I set the marker when I click on the map. I am using MarkerWithLabel.
I use a draggable marker.
If I drag the marker, it works fine. But if I drag the shortcut, it works with the click event on the map.
How can I use labels and drag a shortcut without a click event?
In my example, when I drag a marker, JS creates a new marker.
google.maps.event.addListener(map, 'click', function(event) { addMarker(event.latLng) }); function addMarker(latLng) { var marker = new MarkerWithLabel({ position: latLng, map: map, draggable: true, labelContent: "example", labelAnchor: new google.maps.Point(30, 0), labelClass: "labels",
JSFIDDLE
javascript google-maps google-maps-markers
user3579209
source share