Fix map reference in DataLayersControl
This would create an error when DataLayersControl is not added to the map, but the mouseenter/leave event would still be active through the datalayers list
This commit is contained in:
parent
5f9d7d3ec3
commit
1f61378aac
1 changed files with 2 additions and 2 deletions
|
@ -514,7 +514,7 @@ L.U.DataLayersControl = L.Control.extend({
|
||||||
update: function () {
|
update: function () {
|
||||||
if (this._datalayers_container && this._map) {
|
if (this._datalayers_container && this._map) {
|
||||||
this._datalayers_container.innerHTML = ''
|
this._datalayers_container.innerHTML = ''
|
||||||
this._map.eachDataLayerReverse(function (datalayer) {
|
this.map.eachDataLayerReverse(function (datalayer) {
|
||||||
this.addDataLayer(this._datalayers_container, datalayer)
|
this.addDataLayer(this._datalayers_container, datalayer)
|
||||||
}, this)
|
}, this)
|
||||||
}
|
}
|
||||||
|
@ -525,7 +525,7 @@ L.U.DataLayersControl = L.Control.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
collapse: function () {
|
collapse: function () {
|
||||||
if (this._map.options.datalayersControl === 'expanded') return
|
if (this.map.options.datalayersControl === 'expanded') return
|
||||||
L.DomUtil.removeClass(this._container, 'expanded')
|
L.DomUtil.removeClass(this._container, 'expanded')
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue