Hi!<br>Am trying to save results from a WMS GetFeature request as GML and attempting to add it as GML layer.<br>The request function is as below<br><br>function getGML(){<br><br> var params = {<br> SERVICE: "WFS",<br>
VERSION: "1.0.0",<br> REQUEST: "GetFeature",<br> typeName: "provinces",<br> Filter: "<Filter><PropertyIsEqualTo><PropertyName>prov_name</PropertyName><Literal>Nairobi</Literal></PropertyIsEqualTo></Filter>",<br>
outputFormat: "GML2"<br> };<br><br> OpenLayers.loadURL("<a href="http://mapdemo.net/cgi-bin/mapserv?map=/var/www/mapdemo/project/kenya2.map&">http://mapdemo.net/cgi-bin/mapserv?map=/var/www/mapdemo/project/kenya2.map&</a>", params, this, setGML, setGML);<br>
OpenLayers.Event.stop(e);<br> <br> }<br><br>while the function to add the returned GML is as below<br><br>function setGML(response){<br> <br> <br>
/* <br> if (response.responseXML == 'text/xml') {<br> alert(this.responseXML);<br> } else if (response.responseXML == 'text/plain') {<br>
alert(this.responseText);<br> } else {<br> alert('unknown content type');<br> } <br> */ <br><br> var gmlayer = response.responseXML;<br>
<br> mapPanel.map.addLayer(new OpenLayers.Layer.GML("GML", gmlayer)); */<br> <br>}<br><br><br>running the two functions gives an 'Error in loading GML file [object XMLDocument]' alert<br>
while even the commented code section gives 'unknown content type' alert.<br>My setup includes MapServer(WFS enabled), OpenLayers and GeoExt / ExtJS.<br>Any tips,pointers are highly appreciated.<br><br>Regards,<br>
Allan Maungu.<br>