Select to view content in your preferred language

Help with Feature Layer SELECTION_SUBTRACT

1951
1
11-30-2011 05:35 PM
DaveEaton
Emerging Contributor
I am having problems removing a selected feature from my feature layers.  I am getting the correct feature selected, but the actual removal of the graphic is not working.  The code below shows one of my feature layer selections with the SELECTION_SUBTRACT method, and its responder "removeFeaturesHandler".

case "TEL=COMNT":
   cmntLayer.selectFeatures(remQuery, FeatureLayer.SELECTION_SUBTRACT,
 new AsyncResponder(removeFeaturesHandler, removeFeaturesFault));

protected function removeFeaturesHandler(features:Array, token:Object = null):void
   {   
    for each (var remgraphic:Graphic in features)
     myGraphicsLayer.remove(remgraphic);   
   }


I've been debugging this and the remgraphic variable is populated with a graphic id, but it doesn't correspond to any of the graphic ids I see in the graphicProvider array.  Where am I going wrong?
Tags (2)
0 Kudos
1 Reply
DaveEaton
Emerging Contributor
Should anyone stumble across this thread...the problem I was having was when I initially rendered the features I was using FeatureLayer.MODE_ON_DEMAND instead of using FeatureLayer.SELECTION_ADD.  Everything works like a charm now.
0 Kudos