Fixed
Status Update
Comments
ms...@gmail.com <ms...@gmail.com> #2
not sure if this is a bug or the intended behaviour
this is a way to get the new bounds
zoomChangeListener = google.maps.event.addListener(map,'zoom_changed',function (event) {
zoomChangeBoundsListener = google.maps.event.addListener(map,'bounds_changed',function (event) {
console.log(map.get_bounds());
google.maps.event.removeListener(zoomChangeBoundsListener);
});
});
this is a way to get the new bounds
zoomChangeListener = google.maps.event.addListener(map,'zoom_changed',function (event) {
zoomChangeBoundsListener = google.maps.event.addListener(map,'bounds_changed',function (event) {
console.log(map.get_bounds());
google.maps.event.removeListener(zoomChangeBoundsListener);
});
});
pa...@gmail.com <pa...@gmail.com> #3
Not sure- I'll discuss with team.
st...@gmail.com <st...@gmail.com> #4
Quoted from http://code.google.com/apis/maps/documentation/v3/events.html :
Note: If you are trying to detect a change in the viewport, be sure to use the
specific bounds_changed event rather than constituent zoom_changed and center_changed
events. Because the Maps API fires these latter events independently, getBounds() may
not report useful results until after the viewport has authoritatively changed. If
you wish to getBounds() after such an event, be sure to listen to the bounds_changed
event instead.
It seems like this is the intended behaviour (at least in API V3)
Note: If you are trying to detect a change in the viewport, be sure to use the
specific bounds_changed event rather than constituent zoom_changed and center_changed
events. Because the Maps API fires these latter events independently, getBounds() may
not report useful results until after the viewport has authoritatively changed. If
you wish to getBounds() after such an event, be sure to listen to the bounds_changed
event instead.
It seems like this is the intended behaviour (at least in API V3)
da...@google.com <da...@google.com> #5
I believe this issue has been fixed a while ago by adding an 'idle' event for the Map
object.
object.
to...@gmail.com <to...@gmail.com> #6
I don't understand comment #4 . The issue is NOT fixed, it's still present.
This is clearly a bug, because the map is in inconsistent state when zoom_changed handler is called - the zoom is the new one, but the bounds are still the old ones!!! This should never happen!
Thanks for workaround in comment #1 , this seems to be the only way how one can get the bounds in the zoom_changed event. But this is not a clean way, the issue should be fixed!!!
This is clearly a bug, because the map is in inconsistent state when zoom_changed handler is called - the zoom is the new one, but the bounds are still the old ones!!! This should never happen!
Thanks for workaround in
to...@gmail.com <to...@gmail.com> #7
ad comment #3 - using bounds_changed event instead of zoom_changed in this case is nonsense. It will fire at any occasion when bounds are changed, but here we are only interested in cases when the zoom is changed!
jo...@gmail.com <jo...@gmail.com> #8
ad comment #5 totally agree, cause bounds_changed event is fired after a zoom_changed event :( so that there is no way to get correct bounds when the zoom_changed occurs.
bounds_changed is not handy event because it is fired whenever viewport has changed and a user is moving map all around without releasing the drag mode. In this state (while dragging) I'm not interested in bounds_chaned event. Please can anyone confirm that this is really a bug? IMHO it is :(
bounds_changed is not handy event because it is fired whenever viewport has changed and a user is moving map all around without releasing the drag mode. In this state (while dragging) I'm not interested in bounds_chaned event. Please can anyone confirm that this is really a bug? IMHO it is :(
jo...@gmail.com <jo...@gmail.com> #9
I'm using idle event that is sufficient for my needs and this is the only event I use instead of both the dragend and zoom_chaned events.
pa...@gmail.com <pa...@gmail.com> #10
#8: idle fires when you resize map, while zoom_changed/dragend do not.
cb...@google.com <cb...@google.com>
cb...@google.com <cb...@google.com>
ms...@googlemail.com <ms...@googlemail.com> #11
Status: Fixed? The issue is not fixed, it's still present.
sl...@gmail.com <sl...@gmail.com> #13
So this bug is not fixed for almost 8 years??? I'm using version 3.25
hy...@gmail.com <hy...@gmail.com> #14
Well it's beta software? ain't it? :-D
re...@gmail.com <re...@gmail.com> #15
Any update on this? I'm having the same problem. Took me 3 days of work to figure out this is what's causing the problem.
Description
google.maps.event.addListener(map,'zoom_changed',function (event) {
console.log(map.get_bounds());
});
will return the bounds before the zoom change rather than after