Fixed
Status Update
Comments
he...@gmail.com <he...@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);
});
});
ed...@google.com <ed...@google.com>
cl...@gmail.com <cl...@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)
ti...@gmail.com <ti...@gmail.com> #5
I believe this issue has been fixed a while ago by adding an 'idle' event for the Map
object.
object.
ed...@google.com <ed...@google.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
tk...@gmail.com <tk...@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!
Description
I've noticed a little bug while playing with your API.
I've built a resizable two-fold layout with a Map on one side and a Panorama on the other side (both being synchronized).
It happens that, when the map is resized, at some point the pegman jumps back to the upper left hand corner of the screen (while the panorama POV remains the same).
You can check the following JSFiddle :
* At the beginning, the Pegman is on Oleron Island, France, which is fine because it's a great destination for holidays.
* If you move the vertical bar up to 'Angouleme' city, everything is still OK (1st picture attached, pegman1.jpg).
* But when you reach 'Cognac' city, you'll notice that the Pegman jumps into the ocean (see pegman2.jpg attached)
Thanks for having a look at this.