TomTomMap
This is the main entry point for all methods related to the map. TomTomMap can be obtained via the MapFragment or the MapView, using getMapAsync() method.
You should call methods on TomTomMap from the main thread. Otherwise an exception can occur.
Important: This is a Public Preview API. It may be changed or removed at any time.
Types
Functions
Registers the CameraChangeListener that will be notified about any change of the camera properties.
Registers the CameraSteadyListener that will be notified when the camera becomes steady after applying changes on its properties.
Adds a new Circle based on the given CircleOptions
Registers the CircleClickListener that will be notified about any circle being clicked. The clicked Circle becomes a parameter of the CircleClickListener.onCircleClicked callback.
Registers LocationMarkerClickListener that will be notified about the click (aka tap) gesture recognized on the location marker. Both, the clicked position on the screen and the underlying location on the map, become parameters of the LocationMarkerClickListener.onLocationMarkerClick callback.
Registers MapClickListener which is notified when the map has been clicked (tapped).
Registers MapDoubleClickListener which is notified when the map double click (double tap) gesture has been recognized.
Registers MapLongClickListener which is notified when the map long click (long press) gesture has been recognized.
Registers MapPanningListener which is notified when user performs the panning gesture on the map.
Adds a new Marker based on the given MarkerOptions.
Registers MarkerClickListener that will be notified about any Marker being clicked. The clicked Marker becomes a parameter of the MarkerClickListener.onMarkerClicked callback.
Registers MarkerLongClickListener that will be notified about the long press gesture recognized on the Marker. The clicked Marker becomes a parameter of the MarkerLongClickListener.onMarkerLongClicked callback.
Registers MarkerLongClickListener that will be notified when marker is selected or deselected. The selected Marker becomes a parameter of the MarkerSelectionListener.onMarkerSelectedStateChanged callback.
Adds a new Polygon based on the given PolygonOptions.
Registers the PolygonClickListener that will be notified about any Polygon being clicked. The clicked Polygon becomes a parameter of the PolygonClickListener.onPolygonClicked callback.
Create new PolygonOverlay using provided options.
Adds a new Polyline based on the given PolylineOptions.
Registers the PolylineClickListener that will be notified about any Polyline being clicked. The clicked Polyline becomes a parameter of the PolylineClickListener.onPolylineClicked callback.
Adds a new Route based on the given RouteOptions
Registers RouteClickListener that will be notified about any route being clicked. The clicked Route becomes a parameter of the RouteClickListener.onRouteClick callback.
Add TrafficIncidentClickListener that will be notified when user taps on the traffic incident on the map.
Moves the camera according to the given CameraOptions and animates the transition.
Allows to change the default gesture detection behaviour. For example invocation of this method with the following parameters: setExclusiveGestures(GestureType.Rotation, setOf(GestureType.Scale)) results in GestureType.Rotation being ignored if its not already ongoing before GestureType.Scale.
Disables the location marker so it becomes inactive and invisible.
Enables the location marker based on the supplied LocationMarkerOptions, replacing any existing location marker already visible. The location marker visualizes the users location on the map and can be of three types: CHEVRON: A vehicle position indicator primarily for use in turn-by-turn guidance. POINTER: A user location pointer, primarily for use in browsing or pedestrian modes. CUSTOM: A customizable model supplied by the developer.
Gets the map copyright contents synchronously.
Gets the map copyright contents asynchronously.
Gets the currently set LocationProvider or returns null if none is set.
Provides the Result that contains VisibleRegion or InternalFailure, where VisibleRegion is currently visible region. If the map is completely zoomed out, this property will return four GeoPoints, which are combination of min/max latitude and longitude ranges. InternalFailure is returned if some of four coordinates are invalid and it is not possible to obtain a coordinate.
Hide hill shading layer.
Hides all traffic flow
Hides all traffic incidents
Hides vehicle restrictions layers.
Loads new map style. Provided callback is called once operation finishes with either success or failure.
Immediately moves camera according to the given CameraOptions.
Converts a position on the map into the MapView point.
Removes the CameraChangeListener.
Removes the CameraSteadyListener.
Removes the CircleClickListener.
Removes the LocationMarkerClickListener.
Removes the MapClickListener.
Removes the MapDoubleClickListener.
Removes the MapLongClickListener.
Removes the MapPanningListener.
Removes the MarkerClickListener.
Removes the MarkerLongClickListener.
Removes all Marker elements with provided tag from the map.
Removes the MarkerSelectionListener.
Removes the PolygonClickListener.
Removes all PolygonOverlay elements from the map.
Removes the PolylineClickListener.
Removes the RouteClickListener.
Removes all previously added routes.
Remove TrafficIncidentClickListener.
Gets rendered features within a given bounding box.
Gets rendered features at a given coordinate.
Replaces the list of DataProvider used as alternative sources of tiles.
Applies a frame rate cap on the map renderer. It can be useful for scenarios where the map is not fully visible to the user hence there is no need to render it with its full performance.
Sets map language. If requested locale is not supported, the map will fall back to NGT (Neutral Ground Truth), that means official languages for all regions in local scripts if available.
Sets new LocationProvider. Location marker position is then set based on updates that are received from that engine.
Sets padding on the map. For the map, the padding means a safe area of the MapView which does not receive any input from the user. The safe area can be useful for some sections of the user interface displaying UI components like buttons, sliders etc.
Configures style mode. See StyleMode for more info.
Shows hill shading layer in the current style.
Shows all traffic flow
Shows all traffic incidents
Shows vehicle restrictions layers if hidden previously.
Shows vehicle restriction for given vehicle. It is required that StandardStyles.VEHICLE_RESTRICTIONS is set.
Updates vehicle. If StandardStyles.VEHICLE_RESTRICTIONS is selected restrictions will be visible.
Zooms the map to display all markers added to the map.
Zooms the map to display all markers with provided tag.
Zooms the map do display markers from the given list.
Updates camera view to fit all route points.
Updates camera view to fit all route points, plus additional padding.