Re: [OpenMap Users] Labelling

From: Don Dietrick <dietrick_at_bbn.com>
Date: Wed, 1 Mar 2006 17:55:28 -0500

Hi Dave,

On Feb 28, 2006, at 4:54 AM, Dave Brown wrote:

> Can anyone explain to me the method I would use to render Labels on
> a street
> shapefile I have.

The easiest thing to do now is to set an OMTextLabeler as an
attribute on each OMGraphic:

OMGraphic.putAttribute(OMGraphicConstants.LABEL, new OMTextLabeler
("street name"));

The labels will be rendered automatically. If you want special
behavior, like scale filtering, you could substitute an extended
OMTextLabeler that will only paint if the scale is a certain value,
or something like that.

The order of the rows in the DBF match the order of the shapes out of
the shape file. If you use the ShapeLayer, you can ask the
OMGraphics for their index (row number) in the app object. There's
an off by one thing going on here, though, so be careful. I keep
forgetting which one starts at 1 and which starts at 0. I think the
index numbers in the OMGraphics start at 1.

>
> There is a specific column in the DBF which I wish to use as the
> label.
>
> Also, 'while I'm here.. ' Re' Routing.. How can openmap take into
> consideration the direction of a particular road, whether its
> oneway or not
> when route calculating ? The direction indicator in my case also
> comes
> from the accompanying DBF for the shapefile.

I'll have to check on this, but I can't see anything in the code that
handles one way streets.

- Don

--
[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 Wed Mar 01 2006 - 17:56:18 EST

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