Browse Source

WIP - trying out new leaflet usage structure, step by step (markers on map visibile AND with popup, without cluster api)

pull/4140/head
flisowna 2 years ago
parent
commit
aa4c6476bf
  1. 10
      packages/nc-gui/components/smartsheet/Map.vue

10
packages/nc-gui/components/smartsheet/Map.vue

@ -42,8 +42,11 @@ function addMarker(lat: number, long: number, popupContent: string) {
if (myMapRef.value == null) { if (myMapRef.value == null) {
throw new Error('Map is null') throw new Error('Map is null')
} }
L.marker([lat, long]).addTo(myMapRef.value) const newMarker = L.marker([lat, long]).addTo(myMapRef.value)
console.log(popupContent)
if (newMarker) {
newMarker.bindPopup(popupContent)
}
console.log('myMapRef.value', myMapRef.value) console.log('myMapRef.value', myMapRef.value)
// const markerNew = markerRef?.value?.([lat, long]) // const markerNew = markerRef?.value?.([lat, long])
@ -54,9 +57,6 @@ function addMarker(lat: number, long: number, popupContent: string) {
// myMapRef?.value?.addLayer(markerRef.value) // myMapRef?.value?.addLayer(markerRef.value)
// if (markerNew) {
// markerNew.bindPopup(popupContent)
// }
// return markerNew // return markerNew
} }

Loading…
Cancel
Save