Hi,

  Yes :

  mapObject.zoomToExtent(polygonObject.getBounds());

http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.zoomToExtent
http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Geometry-js.html#OpenLayers.Geometry.getBounds

Regards,

Alexandre


On 11-06-27 10:34 AM, JK Chen wrote:

Hi,

Given a polygon, is there an OpenLayers API that will automatically zoom the map to fit the polygon, similar to GMap API getBoundsZoomLevel()?

Thanks.

JK


_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users


--
Alexandre Dubé
Mapgears
www.mapgears.com

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to