开发者

iPhone zoom map to show all pins

开发者 https://www.devze.com 2023-01-23 04:07 出处:网络
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 sh

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消