That was the second solution i tried... That doesn't work because changing
the draggable property after the dragstart event occurs and while dragging
don't interrupt the dragging process.
That attribute allows the API core to intercepts the dragstart event and
prevent it.
The fact is that gmap API allows events to be detected but not prevented :
in user's code, returning false when dragstart if fired dont't prevent the
dragging process to start.
As info my code was looking like this :
google.maps.event.addListener(map, 'zoom_changed', function() {
map.setOptions({draggable:false});
if(dragLockTimer) window.clearTimeout(dragLockTimer);
dragLockTimer = setTimeout(function(){
map.setOptions({draggable:true}); },300);
});
So... Don't waste your time with that solution, it doesn't work
The only solution i still have in mind is really ugly :
Would be something like that (not even tested) :
var center;
var zooming = false;
google.maps.event.addListener(map, 'zoom_changed', function() {
zooming = true;
center = map.getCenter();
if(dragLockTimer) window.clearTimeout(dragLockTimer);
dragLockTimer = setTimeout(function(){ map.setCenter(center);
},100);
});
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-maps-js-api-v3/-/7Pt-UIroiiEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.