Move a feature with a drag. Create a new control with the OpenLayers.Control.DragFeature constructor.
| OpenLayers. Control. DragFeature | Move a feature with a drag. |
| 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. |
| layer | {OpenLayers.Layer.Vector} |
| feature | {OpenLayers.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 | {OpenLayers.Pixel} |
| Constructor | |
| OpenLayers. Control. DragFeature | Create a new control to drag features. |
| Functions | |
| 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 | {OpenLayers.Feature.Vector} The feature that is about to be dragged. |
| pixel | {OpenLayers.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 | {OpenLayers.Feature.Vector} The feature that was dragged. |
| pixel | {OpenLayers.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 | {OpenLayers.Feature.Vector} The feature that was dragged. |
| pixel | {OpenLayers.Pixel} The pixel location of the mouse. |
Create a new control to drag features.
| layer | {OpenLayers.Layer.Vector} The layer containing features to be dragged. |
| options | {Object} Optional object whose properties will be set on the control. |
overFeature: function( feature )
Called when the feature handler detects a mouse-over on a feature. This activates the drag handler.
| feature | {OpenLayers.Feature.Vector} The selected feature. |
downFeature: function( pixel )
Called when the drag handler detects a mouse-down.
| pixel | {OpenLayers.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 | {OpenLayers.Pixel} Location of the mouse event. |
upFeature: function( pixel )
Called when the drag handler detects a mouse-up. Also calls the optional onComplete method.
| pixel | {OpenLayers.Pixel} Location of the mouse event. |
doneDragging: function( pixel )
Called when the drag handler is done dragging.
| pixel | {OpenLayers.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 | {OpenLayers.Feature.Vector} The feature that the mouse left. |
setMap: function( map )
Set the map property for the control and all handlers.
| map | {OpenLayers.Map} The control’s map. |
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 )