开发者

Mapkit: Only show annotations in current view

开发者 https://www.devze.com 2022-12-29 04:22 出处:网络
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

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 h开发者_如何学JAVAelp with memory.

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消