Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show single annotation pin for a region when i have multiple coordinates for that region?

I am working on the map application and as per requirement i need to show a single pin for a single region even if it has multiple user coordinates when its completely zoomed out but when its zoomed in to the map then i should display all the pins as per its coordinates. I have given example below to explain my problem. I have city New York on this city I have 100 pins on my mapview when I am zooming out of my map it should show me only one annotation pin on the place of 100 pins but when I am zooming in then it should show again 100 pin on map. Does any one knows about this. I need suggestion. Please note that I am getting all the locations from web services except my current location. This should not be affecting application so that application shouldn't become slow.

Please suggest some solution.

like image 412
Dipti Y W Avatar asked Dec 02 '25 08:12

Dipti Y W


1 Answers

The Apple WWDC 2011 video, "Visualizing information geographically with MapKit", https://developer.apple.com/videos/wwdc/2011/ shows how to cluster map annotations - it's exactly what you need.

like image 56
paul.lander Avatar answered Dec 03 '25 23:12

paul.lander



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!