问题
I am new at Google Maps. I want to the get distance from one place to another place and plot it on a map.
e.g: Place1 and Place2 Distance - xxx Km (xx miles) and plot it on map.
Please take a look.
回答1:
Use the geometry library computeDistanceBetween() function. If you don't have the coordinates, use the Geocoder to get them.
Example (based off of the example in the documentation)
来源:https://stackoverflow.com/questions/13542052/google-maps-api-get-two-locations-distance-and-plot-on-map