Changeset 6534
- Timestamp:
- 03/16/08 08:21:15 (10 months ago)
- Files:
-
- trunk/openlayers/examples/wmc.html (modified) (2 diffs)
- trunk/openlayers/lib/OpenLayers/Format/WMC.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Format/WMC/v1.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/examples/wmc.html
r6145 r6534 20 20 OpenLayers.Util.onImageLoadErrorColor = "transparent"; 21 21 22 var format = new OpenLayers.Format.WMC( );22 var format = new OpenLayers.Format.WMC({'layerOptions': {buffer: 0}}); 23 23 var doc, context, map; 24 24 … … 138 138 <textarea id="wmc">paste WMC doc here</textarea> 139 139 <div id="docs"> 140 This is an example of parsing WMC documents. 140 This is an example of parsing WMC documents. <br /> 141 The format class has a layerOptions property, which can be used 142 to control the default options of the layer when it is created 143 by the parser. 141 144 </div> 142 145 </body> trunk/openlayers/lib/OpenLayers/Format/WMC.js
r6401 r6534 27 27 */ 28 28 version: null, 29 30 /** 31 * Property: layerOptions 32 * {Object} Default options for layers created by the parser. These 33 * options are overridden by the options which are read from the 34 * capabilities document. 35 */ 36 layerOptions: null, 29 37 30 38 /** trunk/openlayers/lib/OpenLayers/Format/WMC/v1.js
r6358 r6534 194 194 */ 195 195 getLayerFromInfo: function(layerInfo) { 196 var options = layerInfo.options; 197 if (this.layerOptions) { 198 OpenLayers.Util.applyDefaults(options, this.layerOptions); 199 } 196 200 var layer = new OpenLayers.Layer.WMS( 197 201 layerInfo.title, 198 202 layerInfo.href, 199 203 layerInfo.params, 200 layerInfo.options204 options 201 205 ); 202 206 return layer;
