+ Reply to Thread
Results 1 to 2 of 2

Thread: FeatureLayer.SELECTION_ADD - am I doing this wrong?

  1. #1
    Rene Rubalcava
    Join Date
    Apr 2010
    Posts
    464
    Points
    239
    Answers Provided
    39


    0

    Default FeatureLayer.SELECTION_ADD - am I doing this wrong?

    I recently tried updating an app to allow adding selections to a FeatureLayer. This is using the 2.4 Flex API (want to avoid updating for the moment).
    I'm not doing any editing, I'm just loading the FeatureLayer with a service url like so
    http://internalserver/ArcGIS/rest/se...es/MapServer/4
    I create my FeatureLayer like so
    Code:
    fLayer.mode = FeatureLayer.MODE_SELECTION
    This thread suggests that I should use FeatureLayer.SELECTION_ADD when initializing, but when I did that, no selections worked.

    Anyway, I can do a selection using the default "new"
    Code:
    fLayer.selectFeatures( query, FeatureLayer.SELECTION_NEW, new AsyncResponder( onSewerFeaturesSelected, onFault ));
    Then when I try to add to this selection at some point after the results are shown
    Code:
    fLayer.selectFeatures( query, FeatureLayer.SELECTION_ADD, new AsyncResponder( onSewerFeaturesSelected, onFault ));
    It doesn't add new features to the selection, it just does a new selection and clears what was previously selected.

    These queries are being done via a geometry if that matters.

    Maybe I'm misunderstanding what FeatureLayer.SELECTION_ADD does when in FeatureLayer.MODE_SELECTION.

    I can probably work around it by saving my selected graphics and adding them back, but I would think the above method should work.
    Last edited by odoe; 03-13-2012 at 02:46 PM.

  2. #2
    Rene Rubalcava
    Join Date
    Apr 2010
    Posts
    464
    Points
    239
    Answers Provided
    39


    0

    Default Re: FeatureLayer.SELECTION_ADD - am I doing this wrong?

    Nevermind. This works as intended. I was able to track down the issue in my application to a bug in my library that cleared all GraphicsLayers on varying events, including before I ran my FeatureLayer query.

    My bad, thanks.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts