Graphic class final

A type of GeoElement that has a shape (geometry), symbol, and attributes and can be displayed in a map view or scene view.

Graphics are used to represent temporary data that exists for the lifetime of the application. For example, you can:

  • Show updated locations for objects in the map view, such as moving vehicles.
  • Display results from an analysis, geocoding, or routing operation.
  • Allow the user to draw temporary sketches on top of the map.
  • Store user input, such as a set of route stops to visit.
  • Show ad hoc text labels to describe things on the map.

To display a graphic, add it to a GraphicsOverlay.graphics collection and add the graphics overlay to your map view or scene view.

Each graphic has a geometry describing its location and shape. To maximize performance, the geometry should have the same SpatialReference as the map view or scene view to which it is added. If the geometry has a different SpatialReference, it will be reprojected on-the-fly. This can be computationally expensive when displaying a large number of graphics.

A graphic can have an associated ArcGISSymbol that defines the graphic's appearance. Alternatively, the GraphicsOverlay can be assigned a Renderer that determines the appearance of all graphics in the overlay. If a graphic has an associated symbol, the symbol will override the overlay's renderer for the graphic's display. The symbol used depends on the geometry type associated with the graphic. A MarkerSymbol is used for ArcGISPoint and Multipoint geometries, a SimpleLineSymbol for Polyline geometries, and a SimpleFillSymbol for Polygon or Envelope geometries.

You can select or deselect graphics (Graphic.isSelected), change the visibility of a graphic (Graphic.isVisible), and manage the order in which they are displayed (Graphic.zIndex).

Each graphic can have a collection of attributes (as key-value pairs) to provide more information.

Implemented types

Constructors

Graphic({Geometry? geometry, Map<String, dynamic> attributes = const {}, ArcGISSymbol? symbol})
Creates a graphic with the given geometry, attributes, and symbol.
factory

Properties

attributes Map<String, dynamic>
The attributes of the GeoElement as a collection of name/value pairs.
no setteroverride
geometry Geometry?
The geometry defines the shape and location of the GeoElement.
getter/setter pairoverride
graphicsOverlay GraphicsOverlay?
The graphics overlay the graphic is contained in. If the graphic is not contained in an overlay then null is returned.
no setter
hashCode int
The hash code for this object.
no setterinherited
isSelected bool
True if the graphic is selected, false otherwise.
getter/setter pair
isVisible bool
True if the graphic is visible, false otherwise.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
symbol ArcGISSymbol?
Defines the graphic's appearance when displayed in a map view or scene view.
getter/setter pair
zIndex int
Defines the draw order of a graphic. Graphics with higher Z-index values are drawn on top of lower Z-index graphics.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited