Called for adding a new feature.
Called when a user creates a new feature using a feature template. The implementation should persist the feature to a backend service. If the function throws an error, an error notification is displayed to the user; otherwise, a success notification is shown.
A promise that resolves when the feature has been successfully added, or rejects with an error if the operation fails.
Called for deleting a feature.
Called when a user requests deletion of an existing feature. The implementation should remove the feature from a backend service. If the function throws an error, an error notification is displayed to the user; otherwise, a success notification is shown.
A promise that resolves when the feature has been successfully deleted, or rejects with an error if the operation fails.
Called for updating an existing feature.
Called when a user modifies an existing feature's geometry or properties. The implementation should persist the changes to a backend service. If the function throws an error, an error notification is displayed to the user; otherwise, a success notification is shown.
A promise that resolves when the feature has been successfully updated, or rejects with an error if the operation fails.
Interface defining the backing storage for feature editing operations.
The
FeatureWriterprovides callback functions for creating, updating, and deleting features in the editing workflow. Implementations of this interface are responsible for persisting feature changes to the appropriate underlying data structures or storage systems.Note that the
FeatureWriterdoes not load features. Features and their attributes are taken from the map.If any function throws an error, an error message will be shown to the user via the NotificationService. On success, a success notification is shown.
Example
Example: Error handling
If any function rejects with an error, that error will be logged and a generic error message will be presented to the user. Return an instance of StorageError instead if you want to include an additional user-visible message.