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(cameraPosition: CameraPosition): Unit

Center a map by using the 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, and 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.

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 the current region as the minimum region which contains both coordinates.

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

Sets the 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 the 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.