Update FeatureLayer using applyEdits()

Note: Support for 3D on mobile devices may vary, view the system requirements for more information.

This sample demonstrates how to use FeatureLayer.applyEdits() to create new features, update attributes of existing features or delete existing features.

In this sample, the applyEdits function is called when user either:

  • Clicks to create a new feature.
  • Selects a feature on the view and updates its attributes.
  • Selects a feature on the view and deletes it.
// call FeatureLayer.applyEdits() method with
// edits parameter to create, update or delete
function applyEdits(params) {
  unselectFeature();
  var promise = featureLayer.applyEdits(params);
  editResultsHandler(promise);
}

FeatureLayer.applyEdits() resolves to an object containing edit results. If the edit failed, the edit result includes an error.

Loading...

Sample search results

TitleSample