javascript - Can you get distances by road from google maps? -


i'm trying build function aspx webpage (vb end) can give visitor distance nearest branch location have they're signed in from. i've got lat/long our locations, , can pull location (albeit not accurately) incoming ip, i'm trying figure out how distance they'd have travel. i've been able find equation (i forget name) calculates distance between points "as crow flies"... while work, technically, provide them nearest branch, nice able include mileage in that... , that's going potentially different straight line between 2 points. there way send page request google maps query string of latitude , longitude , receive value of calculated distance provide on actual map/directions page? read on google maps api, , javascript implement it, didn't see how implement functions have on page distance. ideas?

if going display map use google maps api - code samples - direction service.

if need data, use the google directions api.

the google directions api service calculates directions between locations using http request. can search directions several modes of transportation, include transit, driving, walking or cycling. directions may specify origins, destinations , waypoints either text strings (e.g. "chicago, il" or "darwin, nt, australia") or latitude/longitude coordinates. directions api can return multi-part directions using series of waypoints.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -