MKMapKit实用最大MKPolylines数量
是否有任何已发布的基准测试,或者您是否有任何关于可以在 iPhone 和 iPad 上以合理性能添加到地图中的 MKPolylines 的指示?
我想添加数千个。
我的最高限额是多少?
Is there any published benchmarks or do you have any indication about how many MKPolylines you can add to a map with reasonable performance on iPhone and iPad?
I would like to add thousands of them.
What would be my top limit?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道 MKPolylines,但我尝试渲染 1200 个 MKPolygon,并且成功渲染它而没有崩溃。但它表现出一些较慢的性能。我认为没有限制。我的建议是一切都值得尝试。
I dont know about MKPolylines but i have tried rendering 1200 MKPolygons and i successfully rendered it without crashing. But it showed be some slower performance. I dont think there is a limit for it. What i would suggest is everything is worth a try.
我的应用程序(Circle 8)有大约 70 条 MKPolylines,它们在地图中都有自己单独的 MKOverlayView。性能/平移非常慢,内存警告来得又快又猛。我最终将所有这些包装到一个视图(MKOverlayPathView 的子类)中,该视图使用简单的 CGPath 调用绘制每个 MKPolyline。性能/平移/内存问题已解决。公平地说,这并不是我的原创想法,而是主要来自此处相关的 Apple 开发者论坛线程:
https://devforums.apple.com/message/328631#328631
My app (Circle 8) has about 70 MKPolylines that all had their own separate MKOverlayView in the map. Performance/panning was horribly slow and the memory warnings came in fast and furious. I ended up wrapping all these into a single view (subclass of MKOverlayPathView) that draws each MKPolyline using simple CGPath calls. Performance/panning/memory problems SOLVED. To be fair, this was not an original thought on my part but rather came largely from the related Apple Developer Forum thread here:
https://devforums.apple.com/message/328631#328631