How can I get the location that the user has clicked on the map via js?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is a callback function I used for a drop event on the map canvas once:
You have to set an event listener (in your map init function) like this to get mouseLat and mouseLng:
Where map is your google map.
The full working example is at:
http://www.ourride.org/?page_id=238