Package com.mapbox.maps.plugin.location

Types

AnimatorListenerHolder
Link copied to clipboard
open class AnimatorListenerHolder
CompassEngine
Link copied to clipboard

Interface defining the source of compass heading data that is consumed by the LocationPluginImpl when in compass related RenderMode or CameraMode s.

interface CompassEngine
LayerBitmapProvider
Link copied to clipboard
open class LayerBitmapProvider
LocationComponentActivationOptions
Link copied to clipboard

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

open class LocationComponentActivationOptions
LocationComponentCompassEngine
Link copied to clipboard

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

open class LocationComponentCompassEngine : CompassEngine, SensorEventListener
LocationComponentConstants
Link copied to clipboard

Contains all the constants being used for the LocationPluginImpl .

class LocationComponentConstants
class LocationComponentNotInitializedException : RuntimeException
LocationComponentOptions
Link copied to clipboard

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

open class LocationComponentOptions : Parcelable
LocationModelLayerOptions
Link copied to clipboard

Option class that configs and defines the default values for ModelLayerRender

data class LocationModelLayerOptions(modelUrl: String, position: List<Double>, modelScale: List<Double>, modelRotation: List<Double>, modelOpacity: Double)
LocationPlugin
Link copied to clipboard

Define the interfaces for the Location plugin.

interface LocationPlugin : MapStyleObserverPlugin, LifecyclePlugin, MapCameraPlugin
LocationPluginImpl
Link copied to clipboard

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. RenderMode.NORMAL simply shows the users location on the map represented as a dot. RenderMode.COMPASS mode allows you to display an arrow icon (by default) that points in the direction the device is pointing in. RenderMode.GPS can be used in conjunction with our Navigation SDK to display a larger icon (customized with LocationComponentOptions.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 LocationPluginImpl.setCameraMode.

** To get the component object use MapPluginProviderDelegate.getLocationPlugin 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 ACCESS_COARSE_LOCATION or 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 LocationEngineProvider.getBestLocationEngine which defaults to the com.mapbox.android.core.location.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.android.core.location.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.

class LocationPluginImpl : LocationPlugin
LocationUpdate
Link copied to clipboard

A class that contains the location update configuration.

data class LocationUpdate(location: Location, intermediatePoints: List<Location>?, animationDuration: Long?)
MapboxAnimator
Link copied to clipboard

Abstract class for all of the location component animators.

abstract class MapboxAnimator<K> : ValueAnimator, ValueAnimator.AnimatorUpdateListener
MapboxAnimatorListener
Link copied to clipboard
open class MapboxAnimatorListener : AnimatorListenerAdapter
MapboxFloatAnimator
Link copied to clipboard
open class MapboxFloatAnimator : MapboxAnimator<Float>
MapboxLatLngAnimator
Link copied to clipboard
open class MapboxLatLngAnimator : MapboxAnimator<Point>
MapboxPaddingAnimator
Link copied to clipboard

Mapbox animator for padding property.

open class MapboxPaddingAnimator : MapboxAnimator<Array<Double>>
OnIndicatorPositionChangedListener
Link copied to clipboard

Listener that gets invoked when indicator position changes.

fun fun interface OnIndicatorPositionChangedListener
PaddingEvaluator
Link copied to clipboard
open class PaddingEvaluator : TypeEvaluator<Array<Double>>
PointEvaluator
Link copied to clipboard
open class PointEvaluator : TypeEvaluator<Point>
PulsingLocationCircleAnimator
Link copied to clipboard

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

open class PulsingLocationCircleAnimator : MapboxFloatAnimator
StaleStateManager
Link copied to clipboard

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.

open class StaleStateManager
Utils
Link copied to clipboard

Location utils.

class Utils

Functions

getLocationPlugin
Link copied to clipboard

Extension function to the the LocationComponentPlugin instance.