【问题标题】:current location is not accurate using getCurrentPosition使用 getCurrentPosition 当前位置不准确
【发布时间】:2020-11-21 05:53:53
【问题描述】:

无法获得准确的位置,但它与我当前的位置不同。

这是我实现的 url https://www.w3schools.com/html/html5_geolocation.asp

if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition((position) => {
          
          // this.showPosition(position);
              console.log("swd",position.coords)

        });
      }

【问题讨论】:

    标签: javascript html geolocation


    【解决方案1】:

    正如该页面上所说的,Note: Geolocation is most accurate for devices with GPS, like smartphones.,因此,如果您没有使用 GPS 设备,它可能会基于您的 IP 地址,如果您使用的是公司/大学网络或任何类型的代理背后

    【讨论】:

    • 我有我的笔记本电脑,它可以在笔记本电脑上使用 wifi 连接互联网吗
    • 答案适用于任何设备
    猜你喜欢
    • 2019-10-19
    • 1970-01-01
    • 1970-01-01
    • 2021-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多