Configure pop-ups
Pop-ups are an important aspect of web cartography. They allow you to share extra information for each map feature. They can clarify the information communicated by the symbols. They can include charts and photographs that provide more context. Anything that’s present in a layer’s attribute table can be communicated through a pop-up.
With so many things that can be included in a pop-up, it’s important to give careful consideration to what should be included. In this tutorial, you’ll design pop-ups for two layers. One will only display the feature’s name, while the other will use more complex formatting.
Make simple pop-ups
Not every layer in a map should have pop-ups. Unnecessary pop-ups get in the way of necessary ones, making map exploration difficult. In your map, pop-ups are only helpful for two layers: LakeDistrictFells and National Parks (England). These layers are not visible at the same time, so their pop-ups will not conflict with one another. You’ll start by disabling pop-ups for all the other layers and configuring simple pop-ups for the parks layer.
- If you completed the earlier tutorial Cartographic creations – Customize a basemap, sign in to your ArcGIS account or your ArcGIS Enterprise portal. Reopen your Lake District National Park web map.
- If you did not complete the earlier tutorial, open the Lake District National Park 3 web map. Click Sign In and sign in with your ArcGIS account. On the Contents toolbar, click the Save and open button and click Save as. For Title, remove the 3. Click Save.
Note:
If you don't have an ArcGIS account, see options for software access.
- If necessary, on the Contents (dark) toolbar, click the Layers button to open the Layers pane.
- In the Layers pane, select the Lake District National Park layer.
A blue bar appears next to the layer when it is selected.
- On the Settings (light) toolbar, click the Pop-ups button. In the Pop-ups pane, turn off the Enable pop-ups toggle button.
- Also disable pop-ups for the Clip, Lakes, and Rivers layers.
- On the map, zoom out until you can see all of England and its ten national parks.
- Select the National Parks (England) layer.
One of its pop-ups appears on the map. It includes a table with six fields. The only information that is needed for this map is each park’s name. You’ll remove the table.
- In the Pop-ups pane, next to Fields list, click the Options button and click Delete.
- Click Title.
The name of the layer is not necessary information for this map. You should try to remove unnecessary information from maps, because it can make it slower, more difficult, or even confusing for people to read your map. In this case, the layer name is getting in the way of the important information: the park name.
- Remove all of the text before {NAME}.
Text within curly brackets is used to reference field names within the feature layer.
- On the map, click different parks to confirm that the pop-ups title changes.
Format pop-up text
Next, you’ll configure the pop-ups for the LakeDistrictFells layer. You’ll add text and format it for clarity.
- On the map, zoom in until the triangle symbols reappear.
- In the Layers pane, click the LakeDistrictFells layer to select it.
The pop-up for the LakeDistrictFells layer appears.
- In the Pop-ups pane, click Title. Remove all of the text except for {Name}.
The pop-up has a table with many fields. While they provide interesting information about each mountain, most of them are not relevant to this particular map and its goals. You’ll remove the fields list and replace it with formatted text.
- Next to Fields list, click the Options button and click Delete.
- Click Add content and click Text.
- In the text window, type or copy and paste the following:
Click here to see a photo of {Name}.
Height: {Metres} meters
Height is the change in elevation between a mountain's peak and sea-level.
Prominence: {Drop_} meters
Topographic prominence, or drop, is the change in elevation between a mountain's peak and the lowest contour line that encircles it, but no other higher peaks.
Tip:
Right-click and choose Paste as plain text to copy without formatting.
This text repeats the information that is already encoded in the triangle symbols: the height and prominence of each peak. However, the pop-up can communicate more precise values than the size and color of each symbol. It also provides room to explain the difference between height and prominence.
- Highlight the second line of text (Height: {Metres} meters). On the toolbar, click the Bold button.
- Also bold the fourth line of text (Prominence: {Drop_} meters).
- Click OK.
The text appears in the pop-up. The two numbers each have two decimal places.
This amount of precision isn’t necessary for your map and only makes the numbers harder to understand. You’ll simplify them by changing their formatting.
- On the Settings toolbar, click the Fields button. In the Fields pane, click Height (m).
- In the Formatting window, for Significant digits, choose 0 Decimal places.
- Click Done.
- Format the Prominence (m) field to use zero decimal places as well.
In the pop-up, the numbers no longer display decimal values.
Write an attribute expression
Next, you’ll add a link to a photo of each mountain.
The LakeDistrictFells layer does not have a field with links to photos, but it does have a field with an ID number for each peak. The hillsummits website shares photos of each peak, and the URL of each photo page includes the peak’s ID number. Next, you’ll create an attribute expression that constructs a unique URL for each mountain peak from its ID number. These URLs will link to a photo of each peak.
- Reopen the Pop-ups pane.
You can make an attribute expression that creates a link for each feature.
- Under Options, click Attribute expressions.
- Click Add expression.
- In the expression box, delete the existing text and type or copy and paste "http://hillsummits.org.uk/htm_portrait/"++".htm"
The quotation marks indicate text values. The plus signs allow you to add more text between the two parts of the URL.
- Place your cursor between the two plus signs and click the Profile variables button.
- Click the arrow next to $feature.
- Scroll through the list of fields and click $feature.Number.
The expression now reads "http://hillsummits.org.uk/htm_portrait/"+$feature.Number+".htm".
The Number field stores the ID number for each peak.
- Click Run.
A URL appears in the Output window. In it, $feature.Number is replaced with a four or five digit number.
- Click Done.
In the Attribute expressions pane, the new expression is listed, named {expression/expr0}.
- At the top of the Attribute expressions pane, click the Back button.
- If necessary, expand the Text section. Click Edit text.
- In the text editing window, on the first line, highlight the word here. On the toolbar, click the Link button.
- For Link URL, type {expression/expr0}. Click the Save button.
- With the here text still highlighted, click the Bold button.
- Click OK.
- In the pop-up, click the here link.
Note:
If a pop-up is not visible, zoom in on the map and click one of the triangle symbols.
A new browser tab opens with a photo of the selected mountain. You don’t have permission to add these photos directly to your map, but you can provide a link so people can look at them.
- Close the new browser tab.
Add a diagram to the pop-up
Many people reading your map may not be familiar with the term prominence. A good map ensures that people understand the information that it presents. That means that explanations and descriptions are often necessary in addition to symbology and legends. You’ll add text and a diagram to the pop-up to help explain the difference between height and prominence.
- In the Pop-ups pane, click Add content and click Image.
- For URL, type or copy and paste https://www.arcgis.com/sharing/rest/content/items/5172c58b3caf4361b612878d5f5da9e2/data.
Note:
This image is hosted as an item on ArcGIS Online. To learn how to host images, read the Adding and using photos and images in ArcGIS Online blog article.
- For Caption, type Height (h) and prominence (p). For Alternative text, type Diagram describing height and prominence.
Including alternative text helps to make your map more accessible.
- Click Done.
A diagram appears in the pop-up, comparing height measurements to prominence measurements. Its colors match the map. Matching colors help to create a more harmonious design.
- On the Contents toolbar, click the Save and Open button and click Save.
You have now configured pop-ups for two layers. You created simple pop-ups for the National Parks (England) layer, displaying only the name of each park. You created complex pop-ups for the LakeDistrictFells layer, using text formatting, field properties, an attribute expression, and a diagram.
Note:
You can further customize pop-ups with HTML. Read the Beginner steps for formatting pop-ups with HTML blog article for instructions using the same pop-up that you just created.
Configure labels
Pop-ups mean that labels play a much smaller role in web maps than in print maps, but it doesn’t mean that labels should be entirely abandoned. If you can prevent someone from having to open a pop-up by providing the information up-front in a label, you’ve made the map easier to read.
Label the fells
While people can find the name of each mountain in its pop-up, you can make the map easier to read by providing labels for the most prominent peaks. This will help people find the locations of peaks that they may have heard of.
- On the Settings toolbar, click the Labels button. In the Labels pane, ensure that LakeDistrictFells is the selected layer.
- Click Add label class.
- For Label field, choose Name.
Labels appear on the map. There are a lot of labels, which makes the map appear crowded. You can’t show labels for every mountain and you don’t need to. You’ll create a filter so only the most prominent mountains are labeled.
- Click Edit label filter.
- Click Add new. Use the menus to build the expression Prominence (m) is at least 250.
Most of the labels on the map disappear. The cut-off value of 250 is arbitrary, and when you design your own maps, you’ll have to experiment to make choices like this one that balance information with clutter.
- Close the Filter window.
Next, you’ll change the style of the labels to match the rest of the map.
- Click Edit label style.
- Change Font to Noto Sans Bold and Size to 16.
Bold fonts are easier to read on crowded maps. Noto Sans is a font face that is also available in ArcGIS StoryMaps, which you’ll use later to create a layout for the map. Using the same font in both the map and the layout will help to make your map feel more consistent and professional.
- Click the Color menu. For #, type 202e03.
This is the same color that you used earlier for the outline and drop shadow of the park.
- Click Done.
- Under Halo, change Color to dae3d3 and size to 2.
This color matches the background that the labels will most often appear against.
Halos add visual clutter to a map but are worthwhile on busy backgrounds because they allow labels to remain legible regardless of the colors and detail behind them. The halo color should have a high contrast with the label color and be similar to the most common background color.
- Close the Label style window.
The labels are easier to read now, but they don’t need to be visible at all scales. You’ll set their visible range so they only appear when the map is zoomed in.
- For Visible range, set the menus to Cities and Room.
Label the lake district
You’ll also label the Lake District National Park layer. You’ll use ArcGIS Arcade to customize the label’s text.
- Zoom out until the mountains disappear and only Lake District National Park is shown.
- At the top of the Label features pane, click the black banner and choose Lake District National Park.
- Click Add label class. Ensure that Label field is set to NAME.
First, you’ll ensure that this label matches the style of the other labels in your map.
- Click Edit label style.
- Change Font to Noto Sans Regular, and Size to 18.
- Change the color to 202e03 and the halo color to dae3d3.
Tip:
These colors may be available in the recently used color lists.
- Change the halo size to 2.
- Close the Label style window.
On the map, the label currently reads LAKE DISTRICT. You’ll use Arcade to add the text NATIONAL PARK to the end.
- In the Label features pane, next to NAME, click the expression button.
- After the text $feature[“NAME”], type or copy and paste + TextFormatting.NewLine + “NATIONAL PARK”.
The TextFormatting.NewLine constant will split the text over two lines.
- Click Run. If no error is returned, click Done.
The label updates on the map. It has two lines of text.
- For Visible range, set the menus to County and Metropolitan area.
- Zoom in and out on the map.
The label only appears at one scale. Later, when you guide people through your map, you’ll pause at this scale.
- On the Contents toolbar, click the Save and Open button and click Save.
In this tutorial, you configured pop-ups and labels for your map of fells in Lake District National Park. You learned how to format text, create attribute expressions, and add images to pop-ups. You learned how to style and filter labels. Your web map is now complete. In the next tutorial, you’ll use ArcGIS StoryMaps to create a choreographed version of your map that you can share with others.