ALKMaps.Control.DragFeatureData

The DragFeatureData control simulates moving a feature with a drag of the mouse.  Create a new control with the ALKMaps.Control.DragFeatureData constructor.

Inherits From

Summary
ALKMaps.Control.DragFeatureDataThe 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.Control.DragFeatureCreate a new control to drag features.
Functions
initLayerAssign the layer property.
destroyTake care of things that are not handled in superclass
activateActivate the control and the feature handler.
deactivateDeactivate the control and all handlers.
overFeatureCalled when the feature handler detects a mouse-over on a feature.
downFeatureCalled when the drag handler detects a mouse-down.
moveFeatureCalled when the drag handler detects a mouse-move.
upFeatureCalled when the drag handler detects a mouse-up.
doneDraggingCalled when the drag handler is done dragging.
outFeatureCalled when the feature handler detects a mouse-out on a feature.
cancelCalled when the drag handler detects a mouse-out (from the map viewport).
setMapSet the map property for the control and all handlers.
setLayerAttach a new layer to the control, overriding any existing layers.

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.  The function should expect to receive two arguments: the feature that is about to be dragged and the pixel location of the mouse.

Parameters

source{ALKMaps.Feature.Vector} The feature that is about to be dragged.
pixel{ALKMaps.Pixel} The pixel location of the mouse.

onDrag

{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.

Parameters

source{ALKMaps.Feature.Vector} The feature that was dragged.
pixel{ALKMaps.Pixel} The pixel location of the mouse.

onComplete

{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.

Parameters

source{ALKMaps.Feature.Vector} The feature that was dragged.
pixel{ALKMaps.Pixel} The pixel location of the mouse.

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.

Parameters

source{ALKMaps.Feature.Vector} The feature that is ready to be dragged.

Returns

{Boolean} Whether or not this feature is draggable.

overTarget

{Function} Define this function if you want to know when the source goes over a target.

Parameters

source{ALKMaps.Feature.Vector}
target{ALKMaps.Feature.Vector}
pixel{ALKMaps.Pixel} The pixel location of the mouse.

outTarget

{Function} Define this function if you want to know when the source goes out a target.

Parameters

source{ALKMaps.Feature.Vector}
target{ALKMaps.Feature.Vector}
pixel{ALKMaps.Pixel} The pixel location of the mouse.

onDrop

{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.

Parameters

source{ALKMaps.Feature.Vector}
target{ALKMaps.Feature.Vector}
pixel{ALKMaps.Pixel} The pixel location of the mouse.

documentDrag

{Boolean} If set to true, mouse dragging will continue even if the mouse cursor leaves the map viewport.  Default is false.

layers

{Array(ALKMaps.Layer.Vector)} The layers this control will work on, or null if the control was configured with a single layer

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.Control.DragFeature

Create a new control to drag features.

Parameters

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.

Functions

initLayer

initLayer: function(layers)

Assign the layer property.  If layers is an array, we need to use a RootContainer.

Parameters

layers{ALKMaps.Layer.Vector}, or an array of vector layers.

destroy

destroy: function()

Take care of things that are not handled in superclass

activate

activate: function()

Activate the control and the feature handler.

Returns

{Boolean} Successfully activated the control and feature handler.

deactivate

deactivate: function()

Deactivate the control and all handlers.

Returns

{Boolean} Successfully deactivated the control.

overFeature

overFeature: function(feature)

Called when the feature handler detects a mouse-over on a feature.  This activates the drag handler.

Parameters

feature{ALKMaps.Feature.Vector} The selected feature.

Returns

{Boolean} Successfully activated the drag handler.

downFeature

downFeature: function(pixel)

Called when the drag handler detects a mouse-down.

Parameters

pixel{ALKMaps.Pixel} Location of the mouse event.

moveFeature

moveFeature: function(pixel)

Called when the drag handler detects a mouse-move.  Also calls the optional onDrag method.

Parameters

pixel{ALKMaps.Pixel} Location of the mouse event.

upFeature

upFeature: function(pixel)

Called when the drag handler detects a mouse-up.

Parameters

pixel{ALKMaps.Pixel} Location of the mouse event.

doneDragging

doneDragging: function(pixel)

Called when the drag handler is done dragging.

Parameters

pixel{ALKMaps.Pixel} The last event pixel location.  If this event came from a mouseout, this may not be in the map viewport.

outFeature

outFeature: function(feature)

Called when the feature handler detects a mouse-out on a feature.

Parameters

feature{ALKMaps.Feature.Vector} The feature that the mouse left.

cancel

cancel: function()

Called when the drag handler detects a mouse-out (from the map viewport).

setMap

setMap: function(map)

Set the map property for the control and all handlers.

Parameters

map{ALKMaps.Map} The control’s map.

setLayer

setLayer: function(layers)

Attach a new layer to the control, overriding any existing layers.

Parameters

layersArray of {ALKMaps.Layer.Vector} or a single {ALKMaps.Layer.Vector}
Instances of ALKMaps.Layer.Vector are used to render vector data from a variety of sources.
Vector features use the ALKMaps.Geometry classes as geometry description.
initLayer: function(layers)
Assign the layer property.
destroy: function()
Take care of things that are not handled in superclass
activate: function()
Activate the control and the feature handler.
deactivate: function()
Deactivate the control and all handlers.
overFeature: function(feature)
Called when the feature handler detects a mouse-over on a feature.
downFeature: function(pixel)
Called when the drag handler detects a mouse-down.
moveFeature: function(pixel)
Called when the drag handler detects a mouse-move.
upFeature: function(pixel)
Called when the drag handler detects a mouse-up.
doneDragging: function(pixel)
Called when the drag handler is done dragging.
outFeature: function(feature)
Called when the feature handler detects a mouse-out on a feature.
cancel: function()
Called when the drag handler detects a mouse-out (from the map viewport).
setMap: function(map)
Set the map property for the control and all handlers.
setLayer: function(layers)
Attach a new layer to the control, overriding any existing layers.
The DragFeatureData control simulates moving a feature with a drag of the mouse.
Controls affect the display or behavior of the map.
This class represents a screen coordinate, in x and y coordinates
Instances of ALKMaps.Map are interactive maps embedded in a web page.
Close