Add format-level layerOptions configuration property to WMC parser, to support
the configuration of user-preferred layer options in order to allow configurability of options like buffer, ratio, etc. r=ahocevar (Closes #1411). git-svn-id: http://svn.openlayers.org/trunk/openlayers@6534 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -26,6 +26,14 @@ OpenLayers.Format.WMC = OpenLayers.Class({
|
||||
* {String} Specify a version string if one is known.
|
||||
*/
|
||||
version: null,
|
||||
|
||||
/**
|
||||
* Property: layerOptions
|
||||
* {Object} Default options for layers created by the parser. These
|
||||
* options are overridden by the options which are read from the
|
||||
* capabilities document.
|
||||
*/
|
||||
layerOptions: null,
|
||||
|
||||
/**
|
||||
* Property: parser
|
||||
|
||||
@@ -193,11 +193,15 @@ OpenLayers.Format.WMC.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
* {<OpenLayers.Layer.WMS>} A WMS layer.
|
||||
*/
|
||||
getLayerFromInfo: function(layerInfo) {
|
||||
var options = layerInfo.options;
|
||||
if (this.layerOptions) {
|
||||
OpenLayers.Util.applyDefaults(options, this.layerOptions);
|
||||
}
|
||||
var layer = new OpenLayers.Layer.WMS(
|
||||
layerInfo.title,
|
||||
layerInfo.href,
|
||||
layerInfo.params,
|
||||
layerInfo.options
|
||||
options
|
||||
);
|
||||
return layer;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user