From 663d2bb1bb613411ac15f0a192813c1c0acd9191 Mon Sep 17 00:00:00 2001 From: Michael Kuenzli Date: Tue, 17 Apr 2018 17:04:55 +0200 Subject: [PATCH] Move olx.style.StyleOptions to ol/style/Style --- externs/olx.js | 71 ------------------------------------------- src/ol/style/Style.js | 17 ++++++++++- 2 files changed, 16 insertions(+), 72 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index 38141a24f8..02fb198a93 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -49,77 +49,6 @@ olx.render.State.prototype.resolution; olx.render.State.prototype.rotation; -/** - * @typedef {{geometry: (undefined|string|module:ol/geom/Geometry~Geometry|ol.StyleGeometryFunction), - * fill: (module:ol/style/Fill~Fill|undefined), - * image: (module:ol/style/Image~ImageStyle|undefined), - * renderer: (ol.StyleRenderFunction|undefined), - * stroke: (module:ol/style/Stroke~Stroke|undefined), - * text: (module:ol/style/Text~Text|undefined), - * zIndex: (number|undefined)}} - */ -olx.style.StyleOptions; - - -/** - * Feature property or geometry or function returning a geometry to render for - * this style. - * @type {undefined|string|module:ol/geom/Geometry~Geometry|ol.StyleGeometryFunction} - * @api - */ -olx.style.StyleOptions.prototype.geometry; - - -/** - * Fill style. - * @type {module:ol/style/Fill~Fill|undefined} - * @api - */ -olx.style.StyleOptions.prototype.fill; - - -/** - * Image style. - * @type {module:ol/style/Image~ImageStyle|undefined} - * @api - */ -olx.style.StyleOptions.prototype.image; - - -/** - * Custom renderer. When configured, `fill`, `stroke` and `image` will be - * ignored, and the provided function will be called with each render frame for - * each geometry. - * - * @type {ol.StyleRenderFunction|undefined} - */ -olx.style.StyleOptions.prototype.renderer; - - -/** - * Stroke style. - * @type {module:ol/style/Stroke~Stroke|undefined} - * @api - */ -olx.style.StyleOptions.prototype.stroke; - - -/** - * Text style. - * @type {module:ol/style/Text~Text|undefined} - * @api - */ -olx.style.StyleOptions.prototype.text; - - -/** - * Z index. - * @type {number|undefined} - * @api - */ -olx.style.StyleOptions.prototype.zIndex; - - /** * @typedef {{extent: (ol.Extent|undefined), * minZoom: (number|undefined), diff --git a/src/ol/style/Style.js b/src/ol/style/Style.js index e5753eac70..3a082c78f7 100644 --- a/src/ol/style/Style.js +++ b/src/ol/style/Style.js @@ -7,6 +7,21 @@ import CircleStyle from '../style/Circle.js'; import Fill from '../style/Fill.js'; import Stroke from '../style/Stroke.js'; + +/** + * @typedef {Object} Options + * @property {string|module:ol/geom/Geometry~Geometry|ol.StyleGeometryFunction} [geometry] Feature property or geometry + * or function returning a geometry to render for this style. + * @property {module:ol/style/Fill~Fill} [fill] Fill style. + * @property {module:ol/style/Image~ImageStyle} [image] Image style. + * @property {ol.StyleRenderFunction} [renderer] Custom renderer. When configured, `fill`, `stroke` and `image` will be + * ignored, and the provided function will be called with each render frame for each geometry. + * @property {module:ol/style/Stroke~Stroke} [stroke] Stroke style. + * @property {module:ol/style/Text~Text} [text] Text style. + * @property {number} [zIndex] Z index. + */ + + /** * @classdesc * Container for vector feature rendering styles. Any changes made to the style @@ -15,7 +30,7 @@ import Stroke from '../style/Stroke.js'; * * @constructor * @struct - * @param {olx.style.StyleOptions=} opt_options Style options. + * @param {module:ol/style/Style~Options=} opt_options Style options. * @api */ const Style = function(opt_options) {