开发者

Location Services iPhone

开发者 https://www.devze.com 2023-03-15 07:07 出处:网络
what is the best way to determine if two iPhone users are in the same radius of lets say 1000 meters.

what is the best way to determine if two iPhone users are in the same radius of lets say 1000 meters.

What I am thinking is, both phones find out there location, th开发者_开发技巧en submit it to a central server. The problem is how would I figure out if they are within a certain distance of each other.


Use the haversine formula on the server to get a rough estimate on distances, and serve only the closest 4 or 5 to a the clients phone, then it can get a more accurate distance using the method distanceFromLocation: on CLLocation with just the few records sent by the server.

0

精彩评论

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

关注公众号