agrc / wfrc-rtp-projects

Standalone RTP Project Web App
MIT License
0 stars 0 forks source link

Generate Example Arcade Expression #157

Closed stdavis closed 1 year ago

stdavis commented 1 year ago

From Bert:

I think I understand the current app design and why it uses 2 feature services (just point and line) instead of 6 feature services (2 geometry types x the 3 modes -- road, transit, and AT). This likely makes the app performance better and greatly simplifies the app's configuration. But it doesn't allow us to specify which fields appear for different types of projects -- ie. transit and active transportation projects display the fields Current Travel Lanes. We are limited to setting this up in the AGOL map for each of the 2 combined mode layers. If we wanted to control what fields were displayed for each project mode. One approach would be to write a custom, configurable popup widget. Another would be to rewrite the app to use 6 features services instead of 2. Can you think about this and provide a ballpark estimate for the development work needed to implement your recommended approach for controlling what fields display for each mode? Then we can decide whether we want to pursue this further.

I believe that this could be done with arcade expressions in the popup config for each of the layers in the web map without any changes to the application code. The app gets the content for the project information feature details from the popup template for each layer as configured in the web map. Currently, the popups are configured to use a "Fields list" content item. You could instead use an Arcade expression content item that returns a different fields list for each project type. Here are a few links to related docs:

https://developers.arcgis.com/arcade/profiles/popup-element/ https://developers.arcgis.com/web-map-specification/objects/popupElement_fields/

stdavis commented 1 year ago

Sent this to Bert: https://gist.github.com/stdavis/d7167f31bcdbc457e7f75d486fe75d95

nathankota commented 1 year ago

@stdavis this was accepted and is complete?

stdavis commented 1 year ago

Yes. Thanks for the nudge.