Select to view content in your preferred language

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

305
0
10-05-2021 06:20 AM
JeffHaupt
Emerging Contributor

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

0 Replies