Search code examples
javascriptgoogle-mapsevent-handlinggoogle-maps-markers

Event when marker location changes in Google Maps JavaScript API


I can't figure out how can I handle Google Maps marker changes.

Ideally, I want to get marker location changes in real-time.

Finally, I've checked the docs and I didn't find an specific event to cover this case.


Solution

  • This was an easy one:

    marker.addListener("dragend", e => {
       // Do stuff here
    });