ALKMaps.Control.ALK.DragFeature

The DragFeature control modifies a route with a drag of the mouse.  Create a new control with the ALKMaps.Control.ALK.DragFeature constructor.

Inherits From

Summary
ALKMaps.Control.ALK.DragFeatureThe 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}
pointHandleALKMaps.Feature.Vector of point.
dragStartIndicating dragging a route has been started or not.
dragEnterIndicating mouse is over drag handle or not.
Constructor
ALKMaps.Control.ALK.DragFeatureCreate a new control to drag routes.
Functions
clickFeatureCalled when the feature handler detects a click-in on a feature.
clickoutFeatureCalled when the feature handler detects a click-out on a feature.
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.
dragCompleteAfter dragging is completed, update the route.
getStopsGet stops for a drag handle.
onRouteModifiedCallback method.
onMousemoveHandles mouse move envnt.

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

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

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

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

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

onLeave

{Function} Define this function if you want to know when the mouse goes out of the feature that was dragged.

Parameters

feature{ALKMaps.Feature.Vector} The feature that was dragged.

documentDrag

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

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

pointHandle

ALKMaps.Feature.Vector of point.  A visual indicator that indicating that a route can be altered at this point.

dragStart

Indicating dragging a route has been started or not.

dragEnter

Indicating mouse is over drag handle or not.

Constructor

ALKMaps.Control.ALK.DragFeature

Create a new control to drag routes.

Parameters

layer{ALKMaps.Layer.BaseMap} The layer containing routes to be dragged.

Functions

clickFeature

clickFeature: function (feature)

Called when the feature handler detects a click-in on a feature.

Parameters

feature{ALKMaps.Feature.Vector}

clickoutFeature

clickoutFeature: function (feature)

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

Parameters

feature{ALKMaps.Feature.Vector}

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.

dragComplete

dragComplete: function (handle)

After dragging is completed, update the route.

getStops

getStops: function (handle,
transform)

Get stops for a drag handle.

onRouteModified

onRouteModified: function (obj)

Callback method.  Called when results are retured after a route dragging is completed.  Returns report and updated stop lists.

onMousemove

onMousemove: function (evt)

Handles mouse move envnt.  Mainly used to add drag handle to a route.  *

Instances of ALKMaps.Layer.BaseMap are used to display data from ALK Web Service Create a new ALK Map layer with the ALKMaps.Layer.BaseMap constructor.
Vector features use the ALKMaps.Geometry classes as geometry description.
This class represents a screen coordinate, in x and y coordinates
clickFeature: function (feature)
Called when the feature handler detects a click-in on a feature.
clickoutFeature: function (feature)
Called when the feature handler detects a click-out on a feature.
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.
dragComplete: function (handle)
After dragging is completed, update the route.
getStops: function (handle,
transform)
Get stops for a drag handle.
onRouteModified: function (obj)
Callback method.
onMousemove: function (evt)
Handles mouse move envnt.
Create a new control to drag routes.
Controls affect the display or behavior of the map.
Instances of ALKMaps.Map are interactive maps embedded in a web page.
Close