Selection Symbols in the 3.x JavaScript API

593
3
01-24-2022 10:37 AM
NathanHeickLACSD
Occasional Contributor III

Good Morning,

Is there a way to force selections on feature layers to use the standard renderer instead of a different selection symbol?  I just want the selected features to display as usual with no modification.

Thanks,

Nathan

0 Kudos
3 Replies
Noah-Sager
Esri Regular Contributor

Hi @NathanHeickLACSD, how are you selecting the features? Is this from a query or via a popup?

You might be able to use the getSelectedFeatures and getSelectedFeatures methods to override the highlight:

https://developers.arcgis.com/javascript/3/jsapi/featurelayer-amd.html#getselectedfeatures

Or make it 100% transparent in the popup:

https://developers.arcgis.com/javascript/3/jsapi/popup-amd.html#markersymbol

 

 

0 Kudos
NathanHeickLACSD
Occasional Contributor III

Hi Noah,

This is for some custom widgets.  I want to select features in a layer.  This layer has scale dependencies.  I want to highlight the selected features at all scales using a separate graphics layer.  At the scales where the layer is visible, I want the selected features in the layer to display normally.  I still want the layer to have and store the selection.  However, I don't want the layer being selected to change its display at all.

0 Kudos
NathanHeickLACSD
Occasional Contributor III

Also, are you implying that the features returned from getSelectedFeatures can be mutated and the map will update?

0 Kudos