O'Reilly logo

OpenLayers Cookbook by Antonio Santiago Perez

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

Working with unique value rules

Usually, we do not only style features by what they represent, for example a city or a village, but we style depending on their attributes, such as the number of citizens, year of foundation, and number of squares.

To help on these cases, OpenLayers offers us the possibility to define rules to decide how to style features. For example, we can define a rule that for all features of a city with a population greater than 100,000 a point with radius 20 and color brown can be rendered, while for cities with a population less than 100,000, a point with radius 10, color orange, and semi transparent can be rendered.

Beginning in the world of the rules, the concept of unique value rules are the simplest case we can find. ...

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