File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/tools/ip-geo-location Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,15 @@ const fields: Array<{ field: string; name: string }> = [
17
17
];
18
18
19
19
const geoInfos = ref <CKeyValueListItems >([]);
20
- const geoInfosData = ref <any >({});
20
+ const geoInfosData = ref <{
21
+ loc? : string
22
+ }>({});
21
23
const status = ref <' pending' | ' error' | ' success' >(' pending' );
22
24
const token = useStorage (' ip-geoloc:token' , ' ' );
23
25
24
26
const openStreetMapUrl = computed (
25
27
() => {
26
- const gpsLatitude = geoInfosData .value .lat ;
27
- const gpsLongitude = geoInfosData .value .lon ;
28
+ const [gpsLatitude, gpsLongitude] = geoInfosData .value .loc ?.split (' ,' ) || [];
28
29
return gpsLatitude && gpsLongitude ? ` https://www.openstreetmap.org/?mlat=${gpsLatitude }&mlon=${gpsLongitude }#map=18/${gpsLatitude }/${gpsLongitude } ` : undefined ;
29
30
},
30
31
);
You can’t perform that action at this time.
0 commit comments