iPhone zoom map to show all pins
I've just found this for doing this on the Android but has anyone got this to work on the iPhone?
What I'm looking for is a method that will zoom the开发者_开发技巧 map to show all pins that are showing...
Thanks
I'm not sure if there's a built in method, but the usual way is to loop through your annotations, looking at their coordinates, and find the maximum and minimum latitudes and longitudes. You'll end up with 4 numbers, you can create a region from them and set the map to that region.
Here is the solution! :)
http://sdhillon.com/find-the-center-and-span-of-a-set-of-points-android-and-iphone-example/
精彩评论