Add ol.style.Style constructor

This commit is contained in:
Éric Lemoine
2013-11-20 14:40:52 +01:00
parent 4e61f045e1
commit 1cfd185355

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

@@ -0,0 +1,58 @@
// FIXME export ol.style.Style
goog.provide('ol.style.Style');
goog.provide('ol.style.StyleFunction');
goog.require('ol.style.Fill');
goog.require('ol.style.Image');
/**
* @typedef {{fill: (ol.style.Fill|undefined),
* image: (ol.style.Image|undefined),
* stroke: (ol.style.Stroke|undefined),
* text: (ol.style.Text|undefined),
* zIndex: (number|undefined)}}
*/
ol.style.StyleOptions;
/**
* @constructor
* @param {ol.style.StyleOptions} options Options.
*/
ol.style.Style = function(options) {
/**
* @type {ol.style.Fill}
*/
this.fill = goog.isDef(options.fill) ? options.fill : null;
/**
* @type {ol.style.Image}
*/
this.image = goog.isDef(options.image) ? options.image : null;
/**
* @type {ol.style.Stroke}
*/
this.stroke = goog.isDef(options.stroke) ? options.stroke : null;
/**
* @type {ol.style.Text}
*/
this.text = goog.isDef(options.text) ? options.text : null;
/**
* @type {number|undefined}
*/
this.zIndex = options.zIndex;
};
/**
* @typedef {function(ol.Feature): ol.style.Style}
*/
ol.style.StyleFunction;