ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-tutor
python-tutor
RE: [Tutor] Python and a web image map
by John Ertl other posts by this author
Feb 28 2005 1:41PM messages near this date
[Tutor] (no subject) | Re: [Tutor] sys.argv[1: ] help
Liam,

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

John Ertl 

-----Original Message-----
From: Liam Clarke [mailto:cyresse@[...].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@[...].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@[...].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@[...].org
http://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist  -  Tutor@[...].org
http://mail.python.org/mailman/listinfo/tutor

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved