A source of features.

interface FeatureSource {
    attachmentTypes?: string[];
    capabilities: Capabilities;
    featureActions?: Menu<MenuItemProperties, MenuProperties, MenuItem<MenuItemProperties, MenuProperties>>;
    featureSettings: FeatureSettings;
    featureSourceActions?: Menu<MenuItemProperties, MenuProperties, MenuItem<MenuItemProperties, MenuProperties>>;
    hyperlinks: Collection<Hyperlink>;
    iconUrl?: string;
    id: string;
    isDestroyed: boolean;
    isInitialized: boolean;
    itemType: string;
    onAddFeature?: Action;
    onEditFeature?: Action;
    queryService?: QueryService;
    relationships: Collection<Relationship>;
    schema: Schema;
    taskSettings: TaskSettings;
    title: string;
    addAttachment(feature: Feature, attachment: AttachmentProperties | Attachment | File): Promise<Attachment>;
    addFeature(feature: Feature, options?: FeatureWriteOptions): Promise<void>;
    addFeatures(features: Iterable<Feature, any, any>, options?: FeatureWriteOptions): Promise<void>;
    deleteAttachments(feature: Feature, attachments: (string | Attachment)[]): Promise<void>;
    deleteFeature(id: string, options?: FeatureWriteOptions): Promise<void>;
    deleteFeature(feature: Feature, options?: FeatureWriteOptions): Promise<void>;
    deleteFeatures(ids: string[], options?: FeatureWriteOptions): Promise<void>;
    deleteFeatures(features: Iterable<Feature, any, any>, options?: FeatureWriteOptions): Promise<void>;
    destroy(): Promise<void>;
    getAttachments(feature: Feature): Promise<Attachment[]>;
    getFeature(id: string, options?: FeatureReadOptions): Promise<Feature>;
    getFeatures(ids: string[], options?: FeatureReadOptions): AsyncIterable<Feature, any, any>;
    getFullExtent(): Extent;
    initialize(): Promise<void>;
    toItemUri(): string;
    updateFeature(feature: Feature, options?: FeatureWriteOptions): Promise<void>;
    updateFeatures(features: Iterable<Feature, any, any>, options?: FeatureWriteOptions): Promise<void>;
}

Hierarchy (view full)

Implemented by

Properties

attachmentTypes?: string[]

A list of the valid file MIME types that can be uploaded as attachments.

capabilities: Capabilities

Capabilities of the feature source.

A menu for actions specifically related to features from this source.

featureSettings: FeatureSettings

Default settings that apply to features originating from this source.

A menu for actions specifically related to this source.

hyperlinks: Collection<Hyperlink>

Hyperlinks associated with the feature source.

iconUrl?: string

URL to an icon that represents this feature source.

id: string

The unique ID for this entity.

isDestroyed: boolean

Indicates if the item has been destroyed. Once destroyed, it is not safe to invoke any other methods on the object.

isInitialized: boolean

Indicates if the item has been initialized.

itemType: string

The item type for this entity when it participates in an App.

onAddFeature?: Action

The action to be executed when a feature is added.

onEditFeature?: Action

The action to be executed when a feature is edited.

queryService?: QueryService

An optional query service that the feature source can use to get features.

relationships: Collection<Relationship>

Relationships to other feature sources.

schema: Schema

Metadata about features originating from this source, such as fields, domains, and geometry type.

taskSettings: TaskSettings

Settings that affect whether a feature source participates in various tasks that are performed on a map.

title: string

A human readable title for the feature source.

Methods

  • Adds a new feature to the source. If the source does not support adding features, then an InvalidOperationError will be thrown (see capabilities).

    Parameters

    • feature: Feature

      The feature to add.

    • Optionaloptions: FeatureWriteOptions

      Additional options that control how the feature is saved.

    Returns Promise<void>

  • Adds a set of features to the source. If the source does not support adding features, then an InvalidOperationError will be thrown (see capabilities).

    Parameters

    • features: Iterable<Feature, any, any>

      The features to add.

    • Optionaloptions: FeatureWriteOptions

      Additional options that control how the features are saved.

    Returns Promise<void>

  • Deletes attachments from a feature.

    Parameters

    • feature: Feature

      The feature to delete attachments from.

    • attachments: (string | Attachment)[]

      The attachments or the IDs of the attachments to delete from the feature.

    Returns Promise<void>

  • Deletes a feature from its source. If the source does not support deleting features, then an InvalidOperationError will be thrown (see capabilities).

    Parameters

    • id: string

      The ID of the feature to delete.

    • Optionaloptions: FeatureWriteOptions

      Additional options that control how the features are deleted.

    Returns Promise<void>

  • Deletes a feature from its source. If the source does not support deleting features, then an InvalidOperationError will be thrown (see capabilities).

    Parameters

    • feature: Feature

      The feature to delete.

    • Optionaloptions: FeatureWriteOptions

      Additional options that control how the features are deleted.

    Returns Promise<void>

  • Deletes features from their source. If the source does not support deleting features, then an InvalidOperationError will be thrown (see capabilities).

    Parameters

    • ids: string[]

      The IDs of the features to delete.

    • Optionaloptions: FeatureWriteOptions

      Additional options that control how the features are deleted.

    Returns Promise<void>

  • Deletes features from their source. If the source does not support deleting features, then an InvalidOperationError will be thrown (see capabilities).

    Parameters

    • features: Iterable<Feature, any, any>

      The features to delete.

    • Optionaloptions: FeatureWriteOptions

      Additional options that control how the features are deleted.

    Returns Promise<void>

  • A clean-up function that should get called whenever the item is disposed of.

    Returns Promise<void>

  • Gets any attachments associated with a feature.

    Parameters

    • feature: Feature

      The feature to get attachments for.

    Returns Promise<Attachment[]>

  • Gets a feature by ID. If no such feature exists, the promise is rejected with an instance of NotFoundError.

    Parameters

    • id: string

      The ID of the feature to retrieve.

    • Optionaloptions: FeatureReadOptions

      Additional options that control how the feature is retrieved.

    Returns Promise<Feature>

  • Gets a set of features by their IDs.

    Parameters

    • ids: string[]

      The IDs of the features to retrieve.

    • Optionaloptions: FeatureReadOptions

      Additional Options that control how the features are retrieved.

    Returns AsyncIterable<Feature, any, any>

  • Returns the full extent of the source that contains all included features.

    Returns Extent

  • Creates an item:// URI reference to this entity.

    Returns string

  • Saves changes to an existing feature. If the source does not support updating features, then an InvalidOperationError will be thrown (see capabilities).

    Parameters

    • feature: Feature

      The feature to update.

    • Optionaloptions: FeatureWriteOptions

      Additional options that control how the feature is saved.

    Returns Promise<void>

  • Saves changes to a existing features. If the source does not support updating features, then an InvalidOperationError will be thrown (see capabilities).

    Parameters

    • features: Iterable<Feature, any, any>

      The features to update.

    • Optionaloptions: FeatureWriteOptions

      Additional options that control how the features are saved.

    Returns Promise<void>