Select to view content in your preferred language

get driving distance

1430
1
08-24-2016 11:05 AM
ThomasDunajski
Deactivated User

Hi,

I need the driving distance between 2 points in js. I found this:
 Analysis - Calculate travel time and distance | ArcGIS API for JavaScript 3.17 
But I can't find anything in the 4.0 api. I actually don't need a map, just the driving distance. Anything I found in the 4.0 documentation is about getting the 'shortest' or 'euclidean' distance. If anybody can point me towards a piece of documentation id be grateful

0 Kudos
1 Reply
nita14
by
Frequent Contributor

Indeed, it is already in 4.0. Sample guide: Simple Routing - RouteTask | ArcGIS API for JavaScript 4.0 . Open it in Sandbox and put console.log(routeResult.attributes.Total_Kilometers) in 118 line.

Hope this helps,

Adam