Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Marker drop event in google maps?

I need to trigger an event when the user drops a marker on the map. I have the code working for them to drop the marker, but I can't figure out how to trigger the event.

Any tips?

like image 651
temporary_user_name Avatar asked Mar 26 '12 04:03

temporary_user_name


People also ask

Can you drop markers on Google Maps?

You can drop a pin in Google Maps and then save that location or navigate to it. Dropping a pin is convenient if you don't know the address you're at, don't want to look up the exact address, or if a specific location has no address.

How do I add an event to Google Maps?

To add an event, head to Google Maps on Android, tap on Contribute >Events > Add a public event. You can add an event name, tag the location, and add the time and date of the event as well. There's an option to add an image, write more event details, and add description as well.


1 Answers

With Marker event dragend you have the latlng where the Marker is drop. This is that you need?

   google.maps.event.addListener(Marker, "dragend", function(event) { 
          var lat = event.latLng.lat(); 
          var lng = event.latLng.lng(); 
        }); 
like image 196
cadetill Avatar answered Dec 30 '22 19:12

cadetill