OpenLayers JavaScript Mapping Library |
OpenLayers. Control. ModifyFeatureControl to modify features. When activated, a click renders the vertices of a feature - these vertices can then be dragged. By default, the delete key will delete the vertex under the mouse. New features are added by dragging “virtual vertices” between vertices. Create a new control with the OpenLayers.Control.ModifyFeature constructor. Inherits FromSummary
feature{OpenLayers.Feature.Vector} Feature currently available for modification. vertices{Array(OpenLayers.Feature.Vector)} Verticies currently available for dragging. virtualVertices{Array(OpenLayers.Feature.Vector)} Virtual vertices in the middle of each edge. OpenLayers. Control. ModifyFeatureCreate a new modify feature control. Parameters
selectFeature
Called when the select feature control selects a feature. Parameters
unselectFeature
Called when the select feature control unselects a feature. Parameters
dragStart
Called by the drag feature control with before a feature is dragged. This method is used to differentiate between points and vertices of higher order geometries. This respects the geometryTypes property and forces a select of points when the drag control is already active (and stops events from propagating to the select control). Parameters
dragVertex
Called by the drag feature control with each drag move of a vertex. Parameters
dragComplete
Called by the drag feature control when the feature dragging is complete. Parameters
handleKeypress
Called by the feature handler on keypress. This is used to delete vertices and point features. If the <deleteCode> property is set, vertices and points will be deleted when a feature is selected for modification and the mouse is over a vertex. Parameters{Integer} Key code corresponding to the keypress event. setMap
Set the map property for the control and all handlers. Parameters
|
Take care of things that are not handled in superclass.
destroy: function()
Activate the control and the feature handler.
activate: function()
Deactivate the controls.
deactivate: function()
Called when the select feature control selects a feature.
selectFeature: function( feature )
Called when the select feature control unselects a feature.
unselectFeature: function( feature )
Called by the drag feature control with before a feature is dragged.
dragStart: function( feature, pixel )
Called by the drag feature control with each drag move of a vertex.
dragVertex: function( vertex )
Called by the drag feature control when the feature dragging is complete.
dragComplete: function( vertex )
resetVertices: function()
Called by the feature handler on keypress.
handleKeypress: function( code )
Collect the vertices from the modifiable feature’s geometry and push them on to the control’s vertices array.
collectVertices: function()
Set the map property for the control and all handlers.
setMap: function( map )