Packagenet.systemeD.halcyon.styleparser
Classpublic class Rule

A MapCSS selector. Contains a list of Conditions; the entity type to which the selector applies; and the zoom levels at which it is true. way[waterway=river][boat=yes] would be parsed into one Rule.

The selectors and declaration together form a StyleChooser.

See also

net.systemeD.halcyon.styleparser.Condition
net.systemeD.halcyon.styleparser.StyleChooser


Public Properties
 PropertyDefined by
  conditions : Array
The Conditions to be evaluated for the Rule to be fulfilled.
Rule
  isAnd : Boolean = true
Do all Conditions need to be true for the Rule to be fulfilled? (Always =true for MapCSS.)
Rule
  maxZoom : uint = 255
Maximum zoom level at which the Rule is fulfilled.
Rule
  minZoom : uint = 0
Minimum zoom level at which the Rule is fulfilled.
Rule
  subject : String = ""
Entity type to which the Rule applies.
Rule
Public Methods
 MethodDefined by
  
Rule(subject:String = "")
Rule
  
test(entity:Entity, tags:Object, zoom:uint):Boolean
Evaluate the Rule on the given entity, tags and zoom level.
Rule
  
toString():String
Rule
Property detail
conditionsproperty
public var conditions:Array

The Conditions to be evaluated for the Rule to be fulfilled.

isAndproperty 
public var isAnd:Boolean = true

Do all Conditions need to be true for the Rule to be fulfilled? (Always =true for MapCSS.)

maxZoomproperty 
public var maxZoom:uint = 255

Maximum zoom level at which the Rule is fulfilled.

minZoomproperty 
public var minZoom:uint = 0

Minimum zoom level at which the Rule is fulfilled.

subjectproperty 
public var subject:String = ""

Entity type to which the Rule applies. Can be 'way', 'node', 'relation', 'area' (closed way) or 'line' (unclosed way).

Constructor detail
Rule()constructor
public function Rule(subject:String = "")Parameters
subject:String (default = "")
Method detail
test()method
public function test(entity:Entity, tags:Object, zoom:uint):Boolean

Evaluate the Rule on the given entity, tags and zoom level.

Parameters
entity:Entity
 
tags:Object
 
zoom:uint

Returns
Boolean — True if the Rule passes, false if the conditions aren't fulfilled.
toString()method 
public function toString():String

Returns
String