Mapkit: show only annotations in the current view

Instead of loading all the annotations that are in my array, I would just like to load the annotations that the user can currently see how they scale on the map. So, if the user clicks on the place where there are annotations, they will be added, and if they bounce, they will be deleted. I guess this will help with memory.

Does anyone know how to do this? And is it worth it or is it necessary?

+3
source share
1 answer

It is not necessary. MapKit takes care of optimizing the display and placement of annotation views. You must download all of your annotations and let the framework do its work as indicated in the documentation.

Annotations themselves should be fairly small and should not have a significant impact on memory usage.

+4
source

Source: https://habr.com/ru/post/1743855/


All Articles