Specifying graphic geometry
Graphics will almost always have a geometry component which is necessary for placement on the map. These geometry objects can be Point
, Multipoint
, Polyline
, Polygon
, or Extent
and can be either created programmatically, or returned as the output from a task, such as a query.
Before creating any of these geometry types the required esri/geometry
resource needs to be imported. The geometry resource contains classes for Geometry
, Point
, Multipoint
, Polyline
, Polygon
, and Extent
.
Geometry
is the base class which is inherited by Point
, MultiPoint
, Polyline
, Polygon
, and Extent
.
The following example shows how you can create a Point
object:
new Point(-118.15, 33.80);
The Point
class defines a location by an x and y coordinate, and can be in either map units or screen units.