[OpenLayers-Users] Save WFS GetFeature request as GML
allan oware
lumtegis at gmail.com
Wed Oct 5 02:38:11 EDT 2011
Hi!
Am trying to save results from a WMS GetFeature request as GML and
attempting to add it as GML layer.
The request function is as below
function getGML(){
var params = {
SERVICE: "WFS",
VERSION: "1.0.0",
REQUEST: "GetFeature",
typeName: "provinces",
Filter:
"<Filter><PropertyIsEqualTo><PropertyName>prov_name</PropertyName><Literal>Nairobi</Literal></PropertyIsEqualTo></Filter>",
outputFormat: "GML2"
};
OpenLayers.loadURL("
http://mapdemo.net/cgi-bin/mapserv?map=/var/www/mapdemo/project/kenya2.map&",
params, this, setGML, setGML);
OpenLayers.Event.stop(e);
}
while the function to add the returned GML is as below
function setGML(response){
/*
if (response.responseXML == 'text/xml') {
alert(this.responseXML);
} else if (response.responseXML == 'text/plain') {
alert(this.responseText);
} else {
alert('unknown content type');
}
*/
var gmlayer = response.responseXML;
mapPanel.map.addLayer(new OpenLayers.Layer.GML("GML",
gmlayer)); */
}
running the two functions gives an 'Error in loading GML file [object
XMLDocument]' alert
while even the commented code section gives 'unknown content type' alert.
My setup includes MapServer(WFS enabled), OpenLayers and GeoExt / ExtJS.
Any tips,pointers are highly appreciated.
Regards,
Allan Maungu.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20111005/b26ed07b/attachment.html
More information about the Users
mailing list