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.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users