[OpenLayers-Users] Problem with a WFS request
Arthur Delorme
delorme.ipgp at gmail.com
Fri Aug 21 05:10:09 EDT 2009
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
More information about the Users
mailing list