sdk-maps / com.tomtom.online.sdk.map / LocationSourceExtension

LocationSourceExtension

interface LocationSourceExtension

Interface to provide location data for TomtomMap object. A TomtomMap has a built-in location provider based on FusedLocation from Google Play Services. However, the user can provide custom location provider and override the default implementation.

Functions

addLocationUpdateListener

abstract fun addLocationUpdateListener(locationUpdateListener: LocationUpdateListener): Unit

Add location update listener. When using this method, you shoud remember to unregister using LocationSourceExtension#removeLocationUpdateListener(LocationUpdateListener).

getDefaultLocationSource

abstract fun getDefaultLocationSource(): LocationSource

Default location source implementation. This method creates a new instance that can be used by user.

getLocationSource

abstract fun getLocationSource(): LocationSource

Location source provide information about map location. LocationSource is registered in onResume and unregister in onPause method.

removeLocationUpdateListener

abstract fun removeLocationUpdateListener(locationUpdateListener: LocationUpdateListener): Unit

Remove location update listener.

setLocationSource

abstract fun setLocationSource(locationSource: LocationSource): Unit

Set for map location source. Map take from location source information about location of chevron.

Inheritors

TomtomMap

interface TomtomMap : RouteExtension, MarkerExtension, MapManipulationExtension, MapInfoExtension, MapCallbacksExtension, MapViewExtension, MarkersCallbackExtension, OverlaysCallbackExtension, RouteCallbackExtension, LocationSourceExtension, OnRequestPermissionsResultCallback, CameraCallbacksExtension

Interface that is the main entry point for all methods related to the map. TomtomMap is obtained using the MapFragment#getAsyncMap(OnMapReadyCallback) method on a MapFragment.