MapPolygon class abstract

A visual representation of a polygon on the map.

Can be used to visualize areas of all shapes and sizes.

The geometry to be visualized is represented by an instance of GeoPolygon. To display circular areas (for example, a position accuracy indicator) use a GeoPolygon created from a GeoCircle using GeoPolygon.withGeoCircle.

Note:

  • The polygon shape should not cover more than half of the globe, otherwise unexpected results may occur.
  • Polygons which are self-intersecting are not supported and may lead to render artifacts.
  • The inner boundaries (holes) specified in the GeoPolygon are ignored.

Constructors

MapPolygon(GeoPolygon geometry, Color color)
Creates a new MapPolygon instance with outline visualization disabled and containing the geometry passed in.
factory
MapPolygon.withOutlineColorAndOutlineWidthInPixels(GeoPolygon geometry, Color color, Color outlineColor, double outlineWidthInPixels)
Creates a new MapPolygon instance with outline visualization enabled and containing the geometry passed in.
factory

Properties

drawOrder ↔ int
The draw order of this map polygon relative to other map polygons. Gets the draw order of this map polygon relative to other map polygons. Default value is 0.
getter/setter pair
fillColor ↔ Color
Color of the polygon's fill. Gets the current color of the fill.
getter/setter pair
geometry GeoPolygon
The geometry of the polygon. Setting a new geometry will update the appearance. Gets the current geometry of the polygon.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
metadata Metadata?
The Metadata instance attached to this polygon, null by default. Gets the Metadata instance attached to this polygon.
getter/setter pair
outlineColor ↔ Color
The color of the polygon outline. Gets the color of the polygon outline. The default outline color is opaque white.
getter/setter pair
outlineWidth ↔ double
The width of the polygon outline in pixels. Gets the outline width of the polygon in pixels.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
visibilityRanges ↔ List<MapMeasureRange>
The list of visibility ranges. The map polygon is visible only inside these map measure ranges. Gets the list of visibility ranges. The map polygon is visible only inside these map measure ranges. When empty (the default), the map polygon is visible without map measure restrictions.
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