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.
Functions
Adds a new Circle based on the given CircleOptions
Adds a new Marker based on the given MarkerOptions.
Registers the OnCameraChangeListener that will be notified about any change of the camera properties.
Registers the OnCameraSteadyListener that will be notified when the camera becomes steady after applying changes on its properties.
Registers the OnCircleClickListener that will be notified about any circle being clicked. The clicked Circle becomes a parameter of the OnCircleClickListener.onCircleClicked callback.
Registers OnLocationMarkerClickListener 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 OnLocationMarkerClickListener.onLocationMarkerClick callback.
Registers OnMapClickListener which is notified when the map has been clicked (tapped).
Registers OnMapDoubleClickListener which is notified when the map double click (double tap) gesture has been recognized.
Registers OnMapLongClickListener which is notified when the map long click (long press) gesture has been recognized.
Registers OnMapPanningListener which is notified when user performs the panning gesture on the map.
Registers OnMarkerClickListener that will be notified about any Marker being clicked. The clicked Marker becomes a parameter of the OnMarkerClickListener.onMarkerClicked callback.
Registers OnMarkerLongClickListener that will be notified about the long press gesture recognized on the Marker. The clicked Marker becomes a parameter of the OnMarkerLongClickListener.onMarkerLongClicked callback.
Registers OnMarkerLongClickListener that will be notified when marker is selected or deselected. The selected Marker becomes a parameter of the OnMarkerSelectedListener.onMarkerSelectedStateChanged callback.
Registers the OnPolygonClickListener that will be notified about any Polygon being clicked. The clicked Polygon becomes a parameter of the OnPolygonClickListener.onPolygonClicked callback.
Registers the OnPolylineClickListener that will be notified about any Polyline being clicked. The clicked Polyline becomes a parameter of the OnPolylineClickListener.onPolylineClicked callback.
Registers OnRouteClickListener that will be notified about any route being clicked. The clicked Route becomes a parameter of the OnRouteClickListener.onRouteClick callback.
Add OnTrafficIncidentClickListener that will be notified when user taps on the traffic incident on the map.
Adds a new Polygon based on the given PolygonOptions.
Create new PolygonOverlay using provided options.
Adds a new Polyline based on the given PolylineOptions.
Adds a new Route based on the given RouteOptions
Moves the camera according to the given CameraOptions and animates the transition.
Provides the current CameraPosition.
Provides the current CameraTrackingMode.
Changes the CameraTrackingMode.
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 LocationEngine or returns null if none is set.
Hides all traffic flow
Hides all traffic incidents
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 all polylines, polygons and circles from the map.
Removes all Circle elements from the map.
Removes all Marker elements from the map.
Removes the OnCameraChangeListener.
Removes the OnCameraSteadyListener.
Removes the OnCircleClickListener.
Removes the OnLocationMarkerClickListener.
Removes the OnMapClickListener.
Removes the OnMapDoubleClickListener.
Removes the OnMapLongClickListener.
Removes the OnMapPanningListener.
Removes the OnMarkerClickListener.
Removes the OnMarkerLongClickListener.
Removes the OnMarkerSelectedListener.
Removes the OnPolygonClickListener.
Removes the OnPolylineClickListener.
Removes the OnRouteClickListener.
Remove OnTrafficIncidentClickListener.
Removes all PolygonOverlay elements from the map.
Removes all Polygon elements from the map.
Removes all Polyline elements from the map.
Removes all previously added routes.
Gets rendered features within a given bounding box.
Gets rendered features at a given coordinate.
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 as IETF language tag.
Sets new LocationEngine. 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 all traffic flow
Shows all traffic incidents
Zooms the map to display all markers added to the map.
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.
Properties
Provides the Result that contains VisibleRegion or InvalidRegionException, where VisibleRegion is currently visible region. If the map is completely zoomed out, this property will return four GeoCoordinates, which are combination of min/max latitude and longitude ranges. InvalidRegionException is returned if some of four coordinates is invalid and it is not possible to obtain a coordinate.