MTMarker

class MTMarker(val identifier: String = "mark", _coordinates: LngLat) : MTAnnotation

Annotation element that can be added to the map.

Constructors

constructor(coordinates: LngLat, color: Int? = Color.BLUE, icon: Bitmap? = null, draggable: Boolean? = false)
constructor(coordinates: LngLat)
constructor(coordinates: LngLat, icon: Bitmap)
constructor(coordinates: LngLat, icon: Bitmap, popup: MTTextPopup)
constructor(coordinates: LngLat, popup: MTTextPopup)
constructor(identifier: String = "mark", _coordinates: LngLat)

Properties

Anchor used to align the marker relative to its coordinates.

var color: Int?

Color of the marker.

open override val coordinates: LngLat

Position of the marker on the map.

Boolean indicating whether marker is draggable.

var icon: Bitmap?

Custom icon to use for marker.

open override val identifier: String

Pixel offset to apply when positioning the marker relative to its anchor.

Opacity of the marker.

Opacity of the marker when it is covered by another 3D object.

Alignment for marker pitch relative to the map or viewport.

Optional attached popup.

Rotation of the marker in degrees.

Alignment for marker rotation relative to the map or viewport.

Scale of the marker icon.

Enables subpixel positioning for smoother rendering.

Functions

suspend fun getLngLat(): LngLat

Returns the current coordinates of the marker.

suspend fun getOffset(): Double

Returns the offset applied to the marker.

Returns the pitch alignment of the marker.

suspend fun getRotation(): Double

Returns the rotation of the marker in degrees.

Returns the rotation alignment of the marker.

suspend fun isDraggable(): Boolean

Returns boolean indicating whether the marker can be dragged.

open override fun setCoordinates(coordinates: LngLat, mapViewController: MTMapViewController)

Sets coordinates for the marker.

fun setDraggable(draggable: Boolean, mapViewController: MTMapViewController)

Sets draggable flag for the marker.

fun setOffset(offset: Double, mapViewController: MTMapViewController)

Sets pixel offset of the marker.

fun setRotation(rotation: Double, mapViewController: MTMapViewController)

Sets rotation of the marker.

fun setRotationAlignment(rotationAlignment: MTRotationAlignment, mapViewController: MTMapViewController)

Sets rotation alignment of the marker.

fun togglePopup(mapViewController: MTMapViewController)

Toggles popup for marker.