From 84bff2e41628a63151f80a25337b2224833f07b6 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sun, 4 Feb 2024 19:33:01 +0100 Subject: [PATCH] fix: do not try to reset tooltip of feature not on map This can happen in a situation where: - a layer as zoom limits - we click on a feature, which opens a popup - then zoom over the layer's limit (with scroll or keyboard, not keyboard, in order to not close the popup) - then click in anywhere in the map, which will close the popup Since the highlight of features on click (cf #1359), we redraw them on popupclose, which explains the bug described above. fix #1575 --- umap/static/umap/js/umap.features.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index 8e826131..dc98448c 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -794,8 +794,10 @@ L.U.PathMixin = { }, _redraw: function () { - this.setStyle() - this.resetTooltip() + if (this.datalayer && this.datalayer.isVisible()) { + this.setStyle() + this.resetTooltip() + } }, onAdd: function (map) {