ol 9.2.5-dev.1717505118579 → 9.2.5-sh.1

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.
Files changed (85) hide show
  1. package/VectorRenderTile.d.ts +3 -3
  2. package/VectorRenderTile.d.ts.map +1 -1
  3. package/VectorTile.d.ts +16 -19
  4. package/VectorTile.d.ts.map +1 -1
  5. package/VectorTile.js +9 -12
  6. package/dist/ol.d.ts +2 -0
  7. package/dist/ol.d.ts.map +1 -1
  8. package/dist/ol.js +2 -2
  9. package/dist/ol.js.map +1 -1
  10. package/featureloader.d.ts +8 -8
  11. package/featureloader.d.ts.map +1 -1
  12. package/featureloader.js +5 -5
  13. package/format/EsriJSON.d.ts +7 -0
  14. package/format/EsriJSON.d.ts.map +1 -1
  15. package/format/Feature.d.ts +10 -10
  16. package/format/Feature.d.ts.map +1 -1
  17. package/format/Feature.js +6 -6
  18. package/format/GeoJSON.d.ts +9 -9
  19. package/format/GeoJSON.d.ts.map +1 -1
  20. package/format/GeoJSON.js +17 -22
  21. package/format/JSONFeature.d.ts +27 -7
  22. package/format/JSONFeature.d.ts.map +1 -1
  23. package/format/JSONFeature.js +12 -10
  24. package/format/MVT.d.ts +12 -12
  25. package/format/MVT.d.ts.map +1 -1
  26. package/format/MVT.js +18 -16
  27. package/format/TextFeature.d.ts +9 -0
  28. package/format/TextFeature.d.ts.map +1 -1
  29. package/format/TopoJSON.d.ts +7 -0
  30. package/format/TopoJSON.d.ts.map +1 -1
  31. package/format/XMLFeature.d.ts +9 -0
  32. package/format/XMLFeature.d.ts.map +1 -1
  33. package/interaction/Draw.d.ts +1 -1
  34. package/interaction/Draw.d.ts.map +1 -1
  35. package/interaction/Modify.d.ts +3 -3
  36. package/interaction/Modify.d.ts.map +1 -1
  37. package/interaction/Select.d.ts +2 -1
  38. package/interaction/Select.d.ts.map +1 -1
  39. package/layer/BaseVector.d.ts +6 -7
  40. package/layer/BaseVector.d.ts.map +1 -1
  41. package/layer/BaseVector.js +4 -6
  42. package/layer/Graticule.d.ts +2 -3
  43. package/layer/Graticule.d.ts.map +1 -1
  44. package/layer/Graticule.js +1 -1
  45. package/layer/Heatmap.d.ts +7 -8
  46. package/layer/Heatmap.d.ts.map +1 -1
  47. package/layer/Heatmap.js +5 -7
  48. package/layer/Tile.d.ts +2 -2
  49. package/layer/Tile.js +1 -1
  50. package/layer/Vector.d.ts +9 -19
  51. package/layer/Vector.d.ts.map +1 -1
  52. package/layer/Vector.js +5 -12
  53. package/layer/VectorImage.d.ts +7 -9
  54. package/layer/VectorImage.d.ts.map +1 -1
  55. package/layer/VectorImage.js +4 -6
  56. package/layer/VectorTile.d.ts +9 -19
  57. package/layer/VectorTile.d.ts.map +1 -1
  58. package/layer/VectorTile.js +9 -16
  59. package/package.json +1 -1
  60. package/renderer/canvas/TileLayer.d.ts +2 -2
  61. package/renderer/canvas/TileLayer.js +1 -1
  62. package/renderer/canvas/VectorImageLayer.d.ts +1 -1
  63. package/renderer/canvas/VectorImageLayer.d.ts.map +1 -1
  64. package/renderer/canvas/VectorLayer.d.ts +1 -1
  65. package/renderer/canvas/VectorLayer.d.ts.map +1 -1
  66. package/renderer/canvas/VectorTileLayer.d.ts +3 -3
  67. package/renderer/canvas/VectorTileLayer.d.ts.map +1 -1
  68. package/renderer/canvas/VectorTileLayer.js +1 -1
  69. package/renderer/webgl/TileLayerBase.d.ts +6 -1
  70. package/renderer/webgl/TileLayerBase.d.ts.map +1 -1
  71. package/renderer/webgl/TileLayerBase.js +6 -1
  72. package/source/OGCVectorTile.d.ts +7 -7
  73. package/source/OGCVectorTile.d.ts.map +1 -1
  74. package/source/OGCVectorTile.js +3 -3
  75. package/source/SentinelHub.d.ts +507 -0
  76. package/source/SentinelHub.d.ts.map +1 -0
  77. package/source/SentinelHub.js +616 -0
  78. package/source/Vector.d.ts +14 -14
  79. package/source/Vector.d.ts.map +1 -1
  80. package/source/Vector.js +10 -10
  81. package/source/VectorTile.d.ts +7 -8
  82. package/source/VectorTile.d.ts.map +1 -1
  83. package/source/VectorTile.js +2 -3
  84. package/util.d.ts.map +1 -1
  85. package/util.js +1 -1
@@ -14,7 +14,7 @@
14
14
  * source.
15
15
  *
16
16
  * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").default]
17
- * @typedef {function(this:(import("./source/Vector").default<FeatureType>|import("./VectorTile.js").default),
17
+ * @typedef {function(this:(import("./source/Vector").default|import("./VectorTile.js").default),
18
18
  * import("./extent.js").Extent,
19
19
  * number,
20
20
  * import("./proj/Projection.js").default,
@@ -34,9 +34,9 @@
34
34
  * @api
35
35
  */
36
36
  /**
37
- * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").default]
37
+ * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").FeatureLike]
38
38
  * @param {string|FeatureUrlFunction} url Feature URL service.
39
- * @param {import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>} format Feature format.
39
+ * @param {import("./format/Feature.js").default<import('./format/Feature.js').FeatureToFeatureClass<FeatureType>>} format Feature format.
40
40
  * @param {import("./extent.js").Extent} extent Extent.
41
41
  * @param {number} resolution Resolution.
42
42
  * @param {import("./proj/Projection.js").default} projection Projection.
@@ -45,18 +45,18 @@
45
45
  * @param {function(): void} failure Failure
46
46
  * Function called when loading failed.
47
47
  */
48
- export function loadFeaturesXhr<FeatureType extends import("./Feature.js").FeatureLike = import("./Feature.js").default<import("./geom.js").Geometry>>(url: string | FeatureUrlFunction, format: import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>, extent: import("./extent.js").Extent, resolution: number, projection: import("./proj/Projection.js").default, success: (arg0: FeatureType[], arg1: import("./proj/Projection.js").default) => void, failure: () => void): void;
48
+ export function loadFeaturesXhr<FeatureType extends import("./Feature.js").FeatureLike = import("./Feature.js").FeatureLike>(url: string | FeatureUrlFunction, format: import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>, extent: import("./extent.js").Extent, resolution: number, projection: import("./proj/Projection.js").default, success: (arg0: FeatureType[], arg1: import("./proj/Projection.js").default) => void, failure: () => void): void;
49
49
  /**
50
50
  * Create an XHR feature loader for a `url` and `format`. The feature loader
51
51
  * loads features (with XHR), parses the features, and adds them to the
52
52
  * vector source.
53
- * @template {import("./Feature.js").FeatureLike} FeatureType
53
+ * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").FeatureLike]
54
54
  * @param {string|FeatureUrlFunction} url Feature URL service.
55
- * @param {import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>} format Feature format.
55
+ * @param {import("./format/Feature.js").default<import('./format/Feature.js').FeatureToFeatureClass<FeatureType>>} format Feature format.
56
56
  * @return {FeatureLoader<FeatureType>} The feature loader.
57
57
  * @api
58
58
  */
59
- export function xhr<FeatureType extends import("./Feature.js").FeatureLike>(url: string | FeatureUrlFunction, format: import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>): FeatureLoader<FeatureType>;
59
+ export function xhr<FeatureType extends import("./Feature.js").FeatureLike = import("./Feature.js").FeatureLike>(url: string | FeatureUrlFunction, format: import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>): FeatureLoader<FeatureType>;
60
60
  /**
61
61
  * Setter for the withCredentials configuration for the XHR.
62
62
  *
@@ -80,7 +80,7 @@ export function setWithCredentials(xhrWithCredentials: boolean): void;
80
80
  * The function is responsible for loading the features and adding them to the
81
81
  * source.
82
82
  */
83
- export type FeatureLoader<FeatureType extends import("./Feature.js").FeatureLike = import("./Feature.js").default<import("./geom.js").Geometry>> = (this: (import("./source/Vector").default<FeatureType> | import("./VectorTile.js").default<any>), arg1: import("./extent.js").Extent, arg2: number, arg3: import("./proj/Projection.js").default, arg4: ((arg0: Array<FeatureType>) => void) | undefined, arg5: (() => void) | undefined) => void;
83
+ export type FeatureLoader<FeatureType extends import("./Feature.js").FeatureLike = import("./Feature.js").default<import("./geom.js").Geometry>> = (this: (import("./source/Vector").default | import("./VectorTile.js").default), arg1: import("./extent.js").Extent, arg2: number, arg3: import("./proj/Projection.js").default, arg4: ((arg0: Array<FeatureType>) => void) | undefined, arg5: (() => void) | undefined) => void;
84
84
  /**
85
85
  * {@link module :ol/source/Vector~VectorSource} sources use a function of this type to
86
86
  * get the url to load features from.
@@ -1 +1 @@
1
- {"version":3,"file":"featureloader.d.ts","sourceRoot":"","sources":["featureloader.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;GAWG;AACH,4JAVW,MAAM,GAAC,kBAAkB,2HAEzB,OAAO,aAAa,EAAE,MAAM,cAC5B,MAAM,cACN,OAAO,sBAAsB,EAAE,OAAO,uCACT,OAAO,sBAAsB,EAAE,OAAO,KAAG,IAAI,iBAE9D,IAAI,QAkE1B;AAED;;;;;;;;;GASG;AACH,iFALW,MAAM,GAAC,kBAAkB,+IAsCnC;AAED;;;;;;GAMG;AACH,uDAJW,OAAO,QAMjB;;;;;;;;;;;;;;;;0JAxJ0B,CAAC,OAAO,iBAAiB,EAAE,OAAO,CAAC,WAAW,CAAC,yCAAkC,CAAC,QAC5G,OAAmB,aAAa,EAAE,MAAM,QACxC,MAAkB,QAClB,OAAmB,sBAAsB,EAAE,OAAO,gBAC7B,MAAM,WAAW,CAAC,KAAG,IAAI,4BACtB,IAAI,kBAAI,IAAI;;;;;;;;;;wCAYf,OAAO,aAAa,EAAE,MAAM,QAAE,MAAM,QAAE,OAAO,sBAAsB,EAAE,OAAO,KAAG,MAAM"}
1
+ {"version":3,"file":"featureloader.d.ts","sourceRoot":"","sources":["featureloader.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;GAWG;AACH,kIAVW,MAAM,GAAC,kBAAkB,2HAEzB,OAAO,aAAa,EAAE,MAAM,cAC5B,MAAM,cACN,OAAO,sBAAsB,EAAE,OAAO,uCACT,OAAO,sBAAsB,EAAE,OAAO,KAAG,IAAI,iBAE9D,IAAI,QAkE1B;AAED;;;;;;;;;GASG;AACH,sHALW,MAAM,GAAC,kBAAkB,+IAsCnC;AAED;;;;;;GAMG;AACH,uDAJW,OAAO,QAMjB;;;;;;;;;;;;;;;;0JAxJ0B,CAAC,OAAO,iBAAiB,EAAE,OAAO,GAAC,OAAO,iBAAiB,EAAE,OAAO,CAAC,QAC/F,OAAmB,aAAa,EAAE,MAAM,QACxC,MAAkB,QAClB,OAAmB,sBAAsB,EAAE,OAAO,gBAC7B,MAAM,WAAW,CAAC,KAAG,IAAI,4BACtB,IAAI,kBAAI,IAAI;;;;;;;;;;wCAYf,OAAO,aAAa,EAAE,MAAM,QAAE,MAAM,QAAE,OAAO,sBAAsB,EAAE,OAAO,KAAG,MAAM"}
package/featureloader.js CHANGED
@@ -26,7 +26,7 @@ let withCredentials = false;
26
26
  * source.
27
27
  *
28
28
  * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").default]
29
- * @typedef {function(this:(import("./source/Vector").default<FeatureType>|import("./VectorTile.js").default),
29
+ * @typedef {function(this:(import("./source/Vector").default|import("./VectorTile.js").default),
30
30
  * import("./extent.js").Extent,
31
31
  * number,
32
32
  * import("./proj/Projection.js").default,
@@ -48,9 +48,9 @@ let withCredentials = false;
48
48
  */
49
49
 
50
50
  /**
51
- * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").default]
51
+ * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").FeatureLike]
52
52
  * @param {string|FeatureUrlFunction} url Feature URL service.
53
- * @param {import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>} format Feature format.
53
+ * @param {import("./format/Feature.js").default<import('./format/Feature.js').FeatureToFeatureClass<FeatureType>>} format Feature format.
54
54
  * @param {import("./extent.js").Extent} extent Extent.
55
55
  * @param {number} resolution Resolution.
56
56
  * @param {import("./proj/Projection.js").default} projection Projection.
@@ -128,9 +128,9 @@ export function loadFeaturesXhr(
128
128
  * Create an XHR feature loader for a `url` and `format`. The feature loader
129
129
  * loads features (with XHR), parses the features, and adds them to the
130
130
  * vector source.
131
- * @template {import("./Feature.js").FeatureLike} FeatureType
131
+ * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").FeatureLike]
132
132
  * @param {string|FeatureUrlFunction} url Feature URL service.
133
- * @param {import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>} format Feature format.
133
+ * @param {import("./format/Feature.js").default<import('./format/Feature.js').FeatureToFeatureClass<FeatureType>>} format Feature format.
134
134
  * @return {FeatureLoader<FeatureType>} The feature loader.
135
135
  * @api
136
136
  */
@@ -62,6 +62,13 @@ declare class EsriJSON extends JSONFeature<typeof Feature> {
62
62
  * @return {import("../Feature.js").default} Feature.
63
63
  */
64
64
  protected readFeatureFromObject(object: any, options?: import("./Feature.js").ReadOptions | undefined, idField?: string | undefined): import("../Feature.js").default;
65
+ /**
66
+ * @param {Object} object Object.
67
+ * @param {import("./Feature.js").ReadOptions} [options] Read options.
68
+ * @protected
69
+ * @return {Array<Feature>} Features.
70
+ */
71
+ protected readFeaturesFromObject(object: any, options?: import("./Feature.js").ReadOptions | undefined): Array<Feature>;
65
72
  /**
66
73
  * @param {EsriJSONGeometry} object Object.
67
74
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
@@ -1 +1 @@
1
- {"version":3,"file":"EsriJSON.d.ts","sourceRoot":"","sources":["EsriJSON.js"],"names":[],"mappings":";8BAoBa,OAAO,iBAAiB,EAAE,OAAO;iCACjC,OAAO,iBAAiB,EAAE,UAAU;+BACpC,OAAO,iBAAiB,EAAE,QAAQ;4BAClC,OAAO,iBAAiB,EAAE,KAAK;+BAC/B,OAAO,iBAAiB,EAAE,QAAQ;8BAClC,OAAO,iBAAiB,EAAE,OAAO;iCACjC,OAAO,iB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AIG;IACH,sBAAyC;IAG3C;;;;;;OAMG;IACH,sIAFY,OAAO,eAAe,EAAE,OAAO,CAkB1C;IAED;;;;;OAKG;IACH,yGAFY,MAAM,OAAO,CAAC,CAqBzB;IAED;;;;;OAKG;IACH,yCALW,gBAAgB,6DAGf,OAAO,qBAAqB,EAAE,OAAO,CAIhD;IAqBD;;;;;;;OAOG;IACH,8BALW,OAAO,qBAAqB,EAAE,OAAO,8DAEpC,gBAAgB,CAK3B;IAuCD;;;;;;;OAOG;IACH,8BALW,MAAM,OAAO,eAAe,EAAE,OAAO,CAAC,8DAErC,kBAAkB,CAY7B;CACF;oBA/OmB,eAAe;wBACX,kBAAkB"}
@@ -123,7 +123,7 @@ export type FeatureObject = {
123
123
  /**
124
124
  * *
125
125
  */
126
- export type FeatureToFeatureClass<T extends import("../Feature.js").FeatureLike> = T extends RenderFeature ? typeof RenderFeature : typeof Feature;
126
+ export type FeatureToFeatureClass<T extends Feature<import("../geom.js").Geometry> | RenderFeature> = T extends RenderFeature ? typeof RenderFeature : typeof Feature;
127
127
  /**
128
128
  * *
129
129
  */
@@ -191,7 +191,7 @@ import RenderFeature from '../render/Feature.js';
191
191
  * @property {Object<string, *>} [properties] Properties.
192
192
  */
193
193
  /***
194
- * @template {import('../Feature.js').FeatureLike} T
194
+ * @template {Feature|RenderFeature} T
195
195
  * @typedef {T extends RenderFeature ? typeof RenderFeature : typeof Feature} FeatureToFeatureClass
196
196
  */
197
197
  /***
@@ -207,11 +207,11 @@ import RenderFeature from '../render/Feature.js';
207
207
  * {@link module:ol/Feature~Feature} objects from a variety of commonly used geospatial
208
208
  * file formats. See the documentation for each format for more details.
209
209
  *
210
- * @template {import('../Feature.js').FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
210
+ * @template {import('../Feature.js').FeatureClass} [T=typeof import('../Feature.js').default]
211
211
  * @abstract
212
212
  * @api
213
213
  */
214
- declare class FeatureFormat<FeatureClassType extends import("../Feature.js").FeatureClass = typeof Feature> {
214
+ declare class FeatureFormat<T extends import("../Feature.js").FeatureClass = typeof Feature> {
215
215
  /**
216
216
  * @protected
217
217
  * @type {import("../proj/Projection.js").default|undefined}
@@ -224,9 +224,9 @@ declare class FeatureFormat<FeatureClassType extends import("../Feature.js").Fea
224
224
  protected defaultFeatureProjection: import("../proj/Projection.js").default | undefined;
225
225
  /**
226
226
  * @protected
227
- * @type {FeatureClassType}
227
+ * @type {T}
228
228
  */
229
- protected featureClass: FeatureClassType;
229
+ protected featureClass: T;
230
230
  /**
231
231
  * A list media types supported by the format in descending order of preference.
232
232
  * @type {Array<string>}
@@ -261,18 +261,18 @@ declare class FeatureFormat<FeatureClassType extends import("../Feature.js").Fea
261
261
  * @abstract
262
262
  * @param {Document|Element|Object|string} source Source.
263
263
  * @param {ReadOptions} [options] Read options.
264
- * @return {FeatureClassToFeature<FeatureClassType>|Array<FeatureClassToFeature<FeatureClassType>>} Feature.
264
+ * @return {import("../Feature.js").FeatureLike|Array<import("../render/Feature.js").default>} Feature.
265
265
  */
266
- readFeature(source: Document | Element | any | string, options?: ReadOptions | undefined): FeatureClassToFeature<FeatureClassType> | Array<FeatureClassToFeature<FeatureClassType>>;
266
+ readFeature(source: Document | Element | any | string, options?: ReadOptions | undefined): import("../Feature.js").FeatureLike | Array<import("../render/Feature.js").default>;
267
267
  /**
268
268
  * Read all features from a source.
269
269
  *
270
270
  * @abstract
271
271
  * @param {Document|Element|ArrayBuffer|Object|string} source Source.
272
272
  * @param {ReadOptions} [options] Read options.
273
- * @return {Array<FeatureClassToFeature<FeatureClassType>>} Features.
273
+ * @return {Array<import('../Feature.js').FeatureLike|FeatureClassToFeature<T>>} Features.
274
274
  */
275
- readFeatures(source: Document | Element | ArrayBuffer | any | string, options?: ReadOptions | undefined): Array<FeatureClassToFeature<FeatureClassType>>;
275
+ readFeatures(source: Document | Element | ArrayBuffer | any | string, options?: ReadOptions | undefined): Array<import('../Feature.js').FeatureLike | FeatureClassToFeature<T>>;
276
276
  /**
277
277
  * Read a single geometry from a source.
278
278
  *
@@ -1 +1 @@
1
- {"version":3,"file":"Feature.d.ts","sourceRoot":"","sources":["Feature.js"],"names":[],"mappings":"AAgSA;;;;;;GAMG;AACH,0HAJW,OAAO,uDAkDjB;AAED;;;;GAIG;AACH,mDAJW,OAAO,cAAc,EAAE,MAAM,sCAE5B,OAAO,cAAc,EAAE,MAAM,CAgBxC;AA2BD;;;;GAIG;AACH,4CAJW,aAAa,qDAEZ,aAAa,GAAC,MAAM,aAAa,CAAC,CAkC7C;AAED;;;;GAIG;AACH,uCAJW,cAAc,GAAC,IAAI,qDAElB,OAAO,qBAAqB,EAAE,OAAO,CAkBhD;;;;;;;;;;qBAnaa,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;wBASnC,OAAO,YAAY,EAAE,cAAc;;;;;;;;;qBAOnC,OAAO,YAAY,EAAE,cAAc;;;;;;wBAInC,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;mBAoBpC,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK;;;;;UAKtC,OAAO,qBAAqB,EAAE,IAAI;;;;qBAClC,MAAM,MAAM,CAAC;;;;;;;;;;uCAMd,MAAM,cAAc,CAAC;6BAIrB,oBAAoB,mBAAyB;;;;;;;;;;;;;;;;;;;;mFAY7C,CAAC,SAAS,aAAa,GAAG,oBAAoB,GAAG,cAAc;;;;oFAK/D,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,GAAG,OAAO;0BAnG7C,sBAAsB;AAwBhD;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;GAEG;AAEH;;;;;;GAMG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;;;;GAKG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AACH;IAEI;;;OAGG;IACH,0BAFU,OAAO,uBAAuB,EAAE,OAAO,GAA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CAAC,CAEmC;IAE9C;;;OAGG;IACH,qBAFU,MAAM,MAAM,CAAC,CAEQ;IAGjC;;;;;;OAMG;IACH,iCALW,QAAQ,GAAC,OAAO,SAAQ,MAAM,sCAE7B,WAAW,GAAC,SAAS,CAsBhC;IAED;;;;;;;;OAQG;IACH,gCANW,YAAY,GAAC,WAAW,GAAC,SAAS,GAGjC,YAAY,GAAC,WAAW,GAAC,SAAS,CAY7C;IAED;;;OAGG;IACH,WAFY,IAAI,CAIf;IAED;;;;;;;OAOG;IACH,oBAJW,QAAQ,GAAC,OAAO,SAAQ,MAAM,sCAE7B,OAAO,eAAe,EAAE,WAAW,GAAC,MAAM,OAAO,sBAAsB,EAAE,OAAO,CAAC,CAI5F;IAED;;;;;;;OAOG;IACH,qBAJW,QAAQ,GAAC,OAAO,GAAC,WAAW,SAAQ,MAAM,sCAEzC,MAAM,OAAO,eAAe,EAAE,WAAW,GAAC,sBAAsB,CAAC,CAAC,CAAC,CAI9E;IAED;;;;;;;OAOG;IACH,qBAJW,QAAQ,GAAC,OAAO,SAAQ,MAAM,sCAE7B,OAAO,qBAAqB,EAAE,OAAO,CAIhD;IAED;;;;;;OAMG;IACH,uBAHW,QAAQ,GAAC,OAAO,SAAQ,MAAM,GAC7B,OAAO,uBAAuB,EAAE,OAAO,GAAC,SAAS,CAI5D;IAED;;;;;;;OAOG;IACH,sBAJW,OAAO,uCAEN,MAAM,GAAC,WAAW,CAI7B;IAED;;;;;;;OAOG;IACH,wBAJW,MAAM,OAAO,CAAC,uCAEb,MAAM,GAAC,WAAW,CAI7B;IAED;;;;;;;OAOG;IACH,wBAJW,OAAO,qBAAqB,EAAE,OAAO,uCAEpC,MAAM,GAAC,WAAW,CAI7B;CACF;oBAzRmB,eAAe"}
package/format/Feature.js CHANGED
@@ -95,7 +95,7 @@ import {
95
95
  */
96
96
 
97
97
  /***
98
- * @template {import('../Feature.js').FeatureLike} T
98
+ * @template {Feature|RenderFeature} T
99
99
  * @typedef {T extends RenderFeature ? typeof RenderFeature : typeof Feature} FeatureToFeatureClass
100
100
  */
101
101
 
@@ -113,7 +113,7 @@ import {
113
113
  * {@link module:ol/Feature~Feature} objects from a variety of commonly used geospatial
114
114
  * file formats. See the documentation for each format for more details.
115
115
  *
116
- * @template {import('../Feature.js').FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
116
+ * @template {import('../Feature.js').FeatureClass} [T=typeof import('../Feature.js').default]
117
117
  * @abstract
118
118
  * @api
119
119
  */
@@ -133,9 +133,9 @@ class FeatureFormat {
133
133
 
134
134
  /**
135
135
  * @protected
136
- * @type {FeatureClassType}
136
+ * @type {T}
137
137
  */
138
- this.featureClass = /** @type {FeatureClassType} */ (Feature);
138
+ this.featureClass = /** @type {T} */ (Feature);
139
139
 
140
140
  /**
141
141
  * A list media types supported by the format in descending order of preference.
@@ -206,7 +206,7 @@ class FeatureFormat {
206
206
  * @abstract
207
207
  * @param {Document|Element|Object|string} source Source.
208
208
  * @param {ReadOptions} [options] Read options.
209
- * @return {FeatureClassToFeature<FeatureClassType>|Array<FeatureClassToFeature<FeatureClassType>>} Feature.
209
+ * @return {import("../Feature.js").FeatureLike|Array<import("../render/Feature.js").default>} Feature.
210
210
  */
211
211
  readFeature(source, options) {
212
212
  return abstract();
@@ -218,7 +218,7 @@ class FeatureFormat {
218
218
  * @abstract
219
219
  * @param {Document|Element|ArrayBuffer|Object|string} source Source.
220
220
  * @param {ReadOptions} [options] Read options.
221
- * @return {Array<FeatureClassToFeature<FeatureClassType>>} Features.
221
+ * @return {Array<import('../Feature.js').FeatureLike|FeatureClassToFeature<T>>} Features.
222
222
  */
223
223
  readFeatures(source, options) {
224
224
  return abstract();
@@ -10,7 +10,7 @@ export type GeoJSONMultiPoint = import("geojson").MultiPoint;
10
10
  export type GeoJSONMultiLineString = import("geojson").MultiLineString;
11
11
  export type GeoJSONMultiPolygon = import("geojson").MultiPolygon;
12
12
  export type GeoJSONGeometryCollection = import("geojson").GeometryCollection;
13
- export type Options<FeatureClassType extends import("../Feature.js").FeatureClass = typeof Feature> = {
13
+ export type Options<FeatureClassToFeature extends import("../Feature.js").FeatureClass> = {
14
14
  /**
15
15
  * Default data projection.
16
16
  */
@@ -37,7 +37,7 @@ export type Options<FeatureClassType extends import("../Feature.js").FeatureClas
37
37
  * the primary concern, and features are not going to be modified or round-tripped through the format,
38
38
  * consider using {@link module :ol/render/Feature~RenderFeature}
39
39
  */
40
- featureClass?: FeatureClassType | undefined;
40
+ featureClass?: FeatureClassToFeature | undefined;
41
41
  };
42
42
  /**
43
43
  * @typedef {import("geojson").GeoJSON} GeoJSONObject
@@ -53,7 +53,7 @@ export type Options<FeatureClassType extends import("../Feature.js").FeatureClas
53
53
  * @typedef {import("geojson").GeometryCollection} GeoJSONGeometryCollection
54
54
  */
55
55
  /**
56
- * @template {import("../Feature.js").FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
56
+ * @template {import("../Feature.js").FeatureClass} FeatureClassToFeature
57
57
  * @typedef {Object} Options
58
58
  *
59
59
  * @property {import("../proj.js").ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
@@ -64,7 +64,7 @@ export type Options<FeatureClassType extends import("../Feature.js").FeatureClas
64
64
  * the geometry_name field in the feature GeoJSON. If set to `true` the GeoJSON reader
65
65
  * will look for that field to set the geometry name. If both this field is set to `true`
66
66
  * and a `geometryName` is provided, the `geometryName` will take precedence.
67
- * @property {FeatureClassType} [featureClass] Feature class
67
+ * @property {FeatureClassToFeature} [featureClass] Feature class
68
68
  * to be used when reading features. The default is {@link module:ol/Feature~Feature}. If performance is
69
69
  * the primary concern, and features are not going to be modified or round-tripped through the format,
70
70
  * consider using {@link module:ol/render/Feature~RenderFeature}
@@ -73,15 +73,15 @@ export type Options<FeatureClassType extends import("../Feature.js").FeatureClas
73
73
  * @classdesc
74
74
  * Feature format for reading and writing data in the GeoJSON format.
75
75
  *
76
- * @template {import('../Feature.js').FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
77
- * @extends {JSONFeature<FeatureClassType>}
76
+ * @template {import('../Feature.js').FeatureClass} [T=typeof Feature]
77
+ * @extends {JSONFeature<T>}
78
78
  * @api
79
79
  */
80
- declare class GeoJSON<FeatureClassType extends import("../Feature.js").FeatureClass = typeof Feature> extends JSONFeature<FeatureClassType> {
80
+ declare class GeoJSON<T extends import("../Feature.js").FeatureClass = typeof Feature> extends JSONFeature<T> {
81
81
  /**
82
- * @param {Options<FeatureClassType>} [options] Options.
82
+ * @param {Options<T>} [options] Options.
83
83
  */
84
- constructor(options?: Options<FeatureClassType> | undefined);
84
+ constructor(options?: Options<T> | undefined);
85
85
  /**
86
86
  * Name of the geometry attribute for features.
87
87
  * @type {string|undefined}
@@ -1 +1 @@
1
- {"version":3,"file":"GeoJSON.d.ts","sourceRoot":"","sources":["GeoJSON.js"],"names":[],"mappings":";4BAqBa,OAAO,SAAS,EAAE,OAAO;6BACzB,OAAO,SAAS,EAAE,OAAO;uCACzB,OAAO,SAAS,EAAE,iBAAiB;8BACnC,OAAO,SAAS,EAAE,QAAQ;2BAC1B,OAAO,SAAS,EAAE,KAAK;gCACvB,OAAO,SAAS,EAAE,UAAU;6BAC5B,OAAO,SAAS,EAAE,OAAO;gCACzB,OAAO,SAAS,EAAE,UAAU;qCAC5B,OAAO,SAAS,EAAE,eAAe;kCACjC,OAAO,SAAS,EAAE,YAAY;wCAC9B,OAAO,SAAS,EAAE,kBAAkB;;;;;qBAOnC,OAAO,YAAY,EAAE,cAAc;;;;;wBACnC,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;AAnBjD;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;GAOG;AACH;IACE;;OAEG;IACH,6DAyCC;IAlBC;;;;OAIG;IACH,sBAAyC;IAEzC;;;;OAIG;IACH,6BAAuD;IAgGzD;;;;;OAKG;IACH,yCALW,eAA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EAAE,OAAO,CAAC,8DAErC,wBAAwB,CAanC;IAED;;;;;;;OAOG;IACH,8BALW,OAAO,qBAAqB,EAAE,OAAO,8DAEpC,eAAe,GAAC,yBAAyB,CAKpD;CACF;oBAnSmB,eAAe;wBACX,kBAAkB"}
package/format/GeoJSON.js CHANGED
@@ -33,7 +33,7 @@ import {isEmpty} from '../obj.js';
33
33
  */
34
34
 
35
35
  /**
36
- * @template {import("../Feature.js").FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
36
+ * @template {import("../Feature.js").FeatureClass} FeatureClassToFeature
37
37
  * @typedef {Object} Options
38
38
  *
39
39
  * @property {import("../proj.js").ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
@@ -44,7 +44,7 @@ import {isEmpty} from '../obj.js';
44
44
  * the geometry_name field in the feature GeoJSON. If set to `true` the GeoJSON reader
45
45
  * will look for that field to set the geometry name. If both this field is set to `true`
46
46
  * and a `geometryName` is provided, the `geometryName` will take precedence.
47
- * @property {FeatureClassType} [featureClass] Feature class
47
+ * @property {FeatureClassToFeature} [featureClass] Feature class
48
48
  * to be used when reading features. The default is {@link module:ol/Feature~Feature}. If performance is
49
49
  * the primary concern, and features are not going to be modified or round-tripped through the format,
50
50
  * consider using {@link module:ol/render/Feature~RenderFeature}
@@ -54,13 +54,13 @@ import {isEmpty} from '../obj.js';
54
54
  * @classdesc
55
55
  * Feature format for reading and writing data in the GeoJSON format.
56
56
  *
57
- * @template {import('../Feature.js').FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
58
- * @extends {JSONFeature<FeatureClassType>}
57
+ * @template {import('../Feature.js').FeatureClass} [T=typeof Feature]
58
+ * @extends {JSONFeature<T>}
59
59
  * @api
60
60
  */
61
61
  class GeoJSON extends JSONFeature {
62
62
  /**
63
- * @param {Options<FeatureClassType>} [options] Options.
63
+ * @param {Options<T>} [options] Options.
64
64
  */
65
65
  constructor(options) {
66
66
  options = options ? options : {};
@@ -109,7 +109,7 @@ class GeoJSON extends JSONFeature {
109
109
  * @param {Object} object Object.
110
110
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
111
111
  * @protected
112
- * @return {import('./Feature.js').FeatureClassToFeature<FeatureClassType>|Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Feature.
112
+ * @return {Feature|RenderFeature|Array<RenderFeature>}.default} Feature.
113
113
  */
114
114
  readFeatureFromObject(object, options) {
115
115
  /**
@@ -128,15 +128,13 @@ class GeoJSON extends JSONFeature {
128
128
 
129
129
  const geometry = readGeometryInternal(geoJSONFeature['geometry'], options);
130
130
  if (this.featureClass === RenderFeature) {
131
- return /** @type {import('./Feature.js').FeatureClassToFeature<FeatureClassType>|Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} */ (
132
- createRenderFeature(
133
- {
134
- geometry,
135
- id: geoJSONFeature['id'],
136
- properties: geoJSONFeature['properties'],
137
- },
138
- options,
139
- )
131
+ return createRenderFeature(
132
+ {
133
+ geometry,
134
+ id: geoJSONFeature['id'],
135
+ properties: geoJSONFeature['properties'],
136
+ },
137
+ options,
140
138
  );
141
139
  }
142
140
 
@@ -155,19 +153,18 @@ class GeoJSON extends JSONFeature {
155
153
  if (geoJSONFeature['properties']) {
156
154
  feature.setProperties(geoJSONFeature['properties'], true);
157
155
  }
158
- return /** @type {import('./Feature.js').FeatureClassToFeature<FeatureClassType>|Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} */ (
159
- feature
160
- );
156
+ return feature;
161
157
  }
162
158
 
163
159
  /**
164
160
  * @param {Object} object Object.
165
161
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
166
162
  * @protected
167
- * @return {Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Features.
163
+ * @return {Array<Feature|RenderFeature>} Features.
168
164
  */
169
165
  readFeaturesFromObject(object, options) {
170
166
  const geoJSONObject = /** @type {GeoJSONObject} */ (object);
167
+ /** @type {Array<Feature|RenderFeature|Array<RenderFeature>>} */
171
168
  let features = null;
172
169
  if (geoJSONObject['type'] === 'FeatureCollection') {
173
170
  const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (
@@ -188,9 +185,7 @@ class GeoJSON extends JSONFeature {
188
185
  } else {
189
186
  features = [this.readFeatureFromObject(object, options)];
190
187
  }
191
- return /** @type {Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} */ (
192
- features.flat()
193
- );
188
+ return features.flat();
194
189
  }
195
190
 
196
191
  /**
@@ -5,27 +5,47 @@ export default JSONFeature;
5
5
  * instantiated in apps.
6
6
  * Base class for JSON feature formats.
7
7
  *
8
- * @template {import('../Feature.js').FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
9
- * @extends {FeatureFormat<FeatureClassType>}
8
+ * @template {import('../Feature.js').FeatureClass} [T=typeof import('../Feature.js').default]
9
+ * @extends {FeatureFormat<T>}
10
10
  * @abstract
11
11
  */
12
- declare class JSONFeature<FeatureClassType extends import("../Feature.js").FeatureClass = typeof import("../Feature.js").default> extends FeatureFormat<FeatureClassType> {
12
+ declare class JSONFeature<T extends import("../Feature.js").FeatureClass = typeof import("../Feature.js").default> extends FeatureFormat<T> {
13
+ /**
14
+ * Read a feature. Only works for a single feature. Use `readFeatures` to
15
+ * read a feature collection.
16
+ *
17
+ * @param {ArrayBuffer|Document|Element|Object|string} source Source.
18
+ * @param {import("./Feature.js").ReadOptions} [options] Read options.
19
+ * @return {import('./Feature.js').FeatureClassToFeature<T>} Feature.
20
+ * @api
21
+ */
22
+ readFeature(source: ArrayBuffer | Document | Element | any | string, options?: import("./Feature.js").ReadOptions | undefined): import('./Feature.js').FeatureClassToFeature<T>;
23
+ /**
24
+ * Read all features. Works with both a single feature and a feature
25
+ * collection.
26
+ *
27
+ * @param {ArrayBuffer|Document|Element|Object|string} source Source.
28
+ * @param {import("./Feature.js").ReadOptions} [options] Read options.
29
+ * @return {Array<import('./Feature.js').FeatureClassToFeature<T>>} Features.
30
+ * @api
31
+ */
32
+ readFeatures(source: ArrayBuffer | Document | Element | any | string, options?: import("./Feature.js").ReadOptions | undefined): Array<import('./Feature.js').FeatureClassToFeature<T>>;
13
33
  /**
14
34
  * @abstract
15
35
  * @param {Object} object Object.
16
36
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
17
37
  * @protected
18
- * @return {import('./Feature.js').FeatureClassToFeature<FeatureClassType>|Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Feature.
38
+ * @return {import("../Feature.js").default|import("../render/Feature.js").default|Array<import("../render/Feature.js").default>} Feature.
19
39
  */
20
- protected readFeatureFromObject(object: any, options?: import("./Feature.js").ReadOptions | undefined): import('./Feature.js').FeatureClassToFeature<FeatureClassType> | Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>;
40
+ protected readFeatureFromObject(object: any, options?: import("./Feature.js").ReadOptions | undefined): import("../Feature.js").default | import("../render/Feature.js").default | Array<import("../render/Feature.js").default>;
21
41
  /**
22
42
  * @abstract
23
43
  * @param {Object} object Object.
24
44
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
25
45
  * @protected
26
- * @return {Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Features.
46
+ * @return {Array<import("../Feature.js").default|import("../render/Feature.js").default>} Features.
27
47
  */
28
- protected readFeaturesFromObject(object: any, options?: import("./Feature.js").ReadOptions | undefined): Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>;
48
+ protected readFeaturesFromObject(object: any, options?: import("./Feature.js").ReadOptions | undefined): Array<import("../Feature.js").default | import("../render/Feature.js").default>;
29
49
  /**
30
50
  * @abstract
31
51
  * @param {Object} object Object.
@@ -1 +1 @@
1
- {"version":3,"file":"JSONFeature.d.ts","sourceRoot":"","sources":["JSONFeature.js"],"names":[],"mappings":";AAMA;;;;;;;;;GASG;AACH;IA8CE;;;;;;OAMG;IACH,wGAFY,OAAO,cAAc,EAAE,qBAAqB,CAAC,gBAAgB,C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,CAAC,CAUjE;IAED;;;;;;OAMG;IACH,wGAFY,OAAO,eAAe,EAAE,OAAO,GAAC,OAAO,sBAAsB,EAAE,OAAO,GAAC,MAAM,OAAO,sBAAsB,EAAE,OAAO,CAAC,CAI/H;IAED;;;;;;OAMG;IACH,yGAFY,MAAM,OAAO,eAAe,EAAE,OAAO,GAAC,OAAO,sBAAsB,EAAE,OAAO,CAAC,CAIxF;IAiBD;;;;;;OAMG;IACH,yGAFY,OAAO,qBAAqB,EAAE,OAAO,CAIhD;IAED;;;;;;OAMG;IACH,uBAJW,WAAW,GAAC,QAAQ,GAAC,OAAO,SAAQ,MAAM,GACzC,OAAO,uBAAuB,EAAE,OAAO,CAKlD;IAED;;;;;OAKG;IACH,iDAFY,OAAO,uBAAuB,EAAE,OAAO,CAIlD;IAED;;;;;;;OAOG;IACH,sBALW,OAAO,eAAe,EAAE,OAAO,8DAE9B,MAAM,CAKjB;IAED;;;;;OAKG;IACH,4BAJW,OAAO,eAAe,EAAE,OAAO,kEAMzC;IAED;;;;;;;OAOG;IACH,wBALW,MAAM,OAAO,eAAe,EAAE,OAAO,CAAC,8DAErC,MAAM,CAKjB;IAED;;;;;OAKG;IACH,8BAJW,MAAM,OAAO,eAAe,EAAE,OAAO,CAAC,kEAMhD;IAED;;;;;;;OAOG;IACH,wBALW,OAAO,qBAAqB,EAAE,OAAO,8DAEpC,MAAM,CAKjB;IAED;;;;;OAKG;IACH,8BAJW,OAAO,qBAAqB,EAAE,OAAO,kEAM/C;CACF;0BAnMyB,cAAc"}
@@ -10,8 +10,8 @@ import {abstract} from '../util.js';
10
10
  * instantiated in apps.
11
11
  * Base class for JSON feature formats.
12
12
  *
13
- * @template {import('../Feature.js').FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
14
- * @extends {FeatureFormat<FeatureClassType>}
13
+ * @template {import('../Feature.js').FeatureClass} [T=typeof import('../Feature.js').default]
14
+ * @extends {FeatureFormat<T>}
15
15
  * @abstract
16
16
  */
17
17
  class JSONFeature extends FeatureFormat {
@@ -32,13 +32,15 @@ class JSONFeature extends FeatureFormat {
32
32
  *
33
33
  * @param {ArrayBuffer|Document|Element|Object|string} source Source.
34
34
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
35
- * @return {import('./Feature.js').FeatureClassToFeature<FeatureClassType>|Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Feature.
35
+ * @return {import('./Feature.js').FeatureClassToFeature<T>} Feature.
36
36
  * @api
37
37
  */
38
38
  readFeature(source, options) {
39
- return this.readFeatureFromObject(
40
- getObject(source),
41
- this.getReadOptions(source, options),
39
+ return /** @type {import('./Feature.js').FeatureClassToFeature<T>} */ (
40
+ this.readFeatureFromObject(
41
+ getObject(source),
42
+ this.getReadOptions(source, options),
43
+ )
42
44
  );
43
45
  }
44
46
 
@@ -48,11 +50,11 @@ class JSONFeature extends FeatureFormat {
48
50
  *
49
51
  * @param {ArrayBuffer|Document|Element|Object|string} source Source.
50
52
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
51
- * @return {Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Features.
53
+ * @return {Array<import('./Feature.js').FeatureClassToFeature<T>>} Features.
52
54
  * @api
53
55
  */
54
56
  readFeatures(source, options) {
55
- return /** @type {Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} */ (
57
+ return /** @type {Array<import('./Feature.js').FeatureClassToFeature<T>>} */ (
56
58
  this.readFeaturesFromObject(
57
59
  getObject(source),
58
60
  this.getReadOptions(source, options),
@@ -65,7 +67,7 @@ class JSONFeature extends FeatureFormat {
65
67
  * @param {Object} object Object.
66
68
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
67
69
  * @protected
68
- * @return {import('./Feature.js').FeatureClassToFeature<FeatureClassType>|Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Feature.
70
+ * @return {import("../Feature.js").default|import("../render/Feature.js").default|Array<import("../render/Feature.js").default>} Feature.
69
71
  */
70
72
  readFeatureFromObject(object, options) {
71
73
  return abstract();
@@ -76,7 +78,7 @@ class JSONFeature extends FeatureFormat {
76
78
  * @param {Object} object Object.
77
79
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
78
80
  * @protected
79
- * @return {Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Features.
81
+ * @return {Array<import("../Feature.js").default|import("../render/Feature.js").default>} Features.
80
82
  */
81
83
  readFeaturesFromObject(object, options) {
82
84
  return abstract();
package/format/MVT.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  export default MVT;
2
- export type Options<FeatureClassType extends import("../Feature.js").FeatureClass = typeof RenderFeature> = {
2
+ export type Options<FeatureClassToFeature extends import("../Feature.js").FeatureClass> = {
3
3
  /**
4
4
  * Class for features returned by
5
5
  * {@link module :ol/format/MVT~MVT#readFeatures}. Set to {@link module :ol/Feature~Feature} to get full editing and geometry
6
6
  * support at the cost of decreased rendering performance. The default is
7
7
  * {@link module :ol/render/Feature~RenderFeature}, which is optimized for rendering and hit detection.
8
8
  */
9
- featureClass?: FeatureClassType | undefined;
9
+ featureClass?: FeatureClassToFeature | undefined;
10
10
  /**
11
11
  * Geometry name to use when creating features.
12
12
  */
@@ -26,9 +26,9 @@ export type Options<FeatureClassType extends import("../Feature.js").FeatureClas
26
26
  idProperty?: string | undefined;
27
27
  };
28
28
  /**
29
- * @template {import("../Feature.js").FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../render/Feature.js").default>]
29
+ * @template {import("../Feature.js").FeatureClass} FeatureClassToFeature
30
30
  * @typedef {Object} Options
31
- * @property {FeatureClassType} [featureClass] Class for features returned by
31
+ * @property {FeatureClassToFeature} [featureClass] Class for features returned by
32
32
  * {@link module:ol/format/MVT~MVT#readFeatures}. Set to {@link module:ol/Feature~Feature} to get full editing and geometry
33
33
  * support at the cost of decreased rendering performance. The default is
34
34
  * {@link module:ol/render/Feature~RenderFeature}, which is optimized for rendering and hit detection.
@@ -42,15 +42,15 @@ export type Options<FeatureClassType extends import("../Feature.js").FeatureClas
42
42
  * @classdesc
43
43
  * Feature format for reading data in the Mapbox MVT format.
44
44
  *
45
- * @template {import('../Feature.js').FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../render/Feature.js").default>]
46
- * @extends {FeatureFormat<FeatureClassType>}
45
+ * @template {import('../Feature.js').FeatureClass} [T=typeof import("../render/Feature.js").default]
46
+ * @extends {FeatureFormat<T>}
47
47
  * @api
48
48
  */
49
- declare class MVT<FeatureClassType extends import("../Feature.js").FeatureClass = typeof RenderFeature> extends FeatureFormat<FeatureClassType> {
49
+ declare class MVT<T extends import("../Feature.js").FeatureClass = typeof RenderFeature> extends FeatureFormat<T> {
50
50
  /**
51
- * @param {Options<FeatureClassType>} [options] Options.
51
+ * @param {Options<T>} [options] Options.
52
52
  */
53
- constructor(options?: Options<FeatureClassType> | undefined);
53
+ constructor(options?: Options<T> | undefined);
54
54
  /**
55
55
  * @private
56
56
  * @type {string|undefined}
@@ -86,7 +86,7 @@ declare class MVT<FeatureClassType extends import("../Feature.js").FeatureClass
86
86
  * @param {PBF} pbf PBF
87
87
  * @param {Object} rawFeature Raw Mapbox feature.
88
88
  * @param {import("./Feature.js").ReadOptions} options Read options.
89
- * @return {import('./Feature.js').FeatureClassToFeature<FeatureClassType>|null} Feature.
89
+ * @return {import("../Feature.js").FeatureLike|null} Feature.
90
90
  */
91
91
  private createFeature_;
92
92
  /**
@@ -94,10 +94,10 @@ declare class MVT<FeatureClassType extends import("../Feature.js").FeatureClass
94
94
  *
95
95
  * @param {ArrayBuffer} source Source.
96
96
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
97
- * @return {Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Features.
97
+ * @return {Array<import('./Feature.js').FeatureClassToFeature<T>>} Features.
98
98
  * @api
99
99
  */
100
- readFeatures(source: ArrayBuffer, options?: import("./Feature.js").ReadOptions | undefined): Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>;
100
+ readFeatures(source: ArrayBuffer, options?: import("./Feature.js").ReadOptions | undefined): Array<import('./Feature.js').FeatureClassToFeature<T>>;
101
101
  /**
102
102
  * Read the projection from the source.
103
103
  *
@@ -1 +1 @@
1
- {"version":3,"file":"MVT.d.ts","sourceRoot":"","sources":["MVT.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA;;;;;;;;;;;;GAYG;AAEH;;;;;;;GAOG;AACH;IACE;;OAEG;IACH,6DA6CC;IA5BC;;;OAGG;IACH,sBAAyC;IAEzC;;;OAGG;IACH,mBAAiE;IAEjE;;;OAGG;IACH,gBAAqD;IAErD;;;OAGG;IACH,oBAAqC;IAQvC;;;;;;;;OAQG;IACH,yBAoDC;IAED;;;;;;OAMG;IACH,uBAqEC;IASD;;;;;;;OAOG;IACH,qBALW,WAAW,6DAEV,MAAM,OAAO,cAAc,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAAC,CAkChF;IAED;;;;;;OAMG;IACH,uBAJW,QAAQ,GAAC,OAAO,SAAQ,MAAM,GAC7B,OAAO,uBAAuB,EAAE,OAAO,CAKlD;IAED;;;;OAIG;IACH,kBAHW,MAAM,MAAM,CAAC,QAKvB;CACF;0BA7RyB,sBAAsB;0BATU,cAAc"}
1
+ {"version":3,"file":"MVT.d.ts","sourceRoot":"","sources":["MVT.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA;;;;;;;;;;;;GAYG;AAEH;;;;;;;GAOG;AACH;IACE;;OAEG;IACH,8CA6CC;IA5BC;;;OAGG;IACH,sBAAyC;IAEzC;;;OAGG;IACH,mBAAiE;IAEjE;;;OAGG;IACH,gBAAqD;IAErD;;;OAGG;IACH,oBAAqC;IAQvC;;;;;;;;OAQG;IACH,yBAoDC;IAED;;;;;;OAMG;IACH,uBAuEC;IASD;;;;;;;OAOG;IACH,qBALW,WAAW,6DAEV,MAAM,OAAO,cAAc,EAAE,qBAAqB,CA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