Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/workers
Class: Add

require(["esri/dijit/editing/Add"], function(Add) { /* code goes here */ });

Description

(Added at v2.2)
This class is used with the UndoManager to provide undo/redo functionality of Add operations when editing.

Samples

Search for samples that use this class.

Class hierarchy

esri/dijit/editing/OperationBase
|_esri/dijit/editing/Add

Constructors

NameSummary
new Add(params)Create a new Add operation.

Properties

NameTypeSummary
labelStringDetails about the operation, for example: "Update" may be the label for an edit operation that updates features.
typeStringThe type of operation, for example: "edit" or "navigation".

Methods

NameReturn typeSummary
performRedo()NoneRedo the current operation.
performUndo()NoneUndo the current operation.
Constructor Details

new Add(params)

Create a new Add operation.
Parameters:
<Object> params Required See options list for parameters.
params properties:
<Graphic[]> addedGraphics Optional The features that were added to the feature layer.
<FeatureLayer> featureLayer Optional The feature layer where the new feature(s) are added.
Sample:
require([
  "esri/dijit/TemplatePicker", "esri/graphic", "esri/dijit/editing/Add", ... 
], function(TemplatePicker, Graphic, Add, ... ) {
  var templatePicker = new TemplatePicker( ... );
  var newGraphic = new Graphic( ... );
  var selectedTemplate = templatePicker.getSelected();
  var operation = new Add({
    featureLayer: selectedTemplate.featureLayer,
    addedGraphics: [newGraphic]
  });
  ...
});
Property Details

<String> label

Details about the operation, for example: "Update" may be the label for an edit operation that updates features.

<String> type

The type of operation, for example: "edit" or "navigation".
Method Details

performRedo()

Redo the current operation.

performUndo()

Undo the current operation.