LuciadRIA (2026.0.04)
    Preparing search index...

    This strategy ensures that only the data within the visible extent of the Map is retrieved from the model. It can only be used on FeatureLayers whose model supports spatial queries. 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 can define a WFS query object using the WFSQueryOptions.maxFeatures property. For a given visible extent of the Map, this property limits the maximum number of features to load. When this happens, the LoadSpatially strategy will re-query when zooming in or out, so that a new set of data is retrieved for the new view extent.

    In a 3D scene, the visible extent of the Map may cover multiple areas at different scales. For example, when the camera is tilted, data near the horizon is visualized at a lower scale than data closer to the camera. To handle this, LuciadRIA divides the map into multiple zones that correspond with scale levels that are defined by the QueryProvider. The loading strategy queries the model by passing the bounds and the query object for each visible scale level zone, and combines the data across zones for consistent visualization. This approach enables visualization of large datasets in 3D, while still allowing you to apply data-specific business rules when loading and rendering. Please note that you can suppress this behavior by setting LoadSpatiallyStrategyConstructorOptions.singleQueryLevel to true.

    To fully benefit from this loading capability, the QueryProvider should define scale levels and associated query objects, allowing you to limit the number of features at smaller scales, or to prevent loading data entirely at the least detailed level (level 0) using QueryProvider.QUERY_NONE. You can also define the layer’s minimum and maximum scale at which features should be rendered. LuciadRIA will query the model using bounds computed for the area within these scale limits.

    Note: Selected features are preserved between queries and are not removed from the model when new data is returned, provided that the features returned by the query have stable, fixed IDs. If feature IDs change between queries, selections may be lost.

      const townQueryFilter = {
    filter: eq(property("class"), literal("town"))
    };

    class CityQueryProvider extends QueryProvider {
    getQueryForLevel(level: number) {
    // no data requested for least detailed level
    if (level === 0) {
    return QueryProvider.QUERY_NONE;
    }
    // data matching the specific filter is only loaded
    if (level === 1) {
    return townQueryFilter;
    }
    // everything is loaded otherwise
    return null;
    }

    // The query provider defines 3 scale levels:
    // The scale level 0 denotes an area with scales smaller than 1 / 50000,
    // The scale level 1 that represents area with scales between than 1 / 50000 and 1 / 1000,
    // The scale level 2 that represents area with scales greater than 1 / 1000 (closer to the observer).
    getQueryLevelScales(layer?: FeatureLayer, map?: RIAMap) {
    return [ 1/50000, 1/1000 ];
    }
    }

    // the cityModel must support spatial queries
    const cityLayer = new FeatureLayer(cityModel, {
    loadingStrategy: new LoadSpatially({queryProvider: new CityQueryProvider()})
    });

    2015.0 load spatially strategy

    2018.1 3D multi-scale capability

    Hierarchy (View Summary)

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get queryProvider(): QueryProvider

      Returns QueryProvider

    • set queryProvider(queryProvider: QueryProvider): void

      The query provider configured on this strategy.

      Parameters

      Returns void

    • get refresh(): number | Date | null

      Controls the refresh settings for the Loading Strategy.

      • If the refresh property is set to null, the loading strategy never refreshes.
      • If the refresh property is set to a some number n, the loading strategy refreshes every n milliseconds.
      • If the refresh property is set to a Date object, the loading strategy will refresh at that time.

      Returns number | Date | null

      2020.1

    • set refresh(value: number | Date | null): void

      Parameters

      • value: number | Date | null

      Returns void

    Methods

    • 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:

      You can set a custom implementation of shouldUpdate function to verify if the update operation should be performed on existing features.

      Parameters

      • existingFeature: Feature

        the feature that exists in the layer

      • feature: Feature

        of the feature with same id that comes from the query cursor

      Returns boolean

      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