Move ol.RegularShapeRenderOptions to ol/style/RegularShape

This commit is contained in:
Michael Kuenzli
2018-04-18 16:53:46 +02:00
committed by Frederic Junod
parent 873c627cda
commit 76572b6ccf
2 changed files with 16 additions and 18 deletions

View File

@@ -33,6 +33,18 @@ import ImageStyle from '../style/Image.js';
*/
/**
* @typedef {Object} RenderOptions
* @property {module:ol/colorlike~ColorLike} [strokeStyle]
* @property {number} strokeWidth
* @property {number} size
* @property {string} lineCap
* @property {Array.<number>} lineDash
* @property {string} lineJoin
* @property {number} miterLimit
*/
/**
* @classdesc
* Set regular shape style for vector features. The resulting shape will be
@@ -378,7 +390,7 @@ RegularShape.prototype.render_ = function(atlasManager) {
let size = 2 * (this.radius_ + strokeWidth) + 1;
/** @type {ol.RegularShapeRenderOptions} */
/** @type {module:ol/style/RegularShape~RenderOptions} */
const renderOptions = {
strokeStyle: strokeStyle,
strokeWidth: strokeWidth,
@@ -441,7 +453,7 @@ RegularShape.prototype.render_ = function(atlasManager) {
/**
* @private
* @param {ol.RegularShapeRenderOptions} renderOptions Render options.
* @param {module:ol/style/RegularShape~RenderOptions} renderOptions Render options.
* @param {CanvasRenderingContext2D} context The rendering context.
* @param {number} x The origin for the symbol (x).
* @param {number} y The origin for the symbol (y).
@@ -502,7 +514,7 @@ RegularShape.prototype.draw_ = function(renderOptions, context, x, y) {
/**
* @private
* @param {ol.RegularShapeRenderOptions} renderOptions Render options.
* @param {module:ol/style/RegularShape~RenderOptions} renderOptions Render options.
*/
RegularShape.prototype.createHitDetectionCanvas_ = function(renderOptions) {
this.hitDetectionImageSize_ = [renderOptions.size, renderOptions.size];
@@ -522,7 +534,7 @@ RegularShape.prototype.createHitDetectionCanvas_ = function(renderOptions) {
/**
* @private
* @param {ol.RegularShapeRenderOptions} renderOptions Render options.
* @param {module:ol/style/RegularShape~RenderOptions} renderOptions Render options.
* @param {CanvasRenderingContext2D} context The context.
* @param {number} x The origin for the symbol (x).
* @param {number} y The origin for the symbol (y).

View File

@@ -150,20 +150,6 @@ ol.LoadingStrategy;
ol.RasterOperation;
/**
* @typedef {{
* strokeStyle: (module:ol/colorlike~ColorLike|undefined),
* strokeWidth: number,
* size: number,
* lineCap: string,
* lineDash: Array.<number>,
* lineJoin: string,
* miterLimit: number
* }}
*/
ol.RegularShapeRenderOptions;
/**
* Number of features; bounds/extent.
* @typedef {{numberOfFeatures: number,