views:

774

answers:

2

I have an html image map and I want to get the coordinates when a user clicks on the map.

Is there a way to retrieve the map coordinates with a mouse click on the map?

+1  A: 

Yes there is. But using only javascript could be very complex.

If you can you need to implement jquery and then check this link.

If you are talking about a real map image (like google maps or something) once you get the mouse coordinates simply multiply by the map scale. :)

Lucas
No this is not a real map image of the world or something, it is a restaurant plan view in which users will be able to book a table by clicking on the image.
Cameron Saliba
+2  A: 

You could use the JQuery library and do the following:

$(".link").click(function(e){
     e.pageX;
              e.pageY;
}
Rigobert Song