Polygon
Definition
Polygon
encloses an arbitrary 2-dimensional area on a Map
. Polygon
s can be used for drawing a perimeter, such as a campus, city, or country. Polygon
s begin as basic triangles. New vertices can be created by dragging the midpoint of a polygon away from the edge. Clicking on a vertex will remove the vertex, but a minimum of 3 vertices must exist at all times.
Properties
- Description
- Sets or gets the description displayed in the info window. The info window appears when the user taps on the
Polygon
. - Draggable
- Sets or gets whether or not the user can drag a map feature. This feature is accessed by long-pressing and then dragging the
Polygon
to a new location. - EnableInfobox
- Enables or disables the infobox window display when the user taps the
Polygon
. - FillColor
- Sets or gets the color used to fill in the
Polygon
. - FillOpacity
- Sets or gets the opacity of the color used to fill the
Polygon
. A value of 0.0 will be completely invisible and a value of 1.0 will be completely opaque. - HolePoints
- Specifies the points of any holes in the
Polygon
. TheHolePoints
property is a list of lists, with each sublist containing(latitude, longitude)
points representing a hole. - HolePointsFromString
- Specifies holes in a
Polygon
from a GeoJSON string. In contrast toHolePoints
, the longitude of each point comes before the latitude as stated in the GeoJSON specification. - Points
- Specifies the Points used for drawing the
Polygon
. The Points are specified as a list of lists containing latitude and longitude values, such as[[lat1, long1], [lat2, long2], ...]
. - PointsFromString
- Specifies the points for the
Polygon
from a GeoJSON string. UnlikePoints
, this property expects that the longitude comes first in the point rather than the latitude. - StrokeColor
- Sets or gets the color used to outline the
Polygon
. - StrokeOpacity
- Sets or gets the opacity of the outline of the
Polygon
. A value of 0.0 will be invisible and a value of 1.0 will be opaque. - StrokeWidth
- Sets or gets the width of the stroke used to outline the
Polygon
. - Title
- Sets or gets the title displayed in the info window that appears when the user clicks on the map feature.
- Type
- Returns the type of the feature. For polygons, this returns MapFeature.Polygon (“Polygon”).
- Visible
- Specifies whether the
Polygon
should be visible on the screen. Value istrue
if thePolygon
is showing andfalse
if hidden.