From 5bfa3ebcdab8dd929e24367f071a6849aabe55bb Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 27 Mar 2018 15:51:49 +0200 Subject: [PATCH] Move olx.style.StrokeOptions to src/ol/style/Stroke --- externs/olx.js | 76 ------------------------------------------ src/ol/style/Stroke.js | 19 ++++++++++- 2 files changed, 18 insertions(+), 77 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index 7543037d20..76a3852157 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -2952,82 +2952,6 @@ olx.style.RegularShapeOptions.prototype.rotateWithView; olx.style.RegularShapeOptions.prototype.atlasManager; -/** - * @typedef {{color: (ol.Color|ol.ColorLike|undefined), - * lineCap: (string|undefined), - * lineJoin: (string|undefined), - * lineDash: (Array.|undefined), - * lineDashOffset: (number|undefined), - * miterLimit: (number|undefined), - * width: (number|undefined)}} - */ -olx.style.StrokeOptions; - - -/** - * A color, gradient or pattern. See {@link ol.color} - * and {@link ol.colorlike} for possible formats. Default null; - * if null, the Canvas/renderer default black will be used. - * @type {ol.Color|ol.ColorLike|undefined} - * @api - */ -olx.style.StrokeOptions.prototype.color; - - -/** - * Line cap style: `butt`, `round`, or `square`. Default is `round`. - * @type {string|undefined} - * @api - */ -olx.style.StrokeOptions.prototype.lineCap; - - -/** - * Line join style: `bevel`, `round`, or `miter`. Default is `round`. - * @type {string|undefined} - * @api - */ -olx.style.StrokeOptions.prototype.lineJoin; - - -/** - * Line dash pattern. Default is `undefined` (no dash). Please note that - * Internet Explorer 10 and lower [do not support][mdn] the `setLineDash` - * method on the `CanvasRenderingContext2D` and therefore this option will - * have no visual effect in these browsers. - * - * [mdn]: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility - * - * @type {Array.|undefined} - * @api - */ -olx.style.StrokeOptions.prototype.lineDash; - - -/** - * Line dash offset. Default is '0'. - * @type {number|undefined} - * @api - */ -olx.style.StrokeOptions.prototype.lineDashOffset; - - -/** - * Miter limit. Default is `10`. - * @type {number|undefined} - * @api - */ -olx.style.StrokeOptions.prototype.miterLimit; - - -/** - * Width. - * @type {number|undefined} - * @api - */ -olx.style.StrokeOptions.prototype.width; - - /** * @typedef {{font: (string|undefined), * maxAngle: (number|undefined), diff --git a/src/ol/style/Stroke.js b/src/ol/style/Stroke.js index 78b9818890..4857e879f0 100644 --- a/src/ol/style/Stroke.js +++ b/src/ol/style/Stroke.js @@ -3,6 +3,23 @@ */ import {getUid} from '../index.js'; + +/** + * @typedef {Object} Options + * @property {module:ol/color~Color|module:ol/colorlike~ColorLike} [color] A color, gradient or pattern. + * See {@link module:ol/color~Color} and {@link module:ol/colorlike~ColorLike} for possible formats. + * Default null; if null, the Canvas/renderer default black will be used. + * @property {string} [lineCap='round'] Line cap style: `butt`, `round`, or `square`. + * @property {string} [lineJoin='round'] Line join style: `bevel`, `round`, or `miter`. + * @property {Array.} [lineDash] Line dash pattern. Default is `undefined` (no dash). + * Please note that Internet Explorer 10 and lower do not support the `setLineDash` method on + * the `CanvasRenderingContext2D` and therefore this option will have no visual effect in these browsers. + * @property {number} [lineDashOffset=0] Line dash offset. + * @property {number} [miterLimit=10] Miter limit. + * @property {number} [width] Width. + */ + + /** * @classdesc * Set stroke style for vector features. @@ -11,7 +28,7 @@ import {getUid} from '../index.js'; * the options; they will not return the default. * * @constructor - * @param {olx.style.StrokeOptions=} opt_options Options. + * @param {module:ol/style/Stroke~Options=} opt_options Options. * @api */ const Stroke = function(opt_options) {