mapimage.java public method addition?

Stephen Lime steve.lime at dnr.state.mn.us
Wed Jan 24 13:29:45 PST 2001


You folks might want to consider patching a newer version of the mapimage
applet rather than the one Tom is mucking with. It uses the newer mouse
API and may be better suited to this modification. See attached...

Steve

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> "Joan Friedman" <webworks at world.std.com> 01/24/01 09:43AM >>>
> A feature that I would like to add (or see added) is an X Y report of
where
the user's mouse is over the mapplet.
 <....>
> I've tried this but can't seem to find out the how to get the XY out of
the
> applet.
>Tom

I'm not familar with the maplet, but I can tell you a bit about java. You
could extend MouseMotionAdapter to capture the mouse position. The general
idea would be like this:

public class PointLabeler extends MouseMotionAdapter {
    public void mouseMoved (MouseEvent  e) {
       // get the position in pixels relative to java's default origin at
the top left corner of the innermost component containing the mouse position
       int x = e.getX();
       int y = e.getY();
       // translate position from java coordinates to map coordinates

      // display label
   }
}

Let me know if you need more help.

Joan




-------------- next part --------------
A non-text attachment was scrubbed...
Name: mapplet.java
Type: application/octet-stream
Size: 7475 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20010124/0fe71a09/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: README
Type: application/octet-stream
Size: 2691 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20010124/0fe71a09/attachment-0001.obj>


More information about the MapServer-users mailing list