Hi Robert,
Yes, I'm cloning the graphics as they are added to the new GL:
function createExtentGraphic(amenityGraphicsLayer){
for (g = amenityGraphicsLayer.graphics.length - 1; g>=0; g--){
var graphicClone = new Graphic(amenityGraphicsLayer.graphics.items[g].clone());
extentGraphics.add(graphicClone);
}
}
This gives me the error: "[esri.core.Accessor] Accessor#set Invalid property value, value needs to be one of 'esri.geometry.Extent', 'esri.geometry.Multipoint', 'esri.geometry.Point', 'esri.geometry.Polyline', 'esri.geometry.Polygon', or a plain object that can autocast (having .type = 'extent', 'multipoint', 'point', 'polyline', 'polygon')"
This error seems pretty clear to me, but I'm not sure how to specify the type on the graphic before it is added to the graphic layer.
As you can see, my goal is to iterate through every graphic in the amenityGraphicsLayer GL and add it to the extentGraphics GL (which is a global variable).