navigator.geolocation.getCurrentPostion 的调用次数是否有限制?
这可能不是一个真正的编程问题,但涉及地理定位 Api,因此希望 StackOverflow 是解决此问题的正确位置。
我每隔 3 秒调用 navigator.geolocation.getCurrentPosition 一次。尝试 10-15 次后,响应停止。所以我想知道所进行的调用数量是否有限制,或者是因为我正在使用桌面进行测试,因此每次 API 等待位置更改时都不会返回相同的响应。
有人有什么经验可以分享吗?
谢谢
This is may not be a true programming question but deals with geolocation Api, hence hoping StackOverflow is the right place for this.
I'm calling the navigator.geolocation.getCurrentPosition at every 3 seconds interval. After 10-15 tries the responses stop. So i'm wondering is there a limit on the number of calls being made, Or is it because i'm testing it with a desktop and hence instead of giving back the same response each time the API is waiting for a change of location.
Anyone has any experiences to share ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Firefox 源代码中定义了每个窗口 1500 个请求的限制,但由于该限制相当高,我怀疑这是一个错误: http://mxr.mozilla.org/mozilla-central/source/dom/src/geolocation/nsGeolocation.cpp#96
There is a limit of 1500 request per window defined in the Firefox source, but since it's quite high I suspect it's a bug: http://mxr.mozilla.org/mozilla-central/source/dom/src/geolocation/nsGeolocation.cpp#96
对我来说,似乎有某种限制,但我找不到任何明确的信息。我在 MozillaZine 论坛中询问过这个问题。如果我发现任何事情,我会将其发布在这里。
To me, there seems to be some sort of limit, but I am unable to find any definite information. I asked about it in the MozillaZine forums. If I find out anything, I will post it here.