b = map_name.setMarkerOnDrag(markerId, callbackFunction);
The
Map.setMarkerOnDrag function sets the function that is called when the user drags the marker on the map marker identified by
markerId. Markers may be dragged by first long pressing on them and then sliding them to a new position. The
callbackFunction is called at the end of the drag when the user lifts up their finger to release the marker.
The
callbackFunction is the name of a user function defined in the global procedure. The function name may optionally be followed by function arguments which will be passed to the function when it is run. These arguments are evaluated at the time that
Map.setMarkerOnDrag is called rather than at the time the callback is run. This allows you to reuse the same callback function for multiple markers and to customize the behavior of the callback by passing different arguments to the callback function for each marker.
The function returns a logical value of 1 (true) if the marker was found and the callback function was set successfully and 0 (false) if there is an error.