Vector Behavior Example

Uses a new strategy, protocol, and format combination.

The vector layer shown uses the BBOX strategy, the HTTP protocol, and the GML format. (This is a little dumb since the GML is straight from a file, but it is just to demonstrate the parts).

The BBOX strategy is a simple strategy that fetches data based on some ratio applied to the map bounds. When this bounds is invalidated (the map viewport is no longer contained by the data bounds), a new batch of data is requested with a new bounds. When this data comes in, the old data is destroyed and the new data is added. This is a simple strategy, but it is meant to be extended into a more complicated one.

The HTTP protocol makes requests using HTTP verbs. It assumes a layer has a url that corresponds to a collection of features (a resource on some server). It also assumes that each feature will have a url representing a resource for updating or deleting itself. The HTTP protocol also knows how to deal with bbox parameters given to it from a strategy.

The GML format is used to serialize features.