From b5a8fc9407103457ff385d7fff8d0214258c857d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 25 Jan 2023 15:50:19 +0100 Subject: [PATCH] Use 'popup.isOpen()' --- webapp/pages/map.vue | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/webapp/pages/map.vue b/webapp/pages/map.vue index 2160911e0..3ce51ad49 100644 --- a/webapp/pages/map.vue +++ b/webapp/pages/map.vue @@ -91,7 +91,6 @@ export default { isSourceAndLayerAdded: false, isFlyToCenter: false, popup: null, - popupIsVisible: false, }, } }, @@ -200,9 +199,8 @@ export default { this.map.on('mouseenter', 'markers', (e) => { if (e.features[0].properties.type !== 'the-user') { // close old popup first - if (this.markers.popupIsVisible) { + if (this.markers.popup.isOpen()) { this.markers.popup.remove() - this.markers.popupIsVisible = false } // Change the cursor style as a UI indicator. @@ -229,23 +227,12 @@ export default { // Populate the popup and set its coordinates // based on the feature found. this.markers.popup.setLngLat(coordinates).setHTML(description).addTo(this.map) - - this.markers.popupIsVisible = true } }) // this.map.on('mouseleave', 'markers', () => { // this.map.getCanvas().style.cursor = '' // this.markers.popup.remove() - // this.markers.popupIsVisible = false - // }) - - // Wolle: this.map.on('click', (e) => { - // // close old popup first - // if (this.markers.popupIsVisible) { - // this.markers.popup.remove() - // this.markers.popupIsVisible = false - // } // }) // load markers