In my app I need to draw many placemarks and continuously update their location (or delete them if they become old). Now I'm doing it with some cascade and sequential loops, and my fear is that this is not the most efficient way to do it. Here it is how I do this work up to now:
I repeat these 2 loops each 2 seconds.
The problem is that when I manage 20 placemarks or more, the loops take too much time and the update-remove process doesn't work as expected.
Which is the fastest method to work with annotations array? Is it faster removing each annotation and redrawing them all?
I solved the problem. I was doing it in the right way. The only remaining problem was the freeze of the screen during map update. For this reason i solved running the update/delete process on another thread. This means that when you are ready to update the placemark or to delete it, your background thread needs to call the map update on the main thread (the map must be updated on the main thread).