I am not sure if this is the correct forum to ask this question but...
I have been unable to resolve an issue when adding labels to a rendered map
through MapXtreme, even though the code has been adapted from a MapInfo
example (see below). The data is being taken from Oracle 8.1.7. The same
table labels perfectly in MapInfo Professional 6.0.
Any help that anyone can give on this matter is appreciated.
_______________________________________________________________________
Layer thisLayer = map.getLayers().getLayer("poi");
LabelProperties labelProps = new LabelProperties();
// Set the Label offset and alignments to their default positions.
labelProps.setOffset(LabelProperties.DEFAULT_OFFSET);
labelProps.setHorizontalAlignment(LabelProperties.HORIZ_ALIGN_DEFAULT);
labelProps.setVerticalAlignment(LabelProperties.VERT_ALIGN_DEFAULT);
// Turn the multiline option on and set the columns to be used for labeling.
labelProps.setMultiLineTextMode(LabelProperties.MULTILINE_TEXT_ON);
// Note the code example uses setLabelExpression() but does not work either
labelProps.setLabelColumn("NAME");
// Set a Rendition for the Labels and create an OverrideLabelTheme in order
to
// display the options set.
Rendition rend = RenditionImpl.getDefaultRendition();
rend.setValue(Rendition.FONT_FAMILY, "Courier");
rend.setValue(Rendition.FONT_SIZE, 24);
rend.setValue(Rendition.FONT_WEIGHT, 8);
labelProps.setRendition(rend);
OverrideLabelTheme orLabelTheme = new OverrideLabelTheme(labelProps, "Theme
Name");
thisLayer.getLabelThemeList().add(orLabelTheme);
// Get the States Layer, set it's LabelProperties object, and turn labeling
on.
BaseLabelProperties base_label = new BaseLabelProperties(labelProps);
thisLayer.setLabelProperties(base_label);
thisLayer.setLabelProperties(labelProps);
thisLayer.setAutoLabel(true);
______________________________________________________________________
Regards
Colin Thornton.
Informed Solutions Ltd, The Old Bank, Old Market Place, Altrincham,
Cheshire, WA14 4PA UK
Tel: +44(0) 161 942 2000 Fax: +44(0)161 942 2015
This e-mail and any attachments are sent in confidence, subject to
applicable legal privilege and upon the basis that the recipient will
conduct applicable virus checks. If you receive this e-mail in error please
telephone us upon receipt on the above number. You are strictly prohibited
from using, copying or disseminating it or any information contained in it
save to the intended recipient. You are also advised that the opinions
contained within this e-mail are those of the author and may not be those of
Informed Solutions, its associates or Clients. Internet communications are
not secure and Informed Solutions Ltd is not responsible for their abuse by
third parties, nor for any alteration or corruption in transmission, nor for
any damage or loss caused by any virus or other defect.
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.