making 1 the default for layer opacity. p=mosesonline,me r=me (closes #3441)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@12227 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-08-09 17:33:37 +00:00
parent a6b2537074
commit 92546caa9e
3 changed files with 6 additions and 5 deletions

View File

@@ -466,7 +466,7 @@ OpenLayers.Format.OWSContext.v0_3_1 = OpenLayers.Class(OpenLayers.Format.XML, {
name: layer.params.LAYERS,
queryable: layer.queryable ? "1" : "0",
hidden: layer.visibility ? "0" : "1",
opacity: layer.opacity ? layer.opacity: null}
opacity: layer.hasOwnProperty("opacity") ? layer.opacity : null}
});
this.writeNode("ows:Title", layer.name, node);
this.writeNode("ows:OutputFormat", layer.params.FORMAT, node);

View File

@@ -61,7 +61,7 @@ OpenLayers.Format.WMC = OpenLayers.Class(OpenLayers.Format.Context, {
numZoomLevels: layer.numZoomLevels,
units: layer.units,
isBaseLayer: layer.isBaseLayer,
opacity: layer.opacity,
opacity: layer.opacity == 1 ? undefined : layer.opacity,
displayInLayerSwitcher: layer.displayInLayerSwitcher,
singleTile: layer.singleTile,
tileSize: (layer.singleTile || !layer.tileSize) ?

View File

@@ -35,9 +35,10 @@ OpenLayers.Layer = OpenLayers.Class({
/**
* Property: opacity
* {Float} The layer's opacity. Float number between 0.0 and 1.0.
* {Float} The layer's opacity. Float number between 0.0 and 1.0. Default
* is 1.
*/
opacity: null,
opacity: 1,
/**
* APIProperty: alwaysInRange
@@ -349,7 +350,7 @@ OpenLayers.Layer = OpenLayers.Class({
this.div.style.width = "100%";
this.div.style.height = "100%";
this.div.dir = "ltr";
if (this.opacity != null) {
if (this.opacity != null && this.opacity < 1) {
OpenLayers.Util.modifyDOMElement(
this.div, null, null, null, null, null, null, this.opacity
);