From de90b91401c15bd47007744858d3595ffb4c972b Mon Sep 17 00:00:00 2001 From: Michael Kuenzli Date: Tue, 17 Apr 2018 16:06:55 +0200 Subject: [PATCH] Move olx.style.CircleOptions to ol/style/Circle --- externs/olx.js | 58 ------------------------------------------ src/ol/style/Circle.js | 18 ++++++++++++- 2 files changed, 17 insertions(+), 59 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index 29caa4202a..ce96743b26 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -49,64 +49,6 @@ olx.render.State.prototype.resolution; olx.render.State.prototype.rotation; -/** - * @typedef {{fill: (module:ol/style/Fill~Fill|undefined), - * radius: number, - * snapToPixel: (boolean|undefined), - * stroke: (module:ol/style/Stroke~Stroke|undefined), - * atlasManager: (module:ol/style/AtlasManager~AtlasManager|undefined)}} - */ -olx.style.CircleOptions; - - -/** - * Fill style. - * @type {module:ol/style/Fill~Fill|undefined} - * @api - */ -olx.style.CircleOptions.prototype.fill; - - -/** - * Circle radius. - * @type {number} - * @api - */ -olx.style.CircleOptions.prototype.radius; - - -/** - * If `true` integral numbers of pixels are used as the X and Y pixel - * coordinate when drawing the circle in the output canvas. If `false` - * fractional numbers may be used. Using `true` allows for "sharp" - * rendering (no blur), while using `false` allows for "accurate" - * rendering. Note that accuracy is important if the circle's - * position is animated. Without it, the circle may jitter noticeably. - * Default value is `true`. - * @type {boolean|undefined} - * @api - */ -olx.style.CircleOptions.prototype.snapToPixel; - - -/** - * Stroke style. - * @type {module:ol/style/Stroke~Stroke|undefined} - * @api - */ -olx.style.CircleOptions.prototype.stroke; - - -/** - * The atlas manager to use for this circle. When using WebGL it is - * recommended to use an atlas manager to avoid texture switching. - * If an atlas manager is given, the circle is added to an atlas. - * By default no atlas manager is used. - * @type {module:ol/style/AtlasManager~AtlasManager|undefined} - */ -olx.style.CircleOptions.prototype.atlasManager; - - /** * @typedef {{anchor: (Array.|undefined), * anchorOrigin: (module:ol/style/IconOrigin~IconOrigin|undefined), diff --git a/src/ol/style/Circle.js b/src/ol/style/Circle.js index 165d2dabd2..580a65f0be 100644 --- a/src/ol/style/Circle.js +++ b/src/ol/style/Circle.js @@ -4,12 +4,28 @@ import {inherits} from '../index.js'; import RegularShape from '../style/RegularShape.js'; + +/** + * @typedef {Object} Options + * @property {module:ol/style/Fill~Fill} [fill] Fill style. + * @property {number} radius Circle radius. + * @property {boolean} [snapToPixel=true] If `true` integral numbers of pixels are used as the X and Y pixel coordinate + * when drawing the circle in the output canvas. If `false` fractional numbers may be used. Using `true` allows for + * "sharp" rendering (no blur), while using `false` allows for "accurate" rendering. Note that accuracy is important if + * the circle's position is animated. Without it, the circle may jitter noticeably. + * @property {module:ol/style/Stroke~Stroke} [stroke] Stroke style. + * @property {module:ol/style/AtlasManager~AtlasManager} [atlasManager] The atlas manager to use for this circle. + * When using WebGL it is recommended to use an atlas manager to avoid texture switching. If an atlas manager is given, + * the circle is added to an atlas. By default no atlas manager is used. + */ + + /** * @classdesc * Set circle style for vector features. * * @constructor - * @param {olx.style.CircleOptions=} opt_options Options. + * @param {module:ol/style/Circle~Options=} opt_options Options. * @extends {module:ol/style/RegularShape~RegularShape} * @api */