Get latitude and longitude for map click

627 views Asked by At

Can anybody tell me that how can I get latitude and longitude of a location when clicking on map?

2

There are 2 answers

0
Divyesh On

Try google maps v3 api. Add an event listener to click and you can get latitide/longitude pretty easily. Ex:

google.maps.event.addListener(map, 'click', function(event) {
    YourHandler(event.latLng);
});

event.latLng automatically gets the longitude and latitude of the location you clicked on

0
Rab Ross On