Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to manage loading thousands of annotations on mapview

I am developing app on iPhone.

I am using MapView for showing different app users' activity.

So there will thousands of users on my app and i need to show all them on the map with the

different annotations.

So while loading thousands annotations app may get freeze for a while.

I want to know how to load annotations according to the selected region on the map

like image 889
PSD Avatar asked Dec 11 '25 22:12

PSD


1 Answers

You can get the visible portion of the map with MKMapView's visibleMapRect property. Furthermore, if you're loading heaps of data, make sure you do it on a background thread. This is super easy with Grand Central Dispatch - I'd recommend watching the GCD sessions from this and last year's WWDC - they'll literally change your life.

like image 84
Morgan Harris Avatar answered Dec 14 '25 11:12

Morgan Harris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!