I have a v3 Google map initialised as a ROADMAP that I want to change to a HYBRID map on a particular click event being handled by a jQuery function:
$('#cft').click(function() {
map.setCenter($cft);
map.setZoom(18);
map.setMapType(HYBRID);
return false;
});
On click the map recenters and zooms as required but the mapType remains a ROADMAP so clearly this syntax doesn't work!
Is there a method like the above that does, or do I have to initialise a new map?
try this:
map.setMapTypeId(google.maps.MapTypeId.HYBRID);
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