openlayers/ol3 — pull request #1744 by twpayne (2014-02-21 16:21:01+00:00)
Title: ol.source.RemoteVector (work in progress)

This PR is opened for discussion, it is not yet ready to be merged.

This PR experiments with an `ol.source.RemoteVector` designed for the case where the local `ol.source.Vector` is a cache of a subset of the features on a remote server.

The key changes are:

* `ol.source.VectorFile` is split into two classes: `ol.source.FormatVector` and `ol.source.StaticVector`.

* `ol.source.FormatVector` handles reading and writing features both synchronously and asynchronously in a given format.

* `ol.source.StaticVector` loads all features in a given format from a variable or URL.

* `ol.source.RemoteVector` inherits from `ol.source.VectorFile` and is configured with a couple of functions.

* `loadingFunction` represents the loading strategy, skeleton implementations are in `src/ol/loading.js`.

* `extentUrlFunction` takes an extent and returns the URL to request.

There is an example in `examples/remote-vector.js` but it is not yet functional because the `demo.mapfish.org` server does not support cross-origin requests.

@fredj, any chance of finishing off your OSM XML API parser so we can use it for testing this approach?

There's still more to be done, for example a strategy for expiring features from the `ol.source.Remote`.

Comments welcome.