AnsweredAssumed Answered

Closest Facility Service with Asynchronous Execution

Question asked by shaun_weston-eagle-co-nz-esridist on Jul 25, 2013
Latest reply on Sep 19, 2016 by hrithikesh3485
I've been trying to solve a closest facility task with asynchronous execution, but not having much luck so far. It's works fine for synchronous excecution

e.g. The below works fine on http://route.arcgis.com/arcgis/rest/services/World/ClosestFacility/NAServer/ClosestFacility_World
but not
http://logistics.arcgis.com/arcgis/rest/services/World/ClosestFacility/GPServer/FindClosestFacilities


// Push map click into incident parameter var features = []; features.push(location); var incidents = new esri.tasks.FeatureSet(); incidents.features = features; closestFacilityParams.incidents = incidents;   var inPoint = new esri.geometry.Point("1719868", "6047566", app.map.spatialReference); var location = new esri.Graphic(inPoint, configOptions.markerSymbol); var features = []; features.push(location); var facilities = new esri.tasks.FeatureSet(); facilities.features = features; closestFacilityParams.facilities = facilities;   closestFacilityTask.solve(closestFacilityParams, function (result) {    alert(result.routes.length); });


The reason I need use the async service is I have over 100 facilities.

Outcomes