带传单的浏览器地理定位
browser geolocation with leaflet
我在我的应用程序中成功使用了 map.locate()。
现在我想自定义浏览器的默认弹出窗口,特别是发送我自己的消息,向用户解释为什么网站要求获得该职位的许可。
我想在要求 locate 解释之前避免使用另一个弹出窗口。
我在 API 文档中没有看到那种设置,是否可以传递自定义消息?
谢谢
正如您自己所说,此消息不是来自 Mapbox 或 Leaflet,而是直接来自浏览器。从navigator.geolocation
API来具体说。 API(在 MDN 上)状态的文档:
Note: For security reasons, when a web page tries to access location information, the user is notified and asked to grant permission. Be aware that each browser has its own policies and methods for requesting this permission.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/geolocation
我敢肯定,没有浏览器会让您更改其对话框。安全方面,最好对用户保持一致,这样每次他们得到一个对话框时,他们看起来都很熟悉。样式化或更改对话框的内容令人困惑。如果您想提供有关为什么使用地理定位的额外信息,您需要找到另一种方式将其转发给您的用户。
我在我的应用程序中成功使用了 map.locate()。 现在我想自定义浏览器的默认弹出窗口,特别是发送我自己的消息,向用户解释为什么网站要求获得该职位的许可。 我想在要求 locate 解释之前避免使用另一个弹出窗口。
我在 API 文档中没有看到那种设置,是否可以传递自定义消息? 谢谢
正如您自己所说,此消息不是来自 Mapbox 或 Leaflet,而是直接来自浏览器。从navigator.geolocation
API来具体说。 API(在 MDN 上)状态的文档:
Note: For security reasons, when a web page tries to access location information, the user is notified and asked to grant permission. Be aware that each browser has its own policies and methods for requesting this permission.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/geolocation
我敢肯定,没有浏览器会让您更改其对话框。安全方面,最好对用户保持一致,这样每次他们得到一个对话框时,他们看起来都很熟悉。样式化或更改对话框的内容令人困惑。如果您想提供有关为什么使用地理定位的额外信息,您需要找到另一种方式将其转发给您的用户。