Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying OpenLayers 2.10 Beginner's Guide
  • Table Of Contents Toc
  • Feedback & Rating feedback
OpenLayers 2.10 Beginner's Guide

OpenLayers 2.10 Beginner's Guide

4.2 (9)
close
close
OpenLayers 2.10 Beginner's Guide

OpenLayers 2.10 Beginner's Guide

4.2 (9)

Overview of this book

Table of Contents (18 chapters)
close
close
OpenLayers 2.10
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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. Each style object can have multiple rules, and rules can interact with each other depending on how their filters are defined.

How do we use them?

To use custom rules and filters, we just need to associate them with a style object. The general syntax...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY