Merge pull request #1368 from umap-project/datalyerscontrol-map

Fix map reference in DataLayersControl
This commit is contained in:
Yohan Boniface 2023-10-12 11:44:49 +02:00 committed by GitHub
commit b0d135a759
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -514,7 +514,7 @@ L.U.DataLayersControl = L.Control.extend({
update: function () {
if (this._datalayers_container && this._map) {
this._datalayers_container.innerHTML = ''
this._map.eachDataLayerReverse(function (datalayer) {
this.map.eachDataLayerReverse(function (datalayer) {
this.addDataLayer(this._datalayers_container, datalayer)
}, this)
}
@ -525,7 +525,7 @@ L.U.DataLayersControl = L.Control.extend({
},
collapse: function () {
if (this._map.options.datalayersControl === 'expanded') return
if (this.map.options.datalayersControl === 'expanded') return
L.DomUtil.removeClass(this._container, 'expanded')
},