AutoLabel 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

Draws labels in a Map window, and stores the labels in the Cosmetic layer. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

AutoLabel
	[ Window window_id ]
	[ { Selection | Layer layer_id } ]
	[ Overlap [ { On | Off } ] ] 
	[ Duplicates [ { On | Off } ] ] 

window_id is an integer window identifier for a Map window.

layer_id is a table name (e.g., World) or a SmallInt layer number (e.g., 1 to draw labels for the top layer).

Description

The AutoLabel statement draws labels (text objects) in a Map window. Only objects that are currently visible in the Map window are labeled. The Window clause controls which Map window is labeled. If you omit the Window clause, MapInfo Pro draws labels in the front-most Map window. If you specify Selection, only selected objects are labeled. If you omit both the Selection and the Layer clause, all layers are labeled.

The Overlap clause controls whether MapInfo Pro draws labels that overlap other labels. This setting defaults to Off (MapInfo Pro will not draw overlapping labels). To force MapInfo Pro to draw a label for every map object, regardless of whether the labels overlap, specify Overlap On. The Duplicates clause controls whether MapInfo Pro draws a new label for an object that has already been labeled. This setting defaults to Off (duplicates not allowed). The AutoLabel statement uses whatever font and position settings are in effect. Set label options by choosing the Layers command (on the HOME tab in the Document Windows group). To control font and position settings through MapBasic, issue a Set Map statement.

Example

Open Table "world" Interactive
Open Table "worldcap" Interactive 
Map From world, worldcap 
AutoLabel 
	Window FrontWindow( )
	Layer world 

See Also:

Set Map statement