Pretty straight forward: I am simply trying to get a feature layer
var floodLayer = new FeatureLayer("URL");
and convert it to a polygon array similar to:
var polygons = [];
for (var i = 0; i < floodLayer.graphics.length; i++) {
var polygons = new Polygon({ "rings": floodLayer.graphics.rings, "spatialReference": floodLayer.graphics.spatialReference });
}
However, feature layers don't appear to have the appropriate properties to create polygons. Unless I am missing something?
I think you are making it harder than it is.. The geometry is already the 'Polygon'
Try the below sample
//ARRAY OF POLYGONS
var polygons = [];
//LOOP THROUGH ARRAY OF GRAPHICS AND ADD TO POLYGON ARRAY
array.forEach(floodLayer.graphics, function (graphic)
{
polygons.push(graphic.geometry);
});
//PRINT TO CONSOLE
console.debug(polygons);
Drew