[OpenLayers-Dev] Bug in the maps zoomTo method since OL 2.13
ahocevar at boundlessgeo.com
Wed Nov 27 04:14:02 PST 2013
With your above example, your zoom level when you call map.getZoom() will
be something between 0 and 5. This is because map.zoomTo() is asynchronous
now, at least when a zoomMethod is configured for the map.
So instead of calling getZoom() directly, you should register for a zoomend
listener and call getZoom() there.
On Wed, Nov 27, 2013 at 11:17 AM, Johannes Weskamm <weskamm at terrestris.de>wrote:
> I think i found a bug in the zoomTo Method of the map, while investigating
> an issue in geoext 2 ( https://github.com/geoext/geoext2/issues/205).
> The problem seems to be introduced since OL 2.13 and is also occuring in
> When you zoom the map with the zoomTo Method multiple times in a row, the
> result will be confusing.
> To be exact, it will not be the last zoomValue you have given to the
> method, instead it will become e.g. 0.
> Here is the simple code which i used to test the behaviour:
> m = map;
> The result of the last line should return a value of 5. But since OL 2.13,
> it returns 0 or some other non-correct value.
> I checked this with the official examples of OL 2.12, 2.13 and 2.13.1:
> In 2.12, everything works as expected, but in
> it does not, like described above.
> A first finding is that when you use "zoomMethod: null" on map
> instanciation, the problem disappears. So this bug could have something
> todo with the " zoomTween" on the map. Maybe someone could have a detailed
> look at this?
> Best regards,
> Johannes Weskamm
> Dev mailing list
> Dev at lists.osgeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Dev