Polygon

Category Requires Version
Maps API 19, Android 4.4 - 4.4.4 KitKat 2

Overview

A visible component that draws arbitrary shapes on a Map component. Vertices of a Polygon can be moved by clicking and dragging on them.

Events

Click

The user clicked on the feature.

Drag

The user dragged the map feature.

Long Click

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

Start Drag

The user started a drag operation.

Stop Drag

The user stopped a drag operation.

Methods

Centroid

Returns: List

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

Distance To Feature

Returns: Number

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

Params
map Feature Component
centroids Boolean

Distance To Point

Returns: Number

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

Params
latitude Number
longitude Number
centroid Boolean

Hide Infobox

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

Show Infobox

Show the infobox for the feature. This will show the infobox even if

Properties

Description

Text ➖ Read Write - Designer Blocks

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

Draggable

Boolean Default: False ➖ Read Write - Designer Blocks

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

Enable Infobox

Boolean Default: False ➖ Read Write - Designer Blocks

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

Fill Color

Color Default: #F34336FF  ➖ Read Write - Designer Blocks

The paint color used to fill in the map feature.

Fill Opacity

Number Default: 1.0 ➖ Read Write - Designer Blocks

The opacity of the interior of the map feature.

Hole Points

List ➖ Read Write - Blocks

Hole Points From String

Text ➖ Write - Designer Blocks

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

Points

List ➖ Read Write - Blocks

Gets or sets the sequence of points used to draw the polygon.

Points From String

Text ➖ Write - Designer Blocks

Constructs a polygon from the given list of coordinates.

Stroke Color

Color Default: #000000FF  ➖ Read Write - Designer Blocks

The paint color used to outline the map feature.

Stroke Opacity

Number Default: 1.0 ➖ Read Write - Designer Blocks

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

Stroke Width

Number Default: 1 ➖ Read Write - Designer Blocks

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

Title

Text ➖ Read Write - Designer Blocks

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

Type

Text ➖ Read - Blocks

The type of the feature. For polygons, this returns the text "Polygon".

Visible

Boolean Default: True ➖ Read Write - Designer Blocks

Specifies whether the component should be visible on the screen. Value is true if the component is showing and false if hidden.


Last update: January 27, 2020