|
Labels
Re-use
custom or automatic labels via a separate label point map
You've changed positions of your "automatic" labels and
saved your workspace. But now you want to use these re-positioned labels with other
workspaces.
1. Save your workspace-specific labels, both the
"automatic" labels and labels you've moved or otherwise customized, into a
separate map layer composed of "text" objects.
2. Convert the "text" object layer into a point layer, with the text as a
table value.
3. Turn on the "automatic" labels for the new point layer.
1. Save your workspace-specific labels:
Use the Labeler.mbx tool (Tools > Tool Manager...) to save automatic and customized
labels. [Not Autolabeler.mbx!]

Specify a new table into which the labels will be saved:

Check your Layer Control dialog. You'll see that you now
have a new map layer, containing only text objects. You can make this layer editable
and move the text around to your hearts content. You can also use this permanent
layer with other maps and workspaces.
This may be all you need to do. For maximum flexibility, though,
considering converting the text objects into point objects with text values in the
associated table.
2. Convert the "text" object layer into a
point layer (e.g., "Lbl_Txt.tab")
a. Use Table > Maintenance > Table Structure ... to add a column (eg.,
"Text_for_Label") to the text object layer. Define the column to be
Character (not Float, Decimal, etc). This column will hold the text values that are
now in Lbl_Txt.tab as text objects. Note: If your labels disappear when you do
this, don't worry. Use Layer Control to re-add the Lbl_Txt layer to the map.
b. Use Table > Update Column ... to fill-in the Text_for_Label column values.
You need to use the ObjectInfo expression illustrated below. This is a
MapBasic function, but you do not need to have the MapBasic program.

c. Use the MapBasic window to convert your text object in
Lbl_Txt.tab into point objects.
Open the MapBasic window via Options > Show MapBasic window ...
Type in the following command:
Update Lbl_Txt Set obj =
CreatePoint(CentroidX(obj),CentroidY(obj)) <Enter>
The above command makes a point object at the center of the
text object. Sorry, you cannot do this via the Update Table dialog.
3. Turn on the "automatic" labels for the new
point map.
Use the standard Layer Control options to specify the
"Text_for_Label" column as the source of the labels. Check the checkbox to
cause the labels to display dynamically. You'll probably also want to set the point
symbol for Lbl_Txt to "None". Now your labels are in the right place; they
are in a permanent map layer; and they will "scale" like normal automatic
labels.
For more information about label
issues, tricks and traps, click here.
Making
2-line labels
Three options:
-
Dbl-click on each label; edit each label to add the
"Carriage return" character. These types of changes get saved in your Workspace
only [assuming you save one]. Alternatively, you could save all your "custom
labels" into a new permanent map layer using the labeler.mbx
[supplied with MapInfo 4.1+]
-
Use Table > Update Column to change the column values
that are used as a label. You would change the value to include a "Carriage
return" symbol after the first word, for example. These changes are permanently in
your data table, so can be used with many separate projects having many different
workspaces. You can manually adjust the position of the "Carriage return"
character on a record-by-record basis, if you choose, and all these tweaks are also saved
when you save your table.
-
Make an Expression for the Label. The expression can
dynamically "break" the label, as these labels are created and displayed by
MapInfo. The label expression definition can be saved in a workspace. For other projects,
you would re-enter an analogous expression.
Using "Update Column" to
Make 2-line labels
The menu command illustrated below does the following:
-
Changes each value of column SGSINAME in the TMP table.
-
Looks for the position of any space in the value of SGSINAME
[cf Instr()]
-
Insert a "Line feed" character in place of the
first space it finds. The "Line feed" character is Chr$(10).
-
Composes the final value as the part of the name that came
before the "space", plus the "line feed" character, plus the part of
the name that followed the space.
-
Note #1: This exact command will insert a "line feed
character" where the name has *no* embedded spaces. If this is a problem, select all
records *with*
embedded spaces first. Then run the Update Column command on just these.
-
Note #2: The "line feed" character will appear in
your "browser" as a thick vertical bar of sorts. You can use "cut" and
"paste" to move this character around.

Using a label Expression to Make
2-line labels
Use Layer Control to pick the map layer and click on the Label button
-
As a label source, pick "Expression" instead of
any column name.
-
Enter the expression shown above, modified of course to use
your table and column names.
Before:
"Colonia Presbitero Fidel Maiz"

After:
"Colonia
Presbitero Fidel Maiz"

|