@@ -16,6 +16,7 @@ package com.google.maps.android.compose
1616
1717import android.content.ComponentCallbacks
1818import android.content.ComponentCallbacks2
19+ import android.content.Context
1920import android.content.res.Configuration
2021import android.location.Location
2122import android.os.Bundle
@@ -46,12 +47,10 @@ import androidx.lifecycle.findViewTreeLifecycleOwner
4647import com.google.android.gms.maps.GoogleMapOptions
4748import com.google.android.gms.maps.LocationSource
4849import com.google.android.gms.maps.MapView
49-
5050import com.google.android.gms.maps.model.LatLng
5151import com.google.android.gms.maps.model.MapColorScheme
5252import com.google.android.gms.maps.model.PointOfInterest
5353import com.google.maps.android.compose.internal.MapsApiAttribution
54- import com.google.maps.android.compose.meta.AttributionId
5554import com.google.maps.android.ktx.awaitMap
5655import kotlinx.coroutines.CoroutineScope
5756import kotlinx.coroutines.CoroutineStart
@@ -105,6 +104,7 @@ public fun GoogleMap(
105104 onPOIClick : ((PointOfInterest ) -> Unit )? = null,
106105 contentPadding : PaddingValues = DefaultMapContentPadding ,
107106 mapColorScheme : ComposeMapColorScheme ? = null,
107+ mapViewFactory : (Context , GoogleMapOptions ) -> MapView = ::MapView ,
108108 content : @Composable @GoogleMapComposable () -> Unit = {},
109109) {
110110 // When in preview, early return a Box with the received modifier preserving layout
@@ -165,7 +165,7 @@ public fun GoogleMap(
165165 AndroidView (
166166 modifier = modifier,
167167 factory = { context ->
168- MapView (context, googleMapOptionsFactory()).also { mapView ->
168+ mapViewFactory (context, googleMapOptionsFactory()).also { mapView ->
169169 val componentCallbacks = object : ComponentCallbacks2 {
170170 override fun onConfigurationChanged (newConfig : Configuration ) {}
171171
0 commit comments