2010/9/22 toni hernández <tonidelaca...@gmail.com>: > 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?.
map.zoomToExtent(layer.getDataExtent()); -- Eric Lemoine Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel : 00 33 4 79 44 44 96 Mail : eric.lemo...@camptocamp.com http://www.camptocamp.com _______________________________________________ Dev mailing list d...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-dev