[OpenLayers-Users] problem with map.zoomToExtent()

Max Demars burton449geo at gmail.com
Mon Oct 6 05:56:27 PDT 2014


Good day everybody,

I wonder what could be the cause of that weird behaviour. I create bounds
and do a zoomToExtent() on it, but the map zoom to a wrong bounds a lot
smaller than what I expected. *Only the left (xmin) parameter seems correct*

bounds = new OpenLayers.Bounds(2996.2336935074995, 56840.21183910011,
1777863.3259255073, 1312326.8861909)
map.zoomToExtent(bounds);
console.log(map.getExtent());

In the console:

CLASS_NAME: "OpenLayers.Bounds"
bottom: -1056.1561284056
centerLonLat: null
left: -2996.2336935074
right: 5.0249582272954e-11
top: 1056.1561284056

What could be the cause of that?
-Max Demars

-- 
Stack Overflow: http://stackoverflow.com/users/1914034/burton449
GIS Overflow: http://gis.stackexchange.com/users/14426/burton449
LastFm: http://www.lastfm.fr/user/burton449
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20141006/1347d146/attachment.html>


More information about the Users mailing list