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:
- Data frame—Displays coordinate dynamic text for the rectangular geometry of the data frame
- Area of interest envelope—Displays coordinate dynamic text for the rectangular geometry of the MPS-Atlas area of interest envelope
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.
- Start ArcMap.
-
Click the Add Dynamic Text button on the MPS Atlas toolbar.
A crosshair with a letter A appears.
-
Click anywhere in the map sheet layout.
A piece of dynamic text is inserted on the page.
-
Double-click the dynamic text.
The Dynamic Text Properties dialog box appears.
- Click the Dynamic Text tab if necessary.
- Click the Dynamic Text drop-down arrow and choose Coordinate.
-
Click Insert.
The coordinate text appears in the text box.
-
Click the dynamic text element in the text field.
The Coordinate Dynamic Text Properties dialog box appears.
- Click the Data Frame drop-down arrow and choose the data frame for which you want to display the coordinate location.
- Click the Location drop-down arrow and choose the layout location on which to display the coordinates.
-
If there is a current map series, click the Data Frame or Area of interest envelope option in the Extent area.
注意:
When there is no map series present, the Data Frame option is selected by default, and the Extent area is not available.
- Click the Expression option in the Text String area.
-
Click Edit Script.
The Expression Parser dialog box appears.
- In the Expression area, add the following text to right of the Generate = expression: [Longitude] & " " & [Latitude].
- Click Verify.
The Output area lists Function evaluated successfully.
- Click OK to close the Expression Parser dialog box.
- Click OK to close the Coordinate Dynamic Text Properties dialog box.
- Click OK to close the Dynamic Text Properties dialog box.
The dynamic text renders a coordinate pair on the page layout.
If you change the layer or data frame, the expression is cleared. A new layer requires a new set of function parameters.