MapView

fun MapView(context: Context, mapInitOptions: MapInitOptions = MapInitOptions(context))

Build a MapView with Context and MapInitOptions objects.

Parameters

context

a visual context (Activity, WindowContext, or DisplayContext) used to initialise the default MapInitOptions. On API 30+, a non-visual context (e.g. applicationContext) disables VRR/refresh-rate monitoring and locks the map to 60 fps on high-refresh-rate displays.

mapInitOptions

the init options for map


fun MapView(context: Context, attrs: AttributeSet?)

Build a MapView with Context and AttributeSet objects.

Parameters

context

a visual context (Activity, WindowContext, or DisplayContext). On API 30+, a non-visual context (e.g. applicationContext) disables VRR/refresh-rate monitoring and locks the map to 60 fps on high-refresh-rate displays.

attrs

the attribute set to initialise the MapView with


fun MapView(context: Context, attrs: AttributeSet?, defStyleAttr: Int)

Build a MapView with a Context object, a AttributeSet object, and an Int which represents a style resource file.

Parameters

context

a visual context (Activity, WindowContext, or DisplayContext). On API 30+, a non-visual context (e.g. applicationContext) disables VRR/refresh-rate monitoring and locks the map to 60 fps on high-refresh-rate displays.

attrs

the attribute set to initialise the MapView with

defStyleAttr

the default style attribute resource to apply to this MapView