OpenLayers.Control.ModifyFeature - OpenLayers

# OpenLayers. Control. ModifyFeature

Control 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 From

- OpenLayers.Control

Summary

OpenLayers. Control. ModifyFeature | Control to modify features.
Properties |
geometryTypes | {Array(String)} To restrict modification to a limited set of geometry types, send a list of strings corresponding to the geometry class names.
clickout | {Boolean} Unselect features when clicking outside any feature.
toggle | {Boolean} Unselect a selected feature on click.
deleteCodes | {Array(Integer)} Keycodes for deleting verticies.
virtualStyle | {Object} A symbolizer to be used for virtual vertices.
mode | {Integer} Bitfields specifying the modification mode.
onModificationStart | {Function} Deprecated.
onModification | {Function} Deprecated.
onModificationEnd | {Function} Deprecated.
Constructor |
OpenLayers. Control. ModifyFeature | Create a new modify feature control.
Functions |
destroy | Take care of things that are not handled in superclass.
activate | Activate the control.
deactivate | Deactivate the control.
Constants |
RESHAPE | {Integer} Constant used to make the control work in reshape mode
RESIZE | {Integer} Constant used to make the control work in resize mode
ROTATE | {Integer} Constant used to make the control work in rotate mode
DRAG | {Integer} Constant used to make the control work in drag mode

### Properties

### geometryTypes

{Array(String)} To restrict modification to a limited set of geometry types, send a list of strings corresponding to the geometry class names.

### clickout

{Boolean} Unselect features when clicking outside any feature. Default is true.

### toggle

{Boolean} Unselect a selected feature on click. Default is true.

### deleteCodes

{Array(Integer)} Keycodes for deleting verticies. Set to null to disable vertex deltion by keypress. If non-null, keypresses with codes in this array will delete vertices under the mouse. Default is 46 and 68, the ‘delete’ and lowercase ‘d’ keys.

### virtualStyle

{Object} A symbolizer to be used for virtual vertices.

### mode

{Integer} Bitfields specifying the modification mode. Defaults to OpenLayers.Control.ModifyFeature.RESHAPE. To set the mode to a combination of options, use the | operator. or example, to allow the control to both resize and rotate features, use the following syntax

>     control.mode = OpenLayers.Control.ModifyFeature.RESIZE |
>                    OpenLayers.Control.ModifyFeature.ROTATE;

### onModificationStart

{Function} Deprecated. Register for “beforefeaturemodified” instead. The “beforefeaturemodified” event is triggered on the layer before any modification begins.

Optional function to be called when a feature is selected to be modified. The function should expect to be called with a feature. This could be used for example to allow to lock the feature on server-side.

### onModification

{Function} Deprecated. Register for “featuremodified” instead. The “featuremodified” event is triggered on the layer with each feature modification.

Optional function to be called when a feature has been modified. The function should expect to be called with a feature.

### onModificationEnd

{Function} Deprecated. Register for “afterfeaturemodified” instead. The “afterfeaturemodified” event is triggered on the layer after a feature has been modified.

Optional function to be called when a feature is finished being modified. The function should expect to be called with a feature.

### Constructor

### OpenLayers. Control. ModifyFeature

Create a new modify feature control.

#### Parameters

layer | {OpenLayers.Layer.Vector} Layer that contains features that will be modified.
options | {Object} Optional object whose properties will be set on the control.

### Functions

### destroy

> destroy: function()

Take care of things that are not handled in superclass.

### activate

> activate: function()

Activate the control.

#### Returns

{Boolean} Successfully activated the control.

### deactivate

> deactivate: function()

Deactivate the control.

#### Returns

{Boolean} Successfully deactivated the control.

### Constants

### RESHAPE

{Integer} Constant used to make the control work in reshape mode

### RESIZE

{Integer} Constant used to make the control work in resize mode

### ROTATE

{Integer} Constant used to make the control work in rotate mode

### DRAG

{Integer} Constant used to make the control work in drag mode

> destroy: function()

Take care of things that are not handled in superclass.

> activate: function()

Activate the control.

> deactivate: function()

Deactivate the control.
Create a new modify feature control.
Controls affect the display or behavior of the map.
Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.
Close