I am passing a FeatureSet into the stops for RouteParameters. When looking at the RouteParameters using a console.log, I can see the Fields I have specified for the stops. However, once the route.solve is run, the stops that are returned did not preserve any of the information I was trying to pass in. Here's the snippet of code that I am using:
const routeParams = new RouteParameters({
stops: new FeatureSet({ features: featureStops, fields: fields, objectIdField: "ObjectID" }),
findBestSequence: true,
preserveFirstStop: true,
returnStops: true,
restrictUTurns: "at-dead-ends-only",
returnDirections: true,
directionsLanguage: "en_US"
});
route.solve(routeUrl, routeParams)
.then((data)=> {
if (data.routeResults.length > 0) {
showRoute(data.routeResults[0].route);
//console.log(routeParams);
let newStops = data.routeResults[0].stops;
//console.log(data.routeResults[0]);
//console.log(newStops);
Any pointers on where I am doing something wrong would be much appreciated! Thanks