From 3b208864bcb66f9ae6732618de2b38c23804f865 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 24 Sep 2018 10:06:23 +0200 Subject: [PATCH 1/3] Remove unused properties from Cluster options Follow up on #8692 --- src/ol/source/Cluster.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ol/source/Cluster.js b/src/ol/source/Cluster.js index 33d864343d..34294f6b90 100644 --- a/src/ol/source/Cluster.js +++ b/src/ol/source/Cluster.js @@ -16,7 +16,6 @@ import VectorSource from '../source/Vector.js'; * @typedef {Object} Options * @property {import("./Source.js").AttributionLike} [attributions] Attributions. * @property {number} [distance=20] Minimum distance in pixels between clusters. - * @property {import("../extent.js").Extent} [extent] Extent. * @property {function(import("../Feature.js").default):import("../geom/Point.js").default} [geometryFunction] * Function that takes an {@link module:ol/Feature} as argument and returns an * {@link module:ol/geom/Point} as cluster calculation point for the feature. When a @@ -30,7 +29,6 @@ import VectorSource from '../source/Vector.js'; * ``` * See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster * calculation point for polygons. - * @property {import("../proj.js").ProjectionLike} projection Projection. * @property {import("./Vector.js").default} source Source. * @property {boolean} [wrapX=true] Whether to wrap the world horizontally. */ @@ -45,7 +43,7 @@ import VectorSource from '../source/Vector.js'; */ class Cluster extends VectorSource { /** - * @param {Options=} options Cluster options. + * @param {Options} options Cluster options. */ constructor(options) { super({ From 557e2c9029261dbe992d65ad2106aadba75da289 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 24 Sep 2018 10:11:01 +0200 Subject: [PATCH 2/3] Remove extra imports in jsdoc The symbols are already imported (es6 import) --- src/ol/source/Cluster.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ol/source/Cluster.js b/src/ol/source/Cluster.js index 34294f6b90..3754df9f36 100644 --- a/src/ol/source/Cluster.js +++ b/src/ol/source/Cluster.js @@ -16,7 +16,7 @@ import VectorSource from '../source/Vector.js'; * @typedef {Object} Options * @property {import("./Source.js").AttributionLike} [attributions] Attributions. * @property {number} [distance=20] Minimum distance in pixels between clusters. - * @property {function(import("../Feature.js").default):import("../geom/Point.js").default} [geometryFunction] + * @property {function(Feature):Point} [geometryFunction] * Function that takes an {@link module:ol/Feature} as argument and returns an * {@link module:ol/geom/Point} as cluster calculation point for the feature. When a * feature should not be considered for clustering, the function should return @@ -29,7 +29,7 @@ import VectorSource from '../source/Vector.js'; * ``` * See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster * calculation point for polygons. - * @property {import("./Vector.js").default} source Source. + * @property {VectorSource} source Source. * @property {boolean} [wrapX=true] Whether to wrap the world horizontally. */ @@ -64,25 +64,25 @@ class Cluster extends VectorSource { this.distance = options.distance !== undefined ? options.distance : 20; /** - * @type {Array} + * @type {Array} * @protected */ this.features = []; /** - * @param {import("../Feature.js").default} feature Feature. - * @return {import("../geom/Point.js").default} Cluster calculation point. + * @param {Feature} feature Feature. + * @return {Point} Cluster calculation point. * @protected */ this.geometryFunction = options.geometryFunction || function(feature) { - const geometry = /** @type {import("../geom/Point.js").default} */ (feature.getGeometry()); + const geometry = /** @type {Point} */ (feature.getGeometry()); assert(geometry instanceof Point, - 10); // The default `geometryFunction` can only handle `import("../geom/Point.js").Point` geometries + 10); // The default `geometryFunction` can only handle `Point` geometries return geometry; }; /** - * @type {import("./Vector.js").default} + * @type {VectorSource} * @protected */ this.source = options.source; @@ -101,7 +101,7 @@ class Cluster extends VectorSource { /** * Get a reference to the wrapped source. - * @return {import("./Vector.js").default} Source. + * @return {VectorSource} Source. * @api */ getSource() { @@ -185,8 +185,8 @@ class Cluster extends VectorSource { } /** - * @param {Array} features Features - * @return {import("../Feature.js").default} The cluster feature. + * @param {Array} features Features + * @return {Feature} The cluster feature. * @protected */ createCluster(features) { From 7d1b90c7d24ee8e87ece1966272d1226a07381a3 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 24 Sep 2018 10:14:33 +0200 Subject: [PATCH 3/3] Remove unused extent property from ol/source/Image options --- src/ol/source/Image.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ol/source/Image.js b/src/ol/source/Image.js index 669378e96a..e8a643ddc0 100644 --- a/src/ol/source/Image.js +++ b/src/ol/source/Image.js @@ -70,7 +70,6 @@ class ImageSourceEvent extends Event { /** * @typedef {Object} Options * @property {import("./Source.js").AttributionLike} [attributions] - * @property {import("../extent.js").Extent} [extent] * @property {import("../proj.js").ProjectionLike} projection * @property {Array} [resolutions] * @property {import("./State.js").default} [state]