christophe triquet wrote:
> Hi,
>
> I'm adding a GML file in my map with the object OpenLayers.Layer.GML.
> I'm trying to zoom to this layer extent at map's loading. I can do
> this if I know de bounding box coordinates with a postgis query.
>
> Is it possible the get the gml extent to be able to automaticaly zoom
> on it at loading ?
var vectorLayer = ...;
vectorLayer.events.on({
"loadend": function() {
map.zoomToExtent(vectorLayer.getDataExtent());
}
});
Regards,
Andreas.
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users