I'm using SupportMapFragment (class="com.google.android.gms.maps.SupportMapFragment") for map in my code.
When I switch my app to dark or night mode, everything are in dark except map fragment.
Is there any way to use dark mode in SupportMapFragment?
Thanks.
I'm using light mode map
I want night mode map like below
You can style your map using this styling api (night mode or any other style you want) https://developers.google.com/maps/documentation/android-sdk/styling
In the class where you have the GoogleMap object, you can use a style like this one: https://github.com/googlemaps/android-samples/blob/master/ApiDemos/java/app/src/main/res/raw/mapstyle_night.json
They even have a nice preview editor to create this json: https://mapstyle.withgoogle.com/
MapStyleOptions style = MapStyleOptions.loadRawResourceStyle(this, R.raw.mapstyle_night);
GoogleMap mMap; // assigned in onMapReady()
mMap.setMapStyle(style);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With