temporary_user_name
temporary_user_name

Reputation: 37068

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?

Upvotes: 19

Views: 11199

Answers (1)

cadetill
cadetill

Reputation: 1552

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(); 
        }); 

Upvotes: 48

Related Questions