Map View
A MapView 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 MapView requires a Mapbox API access token. Obtain an access token on the Mapbox account page.
Warning: 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.
Constructors
Build a MapView with Context and MapInitOptions objects.
Build a MapView with Context and AttributeSet objects.
Build a MapView with a Context object, a AttributeSet object, and an Int which represents a style resource file.
Types
Functions
Add an instance of RendererSetupErrorListener.
Add Widget to the map.
Create a new plugin instance that will be added to the map. Only one instance of Plugin.instance with given Plugin.id can exist for given MapView.
Returns a MapboxMap object that can be used to interact with the map.
Called when a generic motion event has occurred.
Called whenever a touch event is detected on the surface of a ViewGroup, including on the surface of its children
You must call this method from the parent's Activity#onLowMemory() or Fragment#onLowMemory()
Called when the size of the MapView has changed
Called when the size of the MapView has changed.
Called when a touch event has occurred.
Queue a runnable to be executed on the map renderer thread. Consecutive events will be called in the order they were queued.
Remove the plugin instance that will be removed from the map.
Remove an instance of RendererSetupErrorListener.
Remove Widget from the map.
Set new maximum FPS for map rendering.
Set OnFpsChangedListener to get map rendering FPS.
Set whether legacy mode should be used for snapshot.
Perform snapshot of current MapView state. This method is synchronous so it blocks calling thread until Bitmap is ready.
Perform snapshot of current MapView state with notifying listener about it. This method is asynchronous so it does not block calling thread. Consecutive requests will return snapshots in the order they were added.
Properties
Extensions
Extension val for MapView to get the Annotation plugin instance.
Extension val for MapView to get the Compass View plugin instance.
Extension val for MapView to get the Camera Animations plugin instance.
Extension val for MapView to get the Compass View plugin instance.
Extension val for MapView to get the Gestures plugin instance.
Extension function for MapView to get the lifecycle plugin instance.
Extension val to get the LocationComponentPlugin instance.
Extension val for MapView to get the Logo View plugin instance.
Extension val for MapView to get the map overlay plugin instance.
Extension val for MapView to get the ScaleBar plugin instance.