Enhancements to the WMC parser for better contact information, SRS, and style support. p=trondmm, r=me (closes #3236)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11871 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2011-04-04 17:15:14 +00:00
parent a7d1cc9134
commit 7a5e837c9b
7 changed files with 824 additions and 62 deletions
+22
View File
@@ -76,6 +76,16 @@ OpenLayers.Format.WMC.v1_1_0 = OpenLayers.Class(
layerContext.minScale = parseFloat(this.getChildValue(node));
},
/**
* Method: read_wmc_SRS
*/
read_wmc_SRS: function(layerContext, node) {
if (! ("srs" in layerContext)) {
layerContext.srs = {};
}
layerContext.srs[this.getChildValue(node)] = true;
},
/**
* Method: write_wmc_Layer
* Create a Layer node given a layer context object. This method adds
@@ -109,12 +119,24 @@ OpenLayers.Format.WMC.v1_1_0 = OpenLayers.Class(
node.appendChild(maxSD);
}
// optional SRS element(s)
if (context.srs) {
for(var name in context.srs) {
node.appendChild(this.createElementDefaultNS("SRS", name));
}
}
// optional FormatList element
node.appendChild(this.write_wmc_FormatList(context));
// optional StyleList element
node.appendChild(this.write_wmc_StyleList(context));
// optional DimensionList element
if (context.dimensions) {
node.appendChild(this.write_wmc_DimensionList(context));
}
// OpenLayers specific properties go in an Extension element
node.appendChild(this.write_wmc_LayerExtension(context));