开发者

show pins around 100kilometers

开发者 https://www.devze.com 2022-12-21 11:31 出处:网络
i am implementing an app, that show customers and my userLocation on a map. But now i have a problem, because ther开发者_StackOverflow中文版e are a lot of costumers and the map is very uncomfortable.

i am implementing an app, that show customers and my userLocation on a map. But now i have a problem, because ther开发者_StackOverflow中文版e are a lot of costumers and the map is very uncomfortable.

How can i only see pins on a map or in a list, that are around 100 kilometers away from me?

I hope someone could help me?

Greetings Marco


you should cache your current location in a CLLocation* variable. You have to calculate the distance of every pin (annotation) you add from this location using [myLoc getDistanceFrom:pinLoc] which returns a CLLocationDistance i believe. If this is > 100 kms don't add it to your map.

0

精彩评论

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

关注公众号