Hi,
On 9-nov-2006, at 19:18, Don Dietrick wrote:
> It's actually a little easier than that. The MouseEvent is
> actually a MapMouseEvent, and if you cast it to a MapMouseEvent
> you'll find it has a getLatLon() method.
>
> The other thing you can do from a plugin is call getComponent(),
> which returns the layer (PlugInLayer), and you can call
> getProjection() on the layer.
Got ya.
So it boils down to this:
public class MyFirstPlugIn extends OMGraphicHandlerPlugIn //
OMGraphicHandlerPlugIn implements MapMouseListener interface
{
...
public boolean mouseClicked(MouseEvent e)
{
if (e instanceof MapMouseEvent) {
LatLonPoint lp = ((MapMouseEvent)e).getLatLon();
System.err.println("Latlon of click=" + lp.toString());
} else {
System.err.println("HUH? got mouseClicked but not a
MapMouseEvent?!?");
}
return (false);
}
...
}
--
[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 09 2006 - 13:43:00 EST