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:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user