sdk-maps-ui-extensions / / CurrentLocationView


interface CurrentLocationView : MapComponentView, ClickableMapComponent

The current location view api.



interface LocationStatusListener

The listener used to obtain if current location is available.



abstract fun setCurrentLocationViewAdapter(adapter: CurrentLocationViewAdapter!): Unit

Set current location view adapter that will be used to e.g. propagate custom Context to display alert dialogs.


abstract fun setLocationStatusListener(listener: CurrentLocationView.LocationStatusListener!): Unit

The listener used to obtain if current location is available.


abstract fun updateViewWithLocationInPixels(zoomLevel: Double, focalPixels: PointF!, currentLocationPixels: PointF!): Unit

Centers on the current user location. Updates visibility of center on current location button using pixel difference between focal and current point. Passed zoom level determines tolerance how much map can be moved in X and Y axis before current location button hides or show again.


abstract fun updateViewWithMapLocation(userLocation: Location!, focalLatitude: Double, focalLongitude: Double): Unit

Centers on the current user location. Uses the distance between user location and focal latitude and longitude to determine when button should be shown or hidden. The epsilon is set to 0.0001. For larger zooms use CurrentLocationView#updateViewWithLocationInPixels(double, PointF, PointF) instead.

Inherited Functions


abstract fun getView(): View!

The Android's View which is used by the Map Component.


abstract fun hide(): Unit

Hides the ui component.


abstract fun setMargins(left: Int, top: Int, right: Int, bottom: Int): Unit

Sets the margins of the ui component in PX.


abstract fun setOnMapComponentClickCallback(callback: ClickableMapComponent.MapComponentClickCallback!): Unit

The callback fired when center on map component view is clicked.


abstract fun show(): Unit

Shows the ui component.



open class BasicCurrentLocationView : AppCompatImageView, CurrentLocationView, OnClickListener

Button that is used to center the map on user current location. When clicked, the map is centered on current location that is obtained from TomTom map using the TomtomMap#getCenterOfMap() method. When navigation mode is on, the behaviour is different. When the 'follow the chevron' option is turned on, the route overview is displayed. When the 'follow the chevron' option is turned off, this option is changed to on.