Reputation: 7337
I need to prevent panning and zooming initially when loading my google map. Only when all my markers have been loaded and fitbounds called, should the user be allowed to control the view. What's the best way of toggling this?
Upvotes: 0
Views: 1993
Reputation: 12983
There are lots of map options you can set, including
-- just set to true or false as required. disableDefaultUI removes a lot of controls so they can't be used, but you still need to take care of dragging, wheel-zoom, etc.
Upvotes: 1
Reputation: 5706
When you create the map you turn off all the controls that you dont want active and then when you have added your markers you can call map.setOptions and pass in what you want to activate:
map.setOptions({
panControl: true,
zoomControl: true
});
Upvotes: 2