I have 2 text boxes for lat and lon for when a user is entering a new record to the db.
I have a live preview of Google Maps that works great, now what I want to do is add a right-click event on the map that populates the lat/lon text boxes with the coord clicked.
Is this even possible?
I know how to add the event listener, and looked through the API docs, but didn't see anything that does this. I know you can do it on google's map on their website.
google.maps.event.addListener(map, "rightclick", function(event) { var lat = event.latLng.lat(); var lng = event.latLng.lng(); // populate yor box/field with lat, lng alert("Lat=" + lat + "; Lng=" + lng); });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With