-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

OpenLayers 2.10 Beginner's Guide

The Filter class controls the logic of match feature property attributes to see if a rule should be applied or not. We can use a single filter, like in the previous example, or we can combine filters together (e.g., if property1
is greater than 500 and another property2
is less than 200, then apply the style).
Filters can also be spatial—we can check to see if features intersect geometry objects, are within some distance of a point, and more. To do all these things, we use subclasses of the base Filter class, similar to how we use subclasses of the Layer class and other classes.
There are four subclasses we'll cover here—Comparison, FeatureId, Logical, and Spatial.
The Comparison class is the filter class we've been using so far. Like the name implies, this class will compare properties based on the specified parameters of the filter object. The type of comparison applied is specified by the type
property. We also have to specify a value...
Change the font size
Change margin width
Change background colour