After solving a route, stop fields passed through a feature set are not being preserved

10-05-2021 06:20 AM
New Contributor II

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) {
            let newStops = data.routeResults[0].stops;



Any pointers on where I am doing something wrong would be much appreciated!  Thanks

0 Replies