new on mapserver. basic Help please

Mike Davis mike.and.kerry at GMAIL.COM
Fri Dec 2 20:55:22 EST 2005


On 12/2/05, Luis Treviño <ltrevino at gpobsi.com.mx> wrote:
>
> Hi!
>
> I want to display the position of the mouse (lat/long) while it is over my
> map and the exact position of the mouse when the map is clicked. Could
> anybody help me with this?
>
> Thanks in advance.
>
> Luis
>

I am pretty sure the standard mouse coordinate display function is something
like this:


function mapplet_mouse_moved(name,x,y)

{

with (Math)

{

tempstring = document.mapserv.mapsize.value;

mapsizeArray = tempstring.split(" ");

if (document.mapserv.imgext.value != '')

{

tempstring = document.mapserv.imgext.value;

imgextArray = tempstring.split(" ");

}

if (imgextArray)

{

coordx =
imgextArray[0]*1+(x*(imgextArray[2]-imgextArray[0])/mapsizeArray[0]);

coordy =
imgextArray[3]*1-(y*(imgextArray[3]-imgextArray[1])/mapsizeArray[1]);

}

else

{

coordx = '';

coordy = '';

}

window.status = "WGS-84 UTM X: " + round(coordx) + " Y: " + round(coordy);

}

}

function mapplet_mouse_exited(name)

{

window.status="";

}



We use this in our mapplet (java) based mapserver sites.

As far as displaying the coodinate when clicked, you just need to add a tool
that passes the coordx and coordy values to a new window or something like
that.

Good Luck

-Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20051202/a38f4674/attachment.html


More information about the mapserver-users mailing list