Creates a new MemoryStore instance.
options for the new store instance
An event that is emitted when the contents of the store changes.
the "StoreChanged" event.
the callback to be invoked when the contents of the store changes. The callback has 3 parameters:
value to use as this when executing callback
An option object which has a 'query' property, which represents a query which may be understood and satisfied by the store. The structure of this object is dependent on the specific store. If specified, the listener function must only be invoked for features that match the query.
States if this store instance supports spatial capabilities.
If the returned value is true
then MemoryStore.spatialQuery method is available.
Add a new Feature
to the store. If an id is present on the feature, the Store
may not
yet contain a Feature
with that same ID.
the Feature
to add.
Object literal containing options for the add method. The current implementation does not support any options.
The identifier of the newly added Feature
. An "add" event is triggered if adding is successful.
Removes all Features
from the store
True. A "remove" event is also triggered for every successful removal
Retrieve a Feature
from this store by id.
The identifier of the Feature
.
The Feature
with the specified id. Undefined if it does not exist.
Update an existing Feature
in the store. If an object with the same identifier does not exist yet,
the object will be added to the store. A corresponding StoreChanged
will be fired.
the Feature
to update.
Object literal containing options for the put method. The current implementation does not support any options.
The identifier of the Feature
. An "update" or "add" event is triggered, depending on whether the id already exists in the Store.
Query the store for objects. The current implementation returns all Feature
s contained in
this Store
.
An optional function that is used to filter the results of the query. The supplied function will receive an individual feature as parameter and should return a truthy value to indicate that that feature should be included in the cursor. If the function returns a falsy value then the feature will be excluded from the cursor. If no function is specified, then all features will be returned.
Object literal containing options for the query method. The current implementation does not support any options.
A cursor for the result set.
Clears the Features
in the store and loads a new set of features
The new data to load.
True. A "remove" event is triggered for every successful removal and an "add" event is triggered for every successful addition.
Removes a Feature
from the store by id.
The identifier of the Feature
.
True if removal was successful. If successful, a "remove" event is also triggered.
Queries the store for objects within a spatial extent. This method is available only when the store is created with spatial index. Please see MemoryStoreConstructorOptions.spatialIndex property for more details.
A non-persistent Store that keeps Feature instances in memory.
The store can be created with spatial capabilities using MemoryStoreConstructorOptions.spatialIndex.
When MemoryStore.spatialIndex is
true
then the MemoryStore.spatialQuery method is available. Also in this case LuciadRIA will choose LoadSpatially as a default loading strategy for a layer with this store. Otherwise layer's loading strategy will be defaulted to LoadEverything strategy.As the
Feature
s are stored in memory, there is no need to convert them to a "server-specific format". As such, thisStore
does not use a Codec.