使用 Map Kit 平铺注释
使用 Map Kit 的注释,您可以将图钉甚至自定义图像放置到地图上。凉爽的。
然而,我使用的数据有数百万个位置,分布在世界各地。我不想将它们全部转储到地图上,特别是因为用户只查看其中的一小部分。它会破坏响应能力,甚至可能崩溃。
是否有一种标准技术可以仅在需要时将这些图钉放置到地图上?即仅当它们需要位于地图视图(以及紧邻的周围区域)上时。当用户滚动离开时删除它们。类似于 UITableView 的 dequeueReusableCell 的东西..?
Using annotations with Map Kit, you can put pins, or even custom images onto the map. Cool.
However, the data I'm using has millions of locations, spread out across the world. I don't want to dump them all on the map, especially since the user is only looking at a small bit of it. It would kill responsiveness, and probably crash.
Is there a standard technique for putting these pins on to the map only when required? i.e only when they need to be on the map view (and the immediately surrounding area). And removing them when the user has scrolled away. Something similar to UITableView's dequeueReusableCell..?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有
MKMapView
的dequeueReusableAnnotationViewWithIdentifier:
方法似乎完全符合您的要求。There's
MKMapView
'sdequeueReusableAnnotationViewWithIdentifier:
method which seems to do exactly what you want.请查看此代码: http://www.cocoanetics.com/parts/parts/parts/dtclustermaker/
虽然是 100 欧元,但这当然取决于您对该金额的使用情况。但这可能是值得的。如果没有,它可能会让你通过谷歌搜索找到其他东西。
Check out this piece of code: http://www.cocoanetics.com/parts/dtclustermaker/
While it's 100 EUR, it certainly depends on your usage for that amount of money. But it might be worth it. If not, it might get you on your way to find something else via Google searching.