How to get the "distance by road" in google maps api?
If you try get the distance of:
- Presidente Vargas 817, Centro RJ
- 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.
精彩评论