Polygon

Last Updated On 2021-07-16

Version 2MinSDK 7Tutorial Video

Polygon


Properties

You can set the below properties in the UI part of the builder.

  • Description - it's a text value which is set to blank by default.
  • Draggable - it's a boolean value which is set to false by default.
  • EnableInfobox - it's a boolean value which is set to false by default.
  • FillColor - it's a color value which is set to &hffff0000 by default.
  • FillOpacity - it's a float value which is set to 1.0 by default.
  • HolePointsFromString - it's a textArea value which is set to blank by default.
  • PointsFromString - it's a textArea value which is set to blank by default.
  • StrokeColor - it's a color value which is set to &hff000000 by default.
  • StrokeOpacity - it's a float value which is set to 1.0 by default.
  • StrokeWidth - it's a integer value which is set to 1 by default.
  • Title - it's a text value which is set to blank by default.
  • Visible - it's a visibility value which is set to true by default.

Block Properties

You can set the below blocks properties in the blocks section of the builder.

Description

The description displayed in the info window that appears when the user clicks on the Polygon.


Draggable

The Draggable property is used to set whether or not the user can drag the Polygon by long-pressing and then dragging the Polygon to a new location.


EnableInfobox

Enable or disable the infobox window display when the user taps the Polygon.


FillColor

The paint color used to fill in the Polygon.


FillOpacity

The opacity of the interior of the map feature.


HolePoints

Specifies the points of any holes in the `Polygon`. The `HolePoints` property is a list of lists, with each sublist containing `(latitude, longitude)` points representing a hole.


HolePointsFromString

Constructs holes in a polygon from a given list of coordinates per hole.


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

Constructs a polygon from the given list of coordinates.


StrokeColor

The paint color used to outline the Polygon.


StrokeOpacity

The opacity of the stroke used to outline the map feature.


StrokeWidth

The width of the stroke used to outline the Polygon.


Title

The title displayed in the info window that appears when the user clicks on the Polygon.


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 is true if the component is showing and false if hidden.



Methods

You can set the below method blocks in the blocks section of the builder.

Centroid

Returns the centroid of the Polygon as a (latitude, longitude) pair.

DistanceToFeature

Compute the distance, in meters, between two map features.

DistanceToPoint

Compute the distance, in meters, between a Polygon and a latitude, longitude point.

HideInfobox

Hide the infobox if it is shown. If the infobox is not visible this function has no effect.

ShowInfobox

Show the infobox for the Polygon. This will show the infobox even if EnableInfobox is set to false.


Events

You can set the below event blocks in the blocks section of the builder.

Click

The user clicked on the Polygon.

Drag

The user dragged the Polygon.

LongClick

The user long-pressed on the Polygon. This event will only trigger if Draggable is false.

StartDrag

The user started a drag operation.

StopDrag

The user stopped a drag operation.