Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: not adding by default the MapColorScheme #603

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ import kotlinx.coroutines.awaitCancellation
* @param onPOIClick lambda invoked when a POI is clicked
* @param contentPadding the padding values used to signal that portions of the map around the edges
* may be obscured. The map will move the Google logo, etc. to avoid overlapping the padding.
* @param mapColorScheme Defines the color scheme for the Map. By default it will be
* [ComposeMapColorScheme.FOLLOW_SYSTEM].
* @param mapColorScheme Defines the color scheme for the Map.
* @param content the content of the map
*/
@Composable
Expand All @@ -92,7 +91,7 @@ public fun GoogleMap(
onMyLocationClick: ((Location) -> Unit)? = null,
onPOIClick: ((PointOfInterest) -> Unit)? = null,
contentPadding: PaddingValues = DefaultMapContentPadding,
mapColorScheme: ComposeMapColorScheme = ComposeMapColorScheme.FOLLOW_SYSTEM,
mapColorScheme: ComposeMapColorScheme? = null,
content: @Composable @GoogleMapComposable () -> Unit = {},
) {
// When in preview, early return a Box with the received modifier preserving layout
Expand Down Expand Up @@ -139,7 +138,7 @@ public fun GoogleMap(
locationSource = currentLocationSource,
mapProperties = currentMapProperties,
mapUiSettings = currentUiSettings,
colorMapScheme = currentColorScheme.value
colorMapScheme = currentColorScheme?.value
)

MapClickListenerUpdater()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ internal inline fun MapUpdater(
locationSource: LocationSource?,
mapProperties: MapProperties,
mapUiSettings: MapUiSettings,
colorMapScheme: Int,
colorMapScheme: Int?,
) {
val map = (currentComposer.applier as MapApplier).map
val mapView = (currentComposer.applier as MapApplier).mapView
Expand Down Expand Up @@ -141,7 +141,11 @@ internal inline fun MapUpdater(
set(mapProperties.mapType) { map.mapType = it.value }
set(mapProperties.maxZoomPreference) { map.setMaxZoomPreference(it) }
set(mapProperties.minZoomPreference) { map.setMinZoomPreference(it) }
set(colorMapScheme) { map.mapColorScheme = it }
set(colorMapScheme) {
if (it != null) {
map.mapColorScheme = it
}
}
set(contentPadding) {
val node = this
with(this.density) {
Expand Down
Loading