Package com.mapbox.mapboxsdk.location

Contains the Mapbox Location layer component.

Types

Name Summary
AnimatorListenerHolder
open class AnimatorListenerHolder
CompassEngine
interface CompassEngine
Interface defining the source of compass heading data that is consumed by the LocationComponent when in compass related RenderMode or CameraModes.
CompassListener
interface CompassListener
Callbacks related to the compass
IndicatorLocationLayerRenderer
open class IndicatorLocationLayerRenderer : LocationLayerRenderer
LatLngEvaluator
open class LatLngEvaluator : TypeEvaluator<LatLng>
LayerBitmapProvider
open class LayerBitmapProvider
LayerFeatureProvider
open class LayerFeatureProvider
LayerSourceProvider
open class LayerSourceProvider
LocationAnimatorCoordinator
class LocationAnimatorCoordinator
LocationCameraController
class LocationCameraController
LocationComponent
class LocationComponent
The Location Component provides location awareness to your mobile application.
LocationComponentActivationOptions
open class LocationComponentActivationOptions
A class which holds the various options for activating the Maps SDK’s LocationComponent to eventually show the device location on the map.
LocationComponentCompassEngine
open class LocationComponentCompassEngine : CompassEngine, SensorEventListener
This manager class handles compass events such as starting the tracking of device bearing, or when a new compass update occurs.
LocationComponentConstants
class LocationComponentConstants
Contains all the constants being used for the LocationComponent.
LocationComponentNotInitializedException
class LocationComponentNotInitializedException : RuntimeException
LocationComponentOptions
open class LocationComponentOptions : Parcelable
This class exposes options for the Location Component.
LocationComponentPositionManager
open class LocationComponentPositionManager
LocationIndicatorLayer
@UiThread()
open class LocationIndicatorLayer : Layer
The online documentation
LocationLayerController
class LocationLayerController
LocationLayerRenderer
interface LocationLayerRenderer
LocationPropertyFactory
open class LocationPropertyFactory
Constructs paint/layout properties for Layers
MapboxAnimator
abstract class MapboxAnimator<K> : ValueAnimator, ValueAnimator.AnimatorUpdateListener
Abstract class for all of the location component animators.
MapboxAnimatorProvider
class MapboxAnimatorProvider
MapboxAnimatorSetProvider
open class MapboxAnimatorSetProvider
MapboxCameraAnimatorAdapter
open class MapboxCameraAnimatorAdapter : MapboxFloatAnimator
MapboxFloatAnimator
open class MapboxFloatAnimator : MapboxAnimator
MapboxLatLngAnimator
open class MapboxLatLngAnimator : MapboxAnimator<LatLng>
OnCameraMoveInvalidateListener
interface OnCameraMoveInvalidateListener
OnCameraTrackingChangedListener
interface OnCameraTrackingChangedListener
Listener that gets invoked when camera tracking state changes.
OnLocationCameraTransitionListener
interface OnLocationCameraTransitionListener
Callback for CameraMode transition state.
OnLocationClickListener
interface OnLocationClickListener
The Location Component exposes an API for listening to when the user clicks on the location layer icon visible on the map.
OnLocationLongClickListener
interface OnLocationLongClickListener
The Location Component exposes an API for listening to when the user long clicks on the location layer icon visible on the map.
OnLocationStaleListener
interface OnLocationStaleListener
Listener that can be added as a callback when the last location update is considered stale.
OnRenderModeChangedListener
interface OnRenderModeChangedListener
Listener that gets invoked when layer render mode changes.
PulsingLocationCircleAnimator
open class PulsingLocationCircleAnimator : MapboxFloatAnimator
Manages the logic of the interpolated animation which is applied to the LocationComponent’s pulsing circle
StaleStateManager
open class StaleStateManager
Class controls the location stale state when the android.location.Location hasn’t been updated in ‘x’ amount of time.
SymbolLocationLayerRenderer
class SymbolLocationLayerRenderer : LocationLayerRenderer
Utils
class Utils

AnimatorListenerHolder

open class AnimatorListenerHolder

Constructors

Name Summary
AnimatorListenerHolder open fun AnimatorListenerHolder(animatorType: Int, listener: MapboxAnimator.AnimationsValueChangeListener)

Functions

Name Summary
equals
open fun equals(o: Any): Boolean
hashCode
open fun hashCode(): Int

Properties

Name Summary
animatorType private val animatorType: Int
listener private val listener: MapboxAnimator.AnimationsValueChangeListener

animatorType

private val animatorType: Int

equals

open fun equals(o: Any): Boolean

hashCode

open fun hashCode(): Int

listener

private val listener: MapboxAnimator.AnimationsValueChangeListener

CompassEngine

interface CompassEngine

Interface defining the source of compass heading data that is consumed by the LocationComponent when in compass related RenderMode or CameraModes.

Functions

Name Summary
addCompassListener
abstract fun addCompassListener(compassListener: CompassListener)
Adds a CompassListener that can be used toreceive heading and state changes.
getLastAccuracySensorStatus
abstract fun getLastAccuracySensorStatus(): Int
Provides the last know accuracy status from the sensor manager.
getLastHeading
abstract fun getLastHeading(): Float
Returns the last heading value produced and pushed viaa compass listener.
removeCompassListener
abstract fun removeCompassListener(compassListener: CompassListener)
Removes a CompassListener that can be used toreceive heading and state changes.

Inheritors

Name
LocationComponentCompassEngine

addCompassListener

abstract fun addCompassListener(compassListener: CompassListener)

Adds a CompassListener that can be used toreceive heading and state changes.

Parameters
Name Summary
compassListener
to be added
   
   

getLastAccuracySensorStatus

abstract fun getLastAccuracySensorStatus(): Int

Provides the last know accuracy status from the sensor manager.

An integer value which is identical to the {@code SensorManager} class constants:

  • SENSOR_STATUS_NO_CONTACT
  • SENSOR_STATUS_UNRELIABLE
  • SENSOR_STATUS_ACCURACY_LOW
  • SENSOR_STATUS_ACCURACY_MEDIUM
  • SENSOR_STATUS_ACCURACY_HIGH
Return

last accuracy status

getLastHeading

abstract fun getLastHeading(): Float

Returns the last heading value produced and pushed viaa compass listener.

Return

last heading value

removeCompassListener

abstract fun removeCompassListener(compassListener: CompassListener)

Removes a CompassListener that can be used toreceive heading and state changes.

Parameters
Name Summary
compassListener
to be removed
   
   

CompassListener

interface CompassListener

Callbacks related to the compass

Functions

Name Summary
onCompassAccuracyChange
abstract fun onCompassAccuracyChange(compassStatus: Int)
This gets invoked when the compass accuracy status changes from one value to another.
onCompassChanged
abstract fun onCompassChanged(userHeading: Float)
Callback’s invoked when a new compass update occurs.

onCompassAccuracyChange

abstract fun onCompassAccuracyChange(compassStatus: Int)

This gets invoked when the compass accuracy status changes from one value to another. Itprovides an integer value which is identical to the {@code SensorManager} class constants:

  • SENSOR_STATUS_NO_CONTACT
  • SENSOR_STATUS_UNRELIABLE
  • SENSOR_STATUS_ACCURACY_LOW
  • SENSOR_STATUS_ACCURACY_MEDIUM
  • SENSOR_STATUS_ACCURACY_HIGH
Parameters
Name Summary
compassStatus
the new accuracy of this sensor, one of{@code SensorManager.SENSOR_STATUS_*}
   
   

onCompassChanged

abstract fun onCompassChanged(userHeading: Float)

Callback’s invoked when a new compass update occurs. You can listen into the compass updatesusing addCompassListener and implementing thesecallbacks. Note that this interface is also used internally to to update the UI chevron/arrow.

Parameters
Name Summary
userHeading
the new compass heading
   
   

IndicatorLocationLayerRenderer

open class IndicatorLocationLayerRenderer : LocationLayerRenderer

Constructors

Name Summary
IndicatorLocationLayerRenderer open fun IndicatorLocationLayerRenderer(layerSourceProvider: LayerSourceProvider)

Functions

Name Summary
addBitmaps
open fun addBitmaps(renderMode: Int, shadowBitmap: Bitmap, backgroundBitmap: Bitmap, backgroundStaleBitmap: Bitmap, bearingBitmap: Bitmap, foregroundBitmap: Bitmap, foregroundStaleBitmap: Bitmap)
abstract fun addBitmaps(renderMode: Int, shadowBitmap: Bitmap, backgroundBitmap: Bitmap, backgroundStaleBitmap: Bitmap, bearingBitmap: Bitmap, foregroundBitmap: Bitmap, foregroundStaleBitmap: Bitmap)
addLayers
open fun addLayers(positionManager: LocationComponentPositionManager)
adjustPulsingCircleLayerVisibility
open fun adjustPulsingCircleLayerVisibility(visible: Boolean)
Adjust the visibility of the pulsing LocationComponent circle.
cameraBearingUpdated
open fun cameraBearingUpdated(bearing: Double)
cameraTiltUpdated
open fun cameraTiltUpdated(tilt: Double)
hide
open fun hide()
initializeComponents
open fun initializeComponents(style: Style)
removeLayers
open fun removeLayers()
setAccuracyRadius
open fun setAccuracyRadius(accuracy: Float)
setCompassBearing
open fun setCompassBearing(compassBearing: Float)
setGpsBearing
open fun setGpsBearing(gpsBearing: Float)
setLatLng
open fun setLatLng(latLng: LatLng)
setLocationStale
open fun setLocationStale(isStale: Boolean, renderMode: Int)
show
open fun show(renderMode: Int, isStale: Boolean)
styleAccuracy
open fun styleAccuracy(accuracyAlpha: Float, accuracyColor: Int)
stylePulsingCircle
open fun stylePulsingCircle(options: LocationComponentOptions)
Adjust the the pulsing LocationComponent circle based on the set options.
styleScaling
open fun styleScaling(scaleExpression: Expression)
updateIconIds
open fun updateIconIds(foregroundIconString: String, foregroundStaleIconString: String, backgroundIconString: String, backgroundStaleIconString: String, bearingIconString: String)
abstract fun updateIconIds(foregroundIconString: String, foregroundStaleIconString: String, backgroundIconString: String, backgroundStaleIconString: String, bearingIconString: String)
updatePulsingUi
open fun updatePulsingUi(radius: Float, opacity: Float)
Adjust the visual appearance of the pulsing LocationComponent circle.

addBitmaps

open fun addBitmaps(renderMode: Int, shadowBitmap: Bitmap, backgroundBitmap: Bitmap, backgroundStaleBitmap: Bitmap, bearingBitmap: Bitmap, foregroundBitmap: Bitmap, foregroundStaleBitmap: Bitmap)

addLayers

open fun addLayers(positionManager: LocationComponentPositionManager)

adjustPulsingCircleLayerVisibility

open fun adjustPulsingCircleLayerVisibility(visible: Boolean)

Adjust the visibility of the pulsing LocationComponent circle.

cameraBearingUpdated

open fun cameraBearingUpdated(bearing: Double)

cameraTiltUpdated

open fun cameraTiltUpdated(tilt: Double)

hide

open fun hide()

initializeComponents

open fun initializeComponents(style: Style)

removeLayers

open fun removeLayers()

setAccuracyRadius

open fun setAccuracyRadius(accuracy: Float)

setCompassBearing

open fun setCompassBearing(compassBearing: Float)

setGpsBearing

open fun setGpsBearing(gpsBearing: Float)

setLatLng

open fun setLatLng(latLng: LatLng)

setLocationStale

open fun setLocationStale(isStale: Boolean, renderMode: Int)

show

open fun show(renderMode: Int, isStale: Boolean)

styleAccuracy

open fun styleAccuracy(accuracyAlpha: Float, accuracyColor: Int)

stylePulsingCircle

open fun stylePulsingCircle(options: LocationComponentOptions)

Adjust the the pulsing LocationComponent circle based on the set options.

styleScaling

open fun styleScaling(scaleExpression: Expression)

updateIconIds

open fun updateIconIds(foregroundIconString: String, foregroundStaleIconString: String, backgroundIconString: String, backgroundStaleIconString: String, bearingIconString: String)

updatePulsingUi

open fun updatePulsingUi(radius: Float, opacity: Float)

Adjust the visual appearance of the pulsing LocationComponent circle.

LatLngEvaluator

open class LatLngEvaluator : TypeEvaluator<LatLng>

Functions

Name Summary
evaluate
abstract fun evaluate(p: Float, p1: T, p2: T): T
@NonNull()
open fun evaluate(fraction: Float, startValue: LatLng, endValue: LatLng): LatLng

evaluate

@NonNull()

open fun evaluate(fraction: Float, startValue: LatLng, endValue: LatLng): LatLng

LayerBitmapProvider

open class LayerBitmapProvider

Constructors

Name Summary
LayerBitmapProvider open fun LayerBitmapProvider(context: Context)

Functions

Name Summary
generateBitmap
open fun generateBitmap(drawableRes: Int, tintColor: Integer): Bitmap
generateShadowBitmap
open fun generateShadowBitmap(options: LocationComponentOptions): Bitmap

generateBitmap

open fun generateBitmap(drawableRes: Int, tintColor: Integer): Bitmap

generateShadowBitmap

open fun generateShadowBitmap(options: LocationComponentOptions): Bitmap

LayerFeatureProvider

open class LayerFeatureProvider

Functions

Name Summary
generateLocationFeature
@NonNull()
open fun generateLocationFeature(locationFeature: Feature, isStale: Boolean): Feature

generateLocationFeature

@NonNull()

open fun generateLocationFeature(locationFeature: Feature, isStale: Boolean): Feature

LayerSourceProvider

open class LayerSourceProvider

Functions

Name Summary
generateAccuracyLayer
@NonNull()
open fun generateAccuracyLayer(): Layer
generateLayer
@NonNull()
open fun generateLayer(layerId: String): Layer
generateLocationComponentLayer
open fun generateLocationComponentLayer(): Layer
generatePulsingCircleLayer
@NonNull()
open fun generatePulsingCircleLayer(): Layer
Adds a CircleLayer to the map to support the LocationComponent pulsing UI functionality.
generateSource
@NonNull()
open fun generateSource(locationFeature: Feature): GeoJsonSource
getEmptyLayerSet
open fun getEmptyLayerSet(): Set
getIndicatorLocationLayerRenderer
open fun getIndicatorLocationLayerRenderer(): LocationLayerRenderer
getSymbolLocationLayerRenderer
open fun getSymbolLocationLayerRenderer(featureProvider: LayerFeatureProvider, isStale: Boolean): LocationLayerRenderer

generateAccuracyLayer

@NonNull()

open fun generateAccuracyLayer(): Layer

generateLayer

@NonNull()

open fun generateLayer(layerId: String): Layer

generateLocationComponentLayer

open fun generateLocationComponentLayer(): Layer

generatePulsingCircleLayer

@NonNull()

open fun generatePulsingCircleLayer(): Layer

Adds a CircleLayer to the map to support the LocationComponent pulsing UI functionality.

Return

a CircleLayer with the correct data-driven styling. Tilting the map will keep the pulsinglayer aligned with the map plane.

generateSource

@NonNull()

open fun generateSource(locationFeature: Feature): GeoJsonSource

getEmptyLayerSet

open fun getEmptyLayerSet(): Set

getIndicatorLocationLayerRenderer

open fun getIndicatorLocationLayerRenderer(): LocationLayerRenderer

getSymbolLocationLayerRenderer

open fun getSymbolLocationLayerRenderer(featureProvider: LayerFeatureProvider, isStale: Boolean): LocationLayerRenderer

LocationAnimatorCoordinator

class LocationAnimatorCoordinator

Constructors

Name Summary
LocationAnimatorCoordinator open fun LocationAnimatorCoordinator(projection: Projection, animatorSetProvider: MapboxAnimatorSetProvider, animatorProvider: MapboxAnimatorProvider)

Functions

Name Summary
cancelAllAnimations
open fun cancelAllAnimations()
cancelAndRemoveGpsBearingAnimation
open fun cancelAndRemoveGpsBearingAnimation()
cancelTiltAnimation
open fun cancelTiltAnimation()
cancelZoomAnimation
open fun cancelZoomAnimation()
feedNewAccuracyRadius
open fun feedNewAccuracyRadius(targetAccuracyRadius: Float, noAnimation: Boolean)
feedNewCompassBearing
open fun feedNewCompassBearing(targetCompassBearing: Float, currentCameraPosition: CameraPosition)
feedNewLocation
open fun feedNewLocation(newLocation: Location, currentCameraPosition: CameraPosition, isGpsNorth: Boolean)
open fun feedNewLocation(newLocations: Array, currentCameraPosition: [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition), isGpsNorth: Boolean, lookAheadUpdate: Boolean)
feedNewTilt
open fun feedNewTilt(targetTilt: Double, currentCameraPosition: CameraPosition, animationDuration: Long, callback: MapboxMap.CancelableCallback)
feedNewZoomLevel
open fun feedNewZoomLevel(targetZoomLevel: Double, currentCameraPosition: CameraPosition, animationDuration: Long, callback: MapboxMap.CancelableCallback)
resetAllCameraAnimations
open fun resetAllCameraAnimations(currentCameraPosition: CameraPosition, isGpsNorth: Boolean)
resetAllLayerAnimations
open fun resetAllLayerAnimations()
setTrackingAnimationDurationMultiplier
open fun setTrackingAnimationDurationMultiplier(trackingAnimationDurationMultiplier: Float)
startLocationComponentCirclePulsing
open fun startLocationComponentCirclePulsing(options: LocationComponentOptions)
Initializes the PulsingLocationCircleAnimator, which is a type of MapboxAnimator.This method also adds the animator to this class’ animator array.
stopPulsingCircleAnimation
open fun stopPulsingCircleAnimation()
Cancel the pulsing circle location animator.
updateAnimatorListenerHolders
open fun updateAnimatorListenerHolders(listenerHolders: Set<AnimatorListenerHolder>)

Properties

Name Summary
accuracyAnimationEnabled private open var accuracyAnimationEnabled: Boolean
animatorArray val animatorArray: SparseArray<MapboxAnimator>
compassAnimationEnabled private open var compassAnimationEnabled: Boolean
listeners val listeners: SparseArray<MapboxAnimator.AnimationsValueChangeListener>
maxAnimationFps open var maxAnimationFps: Int

accuracyAnimationEnabled

private open var accuracyAnimationEnabled: Boolean

animatorArray

val animatorArray: SparseArray<MapboxAnimator>

cancelAllAnimations

open fun cancelAllAnimations()

cancelAndRemoveGpsBearingAnimation

open fun cancelAndRemoveGpsBearingAnimation()

cancelTiltAnimation

open fun cancelTiltAnimation()

cancelZoomAnimation

open fun cancelZoomAnimation()

compassAnimationEnabled

private open var compassAnimationEnabled: Boolean

feedNewAccuracyRadius

open fun feedNewAccuracyRadius(targetAccuracyRadius: Float, noAnimation: Boolean)

feedNewCompassBearing

open fun feedNewCompassBearing(targetCompassBearing: Float, currentCameraPosition: CameraPosition)

feedNewLocation

open fun feedNewLocation(newLocation: Location, currentCameraPosition: CameraPosition, isGpsNorth: Boolean)
open fun feedNewLocation(newLocations: Array, currentCameraPosition: [CameraPosition](../com.mapbox.mapboxsdk.camera/#cameraposition), isGpsNorth: Boolean, lookAheadUpdate: Boolean)

feedNewTilt

open fun feedNewTilt(targetTilt: Double, currentCameraPosition: CameraPosition, animationDuration: Long, callback: MapboxMap.CancelableCallback)

feedNewZoomLevel

open fun feedNewZoomLevel(targetZoomLevel: Double, currentCameraPosition: CameraPosition, animationDuration: Long, callback: MapboxMap.CancelableCallback)

listeners

val listeners: SparseArray<MapboxAnimator.AnimationsValueChangeListener>

maxAnimationFps

open var maxAnimationFps: Int

resetAllCameraAnimations

open fun resetAllCameraAnimations(currentCameraPosition: CameraPosition, isGpsNorth: Boolean)

resetAllLayerAnimations

open fun resetAllLayerAnimations()

setTrackingAnimationDurationMultiplier

open fun setTrackingAnimationDurationMultiplier(trackingAnimationDurationMultiplier: Float)

startLocationComponentCirclePulsing

open fun startLocationComponentCirclePulsing(options: LocationComponentOptions)

Initializes the PulsingLocationCircleAnimator, which is a type of MapboxAnimator.This method also adds the animator to this class’ animator array.

Parameters
Name Summary
options
the LocationComponentOptions passed to this class upstream from theLocationComponent.
   
   

stopPulsingCircleAnimation

open fun stopPulsingCircleAnimation()

Cancel the pulsing circle location animator.

updateAnimatorListenerHolders

open fun updateAnimatorListenerHolders(listenerHolders: Set<AnimatorListenerHolder>)

LocationCameraController

class LocationCameraController

Constructors

Name Summary
LocationCameraController open fun LocationCameraController(context: Context, mapboxMap: MapboxMap, transform: Transform, internalCameraTrackingChangedListener: OnCameraTrackingChangedListener, options: LocationComponentOptions, onCameraMoveInvalidateListener: OnCameraMoveInvalidateListener)
LocationCameraController open fun LocationCameraController(mapboxMap: MapboxMap, transform: Transform, moveGestureDetector: MoveGestureDetector, internalCameraTrackingChangedListener: OnCameraTrackingChangedListener, onCameraMoveInvalidateListener: OnCameraMoveInvalidateListener, initialGesturesManager: AndroidGesturesManager, internalGesturesManager: AndroidGesturesManager)

Functions

Name Summary
getAnimationListeners
open fun getAnimationListeners(): Set<AnimatorListenerHolder>
initializeOptions
open fun initializeOptions(options: LocationComponentOptions)
isConsumingCompass
open fun isConsumingCompass(): Boolean
setEnabled
open fun setEnabled(enabled: Boolean)

Properties

Name Summary
cameraMode private open var cameraMode: Int
isTransitioning private open val isTransitioning: Boolean
onMoveListener @NonNull()
open val onMoveListener: MapboxMap.OnMoveListener

cameraMode

private open var cameraMode: Int

getAnimationListeners

open fun getAnimationListeners(): Set<AnimatorListenerHolder>

initializeOptions

open fun initializeOptions(options: LocationComponentOptions)

isConsumingCompass

open fun isConsumingCompass(): Boolean

isTransitioning

private open val isTransitioning: Boolean

onMoveListener

@NonNull()

open val onMoveListener: MapboxMap.OnMoveListener

setEnabled

open fun setEnabled(enabled: Boolean)

LocationComponent

class LocationComponent

The Location Component provides location awareness to your mobile application. Enabling this component provides a contextual experience to your users by showing an icon representing the users current location. A few different modes are offered to provide the right context to your users at the correct time. NORMAL simply shows the users location on the map represented as a dot. COMPASS mode allows you to display an arrow icon (by default) that points in the direction the device is pointing in. GPS can be used in conjunction with our Navigation SDK to display a larger icon (customized with gpsDrawable) we call the user puck.

This component also offers the ability to set a map camera behavior for tracking the user location. These different CameraModes will track, stop tracking the location based on the mode set with setCameraMode.

To get the component object use getLocationComponent and activate it with activateLocationComponent or one of the overloads. Then, manage its visibility with setLocationComponentEnabled. The component will not process location updates right after activation, but only after being enabled.

Using this component requires you to request permission beforehand manually or using PermissionsManager. Either {@code ACCESS_COARSE_LOCATION} or {@code ACCESS_FINE_LOCATION} permissions can be requested for this component to work as expected.

This component offers a default, built-in LocationEngine with some of the activation methods. This engine will be obtained by getBestLocationEngine which defaults to the com.mapbox.mapboxsdk.location.engine.MapboxFusedLocationEngineImpl. If you’d like to utilize Google Play Services for more precise location updates, simply add the Google Play Location Services dependency in your build script. This will make the default engine the com.mapbox.mapboxsdk.location.engine.GoogleLocationEngineImpl instead. After a custom engine is passed to the component, or the built-in is initialized, the location updates are going to be requested with the LocationEngineRequest, either a default one, or the one passed during the activation. When using any engine, requesting/removing the location updates is going to be managed internally.

You can also push location updates to the component without any internal engine management. To achieve that, use activateLocationComponent with false. No engine is going to be initialized and you can push location updates with forceLocationUpdate.

For location puck animation purposes, like navigation, we recommend limiting the maximum zoom level of the map for the best user experience.

Location Component doesn’t support state saving out-of-the-box.

Constructors

Name Summary
LocationComponent open fun LocationComponent(mapboxMap: MapboxMap, transform: Transform, developerAnimationListeners: List<MapboxMap.OnDeveloperAnimationListener>)Internal use.
LocationComponent open fun LocationComponent()
LocationComponent open fun LocationComponent(mapboxMap: MapboxMap, transform: Transform, developerAnimationListeners: List<MapboxMap.OnDeveloperAnimationListener>, currentListener: LocationEngineCallback<LocationEngineResult>, lastListener: LocationEngineCallback<LocationEngineResult>, locationLayerController: LocationLayerController, locationCameraController: LocationCameraController, locationAnimatorCoordinator: LocationAnimatorCoordinator, staleStateManager: StaleStateManager, compassEngine: CompassEngine, internalLocationEngineProvider: LocationComponent.InternalLocationEngineProvider, useSpecializedLocationLayer: Boolean)

Types

Name Summary
CurrentLocationEngineCallback
class CurrentLocationEngineCallback : LocationEngineCallback<LocationEngineResult>
InternalLocationEngineProvider
open class InternalLocationEngineProvider
LastLocationEngineCallback
class LastLocationEngineCallback : LocationEngineCallback<LocationEngineResult>

Functions

Name Summary
activateLocationComponent
open fun activateLocationComponent(activationOptions: LocationComponentActivationOptions)
This method initializes the component and needs to be called before any other operations are performed.
addOnCameraTrackingChangedListener
open fun addOnCameraTrackingChangedListener(listener: OnCameraTrackingChangedListener)
Adds a listener that gets invoked when camera tracking state changes.
addOnLocationClickListener
open fun addOnLocationClickListener(listener: OnLocationClickListener)
Adds a listener that gets invoked when the user clicks the displayed location.
addOnLocationLongClickListener
open fun addOnLocationLongClickListener(listener: OnLocationLongClickListener)
Adds a listener that gets invoked when the user long clicks the displayed location.
addOnLocationStaleListener
open fun addOnLocationStaleListener(listener: OnLocationStaleListener)
Adds the passed listener that gets invoked when user updates have stopped long enough for the last updateto be considered stale.
addOnRenderModeChangedListener
open fun addOnRenderModeChangedListener(listener: OnRenderModeChangedListener)
Adds a listener that gets invoked when render mode changes.
applyStyle
open fun applyStyle(options: LocationComponentOptions)
Apply a new component style with location component options.
open fun applyStyle(context: Context, styleRes: Int)
Apply a new component style with a style resource.
cancelTiltWhileTrackingAnimation
open fun cancelTiltWhileTrackingAnimation()
Cancels animation started by tiltWhileTracking.
cancelZoomWhileTrackingAnimation
open fun cancelZoomWhileTrackingAnimation()
Cancels animation started by zoomWhileTracking.
forceLocationUpdate
open fun forceLocationUpdate(location: Location)
open fun forceLocationUpdate(locations: List, lookAheadUpdate: Boolean)
Use to either force a location update or to manually control when the user location getsupdated.
getCameraMode
open fun getCameraMode(): Int
Provides the current camera mode being used to track the location or compass updates.
getLastKnownLocation
@Nullable()
open fun getLastKnownLocation(): Location
Get the last know location of the location component.
getLocationComponentOptions
open fun getLocationComponentOptions(): LocationComponentOptions
Returns the current location options being used.
getRenderMode
open fun getRenderMode(): Int
Provides the current render mode being used to showthe location and/or compass updates on the map.
isLocationComponentActivated
open fun isLocationComponentActivated(): Boolean
Returns whether the location component is activated.
isLocationComponentEnabled
open fun isLocationComponentEnabled(): Boolean
Returns whether the plugin is enabled, meaning that location can be displayed and camera modes can be used.
onDestroy
open fun onDestroy()
Internal use.
onFinishLoadingStyle
open fun onFinishLoadingStyle()
Internal use.
onStart
open fun onStart()
Internal use.
onStartLoadingMap
open fun onStartLoadingMap()
Internal use.
onStop
open fun onStop()
Internal use.
removeOnCameraTrackingChangedListener
open fun removeOnCameraTrackingChangedListener(listener: OnCameraTrackingChangedListener)
Removes a listener that gets invoked when camera tracking state changes.
removeOnLocationClickListener
open fun removeOnLocationClickListener(listener: OnLocationClickListener)
Removes the passed listener from the current list of location click listeners.
removeOnLocationLongClickListener
open fun removeOnLocationLongClickListener(listener: OnLocationLongClickListener)
Removes the passed listener from the current list of location long click listeners.
removeOnLocationStaleListener
open fun removeOnLocationStaleListener(listener: OnLocationStaleListener)
Removes the passed listener from the current list of stale listeners.
removeRenderModeChangedListener
open fun removeRenderModeChangedListener(listener: OnRenderModeChangedListener)
Removes a listener that gets invoked when render mode changes.
setCameraMode
open fun setCameraMode(cameraMode: Int)
open fun setCameraMode(cameraMode: Int, transitionListener: OnLocationCameraTransitionListener)
open fun setCameraMode(cameraMode: Int, transitionDuration: Long, zoom: Double, bearing: Double, tilt: Double, transitionListener: OnLocationCameraTransitionListener)
Sets the camera mode, which determines how the map camera will track the rendered location.
setLocationComponentEnabled
open fun setLocationComponentEnabled(isEnabled: Boolean)
Manage component’s visibility after activation.
setMaxAnimationFps
open fun setMaxAnimationFps(maxAnimationFps: Int)
Set max FPS at which location animators can output updates.
setRenderMode
open fun setRenderMode(renderMode: Int)
Sets the render mode, which determines how the location updates will be rendered on the map.
tiltWhileTracking
open fun tiltWhileTracking(tilt: Double)
open fun tiltWhileTracking(tilt: Double, animationDuration: Long)
open fun tiltWhileTracking(tilt: Double, animationDuration: Long, callback: MapboxMap.CancelableCallback)
Tilts the camera.
zoomWhileTracking
open fun zoomWhileTracking(zoomLevel: Double)
open fun zoomWhileTracking(zoomLevel: Double, animationDuration: Long)
open fun zoomWhileTracking(zoomLevel: Double, animationDuration: Long, callback: MapboxMap.CancelableCallback)
Zooms to the desired zoom level.

Properties

Name Summary
cameraTrackingChangedListener @NonNull()
open val cameraTrackingChangedListener: OnCameraTrackingChangedListener
compassEngine @Nullable()
private open var compassEngine: CompassEngine
locationEngine @Nullable()
private open var locationEngine: LocationEngine
locationEngineRequest @NonNull()
private open var locationEngineRequest: LocationEngineRequest
renderModeChangedListener @NonNull()
open val renderModeChangedListener: OnRenderModeChangedListener

activateLocationComponent

open fun activateLocationComponent(activationOptions: LocationComponentActivationOptions)

This method initializes the component and needs to be called before any other operations are performed.Afterwards, you can manage component’s visibility by setLocationComponentEnabled.

Parameters
Name Summary
activationOptions
a fully built LocationComponentActivationOptions object
   
   

addOnCameraTrackingChangedListener

open fun addOnCameraTrackingChangedListener(listener: OnCameraTrackingChangedListener)

Adds a listener that gets invoked when camera tracking state changes.

Parameters
Name Summary
listener
Listener that gets invoked when camera tracking state changes.
   
   

addOnLocationClickListener

open fun addOnLocationClickListener(listener: OnLocationClickListener)

Adds a listener that gets invoked when the user clicks the displayed location.

If there are registered location click listeners and the location is clicked,only onLocationComponentClick is going to be delivered, onMapClick is going to be consumedand not pushed to the listeners registered after the component’s activation.

Parameters
Name Summary
listener
The location click listener that is invoked when thelocation is clicked
   
   

addOnLocationLongClickListener

open fun addOnLocationLongClickListener(listener: OnLocationLongClickListener)

Adds a listener that gets invoked when the user long clicks the displayed location.

If there are registered location long click listeners and the location is long clicked,only onLocationComponentLongClick is going to be delivered, onMapLongClick is going to be consumedand not pushed to the listeners registered after the component’s activation.

Parameters
Name Summary
listener
The location click listener that is invoked when thelocation is clicked
   
   

addOnLocationStaleListener

open fun addOnLocationStaleListener(listener: OnLocationStaleListener)

Adds the passed listener that gets invoked when user updates have stopped long enough for the last updateto be considered stale.

This timeout is set by staleStateTimeout.

Parameters
Name Summary
listener
invoked when last update is considered stale
   
   

addOnRenderModeChangedListener

open fun addOnRenderModeChangedListener(listener: OnRenderModeChangedListener)

Adds a listener that gets invoked when render mode changes.

Parameters
Name Summary
listener
Listener that gets invoked when render mode changes.
   
   

applyStyle

open fun applyStyle(context: Context, styleRes: Int)

Apply a new component style with a style resource.

Parameters
Name Summary
styleRes
a XML style overriding some or all the options
   
   

open fun applyStyle(options: LocationComponentOptions)

Apply a new component style with location component options.

Parameters
Name Summary
options
to update the current style
   
   

cameraTrackingChangedListener

@NonNull()

open val cameraTrackingChangedListener: OnCameraTrackingChangedListener

cancelTiltWhileTrackingAnimation

open fun cancelTiltWhileTrackingAnimation()

Cancels animation started by tiltWhileTracking.

cancelZoomWhileTrackingAnimation

open fun cancelZoomWhileTrackingAnimation()

Cancels animation started by zoomWhileTracking.

compassEngine

@Nullable()

private open var compassEngine: CompassEngine

forceLocationUpdate

open fun forceLocationUpdate(location: Location)

Use to either force a location update or to manually control when the user location getsupdated.

Parameters
Name Summary
location
where the location icon is placed on the map
   
   

open fun forceLocationUpdate(locations: List, lookAheadUpdate: Boolean)

Use to either force a location update or to manually control when the user location getsupdated.

This method can be used to provide the list of locations where the last one is the target locationand the rest are intermediate points used as the animation path.The puck and the camera will be animated between each of the points linearly until reaching the target.

Parameters
Name Summary
locations
where the location icon is placed on the map
lookAheadUpdate
If set to true, the last location’s timestamp has to be greater than current timestamp andshould represent the time at which the animation should actually reach this position,cutting out the time interpolation delay.
   
   

getCameraMode

open fun getCameraMode(): Int

Provides the current camera mode being used to track the location or compass updates.

Return

the current camera mode

getLastKnownLocation

@Nullable()

open fun getLastKnownLocation(): Location

Get the last know location of the location component.

Return

the last known location

getLocationComponentOptions

open fun getLocationComponentOptions(): LocationComponentOptions

Returns the current location options being used.

Return

the current LocationComponentOptions

getRenderMode

open fun getRenderMode(): Int

Provides the current render mode being used to showthe location and/or compass updates on the map.

Return

the current render mode

isLocationComponentActivated

open fun isLocationComponentActivated(): Boolean

Returns whether the location component is activated.

Return

true if the component is activated, false otherwise

isLocationComponentEnabled

open fun isLocationComponentEnabled(): Boolean

Returns whether the plugin is enabled, meaning that location can be displayed and camera modes can be used.

Return

true if the plugin is enabled, false otherwise

locationEngineRequest

@NonNull()

private open var locationEngineRequest: LocationEngineRequest

locationEngine

@Nullable()

private open var locationEngine: LocationEngine

onDestroy

open fun onDestroy()

Internal use.

onFinishLoadingStyle

open fun onFinishLoadingStyle()

Internal use.

onStartLoadingMap

open fun onStartLoadingMap()

Internal use.

onStart

open fun onStart()

Internal use.

onStop

open fun onStop()

Internal use.

removeOnCameraTrackingChangedListener

open fun removeOnCameraTrackingChangedListener(listener: OnCameraTrackingChangedListener)

Removes a listener that gets invoked when camera tracking state changes.

Parameters
Name Summary
listener
Listener that gets invoked when camera tracking state changes.
   
   

removeOnLocationClickListener

open fun removeOnLocationClickListener(listener: OnLocationClickListener)

Removes the passed listener from the current list of location click listeners.

Parameters
Name Summary
listener
to be removed
   
   

removeOnLocationLongClickListener

open fun removeOnLocationLongClickListener(listener: OnLocationLongClickListener)

Removes the passed listener from the current list of location long click listeners.

Parameters
Name Summary
listener
to be removed
   
   

removeOnLocationStaleListener

open fun removeOnLocationStaleListener(listener: OnLocationStaleListener)

Removes the passed listener from the current list of stale listeners.

Parameters
Name Summary
listener
to be removed from the list
   
   

removeRenderModeChangedListener

open fun removeRenderModeChangedListener(listener: OnRenderModeChangedListener)

Removes a listener that gets invoked when render mode changes.

Parameters
Name Summary
listener
Listener that gets invoked when render mode changes.
   
   

renderModeChangedListener

@NonNull()

open val renderModeChangedListener: OnRenderModeChangedListener

setCameraMode

open fun setCameraMode(cameraMode: Int)

Sets the camera mode, which determines how the map camera will track the rendered location.

When camera is transitioning to a new mode, it will reject inputs like zoomWhileTracking or tiltWhileTracking.Use OnLocationCameraTransitionListener to listen for the transition state.

  • [NONE](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-n-o-n-e.md): No camera tracking
  • [NONE_COMPASS](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-n-o-n-e_-c-o-m-p-a-s-s.md): Camera does not track location, but does track compass bearing
  • [NONE_GPS](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-n-o-n-e_-g-p-s.md): Camera does not track location, but does track GPS bearing
  • [TRACKING](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-t-r-a-c-k-i-n-g.md): Camera tracks the user location
  • [TRACKING_COMPASS](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-t-r-a-c-k-i-n-g_-c-o-m-p-a-s-s.md): Camera tracks the user location, with bearing provided by a compass
  • [TRACKING_GPS](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-t-r-a-c-k-i-n-g_-g-p-s.md): Camera tracks the user location, with normalized bearing
  • [TRACKING_GPS_NORTH](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-t-r-a-c-k-i-n-g_-g-p-s_-n-o-r-t-h.md): Camera tracks the user location, with bearing always set to north
Parameters
Name Summary
cameraMode
one of the modes found in CameraMode
   
   

open fun setCameraMode(cameraMode: Int, transitionListener: OnLocationCameraTransitionListener)

Sets the camera mode, which determines how the map camera will track the rendered location.

When camera is transitioning to a new mode, it will reject inputs like zoomWhileTracking or tiltWhileTracking.Use OnLocationCameraTransitionListener to listen for the transition state.

  • [NONE](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-n-o-n-e.md): No camera tracking
  • [NONE_COMPASS](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-n-o-n-e_-c-o-m-p-a-s-s.md): Camera does not track location, but does track compass bearing
  • [NONE_GPS](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-n-o-n-e_-g-p-s.md): Camera does not track location, but does track GPS bearing
  • [TRACKING](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-t-r-a-c-k-i-n-g.md): Camera tracks the user location
  • [TRACKING_COMPASS](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-t-r-a-c-k-i-n-g_-c-o-m-p-a-s-s.md): Camera tracks the user location, with bearing provided by a compass
  • [TRACKING_GPS](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-t-r-a-c-k-i-n-g_-g-p-s.md): Camera tracks the user location, with normalized bearing
  • [TRACKING_GPS_NORTH](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-t-r-a-c-k-i-n-g_-g-p-s_-n-o-r-t-h.md): Camera tracks the user location, with bearing always set to north
Parameters
Name Summary
cameraMode
one of the modes found in CameraMode
transitionListener
callback that’s going to be invoked when the transition animation finishes
   
   

open fun setCameraMode(cameraMode: Int, transitionDuration: Long, zoom: Double, bearing: Double, tilt: Double, transitionListener: OnLocationCameraTransitionListener)

Sets the camera mode, which determines how the map camera will track the rendered location.

When camera is transitioning to a new mode, it will reject inputs like zoomWhileTracking or tiltWhileTracking.Use OnLocationCameraTransitionListener to listen for the transition state.

Set values of zoom, bearing and tilt that the camera will transition to. If null is passed to any of those,current value will be used for that parameter instead.If the camera is already tracking, provided values are ignored.

  • [NONE](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-n-o-n-e.md): No camera tracking
  • [NONE_COMPASS](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-n-o-n-e_-c-o-m-p-a-s-s.md): Camera does not track location, but does track compass bearing
  • [NONE_GPS](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-n-o-n-e_-g-p-s.md): Camera does not track location, but does track GPS bearing
  • [TRACKING](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-t-r-a-c-k-i-n-g.md): Camera tracks the user location
  • [TRACKING_COMPASS](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-t-r-a-c-k-i-n-g_-c-o-m-p-a-s-s.md): Camera tracks the user location, with bearing provided by a compass
  • [TRACKING_GPS](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-t-r-a-c-k-i-n-g_-g-p-s.md): Camera tracks the user location, with normalized bearing
  • [TRACKING_GPS_NORTH](../../com.mapbox.mapboxsdk.location.modes//-camera-mode/-t-r-a-c-k-i-n-g_-g-p-s_-n-o-r-t-h.md): Camera tracks the user location, with bearing always set to north
Parameters
Name Summary
cameraMode
one of the modes found in CameraMode
transitionDuration
duration of the transition in milliseconds
zoom
target zoom, set to null to use current camera position
bearing
target bearing, set to null to use current camera position
tilt
target tilt, set to null to use current camera position
transitionListener
callback that’s going to be invoked when the transition animation finishes
   
   

setLocationComponentEnabled

open fun setLocationComponentEnabled(isEnabled: Boolean)

Manage component’s visibility after activation.

Parameters
Name Summary
isEnabled
true if the plugin should be visible and listen for location updates, false otherwise.
   
   

setMaxAnimationFps

open fun setMaxAnimationFps(maxAnimationFps: Int)

Set max FPS at which location animators can output updates. The throttling will only impact the location puckand camera tracking smooth animations.

Setting this will not impact any other animations schedule with MapboxMap, gesture animations or zoomWhileTracking/tiltWhileTracking.

Use this setting to limit animation rate of the location puck on higher zoom levels to decrease the stress onthe device’s CPU which can directly improve battery life, without sacrificing UX.

Example usage:

{@code mapboxMap.addOnCameraIdleListener(new MapboxMap.OnCameraIdleListener() { {@literal @}Override public void onCameraIdle() { double zoom = mapboxMap.getCameraPosition().zoom; int maxAnimationFps; if (zoom < 5) { maxAnimationFps = 3; } else if (zoom < 10) { maxAnimationFps = 5; } else if (zoom < 15) { maxAnimationFps = 7; } else if (zoom < 18) { maxAnimationFps = 15; } else { maxAnimationFps = Integer.MAX_VALUE; } locationComponent.setMaxAnimationFps(maxAnimationFps); } }); }

If you’re looking for a way to throttle the FPS of the whole map, including other animations and gestures, see setMaximumFps.

Parameters
Name Summary
maxAnimationFps
max location animation FPS
   
   

setRenderMode

open fun setRenderMode(renderMode: Int)

Sets the render mode, which determines how the location updates will be rendered on the map.

  • [NORMAL](../../com.mapbox.mapboxsdk.location.modes//-render-mode/-n-o-r-m-a-l.md): Shows user location, bearing ignored
  • [COMPASS](../../com.mapbox.mapboxsdk.location.modes//-render-mode/-c-o-m-p-a-s-s.md): Shows user location with bearing considered from compass
  • [GPS](../../com.mapbox.mapboxsdk.location.modes//-render-mode/-g-p-s.md): Shows user location with bearing considered from location
Parameters
Name Summary
renderMode
one of the modes found in RenderMode
   
   

tiltWhileTracking

open fun tiltWhileTracking(tilt: Double, animationDuration: Long, callback: MapboxMap.CancelableCallback)

Tilts the camera.This API can only be used in pair with camera modes other than NONE.If you are not using any of CameraMode modes,use one of moveCamera, easeCamera or animateCamera instead.

If the camera is transitioning when the tilt change is requested, the call is going to be ignored.Use CameraTransitionListener to chain the animations, or provide the tilt as a camera change argument.

Parameters
Name Summary
tilt
The desired camera tilt.
animationDuration
The tilt animation duration.
callback
The callback with finish/cancel information
   
   

open fun tiltWhileTracking(tilt: Double, animationDuration: Long)

Tilts the camera.This API can only be used in pair with camera modes other than NONE.If you are not using any of CameraMode modes,use one of moveCamera, easeCamera or animateCamera instead.

If the camera is transitioning when the tilt change is requested, the call is going to be ignored.Use CameraTransitionListener to chain the animations, or provide the tilt as a camera change argument.

Parameters
Name Summary
tilt
The desired camera tilt.
animationDuration
The tilt animation duration.
   
   

open fun tiltWhileTracking(tilt: Double)

Tilts the camera.This API can only be used in pair with camera modes other than NONE.If you are not using any of CameraMode modes,use one of moveCamera, easeCamera or animateCamera instead.

If the camera is transitioning when the tilt change is requested, the call is going to be ignored.Use CameraTransitionListener to chain the animations, or provide the tilt as a camera change argument.

Parameters
Name Summary
tilt
The desired camera tilt.
   
   

zoomWhileTracking

open fun zoomWhileTracking(zoomLevel: Double, animationDuration: Long, callback: MapboxMap.CancelableCallback)

Zooms to the desired zoom level.This API can only be used in pair with camera modes other than NONE.If you are not using any of CameraMode modes,use one of moveCamera, easeCamera or animateCamera instead.

If the camera is transitioning when the zoom change is requested, the call is going to be ignored.Use CameraTransitionListener to chain the animations, or provide the zoom as a camera change argument.

Parameters
Name Summary
zoomLevel
The desired zoom level.
animationDuration
The zoom animation duration.
callback
The callback with finish/cancel information
   
   

open fun zoomWhileTracking(zoomLevel: Double, animationDuration: Long)

Zooms to the desired zoom level.This API can only be used in pair with camera modes other than NONE.If you are not using any of CameraMode modes,use one of moveCamera, easeCamera or animateCamera instead.

If the camera is transitioning when the zoom change is requested, the call is going to be ignored.Use CameraTransitionListener to chain the animations, or provide the zoom as a camera change argument.

Parameters
Name Summary
zoomLevel
The desired zoom level.
animationDuration
The zoom animation duration.
   
   

open fun zoomWhileTracking(zoomLevel: Double)

Zooms to the desired zoom level.This API can only be used in pair with camera modes other than NONE.If you are not using any of CameraMode modes,use one of moveCamera, easeCamera or animateCamera instead.

If the camera is transitioning when the zoom change is requested, the call is going to be ignored.Use CameraTransitionListener to chain the animations, or provide the zoom as a camera change argument.

Parameters
Name Summary
zoomLevel
The desired zoom level.
   
   

CurrentLocationEngineCallback

class CurrentLocationEngineCallback : LocationEngineCallback<LocationEngineResult>

Constructors

Name Summary
CurrentLocationEngineCallback open fun CurrentLocationEngineCallback(component: LocationComponent)

Functions

Name Summary
onFailure
open fun onFailure(exception: Exception)
Invoked when engine exception occurs.
onSuccess
abstract fun onSuccess(result: T)
open fun onSuccess(result: LocationEngineResult)
Invoked when new data available.

onFailure

open fun onFailure(exception: Exception)

Invoked when engine exception occurs.

Parameters
Name Summary
exception
Exception
   
   

onSuccess

open fun onSuccess(result: LocationEngineResult)

Invoked when new data available.

Parameters
Name Summary
result
updated data.
   
   

InternalLocationEngineProvider

open class InternalLocationEngineProvider

Functions

Name Summary
getBestLocationEngine
open fun getBestLocationEngine(context: Context, background: Boolean): LocationEngine

getBestLocationEngine

open fun getBestLocationEngine(context: Context, background: Boolean): LocationEngine

LastLocationEngineCallback

class LastLocationEngineCallback : LocationEngineCallback<LocationEngineResult>

Constructors

Name Summary
LastLocationEngineCallback open fun LastLocationEngineCallback(component: LocationComponent)

Functions

Name Summary
onFailure
open fun onFailure(exception: Exception)
Invoked when engine exception occurs.
onSuccess
abstract fun onSuccess(result: T)
open fun onSuccess(result: LocationEngineResult)
Invoked when new data available.

onFailure

open fun onFailure(exception: Exception)

Invoked when engine exception occurs.

Parameters
Name Summary
exception
Exception
   
   

onSuccess

open fun onSuccess(result: LocationEngineResult)

Invoked when new data available.

Parameters
Name Summary
result
updated data.
   
   

LocationComponentActivationOptions

open class LocationComponentActivationOptions

A class which holds the various options for activating the Maps SDK’s LocationComponent to eventually show the device location on the map.

Types

Name Summary
Builder
open class Builder
Builder class for constructing a new instance of LocationComponentActivationOptions.

Functions

Name Summary
builder
@NonNull()
open fun builder(context: Context, fullyLoadedMapStyle: Style): LocationComponentActivationOptions.Builder
Convenience method to retrieve a LocationComponentActivationOptions object which is ready to build with
context
@NonNull()
open fun context(): Context
The application’s current context
locationComponentOptions
@Nullable()
open fun locationComponentOptions(): LocationComponentOptions
A built LocationComponentOptions object, which holds the various LocationComponent styling options
locationEngine
@Nullable()
open fun locationEngine(): LocationEngine
The LocationEngine which the LocationComponent should use
locationEngineRequest
@Nullable()
open fun locationEngineRequest(): LocationEngineRequest
The location request which the LocationComponent should use
style
@NonNull()
open fun style(): Style
The proxy object for current map style.
styleRes
open fun styleRes(): Int
The LocationComponent style resource (e.g.
useDefaultLocationEngine
open fun useDefaultLocationEngine(): Boolean
True if you want to initialize and use the built-in location engine or false if there should be nolocation engine initialized
useSpecializedLocationLayer
open fun useSpecializedLocationLayer(): Boolean
True if you want to initialize and use the specialized location layer to render the location puck.

builder

@NonNull()

open fun builder(context: Context, fullyLoadedMapStyle: Style): LocationComponentActivationOptions.Builder

Convenience method to retrieve a LocationComponentActivationOptions object which is ready to build with

Return

a builder object

context

@NonNull()

open fun context(): Context

The application’s current context

Return

the application’s current context

locationComponentOptions

@Nullable()

open fun locationComponentOptions(): LocationComponentOptions

A built LocationComponentOptions object, which holds the various LocationComponent styling options

Return

the options for styling the actual LocationComponent

locationEngineRequest

@Nullable()

open fun locationEngineRequest(): LocationEngineRequest

The location request which the LocationComponent should use

Return

the LocationEngineRequest object

locationEngine

@Nullable()

open fun locationEngine(): LocationEngine

The LocationEngine which the LocationComponent should use

Return

the engine

styleRes

open fun styleRes(): Int

The LocationComponent style resource (e.g. R.style.style_name)

Return

the style resource.

style

@NonNull()

open fun style(): Style

The proxy object for current map style. at Style

Return

the map’s fully loaded Style object

useDefaultLocationEngine

open fun useDefaultLocationEngine(): Boolean

True if you want to initialize and use the built-in location engine or false if there should be nolocation engine initialized

Return

whether the default LocationEngine is used

useSpecializedLocationLayer

open fun useSpecializedLocationLayer(): Boolean

True if you want to initialize and use the specialized location layer to render the location puck.

The specialized layer is not based on runtime styling. This brings significant performance improvements,but since it’s not based on the runtime styling,it’s not fully compatible with the traditional implementation. The incompatibilities are:

  • Constants like [BACKGROUND_LAYER](../-location-component-constants/-b-a-c-k-g-r-o-u-n-d_-l-a-y-e-r.md), [ACCURACY_LAYER](../-location-component-constants/-a-c-c-u-r-a-c-y_-l-a-y-e-r.md) or [LOCATION_SOURCE](../-location-component-constants/-l-o-c-a-t-i-o-n_-s-o-u-r-c-e.md) are ignored.The only usable and valid for relative positioning layer ID is [FOREGROUND_LAYER](../-location-component-constants/-f-o-r-e-g-r-o-u-n-d_-l-a-y-e-r.md).
  • All options that alter the image ID, like [foregroundName](#foregroundname), are ignored.Use [foregroundDrawable](#foregrounddrawable) to alter the image rendered as the puck.
  • The LocationComponent's pulsing effect. Any of the [LocationComponentOptions](#locationcomponentoptions-2)'pulsing methods such as [pulseEnabled](#pulseenabled) or [pulseColor](#pulsecolor), are useless when using thethe specialized location layer.
Return

whether the default specialized location layer is used

Builder

open class Builder

Builder class for constructing a new instance of LocationComponentActivationOptions.

Constructors

Name Summary
Builder open fun Builder(context: Context, style: Style)Constructor for the LocationComponentActivationOptions builder class.

Functions

Name Summary
build
open fun build(): LocationComponentActivationOptions
Method which actually builds the LocationComponentActivationOptions object whiletaking the various options into account.
locationComponentOptions
open fun locationComponentOptions(locationComponentOptions: LocationComponentOptions): LocationComponentActivationOptions.Builder
a built LocationComponentOptions object,which holds the various LocationComponent styling options
locationEngine
@NonNull()
open fun locationEngine(locationEngine: LocationEngine): LocationComponentActivationOptions.Builder
Deliver your own LocationEngine to the LocationComponent.
locationEngineRequest
open fun locationEngineRequest(locationEngineRequest: LocationEngineRequest): LocationComponentActivationOptions.Builder
the location request which theLocationComponent should use
styleRes
open fun styleRes(styleRes: Int): LocationComponentActivationOptions.Builder
the LocationComponent style resource (e.g.
useDefaultLocationEngine
open fun useDefaultLocationEngine(useDefaultLocationEngine: Boolean): LocationComponentActivationOptions.Builder
true if you want to initialize and use thebuilt-in location engine or false if thereshould be no location engine initializedThis is ignored when null is set as the parameterfor (Context, Style)#locationEngine().
useSpecializedLocationLayer
open fun useSpecializedLocationLayer(useSpecializedLocationLayer: Boolean): LocationComponentActivationOptions.Builder
True if you want to initialize and use the specialized location layer to render the location puck.

build

open fun build(): LocationComponentActivationOptions

Method which actually builds the LocationComponentActivationOptions object whiletaking the various options into account.

Return

a built LocationComponentActivationOptions object

locationComponentOptions

open fun locationComponentOptions(locationComponentOptions: LocationComponentOptions): LocationComponentActivationOptions.Builder

Return

the Builder object being constructed

Parameters
Name Summary
locationComponentOptions
a built LocationComponentOptions object,which holds the various LocationComponent styling options
   
   

locationEngineRequest

open fun locationEngineRequest(locationEngineRequest: LocationEngineRequest): LocationComponentActivationOptions.Builder

Return

the Builder object being constructed

Parameters
Name Summary
locationEngineRequest
the location request which theLocationComponent should use
   
   

locationEngine

@NonNull()

open fun locationEngine(locationEngine: LocationEngine): LocationComponentActivationOptions.Builder

Deliver your own LocationEngine to the LocationComponent.

The true/false useDefaultLocationEngine activation option is ignored when a non-null LocationEngine is set viathis locationEngine() method.

Return

the Builder object being constructed

Parameters
Name Summary
locationEngine
a LocationEngine object
   
   

styleRes

open fun styleRes(styleRes: Int): LocationComponentActivationOptions.Builder

Return

the Builder object being constructed

Parameters
Name Summary
styleRes
the LocationComponent style resource (e.g. R.style.style_name)
   
   

useDefaultLocationEngine

open fun useDefaultLocationEngine(useDefaultLocationEngine: Boolean): LocationComponentActivationOptions.Builder

Return

the Builder object being constructed

Parameters
Name Summary
useDefaultLocationEngine
true if you want to initialize and use thebuilt-in location engine or false if thereshould be no location engine initializedThis is ignored when null is set as the parameterfor (Context, Style)#locationEngine().
   
   

useSpecializedLocationLayer

open fun useSpecializedLocationLayer(useSpecializedLocationLayer: Boolean): LocationComponentActivationOptions.Builder

True if you want to initialize and use the specialized location layer to render the location puck.

The specialized layer is not based on runtime styling. This brings significant performance improvements,but since it’s not based on the runtime styling,it’s not fully compatible with the traditional implementation. The incompatibilities are:

  • Constants like [BACKGROUND_LAYER](../../-location-component-constants/-b-a-c-k-g-r-o-u-n-d_-l-a-y-e-r.md), [ACCURACY_LAYER](../../-location-component-constants/-a-c-c-u-r-a-c-y_-l-a-y-e-r.md) or [LOCATION_SOURCE](../../-location-component-constants/-l-o-c-a-t-i-o-n_-s-o-u-r-c-e.md) are ignored.The only usable and valid for relative positioning layer ID is [FOREGROUND_LAYER](../../-location-component-constants/-f-o-r-e-g-r-o-u-n-d_-l-a-y-e-r.md).
  • All options that alter the image ID, like [foregroundName](#foregroundname), are ignored.Use [foregroundDrawable](#foregrounddrawable) to alter the image rendered as the puck.
  • The LocationComponent's pulsing effect. Any of the [LocationComponentOptions](#locationcomponentoptions-2)'pulsing methods such as [pulseEnabled](#pulseenabled) or [pulseColor](#pulsecolor), are useless when using thethe specialized location layer.
Return

the Builder object being constructed

Parameters
Name Summary
useSpecializedLocationLayer
true if you want to initialize and use thespecialized location layer. Defaults to false.
   
   

LocationComponentCompassEngine

open class LocationComponentCompassEngine : CompassEngine, SensorEventListener

This manager class handles compass events such as starting the tracking of device bearing, or when a new compass update occurs.

Constructors

Name Summary
LocationComponentCompassEngine open fun LocationComponentCompassEngine(windowManager: WindowManager, sensorManager: SensorManager)Construct a new instance of the this class.

Functions

Name Summary
addCompassListener
open fun addCompassListener(compassListener: CompassListener)
Adds a CompassListener that can be used toreceive heading and state changes.
onAccuracyChanged
abstract fun onAccuracyChanged(p: Sensor, p1: Int)
open fun onAccuracyChanged(sensor: Sensor, accuracy: Int)
onSensorChanged
abstract fun onSensorChanged(p: SensorEvent)
open fun onSensorChanged(event: SensorEvent)
removeCompassListener
open fun removeCompassListener(compassListener: CompassListener)
Removes a CompassListener that can be used toreceive heading and state changes.

Properties

Name Summary
lastAccuracySensorStatus private open val lastAccuracySensorStatus: Int
lastHeading private open val lastHeading: Float
SENSOR_DELAY_MICROS val SENSOR_DELAY_MICROS: Int

SENSOR_DELAY_MICROS

val SENSOR_DELAY_MICROS: Int

addCompassListener

open fun addCompassListener(compassListener: CompassListener)

Adds a CompassListener that can be used toreceive heading and state changes.

Parameters
Name Summary
compassListener
to be added
   
   

lastAccuracySensorStatus

private open val lastAccuracySensorStatus: Int

lastHeading

private open val lastHeading: Float

onAccuracyChanged

open fun onAccuracyChanged(sensor: Sensor, accuracy: Int)

onSensorChanged

open fun onSensorChanged(event: SensorEvent)

removeCompassListener

open fun removeCompassListener(compassListener: CompassListener)

Removes a CompassListener that can be used toreceive heading and state changes.

Parameters
Name Summary
compassListener
to be removed
   
   

LocationComponentConstants

class LocationComponentConstants

Contains all the constants being used for the LocationComponent.

Properties

Name Summary
ACCURACY_LAYER val ACCURACY_LAYER: StringLayer ID of the location accuracy.
ACCURACY_RADIUS_ANIMATION_DURATION val ACCURACY_RADIUS_ANIMATION_DURATION: Long
BACKGROUND_ICON val BACKGROUND_ICON: String
BACKGROUND_LAYER val BACKGROUND_LAYER: StringLayer ID of the location background icon.
BACKGROUND_STALE_ICON val BACKGROUND_STALE_ICON: String
BEARING_ICON val BEARING_ICON: String
BEARING_LAYER val BEARING_LAYER: StringLayer ID of the location bearing icon.
BEARING_STALE_ICON val BEARING_STALE_ICON: String
COMPASS_UPDATE_RATE_MS val COMPASS_UPDATE_RATE_MS: Long
DEFAULT_FASTEST_INTERVAL_MILLIS val DEFAULT_FASTEST_INTERVAL_MILLIS: Long
DEFAULT_INTERVAL_MILLIS val DEFAULT_INTERVAL_MILLIS: Long
DEFAULT_TRACKING_TILT_ANIM_DURATION val DEFAULT_TRACKING_TILT_ANIM_DURATION: Long
DEFAULT_TRACKING_ZOOM_ANIM_DURATION val DEFAULT_TRACKING_ZOOM_ANIM_DURATION: Long
FOREGROUND_ICON val FOREGROUND_ICON: String
FOREGROUND_LAYER val FOREGROUND_LAYER: StringLayer ID of the location foreground icon or the only runtime layer added if useSpecializedLocationLayer is used.
FOREGROUND_STALE_ICON val FOREGROUND_STALE_ICON: String
INSTANT_LOCATION_TRANSITION_THRESHOLD val INSTANT_LOCATION_TRANSITION_THRESHOLD: Double
LOCATION_SOURCE val LOCATION_SOURCE: StringSource ID of the location’s GeoJsonSource.
MAX_ANIMATION_DURATION_MS val MAX_ANIMATION_DURATION_MS: Long
PROPERTY_ACCURACY_ALPHA val PROPERTY_ACCURACY_ALPHA: String
PROPERTY_ACCURACY_COLOR val PROPERTY_ACCURACY_COLOR: String
PROPERTY_ACCURACY_RADIUS val PROPERTY_ACCURACY_RADIUS: String
PROPERTY_BACKGROUND_ICON val PROPERTY_BACKGROUND_ICON: String
PROPERTY_BACKGROUND_STALE_ICON val PROPERTY_BACKGROUND_STALE_ICON: String
PROPERTY_BEARING_ICON val PROPERTY_BEARING_ICON: String
PROPERTY_COMPASS_BEARING val PROPERTY_COMPASS_BEARING: String
PROPERTY_FOREGROUND_ICON val PROPERTY_FOREGROUND_ICON: String
PROPERTY_FOREGROUND_ICON_OFFSET val PROPERTY_FOREGROUND_ICON_OFFSET: String
PROPERTY_FOREGROUND_STALE_ICON val PROPERTY_FOREGROUND_STALE_ICON: String
PROPERTY_GPS_BEARING val PROPERTY_GPS_BEARING: String
PROPERTY_LOCATION_STALE val PROPERTY_LOCATION_STALE: String
PROPERTY_PULSING_OPACITY val PROPERTY_PULSING_OPACITY: String
PROPERTY_PULSING_RADIUS val PROPERTY_PULSING_RADIUS: String
PROPERTY_SHADOW_ICON_OFFSET val PROPERTY_SHADOW_ICON_OFFSET: String
PULSING_CIRCLE_LAYER val PULSING_CIRCLE_LAYER: StringLayer ID of the location pulsing circle.
SHADOW_ICON val SHADOW_ICON: String
SHADOW_LAYER val SHADOW_LAYER: StringLayer ID of the location shadow.
TRANSITION_ANIMATION_DURATION_MS val TRANSITION_ANIMATION_DURATION_MS: Long

ACCURACY_LAYER

val ACCURACY_LAYER: String

Layer ID of the location accuracy.

ACCURACY_RADIUS_ANIMATION_DURATION

val ACCURACY_RADIUS_ANIMATION_DURATION: Long

BACKGROUND_ICON

val BACKGROUND_ICON: String

BACKGROUND_LAYER

val BACKGROUND_LAYER: String

Layer ID of the location background icon.

BACKGROUND_STALE_ICON

val BACKGROUND_STALE_ICON: String

BEARING_ICON

val BEARING_ICON: String

BEARING_LAYER

val BEARING_LAYER: String

Layer ID of the location bearing icon.

BEARING_STALE_ICON

val BEARING_STALE_ICON: String

COMPASS_UPDATE_RATE_MS

val COMPASS_UPDATE_RATE_MS: Long

DEFAULT_FASTEST_INTERVAL_MILLIS

val DEFAULT_FASTEST_INTERVAL_MILLIS: Long

DEFAULT_INTERVAL_MILLIS

val DEFAULT_INTERVAL_MILLIS: Long

DEFAULT_TRACKING_TILT_ANIM_DURATION

val DEFAULT_TRACKING_TILT_ANIM_DURATION: Long

DEFAULT_TRACKING_ZOOM_ANIM_DURATION

val DEFAULT_TRACKING_ZOOM_ANIM_DURATION: Long

FOREGROUND_ICON

val FOREGROUND_ICON: String

FOREGROUND_LAYER

val FOREGROUND_LAYER: String

Layer ID of the location foreground icon or the only runtime layer added if useSpecializedLocationLayer is used.

FOREGROUND_STALE_ICON

val FOREGROUND_STALE_ICON: String

INSTANT_LOCATION_TRANSITION_THRESHOLD

val INSTANT_LOCATION_TRANSITION_THRESHOLD: Double

LOCATION_SOURCE

val LOCATION_SOURCE: String

Source ID of the location’s GeoJsonSource.

MAX_ANIMATION_DURATION_MS

val MAX_ANIMATION_DURATION_MS: Long

PROPERTY_ACCURACY_ALPHA

val PROPERTY_ACCURACY_ALPHA: String

PROPERTY_ACCURACY_COLOR

val PROPERTY_ACCURACY_COLOR: String

PROPERTY_ACCURACY_RADIUS

val PROPERTY_ACCURACY_RADIUS: String

PROPERTY_BACKGROUND_ICON

val PROPERTY_BACKGROUND_ICON: String

PROPERTY_BACKGROUND_STALE_ICON

val PROPERTY_BACKGROUND_STALE_ICON: String

PROPERTY_BEARING_ICON

val PROPERTY_BEARING_ICON: String

PROPERTY_COMPASS_BEARING

val PROPERTY_COMPASS_BEARING: String

PROPERTY_FOREGROUND_ICON

val PROPERTY_FOREGROUND_ICON: String

PROPERTY_FOREGROUND_ICON_OFFSET

val PROPERTY_FOREGROUND_ICON_OFFSET: String

PROPERTY_FOREGROUND_STALE_ICON

val PROPERTY_FOREGROUND_STALE_ICON: String

PROPERTY_GPS_BEARING

val PROPERTY_GPS_BEARING: String

PROPERTY_LOCATION_STALE

val PROPERTY_LOCATION_STALE: String

PROPERTY_PULSING_OPACITY

val PROPERTY_PULSING_OPACITY: String

PROPERTY_PULSING_RADIUS

val PROPERTY_PULSING_RADIUS: String

PROPERTY_SHADOW_ICON_OFFSET

val PROPERTY_SHADOW_ICON_OFFSET: String

PULSING_CIRCLE_LAYER

val PULSING_CIRCLE_LAYER: String

Layer ID of the location pulsing circle.

SHADOW_ICON

val SHADOW_ICON: String

SHADOW_LAYER

val SHADOW_LAYER: String

Layer ID of the location shadow.

TRANSITION_ANIMATION_DURATION_MS

val TRANSITION_ANIMATION_DURATION_MS: Long

LocationComponentNotInitializedException

class LocationComponentNotInitializedException : RuntimeException

Constructors

Name Summary
LocationComponentNotInitializedException open fun LocationComponentNotInitializedException()

Functions

Name Summary
addSuppressed
fun addSuppressed(exception: Throwable)
fillInStackTrace
open fun fillInStackTrace(): Throwable
getCause
open fun getCause(): Throwable
getLocalizedMessage
open fun getLocalizedMessage(): String
getMessage
open fun getMessage(): String
getStackTrace
open fun getStackTrace(): Array
getSuppressed
fun getSuppressed(): Array
initCause
open fun initCause(cause: Throwable): Throwable
printStackTrace
open fun printStackTrace()
setStackTrace
open fun setStackTrace(stackTrace: Array)
toString
open fun toString(): String

LocationComponentOptions

open class LocationComponentOptions : Parcelable

This class exposes options for the Location Component. The options can be set by defining a style in your apps style.xml file and passing in directly into the LocationComponent class. Alternatively, if properties need to be changed at runtime depending on a specific state, you can build an instance of this class, setting the values you desire, and then passing it into either the LocationComponent activation method (if it isn’t initialized yet) or applyStyle.

When the createFromAttributes methods called, any attributes not found inside the style will revert back to using their default set values. Likewise, when building a new LocationComponentOptions class using the builder, any options neglecting to be set will reset to their default values.

If you would like to keep your custom style changes while modifying a single attribute, you can get the currently used options object using getLocationComponentOptions and it’s {@code toBuilder} method to modify a single entry while also maintaining the other settings. Once your modifications have been made, you’ll need to pass it back into the location component using applyStyle.

Constructors

Name Summary
LocationComponentOptions open fun LocationComponentOptions(accuracyAlpha: Float, accuracyColor: Int, backgroundDrawableStale: Int, backgroundStaleName: String, foregroundDrawableStale: Int, foregroundStaleName: String, gpsDrawable: Int, gpsName: String, foregroundDrawable: Int, foregroundName: String, backgroundDrawable: Int, backgroundName: String, bearingDrawable: Int, bearingName: String, bearingTintColor: Integer, foregroundTintColor: Integer, backgroundTintColor: Integer, foregroundStaleTintColor: Integer, backgroundStaleTintColor: Integer, elevation: Float, enableStaleState: Boolean, staleStateTimeout: Long, padding: Array, maxZoomIconScale: Float, minZoomIconScale: Float, trackingGesturesManagement: Boolean, trackingInitialMoveThreshold: Float, trackingMultiFingerMoveThreshold: Float, trackingMultiFingerProtectedMoveArea: RectF, layerAbove: String, layerBelow: String, trackingAnimationDurationMultiplier: Float, compassAnimationEnabled: Boolean, accuracyAnimationEnabled: Boolean, pulseEnabled: Boolean, pulseFadeEnabled: Boolean, pulseColor: Integer, pulseSingleDuration: Float, pulseMaxRadius: Float, pulseAlpha: Float, pulseInterpolator: Interpolator)

Types

Name Summary
Builder
open class Builder
Builder class for constructing a new instance of LocationComponentOptions.

Functions

Name Summary
accuracyAlpha
open fun accuracyAlpha(): Float
Set the opacity of the accuracy view to a value from 0 to 1, where 0 means the accuracy view iscompletely transparent and 1 means the view is completely opaque.References style attribute R.
accuracyAnimationEnabled
open fun accuracyAnimationEnabled(): Boolean
Enable or disable smooth animation of the accuracy circle around the user’s position.
accuracyColor
open fun accuracyColor(): Int
Solid color to use as the accuracy view color property.References style attribute R.
backgroundDrawable
@DrawableRes()
open fun backgroundDrawable(): Int
Defines the drawable used for the background state icon.References style attribute R.
backgroundDrawableStale
@DrawableRes()
open fun backgroundDrawableStale(): Int
Defines the drawable used for the stale background icon.References style attribute R.
backgroundName
@Nullable()
open fun backgroundName(): String
String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_backgroundDrawable.
backgroundStaleName
@Nullable()
open fun backgroundStaleName(): String
String image name, identical to one used inthe first parameter of addImage, thecomponent, will use this image in place of the provided or default mapbox_foregroundDrawableStale.
backgroundStaleTintColor
@Nullable()
open fun backgroundStaleTintColor(): Integer
Defines the background stale color as an integer.References style attribute R.
backgroundTintColor
@Nullable()
open fun backgroundTintColor(): Integer
Defines the background color as an integer.References style attribute R.
bearingDrawable
@DrawableRes()
open fun bearingDrawable(): Int
Defines the drawable used for the bearing icon.References style attribute R.
bearingName
@Nullable()
open fun bearingName(): String
String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_bearingDrawable.
bearingTintColor
@Nullable()
open fun bearingTintColor(): Integer
Defines the bearing icon color as an integer.References style attribute R.
builder
@NonNull()
open fun builder(context: Context): LocationComponentOptions.Builder
Build a new instance of the LocationComponentOptions class with all the attributes setautomatically to their defined defaults in this library.
compassAnimationEnabled
open fun compassAnimationEnabled(): Boolean
Enable or disable smooth animation of compass values for com.mapbox.mapboxsdk.location.modes.CameraMode and com.mapbox.mapboxsdk.location.modes.RenderMode.
createFromAttributes
@NonNull()
open fun createFromAttributes(context: Context, styleRes: Int): LocationComponentOptions
Construct a new Location Component Options class using the attributes found within a styleresource.
describeContents
abstract fun describeContents(): Int
open fun describeContents(): Int
elevation
@Dimension()
open fun elevation(): Float
Sets the base elevation of this view, in pixels.
enableStaleState
open fun enableStaleState(): Boolean
Enable or disable to stale state mode.
equals
open fun equals(o: Any): Boolean
foregroundDrawable
@DrawableRes()
open fun foregroundDrawable(): Int
Supply a Drawable that is to be rendered on top of all of the content in the Location LayerComponent layer stack.References style attribute R.
foregroundDrawableStale
@DrawableRes()
open fun foregroundDrawableStale(): Int
Defines the drawable used for the stale foreground icon.References style attribute R.
foregroundName
@Nullable()
open fun foregroundName(): String
String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_foregroundDrawable.
foregroundStaleName
@Nullable()
open fun foregroundStaleName(): String
String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_foregroundDrawableStale.
foregroundStaleTintColor
@Nullable()
open fun foregroundStaleTintColor(): Integer
Defines the foreground stale color as an integer.References style attribute R.
foregroundTintColor
@Nullable()
open fun foregroundTintColor(): Integer
Defines the foreground color as an integer.References style attribute R.
gpsDrawable
@DrawableRes()
open fun gpsDrawable(): Int
Defines the drawable used for the navigation state icon.References style attribute R.
gpsName
@Nullable()
open fun gpsName(): String
String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_gpsDrawable.
hashCode
open fun hashCode(): Int
layerAbove
open fun layerAbove(): String
Gets the id of the layer that’s referenced when placing the component on the map using addLayerAbove.
layerBelow
open fun layerBelow(): String
Gets the id of the layer that’s referenced when placing the component on the map using addLayerBelow.
maxZoomIconScale
open fun maxZoomIconScale(): Float
The scale factor of the location icon when the map is zoomed in.Scaling is linear.
minZoomIconScale
open fun minZoomIconScale(): Float
The scale factor of the location icon when the map is zoomed out.Scaling is linear.
padding
@Nullable()
open fun padding(): Array
Sets the distance from the edges of the map view’s frame to the edges of the mapview’s logical viewport.
pulseAlpha
open fun pulseAlpha(): Float
The opacity of the LocationComponent’s circle as it pulses.
pulseColor
open fun pulseColor(): Integer
Color of the LocationComponent’s pulsing circle as it pulses.
pulseEnabled
open fun pulseEnabled(): Boolean
Enable or disable the LocationComponent’s pulsing circle.
pulseFadeEnabled
open fun pulseFadeEnabled(): Boolean
Enable or disable fading of the LocationComponent’s pulsing circle.
pulseInterpolator
@Nullable()
open fun pulseInterpolator(): Interpolator
The interpolator type of animation for the movement of the LocationComponent’s circle
pulseMaxRadius
open fun pulseMaxRadius(): Float
The maximum radius that a single pulse should expand the LocationComponent’s pulsing circle to.
pulseSingleDuration
open fun pulseSingleDuration(): Float
The number of milliseconds it takes for a single pulse of the LocationComponent’s pulsing circle.
staleStateTimeout
open fun staleStateTimeout(): Long
Set the delay before the location icon becomes stale.
toBuilder
@NonNull()
open fun toBuilder(): LocationComponentOptions.Builder
Takes the currently constructed LocationComponentOptions object and provides it’s builderwith all the values set matching the values in this instance.
toString
@NonNull()
open fun toString(): String
trackingAnimationDurationMultiplier
open fun trackingAnimationDurationMultiplier(): Float
Get the tracking animation duration multiplier.
trackingGesturesManagement
open fun trackingGesturesManagement(): Boolean
Returns whether gesture threshold should be adjusted when camera is in one of the tracking modes.This will adjust the focal point and increase thresholds to enable camera manipulation,like zooming in and out, without breaking tracking.
trackingInitialMoveThreshold
open fun trackingInitialMoveThreshold(): Float
Minimum single pointer movement in pixels required to break camera tracking.
trackingMultiFingerMoveThreshold
open fun trackingMultiFingerMoveThreshold(): Float
Minimum multi pointer movement in pixels required to break camera tracking (for example during scale gesture).
trackingMultiFingerProtectedMoveArea
@Nullable()
open fun trackingMultiFingerProtectedMoveArea(): RectF
Protected multi pointer gesture area.
writeToParcel
abstract fun writeToParcel(p: Parcel, p1: Int)
open fun writeToParcel(dest: Parcel, flags: Int)

Properties

Name Summary
CIRCLE_PULSING_MAX_RADIUS_DEFAULT val CIRCLE_PULSING_MAX_RADIUS_DEFAULT: FloatDefault maximum radius of the LocationComponent circle when it’s pulsing.
CREATOR val CREATOR: Parcelable.Creator<LocationComponentOptions>

CIRCLE_PULSING_MAX_RADIUS_DEFAULT

val CIRCLE_PULSING_MAX_RADIUS_DEFAULT: Float

Default maximum radius of the LocationComponent circle when it’s pulsing.

CREATOR

val CREATOR: Parcelable.Creator<LocationComponentOptions>

accuracyAlpha

open fun accuracyAlpha(): Float

Set the opacity of the accuracy view to a value from 0 to 1, where 0 means the accuracy view iscompletely transparent and 1 means the view is completely opaque.References style attribute R.styleable#LocationComponent_accuracyAlpha

Return

the opacity of the accuracy view

accuracyAnimationEnabled

open fun accuracyAnimationEnabled(): Boolean

Enable or disable smooth animation of the accuracy circle around the user’s position.

Return

whether smooth animation of the accuracy circle is enabled

accuracyColor

open fun accuracyColor(): Int

Solid color to use as the accuracy view color property.References style attribute R.styleable#LocationComponent_accuracyColor

Return

the color of the accuracy view

backgroundDrawableStale

@DrawableRes()

open fun backgroundDrawableStale(): Int

Defines the drawable used for the stale background icon.References style attribute R.styleable#LocationComponent_backgroundDrawableStale

Return

the drawable resource ID

backgroundDrawable

@DrawableRes()

open fun backgroundDrawable(): Int

Defines the drawable used for the background state icon.References style attribute R.styleable#LocationComponent_backgroundDrawable

Return

the drawable resource ID

backgroundName

@Nullable()

open fun backgroundName(): String

String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_backgroundDrawable.

A maki-icon name (example: “circle-15”) may also be provided. These are images that can be loadedwith certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

Return

String icon or maki-icon name

backgroundStaleName

@Nullable()

open fun backgroundStaleName(): String

String image name, identical to one used inthe first parameter of addImage, thecomponent, will use this image in place of the provided or default mapbox_foregroundDrawableStale.

A maki-icon name (example: “circle-15”) may also be provided. These are images that can be loadedwith certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

Return

String icon or maki-icon name

backgroundStaleTintColor

@Nullable()

open fun backgroundStaleTintColor(): Integer

Defines the background stale color as an integer.References style attribute R.styleable#LocationComponent_backgroundStaleTintColor

Return

the color integer resource

backgroundTintColor

@Nullable()

open fun backgroundTintColor(): Integer

Defines the background color as an integer.References style attribute R.styleable#LocationComponent_backgroundTintColor

Return

the color integer resource

bearingDrawable

@DrawableRes()

open fun bearingDrawable(): Int

Defines the drawable used for the bearing icon.References style attribute R.styleable#LocationComponent_bearingDrawable

Return

the drawable resource ID

bearingName

@Nullable()

open fun bearingName(): String

String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_bearingDrawable.

A maki-icon name (example: “circle-15”) may also be provided. These are images that can be loadedwith certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

Return

String icon or maki-icon name

bearingTintColor

@Nullable()

open fun bearingTintColor(): Integer

Defines the bearing icon color as an integer.References style attribute R.styleable#LocationComponent_bearingTintColor

Return

the color integer resource

builder

@NonNull()

open fun builder(context: Context): LocationComponentOptions.Builder

Build a new instance of the LocationComponentOptions class with all the attributes setautomatically to their defined defaults in this library. This allows you to adjust a fewattributes while leaving the rest alone and maintaining their default behavior.

Return

the builder which contains the default values defined by the style resource

Parameters
Name Summary
context
your activities context used to acquire the style resource
   
   

compassAnimationEnabled

open fun compassAnimationEnabled(): Boolean

Enable or disable smooth animation of compass values for com.mapbox.mapboxsdk.location.modes.CameraMode and com.mapbox.mapboxsdk.location.modes.RenderMode.

Return

whether smooth compass animation is enabled

createFromAttributes

@NonNull()

open fun createFromAttributes(context: Context, styleRes: Int): LocationComponentOptions

Construct a new Location Component Options class using the attributes found within a styleresource. It’s important to note that you only need to define the attributes you plan tochange and can safely ignore the other attributes which will be set to their default value.

Return

a new LocationComponentOptions object with the settings you defined in your styleresource

Parameters
Name Summary
context
your activity’s context used for acquiring resources
styleRes
the style id where your custom attributes are defined
   
   

describeContents

open fun describeContents(): Int

elevation

@Dimension()

open fun elevation(): Float

Sets the base elevation of this view, in pixels. To turn off the shadow that appears underthe location icon, set the elevation to 0.References style attribute R.styleable#LocationComponent_elevation

Return

the elevation currently set for the location component icon

enableStaleState

open fun enableStaleState(): Boolean

Enable or disable to stale state mode. This mode indicates to the user that the location beingdisplayed on the map hasn’t been updated in a specific amount of time.References style attribute R.styleable#LocationComponent_enableStaleState

Return

whether the stale state mode is enabled or not

equals

open fun equals(o: Any): Boolean

foregroundDrawableStale

@DrawableRes()

open fun foregroundDrawableStale(): Int

Defines the drawable used for the stale foreground icon.References style attribute R.styleable#LocationComponent_foregroundDrawableStale

Return

the drawable resource ID

foregroundDrawable

@DrawableRes()

open fun foregroundDrawable(): Int

Supply a Drawable that is to be rendered on top of all of the content in the Location LayerComponent layer stack.References style attribute R.styleable#LocationComponent_foregroundDrawable

Return

the drawable resource used for the foreground layer

foregroundName

@Nullable()

open fun foregroundName(): String

String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_foregroundDrawable.

A maki-icon name (example: “circle-15”) may also be provided. These are images that can be loadedwith certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

Return

String icon or maki-icon name

foregroundStaleName

@Nullable()

open fun foregroundStaleName(): String

String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_foregroundDrawableStale.

A maki-icon name (example: “circle-15”) may also be provided. These are images that can be loadedwith certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

Return

String icon or maki-icon name

foregroundStaleTintColor

@Nullable()

open fun foregroundStaleTintColor(): Integer

Defines the foreground stale color as an integer.References style attribute R.styleable#LocationComponent_foregroundStaleTintColor

Return

the color integer resource

foregroundTintColor

@Nullable()

open fun foregroundTintColor(): Integer

Defines the foreground color as an integer.References style attribute R.styleable#LocationComponent_foregroundTintColor

Return

the color integer resource

gpsDrawable

@DrawableRes()

open fun gpsDrawable(): Int

Defines the drawable used for the navigation state icon.References style attribute R.styleable#LocationComponent_gpsDrawable

Return

the drawable resource ID

gpsName

@Nullable()

open fun gpsName(): String

String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_gpsDrawable.

A maki-icon name (example: “circle-15”) may also be provided. These are images that can be loadedwith certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

Return

String icon or maki-icon name

hashCode

open fun hashCode(): Int

layerAbove

open fun layerAbove(): String

Gets the id of the layer that’s referenced when placing the component on the map using addLayerAbove.

The component is going to placed directly above this layer.

Return

layerAbove the id of the layer the component is going to placed directly above.

layerBelow

open fun layerBelow(): String

Gets the id of the layer that’s referenced when placing the component on the map using addLayerBelow.

The component is going to placed directly below this layer.

Return

layerBelow the id of the layer the component is going to placed directly below.

maxZoomIconScale

open fun maxZoomIconScale(): Float

The scale factor of the location icon when the map is zoomed in.Scaling is linear.

Return

icon scale factor

minZoomIconScale

open fun minZoomIconScale(): Float

The scale factor of the location icon when the map is zoomed out.Scaling is linear.

Return

icon scale factor

padding

@Nullable()

open fun padding(): Array

Sets the distance from the edges of the map view’s frame to the edges of the mapview’s logical viewport.

When the value of this property is equal to {0,0,0,0}, viewportproperties such as centerCoordinate assume a viewport that matches the mapview’s frame. Otherwise, those properties are inset, excluding part of theframe from the viewport. For instance, if the only the top edge is inset, themap center is effectively shifted downward.

Return

integer array of padding values

pulseAlpha

open fun pulseAlpha(): Float

The opacity of the LocationComponent’s circle as it pulses. The expected range is0 to 1. An opacity of 1 makes the layer fully visible.

Return

the current opacity of the LocationComponent’s pulsing circle

pulseColor

open fun pulseColor(): Integer

Color of the LocationComponent’s pulsing circle as it pulses.

Return

the current set color of the circle

pulseEnabled

open fun pulseEnabled(): Boolean

Enable or disable the LocationComponent’s pulsing circle.

Return

whether the LocationComponent’s pulsing circle is enabled

pulseFadeEnabled

open fun pulseFadeEnabled(): Boolean

Enable or disable fading of the LocationComponent’s pulsing circle. If it fades, the circle’sopacity decreases as its radius increases.

Return

whether fading of the LocationComponent’s pulsing circle is enabled

pulseInterpolator

@Nullable()

open fun pulseInterpolator(): Interpolator

The interpolator type of animation for the movement of the LocationComponent’s circle

Return

the current set type of animation interpolator for the pulsing circle

pulseMaxRadius

open fun pulseMaxRadius(): Float

The maximum radius that a single pulse should expand the LocationComponent’s pulsing circle to.

Return

the maximum radius that the pulsing circle will expand to.

pulseSingleDuration

open fun pulseSingleDuration(): Float

The number of milliseconds it takes for a single pulse of the LocationComponent’s pulsing circle.

Return

the current set length of time for a single pulse

staleStateTimeout

open fun staleStateTimeout(): Long

Set the delay before the location icon becomes stale. The timer begins approximately when a newlocation update comes in and using this defined time, if an update hasn’t occured by the end,the location is considered stale.References style attribute R.styleable#LocationComponent_staleStateDelay

Return

the duration in milliseconds which it should take before the location isconsidered stale

toBuilder

@NonNull()

open fun toBuilder(): LocationComponentOptions.Builder

Takes the currently constructed LocationComponentOptions object and provides it’s builderwith all the values set matching the values in this instance. This allows you to modify asingle attribute and then rebuild the object.

Return

the builder which contains the values defined in this current instance as defaults.

toString

@NonNull()

open fun toString(): String

trackingAnimationDurationMultiplier

open fun trackingAnimationDurationMultiplier(): Float

Get the tracking animation duration multiplier.

Return

tracking animation duration multiplier

trackingGesturesManagement

open fun trackingGesturesManagement(): Boolean

Returns whether gesture threshold should be adjusted when camera is in one of the tracking modes.This will adjust the focal point and increase thresholds to enable camera manipulation,like zooming in and out, without breaking tracking.

Note: If set to true, this can overwrite some of the gesture thresholdsand the custom com.mapbox.android.gestures.AndroidGesturesManager that was set with setGesturesManager.

Return

true if gestures are adjusted when in one of the camera tracking modes, false otherwise

See also

Name Summary
com.mapbox.mapboxsdk.location.LocationComponentOptions.Builder
Builder#trackingMultiFingerProtectedMoveArea(RectF)
   
   

trackingInitialMoveThreshold

open fun trackingInitialMoveThreshold(): Float

Minimum single pointer movement in pixels required to break camera tracking.

Return

the minimum movement

trackingMultiFingerMoveThreshold

open fun trackingMultiFingerMoveThreshold(): Float

Minimum multi pointer movement in pixels required to break camera tracking (for example during scale gesture).

Return

the minimum movement

trackingMultiFingerProtectedMoveArea

@Nullable()

open fun trackingMultiFingerProtectedMoveArea(): RectF

Protected multi pointer gesture area. When the camera is in a tracking mode, any multi finger gesture with focalpoint inside the provided screen coordinate rectangle is not going to break the tracking.

Best paired with the trackingMultiFingerMoveThreshold set to 0 or a relatively small value to not interfere with gestures outside of the defined rectangle.

Return

the protected multi finger area while camera is tracking

writeToParcel

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

Builder

open class Builder

Builder class for constructing a new instance of LocationComponentOptions.

Constructors

Name Summary
Builder open fun Builder()

Functions

Name Summary
accuracyAlpha
@NonNull()
open fun accuracyAlpha(accuracyAlpha: Float): LocationComponentOptions.Builder
Set the opacity of the accuracy view to a value from 0 to 1, where 0 means the accuracy viewis completely transparent and 1 means the view is completely opaque.References style attribute R.
accuracyAnimationEnabled
open fun accuracyAnimationEnabled(accuracyAnimationEnabled: Boolean): LocationComponentOptions.Builder
Enable or disable smooth animation of the accuracy circle around the user’s position.
accuracyColor
@NonNull()
open fun accuracyColor(accuracyColor: Int): LocationComponentOptions.Builder
Solid color to use as the accuracy view color property.References style attribute R.
autoBuild
@Nullable()
open fun autoBuild(): LocationComponentOptions
backgroundDrawable
@NonNull()
open fun backgroundDrawable(backgroundDrawable: Int): LocationComponentOptions.Builder
Defines the drawable used for the background state icon.References style attribute R.
backgroundDrawableStale
@NonNull()
open fun backgroundDrawableStale(backgroundDrawableStale: Int): LocationComponentOptions.Builder
Defines the drawable used for the stale background icon.References style attribute R.
backgroundName
@NonNull()
open fun backgroundName(backgroundName: String): LocationComponentOptions.Builder
Given a String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_backgroundDrawable.
backgroundStaleName
@NonNull()
open fun backgroundStaleName(backgroundStaleName: String): LocationComponentOptions.Builder
Given a String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_backgroundDrawableStale.
backgroundStaleTintColor
@NonNull()
open fun backgroundStaleTintColor(backgroundStaleTintColor: Integer): LocationComponentOptions.Builder
Defines the background stale color as an integer.References style attribute R.
backgroundTintColor
@NonNull()
open fun backgroundTintColor(backgroundTintColor: Integer): LocationComponentOptions.Builder
Defines the background color as an integer.References style attribute R.
bearingDrawable
@NonNull()
open fun bearingDrawable(bearingDrawable: Int): LocationComponentOptions.Builder
Defines the drawable used for the bearing icon.References style attribute R.
bearingName
@NonNull()
open fun bearingName(bearingName: String): LocationComponentOptions.Builder
Given a String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_bearingDrawable.
bearingTintColor
@NonNull()
open fun bearingTintColor(bearingTintColor: Integer): LocationComponentOptions.Builder
Defines the bearing icon color as an integer.References style attribute R.
build
@NonNull()
open fun build(): LocationComponentOptions
Build a new instance of this LocationComponentOptions class.
compassAnimationEnabled
open fun compassAnimationEnabled(compassAnimationEnabled: Boolean): LocationComponentOptions.Builder
Enable or disable smooth animation of compass values for com.mapbox.mapboxsdk.location.modes.CameraMode and com.mapbox.mapboxsdk.location.modes.RenderMode.
elevation
@NonNull()
open fun elevation(elevation: Float): LocationComponentOptions.Builder
Sets the base elevation of this view, in pixels.References style attribute R.
enableStaleState
@NonNull()
open fun enableStaleState(enabled: Boolean): LocationComponentOptions.Builder
Enable or disable to stale state mode.
foregroundDrawable
@NonNull()
open fun foregroundDrawable(foregroundDrawable: Int): LocationComponentOptions.Builder
Supply a Drawable that is to be rendered on top of all of the content in the Location Component layer stack.References style attribute R.
foregroundDrawableStale
@NonNull()
open fun foregroundDrawableStale(foregroundDrawableStale: Int): LocationComponentOptions.Builder
Defines the drawable used for the stale foreground icon.References style attribute R.
foregroundName
@NonNull()
open fun foregroundName(foregroundName: String): LocationComponentOptions.Builder
Given a String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_foregroundDrawable.
foregroundStaleName
@NonNull()
open fun foregroundStaleName(foregroundStaleName: String): LocationComponentOptions.Builder
Given a String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_foregroundDrawableStale.
foregroundStaleTintColor
@NonNull()
open fun foregroundStaleTintColor(foregroundStaleTintColor: Integer): LocationComponentOptions.Builder
Defines the foreground stale color as an integer.References style attribute R.
foregroundTintColor
@NonNull()
open fun foregroundTintColor(foregroundTintColor: Integer): LocationComponentOptions.Builder
Defines the foreground color as an integer.References style attribute R.
gpsDrawable
@NonNull()
open fun gpsDrawable(gpsDrawable: Int): LocationComponentOptions.Builder
Defines the drawable used for the navigation state icon.References style attribute R.
gpsName
@NonNull()
open fun gpsName(gpsName: String): LocationComponentOptions.Builder
Given a String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_gpsDrawable.
layerAbove
@NonNull()
open fun layerAbove(layerAbove: String): LocationComponentOptions.Builder
Sets the id of the layer that’s referenced when placing the component on the map using addLayerAbove.
layerBelow
@NonNull()
open fun layerBelow(layerBelow: String): LocationComponentOptions.Builder
Sets the id of the layer that’s referenced when placing the component on the map using addLayerBelow.
maxZoomIconScale
@NonNull()
open fun maxZoomIconScale(maxZoomIconScale: Float): LocationComponentOptions.Builder
Sets the scale factor of the location icon when the map is zoomed in.Scaling is linear and the new pixel size of the image will be the original pixel size multiplied by the argument.
minZoomIconScale
@NonNull()
open fun minZoomIconScale(minZoomIconScale: Float): LocationComponentOptions.Builder
Sets the scale factor of the location icon when the map is zoomed out.Scaling is linear and the new pixel size of the image will be the original pixel size multiplied by the argument.
pulseAlpha
open fun pulseAlpha(pulseAlpha: Float): LocationComponentOptions.Builder
Sets the opacity of the LocationComponent’s pulsing circle.
pulseColor
open fun pulseColor(pulseColor: Int): LocationComponentOptions.Builder
Sets the color of the LocationComponent’s pulsing circle.
pulseEnabled
open fun pulseEnabled(pulseEnabled: Boolean): LocationComponentOptions.Builder
Enable or disable the LocationComponent’s pulsing circle.
pulseFadeEnabled
open fun pulseFadeEnabled(pulseFadeEnabled: Boolean): LocationComponentOptions.Builder
Enable or disable fading of the LocationComponent’s pulsing circle.
pulseInterpolator
open fun pulseInterpolator(pulseInterpolator: Interpolator): LocationComponentOptions.Builder
Sets the pulsing circle’s interpolator animation.
pulseMaxRadius
open fun pulseMaxRadius(pulseMaxRadius: Float): LocationComponentOptions.Builder
The maximum radius that a single pulse should expand the LocationComponent’s pulsing circle to.
pulseSingleDuration
open fun pulseSingleDuration(pulseSingleDuration: Float): LocationComponentOptions.Builder
Sets the number of milliseconds it takes for a single pulse of the LocationComponent’s pulsing circle.
staleStateTimeout
@NonNull()
open fun staleStateTimeout(timeout: Long): LocationComponentOptions.Builder
Set the timeout before the location icon becomes stale.
trackingAnimationDurationMultiplier
@NonNull()
open fun trackingAnimationDurationMultiplier(trackingAnimationDurationMultiplier: Float): LocationComponentOptions.Builder
Sets the tracking animation duration multiplier.
trackingGesturesManagement
@NonNull()
open fun trackingGesturesManagement(trackingGesturesManagement: Boolean): LocationComponentOptions.Builder
Set whether gesture threshold should be adjusted when camera is in one of the tracking modes.This will adjust the focal point and increase thresholds to enable camera manipulation,like zooming in and out, without breaking tracking.
trackingInitialMoveThreshold
@NonNull()
open fun trackingInitialMoveThreshold(moveThreshold: Float): LocationComponentOptions.Builder
Sets minimum single pointer movement (map pan) in pixels required to break camera tracking.
trackingMultiFingerMoveThreshold
@NonNull()
open fun trackingMultiFingerMoveThreshold(moveThreshold: Float): LocationComponentOptions.Builder
Sets minimum multi pointer movement (map pan) in pixels required to break camera tracking(for example during scale gesture).
trackingMultiFingerProtectedMoveArea
@NonNull()
open fun trackingMultiFingerProtectedMoveArea(rect: RectF): LocationComponentOptions.Builder
Sets protected multi pointer gesture area.When the camera is in a tracking mode,any multi finger gesture with focalpoint inside the provided screen coordinate rectangle is not going to break the tracking.

accuracyAlpha

@NonNull()

open fun accuracyAlpha(accuracyAlpha: Float): LocationComponentOptions.Builder

Set the opacity of the accuracy view to a value from 0 to 1, where 0 means the accuracy viewis completely transparent and 1 means the view is completely opaque.References style attribute R.styleable#LocationComponent_accuracyAlpha

Return

this builder for chaining options together

Parameters
Name Summary
accuracyAlpha
the opacity of the accuracy view
   
   

accuracyAnimationEnabled

open fun accuracyAnimationEnabled(accuracyAnimationEnabled: Boolean): LocationComponentOptions.Builder

Enable or disable smooth animation of the accuracy circle around the user’s position.

Return

whether smooth animation of the accuracy circle is enabled

accuracyColor

@NonNull()

open fun accuracyColor(accuracyColor: Int): LocationComponentOptions.Builder

Solid color to use as the accuracy view color property.References style attribute R.styleable#LocationComponent_accuracyColor

Return

this builder for chaining options together

Parameters
Name Summary
accuracyColor
the color of the accuracy view
   
   

autoBuild

@Nullable()

open fun autoBuild(): LocationComponentOptions

backgroundDrawableStale

@NonNull()

open fun backgroundDrawableStale(backgroundDrawableStale: Int): LocationComponentOptions.Builder

Defines the drawable used for the stale background icon.References style attribute R.styleable#LocationComponent_backgroundDrawableStale

Return

this builder for chaining options together

Parameters
Name Summary
backgroundDrawableStale
the drawable resource ID
   
   

backgroundDrawable

@NonNull()

open fun backgroundDrawable(backgroundDrawable: Int): LocationComponentOptions.Builder

Defines the drawable used for the background state icon.References style attribute R.styleable#LocationComponent_backgroundDrawable

Return

this builder for chaining options together

Parameters
Name Summary
backgroundDrawable
the drawable resource ID
   
   

backgroundName

@NonNull()

open fun backgroundName(backgroundName: String): LocationComponentOptions.Builder

Given a String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_backgroundDrawable.

A maki-icon name (example: “circle-15”) may also be provided. These are images that can be loadedwith certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

Return

this builder for chaining options together

Parameters
Name Summary
backgroundName
String icon or maki-icon name
   
   

backgroundStaleName

@NonNull()

open fun backgroundStaleName(backgroundStaleName: String): LocationComponentOptions.Builder

Given a String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_backgroundDrawableStale.

A maki-icon name (example: “circle-15”) may also be provided. These are images that can be loadedwith certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

Return

this builder for chaining options together

Parameters
Name Summary
backgroundStaleName
String icon or maki-icon name
   
   

backgroundStaleTintColor

@NonNull()

open fun backgroundStaleTintColor(backgroundStaleTintColor: Integer): LocationComponentOptions.Builder

Defines the background stale color as an integer.References style attribute R.styleable#LocationComponent_backgroundStaleTintColor

Return

this builder for chaining options together

Parameters
Name Summary
backgroundStaleTintColor
the color integer resource
   
   

backgroundTintColor

@NonNull()

open fun backgroundTintColor(backgroundTintColor: Integer): LocationComponentOptions.Builder

Defines the background color as an integer.References style attribute R.styleable#LocationComponent_backgroundTintColor

Return

this builder for chaining options together

Parameters
Name Summary
backgroundTintColor
the color integer resource
   
   

bearingDrawable

@NonNull()

open fun bearingDrawable(bearingDrawable: Int): LocationComponentOptions.Builder

Defines the drawable used for the bearing icon.References style attribute R.styleable#LocationComponent_bearingDrawable

Return

this builder for chaining options together

Parameters
Name Summary
bearingDrawable
the drawable resource ID
   
   

bearingName

@NonNull()

open fun bearingName(bearingName: String): LocationComponentOptions.Builder

Given a String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_bearingDrawable.

A maki-icon name (example: “circle-15”) may also be provided. These are images that can be loadedwith certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

Return

this builder for chaining options together

Parameters
Name Summary
bearingName
String icon or maki-icon name
   
   

bearingTintColor

@NonNull()

open fun bearingTintColor(bearingTintColor: Integer): LocationComponentOptions.Builder

Defines the bearing icon color as an integer.References style attribute R.styleable#LocationComponent_bearingTintColor

Return

this builder for chaining options together

Parameters
Name Summary
bearingTintColor
the color integer resource
   
   

build

@NonNull()

open fun build(): LocationComponentOptions

Build a new instance of this LocationComponentOptions class.

Return

a new instance of LocationComponentOptions

compassAnimationEnabled

open fun compassAnimationEnabled(compassAnimationEnabled: Boolean): LocationComponentOptions.Builder

Enable or disable smooth animation of compass values for com.mapbox.mapboxsdk.location.modes.CameraMode and com.mapbox.mapboxsdk.location.modes.RenderMode.

Return

whether smooth compass animation is enabled

elevation

@NonNull()

open fun elevation(elevation: Float): LocationComponentOptions.Builder

Sets the base elevation of this view, in pixels.References style attribute R.styleable#LocationComponent_elevation

Return

this builder for chaining options together

Parameters
Name Summary
elevation
the elevation currently set for the location icon
   
   

enableStaleState

@NonNull()

open fun enableStaleState(enabled: Boolean): LocationComponentOptions.Builder

Enable or disable to stale state mode. This mode indicates to the user that the locationbeing displayed on the map hasn’t been updated in a specific amount of time.References style attribute R.styleable#LocationComponent_enableStaleState

Return

this builder for chaining options together

Parameters
Name Summary
enabled
whether the stale state mode is enabled or not
   
   

foregroundDrawableStale

@NonNull()

open fun foregroundDrawableStale(foregroundDrawableStale: Int): LocationComponentOptions.Builder

Defines the drawable used for the stale foreground icon.References style attribute R.styleable#LocationComponent_foregroundDrawableStale

Return

this builder for chaining options together

Parameters
Name Summary
foregroundDrawableStale
the drawable resource ID
   
   

foregroundDrawable

@NonNull()

open fun foregroundDrawable(foregroundDrawable: Int): LocationComponentOptions.Builder

Supply a Drawable that is to be rendered on top of all of the content in the Location Component layer stack.References style attribute R.styleable#LocationComponent_foregroundDrawable

Return

this builder for chaining options together

Parameters
Name Summary
foregroundDrawable
the drawable resource used for the foreground layer
   
   

foregroundName

@NonNull()

open fun foregroundName(foregroundName: String): LocationComponentOptions.Builder

Given a String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_foregroundDrawable.

A maki-icon name (example: “circle-15”) may also be provided. These are images that can be loadedwith certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

Return

this builder for chaining options together

Parameters
Name Summary
foregroundName
String icon or maki-icon name
   
   

foregroundStaleName

@NonNull()

open fun foregroundStaleName(foregroundStaleName: String): LocationComponentOptions.Builder

Given a String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_foregroundDrawableStale.

A maki-icon name (example: “circle-15”) may also be provided. These are images that can be loadedwith certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

Return

this builder for chaining options together

Parameters
Name Summary
foregroundStaleName
String icon or maki-icon name
   
   

foregroundStaleTintColor

@NonNull()

open fun foregroundStaleTintColor(foregroundStaleTintColor: Integer): LocationComponentOptions.Builder

Defines the foreground stale color as an integer.References style attribute R.styleable#LocationComponent_foregroundStaleTintColor

Return

this builder for chaining options together

Parameters
Name Summary
foregroundStaleTintColor
the color integer resource
   
   

foregroundTintColor

@NonNull()

open fun foregroundTintColor(foregroundTintColor: Integer): LocationComponentOptions.Builder

Defines the foreground color as an integer.References style attribute R.styleable#LocationComponent_foregroundTintColor

Return

this builder for chaining options together

Parameters
Name Summary
foregroundTintColor
the color integer resource
   
   

gpsDrawable

@NonNull()

open fun gpsDrawable(gpsDrawable: Int): LocationComponentOptions.Builder

Defines the drawable used for the navigation state icon.References style attribute R.styleable#LocationComponent_gpsDrawable

Return

this builder for chaining options together

Parameters
Name Summary
gpsDrawable
the drawable resource ID
   
   

gpsName

@NonNull()

open fun gpsName(gpsName: String): LocationComponentOptions.Builder

Given a String image name, identical to one used inthe first parameter of addImage, thecomponent, will used this image in place of the provided or default mapbox_gpsDrawable.

A maki-icon name (example: “circle-15”) may also be provided. These are images that can be loadedwith certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

Return

this builder for chaining options together

Parameters
Name Summary
gpsName
String icon or maki-icon name
   
   

layerAbove

@NonNull()

open fun layerAbove(layerAbove: String): LocationComponentOptions.Builder

Sets the id of the layer that’s referenced when placing the component on the map using addLayerAbove.

The component is going to placed directly above this layer.

Parameters
Name Summary
layerAbove
the id of the layer the component is going to placed directly above.
   
   

layerBelow

@NonNull()

open fun layerBelow(layerBelow: String): LocationComponentOptions.Builder

Sets the id of the layer that’s referenced when placing the component on the map using addLayerBelow.

The component is going to placed directly below this layer.

Parameters
Name Summary
layerBelow
the id of the layer the component is going to placed directly below.
   
   

maxZoomIconScale

@NonNull()

open fun maxZoomIconScale(maxZoomIconScale: Float): LocationComponentOptions.Builder

Sets the scale factor of the location icon when the map is zoomed in.Scaling is linear and the new pixel size of the image will be the original pixel size multiplied by the argument.

Set both this and minZoomIconScale to 1f to disable location icon scaling.

Scaling is based on the maps minimum and maximum zoom levels in time of component’s style application.

Parameters
Name Summary
maxZoomIconScale
icon scale factor
   
   

minZoomIconScale

@NonNull()

open fun minZoomIconScale(minZoomIconScale: Float): LocationComponentOptions.Builder

Sets the scale factor of the location icon when the map is zoomed out.Scaling is linear and the new pixel size of the image will be the original pixel size multiplied by the argument.

Set both this and maxZoomIconScale to 1f to disable location icon scaling.

Scaling is based on the maps minimum and maximum zoom levels in time of component’s style application.

Parameters
Name Summary
minZoomIconScale
icon scale factor
   
   

pulseAlpha

open fun pulseAlpha(pulseAlpha: Float): LocationComponentOptions.Builder

Sets the opacity of the LocationComponent’s pulsing circle. The expected range is0 to 1. An opacity of 1 makes the layer fully visible.

Return

the current opacity of the LocationComponent’s pulsing circle

pulseColor

open fun pulseColor(pulseColor: Int): LocationComponentOptions.Builder

Sets the color of the LocationComponent’s pulsing circle.

Return

the current set color of the circle

pulseEnabled

open fun pulseEnabled(pulseEnabled: Boolean): LocationComponentOptions.Builder

Enable or disable the LocationComponent’s pulsing circle.

Return

whether the LocationComponent’s pulsing circle is enabled

pulseFadeEnabled

open fun pulseFadeEnabled(pulseFadeEnabled: Boolean): LocationComponentOptions.Builder

Enable or disable fading of the LocationComponent’s pulsing circle. If it fades, the circle’sopacity decreases as its radius increases.

Return

whether fading of the LocationComponent’s pulsing circle is enabled

pulseInterpolator

open fun pulseInterpolator(pulseInterpolator: Interpolator): LocationComponentOptions.Builder

Sets the pulsing circle’s interpolator animation.

Return

a String which represents the interpolator animation that the pulsing circle will use.

Parameters
Name Summary
pulseInterpolator
the type of Android-system interpolator to use whencreating the pulsing animation
   
   

pulseMaxRadius

open fun pulseMaxRadius(pulseMaxRadius: Float): LocationComponentOptions.Builder

The maximum radius that a single pulse should expand the LocationComponent’s pulsing circle to.

Return

the maximum radius that the pulsing circle will expand to.

pulseSingleDuration

open fun pulseSingleDuration(pulseSingleDuration: Float): LocationComponentOptions.Builder

Sets the number of milliseconds it takes for a single pulse of the LocationComponent’s pulsing circle.

Return

the current set length of time for a single pulse

staleStateTimeout

@NonNull()

open fun staleStateTimeout(timeout: Long): LocationComponentOptions.Builder

Set the timeout before the location icon becomes stale. The timer begins approximately when anew location update comes in and using this defined time, if an update hasn’t occurred by theend, the location is considered stale.References style attribute R.styleable#LocationComponent_staleStateTimeout

Return

this builder for chaining options together

Parameters
Name Summary
timeout
the duration in milliseconds which it should take before the location isconsidered stale
   
   

trackingAnimationDurationMultiplier

@NonNull()

open fun trackingAnimationDurationMultiplier(trackingAnimationDurationMultiplier: Float): LocationComponentOptions.Builder

Sets the tracking animation duration multiplier.

Parameters
Name Summary
trackingAnimationDurationMultiplier
the tracking animation duration multiplier
   
   

trackingGesturesManagement

@NonNull()

open fun trackingGesturesManagement(trackingGesturesManagement: Boolean): LocationComponentOptions.Builder

Set whether gesture threshold should be adjusted when camera is in one of the tracking modes.This will adjust the focal point and increase thresholds to enable camera manipulation,like zooming in and out, without breaking tracking.

Note: This can overwrite some of the gesture thresholdsand the custom com.mapbox.android.gestures.AndroidGesturesManager that was set with setGesturesManager.

See also

Name Summary
com.mapbox.mapboxsdk.location.LocationComponentOptions.Builder
Builder#trackingMultiFingerProtectedMoveArea(RectF)
   
Parameters
Name Summary
trackingGesturesManagement
true if gestures should be adjusted when in one of the camera tracking modes,false otherwise
   
   

trackingInitialMoveThreshold

@NonNull()

open fun trackingInitialMoveThreshold(moveThreshold: Float): LocationComponentOptions.Builder

Sets minimum single pointer movement (map pan) in pixels required to break camera tracking.

Parameters
Name Summary
moveThreshold
the minimum movement
   
   

trackingMultiFingerMoveThreshold

@NonNull()

open fun trackingMultiFingerMoveThreshold(moveThreshold: Float): LocationComponentOptions.Builder

Sets minimum multi pointer movement (map pan) in pixels required to break camera tracking(for example during scale gesture).

Parameters
Name Summary
moveThreshold
the minimum movement
   
   

trackingMultiFingerProtectedMoveArea

@NonNull()

open fun trackingMultiFingerProtectedMoveArea(rect: RectF): LocationComponentOptions.Builder

Sets protected multi pointer gesture area.When the camera is in a tracking mode,any multi finger gesture with focalpoint inside the provided screen coordinate rectangle is not going to break the tracking.

Best paired with the trackingMultiFingerMoveThreshold set to 0 or a relatively small value to not interfere with gestures outside of the defined rectangle.

Parameters
Name Summary
rect
the protected multi finger area while camera is tracking
   
   

LocationComponentPositionManager

open class LocationComponentPositionManager

Constructors

Name Summary
LocationComponentPositionManager open fun LocationComponentPositionManager(style: Style, layerAbove: String, layerBelow: String)

Functions

Name Summary
addLayerToMap
open fun addLayerToMap(layer: Layer)
update
open fun update(layerAbove: String, layerBelow: String): Boolean
Returns true whenever layer above/below configuration has changed and requires re-layout.

addLayerToMap

open fun addLayerToMap(layer: Layer)

update

open fun update(layerAbove: String, layerBelow: String): Boolean

Returns true whenever layer above/below configuration has changed and requires re-layout.

LocationIndicatorLayer

@UiThread()

open class LocationIndicatorLayer : Layer

See also

Name Summary
The online documentation
The online documentation
   

Constructors

Name Summary
LocationIndicatorLayer open fun LocationIndicatorLayer(nativePtr: Long)Creates a LocationIndicatorLayer.
LocationIndicatorLayer open fun LocationIndicatorLayer(layerId: String)Creates a LocationIndicatorLayer.

Functions

Name Summary
getAccuracyRadius
@NonNull()
open fun getAccuracyRadius(): PropertyValue
Get the AccuracyRadius property
getAccuracyRadiusBorderColor
@NonNull()
open fun getAccuracyRadiusBorderColor(): PropertyValue
Get the AccuracyRadiusBorderColor property
getAccuracyRadiusBorderColorAsInt
open fun getAccuracyRadiusBorderColorAsInt(): Int
The color for drawing the accuracy radius border.
getAccuracyRadiusBorderColorTransition
@NonNull()
open fun getAccuracyRadiusBorderColorTransition(): TransitionOptions
Get the AccuracyRadiusBorderColor property transition options
getAccuracyRadiusColor
@NonNull()
open fun getAccuracyRadiusColor(): PropertyValue
Get the AccuracyRadiusColor property
getAccuracyRadiusColorAsInt
open fun getAccuracyRadiusColorAsInt(): Int
The color for drawing the accuracy radius, as a circle.
getAccuracyRadiusColorTransition
@NonNull()
open fun getAccuracyRadiusColorTransition(): TransitionOptions
Get the AccuracyRadiusColor property transition options
getAccuracyRadiusTransition
@NonNull()
open fun getAccuracyRadiusTransition(): TransitionOptions
Get the AccuracyRadius property transition options
getBearing
@NonNull()
open fun getBearing(): PropertyValue
Get the Bearing property
getBearingImage
@NonNull()
open fun getBearingImage(): PropertyValue
Get the BearingImage property
getBearingImageSize
@NonNull()
open fun getBearingImageSize(): PropertyValue
Get the BearingImageSize property
getBearingImageSizeTransition
@NonNull()
open fun getBearingImageSizeTransition(): TransitionOptions
Get the BearingImageSize property transition options
getId
@NonNull()
open fun getId(): String
getImageTiltDisplacement
@NonNull()
open fun getImageTiltDisplacement(): PropertyValue
Get the ImageTiltDisplacement property
getLocation
@NonNull()
open fun getLocation(): PropertyValue<Array>
Get the Location property
getLocationTransition
@NonNull()
open fun getLocationTransition(): TransitionOptions
Get the Location property transition options
getMaxZoom
open fun getMaxZoom(): Float
getMinZoom
open fun getMinZoom(): Float
getNativePtr
open fun getNativePtr(): Long
getPerspectiveCompensation
@NonNull()
open fun getPerspectiveCompensation(): PropertyValue
Get the PerspectiveCompensation property
getShadowImage
@NonNull()
open fun getShadowImage(): PropertyValue
Get the ShadowImage property
getShadowImageSize
@NonNull()
open fun getShadowImageSize(): PropertyValue
Get the ShadowImageSize property
getShadowImageSizeTransition
@NonNull()
open fun getShadowImageSizeTransition(): TransitionOptions
Get the ShadowImageSize property transition options
getTopImage
@NonNull()
open fun getTopImage(): PropertyValue
Get the TopImage property
getTopImageSize
@NonNull()
open fun getTopImageSize(): PropertyValue
Get the TopImageSize property
getTopImageSizeTransition
@NonNull()
open fun getTopImageSizeTransition(): TransitionOptions
Get the TopImageSize property transition options
getVisibility
@NonNull()
open fun getVisibility(): PropertyValue
isDetached
open fun isDetached(): Boolean
setAccuracyRadiusBorderColorTransition
open fun setAccuracyRadiusBorderColorTransition(options: TransitionOptions)
Set the AccuracyRadiusBorderColor property transition options
setAccuracyRadiusColorTransition
open fun setAccuracyRadiusColorTransition(options: TransitionOptions)
Set the AccuracyRadiusColor property transition options
setAccuracyRadiusTransition
open fun setAccuracyRadiusTransition(options: TransitionOptions)
Set the AccuracyRadius property transition options
setBearingImageSizeTransition
open fun setBearingImageSizeTransition(options: TransitionOptions)
Set the BearingImageSize property transition options
setDetached
open fun setDetached()
setLocationTransition
open fun setLocationTransition(options: TransitionOptions)
Set the Location property transition options
setMaxZoom
open fun setMaxZoom(zoom: Float)
setMinZoom
open fun setMinZoom(zoom: Float)
setProperties
open fun setProperties(properties: Array<PropertyValue>)
setShadowImageSizeTransition
open fun setShadowImageSizeTransition(options: TransitionOptions)
Set the ShadowImageSize property transition options
setTopImageSizeTransition
open fun setTopImageSizeTransition(options: TransitionOptions)
Set the TopImageSize property transition options
withProperties
@NonNull()
open fun withProperties(properties: Array<PropertyValue>): [LocationIndicatorLayer](#locationindicatorlayer)
Set a property or properties.

getAccuracyRadiusBorderColorAsInt

open fun getAccuracyRadiusBorderColorAsInt(): Int

The color for drawing the accuracy radius border. To adjust transparency, set the alpha component of the color accordingly.

Return

int representation of a rgba string color

Throws

Name Summary
java.lang.RuntimeException
thrown if property isn’t a value
   

getAccuracyRadiusBorderColorTransition

@NonNull()

open fun getAccuracyRadiusBorderColorTransition(): TransitionOptions

Get the AccuracyRadiusBorderColor property transition options

Return

transition options for String

getAccuracyRadiusBorderColor

@NonNull()

open fun getAccuracyRadiusBorderColor(): PropertyValue

Get the AccuracyRadiusBorderColor property

Return

property wrapper value around String

getAccuracyRadiusColorAsInt

open fun getAccuracyRadiusColorAsInt(): Int

The color for drawing the accuracy radius, as a circle. To adjust transparency, set the alpha component of the color accordingly.

Return

int representation of a rgba string color

Throws

Name Summary
java.lang.RuntimeException
thrown if property isn’t a value
   

getAccuracyRadiusColorTransition

@NonNull()

open fun getAccuracyRadiusColorTransition(): TransitionOptions

Get the AccuracyRadiusColor property transition options

Return

transition options for String

getAccuracyRadiusColor

@NonNull()

open fun getAccuracyRadiusColor(): PropertyValue

Get the AccuracyRadiusColor property

Return

property wrapper value around String

getAccuracyRadiusTransition

@NonNull()

open fun getAccuracyRadiusTransition(): TransitionOptions

Get the AccuracyRadius property transition options

Return

transition options for Float

getAccuracyRadius

@NonNull()

open fun getAccuracyRadius(): PropertyValue

Get the AccuracyRadius property

Return

property wrapper value around Float

getBearingImageSizeTransition

@NonNull()

open fun getBearingImageSizeTransition(): TransitionOptions

Get the BearingImageSize property transition options

Return

transition options for Float

getBearingImageSize

@NonNull()

open fun getBearingImageSize(): PropertyValue

Get the BearingImageSize property

Return

property wrapper value around Float

getBearingImage

@NonNull()

open fun getBearingImage(): PropertyValue

Get the BearingImage property

Return

property wrapper value around String

getBearing

@NonNull()

open fun getBearing(): PropertyValue

Get the Bearing property

Return

property wrapper value around Double

getImageTiltDisplacement

@NonNull()

open fun getImageTiltDisplacement(): PropertyValue

Get the ImageTiltDisplacement property

Return

property wrapper value around Float

getLocationTransition

@NonNull()

open fun getLocationTransition(): TransitionOptions

Get the Location property transition options

Return

transition options for Double[]

getLocation

@NonNull()

open fun getLocation(): PropertyValue<Array>

Get the Location property

Return

property wrapper value around Double[]

getPerspectiveCompensation

@NonNull()

open fun getPerspectiveCompensation(): PropertyValue

Get the PerspectiveCompensation property

Return

property wrapper value around Float

getShadowImageSizeTransition

@NonNull()

open fun getShadowImageSizeTransition(): TransitionOptions

Get the ShadowImageSize property transition options

Return

transition options for Float

getShadowImageSize

@NonNull()

open fun getShadowImageSize(): PropertyValue

Get the ShadowImageSize property

Return

property wrapper value around Float

getShadowImage

@NonNull()

open fun getShadowImage(): PropertyValue

Get the ShadowImage property

Return

property wrapper value around String

getTopImageSizeTransition

@NonNull()

open fun getTopImageSizeTransition(): TransitionOptions

Get the TopImageSize property transition options

Return

transition options for Float

getTopImageSize

@NonNull()

open fun getTopImageSize(): PropertyValue

Get the TopImageSize property

Return

property wrapper value around Float

getTopImage

@NonNull()

open fun getTopImage(): PropertyValue

Get the TopImage property

Return

property wrapper value around String

setAccuracyRadiusBorderColorTransition

open fun setAccuracyRadiusBorderColorTransition(options: TransitionOptions)

Set the AccuracyRadiusBorderColor property transition options

Parameters
Name Summary
options
transition options for String
   
   

setAccuracyRadiusColorTransition

open fun setAccuracyRadiusColorTransition(options: TransitionOptions)

Set the AccuracyRadiusColor property transition options

Parameters
Name Summary
options
transition options for String
   
   

setAccuracyRadiusTransition

open fun setAccuracyRadiusTransition(options: TransitionOptions)

Set the AccuracyRadius property transition options

Parameters
Name Summary
options
transition options for Float
   
   

setBearingImageSizeTransition

open fun setBearingImageSizeTransition(options: TransitionOptions)

Set the BearingImageSize property transition options

Parameters
Name Summary
options
transition options for Float
   
   

setLocationTransition

open fun setLocationTransition(options: TransitionOptions)

Set the Location property transition options

Parameters
Name Summary
options
transition options for Double[]
   
   

setShadowImageSizeTransition

open fun setShadowImageSizeTransition(options: TransitionOptions)

Set the ShadowImageSize property transition options

Parameters
Name Summary
options
transition options for Float
   
   

setTopImageSizeTransition

open fun setTopImageSizeTransition(options: TransitionOptions)

Set the TopImageSize property transition options

Parameters
Name Summary
options
transition options for Float
   
   

withProperties

@NonNull()

open fun withProperties(properties: Array<PropertyValue>): [LocationIndicatorLayer](#locationindicatorlayer)

Set a property or properties.

Return

This

Parameters
Name Summary
properties
the var-args properties
   
   

LocationLayerController

class LocationLayerController

Constructors

Name Summary
LocationLayerController open fun LocationLayerController(mapboxMap: MapboxMap, style: Style, layerSourceProvider: LayerSourceProvider, featureProvider: LayerFeatureProvider, bitmapProvider: LayerBitmapProvider, options: LocationComponentOptions, internalRenderModeChangedListener: OnRenderModeChangedListener, useSpecializedLocationLayer: Boolean)

Functions

Name Summary
adjustPulsingCircleLayerVisibility
open fun adjustPulsingCircleLayerVisibility(visible: Boolean)
applyStyle
open fun applyStyle(options: LocationComponentOptions)
cameraBearingUpdated
open fun cameraBearingUpdated(bearing: Double)
cameraTiltUpdated
open fun cameraTiltUpdated(tilt: Double)
getAnimationListeners
open fun getAnimationListeners(): Set<AnimatorListenerHolder>
hide
open fun hide()
initializeComponents
open fun initializeComponents(style: Style, options: LocationComponentOptions)
isConsumingCompass
open fun isConsumingCompass(): Boolean
onMapClick
open fun onMapClick(point: LatLng): Boolean
setGpsBearing
open fun setGpsBearing(gpsBearing: Float)
setLocationsStale
open fun setLocationsStale(isStale: Boolean)
show
open fun show()

Properties

Name Summary
isHidden private open val isHidden: Boolean
renderMode private open var renderMode: Int

adjustPulsingCircleLayerVisibility

open fun adjustPulsingCircleLayerVisibility(visible: Boolean)

applyStyle

open fun applyStyle(options: LocationComponentOptions)

cameraBearingUpdated

open fun cameraBearingUpdated(bearing: Double)

cameraTiltUpdated

open fun cameraTiltUpdated(tilt: Double)

getAnimationListeners

open fun getAnimationListeners(): Set<AnimatorListenerHolder>

hide

open fun hide()

initializeComponents

open fun initializeComponents(style: Style, options: LocationComponentOptions)

isConsumingCompass

open fun isConsumingCompass(): Boolean

isHidden

private open val isHidden: Boolean

onMapClick

open fun onMapClick(point: LatLng): Boolean

renderMode

private open var renderMode: Int

setGpsBearing

open fun setGpsBearing(gpsBearing: Float)

setLocationsStale

open fun setLocationsStale(isStale: Boolean)

show

open fun show()

LocationLayerRenderer

interface LocationLayerRenderer

Functions

Name Summary
addBitmaps
abstract fun addBitmaps(renderMode: Int, shadowBitmap: Bitmap, backgroundBitmap: Bitmap, backgroundStaleBitmap: Bitmap, bearingBitmap: Bitmap, foregroundBitmap: Bitmap, foregroundStaleBitmap: Bitmap)
addLayers
abstract fun addLayers(positionManager: LocationComponentPositionManager)
adjustPulsingCircleLayerVisibility
abstract fun adjustPulsingCircleLayerVisibility(visible: Boolean)
cameraBearingUpdated
abstract fun cameraBearingUpdated(bearing: Double)
cameraTiltUpdated
abstract fun cameraTiltUpdated(tilt: Double)
hide
abstract fun hide()
initializeComponents
abstract fun initializeComponents(style: Style)
removeLayers
abstract fun removeLayers()
setAccuracyRadius
abstract fun setAccuracyRadius(accuracy: Float)
setCompassBearing
abstract fun setCompassBearing(compassBearing: Float)
setGpsBearing
abstract fun setGpsBearing(gpsBearing: Float)
setLatLng
abstract fun setLatLng(latLng: LatLng)
setLocationStale
abstract fun setLocationStale(isStale: Boolean, renderMode: Int)
show
abstract fun show(renderMode: Int, isStale: Boolean)
styleAccuracy
abstract fun styleAccuracy(accuracyAlpha: Float, accuracyColor: Int)
stylePulsingCircle
abstract fun stylePulsingCircle(options: LocationComponentOptions)
styleScaling
abstract fun styleScaling(scaleExpression: Expression)
updateIconIds
abstract fun updateIconIds(foregroundIconString: String, foregroundStaleIconString: String, backgroundIconString: String, backgroundStaleIconString: String, bearingIconString: String)
updatePulsingUi
abstract fun updatePulsingUi(radius: Float, opacity: Float)

Inheritors

Name
IndicatorLocationLayerRenderer
SymbolLocationLayerRenderer

addBitmaps

abstract fun addBitmaps(renderMode: Int, shadowBitmap: Bitmap, backgroundBitmap: Bitmap, backgroundStaleBitmap: Bitmap, bearingBitmap: Bitmap, foregroundBitmap: Bitmap, foregroundStaleBitmap: Bitmap)

addLayers

abstract fun addLayers(positionManager: LocationComponentPositionManager)

adjustPulsingCircleLayerVisibility

abstract fun adjustPulsingCircleLayerVisibility(visible: Boolean)

cameraBearingUpdated

abstract fun cameraBearingUpdated(bearing: Double)

cameraTiltUpdated

abstract fun cameraTiltUpdated(tilt: Double)

hide

abstract fun hide()

initializeComponents

abstract fun initializeComponents(style: Style)

removeLayers

abstract fun removeLayers()

setAccuracyRadius

abstract fun setAccuracyRadius(accuracy: Float)

setCompassBearing

abstract fun setCompassBearing(compassBearing: Float)

setGpsBearing

abstract fun setGpsBearing(gpsBearing: Float)

setLatLng

abstract fun setLatLng(latLng: LatLng)

setLocationStale

abstract fun setLocationStale(isStale: Boolean, renderMode: Int)

show

abstract fun show(renderMode: Int, isStale: Boolean)

styleAccuracy

abstract fun styleAccuracy(accuracyAlpha: Float, accuracyColor: Int)

stylePulsingCircle

abstract fun stylePulsingCircle(options: LocationComponentOptions)

styleScaling

abstract fun styleScaling(scaleExpression: Expression)

updateIconIds

abstract fun updateIconIds(foregroundIconString: String, foregroundStaleIconString: String, backgroundIconString: String, backgroundStaleIconString: String, bearingIconString: String)

updatePulsingUi

abstract fun updatePulsingUi(radius: Float, opacity: Float)

LocationPropertyFactory

open class LocationPropertyFactory

Constructs paint/layout properties for Layers

See also

Name Summary
Layer style documentation
Layer style documentation
   

Functions

Name Summary
accuracyRadius
open fun accuracyRadius(expression: Expression): PropertyValue<Expression>
open fun accuracyRadius(value: Float): PropertyValue
The accuracy, in meters, of the position source used to retrieve the position of the location indicator.
accuracyRadiusBorderColor
open fun accuracyRadiusBorderColor(expression: Expression): PropertyValue<Expression>
open fun accuracyRadiusBorderColor(value: Int): PropertyValue
open fun [accuracyRadiusBorderColor](#accuracyradiusbordercolor)(value: String): [PropertyValue](../com.mapbox.mapboxsdk.style.layers/#propertyvalue)
The color for drawing the accuracy radius border.
accuracyRadiusColor
open fun accuracyRadiusColor(expression: Expression): PropertyValue<Expression>
open fun accuracyRadiusColor(value: Int): PropertyValue
open fun [accuracyRadiusColor](#accuracyradiuscolor)(value: String): [PropertyValue](../com.mapbox.mapboxsdk.style.layers/#propertyvalue)
The color for drawing the accuracy radius, as a circle.
bearing
open fun bearing(expression: Expression): PropertyValue<Expression>
open fun bearing(value: Double): PropertyValue
The bearing of the location indicator.
bearingImage
open fun bearingImage(value: Expression): PropertyValue<Expression>
open fun bearingImage(value: String): PropertyValue
Name of image in sprite to use as the middle of the location indicator.
bearingImageSize
open fun bearingImageSize(expression: Expression): PropertyValue<Expression>
open fun bearingImageSize(value: Float): PropertyValue
The size of the bearing image, as a scale factor applied to the size of the specified image.
imageTiltDisplacement
open fun imageTiltDisplacement(expression: Expression): PropertyValue<Expression>
open fun imageTiltDisplacement(value: Float): PropertyValue
The displacement off the center of the top image and the shadow image when the pitch of the map is greater than 0.
location
open fun location(expression: Expression): PropertyValue<Expression>
open fun location(value: Array): [PropertyValue](../com.mapbox.mapboxsdk.style.layers/#propertyvalue)<Array>
An array of [latitude, longitude, altitude] position of the location indicator.
perspectiveCompensation
open fun perspectiveCompensation(expression: Expression): PropertyValue<Expression>
open fun perspectiveCompensation(value: Float): PropertyValue
The amount of the perspective compensation, between 0 and 1.
shadowImage
open fun shadowImage(value: Expression): PropertyValue<Expression>
open fun shadowImage(value: String): PropertyValue
Name of image in sprite to use as the background of the location indicator.
shadowImageSize
open fun shadowImageSize(expression: Expression): PropertyValue<Expression>
open fun shadowImageSize(value: Float): PropertyValue
The size of the shadow image, as a scale factor applied to the size of the specified image.
topImage
open fun topImage(value: Expression): PropertyValue<Expression>
open fun topImage(value: String): PropertyValue
Name of image in sprite to use as the top of the location indicator.
topImageSize
open fun topImageSize(expression: Expression): PropertyValue<Expression>
open fun topImageSize(value: Float): PropertyValue
The size of the top image, as a scale factor applied to the size of the specified image.
visibility
open fun visibility(value: String): PropertyValue
Set the property visibility.

accuracyRadiusBorderColor

open fun accuracyRadiusBorderColor(value: Int): PropertyValue

The color for drawing the accuracy radius border. To adjust transparency, set the alpha component of the color accordingly.

Return

property wrapper around String color

Parameters
Name Summary
value
a int color value
   
   

open fun accuracyRadiusBorderColor(value: String): PropertyValue

The color for drawing the accuracy radius border. To adjust transparency, set the alpha component of the color accordingly.

Return

property wrapper around String

Parameters
Name Summary
value
a String value
   
   

open fun accuracyRadiusBorderColor(expression: Expression): PropertyValue<Expression>

The color for drawing the accuracy radius border. To adjust transparency, set the alpha component of the color accordingly.

Return

property wrapper around an expression statement

Parameters
Name Summary
expression
an expression statement
   
   

accuracyRadiusColor

open fun accuracyRadiusColor(value: Int): PropertyValue

The color for drawing the accuracy radius, as a circle. To adjust transparency, set the alpha component of the color accordingly.

Return

property wrapper around String color

Parameters
Name Summary
value
a int color value
   
   

open fun accuracyRadiusColor(value: String): PropertyValue

The color for drawing the accuracy radius, as a circle. To adjust transparency, set the alpha component of the color accordingly.

Return

property wrapper around String

Parameters
Name Summary
value
a String value
   
   

open fun accuracyRadiusColor(expression: Expression): PropertyValue<Expression>

The color for drawing the accuracy radius, as a circle. To adjust transparency, set the alpha component of the color accordingly.

Return

property wrapper around an expression statement

Parameters
Name Summary
expression
an expression statement
   
   

accuracyRadius

open fun accuracyRadius(value: Float): PropertyValue

The accuracy, in meters, of the position source used to retrieve the position of the location indicator.

Return

property wrapper around Float

Parameters
Name Summary
value
a Float value
   
   

open fun accuracyRadius(expression: Expression): PropertyValue<Expression>

The accuracy, in meters, of the position source used to retrieve the position of the location indicator.

Return

property wrapper around an expression statement

Parameters
Name Summary
expression
an expression statement
   
   

bearingImageSize

open fun bearingImageSize(value: Float): PropertyValue

The size of the bearing image, as a scale factor applied to the size of the specified image.

Return

property wrapper around Float

Parameters
Name Summary
value
a Float value
   
   

open fun bearingImageSize(expression: Expression): PropertyValue<Expression>

The size of the bearing image, as a scale factor applied to the size of the specified image.

Return

property wrapper around an expression statement

Parameters
Name Summary
expression
an expression statement
   
   

bearingImage

open fun bearingImage(value: String): PropertyValue

Name of image in sprite to use as the middle of the location indicator.

Return

property wrapper around String

Parameters
Name Summary
value
a String value
   
   

open fun bearingImage(value: Expression): PropertyValue<Expression>

Name of image in sprite to use as the middle of the location indicator.

Return

property wrapper around String

Parameters
Name Summary
value
a String value
   
   

bearing

open fun bearing(value: Double): PropertyValue

The bearing of the location indicator.

Return

property wrapper around Double

Parameters
Name Summary
value
a Double value
   
   

open fun bearing(expression: Expression): PropertyValue<Expression>

The bearing of the location indicator.

Return

property wrapper around an expression statement

Parameters
Name Summary
expression
an expression statement
   
   

imageTiltDisplacement

open fun imageTiltDisplacement(value: Float): PropertyValue

The displacement off the center of the top image and the shadow image when the pitch of the map is greater than 0. This helps producing a three-dimensional appearence.

Return

property wrapper around Float

Parameters
Name Summary
value
a Float value
   
   

open fun imageTiltDisplacement(expression: Expression): PropertyValue<Expression>

The displacement off the center of the top image and the shadow image when the pitch of the map is greater than 0. This helps producing a three-dimensional appearence.

Return

property wrapper around an expression statement

Parameters
Name Summary
expression
an expression statement
   
   

location

open fun location(value: Array): [PropertyValue](../com.mapbox.mapboxsdk.style.layers/#propertyvalue)<Array>

An array of [latitude, longitude, altitude] position of the location indicator.

Return

property wrapper around Double[]

Parameters
Name Summary
value
a Double[] value
   
   

open fun location(expression: Expression): PropertyValue<Expression>

An array of [latitude, longitude, altitude] position of the location indicator.

Return

property wrapper around an expression statement

Parameters
Name Summary
expression
an expression statement
   
   

perspectiveCompensation

open fun perspectiveCompensation(value: Float): PropertyValue

The amount of the perspective compensation, between 0 and 1. A value of 1 produces a location indicator of constant width across the screen. A value of 0 makes it scale naturally according to the viewing projection.

Return

property wrapper around Float

Parameters
Name Summary
value
a Float value
   
   

open fun perspectiveCompensation(expression: Expression): PropertyValue<Expression>

The amount of the perspective compensation, between 0 and 1. A value of 1 produces a location indicator of constant width across the screen. A value of 0 makes it scale naturally according to the viewing projection.

Return

property wrapper around an expression statement

Parameters
Name Summary
expression
an expression statement
   
   

shadowImageSize

open fun shadowImageSize(value: Float): PropertyValue

The size of the shadow image, as a scale factor applied to the size of the specified image.

Return

property wrapper around Float

Parameters
Name Summary
value
a Float value
   
   

open fun shadowImageSize(expression: Expression): PropertyValue<Expression>

The size of the shadow image, as a scale factor applied to the size of the specified image.

Return

property wrapper around an expression statement

Parameters
Name Summary
expression
an expression statement
   
   

shadowImage

open fun shadowImage(value: String): PropertyValue

Name of image in sprite to use as the background of the location indicator.

Return

property wrapper around String

Parameters
Name Summary
value
a String value
   
   

open fun shadowImage(value: Expression): PropertyValue<Expression>

Name of image in sprite to use as the background of the location indicator.

Return

property wrapper around String

Parameters
Name Summary
value
a String value
   
   

topImageSize

open fun topImageSize(value: Float): PropertyValue

The size of the top image, as a scale factor applied to the size of the specified image.

Return

property wrapper around Float

Parameters
Name Summary
value
a Float value
   
   

open fun topImageSize(expression: Expression): PropertyValue<Expression>

The size of the top image, as a scale factor applied to the size of the specified image.

Return

property wrapper around an expression statement

Parameters
Name Summary
expression
an expression statement
   
   

topImage

open fun topImage(value: String): PropertyValue

Name of image in sprite to use as the top of the location indicator.

Return

property wrapper around String

Parameters
Name Summary
value
a String value
   
   

open fun topImage(value: Expression): PropertyValue<Expression>

Name of image in sprite to use as the top of the location indicator.

Return

property wrapper around String

Parameters
Name Summary
value
a String value
   
   

visibility

open fun visibility(value: String): PropertyValue

Set the property visibility.

Return

property wrapper around visibility

Parameters
Name Summary
value
the visibility value
   
   

MapboxAnimator

abstract class MapboxAnimator<K> : ValueAnimator, ValueAnimator.AnimatorUpdateListener

Abstract class for all of the location component animators.

Parameters
Name Summary

Data type that will be animated.
   

Constructors

Name Summary
MapboxAnimator open fun MapboxAnimator(values: Array<K>, updateListener: MapboxAnimator.AnimationsValueChangeListener<K>, maxAnimationFps: Int)
MapboxAnimator open fun MapboxAnimator(updateListener: MapboxAnimator.AnimationsValueChangeListener<K>, target: K, animatedValue: K, minUpdateInterval: Double, timeElapsed: Long)

Types

Name Summary
AnimationsValueChangeListener
interface AnimationsValueChangeListener<K>
Type
@Retention(value = RetentionPolicy.SOURCE)
annotation class Type

Functions

Name Summary
addListener
open fun addListener(listener: Animator.AnimatorListener)
addPauseListener
open fun addPauseListener(listener: Animator.AnimatorPauseListener)
addUpdateListener
open fun addUpdateListener(listener: ValueAnimator.AnimatorUpdateListener)
areAnimatorsEnabled
open fun areAnimatorsEnabled(): Boolean
cancel
open fun cancel()
clone
open fun clone(): Animator
open fun clone(): ValueAnimator
end
open fun end()
getAnimatedFraction
open fun getAnimatedFraction(): Float
getAnimatedValue
open fun getAnimatedValue(): Any
getCurrentPlayTime
open fun getCurrentPlayTime(): Long
getDuration
open fun getDuration(): Long
getFrameDelay
open fun getFrameDelay(): Long
getInterpolator
open fun getInterpolator(): TimeInterpolator
getListeners
open fun getListeners(): ArrayList
getRepeatCount
open fun getRepeatCount(): Int
getRepeatMode
open fun getRepeatMode(): Int
getStartDelay
open fun getStartDelay(): Long
getTotalDuration
open fun getTotalDuration(): Long
getValues
open fun getValues(): Array
isPaused
open fun isPaused(): Boolean
isRunning
open fun isRunning(): Boolean
isStarted
open fun isStarted(): Boolean
makeInvalid
open fun makeInvalid()
ofArgb
open fun ofArgb(values: Array): ValueAnimator
ofFloat
open fun ofFloat(values: Array): ValueAnimator
ofInt
open fun ofInt(values: Array): ValueAnimator
ofObject
open fun ofObject(evaluator: TypeEvaluator, values: Array): ValueAnimator
ofPropertyValuesHolder
open fun ofPropertyValuesHolder(values: Array): ValueAnimator
onAnimationUpdate
abstract fun onAnimationUpdate(p: ValueAnimator)
open fun onAnimationUpdate(animation: ValueAnimator)
pause
open fun pause()
provideEvaluator
abstract fun provideEvaluator(): TypeEvaluator
removeAllListeners
open fun removeAllListeners()
removeAllUpdateListeners
open fun removeAllUpdateListeners()
removeListener
open fun removeListener(listener: Animator.AnimatorListener)
removePauseListener
open fun removePauseListener(listener: Animator.AnimatorPauseListener)
removeUpdateListener
open fun removeUpdateListener(listener: ValueAnimator.AnimatorUpdateListener)
resume
open fun resume()
reverse
open fun reverse()
setCurrentFraction
open fun setCurrentFraction(fraction: Float)
setCurrentPlayTime
open fun setCurrentPlayTime(playTime: Long)
setDuration
abstract fun setDuration(p: Long): Animator
open fun setDuration(duration: Long): ValueAnimator
setEvaluator
open fun setEvaluator(value: TypeEvaluator)
setFloatValues
open fun setFloatValues(values: Array)
setFrameDelay
open fun setFrameDelay(frameDelay: Long)
setInterpolator
open fun setInterpolator(value: TimeInterpolator)
setIntValues
open fun setIntValues(values: Array)
setObjectValues
open fun setObjectValues(values: Array)
setRepeatCount
open fun setRepeatCount(value: Int)
setRepeatMode
open fun setRepeatMode(value: Int)
setStartDelay
open fun setStartDelay(startDelay: Long)
setTarget
open fun setTarget(target: Any)
setupEndValues
open fun setupEndValues()
setupStartValues
open fun setupStartValues()
setValues
open fun setValues(values: Array)
start
open fun start()
toString
open fun toString(): String

Properties

Name Summary
ANIMATOR_CAMERA_COMPASS_BEARING val ANIMATOR_CAMERA_COMPASS_BEARING: Int
ANIMATOR_CAMERA_GPS_BEARING val ANIMATOR_CAMERA_GPS_BEARING: Int
ANIMATOR_CAMERA_LATLNG val ANIMATOR_CAMERA_LATLNG: Int
ANIMATOR_LAYER_ACCURACY val ANIMATOR_LAYER_ACCURACY: Int
ANIMATOR_LAYER_COMPASS_BEARING val ANIMATOR_LAYER_COMPASS_BEARING: Int
ANIMATOR_LAYER_GPS_BEARING val ANIMATOR_LAYER_GPS_BEARING: Int
ANIMATOR_LAYER_LATLNG val ANIMATOR_LAYER_LATLNG: Int
ANIMATOR_PULSING_CIRCLE val ANIMATOR_PULSING_CIRCLE: Int
ANIMATOR_TILT val ANIMATOR_TILT: Int
ANIMATOR_ZOOM val ANIMATOR_ZOOM: Int
target private val target: K

Inheritors

Name
MapboxFloatAnimator
MapboxLatLngAnimator

ANIMATOR_CAMERA_COMPASS_BEARING

val ANIMATOR_CAMERA_COMPASS_BEARING: Int

ANIMATOR_CAMERA_GPS_BEARING

val ANIMATOR_CAMERA_GPS_BEARING: Int

ANIMATOR_CAMERA_LATLNG

val ANIMATOR_CAMERA_LATLNG: Int

ANIMATOR_LAYER_ACCURACY

val ANIMATOR_LAYER_ACCURACY: Int

ANIMATOR_LAYER_COMPASS_BEARING

val ANIMATOR_LAYER_COMPASS_BEARING: Int

ANIMATOR_LAYER_GPS_BEARING

val ANIMATOR_LAYER_GPS_BEARING: Int

ANIMATOR_LAYER_LATLNG

val ANIMATOR_LAYER_LATLNG: Int

ANIMATOR_PULSING_CIRCLE

val ANIMATOR_PULSING_CIRCLE: Int

ANIMATOR_TILT

val ANIMATOR_TILT: Int

ANIMATOR_ZOOM

val ANIMATOR_ZOOM: Int

makeInvalid

open fun makeInvalid()

onAnimationUpdate

open fun onAnimationUpdate(animation: ValueAnimator)

provideEvaluator

abstract fun provideEvaluator(): TypeEvaluator

target

private val target: K

AnimationsValueChangeListener

interface AnimationsValueChangeListener<K>

Functions

Name Summary
onNewAnimationValue
abstract fun onNewAnimationValue(value: K)

onNewAnimationValue

abstract fun onNewAnimationValue(value: K)

Type

@Retention(value = RetentionPolicy.SOURCE)

annotation class Type

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

MapboxAnimatorProvider

class MapboxAnimatorProvider

Functions

Name Summary
cameraAnimator
open fun cameraAnimator(values: Array, updateListener: [MapboxAnimator.AnimationsValueChangeListener](#mapboxanimator.animationsvaluechangelistener), cancelableCallback: [MapboxMap.CancelableCallback](../com.mapbox.mapboxsdk.maps/#mapboxmap.cancelablecallback)): [MapboxCameraAnimatorAdapter](#mapboxcameraanimatoradapter)
floatAnimator
open fun floatAnimator(values: Array, updateListener: [MapboxAnimator.AnimationsValueChangeListener](#mapboxanimator.animationsvaluechangelistener), maxAnimationFps: Int): [MapboxFloatAnimator](#mapboxfloatanimator)
getInstance
open fun getInstance(): MapboxAnimatorProvider
latLngAnimator
open fun latLngAnimator(values: Array<LatLng>, updateListener: MapboxAnimator.AnimationsValueChangeListener, maxAnimationFps: Int): MapboxLatLngAnimator
pulsingCircleAnimator
open fun pulsingCircleAnimator(updateListener: MapboxAnimator.AnimationsValueChangeListener, maxAnimationFps: Int, pulseSingleDuration: Float, pulseMaxRadius: Float, pulseInterpolator: Interpolator): PulsingLocationCircleAnimator
This animator is for the LocationComponent pulsing circle.

cameraAnimator

open fun cameraAnimator(values: Array, updateListener: [MapboxAnimator.AnimationsValueChangeListener](#mapboxanimator.animationsvaluechangelistener), cancelableCallback: [MapboxMap.CancelableCallback](../com.mapbox.mapboxsdk.maps/#mapboxmap.cancelablecallback)): [MapboxCameraAnimatorAdapter](#mapboxcameraanimatoradapter)

floatAnimator

open fun floatAnimator(values: Array, updateListener: [MapboxAnimator.AnimationsValueChangeListener](#mapboxanimator.animationsvaluechangelistener), maxAnimationFps: Int): [MapboxFloatAnimator](#mapboxfloatanimator)

getInstance

open fun getInstance(): MapboxAnimatorProvider

latLngAnimator

open fun latLngAnimator(values: Array<LatLng>, updateListener: MapboxAnimator.AnimationsValueChangeListener, maxAnimationFps: Int): MapboxLatLngAnimator

pulsingCircleAnimator

open fun pulsingCircleAnimator(updateListener: MapboxAnimator.AnimationsValueChangeListener, maxAnimationFps: Int, pulseSingleDuration: Float, pulseMaxRadius: Float, pulseInterpolator: Interpolator): PulsingLocationCircleAnimator

This animator is for the LocationComponent pulsing circle.

Return

a built PulsingLocationCircleAnimator object.

Parameters
Name Summary
updateListener
the listener that is found in the LocationAnimatorCoordinator‘slistener array.
maxAnimationFps
the max frames per second of the pulsing animation
pulseSingleDuration
the number of milliseconds it takes for the animator to createa single pulse.
pulseMaxRadius
the max radius when the circle is finished with a single pulse.
pulseInterpolator
the type of Android-system interpolator to use forthe pulsing animation (linear, accelerate, bounce, etc.)
   
   

MapboxAnimatorSetProvider

open class MapboxAnimatorSetProvider

Functions

Name Summary
startAnimation
open fun startAnimation(animators: List, interpolator: Interpolator, duration: Long)

Properties

Name Summary
instance private open val instance: MapboxAnimatorSetProvider

instance

private open val instance: MapboxAnimatorSetProvider

startAnimation

open fun startAnimation(animators: List, interpolator: Interpolator, duration: Long)

MapboxCameraAnimatorAdapter

open class MapboxCameraAnimatorAdapter : MapboxFloatAnimator

Constructors

Name Summary
MapboxCameraAnimatorAdapter open fun MapboxCameraAnimatorAdapter(values: Array, updateListener: [MapboxAnimator.AnimationsValueChangeListener](#mapboxanimator.animationsvaluechangelistener), cancelableCallback: [MapboxMap.CancelableCallback](../com.mapbox.mapboxsdk.maps/#mapboxmap.cancelablecallback))

Functions

Name Summary
addListener
open fun addListener(listener: Animator.AnimatorListener)
addPauseListener
open fun addPauseListener(listener: Animator.AnimatorPauseListener)
addUpdateListener
open fun addUpdateListener(listener: ValueAnimator.AnimatorUpdateListener)
areAnimatorsEnabled
open fun areAnimatorsEnabled(): Boolean
cancel
open fun cancel()
clone
open fun clone(): Animator
open fun clone(): ValueAnimator
end
open fun end()
getAnimatedFraction
open fun getAnimatedFraction(): Float
getAnimatedValue
open fun getAnimatedValue(): Any
getCurrentPlayTime
open fun getCurrentPlayTime(): Long
getDuration
open fun getDuration(): Long
getFrameDelay
open fun getFrameDelay(): Long
getInterpolator
open fun getInterpolator(): TimeInterpolator
getListeners
open fun getListeners(): ArrayList
getRepeatCount
open fun getRepeatCount(): Int
getRepeatMode
open fun getRepeatMode(): Int
getStartDelay
open fun getStartDelay(): Long
getTarget
open fun getTarget(): K
getTotalDuration
open fun getTotalDuration(): Long
getValues
open fun getValues(): Array
isPaused
open fun isPaused(): Boolean
isRunning
open fun isRunning(): Boolean
isStarted
open fun isStarted(): Boolean
makeInvalid
open fun makeInvalid()
ofArgb
open fun ofArgb(values: Array): ValueAnimator
ofFloat
open fun ofFloat(values: Array): ValueAnimator
ofInt
open fun ofInt(values: Array): ValueAnimator
ofObject
open fun ofObject(evaluator: TypeEvaluator, values: Array): ValueAnimator
ofPropertyValuesHolder
open fun ofPropertyValuesHolder(values: Array): ValueAnimator
onAnimationUpdate
abstract fun onAnimationUpdate(p: ValueAnimator)
open fun onAnimationUpdate(animation: ValueAnimator)
pause
open fun pause()
provideEvaluator
@NonNull()
open fun provideEvaluator(): TypeEvaluator
removeAllListeners
open fun removeAllListeners()
removeAllUpdateListeners
open fun removeAllUpdateListeners()
removeListener
open fun removeListener(listener: Animator.AnimatorListener)
removePauseListener
open fun removePauseListener(listener: Animator.AnimatorPauseListener)
removeUpdateListener
open fun removeUpdateListener(listener: ValueAnimator.AnimatorUpdateListener)
resume
open fun resume()
reverse
open fun reverse()
setCurrentFraction
open fun setCurrentFraction(fraction: Float)
setCurrentPlayTime
open fun setCurrentPlayTime(playTime: Long)
setDuration
abstract fun setDuration(p: Long): Animator
open fun setDuration(duration: Long): ValueAnimator
setEvaluator
open fun setEvaluator(value: TypeEvaluator)
setFloatValues
open fun setFloatValues(values: Array)
setFrameDelay
open fun setFrameDelay(frameDelay: Long)
setInterpolator
open fun setInterpolator(value: TimeInterpolator)
setIntValues
open fun setIntValues(values: Array)
setObjectValues
open fun setObjectValues(values: Array)
setRepeatCount
open fun setRepeatCount(value: Int)
setRepeatMode
open fun setRepeatMode(value: Int)
setStartDelay
open fun setStartDelay(startDelay: Long)
setTarget
open fun setTarget(target: Any)
setupEndValues
open fun setupEndValues()
setupStartValues
open fun setupStartValues()
setValues
open fun setValues(values: Array)
start
open fun start()
toString
open fun toString(): String

MapboxFloatAnimator

open class MapboxFloatAnimator : MapboxAnimator

Constructors

Name Summary
MapboxFloatAnimator open fun MapboxFloatAnimator(values: Array, updateListener: [MapboxAnimator.AnimationsValueChangeListener](#mapboxanimator.animationsvaluechangelistener), maxAnimationFps: Int)

Functions

Name Summary
addListener
open fun addListener(listener: Animator.AnimatorListener)
addPauseListener
open fun addPauseListener(listener: Animator.AnimatorPauseListener)
addUpdateListener
open fun addUpdateListener(listener: ValueAnimator.AnimatorUpdateListener)
areAnimatorsEnabled
open fun areAnimatorsEnabled(): Boolean
cancel
open fun cancel()
clone
open fun clone(): Animator
open fun clone(): ValueAnimator
end
open fun end()
getAnimatedFraction
open fun getAnimatedFraction(): Float
getAnimatedValue
open fun getAnimatedValue(): Any
getCurrentPlayTime
open fun getCurrentPlayTime(): Long
getDuration
open fun getDuration(): Long
getFrameDelay
open fun getFrameDelay(): Long
getInterpolator
open fun getInterpolator(): TimeInterpolator
getListeners
open fun getListeners(): ArrayList
getRepeatCount
open fun getRepeatCount(): Int
getRepeatMode
open fun getRepeatMode(): Int
getStartDelay
open fun getStartDelay(): Long
getTarget
open fun getTarget(): K
getTotalDuration
open fun getTotalDuration(): Long
getValues
open fun getValues(): Array
isPaused
open fun isPaused(): Boolean
isRunning
open fun isRunning(): Boolean
isStarted
open fun isStarted(): Boolean
makeInvalid
open fun makeInvalid()
ofArgb
open fun ofArgb(values: Array): ValueAnimator
ofFloat
open fun ofFloat(values: Array): ValueAnimator
ofInt
open fun ofInt(values: Array): ValueAnimator
ofObject
open fun ofObject(evaluator: TypeEvaluator, values: Array): ValueAnimator
ofPropertyValuesHolder
open fun ofPropertyValuesHolder(values: Array): ValueAnimator
onAnimationUpdate
abstract fun onAnimationUpdate(p: ValueAnimator)
open fun onAnimationUpdate(animation: ValueAnimator)
pause
open fun pause()
provideEvaluator
@NonNull()
open fun provideEvaluator(): TypeEvaluator
removeAllListeners
open fun removeAllListeners()
removeAllUpdateListeners
open fun removeAllUpdateListeners()
removeListener
open fun removeListener(listener: Animator.AnimatorListener)
removePauseListener
open fun removePauseListener(listener: Animator.AnimatorPauseListener)
removeUpdateListener
open fun removeUpdateListener(listener: ValueAnimator.AnimatorUpdateListener)
resume
open fun resume()
reverse
open fun reverse()
setCurrentFraction
open fun setCurrentFraction(fraction: Float)
setCurrentPlayTime
open fun setCurrentPlayTime(playTime: Long)
setDuration
abstract fun setDuration(p: Long): Animator
open fun setDuration(duration: Long): ValueAnimator
setEvaluator
open fun setEvaluator(value: TypeEvaluator)
setFloatValues
open fun setFloatValues(values: Array)
setFrameDelay
open fun setFrameDelay(frameDelay: Long)
setInterpolator
open fun setInterpolator(value: TimeInterpolator)
setIntValues
open fun setIntValues(values: Array)
setObjectValues
open fun setObjectValues(values: Array)
setRepeatCount
open fun setRepeatCount(value: Int)
setRepeatMode
open fun setRepeatMode(value: Int)
setStartDelay
open fun setStartDelay(startDelay: Long)
setTarget
open fun setTarget(target: Any)
setupEndValues
open fun setupEndValues()
setupStartValues
open fun setupStartValues()
setValues
open fun setValues(values: Array)
start
open fun start()
toString
open fun toString(): String

Inheritors

Name
MapboxCameraAnimatorAdapter
PulsingLocationCircleAnimator

provideEvaluator

@NonNull()

open fun provideEvaluator(): TypeEvaluator

MapboxLatLngAnimator

open class MapboxLatLngAnimator : MapboxAnimator<LatLng>

Constructors

Name Summary
MapboxLatLngAnimator open fun MapboxLatLngAnimator(values: Array<LatLng>, updateListener: MapboxAnimator.AnimationsValueChangeListener, maxAnimationFps: Int)

Functions

Name Summary
addListener
open fun addListener(listener: Animator.AnimatorListener)
addPauseListener
open fun addPauseListener(listener: Animator.AnimatorPauseListener)
addUpdateListener
open fun addUpdateListener(listener: ValueAnimator.AnimatorUpdateListener)
areAnimatorsEnabled
open fun areAnimatorsEnabled(): Boolean
cancel
open fun cancel()
clone
open fun clone(): Animator
open fun clone(): ValueAnimator
end
open fun end()
getAnimatedFraction
open fun getAnimatedFraction(): Float
getAnimatedValue
open fun getAnimatedValue(): Any
getCurrentPlayTime
open fun getCurrentPlayTime(): Long
getDuration
open fun getDuration(): Long
getFrameDelay
open fun getFrameDelay(): Long
getInterpolator
open fun getInterpolator(): TimeInterpolator
getListeners
open fun getListeners(): ArrayList
getRepeatCount
open fun getRepeatCount(): Int
getRepeatMode
open fun getRepeatMode(): Int
getStartDelay
open fun getStartDelay(): Long
getTarget
open fun getTarget(): K
getTotalDuration
open fun getTotalDuration(): Long
getValues
open fun getValues(): Array
isPaused
open fun isPaused(): Boolean
isRunning
open fun isRunning(): Boolean
isStarted
open fun isStarted(): Boolean
makeInvalid
open fun makeInvalid()
ofArgb
open fun ofArgb(values: Array): ValueAnimator
ofFloat
open fun ofFloat(values: Array): ValueAnimator
ofInt
open fun ofInt(values: Array): ValueAnimator
ofObject
open fun ofObject(evaluator: TypeEvaluator, values: Array): ValueAnimator
ofPropertyValuesHolder
open fun ofPropertyValuesHolder(values: Array): ValueAnimator
onAnimationUpdate
abstract fun onAnimationUpdate(p: ValueAnimator)
open fun onAnimationUpdate(animation: ValueAnimator)
pause
open fun pause()
provideEvaluator
@NonNull()
open fun provideEvaluator(): TypeEvaluator
removeAllListeners
open fun removeAllListeners()
removeAllUpdateListeners
open fun removeAllUpdateListeners()
removeListener
open fun removeListener(listener: Animator.AnimatorListener)
removePauseListener
open fun removePauseListener(listener: Animator.AnimatorPauseListener)
removeUpdateListener
open fun removeUpdateListener(listener: ValueAnimator.AnimatorUpdateListener)
resume
open fun resume()
reverse
open fun reverse()
setCurrentFraction
open fun setCurrentFraction(fraction: Float)
setCurrentPlayTime
open fun setCurrentPlayTime(playTime: Long)
setDuration
abstract fun setDuration(p: Long): Animator
open fun setDuration(duration: Long): ValueAnimator
setEvaluator
open fun setEvaluator(value: TypeEvaluator)
setFloatValues
open fun setFloatValues(values: Array)
setFrameDelay
open fun setFrameDelay(frameDelay: Long)
setInterpolator
open fun setInterpolator(value: TimeInterpolator)
setIntValues
open fun setIntValues(values: Array)
setObjectValues
open fun setObjectValues(values: Array)
setRepeatCount
open fun setRepeatCount(value: Int)
setRepeatMode
open fun setRepeatMode(value: Int)
setStartDelay
open fun setStartDelay(startDelay: Long)
setTarget
open fun setTarget(target: Any)
setupEndValues
open fun setupEndValues()
setupStartValues
open fun setupStartValues()
setValues
open fun setValues(values: Array)
start
open fun start()
toString
open fun toString(): String

provideEvaluator

@NonNull()

open fun provideEvaluator(): TypeEvaluator

OnCameraMoveInvalidateListener

interface OnCameraMoveInvalidateListener

Functions

Name Summary
onInvalidateCameraMove
abstract fun onInvalidateCameraMove()

onInvalidateCameraMove

abstract fun onInvalidateCameraMove()

OnCameraTrackingChangedListener

interface OnCameraTrackingChangedListener

Listener that gets invoked when camera tracking state changes.

Functions

Name Summary
onCameraTrackingChanged
abstract fun onCameraTrackingChanged(currentMode: Int)
Invoked on every CameraMode change.
onCameraTrackingDismissed
abstract fun onCameraTrackingDismissed()
Invoked whenever camera tracking is broken.

onCameraTrackingChanged

abstract fun onCameraTrackingChanged(currentMode: Int)

Invoked on every CameraMode change.

Parameters
Name Summary
currentMode
current active CameraMode.
   
   

onCameraTrackingDismissed

abstract fun onCameraTrackingDismissed()

Invoked whenever camera tracking is broken.This callback gets invoked just after onCameraTrackingChanged, if needed.

OnLocationCameraTransitionListener

interface OnLocationCameraTransitionListener

Callback for CameraMode transition state.

Functions

Name Summary
onLocationCameraTransitionCanceled
abstract fun onLocationCameraTransitionCanceled(cameraMode: Int)
Invoked when the camera mode transition animation has been canceled.
onLocationCameraTransitionFinished
abstract fun onLocationCameraTransitionFinished(cameraMode: Int)
Invoked when the camera mode transition animation has been finished.

onLocationCameraTransitionCanceled

abstract fun onLocationCameraTransitionCanceled(cameraMode: Int)

Invoked when the camera mode transition animation has been canceled.

The camera mode is set regardless of the cancellation of the transition animation.

Parameters
Name Summary
cameraMode
camera mode change that initiated the transition
   
   

onLocationCameraTransitionFinished

abstract fun onLocationCameraTransitionFinished(cameraMode: Int)

Invoked when the camera mode transition animation has been finished.

Parameters
Name Summary
cameraMode
camera mode change that initiated the transition
   
   

OnLocationClickListener

interface OnLocationClickListener

The Location Component exposes an API for listening to when the user clicks on the location layer icon visible on the map. When this event occurs, the onLocationComponentClick method gets invoked.

Functions

Name Summary
onLocationComponentClick
abstract fun onLocationComponentClick()
Called whenever user clicks on the location layer drawn on the map.

onLocationComponentClick

abstract fun onLocationComponentClick()

Called whenever user clicks on the location layer drawn on the map.

OnLocationLongClickListener

interface OnLocationLongClickListener

The Location Component exposes an API for listening to when the user long clicks on the location layer icon visible on the map. when this event occurs, the onLocationComponentLongClick method gets invoked.

Functions

Name Summary
onLocationComponentLongClick
abstract fun onLocationComponentLongClick()
Called whenever user long clicks on the location layer drawn on the map.

onLocationComponentLongClick

abstract fun onLocationComponentLongClick()

Called whenever user long clicks on the location layer drawn on the map.

OnLocationStaleListener

interface OnLocationStaleListener

Listener that can be added as a callback when the last location update is considered stale.

The time from the last location update that determines if a location update is stale or not is provided by staleStateTimeout.

Functions

Name Summary
onStaleStateChange
abstract fun onStaleStateChange(isStale: Boolean)
Called when the stale state changes.

onStaleStateChange

abstract fun onStaleStateChange(isStale: Boolean)

Called when the stale state changes.

Parameters
Name Summary
isStale
true if location is stale, false otherwise
   
   

OnRenderModeChangedListener

interface OnRenderModeChangedListener

Listener that gets invoked when layer render mode changes.

Functions

Name Summary
onRenderModeChanged
abstract fun onRenderModeChanged(currentMode: Int)
Invoked on every RenderMode change.

onRenderModeChanged

abstract fun onRenderModeChanged(currentMode: Int)

Invoked on every RenderMode change.

Parameters
Name Summary
currentMode
current active RenderMode.
   
   

PulsingLocationCircleAnimator

open class PulsingLocationCircleAnimator : MapboxFloatAnimator

Manages the logic of the interpolated animation which is applied to the LocationComponent’s pulsing circle

Constructors

Name Summary
PulsingLocationCircleAnimator open fun PulsingLocationCircleAnimator(updateListener: MapboxAnimator.AnimationsValueChangeListener, maxAnimationFps: Int, circleMaxRadius: Float)the AnimationsValueChangeListener associated with this animator.

Functions

Name Summary
addListener
open fun addListener(listener: Animator.AnimatorListener)
addPauseListener
open fun addPauseListener(listener: Animator.AnimatorPauseListener)
addUpdateListener
open fun addUpdateListener(listener: ValueAnimator.AnimatorUpdateListener)
areAnimatorsEnabled
open fun areAnimatorsEnabled(): Boolean
cancel
open fun cancel()
clone
open fun clone(): Animator
open fun clone(): ValueAnimator
end
open fun end()
getAnimatedFraction
open fun getAnimatedFraction(): Float
getAnimatedValue
open fun getAnimatedValue(): Any
getCurrentPlayTime
open fun getCurrentPlayTime(): Long
getDuration
open fun getDuration(): Long
getFrameDelay
open fun getFrameDelay(): Long
getInterpolator
open fun getInterpolator(): TimeInterpolator
getListeners
open fun getListeners(): ArrayList
getRepeatCount
open fun getRepeatCount(): Int
getRepeatMode
open fun getRepeatMode(): Int
getStartDelay
open fun getStartDelay(): Long
getTarget
open fun getTarget(): K
getTotalDuration
open fun getTotalDuration(): Long
getValues
open fun getValues(): Array
isPaused
open fun isPaused(): Boolean
isRunning
open fun isRunning(): Boolean
isStarted
open fun isStarted(): Boolean
makeInvalid
open fun makeInvalid()
ofArgb
open fun ofArgb(values: Array): ValueAnimator
ofFloat
open fun ofFloat(values: Array): ValueAnimator
ofInt
open fun ofInt(values: Array): ValueAnimator
ofObject
open fun ofObject(evaluator: TypeEvaluator, values: Array): ValueAnimator
ofPropertyValuesHolder
open fun ofPropertyValuesHolder(values: Array): ValueAnimator
onAnimationUpdate
abstract fun onAnimationUpdate(p: ValueAnimator)
open fun onAnimationUpdate(animation: ValueAnimator)
pause
open fun pause()
provideEvaluator
@NonNull()
open fun provideEvaluator(): TypeEvaluator
removeAllListeners
open fun removeAllListeners()
removeAllUpdateListeners
open fun removeAllUpdateListeners()
removeListener
open fun removeListener(listener: Animator.AnimatorListener)
removePauseListener
open fun removePauseListener(listener: Animator.AnimatorPauseListener)
removeUpdateListener
open fun removeUpdateListener(listener: ValueAnimator.AnimatorUpdateListener)
resume
open fun resume()
reverse
open fun reverse()
setCurrentFraction
open fun setCurrentFraction(fraction: Float)
setCurrentPlayTime
open fun setCurrentPlayTime(playTime: Long)
setDuration
abstract fun setDuration(p: Long): Animator
open fun setDuration(duration: Long): ValueAnimator
setEvaluator
open fun setEvaluator(value: TypeEvaluator)
setFloatValues
open fun setFloatValues(values: Array)
setFrameDelay
open fun setFrameDelay(frameDelay: Long)
setInterpolator
open fun setInterpolator(value: TimeInterpolator)
setIntValues
open fun setIntValues(values: Array)
setObjectValues
open fun setObjectValues(values: Array)
setRepeatCount
open fun setRepeatCount(value: Int)
setRepeatMode
open fun setRepeatMode(value: Int)
setStartDelay
open fun setStartDelay(startDelay: Long)
setTarget
open fun setTarget(target: Any)
setupEndValues
open fun setupEndValues()
setupStartValues
open fun setupStartValues()
setValues
open fun setValues(values: Array)
start
open fun start()
toString
open fun toString(): String

StaleStateManager

open class StaleStateManager

Class controls the location stale state when the android.location.Location hasn’t been updated in ‘x’ amount of time. staleStateTimeout can be used to control the amount of time before the location’s considered stale. enableStaleState is available for disabling this behaviour.

Constructors

Name Summary
StaleStateManager open fun StaleStateManager(innerListener: OnLocationStaleListener, options: LocationComponentOptions)

Functions

Name Summary
onStart
open fun onStart()
onStop
open fun onStop()
setEnabled
open fun setEnabled(enabled: Boolean)
updateLatestLocationTime
open fun updateLatestLocationTime()

Properties

Name Summary
delayTime private open var delayTime: Long
isStale private open val isStale: Boolean

delayTime

private open var delayTime: Long

isStale

private open val isStale: Boolean

onStart

open fun onStart()

onStop

open fun onStop()

setEnabled

open fun setEnabled(enabled: Boolean)

updateLatestLocationTime

open fun updateLatestLocationTime()

SymbolLocationLayerRenderer

class SymbolLocationLayerRenderer : LocationLayerRenderer

Constructors

Name Summary
SymbolLocationLayerRenderer open fun SymbolLocationLayerRenderer(layerSourceProvider: LayerSourceProvider, featureProvider: LayerFeatureProvider, isStale: Boolean)

Functions

Name Summary
addBitmaps
abstract fun addBitmaps(renderMode: Int, shadowBitmap: Bitmap, backgroundBitmap: Bitmap, backgroundStaleBitmap: Bitmap, bearingBitmap: Bitmap, foregroundBitmap: Bitmap, foregroundStaleBitmap: Bitmap)
open fun addBitmaps(renderMode: Int, shadowBitmap: Bitmap, backgroundBitmap: Bitmap, backgroundStaleBitmap: Bitmap, bearingBitmap: Bitmap, foregroundBitmap: Bitmap, foregroundBitmapStale: Bitmap)
addLayers
open fun addLayers(positionManager: LocationComponentPositionManager)
adjustPulsingCircleLayerVisibility
open fun adjustPulsingCircleLayerVisibility(visible: Boolean)
Adjust the visibility of the pulsing LocationComponent circle.
cameraBearingUpdated
open fun cameraBearingUpdated(bearing: Double)
cameraTiltUpdated
open fun cameraTiltUpdated(tilt: Double)
hide
open fun hide()
initializeComponents
open fun initializeComponents(style: Style)
removeLayers
open fun removeLayers()
setAccuracyRadius
open fun setAccuracyRadius(accuracy: Float)
setCompassBearing
open fun setCompassBearing(compassBearing: Float)
setGpsBearing
open fun setGpsBearing(gpsBearing: Float)
setLatLng
open fun setLatLng(latLng: LatLng)
setLocationStale
open fun setLocationStale(isStale: Boolean, renderMode: Int)
show
open fun show(renderMode: Int, isStale: Boolean)
styleAccuracy
open fun styleAccuracy(accuracyAlpha: Float, accuracyColor: Int)
stylePulsingCircle
open fun stylePulsingCircle(options: LocationComponentOptions)
Adjust the the pulsing LocationComponent circle based on the set options.
styleScaling
open fun styleScaling(scaleExpression: Expression)
updateIconIds
abstract fun updateIconIds(foregroundIconString: String, foregroundStaleIconString: String, backgroundIconString: String, backgroundStaleIconString: String, bearingIconString: String)
open fun updateIconIds(foregroundIconString: String, foregroundStaleIconString: String, backgroundIconString: String, backgroundStaleIconString: String, bearingIconString: String)
updatePulsingUi
open fun updatePulsingUi(radius: Float, opacity: Float)
Adjust the visual appearance of the pulsing LocationComponent circle.

addBitmaps

open fun addBitmaps(renderMode: Int, shadowBitmap: Bitmap, backgroundBitmap: Bitmap, backgroundStaleBitmap: Bitmap, bearingBitmap: Bitmap, foregroundBitmap: Bitmap, foregroundBitmapStale: Bitmap)

addLayers

open fun addLayers(positionManager: LocationComponentPositionManager)

adjustPulsingCircleLayerVisibility

open fun adjustPulsingCircleLayerVisibility(visible: Boolean)

Adjust the visibility of the pulsing LocationComponent circle.

cameraBearingUpdated

open fun cameraBearingUpdated(bearing: Double)

cameraTiltUpdated

open fun cameraTiltUpdated(tilt: Double)

hide

open fun hide()

initializeComponents

open fun initializeComponents(style: Style)

removeLayers

open fun removeLayers()

setAccuracyRadius

open fun setAccuracyRadius(accuracy: Float)

setCompassBearing

open fun setCompassBearing(compassBearing: Float)

setGpsBearing

open fun setGpsBearing(gpsBearing: Float)

setLatLng

open fun setLatLng(latLng: LatLng)

setLocationStale

open fun setLocationStale(isStale: Boolean, renderMode: Int)

show

open fun show(renderMode: Int, isStale: Boolean)

styleAccuracy

open fun styleAccuracy(accuracyAlpha: Float, accuracyColor: Int)

stylePulsingCircle

open fun stylePulsingCircle(options: LocationComponentOptions)

Adjust the the pulsing LocationComponent circle based on the set options.

styleScaling

open fun styleScaling(scaleExpression: Expression)

updateIconIds

open fun updateIconIds(foregroundIconString: String, foregroundStaleIconString: String, backgroundIconString: String, backgroundStaleIconString: String, bearingIconString: String)

updatePulsingUi

open fun updatePulsingUi(radius: Float, opacity: Float)

Adjust the visual appearance of the pulsing LocationComponent circle.

Utils

class Utils

Functions

Name Summary
calculateZoomLevelRadius
open fun calculateZoomLevelRadius(mapboxMap: MapboxMap, location: Location): Float
generateShadow
open fun generateShadow(drawable: Drawable, elevation: Float): Bitmap
immediateAnimation
open fun immediateAnimation(projection: Projection, current: LatLng, target: LatLng): Boolean
normalize
open fun normalize(angle: Float): Float
Normalizes an angle to be in the [0, 360] range.
shortestRotation
open fun shortestRotation(heading: Float, previousHeading: Float): Float
Util for finding the shortest path from the current rotated degree to the new degree.

calculateZoomLevelRadius

open fun calculateZoomLevelRadius(mapboxMap: MapboxMap, location: Location): Float

generateShadow

open fun generateShadow(drawable: Drawable, elevation: Float): Bitmap

immediateAnimation

open fun immediateAnimation(projection: Projection, current: LatLng, target: LatLng): Boolean

normalize

open fun normalize(angle: Float): Float

Normalizes an angle to be in the [0, 360] range.

Return

the normalized angle

Parameters
Name Summary
angle
the provided angle
   
   

shortestRotation

open fun shortestRotation(heading: Float, previousHeading: Float): Float

Util for finding the shortest path from the current rotated degree to the new degree.

Return

the shortest degree of rotation possible

Parameters
Name Summary
heading
the new position of the rotation
previousHeading
the current position of the rotation