Change Google Maps v3 mapOptions object after load
google-maps-api-3
Solution
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.
====== 2020 update - you should use:
map.setOptions({ draggable: true });
Problem
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 ``` option to ``` draggable: true ``` When an action (such as a click on a div) is triggered. Addition: I have tried loading jquery-ui-map and using: ``` $('#map').gmap('option', 'draggable', true); ``` However this seems to reload the map and forget all the other existing options. I could redefine them all, but that seems a bit hackish. Any pointers appreciated. Thanks!