|
@@ -117,6 +117,24 @@ function onClickCloseText() {
|
|
|
isShowText.value = false;
|
|
|
}
|
|
|
|
|
|
+console.log("geolocation: ", navigator.geolocation);
|
|
|
+navigator.geolocation.getCurrentPosition(
|
|
|
+ // navigator.geolocation.watchPosition(
|
|
|
+ (pos) => {
|
|
|
+ console.log(
|
|
|
+ `pos by geolocation: ${pos.coords.longitude}, ${pos.coords.latitude}, ${pos.coords.altitude}, ${pos.coords.accuracy}`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.error("geolocation error: ", err);
|
|
|
+ },
|
|
|
+ {
|
|
|
+ enableHighAccuracy: true,
|
|
|
+ timeout: 10000,
|
|
|
+ maximumAge: 0,
|
|
|
+ }
|
|
|
+);
|
|
|
+
|
|
|
// 导航相关
|
|
|
const isNavigating = ref(false);
|
|
|
function onClickLocateBtn() {
|