Skip to content

Commit a0b8cf0

Browse files
committed
fix: link to openstreetmap
1 parent 20e138c commit a0b8cf0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/tools/ip-geo-location/ip-geo-location.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ const fields: Array<{ field: string; name: string }> = [
1717
];
1818
1919
const geoInfos = ref<CKeyValueListItems>([]);
20-
const geoInfosData = ref<any>({});
20+
const geoInfosData = ref<{
21+
loc?: string
22+
}>({});
2123
const status = ref<'pending' | 'error' | 'success'>('pending');
2224
const token = useStorage('ip-geoloc:token', '');
2325
2426
const openStreetMapUrl = computed(
2527
() => {
26-
const gpsLatitude = geoInfosData.value.lat;
27-
const gpsLongitude = geoInfosData.value.lon;
28+
const [gpsLatitude, gpsLongitude] = geoInfosData.value.loc?.split(',') || [];
2829
return gpsLatitude && gpsLongitude ? `https://www.openstreetmap.org/?mlat=${gpsLatitude}&mlon=${gpsLongitude}#map=18/${gpsLatitude}/${gpsLongitude}` : undefined;
2930
},
3031
);

0 commit comments

Comments
 (0)