Re: [OpenMap Users] OMTextLabeler question

From: Don Dietrick <dietrick_at_bbn.com>
Date: Thu, 15 Nov 2007 17:25:50 -0500

This is the way you do it. The example I always refer back to is the
DemoLayer, and it looks like you're doing the same thing as that layer.

I'd check to make sure that the plain OMGraphics aren't OMGraphicLists,
which would be the case for a multi-part shape from a shape file. I'm
not really sure of another reason why it wouldn't be working if the
OMGraphics are being displayed.

- Don

Graham, John wrote:
> 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,
> OMTextLabeler.JUSTIFY_CENTER);
> 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?
>
> John
>
>
>
> -----Original Message-----
> From: Don Dietrick [mailto:dietrick_at_bbn.com]
> Sent: Thursday, November 15, 2007 4:26 PM
> To: Graham, John
> Cc: openmap-users_at_bbn.com
> 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 issue...it 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 "majdart_at_bbn.com"
> with the following text in the BODY of the message "unsubscribe openmap-users"]
>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Nov 15 2007 - 17:26:55 EST

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