Adding a coordinate as dynamic text using an expression

You can use the Expression Parser to create a script that displays coordinate dynamic text in a specific way.

Coordinate dynamic text allows you to display coordinate values at specified locations on the map layout. The text can also be used to display the corner or center coordinates for rectangular areas of interest for a map series. The coordinate dynamic text updates whenever any dynamic text updates occur.

In the Selection area of the Coordinate Dynamic Text Properties dialog box, you can choose the data frame in which you want to find the coordinate location and where in the map layout you want the coordinate dynamic text to display.

When a map series is present, the Extent area in the Coordinate Dynamic Text Properties dialog box is available with the following options:

注意注意:

When there is no map series present, the Data Frame option is selected by default and the Extent area is not available.

The coordinate can be added to the map sheet using a VBScript expression. The Expression Parser dialog box allows you to use a field value or array of field values for the selected field to use as the dynamic text.

步骤:
  1. Start ArcMap.
    提示提示:

    If the ArcMap - Getting Started dialog box appears, you can open a new or existing map document. You can also check the Do not show this dialog box in the future check box and click Open.

  2. Click the Add Dynamic Text button Add Dynamic Text on the MPS Atlas toolbar.

    A crosshair with a letter A appears.

  3. Click anywhere in the map sheet layout.

    A piece of dynamic text is inserted on the page.

  4. Double-click the dynamic text.

    The Dynamic Text Properties dialog box appears.

  5. Click the Dynamic Text tab if necessary.
  6. Click the Dynamic Text drop-down arrow and choose Coordinate.
  7. Click Insert.

    The coordinate text appears in the text box.

  8. Click the dynamic text element in the text field.

    The Coordinate Dynamic Text Properties dialog box appears.

    Coordinate Dynamic Text Properties dialog box
  9. Click the Data Frame drop-down arrow and choose the data frame for which you want to display the coordinate location.
  10. Click the Location drop-down arrow and choose the layout location on which to display the coordinates.
  11. If there is a current map series, click the Data Frame or Area of interest envelope option.
    注意注意:

    When there is no map series present, the Data Frame option is selected by default, and the Extent area is not available.

  12. Click the Expression option in the Text String area.
  13. Click Edit Script.

    The Expression Parser dialog box appears.

    Coordinate Dynamic Text Expression Parser dialog box
  14. In the Expression area, add the following text to right of the Generate = expression: [Longitude] & " " & [Latitude].
  15. Click Verify.

    The Output area lists Function evaluated successfully.

  16. Click OK to close the Expression Parser dialog box.
  17. Click OK to close the Coordinate Dynamic Text Properties dialog box.
  18. Click OK to close the Dynamic Text Properties dialog box.

    The dynamic text renders a coordinate pair on the page layout.

  19. 注意注意:

    If you change the layer or data frame, the expression is cleared. A new layer requires a new set of function parameters.


9/23/2010