I originally asked this question over at stackoverflow<http://stackoverflow.com/questions/5560347/how-to-force-a-marker-drag-in-google-maps-javascript-api-v3>, but no one could seem to answer it.
What I am trying to do is mimic the behavior for a google "My Places" feature. When editing a map, there are 3 icons at the top: a hand, a placemarker, and a lines/shapes menu. When I click the placemarker icon, 2 things happen simultaneously: 1.) A marker is added to the map, and 2.) The marker immediately becomes draggable (moving my cursor moves the placemarker). A second click drops the marker onto the page. What I cannot seem to do is combine the marker add & begin drag into a single mouse click. In my code, there are 3 clicks needed to add & place a marker: 1.) Click #1 adds the marker to the map 2.) Click #2 (mouse down) begins drag, and 3.) Click #3 (mouse up) stops the drag, dropping the marker in the cursor location. How would one go about combining the marker add & begin drag into a single click? I could probably write custom javascript to make the marker follow the mouse cursor immediately after it is added, and stopping after the second click (to drop). I thought I would ask here first though, in case there is an easier way I am missing. Thanks, Dan -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/07POLh5zNRgJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
