Many spatial data services support filtering by bounding box, an OGC WFS service for example.

When you are creating a Store for a protocol that supports bounding box queries, you can implement the spatialQuery method of the Store. This method takes two parameters:

  • The bounding box for which features should be returned.

  • The query object, which is identical to the argument of the query method of the Store.

If the spatialQuery method is implemented by the Store, a FeatureLayer can use the LoadSpatially data loading strategy.

Such a strategy limits the request for data to just the features within the current view bounds. This is a useful strategy to improve performance, because data can be downloaded in small batches each time the view extent changes.