显示 100 公里左右的图钉

发布于 2024-08-22 08:53:32 字数 139 浏览 4 评论 0原文

我正在实现一个应用程序,可以在地图上显示客户和我的用户位置。 但现在我遇到了一个问题,因为顾客很多,而且地图很不舒服。

我如何只能在地图或列表中看到距离 100 公里左右的图钉 我?

我希望有人能帮助我?

问候马可

i am implementing an app, that show customers and my userLocation on a map.
But now i have a problem, because there are a lot of costumers and the map is very uncomfortable.

How can i only see pins on a map or in a list, that are around 100 kilometers away from
me?

I hope someone could help me?

Greetings Marco

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

久随 2024-08-29 08:53:32

您应该将当前位置缓存在 CLLocation* 变量中。
您必须使用 [myLoc getDistanceFrom:pinLoc] 计算从该位置添加的每个引脚(注释)的距离,我相信它会返回 CLLocationDistance。如果这是> 100 公里不要将其添加到您的地图中。

you should cache your current location in a CLLocation* variable.
You have to calculate the distance of every pin (annotation) you add from this location using [myLoc getDistanceFrom:pinLoc] which returns a CLLocationDistance i believe. If this is > 100 kms don't add it to your map.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文