Clustering Annotations on MapKit

Hi, I am new in iOS development. I am currently developing an app that shows a large amount of gas stations on the map. Whenever I try running it, performance is really poor, given the fact that there are about 9000 annotations being displayed at a time.


I was wondering if anyone could help me out, explaining a way to cluster annotations that are nearby, so as to increase performance, and also style (the map is overloaded with pins).

There's pretty good sample code which does exactly that.


https://developer.apple.com/library/ios/samplecode/PhotoMap/Introduction/Intro.html

Thank you so much EoinN, I am going to try following that tutorial, to see if I can apply it to my app.

Hi 🙂

I want to display many annotations on the map. The problem is, that the example PhotoMap-App from Apple is building new clusters when you zoom in and out just a little. The same thing happens in all open libraries I've found on the internet.

The maps-app in iOS 10 is doing a much better job. Is there a way to cluster annotations like the maps-app in iOS 10 do?

Clustering Annotations on MapKit
 
 
Q