Whenever I am dragging my marker, the getPosition is being console logged every 0.1s while the element is being dragged. How can I make it only console log when it's being stopped dragged? I want the same effect as .getRadius() works, it only console logs it when the radius is being changed once.
marker.Circle.addListener('center_changed', function() {
console.log(marker.getPosition())
})
Instead of using the center_changed
event, use the dragend
one.
marker.Circle.addListener('dragend', function() {
console.log(marker.getPosition())
});
https://developers.google.com/maps/documentation/javascript/reference/polygon#Circle.dragend
Also it's actually a Circle, not a Marker, that's being dragged. Only Circle and Map objects have the center_changed
event. So it looks like it's a circle attached to your marker.