AnsweredAssumed Answered

Closest Facility using featureService for Facilities

Question asked by GibbyAR on Aug 19, 2013
Has anyone successfully accomplished this? The example uses pre-defined graphic points hard-coded but I need to draw the facilities from a published feature service.

Thanks!

rGibson

*UPDATE* Solved myself....see below should anyone else need the info. Simple actually....

facilitiesFeatureLayer = new FeatureLayer("http://yourURL/arcgis/rest/services/yourService/FeatureServer/0", {
          mode: FeatureLayer.MODE_SNAPSHOT
   });

map.addLayer(facilitiesFeatureLayer);

var facilities = new FeatureSet();
facilities.features = facilitiesFeatureLayer.graphics;

params.facilities = facilities;

Outcomes