getting clicked co-ordinates on an image map

P

paul

Hi all,
I'd like to ask a quick question. Its probably got a simple answer!

I'm creating a clickable image map for a website - now this doesn't
present any problems as I have created client side maps in the past.
But this time, what I would like is to get the co-ordinate of the
clicked area. Is there any way of doing this and then making those
co-ordinates available server side?

The reason for this is as follows: my map will contain many different
areas, some overlapping, or contained within other areas.

If I have just one overlapped area for two shapes, then this will lead
to three clickable areas. With many such overlaps, the amount of
calculation required to find such areas will be horrible (the areas are
obtained from a database which is going to be updated on a regular
basis).

So, what I was thinking was:
get the co-ordinates of the clicked point; do the processing server
side and then sent the client a webpage listing all the areas "found"
in the clicked region.
Is this possible?

Hope that makes sense!

Thanks

Paul
 
O

oeb

Hi all,
I'd like to ask a quick question. Its probably got a simple answer!

I'm creating a clickable image map for a website - now this doesn't
present any problems as I have created client side maps in the past.
But this time, what I would like is to get the co-ordinate of the
clicked area. Is there any way of doing this and then making those
co-ordinates available server side?

The reason for this is as follows: my map will contain many different
areas, some overlapping, or contained within other areas.

If I have just one overlapped area for two shapes, then this will lead
to three clickable areas. With many such overlaps, the amount of
calculation required to find such areas will be horrible (the areas are
obtained from a database which is going to be updated on a regular
basis).

So, what I was thinking was:
get the co-ordinates of the clicked point; do the processing server
side and then sent the client a webpage listing all the areas "found"
in the clicked region.
Is this possible?

Hope that makes sense!

Thanks

Paul

I don't know about xhtml, but you could always create an image map in
oldstyle html (=P) by just adding the ismap attribute to an image tag.

This will pass the coordinates along.
 
P

paul

I don't know about xhtml, but you could always create an image map in
oldstyle html (=P) by just adding the ismap attribute to an image tag.

This will pass the coordinates along.

Thanks...now I'm wondering how to retrieve them serverside...the
problem is still one
of mapping a co-ordinate to a dynamically generated series of areas,
and coping with overlaps,
whether it be done client or server side.
 
P

paul

I think I've found what I'm looking for, something like...:

<form action="getCoords.php" method="post">
<input type="image" src="getWorldMap.php" name="worldmap" />
</form>

and then in getCoords.php I can just get worldmap_x and _y

Shame I can't try it out right now though....
 
O

oeb

I think I've found what I'm looking for, something like...:

<form action="getCoords.php" method="post">
<input type="image" src="getWorldMap.php" name="worldmap" />
</form>

and then in getCoords.php I can just get worldmap_x and _y

Shame I can't try it out right now though....
They are passed as get variables. You will see them in your request string.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top