Book Image

OpenLayers 2.10 Beginner's Guide

Book Image

OpenLayers 2.10 Beginner's Guide

Overview of this book

Table of Contents (18 chapters)
OpenLayers 2.10
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Strategy class


The strategy class is used to determine how the vector layer will request data and what it does with the feature data. Strategies can be used together—for example, the BBOX and Cluster strategies can be both used at the same time. Each subclass is quite different from each other, so let's take a look at each of the subclasses.

Strategy.BBOX

This class is used to display data that is within the map's extent. When used with the WFS protocol, it will set up the request to grab only the data that falls within the map's extent. If you are working with a lot of feature data, using the BBOX strategy will be quite helpful, as you'll only get back the data that is within the visible extent. This is possible only with some sort of feature server though—a static file won't know what to do with the requests passed in map extent, and will always return back every feature which the static file contains.

Strategy.Cluster

This will cluster features together based on a distance and optional threshold...