Rule is filter and symbolizer, style is collection of rules

This commit is contained in:
Tim Schaub
2013-02-19 21:37:40 -07:00
parent 184e1e782c
commit 360e37146c
3 changed files with 76 additions and 0 deletions

34
src/ol/style/rule.js Normal file
View File

@@ -0,0 +1,34 @@
goog.provide('ol.style.Rule');
goog.require('ol.filter.Filter');
goog.require('ol.style.Symbolizer');
/**
* @typedef {{filter: (ol.filter.Filter),
* symbolizers: (Array.<ol.style.Symbolizer>)}}
*/
ol.style.RuleOptions;
/**
* @constructor
* @param {ol.style.RuleOptions} options Rule options.
*/
ol.style.Rule = function(options) {
/**
* @type {ol.filter.Filter}
* @private
*/
this.filter_ = goog.isDef(options.filter) ? options.filter : null;
/**
* @type {Array.<ol.style.Symbolizer>}
* @private
*/
this.symbolizers_ = goog.isDef(options.symbolizers) ?
options.symbolizers : [];
};

25
src/ol/style/style.js Normal file
View File

@@ -0,0 +1,25 @@
goog.provide('ol.style.Style');
goog.require('ol.style.Rule');
/**
* @typedef {{rules: (Array.<ol.style.Rule>)}}
*/
ol.style.StyleOptions;
/**
* @constructor
* @param {ol.style.StyleOptions} options Style options.
*/
ol.style.Style = function(options) {
/**
* @type {Array.<ol.style.Rule>}
* @private
*/
this.rules_ = goog.isDef(options.rules) ? options.rules : [];
};

View File

@@ -1,4 +1,7 @@
goog.provide('ol.style.LiteralSymbolizer');
goog.provide('ol.style.Symbolizer');
goog.require('ol.Feature');
@@ -6,3 +9,17 @@ goog.provide('ol.style.LiteralSymbolizer');
* @interface
*/
ol.style.LiteralSymbolizer = function() {};
/**
* @interface
*/
ol.style.Symbolizer = function() {};
/**
* @param {ol.Feature} feature Feature for evaluating expressions.
* @return {ol.style.LiteralSymbolizer} Literal symbolizer.
*/
ol.style.Symbolizer.prototype.createLiteral = function(feature) {};