I have an application that uses a disconnected feature layer that has temporal features.
I am trying to use the TimeSlider to create a breadcrumb visual effect where the features that match the current value of the timeslider will have one symbology while those with temporal value that are less than the timeslider will have a smaller, less pronounced symbology.
The approach that I have tried is to watch the timeExtent of the timeslider and use applyEdits on the featurelayer to modify an attribute that is used by the uniqueValueRenderer to vary the symbology.
It works to some extent but with a jumpy effect that's probably caused by the lag associated with applyEdits.
Is there a way that symbology can be changed without using applyEdits? Something like visualVariables but can be used to change symbols.
Hi there,
You should not have to use applyEdits at all. You can apply featureEffect to the FeatureLayerView. So that the included features will be more prominent while excluded features are subdued.
We have couple of samples that should help you.
https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=timeslider-filter
https://developers.arcgis.com/javascript/latest/sample-code/featureeffect-layers-histogram/
Is there an effect that I can use to make older features disappear?
You can use FeatureLayerView.filter if you do not want to show your older features. FeatureEffects are useful if you want to display display features that are included in the criteria differently than those that are not included in the criteria. If you for some reason must use featureEffect then use can use opacity effect and make the features completely transparent. The document explains how to use the effects.
This sample shows how use FeatureLayerView.filter to show only features that meet the criteria: https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=featurefilter-attributes
I rewrote the application to use layerview filter to hide older features and commented out all applyEdits. The jerky effect is still there as you can see on the video. You can also see the older feature briefly before they disappear. Is there a way to instruct the layer to hide the older feature first before rendering the new one?
I am using different symbols for current and historic features. It doesn't look like there is any effect that can be used to swap out symbols. If I can use a featureEffect to make any non-current feature disappear before the applyEdits can catch up then that should resolve the temporary duplicate that I'm seeing sometimes.
I tried out the code but it does not look like featureEffect is having any effect on the symbol. As a sanity check I used the follow code to make all features transparent but there seemed to be no change in the appearance of the symbols.