Reputation: 47375
When adding a marker to a google v3 map, I want to automatically begin dragging it. The click event that adds the marker is already on the canvas, and so I want the same click event that adds the marker to also act as a drag start. Very similar to how it's done when adding markers to a Google MyMaps map (though I'm pretty sure that still uses V2).
Is this possible, or do I have to add the marker, then make it follow the mouse around until the user clicks again, then drop?
Upvotes: 1
Views: 1361
Reputation: 125
Add "draggable: true," to the marker's options.
Example:
marker = new google.maps.Marker({
draggable: true,
position: somepoint,
});
marker.setMap(map);
Upvotes: 2
Reputation: 1849
Not sure if adding draggable: true to the marker is what your looking fOr or if it is beyond that? Hope this helps
Upvotes: 0