Instrução

Exibir rótulos de dois ou mais campos no ArcGIS Pro

Last Published: July 20, 2023

Resumo

In ArcGIS Pro, when labeling is enabled, features are labeled based on the values of a selected field. The following image is a map showing each Arkansas county library in and around the Glenwood area labelled with the city name.

Map showing each Arizona county library in and  around the Glenwood area labelled with the city name.

It is sometimes necessary to label a feature based on the values of two or more fields. This can be achieved using label expressions. For instance, a facility manager requiring the contact information of each county library in and around Glenwood. Displaying each library's city name and contact number in the labels quickly reveal the information the manager requires.

Procedimento

Follow the steps below to create and display labels based on the values of two or more fields in ArcGIS Pro.

  1. In ArcGIS Pro, open the project containing the layer.
  2. In the Contents pane, right-click the layer name, and select Label to turn on labeling.
  3. Right-click the layer name, and select Labeling Properties….
  4. In the Label Class pane, click the Language drop-down list, and select VBScript.
  5. Build the label expression, and run the script. In this example, the City and Contact fields are used to label the feature.
    1. Clear the Expression box before proceeding with the following steps.
    2. Under Fields, double-click City to add the City field to the Expression box.
    3. Key in '& vbnewline &' after the City field name in the Expression box to add a line break between the field values in the label. Alternatively, key in ‘& " " &’ to add a space instead of a line break between the field values.
    4. Under Fields, double-click Contact to append the Contact field to the expression.
    5. Click the Verify button to validate the expression.
    6. Click Apply to run the script.
Note:
To add fields to the expression, add a space or a line break after each field name, and double-click the field name under Fields to append the field.
Screenshot showing the steps to build the label expression.

The image below shows each Arkansas county library in and around Glenwood labeled based on the values from the City and Contact fields.

Map showing each library labelled based on values from the two fields.

ID do Artigo: 000025040

Receba notificações e encontre soluções para problemas novos ou comuns

Obtenha respostas resumidas e soluções de vídeo do nosso novo chatbot de IA.

Baixe o Aplicativo de Suporte da Esri

Informações Relacionadas

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download