openlayers/ol3 — pull request #1812 by twpayne (2014-03-06 14:35:46+00:00)
Title: Pass resolution when requesting features in an extent

This PR is opened for discussion. The goal is to explore options for supporting tiled and server-simplified vector data.

In a tiled vector scheme, it is likely that the tiles covering large areas will contain simplified versions of the features compared to tiles covering small areas. If tiles covering large areas contained fully detailed features they could become very large indeed. This means that a single feature will be present in multiple tiles, and at different resolutions. This means that when rendering the feature, we have to somehow decide which version to use.

Similarly, when requesting vector data it can be helpful to specify the desired resolution so that the server can perform simplification.

There are multiple possibilities:

* As features are loaded with a tiling strategy, *replace* features with the same if the newly-loaded feature is more detailed, and then rely on ol3's existing client-side simplification.
* Maintain multiple R-Trees, say one per discrete resolution, and preferably return features from the R-Tree with the resolution corresponding to the requested resolution. Features from other resolutions can be returned if none is found at the desired resolution. This would be the vector equivalent of interim tiles.

This PR suggests a new function (currently stubbed out) `forEachFeatureInExtentAtResolution` to allow renderers to communicate the desired resolution to the vector source.

Comments welcome. It's not obvious to me what the best approach is here.