如何让Google地图再次申请位置权限? [英] How to make Google Maps to request again for location permissions?

查看:602
本文介绍了如何让Google地图再次申请位置权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在移动网络应用中使用Google地图,但我注意到,有时当地图提示位置权限时,用户不小心点击拒绝而不是允许,他们需要重新加载页面到正确定位。



有没有办法,例如,有一些JS调用,用户可以触发,例如通过点击按钮来改变他们的选择提供位置访问权限或让浏览器重新提示他们?



感谢您提供任何帮助:)

这是不可能的,如果用户选择了最好的方式,他们可以做的就是清除他们的位置设置以再次接收提示。你不能强迫这个,也不相信你应该或者能够。毕竟它会在哪里结束。



允许还是拒绝?
你确定吗?
确定你确定?
肯定你确定?
等..



请参阅: http://support.google.com/gmm/bin/answer.py?hl=zh_CN&answer=1250068



处理这个问题的正确方法是查找 PERMISSION_DENIED ,然后向用户显示一条消息,例如此应用程序需要使用位置服务,请在您的设备使用这个应用程序或一些这样的。

I'm using Google maps in my mobile web app, but it I've noticed that sometimes when maps prompts for location permissions, users accidentally tap on "Deny" instead of "Allow" and they need to reload the page to be correctly located.

Is there a way to, i.e., have some JS call that users can trigger, let's say by tapping a button for example, to change their choice on giving location access permissions or make the browser re-prompt for them?

Thanks in advance for any help :)

解决方案

This is not possible, If the user opted out the best they can do is to clear their location settings to receive the prompt again. You can't force this, nor I believe should you want or be able to. After all where would it end.

Allow or deny? Are you sure? Sure you're sure? Positive you're sure? Etc..

See: http://support.google.com/gmm/bin/answer.py?hl=en&answer=1250068

The correct way to handle this would be to look for PERMISSION_DENIED and then display a message to your users such as "This application requires the use of location services, please enable them on your device to use this application" or some such.

这篇关于如何让Google地图再次申请位置权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆