[OpenLayers-Users] Viewport pixel and lonlat transformation problem

maven apache apachemaven0 at gmail.com
Thu Oct 9 19:20:11 PDT 2014


Hi:

I am using Ol 2.13.1,and  I found that  the transformation from viewport
pixel to lonlat may result in unexpected result, for example, the following
two lines should give the same result, but sometimes not.

        console.info(map.getCenter());
        console.info(map.getLonLatFromViewPortPx(new
OpenLayers.Pixel(map.size.w/2,map.size.h/2)));


And it seems that once you drag and drop the map quickly to make the
"kinetic" work, then you will get different result, once you drag the
map slowly(which does not cause the "kinetic", you will get the same
result.


 Live example:http://jsfiddle.net/99x928aL/


I know this can be fixed by disabling the "kinetic" feature, but I
wonder if it is possible with the feature enabled?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20141010/eff620b2/attachment.html>


More information about the Users mailing list