iPhone MapKit - 同时删除多个图钉

发布于 2024-09-30 02:24:24 字数 227 浏览 0 评论 0原文

在我的应用程序中,我添加了很多引脚,并且在 viewForAnnotaion 中,我在 MKPinAnnotaionView 上设置了 animatesDrop=TRUE。问题是,当有 200 多个引脚时,一个接一个地掉落需要很长时间。我见过一次性删除所有图钉的应用程序,我想知道如何做到这一点。

如果我不清楚,请告诉我。

谢谢!

In my app i'm adding alot of pins and in viewForAnnotaion I set animatesDrop=TRUE on my MKPinAnnotaionView. The problem is that when having 200+ pins dropping one by one takes a long time. I have seen Apps that drops all pins at once and wonder how to do that.

Let me know if i'm not clear.

Thanks!

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

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

发布评论

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

评论(2

满地尘埃落定 2024-10-07 02:24:24

你所做的并没有错 - 但你可能想尝试在辅助线程上创建这些引脚(你的应用程序会更快)。

此外,您可能有一些计算成本较高的操作,您可能希望将其移至委托方法之外(即 viewForAnnotation)。

最后,您可以尝试靠近较小的区域,以便您的地图显示更少的图钉。

What you are doing is not wrong - but you might want to try creating those pins on a secondary thread (your app will be snappier).

Also, you might have operations that are computationally expensive that you might want to move outside the delegate method (i.e. viewForAnnotation).

Finally, you can try closing in on a smaller area, so that your map displays less pins.

她说她爱他 2024-10-07 02:24:24

我认为这是通过检测引脚最接近来以编程方式完成的。
您可以根据地图缩放构建不同的引脚列表,以仅显示屏幕上 x 像素间隔的引脚。

I think it is done programmatically by detecting that pins are closest.
You could build differents list of pins depending on the map zoom to display only pins that are separates of x pixels on the screen.

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