diff --git a/packages/nc-gui/components.d.ts b/packages/nc-gui/components.d.ts index 372758da9a..41be648f73 100644 --- a/packages/nc-gui/components.d.ts +++ b/packages/nc-gui/components.d.ts @@ -104,6 +104,7 @@ declare module '@vue/runtime-core' { MaterialSymbolsFileCopyOutline: typeof import('~icons/material-symbols/file-copy-outline')['default'] MaterialSymbolsKeyboardReturn: typeof import('~icons/material-symbols/keyboard-return')['default'] MaterialSymbolsLightModeOutline: typeof import('~icons/material-symbols/light-mode-outline')['default'] + MaterialSymbolsMobileFriendly: typeof import('~icons/material-symbols/mobile-friendly')['default'] MaterialSymbolsRocketLaunchOutline: typeof import('~icons/material-symbols/rocket-launch-outline')['default'] MaterialSymbolsSendOutline: typeof import('~icons/material-symbols/send-outline')['default'] MaterialSymbolsTranslate: typeof import('~icons/material-symbols/translate')['default'] @@ -187,6 +188,7 @@ declare module '@vue/runtime-core' { MdiFunction: typeof import('~icons/mdi/function')['default'] MdiGestureDoubleTap: typeof import('~icons/mdi/gesture-double-tap')['default'] MdiGithub: typeof import('~icons/mdi/github')['default'] + MdiGpsFixed: typeof import('~icons/mdi/gps-fixed')['default'] MdiGraphOutline: typeof import('~icons/mdi/graph-outline')['default'] MdiHeart: typeof import('~icons/mdi/heart')['default'] MdiHook: typeof import('~icons/mdi/hook')['default'] @@ -237,6 +239,7 @@ declare module '@vue/runtime-core' { MdiTableColumnPlusBefore: typeof import('~icons/mdi/table-column-plus-before')['default'] MdiTableKey: typeof import('~icons/mdi/table-key')['default'] MdiTableLarge: typeof import('~icons/mdi/table-large')['default'] + MdiTestTube: typeof import('~icons/mdi/test-tube')['default'] MdiText: typeof import('~icons/mdi/text')['default'] MdiThumbUp: typeof import('~icons/mdi/thumb-up')['default'] MdiTrashCan: typeof import('~icons/mdi/trash-can')['default'] diff --git a/packages/nc-gui/components/cell/GeoData.vue b/packages/nc-gui/components/cell/GeoData.vue index 0ab6575361..d17cd77076 100644 --- a/packages/nc-gui/components/cell/GeoData.vue +++ b/packages/nc-gui/components/cell/GeoData.vue @@ -49,14 +49,14 @@ const clear = () => { const onClickSetCurrentLocation = () => { isLoading = true - const onSuccess = (position) => { + const onSuccess: PositionCallback = (position: GeolocationPosition) => { const crd = position.coords - formState.latitude = crd.latitude - formState.longitude = crd.longitude + formState.latitude = `${crd.latitude}` + formState.longitude = `${crd.longitude}` isLoading = false } - const onError = (err) => { + const onError: PositionErrorCallback = (err) => { console.error(`ERROR(${err.code}): ${err.message}`) isLoading = false } @@ -68,13 +68,25 @@ const onClickSetCurrentLocation = () => { } navigator.geolocation.getCurrentPosition(onSuccess, onError, options) } + +const openInGoogleMaps = () => { + const [latitude, longitude] = (vModel.value || '').split(';') + const url = `https://www.google.com/maps/search/?api=1&query=${latitude},${longitude}` + window.open(url, '_blank') +} + +const openInOSM = () => { + const [latitude, longitude] = (vModel.value || '').split(';') + const url = `https://www.openstreetmap.org/?mlat=${latitude}&mlon=${longitude}#map=15/${latitude}/${longitude}` + window.open(url, '_blank') +}