diff --git a/packages/nc-gui/components/cell/GeoData.vue b/packages/nc-gui/components/cell/GeoData.vue
index 1ebb09e681..0ebcaf7cf7 100644
--- a/packages/nc-gui/components/cell/GeoData.vue
+++ b/packages/nc-gui/components/cell/GeoData.vue
@@ -1,15 +1,9 @@
@@ -156,7 +146,7 @@ console.log('column.value in cell', column.value)
>
-
+
diff --git a/packages/nc-gui/components/smartsheet/Map.vue b/packages/nc-gui/components/smartsheet/Map.vue
index 7ec74e601d..341012a8e1 100644
--- a/packages/nc-gui/components/smartsheet/Map.vue
+++ b/packages/nc-gui/components/smartsheet/Map.vue
@@ -44,9 +44,6 @@ const getMapCenterLocalStorageKey = (viewId: string) => `mapView.center.${viewId
const expandForm = (row: RowType, state?: Record, clickedLatLongForNewRow?: [number, number]) => {
const rowId = extractPkFromRow(row.row, meta.value!.columns!)
- console.log('state in expandForm', state)
- console.log('row in expandForm', row)
- console.log('clickedLatLongForNewRow', clickedLatLongForNewRow)
if (rowId) {
router.push({
query: {
@@ -90,17 +87,13 @@ const addMarker = (lat: number, long: number, row: RowType) => {
throw new Error('Map is null')
}
const newMarker = L.marker([lat, long]).on('click', () => {
- console.log('OnNewMarker')
expandForm(row)
})
- console.log('onaddMarker', lat, long)
markersClusterGroupRef.value?.addLayer(newMarker)
}
const resetZoomAndCenterBasedOnLocalStorage = () => {
if (mapMetaData?.value?.fk_view_id == null) {
- console.error('Early leaving of resetZoomAndCenterBasedOnLocalStorage because "mapMetaData?.value?.fk_view_id == null"')
- console.log('mapMetaData?.value', mapMetaData?.value)
return
}
const initialZoomLevel = parseInt(localStorage.getItem(getMapZoomLocalStorageKey(mapMetaData.value.fk_view_id)) || '10')
@@ -147,22 +140,14 @@ onMounted(async () => {
}
})
- // myMap.on('contextmenu', async function (e) {
- // console.log('onContext')
- // const newRow = await addEmptyRow()
- // const lat = e.latlng.lat
- // const lng = e.latlng.lng
- // addMarker(lat, lng, newRow)
- // expandForm(newRow)
- // submitForm()
- // })
-
myMap.on('contextmenu', async function (e) {
- const newRow = await addEmptyRow()
const lat = e.latlng.lat
const lng = e.latlng.lng
+ const newRow = await addEmptyRow()
+ if (geoDataFieldColumn.value?.title) {
+ newRow.row[geoDataFieldColumn.value.title] = `${lat.toFixed(7)};${lng.toFixed(7)}`
+ }
addMarker(lat, lng, newRow)
- console.log('oncontextClick', lat, lng, newRow)
expandForm(newRow, undefined, [lat, lng])
})
})
diff --git a/packages/nc-gui/components/smartsheet/expanded-form/index.vue b/packages/nc-gui/components/smartsheet/expanded-form/index.vue
index 0bb79dbc1b..2f8e280f44 100644
--- a/packages/nc-gui/components/smartsheet/expanded-form/index.vue
+++ b/packages/nc-gui/components/smartsheet/expanded-form/index.vue
@@ -6,7 +6,6 @@ import {
FieldsInj,
IsFormInj,
IsKanbanInj,
- IsMapInj,
MetaInj,
ReloadRowDataHookInj,
computedInject,
@@ -52,8 +51,6 @@ const state = toRef(props, 'state')
const meta = toRef(props, 'meta')
-const newRow = row.value.row.geoColId
-
// const initialGeoPositionData = toRef(props, 'initialGeoPositionData')
const initialGeoPositionData = ref(props.initialGeoPositionData)
@@ -68,8 +65,6 @@ const fields = computedInject(FieldsInj, (_fields) => {
const isKanban = inject(IsKanbanInj, ref(false))
-const isMap = inject(IsMapInj, ref(false))
-
provide(MetaInj, meta)
const { commentsDrawer, changedColumns, state: rowState, isNew, loadRow } = useProvideExpandedFormStore(meta, row)