Select to view content in your preferred language

Selection Symbols in the 3.x JavaScript API

795
3
01-24-2022 10:37 AM
NathanHeickLACSD
Frequent Contributor

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
Frequent Contributor

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
Frequent Contributor

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

0 Kudos