MTMapViewController

class MTMapViewController(context: Context) : WebViewExecutorDelegate, EventProcessorDelegate, MTJavascriptDelegate, MTZoomable, MTNavigable

Object exposing methods and properties that enable changes to the map, and events that can be interacted with.

Constructors

constructor(context: Context)

Properties

Delegate object responsible for event propagation

Service responsible for gestures handling

Current options of the map object.

Proxy style object of the map.

Functions

Registers a content delegate that observes map events without replacing the primary delegate.

open override fun easeTo(cameraOptions: MTCameraOptions)

Changes any combination of center, zoom, bearing and pitch with an animated transition between old and new values.

open override fun flyTo(cameraOptions: MTCameraOptions, flyToOptions: MTFlyToOptions?)

Changes any combination of center, zoom, bearing, and pitch, animating the transition along a curve that evokes flight.

open suspend override fun getBearing(): Double

Returns the map's current bearing.

open suspend override fun getCenter(): LngLat

Returns the map's current center.

open suspend override fun getRoll(): Double

Returns the map's current roll.

open suspend override fun getZoom(): Double

Returns the map's current zoom level.

open override fun jumpTo(cameraOptions: MTCameraOptions)

Changes any combination of center, zoom, bearing, and pitch, without an animated transition

open override fun onError(message: String)

Map error handler.

open override fun onEvent(event: MTEvent, data: MTData?)
open override fun onEventTriggered(processor: EventProcessor, event: MTEvent, data: MTData?)
open override fun onWebGLContextLost()

WebGL Context error handler

open override fun panBy(offset: MTPoint)

Pans the map by the specified offset.

open override fun panTo(coordinates: LngLat)

Pans the map to the specified location with an animated transition.

open suspend override fun project(coordinates: LngLat): MTPoint

Project coordinates to point on the container.

fun reload()

Unregisters a previously registered content delegate.

open override fun setBearing(bearing: Double)

Sets bearing of the map.

open override fun setCenter(center: LngLat)

Sets the geographical center of the map.

open override fun setCenterElevation(elevation: Double)

Sets the elevation of the map's center point, in meters above sea level.

open override fun setIsCenterClampedToGround(isCenterClampedToGround: Boolean)

Sets the center clamped to the ground.

open override fun setMaxZoom(maxZoom: Double)

Sets the map's maximum zoom.

open override fun setMinZoom(minZoom: Double)

Sets the map's minimum zoom.

open override fun setPadding(padding: MTPaddingOptions)

Sets the padding in pixels around the viewport.

open override fun setRoll(roll: Double)

Sets the map's roll angle.

open override fun setZoom(zoom: Double)

Sets the map's zoom level.

open override fun zoomIn()

Increases the map's zoom level by 1.

open override fun zoomOut()

Decreases the map's zoom level by 1.