Closest Facility Arcgis online javascript not returning data

241
0
03-05-2019 04:14 PM
AdminLCC
New Contributor

I am trying to use the Closest Facility (CF) function in ArcGIS API for Javascript. I need to be able to pass a shape coming from a feature service as an incident, and use a feature service with multiple points as the facilities.

Currently when I use the Closest Facility task, nothing happens. No calls are made at all if I look at the network activity.

CFTask.solve(CFParams).then(function (solveResult) {
 array.forEach(solveResult.routes, function (route, index) {
 console.log(route);
 });
});

I understand that i may be passing it incorrect data, but would expect an error message, rather than the nothing I get now.

2 questions:

- Does the above code snippet actually run the Closest Facility
function?
- How do add data from a feature service to a feature set correctly?

Tags (1)
0 Kudos
0 Replies