[Tutor] Python and a web image map

Ertl, John john.ertl at fnmoc.navy.mil
Mon Feb 28 22:43:14 CET 2005


Liam,

Thanks for the code chunk and the advice.  Java script here I come.

John Ertl 

-----Original Message-----
From: Liam Clarke [mailto:cyresse at gmail.com]
Sent: Monday, February 28, 2005 13:27
To: Tutor Tutor
Subject: Re: [Tutor] Python and a web image map

I would say it's best done as a Javascript thing.

<html>
<head>
<script type = "text/javascript">
function goFunc(e){
x = e.clientX
y = e.clientY
alert("X=" + x + " Y=" + y)
}
</script>
</head>
<body>
<script type = "text/javascript">
window.onload = function(e){document.onclick = goFunc;};
</script>
Javascript or Python?
</body>
</html>


Save the above as an HTM and click, it should give you the x,y co-ords
for the browser window excluding scrolbars etc.

Shouldn't be too hard to create a window that matches the size of your
map, and convert window co-ords into image co-ords.

Good luck with that, though, Javascript is a funny beast, but there's
some good tutorials out there.

Regards,

Liam Clarke

On Mon, 28 Feb 2005 12:00:09 -0800, Ertl, John <john.ertl at fnmoc.navy.mil>
wrote:
>
>
> All,
>
> I have been doing Python for a bit now but I am trying to make a clickable
> map of the world on a web page that gives me the latitude and longitude of
a
> location selected.  I have done little with HTML beyond forms and have
done
> no Java script.  Is this a problem Python can solve or is this a HTML /
Java
> script issue.
>
> Thanks,
>
> John Ertl
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>


--
'There is only one basic human right, and that is to do as you damn well
please.
And with it comes the only basic human duty, to take the consequences.
_______________________________________________
Tutor maillist  -  Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list