Problems with FeatureLayer click events.

573
1
Jump to solution
02-01-2017 07:26 AM
JacobNosal
New Contributor III

Hello All,

I am using the FeatureLayer.selectFeatures() function to select features on a user's click, but am having problems with it. Once a user clicks on a feature, it will flash the symbology that I've set as the selection symbol (red outline, transparent interior SimpleFillSymbol) and the show another symbology. I have inspected the return of FeatureLayer.getSelectedFeatures() with no success. Only the correctly symbolized graphic is present. I've attached a screenshot:

I am unable to share code as this is a client deliverable, but am hoping someone else has ran into this problem before.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
JacobNosal
New Contributor III

Hello All,

Upon further inspection, I found that the graphic was being added to the maps graphics layer. a simple call of 

on(map.graphics, 'graphic-draw', lang.hitch(this, function(eventArg){
    map.graphics.clear();
}));

cleared the graphics layer of the unwanted graphic.

Regards,

Jacob Nosal

View solution in original post

0 Kudos
1 Reply
JacobNosal
New Contributor III

Hello All,

Upon further inspection, I found that the graphic was being added to the maps graphics layer. a simple call of 

on(map.graphics, 'graphic-draw', lang.hitch(this, function(eventArg){
    map.graphics.clear();
}));

cleared the graphics layer of the unwanted graphic.

Regards,

Jacob Nosal

0 Kudos