Changeset 2893
- Timestamp:
- 03/25/07 17:35:12 (2 years ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Layer/MapServer.js (modified) (3 diffs)
- trunk/openlayers/tests/Layer/test_MapServer.html (added)
- trunk/openlayers/tests/list-tests.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Layer/MapServer.js
r2803 r2893 24 24 * @param {hash} params 25 25 */ 26 initialize: function(name, url, params ) {26 initialize: function(name, url, params, options) { 27 27 var newArguments = new Array(); 28 //uppercase params 29 params = OpenLayers.Util.upperCaseObject(params); 30 newArguments.push(name, url, params); 28 newArguments.push(name, url, params, options); 31 29 OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments); 32 30 … … 34 32 OpenLayers.Util.applyDefaults( 35 33 this.params, 36 OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS)34 this.DEFAULT_PARAMS 37 35 ); 36 } 37 38 // unless explicitly set in options, if the layer is transparent, 39 // it will be an overlay 40 if (options == null || options.isBaseLayer == null) { 41 this.isBaseLayer = ((this.params.transparent != "true") && 42 (this.params.transparent != true)); 38 43 } 39 44 }, 40 45 41 42 /** 43 * @type Boolean 44 */ 45 isBaseLayer: function() { 46 return (this.params.TRANSPARENT != 'true'); 47 }, 48 49 /** 50 * @param {String} name 51 * @param {hash} params 46 /** 47 * @param {Object} obj 52 48 * 53 * @returns A clone of this OpenLayers.Layer.MapServer, with the passed-in 54 * parameters merged in. 49 * @returns A clone of this OpenLayers.Layer.MapServer 55 50 * @type OpenLayers.Layer.MapServer 56 51 */ 57 clone: function (name, params) { 58 var mergedParams = {}; 59 OpenLayers.Util.extend(mergedParams, this.params); 60 OpenLayers.Util.extend(mergedParams, params); 61 var obj = new OpenLayers.Layer.MapServer(name, this.url, mergedParams); 62 obj.setTileSize(this.tileSize); 52 clone: function (obj) { 53 if (obj == null) { 54 obj = new OpenLayers.Layer.MapServer(this.name, 55 this.url, 56 this.params, 57 this.options); 58 } 59 //get all additions from superclasses 60 obj = OpenLayers.Layer.Grid.prototype.clone.apply(this, [obj]); 61 62 // copy/set any non-init, non-simple values here 63 63 64 return obj; 64 65 }, … … 77 78 return new OpenLayers.Tile.Image(this, position, bounds, url, this.tileSize); 78 79 }, 79 80 80 81 /** 81 82 * @param {OpenLayers.Bounds} bounds trunk/openlayers/tests/list-tests.html
r2891 r2893 36 36 <li>Layer/test_Markers.html</li> 37 37 <li>Layer/test_Multimap.html</li> 38 <li>Layer/test_MapServer.html</li> 38 39 <li>Layer/test_MapServer_Untiled.html</li> 39 40 <li>Layer/test_Text.html</li>
