MouseOver & Coordinates

Roger Boily boily at BSW.ORG
Thu Mar 10 02:27:47 PST 2005


Hi Stefan,
you can try this java script (from who? I do not remember):
Hope it helps.
Roger

public void mouseMoved(MouseEvent e) {
    String msg;
    xover = e.getX();
    yover = e.getY();
        thex = (thecurxmin + (xover * ((thecurxmax -
thecurxmin)/Applet_Width)));
        they = (thecurymin - (yover * ((thecurymax -
thecurymin)/Applet_Height)));
        String xs = String.valueOf(thex).toString();
        String ys = String.valueOf(they).toString();
        msg = "Coordinate: " + xs + " E   " + ys + " N";
        showStatus(msg); // function to display where you want.
}



Stefan Schwarzer wrote:

> Hi,
>
> I would like to display the coordinates in a corner of the map, when a
> user moves the mouse over it. Is there any Javascript (or Java) code
> out there that would do this?
>
> Thanks for any suggestions.
>
> Stef
>
>
>
>         _______________________________________
>
>         Stefan Schwarzer
>         GIS & Data Management
>
>         UNEP/DEWA/GRID-Geneva
>         Chemin des Anemones 11
>         CH - 1219 Chatelaine
>         Switzerland
>
>         Tel: (+41) 22.917.83.49
>         Fax: (+41) 22.917.80.29
>
>         Internet: http://geodata.grid.unep.ch/
>         _______________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050310/f2616626/attachment.htm>
-------------- next part --------------
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.1 - Release Date: 09/03/2005


More information about the MapServer-users mailing list