Hello,
We have built a custom map application using Arcgis/core 4.24.7. Per the documentation for the route api, you can solve it using just the api key but thats not the case when you go to solve method in code. always requires you to enter route params. I initialize a route params object with my api key and stops needed. This is the error I get back when the solve method is rejected
TypeError: t.toJSON is not a function
at l._writeNetworkFeatures (RouteParameters.js:5:3920)
at l.writeStops (RouteParameters.js:5:2346)
at f (write.js:5:472)
at d (write.js:5:1835)
at l.write (JSONSupport.js:5:657)
at l.toJSON (JSONSupport.js:5:690)
at e.toQueryParams (queryUtils.js:5:187)
at route.js:5:1591
at Generator.next (<anonymous>)
at asyncGeneratorStep (asyncToGenerator.js:3:1)
below is my route layer angular code
//test stop coordinates
also want to ask why route layer solves with RouteLayerSolveResult but routeLayer.update() is expecting a RouteLayerUpdateRouteLayerSolveResult object.
big disconnect from the docs. please help
I ran into this same issue today. Stop.toJSON() is missing in the TypeScript definitions, even though it is in the docs. Running latest JS 4.28.10. This is definitely a bug in the JS library. The workaround is to use a FeatureSet instead of a collection of Stops.