sdk-maps-ui-extensions / com.tomtom.online.sdk.map.ui.currentlocation / CurrentLocationView

CurrentLocationView

interface CurrentLocationView : MapComponentView, ClickableMapComponent

The current location view api.

Types

LocationStatusListener

interface LocationStatusListener

The listener used to obtain if current location is available.

Functions

setCurrentLocationViewAdapter

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.

setLocationStatusListener

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

The listener used to obtain if current location is available.

updateViewWithLocationInPixels

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.

updateViewWithMapLocation

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

getView

abstract fun getView(): View!

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

hide

abstract fun hide(): Unit

Hides the ui component.

setMargins

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

Sets the margins of the ui component in PX.

setOnMapComponentClickCallback

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

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

show

abstract fun show(): Unit

Shows the ui component.

Inheritors

BasicCurrentLocationView

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.