make transparent wms layers be overlays again. fix test.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1209 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-08-15 12:09:46 +00:00
parent 9984c776de
commit dd07041019
2 changed files with 15 additions and 8 deletions
+4 -7
View File
@@ -21,13 +21,8 @@ OpenLayers.Layer.WMS.prototype =
format: "image/jpeg" format: "image/jpeg"
}, },
/** WMS layer by default is a base layer. /** @type Boolean */
* If the user wishes to use a WMS as a datalayer, s/he needs only isBaseLayer: null,
* set this property to false.
*
* @type Boolean
*/
isBaseLayer: true,
/** /**
* @constructor * @constructor
@@ -52,6 +47,8 @@ OpenLayers.Layer.WMS.prototype =
OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS) OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS)
); );
} }
this.isBaseLayer = (this.params.TRANSPARENT != "true");
}, },
/** /**
+11 -1
View File
@@ -98,12 +98,22 @@
function test_05_Layer_WMS_isBaseLayer(t) { function test_05_Layer_WMS_isBaseLayer(t) {
t.plan(1); t.plan(2);
var url = "http://octo.metacarta.com/cgi-bin/mapserv"; var url = "http://octo.metacarta.com/cgi-bin/mapserv";
layer = new OpenLayers.Layer.WMS(name, url, params); layer = new OpenLayers.Layer.WMS(name, url, params);
t.ok( layer.isBaseLayer, "baselayer is true by default"); t.ok( layer.isBaseLayer, "baselayer is true by default");
var newParams = Object.extend(new Object(), params);
newParams.transparent = "true";
layer = new OpenLayers.Layer.WMS(name, url, newParams);
t.ok( !layer.isBaseLayer, "baselayer is false when transparent is set to true");
} }
function test_06_Layer_WMS_mergeNewParams (t) { function test_06_Layer_WMS_mergeNewParams (t) {