Merge pull request #1466 from umap-project/fix-remove-tilelayer

Do not call AttributionControl._update for removed tile layer
This commit is contained in:
Yohan Boniface 2023-12-15 08:24:41 +01:00 committed by GitHub
commit 8568159589
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1250,8 +1250,10 @@ L.U.AttributionControl = L.Control.Attribution.extend({
},
_update: function () {
// Layer is no more on the map
if (!this._map) return
L.Control.Attribution.prototype._update.call(this)
// Use our how container, so we can hide/show on small screens
// Use our own container, so we can hide/show on small screens
const credits = this._container.innerHTML
this._container.innerHTML = ''
const container = L.DomUtil.add(