简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM