Create Designer Legend statement - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Creates a new Legend window to display cartographic style legends for vector, raster, and theme map layers for an active Map window. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Create Designer Legend 
	[ From Window map_window_id ]
	[ WINDOW_CLAUSE ]
	[ DEFAULT_FRAME_CLAUSE ]
	[ LEGEND_TEXT_FRAME_CLAUSE ]
	[ FRAME_FROM_LAYER_CLAUSE ]

map_window_id is an integer window identifier which you can obtain by calling the FrontWindow() function and WindowID() function. If this identifier is for a map within a Layout window, then legends are created in the window.

WINDOW_CLAUSE, see Window Settings

DEFAULT_FRAME_CLAUSE, see Default Frame Settings

LEGEND_TEXT_FRAME_CLAUSE, see Legend Text Frame Settings

FRAME_FROM_LAYER_CLAUSE, see Frame From Layer Settings

Description

The Create Designer Legend statement allows you to create legends for vector, raster, and thematic layers for an active Map window. You can create more than one Legend window per Map window, and each map layer can contribute one legend frame to the Legend window.

Only file formats supported by the Advanced Raster product have the ability to create raster legends. The file formats supported in Advanced Raster can be found in MapInfo Pro on the PRO tab by clicking Options. Under the MapInfo Pro Raster section, click Preferences. In the Raster Preferences dialog, select Raster Formats. Only formats that are not Imagery / Image Palette support creating a legend. With the exception of ERDAS Enhanced Compressed Wavelets (.ecw), New Labelled USGS DOQ (.doq), and BSB NOAA Nautical Chart (.kap), all other formats support creating a legend.

To create legends that define your own custom styles using the Create Designer Legend statement, see Frame From Layer Settings.

When using this statement, at least one Frame From Layer (FRAME_FROM_LAYER_CLAUSE) clause is required. This clause creates a legend in the Legend window. All clauses pertaining to the entire Legend window, such the WINDOW_CLAUSES, must proceed the first Frame From Layer clause.

Note: The Shade statement and Set Legend statement create and modify thematic legends, but only the Create Designer Legend statement adds thematic legends to a Legend window (by specifying the theme layer ID using the Frame From Layer id clause).

See Also:

Alter Designer Frame statement, Add Designer Frame statement, Remove Designer Frame statement, Set Designer Legend statement, Set Window statement, WindowInfo() function