Browse Source

Revert "geodata: add tooltip to each marker on hover - works, WIP: show attachments, qrcode on tooltip"

This reverts commit 94148f02f6.
pull/4749/head
flisowna 2 years ago
parent
commit
5ab81bda4a
  1. 18
      packages/nc-gui/components/smartsheet/Map.vue

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

@ -82,7 +82,7 @@ const expandedFormOnRowIdDlg = computed({
}, },
}) })
const addMarker = (lat: number, long: number, row: RowType, popupContent: string) => { const addMarker = (lat: number, long: number, row: RowType) => {
if (markersClusterGroupRef.value == null) { if (markersClusterGroupRef.value == null) {
throw new Error('Map is null') throw new Error('Map is null')
} }
@ -90,10 +90,6 @@ const addMarker = (lat: number, long: number, row: RowType, popupContent: string
expandForm(row) expandForm(row)
}) })
markersClusterGroupRef.value?.addLayer(newMarker) markersClusterGroupRef.value?.addLayer(newMarker)
if (newMarker) {
newMarker.bindTooltip(popupContent)
}
} }
const resetZoomAndCenterBasedOnLocalStorage = () => { const resetZoomAndCenterBasedOnLocalStorage = () => {
@ -182,23 +178,13 @@ watch([formattedData, mapMetaData, markersClusterGroupRef], () => {
} }
const primaryGeoDataValue = row.row[primaryGeoDataColumnTitle] const primaryGeoDataValue = row.row[primaryGeoDataColumnTitle]
if (primaryGeoDataValue == null) { if (primaryGeoDataValue == null) {
return return
} }
const listItems = Object.entries(row.row)
.map(([key, val]) => {
const prettyVal = val !== null && (typeof val === 'object' || Array.isArray(val)) ? JSON.stringify(val) : val
return `<li><b>${key}</b>: <br/>${prettyVal}</li>`
})
.join('')
const popupContent = `<ul>${listItems}</ul>`
const [lat, long] = primaryGeoDataValue.split(';').map(parseFloat) const [lat, long] = primaryGeoDataValue.split(';').map(parseFloat)
addMarker(lat, long, row, popupContent) addMarker(lat, long, row)
}) })
syncCount() syncCount()
}) })

Loading…
Cancel
Save