View on GitHub
import InlineCode from "@esri-dx/starship-doc-components/components/InlineCode.astro";

Create, update, and delete features to manage a feature layer.

Image of manage features sample

Use case

An end-user performing a survey may want to manage features on the map in various ways during the course of their work.

How to use the sample

Pick an operation, then tap on the map to perform the operation at that location. Available feature management operations include: “Create feature”, “Delete feature”, “Update attribute”, and “Update geometry”.

How it works

  1. Create a
    from a URL.
  2. Get a
    from the
    .
  3. Create a
    derived from the
    instance.
  4. Apply the feature management operation upon selection.
  • Create feature: create a
    with attributes and a location using the
    .
  • Delete feature: delete the selected
    from the
    .
  • Update attribute: update the attribute of the selected
    .
  • Update geometry: update the geometry of the selected
    .
  1. Update the
    locally.
  2. Update the
    of the
    by calling
    .
  • This pushes the changes to the server.

Relevant API

  • Feature
  • FeatureLayer
  • ServiceFeatureTable
  • ServiceGeodatabase

Additional information

When editing feature tables that are subject to database behavior (operations on one table affecting another table), it’s now recommended to call these methods (apply or undo edits) on the

object rather than on the
object. Using the
object to call these operations will prevent possible data inconsistencies and ensure transactional integrity so that all changes can be committed or rolled back.

Tags

amend, attribute, create, delete, deletion, details, edit, editing, feature, feature layer, feature table, geodatabase, information, moving, online service, service, update, updating, value