Home  >  Q&A  >  body text

html5 - H5页面navigator.geolocation接口获取用户的经纬度,用户拒绝授权后无法再次获取到经纬度

在H5页面用navigator.geolocation接口获取用户的经纬度,进入页面的时候会弹出一次是否同意的获取地理位置的消息,但是当用户拒绝后,再次进入页面就无法获取到经纬度了。也不重新弹出是否同意的获取地理位置的消息框。
页面是在微信上打开的。
请问这种情况有什么解决方法?

怪我咯怪我咯2742 days ago956

reply all(2)I'll reply

  • 迷茫

    迷茫2017-04-17 12:05:12

    Due to privacy and security considerations, when using geolocation for positioning, the browser will ask the user whether to allow sharing of location information; when the user performs the "allow" or "disallow" operation, general browsers will I’m not sure about the current site cache operation method or its effective time! The next time you enter the modified site, it will not pop up again. After the user refuses, the location cannot be obtained. You can locate it through IP positioning, provided that you have a corresponding service support. Hope it helps you

    reply
    0
  • 阿神

    阿神2017-04-17 12:05:12

    There is no other way, the user can only manually remove the rules...usually in the user privacy settings

    reply
    0
  • Cancelreply