开发者

How to get the "distance by road" in google maps api?

If you try get the distance of:

  1. Presidente Vargas 817, Centro RJ
  2. rua de santana macaé rj

in Maps v3 API computeDistanceBetween(), you got *155*566.80511451405...but..

in maps.google: you got: 187 km !!!

UPDATE: Maps.google returns the distanc开发者_运维问答e by road, have a way to get this distance?


The computeDistanceBetween() function is giving you a result in meters, as the crow flies. The maps.google.com example is giving a result in kilometers, as the car drives. Thus the route is slightly longer.

The actual driving distance between two points will almost never match the shortest possible distance between them.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜