[OpenLayers-Users] using map.setCenterfunction with getZoomForExtent()

Thomas Gratier osgeo.mailinglist at gmail.com
Sat Feb 26 16:48:46 EST 2011


Hello,

It seems you forget that getZoomForExtent() is related to map or layer
http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.getZoomForExtent
You also made a mistake by using *Openlayers* and not
*OpenLayers*(javascript is case sensitive)

A sample below you can test in
http://openlayers.org/dev/examples/baseLayers.html
map.setCenter(new
OpenLayers.LonLat(-88.7544446426224,13.6255370441885),map.getZoomForExtent(new
OpenLayers.Bounds(-88.69996,13.6920867,-88.530255,13.7854783)));

Regards

ThomasG
GIS specialist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110226/5096b2ac/attachment.html


More information about the Users mailing list