Molato badr wrote:
>
>
>--
>Molato Badr
>
>Hi again,
>I was not clear in my last e-mail so i will reformulate my question.
>I would like to label the roads and the streets that I displayed using the
>shape files. To do this I would like to use my dbf files. -It was already
>done using mapObject from ESRI - So the names are all stored in these dbf
>files but I did not find out how to display them in the mapBean component
>(according to the shape files) without assigning each time the coordinates
>of the city to the label.
> Thank you
>
>
>--
>[To unsubscribe to this list send an email to "majdart@bbn.com"
>with the following text in the BODY of the message "unsubscribe openmap-users"]
>
>
>
Hi,
This is how I did it:
- I use an EsriPlugin: convenient because the content of the .dbf file
is loaded
- I wrote a class that extends the AbstractLocationHandler in which the
"createData" member computes the lat/lon from the EsriGraphicList:
// find lat/long coords for the object
omGraphic = Layer.getEsriGraphicList().getOMGraphicAt(index);
EsriGraphic eg = (EsriGraphic) omGraphic;
float ll[] = eg.getExtents();
float lat = (ll[0]+ll[2])/2; // Works for points and links. For
that latest, label position is at the centre of it...
float lon = (ll[1]+ll[3])/2;
// Create label and put it in the QuadTree
loc = new BasicLocation(lat, lon, label, null);
loc.setLocationHandler(this);
qt.put(lat, lon, loc);
Hope this helps
-- Prof Dr Bart Jourquin F.U.Ca.M. - G.T.M. Chaussee de Binche, 151a B7000 Mons Belgium Tel. : +32 65 323293 Fax. : +32 65 315691 http://message.fucam.ac.be/~jourquin -- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Wed Jun 11 03:58:08 2003
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:35 EDT