开发者

show pins around 100kilometers

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜