@datagouv/components-next 1.4.1-dev.1374.g4dfe0257 → 1.4.1-dev.1376.g1ed2bc83
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-CeBb5PEu.js → Control-DPuXeUqi.js} +3 -12
- package/dist/{Datafair.client-LChXlMI3.js → Datafair.client-LlEgG7WU.js} +2 -3
- package/dist/{Image-CBQwYbQB.js → Image-DVWRoLLI.js} +7 -22
- package/dist/{ImagePreview.client-DWNGZghK.js → ImagePreview.client-Db5dmxMP.js} +2 -3
- package/dist/{JsonPreview.client-DCklbUyJ.js → JsonPreview.client-DKy2AexC.js} +4 -6
- package/dist/{Layer-BPuffNS-.js → Layer-D_5tYbVm.js} +7 -9
- package/dist/{Map-QeL96qbQ.js → Map-CTBJEae_.js} +937 -967
- package/dist/{MapContainer.client-B-aQhH35.js → MapContainer.client-Clk9_bbS.js} +8 -10
- package/dist/{OSM-DT4I7v8A.js → OSM-B5Zc3qAf.js} +2 -3
- package/dist/{PdfPreview.client-1WFiBcXh.js → PdfPreview.client-D3wHTDb9.js} +130 -378
- package/dist/{PdfSkeleton-BvU7ERD1.js → PdfSkeleton-nas5Pmia.js} +2 -3
- package/dist/{Pmtiles.client-BlbOlwyy.js → Pmtiles.client-NGYdeSJY.js} +151 -350
- package/dist/{PreviewError-BfBCBDEx.js → PreviewError-EeaGx3SL.js} +6854 -6849
- package/dist/{PreviewWrapper-DvycGC7l.js → PreviewWrapper-BhldDdXK.js} +2 -3
- package/dist/{ScaleLine-Cwwk9wJo.js → ScaleLine-C_tuJ6VG.js} +3 -4
- package/dist/Tile-8nHSuqcv.js +571 -0
- package/dist/{Tile-4WpHaLOZ.js → Tile-Bu5lF4M5.js} +8 -13
- package/dist/{TileImage-CZZ4lgsm.js → TileImage-CgO5alXc.js} +105 -113
- package/dist/{View-DWqx4Jqr.js → View-Dad8DfSD.js} +25 -51
- package/dist/{XmlPreview.client-ClFD8R3a.js → XmlPreview.client-CmGbc3c3.js} +5 -7
- package/dist/assets/maplibre-gl-worker-CEzvAyZY.js +10 -0
- package/dist/components-next.js +9634 -10210
- package/dist/{en-C_qOt4Jn.js → en-OIaJCts4.js} +1 -2
- package/dist/{france-JfC0dOuE.js → france-BtSQqcqV.js} +5 -9
- package/dist/{hvd-ZlsiTVFh.js → hvd-CTia2VCz.js} +1 -2
- package/dist/{inspire-DZQ-yA5f.js → inspire-Cc-Kc4K-.js} +1 -2
- package/dist/{leaflet-src-lLkzhpcP.js → leaflet-src-BY_Zq0V0.js} +77 -126
- package/dist/{proj-DM6GW1n3.js → proj-COhZ08DR.js} +19 -37
- package/dist/{purify.es-D6pPunDo.js → purify.es-CGAWnSTR.js} +4 -27
- package/dist/{rolldown-runtime-CEFd7nDs.js → rolldown-runtime-DsPmjQRF.js} +2 -3
- package/dist/{sl-BxQ_ZY_w.js → sl-CKkMwQhf.js} +1 -2
- package/dist/{spd-Cs37HjuR.js → spd-Djcs02gw.js} +1 -2
- package/dist/{sr-JDtennFO.js → sr-DabGmchD.js} +1 -2
- package/dist/{src-D_UE0st7.js → src-D_o-aUzl.js} +1612 -2428
- package/dist/{text-clamp.esm-DRvX2Gzm.js → text-clamp.esm-DE3022VR.js} +3 -5
- package/dist/{transform-Ct1GejD-.js → transform-CNeEnSK9.js} +7 -13
- package/dist/{vue3-json-viewer-BJgUfh-l.js → vue3-json-viewer-CUx5EFVA.js} +1 -2
- package/dist/{vue3-xml-viewer.common-DbJwzvCC.js → vue3-xml-viewer.common-C0bbtsGT.js} +2 -3
- package/package.json +2 -2
- package/dist/Tile-BV44yf69.js +0 -574
- package/dist/assets/maplibre-gl-worker-C24SsKwV.js +0 -10
package/dist/Tile-BV44yf69.js
DELETED
|
@@ -1,574 +0,0 @@
|
|
|
1
|
-
import { r as e } from "./rolldown-runtime-CEFd7nDs.js";
|
|
2
|
-
import { $t as t, Bt as n, Ct as r, Dt as i, Et as a, Ot as o, Pt as s, Tt as c, Vt as l, Xt as u, _t as d, an as f, dt as p, in as m, kt as h, nt as g, ot as _, s as v, u as y, vt as b, wt as x, zt as S } from "./proj-DM6GW1n3.js";
|
|
3
|
-
import { a as C, c as w, d as T, f as E, l as D, p as O, u as k, w as A } from "./Image-CBQwYbQB.js";
|
|
4
|
-
import { S as j, a as M, f as N, i as P, n as F, r as I, s as L } from "./transform-Ct1GejD-.js";
|
|
5
|
-
import { c as R, d as z, i as B, p as V, s as H, t as ee } from "./Tile-4WpHaLOZ.js";
|
|
6
|
-
import { i as te, o as U, p as W, t as ne } from "./Layer-BPuffNS-.js";
|
|
7
|
-
//#region ../node_modules/ol/render/canvas/ZIndexContext.js
|
|
8
|
-
var G = class {
|
|
9
|
-
constructor() {
|
|
10
|
-
this.instructions_ = [], this.zIndex = 0, this.offset_ = 0, this.pendingMethod_, this.context_ = new Proxy(E(), {
|
|
11
|
-
get: (e, t) => {
|
|
12
|
-
if (typeof e[t] == "function") return this.pendingMethod_ = t, this.pushMethodArgs_;
|
|
13
|
-
},
|
|
14
|
-
set: (e, t, n) => (this.push_(t, n), !0)
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
push_(...e) {
|
|
18
|
-
let t = this.instructions_, n = this.zIndex + this.offset_;
|
|
19
|
-
t[n] || (t[n] = []), t[n].push(...e);
|
|
20
|
-
}
|
|
21
|
-
pushMethodArgs_ = (...e) => {
|
|
22
|
-
this.push_(this.pendingMethod_, e);
|
|
23
|
-
};
|
|
24
|
-
pushFunction(e) {
|
|
25
|
-
this.push_(e);
|
|
26
|
-
}
|
|
27
|
-
getContext() {
|
|
28
|
-
return this.context_;
|
|
29
|
-
}
|
|
30
|
-
draw(e) {
|
|
31
|
-
this.instructions_.forEach((t) => {
|
|
32
|
-
for (let n = 0, r = t.length; n < r; ++n) {
|
|
33
|
-
let r = t[n];
|
|
34
|
-
if (typeof r == "function") {
|
|
35
|
-
r(e);
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
let i = t[++n];
|
|
39
|
-
typeof e[r] == "function" ? e[r](...i) : e[r] = typeof i == "function" ? i(e) : i;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
clear() {
|
|
44
|
-
this.instructions_.length = 0, this.zIndex = 0, this.offset_ = 0;
|
|
45
|
-
}
|
|
46
|
-
offset() {
|
|
47
|
-
this.offset_ = this.instructions_.length, this.zIndex = 0;
|
|
48
|
-
}
|
|
49
|
-
}, re = 5, ie = class extends l {
|
|
50
|
-
constructor(e) {
|
|
51
|
-
super(), this.ready = !0, this.boundHandleImageChange_ = this.handleImageChange_.bind(this), this.layer_ = e, this.staleKeys_ = [], this.maxStaleKeys = re, this.renderedSourceKey_;
|
|
52
|
-
}
|
|
53
|
-
getStaleKeys() {
|
|
54
|
-
return this.staleKeys_;
|
|
55
|
-
}
|
|
56
|
-
prependStaleKey(e) {
|
|
57
|
-
this.staleKeys_.unshift(e), this.staleKeys_.length > this.maxStaleKeys && (this.staleKeys_.length = this.maxStaleKeys);
|
|
58
|
-
}
|
|
59
|
-
updateStaleKeys(e) {
|
|
60
|
-
this.renderedSourceKey_ ? this.renderedSourceKey_ !== e && (this.prependStaleKey(this.renderedSourceKey_), this.renderedSourceKey_ = e) : this.renderedSourceKey_ = e;
|
|
61
|
-
}
|
|
62
|
-
getFeatures(e) {
|
|
63
|
-
return S();
|
|
64
|
-
}
|
|
65
|
-
getData(e) {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
prepareFrame(e) {
|
|
69
|
-
return S();
|
|
70
|
-
}
|
|
71
|
-
renderFrame(e, t) {
|
|
72
|
-
return S();
|
|
73
|
-
}
|
|
74
|
-
forEachFeatureAtCoordinate(e, t, n, r, i) {}
|
|
75
|
-
getLayer() {
|
|
76
|
-
return this.layer_;
|
|
77
|
-
}
|
|
78
|
-
handleFontsChanged() {}
|
|
79
|
-
handleImageChange_(e) {
|
|
80
|
-
let t = e.target;
|
|
81
|
-
(t.getState() === C.LOADED || t.getState() === C.ERROR) && this.renderIfReadyAndVisible();
|
|
82
|
-
}
|
|
83
|
-
loadImage(e) {
|
|
84
|
-
let t = e.getState();
|
|
85
|
-
return t != C.LOADED && t != C.ERROR && e.addEventListener(f.CHANGE, this.boundHandleImageChange_), t == C.IDLE && (e.load(), t = e.getState()), t == C.LOADED;
|
|
86
|
-
}
|
|
87
|
-
renderIfReadyAndVisible() {
|
|
88
|
-
let e = this.getLayer();
|
|
89
|
-
e && e.getVisible() && e.getSourceState() === "ready" && e.changed();
|
|
90
|
-
}
|
|
91
|
-
renderDeferred(e) {}
|
|
92
|
-
disposeInternal() {
|
|
93
|
-
delete this.layer_, super.disposeInternal();
|
|
94
|
-
}
|
|
95
|
-
}, ae = [], K = null;
|
|
96
|
-
function oe() {
|
|
97
|
-
K = k(1, 1, void 0, { willReadFrequently: !0 });
|
|
98
|
-
}
|
|
99
|
-
var q = class extends ie {
|
|
100
|
-
constructor(e) {
|
|
101
|
-
super(e), this.container = null, this.renderedResolution, this.tempTransform = P(), this.pixelTransform = P(), this.inversePixelTransform = P(), this.context = null, this.deferredContext_ = null, this.containerReused = !1, this.frameState = null;
|
|
102
|
-
}
|
|
103
|
-
getImageData(e, t, n) {
|
|
104
|
-
K || oe(), K.clearRect(0, 0, 1, 1);
|
|
105
|
-
let r;
|
|
106
|
-
try {
|
|
107
|
-
K.drawImage(e, t, n, 1, 1, 0, 0, 1, 1), r = K.getImageData(0, 0, 1, 1).data;
|
|
108
|
-
} catch {
|
|
109
|
-
return K = null, null;
|
|
110
|
-
}
|
|
111
|
-
return r;
|
|
112
|
-
}
|
|
113
|
-
getBackground(e) {
|
|
114
|
-
let t = this.getLayer().getBackground();
|
|
115
|
-
return typeof t == "function" && (t = t(e.viewState.resolution)), t || void 0;
|
|
116
|
-
}
|
|
117
|
-
useContainer(e, n, r, i, a) {
|
|
118
|
-
if (O(e) && this.pixelTransform[1] === 0 && this.pixelTransform[2] === 0 && this.pixelTransform[4] === 0 && this.pixelTransform[5] === 0 && e.width === i && e.height === a) {
|
|
119
|
-
let t = e, n = t.getContext("2d");
|
|
120
|
-
if (n) {
|
|
121
|
-
this.container = e, this.context = n, this.containerReused = !0, r && (n.fillStyle = r, n.fillRect(0, 0, t.width, t.height));
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
let o = this.getLayer().getClassName(), s, c;
|
|
126
|
-
if (e && e.className === o && (!r || e && e.style.backgroundColor && t(U(e.style.backgroundColor), U(r)))) {
|
|
127
|
-
let t = e.firstElementChild;
|
|
128
|
-
O(t) && (c = t.getContext("2d"));
|
|
129
|
-
}
|
|
130
|
-
if (c && M(c.canvas.style.transform, n) ? (this.container = e, this.context = c, this.containerReused = !0) : this.containerReused ? (this.container = null, this.context = null, this.containerReused = !1) : this.container && (this.container.style.backgroundColor = null), !this.container) {
|
|
131
|
-
s = A ? T() : document.createElement("div"), s.className = o;
|
|
132
|
-
let e = s.style;
|
|
133
|
-
e.position = "absolute", e.width = "100%", e.height = "100%", c = k();
|
|
134
|
-
let t = c.canvas;
|
|
135
|
-
s.appendChild(t), e = t.style, e.position = "absolute", e.left = "0", e.transformOrigin = "top left", this.container = s, this.context = c;
|
|
136
|
-
}
|
|
137
|
-
!this.containerReused && r && !this.container.style.backgroundColor && (this.container.style.backgroundColor = r);
|
|
138
|
-
}
|
|
139
|
-
clipUnrotated(e, t, n) {
|
|
140
|
-
let r = a(n), o = i(n), s = b(n), c = d(n);
|
|
141
|
-
F(t.coordinateToPixelTransform, r), F(t.coordinateToPixelTransform, o), F(t.coordinateToPixelTransform, s), F(t.coordinateToPixelTransform, c);
|
|
142
|
-
let l = this.inversePixelTransform;
|
|
143
|
-
F(l, r), F(l, o), F(l, s), F(l, c), e.save(), e.beginPath(), e.moveTo(Math.round(r[0]), Math.round(r[1])), e.lineTo(Math.round(o[0]), Math.round(o[1])), e.lineTo(Math.round(s[0]), Math.round(s[1])), e.lineTo(Math.round(c[0]), Math.round(c[1])), e.clip();
|
|
144
|
-
}
|
|
145
|
-
prepareContainer(e, t) {
|
|
146
|
-
let n = e.extent, i = e.viewState.resolution, a = e.viewState.rotation, s = e.pixelRatio, c = Math.round(o(n) / i * s), l = Math.round(r(n) / i * s);
|
|
147
|
-
I(this.pixelTransform, e.size[0] / 2, e.size[1] / 2, 1 / s, 1 / s, a, -c / 2, -l / 2), L(this.inversePixelTransform, this.pixelTransform);
|
|
148
|
-
let u = N(this.pixelTransform), d = this.getBackground(e);
|
|
149
|
-
if (this.useContainer(t, u, d, c, l), !this.containerReused) {
|
|
150
|
-
let e = this.context.canvas;
|
|
151
|
-
e.width != c || e.height != l ? (e.width = c, e.height = l) : this.context.clearRect(0, 0, c, l), u !== e.style.transform && (e.style.transform = u);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
dispatchRenderEvent_(e, t, n) {
|
|
155
|
-
let r = this.getLayer();
|
|
156
|
-
if (r.hasListener(e)) {
|
|
157
|
-
let i = new te(e, this.inversePixelTransform, n, t);
|
|
158
|
-
r.dispatchEvent(i);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
preRender(e, t) {
|
|
162
|
-
this.frameState = t, !t.declutter && this.dispatchRenderEvent_(W.PRERENDER, e, t);
|
|
163
|
-
}
|
|
164
|
-
postRender(e, t) {
|
|
165
|
-
t.declutter || this.dispatchRenderEvent_(W.POSTRENDER, e, t);
|
|
166
|
-
}
|
|
167
|
-
renderDeferredInternal(e) {}
|
|
168
|
-
getRenderContext(e) {
|
|
169
|
-
return e.declutter && !this.deferredContext_ && (this.deferredContext_ = new G()), e.declutter ? this.deferredContext_.getContext() : this.context;
|
|
170
|
-
}
|
|
171
|
-
renderDeferred(e) {
|
|
172
|
-
e.declutter && (this.dispatchRenderEvent_(W.PRERENDER, this.context, e), e.declutter && this.deferredContext_ && (this.deferredContext_.draw(this.context), this.deferredContext_.clear()), this.renderDeferredInternal(e), this.dispatchRenderEvent_(W.POSTRENDER, this.context, e));
|
|
173
|
-
}
|
|
174
|
-
getRenderTransform(e, t, n, r, i, a, o) {
|
|
175
|
-
let s = i / 2, c = a / 2, l = r / t, u = -l, d = -e[0] + o, f = -e[1];
|
|
176
|
-
return I(this.tempTransform, s, c, l, u, -n, d, f);
|
|
177
|
-
}
|
|
178
|
-
disposeInternal() {
|
|
179
|
-
delete this.frameState, super.disposeInternal();
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
//#endregion
|
|
183
|
-
//#region ../node_modules/ol/DataTile.js
|
|
184
|
-
function J(e) {
|
|
185
|
-
return e instanceof Image || e instanceof HTMLCanvasElement || e instanceof HTMLVideoElement || e instanceof ImageBitmap ? e : null;
|
|
186
|
-
}
|
|
187
|
-
var se = /* @__PURE__ */ Error("disposed"), ce = [256, 256], Y = class extends V {
|
|
188
|
-
constructor(e) {
|
|
189
|
-
let t = D.IDLE;
|
|
190
|
-
super(e.tileCoord, t, {
|
|
191
|
-
transition: e.transition,
|
|
192
|
-
interpolate: e.interpolate
|
|
193
|
-
}), this.loader_ = e.loader, this.data_ = null, this.error_ = null, this.size_ = e.size || null, this.controller_ = e.controller || null;
|
|
194
|
-
}
|
|
195
|
-
getSize() {
|
|
196
|
-
if (this.size_) return this.size_;
|
|
197
|
-
let e = J(this.data_);
|
|
198
|
-
return e ? [e.width, e.height] : ce;
|
|
199
|
-
}
|
|
200
|
-
getData() {
|
|
201
|
-
return this.data_;
|
|
202
|
-
}
|
|
203
|
-
getError() {
|
|
204
|
-
return this.error_;
|
|
205
|
-
}
|
|
206
|
-
load() {
|
|
207
|
-
if (this.state !== D.IDLE && this.state !== D.ERROR) return;
|
|
208
|
-
this.state = D.LOADING, this.changed();
|
|
209
|
-
let e = this;
|
|
210
|
-
this.loader_().then(function(t) {
|
|
211
|
-
e.data_ = t, e.state = D.LOADED, e.changed();
|
|
212
|
-
}).catch(function(t) {
|
|
213
|
-
e.error_ = t, e.state = D.ERROR, e.changed();
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
disposeInternal() {
|
|
217
|
-
this.controller_ &&= (this.controller_.abort(se), null), super.disposeInternal();
|
|
218
|
-
}
|
|
219
|
-
}, X = class {
|
|
220
|
-
constructor(e) {
|
|
221
|
-
this.highWaterMark = e === void 0 ? 2048 : e, this.count_ = 0, this.entries_ = {}, this.oldest_ = null, this.newest_ = null;
|
|
222
|
-
}
|
|
223
|
-
deleteOldest() {
|
|
224
|
-
let e = this.pop();
|
|
225
|
-
e instanceof m && e.dispose();
|
|
226
|
-
}
|
|
227
|
-
canExpireCache() {
|
|
228
|
-
return this.highWaterMark > 0 && this.getCount() > this.highWaterMark;
|
|
229
|
-
}
|
|
230
|
-
expireCache(e) {
|
|
231
|
-
for (; this.canExpireCache();) this.deleteOldest();
|
|
232
|
-
}
|
|
233
|
-
clear() {
|
|
234
|
-
for (; this.oldest_;) this.deleteOldest();
|
|
235
|
-
}
|
|
236
|
-
containsKey(e) {
|
|
237
|
-
return this.entries_.hasOwnProperty(e);
|
|
238
|
-
}
|
|
239
|
-
forEach(e) {
|
|
240
|
-
let t = this.oldest_;
|
|
241
|
-
for (; t;) e(t.value_, t.key_, this), t = t.newer;
|
|
242
|
-
}
|
|
243
|
-
get(e, t) {
|
|
244
|
-
let n = this.entries_[e];
|
|
245
|
-
return j(n !== void 0, "Tried to get a value for a key that does not exist in the cache"), n === this.newest_ ? n.value_ : (n === this.oldest_ ? (this.oldest_ = this.oldest_.newer, this.oldest_.older = null) : (n.newer.older = n.older, n.older.newer = n.newer), n.newer = null, n.older = this.newest_, this.newest_.newer = n, this.newest_ = n, n.value_);
|
|
246
|
-
}
|
|
247
|
-
remove(e) {
|
|
248
|
-
let t = this.entries_[e];
|
|
249
|
-
return j(t !== void 0, "Tried to get a value for a key that does not exist in the cache"), t === this.newest_ ? (this.newest_ = t.older, this.newest_ && (this.newest_.newer = null)) : t === this.oldest_ ? (this.oldest_ = t.newer, this.oldest_ && (this.oldest_.older = null)) : (t.newer.older = t.older, t.older.newer = t.newer), delete this.entries_[e], --this.count_, t.value_;
|
|
250
|
-
}
|
|
251
|
-
getCount() {
|
|
252
|
-
return this.count_;
|
|
253
|
-
}
|
|
254
|
-
getKeys() {
|
|
255
|
-
let e = Array(this.count_), t = 0, n;
|
|
256
|
-
for (n = this.newest_; n; n = n.older) e[t++] = n.key_;
|
|
257
|
-
return e;
|
|
258
|
-
}
|
|
259
|
-
getValues() {
|
|
260
|
-
let e = Array(this.count_), t = 0, n;
|
|
261
|
-
for (n = this.newest_; n; n = n.older) e[t++] = n.value_;
|
|
262
|
-
return e;
|
|
263
|
-
}
|
|
264
|
-
peekLast() {
|
|
265
|
-
return this.oldest_.value_;
|
|
266
|
-
}
|
|
267
|
-
peekLastKey() {
|
|
268
|
-
return this.oldest_.key_;
|
|
269
|
-
}
|
|
270
|
-
peekFirstKey() {
|
|
271
|
-
return this.newest_.key_;
|
|
272
|
-
}
|
|
273
|
-
peek(e) {
|
|
274
|
-
return this.entries_[e]?.value_;
|
|
275
|
-
}
|
|
276
|
-
pop() {
|
|
277
|
-
let e = this.oldest_;
|
|
278
|
-
return delete this.entries_[e.key_], e.newer && (e.newer.older = null), this.oldest_ = e.newer, this.oldest_ || (this.newest_ = null), --this.count_, e.value_;
|
|
279
|
-
}
|
|
280
|
-
replace(e, t) {
|
|
281
|
-
this.get(e), this.entries_[e].value_ = t;
|
|
282
|
-
}
|
|
283
|
-
set(e, t) {
|
|
284
|
-
j(!(e in this.entries_), "Tried to set a value for a key that is used already");
|
|
285
|
-
let n = {
|
|
286
|
-
key_: e,
|
|
287
|
-
newer: null,
|
|
288
|
-
older: this.newest_,
|
|
289
|
-
value_: t
|
|
290
|
-
};
|
|
291
|
-
this.newest_ ? this.newest_.newer = n : this.oldest_ = n, this.newest_ = n, this.entries_[e] = n, ++this.count_;
|
|
292
|
-
}
|
|
293
|
-
setSize(e) {
|
|
294
|
-
this.highWaterMark = e;
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
//#endregion
|
|
298
|
-
//#region ../node_modules/ol/renderer/canvas/TileLayer.js
|
|
299
|
-
function Z(e, t, n) {
|
|
300
|
-
if (!(n in e)) return e[n] = /* @__PURE__ */ new Set([t]), !0;
|
|
301
|
-
let r = e[n], i = r.has(t);
|
|
302
|
-
return i || r.add(t), !i;
|
|
303
|
-
}
|
|
304
|
-
function le(e, t, n) {
|
|
305
|
-
let r = e[n];
|
|
306
|
-
return r ? r.delete(t) : !1;
|
|
307
|
-
}
|
|
308
|
-
function Q(e, t) {
|
|
309
|
-
let n = e.layerStatesArray[e.layerIndex];
|
|
310
|
-
n.extent && (t = x(t, y(n.extent, e.viewState.projection)));
|
|
311
|
-
let r = n.layer.getRenderSource();
|
|
312
|
-
if (!r.getWrapX()) {
|
|
313
|
-
let n = r.getTileGridForProjection(e.viewState.projection).getExtent();
|
|
314
|
-
n && (t = x(t, n));
|
|
315
|
-
}
|
|
316
|
-
return t;
|
|
317
|
-
}
|
|
318
|
-
var ue = class extends q {
|
|
319
|
-
constructor(e, t) {
|
|
320
|
-
super(e), t ||= {}, this.extentChanged = !0, this.renderComplete = !1, this.renderedExtent_ = null, this.renderedPixelRatio, this.renderedProjection = null, this.renderedTiles = [], this.renderedSourceRevision_, this.tempExtent = _(), this.tempTileRange_ = new z(0, 0, 0, 0), this.tempTileCoord_ = H(0, 0, 0);
|
|
321
|
-
let n = t.cacheSize === void 0 ? 512 : t.cacheSize;
|
|
322
|
-
this.tileCache_ = new X(n), this.sourceTileCache_ = null, this.layerExtent = null, this.maxStaleKeys = n * .5;
|
|
323
|
-
}
|
|
324
|
-
getTileCache() {
|
|
325
|
-
return this.tileCache_;
|
|
326
|
-
}
|
|
327
|
-
getSourceTileCache() {
|
|
328
|
-
return this.sourceTileCache_ ||= new X(512), this.sourceTileCache_;
|
|
329
|
-
}
|
|
330
|
-
getOrCreateTile(e, t, n, r) {
|
|
331
|
-
let i = this.tileCache_, a = this.getLayer().getSource(), o = R(a, a.getKey(), e, t, n), s;
|
|
332
|
-
if (i.containsKey(o)) s = i.get(o);
|
|
333
|
-
else {
|
|
334
|
-
let c = r.viewState.projection, l = a.getProjection();
|
|
335
|
-
if (s = a.getTile(e, t, n, r.pixelRatio, c, !l || v(l, c) ? void 0 : this.getSourceTileCache()), !s) return null;
|
|
336
|
-
i.set(o, s);
|
|
337
|
-
}
|
|
338
|
-
return s;
|
|
339
|
-
}
|
|
340
|
-
getTile(e, t, n, r) {
|
|
341
|
-
return this.getOrCreateTile(e, t, n, r) || null;
|
|
342
|
-
}
|
|
343
|
-
getData(e) {
|
|
344
|
-
let t = this.frameState;
|
|
345
|
-
if (!t) return null;
|
|
346
|
-
let n = this.getLayer(), r = F(t.pixelToCoordinateTransform, e.slice()), i = n.getExtent();
|
|
347
|
-
if (i && !g(i, r)) return null;
|
|
348
|
-
let a = t.viewState, o = n.getRenderSource(), s = o.getTileGridForProjection(a.projection), c = o.getTilePixelRatio(t.pixelRatio);
|
|
349
|
-
for (let e = s.getZForResolution(a.resolution); e >= s.getMinZoom(); --e) {
|
|
350
|
-
let n = s.getTileCoordForCoordAndZ(r, e), i = this.getTile(e, n[1], n[2], t);
|
|
351
|
-
if (!i || i.getState() !== D.LOADED) continue;
|
|
352
|
-
let l = s.getOrigin(e), u = w(s.getTileSize(e)), d = s.getResolution(e), f;
|
|
353
|
-
if (i instanceof B || i instanceof ee) f = i.getImage();
|
|
354
|
-
else if (i instanceof Y) {
|
|
355
|
-
if (f = J(i.getData()), !f) continue;
|
|
356
|
-
} else continue;
|
|
357
|
-
let p = Math.floor(c * ((r[0] - l[0]) / d - n[1] * u[0])), m = Math.floor(c * ((l[1] - r[1]) / d - n[2] * u[1])), h = Math.round(c * o.getGutterForProjection(a.projection));
|
|
358
|
-
return this.getImageData(f, p + h, m + h);
|
|
359
|
-
}
|
|
360
|
-
return null;
|
|
361
|
-
}
|
|
362
|
-
prepareFrame(e) {
|
|
363
|
-
this.renderedProjection ? e.viewState.projection !== this.renderedProjection && (this.tileCache_.clear(), this.renderedProjection = e.viewState.projection) : this.renderedProjection = e.viewState.projection;
|
|
364
|
-
let t = this.getLayer().getSource();
|
|
365
|
-
if (!t) return !1;
|
|
366
|
-
let n = t.getRevision();
|
|
367
|
-
return this.renderedSourceRevision_ ? this.renderedSourceRevision_ !== n && (this.renderedSourceRevision_ = n, this.renderedSourceKey_ === t.getKey() && (this.tileCache_.clear(), this.sourceTileCache_?.clear())) : this.renderedSourceRevision_ = n, !0;
|
|
368
|
-
}
|
|
369
|
-
enqueueTilesForNextExtent() {
|
|
370
|
-
return !0;
|
|
371
|
-
}
|
|
372
|
-
enqueueTiles(e, t, r, i, a) {
|
|
373
|
-
let o = e.viewState, s = this.getLayer(), l = s.getRenderSource(), u = l.getTileGridForProjection(o.projection), d = n(l);
|
|
374
|
-
d in e.wantedTiles || (e.wantedTiles[d] = {});
|
|
375
|
-
let f = e.wantedTiles[d], p = s.getMapInternal(), m = Math.max(r - a, u.getMinZoom(), u.getZForResolution(Math.min(s.getMaxResolution(), p ? p.getView().getResolutionForZoom(Math.max(s.getMinZoom(), 0)) : u.getResolution(0)), l.zDirection)), h = o.rotation, g = h ? c(o.center, o.resolution, h, e.size) : void 0;
|
|
376
|
-
for (let n = r; n >= m; --n) {
|
|
377
|
-
let r = u.getTileRangeForExtentAndZ(t, n, this.tempTileRange_), a = u.getResolution(n);
|
|
378
|
-
for (let t = r.minX; t <= r.maxX; ++t) for (let o = r.minY; o <= r.maxY; ++o) {
|
|
379
|
-
if (h && !u.tileCoordIntersectsViewport([
|
|
380
|
-
n,
|
|
381
|
-
t,
|
|
382
|
-
o
|
|
383
|
-
], g)) continue;
|
|
384
|
-
let r = this.getTile(n, t, o, e);
|
|
385
|
-
if (!r || !Z(i, r, n)) continue;
|
|
386
|
-
let s = r.getKey();
|
|
387
|
-
if (f[s] = !0, r.getState() === D.IDLE && !e.tileQueue.isKeyQueued(s)) {
|
|
388
|
-
let i = H(n, t, o, this.tempTileCoord_);
|
|
389
|
-
e.tileQueue.enqueue([
|
|
390
|
-
r,
|
|
391
|
-
d,
|
|
392
|
-
u.getTileCoordCenter(i),
|
|
393
|
-
a
|
|
394
|
-
]);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
findStaleTile_(e, t) {
|
|
400
|
-
let r = this.tileCache_, i = e[0], a = e[1], o = e[2], s = this.getStaleKeys();
|
|
401
|
-
for (let e = 0; e < s.length; ++e) {
|
|
402
|
-
let c = R(this.getLayer().getSource(), s[e], i, a, o);
|
|
403
|
-
if (r.containsKey(c)) {
|
|
404
|
-
let e = r.peek(c);
|
|
405
|
-
if (e.getState() === D.LOADED) return e.endTransition(n(this)), Z(t, e, i), !0;
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
return !1;
|
|
409
|
-
}
|
|
410
|
-
findAltTiles_(e, t, n, r) {
|
|
411
|
-
let i = e.getTileRangeForTileCoordAndZ(t, n, this.tempTileRange_);
|
|
412
|
-
if (!i) return !1;
|
|
413
|
-
let a = !0, o = this.tileCache_, s = this.getLayer().getRenderSource(), c = s.getKey();
|
|
414
|
-
for (let e = i.minX; e <= i.maxX; ++e) for (let t = i.minY; t <= i.maxY; ++t) {
|
|
415
|
-
let i = R(s, c, n, e, t), l = !1;
|
|
416
|
-
if (o.containsKey(i)) {
|
|
417
|
-
let e = o.peek(i);
|
|
418
|
-
e.getState() === D.LOADED && (Z(r, e, n), l = !0);
|
|
419
|
-
}
|
|
420
|
-
l || (a = !1);
|
|
421
|
-
}
|
|
422
|
-
return a;
|
|
423
|
-
}
|
|
424
|
-
renderFrame(e, t) {
|
|
425
|
-
this.renderComplete = !0;
|
|
426
|
-
let r = e.layerStatesArray[e.layerIndex], i = e.viewState, o = i.projection, c = i.resolution, l = i.center, d = e.pixelRatio, f = this.getLayer(), m = f.getSource(), g = m.getTileGridForProjection(o), _ = g.getZForResolution(c, m.zDirection), v = g.getResolution(_);
|
|
427
|
-
this.updateStaleKeys(m.getKey());
|
|
428
|
-
let b = e.extent, S = m.getTilePixelRatio(d);
|
|
429
|
-
this.prepareContainer(e, t);
|
|
430
|
-
let C = this.context.canvas.width, w = this.context.canvas.height;
|
|
431
|
-
this.layerExtent = r.extent ? y(r.extent, o) : null, this.layerExtent && (b = x(b, this.layerExtent));
|
|
432
|
-
let T = v * C / 2 / S, E = v * w / 2 / S, O = [
|
|
433
|
-
l[0] - T,
|
|
434
|
-
l[1] - E,
|
|
435
|
-
l[0] + T,
|
|
436
|
-
l[1] + E
|
|
437
|
-
], k = {};
|
|
438
|
-
this.renderedTiles.length = 0;
|
|
439
|
-
let A = f.getPreload();
|
|
440
|
-
if (e.nextExtent && this.enqueueTilesForNextExtent()) {
|
|
441
|
-
let t = g.getZForResolution(i.nextResolution, m.zDirection), n = Q(e, e.nextExtent);
|
|
442
|
-
this.enqueueTiles(e, n, t, k, A);
|
|
443
|
-
}
|
|
444
|
-
let j = Q(e, b);
|
|
445
|
-
if (this.enqueueTiles(e, j, _, k, 0), A > 0 && setTimeout(() => {
|
|
446
|
-
this.enqueueTiles(e, j, _ - 1, k, A - 1);
|
|
447
|
-
}, 0), !(_ in k)) return this.container;
|
|
448
|
-
let M = n(this), N = e.time;
|
|
449
|
-
for (let t of k[_]) {
|
|
450
|
-
let n = t.getState();
|
|
451
|
-
if (n === D.EMPTY) continue;
|
|
452
|
-
let r = t.tileCoord;
|
|
453
|
-
if (n === D.LOADED && t.getAlpha(M, N) === 1) {
|
|
454
|
-
t.endTransition(M);
|
|
455
|
-
continue;
|
|
456
|
-
}
|
|
457
|
-
if (n !== D.ERROR && (this.renderComplete = !1), this.findStaleTile_(r, k)) {
|
|
458
|
-
le(k, t, _), e.animate = !0;
|
|
459
|
-
continue;
|
|
460
|
-
}
|
|
461
|
-
if (this.findAltTiles_(g, r, _ + 1, k)) continue;
|
|
462
|
-
let i = g.getMinZoom();
|
|
463
|
-
for (let e = _ - 1; e >= i && !this.findAltTiles_(g, r, e, k); --e);
|
|
464
|
-
}
|
|
465
|
-
let P = v / c * d / S, L = this.getRenderContext(e);
|
|
466
|
-
I(this.tempTransform, C / 2, w / 2, P, P, 0, -C / 2, -w / 2), this.layerExtent && this.clipUnrotated(L, e, this.layerExtent), m.getInterpolate() || (L.imageSmoothingEnabled = !1), this.preRender(L, e);
|
|
467
|
-
let R = Object.keys(k).map(Number);
|
|
468
|
-
R.sort(u);
|
|
469
|
-
let z = [], B = [], V = [];
|
|
470
|
-
for (let t = R.length - 1; t >= 0; --t) {
|
|
471
|
-
let n = R[t], r = m.getTilePixelSize(n, d, o), i = g.getResolution(n) / v, c = r[0] * i * P, l = r[1] * i * P, u = g.getTileCoordForCoordAndZ(a(O), n), f = g.getTileCoordExtent(u), p = F(this.tempTransform, [S * (f[0] - O[0]) / v, S * (O[3] - f[3]) / v]), y = S * m.getGutterForProjection(o);
|
|
472
|
-
for (let t of k[n]) {
|
|
473
|
-
if (t.getState() !== D.LOADED) continue;
|
|
474
|
-
let r = t.tileCoord, i = u[1] - r[1], a = Math.round(p[0] - (i - 1) * c), o = u[2] - r[2], d = Math.round(p[1] - (o - 1) * l), f = Math.round(p[0] - i * c), g = Math.round(p[1] - o * l), v = a - f, b = d - g, x = n === _;
|
|
475
|
-
if (x && t.inTransition(M)) {
|
|
476
|
-
V.push({
|
|
477
|
-
tile: t,
|
|
478
|
-
x: f,
|
|
479
|
-
y: g,
|
|
480
|
-
w: v,
|
|
481
|
-
h: b,
|
|
482
|
-
gutter: y
|
|
483
|
-
}), this.renderedTiles.unshift(t), this.updateUsedTiles(e.usedTiles, m, t);
|
|
484
|
-
continue;
|
|
485
|
-
}
|
|
486
|
-
let S = [
|
|
487
|
-
f,
|
|
488
|
-
g,
|
|
489
|
-
f + v,
|
|
490
|
-
g + b
|
|
491
|
-
], C = [];
|
|
492
|
-
for (let e = 0, t = z.length; e < t; ++e) n < B[e] && h(S, z[e]) && C.push(z[e]);
|
|
493
|
-
let w;
|
|
494
|
-
C.length > 0 && (w = s(S, C)), z.push(S), B.push(n), this.drawTile(t, e, f, g, v, b, y, x, w), this.renderedTiles.unshift(t), this.updateUsedTiles(e.usedTiles, m, t);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
for (let t = 0, n = V.length; t < n; ++t) {
|
|
498
|
-
let { tile: n, x: r, y: i, w: a, h: o, gutter: s } = V[t];
|
|
499
|
-
this.drawTile(n, e, r, i, a, o, s, !0, void 0);
|
|
500
|
-
}
|
|
501
|
-
return this.renderedResolution = v, this.extentChanged = !this.renderedExtent_ || !p(this.renderedExtent_, O), this.renderedExtent_ = O, this.renderedPixelRatio = d, this.postRender(this.context, e), this.layerExtent && L.restore(), L.imageSmoothingEnabled = !0, this.renderComplete && e.postRenderFunctions.push((e, t) => {
|
|
502
|
-
let r = n(m), i = t.wantedTiles[r], a = i ? Object.keys(i).length : 0;
|
|
503
|
-
this.updateCacheSize(a), this.tileCache_.expireCache(), this.sourceTileCache_?.expireCache();
|
|
504
|
-
}), this.container;
|
|
505
|
-
}
|
|
506
|
-
updateCacheSize(e) {
|
|
507
|
-
this.tileCache_.highWaterMark = Math.max(this.tileCache_.highWaterMark, e * 2);
|
|
508
|
-
}
|
|
509
|
-
drawTile(e, t, r, i, a, o, s, c, l) {
|
|
510
|
-
let u;
|
|
511
|
-
if (e instanceof Y) {
|
|
512
|
-
if (u = J(e.getData()), !u) throw Error("Rendering array data is not yet supported");
|
|
513
|
-
} else u = this.getTileImage(e);
|
|
514
|
-
if (!u) return;
|
|
515
|
-
let d = this.getRenderContext(t), f = n(this), p = t.layerStatesArray[t.layerIndex], m = p.opacity * (c ? e.getAlpha(f, t.time) : 1), h = m !== d.globalAlpha;
|
|
516
|
-
h && (d.save(), d.globalAlpha = m);
|
|
517
|
-
let g = u.width - 2 * s, _ = u.height - 2 * s;
|
|
518
|
-
if (l) {
|
|
519
|
-
let e = g / a, t = _ / o;
|
|
520
|
-
for (let n = 0, a = l.length; n < a; ++n) {
|
|
521
|
-
let a = l[n], o = a[0], c = a[1], f = a[2] - a[0], p = a[3] - a[1];
|
|
522
|
-
d.drawImage(u, s + (o - r) * e, s + (c - i) * t, f * e, p * t, o, c, f, p);
|
|
523
|
-
}
|
|
524
|
-
} else d.drawImage(u, s, s, g, _, r, i, a, o);
|
|
525
|
-
h && d.restore(), m === p.opacity ? c && e.endTransition(f) : t.animate = !0;
|
|
526
|
-
}
|
|
527
|
-
getImage() {
|
|
528
|
-
let e = this.context;
|
|
529
|
-
return e ? e.canvas : null;
|
|
530
|
-
}
|
|
531
|
-
getTileImage(e) {
|
|
532
|
-
return e.getImage();
|
|
533
|
-
}
|
|
534
|
-
updateUsedTiles(e, t, r) {
|
|
535
|
-
let i = n(t);
|
|
536
|
-
i in e || (e[i] = {}), e[i][r.getKey()] = !0;
|
|
537
|
-
}
|
|
538
|
-
}, $ = {
|
|
539
|
-
PRELOAD: "preload",
|
|
540
|
-
USE_INTERIM_TILES_ON_ERROR: "useInterimTilesOnError"
|
|
541
|
-
}, de = class extends ne {
|
|
542
|
-
constructor(e) {
|
|
543
|
-
e ||= {};
|
|
544
|
-
let t = Object.assign({}, e), n = e.cacheSize;
|
|
545
|
-
delete e.cacheSize, delete t.preload, delete t.useInterimTilesOnError, super(t), this.on, this.once, this.un, this.cacheSize_ = n, this.setPreload(e.preload === void 0 ? 0 : e.preload), this.setUseInterimTilesOnError(e.useInterimTilesOnError === void 0 || e.useInterimTilesOnError);
|
|
546
|
-
}
|
|
547
|
-
getCacheSize() {
|
|
548
|
-
return this.cacheSize_;
|
|
549
|
-
}
|
|
550
|
-
getPreload() {
|
|
551
|
-
return this.get($.PRELOAD);
|
|
552
|
-
}
|
|
553
|
-
setPreload(e) {
|
|
554
|
-
this.set($.PRELOAD, e);
|
|
555
|
-
}
|
|
556
|
-
getUseInterimTilesOnError() {
|
|
557
|
-
return this.get($.USE_INTERIM_TILES_ON_ERROR);
|
|
558
|
-
}
|
|
559
|
-
setUseInterimTilesOnError(e) {
|
|
560
|
-
this.set($.USE_INTERIM_TILES_ON_ERROR, e);
|
|
561
|
-
}
|
|
562
|
-
getData(e) {
|
|
563
|
-
return super.getData(e);
|
|
564
|
-
}
|
|
565
|
-
}, fe = /* @__PURE__ */ e({ default: () => pe }), pe = class extends de {
|
|
566
|
-
constructor(e) {
|
|
567
|
-
super(e);
|
|
568
|
-
}
|
|
569
|
-
createRenderer() {
|
|
570
|
-
return new ue(this, { cacheSize: this.getCacheSize() });
|
|
571
|
-
}
|
|
572
|
-
};
|
|
573
|
-
//#endregion
|
|
574
|
-
export { q as a, ue as i, fe as n, ae as o, $ as r, G as s, pe as t };
|