[OpenLayers-Dev] Bug in the maps zoomTo method since OL 2.13

Johannes Weskamm weskamm at terrestris.de
Wed Nov 27 02:17:48 PST 2013


Hi,

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 
2.13.1:

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;
m.zoomTo(1);
m.zoomTo(2);
m.zoomTo(3);
m.zoomTo(4);
m.zoomTo(5);
m.getZoom();

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:

http://dev.openlayers.org/releases/OpenLayers-2.12/examples/all-overlays.html

In 2.12, everything works as expected, but in

http://dev.openlayers.org/releases/OpenLayers-2.13/examples/all-overlays.html

or

http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/all-overlays.html

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20131127/95271658/attachment.html>


More information about the Dev mailing list