如何获得更稳定的位置而不是更准确的位置

发布于 2025-01-23 19:11:48 字数 409 浏览 1 评论 0原文

我的应用程序使用FusedLocation -Provider API来检索用户当前位置,并使用以下代码每秒在地图上显示标记,

locationRequest = LocationRequest.create().apply {
            interval = 1000
            fastestInterval = 1000
            priority = LocationRequest.PRIORITY_HIGH_ACCURACY
        }

问题是我所获得的位置,只是不准确,因此标记器即使手机也没有移动。因此,在互联网上查看后,我发现Google说API准确性约为6-10米。因此,现在我想完成的是获得稳定的位置更新,如果仅估计它,这并不重要。重要的是要在地图上显示标记有点稳定。

my app uses the fusedlocationprovider api to retrieve the user current location and showing a marker on the map every second using the following code

locationRequest = LocationRequest.create().apply {
            interval = 1000
            fastestInterval = 1000
            priority = LocationRequest.PRIORITY_HIGH_ACCURACY
        }

the problem is that the location I am getting , just not that accurate so the marker keeps moving even the phone is not. so after looking on the internet I find out that google says that there api accuracy is about 6 - 10 meters . so now what I want to accomplish is to get a stable location update , it does not matter if it is only estimated . what's important is to show the marker a little bit steady on the map.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文