Closest Facility using featureService for Facilities

550
0
08-19-2013 06:58 AM
by Anonymous User
Not applicable
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;
0 Replies