I think I know the answer to this, but can we style a Google Map v2? By style, I mean like using the Google Maps API Styled Map Wizard (http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html) that can be used to pull JSON styling data for the JavaScript API.
Google seems to have pulled it off for Ingress, so hoping there's a way. I can't seem to find a way so I suspect Google is using inside knowledge for Ingress. Anyone know for sure?
In the Google Cloud Console, go to the Map Styles page. Select the style you want, and click Customize Style.
To style your map, call GoogleMap.setMapStyle() passing a MapStyleOptions object that contains your style declarations in JSON format. You can load the JSON from a raw resource or a string,in you mapReady() function ... so after ading he json call your map ready function will almost look like
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
try {
// Customise the styling of the base map using a JSON object defined
// in a raw resource file.
boolean success = mMap.setMapStyle(
MapStyleOptions.loadRawResourceStyle(
this, R.raw.style_json));
if (!success) {
Log.e("MapsActivityRaw", "Style parsing failed.");
}
} catch (Resources.NotFoundException e) {
Log.e("MapsActivityRaw", "Can't find style.", e);
}
}
Define a raw resource in /res/raw/style_json.json, containing the JSON style declaration for night-mode styling
You could get the json from the following Link https://mapstyle.withgoogle.com/
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