Retrieving Image Map Coordinates Using Mouse

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

Is there a way to get the coordinates of the map by clicking on the map?

+1


source to share


2 answers


You can use jQuery library and do the following:



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

      

+2


source


Yes there is. But using javascript alone can be very tricky.

If you need to implement jquery then this link .



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

+1


source







All Articles