@vaadin/bundles 23.0.9 → 23.0.12

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 (38) hide show
  1. package/node_modules_ol_ImageCanvas_js.js +121 -0
  2. package/node_modules_ol_ImageCanvas_js.js.map +1 -0
  3. package/node_modules_ol_ImageTile_js.js +177 -0
  4. package/node_modules_ol_ImageTile_js.js.map +1 -0
  5. package/node_modules_ol_TileRange_js.js +154 -0
  6. package/node_modules_ol_TileRange_js.js.map +1 -0
  7. package/node_modules_ol_VectorRenderTile_js.js +182 -0
  8. package/node_modules_ol_VectorRenderTile_js.js.map +1 -0
  9. package/node_modules_ol_VectorTile_js.js +158 -0
  10. package/node_modules_ol_VectorTile_js.js.map +1 -0
  11. package/node_modules_ol_geom_flat_geodesic_js.js +171 -0
  12. package/node_modules_ol_geom_flat_geodesic_js.js.map +1 -0
  13. package/node_modules_ol_render_js.js +131 -0
  14. package/node_modules_ol_render_js.js.map +1 -0
  15. package/node_modules_ol_structs_LRUCache_js.js +275 -0
  16. package/node_modules_ol_structs_LRUCache_js.js.map +1 -0
  17. package/node_modules_ol_style_js.js +47 -0
  18. package/node_modules_ol_style_js.js.map +1 -0
  19. package/node_modules_ol_tilecoord_js.js +115 -0
  20. package/node_modules_ol_tilecoord_js.js.map +1 -0
  21. package/package.json +146 -119
  22. package/vaadin-bundle.json +2571 -949
  23. package/vaadin.js +83552 -36675
  24. package/vaadin.js.map +1 -1
  25. package/vendors-node_modules_ol_Geolocation_js.js +379 -0
  26. package/vendors-node_modules_ol_Geolocation_js.js.map +1 -0
  27. package/vendors-node_modules_ol_TileCache_js.js +461 -0
  28. package/vendors-node_modules_ol_TileCache_js.js.map +1 -0
  29. package/vendors-node_modules_ol_Tile_js.js +330 -0
  30. package/vendors-node_modules_ol_Tile_js.js.map +1 -0
  31. package/vendors-node_modules_ol_index_js.js +874 -0
  32. package/vendors-node_modules_ol_index_js.js.map +1 -0
  33. package/vendors-node_modules_ol_layer_Graticule_js.js +1359 -0
  34. package/vendors-node_modules_ol_layer_Graticule_js.js.map +1 -0
  35. package/vendors-node_modules_ol_style_Text_js.js +509 -0
  36. package/vendors-node_modules_ol_style_Text_js.js.map +1 -0
  37. package/vendors-node_modules_rbush_index_js.js +531 -0
  38. package/vendors-node_modules_rbush_index_js.js.map +1 -0
@@ -0,0 +1,330 @@
1
+ (self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["vendors-node_modules_ol_Tile_js"],{
2
+
3
+ /***/ "./node_modules/ol/Tile.js":
4
+ /*!*********************************!*\
5
+ !*** ./node_modules/ol/Tile.js ***!
6
+ \*********************************/
7
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
8
+
9
+ __webpack_require__.r(__webpack_exports__);
10
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
12
+ /* harmony export */ });
13
+ /* harmony import */ var _events_Target_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./events/Target.js */ "./node_modules/ol/events/Target.js");
14
+ /* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./events/EventType.js */ "./node_modules/ol/events/EventType.js");
15
+ /* harmony import */ var _TileState_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TileState.js */ "./node_modules/ol/TileState.js");
16
+ /* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util.js */ "./node_modules/ol/util.js");
17
+ /* harmony import */ var _easing_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./easing.js */ "./node_modules/ol/easing.js");
18
+ var __extends = (undefined && undefined.__extends) || (function () {
19
+ var extendStatics = function (d, b) {
20
+ extendStatics = Object.setPrototypeOf ||
21
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
22
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
23
+ return extendStatics(d, b);
24
+ };
25
+ return function (d, b) {
26
+ if (typeof b !== "function" && b !== null)
27
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
28
+ extendStatics(d, b);
29
+ function __() { this.constructor = d; }
30
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
31
+ };
32
+ })();
33
+ /**
34
+ * @module ol/Tile
35
+ */
36
+
37
+
38
+
39
+
40
+
41
+ /**
42
+ * A function that takes an {@link module:ol/Tile~Tile} for the tile and a
43
+ * `{string}` for the url as arguments. The default is
44
+ * ```js
45
+ * source.setTileLoadFunction(function(tile, src) {
46
+ * tile.getImage().src = src;
47
+ * });
48
+ * ```
49
+ * For more fine grained control, the load function can use fetch or XMLHttpRequest and involve
50
+ * error handling:
51
+ *
52
+ * ```js
53
+ * import TileState from 'ol/TileState';
54
+ *
55
+ * source.setTileLoadFunction(function(tile, src) {
56
+ * var xhr = new XMLHttpRequest();
57
+ * xhr.responseType = 'blob';
58
+ * xhr.addEventListener('loadend', function (evt) {
59
+ * var data = this.response;
60
+ * if (data !== undefined) {
61
+ * tile.getImage().src = URL.createObjectURL(data);
62
+ * } else {
63
+ * tile.setState(TileState.ERROR);
64
+ * }
65
+ * });
66
+ * xhr.addEventListener('error', function () {
67
+ * tile.setState(TileState.ERROR);
68
+ * });
69
+ * xhr.open('GET', src);
70
+ * xhr.send();
71
+ * });
72
+ * ```
73
+ *
74
+ * @typedef {function(Tile, string): void} LoadFunction
75
+ * @api
76
+ */
77
+ /**
78
+ * {@link module:ol/source/Tile~TileSource} sources use a function of this type to get
79
+ * the url that provides a tile for a given tile coordinate.
80
+ *
81
+ * This function takes an {@link module:ol/tilecoord~TileCoord} for the tile
82
+ * coordinate, a `{number}` representing the pixel ratio and a
83
+ * {@link module:ol/proj/Projection~Projection} for the projection as arguments
84
+ * and returns a `{string}` representing the tile URL, or undefined if no tile
85
+ * should be requested for the passed tile coordinate.
86
+ *
87
+ * @typedef {function(import("./tilecoord.js").TileCoord, number,
88
+ * import("./proj/Projection.js").default): (string|undefined)} UrlFunction
89
+ * @api
90
+ */
91
+ /**
92
+ * @typedef {Object} Options
93
+ * @property {number} [transition=250] A duration for tile opacity
94
+ * transitions in milliseconds. A duration of 0 disables the opacity transition.
95
+ * @property {boolean} [interpolate=false] Use interpolated values when resampling. By default,
96
+ * the nearest neighbor is used when resampling.
97
+ * @api
98
+ */
99
+ /**
100
+ * @classdesc
101
+ * Base class for tiles.
102
+ *
103
+ * @abstract
104
+ */
105
+ var Tile = /** @class */ (function (_super) {
106
+ __extends(Tile, _super);
107
+ /**
108
+ * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
109
+ * @param {import("./TileState.js").default} state State.
110
+ * @param {Options} [opt_options] Tile options.
111
+ */
112
+ function Tile(tileCoord, state, opt_options) {
113
+ var _this = _super.call(this) || this;
114
+ var options = opt_options ? opt_options : {};
115
+ /**
116
+ * @type {import("./tilecoord.js").TileCoord}
117
+ */
118
+ _this.tileCoord = tileCoord;
119
+ /**
120
+ * @protected
121
+ * @type {import("./TileState.js").default}
122
+ */
123
+ _this.state = state;
124
+ /**
125
+ * An "interim" tile for this tile. The interim tile may be used while this
126
+ * one is loading, for "smooth" transitions when changing params/dimensions
127
+ * on the source.
128
+ * @type {Tile}
129
+ */
130
+ _this.interimTile = null;
131
+ /**
132
+ * A key assigned to the tile. This is used by the tile source to determine
133
+ * if this tile can effectively be used, or if a new tile should be created
134
+ * and this one be used as an interim tile for this new tile.
135
+ * @type {string}
136
+ */
137
+ _this.key = '';
138
+ /**
139
+ * The duration for the opacity transition.
140
+ * @type {number}
141
+ */
142
+ _this.transition_ =
143
+ options.transition === undefined ? 250 : options.transition;
144
+ /**
145
+ * Lookup of start times for rendering transitions. If the start time is
146
+ * equal to -1, the transition is complete.
147
+ * @type {Object<string, number>}
148
+ */
149
+ _this.transitionStarts_ = {};
150
+ /**
151
+ * @type {boolean}
152
+ */
153
+ _this.interpolate = !!options.interpolate;
154
+ return _this;
155
+ }
156
+ /**
157
+ * @protected
158
+ */
159
+ Tile.prototype.changed = function () {
160
+ this.dispatchEvent(_events_EventType_js__WEBPACK_IMPORTED_MODULE_0__["default"].CHANGE);
161
+ };
162
+ /**
163
+ * Called by the tile cache when the tile is removed from the cache due to expiry
164
+ */
165
+ Tile.prototype.release = function () { };
166
+ /**
167
+ * @return {string} Key.
168
+ */
169
+ Tile.prototype.getKey = function () {
170
+ return this.key + '/' + this.tileCoord;
171
+ };
172
+ /**
173
+ * Get the interim tile most suitable for rendering using the chain of interim
174
+ * tiles. This corresponds to the most recent tile that has been loaded, if no
175
+ * such tile exists, the original tile is returned.
176
+ * @return {!Tile} Best tile for rendering.
177
+ */
178
+ Tile.prototype.getInterimTile = function () {
179
+ if (!this.interimTile) {
180
+ //empty chain
181
+ return this;
182
+ }
183
+ var tile = this.interimTile;
184
+ // find the first loaded tile and return it. Since the chain is sorted in
185
+ // decreasing order of creation time, there is no need to search the remainder
186
+ // of the list (all those tiles correspond to older requests and will be
187
+ // cleaned up by refreshInterimChain)
188
+ do {
189
+ if (tile.getState() == _TileState_js__WEBPACK_IMPORTED_MODULE_1__["default"].LOADED) {
190
+ // Show tile immediately instead of fading it in after loading, because
191
+ // the interim tile is in place already
192
+ this.transition_ = 0;
193
+ return tile;
194
+ }
195
+ tile = tile.interimTile;
196
+ } while (tile);
197
+ // we can not find a better tile
198
+ return this;
199
+ };
200
+ /**
201
+ * Goes through the chain of interim tiles and discards sections of the chain
202
+ * that are no longer relevant.
203
+ */
204
+ Tile.prototype.refreshInterimChain = function () {
205
+ if (!this.interimTile) {
206
+ return;
207
+ }
208
+ var tile = this.interimTile;
209
+ /**
210
+ * @type {Tile}
211
+ */
212
+ var prev = this;
213
+ do {
214
+ if (tile.getState() == _TileState_js__WEBPACK_IMPORTED_MODULE_1__["default"].LOADED) {
215
+ //we have a loaded tile, we can discard the rest of the list
216
+ //we would could abort any LOADING tile request
217
+ //older than this tile (i.e. any LOADING tile following this entry in the chain)
218
+ tile.interimTile = null;
219
+ break;
220
+ }
221
+ else if (tile.getState() == _TileState_js__WEBPACK_IMPORTED_MODULE_1__["default"].LOADING) {
222
+ //keep this LOADING tile any loaded tiles later in the chain are
223
+ //older than this tile, so we're still interested in the request
224
+ prev = tile;
225
+ }
226
+ else if (tile.getState() == _TileState_js__WEBPACK_IMPORTED_MODULE_1__["default"].IDLE) {
227
+ //the head of the list is the most current tile, we don't need
228
+ //to start any other requests for this chain
229
+ prev.interimTile = tile.interimTile;
230
+ }
231
+ else {
232
+ prev = tile;
233
+ }
234
+ tile = prev.interimTile;
235
+ } while (tile);
236
+ };
237
+ /**
238
+ * Get the tile coordinate for this tile.
239
+ * @return {import("./tilecoord.js").TileCoord} The tile coordinate.
240
+ * @api
241
+ */
242
+ Tile.prototype.getTileCoord = function () {
243
+ return this.tileCoord;
244
+ };
245
+ /**
246
+ * @return {import("./TileState.js").default} State.
247
+ */
248
+ Tile.prototype.getState = function () {
249
+ return this.state;
250
+ };
251
+ /**
252
+ * Sets the state of this tile. If you write your own {@link module:ol/Tile~LoadFunction tileLoadFunction} ,
253
+ * it is important to set the state correctly to {@link module:ol/TileState~ERROR}
254
+ * when the tile cannot be loaded. Otherwise the tile cannot be removed from
255
+ * the tile queue and will block other requests.
256
+ * @param {import("./TileState.js").default} state State.
257
+ * @api
258
+ */
259
+ Tile.prototype.setState = function (state) {
260
+ if (this.state !== _TileState_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERROR && this.state > state) {
261
+ throw new Error('Tile load sequence violation');
262
+ }
263
+ this.state = state;
264
+ this.changed();
265
+ };
266
+ /**
267
+ * Load the image or retry if loading previously failed.
268
+ * Loading is taken care of by the tile queue, and calling this method is
269
+ * only needed for preloading or for reloading in case of an error.
270
+ * @abstract
271
+ * @api
272
+ */
273
+ Tile.prototype.load = function () {
274
+ (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.abstract)();
275
+ };
276
+ /**
277
+ * Get the alpha value for rendering.
278
+ * @param {string} id An id for the renderer.
279
+ * @param {number} time The render frame time.
280
+ * @return {number} A number between 0 and 1.
281
+ */
282
+ Tile.prototype.getAlpha = function (id, time) {
283
+ if (!this.transition_) {
284
+ return 1;
285
+ }
286
+ var start = this.transitionStarts_[id];
287
+ if (!start) {
288
+ start = time;
289
+ this.transitionStarts_[id] = start;
290
+ }
291
+ else if (start === -1) {
292
+ return 1;
293
+ }
294
+ var delta = time - start + 1000 / 60; // avoid rendering at 0
295
+ if (delta >= this.transition_) {
296
+ return 1;
297
+ }
298
+ return (0,_easing_js__WEBPACK_IMPORTED_MODULE_3__.easeIn)(delta / this.transition_);
299
+ };
300
+ /**
301
+ * Determine if a tile is in an alpha transition. A tile is considered in
302
+ * transition if tile.getAlpha() has not yet been called or has been called
303
+ * and returned 1.
304
+ * @param {string} id An id for the renderer.
305
+ * @return {boolean} The tile is in transition.
306
+ */
307
+ Tile.prototype.inTransition = function (id) {
308
+ if (!this.transition_) {
309
+ return false;
310
+ }
311
+ return this.transitionStarts_[id] !== -1;
312
+ };
313
+ /**
314
+ * Mark a transition as complete.
315
+ * @param {string} id An id for the renderer.
316
+ */
317
+ Tile.prototype.endTransition = function (id) {
318
+ if (this.transition_) {
319
+ this.transitionStarts_[id] = -1;
320
+ }
321
+ };
322
+ return Tile;
323
+ }(_events_Target_js__WEBPACK_IMPORTED_MODULE_4__["default"]));
324
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Tile);
325
+ //# sourceMappingURL=Tile.js.map
326
+
327
+ /***/ })
328
+
329
+ }])
330
+ //# sourceMappingURL=vendors-node_modules_ol_Tile_js.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendors-node_modules_ol_Tile_js.js","mappings":";;;;;;;;;;;;;;;;;AAAA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AAC6C;AACC;AACP;AACF;AACA;AACrC;AACA,6BAA6B,2BAA2B;AACxD,KAAK,OAAO;AACZ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA;AACA;AACA,IAAI,wCAAwC;AAC5C;AACA;AACA,2BAA2B,qCAAqC;AAChE,mBAAmB,OAAO;AAC1B,IAAI,4CAA4C;AAChD,mBAAmB,OAAO;AAC1B;AACA;AACA,aAAa;AACb,0EAA0E;AAC1E;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,QAAQ;AACtB;AACA,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD,eAAe,kCAAkC;AACjD,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,mEAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4DAAgB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,mCAAmC,4DAAgB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,6DAAiB;AACzD;AACA;AACA;AACA;AACA,wCAAwC,0DAAc;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,gBAAgB,oCAAoC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kCAAkC;AAClD;AACA;AACA;AACA;AACA;AACA,2DAA2D,oDAAoD;AAC/G,sDAAsD;AACtD;AACA;AACA,eAAe,kCAAkC;AACjD;AACA;AACA;AACA,2BAA2B,2DAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,kDAAQ;AAChB;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA,eAAe,kDAAM;AACrB;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,yDAAW;AACb,iEAAe,IAAI,EAAC;AACpB","sources":["webpack://@vaadin/bundles/./node_modules/ol/Tile.js"],"sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Tile\n */\nimport EventTarget from './events/Target.js';\nimport EventType from './events/EventType.js';\nimport TileState from './TileState.js';\nimport { abstract } from './util.js';\nimport { easeIn } from './easing.js';\n/**\n * A function that takes an {@link module:ol/Tile~Tile} for the tile and a\n * `{string}` for the url as arguments. The default is\n * ```js\n * source.setTileLoadFunction(function(tile, src) {\n * tile.getImage().src = src;\n * });\n * ```\n * For more fine grained control, the load function can use fetch or XMLHttpRequest and involve\n * error handling:\n *\n * ```js\n * import TileState from 'ol/TileState';\n *\n * source.setTileLoadFunction(function(tile, src) {\n * var xhr = new XMLHttpRequest();\n * xhr.responseType = 'blob';\n * xhr.addEventListener('loadend', function (evt) {\n * var data = this.response;\n * if (data !== undefined) {\n * tile.getImage().src = URL.createObjectURL(data);\n * } else {\n * tile.setState(TileState.ERROR);\n * }\n * });\n * xhr.addEventListener('error', function () {\n * tile.setState(TileState.ERROR);\n * });\n * xhr.open('GET', src);\n * xhr.send();\n * });\n * ```\n *\n * @typedef {function(Tile, string): void} LoadFunction\n * @api\n */\n/**\n * {@link module:ol/source/Tile~TileSource} sources use a function of this type to get\n * the url that provides a tile for a given tile coordinate.\n *\n * This function takes an {@link module:ol/tilecoord~TileCoord} for the tile\n * coordinate, a `{number}` representing the pixel ratio and a\n * {@link module:ol/proj/Projection~Projection} for the projection as arguments\n * and returns a `{string}` representing the tile URL, or undefined if no tile\n * should be requested for the passed tile coordinate.\n *\n * @typedef {function(import(\"./tilecoord.js\").TileCoord, number,\n * import(\"./proj/Projection.js\").default): (string|undefined)} UrlFunction\n * @api\n */\n/**\n * @typedef {Object} Options\n * @property {number} [transition=250] A duration for tile opacity\n * transitions in milliseconds. A duration of 0 disables the opacity transition.\n * @property {boolean} [interpolate=false] Use interpolated values when resampling. By default,\n * the nearest neighbor is used when resampling.\n * @api\n */\n/**\n * @classdesc\n * Base class for tiles.\n *\n * @abstract\n */\nvar Tile = /** @class */ (function (_super) {\n __extends(Tile, _super);\n /**\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {import(\"./TileState.js\").default} state State.\n * @param {Options} [opt_options] Tile options.\n */\n function Tile(tileCoord, state, opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @type {import(\"./tilecoord.js\").TileCoord}\n */\n _this.tileCoord = tileCoord;\n /**\n * @protected\n * @type {import(\"./TileState.js\").default}\n */\n _this.state = state;\n /**\n * An \"interim\" tile for this tile. The interim tile may be used while this\n * one is loading, for \"smooth\" transitions when changing params/dimensions\n * on the source.\n * @type {Tile}\n */\n _this.interimTile = null;\n /**\n * A key assigned to the tile. This is used by the tile source to determine\n * if this tile can effectively be used, or if a new tile should be created\n * and this one be used as an interim tile for this new tile.\n * @type {string}\n */\n _this.key = '';\n /**\n * The duration for the opacity transition.\n * @type {number}\n */\n _this.transition_ =\n options.transition === undefined ? 250 : options.transition;\n /**\n * Lookup of start times for rendering transitions. If the start time is\n * equal to -1, the transition is complete.\n * @type {Object<string, number>}\n */\n _this.transitionStarts_ = {};\n /**\n * @type {boolean}\n */\n _this.interpolate = !!options.interpolate;\n return _this;\n }\n /**\n * @protected\n */\n Tile.prototype.changed = function () {\n this.dispatchEvent(EventType.CHANGE);\n };\n /**\n * Called by the tile cache when the tile is removed from the cache due to expiry\n */\n Tile.prototype.release = function () { };\n /**\n * @return {string} Key.\n */\n Tile.prototype.getKey = function () {\n return this.key + '/' + this.tileCoord;\n };\n /**\n * Get the interim tile most suitable for rendering using the chain of interim\n * tiles. This corresponds to the most recent tile that has been loaded, if no\n * such tile exists, the original tile is returned.\n * @return {!Tile} Best tile for rendering.\n */\n Tile.prototype.getInterimTile = function () {\n if (!this.interimTile) {\n //empty chain\n return this;\n }\n var tile = this.interimTile;\n // find the first loaded tile and return it. Since the chain is sorted in\n // decreasing order of creation time, there is no need to search the remainder\n // of the list (all those tiles correspond to older requests and will be\n // cleaned up by refreshInterimChain)\n do {\n if (tile.getState() == TileState.LOADED) {\n // Show tile immediately instead of fading it in after loading, because\n // the interim tile is in place already\n this.transition_ = 0;\n return tile;\n }\n tile = tile.interimTile;\n } while (tile);\n // we can not find a better tile\n return this;\n };\n /**\n * Goes through the chain of interim tiles and discards sections of the chain\n * that are no longer relevant.\n */\n Tile.prototype.refreshInterimChain = function () {\n if (!this.interimTile) {\n return;\n }\n var tile = this.interimTile;\n /**\n * @type {Tile}\n */\n var prev = this;\n do {\n if (tile.getState() == TileState.LOADED) {\n //we have a loaded tile, we can discard the rest of the list\n //we would could abort any LOADING tile request\n //older than this tile (i.e. any LOADING tile following this entry in the chain)\n tile.interimTile = null;\n break;\n }\n else if (tile.getState() == TileState.LOADING) {\n //keep this LOADING tile any loaded tiles later in the chain are\n //older than this tile, so we're still interested in the request\n prev = tile;\n }\n else if (tile.getState() == TileState.IDLE) {\n //the head of the list is the most current tile, we don't need\n //to start any other requests for this chain\n prev.interimTile = tile.interimTile;\n }\n else {\n prev = tile;\n }\n tile = prev.interimTile;\n } while (tile);\n };\n /**\n * Get the tile coordinate for this tile.\n * @return {import(\"./tilecoord.js\").TileCoord} The tile coordinate.\n * @api\n */\n Tile.prototype.getTileCoord = function () {\n return this.tileCoord;\n };\n /**\n * @return {import(\"./TileState.js\").default} State.\n */\n Tile.prototype.getState = function () {\n return this.state;\n };\n /**\n * Sets the state of this tile. If you write your own {@link module:ol/Tile~LoadFunction tileLoadFunction} ,\n * it is important to set the state correctly to {@link module:ol/TileState~ERROR}\n * when the tile cannot be loaded. Otherwise the tile cannot be removed from\n * the tile queue and will block other requests.\n * @param {import(\"./TileState.js\").default} state State.\n * @api\n */\n Tile.prototype.setState = function (state) {\n if (this.state !== TileState.ERROR && this.state > state) {\n throw new Error('Tile load sequence violation');\n }\n this.state = state;\n this.changed();\n };\n /**\n * Load the image or retry if loading previously failed.\n * Loading is taken care of by the tile queue, and calling this method is\n * only needed for preloading or for reloading in case of an error.\n * @abstract\n * @api\n */\n Tile.prototype.load = function () {\n abstract();\n };\n /**\n * Get the alpha value for rendering.\n * @param {string} id An id for the renderer.\n * @param {number} time The render frame time.\n * @return {number} A number between 0 and 1.\n */\n Tile.prototype.getAlpha = function (id, time) {\n if (!this.transition_) {\n return 1;\n }\n var start = this.transitionStarts_[id];\n if (!start) {\n start = time;\n this.transitionStarts_[id] = start;\n }\n else if (start === -1) {\n return 1;\n }\n var delta = time - start + 1000 / 60; // avoid rendering at 0\n if (delta >= this.transition_) {\n return 1;\n }\n return easeIn(delta / this.transition_);\n };\n /**\n * Determine if a tile is in an alpha transition. A tile is considered in\n * transition if tile.getAlpha() has not yet been called or has been called\n * and returned 1.\n * @param {string} id An id for the renderer.\n * @return {boolean} The tile is in transition.\n */\n Tile.prototype.inTransition = function (id) {\n if (!this.transition_) {\n return false;\n }\n return this.transitionStarts_[id] !== -1;\n };\n /**\n * Mark a transition as complete.\n * @param {string} id An id for the renderer.\n */\n Tile.prototype.endTransition = function (id) {\n if (this.transition_) {\n this.transitionStarts_[id] = -1;\n }\n };\n return Tile;\n}(EventTarget));\nexport default Tile;\n//# sourceMappingURL=Tile.js.map"],"names":[],"sourceRoot":""}