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