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 |
Functions
Name | Summary |
---|---|
addMarker | open fun addMarker(markerOptions: BaseMarkerOptions, mapboxMap: MapboxMap): Marker |
addMarkers | open fun addMarkers(markerOptionsList: List |
addPolygon | open fun addPolygon(polygonOptions: PolygonOptions, mapboxMap: MapboxMap): Polygon |
addPolygons | open fun addPolygons(polygonOptionsList: List |
addPolyline | open fun addPolyline(polylineOptions: PolylineOptions, mapboxMap: MapboxMap): Polyline |
addPolylines | open fun addPolylines(polylineOptionsList: 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
addPolygon
open fun addPolygon(polygonOptions: PolygonOptions, mapboxMap: MapboxMap): Polygon
addPolygons
open fun addPolygons(polygonOptionsList: List
addPolyline
open fun addPolyline(polylineOptions: PolylineOptions, mapboxMap: MapboxMap): Polyline
addPolylines
open fun addPolylines(polylineOptionsList: 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
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
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 |
Image | open fun Image(buffer: 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
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 |
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 |
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
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
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.
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.
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.
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.
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 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 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 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 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 Queries the map for rendered features. @NonNull() open fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: RectF, layerIds: Array @NonNull() open fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: PointF, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression), layerIds: Array @NonNull() open fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: RectF, filter: [Expression](../com.mapbox.mapboxsdk.style.expressions/#expression), layerIds: Array 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
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
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
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
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
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
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
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
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
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
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()
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
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 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 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 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 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
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
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
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
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
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 |
Functions
Name | Summary |
---|---|
addBy | open fun addBy(markerOptions: BaseMarkerOptions, mapboxMap: MapboxMap): Marker @NonNull() open fun addBy(markerOptionsList: List abstract fun [addBy](#addby)(markerOptionsList: 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
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 |
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
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 |
addPolygon | abstract fun addPolygon(polygon: Polygon): Long |
addPolygons | @NonNull() abstract fun addPolygons(polygons: List |
addPolyline | abstract fun addPolyline(polyline: Polyline): Long |
addPolylines | @NonNull() abstract fun addPolylines(polylines: List |
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 |
flyTo | abstract fun flyTo(center: LatLng, zoom: Double, bearing: Double, pitch: Double, padding: Array |
getBearing | abstract fun getBearing(): Double |
getCameraForGeometry | abstract fun getCameraForGeometry(geometry: Geometry, padding: Array |
getCameraForLatLngBounds | abstract fun getCameraForLatLngBounds(bounds: LatLngBounds, padding: Array |
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 |
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 |
projectedMetersForLatLng | abstract fun projectedMetersForLatLng(latLng: LatLng): ProjectedMeters |
queryPointAnnotations | @NonNull() abstract fun queryPointAnnotations(rectF: RectF): Array |
queryRenderedFeatures | @NonNull() abstract fun queryRenderedFeatures(coordinates: PointF, layerIds: Array @NonNull() abstract fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: RectF, layerIds: Array |
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
addPolygon
abstract fun addPolygon(polygon: Polygon): Long
addPolygons
@NonNull()
abstract fun addPolygons(polygons: List
addPolyline
abstract fun addPolyline(polyline: Polyline): Long
addPolylines
@NonNull()
abstract fun addPolylines(polylines: List
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
flyTo
abstract fun flyTo(center: LatLng, zoom: Double, bearing: Double, pitch: Double, padding: Array
getBearing
abstract fun getBearing(): Double
getCameraForGeometry
abstract fun getCameraForGeometry(geometry: Geometry, padding: Array
getCameraForLatLngBounds
abstract fun getCameraForLatLngBounds(bounds: LatLngBounds, padding: Array
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
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
projectedMetersForLatLng
abstract fun projectedMetersForLatLng(latLng: LatLng): ProjectedMeters
queryPointAnnotations
@NonNull()
abstract fun queryPointAnnotations(rectF: RectF): Array
queryRenderedFeatures
@NonNull()
abstract fun queryRenderedFeatures(coordinates: PointF, layerIds: Array
abstract fun queryRenderedFeatures(coordinates: RectF, layerIds: Array
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 |
addPolygon | open fun addPolygon(polygon: Polygon): Long |
addPolygons | @NonNull() open fun addPolygons(polygons: List |
addPolyline | open fun addPolyline(polyline: Polyline): Long |
addPolylines | @NonNull() open fun addPolylines(polylines: List |
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 open fun [easeTo](#easeto)(center: [LatLng](../com.mapbox.mapboxsdk.geometry/#latlng), zoom: Double, angle: Double, pitch: Double, padding: Array |
flyTo | abstract fun flyTo(center: LatLng, zoom: Double, bearing: Double, pitch: Double, padding: Array open fun [flyTo](#flyto)(center: [LatLng](../com.mapbox.mapboxsdk.geometry/#latlng), zoom: Double, angle: Double, pitch: Double, padding: Array |
getBearing | open fun getBearing(): Double |
getCameraForGeometry | abstract fun getCameraForGeometry(geometry: Geometry, padding: Array open fun [getCameraForGeometry](#getcameraforgeometry)(geometry: Geometry, padding: Array |
getCameraForLatLngBounds | abstract fun getCameraForLatLngBounds(bounds: LatLngBounds, padding: Array open fun [getCameraForLatLngBounds](#getcameraforlatlngbounds)(bounds: [LatLngBounds](../com.mapbox.mapboxsdk.geometry/#latlngbounds), padding: Array |
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 |
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 |
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 @NonNull() abstract fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: RectF, layerIds: Array @NonNull() open fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: PointF, layerIds: Array @NonNull() open fun [queryRenderedFeatures](#queryrenderedfeatures)(coordinates: RectF, layerIds: Array |
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
addPolygon
open fun addPolygon(polygon: Polygon): Long
addPolygons
@NonNull()
open fun addPolygons(polygons: List
addPolyline
open fun addPolyline(polyline: Polyline): Long
addPolylines
@NonNull()
open fun addPolylines(polylines: List
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
flyTo
open fun flyTo(center: LatLng, zoom: Double, angle: Double, pitch: Double, padding: Array
getBearing
open fun getBearing(): Double
getCameraForGeometry
open fun getCameraForGeometry(geometry: Geometry, padding: Array
getCameraForLatLngBounds
open fun getCameraForLatLngBounds(bounds: LatLngBounds, padding: Array
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
getLayer
open fun getLayer(layerId: String): Layer
getLayers
@NonNull()
open fun getLayers(): List<Layer>
getLight
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
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
projectedMetersForLatLng
open fun projectedMetersForLatLng(latLng: LatLng): ProjectedMeters
queryPointAnnotations
@NonNull()
open fun queryPointAnnotations(rect: RectF): Array
queryRenderedFeatures
@NonNull()
open fun queryRenderedFeatures(coordinates: PointF, layerIds: Array
open fun queryRenderedFeatures(coordinates: RectF, layerIds: Array
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
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 |
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
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 |
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
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 |
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
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 |
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
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 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 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
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
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
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
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
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
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()
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
@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
@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
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
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 |
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 |
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
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
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
Android SDK
SDK JS Reference
- Root
- attribution
- camera
- constants
- exceptions
- geometry
- http
- location
- location.engine
- location.modes
- location.permissions
- log
- maps
- maps.renderer
- maps.renderer.egl
- maps.renderer.glsurfaceview
- maps.renderer.textureview
- maps.widgets
- module.http
- module.loader
- net
- offline
- snapshotter
- storage
- style.expressions
- style.layers
- style.light
- style.sources
- style.types
- text
- utils