How can i modify a V3 map\'s mapOptions (after the initial map has been loaded)?
Specifically, I would like to be able to flip the
draggable: false
If you have already created the map previously, you can set several options ( https://developers.google.com/maps/documentation/javascript/reference#MapOptions ) at once like this:
var myOptions = {
zoom:11,
center: new google.maps.LatLng(-34.397, 150.644),
mapTypeId: google.maps.MapTypeId.ROADMAP,
panControl: false
};
map.set(myOptions);
Google Maps JavaScript API V3.25 update
Note that map.set()
does not work in newer versions of Maps API. You have to use map.setOptions()
Source: Google Maps Reference
Found that I don't even need jQuery for this – it's already part of the Google Maps API. Simply do:
map.set('draggable', true);
Too easy! Hope it helps someone.