Mapkit:仅在当前视图中显示注释

发布于 2024-08-30 20:00:58 字数 149 浏览 0 评论 0原文

我不想加载数组中的所有注释,而是只想加载用户当前可以看到的注释(根据他们在地图上放大的程度)。因此,如果用户平移到有注释的位置,这些注释就会被添加,如果用户平移到有注释的地方,这些注释就会被删除。我想这对记忆有帮助。

有谁知道如何做这样的事情?而且,这值得或者需要吗?

Instead of loading all annotations that are in my array, I would only like to load the annotations that the user could currently see cased on how far they are zoomed in on the map. So, if the user pans to a place where there are annotations, those would be added, and if they pan away, those would be removed. I assume this would help with memory.

Does anyone know how to do something like this? And, is it worth it, or needed?

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

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

发布评论

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

评论(1

脱离于你 2024-09-06 20:00:58

不需要。 MapKit 负责优化注释视图的显示和分配。您应该加载所有注释并让框架完成其工作,就像文档建议的那样。

注释本身应该非常小,并且不会对内存使用产生重大影响。

It is not needed. MapKit takes care of optimizing the display and allocation of annotation views. You should load all your annotations and let the framework do its job, just as the documentation advises.

The annotations themselves should be quite small, and should not have a significant hit on memory use.

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