Package com.mapbox.mapboxsdk.maps

Contains the Mapbox Maps Android Maps API classes.

Types

Name Summary
AnnotationContainer
open class AnnotationContainer : Annotations
Encapsulates Annotation’s functionality..
AnnotationManager
open class AnnotationManager
Responsible for managing and tracking state of Annotations linked to Map.
Annotations
interface Annotations
Interface that defines convenient methods for working with a Annotation’s collection.
AttributionDialogManager
open class AttributionDialogManager : View.OnClickListener, DialogInterface.OnClickListener
Responsible for managing attribution interactions on the map.
CameraChangeDispatcher
open class CameraChangeDispatcher : MapboxMap.OnCameraMoveStartedListener, MapboxMap.OnCameraMoveListener, MapboxMap.OnCameraMoveCanceledListener, MapboxMap.OnCameraIdleListener
Class responsible for dispatching camera change events to registered listeners.
FocalPointChangeListener
interface FocalPointChangeListener
Interface definition of a callback that is invoked when the focal point will change.
IconManager
open class IconManager
Responsible for managing icons added to the Map.
Image
open class Image
ImageContent
class ImageContent
Describes the image content, e.g.
ImageStretches
class ImageStretches
Describes the image stretch areas.
InfoWindowManager
open class InfoWindowManager
Responsible for managing InfoWindows shown on the Map.
MapboxMap
@UiThread()
class MapboxMap
The general class to interact with in the Android Mapbox SDK.
MapboxMapOptions
open class MapboxMapOptions : Parcelable
Defines configuration MapboxMapMapOptions for a MapboxMap.
MapChangeReceiver
open class MapChangeReceiver : NativeMapView.StateCallback
MapFragment
class MapFragment : Fragment, OnMapReadyCallback
Fragment wrapper around a map view.
MapGestureDetector
class MapGestureDetector
Manages gestures events on a MapView.
MapKeyListener
class MapKeyListener
Manages key events on a MapView.
MapView
open class MapView : FrameLayout, NativeMapView.ViewCallback
A {@code MapView} provides an embeddable map interface.
MarkerContainer
open class MarkerContainer : Markers
Encapsulates Marker’s functionality.
Markers
interface Markers
Interface that defines convenient methods for working with a Marker’s collection.
NativeMap
interface NativeMap
NativeMapView
class NativeMapView : NativeMap
OnMapReadyCallback
interface OnMapReadyCallback
Interface definition for a callback to be invoked when the map is ready to be used.
PolygonContainer
open class PolygonContainer : Polygons
Encapsulates Polygon’s functionality.
Polygons
interface Polygons
Interface that defines convenient methods for working with a Polygon’s collection.
PolylineContainer
open class PolylineContainer : Polylines
Encapsulates Polyline’s functionality.
Polylines
interface Polylines
Interface that defines convenient methods for working with a Polyline’s collection.
Projection
open class Projection
A projection is used to translate between on screen location and geographic coordinates on the surface of the Earth.
ShapeAnnotationContainer
open class ShapeAnnotationContainer : ShapeAnnotations
ShapeAnnotations
interface ShapeAnnotations
Style
open class Style
The proxy object for current map style.
SupportMapFragment
open class SupportMapFragment : Fragment, OnMapReadyCallback
Support Fragment wrapper around a map view.
Transform
class Transform : MapView.OnCameraDidChangeListener
Internal use.
UiSettings
class UiSettings
Settings for the user interface of a MapboxMap.

AnnotationContainer

open class AnnotationContainer : Annotations

Encapsulates Annotation’s functionality..

Constructors

Name Summary
AnnotationContainer open fun AnnotationContainer(nativeMap: NativeMap, annotations: LongSparseArray)

Functions

Name Summary
obtainAll
@NonNull()
open fun obtainAll(): List
obtainBy
open fun obtainBy(id: Long): Annotation
removeAll
open fun removeAll()
removeBy
open fun removeBy(annotation: Annotation)
open fun removeBy(annotationList: List)
open fun [removeBy](#removeby)(id: Long)

obtainAll

@NonNull()

open fun obtainAll(): List

obtainBy

open fun obtainBy(id: Long): Annotation

removeAll

open fun removeAll()

removeBy

open fun removeBy(id: Long)
open fun removeBy(annotation: Annotation)
open fun removeBy(annotationList: List)

AnnotationManager

open class AnnotationManager

Responsible for managing and tracking state of Annotations linked to Map. All events related to annotations that occur on MapboxMap are forwarded to this class.

Responsible for referencing InfoWindowManager.

Exposes convenience methods to add/remove/update all subtypes of annotations found in com.mapbox.mapboxsdk.annotations.

Constructors

Name Summary
AnnotationManager open fun AnnotationManager(mapView: MapView, annotationsArray: LongSparseArray, iconManager: [IconManager](#iconmanager), annotations: [Annotations](#annotations), markers: [Markers](#markers), polygons: [Polygons](#polygons), polylines: [Polylines](#polylines), shapeAnnotations: [ShapeAnnotations](#shapeannotations))

Functions

Name Summary
addMarker
open fun addMarker(markerOptions: BaseMarkerOptions, mapboxMap: MapboxMap): Marker
addMarkers
open fun addMarkers(markerOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List
addPolygon
open fun addPolygon(polygonOptions: PolygonOptions, mapboxMap: MapboxMap): Polygon
addPolygons
open fun addPolygons(polygonOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List
addPolyline
open fun addPolyline(polylineOptions: PolylineOptions, mapboxMap: MapboxMap): Polyline
addPolylines
open fun addPolylines(polylineOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List
adjustTopOffsetPixels
open fun adjustTopOffsetPixels(mapboxMap: MapboxMap)
bind
@NonNull()
open fun bind(mapboxMap: MapboxMap): AnnotationManager
deselectMarker
open fun deselectMarker(marker: Marker)
deselectMarkers
open fun deselectMarkers()
getAnnotation
open fun getAnnotation(id: Long): Annotation
getMarkersInRect
@NonNull()
open fun getMarkersInRect(rectangle: RectF): List
onTap
open fun onTap(tapPoint: PointF): Boolean
reloadMarkers
open fun reloadMarkers()
removeAnnotation
open fun removeAnnotation(annotation: Annotation)
open fun removeAnnotation(id: Long)
removeAnnotations
open fun removeAnnotations()
open fun removeAnnotations(annotationList: List)
selectMarker
open fun selectMarker(marker: Marker)
update
open fun update()
updateMarker
open fun updateMarker(updatedMarker: Marker, mapboxMap: MapboxMap)
updatePolygon
open fun updatePolygon(polygon: Polygon)
updatePolyline
open fun updatePolyline(polyline: Polyline)

Properties

Name Summary
infoWindowManager private val infoWindowManager: InfoWindowManager
onMarkerClickListener @Nullable()
private open var onMarkerClickListener: MapboxMap.OnMarkerClickListener
onPolygonClickListener @Nullable()
private open var onPolygonClickListener: MapboxMap.OnPolygonClickListener
onPolylineClickListener @Nullable()
private open var onPolylineClickListener: MapboxMap.OnPolylineClickListener
selectedMarkers private val selectedMarkers: List

addMarker

open fun addMarker(markerOptions: BaseMarkerOptions, mapboxMap: MapboxMap): Marker

addMarkers

open fun addMarkers(markerOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List

addPolygon

open fun addPolygon(polygonOptions: PolygonOptions, mapboxMap: MapboxMap): Polygon

addPolygons

open fun addPolygons(polygonOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List

addPolyline

open fun addPolyline(polylineOptions: PolylineOptions, mapboxMap: MapboxMap): Polyline

addPolylines

open fun addPolylines(polylineOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List

adjustTopOffsetPixels

open fun adjustTopOffsetPixels(mapboxMap: MapboxMap)

bind

@NonNull()

open fun bind(mapboxMap: MapboxMap): AnnotationManager

deselectMarker

open fun deselectMarker(marker: Marker)

deselectMarkers

open fun deselectMarkers()

getAnnotation

open fun getAnnotation(id: Long): Annotation

getMarkersInRect

@NonNull()

open fun getMarkersInRect(rectangle: RectF): List

infoWindowManager

private val infoWindowManager: InfoWindowManager

onMarkerClickListener

@Nullable()

private open var onMarkerClickListener: MapboxMap.OnMarkerClickListener

onPolygonClickListener

@Nullable()

private open var onPolygonClickListener: MapboxMap.OnPolygonClickListener

onPolylineClickListener

@Nullable()

private open var onPolylineClickListener: MapboxMap.OnPolylineClickListener

onTap

open fun onTap(tapPoint: PointF): Boolean

reloadMarkers

open fun reloadMarkers()

removeAnnotation

open fun removeAnnotation(id: Long)
open fun removeAnnotation(annotation: Annotation)

removeAnnotations

open fun removeAnnotations(annotationList: List) open fun [removeAnnotations](#removeannotations)()

selectMarker

open fun selectMarker(marker: Marker)

selectedMarkers

private val selectedMarkers: List

updateMarker

open fun updateMarker(updatedMarker: Marker, mapboxMap: MapboxMap)

updatePolygon

open fun updatePolygon(polygon: Polygon)

updatePolyline

open fun updatePolyline(polyline: Polyline)

update

open fun update()

Annotations

interface Annotations

Interface that defines convenient methods for working with a Annotation’s collection.

Functions

Name Summary
obtainAll
abstract fun obtainAll(): List
obtainBy
abstract fun obtainBy(id: Long): Annotation
removeAll
abstract fun removeAll()
removeBy
abstract fun removeBy(annotation: Annotation)
abstract fun removeBy(annotationList: List)
abstract fun [removeBy](#removeby)(id: Long)

Inheritors

Name
AnnotationContainer

obtainAll

abstract fun obtainAll(): List

obtainBy

abstract fun obtainBy(id: Long): Annotation

removeAll

abstract fun removeAll()

removeBy

abstract fun removeBy(id: Long)
abstract fun removeBy(annotation: Annotation)
abstract fun removeBy(annotationList: List)

AttributionDialogManager

open class AttributionDialogManager : View.OnClickListener, DialogInterface.OnClickListener

Responsible for managing attribution interactions on the map.

When the user clicks the attribution icon, onClick will be invoked. An attribution dialog will be shown to the user with contents based on the attributions found in the map style.

Constructors

Name Summary
AttributionDialogManager open fun AttributionDialogManager(context: Context, mapboxMap: MapboxMap)

Functions

Name Summary
buildMapFeedbackMapUrl
@NonNull()
open fun buildMapFeedbackMapUrl(accessToken: String): String
onClick
abstract fun onClick(p: View)
open fun onClick(view: View)
open fun onClick(dialog: DialogInterface, which: Int)
onStop
open fun onStop()

buildMapFeedbackMapUrl

@NonNull()

open fun buildMapFeedbackMapUrl(accessToken: String): String

onClick

open fun onClick(view: View)
open fun onClick(dialog: DialogInterface, which: Int)

onStop

open fun onStop()

CameraChangeDispatcher

open class CameraChangeDispatcher : MapboxMap.OnCameraMoveStartedListener, MapboxMap.OnCameraMoveListener, MapboxMap.OnCameraMoveCanceledListener, MapboxMap.OnCameraIdleListener

Class responsible for dispatching camera change events to registered listeners.

Types

Name Summary
CameraChange
@Retention(value = )
annotation class CameraChange

Functions

Name Summary
addOnCameraIdleListener
open fun addOnCameraIdleListener(listener: MapboxMap.OnCameraIdleListener)
addOnCameraMoveCancelListener
open fun addOnCameraMoveCancelListener(listener: MapboxMap.OnCameraMoveCanceledListener)
addOnCameraMoveListener
open fun addOnCameraMoveListener(listener: MapboxMap.OnCameraMoveListener)
addOnCameraMoveStartedListener
open fun addOnCameraMoveStartedListener(listener: MapboxMap.OnCameraMoveStartedListener)
onCameraIdle
open fun onCameraIdle()
Called when camera movement has ended.
onCameraMove
open fun onCameraMove()
Called repeatedly as the camera continues to move after an onCameraMoveStarted call.This may be called as often as once every frame and should not perform expensive operations.
onCameraMoveCanceled
open fun onCameraMoveCanceled()
Called when the developer explicitly calls the cancelTransitions() method or if the reason for camera motion haschanged before the onCameraIdle had a chance to fire after the previous animation.Do not update or animate the camera from within this method.
onCameraMoveStarted
open fun onCameraMoveStarted(reason: Int)
abstract fun onCameraMoveStarted(reason: Int)
Called when the camera starts moving after it has been idle or when the reason for camera motion has changed.
onDestroy
open fun onDestroy()
removeOnCameraIdleListener
open fun removeOnCameraIdleListener(listener: MapboxMap.OnCameraIdleListener)
removeOnCameraMoveCancelListener
open fun removeOnCameraMoveCancelListener(listener: MapboxMap.OnCameraMoveCanceledListener)
removeOnCameraMoveListener
open fun removeOnCameraMoveListener(listener: MapboxMap.OnCameraMoveListener)
removeOnCameraMoveStartedListener
open fun removeOnCameraMoveStartedListener(listener: MapboxMap.OnCameraMoveStartedListener)

addOnCameraIdleListener

open fun addOnCameraIdleListener(listener: MapboxMap.OnCameraIdleListener)

addOnCameraMoveCancelListener

open fun addOnCameraMoveCancelListener(listener: MapboxMap.OnCameraMoveCanceledListener)

addOnCameraMoveListener

open fun addOnCameraMoveListener(listener: MapboxMap.OnCameraMoveListener)

addOnCameraMoveStartedListener

open fun addOnCameraMoveStartedListener(listener: MapboxMap.OnCameraMoveStartedListener)

onCameraIdle

open fun onCameraIdle()

Called when camera movement has ended.

onCameraMoveCanceled

open fun onCameraMoveCanceled()

Called when the developer explicitly calls the cancelTransitions() method or if the reason for camera motion haschanged before the onCameraIdle had a chance to fire after the previous animation.Do not update or animate the camera from within this method.

onCameraMoveStarted

open fun onCameraMoveStarted(reason: Int)

Called when the camera starts moving after it has been idle or when the reason for camera motion has changed.

Parameters
Name Summary
reason
the reason for the camera change
   
   

onCameraMove

open fun onCameraMove()

Called repeatedly as the camera continues to move after an onCameraMoveStarted call.This may be called as often as once every frame and should not perform expensive operations.

onDestroy

open fun onDestroy()

removeOnCameraIdleListener

open fun removeOnCameraIdleListener(listener: MapboxMap.OnCameraIdleListener)

removeOnCameraMoveCancelListener

open fun removeOnCameraMoveCancelListener(listener: MapboxMap.OnCameraMoveCanceledListener)

removeOnCameraMoveListener

open fun removeOnCameraMoveListener(listener: MapboxMap.OnCameraMoveListener)

removeOnCameraMoveStartedListener

open fun removeOnCameraMoveStartedListener(listener: MapboxMap.OnCameraMoveStartedListener)

CameraChange

@Retention(value = )

annotation class CameraChange

Functions

Name Summary
annotationType
abstract fun annotationType(): Class
equals
abstract fun equals(p: Any): Boolean
hashCode
abstract fun hashCode(): Int
toString
abstract fun toString(): String

FocalPointChangeListener

interface FocalPointChangeListener

Interface definition of a callback that is invoked when the focal point will change.

Functions

Name Summary
onFocalPointChanged
abstract fun onFocalPointChanged(pointF: PointF)

onFocalPointChanged

abstract fun onFocalPointChanged(pointF: PointF)

IconManager

open class IconManager

Responsible for managing icons added to the Map.

Maintains a List of Icon and is responsible for initialising default markers.

Keep track of icons added and the resulting average icon size. This is used internally by our gestures detection to calculate the size of a touch target.

Constructors

Name Summary
IconManager open fun IconManager(nativeMap: NativeMap)

Functions

Name Summary
ensureIconLoaded
open fun ensureIconLoaded(marker: Marker, mapboxMap: MapboxMap)
getTopOffsetPixelsForIcon
open fun getTopOffsetPixelsForIcon(icon: Icon): Int
iconCleanup
open fun iconCleanup(icon: Icon)
loadIconForMarker
open fun loadIconForMarker(marker: Marker): Icon
reloadIcons
open fun reloadIcons()

Properties

Name Summary
highestIconHeight private open val highestIconHeight: Int
highestIconWidth private open val highestIconWidth: Int

ensureIconLoaded

open fun ensureIconLoaded(marker: Marker, mapboxMap: MapboxMap)

getTopOffsetPixelsForIcon

open fun getTopOffsetPixelsForIcon(icon: Icon): Int

highestIconHeight

private open val highestIconHeight: Int

highestIconWidth

private open val highestIconWidth: Int

iconCleanup

open fun iconCleanup(icon: Icon)

loadIconForMarker

open fun loadIconForMarker(marker: Marker): Icon

reloadIcons

open fun reloadIcons()

Image

open class Image

Constructors

Name Summary
Image open fun Image(buffer: Array, pixelRatio: Float, name: String, width: Int, height: Int, sdf: Boolean)
Image open fun Image(buffer: Array, pixelRatio: Float, name: String, width: Int, height: Int, sdf: Boolean, stretchX: Array, stretchY: Array, content: Array)

ImageContent

class ImageContent

Describes the image content, e.g. where text can be fit into an image.

When sizing icons with icon-text-fit, the icon size will be adjusted so that the this content box fits exactly around the text.

Constructors

Name Summary
ImageContent open fun ImageContent(left: Float, top: Float, right: Float, bottom: Float)

Functions

Name Summary
equals
open fun equals(obj: Any): Boolean
getContentArray
open fun getContentArray(): Array
Get the array for this content, sorted by left, top, right, bottom.
hashCode
open fun hashCode(): Int
toString
open fun toString(): String

equals

open fun equals(obj: Any): Boolean

getContentArray

open fun getContentArray(): Array

Get the array for this content, sorted by left, top, right, bottom.

Return

the content array.

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

ImageStretches

class ImageStretches

Describes the image stretch areas.

Constructors

Name Summary
ImageStretches open fun ImageStretches(first: Float, second: Float)

Functions

Name Summary
equals
open fun equals(obj: Any): Boolean
hashCode
open fun hashCode(): Int
toString
open fun toString(): String

Properties

Name Summary
first private val first: Float
second private val second: Float

equals

open fun equals(obj: Any): Boolean

first

private val first: Float

hashCode

open fun hashCode(): Int

second

private val second: Float

toString

open fun toString(): String

InfoWindowManager

open class InfoWindowManager

Responsible for managing InfoWindows shown on the Map.

Maintains a List of opened InfoWindow and tracks configurations as allowConcurrentMultipleInfoWindows which allows to have multiple InfoWindow open at the same time. Responsible for managing listeners as com.mapbox.mapboxsdk.maps.MapboxMap.OnInfoWindowClickListener and com.mapbox.mapboxsdk.maps.MapboxMap.OnInfoWindowLongClickListener.

Functions

Name Summary
add
open fun add(infoWindow: InfoWindow)
isAllowConcurrentMultipleOpenInfoWindows
open fun isAllowConcurrentMultipleOpenInfoWindows(): Boolean
isInfoWindowValidForMarker
open fun isInfoWindowValidForMarker(marker: Marker): Boolean
setAllowConcurrentMultipleOpenInfoWindows
open fun setAllowConcurrentMultipleOpenInfoWindows(allow: Boolean)
update
open fun update()

Properties

Name Summary
infoWindowAdapter @Nullable()
private open var infoWindowAdapter: MapboxMap.InfoWindowAdapter
onInfoWindowClickListener @Nullable()
private open var onInfoWindowClickListener: MapboxMap.OnInfoWindowClickListener
onInfoWindowCloseListener @Nullable()
private open var onInfoWindowCloseListener: MapboxMap.OnInfoWindowCloseListener
onInfoWindowLongClickListener @Nullable()
private open var onInfoWindowLongClickListener: MapboxMap.OnInfoWindowLongClickListener

add

open fun add(infoWindow: InfoWindow)

infoWindowAdapter

@Nullable()

private open var infoWindowAdapter: MapboxMap.InfoWindowAdapter

isAllowConcurrentMultipleOpenInfoWindows

open fun isAllowConcurrentMultipleOpenInfoWindows(): Boolean

isInfoWindowValidForMarker

open fun isInfoWindowValidForMarker(marker: Marker): Boolean

onInfoWindowClickListener

@Nullable()

private open var onInfoWindowClickListener: MapboxMap.OnInfoWindowClickListener

onInfoWindowCloseListener

@Nullable()

private open var onInfoWindowCloseListener: MapboxMap.OnInfoWindowCloseListener

onInfoWindowLongClickListener

@Nullable()

private open var onInfoWindowLongClickListener: MapboxMap.OnInfoWindowLongClickListener

setAllowConcurrentMultipleOpenInfoWindows

open fun setAllowConcurrentMultipleOpenInfoWindows(allow: Boolean)

update

open fun update()

MapChangeReceiver

open class MapChangeReceiver : NativeMapView.StateCallback

Functions

Name Summary
addOnCameraDidChangeListener
open fun addOnCameraDidChangeListener(listener: MapView.OnCameraDidChangeListener)
addOnCameraIsChangingListener
open fun addOnCameraIsChangingListener(listener: MapView.OnCameraIsChangingListener)
addOnCameraWillChangeListener
open fun addOnCameraWillChangeListener(listener: MapView.OnCameraWillChangeListener)
addOnCanRemoveUnusedStyleImageListener
open fun addOnCanRemoveUnusedStyleImageListener(listener: MapView.OnCanRemoveUnusedStyleImageListener)
addOnDidBecomeIdleListener
open fun addOnDidBecomeIdleListener(listener: MapView.OnDidBecomeIdleListener)
addOnDidFailLoadingMapListener
open fun addOnDidFailLoadingMapListener(listener: MapView.OnDidFailLoadingMapListener)
addOnDidFinishLoadingMapListener
open fun addOnDidFinishLoadingMapListener(listener: MapView.OnDidFinishLoadingMapListener)
addOnDidFinishLoadingStyleListener
open fun addOnDidFinishLoadingStyleListener(listener: MapView.OnDidFinishLoadingStyleListener)
addOnDidFinishRenderingFrameListener
open fun addOnDidFinishRenderingFrameListener(listener: MapView.OnDidFinishRenderingFrameListener)
addOnDidFinishRenderingMapListener
open fun addOnDidFinishRenderingMapListener(listener: MapView.OnDidFinishRenderingMapListener)
addOnSourceChangedListener
open fun addOnSourceChangedListener(listener: MapView.OnSourceChangedListener)
addOnStyleImageMissingListener
open fun addOnStyleImageMissingListener(listener: MapView.OnStyleImageMissingListener)
addOnWillStartLoadingMapListener
open fun addOnWillStartLoadingMapListener(listener: MapView.OnWillStartLoadingMapListener)
addOnWillStartRenderingFrameListener
open fun addOnWillStartRenderingFrameListener(listener: MapView.OnWillStartRenderingFrameListener)
addOnWillStartRenderingMapListener
open fun addOnWillStartRenderingMapListener(listener: MapView.OnWillStartRenderingMapListener)
clear
open fun clear()
onCameraDidChange
open fun onCameraDidChange(animated: Boolean)
onCameraIsChanging
open fun onCameraIsChanging()
onCameraWillChange
open fun onCameraWillChange(animated: Boolean)
onCanRemoveUnusedStyleImage
open fun onCanRemoveUnusedStyleImage(imageId: String): Boolean
onDidBecomeIdle
open fun onDidBecomeIdle()
onDidFailLoadingMap
open fun onDidFailLoadingMap(error: String)
onDidFinishLoadingMap
open fun onDidFinishLoadingMap()
onDidFinishLoadingStyle
open fun onDidFinishLoadingStyle()
onDidFinishRenderingFrame
open fun onDidFinishRenderingFrame(fully: Boolean)
onDidFinishRenderingMap
open fun onDidFinishRenderingMap(fully: Boolean)
onSourceChanged
open fun onSourceChanged(sourceId: String)
onStyleImageMissing
open fun onStyleImageMissing(imageId: String)
onWillStartLoadingMap
open fun onWillStartLoadingMap()
onWillStartRenderingFrame
open fun onWillStartRenderingFrame()
onWillStartRenderingMap
open fun onWillStartRenderingMap()
removeOnCameraDidChangeListener
open fun removeOnCameraDidChangeListener(listener: MapView.OnCameraDidChangeListener)
removeOnCameraIsChangingListener
open fun removeOnCameraIsChangingListener(listener: MapView.OnCameraIsChangingListener)
removeOnCameraWillChangeListener
open fun removeOnCameraWillChangeListener(listener: MapView.OnCameraWillChangeListener)
removeOnCanRemoveUnusedStyleImageListener
open fun removeOnCanRemoveUnusedStyleImageListener(listener: MapView.OnCanRemoveUnusedStyleImageListener)
removeOnDidBecomeIdleListener
open fun removeOnDidBecomeIdleListener(listener: MapView.OnDidBecomeIdleListener)
removeOnDidFailLoadingMapListener
open fun removeOnDidFailLoadingMapListener(listener: MapView.OnDidFailLoadingMapListener)
removeOnDidFinishLoadingMapListener
open fun removeOnDidFinishLoadingMapListener(listener: MapView.OnDidFinishLoadingMapListener)
removeOnDidFinishLoadingStyleListener
open fun removeOnDidFinishLoadingStyleListener(listener: MapView.OnDidFinishLoadingStyleListener)
removeOnDidFinishRenderingFrameListener
open fun removeOnDidFinishRenderingFrameListener(listener: MapView.OnDidFinishRenderingFrameListener)
removeOnDidFinishRenderingMapListener
open fun removeOnDidFinishRenderingMapListener(listener: MapView.OnDidFinishRenderingMapListener)
removeOnSourceChangedListener
open fun removeOnSourceChangedListener(listener: MapView.OnSourceChangedListener)
removeOnStyleImageMissingListener
open fun removeOnStyleImageMissingListener(listener: MapView.OnStyleImageMissingListener)
removeOnWillStartLoadingMapListener
open fun removeOnWillStartLoadingMapListener(listener: MapView.OnWillStartLoadingMapListener)
removeOnWillStartRenderingFrameListener
open fun removeOnWillStartRenderingFrameListener(listener: MapView.OnWillStartRenderingFrameListener)
removeOnWillStartRenderingMapListener
open fun removeOnWillStartRenderingMapListener(listener: MapView.OnWillStartRenderingMapListener)

addOnCameraDidChangeListener

open fun addOnCameraDidChangeListener(listener: MapView.OnCameraDidChangeListener)

addOnCameraIsChangingListener

open fun addOnCameraIsChangingListener(listener: MapView.OnCameraIsChangingListener)

addOnCameraWillChangeListener

open fun addOnCameraWillChangeListener(listener: MapView.OnCameraWillChangeListener)

addOnCanRemoveUnusedStyleImageListener

open fun addOnCanRemoveUnusedStyleImageListener(listener: MapView.OnCanRemoveUnusedStyleImageListener)

addOnDidBecomeIdleListener

open fun addOnDidBecomeIdleListener(listener: MapView.OnDidBecomeIdleListener)

addOnDidFailLoadingMapListener

open fun addOnDidFailLoadingMapListener(listener: MapView.OnDidFailLoadingMapListener)

addOnDidFinishLoadingMapListener

open fun addOnDidFinishLoadingMapListener(listener: MapView.OnDidFinishLoadingMapListener)

addOnDidFinishLoadingStyleListener

open fun addOnDidFinishLoadingStyleListener(listener: MapView.OnDidFinishLoadingStyleListener)

addOnDidFinishRenderingFrameListener

open fun addOnDidFinishRenderingFrameListener(listener: MapView.OnDidFinishRenderingFrameListener)

addOnDidFinishRenderingMapListener

open fun addOnDidFinishRenderingMapListener(listener: MapView.OnDidFinishRenderingMapListener)

addOnSourceChangedListener

open fun addOnSourceChangedListener(listener: MapView.OnSourceChangedListener)

addOnStyleImageMissingListener

open fun addOnStyleImageMissingListener(listener: MapView.OnStyleImageMissingListener)

addOnWillStartLoadingMapListener

open fun addOnWillStartLoadingMapListener(listener: MapView.OnWillStartLoadingMapListener)

addOnWillStartRenderingFrameListener

open fun addOnWillStartRenderingFrameListener(listener: MapView.OnWillStartRenderingFrameListener)

addOnWillStartRenderingMapListener

open fun addOnWillStartRenderingMapListener(listener: MapView.OnWillStartRenderingMapListener)

clear

open fun clear()

onCameraDidChange

open fun onCameraDidChange(animated: Boolean)

onCameraIsChanging

open fun onCameraIsChanging()

onCameraWillChange

open fun onCameraWillChange(animated: Boolean)

onCanRemoveUnusedStyleImage

open fun onCanRemoveUnusedStyleImage(imageId: String): Boolean

onDidBecomeIdle

open fun onDidBecomeIdle()

onDidFailLoadingMap

open fun onDidFailLoadingMap(error: String)

onDidFinishLoadingMap

open fun onDidFinishLoadingMap()

onDidFinishLoadingStyle

open fun onDidFinishLoadingStyle()

onDidFinishRenderingFrame

open fun onDidFinishRenderingFrame(fully: Boolean)

onDidFinishRenderingMap

open fun onDidFinishRenderingMap(fully: Boolean)

onSourceChanged

open fun onSourceChanged(sourceId: String)

onStyleImageMissing

open fun onStyleImageMissing(imageId: String)

onWillStartLoadingMap

open fun onWillStartLoadingMap()

onWillStartRenderingFrame

open fun onWillStartRenderingFrame()

onWillStartRenderingMap

open fun onWillStartRenderingMap()

removeOnCameraDidChangeListener

open fun removeOnCameraDidChangeListener(listener: MapView.OnCameraDidChangeListener)

removeOnCameraIsChangingListener

open fun removeOnCameraIsChangingListener(listener: MapView.OnCameraIsChangingListener)

removeOnCameraWillChangeListener

open fun removeOnCameraWillChangeListener(listener: MapView.OnCameraWillChangeListener)

removeOnCanRemoveUnusedStyleImageListener

open fun removeOnCanRemoveUnusedStyleImageListener(listener: MapView.OnCanRemoveUnusedStyleImageListener)

removeOnDidBecomeIdleListener

open fun removeOnDidBecomeIdleListener(listener: MapView.OnDidBecomeIdleListener)

removeOnDidFailLoadingMapListener

open fun removeOnDidFailLoadingMapListener(listener: MapView.OnDidFailLoadingMapListener)

removeOnDidFinishLoadingMapListener

open fun removeOnDidFinishLoadingMapListener(listener: MapView.OnDidFinishLoadingMapListener)

removeOnDidFinishLoadingStyleListener

open fun removeOnDidFinishLoadingStyleListener(listener: MapView.OnDidFinishLoadingStyleListener)

removeOnDidFinishRenderingFrameListener

open fun removeOnDidFinishRenderingFrameListener(listener: MapView.OnDidFinishRenderingFrameListener)

removeOnDidFinishRenderingMapListener

open fun removeOnDidFinishRenderingMapListener(listener: MapView.OnDidFinishRenderingMapListener)

removeOnSourceChangedListener

open fun removeOnSourceChangedListener(listener: MapView.OnSourceChangedListener)

removeOnStyleImageMissingListener

open fun removeOnStyleImageMissingListener(listener: MapView.OnStyleImageMissingListener)

removeOnWillStartLoadingMapListener

open fun removeOnWillStartLoadingMapListener(listener: MapView.OnWillStartLoadingMapListener)

removeOnWillStartRenderingFrameListener

open fun removeOnWillStartRenderingFrameListener(listener: MapView.OnWillStartRenderingFrameListener)

removeOnWillStartRenderingMapListener

open fun removeOnWillStartRenderingMapListener(listener: MapView.OnWillStartRenderingMapListener)

MapFragment

class MapFragment : Fragment, OnMapReadyCallback

Fragment wrapper around a map view.

A Map component in an app. This fragment is the simplest way to place a map in an application. It’s a wrapper around a view of a map to automatically handle the necessary life cycle needs. Being a fragment, this component can be added to an activity’s layout or can dynamically be added using a FragmentManager.

To get a reference to the MapView, use getMapAsync}

See also

Name Summary
#getMapAsync(OnMapReadyCallback)
#getMapAsync(OnMapReadyCallback)
   

Types

Name Summary
OnMapViewReadyCallback
interface OnMapViewReadyCallback
Callback to be invoked when the map fragment has inflated its MapView.

Functions

Name Summary
dump
open fun dump(prefix: String, fd: FileDescriptor, writer: PrintWriter, args: Array)
equals
fun equals(o: Any): Boolean
getActivity
fun getActivity(): Activity
getAllowEnterTransitionOverlap
open fun getAllowEnterTransitionOverlap(): Boolean
getAllowReturnTransitionOverlap
open fun getAllowReturnTransitionOverlap(): Boolean
getArguments
fun getArguments(): Bundle
getChildFragmentManager
fun getChildFragmentManager(): FragmentManager
getContext
open fun getContext(): Context
getEnterTransition
open fun getEnterTransition(): Transition
getExitTransition
open fun getExitTransition(): Transition
getFragmentManager
fun getFragmentManager(): FragmentManager
getHost
fun getHost(): Any
getId
fun getId(): Int
getLayoutInflater
fun getLayoutInflater(): LayoutInflater
getLoaderManager
open fun getLoaderManager(): LoaderManager
getMapAsync
open fun getMapAsync(onMapReadyCallback: OnMapReadyCallback)
Sets a callback object which will be triggered when the MapboxMap instance is ready to be used.
getParentFragment
fun getParentFragment(): Fragment
getReenterTransition
open fun getReenterTransition(): Transition
getResources
fun getResources(): Resources
getRetainInstance
fun getRetainInstance(): Boolean
getReturnTransition
open fun getReturnTransition(): Transition
getSharedElementEnterTransition
open fun getSharedElementEnterTransition(): Transition
getSharedElementReturnTransition
open fun getSharedElementReturnTransition(): Transition
getString
fun getString(resId: Int): String
getTag
fun getTag(): String
getTargetFragment
fun getTargetFragment(): Fragment
getTargetRequestCode
fun getTargetRequestCode(): Int
getText
fun getText(resId: Int): CharSequence
getUserVisibleHint
open fun getUserVisibleHint(): Boolean
getView
open fun getView(): View
hashCode
fun hashCode(): Int
instantiate
open fun instantiate(context: Context, fname: String): Fragment
isAdded
fun isAdded(): Boolean
isDetached
fun isDetached(): Boolean
isHidden
fun isHidden(): Boolean
isInLayout
fun isInLayout(): Boolean
isRemoving
fun isRemoving(): Boolean
isResumed
fun isResumed(): Boolean
isStateSaved
fun isStateSaved(): Boolean
isVisible
fun isVisible(): Boolean
newInstance
open fun newInstance(): MapFragment
Creates a default MapFragment instance
@NonNull()
open fun newInstance(mapboxMapOptions: MapboxMapOptions): MapFragment
Creates a MapFragment instance
onActivityCreated
open fun onActivityCreated(savedInstanceState: Bundle)
onActivityResult
open fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent)
onAttach
open fun onAttach(context: Context)
open fun onAttach(context: Context)
Called when the context attaches to this fragment.
onAttachFragment
open fun onAttachFragment(childFragment: Fragment)
onConfigurationChanged
open fun onConfigurationChanged(newConfig: Configuration)
onContextItemSelected
open fun onContextItemSelected(item: MenuItem): Boolean
onCreate
open fun onCreate(savedInstanceState: Bundle)
onCreateAnimator
open fun onCreateAnimator(transit: Int, enter: Boolean, nextAnim: Int): Animator
onCreateContextMenu
open fun onCreateContextMenu(menu: ContextMenu, v: View, menuInfo: ContextMenu.ContextMenuInfo)
onCreateOptionsMenu
open fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater)
onCreateView
open fun onCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle): View
open fun onCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle): View
Creates the fragment view hierarchy.
onDestroy
open fun onDestroy()
open fun onDestroy()
Called when the fragment is destroyed.
onDestroyOptionsMenu
open fun onDestroyOptionsMenu()
onDestroyView
open fun onDestroyView()
open fun onDestroyView()
Called when the fragment is view hiearchy is being destroyed.
onDetach
open fun onDetach()
onGetLayoutInflater
open fun onGetLayoutInflater(savedInstanceState: Bundle): LayoutInflater
onHiddenChanged
open fun onHiddenChanged(hidden: Boolean)
onInflate
open fun onInflate(attrs: AttributeSet, savedInstanceState: Bundle)
open fun onInflate(context: Context, attrs: AttributeSet, savedInstanceState: Bundle)
Called when this fragment is inflated, parses XML tag attributes.
onLowMemory
open fun onLowMemory()
open fun onLowMemory()
Called when the fragment receives onLowMemory call from the hosting Activity.
onMapReady
open fun onMapReady(mapboxMap: MapboxMap)
Called when the style of the map has successfully loaded.
onMultiWindowModeChanged
open fun onMultiWindowModeChanged(isInMultiWindowMode: Boolean, newConfig: Configuration)
onOptionsItemSelected
open fun onOptionsItemSelected(item: MenuItem): Boolean
onOptionsMenuClosed
open fun onOptionsMenuClosed(menu: Menu)
onPause
open fun onPause()
open fun onPause()
Called when the fragment is pausing.
onPictureInPictureModeChanged
open fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean, newConfig: Configuration)
onPrepareOptionsMenu
open fun onPrepareOptionsMenu(menu: Menu)
onRequestPermissionsResult
open fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: Array)
onResume
open fun onResume()
open fun onResume()
Called when the fragment is ready to be interacted with.
onSaveInstanceState
open fun onSaveInstanceState(outState: Bundle)
open fun onSaveInstanceState(outState: Bundle)
Called when the fragment state needs to be saved.
onStart
open fun onStart()
open fun onStart()
Called when the fragment is visible for the users.
onStop
open fun onStop()
open fun onStop()
Called when the fragment is no longer visible for the user.
onTrimMemory
open fun onTrimMemory(level: Int)
onViewCreated
open fun onViewCreated(view: View, savedInstanceState: Bundle)
open fun onViewCreated(view: View, savedInstanceState: Bundle)
Called when the fragment view hierarchy is created.
onViewStateRestored
open fun onViewStateRestored(savedInstanceState: Bundle)
postponeEnterTransition
open fun postponeEnterTransition()
registerForContextMenu
open fun registerForContextMenu(view: View)
requestPermissions
fun requestPermissions(permissions: Array, requestCode: Int)
setAllowEnterTransitionOverlap
open fun setAllowEnterTransitionOverlap(allow: Boolean)
setAllowReturnTransitionOverlap
open fun setAllowReturnTransitionOverlap(allow: Boolean)
setArguments
open fun setArguments(args: Bundle)
setEnterSharedElementCallback
open fun setEnterSharedElementCallback(callback: SharedElementCallback)
setEnterTransition
open fun setEnterTransition(transition: Transition)
setExitSharedElementCallback
open fun setExitSharedElementCallback(callback: SharedElementCallback)
setExitTransition
open fun setExitTransition(transition: Transition)
setHasOptionsMenu
open fun setHasOptionsMenu(hasMenu: Boolean)
setInitialSavedState
open fun setInitialSavedState(state: Fragment.SavedState)
setMenuVisibility
open fun setMenuVisibility(menuVisible: Boolean)
setReenterTransition
open fun setReenterTransition(transition: Transition)
setRetainInstance
open fun setRetainInstance(retain: Boolean)
setReturnTransition
open fun setReturnTransition(transition: Transition)
setSharedElementEnterTransition
open fun setSharedElementEnterTransition(transition: Transition)
setSharedElementReturnTransition
open fun setSharedElementReturnTransition(transition: Transition)
setTargetFragment
open fun setTargetFragment(fragment: Fragment, requestCode: Int)
setUserVisibleHint
open fun setUserVisibleHint(isVisibleToUser: Boolean)
shouldShowRequestPermissionRationale
open fun shouldShowRequestPermissionRationale(permission: String): Boolean
startActivity
open fun startActivity(intent: Intent)
startActivityForResult
open fun startActivityForResult(intent: Intent, requestCode: Int)
startIntentSenderForResult
open fun startIntentSenderForResult(intent: IntentSender, requestCode: Int, fillInIntent: Intent, flagsMask: Int, flagsValues: Int, extraFlags: Int, options: Bundle)
startPostponedEnterTransition
open fun startPostponedEnterTransition()
toString
open fun toString(): String
unregisterForContextMenu
open fun unregisterForContextMenu(view: View)

getMapAsync

open fun getMapAsync(onMapReadyCallback: OnMapReadyCallback)

Sets a callback object which will be triggered when the MapboxMap instance is ready to be used.

Parameters
Name Summary
onMapReadyCallback
The callback to be invoked.
   
   

newInstance

open fun newInstance(): MapFragment

Creates a default MapFragment instance

Return

MapFragment instantiated

@NonNull()

open fun newInstance(mapboxMapOptions: MapboxMapOptions): MapFragment

Creates a MapFragment instance

Return

MapFragment instantiated.

Parameters
Name Summary
mapboxMapOptions
The configuration options to be used.
   
   

onAttach

open fun onAttach(context: Context)

Called when the context attaches to this fragment.

Parameters
Name Summary
context
the context attaching
   
   

onCreateView

open fun onCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle): View

Creates the fragment view hierarchy.

Return

The view created

Parameters
Name Summary
inflater
Inflater used to inflate content.
container
The parent layout for the map fragment.
savedInstanceState
The saved instance state for the map fragment.
   
   

onDestroyView

open fun onDestroyView()

Called when the fragment is view hiearchy is being destroyed.

onDestroy

open fun onDestroy()

Called when the fragment is destroyed.

onInflate

open fun onInflate(context: Context, attrs: AttributeSet, savedInstanceState: Bundle)

Called when this fragment is inflated, parses XML tag attributes.

Parameters
Name Summary
context
The context inflating this fragment.
attrs
The XML tag attributes.
savedInstanceState
The saved instance state for the map fragment.
   
   

onLowMemory

open fun onLowMemory()

Called when the fragment receives onLowMemory call from the hosting Activity.

onMapReady

open fun onMapReady(mapboxMap: MapboxMap)

Called when the style of the map has successfully loaded.

Parameters
Name Summary
mapboxMap
The public API controller of the map
   
   

onPause

open fun onPause()

Called when the fragment is pausing.

onResume

open fun onResume()

Called when the fragment is ready to be interacted with.

onSaveInstanceState

open fun onSaveInstanceState(outState: Bundle)

Called when the fragment state needs to be saved.

Parameters
Name Summary
outState
The saved state
   
   

onStart

open fun onStart()

Called when the fragment is visible for the users.

onStop

open fun onStop()

Called when the fragment is no longer visible for the user.

onViewCreated

open fun onViewCreated(view: View, savedInstanceState: Bundle)

Called when the fragment view hierarchy is created.

Parameters
Name Summary
view
The content view of the fragment
savedInstanceState
The saved instance state of the fragment
   
   

OnMapViewReadyCallback

interface OnMapViewReadyCallback

Callback to be invoked when the map fragment has inflated its MapView.

To use this interface the context hosting the fragment must implement this interface.That instance will be set as part of Fragment#onAttach(Context context).

Functions

Name Summary
onMapViewReady
abstract fun onMapViewReady(mapView: MapView)
Called when the map has been created.

onMapViewReady

abstract fun onMapViewReady(mapView: MapView)

Called when the map has been created.

Parameters
Name Summary
mapView
The created mapview
   
   

MapGestureDetector

class MapGestureDetector

Manages gestures events on a MapView.

Constructors

Name Summary
MapGestureDetector open fun MapGestureDetector(context: Context, transform: Transform, projection: Projection, uiSettings: UiSettings, annotationManager: AnnotationManager, cameraChangeDispatcher: CameraChangeDispatcher)

Functions

Name Summary
addOnFlingListener
open fun addOnFlingListener(onFlingListener: MapboxMap.OnFlingListener)
addOnMapClickListener
open fun addOnMapClickListener(onMapClickListener: MapboxMap.OnMapClickListener)
addOnMapLongClickListener
open fun addOnMapLongClickListener(onMapLongClickListener: MapboxMap.OnMapLongClickListener)
addOnMoveListener
open fun addOnMoveListener(listener: MapboxMap.OnMoveListener)
addOnRotateListener
open fun addOnRotateListener(listener: MapboxMap.OnRotateListener)
addOnScaleListener
open fun addOnScaleListener(listener: MapboxMap.OnScaleListener)
addShoveListener
open fun addShoveListener(listener: MapboxMap.OnShoveListener)
cancelAnimators
open fun cancelAnimators()
notifyOnFlingListeners
open fun notifyOnFlingListeners()
notifyOnMapClickListeners
open fun notifyOnMapClickListeners(tapPoint: PointF)
notifyOnMapLongClickListeners
open fun notifyOnMapLongClickListeners(longClickPoint: PointF)
notifyOnMoveBeginListeners
open fun notifyOnMoveBeginListeners(detector: MoveGestureDetector)
notifyOnMoveEndListeners
open fun notifyOnMoveEndListeners(detector: MoveGestureDetector)
notifyOnMoveListeners
open fun notifyOnMoveListeners(detector: MoveGestureDetector)
notifyOnRotateBeginListeners
open fun notifyOnRotateBeginListeners(detector: RotateGestureDetector)
notifyOnRotateEndListeners
open fun notifyOnRotateEndListeners(detector: RotateGestureDetector)
notifyOnRotateListeners
open fun notifyOnRotateListeners(detector: RotateGestureDetector)
notifyOnScaleBeginListeners
open fun notifyOnScaleBeginListeners(detector: StandardScaleGestureDetector)
notifyOnScaleEndListeners
open fun notifyOnScaleEndListeners(detector: StandardScaleGestureDetector)
notifyOnScaleListeners
open fun notifyOnScaleListeners(detector: StandardScaleGestureDetector)
notifyOnShoveBeginListeners
open fun notifyOnShoveBeginListeners(detector: ShoveGestureDetector)
notifyOnShoveEndListeners
open fun notifyOnShoveEndListeners(detector: ShoveGestureDetector)
notifyOnShoveListeners
open fun notifyOnShoveListeners(detector: ShoveGestureDetector)
onGenericMotionEvent
open fun onGenericMotionEvent(event: MotionEvent): Boolean
Called for events that don’t fit the other handlers.
onTouchEvent
open fun onTouchEvent(motionEvent: MotionEvent): Boolean
Called when user touches the screen, all positions are absolute.
removeOnFlingListener
open fun removeOnFlingListener(onFlingListener: MapboxMap.OnFlingListener)
removeOnMapClickListener
open fun removeOnMapClickListener(onMapClickListener: MapboxMap.OnMapClickListener)
removeOnMapLongClickListener
open fun removeOnMapLongClickListener(onMapLongClickListener: MapboxMap.OnMapLongClickListener)
removeOnMoveListener
open fun removeOnMoveListener(listener: MapboxMap.OnMoveListener)
removeOnRotateListener
open fun removeOnRotateListener(listener: MapboxMap.OnRotateListener)
removeOnScaleListener
open fun removeOnScaleListener(listener: MapboxMap.OnScaleListener)
removeShoveListener
open fun removeShoveListener(listener: MapboxMap.OnShoveListener)
setFocalPoint
open fun setFocalPoint(focalPoint: PointF)
Set the gesture focal point.
zoomInAnimated
open fun zoomInAnimated(zoomFocalPoint: PointF, runImmediately: Boolean)
Zoom in by 1.
zoomOutAnimated
open fun zoomOutAnimated(zoomFocalPoint: PointF, runImmediately: Boolean)
Zoom out by 1.

Properties

Name Summary
gesturesManager private open var gesturesManager: AndroidGesturesManager

addOnFlingListener

open fun addOnFlingListener(onFlingListener: MapboxMap.OnFlingListener)

addOnMapClickListener

open fun addOnMapClickListener(onMapClickListener: MapboxMap.OnMapClickListener)

addOnMapLongClickListener

open fun addOnMapLongClickListener(onMapLongClickListener: MapboxMap.OnMapLongClickListener)

addOnMoveListener

open fun addOnMoveListener(listener: MapboxMap.OnMoveListener)

addOnRotateListener

open fun addOnRotateListener(listener: MapboxMap.OnRotateListener)

addOnScaleListener

open fun addOnScaleListener(listener: MapboxMap.OnScaleListener)

addShoveListener

open fun addShoveListener(listener: MapboxMap.OnShoveListener)

cancelAnimators

open fun cancelAnimators()

gesturesManager

private open var gesturesManager: AndroidGesturesManager

notifyOnFlingListeners

open fun notifyOnFlingListeners()

notifyOnMapClickListeners

open fun notifyOnMapClickListeners(tapPoint: PointF)

notifyOnMapLongClickListeners

open fun notifyOnMapLongClickListeners(longClickPoint: PointF)

notifyOnMoveBeginListeners

open fun notifyOnMoveBeginListeners(detector: MoveGestureDetector)

notifyOnMoveEndListeners

open fun notifyOnMoveEndListeners(detector: MoveGestureDetector)

notifyOnMoveListeners

open fun notifyOnMoveListeners(detector: MoveGestureDetector)

notifyOnRotateBeginListeners

open fun notifyOnRotateBeginListeners(detector: RotateGestureDetector)

notifyOnRotateEndListeners

open fun notifyOnRotateEndListeners(detector: RotateGestureDetector)

notifyOnRotateListeners

open fun notifyOnRotateListeners(detector: RotateGestureDetector)

notifyOnScaleBeginListeners

open fun notifyOnScaleBeginListeners(detector: StandardScaleGestureDetector)

notifyOnScaleEndListeners

open fun notifyOnScaleEndListeners(detector: StandardScaleGestureDetector)

notifyOnScaleListeners

open fun notifyOnScaleListeners(detector: StandardScaleGestureDetector)

notifyOnShoveBeginListeners

open fun notifyOnShoveBeginListeners(detector: ShoveGestureDetector)

notifyOnShoveEndListeners

open fun notifyOnShoveEndListeners(detector: ShoveGestureDetector)

notifyOnShoveListeners

open fun notifyOnShoveListeners(detector: ShoveGestureDetector)

onGenericMotionEvent

open fun onGenericMotionEvent(event: MotionEvent): Boolean

Called for events that don’t fit the other handlers.

Examples of such events are mouse scroll events, mouse moves, joystick & trackpad.

Return

True is the event is handled

Parameters
Name Summary
event
The MotionEvent occurred
   
   

onTouchEvent

open fun onTouchEvent(motionEvent: MotionEvent): Boolean

Called when user touches the screen, all positions are absolute.

Forwards event to the related gesture detectors.

Return

True if touch event is handled

Parameters
Name Summary
motionEvent
the MotionEvent
   
   

removeOnFlingListener

open fun removeOnFlingListener(onFlingListener: MapboxMap.OnFlingListener)

removeOnMapClickListener

open fun removeOnMapClickListener(onMapClickListener: MapboxMap.OnMapClickListener)

removeOnMapLongClickListener

open fun removeOnMapLongClickListener(onMapLongClickListener: MapboxMap.OnMapLongClickListener)

removeOnMoveListener

open fun removeOnMoveListener(listener: MapboxMap.OnMoveListener)

removeOnRotateListener

open fun removeOnRotateListener(listener: MapboxMap.OnRotateListener)

removeOnScaleListener

open fun removeOnScaleListener(listener: MapboxMap.OnScaleListener)

removeShoveListener

open fun removeShoveListener(listener: MapboxMap.OnShoveListener)

setFocalPoint

open fun setFocalPoint(focalPoint: PointF)

Set the gesture focal point.

This is the center point used for calculate transformations from gestures, value isoverridden if end user provides his own through setFocalPoint.

Parameters
Name Summary
focalPoint
the center point for gestures
   
   

zoomInAnimated

open fun zoomInAnimated(zoomFocalPoint: PointF, runImmediately: Boolean)

Zoom in by 1.

Parameters
Name Summary
zoomFocalPoint
focal point of zoom animation
runImmediately
if true, animation will be started right away, otherwise it will wait untilACTION_UP is registered.
   
   

zoomOutAnimated

open fun zoomOutAnimated(zoomFocalPoint: PointF, runImmediately: Boolean)

Zoom out by 1.

Parameters
Name Summary
zoomFocalPoint
focal point of zoom animation
runImmediately
if true, animation will be started right away, otherwise it will wait untilACTION_UP is registered.
   
   

MapKeyListener

class MapKeyListener

Manages key events on a MapView.

  • Uses [Transform](./#transform-1) to change the map state
  • Uses [UiSettings](../-ui-settings/index.md) to verify validity of user restricted movement.

Constructors

Name Summary
MapKeyListener open fun MapKeyListener(transform: Transform, uiSettings: UiSettings, mapGestureDetector: MapGestureDetector)

Functions

Name Summary
onKeyDown
open fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean
Called when the user presses a key, alse called for repeated keys held down.
onKeyLongPress
open fun onKeyLongPress(keyCode: Int, event: KeyEvent): Boolean
Called when the user long presses a key that is being tracked.
onKeyUp
open fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean
Called when the user releases a key.
onTrackballEvent
open fun onTrackballEvent(event: MotionEvent): Boolean
Called for trackball events, all motions are relative in device specific units.

onKeyDown

open fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean

Called when the user presses a key, alse called for repeated keys held down.

Return

true if the wevent is handled

Parameters
Name Summary
keyCode
the id of the pressed key
event
the related key event
   
   

onKeyLongPress

open fun onKeyLongPress(keyCode: Int, event: KeyEvent): Boolean

Called when the user long presses a key that is being tracked.

Return

true if event is handled

Parameters
Name Summary
keyCode
the id of the long pressed key
event
the related key event
   
   

onKeyUp

open fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean

Called when the user releases a key.

Return

true if the event is handled

Parameters
Name Summary
keyCode
the id of the released key
event
the related key event
   
   

onTrackballEvent

open fun onTrackballEvent(event: MotionEvent): Boolean

Called for trackball events, all motions are relative in device specific units.

Return

true if the event is handled

Parameters
Name Summary
event
the related motion event
   
   

MapView

open class MapView : FrameLayout, NativeMapView.ViewCallback

A {@code 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 {@code 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

Name Summary
MapView @UiThread()
open fun MapView(context: Context)
MapView @UiThread()
open fun MapView(context: Context, attrs: AttributeSet)
MapView @UiThread()
open fun MapView(context: Context, attrs: AttributeSet, defStyleAttr: Int)
MapView @UiThread()
open fun MapView(context: Context, options: MapboxMapOptions)

Types

Name Summary
OnCameraDidChangeListener
interface OnCameraDidChangeListener
Interface definition for a callback to be invoked when the map region did change.
OnCameraIsChangingListener
interface OnCameraIsChangingListener
Interface definition for a callback to be invoked when the camera is changing.
OnCameraWillChangeListener
interface OnCameraWillChangeListener
Interface definition for a callback to be invoked when the camera will change.
OnCanRemoveUnusedStyleImageListener
interface OnCanRemoveUnusedStyleImageListener
Interface definition for a callback to be invoked with an unused image identifier.
OnDidBecomeIdleListener
interface OnDidBecomeIdleListener
Interface definition for a callback to be invoked when the map has entered the idle state.
OnDidFailLoadingMapListener
interface OnDidFailLoadingMapListener
Interface definition for a callback to be invoked when the map is changing.
OnDidFinishLoadingMapListener
interface OnDidFinishLoadingMapListener
Interface definition for a callback to be invoked when the map finished loading.
OnDidFinishLoadingStyleListener
interface OnDidFinishLoadingStyleListener
Interface definition for a callback to be invoked when the map has loaded the style.
OnDidFinishRenderingFrameListener
interface OnDidFinishRenderingFrameListener
Interface definition for a callback to be invoked when the map finished rendering a frame.
OnDidFinishRenderingMapListener
interface OnDidFinishRenderingMapListener
Interface definition for a callback to be invoked when the map is changing.
OnSourceChangedListener
interface OnSourceChangedListener
Interface definition for a callback to be invoked when a map source has changed.
OnStyleImageMissingListener
interface OnStyleImageMissingListener
Interface definition for a callback to be invoked with the id of a missing icon.
OnWillStartLoadingMapListener
interface OnWillStartLoadingMapListener
Interface definition for a callback to be invoked when the map will start loading.
OnWillStartRenderingFrameListener
interface OnWillStartRenderingFrameListener
Interface definition for a callback to be invoked when the map will start rendering a frame.
OnWillStartRenderingMapListener
interface OnWillStartRenderingMapListener
Interface definition for a callback to be invoked when the map will start rendering the map.

Functions

Name Summary
addChildrenForAccessibility
open fun addChildrenForAccessibility(outChildren: ArrayList)
addExtraDataToAccessibilityNodeInfo
open fun addExtraDataToAccessibilityNodeInfo(info: AccessibilityNodeInfo, extraDataKey: String, arguments: Bundle)
addFocusables
open fun addFocusables(views: ArrayList, direction: Int, focusableMode: Int)
addKeyboardNavigationClusters
open fun addKeyboardNavigationClusters(views: Collection, direction: Int)
addOnAttachStateChangeListener
open fun addOnAttachStateChangeListener(listener: View.OnAttachStateChangeListener)
addOnCameraDidChangeListener
open fun addOnCameraDidChangeListener(listener: MapView.OnCameraDidChangeListener)
Set a callback that’s invoked when the camera region did change.
addOnCameraIsChangingListener
open fun addOnCameraIsChangingListener(listener: MapView.OnCameraIsChangingListener)
Set a callback that’s invoked when the camera is changing.
addOnCameraWillChangeListener
open fun addOnCameraWillChangeListener(listener: MapView.OnCameraWillChangeListener)
Set a callback that’s invoked when the camera region will change.
addOnCanRemoveUnusedStyleImageListener
open fun addOnCanRemoveUnusedStyleImageListener(listener: MapView.OnCanRemoveUnusedStyleImageListener)
Set a callback that’s invoked when map needs to release unused image resources.
addOnDidBecomeIdleListener
open fun addOnDidBecomeIdleListener(listener: MapView.OnDidBecomeIdleListener)
Set a callback that’s invoked when the map has entered the idle state.
addOnDidFailLoadingMapListener
open fun addOnDidFailLoadingMapListener(listener: MapView.OnDidFailLoadingMapListener)
Set a callback that’s invoked when the map failed to load.
addOnDidFinishLoadingMapListener
open fun addOnDidFinishLoadingMapListener(listener: MapView.OnDidFinishLoadingMapListener)
Set a callback that’s invoked when the map has finished loading.
addOnDidFinishLoadingStyleListener
open fun addOnDidFinishLoadingStyleListener(listener: MapView.OnDidFinishLoadingStyleListener)
Set a callback that’s invoked when the style has finished loading.
addOnDidFinishRenderingFrameListener
open fun addOnDidFinishRenderingFrameListener(listener: MapView.OnDidFinishRenderingFrameListener)
Set a callback that’s invoked when the map has finished rendering a frame.
addOnDidFinishRenderingMapListener
open fun addOnDidFinishRenderingMapListener(listener: MapView.OnDidFinishRenderingMapListener)
Set a callback that’s invoked when the map has finished rendering.
addOnLayoutChangeListener
open fun addOnLayoutChangeListener(listener: View.OnLayoutChangeListener)
addOnSourceChangedListener
open fun addOnSourceChangedListener(listener: MapView.OnSourceChangedListener)
Set a callback that’s invoked when a map source has changed.
addOnStyleImageMissingListener
open fun addOnStyleImageMissingListener(listener: MapView.OnStyleImageMissingListener)
Set a callback that’s invoked when the id of an icon is missing.
addOnUnhandledKeyEventListener
open fun addOnUnhandledKeyEventListener(listener: View.OnUnhandledKeyEventListener)
addOnWillStartLoadingMapListener
open fun addOnWillStartLoadingMapListener(listener: MapView.OnWillStartLoadingMapListener)
Set a callback that’s invoked when the map will start loading.
addOnWillStartRenderingFrameListener
open fun addOnWillStartRenderingFrameListener(listener: MapView.OnWillStartRenderingFrameListener)
Set a callback that’s invoked when the map will start rendering a frame.
addOnWillStartRenderingMapListener
open fun addOnWillStartRenderingMapListener(listener: MapView.OnWillStartRenderingMapListener)
Set a callback that’s invoked when the map will start rendering.
addStatesFromChildren
open fun addStatesFromChildren(): Boolean
addTouchables
open fun addTouchables(views: ArrayList)
addView
open fun addView(child: View)
addViewInLayout
open fun addViewInLayout(child: View, index: Int, params: ViewGroup.LayoutParams): Boolean
animate
open fun animate(): ViewPropertyAnimator
announceForAccessibility
open fun announceForAccessibility(text: CharSequence)
attachLayoutAnimationParameters
open fun attachLayoutAnimationParameters(child: View, params: ViewGroup.LayoutParams, index: Int, count: Int)
attachViewToParent
open fun attachViewToParent(child: View, index: Int, params: ViewGroup.LayoutParams)
autofill
open fun autofill(value: AutofillValue)
awakenScrollBars
open fun awakenScrollBars(): Boolean
bringChildToFront
open fun bringChildToFront(child: View)
bringToFront
open fun bringToFront()
buildDrawingCache
open fun buildDrawingCache()
buildLayer
open fun buildLayer()
callOnClick
open fun callOnClick(): Boolean
canAnimate
open fun canAnimate(): Boolean
cancelDragAndDrop
fun cancelDragAndDrop()
cancelLongPress
open fun cancelLongPress()
cancelPendingInputEvents
fun cancelPendingInputEvents()
canResolveLayoutDirection
open fun canResolveLayoutDirection(): Boolean
canResolveTextAlignment
open fun canResolveTextAlignment(): Boolean
canResolveTextDirection
open fun canResolveTextDirection(): Boolean
canScrollHorizontally
open fun canScrollHorizontally(direction: Int): Boolean
canScrollVertically
open fun canScrollVertically(direction: Int): Boolean
checkInputConnectionProxy
open fun checkInputConnectionProxy(view: View): Boolean
checkLayoutParams
open fun checkLayoutParams(p: ViewGroup.LayoutParams): Boolean
childDrawableStateChanged
open fun childDrawableStateChanged(child: View)
childHasTransientStateChanged
open fun childHasTransientStateChanged(child: View, childHasTransientState: Boolean)
cleanupLayoutState
open fun cleanupLayoutState(child: View)
clearAnimation
open fun clearAnimation()
clearChildFocus
open fun clearChildFocus(child: View)
clearDisappearingChildren
open fun clearDisappearingChildren()
clearFocus
open fun clearFocus()
combineMeasuredStates
open fun combineMeasuredStates(curState: Int, newState: Int): Int
computeHorizontalScrollExtent
open fun computeHorizontalScrollExtent(): Int
computeHorizontalScrollOffset
open fun computeHorizontalScrollOffset(): Int
computeHorizontalScrollRange
open fun computeHorizontalScrollRange(): Int
computeScroll
open fun computeScroll()
computeSystemWindowInsets
open fun computeSystemWindowInsets(in: WindowInsets, outLocalInsets: Rect): WindowInsets
computeVerticalScrollExtent
open fun computeVerticalScrollExtent(): Int
computeVerticalScrollOffset
open fun computeVerticalScrollOffset(): Int
computeVerticalScrollRange
open fun computeVerticalScrollRange(): Int
createAccessibilityNodeInfo
open fun createAccessibilityNodeInfo(): AccessibilityNodeInfo
createContextMenu
open fun createContextMenu(menu: ContextMenu)
debug
open fun debug(depth: Int)
destroyDrawingCache
open fun destroyDrawingCache()
detachAllViewsFromParent
open fun detachAllViewsFromParent()
detachViewFromParent
open fun detachViewFromParent(child: View)
detachViewsFromParent
open fun detachViewsFromParent(start: Int, count: Int)
dispatchApplyWindowInsets
open fun dispatchApplyWindowInsets(insets: WindowInsets): WindowInsets
dispatchCapturedPointerEvent
open fun dispatchCapturedPointerEvent(event: MotionEvent): Boolean
dispatchConfigurationChanged
open fun dispatchConfigurationChanged(newConfig: Configuration)
dispatchDisplayHint
open fun dispatchDisplayHint(hint: Int)
dispatchDragEvent
open fun dispatchDragEvent(event: DragEvent): Boolean
dispatchDraw
open fun dispatchDraw(canvas: Canvas)
dispatchDrawableHotspotChanged
open fun dispatchDrawableHotspotChanged(x: Float, y: Float)
dispatchFinishTemporaryDetach
open fun dispatchFinishTemporaryDetach()
dispatchFreezeSelfOnly
open fun dispatchFreezeSelfOnly(container: SparseArray)
dispatchGenericFocusedEvent
open fun dispatchGenericFocusedEvent(event: MotionEvent): Boolean
dispatchGenericMotionEvent
open fun dispatchGenericMotionEvent(event: MotionEvent): Boolean
dispatchGenericPointerEvent
open fun dispatchGenericPointerEvent(event: MotionEvent): Boolean
dispatchHoverEvent
open fun dispatchHoverEvent(event: MotionEvent): Boolean
dispatchKeyEvent
open fun dispatchKeyEvent(event: KeyEvent): Boolean
dispatchKeyEventPreIme
open fun dispatchKeyEventPreIme(event: KeyEvent): Boolean
dispatchKeyShortcutEvent
open fun dispatchKeyShortcutEvent(event: KeyEvent): Boolean
dispatchNestedFling
open fun dispatchNestedFling(velocityX: Float, velocityY: Float, consumed: Boolean): Boolean
dispatchNestedPreFling
open fun dispatchNestedPreFling(velocityX: Float, velocityY: Float): Boolean
dispatchNestedPrePerformAccessibilityAction
open fun dispatchNestedPrePerformAccessibilityAction(action: Int, arguments: Bundle): Boolean
dispatchNestedPreScroll
open fun dispatchNestedPreScroll(dx: Int, dy: Int, consumed: Array, offsetInWindow: Array): Boolean
dispatchNestedScroll
open fun dispatchNestedScroll(dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, offsetInWindow: Array): Boolean
dispatchPointerCaptureChanged
open fun dispatchPointerCaptureChanged(hasCapture: Boolean)
dispatchPopulateAccessibilityEvent
open fun dispatchPopulateAccessibilityEvent(event: AccessibilityEvent): Boolean
dispatchProvideAutofillStructure
open fun dispatchProvideAutofillStructure(structure: ViewStructure, flags: Int)
dispatchProvideStructure
open fun dispatchProvideStructure(structure: ViewStructure)
dispatchRestoreInstanceState
open fun dispatchRestoreInstanceState(container: SparseArray)
dispatchSaveInstanceState
open fun dispatchSaveInstanceState(container: SparseArray)
dispatchSetActivated
open fun dispatchSetActivated(activated: Boolean)
dispatchSetPressed
open fun dispatchSetPressed(pressed: Boolean)
dispatchSetSelected
open fun dispatchSetSelected(selected: Boolean)
dispatchStartTemporaryDetach
open fun dispatchStartTemporaryDetach()
dispatchSystemUiVisibilityChanged
open fun dispatchSystemUiVisibilityChanged(visible: Int)
dispatchThawSelfOnly
open fun dispatchThawSelfOnly(container: SparseArray)
dispatchTouchEvent
open fun dispatchTouchEvent(ev: MotionEvent): Boolean
dispatchTrackballEvent
open fun dispatchTrackballEvent(event: MotionEvent): Boolean
dispatchUnhandledMove
open fun dispatchUnhandledMove(focused: View, direction: Int): Boolean
dispatchVisibilityChanged
open fun dispatchVisibilityChanged(changedView: View, visibility: Int)
dispatchWindowFocusChanged
open fun dispatchWindowFocusChanged(hasFocus: Boolean)
dispatchWindowSystemUiVisiblityChanged
open fun dispatchWindowSystemUiVisiblityChanged(visible: Int)
dispatchWindowVisibilityChanged
open fun dispatchWindowVisibilityChanged(visibility: Int)
draw
open fun draw(canvas: Canvas)
drawableHotspotChanged
open fun drawableHotspotChanged(x: Float, y: Float)
drawableStateChanged
open fun drawableStateChanged()
drawChild
open fun drawChild(canvas: Canvas, child: View, drawingTime: Long): Boolean
endViewTransition
open fun endViewTransition(view: View)
findFocus
open fun findFocus(): View
findViewById
fun <T : View?> findViewById(id: Int): T
findViewsWithText
open fun findViewsWithText(outViews: ArrayList, text: CharSequence, flags: Int)
findViewWithTag
fun <T : View?> findViewWithTag(tag: Any): T
fitSystemWindows
open fun fitSystemWindows(insets: Rect): Boolean
focusableViewAvailable
open fun focusableViewAvailable(v: View)
focusSearch
open fun focusSearch(focused: View, direction: Int): View
forceHasOverlappingRendering
open fun forceHasOverlappingRendering(hasOverlappingRendering: Boolean)
forceLayout
open fun forceLayout()
gatherTransparentRegion
open fun gatherTransparentRegion(region: Region): Boolean
generateDefaultLayoutParams
open fun generateDefaultLayoutParams(): FrameLayout.LayoutParams
generateLayoutParams
open fun generateLayoutParams(attrs: AttributeSet): FrameLayout.LayoutParams
generateViewId
open fun generateViewId(): Int
getAccessibilityClassName
open fun getAccessibilityClassName(): CharSequence
getAccessibilityLiveRegion
open fun getAccessibilityLiveRegion(): Int
getAccessibilityNodeProvider
open fun getAccessibilityNodeProvider(): AccessibilityNodeProvider
getAccessibilityPaneTitle
open fun getAccessibilityPaneTitle(): CharSequence
getAccessibilityTraversalAfter
open fun getAccessibilityTraversalAfter(): Int
getAccessibilityTraversalBefore
open fun getAccessibilityTraversalBefore(): Int
getAlpha
open fun getAlpha(): Float
getAnimation
open fun getAnimation(): Animation
getApplicationWindowToken
open fun getApplicationWindowToken(): IBinder
getAutofillHints
open fun getAutofillHints(): Array
getAutofillId
fun getAutofillId(): AutofillId
getAutofillType
open fun getAutofillType(): Int
getAutofillValue
open fun getAutofillValue(): AutofillValue
getBackground
open fun getBackground(): Drawable
getBackgroundTintList
open fun getBackgroundTintList(): ColorStateList
getBackgroundTintMode
open fun getBackgroundTintMode(): PorterDuff.Mode
getBaseline
open fun getBaseline(): Int
getBottom
fun getBottom(): Int
getBottomFadingEdgeStrength
open fun getBottomFadingEdgeStrength(): Float
getBottomPaddingOffset
open fun getBottomPaddingOffset(): Int
getCameraDistance
open fun getCameraDistance(): Float
getChildAt
open fun getChildAt(index: Int): View
getChildCount
open fun getChildCount(): Int
getChildDrawingOrder
open fun getChildDrawingOrder(childCount: Int, i: Int): Int
getChildMeasureSpec
open fun getChildMeasureSpec(spec: Int, padding: Int, childDimension: Int): Int
getChildStaticTransformation
open fun getChildStaticTransformation(child: View, t: Transformation): Boolean
getChildVisibleRect
open fun getChildVisibleRect(child: View, r: Rect, offset: Point): Boolean
getClipBounds
open fun getClipBounds(): Rect
open fun getClipBounds(outRect: Rect): Boolean
getClipChildren
open fun getClipChildren(): Boolean
getClipToOutline
fun getClipToOutline(): Boolean
getClipToPadding
open fun getClipToPadding(): Boolean
getConsiderGoneChildrenWhenMeasuring
open fun getConsiderGoneChildrenWhenMeasuring(): Boolean
getContentDescription
open fun getContentDescription(): CharSequence
getContext
fun getContext(): Context
getContextMenuInfo
open fun getContextMenuInfo(): ContextMenu.ContextMenuInfo
getDefaultFocusHighlightEnabled
fun getDefaultFocusHighlightEnabled(): Boolean
getDefaultSize
open fun getDefaultSize(size: Int, measureSpec: Int): Int
getDescendantFocusability
open fun getDescendantFocusability(): Int
getDisplay
open fun getDisplay(): Display
getDrawableState
fun getDrawableState(): Array
getDrawingCache
open fun getDrawingCache(): Bitmap
getDrawingCacheBackgroundColor
open fun getDrawingCacheBackgroundColor(): Int
getDrawingCacheQuality
open fun getDrawingCacheQuality(): Int
getDrawingRect
open fun getDrawingRect(outRect: Rect)
getDrawingTime
open fun getDrawingTime(): Long
getElevation
open fun getElevation(): Float
getFilterTouchesWhenObscured
open fun getFilterTouchesWhenObscured(): Boolean
getFitsSystemWindows
open fun getFitsSystemWindows(): Boolean
getFocusable
open fun getFocusable(): Int
getFocusables
open fun getFocusables(direction: Int): ArrayList
getFocusedChild
open fun getFocusedChild(): View
getFocusedRect
open fun getFocusedRect(r: Rect)
getForeground
open fun getForeground(): Drawable
getForegroundGravity
open fun getForegroundGravity(): Int
getForegroundTintList
open fun getForegroundTintList(): ColorStateList
getForegroundTintMode
open fun getForegroundTintMode(): PorterDuff.Mode
getGlobalVisibleRect
open fun getGlobalVisibleRect(r: Rect, globalOffset: Point): Boolean
getHandler
open fun getHandler(): Handler
getHasOverlappingRendering
fun getHasOverlappingRendering(): Boolean
getHeight
fun getHeight(): Int
getHitRect
open fun getHitRect(outRect: Rect)
getHorizontalFadingEdgeLength
open fun getHorizontalFadingEdgeLength(): Int
getHorizontalScrollbarHeight
open fun getHorizontalScrollbarHeight(): Int
getId
open fun getId(): Int
getImportantForAccessibility
open fun getImportantForAccessibility(): Int
getImportantForAutofill
open fun getImportantForAutofill(): Int
getKeepScreenOn
open fun getKeepScreenOn(): Boolean
getKeyDispatcherState
open fun getKeyDispatcherState(): KeyEvent.DispatcherState
getLabelFor
open fun getLabelFor(): Int
getLayerType
open fun getLayerType(): Int
getLayoutAnimation
open fun getLayoutAnimation(): LayoutAnimationController
getLayoutAnimationListener
open fun getLayoutAnimationListener(): Animation.AnimationListener
getLayoutDirection
open fun getLayoutDirection(): Int
getLayoutMode
open fun getLayoutMode(): Int
getLayoutParams
open fun getLayoutParams(): ViewGroup.LayoutParams
getLayoutTransition
open fun getLayoutTransition(): LayoutTransition
getLeft
fun getLeft(): Int
getLeftFadingEdgeStrength
open fun getLeftFadingEdgeStrength(): Float
getLeftPaddingOffset
open fun getLeftPaddingOffset(): Int
getLocalVisibleRect
fun getLocalVisibleRect(r: Rect): Boolean
getLocationInWindow
open fun getLocationInWindow(outLocation: Array)
getLocationOnScreen
open fun getLocationOnScreen(outLocation: Array)
getMapAsync
@UiThread()
open fun getMapAsync(callback: OnMapReadyCallback)
Sets a callback object which will be triggered when the MapboxMap instance is ready to be used.
getMatrix
open fun getMatrix(): Matrix
getMeasureAllChildren
open fun getMeasureAllChildren(): Boolean
getMeasuredHeight
fun getMeasuredHeight(): Int
getMeasuredHeightAndState
fun getMeasuredHeightAndState(): Int
getMeasuredState
fun getMeasuredState(): Int
getMeasuredWidth
fun getMeasuredWidth(): Int
getMeasuredWidthAndState
fun getMeasuredWidthAndState(): Int
getMinimumHeight
open fun getMinimumHeight(): Int
getMinimumWidth
open fun getMinimumWidth(): Int
getNestedScrollAxes
open fun getNestedScrollAxes(): Int
getNextClusterForwardId
open fun getNextClusterForwardId(): Int
getNextFocusDownId
open fun getNextFocusDownId(): Int
getNextFocusForwardId
open fun getNextFocusForwardId(): Int
getNextFocusLeftId
open fun getNextFocusLeftId(): Int
getNextFocusRightId
open fun getNextFocusRightId(): Int
getNextFocusUpId
open fun getNextFocusUpId(): Int
getOnFocusChangeListener
open fun getOnFocusChangeListener(): View.OnFocusChangeListener
getOutlineAmbientShadowColor
open fun getOutlineAmbientShadowColor(): Int
getOutlineProvider
open fun getOutlineProvider(): ViewOutlineProvider
getOutlineSpotShadowColor
open fun getOutlineSpotShadowColor(): Int
getOverlay
open fun getOverlay(): ViewOverlay
open fun getOverlay(): ViewGroupOverlay
getOverScrollMode
open fun getOverScrollMode(): Int
getPaddingBottom
open fun getPaddingBottom(): Int
getPaddingEnd
open fun getPaddingEnd(): Int
getPaddingLeft
open fun getPaddingLeft(): Int
getPaddingRight
open fun getPaddingRight(): Int
getPaddingStart
open fun getPaddingStart(): Int
getPaddingTop
open fun getPaddingTop(): Int
getParent
fun getParent(): ViewParent
getParentForAccessibility
open fun getParentForAccessibility(): ViewParent
getPersistentDrawingCache
open fun getPersistentDrawingCache(): Int
getPivotX
open fun getPivotX(): Float
getPivotY
open fun getPivotY(): Float
getPixelRatio
open fun getPixelRatio(): Float
Returns the map pixel ratio, by default it returns the device pixel ratio.
getPointerIcon
open fun getPointerIcon(): PointerIcon
getResources
open fun getResources(): Resources
getRevealOnFocusHint
fun getRevealOnFocusHint(): Boolean
getRight
fun getRight(): Int
getRightFadingEdgeStrength
open fun getRightFadingEdgeStrength(): Float
getRightPaddingOffset
open fun getRightPaddingOffset(): Int
getRootView
open fun getRootView(): View
getRootWindowInsets
open fun getRootWindowInsets(): WindowInsets
getRotation
open fun getRotation(): Float
getRotationX
open fun getRotationX(): Float
getRotationY
open fun getRotationY(): Float
getScaleX
open fun getScaleX(): Float
getScaleY
open fun getScaleY(): Float
getScrollBarDefaultDelayBeforeFade
open fun getScrollBarDefaultDelayBeforeFade(): Int
getScrollBarFadeDuration
open fun getScrollBarFadeDuration(): Int
getScrollBarSize
open fun getScrollBarSize(): Int
getScrollBarStyle
open fun getScrollBarStyle(): Int
getScrollIndicators
open fun getScrollIndicators(): Int
getScrollX
fun getScrollX(): Int
getScrollY
fun getScrollY(): Int
getSolidColor
open fun getSolidColor(): Int
getStateListAnimator
open fun getStateListAnimator(): StateListAnimator
getSuggestedMinimumHeight
open fun getSuggestedMinimumHeight(): Int
getSuggestedMinimumWidth
open fun getSuggestedMinimumWidth(): Int
getSystemUiVisibility
open fun getSystemUiVisibility(): Int
getTag
open fun getTag(): Any
getTextAlignment
open fun getTextAlignment(): Int
getTextDirection
open fun getTextDirection(): Int
getTooltipText
open fun getTooltipText(): CharSequence
getTop
fun getTop(): Int
getTopFadingEdgeStrength
open fun getTopFadingEdgeStrength(): Float
getTopPaddingOffset
open fun getTopPaddingOffset(): Int
getTouchables
open fun getTouchables(): ArrayList
getTouchDelegate
open fun getTouchDelegate(): TouchDelegate
getTouchscreenBlocksFocus
open fun getTouchscreenBlocksFocus(): Boolean
getTransitionName
open fun getTransitionName(): String
getTranslationX
open fun getTranslationX(): Float
getTranslationY
open fun getTranslationY(): Float
getTranslationZ
open fun getTranslationZ(): Float
getVerticalFadingEdgeLength
open fun getVerticalFadingEdgeLength(): Int
getVerticalScrollbarPosition
open fun getVerticalScrollbarPosition(): Int
getVerticalScrollbarWidth
open fun getVerticalScrollbarWidth(): Int
getViewContent
@Nullable()
open fun getViewContent(): Bitmap
getViewTreeObserver
open fun getViewTreeObserver(): ViewTreeObserver
getVisibility
open fun getVisibility(): Int
getWidth
fun getWidth(): Int
getWindowAttachCount
open fun getWindowAttachCount(): Int
getWindowId
open fun getWindowId(): WindowId
getWindowSystemUiVisibility
open fun getWindowSystemUiVisibility(): Int
getWindowToken
open fun getWindowToken(): IBinder
getWindowVisibility
open fun getWindowVisibility(): Int
getWindowVisibleDisplayFrame
open fun getWindowVisibleDisplayFrame(outRect: Rect)
getX
open fun getX(): Float
getY
open fun getY(): Float
getZ
open fun getZ(): Float
hasExplicitFocusable
open fun hasExplicitFocusable(): Boolean
hasFocus
open fun hasFocus(): Boolean
hasFocusable
open fun hasFocusable(): Boolean
hasNestedScrollingParent
open fun hasNestedScrollingParent(): Boolean
hasOnClickListeners
open fun hasOnClickListeners(): Boolean
hasOverlappingRendering
open fun hasOverlappingRendering(): Boolean
hasPointerCapture
open fun hasPointerCapture(): Boolean
hasTransientState
open fun hasTransientState(): Boolean
hasWindowFocus
open fun hasWindowFocus(): Boolean
indexOfChild
open fun indexOfChild(child: View): Int
inflate
open fun inflate(context: Context, resource: Int, root: ViewGroup): View
invalidate
open fun invalidate(dirty: Rect)
invalidateChild
fun invalidateChild(child: View, dirty: Rect)
invalidateChildInParent
open fun invalidateChildInParent(location: Array, dirty: Rect): ViewParent
invalidateDrawable
open fun invalidateDrawable(drawable: Drawable)
invalidateOutline
open fun invalidateOutline()
isAccessibilityFocused
open fun isAccessibilityFocused(): Boolean
isAccessibilityHeading
open fun isAccessibilityHeading(): Boolean
isActivated
open fun isActivated(): Boolean
isAlwaysDrawnWithCacheEnabled
open fun isAlwaysDrawnWithCacheEnabled(): Boolean
isAnimationCacheEnabled
open fun isAnimationCacheEnabled(): Boolean
isAttachedToWindow
open fun isAttachedToWindow(): Boolean
isChildrenDrawingOrderEnabled
open fun isChildrenDrawingOrderEnabled(): Boolean
isChildrenDrawnWithCacheEnabled
open fun isChildrenDrawnWithCacheEnabled(): Boolean
isClickable
open fun isClickable(): Boolean
isContextClickable
open fun isContextClickable(): Boolean
isDestroyed
@UiThread()
open fun isDestroyed(): Boolean
Returns if the map has been destroyed.
isDirty
open fun isDirty(): Boolean
isDrawingCacheEnabled
open fun isDrawingCacheEnabled(): Boolean
isDuplicateParentStateEnabled
open fun isDuplicateParentStateEnabled(): Boolean
isEnabled
open fun isEnabled(): Boolean
isFocusable
fun isFocusable(): Boolean
isFocusableInTouchMode
fun isFocusableInTouchMode(): Boolean
isFocused
open fun isFocused(): Boolean
isFocusedByDefault
fun isFocusedByDefault(): Boolean
isHapticFeedbackEnabled
open fun isHapticFeedbackEnabled(): Boolean
isHardwareAccelerated
open fun isHardwareAccelerated(): Boolean
isHorizontalFadingEdgeEnabled
open fun isHorizontalFadingEdgeEnabled(): Boolean
isHorizontalScrollBarEnabled
open fun isHorizontalScrollBarEnabled(): Boolean
isHovered
open fun isHovered(): Boolean
isImportantForAccessibility
open fun isImportantForAccessibility(): Boolean
isImportantForAutofill
fun isImportantForAutofill(): Boolean
isInEditMode
open fun isInEditMode(): Boolean
isInLayout
open fun isInLayout(): Boolean
isInTouchMode
open fun isInTouchMode(): Boolean
isKeyboardNavigationCluster
fun isKeyboardNavigationCluster(): Boolean
isLaidOut
open fun isLaidOut(): Boolean
isLayoutDirectionResolved
open fun isLayoutDirectionResolved(): Boolean
isLayoutRequested
open fun isLayoutRequested(): Boolean
isLongClickable
open fun isLongClickable(): Boolean
isMotionEventSplittingEnabled
open fun isMotionEventSplittingEnabled(): Boolean
isNestedScrollingEnabled
open fun isNestedScrollingEnabled(): Boolean
isOpaque
open fun isOpaque(): Boolean
isPaddingOffsetRequired
open fun isPaddingOffsetRequired(): Boolean
isPaddingRelative
open fun isPaddingRelative(): Boolean
isPivotSet
open fun isPivotSet(): Boolean
isPressed
open fun isPressed(): Boolean
isSaveEnabled
open fun isSaveEnabled(): Boolean
isSaveFromParentEnabled
open fun isSaveFromParentEnabled(): Boolean
isScreenReaderFocusable
open fun isScreenReaderFocusable(): Boolean
isScrollbarFadingEnabled
open fun isScrollbarFadingEnabled(): Boolean
isScrollContainer
open fun isScrollContainer(): Boolean
isSelected
open fun isSelected(): Boolean
isShown
open fun isShown(): Boolean
isSoundEffectsEnabled
open fun isSoundEffectsEnabled(): Boolean
isTemporarilyDetached
fun isTemporarilyDetached(): Boolean
isTextAlignmentResolved
open fun isTextAlignmentResolved(): Boolean
isTextDirectionResolved
open fun isTextDirectionResolved(): Boolean
isTransitionGroup
open fun isTransitionGroup(): Boolean
isVerticalFadingEdgeEnabled
open fun isVerticalFadingEdgeEnabled(): Boolean
isVerticalScrollBarEnabled
open fun isVerticalScrollBarEnabled(): Boolean
isVisibleToUserForAutofill
open fun isVisibleToUserForAutofill(virtualId: Int): Boolean
jumpDrawablesToCurrentState
open fun jumpDrawablesToCurrentState()
keyboardNavigationClusterSearch
open fun keyboardNavigationClusterSearch(currentCluster: View, direction: Int): View
layout
fun layout(l: Int, t: Int, r: Int, b: Int)
measure
fun measure(widthMeasureSpec: Int, heightMeasureSpec: Int)
measureChild
open fun measureChild(child: View, parentWidthMeasureSpec: Int, parentHeightMeasureSpec: Int)
measureChildren
open fun measureChildren(widthMeasureSpec: Int, heightMeasureSpec: Int)
measureChildWithMargins
open fun measureChildWithMargins(child: View, parentWidthMeasureSpec: Int, widthUsed: Int, parentHeightMeasureSpec: Int, heightUsed: Int)
mergeDrawableStates
open fun mergeDrawableStates(baseState: Array, additionalState: Array): Array
notifySubtreeAccessibilityStateChanged
open fun notifySubtreeAccessibilityStateChanged(child: View, source: View, changeType: Int)
offsetDescendantRectToMyCoords
fun offsetDescendantRectToMyCoords(descendant: View, rect: Rect)
offsetLeftAndRight
open fun offsetLeftAndRight(offset: Int)
offsetRectIntoDescendantCoords
fun offsetRectIntoDescendantCoords(descendant: View, rect: Rect)
offsetTopAndBottom
open fun offsetTopAndBottom(offset: Int)
onAnimationEnd
open fun onAnimationEnd()
onAnimationStart
open fun onAnimationStart()
onApplyWindowInsets
open fun onApplyWindowInsets(insets: WindowInsets): WindowInsets
onAttachedToWindow
open fun onAttachedToWindow()
onCancelPendingInputEvents
open fun onCancelPendingInputEvents()
onCapturedPointerEvent
open fun onCapturedPointerEvent(event: MotionEvent): Boolean
onCheckIsTextEditor
open fun onCheckIsTextEditor(): Boolean
onConfigurationChanged
open fun onConfigurationChanged(newConfig: Configuration)
onCreate
@UiThread()
open fun onCreate(savedInstanceState: Bundle)
You must call this method from the parent’s Activity#onCreate(Bundle)} orFragment#onViewCreated(View, Bundle).
onCreateContextMenu
open fun onCreateContextMenu(menu: ContextMenu)
onCreateDrawableState
open fun onCreateDrawableState(extraSpace: Int): Array
onCreateInputConnection
open fun onCreateInputConnection(outAttrs: EditorInfo): InputConnection
onDescendantInvalidated
open fun onDescendantInvalidated(child: View, target: View)
onDestroy
@UiThread()
open fun onDestroy()
You must call this method from the parent’s Activity#onDestroy() or Fragment#onDestroyView().
onDetachedFromWindow
open fun onDetachedFromWindow()
onDisplayHint
open fun onDisplayHint(hint: Int)
onDragEvent
open fun onDragEvent(event: DragEvent): Boolean
onDraw
open fun onDraw(canvas: Canvas)
onDrawForeground
open fun onDrawForeground(canvas: Canvas)
onDrawScrollBars
fun onDrawScrollBars(canvas: Canvas)
onFilterTouchEventForSecurity
open fun onFilterTouchEventForSecurity(event: MotionEvent): Boolean
onFinishInflate
open fun onFinishInflate()
onFinishTemporaryDetach
open fun onFinishTemporaryDetach()
onFocusChanged
open fun onFocusChanged(gainFocus: Boolean, direction: Int, previouslyFocusedRect: Rect)
onGenericMotionEvent
open fun onGenericMotionEvent(event: MotionEvent): Boolean
open fun onGenericMotionEvent(event: MotionEvent): Boolean
onHoverChanged
open fun onHoverChanged(hovered: Boolean)
onHoverEvent
open fun onHoverEvent(event: MotionEvent): Boolean
onInitializeAccessibilityEvent
open fun onInitializeAccessibilityEvent(event: AccessibilityEvent)
onInitializeAccessibilityNodeInfo
open fun onInitializeAccessibilityNodeInfo(info: AccessibilityNodeInfo)
onInterceptHoverEvent
open fun onInterceptHoverEvent(event: MotionEvent): Boolean
onInterceptTouchEvent
open fun onInterceptTouchEvent(ev: MotionEvent): Boolean
onKeyDown
open fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean
open fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean
onKeyLongPress
open fun onKeyLongPress(keyCode: Int, event: KeyEvent): Boolean
open fun onKeyLongPress(keyCode: Int, event: KeyEvent): Boolean
onKeyMultiple
open fun onKeyMultiple(keyCode: Int, repeatCount: Int, event: KeyEvent): Boolean
onKeyPreIme
open fun onKeyPreIme(keyCode: Int, event: KeyEvent): Boolean
onKeyShortcut
open fun onKeyShortcut(keyCode: Int, event: KeyEvent): Boolean
onKeyUp
open fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean
open fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean
onLayout
open fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int)
onLowMemory
@UiThread()
open fun onLowMemory()
You must call this method from the parent’s Activity#onLowMemory() or Fragment#onLowMemory().
onMeasure
open fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)
onNestedFling
open fun onNestedFling(target: View, velocityX: Float, velocityY: Float, consumed: Boolean): Boolean
onNestedPreFling
open fun onNestedPreFling(target: View, velocityX: Float, velocityY: Float): Boolean
onNestedPrePerformAccessibilityAction
open fun onNestedPrePerformAccessibilityAction(target: View, action: Int, args: Bundle): Boolean
onNestedPreScroll
open fun onNestedPreScroll(target: View, dx: Int, dy: Int, consumed: Array)
onNestedScroll
open fun onNestedScroll(target: View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int)
onNestedScrollAccepted
open fun onNestedScrollAccepted(child: View, target: View, axes: Int)
onOverScrolled
open fun onOverScrolled(scrollX: Int, scrollY: Int, clampedX: Boolean, clampedY: Boolean)
onPause
@UiThread()
open fun onPause()
You must call this method from the parent’s Activity#onPause() or Fragment#onPause().
onPointerCaptureChange
open fun onPointerCaptureChange(hasCapture: Boolean)
onPopulateAccessibilityEvent
open fun onPopulateAccessibilityEvent(event: AccessibilityEvent)
onProvideAutofillStructure
open fun onProvideAutofillStructure(structure: ViewStructure, flags: Int)
onProvideAutofillVirtualStructure
open fun onProvideAutofillVirtualStructure(structure: ViewStructure, flags: Int)
onProvideStructure
open fun onProvideStructure(structure: ViewStructure)
onProvideVirtualStructure
open fun onProvideVirtualStructure(structure: ViewStructure)
onRequestFocusInDescendants
open fun onRequestFocusInDescendants(direction: Int, previouslyFocusedRect: Rect): Boolean
onRequestSendAccessibilityEvent
open fun onRequestSendAccessibilityEvent(child: View, event: AccessibilityEvent): Boolean
onResolvePointerIcon
open fun onResolvePointerIcon(event: MotionEvent, pointerIndex: Int): PointerIcon
onRestoreInstanceState
open fun onRestoreInstanceState(state: Parcelable)
onResume
@UiThread()
open fun onResume()
You must call this method from the parent’s Activity#onResume() or Fragment#onResume().
onRtlPropertiesChanged
open fun onRtlPropertiesChanged(layoutDirection: Int)
onSaveInstanceState
open fun onSaveInstanceState(): Parcelable
@UiThread()
open fun onSaveInstanceState(outState: Bundle)
You must call this method from the parent’s Activity#onSaveInstanceState(Bundle)or Fragment#onSaveInstanceState(Bundle).
onScreenStateChanged
open fun onScreenStateChanged(screenState: Int)
onScrollChanged
open fun onScrollChanged(l: Int, t: Int, oldl: Int, oldt: Int)
onSetAlpha
open fun onSetAlpha(alpha: Int): Boolean
onSizeChanged
open fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int)
onStart
@UiThread()
open fun onStart()
You must call this method from the parent’s Activity#onStart() or Fragment#onStart()
onStartNestedScroll
open fun onStartNestedScroll(child: View, target: View, nestedScrollAxes: Int): Boolean
onStartTemporaryDetach
open fun onStartTemporaryDetach()
onStop
@UiThread()
open fun onStop()
You must call this method from the parent’s Activity#onStop() or Fragment#onStop().
onStopNestedScroll
open fun onStopNestedScroll(child: View)
onTouchEvent
open fun onTouchEvent(event: MotionEvent): Boolean
open fun onTouchEvent(event: MotionEvent): Boolean
onTrackballEvent
open fun onTrackballEvent(event: MotionEvent): Boolean
open fun onTrackballEvent(event: MotionEvent): Boolean
onViewAdded
open fun onViewAdded(child: View)
onViewRemoved
open fun onViewRemoved(child: View)
onVisibilityAggregated
open fun onVisibilityAggregated(isVisible: Boolean)
onVisibilityChanged
open fun onVisibilityChanged(changedView: View, visibility: Int)
onWindowFocusChanged
open fun onWindowFocusChanged(hasWindowFocus: Boolean)
onWindowSystemUiVisibilityChanged
open fun onWindowSystemUiVisibilityChanged(visible: Int)
onWindowVisibilityChanged
open fun onWindowVisibilityChanged(visibility: Int)
overScrollBy
open fun overScrollBy(deltaX: Int, deltaY: Int, scrollX: Int, scrollY: Int, scrollRangeX: Int, scrollRangeY: Int, maxOverScrollX: Int, maxOverScrollY: Int, isTouchEvent: Boolean): Boolean
performAccessibilityAction
open fun performAccessibilityAction(action: Int, arguments: Bundle): Boolean
performClick
open fun performClick(): Boolean
performContextClick
open fun performContextClick(x: Float, y: Float): Boolean
performHapticFeedback
open fun performHapticFeedback(feedbackConstant: Int): Boolean
performLongClick
open fun performLongClick(): Boolean
playSoundEffect
open fun playSoundEffect(soundConstant: Int)
post
open fun post(action: Runnable): Boolean
postDelayed
open fun postDelayed(action: Runnable, delayMillis: Long): Boolean
postInvalidate
open fun postInvalidate()
postInvalidateDelayed
open fun postInvalidateDelayed(delayMilliseconds: Long)
postInvalidateOnAnimation
open fun postInvalidateOnAnimation()
postOnAnimation
open fun postOnAnimation(action: Runnable)
postOnAnimationDelayed
open fun postOnAnimationDelayed(action: Runnable, delayMillis: Long)
queueEvent
open fun queueEvent(runnable: Runnable)
Queue a runnable to be executed on the map renderer thread.
recomputeViewAttributes
open fun recomputeViewAttributes(child: View)
refreshDrawableState
open fun refreshDrawableState()
releasePointerCapture
open fun releasePointerCapture()
removeAllViews
open fun removeAllViews()
removeAllViewsInLayout
open fun removeAllViewsInLayout()
removeCallbacks
open fun removeCallbacks(action: Runnable): Boolean
removeDetachedView
open fun removeDetachedView(child: View, animate: Boolean)
removeOnAttachStateChangeListener
open fun removeOnAttachStateChangeListener(listener: View.OnAttachStateChangeListener)
removeOnCameraDidChangeListener
open fun removeOnCameraDidChangeListener(listener: MapView.OnCameraDidChangeListener)
Set a callback that’s invoked when the camera region did change.
removeOnCameraIsChangingListener
open fun removeOnCameraIsChangingListener(listener: MapView.OnCameraIsChangingListener)
Remove a callback that’s invoked when the camera is changing.
removeOnCameraWillChangeListener
open fun removeOnCameraWillChangeListener(listener: MapView.OnCameraWillChangeListener)
Remove a callback that’s invoked when the camera region will change.
removeOnCanRemoveUnusedStyleImageListener
open fun removeOnCanRemoveUnusedStyleImageListener(listener: MapView.OnCanRemoveUnusedStyleImageListener)
Removes a callback that’s invoked when map needs to release unused image resources.
removeOnDidBecomeIdleListener
open fun removeOnDidBecomeIdleListener(listener: MapView.OnDidBecomeIdleListener)
Remove a callback that’s invoked when the map has entered the idle state.
removeOnDidFailLoadingMapListener
open fun removeOnDidFailLoadingMapListener(listener: MapView.OnDidFailLoadingMapListener)
Set a callback that’s invoked when the map failed to load.
removeOnDidFinishLoadingMapListener
open fun removeOnDidFinishLoadingMapListener(listener: MapView.OnDidFinishLoadingMapListener)
Set a callback that’s invoked when the map has finished loading.
removeOnDidFinishLoadingStyleListener
open fun removeOnDidFinishLoadingStyleListener(listener: MapView.OnDidFinishLoadingStyleListener)
Set a callback that’s invoked when the style has finished loading.
removeOnDidFinishRenderingFrameListener
open fun removeOnDidFinishRenderingFrameListener(listener: MapView.OnDidFinishRenderingFrameListener)
Set a callback that’s invoked when the map has finished rendering a frame.
removeOnDidFinishRenderingMapListener
open fun removeOnDidFinishRenderingMapListener(listener: MapView.OnDidFinishRenderingMapListener)
Remove a callback that’s invoked when the map has finished rendering.
removeOnLayoutChangeListener
open fun removeOnLayoutChangeListener(listener: View.OnLayoutChangeListener)
removeOnSourceChangedListener
open fun removeOnSourceChangedListener(listener: MapView.OnSourceChangedListener)
Set a callback that’s invoked when a map source has changed.
removeOnStyleImageMissingListener
open fun removeOnStyleImageMissingListener(listener: MapView.OnStyleImageMissingListener)
Set a callback that’s invoked when a map source has changed.
removeOnUnhandledKeyEventListener
open fun removeOnUnhandledKeyEventListener(listener: View.OnUnhandledKeyEventListener)
removeOnWillStartLoadingMapListener
open fun removeOnWillStartLoadingMapListener(listener: MapView.OnWillStartLoadingMapListener)
Set a callback that’s invoked when the map will start loading.
removeOnWillStartRenderingFrameListener
open fun removeOnWillStartRenderingFrameListener(listener: MapView.OnWillStartRenderingFrameListener)
Set a callback that’s invoked when the map will start rendering a frame.
removeOnWillStartRenderingMapListener
open fun removeOnWillStartRenderingMapListener(listener: MapView.OnWillStartRenderingMapListener)
Set a callback that’s invoked when the map will start rendering.
removeView
open fun removeView(view: View)
removeViewAt
open fun removeViewAt(index: Int)
removeViewInLayout
open fun removeViewInLayout(view: View)
removeViews
open fun removeViews(start: Int, count: Int)
removeViewsInLayout
open fun removeViewsInLayout(start: Int, count: Int)
requestApplyInsets
open fun requestApplyInsets()
requestChildFocus
open fun requestChildFocus(child: View, focused: View)
requestChildRectangleOnScreen
open fun requestChildRectangleOnScreen(child: View, rectangle: Rect, immediate: Boolean): Boolean
requestDisallowInterceptTouchEvent
open fun requestDisallowInterceptTouchEvent(disallowIntercept: Boolean)
requestFitSystemWindows
open fun requestFitSystemWindows()
requestFocus
open fun requestFocus(direction: Int, previouslyFocusedRect: Rect): Boolean
requestFocusFromTouch
fun requestFocusFromTouch(): Boolean
requestLayout
open fun requestLayout()
requestPointerCapture
open fun requestPointerCapture()
requestRectangleOnScreen
open fun requestRectangleOnScreen(rectangle: Rect): Boolean
requestSendAccessibilityEvent
open fun requestSendAccessibilityEvent(child: View, event: AccessibilityEvent): Boolean
requestTransparentRegion
open fun requestTransparentRegion(child: View)
requestUnbufferedDispatch
fun requestUnbufferedDispatch(event: MotionEvent)
requireViewById
fun <T : View?> requireViewById(id: Int): T
resetPivot
open fun resetPivot()
resolveSize
open fun resolveSize(size: Int, measureSpec: Int): Int
resolveSizeAndState
open fun resolveSizeAndState(size: Int, measureSpec: Int, childMeasuredState: Int): Int
restoreDefaultFocus
open fun restoreDefaultFocus(): Boolean
restoreHierarchyState
open fun restoreHierarchyState(container: SparseArray)
saveHierarchyState
open fun saveHierarchyState(container: SparseArray)
scheduleDrawable
open fun scheduleDrawable(who: Drawable, what: Runnable, when: Long)
scheduleLayoutAnimation
open fun scheduleLayoutAnimation()
scrollBy
open fun scrollBy(x: Int, y: Int)
scrollTo
open fun scrollTo(x: Int, y: Int)
sendAccessibilityEvent
open fun sendAccessibilityEvent(eventType: Int)
sendAccessibilityEventUnchecked
open fun sendAccessibilityEventUnchecked(event: AccessibilityEvent)
setAccessibilityDelegate
open fun setAccessibilityDelegate(delegate: View.AccessibilityDelegate)
setAccessibilityHeading
open fun setAccessibilityHeading(isHeading: Boolean)
setAccessibilityLiveRegion
open fun setAccessibilityLiveRegion(mode: Int)
setAccessibilityPaneTitle
open fun setAccessibilityPaneTitle(accessibilityPaneTitle: CharSequence)
setAccessibilityTraversalAfter
open fun setAccessibilityTraversalAfter(afterId: Int)
setAccessibilityTraversalBefore
open fun setAccessibilityTraversalBefore(beforeId: Int)
setActivated
open fun setActivated(activated: Boolean)
setAddStatesFromChildren
open fun setAddStatesFromChildren(addsStates: Boolean)
setAlpha
open fun setAlpha(alpha: Float)
setAlwaysDrawnWithCacheEnabled
open fun setAlwaysDrawnWithCacheEnabled(always: Boolean)
setAnimation
open fun setAnimation(animation: Animation)
setAnimationCacheEnabled
open fun setAnimationCacheEnabled(enabled: Boolean)
setAutofillHints
open fun setAutofillHints(autofillHints: Array)
setAutofillId
open fun setAutofillId(id: AutofillId)
setBackground
open fun setBackground(background: Drawable)
setBackgroundColor
open fun setBackgroundColor(color: Int)
setBackgroundDrawable
open fun setBackgroundDrawable(background: Drawable)
setBackgroundResource
open fun setBackgroundResource(resid: Int)
setBackgroundTintList
open fun setBackgroundTintList(tint: ColorStateList)
setBackgroundTintMode
open fun setBackgroundTintMode(tintMode: PorterDuff.Mode)
setBottom
fun setBottom(bottom: Int)
setCameraDistance
open fun setCameraDistance(distance: Float)
setChildrenDrawingCacheEnabled
open fun setChildrenDrawingCacheEnabled(enabled: Boolean)
setChildrenDrawingOrderEnabled
open fun setChildrenDrawingOrderEnabled(enabled: Boolean)
setChildrenDrawnWithCacheEnabled
open fun setChildrenDrawnWithCacheEnabled(enabled: Boolean)
setClickable
open fun setClickable(clickable: Boolean)
setClipBounds
open fun setClipBounds(clipBounds: Rect)
setClipChildren
open fun setClipChildren(clipChildren: Boolean)
setClipToOutline
open fun setClipToOutline(clipToOutline: Boolean)
setClipToPadding
open fun setClipToPadding(clipToPadding: Boolean)
setContentDescription
open fun setContentDescription(contentDescription: CharSequence)
setContextClickable
open fun setContextClickable(contextClickable: Boolean)
setDefaultFocusHighlightEnabled
open fun setDefaultFocusHighlightEnabled(defaultFocusHighlightEnabled: Boolean)
setDescendantFocusability
open fun setDescendantFocusability(focusability: Int)
setDrawingCacheBackgroundColor
open fun setDrawingCacheBackgroundColor(color: Int)
setDrawingCacheEnabled
open fun setDrawingCacheEnabled(enabled: Boolean)
setDrawingCacheQuality
open fun setDrawingCacheQuality(quality: Int)
setDuplicateParentStateEnabled
open fun setDuplicateParentStateEnabled(enabled: Boolean)
setElevation
open fun setElevation(elevation: Float)
setEnabled
open fun setEnabled(enabled: Boolean)
setFadingEdgeLength
open fun setFadingEdgeLength(length: Int)
setFilterTouchesWhenObscured
open fun setFilterTouchesWhenObscured(enabled: Boolean)
setFitsSystemWindows
open fun setFitsSystemWindows(fitSystemWindows: Boolean)
setFocusable
open fun setFocusable(focusable: Boolean)
setFocusableInTouchMode
open fun setFocusableInTouchMode(focusableInTouchMode: Boolean)
setFocusedByDefault
open fun setFocusedByDefault(isFocusedByDefault: Boolean)
setForeground
open fun setForeground(foreground: Drawable)
setForegroundGravity
open fun setForegroundGravity(foregroundGravity: Int)
setForegroundTintList
open fun setForegroundTintList(tint: ColorStateList)
setForegroundTintMode
open fun setForegroundTintMode(tintMode: PorterDuff.Mode)
setHapticFeedbackEnabled
open fun setHapticFeedbackEnabled(hapticFeedbackEnabled: Boolean)
setHasTransientState
open fun setHasTransientState(hasTransientState: Boolean)
setHorizontalFadingEdgeEnabled
open fun setHorizontalFadingEdgeEnabled(horizontalFadingEdgeEnabled: Boolean)
setHorizontalScrollBarEnabled
open fun setHorizontalScrollBarEnabled(horizontalScrollBarEnabled: Boolean)
setHovered
open fun setHovered(hovered: Boolean)
setId
open fun setId(id: Int)
setImportantForAccessibility
open fun setImportantForAccessibility(mode: Int)
setImportantForAutofill
open fun setImportantForAutofill(mode: Int)
setKeepScreenOn
open fun setKeepScreenOn(keepScreenOn: Boolean)
setKeyboardNavigationCluster
open fun setKeyboardNavigationCluster(isCluster: Boolean)
setLabelFor
open fun setLabelFor(id: Int)
setLayerPaint
open fun setLayerPaint(paint: Paint)
setLayerType
open fun setLayerType(layerType: Int, paint: Paint)
setLayoutAnimation
open fun setLayoutAnimation(controller: LayoutAnimationController)
setLayoutAnimationListener
open fun setLayoutAnimationListener(animationListener: Animation.AnimationListener)
setLayoutDirection
open fun setLayoutDirection(layoutDirection: Int)
setLayoutMode
open fun setLayoutMode(layoutMode: Int)
setLayoutParams
open fun setLayoutParams(params: ViewGroup.LayoutParams)
setLayoutTransition
open fun setLayoutTransition(transition: LayoutTransition)
setLeft
fun setLeft(left: Int)
setLongClickable
open fun setLongClickable(longClickable: Boolean)
setMapStrictModeEnabled
open fun setMapStrictModeEnabled(strictModeEnabled: Boolean)
Sets the strict mode that will throw the com.mapbox.mapboxsdk.MapStrictModeException whenever the map would fail silently otherwise.
setMaximumFps
open fun setMaximumFps(maximumFps: Int)
The maximum frame rate at which the map view is rendered,but it can’t excess the ability of device hardware.
setMeasureAllChildren
open fun setMeasureAllChildren(measureAll: Boolean)
setMeasuredDimension
fun setMeasuredDimension(measuredWidth: Int, measuredHeight: Int)
setMinimumHeight
open fun setMinimumHeight(minHeight: Int)
setMinimumWidth
open fun setMinimumWidth(minWidth: Int)
setMotionEventSplittingEnabled
open fun setMotionEventSplittingEnabled(split: Boolean)
setNestedScrollingEnabled
open fun setNestedScrollingEnabled(enabled: Boolean)
setNextClusterForwardId
open fun setNextClusterForwardId(nextClusterForwardId: Int)
setNextFocusDownId
open fun setNextFocusDownId(nextFocusDownId: Int)
setNextFocusForwardId
open fun setNextFocusForwardId(nextFocusForwardId: Int)
setNextFocusLeftId
open fun setNextFocusLeftId(nextFocusLeftId: Int)
setNextFocusRightId
open fun setNextFocusRightId(nextFocusRightId: Int)
setNextFocusUpId
open fun setNextFocusUpId(nextFocusUpId: Int)
setOnApplyWindowInsetsListener
open fun setOnApplyWindowInsetsListener(listener: View.OnApplyWindowInsetsListener)
setOnCapturedPointerListener
open fun setOnCapturedPointerListener(l: View.OnCapturedPointerListener)
setOnClickListener
open fun setOnClickListener(l: View.OnClickListener)
setOnContextClickListener
open fun setOnContextClickListener(l: View.OnContextClickListener)
setOnCreateContextMenuListener
open fun setOnCreateContextMenuListener(l: View.OnCreateContextMenuListener)
setOnDragListener
open fun setOnDragListener(l: View.OnDragListener)
setOnFocusChangeListener
open fun setOnFocusChangeListener(l: View.OnFocusChangeListener)
setOnGenericMotionListener
open fun setOnGenericMotionListener(l: View.OnGenericMotionListener)
setOnHierarchyChangeListener
open fun setOnHierarchyChangeListener(listener: ViewGroup.OnHierarchyChangeListener)
setOnHoverListener
open fun setOnHoverListener(l: View.OnHoverListener)
setOnKeyListener
open fun setOnKeyListener(l: View.OnKeyListener)
setOnLongClickListener
open fun setOnLongClickListener(l: View.OnLongClickListener)
setOnScrollChangeListener
open fun setOnScrollChangeListener(l: View.OnScrollChangeListener)
setOnSystemUiVisibilityChangeListener
open fun setOnSystemUiVisibilityChangeListener(l: View.OnSystemUiVisibilityChangeListener)
setOnTouchListener
open fun setOnTouchListener(l: View.OnTouchListener)
setOutlineAmbientShadowColor
open fun setOutlineAmbientShadowColor(color: Int)
setOutlineProvider
open fun setOutlineProvider(provider: ViewOutlineProvider)
setOutlineSpotShadowColor
open fun setOutlineSpotShadowColor(color: Int)
setOverScrollMode
open fun setOverScrollMode(overScrollMode: Int)
setPadding
open fun setPadding(left: Int, top: Int, right: Int, bottom: Int)
setPaddingRelative
open fun setPaddingRelative(start: Int, top: Int, end: Int, bottom: Int)
setPersistentDrawingCache
open fun setPersistentDrawingCache(drawingCacheToKeep: Int)
setPivotX
open fun setPivotX(pivotX: Float)
setPivotY
open fun setPivotY(pivotY: Float)
setPointerIcon
open fun setPointerIcon(pointerIcon: PointerIcon)
setPressed
open fun setPressed(pressed: Boolean)
setRevealOnFocusHint
fun setRevealOnFocusHint(revealOnFocus: Boolean)
setRight
fun setRight(right: Int)
setRotation
open fun setRotation(rotation: Float)
setRotationX
open fun setRotationX(rotationX: Float)
setRotationY
open fun setRotationY(rotationY: Float)
setSaveEnabled
open fun setSaveEnabled(enabled: Boolean)
setSaveFromParentEnabled
open fun setSaveFromParentEnabled(enabled: Boolean)
setScaleX
open fun setScaleX(scaleX: Float)
setScaleY
open fun setScaleY(scaleY: Float)
setScreenReaderFocusable
open fun setScreenReaderFocusable(screenReaderFocusable: Boolean)
setScrollBarDefaultDelayBeforeFade
open fun setScrollBarDefaultDelayBeforeFade(scrollBarDefaultDelayBeforeFade: Int)
setScrollBarFadeDuration
open fun setScrollBarFadeDuration(scrollBarFadeDuration: Int)
setScrollbarFadingEnabled
open fun setScrollbarFadingEnabled(fadeScrollbars: Boolean)
setScrollBarSize
open fun setScrollBarSize(scrollBarSize: Int)
setScrollBarStyle
open fun setScrollBarStyle(style: Int)
setScrollContainer
open fun setScrollContainer(isScrollContainer: Boolean)
setScrollIndicators
open fun setScrollIndicators(indicators: Int)
setScrollX
open fun setScrollX(value: Int)
setScrollY
open fun setScrollY(value: Int)
setSelected
open fun setSelected(selected: Boolean)
setSoundEffectsEnabled
open fun setSoundEffectsEnabled(soundEffectsEnabled: Boolean)
setStateListAnimator
open fun setStateListAnimator(stateListAnimator: StateListAnimator)
setStaticTransformationsEnabled
open fun setStaticTransformationsEnabled(enabled: Boolean)
setSystemUiVisibility
open fun setSystemUiVisibility(visibility: Int)
setTag
open fun setTag(tag: Any)
setTextAlignment
open fun setTextAlignment(textAlignment: Int)
setTextDirection
open fun setTextDirection(textDirection: Int)
setTooltipText
open fun setTooltipText(tooltipText: CharSequence)
setTop
fun setTop(top: Int)
setTouchDelegate
open fun setTouchDelegate(delegate: TouchDelegate)
setTouchscreenBlocksFocus
open fun setTouchscreenBlocksFocus(touchscreenBlocksFocus: Boolean)
setTransitionGroup
open fun setTransitionGroup(isTransitionGroup: Boolean)
setTransitionName
fun setTransitionName(transitionName: String)
setTranslationX
open fun setTranslationX(translationX: Float)
setTranslationY
open fun setTranslationY(translationY: Float)
setTranslationZ
open fun setTranslationZ(translationZ: Float)
setVerticalFadingEdgeEnabled
open fun setVerticalFadingEdgeEnabled(verticalFadingEdgeEnabled: Boolean)
setVerticalScrollBarEnabled
open fun setVerticalScrollBarEnabled(verticalScrollBarEnabled: Boolean)
setVerticalScrollbarPosition
open fun setVerticalScrollbarPosition(position: Int)
setVisibility
open fun setVisibility(visibility: Int)
setWillNotCacheDrawing
open fun setWillNotCacheDrawing(willNotCacheDrawing: Boolean)
setWillNotDraw
open fun setWillNotDraw(willNotDraw: Boolean)
setX
open fun setX(x: Float)
setY
open fun setY(y: Float)
setZ
open fun setZ(z: Float)
shouldDelayChildPressedState
open fun shouldDelayChildPressedState(): Boolean
showContextMenu
open fun showContextMenu(): Boolean
showContextMenuForChild
open fun showContextMenuForChild(originalView: View): Boolean
startActionMode
open fun startActionMode(callback: ActionMode.Callback): ActionMode
startActionModeForChild
open fun startActionModeForChild(originalView: View, callback: ActionMode.Callback): ActionMode
startAnimation
open fun startAnimation(animation: Animation)
startDrag
fun startDrag(data: ClipData, shadowBuilder: View.DragShadowBuilder, myLocalState: Any, flags: Int): Boolean
startDragAndDrop
fun startDragAndDrop(data: ClipData, shadowBuilder: View.DragShadowBuilder, myLocalState: Any, flags: Int): Boolean
startLayoutAnimation
open fun startLayoutAnimation()
startNestedScroll
open fun startNestedScroll(axes: Int): Boolean
startViewTransition
open fun startViewTransition(view: View)
stopNestedScroll
open fun stopNestedScroll()
toString
open fun toString(): String
unscheduleDrawable
open fun unscheduleDrawable(who: Drawable, what: Runnable)
updateDragShadow
fun updateDragShadow(shadowBuilder: View.DragShadowBuilder)
updateViewLayout
open fun updateViewLayout(view: View, params: ViewGroup.LayoutParams)
verifyDrawable
open fun verifyDrawable(who: Drawable): Boolean
willNotCacheDrawing
open fun willNotCacheDrawing(): Boolean
willNotDraw
open fun willNotDraw(): Boolean

Properties

Name Summary
mapboxMap @Nullable()
private open var mapboxMap: MapboxMap
mapboxMapOptions open val mapboxMapOptions: MapboxMapOptions
renderView private open val renderView: View

addOnCameraDidChangeListener

open fun addOnCameraDidChangeListener(listener: MapView.OnCameraDidChangeListener)

Set a callback that’s invoked when the camera region did change.

Parameters
Name Summary
listener
The callback that’s invoked when the camera region did change
   
   

addOnCameraIsChangingListener

open fun addOnCameraIsChangingListener(listener: MapView.OnCameraIsChangingListener)

Set a callback that’s invoked when the camera is changing.

Parameters
Name Summary
listener
The callback that’s invoked when the camera is changing
   
   

addOnCameraWillChangeListener

open fun addOnCameraWillChangeListener(listener: MapView.OnCameraWillChangeListener)

Set a callback that’s invoked when the camera region will change.

Parameters
Name Summary
listener
The callback that’s invoked when the camera region will change
   
   

addOnCanRemoveUnusedStyleImageListener

open fun addOnCanRemoveUnusedStyleImageListener(listener: MapView.OnCanRemoveUnusedStyleImageListener)

Set a callback that’s invoked when map needs to release unused image resources.

A callback will be called only for unused images that were provided by the client via onStyleImageMissing listener interface.

By default, platform will remove unused images from the style. By adding listener, defaultbehavior can be overridden and client can control whether to release unused resources.

Parameters
Name Summary
listener
The callback that’s invoked when map needs to release unused image resources
   
   

addOnDidBecomeIdleListener

open fun addOnDidBecomeIdleListener(listener: MapView.OnDidBecomeIdleListener)

Set a callback that’s invoked when the map has entered the idle state.

Parameters
Name Summary
listener
The callback that’s invoked when the map has entered the idle state.
   
   

addOnDidFailLoadingMapListener

open fun addOnDidFailLoadingMapListener(listener: MapView.OnDidFailLoadingMapListener)

Set a callback that’s invoked when the map failed to load.

Parameters
Name Summary
listener
The callback that’s invoked when the map failed to load
   
   

addOnDidFinishLoadingMapListener

open fun addOnDidFinishLoadingMapListener(listener: MapView.OnDidFinishLoadingMapListener)

Set a callback that’s invoked when the map has finished loading.

Parameters
Name Summary
listener
The callback that’s invoked when the map has finished loading
   
   

addOnDidFinishLoadingStyleListener

open fun addOnDidFinishLoadingStyleListener(listener: MapView.OnDidFinishLoadingStyleListener)

Set a callback that’s invoked when the style has finished loading.

Parameters
Name Summary
listener
The callback that’s invoked when the style has finished loading
   
   

addOnDidFinishRenderingFrameListener

open fun addOnDidFinishRenderingFrameListener(listener: MapView.OnDidFinishRenderingFrameListener)

Set a callback that’s invoked when the map has finished rendering a frame.

Parameters
Name Summary
listener
The callback that’s invoked when the map has finished rendering a frame
   
   

addOnDidFinishRenderingMapListener

open fun addOnDidFinishRenderingMapListener(listener: MapView.OnDidFinishRenderingMapListener)

Set a callback that’s invoked when the map has finished rendering.

Parameters
Name Summary
listener
The callback that’s invoked when the map has finished rendering
   
   

addOnSourceChangedListener

open fun addOnSourceChangedListener(listener: MapView.OnSourceChangedListener)

Set a callback that’s invoked when a map source has changed.

Parameters
Name Summary
listener
The callback that’s invoked when the source has changed
   
   

addOnStyleImageMissingListener

open fun addOnStyleImageMissingListener(listener: MapView.OnStyleImageMissingListener)

Set a callback that’s invoked when the id of an icon is missing.

Parameters
Name Summary
listener
The callback that’s invoked when the id of an icon is missing
   
   

addOnWillStartLoadingMapListener

open fun addOnWillStartLoadingMapListener(listener: MapView.OnWillStartLoadingMapListener)

Set a callback that’s invoked when the map will start loading.

Parameters
Name Summary
listener
The callback that’s invoked when the map will start loading
   
   

addOnWillStartRenderingFrameListener

open fun addOnWillStartRenderingFrameListener(listener: MapView.OnWillStartRenderingFrameListener)

Set a callback that’s invoked when the map will start rendering a frame.

Parameters
Name Summary
listener
The callback that’s invoked when the camera will start rendering a frame
   
   

addOnWillStartRenderingMapListener

open fun addOnWillStartRenderingMapListener(listener: MapView.OnWillStartRenderingMapListener)

Set a callback that’s invoked when the map will start rendering.

Parameters
Name Summary
listener
The callback that’s invoked when the map will start rendering
   
   

getMapAsync

@UiThread()

open fun getMapAsync(callback: OnMapReadyCallback)

Sets a callback object which will be triggered when the MapboxMap instance is ready to be used.

Parameters
Name Summary
callback
The callback object that will be triggered when the map is ready to be used.
   
   

getPixelRatio

open fun getPixelRatio(): Float

Returns the map pixel ratio, by default it returns the device pixel ratio.Can be overwritten using pixelRatio.

Return

the current map pixel ratio

getViewContent

@Nullable()

open fun getViewContent(): Bitmap

isDestroyed

@UiThread()

open fun isDestroyed(): Boolean

Returns if the map has been destroyed.

This method can be used to determine if the result of an asynchronous operation should be set.

Return

true, if the map has been destroyed

mapboxMapOptions

open val mapboxMapOptions: MapboxMapOptions

mapboxMap

@Nullable()

private open var mapboxMap: MapboxMap

onCreate

@UiThread()

open fun onCreate(savedInstanceState: Bundle)

You must call this method from the parent’s Activity#onCreate(Bundle)} orFragment#onViewCreated(View, Bundle).

You must set a valid access token with getInstance before you call this method or an exception will be thrown.

See also

Name Summary
com.mapbox.mapboxsdk.Mapbox
com.mapbox.mapboxsdk.Mapbox#getInstance(Context, String)
   
Parameters
Name Summary
savedInstanceState
Pass in the parent’s savedInstanceState.
   
   

onDestroy

@UiThread()

open fun onDestroy()

You must call this method from the parent’s Activity#onDestroy() or Fragment#onDestroyView().

onGenericMotionEvent

open fun onGenericMotionEvent(event: MotionEvent): Boolean

onKeyDown

open fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean

onKeyLongPress

open fun onKeyLongPress(keyCode: Int, event: KeyEvent): Boolean

onKeyUp

open fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean

onLowMemory

@UiThread()

open fun onLowMemory()

You must call this method from the parent’s Activity#onLowMemory() or Fragment#onLowMemory().

onPause

@UiThread()

open fun onPause()

You must call this method from the parent’s Activity#onPause() or Fragment#onPause().

onResume

@UiThread()

open fun onResume()

You must call this method from the parent’s Activity#onResume() or Fragment#onResume().

onSaveInstanceState

@UiThread()

open fun onSaveInstanceState(outState: Bundle)

You must call this method from the parent’s Activity#onSaveInstanceState(Bundle)or Fragment#onSaveInstanceState(Bundle).

Parameters
Name Summary
outState
Pass in the parent’s outState.
   
   

onStart

@UiThread()

open fun onStart()

You must call this method from the parent’s Activity#onStart() or Fragment#onStart()

onStop

@UiThread()

open fun onStop()

You must call this method from the parent’s Activity#onStop() or Fragment#onStop().

onTouchEvent

open fun onTouchEvent(event: MotionEvent): Boolean

onTrackballEvent

open fun onTrackballEvent(event: MotionEvent): Boolean

queueEvent

open fun queueEvent(runnable: Runnable)

Queue a runnable to be executed on the map renderer thread.

Parameters
Name Summary
runnable
the runnable to queue
   
   

removeOnCameraDidChangeListener

open fun removeOnCameraDidChangeListener(listener: MapView.OnCameraDidChangeListener)

Set a callback that’s invoked when the camera region did change.

Parameters
Name Summary
listener
The callback that’s invoked when the camera region did change
   
   

removeOnCameraIsChangingListener

open fun removeOnCameraIsChangingListener(listener: MapView.OnCameraIsChangingListener)

Remove a callback that’s invoked when the camera is changing.

Parameters
Name Summary
listener
The callback that’s invoked when the camera is changing
   
   

removeOnCameraWillChangeListener

open fun removeOnCameraWillChangeListener(listener: MapView.OnCameraWillChangeListener)

Remove a callback that’s invoked when the camera region will change.

Parameters
Name Summary
listener
The callback that’s invoked when the camera region will change
   
   

removeOnCanRemoveUnusedStyleImageListener

open fun removeOnCanRemoveUnusedStyleImageListener(listener: MapView.OnCanRemoveUnusedStyleImageListener)

Removes a callback that’s invoked when map needs to release unused image resources.

When all listeners are removed, platform will fallback to default behavior, which is to removeunused images from the style.

Parameters
Name Summary
listener
The callback that’s invoked when map needs to release unused image resources
   
   

removeOnDidBecomeIdleListener

open fun removeOnDidBecomeIdleListener(listener: MapView.OnDidBecomeIdleListener)

Remove a callback that’s invoked when the map has entered the idle state.

Parameters
Name Summary
listener
The callback that’s invoked when the map has entered the idle state.
   
   

removeOnDidFailLoadingMapListener

open fun removeOnDidFailLoadingMapListener(listener: MapView.OnDidFailLoadingMapListener)

Set a callback that’s invoked when the map failed to load.

Parameters
Name Summary
listener
The callback that’s invoked when the map failed to load
   
   

removeOnDidFinishLoadingMapListener

open fun removeOnDidFinishLoadingMapListener(listener: MapView.OnDidFinishLoadingMapListener)

Set a callback that’s invoked when the map has finished loading.

Parameters
Name Summary
listener
The callback that’s invoked when the map has finished loading
   
   

removeOnDidFinishLoadingStyleListener

open fun removeOnDidFinishLoadingStyleListener(listener: MapView.OnDidFinishLoadingStyleListener)

Set a callback that’s invoked when the style has finished loading.

Parameters
Name Summary
listener
The callback that’s invoked when the style has finished loading
   
   

removeOnDidFinishRenderingFrameListener

open fun removeOnDidFinishRenderingFrameListener(listener: MapView.OnDidFinishRenderingFrameListener)

Set a callback that’s invoked when the map has finished rendering a frame.

Parameters
Name Summary
listener
The callback that’s invoked when the map has finished rendering a frame
   
   

removeOnDidFinishRenderingMapListener

open fun removeOnDidFinishRenderingMapListener(listener: MapView.OnDidFinishRenderingMapListener)

Remove a callback that’s invoked when the map has finished rendering.

Parameters
Name Summary
listener
The callback that’s invoked when the map has has finished rendering.
   
   

removeOnSourceChangedListener

open fun removeOnSourceChangedListener(listener: MapView.OnSourceChangedListener)

Set a callback that’s invoked when a map source has changed.

Parameters
Name Summary
listener
The callback that’s invoked when the source has changed
   
   

removeOnStyleImageMissingListener

open fun removeOnStyleImageMissingListener(listener: MapView.OnStyleImageMissingListener)

Set a callback that’s invoked when a map source has changed.

Parameters
Name Summary
listener
The callback that’s invoked when the source has changed
   
   

removeOnWillStartLoadingMapListener

open fun removeOnWillStartLoadingMapListener(listener: MapView.OnWillStartLoadingMapListener)

Set a callback that’s invoked when the map will start loading.

Parameters
Name Summary
listener
The callback that’s invoked when the map will start loading
   
   

removeOnWillStartRenderingFrameListener

open fun removeOnWillStartRenderingFrameListener(listener: MapView.OnWillStartRenderingFrameListener)

Set a callback that’s invoked when the map will start rendering a frame.

Parameters
Name Summary
listener
The callback that’s invoked when the camera will start rendering a frame
   
   

removeOnWillStartRenderingMapListener

open fun removeOnWillStartRenderingMapListener(listener: MapView.OnWillStartRenderingMapListener)

Set a callback that’s invoked when the map will start rendering.

Parameters
Name Summary
listener
The callback that’s invoked when the map will start rendering
   
   

renderView

private open val renderView: View

setMapStrictModeEnabled

open fun setMapStrictModeEnabled(strictModeEnabled: Boolean)

Sets the strict mode that will throw the com.mapbox.mapboxsdk.MapStrictModeException whenever the map would fail silently otherwise.

Parameters
Name Summary
strictModeEnabled
true to enable the strict mode, false otherwise
   
   

setMaximumFps

open fun setMaximumFps(maximumFps: Int)

The maximum frame rate at which the map view is rendered,but it can’t excess the ability of device hardware.

Parameters
Name Summary
maximumFps
Can be set to arbitrary integer values.
   
   

OnCameraDidChangeListener

interface OnCameraDidChangeListener

Interface definition for a callback to be invoked when the map region did change.

addOnCameraDidChangeListener

Functions

Name Summary
onCameraDidChange
abstract fun onCameraDidChange(animated: Boolean)
Called when the camera did change.

Inheritors

Name
Transform

onCameraDidChange

abstract fun onCameraDidChange(animated: Boolean)

Called when the camera did change.

OnCameraIsChangingListener

interface OnCameraIsChangingListener

Interface definition for a callback to be invoked when the camera is changing.

addOnCameraIsChangingListener

Functions

Name Summary
onCameraIsChanging
abstract fun onCameraIsChanging()
Called when the camera is changing.

onCameraIsChanging

abstract fun onCameraIsChanging()

Called when the camera is changing.

OnCameraWillChangeListener

interface OnCameraWillChangeListener

Interface definition for a callback to be invoked when the camera will change.

addOnCameraWillChangeListener

Functions

Name Summary
onCameraWillChange
abstract fun onCameraWillChange(animated: Boolean)
Called when the camera region will change.

onCameraWillChange

abstract fun onCameraWillChange(animated: Boolean)

Called when the camera region will change.

OnCanRemoveUnusedStyleImageListener

interface OnCanRemoveUnusedStyleImageListener

Interface definition for a callback to be invoked with an unused image identifier.

addOnCanRemoveUnusedStyleImageListener

Functions

Name Summary
onCanRemoveUnusedStyleImage
abstract fun onCanRemoveUnusedStyleImage(id: String): Boolean
Called when the map needs to release unused image resources.

onCanRemoveUnusedStyleImage

abstract fun onCanRemoveUnusedStyleImage(id: String): Boolean

Called when the map needs to release unused image resources.

Return

true if image can be removed, false otherwise.

Parameters
Name Summary
id
of an image that is not used by the map and can be removed from the style.
   
   

OnDidBecomeIdleListener

interface OnDidBecomeIdleListener

Interface definition for a callback to be invoked when the map has entered the idle state.

Calling snapshot from this callbackwill result in recursive execution. Use OnDidFinishRenderingFrameListener instead.

addOnDidBecomeIdleListener

Functions

Name Summary
onDidBecomeIdle
abstract fun onDidBecomeIdle()
Called when the map has entered the idle state.

onDidBecomeIdle

abstract fun onDidBecomeIdle()

Called when the map has entered the idle state.

OnDidFailLoadingMapListener

interface OnDidFailLoadingMapListener

Interface definition for a callback to be invoked when the map is changing.

addOnDidFailLoadingMapListener

Functions

Name Summary
onDidFailLoadingMap
abstract fun onDidFailLoadingMap(errorMessage: String)
Called when the map failed to load.

onDidFailLoadingMap

abstract fun onDidFailLoadingMap(errorMessage: String)

Called when the map failed to load.

Parameters
Name Summary
errorMessage
The reason why the map failed to load
   
   

OnDidFinishLoadingMapListener

interface OnDidFinishLoadingMapListener

Interface definition for a callback to be invoked when the map finished loading.

addOnDidFinishLoadingMapListener

Functions

Name Summary
onDidFinishLoadingMap
abstract fun onDidFinishLoadingMap()
Called when the map has finished loading.

onDidFinishLoadingMap

abstract fun onDidFinishLoadingMap()

Called when the map has finished loading.

OnDidFinishLoadingStyleListener

interface OnDidFinishLoadingStyleListener

Interface definition for a callback to be invoked when the map has loaded the style.

addOnDidFailLoadingMapListener

Functions

Name Summary
onDidFinishLoadingStyle
abstract fun onDidFinishLoadingStyle()
Called when a style has finished loading.

onDidFinishLoadingStyle

abstract fun onDidFinishLoadingStyle()

Called when a style has finished loading.

OnDidFinishRenderingFrameListener

interface OnDidFinishRenderingFrameListener

Interface definition for a callback to be invoked when the map finished rendering a frame.

addOnDidFinishRenderingFrameListener

Functions

Name Summary
onDidFinishRenderingFrame
abstract fun onDidFinishRenderingFrame(fully: Boolean)
Called when the map has finished rendering a frame

onDidFinishRenderingFrame

abstract fun onDidFinishRenderingFrame(fully: Boolean)

Called when the map has finished rendering a frame

Parameters
Name Summary
fully
true if all frames have been rendered, false if partially rendered
   
   

OnDidFinishRenderingMapListener

interface OnDidFinishRenderingMapListener

Interface definition for a callback to be invoked when the map is changing.

addOnDidFinishRenderingMapListener

Functions

Name Summary
onDidFinishRenderingMap
abstract fun onDidFinishRenderingMap(fully: Boolean)
Called when the map has finished rendering.

onDidFinishRenderingMap

abstract fun onDidFinishRenderingMap(fully: Boolean)

Called when the map has finished rendering.

Parameters
Name Summary
fully
true if map is fully rendered, false if not fully rendered
   
   

OnSourceChangedListener

interface OnSourceChangedListener

Interface definition for a callback to be invoked when a map source has changed.

addOnDidFailLoadingMapListener

Functions

Name Summary
onSourceChangedListener
abstract fun onSourceChangedListener(id: String)
Called when a map source has changed.

onSourceChangedListener

abstract fun onSourceChangedListener(id: String)

Called when a map source has changed.

Parameters
Name Summary
id
the id of the source that has changed
   
   

OnStyleImageMissingListener

interface OnStyleImageMissingListener

Interface definition for a callback to be invoked with the id of a missing icon. The icon should be addedsynchronously with addImage to be rendered on the current zoom level. When loadingicons asynchronously, you can load a placeholder image and replace it when you icon has loaded.

addOnStyleImageMissingListener

Functions

Name Summary
onStyleImageMissing
abstract fun onStyleImageMissing(id: String)
Called when the map is missing an icon.

onStyleImageMissing

abstract fun onStyleImageMissing(id: String)

Called when the map is missing an icon.The icon should be added synchronously with addImage to be rendered on the current zoom level. When loading iconsasynchronously, you can load a placeholder image and replace it when you icon has loaded.

Parameters
Name Summary
id
the id of the icon that is missing
   
   

OnWillStartLoadingMapListener

interface OnWillStartLoadingMapListener

Interface definition for a callback to be invoked when the map will start loading.

addOnWillStartLoadingMapListener

Functions

Name Summary
onWillStartLoadingMap
abstract fun onWillStartLoadingMap()
Called when the map will start loading.

onWillStartLoadingMap

abstract fun onWillStartLoadingMap()

Called when the map will start loading.

OnWillStartRenderingFrameListener

interface OnWillStartRenderingFrameListener

Interface definition for a callback to be invoked when the map will start rendering a frame.

addOnWillStartRenderingFrameListener

Functions

Name Summary
onWillStartRenderingFrame
abstract fun onWillStartRenderingFrame()
Called when the map will start rendering a frame.

onWillStartRenderingFrame

abstract fun onWillStartRenderingFrame()

Called when the map will start rendering a frame.

OnWillStartRenderingMapListener

interface OnWillStartRenderingMapListener

Interface definition for a callback to be invoked when the map will start rendering the map.

addOnDidFailLoadingMapListener

Functions

Name Summary
onWillStartRenderingMap
abstract fun onWillStartRenderingMap()
Called when the map will start rendering.

onWillStartRenderingMap

abstract fun onWillStartRenderingMap()

Called when the map will start rendering.

MapboxMap

@UiThread()

class MapboxMap

The general class to interact with in the Android Mapbox SDK. It exposes the entry point for all methods related to the MapView. You cannot instantiate MapboxMap object directly, rather, you must obtain one from the getMapAsync() method on a MapFragment or 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.

Constructors

Name Summary
MapboxMap open fun MapboxMap(map: NativeMap, transform: Transform, ui: UiSettings, projection: Projection, listener: MapboxMap.OnGesturesManagerInteractionListener, cameraChangeDispatcher: CameraChangeDispatcher, developerAnimationStartedListeners: List<MapboxMap.OnDeveloperAnimationListener>)

Types

Name Summary
CancelableCallback
interface CancelableCallback
Interface definition for a callback to be invoked when a task is complete or cancelled.
OnCameraIdleListener
interface OnCameraIdleListener
Interface definition for a callback to be invoked for when camera movement has ended.
OnCameraMoveCanceledListener
interface OnCameraMoveCanceledListener
Interface definition for a callback to be invoked for when the camera’s motion has been stopped or when the camerastarts moving for a new reason.
OnCameraMoveListener
interface OnCameraMoveListener
Interface definition for a callback to be invoked for when the camera changes position.
OnCameraMoveStartedListener
interface OnCameraMoveStartedListener
Interface definition for a callback to be invoked for when the camera motion starts.
OnCompassAnimationListener
interface OnCompassAnimationListener
Interface definition for a callback to be invoked for when the compass is animating.
OnDeveloperAnimationListener
interface OnDeveloperAnimationListener
Internal use.
OnFlingListener
interface OnFlingListener
Interface definition for a callback to be invoked when the map is flinged.
OnFpsChangedListener
interface OnFpsChangedListener
Interface definition for a callback to be invoked when a frame is rendered to the map view.
OnGesturesManagerInteractionListener
interface OnGesturesManagerInteractionListener
Interface definition for a callback to be invoked when a user registers an listener that isrelated to touch and click events.
OnInfoWindowClickListener
interface OnInfoWindowClickListener
Interface definition for a callback to be invoked when the user clicks on an info window.
OnInfoWindowCloseListener
interface OnInfoWindowCloseListener
Interface definition for a callback to be invoked when a marker’s info window is closed.
OnInfoWindowLongClickListener
interface OnInfoWindowLongClickListener
Interface definition for a callback to be invoked when the user long presses on a marker’s info window.
OnMapClickListener
interface OnMapClickListener
Interface definition for a callback to be invoked when the user clicks on the map view.
OnMapLongClickListener
interface OnMapLongClickListener
Interface definition for a callback to be invoked when the user long clicks on the map view.
OnMoveListener
interface OnMoveListener
Interface definition for a callback to be invoked when the map is moved.
OnRotateListener
interface OnRotateListener
Interface definition for a callback to be invoked when the map is rotated.
OnScaleListener
interface OnScaleListener
Interface definition for a callback to be invoked when the map is scaled.
OnShoveListener
interface OnShoveListener
Interface definition for a callback to be invoked when the map is tilted.
SnapshotReadyCallback
interface SnapshotReadyCallback
Interface definition for a callback to be invoked when the snapshot has been taken.

Functions

Name Summary
addOnCameraIdleListener
open fun addOnCameraIdleListener(listener: MapboxMap.OnCameraIdleListener)
Adds a callback that is invoked when camera movement has ended.
addOnCameraMoveCancelListener
open fun addOnCameraMoveCancelListener(listener: MapboxMap.OnCameraMoveCanceledListener)
Adds a callback that is invoked when camera movement was cancelled.
addOnCameraMoveListener
open fun addOnCameraMoveListener(listener: MapboxMap.OnCameraMoveListener)
Adds a callback that is invoked when camera position changes.
addOnCameraMoveStartedListener
open fun addOnCameraMoveStartedListener(listener: MapboxMap.OnCameraMoveStartedListener)
Adds a callback that is invoked when camera movement has started.
addOnFlingListener
open fun addOnFlingListener(listener: MapboxMap.OnFlingListener)
Adds a callback that’s invoked when the map is flinged.
addOnMapClickListener
open fun addOnMapClickListener(listener: MapboxMap.OnMapClickListener)
Adds a callback that’s invoked when the user clicks on the map view.
addOnMapLongClickListener
open fun addOnMapLongClickListener(listener: MapboxMap.OnMapLongClickListener)
Adds a callback that’s invoked when the user long clicks on the map view.
addOnMoveListener
open fun addOnMoveListener(listener: MapboxMap.OnMoveListener)
Adds a callback that’s invoked when the map is moved.
addOnRotateListener
open fun addOnRotateListener(listener: MapboxMap.OnRotateListener)
Adds a callback that’s invoked when the map is rotated.
addOnScaleListener
open fun addOnScaleListener(listener: MapboxMap.OnScaleListener)
Adds a callback that’s invoked when the map is scaled.
addOnShoveListener
open fun addOnShoveListener(listener: MapboxMap.OnShoveListener)
Adds a callback that’s invoked when the map is tilted.
animateCamera
fun animateCamera(update: CameraUpdate)
fun animateCamera(update: CameraUpdate, callback: MapboxMap.CancelableCallback)
fun animateCamera(update: CameraUpdate, durationMs: Int)
fun animateCamera(update: CameraUpdate, durationMs: Int, callback: MapboxMap.CancelableCallback)
Animate the camera to a new location defined within CameraUpdate using a transitionanimation that evokes powered flight.
cancelAllVelocityAnimations
open fun cancelAllVelocityAnimations()
Interrupts any ongoing gesture velocity animations.
cancelTransitions
open fun cancelTransitions()
Cancels ongoing animations.
easeCamera
fun easeCamera(update: CameraUpdate)
fun easeCamera(update: CameraUpdate, callback: MapboxMap.CancelableCallback)
Gradually move the camera by the default duration, zoom will not be affected unless specifiedwithin CameraUpdate.
fun easeCamera(update: CameraUpdate, durationMs: Int)
fun easeCamera(update: CameraUpdate, durationMs: Int, easingInterpolator: Boolean)
fun easeCamera(update: CameraUpdate, durationMs: Int, callback: MapboxMap.CancelableCallback)
fun easeCamera(update: CameraUpdate, durationMs: Int, easingInterpolator: Boolean, callback: MapboxMap.CancelableCallback)
Gradually move the camera by a specified duration in milliseconds, zoom will not be affectedunless specified within CameraUpdate.
getCameraForGeometry
@Nullable()
open fun getCameraForGeometry(geometry: Geometry): CameraPosition
Get a camera position that fits a provided shape.
@Nullable()
open fun getCameraForGeometry(geometry: Geometry, padding: Array): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)
Get a camera position that fits a provided shape and padding.
@Nullable()
open fun [getCameraForGeometry](#getcameraforgeometry)(geometry: Geometry, bearing: Double, tilt: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)
Get a camera position that fits a provided shape with a given bearing and tilt.
@Nullable()
open fun [getCameraForGeometry](#getcameraforgeometry)(geometry: Geometry, padding: Array, bearing: Double, tilt: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)
Get a camera position that fits a provided shape with a given padding, bearing and tilt.
getCameraForLatLngBounds
@Nullable()
open fun getCameraForLatLngBounds(latLngBounds: LatLngBounds): CameraPosition
Get a camera position that fits a provided bounds and the current camera tilt and bearing.
@Nullable()
open fun getCameraForLatLngBounds(latLngBounds: LatLngBounds, padding: Array): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)
Get a camera position that fits a provided bounds and padding and the current camera tilt and bearing.
@Nullable()
open fun [getCameraForLatLngBounds](#getcameraforlatlngbounds)(latLngBounds: [LatLngBounds](../com.mapbox.mapboxsdk.geometry/#latlngbounds), bearing: Double, tilt: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)
Get a camera position that fits a provided bounds, bearing and tilt.
@Nullable()
open fun [getCameraForLatLngBounds](#getcameraforlatlngbounds)(latLngBounds: [LatLngBounds](../com.mapbox.mapboxsdk.geometry/#latlngbounds), padding: Array, bearing: Double, tilt: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)
Get a camera position that fits a provided bounds, padding, bearing and tilt.
getCameraPosition
@NonNull()
fun getCameraPosition(): CameraPosition
Gets the current position of the camera.The CameraPosition returned is a snapshot of the current position, and will not automatically update when thecamera moves.
getGesturesManager
@NonNull()
open fun getGesturesManager(): AndroidGesturesManager
Get current AndroidGesturesManager that handles android.view.MotionEventsregistered by the MapView
getHeight
open fun getHeight(): Float
Returns the measured height of the Map.
getMaxPitch
open fun getMaxPitch(): Double
Gets the maximum Pitch the map can be displayed at.
getMaxZoomLevel
open fun getMaxZoomLevel(): Double
Gets the maximum zoom level the map can be displayed at.
getMinPitch
open fun getMinPitch(): Double
Gets the minimum Pitch the map can be displayed at.
getMinZoomLevel
open fun getMinZoomLevel(): Double
Gets the minimum zoom level the map can be displayed at.
getNativeMapPtr
open fun getNativeMapPtr(): Long
Experimental feature.
getOnInfoWindowClickListener
@Nullable()
open fun getOnInfoWindowClickListener(): MapboxMap.OnInfoWindowClickListener
Return the InfoWindow click listener
getOnInfoWindowCloseListener
@Nullable()
open fun getOnInfoWindowCloseListener(): MapboxMap.OnInfoWindowCloseListener
Return the InfoWindow close listener
getOnInfoWindowLongClickListener
@Nullable()
open fun getOnInfoWindowLongClickListener(): MapboxMap.OnInfoWindowLongClickListener
Return the InfoWindow long click listener
getPrefetchZoomDelta
open fun getPrefetchZoomDelta(): Int
Check current pre-fetching zoom delta.
getWidth
open fun getWidth(): Float
Returns the measured width of the Map.
initialise
open fun initialise(context: Context, options: MapboxMapOptions)
injectAnnotationManager
open fun injectAnnotationManager(annotationManager: AnnotationManager)
injectLocationComponent
open fun injectLocationComponent(locationComponent: LocationComponent)
isDebugActive
open fun isDebugActive(): Boolean
Returns whether the map debug information is currently shown.
moveCamera
fun moveCamera(update: CameraUpdate)
fun moveCamera(update: CameraUpdate, callback: MapboxMap.CancelableCallback)
Repositions the camera according to the instructions defined in the update.The move is instantaneous, and a subsequent getCameraPosition() will reflect the new position.See CameraUpdateFactory for a set of updates.
notifyStyleLoaded
open fun notifyStyleLoaded()
onDestroy
open fun onDestroy()
Called when the hosting Activity/Fragment onDestroy()/onDestroyView() method is called.
onFailLoadingStyle
open fun onFailLoadingStyle()
Called when the map failed loading a style.
onFinishLoadingStyle
open fun onFinishLoadingStyle()
Called when the map finished loading a style.
onPostMapReady
open fun onPostMapReady()
Called when the OnMapReadyCallback has finished executing.
onPreMapReady
open fun onPreMapReady()
Called before the OnMapReadyCallback is invoked.
onRestoreInstanceState
open fun onRestoreInstanceState(savedInstanceState: Bundle)
Called when the hosting Activity/Fragment is recreated and map state needs to be restored.
onSaveInstanceState
open fun onSaveInstanceState(outState: Bundle)
Called when the hosting Activity/Fragment is going to be destroyed and map state needs to be saved.
onStart
open fun onStart()
Called when the hosting Activity/Fragment onStart() method is called.
onStop
open fun onStop()
Called when the hosting Activity/Fragment onStop() method is called.
onUpdateFullyRendered
open fun onUpdateFullyRendered()
Called when the map frame is fully rendered.
onUpdateRegionChange
open fun onUpdateRegionChange()
Called when the region is changing or has changed.
queryRenderedFeatures
@NonNull()
open fun queryRenderedFeatures(coordinates: PointF, layerIds: Array): List
Queries the map for rendered features.
@NonNull()
open fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: RectF, layerIds: Array): List
@NonNull()
open fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: PointF, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression), layerIds: Array): List
@NonNull()
open fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: RectF, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression), layerIds: Array): List
Queries the map for rendered featuresReturns an empty list if either the map or underlying render surface has been destroyed.
removeOnCameraIdleListener
open fun removeOnCameraIdleListener(listener: MapboxMap.OnCameraIdleListener)
Removes a callback that is invoked when camera movement has ended.
removeOnCameraMoveCancelListener
open fun removeOnCameraMoveCancelListener(listener: MapboxMap.OnCameraMoveCanceledListener)
Removes a callback that is invoked when camera movement was cancelled.
removeOnCameraMoveListener
open fun removeOnCameraMoveListener(listener: MapboxMap.OnCameraMoveListener)
Removes a callback that is invoked when camera position changes.
removeOnCameraMoveStartedListener
open fun removeOnCameraMoveStartedListener(listener: MapboxMap.OnCameraMoveStartedListener)
Removes a callback that is invoked when camera movement has started.
removeOnFlingListener
open fun removeOnFlingListener(listener: MapboxMap.OnFlingListener)
Removes a callback that’s invoked when the map is flinged.
removeOnMapClickListener
open fun removeOnMapClickListener(listener: MapboxMap.OnMapClickListener)
Removes a callback that’s invoked when the user clicks on the map view.
removeOnMapLongClickListener
open fun removeOnMapLongClickListener(listener: MapboxMap.OnMapLongClickListener)
Removes a callback that’s invoked when the user long clicks on the map view.
removeOnMoveListener
open fun removeOnMoveListener(listener: MapboxMap.OnMoveListener)
Removes a callback that’s invoked when the map is moved.
removeOnRotateListener
open fun removeOnRotateListener(listener: MapboxMap.OnRotateListener)
Removes a callback that’s invoked when the map is rotated.
removeOnScaleListener
open fun removeOnScaleListener(listener: MapboxMap.OnScaleListener)
Removes a callback that’s invoked when the map is scaled.
removeOnShoveListener
open fun removeOnShoveListener(listener: MapboxMap.OnShoveListener)
Remove a callback that’s invoked when the map is tilted.
resetNorth
open fun resetNorth()
Resets the map view to face north.
scrollBy
open fun scrollBy(x: Float, y: Float)
open fun scrollBy(x: Float, y: Float, duration: Long)
Scrolls the camera over the map, shifting the center of view by the specified number of pixels in the x and ydirections.
setCameraPosition
open fun setCameraPosition(cameraPosition: CameraPosition)
Repositions the camera according to the cameraPosition.The move is instantaneous, and a subsequent getCameraPosition() will reflect the new position.See CameraUpdateFactory for a set of updates.
setFocalBearing
open fun setFocalBearing(bearing: Double, focalX: Float, focalY: Float, duration: Long)
Transform the map bearing given a bearing, focal point coordinates, and a duration.
setGesturesManager
open fun setGesturesManager(androidGesturesManager: AndroidGesturesManager, attachDefaultListeners: Boolean, setDefaultMutuallyExclusives: Boolean)
Sets a custom AndroidGesturesManager to handle android.view.MotionEventsregistered by the MapView.
setLatLngBoundsForCameraTarget
open fun setLatLngBoundsForCameraTarget(latLngBounds: LatLngBounds)
Sets a LatLngBounds that constraints map transformations to this bounds.
setMaxPitchPreference
open fun setMaxPitchPreference(maxPitch: Double)
Sets the maximum Pitch the map can be displayed at.
setMaxZoomPreference
open fun setMaxZoomPreference(maxZoom: Double)
Sets the maximum zoom level the map can be displayed at.
setMinPitchPreference
open fun setMinPitchPreference(minPitch: Double)
Sets the minimum Pitch the map can be displayed at.
setMinZoomPreference
open fun setMinZoomPreference(minZoom: Double)
Sets the minimum zoom level the map can be displayed at.
setOfflineRegionDefinition
open fun setOfflineRegionDefinition(definition: OfflineRegionDefinition)
open fun setOfflineRegionDefinition(definition: OfflineRegionDefinition, callback: Style.OnStyleLoaded)
Loads a new style from the specified offline region definition and moves the map camera to that region.
setOnInfoWindowClickListener
open fun setOnInfoWindowClickListener(listener: MapboxMap.OnInfoWindowClickListener)
Sets a callback that’s invoked when the user clicks on an info window.
setOnInfoWindowCloseListener
open fun setOnInfoWindowCloseListener(listener: MapboxMap.OnInfoWindowCloseListener)
Set an callback to be invoked when an InfoWindow closes.
setOnInfoWindowLongClickListener
open fun setOnInfoWindowLongClickListener(listener: MapboxMap.OnInfoWindowLongClickListener)
Sets a callback that’s invoked when a marker’s info window is long pressed.
setPrefetchZoomDelta
open fun setPrefetchZoomDelta(delta: Int)
Set the tile pre-fetching zoom delta.
snapshot
open fun snapshot(callback: MapboxMap.SnapshotReadyCallback)
Takes a snapshot of the map.
triggerRepaint
open fun triggerRepaint()
Trigger the mapview to repaint.

Properties

Name Summary
debugActive private open var debugActive: Boolean
locationComponent private open val locationComponent: LocationComponent
onFpsChangedListener @Nullable()
private open var onFpsChangedListener: MapboxMap.OnFpsChangedListener
projection private val projection: Projection
style @Nullable()
private open var style: Style
transform private val transform: Transform
uiSettings private val uiSettings: UiSettings

addOnCameraIdleListener

open fun addOnCameraIdleListener(listener: MapboxMap.OnCameraIdleListener)

Adds a callback that is invoked when camera movement has ended.

Parameters
Name Summary
listener
the listener to notify
   
   

addOnCameraMoveCancelListener

open fun addOnCameraMoveCancelListener(listener: MapboxMap.OnCameraMoveCanceledListener)

Adds a callback that is invoked when camera movement was cancelled.

Parameters
Name Summary
listener
the listener to notify
   
   

addOnCameraMoveListener

open fun addOnCameraMoveListener(listener: MapboxMap.OnCameraMoveListener)

Adds a callback that is invoked when camera position changes.

Parameters
Name Summary
listener
the listener to notify
   
   

addOnCameraMoveStartedListener

open fun addOnCameraMoveStartedListener(listener: MapboxMap.OnCameraMoveStartedListener)

Adds a callback that is invoked when camera movement has started.

Parameters
Name Summary
listener
the listener to notify
   
   

addOnFlingListener

open fun addOnFlingListener(listener: MapboxMap.OnFlingListener)

Adds a callback that’s invoked when the map is flinged.

Parameters
Name Summary
listener
The callback that’s invoked when the map is flinged.
   
   

addOnMapClickListener

open fun addOnMapClickListener(listener: MapboxMap.OnMapClickListener)

Adds a callback that’s invoked when the user clicks on the map view.

Parameters
Name Summary
listener
The callback that’s invoked when the user clicks on the map view.
   
   

addOnMapLongClickListener

open fun addOnMapLongClickListener(listener: MapboxMap.OnMapLongClickListener)

Adds a callback that’s invoked when the user long clicks on the map view.

Parameters
Name Summary
listener
The callback that’s invoked when the user long clicks on the map view.
   
   

addOnMoveListener

open fun addOnMoveListener(listener: MapboxMap.OnMoveListener)

Adds a callback that’s invoked when the map is moved.

Parameters
Name Summary
listener
The callback that’s invoked when the map is moved.
   
   

addOnRotateListener

open fun addOnRotateListener(listener: MapboxMap.OnRotateListener)

Adds a callback that’s invoked when the map is rotated.

Parameters
Name Summary
listener
The callback that’s invoked when the map is rotated.
   
   

addOnScaleListener

open fun addOnScaleListener(listener: MapboxMap.OnScaleListener)

Adds a callback that’s invoked when the map is scaled.

Parameters
Name Summary
listener
The callback that’s invoked when the map is scaled.
   
   

addOnShoveListener

open fun addOnShoveListener(listener: MapboxMap.OnShoveListener)

Adds a callback that’s invoked when the map is tilted.

Parameters
Name Summary
listener
The callback that’s invoked when the map is tilted.
   
   

animateCamera

fun animateCamera(update: CameraUpdate)

Animate the camera to a new location defined within CameraUpdate using a transitionanimation that evokes powered flight. The animation will last the default amount of time.During the animation, a call to getCameraPosition returns an intermediate locationof the camera in flight.

See also

Name Summary
com.mapbox.mapboxsdk.camera.CameraUpdateFactory
for a set of updates.
   
Parameters
Name Summary
update
The change that should be applied to the camera.
   
   

fun animateCamera(update: CameraUpdate, callback: MapboxMap.CancelableCallback)

Animate the camera to a new location defined within CameraUpdate using a transitionanimation that evokes powered flight. The animation will last the default amount of time. Acallback can be used to be notified when animating the camera stops. During the animation, acall to getCameraPosition returns an intermediate location of the camera in flight.

See also

Name Summary
com.mapbox.mapboxsdk.camera.CameraUpdateFactory
for a set of updates.
   
Parameters
Name Summary
update
The change that should be applied to the camera.
callback
The callback to invoke from the main thread when the animation stops. If theanimation completes normally, onFinish() is called; otherwise, onCancel() iscalled. Do not update or animate the camera from within onCancel().
   
   

fun animateCamera(update: CameraUpdate, durationMs: Int)

Animate the camera to a new location defined within CameraUpdate using a transitionanimation that evokes powered flight. The animation will last a specified amount of timegiven in milliseconds. During the animation, a call to getCameraPosition returnsan intermediate location of the camera in flight.

See also

Name Summary
com.mapbox.mapboxsdk.camera.CameraUpdateFactory
for a set of updates.
   
Parameters
Name Summary
update
The change that should be applied to the camera.
durationMs
The duration of the animation in milliseconds. This must be strictlypositive, otherwise an IllegalArgumentException will be thrown.
   
   

fun animateCamera(update: CameraUpdate, durationMs: Int, callback: MapboxMap.CancelableCallback)

Animate the camera to a new location defined within CameraUpdate using a transitionanimation that evokes powered flight. The animation will last a specified amount of timegiven in milliseconds. A callback can be used to be notified when animating the camera stops.During the animation, a call to getCameraPosition returns an intermediate locationof the camera in flight.

See also

Name Summary
com.mapbox.mapboxsdk.camera.CameraUpdateFactory
for a set of updates.
   
Parameters
Name Summary
update
The change that should be applied to the camera.
durationMs
The duration of the animation in milliseconds. This must be strictlypositive, otherwise an IllegalArgumentException will be thrown.
callback
An optional callback to be notified from the main thread when the animationstops. If the animation stops due to its natural completion, the callbackwill be notified with onFinish(). If the animation stops due to interruptionby a later camera movement or a user gesture, onCancel() will be called.Do not update or animate the camera from within onCancel(). If a callbackisn’t required, leave it as null.
   
   

cancelAllVelocityAnimations

open fun cancelAllVelocityAnimations()

Interrupts any ongoing gesture velocity animations.

cancelTransitions

open fun cancelTransitions()

Cancels ongoing animations.

This invokes the CancelableCallback for ongoing camera updates.

debugActive

private open var debugActive: Boolean

easeCamera

fun easeCamera(update: CameraUpdate)

Gradually move the camera by the default duration, zoom will not be affected unless specifiedwithin CameraUpdate. If getCameraPosition is called during the animation,it will return the current location of the camera in flight.

See also

Name Summary
com.mapbox.mapboxsdk.camera.CameraUpdateFactory
for a set of updates.
   
Parameters
Name Summary
update
The change that should be applied to the camera.
   
   

fun easeCamera(update: CameraUpdate, callback: MapboxMap.CancelableCallback)

Gradually move the camera by the default duration, zoom will not be affected unless specifiedwithin CameraUpdate. If getCameraPosition is called during the animation,it will return the current location of the camera in flight.

See also

Name Summary
com.mapbox.mapboxsdk.camera.CameraUpdateFactory
for a set of updates.
   
Parameters
Name Summary
update
The change that should be applied to the camera.
callback
An optional callback to be notified from the main thread when the animationstops. If the animation stops due to its natural completion, the callbackwill be notified with onFinish(). If the animation stops due to interruptionby a later camera movement or a user gesture, onCancel() will be called.Do not update or ease the camera from within onCancel().
   
   

fun easeCamera(update: CameraUpdate, durationMs: Int)

Gradually move the camera by a specified duration in milliseconds, zoom will not be affectedunless specified within CameraUpdate. If getCameraPosition is calledduring the animation, it will return the current location of the camera in flight.

See also

Name Summary
com.mapbox.mapboxsdk.camera.CameraUpdateFactory
for a set of updates.
   
Parameters
Name Summary
update
The change that should be applied to the camera.
durationMs
The duration of the animation in milliseconds. This must be strictlypositive, otherwise an IllegalArgumentException will be thrown.
   
   

fun easeCamera(update: CameraUpdate, durationMs: Int, callback: MapboxMap.CancelableCallback)

Gradually move the camera by a specified duration in milliseconds, zoom will not be affectedunless specified within CameraUpdate. A callback can be used to be notified wheneasing the camera stops. If getCameraPosition is called during the animation, itwill return the current location of the camera in flight.

Note that this will cancel location tracking mode if enabled.

See also

Name Summary
com.mapbox.mapboxsdk.camera.CameraUpdateFactory
for a set of updates.
   
Parameters
Name Summary
update
The change that should be applied to the camera.
durationMs
The duration of the animation in milliseconds. This must be strictlypositive, otherwise an IllegalArgumentException will be thrown.
callback
An optional callback to be notified from the main thread when the animationstops. If the animation stops due to its natural completion, the callbackwill be notified with onFinish(). If the animation stops due to interruptionby a later camera movement or a user gesture, onCancel() will be called.Do not update or ease the camera from within onCancel().
   
   

fun easeCamera(update: CameraUpdate, durationMs: Int, easingInterpolator: Boolean)

Gradually move the camera by a specified duration in milliseconds, zoom will not be affectedunless specified within CameraUpdate. A callback can be used to be notified wheneasing the camera stops. If getCameraPosition is called during the animation, itwill return the current location of the camera in flight.

Note that this will cancel location tracking mode if enabled.

Parameters
Name Summary
update
The change that should be applied to the camera.
durationMs
The duration of the animation in milliseconds. This must be strictlypositive, otherwise an IllegalArgumentException will be thrown.
easingInterpolator
True for easing interpolator, false for linear.
   
   

fun easeCamera(update: CameraUpdate, durationMs: Int, easingInterpolator: Boolean, callback: MapboxMap.CancelableCallback)

Gradually move the camera by a specified duration in milliseconds, zoom will not be affectedunless specified within CameraUpdate. A callback can be used to be notified wheneasing the camera stops. If getCameraPosition is called during the animation, itwill return the current location of the camera in flight.

Parameters
Name Summary
update
The change that should be applied to the camera.
durationMs
The duration of the animation in milliseconds. This must be strictlypositive, otherwise an IllegalArgumentException will be thrown.
easingInterpolator
True for easing interpolator, false for linear.
callback
An optional callback to be notified from the main thread when the animationstops. If the animation stops due to its natural completion, the callbackwill be notified with onFinish(). If the animation stops due to interruptionby a later camera movement or a user gesture, onCancel() will be called.Do not update or ease the camera from within onCancel().
   
   

getCameraForGeometry

@Nullable()

open fun getCameraForGeometry(geometry: Geometry): CameraPosition

Get a camera position that fits a provided shape.

Return

the camera position that fits the geometry inside

Parameters
Name Summary
geometry
the geometry to wraps the map with
   
   

@Nullable()

open fun getCameraForGeometry(geometry: Geometry, padding: Array): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)

Get a camera position that fits a provided shape and padding.

Return

the camera position that fits the geometry inside and padding

Parameters
Name Summary
geometry
the geometry to wraps the map with
padding
the padding to apply to the bounds
   
   

@Nullable()

open fun getCameraForGeometry(geometry: Geometry, bearing: Double, tilt: Double): CameraPosition

Get a camera position that fits a provided shape with a given bearing and tilt.

Return

the camera position that the geometry inside with bearing and tilt

Parameters
Name Summary
geometry
the geometry to wraps the map with
bearing
the bearing at which to compute the geometry’s bounds
tilt
the tilt at which to compute the geometry’s bounds
   
   

@Nullable()

open fun getCameraForGeometry(geometry: Geometry, padding: Array, bearing: Double, tilt: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)

Get a camera position that fits a provided shape with a given padding, bearing and tilt.

Return

the camera position that fits the geometry inside with padding, bearing and tilt

Parameters
Name Summary
geometry
the geometry to wraps the map with
padding
the padding to apply to the bounds
bearing
the bearing at which to compute the geometry’s bounds
tilt
the tilt at which to compute the geometry’s bounds
   
   

getCameraForLatLngBounds

@Nullable()

open fun getCameraForLatLngBounds(latLngBounds: LatLngBounds): CameraPosition

Get a camera position that fits a provided bounds and the current camera tilt and bearing.

Return

the camera position that fits the bounds

Parameters
Name Summary
latLngBounds
the bounds to set the map with
   
   

@Nullable()

open fun getCameraForLatLngBounds(latLngBounds: LatLngBounds, padding: Array): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)

Get a camera position that fits a provided bounds and padding and the current camera tilt and bearing.

Return

the camera position that fits the bounds and padding

Parameters
Name Summary
latLngBounds
the bounds to set the map with
padding
the padding to apply to the bounds
   
   

@Nullable()

open fun getCameraForLatLngBounds(latLngBounds: LatLngBounds, bearing: Double, tilt: Double): CameraPosition

Get a camera position that fits a provided bounds, bearing and tilt.

Return

the camera position that fits the bounds and given bearing and tilt

Parameters
Name Summary
latLngBounds
the bounds to set the map with
bearing
the bearing to transform the camera position with
tilt
to transform the camera position with
   
   

@Nullable()

open fun getCameraForLatLngBounds(latLngBounds: LatLngBounds, padding: Array, bearing: Double, tilt: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)

Get a camera position that fits a provided bounds, padding, bearing and tilt.

Return

the camera position that fits the bounds, bearing and tilt

Parameters
Name Summary
latLngBounds
the bounds to set the map with
padding
the padding to apply to the bounds
bearing
the bearing to transform the camera position with
tilt
to transform the camera position with
   
   

getCameraPosition

@NonNull()

fun getCameraPosition(): CameraPosition

Gets the current position of the camera.The CameraPosition returned is a snapshot of the current position, and will not automatically update when thecamera moves.

Return

The current position of the Camera.

getGesturesManager

@NonNull()

open fun getGesturesManager(): AndroidGesturesManager

Get current AndroidGesturesManager that handles android.view.MotionEventsregistered by the MapView

Return

Current gestures manager.

getHeight

open fun getHeight(): Float

Returns the measured height of the Map.

Return

the height of the map

getMaxPitch

open fun getMaxPitch(): Double

Gets the maximum Pitch the map can be displayed at.

Return

The maximum Pitch.

getMaxZoomLevel

open fun getMaxZoomLevel(): Double

Gets the maximum zoom level the map can be displayed at.

Return

The maximum zoom level.

getMinPitch

open fun getMinPitch(): Double

Gets the minimum Pitch the map can be displayed at.

Return

The minimum Pitch.

getMinZoomLevel

open fun getMinZoomLevel(): Double

Gets the minimum zoom level the map can be displayed at.

Return

The minimum zoom level.

getNativeMapPtr

open fun getNativeMapPtr(): Long

Experimental feature. Do not use.

getOnInfoWindowClickListener

@Nullable()

open fun getOnInfoWindowClickListener(): MapboxMap.OnInfoWindowClickListener

Return the InfoWindow click listener

Return

Current active InfoWindow Click Listener

getOnInfoWindowCloseListener

@Nullable()

open fun getOnInfoWindowCloseListener(): MapboxMap.OnInfoWindowCloseListener

Return the InfoWindow close listener

Return

Current active InfoWindow Close Listener

getOnInfoWindowLongClickListener

@Nullable()

open fun getOnInfoWindowLongClickListener(): MapboxMap.OnInfoWindowLongClickListener

Return the InfoWindow long click listener

Return

Current active InfoWindow long Click Listener

getPrefetchZoomDelta

open fun getPrefetchZoomDelta(): Int

Check current pre-fetching zoom delta.

Return

current zoom delta.

See also

Name Summary
com.mapbox.mapboxsdk.maps.MapboxMap
MapboxMap#setPrefetchZoomDelta(int)
   
   

getWidth

open fun getWidth(): Float

Returns the measured width of the Map.

Return

the width of the map

initialise

open fun initialise(context: Context, options: MapboxMapOptions)

injectAnnotationManager

open fun injectAnnotationManager(annotationManager: AnnotationManager)

injectLocationComponent

open fun injectLocationComponent(locationComponent: LocationComponent)

isDebugActive

open fun isDebugActive(): Boolean

Returns whether the map debug information is currently shown.

Return

If true, map debug information is currently shown.

locationComponent

private open val locationComponent: LocationComponent

moveCamera

fun moveCamera(update: CameraUpdate)

Repositions the camera according to the instructions defined in the update.The move is instantaneous, and a subsequent getCameraPosition() will reflect the new position.See CameraUpdateFactory for a set of updates.

Parameters
Name Summary
update
The change that should be applied to the camera.
   
   

fun moveCamera(update: CameraUpdate, callback: MapboxMap.CancelableCallback)

Repositions the camera according to the instructions defined in the update.The move is instantaneous, and a subsequent getCameraPosition() will reflect the new position.See CameraUpdateFactory for a set of updates.

Parameters
Name Summary
update
The change that should be applied to the camera
callback
the callback to be invoked when an animation finishes or is canceled
   
   

notifyStyleLoaded

open fun notifyStyleLoaded()

onDestroy

open fun onDestroy()

Called when the hosting Activity/Fragment onDestroy()/onDestroyView() method is called.

onFailLoadingStyle

open fun onFailLoadingStyle()

Called when the map failed loading a style.

onFinishLoadingStyle

open fun onFinishLoadingStyle()

Called when the map finished loading a style.

onFpsChangedListener

@Nullable()

private open var onFpsChangedListener: MapboxMap.OnFpsChangedListener

onPostMapReady

open fun onPostMapReady()

Called when the OnMapReadyCallback has finished executing.

Invalidation of the camera position is required to update the added components inOnMapReadyCallback with the correct transformation.

onPreMapReady

open fun onPreMapReady()

Called before the OnMapReadyCallback is invoked.

onRestoreInstanceState

open fun onRestoreInstanceState(savedInstanceState: Bundle)

Called when the hosting Activity/Fragment is recreated and map state needs to be restored.

Parameters
Name Summary
savedInstanceState
the bundle containing the saved state
   
   

onSaveInstanceState

open fun onSaveInstanceState(outState: Bundle)

Called when the hosting Activity/Fragment is going to be destroyed and map state needs to be saved.

Parameters
Name Summary
outState
the bundle to save the state to.
   
   

onStart

open fun onStart()

Called when the hosting Activity/Fragment onStart() method is called.

onStop

open fun onStop()

Called when the hosting Activity/Fragment onStop() method is called.

onUpdateFullyRendered

open fun onUpdateFullyRendered()

Called when the map frame is fully rendered.

onUpdateRegionChange

open fun onUpdateRegionChange()

Called when the region is changing or has changed.

projection

private val projection: Projection

queryRenderedFeatures

@NonNull()

open fun queryRenderedFeatures(coordinates: PointF, layerIds: Array): List

Queries the map for rendered features.

Returns an empty list if either the map or underlying render surface has been destroyed.

Return

the list of feature

Parameters
Name Summary
coordinates
the point to query
layerIds
optionally - only query these layers
   
   

@NonNull()

open fun queryRenderedFeatures(coordinates: PointF, filter: Expression, layerIds: Array): List

Queries the map for rendered features

Returns an empty list if either the map or underlying render surface has been destroyed.

Return

the list of feature

Parameters
Name Summary
coordinates
the point to query
filter
filters the returned features with an expression
layerIds
optionally - only query these layers
   
   

@NonNull()

open fun queryRenderedFeatures(coordinates: RectF, layerIds: Array): List

Queries the map for rendered features

Returns an empty list if either the map or underlying render surface has been destroyed.

Return

the list of feature

Parameters
Name Summary
coordinates
the box to query
layerIds
optionally - only query these layers
   
   

@NonNull()

open fun queryRenderedFeatures(coordinates: RectF, filter: Expression, layerIds: Array): List

Queries the map for rendered features

Returns an empty list if either the map or underlying render surface has been destroyed.

Return

the list of feature

Parameters
Name Summary
coordinates
the box to query
filter
filters the returned features with an expression
layerIds
optionally - only query these layers
   
   

removeOnCameraIdleListener

open fun removeOnCameraIdleListener(listener: MapboxMap.OnCameraIdleListener)

Removes a callback that is invoked when camera movement has ended.

Parameters
Name Summary
listener
the listener to remove
   
   

removeOnCameraMoveCancelListener

open fun removeOnCameraMoveCancelListener(listener: MapboxMap.OnCameraMoveCanceledListener)

Removes a callback that is invoked when camera movement was cancelled.

Parameters
Name Summary
listener
the listener to remove
   
   

removeOnCameraMoveListener

open fun removeOnCameraMoveListener(listener: MapboxMap.OnCameraMoveListener)

Removes a callback that is invoked when camera position changes.

Parameters
Name Summary
listener
the listener to remove
   
   

removeOnCameraMoveStartedListener

open fun removeOnCameraMoveStartedListener(listener: MapboxMap.OnCameraMoveStartedListener)

Removes a callback that is invoked when camera movement has started.

Parameters
Name Summary
listener
the listener to remove
   
   

removeOnFlingListener

open fun removeOnFlingListener(listener: MapboxMap.OnFlingListener)

Removes a callback that’s invoked when the map is flinged.

Parameters
Name Summary
listener
The callback that’s invoked when the map is flinged.
   
   

removeOnMapClickListener

open fun removeOnMapClickListener(listener: MapboxMap.OnMapClickListener)

Removes a callback that’s invoked when the user clicks on the map view.

Parameters
Name Summary
listener
The callback that’s invoked when the user clicks on the map view.
   
   

removeOnMapLongClickListener

open fun removeOnMapLongClickListener(listener: MapboxMap.OnMapLongClickListener)

Removes a callback that’s invoked when the user long clicks on the map view.

Parameters
Name Summary
listener
The callback that’s invoked when the user long clicks on the map view.
   
   

removeOnMoveListener

open fun removeOnMoveListener(listener: MapboxMap.OnMoveListener)

Removes a callback that’s invoked when the map is moved.

Parameters
Name Summary
listener
The callback that’s invoked when the map is moved.
   
   

removeOnRotateListener

open fun removeOnRotateListener(listener: MapboxMap.OnRotateListener)

Removes a callback that’s invoked when the map is rotated.

Parameters
Name Summary
listener
The callback that’s invoked when the map is rotated.
   
   

removeOnScaleListener

open fun removeOnScaleListener(listener: MapboxMap.OnScaleListener)

Removes a callback that’s invoked when the map is scaled.

Parameters
Name Summary
listener
The callback that’s invoked when the map is scaled.
   
   

removeOnShoveListener

open fun removeOnShoveListener(listener: MapboxMap.OnShoveListener)

Remove a callback that’s invoked when the map is tilted.

Parameters
Name Summary
listener
The callback that’s invoked when the map is tilted.
   
   

resetNorth

open fun resetNorth()

Resets the map view to face north.

scrollBy

open fun scrollBy(x: Float, y: Float)

Scrolls the camera over the map, shifting the center of view by the specified number of pixels in the x and ydirections.

Parameters
Name Summary
x
Amount of pixels to scroll to in x direction
y
Amount of pixels to scroll to in y direction
   
   

open fun scrollBy(x: Float, y: Float, duration: Long)

Scrolls the camera over the map, shifting the center of view by the specified number of pixels in the x and ydirections.

Parameters
Name Summary
x
Amount of pixels to scroll to in x direction
y
Amount of pixels to scroll to in y direction
duration
Amount of time the scrolling should take
   
   

setCameraPosition

open fun setCameraPosition(cameraPosition: CameraPosition)

Repositions the camera according to the cameraPosition.The move is instantaneous, and a subsequent getCameraPosition() will reflect the new position.See CameraUpdateFactory for a set of updates.

Parameters
Name Summary
cameraPosition
the camera position to set
   
   

setFocalBearing

open fun setFocalBearing(bearing: Double, focalX: Float, focalY: Float, duration: Long)

Transform the map bearing given a bearing, focal point coordinates, and a duration.

Parameters
Name Summary
bearing
The bearing of the Map to be transformed to
focalX
The x coordinate of the focal point
focalY
The y coordinate of the focal point
duration
The duration of the transformation
   
   

setGesturesManager

open fun setGesturesManager(androidGesturesManager: AndroidGesturesManager, attachDefaultListeners: Boolean, setDefaultMutuallyExclusives: Boolean)

Sets a custom AndroidGesturesManager to handle android.view.MotionEventsregistered by the MapView.

See also

Name Summary
mapbox-gestures-android library
mapbox-gestures-android library
   
Parameters
Name Summary
androidGesturesManager
Gestures manager that interprets gestures based on the motion events.
attachDefaultListeners
If true, pre-defined listeners will be attachto change map based on AndroidGesturesManager callbacks.
setDefaultMutuallyExclusives
If true, pre-defined mutually exclusive gesture setswill be added to the passed gestures manager.
   
   

setLatLngBoundsForCameraTarget

open fun setLatLngBoundsForCameraTarget(latLngBounds: LatLngBounds)

Sets a LatLngBounds that constraints map transformations to this bounds.

Set to null to clear current bounds, newly set bounds will override previously set bounds.

Parameters
Name Summary
latLngBounds
the bounds to constrain the map with
   
   

setMaxPitchPreference

open fun setMaxPitchPreference(maxPitch: Double)

Sets the maximum Pitch the map can be displayed at.

The default and upper bound for maximum Pitch is 60.

Parameters
Name Summary
maxPitch
The new maximum Pitch.
   
   

setMaxZoomPreference

open fun setMaxZoomPreference(maxZoom: Double)

Sets the maximum zoom level the map can be displayed at.

The default maximum zoomn level is 22. The upper bound for this value is 25.5.

Parameters
Name Summary
maxZoom
The new maximum zoom level.
   
   

setMinPitchPreference

open fun setMinPitchPreference(minPitch: Double)

Sets the minimum Pitch the map can be displayed at.

The default and lower bound for minPitch Pitch is 0.

Parameters
Name Summary
minPitch
The new minimum Pitch.
   
   

setMinZoomPreference

open fun setMinZoomPreference(minZoom: Double)

Sets the minimum zoom level the map can be displayed at.

Parameters
Name Summary
minZoom
The new minimum zoom level.
   
   

setOfflineRegionDefinition

open fun setOfflineRegionDefinition(definition: OfflineRegionDefinition)

Loads a new style from the specified offline region definition and moves the map camera to that region.

See also

Name Summary
com.mapbox.mapboxsdk.offline.OfflineRegionDefinition  
   
Parameters
Name Summary
definition
the offline region definition
   
   

open fun setOfflineRegionDefinition(definition: OfflineRegionDefinition, callback: Style.OnStyleLoaded)

Loads a new style from the specified offline region definition and moves the map camera to that region.

See also

Name Summary
com.mapbox.mapboxsdk.offline.OfflineRegionDefinition  
   
Parameters
Name Summary
definition
the offline region definition
callback
the callback to be invoked when the style has loaded
   
   

setOnInfoWindowClickListener

open fun setOnInfoWindowClickListener(listener: MapboxMap.OnInfoWindowClickListener)

Sets a callback that’s invoked when the user clicks on an info window.

Parameters
Name Summary
listener
The callback that’s invoked when the user clicks on an info window.To unset the callback, use null.
   
   

setOnInfoWindowCloseListener

open fun setOnInfoWindowCloseListener(listener: MapboxMap.OnInfoWindowCloseListener)

Set an callback to be invoked when an InfoWindow closes.

Parameters
Name Summary
listener
callback invoked when an InfoWindow closes
   
   

setOnInfoWindowLongClickListener

open fun setOnInfoWindowLongClickListener(listener: MapboxMap.OnInfoWindowLongClickListener)

Sets a callback that’s invoked when a marker’s info window is long pressed.

Parameters
Name Summary
listener
The callback that’s invoked when a marker’s info window is long pressed. To unset the callback,use null.
   
   

setPrefetchZoomDelta

open fun setPrefetchZoomDelta(delta: Int)

Set the tile pre-fetching zoom delta. Pre-fetching makes sure that a low-resolutiontile at the (current_zoom_level - delta) is rendered as soon as possible at theexpense of a little bandwidth.Note: This operation will override the MapboxMapOptions#setPrefetchesTiles(boolean)Setting zoom delta to 0 will disable pre-fetching.Default zoom delta is 4.

Parameters
Name Summary
delta
zoom delta
   
   

snapshot

open fun snapshot(callback: MapboxMap.SnapshotReadyCallback)

Takes a snapshot of the map.

Parameters
Name Summary
callback
Callback method invoked when the snapshot is taken.
   
   

style

@Nullable()

private open var style: Style

transform

private val transform: Transform

triggerRepaint

open fun triggerRepaint()

Trigger the mapview to repaint.

uiSettings

private val uiSettings: UiSettings

CancelableCallback

interface CancelableCallback

Interface definition for a callback to be invoked when a task is complete or cancelled.

Functions

Name Summary
onCancel
abstract fun onCancel()
Invoked when a task is cancelled.
onFinish
abstract fun onFinish()
Invoked when a task is complete.

onCancel

abstract fun onCancel()

Invoked when a task is cancelled.

onFinish

abstract fun onFinish()

Invoked when a task is complete.

OnCameraIdleListener

interface OnCameraIdleListener

Interface definition for a callback to be invoked for when camera movement has ended.

Functions

Name Summary
onCameraIdle
abstract fun onCameraIdle()
Called when camera movement has ended.

Inheritors

Name
CameraChangeDispatcher

onCameraIdle

abstract fun onCameraIdle()

Called when camera movement has ended.

OnCameraMoveCanceledListener

interface OnCameraMoveCanceledListener

Interface definition for a callback to be invoked for when the camera’s motion has been stopped or when the camerastarts moving for a new reason.

Functions

Name Summary
onCameraMoveCanceled
abstract fun onCameraMoveCanceled()
Called when the developer explicitly calls the cancelTransitions() method or if the reason for camera motion haschanged before the onCameraIdle had a chance to fire after the previous animation.Do not update or animate the camera from within this method.

Inheritors

Name
CameraChangeDispatcher

onCameraMoveCanceled

abstract fun onCameraMoveCanceled()

Called when the developer explicitly calls the cancelTransitions() method or if the reason for camera motion haschanged before the onCameraIdle had a chance to fire after the previous animation.Do not update or animate the camera from within this method.

OnCameraMoveListener

interface OnCameraMoveListener

Interface definition for a callback to be invoked for when the camera changes position.

Functions

Name Summary
onCameraMove
abstract fun onCameraMove()
Called repeatedly as the camera continues to move after an onCameraMoveStarted call.This may be called as often as once every frame and should not perform expensive operations.

Inheritors

Name
CameraChangeDispatcher

onCameraMove

abstract fun onCameraMove()

Called repeatedly as the camera continues to move after an onCameraMoveStarted call.This may be called as often as once every frame and should not perform expensive operations.

OnCameraMoveStartedListener

interface OnCameraMoveStartedListener

Interface definition for a callback to be invoked for when the camera motion starts.

Functions

Name Summary
onCameraMoveStarted
abstract fun onCameraMoveStarted(reason: Int)
Called when the camera starts moving after it has been idle or when the reason for camera motion has changed.

Properties

Name Summary
REASON_API_ANIMATION val REASON_API_ANIMATION: Int
REASON_API_GESTURE val REASON_API_GESTURE: Int
REASON_DEVELOPER_ANIMATION val REASON_DEVELOPER_ANIMATION: Int

Inheritors

Name
CameraChangeDispatcher

REASON_API_ANIMATION

val REASON_API_ANIMATION: Int

REASON_API_GESTURE

val REASON_API_GESTURE: Int

REASON_DEVELOPER_ANIMATION

val REASON_DEVELOPER_ANIMATION: Int

onCameraMoveStarted

abstract fun onCameraMoveStarted(reason: Int)

Called when the camera starts moving after it has been idle or when the reason for camera motion has changed.

Parameters
Name Summary
reason
the reason for the camera change
   
   

OnCompassAnimationListener

interface OnCompassAnimationListener

Interface definition for a callback to be invoked for when the compass is animating.

Functions

Name Summary
onCompassAnimation
abstract fun onCompassAnimation()
Called repeatedly as the compass continues to move after clicking on it.
onCompassAnimationFinished
abstract fun onCompassAnimationFinished()
Called when compass animation has ended.

onCompassAnimationFinished

abstract fun onCompassAnimationFinished()

Called when compass animation has ended.

onCompassAnimation

abstract fun onCompassAnimation()

Called repeatedly as the compass continues to move after clicking on it.

OnDeveloperAnimationListener

interface OnDeveloperAnimationListener

Internal use.

Functions

Name Summary
onDeveloperAnimationStarted
abstract fun onDeveloperAnimationStarted()
Notifies listener when a developer invoked animation is about to start.

onDeveloperAnimationStarted

abstract fun onDeveloperAnimationStarted()

Notifies listener when a developer invoked animation is about to start.

OnFlingListener

interface OnFlingListener

Interface definition for a callback to be invoked when the map is flinged.

See also

Name Summary
com.mapbox.mapboxsdk.maps.MapboxMap
MapboxMap#addOnFlingListener(OnFlingListener)
   

Functions

Name Summary
onFling
abstract fun onFling()
Called when the map is flinged.

onFling

abstract fun onFling()

Called when the map is flinged.

OnFpsChangedListener

interface OnFpsChangedListener

Interface definition for a callback to be invoked when a frame is rendered to the map view.

See also

Name Summary
com.mapbox.mapboxsdk.maps.MapboxMap
MapboxMap#setOnFpsChangedListener(OnFpsChangedListener)
   

Functions

Name Summary
onFpsChanged
abstract fun onFpsChanged(fps: Double)
Called for every frame rendered to the map view.

onFpsChanged

abstract fun onFpsChanged(fps: Double)

Called for every frame rendered to the map view.

Parameters
Name Summary
fps
The average number of frames rendered over the last second.
   
   

OnGesturesManagerInteractionListener

interface OnGesturesManagerInteractionListener

Interface definition for a callback to be invoked when a user registers an listener that isrelated to touch and click events.

Functions

Name Summary
cancelAllVelocityAnimations
abstract fun cancelAllVelocityAnimations()
getGesturesManager
abstract fun getGesturesManager(): AndroidGesturesManager
onAddFlingListener
abstract fun onAddFlingListener(listener: MapboxMap.OnFlingListener)
onAddMapClickListener
abstract fun onAddMapClickListener(listener: MapboxMap.OnMapClickListener)
onAddMapLongClickListener
abstract fun onAddMapLongClickListener(listener: MapboxMap.OnMapLongClickListener)
onAddMoveListener
abstract fun onAddMoveListener(listener: MapboxMap.OnMoveListener)
onAddRotateListener
abstract fun onAddRotateListener(listener: MapboxMap.OnRotateListener)
onAddScaleListener
abstract fun onAddScaleListener(listener: MapboxMap.OnScaleListener)
onAddShoveListener
abstract fun onAddShoveListener(listener: MapboxMap.OnShoveListener)
onRemoveFlingListener
abstract fun onRemoveFlingListener(listener: MapboxMap.OnFlingListener)
onRemoveMapClickListener
abstract fun onRemoveMapClickListener(listener: MapboxMap.OnMapClickListener)
onRemoveMapLongClickListener
abstract fun onRemoveMapLongClickListener(listener: MapboxMap.OnMapLongClickListener)
onRemoveMoveListener
abstract fun onRemoveMoveListener(listener: MapboxMap.OnMoveListener)
onRemoveRotateListener
abstract fun onRemoveRotateListener(listener: MapboxMap.OnRotateListener)
onRemoveScaleListener
abstract fun onRemoveScaleListener(listener: MapboxMap.OnScaleListener)
onRemoveShoveListener
abstract fun onRemoveShoveListener(listener: MapboxMap.OnShoveListener)
setGesturesManager
abstract fun setGesturesManager(gesturesManager: AndroidGesturesManager, attachDefaultListeners: Boolean, setDefaultMutuallyExclusives: Boolean)

cancelAllVelocityAnimations

abstract fun cancelAllVelocityAnimations()

getGesturesManager

abstract fun getGesturesManager(): AndroidGesturesManager

onAddFlingListener

abstract fun onAddFlingListener(listener: MapboxMap.OnFlingListener)

onAddMapClickListener

abstract fun onAddMapClickListener(listener: MapboxMap.OnMapClickListener)

onAddMapLongClickListener

abstract fun onAddMapLongClickListener(listener: MapboxMap.OnMapLongClickListener)

onAddMoveListener

abstract fun onAddMoveListener(listener: MapboxMap.OnMoveListener)

onAddRotateListener

abstract fun onAddRotateListener(listener: MapboxMap.OnRotateListener)

onAddScaleListener

abstract fun onAddScaleListener(listener: MapboxMap.OnScaleListener)

onAddShoveListener

abstract fun onAddShoveListener(listener: MapboxMap.OnShoveListener)

onRemoveFlingListener

abstract fun onRemoveFlingListener(listener: MapboxMap.OnFlingListener)

onRemoveMapClickListener

abstract fun onRemoveMapClickListener(listener: MapboxMap.OnMapClickListener)

onRemoveMapLongClickListener

abstract fun onRemoveMapLongClickListener(listener: MapboxMap.OnMapLongClickListener)

onRemoveMoveListener

abstract fun onRemoveMoveListener(listener: MapboxMap.OnMoveListener)

onRemoveRotateListener

abstract fun onRemoveRotateListener(listener: MapboxMap.OnRotateListener)

onRemoveScaleListener

abstract fun onRemoveScaleListener(listener: MapboxMap.OnScaleListener)

onRemoveShoveListener

abstract fun onRemoveShoveListener(listener: MapboxMap.OnShoveListener)

setGesturesManager

abstract fun setGesturesManager(gesturesManager: AndroidGesturesManager, attachDefaultListeners: Boolean, setDefaultMutuallyExclusives: Boolean)

OnInfoWindowClickListener

interface OnInfoWindowClickListener

Interface definition for a callback to be invoked when the user clicks on an info window.

See also

Name Summary
com.mapbox.mapboxsdk.maps.MapboxMap
MapboxMap#setOnInfoWindowClickListener(OnInfoWindowClickListener)
   

Functions

Name Summary
onInfoWindowClick
abstract fun onInfoWindowClick(marker: Marker): Boolean
Called when the user clicks on an info window.

onInfoWindowClick

abstract fun onInfoWindowClick(marker: Marker): Boolean

Called when the user clicks on an info window.

Return

If true the listener has consumed the event and the info window will not be closed.

Parameters
Name Summary
marker
The marker of the info window the user clicked on.
   
   

OnInfoWindowCloseListener

interface OnInfoWindowCloseListener

Interface definition for a callback to be invoked when a marker’s info window is closed.

See also

Name Summary
com.mapbox.mapboxsdk.maps.MapboxMap
MapboxMap#setOnInfoWindowCloseListener(OnInfoWindowCloseListener)
   

Functions

Name Summary
onInfoWindowClose
abstract fun onInfoWindowClose(marker: Marker)
Called when the marker’s info window is closed.

onInfoWindowClose

abstract fun onInfoWindowClose(marker: Marker)

Called when the marker’s info window is closed.

Parameters
Name Summary
marker
The marker of the info window that was closed.
   
   

OnInfoWindowLongClickListener

interface OnInfoWindowLongClickListener

Interface definition for a callback to be invoked when the user long presses on a marker’s info window.

See also

Name Summary
com.mapbox.mapboxsdk.maps.MapboxMap
MapboxMap#setOnInfoWindowClickListener(OnInfoWindowClickListener)
   

Functions

Name Summary
onInfoWindowLongClick
abstract fun onInfoWindowLongClick(marker: Marker)
Called when the user makes a long-press gesture on the marker’s info window.

onInfoWindowLongClick

abstract fun onInfoWindowLongClick(marker: Marker)

Called when the user makes a long-press gesture on the marker’s info window.

Parameters
Name Summary
marker
The marker were the info window is attached to
   
   

OnMapClickListener

interface OnMapClickListener

Interface definition for a callback to be invoked when the user clicks on the map view.

See also

Name Summary
com.mapbox.mapboxsdk.maps.MapboxMap
MapboxMap#addOnMapClickListener(OnMapClickListener)
   

Functions

Name Summary
onMapClick
abstract fun onMapClick(point: LatLng): Boolean
Called when the user clicks on the map view.

onMapClick

abstract fun onMapClick(point: LatLng): Boolean

Called when the user clicks on the map view.

Return

True if this click should be consumed and not passed further to other listeners registered afterwards,false otherwise.

Parameters
Name Summary
point
The projected map coordinate the user clicked on.
   
   

OnMapLongClickListener

interface OnMapLongClickListener

Interface definition for a callback to be invoked when the user long clicks on the map view.

See also

Name Summary
com.mapbox.mapboxsdk.maps.MapboxMap
MapboxMap#addOnMapLongClickListener(OnMapLongClickListener)
   

Functions

Name Summary
onMapLongClick
abstract fun onMapLongClick(point: LatLng): Boolean
Called when the user long clicks on the map view.

onMapLongClick

abstract fun onMapLongClick(point: LatLng): Boolean

Called when the user long clicks on the map view.

Return

True if this click should be consumed and not passed further to other listeners registered afterwards,false otherwise.

Parameters
Name Summary
point
The projected map coordinate the user long clicked on.
   
   

OnMoveListener

interface OnMoveListener

Interface definition for a callback to be invoked when the map is moved.

See also

Name Summary
com.mapbox.mapboxsdk.maps.MapboxMap
MapboxMap#addOnMoveListener(OnMoveListener)
   

Functions

Name Summary
onMove
abstract fun onMove(detector: MoveGestureDetector)
onMoveBegin
abstract fun onMoveBegin(detector: MoveGestureDetector)
onMoveEnd
abstract fun onMoveEnd(detector: MoveGestureDetector)

onMoveBegin

abstract fun onMoveBegin(detector: MoveGestureDetector)

onMoveEnd

abstract fun onMoveEnd(detector: MoveGestureDetector)

onMove

abstract fun onMove(detector: MoveGestureDetector)

OnRotateListener

interface OnRotateListener

Interface definition for a callback to be invoked when the map is rotated.

See also

Name Summary
com.mapbox.mapboxsdk.maps.MapboxMap
MapboxMap#addOnRotateListener(OnRotateListener)
   

Functions

Name Summary
onRotate
abstract fun onRotate(detector: RotateGestureDetector)
onRotateBegin
abstract fun onRotateBegin(detector: RotateGestureDetector)
onRotateEnd
abstract fun onRotateEnd(detector: RotateGestureDetector)

onRotateBegin

abstract fun onRotateBegin(detector: RotateGestureDetector)

onRotateEnd

abstract fun onRotateEnd(detector: RotateGestureDetector)

onRotate

abstract fun onRotate(detector: RotateGestureDetector)

OnScaleListener

interface OnScaleListener

Interface definition for a callback to be invoked when the map is scaled.

See also

Name Summary
com.mapbox.mapboxsdk.maps.MapboxMap
MapboxMap#addOnScaleListener(OnScaleListener)
   

Functions

Name Summary
onScale
abstract fun onScale(detector: StandardScaleGestureDetector)
onScaleBegin
abstract fun onScaleBegin(detector: StandardScaleGestureDetector)
onScaleEnd
abstract fun onScaleEnd(detector: StandardScaleGestureDetector)

onScaleBegin

abstract fun onScaleBegin(detector: StandardScaleGestureDetector)

onScaleEnd

abstract fun onScaleEnd(detector: StandardScaleGestureDetector)

onScale

abstract fun onScale(detector: StandardScaleGestureDetector)

OnShoveListener

interface OnShoveListener

Interface definition for a callback to be invoked when the map is tilted.

See also

Name Summary
com.mapbox.mapboxsdk.maps.MapboxMap
MapboxMap#addOnShoveListener(OnShoveListener)
   

Functions

Name Summary
onShove
abstract fun onShove(detector: ShoveGestureDetector)
onShoveBegin
abstract fun onShoveBegin(detector: ShoveGestureDetector)
onShoveEnd
abstract fun onShoveEnd(detector: ShoveGestureDetector)

onShoveBegin

abstract fun onShoveBegin(detector: ShoveGestureDetector)

onShoveEnd

abstract fun onShoveEnd(detector: ShoveGestureDetector)

onShove

abstract fun onShove(detector: ShoveGestureDetector)

SnapshotReadyCallback

interface SnapshotReadyCallback

Interface definition for a callback to be invoked when the snapshot has been taken.

Functions

Name Summary
onSnapshotReady
abstract fun onSnapshotReady(snapshot: Bitmap)
Invoked when the snapshot has been taken.

onSnapshotReady

abstract fun onSnapshotReady(snapshot: Bitmap)

Invoked when the snapshot has been taken.

Parameters
Name Summary
snapshot
the snapshot bitmap
   
   

MapboxMapOptions

open class MapboxMapOptions : Parcelable

Defines configuration MapboxMapMapOptions 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.

Functions

Name Summary
apiBaseUri
@NonNull()
open fun apiBaseUri(apiBaseUri: String): MapboxMapOptions
Specifies the URI used for API endpoint.
attributionEnabled
@NonNull()
open fun attributionEnabled(enabled: Boolean): MapboxMapOptions
Specifies the visibility state of a attribution for a map view.
attributionGravity
@NonNull()
open fun attributionGravity(gravity: Int): MapboxMapOptions
Specifies the gravity state of attribution for a map view.
attributionMargins
@NonNull()
open fun attributionMargins(margins: Array): [MapboxMapOptions](#mapboxmapoptions)
Specifies the margin state of attribution for a map view
attributionTintColor
@NonNull()
open fun attributionTintColor(color: Int): MapboxMapOptions
Specifies the tint color of the attribution for a map view
camera
@NonNull()
open fun camera(cameraPosition: CameraPosition): MapboxMapOptions
Specifies a the initial camera position for the map view.
compassEnabled
@NonNull()
open fun compassEnabled(enabled: Boolean): MapboxMapOptions
Specifies the visibility state of a mapbox_compass_icon for a map view.
compassFadesWhenFacingNorth
@NonNull()
open fun compassFadesWhenFacingNorth(compassFadeWhenFacingNorth: Boolean): MapboxMapOptions
Specifies if the mapbox_compass_icon fades to invisible when facing north.
compassGravity
@NonNull()
open fun compassGravity(gravity: Int): MapboxMapOptions
Specifies the gravity state of mapbox_compass_icon for a map view.
compassImage
@NonNull()
open fun compassImage(compass: Drawable): MapboxMapOptions
Specifies the image of the CompassView.
compassMargins
@NonNull()
open fun compassMargins(margins: Array): [MapboxMapOptions](#mapboxmapoptions)
Specifies the margin state of mapbox_compass_icon for a map view
createFromAttributes
@NonNull()
open fun createFromAttributes(context: Context): MapboxMapOptions
Creates a default MapboxMapsOptions from a given context.
@NonNull()
open fun createFromAttributes(context: Context, attrs: AttributeSet): MapboxMapOptions
Creates a MapboxMapsOptions from the attribute set.
open fun createFromAttributes(mapboxMapOptions: MapboxMapOptions, context: Context, typedArray: TypedArray): MapboxMapOptions
crossSourceCollisions
@NonNull()
open fun crossSourceCollisions(crossSourceCollisions: Boolean): MapboxMapOptions
Enable cross-source symbol collision detection, defaults to true.
debugActive
@NonNull()
open fun debugActive(enabled: Boolean): MapboxMapOptions
Specifies the used debug type for a map view.
describeContents
abstract fun describeContents(): Int
open fun describeContents(): Int
doubleTapGesturesEnabled
@NonNull()
open fun doubleTapGesturesEnabled(enabled: Boolean): MapboxMapOptions
Specifies if the double tap gesture is enabled for a map view.
equals
open fun equals(o: Any): Boolean
foregroundLoadColor
@NonNull()
open fun foregroundLoadColor(loadColor: Int): MapboxMapOptions
Set the MapView foreground color that is used when the map surface is being created.
getCamera
open fun getCamera(): CameraPosition
Get the current configured initial camera position for a map view.
getCompassFadeFacingNorth
open fun getCompassFadeFacingNorth(): Boolean
Get the current configured state for fading the mapbox_compass_icon when facing north.
getMaxPitchPreference
open fun getMaxPitchPreference(): Double
Get the current configured maximum pitch for a map view.
getMaxZoomPreference
open fun getMaxZoomPreference(): Double
Get the current configured maximum zoom for a map view.
getMinPitchPreference
open fun getMinPitchPreference(): Double
Get the current configured min pitch for a map view.
getMinZoomPreference
open fun getMinZoomPreference(): Double
Get the current configured min zoom for a map view.
getRenderSurfaceOnTop
open fun getRenderSurfaceOnTop(): Boolean
Get the flag to render the map surface on top of another surface.
hashCode
open fun hashCode(): Int
horizontalScrollGesturesEnabled
@NonNull()
open fun horizontalScrollGesturesEnabled(enabled: Boolean): MapboxMapOptions
Specifies if the horizontal scroll gesture is enabled for a map view.
isLocalIdeographFontFamilyEnabled
open fun isLocalIdeographFontFamilyEnabled(): Boolean
Returns true if local ideograph font family is enabled, defaults to true.
localIdeographFontFamily
@NonNull()
open fun localIdeographFontFamily(fontFamilies: Array): [MapboxMapOptions](#mapboxmapoptions)
Set a font family from range of font families for generating glyphs locally for ideographs in the'CJK Unified Ideographs' and 'Hangul Syllables' ranges.
@NonNull()
open fun [localIdeographFontFamily](#localideographfontfamily)(fontFamily: String): [MapboxMapOptions](#mapboxmapoptions)
Set the font family for generating glyphs locally for ideographs in the 'CJK Unified Ideographs'and 'Hangul Syllables' ranges.
localIdeographFontFamilyEnabled
@NonNull()
open fun localIdeographFontFamilyEnabled(enabled: Boolean): MapboxMapOptions
Enable local ideograph font family, defaults to true.
logoEnabled
@NonNull()
open fun logoEnabled(enabled: Boolean): MapboxMapOptions
Specifies the visibility state of a logo for a map view.
logoGravity
@NonNull()
open fun logoGravity(gravity: Int): MapboxMapOptions
Specifies the gravity state of logo for a map view.
logoMargins
@NonNull()
open fun logoMargins(margins: Array): [MapboxMapOptions](#mapboxmapoptions)
Specifies the margin state of logo for a map view
maxPitchPreference
@NonNull()
open fun maxPitchPreference(maxPitch: Double): MapboxMapOptions
Specifies the used maximum pitch for a map view.
maxZoomPreference
@NonNull()
open fun maxZoomPreference(maxZoom: Double): MapboxMapOptions
Specifies the used maximum zoom level for a map view.
minPitchPreference
@NonNull()
open fun minPitchPreference(minPitch: Double): MapboxMapOptions
Specifies the used minimum pitch for a map view.
minZoomPreference
@NonNull()
open fun minZoomPreference(minZoom: Double): MapboxMapOptions
Specifies the used minimum zoom level for a map view.
pixelRatio
@NonNull()
open fun pixelRatio(pixelRatio: Float): MapboxMapOptions
Set the custom pixel ratio configuration to override the default value from resources.This ratio will be used to initialise the map with.
quickZoomGesturesEnabled
@NonNull()
open fun quickZoomGesturesEnabled(enabled: Boolean): MapboxMapOptions
Specifies whether the user may zoom the map by tapping twice, holding and moving the pointer up and down.
renderSurfaceOnTop
open fun renderSurfaceOnTop(renderOnTop: Boolean)
Set the flag to render the map surface on top of another surface.
rotateGesturesEnabled
@NonNull()
open fun rotateGesturesEnabled(enabled: Boolean): MapboxMapOptions
Specifies if the rotate gesture is enabled for a map view.
scrollGesturesEnabled
@NonNull()
open fun scrollGesturesEnabled(enabled: Boolean): MapboxMapOptions
Specifies if the scroll gesture is enabled for a map view.
textureMode
@NonNull()
open fun textureMode(textureMode: Boolean): MapboxMapOptions
Enable android.view.TextureView as rendered surface.
tiltGesturesEnabled
@NonNull()
open fun tiltGesturesEnabled(enabled: Boolean): MapboxMapOptions
Specifies if the tilt gesture is enabled for a map view.
translucentTextureSurface
@NonNull()
open fun translucentTextureSurface(translucentTextureSurface: Boolean): MapboxMapOptions
writeToParcel
abstract fun writeToParcel(p: Parcel, p1: Int)
open fun writeToParcel(dest: Parcel, flags: Int)
zoomGesturesEnabled
@NonNull()
open fun zoomGesturesEnabled(enabled: Boolean): MapboxMapOptions
Specifies if the zoom gesture is enabled for a map view.

Properties

Name Summary
apiBaseUri private open val apiBaseUri: String
attributionEnabled private open val attributionEnabled: Boolean
attributionGravity private open val attributionGravity: Int
attributionMargins private open val attributionMargins: Array
attributionTintColor private open val attributionTintColor: Int
compassEnabled private open val compassEnabled: Boolean
compassGravity private open val compassGravity: Int
compassImage private open val compassImage: Drawable
compassMargins private open val compassMargins: Array
CREATOR val CREATOR: Parcelable.Creator<MapboxMapOptions>
crossSourceCollisions private open val crossSourceCollisions: Boolean
debugActive private open val debugActive: Boolean
doubleTapGesturesEnabled private open val doubleTapGesturesEnabled: Boolean
foregroundLoadColor private open val foregroundLoadColor: Int
horizontalScrollGesturesEnabled private open val horizontalScrollGesturesEnabled: Boolean
localIdeographFontFamily private open val localIdeographFontFamily: String
logoEnabled private open val logoEnabled: Boolean
logoGravity private open val logoGravity: Int
logoMargins private open val logoMargins: Array
pixelRatio private open val pixelRatio: Float
prefetchesTiles private open var prefetchesTiles: Boolean
prefetchZoomDelta private open var prefetchZoomDelta: Int
quickZoomGesturesEnabled private open val quickZoomGesturesEnabled: Boolean
rotateGesturesEnabled private open val rotateGesturesEnabled: Boolean
scrollGesturesEnabled private open val scrollGesturesEnabled: Boolean
textureMode private open val textureMode: Boolean
tiltGesturesEnabled private open val tiltGesturesEnabled: Boolean
translucentTextureSurface private open val translucentTextureSurface: Boolean
zoomGesturesEnabled private open val zoomGesturesEnabled: Boolean

CREATOR

val CREATOR: Parcelable.Creator<MapboxMapOptions>

apiBaseUri

@NonNull()

open fun apiBaseUri(apiBaseUri: String): MapboxMapOptions

Specifies the URI used for API endpoint.

Return

This

Parameters
Name Summary
apiBaseUri
The base of our API endpoint
   
   

private open val apiBaseUri: String

attributionEnabled

@NonNull()

open fun attributionEnabled(enabled: Boolean): MapboxMapOptions

Specifies the visibility state of a attribution for a map view.

Return

This

Parameters
Name Summary
enabled
True and attribution is shown
   
   

private open val attributionEnabled: Boolean

attributionGravity

@NonNull()

open fun attributionGravity(gravity: Int): MapboxMapOptions

Specifies the gravity state of attribution for a map view.

Return

This

Parameters
Name Summary
gravity
Android SDK Gravity.
   
   

private open val attributionGravity: Int

attributionMargins

@NonNull()

open fun attributionMargins(margins: Array): [MapboxMapOptions](#mapboxmapoptions)

Specifies the margin state of attribution for a map view

Return

This

Parameters
Name Summary
margins
4 long array for LTRB margins
   
   

private open val attributionMargins: Array

attributionTintColor

@NonNull()

open fun attributionTintColor(color: Int): MapboxMapOptions

Specifies the tint color of the attribution for a map view

Return

This

Parameters
Name Summary
color
integer resembling a color
   
   

private open val attributionTintColor: Int

camera

@NonNull()

open fun camera(cameraPosition: CameraPosition): MapboxMapOptions

Specifies a the initial camera position for the map view.

Return

This

Parameters
Name Summary
cameraPosition
Inital camera position
   
   

compassEnabled

@NonNull()

open fun compassEnabled(enabled: Boolean): MapboxMapOptions

Specifies the visibility state of a mapbox_compass_icon for a map view.

Return

This

Parameters
Name Summary
enabled
True and mapbox_compass_icon is shown
   
   

private open val compassEnabled: Boolean

compassFadesWhenFacingNorth

@NonNull()

open fun compassFadesWhenFacingNorth(compassFadeWhenFacingNorth: Boolean): MapboxMapOptions

Specifies if the mapbox_compass_icon fades to invisible when facing north.

By default this value is true.

Return

This

Parameters
Name Summary
compassFadeWhenFacingNorth
true is mapbox_compass_icon fades to invisble
   
   

compassGravity

@NonNull()

open fun compassGravity(gravity: Int): MapboxMapOptions

Specifies the gravity state of mapbox_compass_icon for a map view.

Return

This

Parameters
Name Summary
gravity
Android SDK Gravity.
   
   

private open val compassGravity: Int

compassImage

@NonNull()

open fun compassImage(compass: Drawable): MapboxMapOptions

Specifies the image of the CompassView.

By default this value is R.drawable.mapbox_compass_icon.

Return

This

Parameters
Name Summary
compass
the drawable to show as image compass
   
   

private open val compassImage: Drawable

compassMargins

@NonNull()

open fun compassMargins(margins: Array): [MapboxMapOptions](#mapboxmapoptions)

Specifies the margin state of mapbox_compass_icon for a map view

Return

This

Parameters
Name Summary
margins
4 long array for LTRB margins
   
   

private open val compassMargins: Array

createFromAttributes

@NonNull()

open fun createFromAttributes(context: Context): MapboxMapOptions

Creates a default MapboxMapsOptions from a given context.

Return

the MapboxMapOptions created from attributes

Parameters
Name Summary
context
Context related to a map view.
   
   

@NonNull()

open fun createFromAttributes(context: Context, attrs: AttributeSet): MapboxMapOptions

Creates a MapboxMapsOptions from the attribute set.

Return

the MapboxMapOptions created from attributes

Parameters
Name Summary
context
Context related to a map view.
attrs
Attributeset containing configuration
   
   

open fun createFromAttributes(mapboxMapOptions: MapboxMapOptions, context: Context, typedArray: TypedArray): MapboxMapOptions

crossSourceCollisions

@NonNull()

open fun crossSourceCollisions(crossSourceCollisions: Boolean): MapboxMapOptions

Enable cross-source symbol collision detection, defaults to true.

If set to false, symbol layers will only run collision detection againstother symbol layers that are part of the same source.

Return

This

Parameters
Name Summary
crossSourceCollisions
true to enable, false to disable
   
   

private open val crossSourceCollisions: Boolean

debugActive

@NonNull()

open fun debugActive(enabled: Boolean): MapboxMapOptions

Specifies the used debug type for a map view.

Return

This

Parameters
Name Summary
enabled
True is debug is enabled
   
   

private open val debugActive: Boolean

describeContents

open fun describeContents(): Int

doubleTapGesturesEnabled

@NonNull()

open fun doubleTapGesturesEnabled(enabled: Boolean): MapboxMapOptions

Specifies if the double tap gesture is enabled for a map view.

Return

This

Parameters
Name Summary
enabled
True and gesture will be enabled
   
   

private open val doubleTapGesturesEnabled: Boolean

equals

open fun equals(o: Any): Boolean

foregroundLoadColor

@NonNull()

open fun foregroundLoadColor(loadColor: Int): MapboxMapOptions

Set the MapView foreground color that is used when the map surface is being created.

Return

This

Parameters
Name Summary
loadColor
the color to show during map creation
   
   

private open val foregroundLoadColor: Int

getCamera

open fun getCamera(): CameraPosition

Get the current configured initial camera position for a map view.

Return

CameraPosition to be initially used.

getCompassFadeFacingNorth

open fun getCompassFadeFacingNorth(): Boolean

Get the current configured state for fading the mapbox_compass_icon when facing north.

Return

True if mapbox_compass_icon fades to invisible when facing north

getMaxPitchPreference

open fun getMaxPitchPreference(): Double

Get the current configured maximum pitch for a map view.

Return

Maximum pitch to be used.

getMaxZoomPreference

open fun getMaxZoomPreference(): Double

Get the current configured maximum zoom for a map view.

Return

Maximum zoom to be used.

getMinPitchPreference

open fun getMinPitchPreference(): Double

Get the current configured min pitch for a map view.

Return

Mininum pitch to be used.

getMinZoomPreference

open fun getMinZoomPreference(): Double

Get the current configured min zoom for a map view.

Return

Mininum zoom level to be used.

getRenderSurfaceOnTop

open fun getRenderSurfaceOnTop(): Boolean

Get the flag to render the map surface on top of another surface.

Return

true if this map is

hashCode

open fun hashCode(): Int

horizontalScrollGesturesEnabled

@NonNull()

open fun horizontalScrollGesturesEnabled(enabled: Boolean): MapboxMapOptions

Specifies if the horizontal scroll gesture is enabled for a map view.

Return

This

Parameters
Name Summary
enabled
True and gesture will be enabled
   
   

private open val horizontalScrollGesturesEnabled: Boolean

isLocalIdeographFontFamilyEnabled

open fun isLocalIdeographFontFamilyEnabled(): Boolean

Returns true if local ideograph font family is enabled, defaults to true.

Return

True if local ideograph font family is enabled

localIdeographFontFamilyEnabled

@NonNull()

open fun localIdeographFontFamilyEnabled(enabled: Boolean): MapboxMapOptions

Enable local ideograph font family, defaults to true.

Return

This

Parameters
Name Summary
enabled
true to enable, false to disable
   
   

localIdeographFontFamily

@NonNull()

open fun localIdeographFontFamily(fontFamily: String): MapboxMapOptions

Set the font family for generating glyphs locally for ideographs in the ‘CJK Unified Ideographs’and ‘Hangul Syllables’ ranges.

The font family argument is passed to create.Default system fonts are defined in ‘/system/etc/fonts.xml’Default font for local ideograph font family is DEFAULT_FONT.

Return

This

Parameters
Name Summary
fontFamily
font family for local ideograph generation.
   
   

@NonNull()

open fun localIdeographFontFamily(fontFamilies: Array): [MapboxMapOptions](#mapboxmapoptions)

Set a font family from range of font families for generating glyphs locally for ideographs in the’CJK Unified Ideographs’ and ‘Hangul Syllables’ ranges. The first matching fontwill be selected. If no valid font found, it defaults to DEFAULT_FONT.

The font families are checked against the default system fonts defined in’/system/etc/fonts.xml’ Default font for local ideograph font family is DEFAULT_FONT.

Return

This

Parameters
Name Summary
fontFamilies
an array of font families for local ideograph generation.
   
   

private open val localIdeographFontFamily: String

logoEnabled

@NonNull()

open fun logoEnabled(enabled: Boolean): MapboxMapOptions

Specifies the visibility state of a logo for a map view.

Return

This

Parameters
Name Summary
enabled
True and logo is shown
   
   

private open val logoEnabled: Boolean

logoGravity

@NonNull()

open fun logoGravity(gravity: Int): MapboxMapOptions

Specifies the gravity state of logo for a map view.

Return

This

Parameters
Name Summary
gravity
Android SDK Gravity.
   
   

private open val logoGravity: Int

logoMargins

@NonNull()

open fun logoMargins(margins: Array): [MapboxMapOptions](#mapboxmapoptions)

Specifies the margin state of logo for a map view

Return

This

Parameters
Name Summary
margins
4 long array for LTRB margins
   
   

private open val logoMargins: Array

maxPitchPreference

@NonNull()

open fun maxPitchPreference(maxPitch: Double): MapboxMapOptions

Specifies the used maximum pitch for a map view.

Return

This

Parameters
Name Summary
maxPitch
Pitch to be used
   
   

maxZoomPreference

@NonNull()

open fun maxZoomPreference(maxZoom: Double): MapboxMapOptions

Specifies the used maximum zoom level for a map view.

Return

This

Parameters
Name Summary
maxZoom
Zoom level to be used
   
   

minPitchPreference

@NonNull()

open fun minPitchPreference(minPitch: Double): MapboxMapOptions

Specifies the used minimum pitch for a map view.

Return

This

Parameters
Name Summary
minPitch
Pitch to be used
   
   

minZoomPreference

@NonNull()

open fun minZoomPreference(minZoom: Double): MapboxMapOptions

Specifies the used minimum zoom level for a map view.

Return

This

Parameters
Name Summary
minZoom
Zoom level to be used
   
   

pixelRatio

@NonNull()

open fun pixelRatio(pixelRatio: Float): MapboxMapOptions

Set the custom pixel ratio configuration to override the default value from resources.This ratio will be used to initialise the map with.

Return

This

Parameters
Name Summary
pixelRatio
the custom pixel ratio of the map under construction
   
   

private open val pixelRatio: Float

prefetchZoomDelta

private open var prefetchZoomDelta: Int

prefetchesTiles

private open var prefetchesTiles: Boolean

quickZoomGesturesEnabled

@NonNull()

open fun quickZoomGesturesEnabled(enabled: Boolean): MapboxMapOptions

Specifies whether the user may zoom the map by tapping twice, holding and moving the pointer up and down.

Return

This

Parameters
Name Summary
enabled
True and gesture will be enabled
   
   

private open val quickZoomGesturesEnabled: Boolean

renderSurfaceOnTop

open fun renderSurfaceOnTop(renderOnTop: Boolean)

Set the flag to render the map surface on top of another surface.

Parameters
Name Summary
renderOnTop
true if this map is shown on top of another one, false if bottom.
   
   

rotateGesturesEnabled

@NonNull()

open fun rotateGesturesEnabled(enabled: Boolean): MapboxMapOptions

Specifies if the rotate gesture is enabled for a map view.

Return

This

Parameters
Name Summary
enabled
True and gesture will be enabled
   
   

private open val rotateGesturesEnabled: Boolean

scrollGesturesEnabled

@NonNull()

open fun scrollGesturesEnabled(enabled: Boolean): MapboxMapOptions

Specifies if the scroll gesture is enabled for a map view.

Return

This

Parameters
Name Summary
enabled
True and gesture will be enabled
   
   

private open val scrollGesturesEnabled: Boolean

textureMode

@NonNull()

open fun textureMode(textureMode: Boolean): MapboxMapOptions

Enable android.view.TextureView as rendered surface.

Since the 5.2.0 release we replaced our TextureView with an android.opengl.GLSurfaceView implementation. Enabling this option will use the android.view.TextureView instead. android.view.TextureView can be useful in situations where you need to animate, scaleor transform the view. This comes at a siginficant performance penalty and should not be consideredunless absolutely needed.

Return

This

Parameters
Name Summary
textureMode
True to enable texture mode
   
   

private open val textureMode: Boolean

tiltGesturesEnabled

@NonNull()

open fun tiltGesturesEnabled(enabled: Boolean): MapboxMapOptions

Specifies if the tilt gesture is enabled for a map view.

Return

This

Parameters
Name Summary
enabled
True and gesture will be enabled
   
   

private open val tiltGesturesEnabled: Boolean

translucentTextureSurface

@NonNull()

open fun translucentTextureSurface(translucentTextureSurface: Boolean): MapboxMapOptions
private open val translucentTextureSurface: Boolean

writeToParcel

open fun writeToParcel(dest: Parcel, flags: Int)

zoomGesturesEnabled

@NonNull()

open fun zoomGesturesEnabled(enabled: Boolean): MapboxMapOptions

Specifies if the zoom gesture is enabled for a map view.

Return

This

Parameters
Name Summary
enabled
True and gesture will be enabled
   
   

private open val zoomGesturesEnabled: Boolean

MarkerContainer

open class MarkerContainer : Markers

Encapsulates Marker’s functionality.

Constructors

Name Summary
MarkerContainer open fun MarkerContainer(nativeMapView: NativeMap, annotations: LongSparseArray, iconManager: [IconManager](#iconmanager))

Functions

Name Summary
addBy
open fun addBy(markerOptions: BaseMarkerOptions, mapboxMap: MapboxMap): Marker
@NonNull()
open fun addBy(markerOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List
abstract fun [addBy](#addby)(markerOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List
obtainAll
@NonNull()
open fun obtainAll(): List
obtainAllIn
@NonNull()
open fun obtainAllIn(rectangle: RectF): List
reload
open fun reload()
update
open fun update(updatedMarker: Marker, mapboxMap: MapboxMap)

addBy

open fun addBy(markerOptions: BaseMarkerOptions, mapboxMap: MapboxMap): Marker
@NonNull()

open fun addBy(markerOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List

obtainAllIn

@NonNull()

open fun obtainAllIn(rectangle: RectF): List

obtainAll

@NonNull()

open fun obtainAll(): List

reload

open fun reload()

update

open fun update(updatedMarker: Marker, mapboxMap: MapboxMap)

Markers

interface Markers

Interface that defines convenient methods for working with a Marker’s collection.

Functions

Name Summary
addBy
abstract fun addBy(markerOptions: BaseMarkerOptions, mapboxMap: MapboxMap): Marker
abstract fun addBy(markerOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List
obtainAll
abstract fun obtainAll(): List
obtainAllIn
@NonNull()
abstract fun obtainAllIn(rectangle: RectF): List
reload
abstract fun reload()
update
abstract fun update(updatedMarker: Marker, mapboxMap: MapboxMap)

Inheritors

Name
MarkerContainer

addBy

abstract fun addBy(markerOptions: BaseMarkerOptions, mapboxMap: MapboxMap): Marker
abstract fun addBy(markerOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List

obtainAllIn

@NonNull()

abstract fun obtainAllIn(rectangle: RectF): List

obtainAll

abstract fun obtainAll(): List

reload

abstract fun reload()

update

abstract fun update(updatedMarker: Marker, mapboxMap: MapboxMap)

NativeMap

interface NativeMap

Functions

Name Summary
addAnnotationIcon
abstract fun addAnnotationIcon(symbol: String, width: Int, height: Int, scale: Float, pixels: Array)
addImages
abstract fun addImages(images: Array<Image>)
addLayer
abstract fun addLayer(layer: Layer)
addLayerAbove
abstract fun addLayerAbove(layer: Layer, above: String)
addLayerAt
abstract fun addLayerAt(layer: Layer, index: Int)
addLayerBelow
abstract fun addLayerBelow(layer: Layer, below: String)
addMarker
abstract fun addMarker(marker: Marker): Long
addMarkers
@NonNull()
abstract fun addMarkers(markers: List): Array
addPolygon
abstract fun addPolygon(polygon: Polygon): Long
addPolygons
@NonNull()
abstract fun addPolygons(polygons: List): Array
addPolyline
abstract fun addPolyline(polyline: Polyline): Long
addPolylines
@NonNull()
abstract fun addPolylines(polylines: List): Array
addSnapshotCallback
abstract fun addSnapshotCallback(callback: MapboxMap.SnapshotReadyCallback)
addSource
abstract fun addSource(source: Source)
cancelTransitions
abstract fun cancelTransitions()
destroy
abstract fun destroy()
easeTo
abstract fun easeTo(center: LatLng, zoom: Double, bearing: Double, pitch: Double, padding: Array, duration: Long, easingInterpolator: Boolean)
flyTo
abstract fun flyTo(center: LatLng, zoom: Double, bearing: Double, pitch: Double, padding: Array, duration: Long)
getBearing
abstract fun getBearing(): Double
getCameraForGeometry
abstract fun getCameraForGeometry(geometry: Geometry, padding: Array, bearing: Double, pitch: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)
getCameraForLatLngBounds
abstract fun getCameraForLatLngBounds(bounds: LatLngBounds, padding: Array, bearing: Double, pitch: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)
getCameraPosition
@NonNull()
abstract fun getCameraPosition(): CameraPosition
getContentPadding
abstract fun getContentPadding(): Array
getDebug
abstract fun getDebug(): Boolean
getDensityDependantRectangle
@NonNull()
abstract fun getDensityDependantRectangle(rectangle: RectF): RectF
getImage
abstract fun getImage(name: String): Bitmap
getLatLng
abstract fun getLatLng(): LatLng
getLayer
abstract fun getLayer(layerId: String): Layer
getLayers
@NonNull()
abstract fun getLayers(): List<Layer>
getLight
abstract fun getLight(): Light
getMaxPitch
abstract fun getMaxPitch(): Double
getMaxZoom
abstract fun getMaxZoom(): Double
getMetersPerPixelAtLatitude
abstract fun getMetersPerPixelAtLatitude(lat: Double): Double
getMinPitch
abstract fun getMinPitch(): Double
getMinZoom
abstract fun getMinZoom(): Double
getNativePtr
abstract fun getNativePtr(): Long
getPitch
abstract fun getPitch(): Double
getPixelRatio
abstract fun getPixelRatio(): Float
getPrefetchTiles
abstract fun getPrefetchTiles(): Boolean
getPrefetchZoomDelta
abstract fun getPrefetchZoomDelta(): Int
getSource
abstract fun getSource(sourceId: String): Source
getSources
@NonNull()
abstract fun getSources(): List<Source>
getStyleJson
@NonNull()
abstract fun getStyleJson(): String
getStyleUri
@NonNull()
abstract fun getStyleUri(): String
getTopOffsetPixelsForAnnotationSymbol
abstract fun getTopOffsetPixelsForAnnotationSymbol(symbolName: String): Double
getTransitionOptions
@NonNull()
abstract fun getTransitionOptions(): TransitionOptions
getVisibleCoordinateBounds
abstract fun getVisibleCoordinateBounds(output: Array)
getZoom
abstract fun getZoom(): Double
isDestroyed
abstract fun isDestroyed(): Boolean
isFullyLoaded
abstract fun isFullyLoaded(): Boolean
jumpTo
abstract fun jumpTo(center: LatLng, zoom: Double, pitch: Double, bearing: Double, padding: Array)
latLngForPixel
abstract fun latLngForPixel(pixel: PointF): LatLng
latLngForProjectedMeters
abstract fun latLngForProjectedMeters(projectedMeters: ProjectedMeters): LatLng
latLngsForPixels
abstract fun latLngsForPixels(input: Array, output: Array)
moveBy
abstract fun moveBy(deltaX: Double, deltaY: Double, duration: Long)
onLowMemory
abstract fun onLowMemory()
pixelForLatLng
@NonNull()
abstract fun pixelForLatLng(latLng: LatLng): PointF
pixelsForLatLngs
abstract fun pixelsForLatLngs(input: Array, output: Array)
projectedMetersForLatLng
abstract fun projectedMetersForLatLng(latLng: LatLng): ProjectedMeters
queryPointAnnotations
@NonNull()
abstract fun queryPointAnnotations(rectF: RectF): Array
queryRenderedFeatures
@NonNull()
abstract fun queryRenderedFeatures(coordinates: PointF, layerIds: Array, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression)): List
@NonNull()
abstract fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: RectF, layerIds: Array, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression)): List
queryShapeAnnotations
@NonNull()
abstract fun queryShapeAnnotations(rectF: RectF): Array
removeAnnotation
abstract fun removeAnnotation(id: Long)
removeAnnotationIcon
abstract fun removeAnnotationIcon(symbol: String)
removeAnnotations
abstract fun removeAnnotations(ids: Array)
removeImage
abstract fun removeImage(name: String)
removeLayer
abstract fun removeLayer(layer: Layer): Boolean
abstract fun removeLayer(layerId: String): Boolean
removeLayerAt
abstract fun removeLayerAt(index: Int): Boolean
removeSource
abstract fun removeSource(source: Source): Boolean
abstract fun removeSource(sourceId: String): Boolean
resetNorth
abstract fun resetNorth()
resetPosition
abstract fun resetPosition()
resetZoom
abstract fun resetZoom()
resizeView
abstract fun resizeView(width: Int, height: Int)
rotateBy
abstract fun rotateBy(sx: Double, sy: Double, ex: Double, ey: Double, duration: Long)
setApiBaseUrl
abstract fun setApiBaseUrl(baseUrl: String)
setBearing
abstract fun setBearing(degrees: Double, duration: Long)
abstract fun setBearing(degrees: Double, fx: Double, fy: Double, duration: Long)
setContentPadding
abstract fun setContentPadding(padding: Array)
setDebug
abstract fun setDebug(debug: Boolean)
setGestureInProgress
abstract fun setGestureInProgress(inProgress: Boolean)
setLatLng
abstract fun setLatLng(latLng: LatLng, duration: Long)
setLatLngBounds
abstract fun setLatLngBounds(latLngBounds: LatLngBounds)
setMaxPitch
abstract fun setMaxPitch(pitch: Double)
setMaxZoom
abstract fun setMaxZoom(zoom: Double)
setMinPitch
abstract fun setMinPitch(pitch: Double)
setMinZoom
abstract fun setMinZoom(zoom: Double)
setOnFpsChangedListener
abstract fun setOnFpsChangedListener(listener: MapboxMap.OnFpsChangedListener)
setPitch
abstract fun setPitch(pitch: Double, duration: Long)
setPrefetchTiles
abstract fun setPrefetchTiles(enable: Boolean)
setPrefetchZoomDelta
abstract fun setPrefetchZoomDelta(delta: Int)
setReachability
abstract fun setReachability(status: Boolean)
setStyleJson
abstract fun setStyleJson(newStyleJson: String)
setStyleUri
abstract fun setStyleUri(url: String)
setTransitionOptions
abstract fun setTransitionOptions(transitionOptions: TransitionOptions)
setVisibleCoordinateBounds
abstract fun setVisibleCoordinateBounds(coordinates: Array<LatLng>, padding: RectF, direction: Double, duration: Long)
setZoom
abstract fun setZoom(zoom: Double, focalPoint: PointF, duration: Long)
triggerRepaint
abstract fun triggerRepaint()
updateMarker
abstract fun updateMarker(marker: Marker)
updatePolygon
abstract fun updatePolygon(polygon: Polygon)
updatePolyline
abstract fun updatePolyline(polyline: Polyline)

Inheritors

Name
NativeMapView

addAnnotationIcon

abstract fun addAnnotationIcon(symbol: String, width: Int, height: Int, scale: Float, pixels: Array)

addImages

abstract fun addImages(images: Array<Image>)

addLayerAbove

abstract fun addLayerAbove(layer: Layer, above: String)

addLayerAt

abstract fun addLayerAt(layer: Layer, index: Int)

addLayerBelow

abstract fun addLayerBelow(layer: Layer, below: String)

addLayer

abstract fun addLayer(layer: Layer)

addMarker

abstract fun addMarker(marker: Marker): Long

addMarkers

@NonNull()

abstract fun addMarkers(markers: List): Array

addPolygon

abstract fun addPolygon(polygon: Polygon): Long

addPolygons

@NonNull()

abstract fun addPolygons(polygons: List): Array

addPolyline

abstract fun addPolyline(polyline: Polyline): Long

addPolylines

@NonNull()

abstract fun addPolylines(polylines: List): Array

addSnapshotCallback

abstract fun addSnapshotCallback(callback: MapboxMap.SnapshotReadyCallback)

addSource

abstract fun addSource(source: Source)

cancelTransitions

abstract fun cancelTransitions()

destroy

abstract fun destroy()

easeTo

abstract fun easeTo(center: LatLng, zoom: Double, bearing: Double, pitch: Double, padding: Array, duration: Long, easingInterpolator: Boolean)

flyTo

abstract fun flyTo(center: LatLng, zoom: Double, bearing: Double, pitch: Double, padding: Array, duration: Long)

getBearing

abstract fun getBearing(): Double

getCameraForGeometry

abstract fun getCameraForGeometry(geometry: Geometry, padding: Array, bearing: Double, pitch: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)

getCameraForLatLngBounds

abstract fun getCameraForLatLngBounds(bounds: LatLngBounds, padding: Array, bearing: Double, pitch: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)

getCameraPosition

@NonNull()

abstract fun getCameraPosition(): CameraPosition

getContentPadding

abstract fun getContentPadding(): Array

getDebug

abstract fun getDebug(): Boolean

getDensityDependantRectangle

@NonNull()

abstract fun getDensityDependantRectangle(rectangle: RectF): RectF

getImage

abstract fun getImage(name: String): Bitmap

getLatLng

abstract fun getLatLng(): LatLng

getLayer

abstract fun getLayer(layerId: String): Layer

getLayers

@NonNull()

abstract fun getLayers(): List<Layer>

getLight

abstract fun getLight(): Light

getMaxPitch

abstract fun getMaxPitch(): Double

getMaxZoom

abstract fun getMaxZoom(): Double

getMetersPerPixelAtLatitude

abstract fun getMetersPerPixelAtLatitude(lat: Double): Double

getMinPitch

abstract fun getMinPitch(): Double

getMinZoom

abstract fun getMinZoom(): Double

getNativePtr

abstract fun getNativePtr(): Long

getPitch

abstract fun getPitch(): Double

getPixelRatio

abstract fun getPixelRatio(): Float

getPrefetchTiles

abstract fun getPrefetchTiles(): Boolean

getPrefetchZoomDelta

abstract fun getPrefetchZoomDelta(): Int

getSource

abstract fun getSource(sourceId: String): Source

getSources

@NonNull()

abstract fun getSources(): List<Source>

getStyleJson

@NonNull()

abstract fun getStyleJson(): String

getStyleUri

@NonNull()

abstract fun getStyleUri(): String

getTopOffsetPixelsForAnnotationSymbol

abstract fun getTopOffsetPixelsForAnnotationSymbol(symbolName: String): Double

getTransitionOptions

@NonNull()

abstract fun getTransitionOptions(): TransitionOptions

getVisibleCoordinateBounds

abstract fun getVisibleCoordinateBounds(output: Array)

getZoom

abstract fun getZoom(): Double

isDestroyed

abstract fun isDestroyed(): Boolean

isFullyLoaded

abstract fun isFullyLoaded(): Boolean

jumpTo

abstract fun jumpTo(center: LatLng, zoom: Double, pitch: Double, bearing: Double, padding: Array)

latLngForPixel

abstract fun latLngForPixel(pixel: PointF): LatLng

latLngForProjectedMeters

abstract fun latLngForProjectedMeters(projectedMeters: ProjectedMeters): LatLng

latLngsForPixels

abstract fun latLngsForPixels(input: Array, output: Array)

moveBy

abstract fun moveBy(deltaX: Double, deltaY: Double, duration: Long)

onLowMemory

abstract fun onLowMemory()

pixelForLatLng

@NonNull()

abstract fun pixelForLatLng(latLng: LatLng): PointF

pixelsForLatLngs

abstract fun pixelsForLatLngs(input: Array, output: Array)

projectedMetersForLatLng

abstract fun projectedMetersForLatLng(latLng: LatLng): ProjectedMeters

queryPointAnnotations

@NonNull()

abstract fun queryPointAnnotations(rectF: RectF): Array

queryRenderedFeatures

@NonNull()

abstract fun queryRenderedFeatures(coordinates: PointF, layerIds: Array, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression)): List @NonNull()

abstract fun queryRenderedFeatures(coordinates: RectF, layerIds: Array, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression)): List

queryShapeAnnotations

@NonNull()

abstract fun queryShapeAnnotations(rectF: RectF): Array

removeAnnotationIcon

abstract fun removeAnnotationIcon(symbol: String)

removeAnnotation

abstract fun removeAnnotation(id: Long)

removeAnnotations

abstract fun removeAnnotations(ids: Array)

removeImage

abstract fun removeImage(name: String)

removeLayerAt

abstract fun removeLayerAt(index: Int): Boolean

removeLayer

abstract fun removeLayer(layerId: String): Boolean
abstract fun removeLayer(layer: Layer): Boolean

removeSource

abstract fun removeSource(sourceId: String): Boolean
abstract fun removeSource(source: Source): Boolean

resetNorth

abstract fun resetNorth()

resetPosition

abstract fun resetPosition()

resetZoom

abstract fun resetZoom()

resizeView

abstract fun resizeView(width: Int, height: Int)

rotateBy

abstract fun rotateBy(sx: Double, sy: Double, ex: Double, ey: Double, duration: Long)

setApiBaseUrl

abstract fun setApiBaseUrl(baseUrl: String)

setBearing

abstract fun setBearing(degrees: Double, duration: Long)
abstract fun setBearing(degrees: Double, fx: Double, fy: Double, duration: Long)

setContentPadding

abstract fun setContentPadding(padding: Array)

setDebug

abstract fun setDebug(debug: Boolean)

setGestureInProgress

abstract fun setGestureInProgress(inProgress: Boolean)

setLatLngBounds

abstract fun setLatLngBounds(latLngBounds: LatLngBounds)

setLatLng

abstract fun setLatLng(latLng: LatLng, duration: Long)

setMaxPitch

abstract fun setMaxPitch(pitch: Double)

setMaxZoom

abstract fun setMaxZoom(zoom: Double)

setMinPitch

abstract fun setMinPitch(pitch: Double)

setMinZoom

abstract fun setMinZoom(zoom: Double)

setOnFpsChangedListener

abstract fun setOnFpsChangedListener(listener: MapboxMap.OnFpsChangedListener)

setPitch

abstract fun setPitch(pitch: Double, duration: Long)

setPrefetchTiles

abstract fun setPrefetchTiles(enable: Boolean)

setPrefetchZoomDelta

abstract fun setPrefetchZoomDelta(delta: Int)

setReachability

abstract fun setReachability(status: Boolean)

setStyleJson

abstract fun setStyleJson(newStyleJson: String)

setStyleUri

abstract fun setStyleUri(url: String)

setTransitionOptions

abstract fun setTransitionOptions(transitionOptions: TransitionOptions)

setVisibleCoordinateBounds

abstract fun setVisibleCoordinateBounds(coordinates: Array<LatLng>, padding: RectF, direction: Double, duration: Long)

setZoom

abstract fun setZoom(zoom: Double, focalPoint: PointF, duration: Long)

triggerRepaint

abstract fun triggerRepaint()

updateMarker

abstract fun updateMarker(marker: Marker)

updatePolygon

abstract fun updatePolygon(polygon: Polygon)

updatePolyline

abstract fun updatePolyline(polyline: Polyline)

NativeMapView

class NativeMapView : NativeMap

Constructors

Name Summary
NativeMapView open fun NativeMapView(context: Context, crossSourceCollisions: Boolean, viewCallback: NativeMapView.ViewCallback, stateCallback: NativeMapView.StateCallback, mapRenderer: MapRenderer)
NativeMapView open fun NativeMapView(context: Context, pixelRatio: Float, crossSourceCollisions: Boolean, viewCallback: NativeMapView.ViewCallback, stateCallback: NativeMapView.StateCallback, mapRenderer: MapRenderer)

Types

Name Summary
StateCallback
interface StateCallback : NativeMapView.StyleCallback
StyleCallback
interface StyleCallback
ViewCallback
interface ViewCallback

Functions

Name Summary
addAnnotationIcon
open fun addAnnotationIcon(symbol: String, width: Int, height: Int, scale: Float, pixels: Array)
addImages
abstract fun addImages(images: Array<Image>)
open fun addImages(images: Array<Image>)
addLayer
open fun addLayer(layer: Layer)
addLayerAbove
open fun addLayerAbove(layer: Layer, above: String)
addLayerAt
open fun addLayerAt(layer: Layer, index: Int)
addLayerBelow
open fun addLayerBelow(layer: Layer, below: String)
addMarker
open fun addMarker(marker: Marker): Long
addMarkers
@NonNull()
open fun addMarkers(markers: List): Array
addPolygon
open fun addPolygon(polygon: Polygon): Long
addPolygons
@NonNull()
open fun addPolygons(polygons: List): Array
addPolyline
open fun addPolyline(polyline: Polyline): Long
addPolylines
@NonNull()
open fun addPolylines(polylines: List): Array
addSnapshotCallback
open fun addSnapshotCallback(callback: MapboxMap.SnapshotReadyCallback)
addSource
open fun addSource(source: Source)
cancelTransitions
open fun cancelTransitions()
destroy
open fun destroy()
easeTo
abstract fun easeTo(center: LatLng, zoom: Double, bearing: Double, pitch: Double, padding: Array, duration: Long, easingInterpolator: Boolean)
open fun [easeTo](#easeto)(center: [LatLng](../com.mapbox.mapboxsdk.geometry/#latlng), zoom: Double, angle: Double, pitch: Double, padding: Array, duration: Long, easingInterpolator: Boolean)
flyTo
abstract fun flyTo(center: LatLng, zoom: Double, bearing: Double, pitch: Double, padding: Array, duration: Long)
open fun [flyTo](#flyto)(center: [LatLng](../com.mapbox.mapboxsdk.geometry/#latlng), zoom: Double, angle: Double, pitch: Double, padding: Array, duration: Long)
getBearing
open fun getBearing(): Double
getCameraForGeometry
abstract fun getCameraForGeometry(geometry: Geometry, padding: Array, bearing: Double, pitch: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)
open fun [getCameraForGeometry](#getcameraforgeometry)(geometry: Geometry, padding: Array, bearing: Double, tilt: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)
getCameraForLatLngBounds
abstract fun getCameraForLatLngBounds(bounds: LatLngBounds, padding: Array, bearing: Double, pitch: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)
open fun [getCameraForLatLngBounds](#getcameraforlatlngbounds)(bounds: [LatLngBounds](../com.mapbox.mapboxsdk.geometry/#latlngbounds), padding: Array, bearing: Double, tilt: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)
getCameraPosition
@NonNull()
open fun getCameraPosition(): CameraPosition
getContentPadding
open fun getContentPadding(): Array
getDebug
open fun getDebug(): Boolean
getDensityDependantRectangle
@NonNull()
abstract fun getDensityDependantRectangle(rectangle: RectF): RectF
@NonNull()
open fun getDensityDependantRectangle(rectangle: RectF): RectF
getImage
open fun getImage(name: String): Bitmap
getLatLng
open fun getLatLng(): LatLng
getLayer
open fun getLayer(layerId: String): Layer
getLayers
@NonNull()
open fun getLayers(): List<Layer>
getLight
open fun getLight(): Light
getMaxPitch
open fun getMaxPitch(): Double
getMaxZoom
open fun getMaxZoom(): Double
getMetersPerPixelAtLatitude
open fun getMetersPerPixelAtLatitude(lat: Double): Double
getMinPitch
open fun getMinPitch(): Double
getMinZoom
open fun getMinZoom(): Double
getPitch
open fun getPitch(): Double
getPrefetchTiles
open fun getPrefetchTiles(): Boolean
getPrefetchZoomDelta
open fun getPrefetchZoomDelta(): Int
getSource
open fun getSource(sourceId: String): Source
getSources
@NonNull()
open fun getSources(): List<Source>
getStyleJson
@NonNull()
open fun getStyleJson(): String
getStyleUri
@NonNull()
open fun getStyleUri(): String
getTopOffsetPixelsForAnnotationSymbol
open fun getTopOffsetPixelsForAnnotationSymbol(symbolName: String): Double
getTransitionOptions
@NonNull()
open fun getTransitionOptions(): TransitionOptions
getVisibleCoordinateBounds
open fun getVisibleCoordinateBounds(output: Array)
getZoom
open fun getZoom(): Double
isDestroyed
open fun isDestroyed(): Boolean
isFullyLoaded
open fun isFullyLoaded(): Boolean
jumpTo
abstract fun jumpTo(center: LatLng, zoom: Double, pitch: Double, bearing: Double, padding: Array)
open fun [jumpTo](#jumpto)(center: [LatLng](../com.mapbox.mapboxsdk.geometry/#latlng), zoom: Double, pitch: Double, angle: Double, padding: Array)
latLngForPixel
open fun latLngForPixel(pixel: PointF): LatLng
latLngForProjectedMeters
open fun latLngForProjectedMeters(projectedMeters: ProjectedMeters): LatLng
latLngsForPixels
open fun latLngsForPixels(input: Array, output: Array)
moveBy
abstract fun moveBy(deltaX: Double, deltaY: Double, duration: Long)
open fun moveBy(dx: Double, dy: Double, duration: Long)
onLowMemory
open fun onLowMemory()
pixelForLatLng
@NonNull()
open fun pixelForLatLng(latLng: LatLng): PointF
pixelsForLatLngs
open fun pixelsForLatLngs(input: Array, output: Array)
projectedMetersForLatLng
open fun projectedMetersForLatLng(latLng: LatLng): ProjectedMeters
queryPointAnnotations
@NonNull()
abstract fun queryPointAnnotations(rectF: RectF): Array
@NonNull()
open fun [queryPointAnnotations](#querypointannotations)(rect: RectF): Array
queryRenderedFeatures
@NonNull()
abstract fun queryRenderedFeatures(coordinates: PointF, layerIds: Array, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression)): List
@NonNull()
abstract fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: RectF, layerIds: Array, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression)): List
@NonNull()
open fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: PointF, layerIds: Array, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression)): List
@NonNull()
open fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: RectF, layerIds: Array, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression)): List
queryShapeAnnotations
@NonNull()
open fun queryShapeAnnotations(rectF: RectF): Array
removeAnnotation
open fun removeAnnotation(id: Long)
removeAnnotationIcon
open fun removeAnnotationIcon(symbol: String)
removeAnnotations
open fun removeAnnotations(ids: Array)
removeImage
open fun removeImage(name: String)
removeLayer
open fun removeLayer(layer: Layer): Boolean
open fun removeLayer(layerId: String): Boolean
removeLayerAt
open fun removeLayerAt(index: Int): Boolean
removeSource
open fun removeSource(source: Source): Boolean
open fun removeSource(sourceId: String): Boolean
resetNorth
open fun resetNorth()
resetPosition
open fun resetPosition()
resetZoom
open fun resetZoom()
resizeView
open fun resizeView(width: Int, height: Int)
rotateBy
abstract fun rotateBy(sx: Double, sy: Double, ex: Double, ey: Double, duration: Long)
open fun rotateBy(sx: Double, sy: Double, ex: Double, ey: Double, duration: Long)
setApiBaseUrl
open fun setApiBaseUrl(baseUrl: String)
setBearing
open fun setBearing(degrees: Double, duration: Long)
open fun setBearing(degrees: Double, fx: Double, fy: Double, duration: Long)
setContentPadding
open fun setContentPadding(padding: Array)
setDebug
open fun setDebug(debug: Boolean)
setGestureInProgress
open fun setGestureInProgress(inProgress: Boolean)
setLatLng
open fun setLatLng(latLng: LatLng, duration: Long)
setLatLngBounds
abstract fun setLatLngBounds(latLngBounds: LatLngBounds)
open fun setLatLngBounds(latLngBounds: LatLngBounds)
setMaxPitch
open fun setMaxPitch(pitch: Double)
setMaxZoom
open fun setMaxZoom(zoom: Double)
setMinPitch
open fun setMinPitch(pitch: Double)
setMinZoom
open fun setMinZoom(zoom: Double)
setOnFpsChangedListener
abstract fun setOnFpsChangedListener(listener: MapboxMap.OnFpsChangedListener)
open fun setOnFpsChangedListener(listener: MapboxMap.OnFpsChangedListener)
setPitch
open fun setPitch(pitch: Double, duration: Long)
setPrefetchTiles
open fun setPrefetchTiles(enable: Boolean)
setPrefetchZoomDelta
open fun setPrefetchZoomDelta(delta: Int)
setReachability
open fun setReachability(status: Boolean)
setStyleJson
open fun setStyleJson(newStyleJson: String)
setStyleUri
open fun setStyleUri(url: String)
setTransitionOptions
open fun setTransitionOptions(transitionOptions: TransitionOptions)
setVisibleCoordinateBounds
abstract fun setVisibleCoordinateBounds(coordinates: Array<LatLng>, padding: RectF, direction: Double, duration: Long)
open fun setVisibleCoordinateBounds(coordinates: Array<LatLng>, padding: RectF, direction: Double, duration: Long)
setZoom
open fun setZoom(zoom: Double, focalPoint: PointF, duration: Long)
triggerRepaint
open fun triggerRepaint()
updateMarker
open fun updateMarker(marker: Marker)
updatePolygon
open fun updatePolygon(polygon: Polygon)
updatePolyline
open fun updatePolyline(polyline: Polyline)

Properties

Name Summary
nativePtr private open val nativePtr: Long
pixelRatio private val pixelRatio: Float

addAnnotationIcon

open fun addAnnotationIcon(symbol: String, width: Int, height: Int, scale: Float, pixels: Array)

addImages

open fun addImages(images: Array<Image>)

addLayerAbove

open fun addLayerAbove(layer: Layer, above: String)

addLayerAt

open fun addLayerAt(layer: Layer, index: Int)

addLayerBelow

open fun addLayerBelow(layer: Layer, below: String)

addLayer

open fun addLayer(layer: Layer)

addMarker

open fun addMarker(marker: Marker): Long

addMarkers

@NonNull()

open fun addMarkers(markers: List): Array

addPolygon

open fun addPolygon(polygon: Polygon): Long

addPolygons

@NonNull()

open fun addPolygons(polygons: List): Array

addPolyline

open fun addPolyline(polyline: Polyline): Long

addPolylines

@NonNull()

open fun addPolylines(polylines: List): Array

addSnapshotCallback

open fun addSnapshotCallback(callback: MapboxMap.SnapshotReadyCallback)

addSource

open fun addSource(source: Source)

cancelTransitions

open fun cancelTransitions()

destroy

open fun destroy()

easeTo

open fun easeTo(center: LatLng, zoom: Double, angle: Double, pitch: Double, padding: Array, duration: Long, easingInterpolator: Boolean)

flyTo

open fun flyTo(center: LatLng, zoom: Double, angle: Double, pitch: Double, padding: Array, duration: Long)

getBearing

open fun getBearing(): Double

getCameraForGeometry

open fun getCameraForGeometry(geometry: Geometry, padding: Array, bearing: Double, tilt: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)

getCameraForLatLngBounds

open fun getCameraForLatLngBounds(bounds: LatLngBounds, padding: Array, bearing: Double, tilt: Double): [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition)

getCameraPosition

@NonNull()

open fun getCameraPosition(): CameraPosition

getContentPadding

open fun getContentPadding(): Array

getDebug

open fun getDebug(): Boolean

getDensityDependantRectangle

@NonNull()

open fun getDensityDependantRectangle(rectangle: RectF): RectF

getImage

open fun getImage(name: String): Bitmap

getLatLng

open fun getLatLng(): LatLng

getLayer

open fun getLayer(layerId: String): Layer

getLayers

@NonNull()

open fun getLayers(): List<Layer>

getLight

open fun getLight(): Light

getMaxPitch

open fun getMaxPitch(): Double

getMaxZoom

open fun getMaxZoom(): Double

getMetersPerPixelAtLatitude

open fun getMetersPerPixelAtLatitude(lat: Double): Double

getMinPitch

open fun getMinPitch(): Double

getMinZoom

open fun getMinZoom(): Double

getPitch

open fun getPitch(): Double

getPrefetchTiles

open fun getPrefetchTiles(): Boolean

getPrefetchZoomDelta

open fun getPrefetchZoomDelta(): Int

getSource

open fun getSource(sourceId: String): Source

getSources

@NonNull()

open fun getSources(): List<Source>

getStyleJson

@NonNull()

open fun getStyleJson(): String

getStyleUri

@NonNull()

open fun getStyleUri(): String

getTopOffsetPixelsForAnnotationSymbol

open fun getTopOffsetPixelsForAnnotationSymbol(symbolName: String): Double

getTransitionOptions

@NonNull()

open fun getTransitionOptions(): TransitionOptions

getVisibleCoordinateBounds

open fun getVisibleCoordinateBounds(output: Array)

getZoom

open fun getZoom(): Double

isDestroyed

open fun isDestroyed(): Boolean

isFullyLoaded

open fun isFullyLoaded(): Boolean

jumpTo

open fun jumpTo(center: LatLng, zoom: Double, pitch: Double, angle: Double, padding: Array)

latLngForPixel

open fun latLngForPixel(pixel: PointF): LatLng

latLngForProjectedMeters

open fun latLngForProjectedMeters(projectedMeters: ProjectedMeters): LatLng

latLngsForPixels

open fun latLngsForPixels(input: Array, output: Array)

moveBy

open fun moveBy(dx: Double, dy: Double, duration: Long)

nativePtr

private open val nativePtr: Long

onLowMemory

open fun onLowMemory()

pixelForLatLng

@NonNull()

open fun pixelForLatLng(latLng: LatLng): PointF

pixelRatio

private val pixelRatio: Float

pixelsForLatLngs

open fun pixelsForLatLngs(input: Array, output: Array)

projectedMetersForLatLng

open fun projectedMetersForLatLng(latLng: LatLng): ProjectedMeters

queryPointAnnotations

@NonNull()

open fun queryPointAnnotations(rect: RectF): Array

queryRenderedFeatures

@NonNull()

open fun queryRenderedFeatures(coordinates: PointF, layerIds: Array, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression)): List @NonNull()

open fun queryRenderedFeatures(coordinates: RectF, layerIds: Array, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression)): List

queryShapeAnnotations

@NonNull()

open fun queryShapeAnnotations(rectF: RectF): Array

removeAnnotationIcon

open fun removeAnnotationIcon(symbol: String)

removeAnnotation

open fun removeAnnotation(id: Long)

removeAnnotations

open fun removeAnnotations(ids: Array)

removeImage

open fun removeImage(name: String)

removeLayerAt

open fun removeLayerAt(index: Int): Boolean

removeLayer

open fun removeLayer(layerId: String): Boolean
open fun removeLayer(layer: Layer): Boolean

removeSource

open fun removeSource(sourceId: String): Boolean
open fun removeSource(source: Source): Boolean

resetNorth

open fun resetNorth()

resetPosition

open fun resetPosition()

resetZoom

open fun resetZoom()

resizeView

open fun resizeView(width: Int, height: Int)

rotateBy

open fun rotateBy(sx: Double, sy: Double, ex: Double, ey: Double, duration: Long)

setApiBaseUrl

open fun setApiBaseUrl(baseUrl: String)

setBearing

open fun setBearing(degrees: Double, duration: Long)
open fun setBearing(degrees: Double, fx: Double, fy: Double, duration: Long)

setContentPadding

open fun setContentPadding(padding: Array)

setDebug

open fun setDebug(debug: Boolean)

setGestureInProgress

open fun setGestureInProgress(inProgress: Boolean)

setLatLngBounds

open fun setLatLngBounds(latLngBounds: LatLngBounds)

setLatLng

open fun setLatLng(latLng: LatLng, duration: Long)

setMaxPitch

open fun setMaxPitch(pitch: Double)

setMaxZoom

open fun setMaxZoom(zoom: Double)

setMinPitch

open fun setMinPitch(pitch: Double)

setMinZoom

open fun setMinZoom(zoom: Double)

setOnFpsChangedListener

open fun setOnFpsChangedListener(listener: MapboxMap.OnFpsChangedListener)

setPitch

open fun setPitch(pitch: Double, duration: Long)

setPrefetchTiles

open fun setPrefetchTiles(enable: Boolean)

setPrefetchZoomDelta

open fun setPrefetchZoomDelta(delta: Int)

setReachability

open fun setReachability(status: Boolean)

setStyleJson

open fun setStyleJson(newStyleJson: String)

setStyleUri

open fun setStyleUri(url: String)

setTransitionOptions

open fun setTransitionOptions(transitionOptions: TransitionOptions)

setVisibleCoordinateBounds

open fun setVisibleCoordinateBounds(coordinates: Array<LatLng>, padding: RectF, direction: Double, duration: Long)

setZoom

open fun setZoom(zoom: Double, focalPoint: PointF, duration: Long)

triggerRepaint

open fun triggerRepaint()

updateMarker

open fun updateMarker(marker: Marker)

updatePolygon

open fun updatePolygon(polygon: Polygon)

updatePolyline

open fun updatePolyline(polyline: Polyline)

StateCallback

interface StateCallback : NativeMapView.StyleCallback

Functions

Name Summary
onCameraDidChange
abstract fun onCameraDidChange(animated: Boolean)
onCameraIsChanging
abstract fun onCameraIsChanging()
onCameraWillChange
abstract fun onCameraWillChange(animated: Boolean)
onCanRemoveUnusedStyleImage
abstract fun onCanRemoveUnusedStyleImage(imageId: String): Boolean
onDidBecomeIdle
abstract fun onDidBecomeIdle()
onDidFailLoadingMap
abstract fun onDidFailLoadingMap(error: String)
onDidFinishLoadingMap
abstract fun onDidFinishLoadingMap()
onDidFinishLoadingStyle
abstract fun onDidFinishLoadingStyle()
onDidFinishRenderingFrame
abstract fun onDidFinishRenderingFrame(fully: Boolean)
onDidFinishRenderingMap
abstract fun onDidFinishRenderingMap(fully: Boolean)
onSourceChanged
abstract fun onSourceChanged(sourceId: String)
onStyleImageMissing
abstract fun onStyleImageMissing(imageId: String)
onWillStartLoadingMap
abstract fun onWillStartLoadingMap()
onWillStartRenderingFrame
abstract fun onWillStartRenderingFrame()
onWillStartRenderingMap
abstract fun onWillStartRenderingMap()

Inheritors

Name
MapChangeReceiver

onCameraDidChange

abstract fun onCameraDidChange(animated: Boolean)

onCameraIsChanging

abstract fun onCameraIsChanging()

onCameraWillChange

abstract fun onCameraWillChange(animated: Boolean)

onCanRemoveUnusedStyleImage

abstract fun onCanRemoveUnusedStyleImage(imageId: String): Boolean

onDidBecomeIdle

abstract fun onDidBecomeIdle()

onDidFailLoadingMap

abstract fun onDidFailLoadingMap(error: String)

onDidFinishLoadingMap

abstract fun onDidFinishLoadingMap()

onDidFinishRenderingFrame

abstract fun onDidFinishRenderingFrame(fully: Boolean)

onDidFinishRenderingMap

abstract fun onDidFinishRenderingMap(fully: Boolean)

onSourceChanged

abstract fun onSourceChanged(sourceId: String)

onStyleImageMissing

abstract fun onStyleImageMissing(imageId: String)

onWillStartRenderingFrame

abstract fun onWillStartRenderingFrame()

onWillStartRenderingMap

abstract fun onWillStartRenderingMap()

StyleCallback

interface StyleCallback

Functions

Name Summary
onDidFinishLoadingStyle
abstract fun onDidFinishLoadingStyle()
onWillStartLoadingMap
abstract fun onWillStartLoadingMap()

Inheritors

Name
NativeMapView

onDidFinishLoadingStyle

abstract fun onDidFinishLoadingStyle()

onWillStartLoadingMap

abstract fun onWillStartLoadingMap()

ViewCallback

interface ViewCallback

Functions

Name Summary
getViewContent
@Nullable()
abstract fun getViewContent(): Bitmap

Inheritors

Name
MapView

getViewContent

@Nullable()

abstract fun getViewContent(): Bitmap

OnMapReadyCallback

interface OnMapReadyCallback

Interface definition for a callback to be invoked when the map is ready to be used.

Once an instance of this interface is set on a MapFragment or MapView object, the onMapReady(MapboxMap) method is triggered when the map is ready to be used and provides an instance of MapboxMap.

Functions

Name Summary
onMapReady
abstract fun onMapReady(mapboxMap: MapboxMap)
Called when the map is ready to be used.

Inheritors

Name
MapFragment
SupportMapFragment

onMapReady

abstract fun onMapReady(mapboxMap: MapboxMap)

Called when the map is ready to be used.

Parameters
Name Summary
mapboxMap
An instance of MapboxMap associated with the MapFragment orMapView that defines the callback.
   
   

PolygonContainer

open class PolygonContainer : Polygons

Encapsulates Polygon’s functionality.

Constructors

Name Summary
PolygonContainer open fun PolygonContainer(nativeMap: NativeMap, annotations: LongSparseArray)

Functions

Name Summary
addBy
open fun addBy(polygonOptions: PolygonOptions, mapboxMap: MapboxMap): Polygon
@NonNull()
open fun addBy(polygonOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List
obtainAll
@NonNull()
open fun obtainAll(): List
update
open fun update(polygon: Polygon)
abstract fun update(polygon: Polygon)

addBy

open fun addBy(polygonOptions: PolygonOptions, mapboxMap: MapboxMap): Polygon
@NonNull()

open fun addBy(polygonOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List

obtainAll

@NonNull()

open fun obtainAll(): List

update

open fun update(polygon: Polygon)

Polygons

interface Polygons

Interface that defines convenient methods for working with a Polygon’s collection.

Functions

Name Summary
addBy
abstract fun addBy(polygonOptions: PolygonOptions, mapboxMap: MapboxMap): Polygon
abstract fun addBy(polygonOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List
obtainAll
abstract fun obtainAll(): List
update
abstract fun update(polygon: Polygon)

Inheritors

Name
PolygonContainer

addBy

abstract fun addBy(polygonOptions: PolygonOptions, mapboxMap: MapboxMap): Polygon
abstract fun addBy(polygonOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List

obtainAll

abstract fun obtainAll(): List

update

abstract fun update(polygon: Polygon)

PolylineContainer

open class PolylineContainer : Polylines

Encapsulates Polyline’s functionality.

Constructors

Name Summary
PolylineContainer open fun PolylineContainer(nativeMap: NativeMap, annotations: LongSparseArray)

Functions

Name Summary
addBy
open fun addBy(polylineOptions: PolylineOptions, mapboxMap: MapboxMap): Polyline
@NonNull()
open fun addBy(polylineOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List
obtainAll
@NonNull()
open fun obtainAll(): List
update
open fun update(polyline: Polyline)
abstract fun update(polyline: Polyline)

addBy

open fun addBy(polylineOptions: PolylineOptions, mapboxMap: MapboxMap): Polyline
@NonNull()

open fun addBy(polylineOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List

obtainAll

@NonNull()

open fun obtainAll(): List

update

open fun update(polyline: Polyline)

Polylines

interface Polylines

Interface that defines convenient methods for working with a Polyline’s collection.

Functions

Name Summary
addBy
abstract fun addBy(polylineOptions: PolylineOptions, mapboxMap: MapboxMap): Polyline
abstract fun addBy(polylineOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List
obtainAll
abstract fun obtainAll(): List
update
abstract fun update(polyline: Polyline)

Inheritors

Name
PolylineContainer

addBy

abstract fun addBy(polylineOptions: PolylineOptions, mapboxMap: MapboxMap): Polyline
abstract fun addBy(polylineOptionsList: List, mapboxMap: [MapboxMap](#mapboxmap)): List

obtainAll

abstract fun obtainAll(): List

update

abstract fun update(polyline: Polyline)

Projection

open class Projection

A projection is used to translate between on screen location and geographic coordinates on the surface of the Earth. Screen location is in screen pixels (not display pixels) with respect to the top left corner of the map (and not necessarily of the whole screen).

Constructors

Name Summary
Projection open fun Projection(nativeMapView: NativeMap, mapView: MapView)

Functions

Name Summary
bearing
open fun bearing(latLng1: LatLng, latLng2: LatLng): Double
Takes two Points and finds the geographic bearing between them.
calculateZoom
open fun calculateZoom(minScale: Float): Double
Calculates a zoom level based on minimum scale and current scale from MapView
degreesToRadians
open fun degreesToRadians(degrees: Double): Double
Converts an angle in degrees to radians.
fromScreenLocation
@NonNull()
open fun fromScreenLocation(point: PointF): LatLng
Returns the geographic location that corresponds to a screen location.The screen location is specified in screen pixels (not display pixels) relative to thetop left of the map (not the top left of the whole screen).
fromScreenLocations
open fun fromScreenLocations(input: Array, output: Array)
Returns the geographic locations that corresponds to screen locations.The screen locations are specified in screen pixels (not display pixels) relative to thetop left of the map (not the top left of the whole screen).
getContentPadding
open fun getContentPadding(): Array
getHeight
open fun getHeight(): Float
getLatLngForProjectedMeters
@NonNull()
open fun getLatLngForProjectedMeters(projectedMeters: ProjectedMeters): LatLng
Returns the LatLng for a spherical Mercator projected meters.
getLongitudeSpan
open fun getLongitudeSpan(east: Double, west: Double): Double
Get the absolute distance, in degrees, between the west andeast boundaries of this LatLngBounds
getMetersPerPixelAtLatitude
open fun getMetersPerPixelAtLatitude(latitude: Double): Double
Returns the distance spanned by one pixel at the specified latitude and current zoom level.
getProjectedMetersForLatLng
@NonNull()
open fun getProjectedMetersForLatLng(latLng: LatLng): ProjectedMeters
Returns the spherical Mercator projected meters for a LatLng.
getVisibleCoordinateBounds
open fun getVisibleCoordinateBounds(bounds: Array)
Gets a projection of the viewing frustum for converting between screen coordinates andgeo-latitude/longitude coordinate bounds.
getVisibleRegion
@NonNull()
open fun getVisibleRegion(): VisibleRegion
@NonNull()
open fun getVisibleRegion(ignorePadding: Boolean): VisibleRegion
Gets a projection of the viewing frustum for converting between screen coordinates andgeo-latitude/longitude coordinates.
getWidth
open fun getWidth(): Float
radiansToDegrees
open fun radiansToDegrees(radians: Double): Double
Converts an angle in radians to degrees.
setContentPadding
open fun setContentPadding(contentPadding: Array)
toScreenLocation
@NonNull()
open fun toScreenLocation(location: LatLng): PointF
Returns a screen location that corresponds to a geographical coordinate (LatLng).The screen location is in screen pixels (not display pixels) relative to the top leftof the map (not of the whole screen).
toScreenLocations
open fun toScreenLocations(input: Array, output: Array)
Returns a screen locations that corresponds to a geographical coordinates.The screen locations are in screen pixels (not display pixels) relative to the top leftof the map (not of the whole screen).

bearing

open fun bearing(latLng1: LatLng, latLng2: LatLng): Double

Takes two Points and finds the geographic bearing between them.

Return

bearing in decimal degrees

See also

Name Summary
Turf Bearing documentation
Turf Bearing documentation
   
Parameters
Name Summary
latLng1
the first point used for calculating the bearing
latLng2
the second point used for calculating the bearing
   
   

calculateZoom

open fun calculateZoom(minScale: Float): Double

Calculates a zoom level based on minimum scale and current scale from MapView

Return

zoom level that fits the MapView.

Parameters
Name Summary
minScale
The minimum scale to calculate the zoom level.
   
   

degreesToRadians

open fun degreesToRadians(degrees: Double): Double

Converts an angle in degrees to radians.

Return

angle in radians

Parameters
Name Summary
degrees
angle between 0 and 360 degrees
   
   

fromScreenLocation

@NonNull()

open fun fromScreenLocation(point: PointF): LatLng

Returns the geographic location that corresponds to a screen location.The screen location is specified in screen pixels (not display pixels) relative to thetop left of the map (not the top left of the whole screen).

Return

The LatLng corresponding to the point on the screen, or null if the ray throughthe given screen point does not intersect the ground plane.

Parameters
Name Summary
point
A Point on the screen in screen pixels.
   
   

fromScreenLocations

open fun fromScreenLocations(input: Array, output: Array)

Returns the geographic locations that corresponds to screen locations.The screen locations are specified in screen pixels (not display pixels) relative to thetop left of the map (not the top left of the whole screen).

Parameters
Name Summary
input
an array of input values representing screen coordinates
output
an array of output values representing geographic locations
   
   

getContentPadding

open fun getContentPadding(): Array

getHeight

open fun getHeight(): Float

getLatLngForProjectedMeters

@NonNull()

open fun getLatLngForProjectedMeters(projectedMeters: ProjectedMeters): LatLng

Returns the LatLng for a spherical Mercator projected meters.

getLongitudeSpan

open fun getLongitudeSpan(east: Double, west: Double): Double

Get the absolute distance, in degrees, between the west andeast boundaries of this LatLngBounds

Return

Span distance

getMetersPerPixelAtLatitude

open fun getMetersPerPixelAtLatitude(latitude: Double): Double

Returns the distance spanned by one pixel at the specified latitude and current zoom level.

The distance between pixels decreases as the latitude approaches the poles.This relationship parallels the relationship between longitudinal coordinates at different latitudes.

Return

The distance measured in meters.

Parameters
Name Summary
latitude
The latitude for which to return the value.
   
   

getProjectedMetersForLatLng

@NonNull()

open fun getProjectedMetersForLatLng(latLng: LatLng): ProjectedMeters

Returns the spherical Mercator projected meters for a LatLng.

getVisibleCoordinateBounds

open fun getVisibleCoordinateBounds(bounds: Array)

Gets a projection of the viewing frustum for converting between screen coordinates andgeo-latitude/longitude coordinate bounds.

This method ignores the content padding.

Parameters
Name Summary
bounds
an array of 4 output values representing bounds(in the order of latNorth,lonEast, latSouth, lonWest).
   
   

getVisibleRegion

@NonNull()

open fun getVisibleRegion(): VisibleRegion

Gets a projection of the viewing frustum for converting between screen coordinates andgeo-latitude/longitude coordinates.

This method ignores the content padding.

Return

The projection of the viewing frustum in its current state.

@NonNull()

open fun getVisibleRegion(ignorePadding: Boolean): VisibleRegion

Gets a projection of the viewing frustum for converting between screen coordinates andgeo-latitude/longitude coordinates.

Return

The projection of the viewing frustum in its current state.

Parameters
Name Summary
ignorePadding
True if the padding should be ignored,false if the returned region should be reduced by the padding.
   
   

getWidth

open fun getWidth(): Float

radiansToDegrees

open fun radiansToDegrees(radians: Double): Double

Converts an angle in radians to degrees.

Return

degrees between 0 and 360 degrees

Parameters
Name Summary
radians
angle in radians
   
   

setContentPadding

open fun setContentPadding(contentPadding: Array)

toScreenLocation

@NonNull()

open fun toScreenLocation(location: LatLng): PointF

Returns a screen location that corresponds to a geographical coordinate (LatLng).The screen location is in screen pixels (not display pixels) relative to the top leftof the map (not of the whole screen).

Return

A Point representing the screen location in screen pixels.

Parameters
Name Summary
location
A LatLng on the map to convert to a screen location.
   
   

toScreenLocations

open fun toScreenLocations(input: Array, output: Array)

Returns a screen locations that corresponds to a geographical coordinates.The screen locations are in screen pixels (not display pixels) relative to the top leftof the map (not of the whole screen).

Parameters
Name Summary
input
an array of input values representing geographic locations
output
an array of output values representing screen coordinates
   
   

ShapeAnnotationContainer

open class ShapeAnnotationContainer : ShapeAnnotations

Constructors

Name Summary
ShapeAnnotationContainer open fun ShapeAnnotationContainer(nativeMapView: NativeMap, annotations: LongSparseArray)

Functions

Name Summary
obtainAllIn
@NonNull()
open fun obtainAllIn(rectangle: RectF): List
abstract fun [obtainAllIn](#obtainallin)(rectF: RectF): List

obtainAllIn

@NonNull()

open fun obtainAllIn(rectangle: RectF): List

ShapeAnnotations

interface ShapeAnnotations

Functions

Name Summary
obtainAllIn
abstract fun obtainAllIn(rectF: RectF): List

Inheritors

Name
ShapeAnnotationContainer

obtainAllIn

abstract fun obtainAllIn(rectF: RectF): List

Style

open class Style

The proxy object for current map style.

To create new instances of this object, create a new instance using a Builder and load the style with MapboxMap. This object is returned from getStyle once the style has been loaded by underlying map.

Types

Name Summary
Builder
open class Builder
Builder for composing a style object.
OnStyleLoaded
interface OnStyleLoaded
Callback to be invoked when a style has finished loading.
StyleUrl
@Retention(value = RetentionPolicy.SOURCE)
annotation class StyleUrl
Indicates the parameter accepts one of the values from Style.

Functions

Name Summary
addImage
open fun addImage(name: String, image: Bitmap)
open fun addImage(name: String, bitmap: Bitmap, sdf: Boolean)
open fun addImage(name: String, image: Bitmap, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)
open fun addImage(name: String, bitmap: Bitmap, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)
Adds an image to be used in the map’s style
open fun addImage(name: String, drawable: Drawable)
open fun addImage(name: String, drawable: Drawable, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)
Adds an drawable to be converted into a bitmap to be used in the map’s style
addImageAsync
open fun addImageAsync(name: String, image: Bitmap)
open fun addImageAsync(name: String, bitmap: Bitmap, sdf: Boolean)
open fun addImageAsync(name: String, image: Bitmap, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)
open fun addImageAsync(name: String, bitmap: Bitmap, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)
Adds an image asynchronously, to be used in the map’s style.
open fun addImageAsync(name: String, drawable: Drawable)
open fun addImageAsync(name: String, drawable: Drawable, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)
Adds an drawable asynchronously, to be converted into a bitmap to be used in the map’s style.
addImages
open fun addImages(images: HashMap<String, Bitmap>)
open fun addImages(images: HashMap<String, Bitmap>, sdf: Boolean)
open fun addImages(images: HashMap<String, Bitmap>, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)
open fun addImages(images: HashMap<String, Bitmap>, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)
Adds images to be used in the map’s style.
addImagesAsync
open fun addImagesAsync(images: HashMap<String, Bitmap>)
open fun addImagesAsync(images: HashMap<String, Bitmap>, sdf: Boolean)
open fun addImagesAsync(images: HashMap<String, Bitmap>, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)
open fun addImagesAsync(images: HashMap<String, Bitmap>, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)
Adds images asynchronously, to be used in the map’s style.
addLayer
open fun addLayer(layer: Layer)
Adds the layer to the map.
addLayerAbove
open fun addLayerAbove(layer: Layer, above: String)
Adds the layer to the map.
addLayerAt
open fun addLayerAt(layer: Layer, index: Int)
Adds the layer to the map at the specified index.
addLayerBelow
open fun addLayerBelow(layer: Layer, below: String)
Adds the layer to the map.
addSource
open fun addSource(source: Source)
Adds the source to the map.
clear
open fun clear()
Called when the underlying map will start loading a new style or the map is destroyed.This method will clean up this style by setting the java sources and layersin a detached state and removing them from core.
getImage
@Nullable()
open fun getImage(id: String): Bitmap
Get an image from the map’s style using an id.
getJson
@NonNull()
open fun getJson(): String
Returns the current style json.
getLayer
@Nullable()
open fun getLayer(id: String): Layer
Get the layer by id
getLayerAs
@Nullable()
open fun <T : Layer?> getLayerAs(layerId: String): T
Tries to cast the Layer to T, throws ClassCastException if it’s another type.
getLight
@Nullable()
open fun getLight(): Light
Get the light source used to change lighting conditions on extruded fill layers.
getSource
@Nullable()
open fun getSource(id: String): Source
Retrieve a source by id
getSourceAs
@Nullable()
open fun <T : Source?> getSourceAs(sourceId: String): T
Tries to cast the Source to T, throws ClassCastException if it’s another type.
getTransition
@NonNull()
open fun getTransition(): TransitionOptions
Get the transition options for style changes.
getUri
@NonNull()
open fun getUri(): String
Returns the current style uri.
isFullyLoaded
open fun isFullyLoaded(): Boolean
Returns true if the style is fully loaded.
onDidFinishLoadingStyle
open fun onDidFinishLoadingStyle()
Called when the underlying map has finished loading this style.This method will add all components added to the builder that were defined with the ‘with’ prefix.
removeImage
open fun removeImage(name: String)
Removes an image from the map’s style.
removeLayer
open fun removeLayer(layer: Layer): Boolean
open fun removeLayer(layerId: String): Boolean
Removes the layer.
removeLayerAt
open fun removeLayerAt(index: Int): Boolean
Removes the layer.
removeSource
open fun removeSource(source: Source): Boolean
Removes the source, preserving the reference for re-use
open fun removeSource(sourceId: String): Boolean
Removes the source from the style.
setTransition
open fun setTransition(transitionOptions: TransitionOptions)
Set the transition options for style changes.
toImage
open fun toImage(imageWrapper: Style.Builder.ImageWrapper): Image

Properties

Name Summary
DARK val DARK: StringDark: Subtle dark backdrop for data visualizations.
EMPTY_JSON val EMPTY_JSON: String
LIGHT val LIGHT: StringLight: Subtle light backdrop for data visualizations.
MAPBOX_STREETS val MAPBOX_STREETS: StringMapbox Streets: A complete basemap, perfect for incorporating your own data.
OUTDOORS val OUTDOORS: StringOutdoors: A general-purpose style tailored to outdoor activities.
SATELLITE val SATELLITE: StringSatellite: A beautiful global satellite and aerial imagery layer.
SATELLITE_STREETS val SATELLITE_STREETS: StringSatellite Streets: Global satellite and aerial imagery with unobtrusive labels.
TRAFFIC_DAY val TRAFFIC_DAY: StringTraffic Day: Color-coded roads based on live traffic congestion data.
TRAFFIC_NIGHT val TRAFFIC_NIGHT: StringTraffic Night: Color-coded roads based on live traffic congestion data, designed to maximizelegibility in low-light situations.

DARK

val DARK: String

Dark: Subtle dark backdrop for data visualizations. Using this constant means your map stylewill always use the latest version and may change as we improve the style.

EMPTY_JSON

val EMPTY_JSON: String

LIGHT

val LIGHT: String

Light: Subtle light backdrop for data visualizations. Using this constant means your mapstyle will always use the latest version and may change as we improve the style.

MAPBOX_STREETS

val MAPBOX_STREETS: String

Mapbox Streets: A complete basemap, perfect for incorporating your own data. Using thisconstant means your map style will always use the latest version and may change as weimprove the style.

OUTDOORS

val OUTDOORS: String

Outdoors: A general-purpose style tailored to outdoor activities. Using this constant meansyour map style will always use the latest version and may change as we improve the style.

SATELLITE

val SATELLITE: String

Satellite: A beautiful global satellite and aerial imagery layer. Using this constant meansyour map style will always use the latest version and may change as we improve the style.

SATELLITE_STREETS

val SATELLITE_STREETS: String

Satellite Streets: Global satellite and aerial imagery with unobtrusive labels. Using thisconstant means your map style will always use the latest version and may change as weimprove the style.

TRAFFIC_DAY

val TRAFFIC_DAY: String

Traffic Day: Color-coded roads based on live traffic congestion data. Traffic data is currentlyavailable inthese selectcountries. Using this constant means your map style will always use the latest version andmay change as we improve the style.

TRAFFIC_NIGHT

val TRAFFIC_NIGHT: String

Traffic Night: Color-coded roads based on live traffic congestion data, designed to maximizelegibility in low-light situations. Traffic data is currently available inthese selectcountries. Using this constant means your map style will always use the latest version andmay change as we improve the style.

addImageAsync

open fun addImageAsync(name: String, image: Bitmap)

Adds an image asynchronously, to be used in the map’s style.

Parameters
Name Summary
name
the name of the image
image
the pre-multiplied Bitmap
   
   

open fun addImageAsync(name: String, image: Bitmap, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)

Adds an image asynchronously, to be used in the map’s style.

Parameters
Name Summary
name
the name of the image
image
the pre-multiplied Bitmap
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

open fun addImageAsync(name: String, drawable: Drawable)

Adds an drawable asynchronously, to be converted into a bitmap to be used in the map’s style.

Parameters
Name Summary
name
the name of the image
drawable
the drawable instance to convert
   
   

open fun addImageAsync(name: String, drawable: Drawable, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)

Adds an drawable asynchronously, to be converted into a bitmap to be used in the map’s style.

Parameters
Name Summary
name
the name of the image
drawable
the drawable instance to convert
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

open fun addImageAsync(name: String, bitmap: Bitmap, sdf: Boolean)

Adds an image asynchronously, to be used in the map’s style.

Parameters
Name Summary
name
the name of the image
bitmap
the pre-multiplied Bitmap
sdf
the flag indicating image is an SDF or template image
   
   

open fun addImageAsync(name: String, bitmap: Bitmap, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)

Adds an image asynchronously, to be used in the map’s style.

Parameters
Name Summary
name
the name of the image
bitmap
the pre-multiplied Bitmap
sdf
the flag indicating image is an SDF or template image
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

addImage

open fun addImage(name: String, image: Bitmap)

Adds an image to be used in the map’s style

Parameters
Name Summary
name
the name of the image
image
the pre-multiplied Bitmap
   
   

open fun addImage(name: String, image: Bitmap, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)

Adds an image to be used in the map’s style

Parameters
Name Summary
name
the name of the image
image
the pre-multiplied Bitmap
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

open fun addImage(name: String, drawable: Drawable)

Adds an drawable to be converted into a bitmap to be used in the map’s style

Parameters
Name Summary
name
the name of the image
drawable
the drawable instance to convert
   
   

open fun addImage(name: String, drawable: Drawable, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)

Adds an drawable to be converted into a bitmap to be used in the map’s style

Parameters
Name Summary
name
the name of the image
drawable
the drawable instance to convert
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

open fun addImage(name: String, bitmap: Bitmap, sdf: Boolean)

Adds an image to be used in the map’s style

Parameters
Name Summary
name
the name of the image
bitmap
the pre-multiplied Bitmap
sdf
the flag indicating image is an SDF or template image
   
   

open fun addImage(name: String, bitmap: Bitmap, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)

Adds an image to be used in the map’s style

Parameters
Name Summary
name
the name of the image
bitmap
the pre-multiplied Bitmap
sdf
the flag indicating image is an SDF or template image
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

addImagesAsync

open fun addImagesAsync(images: HashMap<String, Bitmap>)

Adds images asynchronously, to be used in the map’s style.

Parameters
Name Summary
images
the map of images to add
   
   

open fun addImagesAsync(images: HashMap<String, Bitmap>, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)

Adds images asynchronously, to be used in the map’s style.

Parameters
Name Summary
images
the map of images to add
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

open fun addImagesAsync(images: HashMap<String, Bitmap>, sdf: Boolean)

Adds images asynchronously, to be used in the map’s style.

Parameters
Name Summary
images
the map of images to add
sdf
the flag indicating image is an SDF or template image
   
   

open fun addImagesAsync(images: HashMap<String, Bitmap>, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)

Adds images asynchronously, to be used in the map’s style.

Parameters
Name Summary
images
the map of images to add
sdf
the flag indicating image is an SDF or template image
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

addImages

open fun addImages(images: HashMap<String, Bitmap>)

Adds images to be used in the map’s style.

Parameters
Name Summary
images
the map of images to add
   
   

open fun addImages(images: HashMap<String, Bitmap>, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)

Adds images to be used in the map’s style.

Parameters
Name Summary
images
the map of images to add
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

open fun addImages(images: HashMap<String, Bitmap>, sdf: Boolean)

Adds images to be used in the map’s style.

Parameters
Name Summary
images
the map of images to add
sdf
the flag indicating image is an SDF or template image
   
   

open fun addImages(images: HashMap<String, Bitmap>, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)

Adds images to be used in the map’s style.

Parameters
Name Summary
images
the map of images to add
sdf
the flag indicating image is an SDF or template image
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

addLayerAbove

open fun addLayerAbove(layer: Layer, above: String)

Adds the layer to the map. The layer must be newly created and not added to the map before

Parameters
Name Summary
layer
the layer to add
above
the layer id to add this layer above
   
   

addLayerAt

open fun addLayerAt(layer: Layer, index: Int)

Adds the layer to the map at the specified index. The layer must be newlycreated and not added to the map before

Parameters
Name Summary
layer
the layer to add
index
the index to insert the layer at
   
   

addLayerBelow

open fun addLayerBelow(layer: Layer, below: String)

Adds the layer to the map. The layer must be newly created and not added to the map before

Parameters
Name Summary
layer
the layer to add
below
the layer id to add this layer before
   
   

addLayer

open fun addLayer(layer: Layer)

Adds the layer to the map. The layer must be newly created and not added to the map before

Parameters
Name Summary
layer
the layer to add
   
   

addSource

open fun addSource(source: Source)

Adds the source to the map. The source must be newly created and not added to the map before

Parameters
Name Summary
source
the source to add
   
   

clear

open fun clear()

Called when the underlying map will start loading a new style or the map is destroyed.This method will clean up this style by setting the java sources and layersin a detached state and removing them from core.

getImage

@Nullable()

open fun getImage(id: String): Bitmap

Get an image from the map’s style using an id.

Return

the image bitmap

Parameters
Name Summary
id
the id of the image
   
   

getJson

@NonNull()

open fun getJson(): String

Returns the current style json.

Return

the style json

getLayerAs

@Nullable()

open fun <T : Layer?> getLayerAs(layerId: String): T

Tries to cast the Layer to T, throws ClassCastException if it’s another type.

Return

the casted Layer, null if another type

Parameters
Name Summary
layerId
the layer id used to look up a layer

the generic attribute of a Layer
   
   

getLayer

@Nullable()

open fun getLayer(id: String): Layer

Get the layer by id

Return

the layer, if present in the style

Parameters
Name Summary
id
the layer’s id
   
   

getLight

@Nullable()

open fun getLight(): Light

Get the light source used to change lighting conditions on extruded fill layers.

Return

the global light source

getSourceAs

@Nullable()

open fun <T : Source?> getSourceAs(sourceId: String): T

Tries to cast the Source to T, throws ClassCastException if it’s another type.

Return

the casted Source, null if another type

Parameters
Name Summary
sourceId
the id used to look up a layer

the generic type of a Source
   
   

getSource

@Nullable()

open fun getSource(id: String): Source

Retrieve a source by id

Return

the source if present in the current style

Parameters
Name Summary
id
the source’s id
   
   

getTransition

@NonNull()

open fun getTransition(): TransitionOptions

Get the transition options for style changes.

By default, any changes take effect without animation, besides symbols,which will fade in/out with a default duration after symbol collision detection.

To disable symbols fade in/out animation,pass transition options with enablePlacementTransitions equal to falseinto setTransition.

Both duration and delay will also change the behavior of the symbols fade in/out animation if the placement transition is enabled.

Return

TransitionOptions the transition options

getUri

@NonNull()

open fun getUri(): String

Returns the current style uri.

Return

the style uri

isFullyLoaded

open fun isFullyLoaded(): Boolean

Returns true if the style is fully loaded. Returns false if style hasn’t been fully loaded or a new style isunderway of being loaded.

Return

True if fully loaded, false otherwise

onDidFinishLoadingStyle

open fun onDidFinishLoadingStyle()

Called when the underlying map has finished loading this style.This method will add all components added to the builder that were defined with the ‘with’ prefix.

removeImage

open fun removeImage(name: String)

Removes an image from the map’s style.

Parameters
Name Summary
name
the name of the image to remove
   
   

removeLayerAt

open fun removeLayerAt(index: Int): Boolean

Removes the layer. Any other references to the layer become invalid and should not be used anymore

Return

true if the layer was removed, false otherwise

Parameters
Name Summary
index
the layer index
   
   

removeLayer

open fun removeLayer(layerId: String): Boolean

Removes the layer. Any references to the layer become invalid and should not be used anymore

Return

true if the layer was removed, false otherwise

Parameters
Name Summary
layerId
the layer to remove
   
   

open fun removeLayer(layer: Layer): Boolean

Removes the layer. The reference is re-usable after this and can be re-added

Return

true if the layer was removed, false otherwise

Parameters
Name Summary
layer
the layer to remove
   
   

removeSource

open fun removeSource(sourceId: String): Boolean

Removes the source from the style.

Return

true if the source was removed, false otherwise

Parameters
Name Summary
sourceId
the source to remove
   
   

open fun removeSource(source: Source): Boolean

Removes the source, preserving the reference for re-use

Return

true if the source was removed, false otherwise

Parameters
Name Summary
source
the source to remove
   
   

setTransition

open fun setTransition(transitionOptions: TransitionOptions)

Set the transition options for style changes.

If not set, any changes take effect without animation, besides symbols,which will fade in/out with a default duration after symbol collision detection.

To disable symbols fade in/out animation,pass transition options with enablePlacementTransitions equal to false.

Both duration and delay will also change the behavior of the symbols fade in/out animation if the placement transition is enabled.

Parameters
Name Summary
transitionOptions
the transition options
   
   

toImage

open fun toImage(imageWrapper: Style.Builder.ImageWrapper): Image

Builder

open class Builder

Builder for composing a style object.

Types

Name Summary
ImageWrapper
open class ImageWrapper
LayerAboveWrapper
open class LayerAboveWrapper : Style.Builder.LayerWrapper
LayerAtWrapper
open class LayerAtWrapper : Style.Builder.LayerWrapper
LayerBelowWrapper
open class LayerBelowWrapper : Style.Builder.LayerWrapper
LayerWrapper
open class LayerWrapper

Functions

Name Summary
build
open fun build(nativeMap: NativeMap): Style
Build the composed style.
fromJson
@NonNull()
open fun fromJson(styleJson: String): Style.Builder
Will load a new map style from a json string.
fromUri
@NonNull()
open fun fromUri(uri: String): Style.Builder
Will loads a new map style asynchronous from the specified URI.
getJson
open fun getJson(): String
getUri
open fun getUri(): String
withBitmapImages
@NonNull()
open fun withBitmapImages(values: Array<Pair<String, Bitmap»): Style.Builder
@NonNull()
open fun withBitmapImages(sdf: Boolean, values: Array<Pair<String, Bitmap»): Style.Builder
Will add the images when the map style has loaded.
withDrawableImages
@NonNull()
open fun withDrawableImages(values: Array<Pair<String, Drawable»): Style.Builder
@NonNull()
open fun withDrawableImages(sdf: Boolean, values: Array<Pair<String, Drawable»): Style.Builder
Will add the drawables as images when the map style has loaded.
withImage
@NonNull()
open fun withImage(id: String, image: Bitmap): Style.Builder
@NonNull()
open fun withImage(id: String, image: Bitmap, sdf: Boolean): Style.Builder
@NonNull()
open fun withImage(id: String, image: Bitmap, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent): Style.Builder
@NonNull()
open fun withImage(id: String, image: Bitmap, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent): Style.Builder
Will add the image when the map style has loaded.
@NonNull()
open fun withImage(id: String, drawable: Drawable): Style.Builder
@NonNull()
open fun withImage(id: String, drawable: Drawable, sdf: Boolean): Style.Builder
@NonNull()
open fun withImage(id: String, drawable: Drawable, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent): Style.Builder
@NonNull()
open fun withImage(id: String, drawable: Drawable, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent): Style.Builder
Will add the drawable as image when the map style has loaded.
withLayer
@NonNull()
open fun withLayer(layer: Layer): Style.Builder
Will add the layer when the style has loaded.
withLayerAbove
@NonNull()
open fun withLayerAbove(layer: Layer, aboveLayerId: String): Style.Builder
Will add the layer when the style has loaded above a specified layer id.
withLayerAt
@NonNull()
open fun withLayerAt(layer: Layer, index: Int): Style.Builder
Will add the layer when the style has loaded at a specified index.
withLayerBelow
@NonNull()
open fun withLayerBelow(layer: Layer, belowLayerId: String): Style.Builder
Will add the layer when the style has loaded below a specified layer id.
withLayers
@NonNull()
open fun withLayers(layers: Array<Layer>): Style.Builder
Will add the layers when the style has loaded.
withSource
@NonNull()
open fun withSource(source: Source): Style.Builder
Will add the source when map style has loaded.
withSources
@NonNull()
open fun withSources(sources: Array<Source>): Style.Builder
Will add the sources when map style has loaded.
withTransition
@NonNull()
open fun withTransition(transition: TransitionOptions): Style.Builder
Will add the transition when the map style has loaded.

Properties

Name Summary
images private val images: List<Style.Builder.ImageWrapper>
layers private val layers: List<Style.Builder.LayerWrapper>
sources private val sources: List<Source>
transitionOptions private open val transitionOptions: TransitionOptions

build

open fun build(nativeMap: NativeMap): Style

Build the composed style.

fromJson

@NonNull()

open fun fromJson(styleJson: String): Style.Builder

Will load a new map style from a json string.

If the style fails to load or an invalid style URI is set, the map view will become blank.An error message will be logged in the Android logcat and MapView.OnDidFailLoadingMapListener callbackwill be triggered.

Return

this

fromUri

@NonNull()

open fun fromUri(uri: String): Style.Builder

Will loads a new map style asynchronous from the specified URI.

{@code uri} can take the following forms:<ul><li>{@code Style#StyleUrl}: load one of the bundled styles in Style.</li><li>{@code mapbox://styles//</li></ul>

Return

this

See also

Name Summary
com.mapbox.mapboxsdk.maps.Style  
   
Parameters
Name Summary
uri
The URI of the map style
   
   

getJson

open fun getJson(): String

getUri

open fun getUri(): String

images

private val images: List<Style.Builder.ImageWrapper>

layers

private val layers: List<Style.Builder.LayerWrapper>

sources

private val sources: List<Source>

transitionOptions

private open val transitionOptions: TransitionOptions

withBitmapImages

@NonNull()

open fun withBitmapImages(values: Array<Pair<String, Bitmap»): Style.Builder

Will add the images when the map style has loaded.

Return

this

Parameters
Name Summary
values
pairs, where first is the id for te image and second is the bitmap
   
   

@NonNull()

open fun withBitmapImages(sdf: Boolean, values: Array<Pair<String, Bitmap»): Style.Builder

Will add the images when the map style has loaded.

Return

this

Parameters
Name Summary
sdf
the flag indicating image is an SDF or template image
values
pairs, where first is the id for te image and second is the bitmap
   
   

withDrawableImages

@NonNull()

open fun withDrawableImages(values: Array<Pair<String, Drawable»): Style.Builder

Will add the drawables as images when the map style has loaded.

Return

this

Parameters
Name Summary
values
pairs, where first is the id for te image and second is the drawable
   
   

@NonNull()

open fun withDrawableImages(sdf: Boolean, values: Array<Pair<String, Drawable»): Style.Builder

Will add the drawables as images when the map style has loaded.

Return

this

Parameters
Name Summary
sdf
the flag indicating image is an SDF or template image
values
pairs, where first is the id for te image and second is the drawable
   
   

withImage

@NonNull()

open fun withImage(id: String, drawable: Drawable): Style.Builder

Will add the drawable as image when the map style has loaded.

Return

this

Parameters
Name Summary
id
the id for the image
drawable
the drawable to be converted and added
   
   

@NonNull()

open fun withImage(id: String, drawable: Drawable, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent): Style.Builder

Will add the drawable as image when the map style has loaded.

Return

this

Parameters
Name Summary
id
the id for the image
drawable
the drawable to be converted and added
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

@NonNull()

open fun withImage(id: String, image: Bitmap): Style.Builder

Will add the image when the map style has loaded.

Return

this

Parameters
Name Summary
id
the id for the image
image
the image to be added
   
   

@NonNull()

open fun withImage(id: String, image: Bitmap, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent): Style.Builder

Will add the image when the map style has loaded.

Return

this

Parameters
Name Summary
id
the id for the image
image
the image to be added
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

@NonNull()

open fun withImage(id: String, drawable: Drawable, sdf: Boolean): Style.Builder

Will add the drawable as image when the map style has loaded.

Return

this

Parameters
Name Summary
id
the id for the image
drawable
the drawable to be converted and added
sdf
the flag indicating image is an SDF or template image
   
   

@NonNull()

open fun withImage(id: String, drawable: Drawable, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent): Style.Builder

Will add the drawable as image when the map style has loaded.

Return

this

Parameters
Name Summary
id
the id for the image
drawable
the drawable to be converted and added
sdf
the flag indicating image is an SDF or template image
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

@NonNull()

open fun withImage(id: String, image: Bitmap, sdf: Boolean): Style.Builder

Will add the image when the map style has loaded.

Return

this

Parameters
Name Summary
id
the id for the image
image
the image to be added
sdf
the flag indicating image is an SDF or template image
   
   

@NonNull()

open fun withImage(id: String, image: Bitmap, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent): Style.Builder

Will add the image when the map style has loaded.

Return

this

Parameters
Name Summary
id
the id for the image
image
the image to be added
sdf
the flag indicating image is an SDF or template image
stretchX
image stretch areas for x axix
stretchY
image stretch areas for y axix
content
image content for text to fit
   
   

withLayerAbove

@NonNull()

open fun withLayerAbove(layer: Layer, aboveLayerId: String): Style.Builder

Will add the layer when the style has loaded above a specified layer id.

Return

this

Parameters
Name Summary
layer
the layer to be added
   
   

withLayerAt

@NonNull()

open fun withLayerAt(layer: Layer, index: Int): Style.Builder

Will add the layer when the style has loaded at a specified index.

Return

this

Parameters
Name Summary
layer
the layer to be added
   
   

withLayerBelow

@NonNull()

open fun withLayerBelow(layer: Layer, belowLayerId: String): Style.Builder

Will add the layer when the style has loaded below a specified layer id.

Return

this

Parameters
Name Summary
layer
the layer to be added
   
   

withLayer

@NonNull()

open fun withLayer(layer: Layer): Style.Builder

Will add the layer when the style has loaded.

Return

this

Parameters
Name Summary
layer
the layer to be added
   
   

withLayers

@NonNull()

open fun withLayers(layers: Array<Layer>): Style.Builder

Will add the layers when the style has loaded.

Return

this

Parameters
Name Summary
layers
the layers to be added
   
   

withSource

@NonNull()

open fun withSource(source: Source): Style.Builder

Will add the source when map style has loaded.

Return

this

Parameters
Name Summary
source
the source to add
   
   

withSources

@NonNull()

open fun withSources(sources: Array<Source>): Style.Builder

Will add the sources when map style has loaded.

Return

this

Parameters
Name Summary
sources
the sources to add
   
   

withTransition

@NonNull()

open fun withTransition(transition: TransitionOptions): Style.Builder

Will add the transition when the map style has loaded.

Return

this

Parameters
Name Summary
transition
the transition to be added
   
   

ImageWrapper

open class ImageWrapper

Constructors

Name Summary
ImageWrapper open fun ImageWrapper(id: String, bitmap: Bitmap, sdf: Boolean)
ImageWrapper open fun ImageWrapper(id: String, bitmap: Bitmap, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent)

Functions

Name Summary
convertToImageArray
open fun convertToImageArray(bitmapHashMap: HashMap<String, Bitmap>, sdf: Boolean): Array<Style.Builder.ImageWrapper>
open fun convertToImageArray(bitmapHashMap: HashMap<String, Bitmap>, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent): Array<Style.Builder.ImageWrapper>
isSdf
open fun isSdf(): Boolean

Properties

Name Summary
bitmap open val bitmap: Bitmap
content open val content: ImageContent
id open val id: String
sdf open val sdf: Boolean
stretchX open val stretchX: List<ImageStretches>
stretchY open val stretchY: List<ImageStretches>

bitmap

open val bitmap: Bitmap

content

open val content: ImageContent

convertToImageArray

open fun convertToImageArray(bitmapHashMap: HashMap<String, Bitmap>, sdf: Boolean): Array<Style.Builder.ImageWrapper>
open fun convertToImageArray(bitmapHashMap: HashMap<String, Bitmap>, sdf: Boolean, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, content: ImageContent): Array<Style.Builder.ImageWrapper>

id

open val id: String

isSdf

open fun isSdf(): Boolean

sdf

open val sdf: Boolean

stretchX

open val stretchX: List<ImageStretches>

stretchY

open val stretchY: List<ImageStretches>

LayerAboveWrapper

open class LayerAboveWrapper : Style.Builder.LayerWrapper

Constructors

Name Summary
LayerAboveWrapper open fun LayerAboveWrapper(layer: Layer, aboveLayer: String)

Functions

Name Summary
getLayer
open fun getLayer(): Layer

Properties

Name Summary
aboveLayer open val aboveLayer: String

aboveLayer

open val aboveLayer: String

LayerAtWrapper

open class LayerAtWrapper : Style.Builder.LayerWrapper

Constructors

Name Summary
LayerAtWrapper open fun LayerAtWrapper(layer: Layer, index: Int)

Functions

Name Summary
getLayer
open fun getLayer(): Layer

Properties

Name Summary
index open val index: Int

index

open val index: Int

LayerBelowWrapper

open class LayerBelowWrapper : Style.Builder.LayerWrapper

Constructors

Name Summary
LayerBelowWrapper open fun LayerBelowWrapper(layer: Layer, belowLayer: String)

Functions

Name Summary
getLayer
open fun getLayer(): Layer

Properties

Name Summary
belowLayer open val belowLayer: String

belowLayer

open val belowLayer: String

LayerWrapper

open class LayerWrapper

Constructors

Name Summary
LayerWrapper open fun LayerWrapper(layer: Layer)

Properties

Name Summary
layer open val layer: Layer

Inheritors

Name
Style.Builder
Style.Builder
Style.Builder

layer

open val layer: Layer

OnStyleLoaded

interface OnStyleLoaded

Callback to be invoked when a style has finished loading.

Functions

Name Summary
onStyleLoaded
abstract fun onStyleLoaded(style: Style)
Invoked when a style has finished loading.

onStyleLoaded

abstract fun onStyleLoaded(style: Style)

Invoked when a style has finished loading.

Parameters
Name Summary
style
the style that has finished loading
   
   

StyleUrl

@Retention(value = RetentionPolicy.SOURCE)

annotation class StyleUrl

Indicates the parameter accepts one of the values from Style. Using one of theseconstants means your map style will always use the latest version and may change as weimprove the style

Functions

Name Summary
annotationType
abstract fun annotationType(): Class
equals
abstract fun equals(p: Any): Boolean
hashCode
abstract fun hashCode(): Int
toString
abstract fun toString(): String

SupportMapFragment

open class SupportMapFragment : Fragment, OnMapReadyCallback

Support Fragment wrapper around a map view.

A Map component in an app. This fragment is the simplest way to place a map in an application. It’s a wrapper around a view of a map to automatically handle the necessary life cycle needs. Being a fragment, this component can be added to an activity’s layout or can dynamically be added using a FragmentManager.

To get a reference to the MapView, use getMapAsync}

See also

Name Summary
#getMapAsync(OnMapReadyCallback)
#getMapAsync(OnMapReadyCallback)
   

Functions

Name Summary
callStartTransitionListener
open fun callStartTransitionListener()
dump
open fun dump(prefix: String, fd: FileDescriptor, writer: PrintWriter, args: Array)
ensureAnimationInfo
open fun ensureAnimationInfo(): Fragment.AnimationInfo
equals
fun equals(o: Any): Boolean
findFragmentByWho
open fun findFragmentByWho(who: String): Fragment
getActivity
fun getActivity(): FragmentActivity
getAllowEnterTransitionOverlap
open fun getAllowEnterTransitionOverlap(): Boolean
getAllowReturnTransitionOverlap
open fun getAllowReturnTransitionOverlap(): Boolean
getAnimatingAway
open fun getAnimatingAway(): View
getAnimator
open fun getAnimator(): Animator
getArguments
fun getArguments(): Bundle
getChildFragmentManager
fun getChildFragmentManager(): FragmentManager
getContext
open fun getContext(): Context
getEnterTransition
open fun getEnterTransition(): Any
getEnterTransitionCallback
open fun getEnterTransitionCallback(): SharedElementCallback
getExitTransition
open fun getExitTransition(): Any
getExitTransitionCallback
open fun getExitTransitionCallback(): SharedElementCallback
getFragmentManager
fun getFragmentManager(): FragmentManager
getHost
fun getHost(): Any
getId
fun getId(): Int
getLayoutInflater
fun getLayoutInflater(): LayoutInflater
getLifecycle
open fun getLifecycle(): Lifecycle
getLoaderManager
open fun getLoaderManager(): LoaderManager
getMapAsync
open fun getMapAsync(onMapReadyCallback: OnMapReadyCallback)
Sets a callback object which will be triggered when the MapboxMap instance is ready to be used.
getNextAnim
open fun getNextAnim(): Int
getNextTransition
open fun getNextTransition(): Int
getNextTransitionStyle
open fun getNextTransitionStyle(): Int
getParentFragment
fun getParentFragment(): Fragment
getReenterTransition
open fun getReenterTransition(): Any
getResources
fun getResources(): Resources
getRetainInstance
fun getRetainInstance(): Boolean
getReturnTransition
open fun getReturnTransition(): Any
getSharedElementEnterTransition
open fun getSharedElementEnterTransition(): Any
getSharedElementReturnTransition
open fun getSharedElementReturnTransition(): Any
getStateAfterAnimating
open fun getStateAfterAnimating(): Int
getString
fun getString(resId: Int): String
getTag
fun getTag(): String
getTargetFragment
fun getTargetFragment(): Fragment
getTargetRequestCode
fun getTargetRequestCode(): Int
getText
fun getText(resId: Int): CharSequence
getUserVisibleHint
open fun getUserVisibleHint(): Boolean
getView
open fun getView(): View
getViewLifecycleOwner
open fun getViewLifecycleOwner(): LifecycleOwner
getViewLifecycleOwnerLiveData
open fun getViewLifecycleOwnerLiveData(): LiveData
getViewModelStore
open fun getViewModelStore(): ViewModelStore
hashCode
fun hashCode(): Int
hasOptionsMenu
fun hasOptionsMenu(): Boolean
initState
open fun initState()
instantiate
open fun instantiate(context: Context, fname: String): Fragment
instantiateChildFragmentManager
open fun instantiateChildFragmentManager()
isAdded
fun isAdded(): Boolean
isDetached
fun isDetached(): Boolean
isHidden
fun isHidden(): Boolean
isHideReplaced
open fun isHideReplaced(): Boolean
isInBackStack
fun isInBackStack(): Boolean
isInLayout
fun isInLayout(): Boolean
isMenuVisible
fun isMenuVisible(): Boolean
isPostponed
open fun isPostponed(): Boolean
isRemoving
fun isRemoving(): Boolean
isResumed
fun isResumed(): Boolean
isStateSaved
fun isStateSaved(): Boolean
isSupportFragmentClass
open fun isSupportFragmentClass(context: Context, fname: String): Boolean
isVisible
fun isVisible(): Boolean
newInstance
open fun newInstance(): SupportMapFragment
Creates a default MapFragment instance
@NonNull()
open fun newInstance(mapboxMapOptions: MapboxMapOptions): SupportMapFragment
Creates a MapFragment instance
noteStateNotSaved
open fun noteStateNotSaved()
onActivityCreated
open fun onActivityCreated(savedInstanceState: Bundle)
onActivityResult
open fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent)
onAttach
open fun onAttach(context: Context)
open fun onAttach(context: Context)
Called when the context attaches to this fragment.
onAttachFragment
open fun onAttachFragment(childFragment: Fragment)
onConfigurationChanged
open fun onConfigurationChanged(newConfig: Configuration)
onContextItemSelected
open fun onContextItemSelected(item: MenuItem): Boolean
onCreate
open fun onCreate(savedInstanceState: Bundle)
onCreateAnimation
open fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation
onCreateAnimator
open fun onCreateAnimator(transit: Int, enter: Boolean, nextAnim: Int): Animator
onCreateContextMenu
open fun onCreateContextMenu(menu: ContextMenu, v: View, menuInfo: ContextMenu.ContextMenuInfo)
onCreateOptionsMenu
open fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater)
onCreateView
open fun onCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle): View
open fun onCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle): View
Creates the fragment view hierarchy.
onDestroy
open fun onDestroy()
open fun onDestroy()
Called when the fragment is destroyed.
onDestroyOptionsMenu
open fun onDestroyOptionsMenu()
onDestroyView
open fun onDestroyView()
open fun onDestroyView()
Called when the fragment is view hierarchy is being destroyed.
onDetach
open fun onDetach()
onGetLayoutInflater
open fun onGetLayoutInflater(savedInstanceState: Bundle): LayoutInflater
onHiddenChanged
open fun onHiddenChanged(hidden: Boolean)
onInflate
open fun onInflate(context: Context, attrs: AttributeSet, savedInstanceState: Bundle)
open fun onInflate(context: Context, attrs: AttributeSet, savedInstanceState: Bundle)
Called when this fragment is inflated, parses XML tag attributes.
onLowMemory
open fun onLowMemory()
open fun onLowMemory()
Called when the fragment receives onLowMemory call from the hosting Activity.
onMapReady
open fun onMapReady(mapboxMap: MapboxMap)
Called when the map is ready to be used.
onMultiWindowModeChanged
open fun onMultiWindowModeChanged(isInMultiWindowMode: Boolean)
onOptionsItemSelected
open fun onOptionsItemSelected(item: MenuItem): Boolean
onOptionsMenuClosed
open fun onOptionsMenuClosed(menu: Menu)
onPause
open fun onPause()
open fun onPause()
Called when the fragment is pausing.
onPictureInPictureModeChanged
open fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean)
onPrepareOptionsMenu
open fun onPrepareOptionsMenu(menu: Menu)
onRequestPermissionsResult
open fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: Array)
onResume
open fun onResume()
open fun onResume()
Called when the fragment is ready to be interacted with.
onSaveInstanceState
open fun onSaveInstanceState(outState: Bundle)
open fun onSaveInstanceState(outState: Bundle)
Called when the fragment state needs to be saved.
onStart
open fun onStart()
open fun onStart()
Called when the fragment is visible for the users.
onStop
open fun onStop()
open fun onStop()
Called when the fragment is no longer visible for the user.
onViewCreated
open fun onViewCreated(view: View, savedInstanceState: Bundle)
open fun onViewCreated(view: View, savedInstanceState: Bundle)
Called when the fragment view hierarchy is created.
onViewStateRestored
open fun onViewStateRestored(savedInstanceState: Bundle)
peekChildFragmentManager
open fun peekChildFragmentManager(): FragmentManager
performActivityCreated
open fun performActivityCreated(savedInstanceState: Bundle)
performConfigurationChanged
open fun performConfigurationChanged(newConfig: Configuration)
performContextItemSelected
open fun performContextItemSelected(item: MenuItem): Boolean
performCreate
open fun performCreate(savedInstanceState: Bundle)
performCreateOptionsMenu
open fun performCreateOptionsMenu(menu: Menu, inflater: MenuInflater): Boolean
performCreateView
open fun performCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle)
performDestroy
open fun performDestroy()
performDestroyView
open fun performDestroyView()
performDetach
open fun performDetach()
performGetLayoutInflater
open fun performGetLayoutInflater(savedInstanceState: Bundle): LayoutInflater
performLowMemory
open fun performLowMemory()
performMultiWindowModeChanged
open fun performMultiWindowModeChanged(isInMultiWindowMode: Boolean)
performOptionsItemSelected
open fun performOptionsItemSelected(item: MenuItem): Boolean
performOptionsMenuClosed
open fun performOptionsMenuClosed(menu: Menu)
performPause
open fun performPause()
performPictureInPictureModeChanged
open fun performPictureInPictureModeChanged(isInPictureInPictureMode: Boolean)
performPrepareOptionsMenu
open fun performPrepareOptionsMenu(menu: Menu): Boolean
performResume
open fun performResume()
performSaveInstanceState
open fun performSaveInstanceState(outState: Bundle)
performStart
open fun performStart()
performStop
open fun performStop()
postponeEnterTransition
open fun postponeEnterTransition()
registerForContextMenu
open fun registerForContextMenu(view: View)
requestPermissions
fun requestPermissions(permissions: Array, requestCode: Int)
requireActivity
fun requireActivity(): FragmentActivity
requireContext
fun requireContext(): Context
requireFragmentManager
fun requireFragmentManager(): FragmentManager
requireHost
fun requireHost(): Any
restoreChildFragmentState
open fun restoreChildFragmentState(savedInstanceState: Bundle)
restoreViewState
fun restoreViewState(savedInstanceState: Bundle)
setAllowEnterTransitionOverlap
open fun setAllowEnterTransitionOverlap(allow: Boolean)
setAllowReturnTransitionOverlap
open fun setAllowReturnTransitionOverlap(allow: Boolean)
setAnimatingAway
open fun setAnimatingAway(view: View)
setAnimator
open fun setAnimator(animator: Animator)
setArguments
open fun setArguments(args: Bundle)
setEnterSharedElementCallback
open fun setEnterSharedElementCallback(callback: SharedElementCallback)
setEnterTransition
open fun setEnterTransition(transition: Any)
setExitSharedElementCallback
open fun setExitSharedElementCallback(callback: SharedElementCallback)
setExitTransition
open fun setExitTransition(transition: Any)
setHasOptionsMenu
open fun setHasOptionsMenu(hasMenu: Boolean)
setHideReplaced
open fun setHideReplaced(replaced: Boolean)
setIndex
fun setIndex(index: Int, parent: Fragment)
setInitialSavedState
open fun setInitialSavedState(state: Fragment.SavedState)
setMenuVisibility
open fun setMenuVisibility(menuVisible: Boolean)
setNextAnim
open fun setNextAnim(animResourceId: Int)
setNextTransition
open fun setNextTransition(nextTransition: Int, nextTransitionStyle: Int)
setOnStartEnterTransitionListener
open fun setOnStartEnterTransitionListener(listener: Fragment.OnStartEnterTransitionListener)
setReenterTransition
open fun setReenterTransition(transition: Any)
setRetainInstance
open fun setRetainInstance(retain: Boolean)
setReturnTransition
open fun setReturnTransition(transition: Any)
setSharedElementEnterTransition
open fun setSharedElementEnterTransition(transition: Any)
setSharedElementReturnTransition
open fun setSharedElementReturnTransition(transition: Any)
setStateAfterAnimating
open fun setStateAfterAnimating(state: Int)
setTargetFragment
open fun setTargetFragment(fragment: Fragment, requestCode: Int)
setUserVisibleHint
open fun setUserVisibleHint(isVisibleToUser: Boolean)
shouldShowRequestPermissionRationale
open fun shouldShowRequestPermissionRationale(permission: String): Boolean
startActivity
open fun startActivity(intent: Intent)
startActivityForResult
open fun startActivityForResult(intent: Intent, requestCode: Int)
startIntentSenderForResult
open fun startIntentSenderForResult(intent: IntentSender, requestCode: Int, fillInIntent: Intent, flagsMask: Int, flagsValues: Int, extraFlags: Int, options: Bundle)
startPostponedEnterTransition
open fun startPostponedEnterTransition()
toString
open fun toString(): String
unregisterForContextMenu
open fun unregisterForContextMenu(view: View)

getMapAsync

open fun getMapAsync(onMapReadyCallback: OnMapReadyCallback)

Sets a callback object which will be triggered when the MapboxMap instance is ready to be used.

Parameters
Name Summary
onMapReadyCallback
The callback to be invoked.
   
   

newInstance

open fun newInstance(): SupportMapFragment

Creates a default MapFragment instance

Return

MapFragment created

@NonNull()

open fun newInstance(mapboxMapOptions: MapboxMapOptions): SupportMapFragment

Creates a MapFragment instance

Return

MapFragment created.

Parameters
Name Summary
mapboxMapOptions
The configuration options to be used.
   
   

onAttach

open fun onAttach(context: Context)

Called when the context attaches to this fragment.

Parameters
Name Summary
context
the context attaching
   
   

onCreateView

open fun onCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle): View

Creates the fragment view hierarchy.

Return

The view created

Parameters
Name Summary
inflater
Inflater used to inflate content.
container
The parent layout for the map fragment.
savedInstanceState
The saved instance state for the map fragment.
   
   

onDestroyView

open fun onDestroyView()

Called when the fragment is view hierarchy is being destroyed.

onDestroy

open fun onDestroy()

Called when the fragment is destroyed.

onInflate

open fun onInflate(context: Context, attrs: AttributeSet, savedInstanceState: Bundle)

Called when this fragment is inflated, parses XML tag attributes.

Parameters
Name Summary
context
The context inflating this fragment.
attrs
The XML tag attributes.
savedInstanceState
The saved instance state for the map fragment.
   
   

onLowMemory

open fun onLowMemory()

Called when the fragment receives onLowMemory call from the hosting Activity.

onMapReady

open fun onMapReady(mapboxMap: MapboxMap)

Called when the map is ready to be used.

Parameters
Name Summary
mapboxMap
An instance of MapboxMap associated with the MapFragment orMapView that defines the callback.
   
   

onPause

open fun onPause()

Called when the fragment is pausing.

onResume

open fun onResume()

Called when the fragment is ready to be interacted with.

onSaveInstanceState

open fun onSaveInstanceState(outState: Bundle)

Called when the fragment state needs to be saved.

Parameters
Name Summary
outState
The saved state
   
   

onStart

open fun onStart()

Called when the fragment is visible for the users.

onStop

open fun onStop()

Called when the fragment is no longer visible for the user.

onViewCreated

open fun onViewCreated(view: View, savedInstanceState: Bundle)

Called when the fragment view hierarchy is created.

Parameters
Name Summary
view
The content view of the fragment
savedInstanceState
THe saved instance state of the framgnt
   
   

Transform

class Transform : MapView.OnCameraDidChangeListener

Internal use.

Resembles the current Map transformation.

Responsible for synchronising CameraPosition state and notifying camera change listeners.

Constructors

Name Summary
Transform open fun Transform(mapView: MapView, nativeMap: NativeMap, cameraChangeDispatcher: CameraChangeDispatcher)

Functions

Name Summary
animateCamera
@UiThread()
fun animateCamera(mapboxMap: MapboxMap, update: CameraUpdate, durationMs: Int, callback: MapboxMap.CancelableCallback)
Internal use.
cancelTransitions
open fun cancelTransitions()
easeCamera
@UiThread()
fun easeCamera(mapboxMap: MapboxMap, update: CameraUpdate, durationMs: Int, easingInterpolator: Boolean, callback: MapboxMap.CancelableCallback)
getBearing
open fun getBearing(): Double
getCenterCoordinate
open fun getCenterCoordinate(): LatLng
getLatLng
open fun getLatLng(): LatLng
getMaxPitch
open fun getMaxPitch(): Double
getMaxZoom
open fun getMaxZoom(): Double
getMinPitch
open fun getMinPitch(): Double
getMinZoom
open fun getMinZoom(): Double
getRawBearing
open fun getRawBearing(): Double
getRawZoom
open fun getRawZoom(): Double
getTilt
open fun getTilt(): Double
initialise
open fun initialise(mapboxMap: MapboxMap, options: MapboxMapOptions)
invalidateCameraPosition
@UiThread()
@Nullable()
open fun invalidateCameraPosition(): CameraPosition
moveBy
open fun moveBy(offsetX: Double, offsetY: Double, duration: Long)
moveCamera
@UiThread()
fun moveCamera(mapboxMap: MapboxMap, update: CameraUpdate, callback: MapboxMap.CancelableCallback)
Internal use.
onCameraDidChange
open fun onCameraDidChange(animated: Boolean)
Called when the camera did change.
resetNorth
@UiThread()
open fun resetNorth()
setBearing
open fun setBearing(bearing: Double)
open fun setBearing(bearing: Double, focalX: Float, focalY: Float)
open fun setBearing(bearing: Double, focalX: Float, focalY: Float, duration: Long)
setCenterCoordinate
open fun setCenterCoordinate(centerCoordinate: LatLng)
setGestureInProgress
open fun setGestureInProgress(gestureInProgress: Boolean)
setMaxPitch
open fun setMaxPitch(maxPitch: Double)
setMaxZoom
open fun setMaxZoom(maxZoom: Double)
setMinPitch
open fun setMinPitch(minPitch: Double)
setMinZoom
open fun setMinZoom(minZoom: Double)
setTilt
open fun setTilt(pitch: Double)
setZoom
open fun setZoom(zoom: Double, focalPoint: PointF)
zoomBy
open fun zoomBy(zoomAddition: Double, focalPoint: PointF)

Properties

Name Summary
cameraPosition @Nullable()
private open val cameraPosition: CameraPosition

animateCamera

@UiThread()

fun animateCamera(mapboxMap: MapboxMap, update: CameraUpdate, durationMs: Int, callback: MapboxMap.CancelableCallback)

Internal use.

cameraPosition

@Nullable()

private open val cameraPosition: CameraPosition

cancelTransitions

open fun cancelTransitions()

easeCamera

@UiThread()

fun easeCamera(mapboxMap: MapboxMap, update: CameraUpdate, durationMs: Int, easingInterpolator: Boolean, callback: MapboxMap.CancelableCallback)

getBearing

open fun getBearing(): Double

getCenterCoordinate

open fun getCenterCoordinate(): LatLng

getLatLng

open fun getLatLng(): LatLng

getMaxPitch

open fun getMaxPitch(): Double

getMaxZoom

open fun getMaxZoom(): Double

getMinPitch

open fun getMinPitch(): Double

getMinZoom

open fun getMinZoom(): Double

getRawBearing

open fun getRawBearing(): Double

getRawZoom

open fun getRawZoom(): Double

getTilt

open fun getTilt(): Double

initialise

open fun initialise(mapboxMap: MapboxMap, options: MapboxMapOptions)

invalidateCameraPosition

@UiThread()
@Nullable()

open fun invalidateCameraPosition(): CameraPosition

moveBy

open fun moveBy(offsetX: Double, offsetY: Double, duration: Long)

moveCamera

@UiThread()

fun moveCamera(mapboxMap: MapboxMap, update: CameraUpdate, callback: MapboxMap.CancelableCallback)

Internal use.

onCameraDidChange

open fun onCameraDidChange(animated: Boolean)

Called when the camera did change.

resetNorth

@UiThread()

open fun resetNorth()

setBearing

open fun setBearing(bearing: Double)
open fun setBearing(bearing: Double, focalX: Float, focalY: Float)
open fun setBearing(bearing: Double, focalX: Float, focalY: Float, duration: Long)

setCenterCoordinate

open fun setCenterCoordinate(centerCoordinate: LatLng)

setGestureInProgress

open fun setGestureInProgress(gestureInProgress: Boolean)

setMaxPitch

open fun setMaxPitch(maxPitch: Double)

setMaxZoom

open fun setMaxZoom(maxZoom: Double)

setMinPitch

open fun setMinPitch(minPitch: Double)

setMinZoom

open fun setMinZoom(minZoom: Double)

setTilt

open fun setTilt(pitch: Double)

setZoom

open fun setZoom(zoom: Double, focalPoint: PointF)

zoomBy

open fun zoomBy(zoomAddition: Double, focalPoint: PointF)

UiSettings

class UiSettings

Settings for the user interface of a MapboxMap. To obtain this interface, call getUiSettings().

Constructors

Name Summary
UiSettings open fun UiSettings(projection: Projection, listener: FocalPointChangeListener, pixelRatio: Float, mapView: MapView)

Functions

Name Summary
areAllGesturesEnabled
open fun areAllGesturesEnabled(): Boolean
Retrieves the current status of whether all gestures are enabled.
getAttributionGravity
open fun getAttributionGravity(): Int
Returns the gravity value of the logo
getAttributionMarginBottom
@Px()
open fun getAttributionMarginBottom(): Int
Returns the bottom side margin of the logo in pixels.
getAttributionMarginLeft
@Px()
open fun getAttributionMarginLeft(): Int
Returns the left side margin of the attribution view in pixels.
getAttributionMarginRight
@Px()
open fun getAttributionMarginRight(): Int
Returns the right side margin of the attribution view in pixels.
getAttributionMarginTop
@Px()
open fun getAttributionMarginTop(): Int
Returns the top side margin of the attribution view in pixels.
getCompassGravity
open fun getCompassGravity(): Int
Returns the gravity value of the CompassView
getCompassImage
@Nullable()
open fun getCompassImage(): Drawable
Get the current configured CompassView image.
getCompassMarginBottom
@Px()
open fun getCompassMarginBottom(): Int
Returns the bottom side margin of CompassView in pixels.
getCompassMarginLeft
@Px()
open fun getCompassMarginLeft(): Int
Returns the left side margin of CompassView in pixels.
getCompassMarginRight
@Px()
open fun getCompassMarginRight(): Int
Returns the right side margin of CompassView in pixels.
getCompassMarginTop
@Px()
open fun getCompassMarginTop(): Int
Returns the top side margin of CompassView in pixels.
getFocalPoint
@Nullable()
open fun getFocalPoint(): PointF
Returns the gesture focal point
getHeight
open fun getHeight(): Float
Returns the measured height of the MapView
getLogoGravity
open fun getLogoGravity(): Int
Returns the gravity value of the logo
getLogoMarginBottom
@Px()
open fun getLogoMarginBottom(): Int
Returns the bottom side margin of the logo in pixels.
getLogoMarginLeft
@Px()
open fun getLogoMarginLeft(): Int
Returns the left side margin of the logo in pixels.
getLogoMarginRight
@Px()
open fun getLogoMarginRight(): Int
Returns the right side margin of the logo in pixels.
getLogoMarginTop
@Px()
open fun getLogoMarginTop(): Int
Returns the top side margin of the logo in pixels.
getWidth
open fun getWidth(): Float
Returns the measured width of the MapView
initialise
open fun initialise(context: Context, options: MapboxMapOptions)
invalidate
open fun invalidate()
Invalidates the ViewSettings instances shown on top of the MapView
isAttributionEnabled
open fun isAttributionEnabled(): Boolean
Returns whether the attribution is enabled.
isCompassEnabled
open fun isCompassEnabled(): Boolean
Returns whether the compass is enabled.
isCompassFadeWhenFacingNorth
open fun isCompassFadeWhenFacingNorth(): Boolean
Returns whether the compass performs a fading animation out when facing north.
isDeselectMarkersOnTap
open fun isDeselectMarkersOnTap(): Boolean
Gets whether the markers are automatically deselected (and therefore, their infowindowsclosed) when a map tap is detected.
isDisableRotateWhenScaling
open fun isDisableRotateWhenScaling(): Boolean
Returns whether rotation gesture detector is disabled when scale is detected first.
isDoubleTapGesturesEnabled
open fun isDoubleTapGesturesEnabled(): Boolean
Returns whether the user may zoom the map with a double tap.
isFlingVelocityAnimationEnabled
open fun isFlingVelocityAnimationEnabled(): Boolean
Returns whether fling velocity animation should execute after users finishes a gesture.
isHorizontalScrollGesturesEnabled
open fun isHorizontalScrollGesturesEnabled(): Boolean
Returns whether the user may scroll horizontally around the map.
isIncreaseScaleThresholdWhenRotating
open fun isIncreaseScaleThresholdWhenRotating(): Boolean
Returns whether scale threshold should be increase whenever rotation is detected.
isLogoEnabled
open fun isLogoEnabled(): Boolean
Returns whether the logo is enabled.
isQuickZoomGesturesEnabled
open fun isQuickZoomGesturesEnabled(): Boolean
Returns whether the user may zoom the map by tapping twice, holding and moving the pointer up and down.
isRotateGesturesEnabled
open fun isRotateGesturesEnabled(): Boolean
Returns whether the user may rotate the map.
isRotateVelocityAnimationEnabled
open fun isRotateVelocityAnimationEnabled(): Boolean
Returns whether rotate velocity animation should execute after users finishes a gesture.
isScaleVelocityAnimationEnabled
open fun isScaleVelocityAnimationEnabled(): Boolean
Returns whether scale velocity animation should execute after users finishes a gesture.
isScrollGesturesEnabled
open fun isScrollGesturesEnabled(): Boolean
Returns whether the user may scroll around the map.
isTiltGesturesEnabled
open fun isTiltGesturesEnabled(): Boolean
Returns whether the user may tilt the map.
isZoomGesturesEnabled
open fun isZoomGesturesEnabled(): Boolean
Returns whether the user may zoom the map.
onRestoreInstanceState
open fun onRestoreInstanceState(savedInstanceState: Bundle)
onSaveInstanceState
open fun onSaveInstanceState(outState: Bundle)
setAllGesturesEnabled
open fun setAllGesturesEnabled(enabled: Boolean)
Sets the preference for whether all gestures should be enabled or disabled.
setAllVelocityAnimationsEnabled
open fun setAllVelocityAnimationsEnabled(allVelocityAnimationsEnabled: Boolean)
Set whether all velocity animations should execute after users finishes a gesture.
setAttributionEnabled
open fun setAttributionEnabled(enabled: Boolean)
Enables or disables the attribution.
setAttributionGravity
open fun setAttributionGravity(gravity: Int)
Sets the gravity of the attribution.
setAttributionMargins
open fun setAttributionMargins(left: Int, top: Int, right: Int, bottom: Int)
Sets the margins of the attribution view in pixels.
setAttributionTintColor
open fun setAttributionTintColor(tintColor: Int)
Sets the tint of the attribution view.
setCompassEnabled
open fun setCompassEnabled(compassEnabled: Boolean)
Enables or disables the compass.
setCompassFadeFacingNorth
open fun setCompassFadeFacingNorth(compassFadeFacingNorth: Boolean)
Enables or disables fading of the compass when facing north.
setCompassGravity
@UiThread()
open fun setCompassGravity(gravity: Int)
Sets the gravity of the compass view.
setCompassImage
open fun setCompassImage(compass: Drawable)
Specifies the CompassView image.
setFocalPoint
open fun setFocalPoint(focalPoint: PointF)
Sets the focal point used as center for a gesture
setLogoEnabled
open fun setLogoEnabled(enabled: Boolean)
Enables or disables the Mapbox logo.
setLogoGravity
open fun setLogoGravity(gravity: Int)
Sets the gravity of the logo view.
update
open fun update(cameraPosition: CameraPosition)

Properties

Name Summary
attributionDialogManager private open var attributionDialogManager: AttributionDialogManager
attributionsView @Nullable()
open val attributionsView: ImageView
compassMargins private var compassMargins: Array
compassView @Nullable()
open val compassView: CompassView
deselectMarkersOnTap private open var deselectMarkersOnTap: Boolean
disableRotateWhenScaling private open var disableRotateWhenScaling: Boolean
doubleTapGesturesEnabled private open var doubleTapGesturesEnabled: Boolean
flingVelocityAnimationEnabled private open var flingVelocityAnimationEnabled: Boolean
horizontalScrollGesturesEnabled private open var horizontalScrollGesturesEnabled: Boolean
increaseRotateThresholdWhenScaling private open var increaseRotateThresholdWhenScaling: Boolean
increaseScaleThresholdWhenRotating private open var increaseScaleThresholdWhenRotating: Boolean
isAttributionInitialized open val isAttributionInitialized: Boolean
isCompassInitialized open val isCompassInitialized: Boolean
isLogoInitialized open val isLogoInitialized: Boolean
logoView @Nullable()
open val logoView: ImageView
pixelRatio private val pixelRatio: Float
quickZoomGesturesEnabled private open var quickZoomGesturesEnabled: Boolean
rotateGesturesEnabled private open var rotateGesturesEnabled: Boolean
rotateVelocityAnimationEnabled private open var rotateVelocityAnimationEnabled: Boolean
scaleVelocityAnimationEnabled private open var scaleVelocityAnimationEnabled: Boolean
scrollGesturesEnabled private open var scrollGesturesEnabled: Boolean
tiltGesturesEnabled private open var tiltGesturesEnabled: Boolean
zoomGesturesEnabled private open var zoomGesturesEnabled: Boolean
zoomRate private open var zoomRate: Float

areAllGesturesEnabled

open fun areAllGesturesEnabled(): Boolean

Retrieves the current status of whether all gestures are enabled.

Return

If true, all gestures are enabled.

attributionDialogManager

private open var attributionDialogManager: AttributionDialogManager

attributionsView

@Nullable()

open val attributionsView: ImageView

compassMargins

private var compassMargins: Array

compassView

@Nullable()

open val compassView: CompassView

deselectMarkersOnTap

private open var deselectMarkersOnTap: Boolean

disableRotateWhenScaling

private open var disableRotateWhenScaling: Boolean

doubleTapGesturesEnabled

private open var doubleTapGesturesEnabled: Boolean

flingVelocityAnimationEnabled

private open var flingVelocityAnimationEnabled: Boolean

getAttributionGravity

open fun getAttributionGravity(): Int

Returns the gravity value of the logo

Return

The gravity

getAttributionMarginBottom

@Px()

open fun getAttributionMarginBottom(): Int

Returns the bottom side margin of the logo in pixels.

Return

The bottom margin in pixels

getAttributionMarginLeft

@Px()

open fun getAttributionMarginLeft(): Int

Returns the left side margin of the attribution view in pixels.

Return

The left margin in pixels

getAttributionMarginRight

@Px()

open fun getAttributionMarginRight(): Int

Returns the right side margin of the attribution view in pixels.

Return

The right margin in pixels

getAttributionMarginTop

@Px()

open fun getAttributionMarginTop(): Int

Returns the top side margin of the attribution view in pixels.

Return

The top margin in pixels

getCompassGravity

open fun getCompassGravity(): Int

Returns the gravity value of the CompassView

Return

The gravity

getCompassImage

@Nullable()

open fun getCompassImage(): Drawable

Get the current configured CompassView image.

Return

the drawable used as compass image

getCompassMarginBottom

@Px()

open fun getCompassMarginBottom(): Int

Returns the bottom side margin of CompassView in pixels.

Return

The bottom margin in pixels

getCompassMarginLeft

@Px()

open fun getCompassMarginLeft(): Int

Returns the left side margin of CompassView in pixels.

Return

The left margin in pixels

getCompassMarginRight

@Px()

open fun getCompassMarginRight(): Int

Returns the right side margin of CompassView in pixels.

Return

The right margin in pixels

getCompassMarginTop

@Px()

open fun getCompassMarginTop(): Int

Returns the top side margin of CompassView in pixels.

Return

The top margin in pixels

getFocalPoint

@Nullable()

open fun getFocalPoint(): PointF

Returns the gesture focal point

Return

The focal point

getHeight

open fun getHeight(): Float

Returns the measured height of the MapView

Return

height in pixels

getLogoGravity

open fun getLogoGravity(): Int

Returns the gravity value of the logo

Return

The gravity

getLogoMarginBottom

@Px()

open fun getLogoMarginBottom(): Int

Returns the bottom side margin of the logo in pixels.

Return

The bottom margin in pixels

getLogoMarginLeft

@Px()

open fun getLogoMarginLeft(): Int

Returns the left side margin of the logo in pixels.

Return

The left margin in pixels

getLogoMarginRight

@Px()

open fun getLogoMarginRight(): Int

Returns the right side margin of the logo in pixels.

Return

The right margin in pixels

getLogoMarginTop

@Px()

open fun getLogoMarginTop(): Int

Returns the top side margin of the logo in pixels.

Return

The top margin in pixels

getWidth

open fun getWidth(): Float

Returns the measured width of the MapView

Return

widht in pixels

horizontalScrollGesturesEnabled

private open var horizontalScrollGesturesEnabled: Boolean

increaseRotateThresholdWhenScaling

private open var increaseRotateThresholdWhenScaling: Boolean

increaseScaleThresholdWhenRotating

private open var increaseScaleThresholdWhenRotating: Boolean

initialise

open fun initialise(context: Context, options: MapboxMapOptions)

invalidate

open fun invalidate()

Invalidates the ViewSettings instances shown on top of the MapView

isAttributionEnabled

open fun isAttributionEnabled(): Boolean

Returns whether the attribution is enabled.

Return

True if the attribution is enabled; false if the attribution is disabled.

isAttributionInitialized

open val isAttributionInitialized: Boolean

isCompassEnabled

open fun isCompassEnabled(): Boolean

Returns whether the compass is enabled.

Return

True if the compass is enabled; false if the compass is disabled.

isCompassFadeWhenFacingNorth

open fun isCompassFadeWhenFacingNorth(): Boolean

Returns whether the compass performs a fading animation out when facing north.

Return

True if the compass will fade, false if it remains visible

isCompassInitialized

open val isCompassInitialized: Boolean

isDeselectMarkersOnTap

open fun isDeselectMarkersOnTap(): Boolean

Gets whether the markers are automatically deselected (and therefore, their infowindowsclosed) when a map tap is detected.

Return

If true, markers are deselected on a map tap.

isDisableRotateWhenScaling

open fun isDisableRotateWhenScaling(): Boolean

Returns whether rotation gesture detector is disabled when scale is detected first.

Return

If true, rotation gesture detector will be disabled when scale is detected first.

isDoubleTapGesturesEnabled

open fun isDoubleTapGesturesEnabled(): Boolean

Returns whether the user may zoom the map with a double tap.

Return

If true, zooming with a double tap is enabled.

isFlingVelocityAnimationEnabled

open fun isFlingVelocityAnimationEnabled(): Boolean

Returns whether fling velocity animation should execute after users finishes a gesture.

Return

If true, fling velocity animation is enabled.

isHorizontalScrollGesturesEnabled

open fun isHorizontalScrollGesturesEnabled(): Boolean

Returns whether the user may scroll horizontally around the map.

Return

If true, scrolling horizontally is enabled.

isIncreaseScaleThresholdWhenRotating

open fun isIncreaseScaleThresholdWhenRotating(): Boolean

Returns whether scale threshold should be increase whenever rotation is detected.

Return

If true, scale threshold will be increased.

isLogoEnabled

open fun isLogoEnabled(): Boolean

Returns whether the logo is enabled.

Return

True if the logo is enabled; false if the logo is disabled.

isLogoInitialized

open val isLogoInitialized: Boolean

isQuickZoomGesturesEnabled

open fun isQuickZoomGesturesEnabled(): Boolean

Returns whether the user may zoom the map by tapping twice, holding and moving the pointer up and down.

Return

If true, zooming by tapping twice and holding is enabled.

isRotateGesturesEnabled

open fun isRotateGesturesEnabled(): Boolean

Returns whether the user may rotate the map.

Return

If true, rotating is enabled.

isRotateVelocityAnimationEnabled

open fun isRotateVelocityAnimationEnabled(): Boolean

Returns whether rotate velocity animation should execute after users finishes a gesture.

Return

If true, rotate velocity animation is enabled.

isScaleVelocityAnimationEnabled

open fun isScaleVelocityAnimationEnabled(): Boolean

Returns whether scale velocity animation should execute after users finishes a gesture.

Return

If true, scale velocity animation is enabled.

isScrollGesturesEnabled

open fun isScrollGesturesEnabled(): Boolean

Returns whether the user may scroll around the map.

Return

If true, scrolling is enabled.

isTiltGesturesEnabled

open fun isTiltGesturesEnabled(): Boolean

Returns whether the user may tilt the map.

Return

If true, tilting is enabled.

isZoomGesturesEnabled

open fun isZoomGesturesEnabled(): Boolean

Returns whether the user may zoom the map.

Return

If true, zooming is enabled.

logoView

@Nullable()

open val logoView: ImageView

onRestoreInstanceState

open fun onRestoreInstanceState(savedInstanceState: Bundle)

onSaveInstanceState

open fun onSaveInstanceState(outState: Bundle)

pixelRatio

private val pixelRatio: Float

quickZoomGesturesEnabled

private open var quickZoomGesturesEnabled: Boolean

rotateGesturesEnabled

private open var rotateGesturesEnabled: Boolean

rotateVelocityAnimationEnabled

private open var rotateVelocityAnimationEnabled: Boolean

scaleVelocityAnimationEnabled

private open var scaleVelocityAnimationEnabled: Boolean

scrollGesturesEnabled

private open var scrollGesturesEnabled: Boolean

setAllGesturesEnabled

open fun setAllGesturesEnabled(enabled: Boolean)

Sets the preference for whether all gestures should be enabled or disabled.

This setting controls only user interactions with the map. If you set the value to false,you may still change the map location programmatically.

The default value is true.

See also

Name Summary
#setZoomGesturesEnabled(boolean)
#setZoomGesturesEnabled(boolean))
#setScrollGesturesEnabled(boolean)
#setScrollGesturesEnabled(boolean)
#setRotateGesturesEnabled(boolean)
#setRotateGesturesEnabled(boolean)
#setTiltGesturesEnabled(boolean)
#setTiltGesturesEnabled(boolean)
#setDoubleTapGesturesEnabled(boolean)
#setDoubleTapGesturesEnabled(boolean)
#setQuickZoomGesturesEnabled(boolean)
#setQuickZoomGesturesEnabled(boolean)
   
Parameters
Name Summary
enabled
If true, all gestures are available; otherwise, all gestures are disabled.
   
   

setAllVelocityAnimationsEnabled

open fun setAllVelocityAnimationsEnabled(allVelocityAnimationsEnabled: Boolean)

Set whether all velocity animations should execute after users finishes a gesture.

Parameters
Name Summary
allVelocityAnimationsEnabled
If true, all velocity animations will be enabled.
   
   

setAttributionEnabled

open fun setAttributionEnabled(enabled: Boolean)

Enables or disables the attribution.

By default, the attribution is enabled.

Parameters
Name Summary
enabled
True to enable the attribution; false to disable the attribution.
   
   

setAttributionGravity

open fun setAttributionGravity(gravity: Int)

Sets the gravity of the attribution.

By default, the attribution is in the bottom left corner next to the Mapbox logo.

Parameters
Name Summary
gravity
Android SDK Gravity.
   
   

setAttributionMargins

open fun setAttributionMargins(left: Int, top: Int, right: Int, bottom: Int)

Sets the margins of the attribution view in pixels.

Parameters
Name Summary
left
The left margin in pixels.
top
The top margin in pixels.
right
The right margin in pixels.
bottom
The bottom margin in pixels.
   
   

setAttributionTintColor

open fun setAttributionTintColor(tintColor: Int)

Sets the tint of the attribution view. Use this to change the color of the attribution.

Parameters
Name Summary
tintColor
Color to tint the attribution.
   
   

setCompassEnabled

open fun setCompassEnabled(compassEnabled: Boolean)

Enables or disables the compass. The compass is an icon on the map that indicates thedirection of north on the map. When a user clicksthe compass, the camera orients itself to its default orientation and fades away shortlyafter. If disabled, the compass will never be displayed.

By default, the compass is enabled.

Parameters
Name Summary
compassEnabled
True to enable the compass; false to disable the compass.
   
   

setCompassFadeFacingNorth

open fun setCompassFadeFacingNorth(compassFadeFacingNorth: Boolean)

Enables or disables fading of the compass when facing north.

By default this feature is enabled

Parameters
Name Summary
compassFadeFacingNorth
True to enable the fading animation; false to disable it
   
   

setCompassGravity

@UiThread()

open fun setCompassGravity(gravity: Int)

Sets the gravity of the compass view. Use this to change the corner of the map view that thecompass is displayed in.

By default, the compass is in the top right corner.

Parameters
Name Summary
gravity
Android SDK Gravity.
   
   

setCompassImage

open fun setCompassImage(compass: Drawable)

Specifies the CompassView image.

By default this value is R.drawable.mapbox_compass_icon.

Parameters
Name Summary
compass
the drawable to show as image compass
   
   

setFocalPoint

open fun setFocalPoint(focalPoint: PointF)

Sets the focal point used as center for a gesture

Parameters
Name Summary
focalPoint
the focal point to be used.
   
   

setLogoEnabled

open fun setLogoEnabled(enabled: Boolean)

Enables or disables the Mapbox logo.

By default, the logo is enabled.

Parameters
Name Summary
enabled
True to enable the logo; false to disable the logo.
   
   

setLogoGravity

open fun setLogoGravity(gravity: Int)

Sets the gravity of the logo view. Use this to change the corner of the map view that theMapbox logo is displayed in.

By default, the logo is in the bottom left corner.

Parameters
Name Summary
gravity
Android SDK Gravity.
   
   

tiltGesturesEnabled

private open var tiltGesturesEnabled: Boolean

update

open fun update(cameraPosition: CameraPosition)

zoomGesturesEnabled

private open var zoomGesturesEnabled: Boolean

zoomRate

private open var zoomRate: Float