Only close ui panel if it is open
When calling ui.closePanel, this will fire "panel:closed", which is listened by uMap to blindly call map.invalidateSize, which creates trouble in the dashboard preview: when pressing twice ESC key (eg. when switching from a preview to another), the map would pan once to the north east (I guess because invalidateSize is called while the map is not displayed, but not sure).
This commit is contained in:
parent
36f72e3154
commit
d54b0e94b7
1 changed files with 4 additions and 2 deletions
|
@ -64,8 +64,10 @@ L.U.UI = L.Evented.extend({
|
|||
},
|
||||
|
||||
closePanel: function () {
|
||||
if (L.DomUtil.hasClass(this.parent, 'umap-ui')) {
|
||||
L.DomUtil.removeClass(this.parent, 'umap-ui')
|
||||
this.fire('panel:closed')
|
||||
}
|
||||
},
|
||||
|
||||
alert: function (e) {
|
||||
|
|
Loading…
Reference in a new issue