[OpenLayers-Commits] r11630 - in trunk/openlayers:
lib/OpenLayers/Format/OWSContext tests/Format/OWSContext
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Sun Mar 6 20:27:00 EST 2011
Author: bartvde
Date: 2011-03-06 17:26:56 -0800 (Sun, 06 Mar 2011)
New Revision: 11630
Modified:
trunk/openlayers/lib/OpenLayers/Format/OWSContext/v0_3_1.js
trunk/openlayers/tests/Format/OWSContext/v0_3_1.html
Log:
Writing map via OWSContext discards nesting path, p=hbruch, r=me (closes #3064)
Modified: trunk/openlayers/lib/OpenLayers/Format/OWSContext/v0_3_1.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Format/OWSContext/v0_3_1.js 2011-03-07 01:14:55 UTC (rev 11629)
+++ trunk/openlayers/lib/OpenLayers/Format/OWSContext/v0_3_1.js 2011-03-07 01:26:56 UTC (rev 11630)
@@ -179,9 +179,10 @@
decomposeNestingPath: function(nPath){
var a = [];
if (nPath instanceof Array) {
- while (nPath.length > 0) {
- a.push(nPath.slice());
- nPath.pop();
+ var path = nPath.slice();
+ while (path.length > 0) {
+ a.push(path.slice());
+ path.pop();
}
a.reverse();
}
Modified: trunk/openlayers/tests/Format/OWSContext/v0_3_1.html
===================================================================
--- trunk/openlayers/tests/Format/OWSContext/v0_3_1.html 2011-03-07 01:14:55 UTC (rev 11629)
+++ trunk/openlayers/tests/Format/OWSContext/v0_3_1.html 2011-03-07 01:26:56 UTC (rev 11630)
@@ -4,7 +4,7 @@
<script type="text/javascript">
function test_read_wmswfs(t) {
- t.plan(16);
+ t.plan(17);
// taken from http://www.ogcnetwork.net/schemas/owc/0.3.1/context_nested.xml
// adapted: add an extra slash (roads/railways) in the Title of the WMS layer to test nesting
var text = '<?xml version="1.0" encoding="UTF-8"?>' +
@@ -61,6 +61,7 @@
map.zoomToExtent(new OpenLayers.Bounds(-117, 32, -116, 33));
var owc = parser.write(map, {id: 'ows-context-ex-1-v3', title: 'OWS Context version 0.3.1 showing nested layers'});
t.xml_eq(text, owc, "Can we roundtrip this nested OWSContext with a WMS and WFS layer?");
+ t.eq(context.layers[1].metadata.nestingPath[0], "Tiger 2005fe major roads/railways", "Nesting path is preserved even after calling write");
}
function test_write_wmswfs(t) {
More information about the Commits
mailing list