开发者

MKMapKit true distance between two annotations

开发者 https://www.devze.com 2023-02-10 04:26 出处:网络
I want to make a application that calculates the distance between the user\'s current location and the nearest something (store, whatnot). Is there any way to obtain the real distance (following publi

I want to make a application that calculates the distance between the user's current location and the nearest something (store, whatnot). Is there any way to obtain the real distance (following public roads ) instead of a direct dista开发者_开发问答nce (line from point A to B) ??

Thank you


Use google API to get the route and distance: http://code.google.com/apis/maps/documentation/directions/

I don't think you can get the route (following roads) from MKMapKit.

The google maps API will return the route (following roads) as a set of latitude and longitude coordinates. It will also return the calculated distance.

0

精彩评论

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