[OpenLayers-Users] Problem with a WFS request
bartvde at osgis.nl
bartvde at osgis.nl
Fri Aug 21 05:35:17 EDT 2009
Hi,
please check examples\wfs-protocol.html for the right way to do this as of
OpenLayers 2.8.
Best regards,
Bart
> Hello,
>
> I am trying to display part of the data of a big shapefile with a WFS
> request and BBOX to filter the data and display only the vectors
> contained in the map view.
>
> I just finished configuring the WFS server (Mapserver) : URL request is
> working and I could read the XML that I saved in a file with OpenLayers
> (for testing). Now I try to make the WFS request with OpenLayers and I
> don't understand what is the problem. I tried two solutions based on
> what I found on the net. Here is my OpenLayers code :
>
>
> var map, wms, test_WFS;
> function init()
> {
> map = new OpenLayers.Map('map', {
> controls: [new OpenLayers.Control.Navigation(),
> new OpenLayers.Control.PanZoom(),
> new OpenLayers.Control.LayerSwitcher()
> ]
> });
>
> wms = new OpenLayers.Layer.WMS("OpenLayers WMS",
> "http://labs.metacarta.com/wms/vmap0",
> {layers:'basic'
> });
>
> // test_WFS = new OpenLayers.Layer.WFS("test WFS",
> //
> "http://IP-address/cgi-bin/mapserv_5.4.1?map=/var/www/html/WFS_server/test.map&",
> // {service:'WFS', version:'1.1.0', request:'GetFeature',
> bbox:'70,35,75,37', typeName:'aster_gdem', outputFormat:'GML2'},
> // {}
> // );
>
> test_WFS = new OpenLayers.Layer.GML("test WFS", [
> "http://134.157.122.201/cgi-bin/mapserv_5.4.1",
> "?map=/var/www/html/WFS_server/test.map",
> "&SERVICE=WFS",
> "&VERSION=1.1.0",
> "&REQUEST=GetFeature",
> "&BBOX=70,35,75,37",
> "&TYPENAME=aster_gdem",
> "&OUTPUTFORMAT=GML2"].join(",")
> );
>
> map.addLayers([wms, test_WFS]);
>
> map.zoomToMaxExtent();
> }
>
>
> The test_WFS layer is not displaying and I don't know how to fix it.
>
> Thank you for your help !
>
> Arthur Delorme
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
More information about the Users
mailing list