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

MapManipulationExtension

interface MapManipulationExtension

This interface defines map operations that allow the application of map manipulation operations, e.g., center a map on the given location, or zoom to a specific level.

Functions

centerOn

abstract fun centerOn(location: LatLng): Unit

Center map on given coordinates/

abstract fun centerOn(location: LatLng, zoomLevel: Double): Unit

Center map on given coordinates and with given zoom level. When zoom level is out of range, the minimum zoom level will be set. Zoom levels are in range [0, 20]

abstract fun centerOn(latitude: Double, longitude: Double): Unit

Center map on given latitude and longitude. Latitude and longitude is set in degrees minutes seconds format.

abstract fun centerOn(latitude: Double, longitude: Double, zoomLevel: Double): Unit

Center map on given latitude and longitude with a given zoom level. When zoom level is out of range, the minimum zoom level will be set. Zoom levels are in range [0, 20], where 0 is the whole world and 20 is the highest zoom level. Latitude and longitude is set in degrees minutes seconds format.

abstract fun centerOn(latitude: Double, longitude: Double, zoomLevel: Double, yawAngle: Int): Unit

Center map on given latitude and longitude with a given zoom level and yaw angle (map rotation). When zoom level is out of range, the minimum zoom level will be set. Zoom levels are in range [0, 20], where 0 is the whole world and 20 is the highest zoom level. Yaw angle is in range [0, 360], where 0 is north, 90 is east, 180 is south, and 270 is west. Latitude and longitude is set in degrees minutes seconds format.

abstract fun centerOn(cameraPosition: CameraPosition): Unit

Center map on using given camera position options. The required parameters for camera position are latitude and longitude (set in degrees minutes seconds format). Zoom, bearing and pitch are not mandatory, will be used once they are set.

abstract fun centerOn(cameraFocusArea: CameraFocusArea): Unit
abstract fun centerOn(cameraFocusArea: CameraFocusArea, callback: OnMapCenteredCallback!): Unit

Centers a map on the area determined by the BoundingBox defined in the CameraFocusArea. Configurable bearing and pitch are optional.

abstract fun centerOn(cameraFocusArea: CameraFocusArea, animationDuration: AnimationDuration!): Unit
abstract fun centerOn(cameraFocusArea: CameraFocusArea, animationDuration: AnimationDuration!, callback: OnMapCenteredCallback!): Unit

Centers a map on the area determined by the BoundingBox defined in the CameraFocusArea. Configurable bearing and pitch are optional. Map centering can be animated with a set time determined by the given AnimationDuration parameter.

abstract fun centerOn(cameraPosition: CameraPosition, callback: OnMapCenteredCallback!): Unit

Center the map when using the given camera position options. The required parameters for camera position are latitude and longitude (set in the degrees minutes seconds format). Zoom, bearing, and pitch are not mandatory and will be used once they are set.

centerOnMyLocation

abstract fun centerOnMyLocation(): Unit

Center map on current location. The current location is obtained using LocationSource#getLastKnownLocation() The default location source is {FusedLocationSource}, however, it may be overridden by SDK user. No action is executed when last location is null.

centerOnMyLocationWithNorthUp

abstract fun centerOnMyLocationWithNorthUp(): Unit

Center map on current location and set map orientation to north. No action is executed when last location is null.

centerOnWithDefaultZoom

abstract fun centerOnWithDefaultZoom(latitude: Double, longitude: Double): Unit

Center map on given latitude and longitude with default zoom level {@value MapConstants#DEFAULT_ZOOM_LEVEL}. Latitude and longitude is set in degrees minutes seconds format.

getCurrentBounds

abstract fun getCurrentBounds(): BoundingBox!

Gets the current region bounds.

getZoomLevel

abstract fun getZoomLevel(): Double

getZoomLevel.

getZoomLevelForBounds

abstract fun getZoomLevelForBounds(topLeft: LatLng, bottomRight: LatLng): Double

Gets zoom for the minimum region which contains both coordinates.

setCurrentBounds

abstract fun setCurrentBounds(topLeft: LatLng, bottomRight: LatLng): Unit

Sets current region as the minimum region which contains both coordinates.

abstract fun setCurrentBounds(coordinates: MutableList<LatLng!>): Unit

Sets current region as the minimum region which contains the provided coordinates.

setPadding

abstract fun setPadding(top: Double, left: Double, bottom: Double, right: Double): Unit

Sets padding for the map in pixels. Changing map padding does not have an immediate effect on the map. It will be applied with the next map operation.

abstract fun setPadding(mapPadding: MapPadding!): Unit

Sets padding for the map in pixels using MapPadding class. Changing map padding does not have an immediate effect on the map. It will be applied with the next map operation.

zoomIn

abstract fun zoomIn(): Unit

Zoom map by one level

zoomOut

abstract fun zoomOut(): Unit

Zoom out by one level

zoomTo

abstract fun zoomTo(zoomLevel: Double): Unit

Zoom the map to a requested level. Zoom levels are in the range of [0, 20]. 0 is the whole world. 20 is the highest zoom level.

Inheritors

TomtomMap

interface TomtomMap : RouteExtension, MarkerExtension, MapManipulationExtension, MapInfoExtension, MapCallbacksExtension, MapViewExtension, MarkersCallbackExtension, OverlaysCallbackExtension, RouteCallbackExtension, LocationSourceExtension, OnRequestPermissionsResultCallback, CameraCallbacksExtension

Interface that is the main entry point for all methods related to the map. TomtomMap is obtained using the MapFragment#getAsyncMap(OnMapReadyCallback) method on a MapFragment.