GetLegendSettings()
Summary
Gets the settings for a map legend.
Syntax
leg_set = GetLegendSettings(string map_name)
| Argument |
Contents |
| map_name |
The name of the map |
Returns
An array of five elements containing the legend settings:
| Settings Element |
Type |
Contents |
| 1 |
String |
Type of legend ("Automatic", "Manual" or "None", where "None" indicates a legend created with the given settings but not displayed) |
| 2 |
Array |
Six flags indicating the legend contents (see table below) |
| 3 |
Array |
Three flags indicating legend style (see table below) |
| 4 |
Array |
Four font strings indicating the fonts used for the legend title, footnote, subtitles and items |
| 5 |
Array |
Two strings containing the legend title and footnote |
The seven flags in the second element indicate the legend contents:
| Contents Flags |
Type |
Contents |
| 1 |
Integer |
Whether a title is displayed (1 or 0) |
| 2 |
Integer |
Whether a footnote is displayed (1 or 0) |
| 3 |
Integer |
Whether layer information is displayed (1 or 0) |
| 4 |
Integer |
Whether set information is displayed (1 or 0) |
| 5 |
Integer |
Whether theme information is displayed (1 or 0) |
| 6 |
Integer |
How the scale of miles is displayed (0 for none, or 1-6 indicating the style to use) |
| 7 |
Integer |
Whether feature display settings are displayed (1 or 0) |
The three flags in the third element indicate the legend style:
| Style Flags |
Type |
Contents |
| 1 |
Integer |
Whether the legend is attached to the map or in a separate window (1 or 0) |
| 2 |
Integer |
Whether the legend is framed (1 or 0) |
| 3 |
Integer |
Whether the background is filled (1) or transparent (0). If the background is filled (the default), a background style and background color must be specified as options in the options array |
Example
leg_set = GetLegendSettings("New York Map")
Error Codes
| Error Type |
Meaning |
| NotFound |
The named map does not exist or has no legend |
See Also