
OpenLayers Cookbook

A key concept when working against a WFS server is the concept of filters.
Among many other specifications, the OGC has defined a standard that defines the notation to be used for filtering, the Filter Encoding Specification.
Filters are similar to the WHERE
clause in SQL and allow us to select features that meet some conditions.
You can find the Filter Encoding Specification on the OGC website available at http://www.opengeospatial.org/standards/filter.
As we will see in Chapter 7, Styling Features, filters are not only used to query features but are also used to define rules to style them.
OpenLayers offers a set of classes suited to work with the filters the specification defines: property filters (PropertyIsEqualTo
, PropertyIsLessThan
, and so on), logical filters, and spatial filters (Int
ersects
, Within
, and so on).
This recipe shows a basic usage of the filter classes to restrict the features queried on a WFS server.
We are going to query...
Change the font size
Change margin width
Change background colour