@datagouv/components-next 1.0.2-dev.113 → 1.0.2-dev.114
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.
- package/dist/{Control-ZFh5ta_U.js → Control-b-43UT2B.js} +10 -10
- package/dist/{Datafair.client-CKB2P_X1.js → Datafair.client-BH351yV9.js} +4 -4
- package/dist/{Event-DSQcW7OF.js → Event-py_AAwJY.js} +18 -18
- package/dist/{Image-BijNEG0p.js → Image-BHQYZWzH.js} +23 -23
- package/dist/{JsonPreview.client-Bx11-jfT.js → JsonPreview.client-CawLfTe_.js} +5 -5
- package/dist/{Map-BUtPf5GN.js → Map-CtP7leHl.js} +1313 -1173
- package/dist/{MapContainer.client-CdZSeT_L.js → MapContainer.client-DN8kHTOA.js} +17 -17
- package/dist/{OSM-D4MTdBtk.js → OSM-gdDSIsDA.js} +15 -23
- package/dist/{PdfPreview.client-Bh9lP-qU.js → PdfPreview.client-BGOycK0h.js} +6 -10
- package/dist/Pmtiles.client-CRaI4U8S.js +26123 -0
- package/dist/{PreviewWrapper.vue_vue_type_script_setup_true_lang-BnC7vWGP.js → PreviewWrapper.vue_vue_type_script_setup_true_lang-DAddoRna.js} +2 -2
- package/dist/{ScaleLine-hJQIqcZm.js → ScaleLine-hG-FhNqy.js} +2 -2
- package/dist/{Tile-Dcl7oIVu.js → Tile-D6rFonpT.js} +163 -166
- package/dist/{TileImage-BJeHipMX.js → TileImage-cfrEgz5y.js} +131 -119
- package/dist/{View-xp_P_OHw.js → View-vp7vDb9q.js} +169 -119
- package/dist/{XmlPreview.client-oFAOv828.js → XmlPreview.client-Dyv0J4kw.js} +5 -5
- package/dist/{common-BjQlan3k.js → common-C8efyyuc.js} +49 -49
- package/dist/components-next.css +1 -52
- package/dist/components-next.js +36 -36
- package/dist/components.css +2 -2
- package/dist/{index-CxCuKQ81.js → index-_qLRU0Z5.js} +6382 -6057
- package/dist/{leaflet-src-7m1mB8LI.js → leaflet-src-D_sX6kLJ.js} +162 -164
- package/dist/{main-CQ9ZQG7n.js → main-CR8bhz_w.js} +19161 -20321
- package/dist/{proj-CsNo9yH1.js → proj-CsjVeojN.js} +322 -306
- package/dist/{text-clamp.esm-B5kW_XMt.js → text-clamp.esm-DVseBqZZ.js} +4 -4
- package/dist/{tilecoord-A0fLnBZr.js → tilecoord-CPcQJnrF.js} +270 -261
- package/dist/{vue3-json-viewer-BXwup7nO.js → vue3-json-viewer-CJLQFzXZ.js} +10 -16
- package/dist/{vue3-xml-viewer.common-B9qp90K_.js → vue3-xml-viewer.common-DRgxPToX.js} +1 -1
- package/package.json +34 -34
- package/src/components/ResourceAccordion/Pmtiles.client.vue +3 -1
- package/dist/Pmtiles.client-Bi46wN14.js +0 -25185
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as g, s as W, T as _,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { a as Y, e as f, d as b, h as D, w as v, I as K, R as N, g as k } from "./tilecoord-CPcQJnrF.js";
|
|
2
|
+
import { t as g, s as W, T as _, b as q } from "./Image-BHQYZWzH.js";
|
|
3
|
+
import { au as H, ai as $, z as j, aw as V, p as B, o as F, _ as x, a4 as E, M as J, ae as Q, ao as w, u as tt, ab as et, aA as it, a as nt, am as R, d as rt, B as st, U as P, E as ot } from "./proj-CsjVeojN.js";
|
|
4
|
+
import { c as m, a as A, n as lt, D as at } from "./common-C8efyyuc.js";
|
|
5
5
|
const T = [0, 0, 0], d = 5;
|
|
6
|
-
class
|
|
6
|
+
class U {
|
|
7
7
|
/**
|
|
8
8
|
* @param {Options} options Tile grid options.
|
|
9
9
|
*/
|
|
@@ -16,13 +16,13 @@ class X {
|
|
|
16
16
|
* @param {number} b Second resolution
|
|
17
17
|
* @return {number} Comparison result
|
|
18
18
|
*/
|
|
19
|
-
(n,
|
|
19
|
+
(n, s) => s - n
|
|
20
20
|
),
|
|
21
21
|
"`resolutions` must be sorted in descending order"
|
|
22
22
|
);
|
|
23
23
|
let e;
|
|
24
24
|
if (!t.origins) {
|
|
25
|
-
for (let n = 0,
|
|
25
|
+
for (let n = 0, s = this.resolutions_.length - 1; n < s; ++n)
|
|
26
26
|
if (!e)
|
|
27
27
|
e = this.resolutions_[n] / this.resolutions_[n + 1];
|
|
28
28
|
else if (this.resolutions_[n] / this.resolutions_[n + 1] !== e) {
|
|
@@ -44,18 +44,18 @@ class X {
|
|
|
44
44
|
)), this.tileSize_ = t.tileSize !== void 0 ? t.tileSize : this.tileSizes_ ? null : A, m(
|
|
45
45
|
!this.tileSize_ && this.tileSizes_ || this.tileSize_ && !this.tileSizes_,
|
|
46
46
|
"Either `tileSize` or `tileSizes` must be configured, never both"
|
|
47
|
-
), this.extent_ = i !== void 0 ? i : null, this.fullTileRanges_ = null, this.tmpSize_ = [0, 0], this.tmpExtent_ = [0, 0, 0, 0], t.sizes !== void 0 ? this.fullTileRanges_ = t.sizes.map((n,
|
|
48
|
-
const
|
|
47
|
+
), this.extent_ = i !== void 0 ? i : null, this.fullTileRanges_ = null, this.tmpSize_ = [0, 0], this.tmpExtent_ = [0, 0, 0, 0], t.sizes !== void 0 ? this.fullTileRanges_ = t.sizes.map((n, s) => {
|
|
48
|
+
const r = new Y(
|
|
49
49
|
Math.min(0, n[0]),
|
|
50
50
|
Math.max(n[0] - 1, -1),
|
|
51
51
|
Math.min(0, n[1]),
|
|
52
52
|
Math.max(n[1] - 1, -1)
|
|
53
53
|
);
|
|
54
54
|
if (i) {
|
|
55
|
-
const l = this.getTileRangeForExtentAndZ(i,
|
|
56
|
-
|
|
55
|
+
const l = this.getTileRangeForExtentAndZ(i, s);
|
|
56
|
+
r.minX = Math.max(l.minX, r.minX), r.maxX = Math.min(l.maxX, r.maxX), r.minY = Math.max(l.minY, r.minY), r.maxY = Math.min(l.maxY, r.maxY);
|
|
57
57
|
}
|
|
58
|
-
return
|
|
58
|
+
return r;
|
|
59
59
|
}) : i && this.calculateTileRanges_(i);
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
@@ -68,9 +68,9 @@ class X {
|
|
|
68
68
|
*/
|
|
69
69
|
forEachTileCoord(t, e, i) {
|
|
70
70
|
const n = this.getTileRangeForExtentAndZ(t, e);
|
|
71
|
-
for (let
|
|
71
|
+
for (let s = n.minX, r = n.maxX; s <= r; ++s)
|
|
72
72
|
for (let l = n.minY, a = n.maxY; l <= a; ++l)
|
|
73
|
-
i([e,
|
|
73
|
+
i([e, s, l]);
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
|
@@ -80,13 +80,13 @@ class X {
|
|
|
80
80
|
* @return {boolean} Callback succeeded.
|
|
81
81
|
*/
|
|
82
82
|
forEachTileCoordParentTileRange(t, e, i, n) {
|
|
83
|
-
let
|
|
84
|
-
for (this.zoomFactor_ === 2 ? (
|
|
85
|
-
if (
|
|
83
|
+
let s, r, l, a = null, h = t[0] - 1;
|
|
84
|
+
for (this.zoomFactor_ === 2 ? (r = t[1], l = t[2]) : a = this.getTileCoordExtent(t, n); h >= this.minZoom; ) {
|
|
85
|
+
if (r !== void 0 && l !== void 0 ? (r = Math.floor(r / 2), l = Math.floor(l / 2), s = f(r, r, l, l, i)) : s = this.getTileRangeForExtentAndZ(
|
|
86
86
|
a,
|
|
87
87
|
h,
|
|
88
88
|
i
|
|
89
|
-
), e(h,
|
|
89
|
+
), e(h, s))
|
|
90
90
|
return !0;
|
|
91
91
|
--h;
|
|
92
92
|
}
|
|
@@ -125,6 +125,13 @@ class X {
|
|
|
125
125
|
getOrigin(t) {
|
|
126
126
|
return this.origin_ ? this.origin_ : this.origins_[t];
|
|
127
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Get the list of origins for the grid.
|
|
130
|
+
* @return {Array<import("../coordinate.js").Coordinate>|null} Origin.
|
|
131
|
+
*/
|
|
132
|
+
getOrigins() {
|
|
133
|
+
return this.origins_;
|
|
134
|
+
}
|
|
128
135
|
/**
|
|
129
136
|
* Get the resolution for the given zoom level.
|
|
130
137
|
* @param {number} z Integer zoom level.
|
|
@@ -151,12 +158,12 @@ class X {
|
|
|
151
158
|
getTileCoordChildTileRange(t, e, i) {
|
|
152
159
|
if (t[0] < this.maxZoom) {
|
|
153
160
|
if (this.zoomFactor_ === 2) {
|
|
154
|
-
const
|
|
161
|
+
const s = t[1] * 2, r = t[2] * 2;
|
|
155
162
|
return f(
|
|
156
|
-
r,
|
|
157
|
-
r + 1,
|
|
158
163
|
s,
|
|
159
164
|
s + 1,
|
|
165
|
+
r,
|
|
166
|
+
r + 1,
|
|
160
167
|
e
|
|
161
168
|
);
|
|
162
169
|
}
|
|
@@ -181,21 +188,21 @@ class X {
|
|
|
181
188
|
getTileRangeForTileCoordAndZ(t, e, i) {
|
|
182
189
|
if (e > this.maxZoom || e < this.minZoom)
|
|
183
190
|
return null;
|
|
184
|
-
const n = t[0],
|
|
191
|
+
const n = t[0], s = t[1], r = t[2];
|
|
185
192
|
if (e === n)
|
|
186
193
|
return f(
|
|
187
|
-
r,
|
|
188
194
|
s,
|
|
189
195
|
r,
|
|
190
196
|
s,
|
|
197
|
+
r,
|
|
191
198
|
i
|
|
192
199
|
);
|
|
193
200
|
if (this.zoomFactor_) {
|
|
194
|
-
const a = Math.pow(this.zoomFactor_, e - n), h = Math.floor(
|
|
201
|
+
const a = Math.pow(this.zoomFactor_, e - n), h = Math.floor(s * a), c = Math.floor(r * a);
|
|
195
202
|
if (e < n)
|
|
196
|
-
return f(h, h,
|
|
197
|
-
const
|
|
198
|
-
return f(h,
|
|
203
|
+
return f(h, h, c, c, i);
|
|
204
|
+
const u = Math.floor(a * (s + 1)) - 1, S = Math.floor(a * (r + 1)) - 1;
|
|
205
|
+
return f(h, u, c, S, i);
|
|
199
206
|
}
|
|
200
207
|
const l = this.getTileCoordExtent(t, this.tmpExtent_);
|
|
201
208
|
return this.getTileRangeForExtentAndZ(l, e, i);
|
|
@@ -209,10 +216,10 @@ class X {
|
|
|
209
216
|
*/
|
|
210
217
|
getTileRangeForExtentAndZ(t, e, i) {
|
|
211
218
|
this.getTileCoordForXYAndZ_(t[0], t[3], e, !1, T);
|
|
212
|
-
const n = T[1],
|
|
219
|
+
const n = T[1], s = T[2];
|
|
213
220
|
this.getTileCoordForXYAndZ_(t[2], t[1], e, !0, T);
|
|
214
|
-
const
|
|
215
|
-
return f(n,
|
|
221
|
+
const r = T[1], l = T[2];
|
|
222
|
+
return f(n, r, s, l, i);
|
|
216
223
|
}
|
|
217
224
|
/**
|
|
218
225
|
* @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
|
@@ -234,8 +241,8 @@ class X {
|
|
|
234
241
|
* @api
|
|
235
242
|
*/
|
|
236
243
|
getTileCoordExtent(t, e) {
|
|
237
|
-
const i = this.getOrigin(t[0]), n = this.getResolution(t[0]),
|
|
238
|
-
return j(
|
|
244
|
+
const i = this.getOrigin(t[0]), n = this.getResolution(t[0]), s = g(this.getTileSize(t[0]), this.tmpSize_), r = i[0] + t[1] * s[0] * n, l = i[1] - (t[2] + 1) * s[1] * n, a = r + s[0] * n, h = l + s[1] * n;
|
|
245
|
+
return j(r, l, a, h, e);
|
|
239
246
|
}
|
|
240
247
|
/**
|
|
241
248
|
* Get the tile coordinate for the given map coordinate and resolution. This
|
|
@@ -270,10 +277,10 @@ class X {
|
|
|
270
277
|
* @return {import("../tilecoord.js").TileCoord} Tile coordinate.
|
|
271
278
|
* @private
|
|
272
279
|
*/
|
|
273
|
-
getTileCoordForXYAndResolution_(t, e, i, n,
|
|
274
|
-
const
|
|
275
|
-
let
|
|
276
|
-
return n ? (
|
|
280
|
+
getTileCoordForXYAndResolution_(t, e, i, n, s) {
|
|
281
|
+
const r = this.getZForResolution(i), l = i / this.getResolution(r), a = this.getOrigin(r), h = g(this.getTileSize(r), this.tmpSize_);
|
|
282
|
+
let c = l * (t - a[0]) / i / h[0], u = l * (a[1] - e) / i / h[1];
|
|
283
|
+
return n ? (c = F(c, d) - 1, u = F(u, d) - 1) : (c = x(c, d), u = x(u, d)), b(r, c, u, s);
|
|
277
284
|
}
|
|
278
285
|
/**
|
|
279
286
|
* Although there is repetition between this method and `getTileCoordForXYAndResolution_`,
|
|
@@ -290,10 +297,10 @@ class X {
|
|
|
290
297
|
* @return {import("../tilecoord.js").TileCoord} Tile coordinate.
|
|
291
298
|
* @private
|
|
292
299
|
*/
|
|
293
|
-
getTileCoordForXYAndZ_(t, e, i, n,
|
|
294
|
-
const
|
|
295
|
-
let h = (t -
|
|
296
|
-
return n ? (h = F(h, d) - 1,
|
|
300
|
+
getTileCoordForXYAndZ_(t, e, i, n, s) {
|
|
301
|
+
const r = this.getOrigin(i), l = this.getResolution(i), a = g(this.getTileSize(i), this.tmpSize_);
|
|
302
|
+
let h = (t - r[0]) / l / a[0], c = (r[1] - e) / l / a[1];
|
|
303
|
+
return n ? (h = F(h, d) - 1, c = F(c, d) - 1) : (h = x(h, d), c = x(c, d)), b(i, h, c, s);
|
|
297
304
|
}
|
|
298
305
|
/**
|
|
299
306
|
* Get a tile coordinate given a map coordinate and zoom level.
|
|
@@ -388,24 +395,24 @@ class X {
|
|
|
388
395
|
this.fullTileRanges_ = i;
|
|
389
396
|
}
|
|
390
397
|
}
|
|
391
|
-
function
|
|
398
|
+
function p(o) {
|
|
392
399
|
let t = o.getDefaultTileGrid();
|
|
393
|
-
return t || (t =
|
|
400
|
+
return t || (t = ut(o), o.setDefaultTileGrid(t)), t;
|
|
394
401
|
}
|
|
395
402
|
function ht(o, t, e) {
|
|
396
|
-
const i = t[0], n = o.getTileCoordCenter(t),
|
|
397
|
-
if (!tt(
|
|
398
|
-
const
|
|
399
|
-
(
|
|
403
|
+
const i = t[0], n = o.getTileCoordCenter(t), s = X(e);
|
|
404
|
+
if (!tt(s, n)) {
|
|
405
|
+
const r = w(s), l = Math.ceil(
|
|
406
|
+
(s[0] - n[0]) / r
|
|
400
407
|
);
|
|
401
|
-
return n[0] +=
|
|
408
|
+
return n[0] += r * l, o.getTileCoordForCoordAndZ(n, i);
|
|
402
409
|
}
|
|
403
410
|
return t;
|
|
404
411
|
}
|
|
405
|
-
function
|
|
412
|
+
function ct(o, t, e, i) {
|
|
406
413
|
i = i !== void 0 ? i : "top-left";
|
|
407
|
-
const n =
|
|
408
|
-
return new
|
|
414
|
+
const n = O(o, t, e);
|
|
415
|
+
return new U({
|
|
409
416
|
extent: o,
|
|
410
417
|
origin: et(o, i),
|
|
411
418
|
resolutions: n,
|
|
@@ -417,29 +424,29 @@ function jt(o) {
|
|
|
417
424
|
extent: e,
|
|
418
425
|
minZoom: t.minZoom,
|
|
419
426
|
tileSize: t.tileSize,
|
|
420
|
-
resolutions:
|
|
427
|
+
resolutions: O(
|
|
421
428
|
e,
|
|
422
429
|
t.maxZoom,
|
|
423
430
|
t.tileSize,
|
|
424
431
|
t.maxResolution
|
|
425
432
|
)
|
|
426
433
|
};
|
|
427
|
-
return new
|
|
434
|
+
return new U(i);
|
|
428
435
|
}
|
|
429
|
-
function
|
|
436
|
+
function O(o, t, e, i) {
|
|
430
437
|
t = t !== void 0 ? t : at, e = g(e !== void 0 ? e : A);
|
|
431
|
-
const n = Q(o),
|
|
432
|
-
i = i > 0 ? i : Math.max(
|
|
433
|
-
const
|
|
434
|
-
for (let a = 0; a <
|
|
438
|
+
const n = Q(o), s = w(o);
|
|
439
|
+
i = i > 0 ? i : Math.max(s / e[0], n / e[1]);
|
|
440
|
+
const r = t + 1, l = new Array(r);
|
|
441
|
+
for (let a = 0; a < r; ++a)
|
|
435
442
|
l[a] = i / Math.pow(2, a);
|
|
436
443
|
return l;
|
|
437
444
|
}
|
|
438
|
-
function
|
|
439
|
-
const n =
|
|
440
|
-
return
|
|
445
|
+
function ut(o, t, e, i) {
|
|
446
|
+
const n = X(o);
|
|
447
|
+
return ct(n, t, e, i);
|
|
441
448
|
}
|
|
442
|
-
function
|
|
449
|
+
function X(o) {
|
|
443
450
|
o = E(o);
|
|
444
451
|
let t = o.getExtent();
|
|
445
452
|
if (!t) {
|
|
@@ -471,9 +478,9 @@ function _t(o) {
|
|
|
471
478
|
let e = /\{([a-z])-([a-z])\}/.exec(o);
|
|
472
479
|
if (e) {
|
|
473
480
|
const i = e[1].charCodeAt(0), n = e[2].charCodeAt(0);
|
|
474
|
-
let
|
|
475
|
-
for (
|
|
476
|
-
t.push(o.replace(e[0], String.fromCharCode(
|
|
481
|
+
let s;
|
|
482
|
+
for (s = i; s <= n; ++s)
|
|
483
|
+
t.push(o.replace(e[0], String.fromCharCode(s)));
|
|
477
484
|
return t;
|
|
478
485
|
}
|
|
479
486
|
if (e = /\{(\d+)-(\d+)\}/.exec(o), e) {
|
|
@@ -495,13 +502,13 @@ function Ft(o, t) {
|
|
|
495
502
|
(function(e, i, n) {
|
|
496
503
|
if (!e)
|
|
497
504
|
return;
|
|
498
|
-
let
|
|
499
|
-
const
|
|
505
|
+
let s;
|
|
506
|
+
const r = e[0];
|
|
500
507
|
if (t) {
|
|
501
|
-
const l = t.getFullTileRange(
|
|
502
|
-
l && (
|
|
508
|
+
const l = t.getFullTileRange(r);
|
|
509
|
+
l && (s = l.getHeight() - 1);
|
|
503
510
|
}
|
|
504
|
-
return mt(o,
|
|
511
|
+
return mt(o, r, e[1], e[2], s);
|
|
505
512
|
})
|
|
506
513
|
);
|
|
507
514
|
}
|
|
@@ -522,8 +529,8 @@ function Rt(o) {
|
|
|
522
529
|
(function(t, e, i) {
|
|
523
530
|
if (!t)
|
|
524
531
|
return;
|
|
525
|
-
const n = D(t),
|
|
526
|
-
return o[
|
|
532
|
+
const n = D(t), s = it(n, o.length);
|
|
533
|
+
return o[s](t, e, i);
|
|
527
534
|
})
|
|
528
535
|
);
|
|
529
536
|
}
|
|
@@ -562,7 +569,7 @@ class Et extends nt {
|
|
|
562
569
|
return this.projection;
|
|
563
570
|
}
|
|
564
571
|
/**
|
|
565
|
-
* @param {import("../proj/Projection").default} [projection] Projection.
|
|
572
|
+
* @param {import("../proj/Projection.js").default} [projection] Projection.
|
|
566
573
|
* @return {Array<number>|null} Resolutions.
|
|
567
574
|
*/
|
|
568
575
|
getResolutions(t) {
|
|
@@ -664,7 +671,7 @@ class St extends Et {
|
|
|
664
671
|
this.key_ !== t && (this.key_ = t, this.changed());
|
|
665
672
|
}
|
|
666
673
|
/**
|
|
667
|
-
* @param {import("../proj/Projection").default} [projection] Projection.
|
|
674
|
+
* @param {import("../proj/Projection.js").default} [projection] Projection.
|
|
668
675
|
* @return {Array<number>|null} Resolutions.
|
|
669
676
|
* @override
|
|
670
677
|
*/
|
|
@@ -682,7 +689,7 @@ class St extends Et {
|
|
|
682
689
|
* @param {import("../structs/LRUCache.js").default<import("../Tile.js").default>} [tileCache] Tile cache.
|
|
683
690
|
* @return {TileType|null} Tile.
|
|
684
691
|
*/
|
|
685
|
-
getTile(t, e, i, n,
|
|
692
|
+
getTile(t, e, i, n, s, r) {
|
|
686
693
|
return rt();
|
|
687
694
|
}
|
|
688
695
|
/**
|
|
@@ -698,7 +705,7 @@ class St extends Et {
|
|
|
698
705
|
* @return {!import("../tilegrid/TileGrid.js").default} Tile grid.
|
|
699
706
|
*/
|
|
700
707
|
getTileGridForProjection(t) {
|
|
701
|
-
return this.tileGrid ? this.tileGrid :
|
|
708
|
+
return this.tileGrid ? this.tileGrid : p(t);
|
|
702
709
|
}
|
|
703
710
|
/**
|
|
704
711
|
* Get the tile pixel ratio for this source. Subclasses may override this
|
|
@@ -717,8 +724,8 @@ class St extends Et {
|
|
|
717
724
|
* @return {import("../size.js").Size} Tile size.
|
|
718
725
|
*/
|
|
719
726
|
getTilePixelSize(t, e, i) {
|
|
720
|
-
const n = this.getTileGridForProjection(i),
|
|
721
|
-
return
|
|
727
|
+
const n = this.getTileGridForProjection(i), s = this.getTilePixelRatio(e), r = g(n.getTileSize(t), this.tmpSize);
|
|
728
|
+
return s == 1 ? r : W(r, s, this.tmpSize);
|
|
722
729
|
}
|
|
723
730
|
/**
|
|
724
731
|
* Returns a tile coordinate wrapped around the x-axis. When the tile coordinate
|
|
@@ -746,7 +753,7 @@ class St extends Et {
|
|
|
746
753
|
this.clear(), super.refresh();
|
|
747
754
|
}
|
|
748
755
|
}
|
|
749
|
-
class
|
|
756
|
+
class Pt extends st {
|
|
750
757
|
/**
|
|
751
758
|
* @param {string} type Type.
|
|
752
759
|
* @param {import("../Tile.js").default} tile The tile.
|
|
@@ -755,7 +762,7 @@ class zt extends st {
|
|
|
755
762
|
super(t), this.tile = e;
|
|
756
763
|
}
|
|
757
764
|
}
|
|
758
|
-
const
|
|
765
|
+
const z = {
|
|
759
766
|
/**
|
|
760
767
|
* Triggered when a tile starts loading.
|
|
761
768
|
* @event module:ol/source/Tile.TileSourceEvent#tileloadstart
|
|
@@ -837,8 +844,8 @@ class y extends St {
|
|
|
837
844
|
/** @type {import("../Tile.js").default} */
|
|
838
845
|
t.target
|
|
839
846
|
), i = R(e), n = e.getState();
|
|
840
|
-
let
|
|
841
|
-
n == _.LOADING ? (this.tileLoadingKeys_[i] = !0,
|
|
847
|
+
let s;
|
|
848
|
+
n == _.LOADING ? (this.tileLoadingKeys_[i] = !0, s = z.TILELOADSTART) : i in this.tileLoadingKeys_ && (delete this.tileLoadingKeys_[i], s = n == _.ERROR ? z.TILELOADERROR : n == _.LOADED ? z.TILELOADEND : void 0), s != null && this.dispatchEvent(new Pt(s, e));
|
|
842
849
|
}
|
|
843
850
|
/**
|
|
844
851
|
* Deprecated. Use an ImageTile source instead.
|
|
@@ -900,7 +907,7 @@ class At extends y {
|
|
|
900
907
|
projection: t.projection,
|
|
901
908
|
state: t.state,
|
|
902
909
|
tileGrid: t.tileGrid,
|
|
903
|
-
tileLoadFunction: t.tileLoadFunction ? t.tileLoadFunction :
|
|
910
|
+
tileLoadFunction: t.tileLoadFunction ? t.tileLoadFunction : zt,
|
|
904
911
|
tilePixelRatio: t.tilePixelRatio,
|
|
905
912
|
tileUrlFunction: t.tileUrlFunction,
|
|
906
913
|
url: t.url,
|
|
@@ -911,7 +918,7 @@ class At extends y {
|
|
|
911
918
|
key: t.key,
|
|
912
919
|
attributionsCollapsible: t.attributionsCollapsible,
|
|
913
920
|
zDirection: t.zDirection
|
|
914
|
-
}), this.crossOrigin = t.crossOrigin !== void 0 ? t.crossOrigin : null, this.tileClass = t.tileClass !== void 0 ? t.tileClass : K, this.tileGridForProjection = {}, this.reprojectionErrorThreshold_ = t.reprojectionErrorThreshold, this.renderReprojectionEdges_ = !1;
|
|
921
|
+
}), this.crossOrigin = t.crossOrigin !== void 0 ? t.crossOrigin : null, this.referrerPolicy = t.referrerPolicy, this.tileClass = t.tileClass !== void 0 ? t.tileClass : K, this.tileGridForProjection = {}, this.reprojectionErrorThreshold_ = t.reprojectionErrorThreshold, this.renderReprojectionEdges_ = !1;
|
|
915
922
|
}
|
|
916
923
|
/**
|
|
917
924
|
* @param {import("../proj/Projection.js").default} projection Projection.
|
|
@@ -919,7 +926,7 @@ class At extends y {
|
|
|
919
926
|
* @override
|
|
920
927
|
*/
|
|
921
928
|
getGutterForProjection(t) {
|
|
922
|
-
return this.getProjection() && t && !
|
|
929
|
+
return this.getProjection() && t && !P(this.getProjection(), t) ? 0 : this.getGutter();
|
|
923
930
|
}
|
|
924
931
|
/**
|
|
925
932
|
* @return {number} Gutter.
|
|
@@ -943,10 +950,10 @@ class At extends y {
|
|
|
943
950
|
*/
|
|
944
951
|
getTileGridForProjection(t) {
|
|
945
952
|
const e = this.getProjection();
|
|
946
|
-
if (this.tileGrid && (!e ||
|
|
953
|
+
if (this.tileGrid && (!e || P(e, t)))
|
|
947
954
|
return this.tileGrid;
|
|
948
955
|
const i = R(t);
|
|
949
|
-
return i in this.tileGridForProjection || (this.tileGridForProjection[i] =
|
|
956
|
+
return i in this.tileGridForProjection || (this.tileGridForProjection[i] = p(t)), this.tileGridForProjection[i];
|
|
950
957
|
}
|
|
951
958
|
/**
|
|
952
959
|
* @param {number} z Tile coordinate z.
|
|
@@ -958,19 +965,22 @@ class At extends y {
|
|
|
958
965
|
* @return {!ImageTile} Tile.
|
|
959
966
|
* @private
|
|
960
967
|
*/
|
|
961
|
-
createTile_(t, e, i, n,
|
|
968
|
+
createTile_(t, e, i, n, s, r) {
|
|
962
969
|
const l = [t, e, i], a = this.getTileCoordForTileUrlFunction(
|
|
963
970
|
l,
|
|
964
|
-
|
|
965
|
-
), h = a ? this.tileUrlFunction(a, n,
|
|
971
|
+
s
|
|
972
|
+
), h = a ? this.tileUrlFunction(a, n, s) : void 0, c = new this.tileClass(
|
|
966
973
|
l,
|
|
967
974
|
h !== void 0 ? _.IDLE : _.EMPTY,
|
|
968
975
|
h !== void 0 ? h : "",
|
|
969
|
-
|
|
976
|
+
{
|
|
977
|
+
crossOrigin: this.crossOrigin,
|
|
978
|
+
referrerPolicy: this.referrerPolicy
|
|
979
|
+
},
|
|
970
980
|
this.tileLoadFunction,
|
|
971
981
|
this.tileOptions
|
|
972
982
|
);
|
|
973
|
-
return
|
|
983
|
+
return c.key = r, c.addEventListener(ot.CHANGE, this.handleTileChange.bind(this)), c;
|
|
974
984
|
}
|
|
975
985
|
/**
|
|
976
986
|
* @param {number} z Tile coordinate z.
|
|
@@ -982,29 +992,29 @@ class At extends y {
|
|
|
982
992
|
* @return {!(ImageTile|ReprojTile)} Tile.
|
|
983
993
|
* @override
|
|
984
994
|
*/
|
|
985
|
-
getTile(t, e, i, n,
|
|
995
|
+
getTile(t, e, i, n, s, r) {
|
|
986
996
|
const l = this.getProjection();
|
|
987
|
-
if (!l || !
|
|
997
|
+
if (!l || !s || P(l, s))
|
|
988
998
|
return this.getTileInternal(
|
|
989
999
|
t,
|
|
990
1000
|
e,
|
|
991
1001
|
i,
|
|
992
1002
|
n,
|
|
993
|
-
l ||
|
|
1003
|
+
l || s
|
|
994
1004
|
);
|
|
995
|
-
const a = [t, e, i], h = this.getKey(),
|
|
1005
|
+
const a = [t, e, i], h = this.getKey(), c = this.getTileGridForProjection(l), u = this.getTileGridForProjection(s), S = this.getTileCoordForTileUrlFunction(
|
|
996
1006
|
a,
|
|
997
|
-
|
|
1007
|
+
s
|
|
998
1008
|
), C = new N(
|
|
999
1009
|
l,
|
|
1000
|
-
u,
|
|
1001
|
-
r,
|
|
1002
1010
|
c,
|
|
1011
|
+
s,
|
|
1012
|
+
u,
|
|
1003
1013
|
a,
|
|
1004
1014
|
S,
|
|
1005
1015
|
this.getTilePixelRatio(n),
|
|
1006
1016
|
this.getGutter(),
|
|
1007
|
-
(
|
|
1017
|
+
(Z, L, I, M) => this.getTileInternal(Z, L, I, M, l, r),
|
|
1008
1018
|
this.reprojectionErrorThreshold_,
|
|
1009
1019
|
this.renderReprojectionEdges_,
|
|
1010
1020
|
this.tileOptions
|
|
@@ -1021,15 +1031,15 @@ class At extends y {
|
|
|
1021
1031
|
* @return {!ImageTile} Tile.
|
|
1022
1032
|
* @protected
|
|
1023
1033
|
*/
|
|
1024
|
-
getTileInternal(t, e, i, n,
|
|
1034
|
+
getTileInternal(t, e, i, n, s, r) {
|
|
1025
1035
|
const l = this.getKey(), a = k(this, l, t, e, i);
|
|
1026
|
-
if (
|
|
1036
|
+
if (r && r.containsKey(a))
|
|
1027
1037
|
return (
|
|
1028
1038
|
/** @type {!ImageTile} */
|
|
1029
|
-
|
|
1039
|
+
r.get(a)
|
|
1030
1040
|
);
|
|
1031
|
-
const h = this.createTile_(t, e, i, n,
|
|
1032
|
-
return
|
|
1041
|
+
const h = this.createTile_(t, e, i, n, s, l);
|
|
1042
|
+
return r?.set(a, h), h;
|
|
1033
1043
|
}
|
|
1034
1044
|
/**
|
|
1035
1045
|
* Sets whether to render reprojection edges or not (usually for debugging).
|
|
@@ -1059,21 +1069,24 @@ class At extends y {
|
|
|
1059
1069
|
}
|
|
1060
1070
|
}
|
|
1061
1071
|
}
|
|
1062
|
-
function
|
|
1072
|
+
function zt(o, t) {
|
|
1063
1073
|
if (q) {
|
|
1064
1074
|
const e = o.getCrossOrigin();
|
|
1065
1075
|
let i = "same-origin", n = "same-origin";
|
|
1066
|
-
e === "anonymous" || e === "" ? (i = "cors", n = "omit") : e === "use-credentials" && (i = "cors", n = "include")
|
|
1076
|
+
e === "anonymous" || e === "" ? (i = "cors", n = "omit") : e === "use-credentials" && (i = "cors", n = "include");
|
|
1077
|
+
const s = {
|
|
1067
1078
|
mode: i,
|
|
1068
|
-
credentials: n
|
|
1069
|
-
|
|
1079
|
+
credentials: n,
|
|
1080
|
+
referrerPolicy: o.getReferrerPolicy()
|
|
1081
|
+
};
|
|
1082
|
+
fetch(t, s).then((r) => {
|
|
1070
1083
|
if (!r.ok)
|
|
1071
1084
|
throw new Error(`HTTP ${r.status}`);
|
|
1072
1085
|
return r.blob();
|
|
1073
1086
|
}).then((r) => createImageBitmap(r)).then((r) => {
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1076
|
-
|
|
1087
|
+
const l = o.getImage();
|
|
1088
|
+
l.width = r.width, l.height = r.height, /** @type {OffscreenCanvas} */
|
|
1089
|
+
l.getContext("2d").drawImage(r, 0, 0), r.close?.(), l.dispatchEvent(new Event("load"));
|
|
1077
1090
|
}).catch(() => {
|
|
1078
1091
|
o.getImage().dispatchEvent(new Event("error"));
|
|
1079
1092
|
});
|
|
@@ -1083,15 +1096,14 @@ function Pt(o, t) {
|
|
|
1083
1096
|
}
|
|
1084
1097
|
export {
|
|
1085
1098
|
Et as S,
|
|
1086
|
-
|
|
1099
|
+
U as T,
|
|
1087
1100
|
y as U,
|
|
1088
|
-
|
|
1101
|
+
At as a,
|
|
1089
1102
|
wt as b,
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1103
|
+
xt as c,
|
|
1104
|
+
Rt as d,
|
|
1105
|
+
jt as e,
|
|
1093
1106
|
_t as f,
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
xt as i
|
|
1107
|
+
X as g,
|
|
1108
|
+
p as h
|
|
1097
1109
|
};
|