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

OpenLayers.Filter class


The Filter class controls the logic of match feature property attributes to see if a rule should be applied or not. We can use a single filter, like in the previous example, or we can combine filters together (e.g., if property1 is greater than 500 and another property2 is less than 200, then apply the style).

Filters can also be spatial—we can check to see if features intersect geometry objects, are within some distance of a point, and more. To do all these things, we use subclasses of the base Filter class, similar to how we use subclasses of the Layer class and other classes.

Filter Subclasses

There are four subclasses we'll cover here—Comparison, FeatureId, Logical, and Spatial.

Filter.Comparison

The Comparison class is the filter class we've been using so far. Like the name implies, this class will compare properties based on the specified parameters of the filter object. The type of comparison applied is specified by the type property. We also have to specify a value...

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