Merge pull request #1369 from umap-project/heatlayer-map

Add back HeatLayer._map reference check
This commit is contained in:
Yohan Boniface 2023-10-12 11:45:05 +02:00 committed by GitHub
commit 7bdd56ee9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.