I have routing set up in my web app and working, except when I try to add a rest feature service for polygonBarriers property of RouteParameters, it fails. This is how I'm defining the polygonBarriers in the RouteParameters:
const routeParams = new RouteParameters({
stops: new FeatureSet({
features: view.graphics.toArray()
}),
returnPolygonBarriers: true,
polygonBarriers: {
"url" : "https://maps.gilbertaz.gov/arcgis/rest/services/GilbertDays2022Closure/FeatureServer/1/query?where=1%3D1&returnGeometry=true&f=json"
}
});
The error I get is below. I am pretty sure I am doing this the way the javascript API Reference show it, however I am not getting this to work. I get this error in the console:
RouteParameters.js:5 Uncaught (in promise) TypeError: n.toJSON is not a function
at r (RouteParameters.js:5:156)
at f.writePolygonBarrier (RouteParameters.js:8:186)
at q ((index):263:421)
at a.write ((index):266:327)
at f.write ((index):254:370)
at f.toJSON ((index):254:420)
at e.routeParametersToQueryParameters (utils.js:5:115)
at Module.<anonymous> (route.js:6:98)
at Generator.next (<anonymous>)
at d ((index):35:26)
Thanks in advance for any assistance provided. It may just be something minor that I'm overlooking, I've never worked with routing before...