kuigoo / issues

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML5 定位问题

kuigoo opened this issue · comments

HTML5 中的地理位置 API 通过 navigator.geolocation 对象提供。

getCurrentPosition

默认会快速返回一个低精度定位结果(基于 IP 或 WIFI),有 GPS 的设备可能会通过一分钟或更久来通过 GPS 获取定位(高精度)

当调用 getCurrentPosition 时在 ios safari & chrome 中可能会报错

origin does not have permission to use geolocation service

检查网站是否 Secure:

  • secure domain (https)
  • secure origins (页面是否含有 http 的资源)

permission denied

是否对承载页面的 App or Browser 授权定位

多谢大佬~
是页面中不能有包含http资源的链接, 否则调用返回错误:
origin does not have permission to use geolocation service