From 6eeec6096318379b66132d978fe4cc9e7a8ca18e Mon Sep 17 00:00:00 2001 From: flisowna Date: Mon, 31 Oct 2022 12:29:55 +0400 Subject: [PATCH] geodata: work on mapViewStore --- packages/nc-gui/components/smartsheet/Map.vue | 14 +++--- .../nc-gui/components/tabs/Smartsheet.vue | 2 +- .../nc-gui/composables/useMapViewDataStore.ts | 43 ++++++++++++++++--- 3 files changed, 43 insertions(+), 16 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Map.vue b/packages/nc-gui/components/smartsheet/Map.vue index 98ef45e16b..6a67576018 100644 --- a/packages/nc-gui/components/smartsheet/Map.vue +++ b/packages/nc-gui/components/smartsheet/Map.vue @@ -14,11 +14,11 @@ provide(IsMapInj, ref(true)) provide(ReadonlyInj, !isUIAllowed('xcDatatableEditable')) const reloadViewDataHook = inject(ReloadViewDataHookInj) - -const meta = inject(MetaInj, ref()) +// const meta = inject(MetaInj, ref()) const view = inject(ActiveViewInj, ref()) -const { loadData, formattedData: data } = useViewData(meta, view) +// const { loadData, formattedData: data } = useViewData(meta, view) +const { formattedData, loadMapData } = useMapViewStoreOrThrow() watch(view, async (nextView) => { if (nextView?.type === ViewTypes.MAP) { @@ -31,7 +31,7 @@ watch(view, async (nextView) => { // const { isUIAllowed } = useUIPermission() onMounted(async () => { - await loadData() + await loadMapData() // const geodata = data.value[0].row.geo.split(';') }) @@ -41,10 +41,8 @@ const myMapRef = ref() // const longitude = ref() const markersRef = ref() -const { staticData } = useMapViewStoreOrThrow() - reloadViewDataHook?.on(async () => { - alert('reloadViewDataHook for Map') + loadMapData() }) // function addMarker() { @@ -76,7 +74,7 @@ onMounted(async () => {