Reputation: 373
I use fitBounds to update the area a map views, based on new GeoJson data. As soon as a user zooms or drags the map I want to disable the automatic "fitBounds" functionality.
Is there general way of detecting that user interaction caused a change in the viewport?
Thanks so much, for the answers.
Upvotes: 2
Views: 1296
Reputation: 22488
The only event that will fire "as soon as a user zooms or drags the map" is the bounds_changed
event.
You can try all events here: https://developers.google.com/maps/documentation/javascript/events
And you can refer to the documentation here: https://developers.google.com/maps/documentation/javascript/reference#Map
google.maps.event.addListener(map, 'bounds_changed', function() {
// Do what you want here...
});
Upvotes: 3