* Style and Rule now have separate context properties

* new convenience method addUniqueValueRules in OL.!StyleMap. This can actually be used to achieve what I was trying to show in the example of this ticket's description.
 * some refactoring of OL.Style to remove duplicate code (with tests)
 * a new example showing how to add a "unique value" legend to a point layer using the new addUniqueValueRules method
 * Rule.symbolizer can now also be just a symbolizer, instead of a hash of symbolizers keyed by "Point", "Line", "Polygon". This will make things even simpler (as can be seen in the styles-unique.html example)

r=tschaub (closes #1373)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6396 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2008-02-28 17:57:37 +00:00
parent d3294e73fd
commit 2f0382e6f6
6 changed files with 187 additions and 35 deletions
+5 -5
View File
@@ -22,9 +22,9 @@ OpenLayers.Rule = OpenLayers.Class({
/**
* Property: context
* {Object} An optional object with properties that the rule and its
* symbolizers' property values should be evaluatad against. If no
* context is specified, feature.attributes will be used
* {Object} An optional object with properties that the rule should be
* evaluatad against. If no context is specified, feature.attributes will
* be used.
*/
context: null,
@@ -40,8 +40,8 @@ OpenLayers.Rule = OpenLayers.Class({
/**
* Property: symbolizer
* {Object} Hash of styles for this rule. Contains hashes of feature
* styles. Keys are one or more of ["Point", "Line", "Polygon"]
* {Object} Symbolizer or hash of symbolizers for this rule. If hash of
* symbolizers, keys are one or more of ["Point", "Line", "Polygon"]
*/
symbolizer: null,