Select to view content in your preferred language

Rendering of time based symbols in a FeatureLayer

690
6
Jump to solution
08-12-2024 06:28 AM
Labels (2)
LarsNess
Emerging Contributor

Hello Esri and ArcGIS people!

I'm wondering if there exists support for time based rendering of point geometries where the point's coordinates do not change (the points are static). Explanation:

  1.  I have a FeatureLayer which contains points of interests. This is loaded through an ArcGIS Portal instance.
  2. These points have time-based symbols, and change when they are re-drawn and relative time has passed, meaning there's a Renderer defined on the FeatureLayer on load (RenderingMode = Automatic).
  3. This, howerer, requires user interaction with the MapView. If I have a static viewpoint, the symbols never change until I either pan or zoom. New features do appear though, with its initial symbol.

Is there a way to force the Renderer to re-draw, preferably according to the FeatureLayer's RefreshInterval? New data is indeed fetched, but the symbols do not change until the user interacts with the map.

Any help is greatly appreciated!

Lars

0 Kudos
1 Solution

Accepted Solutions
HamishDuff
Esri Contributor

Hi @LarsNess,

At the moment there isn't a trigger for the renderer to refresh. Although the refresh interval is looking at data updates in your use case as you are considering relative time the attributes aren't updating so this won't happen.

A possible workaround would be to populate the feature layer with a dummy attribute that holds the Now() time.  You could update that dummy attribute at an interval using an arcade script and the Now() function. Then instead of using Now() in your arcade expression for the renderer, you would use the dummy attribute.  Whenever the dummy Now() attribute is updated the symbols should be forced to refresh.

I hope that helps!

View solution in original post

0 Kudos
6 Replies
HamishDuff
Esri Contributor

Hi @LarsNess, thank you for your question. 

Would you mind giving me a little more information on how you have set up your symbology? Currently time-based symbols don't exist but it sounds like your goal is to change the symbol based on some time-based attribute of a feature.

If you could provide more information on what you're expecting to happen that will help me to point you in the right direction. 

0 Kudos
LarsNess
Emerging Contributor

Hello Hamish, thanks for the reply!

The symbology is apparently defined by string comparison on an Arcade expression, allowing the use of Now(). This does not seem to translate well into the C# runtime, and if we have a static viewpoint the symbols never change/the Arcade expression never re-evaluates. We have to pan or zoom or shake the map before the symbols change. Even though the layer has a RefreshInterval of 30 seconds, the connected Renderer does nothing to change symbols of Features that should be changed.

So, I can reformulate the question into two parts:

  1. Is there a way to force the connected Renderer to re-draw based on the RefreshInterval the layer provides?
  2. If an attribute on a Feature got updated, and the Renderer "subscribes" to this attribute (UniqueValueRenderer.FieldNames), would the symbol change if the viewpoint is static (not requiring user interaction at all)?
0 Kudos
LarsNess
Emerging Contributor

I forgot to add that there are 8 different symbols based on "time passed", which are defined as follows:

LarsNess_0-1723709931499.png

 

0 Kudos
HamishDuff
Esri Contributor

Thanks for the additional information, I've asked internally for some clarification then I will get back to you. 

0 Kudos
HamishDuff
Esri Contributor

Hi @LarsNess,

At the moment there isn't a trigger for the renderer to refresh. Although the refresh interval is looking at data updates in your use case as you are considering relative time the attributes aren't updating so this won't happen.

A possible workaround would be to populate the feature layer with a dummy attribute that holds the Now() time.  You could update that dummy attribute at an interval using an arcade script and the Now() function. Then instead of using Now() in your arcade expression for the renderer, you would use the dummy attribute.  Whenever the dummy Now() attribute is updated the symbols should be forced to refresh.

I hope that helps!

0 Kudos
LarsNess
Emerging Contributor

Thank you for the reply and research Hamish, we'll try to implement it in that way!

0 Kudos