Give the WMS Layer an option to turn off the 'magic' of changing format and

baseLayer state, since that magic can sometimes be problematic. Patch by
part, cleaned up a bit by me, r=me, (Closes #1980)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9029 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2009-03-12 14:19:11 +00:00
parent d2c0182fd9
commit 458461c779
2 changed files with 23 additions and 3 deletions

View File

@@ -54,7 +54,16 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
* but some services want it that way. Default false.
*/
encodeBBOX: false,
/**
* APIProperty: noMagic
* {Boolean} If true, the image format will not be automagicaly switched
* from image/jpeg to image/png or image/gif when using
* TRANSPARENT=TRUE. Also isBaseLayer will not changed by the
* constructor. Default false.
*/
noMagic: false,
/**
* Constructor: OpenLayers.Layer.WMS
* Create a new WMS layer object
@@ -87,7 +96,7 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
//layer is transparent
if (this.params.TRANSPARENT &&
if (!this.noMagic && this.params.TRANSPARENT &&
this.params.TRANSPARENT.toString().toLowerCase() == "true") {
// unless explicitly set in options, make layer an overlay