Ashley,
You can get information about displayed labels and change them including
their location. To do so, you must identify the label you want to change.
The functionality is contained in the LabelInfo() function. The searching
for labels is done via LabelFindFirst, LabelFindNext and/or LabelFindByID.
Changing a label is done via the
Set Map (WindowId) Layer (number or name) Label Object (rowid)
command where you specify the properties you wish to change.
These changes may only be preserved in a workspace.
Determining whether labels overlap can be done via LabelInfo() by returning
a text object representation of the generated label and querying the MBR of
the text via ObjectGeography. However, if the label is rotated, you will
need to use the rotation angle (available from LabelInfo) to determine
where in the MBR the label text actually exists.
I hope this helps.
Eric Blasenheim
Software Architect
MapInfo Corporation
Mail List:
[EMAIL PROTECTED]
From: on 12/20/2002 11:19 AM ZE10B
To: "'Mapinfo List (E-mail)'" <[EMAIL PROTECTED]>
cc:
Subject: MI-L moving overlapping labels programmatically
hey people,
i know i've groaned about labels before, but before i spend some time
looking into the subject any further, does anyone know if there's an easy
way to:
1. detect whether labels are overlapping
2. move labels programmatically.
the other option is that i could turn autolabelling off for a given layer,
and assign labels to objects individually (there's only ever less than a
dozen objects on this given layer). my thought is that my program could
check the locations of the objects and the current zoom level to figure out
where the best position for a label would be.
if the latter is my best option, is it difficult and fiddly, or something
which should be relatively easy to accomplish.
gramercy,
ash.
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 4635
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 4664