Package com.mapbox.maps

Types

CredentialsManager
Link copied to clipboard

Convenience class that holds MapboxMap related token. CredentialsManager could be created per MapView instance if given view should use some specific token. Most common use-case when all MapViews should use same token could be handled by using CredentialsManager.shared static object.

data class CredentialsManager(accessToken: String?)
MapAttributeParser
Link copied to clipboard

Utility class for parsing AttributeSet to MapSettings.

object MapAttributeParser
MapboxConfigurationException
Link copied to clipboard

A MapboxConfigurationException is thrown by MapboxMap when the SDK hasn't been properly initialised.

class MapboxConfigurationException : RuntimeException
MapboxExperimental
Link copied to clipboard

Annotation class to mark API as experimental.

annotation class MapboxExperimental
MapboxMap
Link copied to clipboard

The general class to interact with in the Mapbox Maps SDK for Android. It exposes the entry point for all methods related to the Map object. You cannot instantiate MapboxMap object directly, rather, you must obtain one from the getMapboxMap() method MapView that you have added to your application.

Note: Similar to a View object, a MapboxMap should only be read and modified from the main thread.

MapControllable
Link copied to clipboard

MapControllable interface is the gateway for public API to talk to the internal map controller.

interface MapControllable
MapInitOptions
Link copied to clipboard

Defines configuration MapInitOptions for a MapboxMap. These options can be used when adding a map to your application programmatically (as opposed to via XML). If you are using a MapFragment, you can pass these options in using the static factory method newInstance(MapboxMapOptions). If you are using a MapView, you can pass these options in using the constructor MapView(Context, MapboxMapOptions). If you add a map using XML, then you can apply these options using custom XML tags.

data class MapInitOptions(context: Context, resourceOptions: ResourceOptions, mapOptions: MapOptions, plugins: List<String>, cameraOptions: CameraOptions?, textureView: Boolean, styleUri: String?, attrs: AttributeSet?)
MapSurface
Link copied to clipboard

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(context: Context, surface: Surface, mapInitOptions: MapInitOptions) : MapPluginProviderDelegate, MapControllable
MapView
Link copied to clipboard

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.

<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.

open class MapView : FrameLayout, MapPluginProviderDelegate, MapControllable
SnapshotCreatedListener
Link copied to clipboard

Interface for getting snapshot when it's finished.

fun fun interface SnapshotCreatedListener
SnapshotStyleListener
Link copied to clipboard

Interface for getting all style related events for snapshotter.

interface SnapshotStyleListener
Snapshotter
Link copied to clipboard

Snapshotter is high-level component responsible for taking map snapshot with given MapSnapshotOptions.

open class Snapshotter
Style
Link copied to clipboard

The general class to interact with Styles in the Modular Mapbox Maps SDK for Android. It exposes the entry point for all methods related to the Style. You cannot instantiate Style object directly, rather, you must obtain one from the getStyleAsync() method on MapboxMap.

Note: Similar to a View object, a Style should only be read and modified from the main thread.

class Style : StyleInterface

Functions

bitmap
Link copied to clipboard

Extension function to obtain Bitmap from snapshotter converted from Image.

fun MapSnapshotInterface.bitmap(): Bitmap
equalsWithDelta
Link copied to clipboard

Extension function to compare two double with delta.

fun Double.equalsWithDelta(other: Double, delta: Double): Boolean
roughlyEquals
Link copied to clipboard

Extension function to compare two double with default delta of 1E-5.

fun Double.roughlyEquals(other: Double): Boolean
toCameraOptions
Link copied to clipboard

Extension function to convert CameraState to CameraOptions.

fun CameraState.toCameraOptions(anchor: ScreenCoordinate?): CameraOptions
toJson
Link copied to clipboard

Extension function to compare two double with default delta of 1E-5.

fun Value.toJson(): String

Properties

DATABASE_NAME
Link copied to clipboard

Name of the database file.

const val DATABASE_NAME: String
MAPBOX_ACCESS_TOKEN_RESOURCE_NAME
Link copied to clipboard

Resource name used to lookup the Mapbox access token.

const val MAPBOX_ACCESS_TOKEN_RESOURCE_NAME: String
MAPBOX_LOCALE
Link copied to clipboard

Default Locale for data processing (ex: String.toLowerCase(com.mapbox.maps.getMAPBOX_LOCALE, "foo"))

val MAPBOX_LOCALE: Locale