AddLegendItem()
Summary
Adds an item to a manual map legend.
Syntax
result = AddLegendItem(string map_name, array item_info)
| Argument |
Contents |
| map_name |
The name of the map |
| item_info |
An array containing the item type (a string) and other information about the item, as indicated below. |
| Item Type |
Other Information |
| Space |
An integer: the position in the legend at which the space is located |
| Text |
Two strings: the text, and the font with which to display the text |
| Set |
One string: the name of the set |
| Theme |
One string and one integer: the name of the theme and the number of the class |
Returns
If the item type is a theme class, the function returns an integer containing the number of classes in the theme. Otherwise, it returns 1.
Example
rslt = AddLegendItem("My Map", {"Space", 4})
rslt = AddLegendItem("U.S. States", {"Set", "High Income States"})
Error Codes
| Error Type |
Meaning |
| Error |
The type of the item is incorrect or the additional information is not specified correctly |
| NotFound |
The named map or specified item does not exist, the map has no legend, or the item array is null |
See Also