fix(maps-compose): apply mapColorScheme to GoogleMapOptions during MapView creation - #976
Merged
Merged
Conversation
dkhawk
force-pushed
the
fix/terrain-dark-mode-map-color-scheme
branch
from
August 21, 2026 16:16
8bb89cd to
422622f
Compare
dkhawk
force-pushed
the
fix/terrain-dark-mode-map-color-scheme
branch
5 times, most recently
from
August 21, 2026 17:40
01754fc to
d84fc14
Compare
…pView creation GoogleMap() currently only applies mapColorScheme via map.setMapColorScheme() after getMapAsync() completes. However, the Maps SDK's terrain renderer only respects FOLLOW_SYSTEM/DARK when it is present in GoogleMapOptions at MapView creation time; calling setMapColorScheme() later on an already-initialized terrain map with custom MapStyleOptions fails to trigger dark terrain shaders. This change updates AndroidView's factory in GoogleMap.kt to automatically populate GoogleMapOptions.mapColorScheme from the mapColorScheme parameter if it has not been explicitly configured in googleMapOptionsFactory (where 0 / MapColorScheme.LIGHT is the Java int default). Also fixes GoogleMapViewTests.kt to replace vacuous tests (which asserted against a test-local variable) with real assertions against the GoogleMapOptions passed to mapViewFactory, and adds a test verifying that an explicitly configured googleMapOptionsFactory is not overwritten. Verified via ./gradlew :maps-compose:compileDebugKotlin and test suite.
dkhawk
force-pushed
the
fix/terrain-dark-mode-map-color-scheme
branch
from
August 21, 2026 17:41
d84fc14 to
bcceb4b
Compare
Contributor
Code Coverage
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GoogleMap() currently applies mapColorScheme via map.setMapColorScheme() only after getMapAsync() completes. However, the Maps SDK's terrain renderer only respects FOLLOW_SYSTEM/DARK when it is present in GoogleMapOptions at MapView creation time; calling setMapColorScheme() later on an already-initialized terrain map with custom MapStyleOptions fails to trigger dark terrain shaders.
This change updates AndroidView's factory in GoogleMap.kt to automatically populate GoogleMapOptions.mapColorScheme from the mapColorScheme parameter if it has not been explicitly configured in googleMapOptionsFactory.
Also fixes GoogleMapViewTests.kt to replace vacuous tests (which asserted against a test-local variable) with real assertions against the GoogleMapOptions passed to mapViewFactory, and adds a test verifying that an explicitly configured googleMapOptionsFactory is not overwritten.
Verified via ./gradlew :maps-compose:compileDebugKotlin and test suite.