AnsweredAssumed Answered

FeatureLayer.grahics is empty

Question asked by burton449 on Jan 16, 2014
Latest reply on Jan 16, 2014 by JGBarclay
Hi,

I am new to the javascript API and I dont know what is going wrong in my simple map application. I have a map servcie published by arcgis Server and I would like to select a layer of this service to use in a geoprocessing tool. However, I cant retrieve the graphics of this layer.

I am doing like this:

     require(["esri/map", "dojo/domReady!", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/layers/FeatureLayer", "esri/tasks/Geoprocessor", "esri/SpatialReference",], function(Map) {  /*initializing map, etc... */  var school = new esri.layers.FeatureLayer("http://localhost:6080/arcgis/rest/services/carte1/MapServer/0");    //trying to retieve the graphics with load event because the map service is asynchronous            school.on("load", function(){      inputFeatures.features = school.graphics;      inputFeatures.fields = school.dataAttributes;      alert(inputFeatures.features) //the alert box is empty     }); });



Why can't I get the graphics like this?

Thank you,

Outcomes