Have Format.WFST support multiple typenames, r=ahocevar (closes #1839)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10260 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -89,6 +89,29 @@
|
||||
}
|
||||
}
|
||||
|
||||
function test_write_multiple(t) {
|
||||
|
||||
var format = new OpenLayers.Format.WFST({
|
||||
featureNS: "http://www.openplans.org/topp",
|
||||
featureType: ["states", "cities"],
|
||||
featurePrefix: "topp",
|
||||
geometryName: "the_geom"
|
||||
});
|
||||
|
||||
t.plan(1);
|
||||
var snippets = {
|
||||
"GetFeatureMultiple": {}
|
||||
}
|
||||
|
||||
var arg;
|
||||
for(var snippet in snippets) {
|
||||
arg = snippets[snippet]
|
||||
var expected = readXML(snippet);
|
||||
var got = format.writers["wfs"]["GetFeature"].apply(format, [arg]);
|
||||
t.xml_eq(got, expected, snippet + " request created correctly with multiple typenames");
|
||||
}
|
||||
}
|
||||
|
||||
function readXML(id) {
|
||||
var xml = document.getElementById(id).firstChild.nodeValue;
|
||||
return new OpenLayers.Format.XML().read(xml).documentElement;
|
||||
@@ -148,6 +171,12 @@
|
||||
<wfs:Query typeName="topp:states" xmlns:topp="http://www.openplans.org/topp"/>
|
||||
</wfs:GetFeature>
|
||||
--></div>
|
||||
<div id="GetFeatureMultiple"><!--
|
||||
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<wfs:Query typeName="topp:states" xmlns:topp="http://www.openplans.org/topp"/>
|
||||
<wfs:Query typeName="topp:cities" xmlns:topp="http://www.openplans.org/topp"/>
|
||||
</wfs:GetFeature>
|
||||
--></div>
|
||||
<div id="Transaction"><!--
|
||||
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0"/>
|
||||
--></div>
|
||||
|
||||
Reference in New Issue
Block a user