LocationComponentPlugin

Define the interfaces for the Location plugin.

Functions

addOnIndicatorBearingChangedListener
Link copied to clipboard
abstract fun addOnIndicatorBearingChangedListener(listener: OnIndicatorBearingChangedListener)

Adds a listener that gets invoked when indicator bearing changes.

addOnIndicatorPositionChangedListener
Link copied to clipboard
abstract fun addOnIndicatorPositionChangedListener(listener: OnIndicatorPositionChangedListener)

Adds a listener that gets invoked when indicator position changes.

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

cleanup
Link copied to clipboard
open fun cleanup()

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

getLocationProvider
Link copied to clipboard
abstract fun getLocationProvider(): LocationProvider?

Get the current LocationProvider under usage with the LocationComponentPlugin.

getSettings
Link copied to clipboard
abstract fun getSettings(): LocationComponentSettings

Get current locationcomponent configuration.

initialize
Link copied to clipboard
open fun initialize()

Called when the plugin is first added to the map.

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

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

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

Provides all map delegate instances.

onStart
Link copied to clipboard
open fun onStart()

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

onStop
Link copied to clipboard
open fun onStop()

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

onStyleChanged
Link copied to clipboard
abstract fun onStyleChanged(styleDelegate: StyleInterface)

Called when a new Style is loaded.

removeOnIndicatorBearingChangedListener
Link copied to clipboard
abstract fun removeOnIndicatorBearingChangedListener(listener: OnIndicatorBearingChangedListener)

Removes a listener that gets invoked when indicator bearing changes.

abstract fun removeOnIndicatorPositionChangedListener(listener: OnIndicatorPositionChangedListener)

Removes a listener that gets invoked when indicator position changes.

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

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

updateSettings
Link copied to clipboard
abstract fun updateSettings(block: LocationComponentSettings.() -> Unit)

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

Properties

enabled
Link copied to clipboard
abstract var enabled: Boolean

Whether the user location is visible on the map.

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

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

locationPuck
Link copied to clipboard
abstract var locationPuck: LocationPuck

Defines what the customised look of the location puck.

pulsingColor
Link copied to clipboard
abstract var pulsingColor: Int

The color of the pulsing circle. Works for 2D location puck only.

pulsingEnabled
Link copied to clipboard
abstract var pulsingEnabled: Boolean

Whether the location puck is pulsing on the map. Works for 2D location puck only.

pulsingMaxRadius
Link copied to clipboard
abstract var pulsingMaxRadius: Float

The maximum radius of the pulsing circle. Works for 2D location puck only.

Inheritors

LocationComponentPlugin2
Link copied to clipboard

Extensions

createDefault2DPuck
Link copied to clipboard
fun LocationComponentPlugin.createDefault2DPuck(context: Context, withBearing: Boolean = false): LocationPuck2D

Create a LocationPuck2D instance with or without an arrow bearing image.