The DragFeature control modifies a route with a drag of the mouse. Create a new control with the ALKMaps.Control.ALK.DragFeature constructor.
ALKMaps. | The DragFeature control modifies a route with a drag of the mouse. |
Properties | |
geometryTypes | {Array(String)} To restrict dragging to a limited set of geometry types, send a list of strings corresponding to the geometry class names. |
onStart | {Function} Define this function if you want to know when a drag starts. |
onDrag | {Function} Define this function if you want to know about each move of a feature. |
onComplete | {Function} Define this function if you want to know when a feature is done dragging. |
onEnter | {Function} Define this function if you want to know when the mouse goes over a feature and thereby makes this feature a candidate for dragging. |
onLeave | {Function} Define this function if you want to know when the mouse goes out of the feature that was dragged. |
documentDrag | {Boolean} If set to true, mouse dragging will continue even if the mouse cursor leaves the map viewport. |
layer | {ALKMaps.Layer.BaseMap} |
feature | {ALKMaps.Feature.Vector} |
dragCallbacks | {Object} The functions that are sent to the drag handler for callback. |
featureCallbacks | {Object} The functions that are sent to the feature handler for callback. |
lastPixel | {ALKMaps.Pixel} |
pointHandle | ALKMaps.Feature.Vector of point. |
dragStart | Indicating dragging a route has been started or not. |
dragEnter | Indicating mouse is over drag handle or not. |
Constructor | |
ALKMaps. | Create a new control to drag routes. |
Functions | |
clickFeature | Called when the feature handler detects a click-in on a feature. |
clickoutFeature | Called when the feature handler detects a click-out on a feature. |
destroy | Take care of things that are not handled in superclass |
activate | Activate the control and the feature handler. |
deactivate | Deactivate the control and all handlers. |
overFeature | Called when the feature handler detects a mouse-over on a feature. |
downFeature | Called when the drag handler detects a mouse-down. |
moveFeature | Called when the drag handler detects a mouse-move. |
upFeature | Called when the drag handler detects a mouse-up. |
doneDragging | Called when the drag handler is done dragging. |
outFeature | Called when the feature handler detects a mouse-out on a feature. |
cancel | Called when the drag handler detects a mouse-out (from the map viewport). |
setMap | Set the map property for the control and all handlers. |
dragComplete | After dragging is completed, update the route. |
getStops | Get stops for a drag handle. |
onRouteModified | Callback method. |
onMousemove | Handles mouse move envnt. |
{Function} Define this function if you want to know when a drag starts. The function should expect to receive two arguments: the feature that is about to be dragged and the pixel location of the mouse.
feature | {ALKMaps.Feature.Vector} The feature that is about to be dragged. |
pixel | {ALKMaps.Pixel} The pixel location of the mouse. |
{Function} Define this function if you want to know about each move of a feature. The function should expect to receive two arguments: the feature that is being dragged and the pixel location of the mouse.
feature | {ALKMaps.Feature.Vector} The feature that was dragged. |
pixel | {ALKMaps.Pixel} The pixel location of the mouse. |
{Function} Define this function if you want to know when a feature is done dragging. The function should expect to receive two arguments: the feature that is being dragged and the pixel location of the mouse.
feature | {ALKMaps.Feature.Vector} The feature that was dragged. |
pixel | {ALKMaps.Pixel} The pixel location of the mouse. |
{Function} Define this function if you want to know when the mouse goes over a feature and thereby makes this feature a candidate for dragging.
feature | {ALKMaps.Feature.Vector} The feature that is ready to be dragged. |
{Function} Define this function if you want to know when the mouse goes out of the feature that was dragged.
feature | {ALKMaps.Feature.Vector} The feature that was dragged. |
Create a new control to drag routes.
layer | {ALKMaps.Layer.BaseMap} The layer containing routes to be dragged. |
clickFeature: function ( feature )
Called when the feature handler detects a click-in on a feature.
feature | {ALKMaps.Feature.Vector} |
clickoutFeature: function ( feature )
Called when the feature handler detects a click-out on a feature.
feature | {ALKMaps.Feature.Vector} |
overFeature: function ( feature )
Called when the feature handler detects a mouse-over on a feature. This activates the drag handler.
feature | {ALKMaps.Feature.Vector} The selected feature. |
{Boolean} Successfully activated the drag handler.
downFeature: function ( pixel )
Called when the drag handler detects a mouse-down.
pixel | {ALKMaps.Pixel} Location of the mouse event. |
moveFeature: function ( pixel )
Called when the drag handler detects a mouse-move. Also calls the optional onDrag method.
pixel | {ALKMaps.Pixel} Location of the mouse event. |
upFeature: function ( pixel )
Called when the drag handler detects a mouse-up.
pixel | {ALKMaps.Pixel} Location of the mouse event. |
doneDragging: function ( pixel )
Called when the drag handler is done dragging.
pixel | {ALKMaps.Pixel} The last event pixel location. If this event came from a mouseout, this may not be in the map viewport. |
outFeature: function ( feature )
Called when the feature handler detects a mouse-out on a feature.
feature | {ALKMaps.Feature.Vector} The feature that the mouse left. |
setMap: function ( map )
Set the map property for the control and all handlers.
map | {ALKMaps.Map} The control’s map. |
Called when the feature handler detects a click-in on a feature.
clickFeature: function ( feature )
Called when the feature handler detects a click-out on a feature.
clickoutFeature: function ( feature )
Take care of things that are not handled in superclass
destroy: function ()
Activate the control and the feature handler.
activate: function ()
Deactivate the control and all handlers.
deactivate: function ()
Called when the feature handler detects a mouse-over on a feature.
overFeature: function ( feature )
Called when the drag handler detects a mouse-down.
downFeature: function ( pixel )
Called when the drag handler detects a mouse-move.
moveFeature: function ( pixel )
Called when the drag handler detects a mouse-up.
upFeature: function ( pixel )
Called when the drag handler is done dragging.
doneDragging: function ( pixel )
Called when the feature handler detects a mouse-out on a feature.
outFeature: function ( feature )
Called when the drag handler detects a mouse-out (from the map viewport).
cancel: function ()
Set the map property for the control and all handlers.
setMap: function ( map )
After dragging is completed, update the route.
dragComplete: function ( handle )
Get stops for a drag handle.
getStops: function ( handle, transform )
Callback method.
onRouteModified: function ( obj )
Handles mouse move envnt.
onMousemove: function ( evt )