O'Reilly logo

OpenLayers 2.10 by Erik Hazzard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rules and filters

So far, we've pretty much just been doing a one to one match on properties to specify style. With attribute replacement, we directly replace a value. With addUniqueValueRules, we see if a property is equal to something. So far, we haven't had much flexibility.

By using Rules and Filters, we can be as flexible as we want. We can do comparisons on properties, such as styling a feature a certain way if, for instance, it has a property less than or greater than some value. We can create filters to check for a multitude of different types of comparisons (greater than, less than, equal to, etc.), and have filters interact with each other.

How do they work?

A filters object belongs to a rule object. A rule object belongs to a style object. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required