For even more fine grained control, we can style objects by using the Rule and Filter classes. These two classes allow us to apply different styles to different features based on some arbitrary 'rules' we choose. We can use the feature's
attributes property to apply certain styles if one (or more) of the properties match some value we choose.
Rules allow us to apply symbolizers when certain conditions occur. Those conditions are handled via the Filter class. We can have multiple rules and filters, and even use logical operators (such as OR and AND) with them. Before we talk about that though, there are two ways we can use rules.
The first is by using the
addUniqueValueRules method of the StyleMap class. ...