I’m trying to change the maptype in google maps from roadmap to satellite when a user clicks on a marker, but I’m getting errors. I’ve tried:
map.setMapTypeId("SATELLITE");
or
map.setMapTypeId(SATELLITE);
or
map.setMapTypeId(mapTypeId:Satellite);
What am I doing wrong here? This is the documentation:
http://code.google.com/apis/maps/documentation/javascript/reference.html#Map
You want:
which evaluates to
"satellite"– but you’re better off using the API version, in case they ever change the string constant. Full call: