The DragFeatureData control simulates moving a feature with a drag of the mouse. Create a new control with the ALKMaps.Control.DragFeatureData constructor.
ALKMaps. | The DragFeatureData control simulates moving 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. |
overTarget | {Function} Define this function if you want to know when the source goes over a target. |
outTarget | {Function} Define this function if you want to know when the source goes out a target. |
onDrop | {Function} Define this function if you want to know when the source has been dropped on target. |
documentDrag | {Boolean} If set to true, mouse dragging will continue even if the mouse cursor leaves the map viewport. |
layer | {ALKMaps.Layer.Vector} |
layers | {Array(ALKMaps.Layer.Vector)} The layers this control will work on, or null if the control was configured with a single layer |
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. |
Constructor | |
ALKMaps. | Create a new control to drag features. |
Functions | |
initLayer | Assign the layer property. |
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. |
setLayer | Attach a new layer to the control, overriding any existing layers. |
{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.
source | {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.
source | {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.
source | {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.
source | {ALKMaps.Feature.Vector} The feature that is ready to be dragged. |
{Boolean} Whether or not this feature is draggable.
{Function} Define this function if you want to know when the source goes over a target.
source | {ALKMaps.Feature.Vector} |
target | {ALKMaps.Feature.Vector} |
pixel | {ALKMaps.Pixel} The pixel location of the mouse. |
{Function} Define this function if you want to know when the source goes out a target.
source | {ALKMaps.Feature.Vector} |
target | {ALKMaps.Feature.Vector} |
pixel | {ALKMaps.Pixel} The pixel location of the mouse. |
{Function} Define this function if you want to know when the source has been dropped on target. If target is null, the source has been dropped but not on a vector feature.
source | {ALKMaps.Feature.Vector} |
target | {ALKMaps.Feature.Vector} |
pixel | {ALKMaps.Pixel} The pixel location of the mouse. |
{Array(ALKMaps.Layer.Vector)} The layers this control will work on, or null if the control was configured with a single layer
Create a new control to drag features.
layers | {ALKMaps.Layer.Vector} The layer containing features to be dragged. Or an array of vector layers. |
options | {Object} Optional object whose properties will be set on the control. |
initLayer: function( layers )
Assign the layer property. If layers is an array, we need to use a RootContainer.
layers | {ALKMaps.Layer.Vector}, or an array of vector layers. |
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. |
setLayer: function( layers )
Attach a new layer to the control, overriding any existing layers.
layers | Array of {ALKMaps.Layer.Vector} or a single {ALKMaps.Layer.Vector} |
Assign the layer property.
initLayer: function( layers )
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 )
Attach a new layer to the control, overriding any existing layers.
setLayer: function( layers )