FeatureLayer.selectFeature Can't change selection method

671
2
Jump to solution
11-05-2016 07:05 AM
THomasPurfürst
New Contributor

I try to select Points with different selection methods in a Feature layer.

If I try SELECTION_ADD or SELECTION_NEW or SELECTION_SUBTRACT the selection is always like SELECTION_NEW and the result-Method is always "3".

lyrZE.selectFeatures(selectQuery,
        //lyrZE.SELECTION_ADD,
        lyrZE.SELECTION_NEW,
        //lyrZE.SELECTION_SUBTRACT,
        function(RE_Geometry,RE_Method){
          console.log(RE_Geometry);
          console.log(RE_Method)
      });

I need the add and subtract method.

thx

Thomas

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

You're not using the correct value for the selection method constants. These are derived from the "FeatureLayer" class (FeatureLayer.SELECTION_NEW, FeatureLayer.SELECTION_ADD), not your variable lyrZE (lyrZE.SELECTION_ADD).

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

You're not using the correct value for the selection method constants. These are derived from the "FeatureLayer" class (FeatureLayer.SELECTION_NEW, FeatureLayer.SELECTION_ADD), not your variable lyrZE (lyrZE.SELECTION_ADD).

THomasPurfürst
New Contributor

Thanks you're right

This is the example from Esri:

featureLayer.selectFeatures(selectQuery,
FeatureLayer.SELECTION_NEW);

I didn't recognizes the case sensitiv variable. I did change all FeatureLayer/featureLayer instead of only featureLayer.

Thomas

0 Kudos