ol 9.2.1-dev.1715808081797 → 9.2.1-dev.1715879366731

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  export default BaseVectorLayer;
2
- export type Options<VectorSourceType extends import("../source/VectorTile.js").default<import("../Feature").FeatureLike> | import("../source/Vector.js").default<import("../Feature").FeatureLike>> = {
2
+ export type Options<VectorSourceType extends import("../source/Vector.js").default<import("../Feature").FeatureLike> | import("../source/VectorTile.js").default<import("../Feature").FeatureLike>> = {
3
3
  /**
4
4
  * A CSS class name to set to the layer element.
5
5
  */
@@ -117,7 +117,7 @@ export type Options<VectorSourceType extends import("../source/VectorTile.js").d
117
117
  * @extends {Layer<VectorSourceType, RendererType>}
118
118
  * @api
119
119
  */
120
- declare class BaseVectorLayer<VectorSourceType extends import("../source/VectorTile.js").default<import("../Feature").FeatureLike> | import("../source/Vector.js").default<import("../Feature").FeatureLike>, RendererType extends import("../renderer/canvas/VectorLayer.js").default | import("../renderer/canvas/VectorTileLayer.js").default | import("../renderer/canvas/VectorImageLayer.js").default | import("../renderer/webgl/PointsLayer.js").default> extends Layer<VectorSourceType, RendererType> {
120
+ declare class BaseVectorLayer<VectorSourceType extends import("../source/Vector.js").default<import("../Feature").FeatureLike> | import("../source/VectorTile.js").default<import("../Feature").FeatureLike>, RendererType extends import("../renderer/canvas/VectorLayer.js").default | import("../renderer/canvas/VectorTileLayer.js").default | import("../renderer/canvas/VectorImageLayer.js").default | import("../renderer/webgl/PointsLayer.js").default> extends Layer<VectorSourceType, RendererType> {
121
121
  /**
122
122
  * @param {Options<VectorSourceType>} [options] Options.
123
123
  */
@@ -274,10 +274,10 @@ export type Options = {
274
274
  * Note that the view projection must define both extent and worldExtent.
275
275
  *
276
276
  * @fires import("../render/Event.js").RenderEvent
277
- * @extends {VectorLayer<import("../source/Vector.js").default>}
277
+ * @extends {VectorLayer<Feature>}
278
278
  * @api
279
279
  */
280
- declare class Graticule extends VectorLayer<VectorSource<Feature<import("../geom.js").Geometry>>> {
280
+ declare class Graticule extends VectorLayer<Feature<import("../geom.js").Geometry>> {
281
281
  /**
282
282
  * @param {Options} [options] Options.
283
283
  */
@@ -587,7 +587,6 @@ import Point from '../geom/Point.js';
587
587
  import Stroke from '../style/Stroke.js';
588
588
  import Text from '../style/Text.js';
589
589
  import Feature from '../Feature.js';
590
- import VectorSource from '../source/Vector.js';
591
590
  import VectorLayer from './Vector.js';
592
591
  import LineString from '../geom/LineString.js';
593
592
  //# sourceMappingURL=Graticule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Graticule.d.ts","sourceRoot":"","sources":["Graticule.js"],"names":[],"mappings":";;;;;UA2Ec,KAAK;;;;UACL,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAuCG,MAAM,KAAE,MAAM;;;;;;;gCAId,MAAM,KAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA9CrC;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AAEH;;;;;;;;GAQG;AACH;IACE;;OAEG;IACH,2CAsUC;IA7SC;;OAEG;IACH,aAFU,OAAO,uBAAuB,EAAE,OAAO,CAE1B;IAEvB;;;OAGG;IACH,gBAAuB;IAEvB;;;OAGG;IACH,gBAAuB;IAEvB;;;OAGG;IACH,gBAAwB;IAExB;;;OAGG;IACH,gBAAwB;IAExB;;;OAGG;IACH,cAAqB;IAErB;;;OAGG;IACH,cAAqB;IAErB;;;OAGG;IACH,cAAsB;IAEtB;;;OAGG;IACH,cAAsB;IAEtB;;;OAGG;IACH,oBAC6D;IAE7D;;;OAGG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,CAK5B;IAED;;;OAGG;IACH,8BA0EC;CACF;kBA/tCiB,kBAAkB;mBACjB,oBAAoB;iBAEtB,kBAAkB;oBANf,eAAe;wBAOX,aAAa;uBALd,uBAAuB"}
@@ -178,7 +178,7 @@ const INTERVALS = [
178
178
  * Note that the view projection must define both extent and worldExtent.
179
179
  *
180
180
  * @fires import("../render/Event.js").RenderEvent
181
- * @extends {VectorLayer<import("../source/Vector.js").default>}
181
+ * @extends {VectorLayer<Feature>}
182
182
  * @api
183
183
  */
184
184
  class Graticule extends VectorLayer {
@@ -1,5 +1,5 @@
1
1
  export default Heatmap;
2
- export type Options = {
2
+ export type Options<FeatureType extends import("../Feature.js").FeatureLike> = {
3
3
  /**
4
4
  * A CSS class name to set to the layer element.
5
5
  */
@@ -66,7 +66,7 @@ export type Options = {
66
66
  /**
67
67
  * Point source.
68
68
  */
69
- source?: import("../source/Vector.js").default<import("../Feature.js").default<import("../geom.js").Geometry>> | undefined;
69
+ source?: import("../source/Vector.js").default<FeatureType> | undefined;
70
70
  /**
71
71
  * Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.
72
72
  */
@@ -82,14 +82,15 @@ export type Options = {
82
82
  * options means that `title` is observable, and has get/set accessors.
83
83
  *
84
84
  * @fires import("../render/Event.js").RenderEvent
85
- * @extends {BaseVector<import("../source/Vector.js").default, WebGLPointsLayerRenderer>}
85
+ * @template {import("../Feature.js").FeatureLike} FeatureType
86
+ * @extends {BaseVector<import("../source/Vector.js").default<FeatureType>, WebGLPointsLayerRenderer>}
86
87
  * @api
87
88
  */
88
- declare class Heatmap extends BaseVector<import("../source/Vector.js").default<import("../Feature.js").default<import("../geom.js").Geometry>>, WebGLPointsLayerRenderer> {
89
+ declare class Heatmap<FeatureType extends import("../Feature.js").FeatureLike> extends BaseVector<import("../source/Vector.js").default<FeatureType>, WebGLPointsLayerRenderer> {
89
90
  /**
90
- * @param {Options} [options] Options.
91
+ * @param {Options<FeatureType>} [options] Options.
91
92
  */
92
- constructor(options?: Options | undefined);
93
+ constructor(options?: Options<FeatureType> | undefined);
93
94
  /**
94
95
  * @private
95
96
  * @type {HTMLCanvasElement}
@@ -1 +1 @@
1
- {"version":3,"file":"Heatmap.d.ts","sourceRoot":"","sources":["Heatmap.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAgC8B,OAAO,eAAe,EAAE,OAAO,KAAE,MAAM;;;;;;;;;;;;AAuBrE;;;;;;;;;;GAUG;AACH;IACE;;OAEG;IACH,2CAqCC;IA1BC;;;OAGG;IACH,kBAAqB;IAYnB,uCAEC;IAUL;;;;;OAKG;IACH,WAJY,MAAM,CAMjB;IAED;;;;;OAKG;IACH,eAJY,MAAM,MAAM,CAAC,CAMxB;IAED;;;;;OAKG;IACH,aAJY,MAAM,CAMjB;IAED;;OAEG;IACH,+BAEC;IAED;;;;;OAKG;IACH,cAJW,MAAM,QAMhB;IAED;;;;;OAKG;IACH,oBAJW,MAAM,MAAM,CAAC,QAMvB;IAED;;;;;OAKG;IACH,kBAJW,MAAM,QAMhB;IAED,sBA2DC;IAED,wBAAoB;CACrB;qCA1OoC,kCAAkC;uBADhD,iBAAiB"}
1
+ {"version":3,"file":"Heatmap.d.ts","sourceRoot":"","sources":["Heatmap.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAiC8B,OAAO,eAAe,EAAE,OAAO,KAAE,MAAM;;;;;;;;;;;;AAuBrE;;;;;;;;;;;GAWG;AACH;IACE;;OAEG;IACH,wDAqCC;IA1BC;;;OAGG;IACH,kBAAqB;IAYnB,uCAEC;IAUL;;;;;OAKG;IACH,WAJY,MAAM,CAMjB;IAED;;;;;OAKG;IACH,eAJY,MAAM,MAAM,CAAC,CAMxB;IAED;;;;;OAKG;IACH,aAJY,MAAM,CAMjB;IAED;;OAEG;IACH,+BAEC;IAED;;;;;OAKG;IACH,cAJW,MAAM,QAMhB;IAED;;;;;OAKG;IACH,oBAJW,MAAM,MAAM,CAAC,QAMvB;IAED;;;;;OAKG;IACH,kBAJW,MAAM,QAMhB;IAED,sBA2DC;IAED,wBAAoB;CACrB;qCA5OoC,kCAAkC;uBADhD,iBAAiB"}
package/layer/Heatmap.js CHANGED
@@ -8,6 +8,7 @@ import {clamp} from '../math.js';
8
8
  import {createCanvasContext2D} from '../dom.js';
9
9
 
10
10
  /**
11
+ * @template {import("../Feature.js").FeatureLike} FeatureType
11
12
  * @typedef {Object} Options
12
13
  * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.
13
14
  * @property {number} [opacity=1] Opacity (0, 1).
@@ -33,7 +34,7 @@ import {createCanvasContext2D} from '../dom.js';
33
34
  * @property {string|function(import("../Feature.js").default):number} [weight='weight'] The feature
34
35
  * attribute to use for the weight or a function that returns a weight from a feature. Weight values
35
36
  * should range from 0 to 1 (and values outside will be clamped to that range).
36
- * @property {import("../source/Vector.js").default} [source] Point source.
37
+ * @property {import("../source/Vector.js").default<FeatureType>} [source] Point source.
37
38
  * @property {Object<string, *>} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.
38
39
  */
39
40
 
@@ -61,12 +62,13 @@ const DEFAULT_GRADIENT = ['#00f', '#0ff', '#0f0', '#ff0', '#f00'];
61
62
  * options means that `title` is observable, and has get/set accessors.
62
63
  *
63
64
  * @fires import("../render/Event.js").RenderEvent
64
- * @extends {BaseVector<import("../source/Vector.js").default, WebGLPointsLayerRenderer>}
65
+ * @template {import("../Feature.js").FeatureLike} FeatureType
66
+ * @extends {BaseVector<import("../source/Vector.js").default<FeatureType>, WebGLPointsLayerRenderer>}
65
67
  * @api
66
68
  */
67
69
  class Heatmap extends BaseVector {
68
70
  /**
69
- * @param {Options} [options] Options.
71
+ * @param {Options<FeatureType>} [options] Options.
70
72
  */
71
73
  constructor(options) {
72
74
  options = options ? options : {};
package/layer/Vector.d.ts CHANGED
@@ -10,15 +10,15 @@ export default VectorLayer;
10
10
  * property on the layer object; for example, setting `title: 'My Title'` in the
11
11
  * options means that `title` is observable, and has get/set accessors.
12
12
  *
13
- * @template {import("../source/Vector.js").default<import('../Feature.js').FeatureLike>} VectorSourceType
14
- * @extends {BaseVectorLayer<VectorSourceType, CanvasVectorLayerRenderer>}
13
+ * @template {import('../Feature.js').FeatureLike} FeatureType
14
+ * @extends {BaseVectorLayer<import("../source/Vector.js").default<FeatureType>, CanvasVectorLayerRenderer>}
15
15
  * @api
16
16
  */
17
- declare class VectorLayer<VectorSourceType extends import("../source/Vector.js").default<import("../Feature.js").FeatureLike>> extends BaseVectorLayer<VectorSourceType, CanvasVectorLayerRenderer> {
17
+ declare class VectorLayer<FeatureType extends import("../Feature.js").FeatureLike> extends BaseVectorLayer<import("../source/Vector.js").default<FeatureType>, CanvasVectorLayerRenderer> {
18
18
  /**
19
- * @param {import("./BaseVector.js").Options<VectorSourceType>} [options] Options.
19
+ * @param {import("./BaseVector.js").Options<import("../source/Vector.js").default<FeatureType>>} [options] Options.
20
20
  */
21
- constructor(options?: import("./BaseVector.js").Options<VectorSourceType> | undefined);
21
+ constructor(options?: import("./BaseVector.js").Options<import("../source/Vector.js").default<FeatureType>> | undefined);
22
22
  }
23
23
  import CanvasVectorLayerRenderer from '../renderer/canvas/VectorLayer.js';
24
24
  import BaseVectorLayer from './BaseVector.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Vector.d.ts","sourceRoot":"","sources":["Vector.js"],"names":[],"mappings":";AAMA;;;;;;;;;;;;;;GAcG;AACH;IACE;;OAEG;IACH,uFAEC;CAKF;sCA5BqC,mCAAmC;4BAD7C,iBAAiB"}
1
+ {"version":3,"file":"Vector.d.ts","sourceRoot":"","sources":["Vector.js"],"names":[],"mappings":";AAMA;;;;;;;;;;;;;;GAcG;AACH;IACE;;OAEG;IACH,yHAEC;CAKF;sCA5BqC,mCAAmC;4BAD7C,iBAAiB"}
package/layer/Vector.js CHANGED
@@ -15,13 +15,13 @@ import CanvasVectorLayerRenderer from '../renderer/canvas/VectorLayer.js';
15
15
  * property on the layer object; for example, setting `title: 'My Title'` in the
16
16
  * options means that `title` is observable, and has get/set accessors.
17
17
  *
18
- * @template {import("../source/Vector.js").default<import('../Feature.js').FeatureLike>} VectorSourceType
19
- * @extends {BaseVectorLayer<VectorSourceType, CanvasVectorLayerRenderer>}
18
+ * @template {import('../Feature.js').FeatureLike} FeatureType
19
+ * @extends {BaseVectorLayer<import("../source/Vector.js").default<FeatureType>, CanvasVectorLayerRenderer>}
20
20
  * @api
21
21
  */
22
22
  class VectorLayer extends BaseVectorLayer {
23
23
  /**
24
- * @param {import("./BaseVector.js").Options<VectorSourceType>} [options] Options.
24
+ * @param {import("./BaseVector.js").Options<import("../source/Vector.js").default<FeatureType>>} [options] Options.
25
25
  */
26
26
  constructor(options) {
27
27
  super(options);
@@ -154,15 +154,15 @@ export type Options<VectorSourceType extends import("../source/Vector.js").defau
154
154
  * property on the layer object; for example, setting `title: 'My Title'` in the
155
155
  * options means that `title` is observable, and has get/set accessors.
156
156
  *
157
- * @template {import("../source/Vector.js").default} VectorSourceType
158
- * @extends {BaseVectorLayer<VectorSourceType, CanvasVectorImageLayerRenderer>}
157
+ * @template {import("../Feature.js").default} FeatureType
158
+ * @extends {BaseVectorLayer<import("../source/Vector.js").default<FeatureType>, CanvasVectorImageLayerRenderer>}
159
159
  * @api
160
160
  */
161
- declare class VectorImageLayer<VectorSourceType extends import("../source/Vector.js").default<import("../Feature.js").default<import("../geom.js").Geometry>>> extends BaseVectorLayer<VectorSourceType, CanvasVectorImageLayerRenderer> {
161
+ declare class VectorImageLayer<FeatureType extends import("../Feature.js").default<import("../geom.js").Geometry>> extends BaseVectorLayer<import("../source/Vector.js").default<FeatureType>, CanvasVectorImageLayerRenderer> {
162
162
  /**
163
- * @param {Options<VectorSourceType>} [options] Options.
163
+ * @param {Options<import("../source/Vector.js").default<FeatureType>>} [options] Options.
164
164
  */
165
- constructor(options?: Options<VectorSourceType> | undefined);
165
+ constructor(options?: Options<import("../source/Vector.js").default<FeatureType>> | undefined);
166
166
  /**
167
167
  * @type {number}
168
168
  * @private
@@ -1 +1 @@
1
- {"version":3,"file":"VectorImage.d.ts","sourceRoot":"","sources":["VectorImage.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH;;;;;;;;;;;;;;GAcG;AACH;IACE;;OAEG;IACH,6DAaC;IANC;;;OAGG;IACH,oBAC2D;IAG7D;;OAEG;IACH,iBAFY,MAAM,CAIjB;CAKF;2CA5F0C,wCAAwC;4BADvD,iBAAiB"}
1
+ {"version":3,"file":"VectorImage.d.ts","sourceRoot":"","sources":["VectorImage.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH;;;;;;;;;;;;;;GAcG;AACH;IACE;;OAEG;IACH,+FAaC;IANC;;;OAGG;IACH,oBAC2D;IAG7D;;OAEG;IACH,iBAFY,MAAM,CAIjB;CAKF;2CA5F0C,wCAAwC;4BADvD,iBAAiB"}
@@ -61,13 +61,13 @@ import CanvasVectorImageLayerRenderer from '../renderer/canvas/VectorImageLayer.
61
61
  * property on the layer object; for example, setting `title: 'My Title'` in the
62
62
  * options means that `title` is observable, and has get/set accessors.
63
63
  *
64
- * @template {import("../source/Vector.js").default} VectorSourceType
65
- * @extends {BaseVectorLayer<VectorSourceType, CanvasVectorImageLayerRenderer>}
64
+ * @template {import("../Feature.js").default} FeatureType
65
+ * @extends {BaseVectorLayer<import("../source/Vector.js").default<FeatureType>, CanvasVectorImageLayerRenderer>}
66
66
  * @api
67
67
  */
68
68
  class VectorImageLayer extends BaseVectorLayer {
69
69
  /**
70
- * @param {Options<VectorSourceType>} [options] Options.
70
+ * @param {Options<import("../source/Vector.js").default<FeatureType>>} [options] Options.
71
71
  */
72
72
  constructor(options) {
73
73
  options = options ? options : {};
@@ -87,11 +87,11 @@ export type Options = any;
87
87
  * options means that `title` is observable, and has get/set accessors.
88
88
  *
89
89
  * @param {Options} [options] Options.
90
- * @template {import("../source/VectorTile.js").default<import('../Feature').FeatureLike>} VectorTileSourceType
91
- * @extends {BaseVectorLayer<VectorTileSourceType, CanvasVectorTileLayerRenderer>}
90
+ * @template {import('../Feature').FeatureLike} FeatureType
91
+ * @extends {BaseVectorLayer<import("../source/VectorTile.js").default<FeatureType>, CanvasVectorTileLayerRenderer>}
92
92
  * @api
93
93
  */
94
- declare class VectorTileLayer<VectorTileSourceType extends import("../source/VectorTile.js").default<import("../Feature").FeatureLike>> extends BaseVectorLayer<VectorTileSourceType, CanvasVectorTileLayerRenderer> {
94
+ declare class VectorTileLayer<FeatureType extends import("../Feature").FeatureLike> extends BaseVectorLayer<import("../source/VectorTile.js").default<FeatureType>, CanvasVectorTileLayerRenderer> {
95
95
  /**
96
96
  * @param {Options} [options] Options.
97
97
  */
@@ -91,8 +91,8 @@ import {assert} from '../asserts.js';
91
91
  * options means that `title` is observable, and has get/set accessors.
92
92
  *
93
93
  * @param {Options} [options] Options.
94
- * @template {import("../source/VectorTile.js").default<import('../Feature').FeatureLike>} VectorTileSourceType
95
- * @extends {BaseVectorLayer<VectorTileSourceType, CanvasVectorTileLayerRenderer>}
94
+ * @template {import('../Feature').FeatureLike} FeatureType
95
+ * @extends {BaseVectorLayer<import("../source/VectorTile.js").default<FeatureType>, CanvasVectorTileLayerRenderer>}
96
96
  * @api
97
97
  */
98
98
  class VectorTileLayer extends BaseVectorLayer {
@@ -107,7 +107,7 @@ class VectorTileLayer extends BaseVectorLayer {
107
107
  delete baseOptions.useInterimTilesOnError;
108
108
 
109
109
  super(
110
- /** @type {import("./BaseVector.js").Options<VectorTileSourceType>} */ (
110
+ /** @type {import("./BaseVector.js").Options<import("../source/VectorTile.js").default<FeatureType>>} */ (
111
111
  baseOptions
112
112
  ),
113
113
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol",
3
- "version": "9.2.1-dev.1715808081797",
3
+ "version": "9.2.1-dev.1715879366731",
4
4
  "description": "OpenLayers mapping library",
5
5
  "keywords": [
6
6
  "map",
@@ -1,5 +1,5 @@
1
1
  export default Cluster;
2
- export type Options = {
2
+ export type Options<FeatureType extends import("../Feature.js").FeatureLike> = {
3
3
  /**
4
4
  * Attributions.
5
5
  */
@@ -31,7 +31,7 @@ export type Options = {
31
31
  * See {@link module :ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster
32
32
  * calculation point for polygons.
33
33
  */
34
- geometryFunction?: ((arg0: Feature) => Point) | undefined;
34
+ geometryFunction?: ((arg0: FeatureType) => (Point)) | undefined;
35
35
  /**
36
36
  * Function that takes the cluster's center {@link module :ol/geom/Point~Point} and an array
37
37
  * of {@link module :ol/Feature~Feature} included in this cluster. Must return a
@@ -45,17 +45,18 @@ export type Options = {
45
45
  * }
46
46
  * ```
47
47
  */
48
- createCluster?: ((arg0: Point, arg1: Array<Feature>) => Feature) | undefined;
48
+ createCluster?: ((arg0: Point, arg1: Array<FeatureType>) => Feature) | undefined;
49
49
  /**
50
50
  * Source.
51
51
  */
52
- source?: VectorSource<Feature<import("../geom.js").Geometry>> | undefined;
52
+ source?: VectorSource<FeatureType> | undefined;
53
53
  /**
54
54
  * Whether to wrap the world horizontally.
55
55
  */
56
56
  wrapX?: boolean | undefined;
57
57
  };
58
58
  /**
59
+ * @template {import("../Feature.js").FeatureLike} FeatureType
59
60
  * @typedef {Object} Options
60
61
  * @property {import("./Source.js").AttributionLike} [attributions] Attributions.
61
62
  * @property {number} [distance=20] Distance in pixels within which features will
@@ -65,7 +66,7 @@ export type Options = {
65
66
  * By default no minimum distance is guaranteed. This config can be used to avoid
66
67
  * overlapping icons. As a tradoff, the cluster feature's position will no longer be
67
68
  * the center of all its features.
68
- * @property {function(Feature):Point} [geometryFunction]
69
+ * @property {function(FeatureType):(Point)} [geometryFunction]
69
70
  * Function that takes an {@link module:ol/Feature~Feature} as argument and returns an
70
71
  * {@link module:ol/geom/Point~Point} as cluster calculation point for the feature. When a
71
72
  * feature should not be considered for clustering, the function should return
@@ -78,7 +79,7 @@ export type Options = {
78
79
  * ```
79
80
  * See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster
80
81
  * calculation point for polygons.
81
- * @property {function(Point, Array<Feature>):Feature} [createCluster]
82
+ * @property {function(Point, Array<FeatureType>):Feature} [createCluster]
82
83
  * Function that takes the cluster's center {@link module:ol/geom/Point~Point} and an array
83
84
  * of {@link module:ol/Feature~Feature} included in this cluster. Must return a
84
85
  * {@link module:ol/Feature~Feature} that will be used to render. Default implementation is:
@@ -90,7 +91,7 @@ export type Options = {
90
91
  * });
91
92
  * }
92
93
  * ```
93
- * @property {VectorSource} [source=null] Source.
94
+ * @property {VectorSource<FeatureType>} [source=null] Source.
94
95
  * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.
95
96
  */
96
97
  /**
@@ -103,12 +104,14 @@ export type Options = {
103
104
  * source `setSource(null)` has to be called to remove the listener reference
104
105
  * from the wrapped source.
105
106
  * @api
107
+ * @template {import('../Feature.js').FeatureLike} FeatureType
108
+ * @extends {VectorSource<Feature<import("../geom/Geometry.js").default>>}
106
109
  */
107
- declare class Cluster extends VectorSource<Feature<import("../geom.js").Geometry>> {
110
+ declare class Cluster<FeatureType extends import("../Feature.js").FeatureLike> extends VectorSource<Feature<import("../geom/Geometry.js").default>> {
108
111
  /**
109
- * @param {Options} options Cluster options.
112
+ * @param {Options<FeatureType>} options Cluster options.
110
113
  */
111
- constructor(options: Options);
114
+ constructor(options: Options<FeatureType>);
112
115
  /**
113
116
  * @type {number|undefined}
114
117
  * @protected
@@ -135,21 +138,21 @@ declare class Cluster extends VectorSource<Feature<import("../geom.js").Geometry
135
138
  */
136
139
  protected features: Array<Feature>;
137
140
  /**
138
- * @param {Feature} feature Feature.
141
+ * @param {FeatureType} feature Feature.
139
142
  * @return {Point} Cluster calculation point.
140
143
  * @protected
141
144
  */
142
- protected geometryFunction: (arg0: Feature) => Point;
145
+ protected geometryFunction: (arg0: FeatureType) => (Point);
143
146
  /**
144
- * @type {function(Point, Array<Feature>):Feature}
147
+ * @type {function(Point, Array<FeatureType>):Feature}
145
148
  * @private
146
149
  */
147
150
  private createCustomCluster_;
148
151
  /**
149
- * @type {VectorSource|null}
152
+ * @type {VectorSource<FeatureType>|null}
150
153
  * @protected
151
154
  */
152
- protected source: VectorSource | null;
155
+ protected source: VectorSource<FeatureType> | null;
153
156
  /**
154
157
  * @private
155
158
  */
@@ -162,10 +165,10 @@ declare class Cluster extends VectorSource<Feature<import("../geom.js").Geometry
162
165
  getDistance(): number;
163
166
  /**
164
167
  * Get a reference to the wrapped source.
165
- * @return {VectorSource|null} Source.
168
+ * @return {VectorSource<FeatureType>|null} Source.
166
169
  * @api
167
170
  */
168
- getSource(): VectorSource | null;
171
+ getSource(): VectorSource<FeatureType> | null;
169
172
  /**
170
173
  * Set the distance within which features will be clusterd together.
171
174
  * @param {number} distance The distance in pixels.
@@ -187,10 +190,10 @@ declare class Cluster extends VectorSource<Feature<import("../geom.js").Geometry
187
190
  getMinDistance(): number;
188
191
  /**
189
192
  * Replace the wrapped source.
190
- * @param {VectorSource|null} source The new source for this instance.
193
+ * @param {VectorSource<FeatureType>|null} source The new source for this instance.
191
194
  * @api
192
195
  */
193
- setSource(source: VectorSource | null): void;
196
+ setSource(source: VectorSource<FeatureType> | null): void;
194
197
  /**
195
198
  * Update the distances and refresh the source if necessary.
196
199
  * @param {number} distance The new distance.
@@ -202,14 +205,14 @@ declare class Cluster extends VectorSource<Feature<import("../geom.js").Geometry
202
205
  */
203
206
  protected cluster(): void;
204
207
  /**
205
- * @param {Array<Feature>} features Features
208
+ * @param {Array<FeatureType>} features Features
206
209
  * @param {import("../extent.js").Extent} extent The searched extent for these features.
207
210
  * @return {Feature} The cluster feature.
208
211
  * @protected
209
212
  */
210
- protected createCluster(features: Array<Feature>, extent: import("../extent.js").Extent): Feature;
213
+ protected createCluster(features: Array<FeatureType>, extent: import("../extent.js").Extent): Feature;
211
214
  }
212
- import Feature from '../Feature.js';
213
215
  import Point from '../geom/Point.js';
216
+ import Feature from '../Feature.js';
214
217
  import VectorSource from './Vector.js';
215
218
  //# sourceMappingURL=Cluster.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Cluster.d.ts","sourceRoot":"","sources":["Cluster.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BA4BuB,OAAO,KAAE,KAAK;;;;;;;;;;;;;;4BAad,KAAK,QAAE,MAAM,OAAO,CAAC,KAAE,OAAO;;;;;;;;;;AAvBrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH;;;;;;;;;;GAUG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EAyEjB;IAjEC;;;OAGG;IACH,sBAHU,MAAM,GAAC,SAAS,CAGC;IAE3B;;;OAGG;IACH,oBAHU,MAAM,CAGsD;IAEtE;;;OAGG;IACH,uBAHU,MAAM,CAG2B;IAE3C;;;OAGG;IACH,8BAHU,MAAM,CAGW;IAE3B;;;OAGG;IACH,oBAHU,MAAM,OAAO,CAAC,CAGN;IAElB;;;;OAIG;IACH,mCArFmB,OAAO,KAAE,KAAK,CA8F9B;IAEH;;;OAGG;IACH,6BAAiD;IAEjD;;;OAGG;IACH,kBAHU,YAAY,GAAC,IAAI,CAGT;IAElB;;OAEG;IACH,sBAA4C;IAgB9C;;;;OAIG;IACH,eAHY,MAAM,CAKjB;IAED;;;;OAIG;IACH,aAHY,YAAY,GAAC,IAAI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Y,aAAa,WAAW,CAAC,GAAC,IAAI,CAKzC;IAeD;;;;OAIG;IACH,sBAHW,MAAM,QAKhB;IAED;;;;;OAKG;IACH,4BAHW,MAAM,QAKhB;IAED;;;;OAIG;IACH,kBAHY,MAAM,CAKjB;IAED;;;;OAIG;IACH,kBAHW,aAAa,WAAW,CAAC,GAAC,IAAI,QAYxC;IAWD;;;;OAIG;IACH,yBAHW,MAAM,eACN,MAAM,QAahB;IAED;;OAEG;IACH,0BAkCC;IAED;;;;;OAKG;IACH,kCALW,MAAM,WAAW,CAAC,UAClB,OAAO,cAAc,EAAE,MAAM,GAC5B,OAAO,CA2BlB;CACF;kBApUiB,kBAAkB;oBADhB,eAAe;yBAEV,aAAa"}
package/source/Cluster.js CHANGED
@@ -17,6 +17,7 @@ import {
17
17
  import {getUid} from '../util.js';
18
18
 
19
19
  /**
20
+ * @template {import("../Feature.js").FeatureLike} FeatureType
20
21
  * @typedef {Object} Options
21
22
  * @property {import("./Source.js").AttributionLike} [attributions] Attributions.
22
23
  * @property {number} [distance=20] Distance in pixels within which features will
@@ -26,7 +27,7 @@ import {getUid} from '../util.js';
26
27
  * By default no minimum distance is guaranteed. This config can be used to avoid
27
28
  * overlapping icons. As a tradoff, the cluster feature's position will no longer be
28
29
  * the center of all its features.
29
- * @property {function(Feature):Point} [geometryFunction]
30
+ * @property {function(FeatureType):(Point)} [geometryFunction]
30
31
  * Function that takes an {@link module:ol/Feature~Feature} as argument and returns an
31
32
  * {@link module:ol/geom/Point~Point} as cluster calculation point for the feature. When a
32
33
  * feature should not be considered for clustering, the function should return
@@ -39,7 +40,7 @@ import {getUid} from '../util.js';
39
40
  * ```
40
41
  * See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster
41
42
  * calculation point for polygons.
42
- * @property {function(Point, Array<Feature>):Feature} [createCluster]
43
+ * @property {function(Point, Array<FeatureType>):Feature} [createCluster]
43
44
  * Function that takes the cluster's center {@link module:ol/geom/Point~Point} and an array
44
45
  * of {@link module:ol/Feature~Feature} included in this cluster. Must return a
45
46
  * {@link module:ol/Feature~Feature} that will be used to render. Default implementation is:
@@ -51,7 +52,7 @@ import {getUid} from '../util.js';
51
52
  * });
52
53
  * }
53
54
  * ```
54
- * @property {VectorSource} [source=null] Source.
55
+ * @property {VectorSource<FeatureType>} [source=null] Source.
55
56
  * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.
56
57
  */
57
58
 
@@ -65,10 +66,12 @@ import {getUid} from '../util.js';
65
66
  * source `setSource(null)` has to be called to remove the listener reference
66
67
  * from the wrapped source.
67
68
  * @api
69
+ * @template {import('../Feature.js').FeatureLike} FeatureType
70
+ * @extends {VectorSource<Feature<import("../geom/Geometry.js").default>>}
68
71
  */
69
72
  class Cluster extends VectorSource {
70
73
  /**
71
- * @param {Options} options Cluster options.
74
+ * @param {Options<FeatureType>} options Cluster options.
72
75
  */
73
76
  constructor(options) {
74
77
  super({
@@ -107,7 +110,7 @@ class Cluster extends VectorSource {
107
110
  this.features = [];
108
111
 
109
112
  /**
110
- * @param {Feature} feature Feature.
113
+ * @param {FeatureType} feature Feature.
111
114
  * @return {Point} Cluster calculation point.
112
115
  * @protected
113
116
  */
@@ -123,13 +126,13 @@ class Cluster extends VectorSource {
123
126
  };
124
127
 
125
128
  /**
126
- * @type {function(Point, Array<Feature>):Feature}
129
+ * @type {function(Point, Array<FeatureType>):Feature}
127
130
  * @private
128
131
  */
129
132
  this.createCustomCluster_ = options.createCluster;
130
133
 
131
134
  /**
132
- * @type {VectorSource|null}
135
+ * @type {VectorSource<FeatureType>|null}
133
136
  * @protected
134
137
  */
135
138
  this.source = null;
@@ -164,7 +167,7 @@ class Cluster extends VectorSource {
164
167
 
165
168
  /**
166
169
  * Get a reference to the wrapped source.
167
- * @return {VectorSource|null} Source.
170
+ * @return {VectorSource<FeatureType>|null} Source.
168
171
  * @api
169
172
  */
170
173
  getSource() {
@@ -214,7 +217,7 @@ class Cluster extends VectorSource {
214
217
 
215
218
  /**
216
219
  * Replace the wrapped source.
217
- * @param {VectorSource|null} source The new source for this instance.
220
+ * @param {VectorSource<FeatureType>|null} source The new source for this instance.
218
221
  * @api
219
222
  */
220
223
  setSource(source) {
@@ -295,7 +298,7 @@ class Cluster extends VectorSource {
295
298
  }
296
299
 
297
300
  /**
298
- * @param {Array<Feature>} features Features
301
+ * @param {Array<FeatureType>} features Features
299
302
  * @param {import("../extent.js").Extent} extent The searched extent for these features.
300
303
  * @return {Feature} The cluster feature.
301
304
  * @protected
package/util.js CHANGED
@@ -33,4 +33,4 @@ export function getUid(obj) {
33
33
  * OpenLayers version.
34
34
  * @type {string}
35
35
  */
36
- export const VERSION = '9.2.1-dev.1715808081797';
36
+ export const VERSION = '9.2.1-dev.1715879366731';