Legends in layouts are frames that contain a legend. There are two types of legends in layouts, dynamic legends and static legends:
See the First Look - Legends in Maps and Layouts video for a quick introduction to new legend capabilities.
To add a dynamic legend frame, open a layout, choose the Create Legend tool from the drop-down menu for the cursor mode button in the main toolbar, and then in the layout click the approximate center of the legend frame you would like to create.
A dynamic legend frame appears at that location with a default legend in the frame. The legend will take its contents from the topmost map frame under the legend, automatically including or excluding layers depending on the legend mode set for layers in the map used in that topmost frame.
The Info pane pops open to the Style tab so we can edit the Legend. When we would like to apply any changes, we press the Update Frame button. We can resize and reposition the legend frame as desired, or click again to create another legend frame.
When we are finished creating legend frames we can choose the Default + cursor tool in the main toolbar to exit Create Legend mode.
Keyboard shortcut: Press Shift-Esc to get back to Default navigation mode.
We open the layout and click on the Create Legend tool in the cursor mode button in the main toolbar.
In the layout we click approximately where we would like the legend frame to appear.
A small legend frame of default size appears at the clicked spot, using the default legend style. The legend takes its contents from whatever is the topmost frame directly below the frame in the display stack. If there is no frame directly below the legend, the legend takes its contents from whatever is the topmost frame in the layout.
The legend frame is already picked for editing, as if we had Alt-clicked the frame. The Info pane will automatically be brought to the foreground, ready for any changes to the legend frame or to launch the Legend dialog.
Zooming into the layout window, we can see the default style used for the legend.
In the Layers pane for the layout, a new Legend frame appears as well:
The Info pane pops open with the default styling for the legend frame.
The Info pane launches with a light blue background by default in the preview pane for the grid. The default light blue background makes it easy to see legends that use white or other light colors. We can change the background color for the preview pane as desired by clicking the square color well box in the upper right corner of the preview pane.
The preview pane shows a schematic example of the overall style used for the legend. We can change the style of the frame that contains the legend by adjusting the Background or Border color, width, and padding for the frame. For simple legends, we rarely want to make such changes, and instead we will want to change simple characteristics of the legend itself.
Configure parameters for the legend by clicking the [...] browse button, and then in the Legend dialog choosing different parameters.
For example, we can change the font used for the Text line at the top of the legend to a bold font. Press OK to accept changes in the dialog.
Back in the Info pane, press the Update Frame button to apply the changes.
Immediately, the new legend style appears.
Zooming in to the layout window again, we can see that the text line at the top of the legend is now boldfaced.
We can reposition or resize the frame that contains the legend by simply dragging it to a new position. If we like we can manually change the X and Y extents of the frame and the frame size by clicking on the Position tab and then entering whatever extents in millimeters we desire. Except for special purposes, doing that is inefficient as it is easier to simply drag the borders of the frame to resize it and reposition it as we like.
We will reposition the legend frame.
To do that, we click on the Default cursor button in the main toolbar, to exit Create Legend mode. This allows us to click into the Layout without creating a new legend frame with each click.
We can then drag the legend frame to a new position, as seen above.
To resize the legend, we drag the corner handles to resize the legend frame.
In the illustration above, we have dragged the handles of the frame to make the legend narrower. We have also reduced the vertical height of the frame, and we have dragged the entire frame toward the upper right corner of the layout.
Resizing the frame horizontally will adjust the width of the legend. The vertical height of the legend is automatically computed. Resizing the frame to make it bigger in the vertical dimension will not make the legend taller. However, if we reduce the height of the frame to smaller than the default size of the legend, the legend will start clipping contents so that what is shown will fit within the frame.
For a more customized legend, we can convert the dynamic legend into a collection of static legend frames. See the main Legends topic for information on converting a dynamic legend into a collection of static frames.
The Legend dialog for legends in layouts is the same as the Legend dialog for map windows, except that the layout version has no Apply button and no Margin and Size controls, since those are handled by controls in the Info pane for legends or, in the case of Size, by directly resizing the legend frame in the layout.
The Legend dialog for layouts allows setting the following parameters:
(Preview pane) |
Shows a preview of the current settings used in the dialog. The background color is light blue by default, to allow either very light or dark shapes to be visible. Change the background color of the preview pane by clicking the square box in the upper right corner of the preview pane.
The preview pane shows a schematic representation of a legend that includes typical elements which can be configured in the Legend dialog. It does not show the actual legend being configured, since legends are usually too large to fit into the preview pane. |
(Styles gallery) |
Choose a legend style from the gallery. At the present time, the gallery provides a single, plain style. from a gallery of popular shapes. Hovering the mouse over a style will show the name of that style in a tooltip. |
Foreground and stroke color for style and text. |
|
Fill color. |
|
Buttons that show a small "box" sub-icon indicate that color has been changed from the default. |
|
Stroke |
Stroke width for the style, currently setting the width of the legend border. |
Text |
Text alignment (right, center, left) for legend entries that are entirely text, such as titles. The Cities : Population entry in the preview pane is an example. |
Single |
Text alignment (right, center, left) for legend entries that have a single sample, such as layers that are not thematically formatted. Text in the Roads, Lakes, and Names entries in the preview pane provides examples. |
Multiple |
Text alignment (right, center, left) for legend entries that have multiple samples, such as thematically formatted layers. Text next to the magenta circles under the Cities : Population layer provides examples. |
Font for text. Fully configurable for typeface, effects, bold, etc. |
|
Font size for text. |
|
Position |
For maps, a combination of left, center or right horizontal position and top, center, or bottom vertical position, to place the legend in any of nine possible positions within the map window. The default is the left bottom corner.
For layouts, a choice of top, center, or bottom vertical position within the frame. The default is the center of the frame. |
Padding |
The distance in points between the samples and text of a legend entry and the surrounding legend border. Default is 3 points. Increasing the padding provides more space between the content of a legend's entries and the borders. |
In addition to the above settings, the composition of a legend will be influenced by Legend Mode settings in the Layers pane. Legend mode settings determine which layers in a map will appear in the legend and whether, in the case of thematically formatted layers, if they will appear as single line samples or multiple line samples.
Dynamic legends in layouts take their contents from whatever is the topmost map frame below the legend frame in the Layers pane display stack. That provides easy, unambiguous control of the source for the legend's contents if we use the Layers pane, but it can result in unexpected effects if we do not use the Layers pane. We should also keep in mind that map frames are any layout frame that is populated from a map, drawing, image, or labels layer.
Consider a layout as seen above. The layout has three frames, as seen in the Layers pane illustrated below. The uppermost frame in the layout is a text frame containing the Roads from OSM Data caption. The next frame in the stack is the frame that appears to be inset in the upper left of the layout, containing a view of a Bing street map image in a frame. The lowest frame is the largest one in the background, which takes its contents from a map.
We use the Create Legend tool to add a dynamic legend to the layout, by choosing the tool and then clicking near the right edge of the layout.
A new frame appears, but it has no contents. Why is that?
If we take a look at the Layers pane, as illustrated at left above, we see that a new dynamic Legend frame has been created in the layout as the uppermost frame in the layout. The uppermost map frame below that is the frame populated by a Bing streets web server image. The dynamic legend takes its contents from whatever is the uppermost map frame below it in the Layers pane, so in this case it dynamically takes its content from the Bing streets web server image. Since dynamic legends do not show anything for such web server layers, the Legend frame is empty.
If we want the dynamic legend to take its contents from the map frame at the bottom of the Layers pane stack, in the Layers pane we can Ctrl-click the Legend frame to select it, and then use the Move Down button in the Layers pane toolbar to move the Legend frame down in the Layers pane display stack below the Bing streets layer. In the illustration at right above, the Legend frame has been moved down so the uppermost frame below it in the Layers pane display stack is the map frame we want to be the context for the dynamic legend.
As soon as we move the Legend frame down in the Layers pane display stack, it automatically takes its contents from the map frame that is below it in the display stack.
Style overrides excluded - Legends created using Create Legend will capture formatting in the Style pane, but will not capture style overrides used to style objects individually if such have been applied.
More than just maps - Legends can be created for any visual display window that can host multiple layers, such as drawing windows, image windows, or labels windows in addition to map windows. When this documentation refers to a "map window" in the context of creating legends for map windows or for map window frames in layouts, it also intends to refer to all such visual display windows as well.
Example: Layout Properties - Editing properties which appear in the mfd_meta table for a layout changes the content of that layout. We can exploit that effect to create standardized layouts which are then re-cycled for different content.