AnsweredAssumed Answered

Find Graphic based on Attribute

Question asked by andrewb on May 11, 2012
Latest reply on May 14, 2012 by andrewb
I have a graphicslayer containing several polygon graphics.  I want to select one specific graphic based on an attribute value and remove all but that graphic.  I'm not quite sure how to do this.  I'm imagining some sort of for loop but i'm not sure how to get the collection of graphics in the graphics layer... 

for(Graphic graphic: graphicsLayer.getGraphics(??)){   if(!graphic.getAttributeValue("PIN")=="1234"){   graphicsLayer.removeGraphic(graphic.getUid()); } }


Thanks for any help!

Outcomes