fix for #650 - if user specifies a layer as transparent and of format image/jpg, we change it to the appropriate type (gif or png). Sure, it's somewhat magical... but it will probably help people out in the long run
git-svn-id: http://svn.openlayers.org/trunk/openlayers@3554 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -74,13 +74,23 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS)
|
||||
);
|
||||
|
||||
// unless explicitly set in options, if the layer is transparent,
|
||||
// it will be an overlay
|
||||
if ((options == null) || (options.isBaseLayer == null)) {
|
||||
this.isBaseLayer = ((this.params.TRANSPARENT != "TRUE") &&
|
||||
(this.params.TRANSPARENT != "true") &&
|
||||
(this.params.TRANSPARENT != true));
|
||||
//layer is transparent
|
||||
if (this.params.TRANSPARENT &&
|
||||
this.params.TRANSPARENT.toString().toLowerCase() == "true") {
|
||||
|
||||
// unless explicitly set in options, make layer an overlay
|
||||
if ( (options == null) || (!options.isBaseLayer) ) {
|
||||
this.isBaseLayer = false;
|
||||
}
|
||||
|
||||
// jpegs can never be transparent, so intelligently switch the
|
||||
// format, depending on teh browser's capabilities
|
||||
if (this.params.FORMAT == "image/jpeg") {
|
||||
this.params.FORMAT = OpenLayers.Util.alphaHack() ? "image/gif"
|
||||
: "image/png";
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user