Ivan Abragimovich
unread,Sep 13, 2010, 10:48:47 AM9/13/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Maps JavaScript API v3
Hi, all.
I found strange behavior of 'setCenter' and 'panBy' function.
When i add event handler to 'zoom_changed' event, something like this:
google.maps.event.addListener(map, 'zoom_changed', function() {
map.panBy(300, 300);
});
Code above doesn't work.
But if I use 'setTimeout' function like this:
google.maps.event.addListener(map, 'zoom_changed', function() {
setTimeout(moveMap, 10);
});
function moveMap() {
map.panBy(300, 300);
}
This code works fine.
Could anybody explain me, why first code snippet doesn't work?
P.S. Sorry for my terrible English.