diff --git a/packages/nc-gui/components/smartsheet/Map.vue b/packages/nc-gui/components/smartsheet/Map.vue
index a345c293c6..41893be8cb 100644
--- a/packages/nc-gui/components/smartsheet/Map.vue
+++ b/packages/nc-gui/components/smartsheet/Map.vue
@@ -52,7 +52,7 @@ watch([formattedData, mapMetaData, markersClusterGroupRef], () => {
throw new Error('Cannot find primary geo data column title')
}
- const primaryGeoDataValue = row[primaryGeoDataColumnTitle]
+ const primaryGeoDataValue = row.row[primaryGeoDataColumnTitle]
const listItems = Object.entries(row)
.map(([key, val]) => {
@@ -64,6 +64,10 @@ watch([formattedData, mapMetaData, markersClusterGroupRef], () => {
const popupContent = `
`
+ if (primaryGeoDataValue == null) {
+ return
+ }
+
const [lat, long] = primaryGeoDataValue.split(';').map(parseFloat)
addMarker(lat, long, popupContent)
diff --git a/packages/nc-gui/composables/useMapViewDataStore.ts b/packages/nc-gui/composables/useMapViewDataStore.ts
index ca7fb49e28..7c32e4937a 100644
--- a/packages/nc-gui/composables/useMapViewDataStore.ts
+++ b/packages/nc-gui/composables/useMapViewDataStore.ts
@@ -3,6 +3,13 @@ import type { ColumnType, MapType, TableType, ViewType } from 'nocodb-sdk'
import { ref, useInjectionState } from '#imports'
import type { Row } from '~/lib'
+const formatData = (list: Row[]) =>
+ list.map((row) => ({
+ row: { ...row },
+ oldRow: { ...row },
+ rowMeta: {},
+ }))
+
const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
(
meta: Ref,
@@ -32,7 +39,7 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
const res = await api.dbViewRow.list('noco', project.value.id!, meta.value!.id!, viewMeta.value!.id!)
- formattedData.value = res.list
+ formattedData.value = formatData(res.list)
}
async function updateMapMeta(updateObj: Partial) {