Skip to content

Commit

Permalink
Fix empty tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Mar 17, 2025
1 parent 236b371 commit 163fdbe
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DISABLE_LAYER_OPTIONS } from '@/components/Map/constants'
import { AGGREGATE } from '@/constants/objectTypes'
import { computed, ref } from 'vue'

export function makeGeojsonOptions({ popupElement, popupItem }) {
Expand All @@ -8,13 +9,15 @@ export function makeGeojsonOptions({ popupElement, popupItem }) {
layer.pm.setOptions(DISABLE_LAYER_OPTIONS)
layer.pm.disable()

layer.on('popupopen', () => (popupItem.value = feature.properties))
layer.on('popupclose', () => (popupItem.value = null))
if (feature.properties.base.some(({ label }) => Boolean(label))) {
layer.on('popupopen', () => (popupItem.value = feature.properties))
layer.on('popupclose', () => (popupItem.value = null))

layer.bindPopup(popupElement.value, {
minWidth: 400,
maxWidth: 400
})
layer.bindPopup(popupElement.value, {
minWidth: 400,
maxWidth: 400
})
}
}
}
}
Expand Down

0 comments on commit 163fdbe

Please sign in to comment.