Hierarchy (View Summary)

Constructors

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

    Parameters

    Returns ModifyFeature

Properties

active: boolean
autoActivate: boolean
deleteCodes: null | number[]

APIProperty: 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.

displayClass: string
div: HTMLElement
events: Events
feature: null | Vector<Geometry>
handler: null | Handler
handlers: { drag: Handler.Drag; keyboard: Handler.Keyboard }
layer: Layer.Vector
map: null | Map

Property: map {<OpenLayers.Map>} this gets set in the addControl() function in OpenLayers.Map

toggle: boolean

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

vertex: null | Vector<Geometry>

Property: vertex {<OpenLayers.Feature.Vector>} Vertex currently being modified.

DRAG: 8
RESHAPE: 1
RESIZE: 2
ROTATE: 4
TYPE_BUTTON: 1

Constant: OpenLayers.Control.TYPE_BUTTON

TYPE_TOGGLE: 2

Constant: OpenLayers.Control.TYPE_TOGGLE

TYPE_TOOL: 3

Constant: OpenLayers.Control.TYPE_TOOL

Methods

  • APIMethod: activate Explicitly activates a control and it's associated handler if one has been set. Controls can be deactivated by calling the deactivate() method.

    Returns: {Boolean} True if the control was successfully activated or false if the control was already active.

    Returns boolean

  • Method: collectDragHandle Collect the drag handle for the selected geometry.

    Returns void

  • APIMethod: deactivate Deactivates a control and it's associated handler if any. The exact effect of this depends on the control itself.

    Returns: {Boolean} True if the control was effectively deactivated or false if the control was already inactive.

    Returns boolean

  • Method: destroy The destroy method is used to perform any clean up before the control is dereferenced. Typically this is where event listeners are removed to prevent memory leaks.

    Returns void

  • Method: dragComplete Called by the drag handler when the feature dragging is complete.

    Parameters: vertex - {<OpenLayers.Feature.Vector>} The vertex being dragged.

    Parameters

    Returns void

  • Method: dragStart Called by the drag handler before a feature is dragged. This method is used to differentiate between points and vertices of higher order geometries.

    Parameters: feature - {<OpenLayers.Feature.Vector>} The point or vertex about to be dragged.

    Parameters

    Returns void

  • Method: draw The draw method is called when the control is ready to be displayed on the page. If a div has not been created one is created. Controls with a visual component will almost always want to override this method to customize the look of control.

    Parameters: px - {<OpenLayers.Pixel>} The top-left pixel position of the control or null.

    Returns: {DOMElement} A reference to the DIV DOMElement containing the control

    Parameters

    Returns HTMLElement

  • Method: handleKeypress Called by the feature handler on keypress. This is used to delete vertices. If the property is set, vertices will be deleted when a feature is selected for modification and the mouse is over a vertex.

    Parameters: evt - {Event} Keypress event.

    Parameters

    • evt: KeyboardEvent

    Returns void

  • APIProperty: 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.

    Returns void

  • Method: resetVertices

    Returns void

  • APIMethod: selectFeature Select a feature for modification in standalone mode. In non-standalone mode, this method is called when a feature is selected by clicking. Register a listener to the beforefeaturemodified event and return false to prevent feature modification.

    Parameters: feature - {<OpenLayers.Feature.Vector>} the selected feature.

    Parameters

    Returns void

  • Method: setFeatureState Called when the feature is modified. If the current state is not INSERT or DELETE, the state is set to UPDATE.

    Returns void

  • Method: setMap Set the map property for the control. This is done through an accessor so that subclasses can override this and take special action once they have their map variable set.

    Parameters: map - {<OpenLayers.Map>}

    Parameters

    Returns void

  • APIMethod: unselectFeature Called when the select feature control unselects a feature.

    Parameters: feature - {<OpenLayers.Feature.Vector>} The unselected feature.

    Parameters

    Returns void