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:
euzuro
2007-07-02 22:11:16 +00:00
parent 71a140055e
commit d2c2b011e7
3 changed files with 45 additions and 15 deletions

View File

@@ -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";
}
}
},
/**