Marker

Last Updated On 2021-07-16

Version 4MinSDK 7Tutorial Video

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.


Properties

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

  • AnchorHorizontal - it's a horizontal alignment value which is set to 3 by default.
  • AnchorVertical - it's a vertical alignment value which is set to 3 by default.
  • 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.
  • ImageAsset - it's a asset value which is set to blank by default.
  • Latitude - it's a latitude value which is set to 0 by default.
  • Longitude - it's a longitude value which is set to 0 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.

AnchorHorizontal

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.


AnchorVertical

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

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


Draggable

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.


EnableInfobox

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


FillColor

The paint color used to fill in the Marker.


FillOpacity

The opacity of the interior of the map feature.


Height

Specifies the `Marker`'s vertical height, measured in pixels.


HeightPercent

Specifies the `Marker`'s vertical height as a percentage of the [`Screen`'s `Height`](userinterface.html#Screen.Height).


ImageAsset

Specifies the image shown for the `Marker`. If set to the empty string "", then the default marker icon will be used.


Latitude

Sets or gets the latitude of the `Marker`, in degrees, with positive values representing north of the equator and negative values representing south of the equator. To update the `Latitude` and


Longitude

Sets or gets the longitude of the `Marker`, in degrees, with positive values representing east of the prime meridian and negative values representing west of the prime meridian. To update the


StrokeColor

The paint color used to outline the Marker.


StrokeOpacity

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


StrokeWidth

The width of the stroke used to outline the Marker.


Title

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


Type

Returns the type of the feature. For Markers, this returns MapFeature.Marker ("Marker").


Visible

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


Width

Specifies the horizontal width of the `Marker`, measured in pixels.


WidthPercent

Specifies the horizontal width of the `Marker` as a percentage of the [`Screen`'s `Width`](userinterface.html#Screen.Width).



Methods

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

BearingToFeature

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.

BearingToPoint

Returns the bearing from the Marker to the given latitude and longitude, in degrees from due north.

DistanceToFeature

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

DistanceToPoint

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

HideInfobox

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

SetLocation

Set the location of the marker.

ShowInfobox

Show the infobox for the Marker. 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 Marker.

Drag

The user dragged the Marker.

LongClick

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

StartDrag

The user started a drag operation.

StopDrag

The user stopped a drag operation.