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; }, );