Marker

class Marker @JvmOverloads constructor(position: LatLng, icon: Icon, label: String? = null, isVisible: Boolean = true)

Marker class to quickly put an icon on a MapView.

To be used with MapView.addMarker.

Property writes after remove are silent no-ops; readers always see the last value before removal.

Constructors

Link copied to clipboard
constructor(position: LatLng, icon: Icon, label: String? = null, isVisible: Boolean = true)

Properties

Link copied to clipboard

Opacity of the marker icon. Values are clamped to 0f..1f. Default 1f.

Link copied to clipboard

Accessibility description for the marker. Default null. Cleared by remove.

Link copied to clipboard

If true the marker is rendered flat against the map: rotation tracks the map bearing and the icon tilts with the camera. If false (default) the marker is screen-aligned.

Link copied to clipboard
var icon: Icon

The icon of the marker.

Link copied to clipboard
val id: String

Stable, opaque identifier for this marker. Generated at construction.

Link copied to clipboard

true once remove has been called. After this, every property setter is a silent no-op and listener callbacks have been cleared.

Link copied to clipboard

Toggle this marker visibility.

Link copied to clipboard

A label to be associated with this marker.

Link copied to clipboard

The position of the marker.

Link copied to clipboard

Rotation of the icon in degrees clockwise. Default 0f.

Link copied to clipboard
var tag: Any?

Free-form payload attached to this marker by the host app. Default null.

Link copied to clipboard

Stacking order key. Higher values draw on top of lower ones. Default 0f.

Functions

Link copied to clipboard

Add a listener to be notified when this marker is clicked.

Link copied to clipboard

Add a listener that will be notified if any rendered property of this marker changes (tag and contentDescription do not trigger this callback).

Link copied to clipboard
fun remove()

Detach the marker from its MapView, clear its listeners and lock it.

Link copied to clipboard

Remove a listener that was notified when this marker was clicked.

Link copied to clipboard

Remove a listener that was notified on properties change.