/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the Clear BSD * license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the * full text of the license. */ /** * @requires OpenLayers/Rule.js */ /** * Class: OpenLayers.Rule.Logical * This class represents ogc:And, ogc:Or and ogc:Not rules. * * Inherits from * - */ OpenLayers.Rule.Logical = OpenLayers.Class(OpenLayers.Rule, { /** * APIProperty: children * {Array()} child rules for this rule */ children: null, /** * APIProperty: type * {String} type of logical operator. Available types are: * - OpenLayers.Rule.Locical.AND = "&&"; * - OpenLayers.Rule.Logical.OR = "||"; * - OpenLayers.Rule.Logical.NOT = "!"; */ type: null, /** * Constructor: OpenLayers.Rule.Logical * Creates a logical rule (And, Or, Not). * * Parameters: * options - {Object} An optional object with properties to set on the * rule * * Returns: * {} */ initialize: function(options) { this.children = []; OpenLayers.Rule.prototype.initialize.apply(this, [options]); }, /** * APIMethod: destroy * nullify references to prevent circular references and memory leaks */ destroy: function() { for (var i=0; i} feature to apply the rule to. * * Returns: * {boolean} true if the rule applies, false if it does not */ evaluate: function(feature) { switch(this.type) { case OpenLayers.Rule.Logical.AND: for (var i=0; i