From 654291ecff3c561473e93c12ca0f052114f57aef Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 1 Mar 2009 15:32:47 +0000 Subject: [PATCH] Adding layerParams property to WMC options. This lets WMC users set params to be used on WMS layers that are different from the WMS layer defaults and not present in the WMC doc. Thanks for the patch bartvde. r=me (closes #1513) git-svn-id: http://svn.openlayers.org/trunk/openlayers@8922 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/WMC.js | 7 +++++++ lib/OpenLayers/Format/WMC/v1.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Format/WMC.js b/lib/OpenLayers/Format/WMC.js index 9ce9d48b08..cac71e91f9 100644 --- a/lib/OpenLayers/Format/WMC.js +++ b/lib/OpenLayers/Format/WMC.js @@ -34,6 +34,13 @@ OpenLayers.Format.WMC = OpenLayers.Class({ * capabilities document. */ layerOptions: null, + + /** + * Property: layerParams + * {Object} Default parameters for layers created by the parser. This + * can be used to override DEFAULT_PARAMS for OpenLayers.Layer.WMS. + */ + layerParams: null, /** * Property: parser diff --git a/lib/OpenLayers/Format/WMC/v1.js b/lib/OpenLayers/Format/WMC/v1.js index ee906578fa..b172dbabe5 100644 --- a/lib/OpenLayers/Format/WMC/v1.js +++ b/lib/OpenLayers/Format/WMC/v1.js @@ -166,7 +166,7 @@ OpenLayers.Format.WMC.v1 = OpenLayers.Class(OpenLayers.Format.XML, { */ read_wmc_Layer: function(context, node) { var layerInfo = { - params: {}, + params: this.layerParams || {}, options: { visibility: (node.getAttribute("hidden") != "1"), queryable: (node.getAttribute("queryable") == "1")