[OpenLayers-Dev] how to zoomToLayer

toni hernández tonidelacalle at gmail.com
Wed Sep 22 11:19:56 EDT 2010


Hi,

I have a vector layer with several polygons.
Is there a way to zoom to the layer?

Right now, I take all the features from the layer (one by one), get their
bounds and  keep the minimum left and bottom, and the maximum right and top.

Then I  can create a new Bounds  and move the map with zoomToExtent (new
Bounds(...))

Is there a better way to do this?.

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20100922/f6ae1cba/attachment.html


More information about the Dev mailing list