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

springrider springrider at hotmail.com
Wed Nov 14 05:50:16 EST 2007


Thanks for your reply

I have installed GeoJSOn on my Geoserver. The idea would be effectively to
pick up the bbox value available in the
gml:boundedBy\gml:Box\gml:coordinates tag from the XML obtained with the WFS
request using the same filter.

 I tried using the outputformat=JSON
(geoserver/wfs?request=GetFeature&typename=fifao:Fao_areas&cql_filter=F_AREA=27&&outputformat=json)
but i don't know what should be my syntax at openlayers JS code in order to
use this extent to zoom to.
Would you have any example?

Thanks for your help

Does it mean that this kind of infos (WMS extent) can only be obtained by
WFS, there is no other way?

Best regards

Sylvain



Bart van den Eijnden (OSGIS)-2 wrote:
> 
> 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
> 
> --
> Bart van den Eijnden
> OSGIS, Open Source GIS
> http://www.osgis.nl
> 
> 
> --------- 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
> WMS
>> 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
>>
> (.../wfs?request=GetFeature&amp;typename=fifao:Fao_areas&amp;cql_filter=F_AREA=27),
>> can we extract this information and use it to define the extent of the
> map??
>> 
>> Thanks for helping me, i start becoming crazy about that point.
>> 
>> Sylvain
>> -- 
>> View this message in context:
> http://www.nabble.com/How-can-i-get-the-extent-of-the-WMS-%28JS%2C-WFS%29-tf4797527.html#a13725061
>> Sent from the OpenLayers Dev mailing list archive at Nabble.com.
>> 
>> _______________________________________________
>> Dev mailing list
>> Dev at openlayers.org
>> http://openlayers.org/mailman/listinfo/dev
>> 
>> 
> 
> 
> 
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
> 
> 

-- 
View this message in context: http://www.nabble.com/How-can-i-get-the-extent-of-the-WMS-%28JS%2C-WFS%29-tf4797527.html#a13744115
Sent from the OpenLayers Dev mailing list archive at Nabble.com.




More information about the Dev mailing list