I am adding my feature layers to an array and map as follows:
dojo.forEach(globals.layers, function (addit, i) {
globals.featureLayers = new FeatureLayer(addit.url, {
mode: addit.mode,
id: addit.id,
outFields: addit.outFields,
infoTemplate: addit.infoTemplate
});
if (addit.type == "poly") {
globals.featureLayers.setRenderer(renderer)
}
map.addLayer(globals.featureLayers);
});
This works fine and the layers needed display in the browser. However, when I try to access the graphics array within the feature layer by doing the below in the above forEach statement:
var graphicstmp = globals.featureLayers.graphics;
console.log("Features Layer Properties in base ", graphicstmp)
I get an empty array in graphicstmp. If I look at the globals.featureLayers array in dev tools I see the graphics object there and it is not empty. It has the properties for the layer that are displaying. So apparently I am doing something wrong with trying to access it this way globals.featureLayers.graphics. Help is appreciated. I eventually want to modify some of the properties but I first need to be able to access them.