import type { FeatureIdentifier, FeatureEditResult, AttachmentEdit, Attachment, EditOptions } from "@arcgis/core/editing/types.js";Type definitions
FeatureIdentifier
- Since
- ArcGIS Maps SDK for JavaScript 5.0
A feature identifier. Either objectId or globalId is required when this object is used as input for operations.
FeatureEditResult
- Since
- ArcGIS Maps SDK for JavaScript 5.0
FeatureEditResult represents the result of adding, updating or deleting a feature or an attachment.
- Supertypes
- FeatureIdentifier
AttachmentEdit
- Since
- ArcGIS Maps SDK for JavaScript 5.0
AttachmentEdit represents an attachment that can be added, updated or deleted via FeatureLayer.applyEdits(). This object can be either pre-uploaded data or base 64 encoded data.
feature
- Type
- Graphic | FeatureIdentifier
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The feature, objectId or globalId of feature associated
with the attachment.
attachment
- Type
- Attachment
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The attachment to be added, updated or deleted.
Attachment
- Since
- ArcGIS Maps SDK for JavaScript 5.0
globalId
- Type
- string
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The globalId of the attachment to be added or updated. These Global IDs must be from the Global ID field created by ArcGIS. For more information on ArcGIS generated Global IDs, see the Global IDs and Attachments and relationship classes sections in the Data Preparation documentation.
contentType
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The content type of the attachment. For example, 'image/jpeg'.
See the ArcGIS REST API documentation
for more information on supported attachment types.
EditOptions
- Since
- ArcGIS Maps SDK for JavaScript 5.0
gdbVersion
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The geodatabase version to apply the edits. This parameter applies only if the
capabilities.data.isVersioned property of the layer is true. If the gdbVersion parameter is not specified, edits are made to the published map's version.
rollbackOnFailureEnabled
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Indicates whether the edits should be applied only if all submitted edits succeed.
If false, the server will apply the edits that succeed even if some of the submitted edits fail. If true, the server will apply the edits
only if all edits succeed. The layer's capabilities.editing.supportsRollbackOnFailure property must be true if using this parameter.
If supportsRollbackOnFailure is false for a layer, then rollbackOnFailureEnabled will always be true, regardless of how the parameter is set.
globalIdUsed
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Indicates whether the edits can be applied using globalIds of features or attachments.
This parameter applies only if the layer's capabilities.editing.supportsGlobalId property is true.
When false, globalIds submitted with the features are ignored and the service assigns new globalIds
to the new features. When true, the globalIds must be submitted with the new features. When updating existing features, if the globalIdUsed is
false, the objectIds of the features to be updated must be provided. If the globalIdUsed is true, globalIds of features to be updated must be provided.
When deleting existing features, set this property to false as deletes operation only accepts objectIds at the current version of the API.
When adding, updating or deleting attachments, globalIdUsed parameter must be set to true and the attachment globalId must be set.
For new attachments, the user must provide globalIds. In order for an attachment to be updated or deleted, clients must include its globalId.
Attachments are not supported in an edit payload when globalIdUsed is false.
// add an image attachments to featuresfunction addAttachment(selectedFeature) { const blob = new Blob(byteArrays, { type: "image/png" }); addAttachments.push({ feature: selectedFeature, attachment: { globalId: "8c4d6085-a33c-42a0-8e11-21e9528bca0d", name: "brokenLight", data: blob } });
const edits = { addAttachments: addAttachments };
const options = { // globalIdUsed has to be true when adding, updating or deleting attachments globalIdUsed: true, rollbackOnFailureEnabled: true };
featureLayer.applyEdits(edits, options).then(function(results) { console.log("edits added: ", results); });} returnEditMoment
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Indicates whether the edit results should return the time edits were applied. If true, the feature service will return
the time edits were applied in the edit result's editMoment property. Only applicable with ArcGIS Server services only. This option was added at the version 4.20.
returnServiceEditsOption
- Type
- "none" | "original-and-current-features" | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.0
If set to original-and-current-features, the EditedFeatureResult parameter will be included
in the applyEdits response. It contains all edited features participating in composite relationships in a database as result of editing a feature. Note that even for deletions, the geometry and attributes
of the deleted feature are returned. The original-and-current-features option is only valid when rollbackOnFailureEnabled is true. The default value is none, which will not include the
EditedFeatureResult parameter in the response. This is only applicable with ArcGIS Server services only. This option was added at the version 4.20.
editsRespectTrueCurves
Attests that the edits were prepared in a way that avoids the loss of true curve geometries. An app should only set this parameter to true if it can
guarantee that the entire client-side chain of custody handles true curves properly.
Setting this parameter is only necessary when the feature service is configured to restrict updating of true curve geometries to clients that explicitly indicate support for true curve editing.
Considerations for curve-aware editing include:
- Prior to editing, the feature must be obtained from the service with its true curves intact, e.g. by a query with the Query.returnTrueCurves parameter set to
true. - Ensure all spatial operations performed on the geometry preserve curves — i.e., avoids densifying curves into linear approximations.
- Beware of code that references a geometry's Polygon.rings or Polyline.paths properties directly. Curve-aware iteration over the vertices of a geometry requires a conditional logic whereby Polygon.curveRings or Polyline.curvePaths are used when defined, and Polygon.rings or Polyline.paths are used otherwise.
Edits
- Since
- ArcGIS Maps SDK for JavaScript 5.0
addFeatures
- Type
- Graphic[] | Collection<Graphic> | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.0
An array or a Collection of features to be added. Feature geometries must be of type Mesh. Values of non nullable fields must be provided when adding new features. Date fields must have numeric values representing universal time.
updateFeatures
- Type
- Graphic[] | Collection<Graphic> | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.0
An array or a Collection of features to be updated. Each feature must have a valid objectId or globalId for attribute updates, while geometry updates must always use a valid globalId. Values of non nullable fields must be provided when updating features. Date fields must have numeric values representing universal time.
deleteFeatures
- Type
- Graphic[] | Collection<Graphic> | FeatureIdentifier[] | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.0
An array or a Collection of features, or an array of objects with globalId of each feature to be deleted. When an array or collection of features is passed, each feature must have a valid globalId. When an array of objects is used, each object must have a valid value set for the globalId property.
addAttachments
- Type
- AttachmentEdit[] | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.0
An array of attachments to be added. Applies only when the options.globalIdUsed
parameter is set to true. User must provide globalIds for all attachments to be added.
updateAttachments
- Type
- AttachmentEdit[] | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.0
An array of attachments to be updated. Applies only when the options.globalIdUsed
parameter is set to true. User must provide globalIds for all attachments to be updated.
EditsResult
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Results returned from the FeatureLayer.applyEdits() method.
addFeatureResults
- Type
- FeatureEditResult[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Result of adding features.
updateFeatureResults
- Type
- FeatureEditResult[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Result of updating features.
deleteFeatureResults
- Type
- FeatureEditResult[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Result of deleting features.
addAttachmentResults
- Type
- FeatureEditResult[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Result of adding attachments.
updateAttachmentResults
- Type
- FeatureEditResult[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Result of updating attachments.
deleteAttachmentResults
- Type
- FeatureEditResult[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Result of deleting attachments.
editedFeatureResults
- Type
- EditedFeatureResult[] | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Edited features as result of editing a feature that participates in composite relationships in a database.
This parameter is returned only when the returnServiceEditsOption parameter of the FeatureLayer.applyEdits() method is set to original-and-current-features. This parameter was added at 4.20.
editMoment
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The time edits were applied to the feature service.
This parameter is returned only when the returnEditMoment parameter of the FeatureLayer.applyEdits() method is set to true. This option was added at the version 4.20.
EditedFeatureResult
- Since
- ArcGIS Maps SDK for JavaScript 4.20
Results returned from the FeatureLayer.applyEdits() method if the returnServiceEditsOption parameter is set to original-and-current-features. It contains features
that were added, deleted or updated in different feature layers of a feature service as a result of editing a single feature that participates in a composite relationship in
a database. The results are organized by each layer affected by the edit.
For example, if a feature is deleted and it is the origin in a composite relationship, the edited features as a result of this deletion are returned.
The editedFeatures object returns full features including newly added features, the original features prior to delete, the original and current features for updates.
layerId
- Type
- number
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The layerId of the feature layer where features were edited.
editedFeatures
- Type
- EditedFeatures
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Object containing all edited features belonging to the specified layer.
EditedFeatures
- Since
- ArcGIS Maps SDK for JavaScript 5.0
adds
- Type
- Graphic[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Newly added features as a result of editing a feature that participates in a composite relationship.
updates
- Type
- EditedFeaturesUpdate[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Object containing original and updated features as a result of editing a feature that participates in a composite relationship.
deletes
- Type
- Graphic[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Deleted features as a result of editing a feature that participates in a composite relationship.
spatialReference
- Type
- SpatialReference | null | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Edited features are returned in the spatial reference of the feature service.
EditedFeaturesUpdate
- Since
- ArcGIS Maps SDK for JavaScript 5.0
original
- Type
- Graphic
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Original feature before the update took place.
current
- Type
- Graphic
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Updated feature as a result of editing a feature that participates in a composite relationship.
EditsResultEvent
- Since
- ArcGIS Maps SDK for JavaScript 5.0
addedFeatures
- Type
- FeatureEditResult[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
An array of successfully added features.
updatedFeatures
- Type
- FeatureEditResult[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
An array of successfully updated features.
deletedFeatures
- Type
- FeatureEditResult[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
An array of successfully deleted features.
addedAttachments
- Type
- FeatureEditResult[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
An array of successfully added attachments.
updatedAttachments
- Type
- FeatureEditResult[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
An array of successfully updated attachments.
deletedAttachments
- Type
- FeatureEditResult[]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
An array of successfully deleted attachments.
editedFeatures
- Type
- EditedFeatureResult[] | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Edited features as result of editing a feature that participates in composite relationships in a database.
This parameter is returned only when the returnServiceEditsOption parameter of the FeatureLayer.applyEdits() method is set to original-and-current-features. This parameter was added at 4.20.
exceededTransferLimit
- Type
- boolean
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Returns true when the number of records returned exceeds the maximum number configured on the service.