Cursor coordinates

Ed McNierney ed at TOPOZONE.COM
Fri Feb 4 15:15:37 EST 2005


Abe -

Firefox prohibits (by default) changing the status bar text.  I have no
idea why.

Use the Tools/Options/Web Features dialog to make sure "Enable
JavaScript" is checked.  Then hit the Advanced button, and check "Change
status bar text".

        - Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242  

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Abe Gillespie
Sent: Friday, February 04, 2005 2:45 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Cursor coordinates

In Javascript you need to use: window.status = "your coordinate text".
Firefox seems to have issues with this ... anyone know why the text
often doesn't show up?

To do the actual calculation you need to take your current extents and
find how many map units per pixel there is.  Something like:

mapWidth / imageWidth = map_units_per_pixel_in_x

Then you just need to multiply the above result by the current X
position:

mapX = map_units_per_pixel_in_x * imageX

It should be simple to figure out the Y.

There should be examples how to capture the current mouse X & Y either
in the dbox code or elsewhere on the internet (read: Google).

-Abe

On Feb 4, 2005, at 2:16 PM, Kevin Grootendorst wrote:

> Just wondering if anyone has a clue how to display the geographic 
> coordinates of the cursor as it moves across the map frame?
> I'd like to display these coordinates on the webpage. I envision the 
> coordinates changing on the fly, as the user moves the mouse around.
> Any ideas????
>
> Using MS 4.2, PHP 4.3.4, Win2000
>



More information about the mapserver-users mailing list