OpenLayers.Control.EditFeature

N.B.  Supports only ONE vector layer

Inherits From

  • <OpenLayers.Control>
Summary
OpenLayers.Control.EditFeatureN.B.
Properties
VECTOR_LAYER_TYPES{Array(String)} Supported Vector layer types for the edition control.
WMS_LAYER_TYPES{Array(String)} Supported WMS layer types.
layer{OpenLayers.Layer.Vector} Vector layer that has this.resource
handlers{Array(<OpenLayers.Handler>)}
wmslayer{OpenLayers.Layer.WMS} WMS layer that has this.resource
Functions
OpenLayers.Control.EditFeature.UpdateCreate a new EditFeature.Update control.
setFeatureControlCalled as soon as the vector layer related to the resources of this control is found.
setSnappingControlCalled as soon as the vector layer related to the resources of this control is found.
getSelectControlReturns the SelectFeature control used by this control depending on this.snappingcontrol.
getSelectedFeaturesReturns current selected features.
commitCommit created/updated/deleted features using the layer’s protocol.
onCommitCalled after protocol commit.
onModificationStartCalled before feature modification.
onModificationCalled on feature modification.
onModificationEndCalled after feature modification.
cancelCancel modification on a feature (if it has any).
toggleExtComponentCalled on map “moveend” events.
handleKeypressCalled by the keyboard handler when a key is pressed.
setMapSet the map property for the control and all handlers.

Properties

VECTOR_LAYER_TYPES

{Array(String)} Supported Vector layer types for the edition control.

WMS_LAYER_TYPES

{Array(String)} Supported WMS layer types.  Only used to redraw on commits.

layer

{OpenLayers.Layer.Vector} Vector layer that has this.resource

handlers

{Array(<OpenLayers.Handler>)}

wmslayer

{OpenLayers.Layer.WMS} WMS layer that has this.resource

Functions

OpenLayers.Control.EditFeature.Update

Create a new EditFeature.Update control.

Parameters

options{Object} Optional object whose properties will be set on the control.

setFeatureControl

setFeatureControl: function(layer)

Called as soon as the vector layer related to the resources of this control is found.  It creates the according OpenLayers control depending on what is the type of editfeature control currently used.  The code of this function is redefined in the child control, i.e.  : /create/Create.js /update/Update.js /delete/Delete.js

Parameters

layer{<OpenLayers.Layer.Vector>} The vector layer to assign the control to be created.
options{Object} Options for the control to be created.

setSnappingControl

setSnappingControl: function(layer)

Called as soon as the vector layer related to the resources of this control is found.  The code of this function is redefined in the child control, i.e.  : /create/Create.js /update/Update.js /delete/Delete.js

Parameters

layer{<OpenLayers.Layer.Vector>} The vector layer to assign the control to be created.
options{Object} Options for the control to be created.

getSelectControl

getSelectControl: function()

Returns the SelectFeature control used by this control depending on this.snappingcontrol.

options{Object} Options for the control to be created.  Returns: {<OpenLayers.Control.SelectFeature>}

getSelectedFeatures

getSelectedFeatures: function()

Returns current selected features.

Returns

{Array of(<OpenLayers.Feature.Vector>)}

commit

commit: function (features)

Commit created/updated/deleted features using the layer’s protocol.  Currently supports the MapFish and HTTP protocols.

Calls this.onCommit function when a response is received.

Parameters

features {Array of(<OpenLayers.Feature.Vector>)}

onCommit

onCommit: function(response)

Called after protocol commit.

Currently supports GeoJSON format only.

Parameters

response{<OpenLayers.Protocol.Response>} A response object.

onModificationStart

onModificationStart: function(object)

Called before feature modification.  Show the FeaturePanel if it’s set.  If the feature is about to be modified (not a new feature), clone it to keep an original copy if modification are canceled.

Parameters

object{<OpenLayers.Event>} Used to get the feature about to be modified

onModification

onModification: function(object)

Called on feature modification.

Parameters

object{<OpenLayers.Event>} Used to get the modified feature

onModificationEnd

onModificationEnd: function(object)

Called after feature modification.  If using a FeaturePanel : Validate that it’s currently commiting.  If not, depending of the feature state, reset or destroy the feature.  If not using a FeaturePanel : Simply commit the modifications made to the feature.

Parameters

object{<OpenLayers.Event>} Used to get the modified feature

cancel

cancel: function(feature)

Cancel modification on a feature (if it has any).

Parameters

feature{<OpenLayers.Feature.Vector>}

toggleExtComponent

toggleExtComponent: function()

Called on map “moveend” events.  If the layer becomes out of range, disable the according Ext.Component (button/checkItem).

handleKeypress

handleKeypress: function(evt)

Called by the keyboard handler when a key is pressed.  This is used to for the following key+events :

  • ’esc’ : cancel the current edition.

Parameters

{Integer} Key code corresponding to the keypress event.

setMap

setMap: function(map)

Set the map property for the control and all handlers.

Parameters

map{<OpenLayers.Map>} The control’s map.
setFeatureControl: function(layer)
Called as soon as the vector layer related to the resources of this control is found.
setSnappingControl: function(layer)
Called as soon as the vector layer related to the resources of this control is found.
getSelectControl: function()
Returns the SelectFeature control used by this control depending on this.snappingcontrol.
getSelectedFeatures: function()
Returns current selected features.
commit: function (features)
Commit created/updated/deleted features using the layer’s protocol.
onCommit: function(response)
Called after protocol commit.
onModificationStart: function(object)
Called before feature modification.
onModification: function(object)
Called on feature modification.
onModificationEnd: function(object)
Called after feature modification.
cancel: function(feature)
Cancel modification on a feature (if it has any).
toggleExtComponent: function()
Called on map “moveend” events.
handleKeypress: function(evt)
Called by the keyboard handler when a key is pressed.
setMap: function(map)
Set the map property for the control and all handlers.
Close