Select to view content in your preferred language

Customize Symbology Based on Time Slider for Time Frame

380
1
07-17-2019 01:50 PM
by Anonymous User
Not applicable

We have a feature service for gates that have fields for when the gates will be under construction and closed. There are 2 date fields, one for the start of the closure and one for the end of the closure. Only a few gates are being upgraded so not all features have the field populated and they are not all closed for the same duration. For now I've been able to customize an expression solely based on the Now() function which is for the current time. We would like to be able to have the function based on when we have time enabled on the layer in AGOL so that as someone moves the temporal slider, if the time frame depicts when closures are, the color would change to show which points would be closed. Is this even possible? 

This is the current code which works, but only based on current time.

var started = $feature["Closure_Schedule_Start"]
var closed = $feature["Closure_Schedule_End"]
var present = Now()

If (present >= started && present <= closed) {
   return "Closed"
} else {
   return "Open"
}

Thanks

0 Kudos
1 Reply
NathanShephard
Esri Contributor

Unfortunately, there’s no way to access the map’s current time (from the time slider) in AGOL yet. We’re considering adding this in a future release of Arcade, which would make it available across the ArcGIS Platform. You would then be able to drive feature symbology based on the state of the map’s time slider.

Thanks for posting the idea, Savannah!

-Nathan.

0 Kudos