Hello,
I have a Layer that works as expected, except for the part where I
want to display "Hello"
when the mouse is clicked. The mouseClicked method below prints "button"
on the console, but the OMText is not displayed on the map.
I have successfully changed the color of an existing OMGraphic
in another mouse even method, but I can't seem to add an OMGraphic to my
omgraphic list.
Can somebody give a tip on how to make the OMText be displayed?
Code snippet:
public class UnitLocationLayer extends Layer
implements MapMouseListener {
... do stuff
public boolean mouseClicked(MouseEvent e) {
OMGraphic obj = omgraphics.findClosest(e.getX(), e.getY(), 4);
if (obj != null) {
System.out.println("button");
// Display information
OMText textLabel = new OMText(30f, -80f, "Hello", MText.JUSTIFY_CENTER);
textLabel.setVisible(true);
// omgraphics is the global OMGraphicsList
omgraphics.add(textLabel);
repaint();
}
...
}
Thanks.
-Thomas
-- [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 Tue Mar 22 14:07:34 2005
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:41 EDT