MapSurface

class MapSurface @JvmOverloads() constructor(context: Context, surface: Surface, mapInitOptions: MapInitOptions) : MapPluginProviderDelegate, MapControllable

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.

Parameters

context

the application context to init the default MapInitOptions

mapInitOptions

the init options to for map

surface

the surface that will display map

Constructors

MapSurface
Link copied to clipboard
fun MapSurface(context: Context, surface: Surface, mapInitOptions: MapInitOptions = MapInitOptions(context))
the application context to init the default MapInitOptions

Functions

addWidget
Link copied to clipboard
open override fun addWidget(widget: Widget)
Add Widget to the map.
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
getMapboxMap
Link copied to clipboard
open override fun getMapboxMap(): MapboxMap
Returns a MapboxMap object that can be used to interact with the map.
getPlugin
Link copied to clipboard
open override fun <T : MapPlugin> getPlugin(id: String): T?
Get the plugin instance.
hashCode
Link copied to clipboard
open fun hashCode(): Int
onDestroy
Link copied to clipboard
open override fun onDestroy()
Called to dispose the renderer
onGenericMotionEvent
Link copied to clipboard
open override fun onGenericMotionEvent(event: MotionEvent): Boolean
Called when a motion event has occurred.
onLowMemory
Link copied to clipboard
open override fun onLowMemory()
Called to reduce memory use
onSizeChanged
Link copied to clipboard
open override fun onSizeChanged(w: Int, h: Int)
Called when the size has changed.
onStart
Link copied to clipboard
open override fun onStart()
Called to resume rendering
onStop
Link copied to clipboard
open override fun onStop()
Called to stop rendering
onTouchEvent
Link copied to clipboard
open override fun onTouchEvent(event: MotionEvent): Boolean
Called when a touch event has occurred.
queueEvent
Link copied to clipboard
open override fun queueEvent(event: Runnable, needRender: Boolean)
Queue a runnable to be executed on the map renderer thread.
removeWidget
Link copied to clipboard
open override fun removeWidget(widget: Widget): <ERROR CLASS>
Remove Widget from the map.
setMaximumFps
Link copied to clipboard
open override fun setMaximumFps(fps: Int)
Called to limit the maximum fps
setOnFpsChangedListener
Link copied to clipboard
open override fun setOnFpsChangedListener(listener: OnFpsChangedListener)
Set OnFpsChangedListener to get map rendering FPS.
snapshot
Link copied to clipboard
open override fun snapshot(): Bitmap?
Called to capture a snapshot synchronously.
open override fun snapshot(listener: MapView.OnSnapshotReady)
Called to capture a snapshot asynchronously.
surfaceChanged
Link copied to clipboard
fun surfaceChanged(width: Int, height: Int)
Called when the surface dimensions have changed.
surfaceCreated
Link copied to clipboard
fun surfaceCreated()
Called when the surface has been created.
surfaceDestroyed
Link copied to clipboard
fun surfaceDestroyed()
Called when the surface
toString
Link copied to clipboard
open fun toString(): String

Properties

surface
Link copied to clipboard
val surface: Surface
the surface that will display map