[mapserver-users] Intercepting Map Click Coordinates with JavaScript ? Zooming with scale values.

Doyon, Jean-Francois Jean-Francois.Doyon at ccrs.nrcan.gc.ca
Mon Jan 21 11:38:36 EST 2002


Hello,

This is not necessarily a mpaserver specific question but ...

Is there anyway/does anybody know how to intercept the x/y pixel coordinates
that the user generated by clicking on the map when using the map as an
<input type=image> ?

I'm trying to create an interface that uses scale values to determine the
next up/down zoom levels, and apparently in order to do this I have to use
the CGI variable MAPXY, which unfortunately has to be inn the map's
projection coordinates.

So, I need to intercept the pixel coordinates (img.x and img.y) in order to
do the necessary calculations and set MAPXY, all this triggered by the
form's onSubmit ...

Anybody have any idea on how to do this? I haven't had any luck so far using
things like document.form.img.x ...

If worse comes to worse I guess I could use client-side maps, but I'd rather
not unless I absolutely have to!

Thanks in advance for the help!

Jean-François Doyon
Internet Service Development and Systems Support
GeoAccess Division
Canadian Center for Remote Sensing
Natural Resources Canada
http://atlas.gc.ca
Phone: (613) 992-4902
Fax: (613) 947-2410




More information about the mapserver-users mailing list