I am trying to change the maptype in google maps from a roadmap to a satellite when a user clicks on a marker, but I get errors. I tried:
map.setMapTypeId("SATELLITE");
or
map.setMapTypeId(SATELLITE);
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
Do you want to:
google.maps.MapTypeId.SATELLITE
which evaluates to "satellite"- but you better use the version of the API if they ever change the string constant. Full call:
"satellite"
map.setMapTypeId(google.maps.MapTypeId.SATELLITE);