Mobile Zone is brought to you in partnership with:

Programmed Macs since Inside Mac came in 3-ring binders; programmed iPhones since the first day the SDK was downloadable. 51 apps in the App Store to date, and always looking for new and interesting contracts! Alex is a DZone MVB and is not an employee of DZone and has posted 122 posts at DZone. You can read more from them at their website. View Full User Profile

Tutorial: MapKit Clustering on iOS

12.03.2013
| 2029 views |
  • submit to reddit

Now this is a tutorial you should bookmark for next time you need to display point info on a MapKit map:

How To Efficiently Display Large Amounts of Data on iOS Maps

This tutorial will demonstrate how to handle and display thousands of points of data on an iOS map in a way people understand and enjoy.

We are going to make an iOS app which ships with 87,000 hotels, each with a coordinate, a name and a phone number. This app will never ask the user to “redo search in area”; it will update the map as the user pans and zooms, allowing the user to freely explore the data.

This will require us to come up with an ultra quick data structure built for the task. We will need to build it in C for it to be performant. Once we have constructed our data structure we will come up with a clustering system, as to not overwhelm the user. Finally, we will give it the professional polish that is required for apps to compete in today’s market…

That is one seriously detailed tutorial. Check out the accompanying app at thoughtbot / TBAnnotationClustering!


Published at DZone with permission of Alex Curylo, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)