Adding some serious enhancements to the WMC format. With this, OL map and layer objects can be created from WMC context objects and vice versa. Thanks for the great patch bbinet. r=me (closes #2251)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9733 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -46,29 +46,30 @@ OpenLayers.Format.WMC.v1_0_0 = OpenLayers.Class(
|
||||
|
||||
/**
|
||||
* Method: write_wmc_Layer
|
||||
* Create a Layer node given a layer object.
|
||||
* Create a Layer node given a layer context object. This method adds
|
||||
* elements specific to version 1.0.0.
|
||||
*
|
||||
* Parameters:
|
||||
* layer - {<OpenLayers.Layer.WMS>} Layer object.
|
||||
* context - {Object} A layer context object.}
|
||||
*
|
||||
* Returns:
|
||||
* {Element} A WMC Layer element node.
|
||||
*/
|
||||
write_wmc_Layer: function(layer) {
|
||||
write_wmc_Layer: function(context) {
|
||||
var node = OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(
|
||||
this, [layer]
|
||||
this, [context]
|
||||
);
|
||||
|
||||
// optional FormatList element
|
||||
node.appendChild(this.write_wmc_FormatList(layer));
|
||||
node.appendChild(this.write_wmc_FormatList(context));
|
||||
|
||||
// optional StyleList element
|
||||
node.appendChild(this.write_wmc_StyleList(layer));
|
||||
node.appendChild(this.write_wmc_StyleList(context));
|
||||
|
||||
// OpenLayers specific properties go in an Extension element
|
||||
node.appendChild(this.write_wmc_LayerExtension(layer));
|
||||
node.appendChild(this.write_wmc_LayerExtension(context));
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Format.WMC.v1_0_0"
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user