Select to view content in your preferred language

Find the travelModeName of Directions widget arcgis api 3.38

815
2
Jump to solution
11-05-2021 04:43 AM
benchikh
Regular Contributor

Hi,

Im working with Directions widget on arcgis api js 3.38...... Actually I can get all the directions details such as (features, stops, sommury, strrings,... and other details) as below

directionsW.on("directions-finish", changeHandler);

function changeHandler(data) {
console.log("done", data.result);
}

but the question is how can I get the travelModeName paramter as I need to recuperate it from the directions details result ?

https://developers.arcgis.com/javascript/3/jsapi/directions-amd.html#travelmodename

any idea please ?

 

0 Kudos
1 Solution

Accepted Solutions
Noah-Sager
Esri Regular Contributor

Another great question. It's there in the Route Parameters, just took some digging to find. Try this:

directionsW.on("directions-finish", changeHandler);
function changeHandler(data) {
   console.log("travelMode: ", data.target.routeParams.travelMode.name);
}

 

View solution in original post

2 Replies
Noah-Sager
Esri Regular Contributor

Another great question. It's there in the Route Parameters, just took some digging to find. Try this:

directionsW.on("directions-finish", changeHandler);
function changeHandler(data) {
   console.log("travelMode: ", data.target.routeParams.travelMode.name);
}

 

benchikh
Regular Contributor

Many thanks for your great help !

0 Kudos