Marker¶
Category | Requires | Version |
---|---|---|
Maps | API 21, Android 5.0 Lollipop | 4 |
Overview¶
An icon positioned at a point to indicate information on a map. Markers can be used to provide an info window, custom fill and stroke colors, and custom images to convey information to the user.
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¶
Bearing To Feature¶
Returns: Number
Returns the bearing from the Marker to the given map feature, in degrees from due north. If the centroids parameter is true, the bearing will be to the center of the map feature. Otherwise, the bearing will be computed to the point in the feature nearest the Marker.
Params | |
---|---|
map Feature | Component |
centroids | Boolean |
Bearing To Point¶
Returns: Number
Returns the bearing from the Marker to the given latitude and longitude, in degrees from due north.
Params | |
---|---|
latitude | Number |
longitude | Number |
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 |
Hide Infobox¶
Hide the infobox if it is shown. If the infobox is not visible this function has no effect.
Set Location¶
Set the location of the marker.
Params | |
---|---|
latitude | Number |
longitude | Number |
Show Infobox¶
Show the infobox for the feature. This will show the infobox even if
Properties¶
Anchor Horizontal¶
Number Default: 3 Read Write - Designer Blocks
The horizontal alignment property controls where the Marker's anchor is located relative to its width. The choices are: 1 = left aligned, 3 = horizontally centered, 2 = right aligned.
Anchor Vertical¶
Number Default: 3 Read Write - Designer Blocks
The vertical alignment property controls where the Marker's anchor is located relative to its height. The choices are: 1 = aligned at the top, 2 = vertically centered, 3 = aligned at the bottom.
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.
Height¶
Number Read Write - Blocks
Property for Height
Height Percent¶
Number Write - Blocks
Property for HeightPercent
Image Asset¶
Text Read Write - Designer Blocks
The ImageAsset property is used to provide an alternative image for the Marker.
Latitude¶
Number Default: 0 Read Write - Designer Blocks
Property for Latitude
Longitude¶
Number Default: 0 Read Write - Designer Blocks
Property for Longitude
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
Returns the type of the feature. For Markers, this returns MapFeature.Marker ("Marker").
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.
Width¶
Number Read Write - Blocks
Property for Width
Width Percent¶
Number Write - Blocks
Property for WidthPercent