Browse Source

geo map: work on popup

pull/5247/head
Daniel Spaude 2 years ago
parent
commit
5044cca4cc
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 82
      packages/nc-gui/components/smartsheet/Map.vue

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

@ -105,39 +105,44 @@ const addMarker = (lat: number, long: number, row: RowType) => {
const newMarker = L.marker([lat, long], { const newMarker = L.marker([lat, long], {
alt: `${lat}, ${long}`, alt: `${lat}, ${long}`,
}).on('click', () => { }).on('click', () => {
expandForm(row) if (newMarker && isPublic.value) {
popUpRow.value = row
popupIsOpen.value = true
} else {
expandForm(row)
}
}) })
markersClusterGroupRef.value?.addLayer(newMarker) markersClusterGroupRef.value?.addLayer(newMarker)
if (newMarker && isPublic.value) { // if (newMarker && isPublic.value) {
// newMarker.setPopupContent(popupContainer.value!) // // newMarker.setPopupContent(popupContainer.value!)
popUpRow.value = row // popUpRow.value = row
newMarker.bindPopup(popupContainer.value!) // newMarker.bindPopup(popupContainer.value!)
// newMarker.bindPopup(popupContent) // // newMarker.bindPopup(popupContent)
// const vm = new Vue({ // // const vm = new Vue({
// render: (h: any) => // // render: (h: any) =>
// h(LazySmartsheetMyPopupComponent, { // // h(LazySmartsheetMyPopupComponent, {
// props: { // // props: {
// title: 'Marker Title', // // title: 'Marker Title',
// description: 'Marker Description', // // description: 'Marker Description',
// }, // // },
// }), // // }),
// }) // // })
// newMarker.bindPopup(vm.$el, { maxWidth: 300 }) // // newMarker.bindPopup(vm.$el, { maxWidth: 300 })
newMarker.on('popupopen', () => { // newMarker.on('popupopen', () => {
popupIsOpen.value = true // popupIsOpen.value = true
// vm.$mount() // // vm.$mount()
}) // })
newMarker.on('popupclose', () => { // newMarker.on('popupclose', () => {
popupIsOpen.value = false // popupIsOpen.value = false
// vm.$destroy() // // vm.$destroy()
}) // })
} // }
} }
const resetZoomAndCenterBasedOnLocalStorage = () => { const resetZoomAndCenterBasedOnLocalStorage = () => {
@ -263,14 +268,23 @@ watch(view, async (nextView) => {
} }
}) })
// @cancel="emit('closed')"
const count = computed(() => paginationData.value.totalRows) const count = computed(() => paginationData.value.totalRows)
</script> </script>
<template> <template>
<div v-if="popupIsOpen" ref="popupContainer"> <a-modal
<LazySmartsheetMyPopupComponent :fields="fields" :row="popUpRow"></LazySmartsheetMyPopupComponent> v-model:visible="popupIsOpen"
</div> :class="{ active: popupIsOpen }"
<!-- <div ref="popupContainer" v-if="popupIsOpen">FOO-Hi<LazySmartsheetMyPopupComponent></LazySmartsheetMyPopupComponent></div> --> :footer="null"
centered
:closable="false"
@close="popupIsOpen = false"
>
<!-- <div v-if="popupIsOpen" ref="popupContainer"> -->
<LazySmartsheetMyPopupComponent v-if="popUpRow" :fields="fields" :row="popUpRow"></LazySmartsheetMyPopupComponent>
<!-- </div> -->
</a-modal>
<div class="flex flex-col h-full w-full no-underline" data-testid="nc-map-wrapper"> <div class="flex flex-col h-full w-full no-underline" data-testid="nc-map-wrapper">
<div id="mapContainer" ref="mapContainerRef" class="w-full h-screen"> <div id="mapContainer" ref="mapContainerRef" class="w-full h-screen">

Loading…
Cancel
Save