Package com.mapbox.maps

Types

MapboxAnnotationException
Link copied to clipboard
class MapboxAnnotationException(exceptionText: String?) : RuntimeException

Mapbox exception class flagging annotation plugin related RuntimeException did occur.

MapboxCameraAnimationException
Link copied to clipboard
class MapboxCameraAnimationException(exceptionText: String?) : RuntimeException

Mapbox exception class flagging camera animation plugin related RuntimeException did occur.

class MapboxConcurrentGeometryModificationException(exceptionText: String, sourceId: String) : ConcurrentModificationException

Mapbox exception thrown when any collection used to build GeoJson data is mutated.

MapboxConfigurationException
Link copied to clipboard
class MapboxConfigurationException : RuntimeException

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

MapboxExperimental
Link copied to clipboard
annotation class MapboxExperimental

Annotation class to mark API as experimental.

MapboxLifecycleObserver
Link copied to clipboard
interface MapboxLifecycleObserver

MapboxLifecycleObserver interface defines the lifecycle events that needed by MapView.

MapboxLocationComponentException
Link copied to clipboard
class MapboxLocationComponentException(exceptionText: String?) : RuntimeException

Mapbox exception class flagging location component plugin related RuntimeException did occur.

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.

MapboxMapException
Link copied to clipboard
class MapboxMapException(exceptionText: String?) : RuntimeException

Mapbox exception class flagging map related RuntimeException did occur.

MapboxStyleException
Link copied to clipboard
class MapboxStyleException(exceptionText: String?) : RuntimeException

Mapbox exception class flagging style extension related RuntimeException did occur.

MapboxViewAnnotationException
Link copied to clipboard
class MapboxViewAnnotationException(exceptionText: String?) : RuntimeException

Mapbox exception class flagging view annotation related RuntimeException did occur.

MapControllable
Link copied to clipboard
interface MapControllable : MapboxLifecycleObserver

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

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

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.

MapSurface
Link copied to clipboard
class MapSurface : 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.

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

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.

ResourceOptionsManager
Link copied to clipboard
data class ResourceOptionsManager(resourceOptions: ResourceOptions)

Convenience class that manages a global ResourceOptions It's possible to create ResourceOptionsManager instances as you need them, however it's convenient to use the default object (default).

SnapshotCreatedListener
Link copied to clipboard
fun interface SnapshotCreatedListener

Interface for getting snapshot when it's finished.

SnapshotOverlayOptions
Link copied to clipboard
data class SnapshotOverlayOptions @JvmOverloads constructor(showLogo: Boolean, showAttributes: Boolean)

Data class to config the overlays on the snapshotter

SnapshotStyleListener
Link copied to clipboard
interface SnapshotStyleListener

Interface for getting all style related events for snapshotter.

Snapshotter
Link copied to clipboard
open class Snapshotter

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

Style
Link copied to clipboard
class Style : StyleInterface

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 getStyle(onStyleLoaded) method on MapboxMap.

Functions

applyDefaultParams
Link copied to clipboard
fun MapOptions.Builder.applyDefaultParams(context: Context): MapOptions.Builder

Get a default MapOptions.Builder with reasterization mode GlyphsRasterizationMode#ALL_GLYPHS_RASTERIZED_LOCALLY

fun ResourceOptions.Builder.applyDefaultParams(context: Context): ResourceOptions.Builder

Get a default ResourceOptions.Builder with Mapbox pre-defined options, and with the access token taken from the Android resources(if available).

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

Extension function to obtain Bitmap from snapshotter converted from Image.

logD
Link copied to clipboard
fun logD(tag: String, message: String)

Log Android debug entry in the following format: D/Mapbox: [SDK_IDENTIFIER]\ [tag]

logE
Link copied to clipboard
fun logE(tag: String, message: String)

Log Android error entry in the following format: E/Mapbox: [SDK_IDENTIFIER]\ [tag]

logI
Link copied to clipboard
fun logI(tag: String, message: String)

Log Android info entry in the following format: I/Mapbox: [SDK_IDENTIFIER]\ [tag]

logW
Link copied to clipboard
fun logW(tag: String, message: String)

Log Android warning entry in the following format: W/Mapbox: [SDK_IDENTIFIER]\ [tag]

setDisabled
Link copied to clipboard
fun RenderCacheOptions.Builder.setDisabled(): RenderCacheOptions.Builder

Set render cache size to 0MB in order to disable it.

setLargeSize
Link copied to clipboard
fun RenderCacheOptions.Builder.setLargeSize(): RenderCacheOptions.Builder

Set render cache size to large(128MB).

setSmallSize
Link copied to clipboard
fun RenderCacheOptions.Builder.setSmallSize(): RenderCacheOptions.Builder

Set render cache size to small(64MB).

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

Extension function to convert CameraState to CameraOptions.

Properties

MAPBOX_ACCESS_TOKEN_RESOURCE_NAME
Link copied to clipboard
const val MAPBOX_ACCESS_TOKEN_RESOURCE_NAME: String

Resource name used to lookup the Mapbox access token.

MAPBOX_LOCALE
Link copied to clipboard
val MAPBOX_LOCALE: Locale

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