Here I'm trying to changing the color of google map into black from white but not getting a good solution. I tried it to change by using a relative layout over it but it hides that part , it doesn't change color of GoogleMap
.
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
class="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="100dp" />
Go here: https://mapstyle.withgoogle.com/
Find your style and get json for your style value and copy.
Come to your android map project resource, click-new file, add json and paste style json value like style_map.json and your map activity's onMapReady(GoogleMap googleMap)
do this:
mGoogleMap = googleMap;
MapStyleOptions mapStyleOptions = MapStyleOptions.loadRawResourceStyle(this, R.raw.style_json);
mGoogleMap.setMapStyle(mapStyleOptions);
It works for me :)
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