MapOptions

constructor(mapKey: String, initialCameraOptions: InitialCameraOptions, padding: Padding = Padding(), mapStyle: StyleDescriptor? = null, styleMode: StyleMode = StyleMode.MAIN, onlineCachePolicy: OnlineCachePolicy = OnlineCachePolicy.Default, renderToTexture: Boolean = false)

The MapOptions class configures initial behavior and visual style of the map. It enables setting the default zoom level, the map language, style and more. The MapOptions is used as an argument for MapFragment.newInstance, which instantiates MapFragment object.

val mapOptions = MapOptions(mapKey = "YOUR_TOMTOM_API_KEY",
initialCameraOptions = InitialCameraOptions(position = GeoPoint(0.0, 0.0)))
val mapFragment = MapFragment.newInstance(mapOptions)

constructor(mapKey: String, cameraOptions: CameraOptions? = null, padding: Padding = Padding(), mapStyle: StyleDescriptor? = null, styleMode: StyleMode = StyleMode.MAIN, onlineCachePolicy: OnlineCachePolicy = OnlineCachePolicy.Default, renderToTexture: Boolean = false)

Deprecated

This will be removed from future releases after 2026-07-26. Use MapOptions(mapKey, initialCameraOptions, padding, mapStyle, styleMode, onlineCachePolicy, renderToTexture) constructor instead.