Exercise 2: Add labels that use an expression

AutoCAD Map 3D 2009

 
Exercise 2: Add labels that use an expression
 
 
 

You can label each parcel with text that is determined by an expression. In this exercise, you will create a label for each parcel that displays the parcel address on two lines.

The Style Editor should still be open from the previous exercise.

NoteThis exercise uses the map you created and modified in the previous exercises.

To add labels using expressions

  1. In the Style Editor, click the entry under Feature Label for the first rule in the theme.

    Because you are theming the Parcels feature, you have one entry for each theme rule.

  2. In the Style and Label Editor, click Property To Display, scroll down to the bottom of the list, and click Expression.

  3. To create the two-line label, enter Concat (ADDRESS, Concat ('\n', STNAME))

    The Concat operator combines multiple properties and uses the '\n' argument to insert a line break.

  4. Validate the expression.
  5. Click OK in the Style and Label Editor.
  6. In the Style Editor, click the entry under Feature Label for the second rule in the theme.
  7. In the Style and Label Editor, click Property To Display, scroll down to the bottom of the list, and click the Concat expression you created earlier. Click OK twice.

    Once you create an expression for a label, you can select it from the Property To Display list. You don’t need to re-create it each time.

  8. Repeat steps 5 and 6 for each entry in the theme for which you want labels.
  9. Close the Style Editor to see the changes.

Where you are now

You themed the Parcels layer, using a calculated property as the basis for the theme. You added labels whose content was determined by an expression.

To continue this tutorial, go to Lesson 5: Publishing Your Styled Map to MapGuide