MTTextPopup

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

Constructors

constructor(coordinates: LngLat, text: String)
constructor(coordinates: LngLat, text: String, offset: Double)
constructor(coordinates: LngLat, text: String, offset: Double, maxWidth: Int?)
constructor(identifier: String = "mark", _coordinates: LngLat)

Properties

open override val coordinates: LngLat

Position of the popup on the map.

open override val identifier: String

Boolean indicating whether the popup is currently displayed on the map.

Max width of the popup container in pixels.

The pixel distance from the popup's coordinates.

Enables subpixel positioning for the popup.

Text content of the popup.

Functions

fun close(mapViewController: MTMapViewController)

Closes the popup on the map.

suspend fun getLngLat(): LngLat

Returns the current coordinates of the popup.

fun open(mapViewController: MTMapViewController)

Opens the popup on the map.

suspend fun refreshIsOpen(): Boolean

Refreshes the open state of the popup from the map.

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

Sets coordinates for the popup.

fun setLngLat(lngLat: LngLat, mapViewController: MTMapViewController)

Sets the geographical location of the popup.

fun setMaxWidth(maxWidth: Int, mapViewController: MTMapViewController)

Sets the max width for the popup and updates it on the map.

fun setOffset(offset: Double?, mapViewController: MTMapViewController)

Sets the popup's pixel offset from its anchor.

fun setSubpixelPositioning(subpixelPositioning: Boolean, mapViewController: MTMapViewController)

Enables or disables subpixel positioning on the popup.

fun setText(text: String, mapViewController: MTMapViewController)

Sets the popup text content and updates it on the map.

fun trackPointer(mapViewController: MTMapViewController)

Tracks the popup anchor to the pointer position.