Map labels help to identify features, establish a visual hierarchy of important features, and focus the map user's attention on the purpose of the map. Labels can be positioned based on the size of features so they are easier to read on the map. Labels are generated dynamically, and only labeling properties are stored—the settings used to create labels on the fly. In ArcGIS Pro, if you are working in a map, your labeling properties are saved when you save your project (.aprx). Labeling properties can also be stored in layer files (.lyrx) and used to transfer labels between two maps without having to set up labeling again in the new map.
Overview
- Video length: 3:27
- This video was created with ArcGIS Pro 2.5.
In this tutorial, you are going to label different types of features and manage their appearance on the map through labelling properties and optionally use ArcGIS Arcade expressions to show the capacity of different facilities.
- Estimated time: 25 minutes
- Software requirements: ArcGIS Pro
Note:
The tutorial steps in the online help reflect the look and capabilities of the current software release. If you have an earlier software version, use the offline help system to open the tutorial. To switch from the online to the offline help system, see Set the help source in the About ArcGIS Pro help topic. If you don't have ArcGIS Pro, you can sign up for an ArcGIS Pro free trial.
Open the project
In this tutorial, you'll label suburbs in Wellington, New Zealand; historic buildings that lie in a flood risk zone; and local civil defense centers nearby. Adding labels makes it easier for a city planning group to identify important features on the map and make decisions for risk management.
- Start ArcGIS Pro and sign in if necessary.
- On the start page, under your recent projects, click Open another project.
Note:
If you already have a project open, click the Project tab on the ribbon. In the list of menu items on the left, click Open. On the Open page, click Portal and click Open another project at the bottom of the page.
- On the Open Project dialog box, under Portal , click ArcGIS Online .
Note:
If you see ArcGIS Enterprise listed instead, you must add a portal connection or set your active portal to ArcGIS Online. Alternatively, you can download the tutorial data from a browser.
- At the top of the dialog box, in the Search box, type Label your map tutorial and press Enter.
- In the list of search results, click Label your map to select the project package.
Note:
If there is more than one project package with this name, look at the Owner column. Select the item with the owner name ArcGISProTutorials. If you don't get any results, see No search results are returned.
- Click OK.
The project opens with a light gray basemap centered on Wellington, New Zealand. Boundaries of local neighborhoods and suburbs are drawn in darker gray, and a flood risk zone is shown in light blue. Other layers in the Contents pane are turned off or are not visible at the current map scale (indicated by a gray check mark).
Note:
By default, project packages are unpacked to your <User Documents>\ArcGIS\Packages folder. You can change the default location in the Share and download options.
- On the ribbon, click the View tab. In the Windows group, click Reset Panes and click Reset Panes for Mapping (Default).
This ensures that the Contents and Catalog panes are open and that other panes are closed.
Label suburbs
The basemap includes a reference layer that labels notable features. However, the Suburb Boundaries layer has more information about the area and will allow you to control the appearance of each suburb's label.
You'll label the Suburb Boundaries layer so the suburb names display on the map. Labels for a layer are based on values in the layer's attribute table. Before you turn on labeling, you'll remove the reference layer.
- In the Contents pane, right-click the Light Gray Reference layer and click Remove .
The default reference labels for the basemap are removed.
- In the Contents pane, right-click the Surburb Boundaries layer and click Attribute Table .
The attribute table opens. The Suburb field contains the values that will be used to label the suburbs.
- Close the attribute table.
- In the Contents pane, right-click the Suburb Boundaries layer and click Label .
The suburbs are labeled with the names you saw in the table. On the ribbon, the Feature Layer contextual tab set appears.
- Under Feature Layer, click the Labeling tab. In the Text Symbol group, expand the Text Symbol Style gallery. Under Scheme 2, click the Landform/Physical Region style.
The labels update to reflect the new style.
- On the Labeling tab, in the Label Placement group, click Land Parcel.
Some of the labels disappear. The Land Parcel placement setting suppresses labels that don't fit completely within their feature. This condition changes as you zoom in and out on the map.
Note:
ArcGIS Pro has two labeling engines: the default Maplex Label Engine, which is used in this map, and the Standard Label Engine. The Maplex Label Engine has more advanced label placement settings than the Standard Label Engine. To change the label engine setting, on the Labeling tab, in the Map group, click the More button and uncheck Use Maplex Labeling Engine.
Learn more about labeling with the Maplex Label Engine and labeling with the Standard Label Engine.
- Zoom in and out and pan the map.
As you zoom in, more features are labeled. As you pan, the labels change position to stay in view.
Set a visibility range for label display
Labels may be more helpful at some scales than others. As you zoom in, labels for regional features grow less important and labels for local features become more important. By choosing the right map scale for label display, you help the map reader focus on the most important features of your map. You'll set a visibility range for the Suburb Boundaries labels so they don't display at very large (close-up) map scales.
- On the Labeling tab, in the Visibility Range group, click the input box next to In Beyond . Type 1:7,000 in the box and press Enter.
- On the ribbon, click the Map tab. In the Navigate group, click Bookmarks and click Te Aro.
The map zooms in to the Te Aro neighborhood. Whether or not you see the labels depends on whether your map scale is larger (closer) than 1:7,000. The map scale is displayed in the lower left corner of the map view.
- If necessary, on the Map tab, in the Navigate group, click Fixed Zoom In as needed until the labels disappear.
When you zoom in closer than 1:10,000, the Building Footprints layer displays.
- On the Quick Access Toolbar, click Save to save the project.
Label historic buildings
City planners may be concerned about damage to historic buildings in the event of a flood. The Building Footprints layer is already symbolized to show which buildings are historic. You'll zoom in to a small area that lies within the flood risk zone and label the historic buildings with their names. By default, all features in the layer are labeled. To label just the historic buildings, you'll build an SQL query.
- On the Map tab, in the Navigate group, click Bookmarks and click Historic Buildings 1.
- In the Contents pane, click the Building Footprints layer to select it. On the ribbon, under Feature Layer, click the Labeling tab.
- On the Labeling tab, in the Layer group, click Label .
The buildings are labeled. On the ribbon, in the Label Class group, you can see that the labels come from the Name field of the layer attribute table.
Tip:
As you have seen with the Suburb Boundaries and Building Footprints layers, you can label a layer either from its context menu or from the ribbon.
- In the Contents pane, right-click the Building Footprints layer and click Attribute Table .
- In the table, right-click the Historic field name heading and click Sort Descending .
- Scroll down through the table and look at some values in the Name field (not the Historic field) for the historic buildings.
Most of the historic buildings have proper names. Others are called Building, House, or Warehouse.
- Close the attribute table.
- In the Contents pane, right-click the Building Footprints layer and click Labeling Properties .
The Label Class pane appears.
Note:
By default, labels are grouped in a label class. All labels in a class have the same properties, such as text symbol and placement settings. A layer can have more than one label class. Additional label classes allow you to define different properties for subsets of labels within a layer. To create a label class, on the Labeling tab, in the Label Class group, click the Class drop-down arrow and click Create label class. Alternatively, click Menu on the Label Class pane.
- In the Label Class pane, confirm that the Class tab is selected at the top of the pane. Under it, click the SQL query tab .
Queries are used to filter features and table records of interest. In this case, you'll use the query to label only the historic buildings. Other buildings will not be labeled.
- In the Label Class pane, click New expression.
The clause builder appears.
- In the clause builder, click the drop-down arrow next to OBJECTID and click Historic. Make sure the query condition is set to is equal to. Click the drop-down arrow in the empty box and click Yes for the value.
- Click Apply at the bottom of the pane.
On the map, only the historic buildings (symbolized in purple) are labeled.
Change label placement settings
By default, all the historic buildings are labeled, even if labels are placed outside the features they belong to. You'll change some label properties and placement settings to make the labels easier to see and to make them fit within the buildings. Some of the labels will not display at all scales.
- In the Label Class pane, click the Position tab at the top of the pane.
Under Position, click the Position tab if necessary.
- Expand Placement.
- Change the Horizontal in polygon setting to Straight in polygon.
On the map, the labels are oriented to the longest axis of their features. They now fit better within their features.
- Uncheck the May place label outside polygon boundary check box.
Building labels are no longer placed completely outside their features. However, labels are allowed to extend beyond the boundary of a feature. (You may not see any changes in the area of the map you're zoomed to.)
- On the ribbon, on the Labeling tab, in the Text Symbol group, change the text symbol font size to 8 and the color to Arctic White.
The white labels are easier to read. The smaller font size means that more labels fit completely inside the buildings.
- Pan around the neighborhood and look at some other historic buildings.
Some buildings have long names and don't fit well within their features, even at this large scale. You'll place some constraints on how far a label is allowed to extend beyond the boundary of its feature.
- Near the top of the Label Class pane, click the Fitting strategy tab .
- Expand Overrun and change the Maximum overrun to 5 points. Press Enter.
- Expand Reduce size and check the Reduce font size check box. Under Font size reduction, change the Lower limit to 7.5 pts and press Enter.
- Under Font width compression, change the Lower limit to 95% and press Enter.
The changes are applied to the map as you make them. Labels are now allowed to overrun their feature boundaries by no more than 5 points. Font size and compression will be adjusted slightly to make a label fit better. Labels will not be drawn if they don't fit within a feature under these constraints.
- On the ribbon, click the Map tab. In the Navigate group, click Bookmarks and click Historic Buildings 2.
In this part of the neighborhood, you may see some historic buildings that aren't labeled.
- On the ribbon, under Feature Layer, click the Labeling tab. In the Map group, click View Unplaced .
Unplaced labels are drawn in red on the map.
- Click View Unplaced again to turn off the display of unplaced labels.
The Maplex Label Engine has many fitting strategies to help you place labels within features. For more information, see Why use additional strategies for placing labels?
- At the bottom of the map view, click the map scale drop-down arrow and click 1:10,000. If the scale isn't present in the list, type 1:10,000 directly in the scale box.
At this scale (the smallest scale at which the buildings are visible), your overrun setting prevents most or all of the building labels from drawing. However, it's possible that some labels are visible. You'll set a visibility range to make sure all the labels turn off when you zoom out. You want the labels to draw at the scale of city blocks but not at the scale of neighborhoods.
- On the ribbon, under Feature Layer, click the Labeling tab. In the Visibility Range group, click the input box next to Out Beyond . Type 1:2,500 and press Enter.
Any visible building labels turn off. They will display only when your map scale is 1:2,500 or larger.
- On the Quick Access Toolbar, click Save to save the project.
Label civil defense centers
In the event of a flood, civil defense centers—typically schools or community centers—are important emergency shelters. You'll label the civil defense centers in the Wellington area.
- Click the Map tab and go the Te Aro bookmark.
The buildings should no longer be visible. If they are visible, click Fixed Zoom Out as needed to zoom out to a scale beyond 1:10,000.
- In the Contents pane, turn on the Civil Defence Centres layer.
- On the map, click one of the red dots representing civil defense centers.
The Pop-up pane appears and displays the attributes of the feature you clicked. The labels for the civil defense centers are based on the Site Name attribute.
- Close the Pop-up pane.
- In the Contents pane, right-click the Civil Defence Centres layer and click Label .
The labels display on the map, but might look better with different symbology.
- On the ribbon, under Feature Layer, click the Labeling tab. In the Text Symbol group, expand the Text Symbol Style gallery. Under Scheme 2, click the Populated Place style.
- In the Label Class pane, click the Position tab in the top row of tabs if necessary. Click the Position tab under it and expand Placement.
Tip:
If the Label Class pane is not open, right-click the Civil Defence Centres layer in the Contents pane and click Labeling Properties .
- Change the placement from Best position to Bottom of point.
The label is placed under the feature.
- Change the placement back to Best position.
The Best position placement usually puts the label above and slightly to the right of the point. It uses other positions as needed to avoid conflicts with other labels or features.
- On the Quick Access Toolbar, click Save .
Customize labels with Arcade (optional)
You can add more information to the civil defense center labels with a label expression. You'll use Esri's expression language, Arcade, to display the number of people each center can hold and to customize the label's appearance.
- Right-click the Civil Defence Centres layer and click Attribute Table .
The Capacity field contains the maximum number of people each center can hold. For each civil defense center label, you'll add the word "Capacity" and the corresponding value from the Capacity field.
- Close the attribute table.
- On the Label Class pane, click the Class tab. Click the Label Expression tab under it.
- If necessary, click the Language drop-down arrow and click Arcade.
You will specify the text for the label in the Expression box. Since you have already labeled the civil defense centers, the site names are included in the Arcade expression as $feature.site_name. You'll add text and the Capacity field to the label as a new line under the site names.
- Copy the text below. In the Expression box, paste the text at the end of the existing expression.
+ TextFormatting.NewLine + "Capacity: " + $feature.Capacity
TextFormatting.NewLine creates a new line below the site name labels. "Capacity: " is added as text on the new line and $feature.Capacity adds the capacity value for each site.
- At the bottom of the pane, click Apply. Optionally pan the map to view labels in other suburbs.
The site name and capacity text both display with the same font size. To make the civil defense center name stand out, you'll decrease the size of the capacity text. By adding a font tag, you can specify the font and size of the text.
- Copy the text below. In the Expression box, paste the text after TextFormatting.NewLine + and before "Capacity: ".
"<FNT name= 'Arial' size= '9'>" +
- In the Expression box, at the end of the expression, type (or copy and paste) the closing font tag.
+ "</FNT>"
Everything between the opening and closing font tags will display with Arial font and size 9 text.
- Click Apply.
For more information about using Arcade for labeling, see Specify text for labels.
- On the Quick Access Toolbar, click Save to save the project.
You have labeled three layers on your map. You can keep experimenting with label properties to make improvements. For example, you can change the text color or halo size of the Suburb Boundaries layer to make its labels stand out more distinctly against the basemap. You can use different text symbols and fonts for the labels in any of your layers.