Re: [OpenMap Users] Lat, Lon Display and CoordMouseMode

From: Don Dietrick <>
Date: Wed, 14 Mar 2007 16:28:12 -0400

Hi Thomas,

There's a couple of things you can do. The CoordMouseMode asks the
InformationDelegator to put the coordinates on its info line
specified for coordinates
(InformationDelegator.COORDINATE_INFO_LINE), and to the
InformationDelegator, that's just a JLabel. If you want the
coordinates to go somewhere else, you can create a JLabel somewhere
else in your application, and tell the InformationDelegator you want
it to use your label instead.

You can also just put the information delegator somewhere else in
your GUI and have it display the coords.

You can add a MouseMotionListener to the MapBean to get the mouse
events. The MapBean has methods on it that will tell you the
coordinates of the pixel location, and should be the source of the
MouseEvents you get.

To get to the MapBean and/or the InformationDelegator, you can use
the MapHandler in the BasicMapPanel, if that's what you are using.

Hope this helps,


On Mar 13, 2007, at 3:06 PM, Lepkowski, Thomas wrote:

> Hello,
> I'm trying to get an understanding of how to most efficiently
> display Lat, Lon of the current mouse position as it moves over the
> map. Looks like CoordMouseMode plays an important part. I'd like
> to display Lat, Lon somewhere on the GUI (not necessarily on the
> "info line". I admit not fully understanding the architectural
> details of the various OM parts. I'd appreciate any guidance.
> Thanks.

Don Dietrick,
BBN Technologies, Cambridge, MA

[To unsubscribe to this list send an email to ""
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Mar 14 2007 - 16:28:50 EDT

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