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

MarkerSettings

interface MarkerSettings : MarkerExtension, MarkersCallbackExtension, Persistable, TomtomMapCallback.OnMapTapListener, TomtomMapCallback.OnMapChangedListener

Advanced settings for markers manipulation. To obtain this interface, call TomtomMap.getMarkerSettings

Properties

defaultOnMapDragListener

abstract val defaultOnMapDragListener: TomtomMapCallback.OnMapDragListener

markerBalloonViewAdapter

abstract var markerBalloonViewAdapter: BalloonViewAdapter<out MarkerBalloon?, Marker?>?

Set adapter for marker balloons. Override BalloonViewAdapter.onCreateView to inflate balloon view. Override BalloonViewAdapter.getBalloonView to bind view with marker view model.

selectedMarker

abstract val selectedMarker: Collection<Marker>

Get list of selected markers. In default implementation list should be empty or with one element

Functions

areMarkersActive

abstract fun areMarkersActive(): Boolean

Indicates whether any markers are added on the map or not.

moveMarker

abstract fun moveMarker(marker: Marker, newPosition: LatLng): Unit

Move marker to new position.

setDefaultBehaviorWhenSelected

abstract fun setDefaultBehaviorWhenSelected(defaultBehaviorWhenSelected: OnMarkerSelectedListener): Unit

Marker can be selected and deselected by user by touch events or programmatically. Marker is selected when user tap on marker icon, other markers then are deselected. Markers are deselected when user tap on map. Default implementation shows popup when marker is selected.

setDefaultIconWhenNotDefinedByUser

abstract fun setDefaultIconWhenNotDefinedByUser(defaultIcon: Icon): Unit

Set default marker icon for application.

setMarkersClustering

abstract fun setMarkersClustering(enabled: Boolean): Unit

Turn on / off markers clustering. By default, clustering is not enabled.

abstract fun setMarkersClustering(enabled: Boolean, radius: Int, maxZoom: Int): Unit

Turn on / off markers clustering and provide custom parameters to customize the algorithm. By default, clustering is not enabled, maximum zoom level is set to 16 and radius is set to 50.

updateMarkerIcon

abstract fun updateMarkerIcon(marker: Marker, icon: Icon): Unit

Update marker icon with a new one.

zoomToMarkers

abstract fun zoomToMarkers(markers: List<Marker>): Unit

Zoom to map markers. Map bounding box is calculated in a way that all markers are visible.

Inherited Functions

addMarker

abstract fun addMarker(markerBuilder: MarkerBuilder!): Marker

Add marker to map.

addOnMarkerClickListener

abstract fun addOnMarkerClickListener(listener: TomtomMapCallback.OnMarkerClickListener!): Unit

Called to add a listener for marker clicks.

addOnMarkerDragListener

abstract fun addOnMarkerDragListener(listener: TomtomMapCallback.OnMarkerDragListener!): Unit

Called to add a listener for marker dragging.

findMarkerByID

abstract fun findMarkerByID(id: Long): Optional<Marker!>

Find marker using its id.

findMarkerByPosition

abstract fun findMarkerByPosition(location: LatLng!): Optional<Marker!>

Find marker using its location (latitude, longitude).

findMarkerByTag

abstract fun findMarkerByTag(tag: Serializable): Optional<Marker!>

Find marker using its tag.

getMarkers

abstract fun getMarkers(): MutableList<Marker!>

Get list of all markers added to map. Even marker which already not visible on map.

onCameraDidChange

abstract fun onCameraDidChange(): Unit

Called when the new camera parameters are loaded.

onCameraIsChanging

abstract fun onCameraIsChanging(): Unit

Called when the map camera is changing.

onCameraWillChange

abstract fun onCameraWillChange(): Unit

Called when the map is about to change the camera parameters.

onDidFailLoadingMap

abstract fun onDidFailLoadingMap(): Unit

Called when the map style has failed to load.

onDidFinishInitializingMap

abstract fun onDidFinishInitializingMap(): Unit

Called when the map has been loaded and is ready to use.

onDidFinishLoadingMap

abstract fun onDidFinishLoadingMap(): Unit

Called when the map has been loaded, including tiles. However, in Offline mode when tiles are not loaded, the load event is not triggered.

onDidFinishLoadingStyle

abstract fun onDidFinishLoadingStyle(): Unit

Called when the map style has been loaded. This event triggers an OnMapReady callback.

onDidFinishRenderingFrame

abstract fun onDidFinishRenderingFrame(): Unit

Called when the map frame has been rendered.

onDidFinishRenderingMap

abstract fun onDidFinishRenderingMap(): Unit

Called when the map has been rendered.

onMapLongTap

abstract fun onMapLongTap(x: Float!, y: Float!): Unit

TomtomMapCallback.OnMapLongClickListener#onMapLongClick(LatLng)

onMapTap

abstract fun onMapTap(x: Float!, y: Float!): Unit

TomtomMapCallback.OnMapClickListener#onMapClick(LatLng)

onSourceChanged

abstract fun onSourceChanged(): Unit

Called when the source for the map style has been changed.

onViewStateRestored

abstract fun onViewStateRestored(savedState: MapState!): Unit

Called internally to restore state, e.g., when the app is resumed from the background.

onViewStateSave

abstract fun onViewStateSave(outState: MapState!): Unit

Called internally to save state, e.g., when the app is going to the background.

onWillStartLoadingMap

abstract fun onWillStartLoadingMap(): Unit

Called when the map is about to load a new style.

onWillStartRenderingFrame

abstract fun onWillStartRenderingFrame(): Unit

Called when the map is about to render a new frame.

onWillStartRenderingMap

abstract fun onWillStartRenderingMap(): Unit

Called when the map is about to render.

removeMarker

abstract fun removeMarker(marker: Marker!): Unit

Remove selected marker, if added to the map.

removeMarkerByID

abstract fun removeMarkerByID(id: Long): Unit

Remove marker by marker id. Because id is unique, method should remove one marker.

removeMarkerByTag

abstract fun removeMarkerByTag(tag: Serializable!): Unit

Remove all markers with tag.

removeMarkers

abstract fun removeMarkers(): Unit

Remove all markers from the map.

removeOnMarkerClickListener

abstract fun removeOnMarkerClickListener(listener: TomtomMapCallback.OnMarkerClickListener!): Unit

Called to remove a listener for marker clicks.

removeOnMarkerClickListeners

abstract fun removeOnMarkerClickListeners(): Unit

Remove all registered marker click listeners.

removeOnMarkerDragListener

abstract fun removeOnMarkerDragListener(listener: TomtomMapCallback.OnMarkerDragListener!): Unit

Called to remove a listener for marker dragging.

removeOnMarkerDragListeners

abstract fun removeOnMarkerDragListeners(): Unit

Remove all registered marker drag listeners.

zoomToAllMarkers

abstract fun zoomToAllMarkers(): Unit

Zoom map to level where all markers are visible.