[OpenLayers-Dev] How can i get the extent of the WMS (JS, WFS)

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Wed Nov 14 04:01:28 EST 2007

The way to do this unfortunately is to also perform a WFS request with the
same filter. You can use GeoJSON as the output format. Then you can use the
bbox attribute of the GeoJSON featurecollection (note: this is very new in
Geoserver and has only been added yesterday) as the extent to zoom to.

Btw, it would be a nice enhancement if you could ask Geoserver only for the
bbox of the featurecollection, since you are not interested in the actual
features itself.

Best regards,

Bart van den Eijnden
OSGIS, Open Source GIS

--------- Oorspronkelijk bericht --------
Van: springrider <springrider at hotmail.com>
Naar: dev at openlayers.org <dev at openlayers.org>
Onderwerp: [OpenLayers-Dev]  How can i get the extent of the WMS (JS, WFS)
Datum: 14/11/07 06:54

> Good morning
> I am generating  some maps using Geoserver and Openlayers which contain
> layers. I can not define in advance what should be the current extent
> because these WMS layers are generated from geoserver using cql_filter to
> select some specific polygons from my shapefile.
> The goal would be to know automatically the extent of the WMS in order to
> zoom on it.
> This is my current map: http://www.nabble.com/file/p13725061/OL1.jpg  and
> this is what i would like to get automatically:
> http://www.nabble.com/file/p13725061/OL2.jpg .
> Is there a way to obtain by coding the current extent of the WMS (At
> geoserver or openlayers levels...)??
> I saw by using WFS service, we can get the gml:ccordinates
> can we extract this information and use it to define the extent of the
> Thanks for helping me, i start becoming crazy about that point.
> Sylvain
> -- 
> View this message in context:
> Sent from the OpenLayers Dev mailing list archive at Nabble.com.
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev

More information about the Dev mailing list