arcgis arcade pop ups

ArcGIS Arcade Pop-ups: Enhance Your Mapping

By Emily Johnson
AD

ArcGIS Arcade Pop-ups, a powerful feature of Esri's ArcGIS platform, enable users to create interactive and customizable pop-up windows for their maps. These pop-ups can display more than just basic attribute information, offering users an engaging and dynamic way to interact with their data.

By leveraging Arcade, Esri's expression language for client-side processing, you can create pop-ups that perform calculations, make decisions based on data, and even control the display based on user actions. This level of interactivity can significantly enhance the user experience, turning your maps into powerful analytical and exploratory tools.

The Building Blocks of Arcade Pop-ups

To create an effective Arcade pop-up, you need to understand its key components:

AD
ArcGIS Urban 101 – Projects and Plans
ArcGIS Urban 101 – Projects and Plans
Playing arcgis
Playing arcgis
a group of people standing next to each other in front of some kind of machines
a group of people standing next to each other in front of some kind of machines

1. Trigger: The event that causes the pop-up to appear, such as a mouse hover or click on a feature.

2. Content: The information displayed in the pop-up. This can include text, images, related features, or even external web content.

a computer screen with a map on it and an image of the area that is highlighted
a computer screen with a map on it and an image of the area that is highlighted
an arcade machine is on display in a room with white walls and purple carpeting
an arcade machine is on display in a room with white walls and purple carpeting
an indoor play area in a mall with people walking around and looking at items on display
an indoor play area in a mall with people walking around and looking at items on display

3. Expression: The Arcade expression that determines what's displayed in the pop-up. This could be a simple attribute display, a calculation, or a complex decision-making process.

Creating a Basic Arcade Pop-up

Here's a basic example of an Arcade expression that displays the 'Description' attribute of a feature when a user hovers over it:

AD

return [$feature.description]

an image of a city with lots of colorful buildings and trees on the top of it
an image of a city with lots of colorful buildings and trees on the top of it
ArcGIS Urban: An Introduction
ArcGIS Urban: An Introduction
What's New in ArcGIS Online (December 2016)
What's New in ArcGIS Online (December 2016)
an open laptop computer sitting on top of a desk
an open laptop computer sitting on top of a desk
arcgis
arcgis
an old - school video game with a car driving down the road and a sign above it
an old - school video game with a car driving down the road and a sign above it

This expression returns the value of the 'description' field for the feature that triggered the hover event.

Conditional Pop-ups with Arcade

Arcade allows you to control the display of pop-up content based on conditions. Here's an example that displays a warning message when the 'Status' field of a feature is 'Closed':

AD

if ($feature.Status = "Closed") { return "This facility is closed."; } else { return [$feature.Name]; }

This expression checks the 'Status' field. If it's 'Closed', it displays a warning message. Otherwise, it displays the feature's name.

Enhancing Pop-ups with Arcade Functions

Beyond simple attribute displays and conditional logic, Arcade allows you to perform calculations and transformations on your data to enhance your pop-ups:

AD

1. ToString(): Converts a number to a string for display in the pop-up. For example, return toString($feature.Area) would display the area as a value rather than a scientific notation.

2. Pact(): Formats a number for display with a specific number of decimals. For example, return Pact($feature.Precipitation, 2) could display precipitation values with two decimal places.

Displaying Related Features in Pop-ups

Arcade's ability to query related features allows you to display data from related records within the same pop-up. This can significantly enhance the context provided by your map:

For example, if you have a map of parks and their corresponding restrooms, you could display information about the closest restrooms in each park's pop-up.

Displaying External Web Content

Arcade can also pull external web content into your pop-ups, turning them into gateways to additional resources. For instance, you could retrieve a weather forecast from a URL and display it in a pop-up for a weather station:

return jsonParse(getUrl("https://www.WeatherAPI.com", "station=", $feature.StationID)).Forecast

This expression fetches a weather forecast from the specified URL and displays it in the pop-up.

ArcGIS Arcade pop-ups offer a wealth of opportunities to enrich your maps with interactive, dynamic, and contextual data displays. By mastering Arcade expressions, you can create incredibly powerful and user-friendly mapping experiences.

AD