LuciadRIA (2026.1.02)
    Preparing search index...

    Class UrlStore<TFeature>

    A read-only store that retrieves a collection of objects from a URL. The response content is decoded using a LuciadRIA Codec.

    Type Parameters

    • TFeature extends Feature = Feature

      Represents the type of Feature instances that are handled by the store. Default type is Feature without restrictions on shape and properties.

    Hierarchy (View Summary)

    • get credentials(): boolean

      Indicates whether credentials should be included with HTTP requests.

      Set this to true if the server requires credentials, like HTTP basic authentication headers or cookies. You should disable credentials if the server is configured to allow cross-origin requests from all domains (<Access-Control-Allow-Origin=*). If the server allows CORS requests from all domains, the browser will block all requests where credentials=true.

      Once set, all later HTTP requests will use the newly set value.

      The default value is false.

      Returns boolean

    • set credentials(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get requestHeaders(): HttpRequestHeaders | null

      Headers to send with every HTTP request.

      An object literal that represents the headers to send with every HTTP request. The property names represent HTTP header names, the property values represent the HTTP header values. This property can be set dynamically (post-construction). Once set, all later HTTP requests will use the newly set headers.

      Note that when custom headers are being sent to a server on another domain, the server will have to properly respond to pre-flight CORS requests (an HTTP OPTION request sent by the browser before doing the actual request). The server has to indicate that the header can be used in the actual request by including it in the pre-flight's Access-Control-Allow-Headers response header.

      The default value is null.

      Returns HttpRequestHeaders | null

    • set requestHeaders(value: HttpRequestHeaders | null): void

      Parameters

      Returns void

    • get requestParameters(): HttpRequestParameters | null

      Custom request parameters to send along with requests. The object literal can contain simple key/value pairs. Accepted values are strings, numbers, and booleans. A ProgrammingError will be thrown if values of another type are used. Values must not be URL encoded.

      Assignments of other values than object literals to requestParameters will throw an Error. Clearing the parameters can be done by assigning null or an empty object literal to requestParameters. To trigger a refresh of the visualization on the map, use layer.loadingStrategy.queryProvider.invalidate() (QueryProvider.invalidate).

      Returns HttpRequestParameters | null

      2021.1.03

    • set requestParameters(value: HttpRequestParameters | null): void

      Parameters

      Returns void

    • Adds a Feature to the store.

      Throws a ProgrammingError. Override this method to support the operation, and report "add" from Store.isOperationSupported. LuciadRIA never calls an operation that the store does not report as supported.

      When the addition is successful, the Store must:

      • Update the ID of the Feature to reflect the ID assigned by the server, if the Feature's ID was undefined prior to addition. If an ID was already defined, the Store should respect the provided ID unless overridden by the server.

      • Emit a "StoreChanged" event with:

        • eventType: "add"
        • feature: The added Feature, including its updated ID.
        • id: The updated identifier of the Feature.

        Failure to do so will result in a map not displaying newly added features.

      Parameters

      • feature: TFeature

        The Feature to add.

      • Optionaloptions: any

        An optional object for additional implementation-specific parameters.

      Returns FeatureId | Promise<FeatureId>

      Returns the identifier of the Feature on success, or a promise that resolves to the identifier.

      ProgrammingError if this store does not support the "add" operation, as reported by Store.isOperationSupported.

      2026.1

    • Emits the StoreChanged event to report that the contents of this store changed. Call this from add, put and remove when the operation succeeds.

      Parameters

      • eventType: "add" | "update" | "remove"

        "add", "update" or "remove".

      • feature: TFeature | undefined

        The Feature that was added, updated or removed. May be undefined for "remove".

      • id: FeatureId

        The identifier of the affected Feature.

      Returns void

      2026.1

    • Retrieves a Feature by id from the data provider.

      Throws a ProgrammingError. Override this method to support the operation, and report "get" from Store.isOperationSupported. LuciadRIA never calls an operation that the store does not report as supported.

      Parameters

      • id: FeatureId

        The identifier of the Feature.

      • Optionaloptions: any

        An optional object that can be used in a specific implementation of the method.

      Returns TFeature | Promise<TFeature | undefined> | undefined

      May return the Feature, or a promise for the Feature. When no feature with that id exists, the returned value must be undefined, whether the implementation is synchronous or asynchronous (a promise resolving to undefined). Reject the promise only for an actual failure, such as a network or parsing error.

      ProgrammingError if this store does not support the "get" operation, as reported by Store.isOperationSupported.

      2026.1

    • Indicates whether the given store operation is supported.

      LuciadRIA uses this method to determine whether an operation can be called. A Store defines all operations, so the presence of a method does not imply that it is supported. Return true for each supported operation and false otherwise. Calling an unsupported operation throws a ProgrammingError.

      The result must remain stable for the lifetime of the store. A FeatureLayer reads it when it is added to a map, and does not pick up later changes.

      Returns false for every operation. Override this method to report the operations that this store implements.

      Parameters

      Returns boolean

      true if methodName can be called on this store.

      2026.1

    • Updates an existing Feature in the store or adds it if it does not already exist.

      Throws a ProgrammingError. Override this method to support the operation, and report "put" from Store.isOperationSupported. LuciadRIA never calls an operation that the store does not report as supported.

      When the operation is successful, the Store must emit a "StoreChanged" event. The event should contain:

      • eventType: "update" if an existing feature is updated, or "add" if a new feature is added.
      • feature: The updated or newly added Feature.
      • id: The identifier of the affected Feature.

      Failure to do so will result in a map not displaying updated features.

      The implementation of this method may follow the semantics of an HTTP PUT request. This means that if the feature does not already exist in the store, it may be added as a new entry.

      Parameters

      • feature: TFeature

        The Feature to update or add.

      • Optionaloptions: any

        An optional object for additional implementation-specific parameters.

      Returns FeatureId | Promise<FeatureId>

      Returns the identifier of the Feature on success, or a promise that resolves to the identifier.

      ProgrammingError if this store does not support the "put" operation, as reported by Store.isOperationSupported.

      2026.1

    • Removes a Feature from the store by its ID.

      Throws a ProgrammingError. Override this method to support the operation, and report "remove" from Store.isOperationSupported. LuciadRIA never calls an operation that the store does not report as supported.

      When the removal is successful, the Store must emit a "StoreChanged" event, which contains an eventType of "remove" and the ID of the removed Feature.

      If the Store does not emit the "StoreChanged" event, the map visualization will not reflect the removal of the feature.

      Parameters

      • id: FeatureId

        The identifier of the Feature to be removed.

      Returns boolean | Promise<boolean>

      Returns true on successful removal, or a promise that resolves to true.

      ProgrammingError if this store does not support the "remove" operation, as reported by Store.isOperationSupported.

      2026.1

    • Queries the store for objects within a spatial extent.

      Throws a ProgrammingError. Override this method to support the operation, and report "spatialQuery" from Store.isOperationSupported. LuciadRIA never calls an operation that the store does not report as supported.

      Note: LuciadRIA determines the layer's default loading strategy based on whether the store reports "spatialQuery" as supported. If it does, the default loading strategy is LoadSpatially. Otherwise it is LoadEverything.

      Note: When the map reference and the model reference are incompatible, for example a Cartesian reference and a geodetic reference, the layer falls back to LoadEverything.

      Note: WFSFeatureStore implements this operation by creating an OGC BBOX filter based on the bounds parameter.

      Parameters

      • Optionalbounds: Bounds

        The spatial extent to return features for.

      • Optionalquery: any

        An object that represents a query filter that is understood by the underlying data provider. The structure of this object depends on a specific store implementation.

      • Optionaloptions: QueryOptions

        An optional object that can be used in a specific implementation of the method.

      Returns Cursor<TFeature> | Promise<Cursor<TFeature>>

      A Cursor.

      ProgrammingError if this store does not support the "spatialQuery" operation, as reported by Store.isOperationSupported.

      2026.1

    • An event that is emitted when the contents of the store change. A store that performs create, update, or delete operations must report them with Store.emitStoreChangedEvent, to ensure that changes are communicated properly to listeners.

      Parameters

      • event: "StoreChanged"

        The "StoreChanged" event.

      • callback: (
            eventType: "add" | "update" | "remove",
            feature: TFeature,
            id: FeatureId,
        ) => any

        The callback to be invoked when the contents of the store change. The callback has three parameters:

        • eventType: The type of change.
        • feature: The Feature that was added, updated, or removed. For the "remove" event type, the value should be undefined.
        • id: The identifier of the Feature that was affected by the change.
      • Optionalcontext: any

        An optional value used as the this context when executing the callback.

      • Optionaloptions: StoreChangedOptions

        An optional object specifying additional options for the event listener. The inherited implementation ignores StoreChangedOptions.query: override this method to filter the events that this store reports. StoreChanged

      Returns Handle

      2026.1