From a0b8cf0301ec1d2dab235116c14f3946c6b9d48e Mon Sep 17 00:00:00 2001 From: ShareVB Date: Sun, 21 Jul 2024 21:26:11 +0200 Subject: [PATCH] fix: link to openstreetmap --- src/tools/ip-geo-location/ip-geo-location.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tools/ip-geo-location/ip-geo-location.vue b/src/tools/ip-geo-location/ip-geo-location.vue index 26394f5f..e829fde6 100644 --- a/src/tools/ip-geo-location/ip-geo-location.vue +++ b/src/tools/ip-geo-location/ip-geo-location.vue @@ -17,14 +17,15 @@ const fields: Array<{ field: string; name: string }> = [ ]; const geoInfos = ref([]); -const geoInfosData = ref({}); +const geoInfosData = ref<{ + loc?: string +}>({}); const status = ref<'pending' | 'error' | 'success'>('pending'); const token = useStorage('ip-geoloc:token', ''); const openStreetMapUrl = computed( () => { - const gpsLatitude = geoInfosData.value.lat; - const gpsLongitude = geoInfosData.value.lon; + const [gpsLatitude, gpsLongitude] = geoInfosData.value.loc?.split(',') || []; return gpsLatitude && gpsLongitude ? `https://www.openstreetmap.org/?mlat=${gpsLatitude}&mlon=${gpsLongitude}#map=18/${gpsLatitude}/${gpsLongitude}` : undefined; }, );