mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Use 'popup.isOpen()'
This commit is contained in:
parent
bce3ad649b
commit
b5a8fc9407
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user