MapSurface

A MapSurface provides an embeddable map interface. You use this class to display map information and to manipulate the map contents from your application. You can center the map on a given coordinate, specify the size of the area you want to display, and style the features of the map to fit your application's use case.

Use of MapSurface requires a Mapbox API access token. Obtain an access token on the Mapbox account page.

<strong>Warning:</strong> Please note that you are responsible for getting permission to use the map data, and for ensuring your use adheres to the relevant terms of use.

class MapSurface : MapPluginProviderDelegate, MapControllable

Constructors

MapSurface
Link copied to clipboard
fun MapSurface(context: Context, surface: Surface, mapObserver: MapObserver)
MapSurface
Link copied to clipboard
fun MapSurface(mapboxMapOptions: MapboxMapOptions, surface: Surface, mapObserver: MapObserver)

Functions

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
getMapboxMap
Link copied to clipboard

Returns a MapboxMap object that can be used to interact with the map.

open override fun getMapboxMap(): MapboxMap
getPlugin
Link copied to clipboard

Get the plugin instance.

open override fun <T> getPlugin(clazz: Class<T>): T?

Get the plugin instance

open override fun <T> getPlugin(className: String): T?
hashCode
Link copied to clipboard
open override fun hashCode(): Int
onDestroy
Link copied to clipboard

Called to dispose the renderer

open override fun onDestroy()
onGenericMotionEvent
Link copied to clipboard

Called when a motion event has occurred.

open override fun onGenericMotionEvent(event: MotionEvent): Boolean
onSizeChanged
Link copied to clipboard

Called when the size has changed.

open override fun onSizeChanged(w: Int, h: Int)
onStart
Link copied to clipboard

Called to resume rendering

open override fun onStart()
onStop
Link copied to clipboard

Called to stop rendering

open override fun onStop()
onTouchEvent
Link copied to clipboard

Called when a touch event has occurred.

open override fun onTouchEvent(event: MotionEvent): Boolean
queueEvent
Link copied to clipboard

Called to queue an event on the render thread.

open override fun queueEvent(runnable: Runnable)
setMaximumFps
Link copied to clipboard

Called to limit the maximum fps

open override fun setMaximumFps(fps: Int)
snapshot
Link copied to clipboard

Called to capture a snapshot synchronously.

open override fun snapshot(): Bitmap?

Called to capture a snapshot asynchronously.

open override fun snapshot(listener: MapView.OnSnapshotReady)
surfaceChanged
Link copied to clipboard

Called when the surface dimensions have changed.

fun surfaceChanged(width: Int, height: Int)
surfaceCreated
Link copied to clipboard

Called when the surface has been created.

fun surfaceCreated()
surfaceDestroyed
Link copied to clipboard

Called when the surface

fun surfaceDestroyed()
toString
Link copied to clipboard
open override fun toString(): String