Never try to run _updateOpacity if this._map is undefined
This commit is contained in:
parent
024e01ec3a
commit
7523aaafa0
@ -72,10 +72,7 @@ L.GridLayer = L.Layer.extend({
|
|||||||
|
|
||||||
setOpacity: function (opacity) {
|
setOpacity: function (opacity) {
|
||||||
this.options.opacity = opacity;
|
this.options.opacity = opacity;
|
||||||
|
this._updateOpacity();
|
||||||
if (this._map) {
|
|
||||||
this._updateOpacity();
|
|
||||||
}
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -148,6 +145,7 @@ L.GridLayer = L.Layer.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_updateOpacity: function () {
|
_updateOpacity: function () {
|
||||||
|
if (!this._map) { return; }
|
||||||
var opacity = this.options.opacity;
|
var opacity = this.options.opacity;
|
||||||
|
|
||||||
// IE doesn't inherit filter opacity properly, so we're forced to set it on tiles
|
// IE doesn't inherit filter opacity properly, so we're forced to set it on tiles
|
||||||
|
Loading…
Reference in New Issue
Block a user