One of the many reasons people love ArcGIS StoryMaps is its simplicity- but what are your options when you want to add more complexity to your story than what seems possible in the app?
That’s when you may want to consider using ArcGIS Arcade to provide enhanced customization to your story’s mapping components, such a map pop-ups.
What is ArcGIS Arcade?
If you’ve never heard of ArcGIS Arcade, it’s an expression language that can customize content coming from ArcGIS apps. For example, it can perform calculations on data from feature layers, which can then be used as your text for pop-ups, or even to stylize text. It is also a desirable customization tool due to its ability to utilize geometry data (think points, lines, and polygons) in its calculations and results, like applying a 10 meter buffer around existing data points.
One advantage to using ArcGIS Arcade is its dynamic nature: you can apply a calculation to all data within your story, and if that data changes frequently, so will your expression results (as noted in Your Arcade Questions Answered). To learn more about the basics of ArcGIS Arcade, take a look at the links at the bottom of the story.
Arcade expressions
When building an expression in Arcade, you can use a combination of profile variables and functions. These items are organized in the tabs of the Arcade expression editor.
Tabs:
Profile variables: Within this tab, you can select inputs for your expression based on the data within your map. For example, the $feature profile variable will hold a selection of the feature layers within your web map that you can select to add to your Arcade expression. You can also build these expressions based off of views you’ve created with the $view variable.
Functions: Here you’ll find all the functions you can apply to your data, from reformatting dates, to applying a buffer. Check out this page for a glossary of the available functions.
Suggestions
A word on arcade functions
It’s up to you to decide how you want to use the functions in the expression editor, whether it be to alter the visual style of your layer, or to customize the information in your pop-up.
Arcade and pop-ups
You can use Arcade to format your pop-ups by calculating statistics from your layer, without having to make entirely new fields that are precisely formatted with this pre-calculated data.
Arcade and layer styles
Using ArcGIS Arcade on your layer can help transform the visualization of your data. Let’s say you want to apply a buffer to your Fault line data to inform your reader of when they may be buying a home near an earthquake prone area. You can apply that buffer with Arcade!
Calculating fields for map tours
Another place to utilize ArcGIS Arcade is within the fields of a feature layer that you’re planning to use for a data-driven map tour. You can calculate values of a new feature layer field based on data within the existing fields. This results in highly customizable data-driven map tours.
To calculate one of your feature layer fields, go to the item details page of your feature layer. Click the Data tab, then the Options bar on the table to click Add Field. Lastly, click on the new field title and click Calculate.
Use your customized field as your descriptions for your map tour points. If you’re working with a lot of data, this can save significant time by concatenating the important details of your fields. It can also be helpful for performing data analysis on your fields, in bulk, like calculating an average distance from a point, reformatting a date, or returning a certain field over another depending on the logic supplied!
Here’s a simple example of concatenation performed on a feature layer of Los Angeles Historical Sites. Let’s say you wanted to combine the information like hours of operation, and what number to call for additional information. The result was the calculated Map Tour Descriptions field:
A note here that when calculating a field from the Data tab, this calculation will be run in bulk for all features. It will NOT update when changing data from referenced fields, and it will not save the previously utilized calculation. This makes it a great tool for information that isn’t likely to change over time, like distances between fixed points.
You can also go in after running the calculation and manually alter individual results to your liking.
Now, I’ve created a map tour from the feature service, and designated the Map Tour Descriptions field as the Place description:
How can you use ArcGIS Arcade in your story?
Sometimes, you want to add some more depth to your map’s pop-ups and visualization. While you can’t perform this operation right from the ArcGIS StoryMaps builder, you can complete this through formatting your pop-ups in the Map viewer with Arcade.
Let’s take a look at the Arcade expression editor together:
There are three main places to use Arcade within your web map: Your pop-ups and your layer style.
To get to the Arcade expression editor for your pop-up, click Pop-ups on the Settings toolbar, and the Add content button to find Arcade.
To open the Arcade expression editor for your layer styles, click Layers on the Contents toolbar. In the Layers pane select your desired layer, then click Styles on the Settings toolbar. Click Expression on the Styles pane.
Where should you start?
Take a look at your story and decide what it might benefit from; Does your story need richer pop-ups, or more relevant map visualization for the story’s focus? Maybe you’d like to provide highly customized descriptions in your map tour. All of these items can be added with a little help from ArcGIS Arcade.
Let's Learn
There are countless resources to help familiarize yourself with ArcGIS Arcade. Here are just a few tutorials and reference documents to get you started:
Resources:
Get started with ArcGIS Arcade
Arcade | Documentation | ArcGIS Developers
Access attributes from another layer with ArcGIS Arcade
GitHub - Esri/arcade-expressions: ArcGIS Arcade expression templates for all supported profiles in t...