The DragFeature control moves a feature with a drag of the mouse. Create a new control with the ALKMaps.Control.DragFeature constructor.
ALKMaps. | The DragFeature control moves a feature 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.Vector} |
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} |
Constructor | |
ALKMaps. | Create a new control to drag features. |
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. |
{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 features.
layer | {ALKMaps.Layer.Vector} The layer containing features to be dragged. |
options | {Object} Optional object whose properties will be set on the control. |
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 )