Hi ,
I am using routeresult to get the result of my route. I am getting the length for each segment as well as time.
array.forEach(routeResult.directions.features, function (feature) {
var direction = feature.attributes;
directions.push(direction);
The output is
1: {length: 0.01642324482308207, time: 0.15858421215735188, text: "Go northwest", ETA: -2209161600000, arriveTimeUTC: -2209161600000, …}
Can I get something like
The unit as been set as esriMiles in my code.
Any suggestion will be really helpful.
Thanks
Kumar
Kumar,
Why are you setting the direction length units to esriMiles when you are wanting the output to be in Meters?...
Hi Robert,
The image is just for reference.I am getting miles for distance but I am not sure of time unit as I have not set any time unit there.
Thanks
Kumar
Kumar,
In your output you have time and ETA...
{length: 0.01642324482308207, time: 0.15858421215735188, text: "Go northwest", ETA: -2209161600000, arriveTimeUTC: -2209161600000, …}
Yes.
What I want to know is the units of length: 0.01642324482308207(which I suppose is Miles) and unit for time: 0.15858421215735188?
I am not able to get the unit of time. Is it minute/sec/hr?
Thanks
Kumar
Time is in milliseconds
Thanks a lot Robert. It resolved the issue. But is there any way where we can get the unit of time? Because at the total time its giving me 22.05 which i suppose is minutes
number.format(routeResult.directions.totalTime);
Thanks
Kumar
As I mentioned the unit will be milliseconds. So you just need to format/convert the milliseconds to what ever unit of time you want.
Yes.
What I want to know is the units of length: 0.01642324482308207(which I suppose is Miles) and unit for time: 0.15858421215735188?
I am not able to get the unit of time. Is it minute/sec/hr?
Thanks
Kumar