LocationComponentPlugin

Functions

Adds a listener that gets invoked when indicator accuracy radius changes.

Link copied to clipboard

Adds a listener that gets invoked when indicator bearing changes.

Link copied to clipboard

Adds a listener that gets invoked when indicator position changes.

Link copied to clipboard
abstract fun bind(context: Context, attrs: AttributeSet?, pixelRatio: Float)

Bind the ViewPlugin with current map context. This will create a View that will be added to the MapView.

Link copied to clipboard
open fun cleanup()

Called when the map is destroyed. Should be used to cleanup plugin resources for that map.

Link copied to clipboard

Get the current LocationProvider under usage with the LocationComponentPlugin.

Link copied to clipboard

Get current locationcomponent configuration.

Link copied to clipboard
open fun initialize()

Called when the plugin is first added to the map.

Link copied to clipboard
abstract fun isLocatedAt(point: Point, listener: PuckLocatedAtPointListener)

Check whether the rendered location puck is on the given point.

Link copied to clipboard
open fun onDelegateProvider(delegateProvider: MapDelegateProvider)

Provides all map delegate instances.

Link copied to clipboard
open fun onStart()

Called whenever activity's/fragment's lifecycle is entering a "started" state.

Link copied to clipboard
open fun onStop()

Called whenever activity's/fragment's lifecycle is entering a "stopped" state.

Link copied to clipboard
abstract fun onStyleChanged(style: MapboxStyleManager)

Called when a new Style is loaded.

Removes a listener that gets invoked when indicator accuracy radius changes.

Link copied to clipboard

Removes a listener that gets invoked when indicator bearing changes.

Link copied to clipboard

Removes a listener that gets invoked when indicator position changes.

Link copied to clipboard
abstract fun setLocationProvider(locationProvider: LocationProvider)

Set the LocationProvider, it will replace the default location provider provided by the LocationComponentPlugin.

Link copied to clipboard

Update locationcomponent configuration, the update will be applied to the plugin automatically.

Properties

Link copied to clipboard

The color of the accuracy ring border. Works for 2D location puck only. Default value: "#4d89cff0".

Link copied to clipboard
abstract var accuracyRingColor: Int

The color of the accuracy ring. Works for 2D location puck only. Default value: "#4d89cff0".

Link copied to clipboard
abstract var enabled: Boolean

Whether the user location is visible on the map. Default value: false.

Link copied to clipboard
abstract var layerAbove: String?

Sets the id of the layer that's added above to when placing the component on the map.

Link copied to clipboard
abstract var layerBelow: String?

Sets the id of the layer that's added below to when placing the component on the map.

Link copied to clipboard

Defines what the customised look of the location puck. Note that direct changes to the puck variables won't have any effect, a new puck needs to be set every time.

Link copied to clipboard
abstract var puckBearing: PuckBearing

The enum controls how the puck is oriented Default value: "heading".

Link copied to clipboard

Whether the puck rotates to track the bearing source. Default value: false.

Link copied to clipboard
abstract var pulsingColor: Int

The color of the pulsing circle. Works for 2D location puck only. Default value: "#4A90E2".

Link copied to clipboard
abstract var pulsingEnabled: Boolean

Whether the location puck is pulsing on the map. Works for 2D location puck only. Default value: false.

Link copied to clipboard
abstract var pulsingMaxRadius: Float

The maximum radius of the pulsing circle. Works for 2D location puck only. Note: Setting pulsingMaxRadius to LocationComponentConstants.PULSING_MAX_RADIUS_FOLLOW_ACCURACY will set the pulsing circle's maximum radius to follow location accuracy circle. Default value: 10.

Link copied to clipboard

Whether show accuracy ring with location puck. Works for 2D location puck only. Default value: false.

Link copied to clipboard
abstract var slot: String?

The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order.

Extensions

Link copied to clipboard

Create a AnimatableModel with the model uri and ModelPart that can be used with the location component.