Display Dynamic Labels for Layer

342
1
12-18-2019 07:27 AM
TomLewis
New Contributor II

I'm attempting to create labels on streets that would show the AADT (Annual Average Daily Traffic) for a street segment. I can easily do this by creating a spatial view that pulls the AADT as the label. 

My problem: The year is hardcoded in the label's SQL Query. I would like to pass in the Year value from the browser and have the correct AADT values applied. Is this something that can be done?

As a side note, I've attempted creating a new FeatureLayer on the client using the featureset returned for the street affected. This works fine and I can change the labelinfo for the new featurelayer, but my labels aren't showing. I'm thinking this is a limitation to what the ArcGIS API can do. Is this a feasible solution?

0 Kudos
1 Reply
Noah-Sager
Esri Regular Contributor

Not totally sure I follow the question, but here is an example displaying a featureLayer from client-side graphics using an Arcade expression to label features with the current year.

https://codepen.io/noash/pen/YzPNJYQ 

0 Kudos