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

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -