javascript - How to find distance only between two places with Google Map API? -
i new use api.
basically developing widget calculate freight between 2 places, need compute distance there no need of showing map.
if 1 has simple explanation please share me.
i have gone through this link not able identify part of code need use finding distance only.
you can use geometry
computedistancebetween()
var placea = new google.maps.latlng(-33.873, 151.13); var placeb = new google.maps.latlng(-33.92, 151.05); console.log(google.maps.geometry.spherical.computedistancebetween(placea, placeb));
reference: https://developers.google.com/maps/documentation/javascript/geometry#sphericalgeometry
Comments
Post a Comment