Rule is filter and symbolizer, style is collection of rules
This commit is contained in:
34
src/ol/style/rule.js
Normal file
34
src/ol/style/rule.js
Normal 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
25
src/ol/style/style.js
Normal 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 : [];
|
||||
|
||||
};
|
||||
@@ -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) {};
|
||||
|
||||
Reference in New Issue
Block a user