RE: [OpenMap Users] OMTextLabeler question

From: Graham, John <>
Date: Thu, 15 Nov 2007 15:48:05 -0600

I get an OMGraphicList from the OMGraphicHandlerLayer using getList and
I iterate through the OMGraphicList and find the graphic(s) I want to
label. These are just plain "OMGraphic"s.

Then all I am doing is:

OMTextLabeler tl = new OMTextLabeler(hasc_code,
omg.putAttribute(OMGraphicConstants.LABEL, tl);

Is this a viable way of adding a text label to a graphic?

Do I need to update the OMGraphicList via the OMGraphicLayerHandler
after the label is added?


-----Original Message-----
From: Don Dietrick []
Sent: Thursday, November 15, 2007 4:26 PM
To: Graham, John
Subject: Re: [OpenMap Users] OMTextLabeler question

Hi John,

Looks OK to me, what kind of OMGraphic are you using? I don't think it
works for an OMGraphicList, because the OMTextLabeler piggybacks on the
projected location of the OMGraphic, and the OMGraphicList doesn't
really know where its OMGraphics are.

- Don

Graham, John wrote:
> Hi,
> I am using the following code to add a text label (HASC code string)
> to an OMGraphic:
> ...
> OMTextLabeler tl = new OMTextLabeler(hasc_code,
> OMTextLabeler.JUSTIFY_CENTER); FontSizer fs = new FontSizer(new
> java.awt.Font("Arial", java.awt.Font.PLAIN, 8), 275158.16f, 1, 5, 32);

> tl.setFontSizer(fs); omg.putAttribute(OMGraphicConstants.LABEL, tl);
> My problem is, the text label is never getting displayed. I removed
> the FontSizer to see if that was the wasn't.
> I tried repainting the layer, which is an AreaShapeLayer. I also tried

> adding the OMTextLabeler object to the OMGraphicList but that didn't
> work either.
> Any ideas on what I might be doing wrong?
> Thanks,
> John

[To unsubscribe to this list send an email to ""
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Nov 15 2007 - 16:48:30 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:08 EDT