Constructs a LoadSpatially data loading strategy.
Optional
options: LoadSpatiallyStrategyConstructorOptionsconfiguration options
The query provider configured on this strategy.
Controls the refresh settings for the Loading Strategy.
null
, the loading strategy never refreshes.
n
, the loading strategy refreshes every n
milliseconds.
Date
object, the loading strategy will refresh at that time.
2020.1
This is a predicate function that is called by LuciadRIA when processing the query cursor in order to find out if an existing feature should be replaced by a new version from the cursor. If the result of this test is true then the feature will be replaced by the new version. By default LuciadRIA does not replace existing features, as the update operation incurs some performance impact.
Please note that the query process is launched when:
Map
You can set a custom implementation of shouldUpdate
function to verify if the update
operation should be performed on existing features.
the feature that exists in the layer
of the feature with same id that comes from the query cursor
true, if the update operation should be performed, false to keep the existing feature unchanged.
const loadingStrategy = new LoadSpatially({queryProvider: queryProvider});
//Replace the shouldUpdate function with a custom implementation which checks the revision
//number stored in the Feature to decide whether or not the Feature should be updated
loadingStrategy.shouldUpdate = function(existingFeature: Feature, feature: Feature): boolean {
const properties = feature.properties as any;
return properties.revision &&
properties.revision > (existingFeature.properties as any).revision;
};
2020.1
This strategy ensures that only the data which is in the visible extent of the
Map
is retrieved from the model. It can only be used onFeatureLayers
whose model has a spatial-query capability. See Store.spatialQuery for more information about this capability. If you attempt to use this strategy with a model that does not support spatial queries, an error will be thrown.Additionally, you can configure a QueryProvider on this loading strategy to further refine the amount of data to load from the FeatureModel.
Note: QueryProvider by defining a WFS query object with the WFSQueryOptions.maxFeatures property. For the given visible extent of the
Map
this maximum number of features can be loaded. When this happens, the LoadSpatially strategy re-queries when zooming in or out, so that a new set of data is requested for the new view extent.In a 3D scene it is possible that the visible extent of the
Map
covers multiple areas with different scales. For example, if the camera is tilted, data on the horizon is visualized at a lower scale than data closer to the camera. To that end, LuciadRIA divides the map in multiple zones that correspond with scale levels that are defined by the QueryProvider. The loading strategy queries the underlying model by passing the bounds and the query object for each visible scale level zone, and combines the data in each zone for a consistent visualization. This approach allows you to visualize large data sets in 3D, while you can still apply data specific business rules when loading and visualizing the data.Please note that you can suppress this behavior by setting LoadSpatiallyStrategyConstructorOptions.singleQueryLevel to true.
In order to take advantage of this loading capability the QueryProvider should define scale levels and their query objects to limit the number of features for smaller scales, or even to prevent from loading data at all for the least detailed scale (level 0) (QueryProvider.QUERY_NONE). Additionally, you can also define layer's minimum scale or maximum scale at which features should be rendered. LuciadRIA will query the underlying model by passing the bounds computed for the area with scales within layer's scale limits.
Since
2015.0 load spatially strategy
Since
2018.1 3D multi-scale capability