开发者

how to find the distance from current location to given location?

I am developing an applica开发者_JAVA百科tion related to maps.

By using that I want to develop a code to find the distance from current location to given location, get directions from current location to given location, and get the estimated time to reach from current location to given location.


You get the distance between two locations as follows:

location1.distanceTo(location2);

The result is in meters, as a float. But this is distance as the crow flies.

To get the directions between two locations, including the distance of that route, and the travel time, you need to use Google Directions API

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜