Options
All
  • Public
  • Public/Protected
  • All
Menu

A collection of objects that a FeatureLayer has loaded from a model. A working set is initially populated by querying the model of the layer using the query object specified on the layer. Subsequent updates to the working set are triggered by change events from the model.

Note that the working set contains all features that should eventually be painted in the map. However perfect consistency with what is actually being painted on the map is not guaranteed. Typically this happens if the layer performs additional processing on the features (ex. styling and discretization) in an incremental or asynchronous way. For example a feature that was added to the working set may not be painted immediately on the map. Similarly a feature that was updated or removed may still be painted in its previous state while the layer is processing it. The working set can also contain features that are outside the visible area of the map.

Hierarchy

Overview

Events

Properties

Methods

Events

on

  • (event: "QueryStarted", callback: () => void, context?: object): Handle
  • (event: "QueryFinished", callback: () => void, context?: object): Handle
  • (event: "QueryInterrupted", callback: () => void, context?: object): Handle
  • (event: "QuerySuccess", callback: () => void, context?: object): Handle
  • (event: "QueryError", callback: (error: Error) => void, context?: object): Handle
  • (event: "WorkingSetChanged", callback: (eventType: "add" | "update" | "remove" | "clear", feature: Feature, id: number | string) => void, context?: object): Handle
  • An event that is emitted when the working set is about to query the underlying model for data.

    Parameters

    • event: "QueryStarted"

      the 'QueryStarted'event

    • callback: () => void

      the callback to be invoked when a query is started, the callback has no parameters.

        • (): void
        • Returns void

    • Optional context: object

      value to use as this when executing callback

    Returns Handle

  • An event that is emitted when the working set has completed a previously started model query. Typically, it follows the 'QuerySuccess' event shortly.

    Parameters

    • event: "QueryFinished"

      the 'QueryFinished'event

    • callback: () => void

      the callback to be invoked when a query is completed, the callback has no parameters.

        • (): void
        • Returns void

    • Optional context: object

      value to use as this when executing callback

    Returns Handle

  • An event that is emitted when an ongoing query has been interrupted. This typically happens when the FeatureLayer.query property is set before another query has finished processing.

    Parameters

    • event: "QueryInterrupted"

      the 'QueryInterrupted' event

    • callback: () => void

      the callback to be invoked when a query is interrupted, the callback has no parameters.

        • (): void
        • Returns void

    • Optional context: object

      value to use as this when executing callback

    Returns Handle

  • An event that is emitted when the working set has successfully received a cursor from the underlying model.

    Parameters

    • event: "QuerySuccess"

      the 'QuerySuccess' event

    • callback: () => void

      the callback to be invoked when a query has successfully received a cursor from the underlying model, the callback has no parameters.

        • (): void
        • Returns void

    • Optional context: object

      value to use as this when executing callback

    Returns Handle

  • An event that is emitted when the working set received an error from the underlying model during the execution of a query.

    Parameters

    • event: "QueryError"

      the 'QueryError' event

    • callback: (error: Error) => void

      the callback to be invoked when the working set received an error from the underlying model during the execution of a query, the callback gets the 'error' parameter, which is the error that occurred.

        • Parameters

          Returns void

    • Optional context: object

      value to use as this when executing callback

    Returns Handle

  • An event that is emitted when the contents of the working set changes.

    Parameters

    • event: "WorkingSetChanged"

      the 'WorkingSetChanged' event

    • callback: (eventType: "add" | "update" | "remove" | "clear", feature: Feature, id: number | string) => void

      the callback the should be invoked when the content of the working set changes. It gets the following parameters:

      • eventType: "add", "update", "remove", "clear"
      • feature: the Feature that was added, updated or removed. In case of remove and clear events, this may be undefined.
      • id: The identifier of the Feature. In case of clear events, this may be undefined.
        • (eventType: "add" | "update" | "remove" | "clear", feature: Feature, id: number | string): void
        • Parameters

          • eventType: "add" | "update" | "remove" | "clear"
          • feature: Feature
          • id: number | string

          Returns void

    • Optional context: object

      value to use as this when executing callback

    Returns Handle

Properties

queryStatus

queryStatus: QueryStatus

A property indicating the status of the query of the working set.

Methods

add

  • (feature: Feature, options?: any): string | number | Promise<string | number>
  • Add a feature to the working set. This method will add the feature to the underlying model. Note that this function will only be available if the underlying model also provides an add function.

    If this method returns a Promise, then that Promise will resolve once the newly added feature has been added to the working set. This requires that the underlying model generates a change event for the addition of the feature. If the model does not generate a change event, the Promise will be rejected after an implementation dependent timeout. If this behaviour is not desired then it is recommended to call put on the underlying model directly.

    The advantage of adding a Feature through the WorkingSet, as opposed to adding it directly in the FeatureModel or the underlying Store, is that the returned Promise will resolve only when the entire add-operation has been completed and the associated WorkingSetChanged event has been fired.

    Parameters

    • feature: Feature

      The feature to add to the model.

    • Optional options: any

    Returns string | number | Promise<string | number>

get

  • Retrieves an array with all the objects contained in this working set.

    Returns Feature[]

put

  • (feature: Feature, options?: any): string | number | Promise<string | number>
  • Update an existing feature in the working set. Note that this function will only be available if the underlying model also provides a put function.

    If this method returns a Promise, then that Promise will resolve when the update has been completely processed by the working set. This requires that the underlying model generates a change event for the update of the feature. If the model does not generate a change event, the Promise will be rejected after an implementation dependent timeout. If this behaviour is not desired then it is recommended to call put on the underlying model directly.

    The advantage of updating a Feature through the WorkingSet, as opposed to updating it directly in the FeatureModel or the underlying Store, is that the returned Promise will resolve only when the entire put-operation has been completed and the associated WorkingSetChanged event has been fired.

    Parameters

    • feature: Feature

      The feature to update.

    • Optional options: any

    Returns string | number | Promise<string | number>

remove

  • (id: number | string): string | number | Promise<string | number>
  • Removes a feature from the working set by id. Note that this function will only be available if the underlying model also provides a remove function.

    If this method returns a Promise, then that Promise will resolve once the object has been removed from the working set. This requires that the underlying model generates a change event for the removal of the feature. If the model does not generate a change event, the Promise will be rejected after an implementation dependent timeout. If this behaviour is not desired then it is recommended to call put on the underlying model directly.

    The advantage of deleting a Feature through the WorkingSet, as opposed to deleting it directly in the FeatureModel or the underlying Store, is that the returned Promise will resolve only when the entire remove-operation has been completed and the associated WorkingSetChanged event has been fired.

    Parameters

    • id: number | string

      The identifier of the feature.

    Returns string | number | Promise<string | number>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method