Add back HeatLayer._map reference check
In some situation, the property is undefined, given the call is async, and we can add/remove the layer during the async stack
This commit is contained in:
parent
5f9d7d3ec3
commit
1e8c51b0e5
1 changed files with 8 additions and 0 deletions
|
@ -374,6 +374,14 @@ L.U.Layer.Heat = L.HeatLayer.extend({
|
|||
this._updateOptions()
|
||||
},
|
||||
|
||||
redraw: function () {
|
||||
// setlalngs call _redraw through setAnimFrame, thus async, so this
|
||||
// can ends with race condition if we remove the layer very faslty after.
|
||||
// TODO: PR in upstream Leaflet.heat
|
||||
if (!this._map) return
|
||||
L.HeatLayer.prototype.redraw.call(this)
|
||||
},
|
||||
|
||||
_redraw: function () {
|
||||
// Import patch from https://github.com/Leaflet/Leaflet.heat/pull/78
|
||||
// Remove me when this get merged and released.
|
||||
|
|
Loading…
Reference in a new issue