@maptalks/vt 0.63.7 → 0.63.8
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/maptalks.vt.js +348 -342
- package/dist/maptalks.vt.mjs +340 -334
- package/package.json +1 -1
package/dist/maptalks.vt.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @maptalks/vt v0.63.
|
|
2
|
+
* @maptalks/vt v0.63.8
|
|
3
3
|
* LICENSE : undefined
|
|
4
4
|
* (c) 2016-2022 maptalks.org
|
|
5
5
|
*/
|
|
@@ -220,12 +220,12 @@
|
|
|
220
220
|
}
|
|
221
221
|
return t.length;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function L(t) {
|
|
224
224
|
const e = {};
|
|
225
225
|
for (const n in t) void 0 !== t[n] && null !== t[n] && (t[n].toJSON ? e[n] = t[n].toJSON() : e[n] = t[n]);
|
|
226
226
|
return e;
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function R(t) {
|
|
229
229
|
return function t(e) {
|
|
230
230
|
if (!Array.isArray(e)) return t([ e ]);
|
|
231
231
|
const n = [];
|
|
@@ -1183,12 +1183,12 @@
|
|
|
1183
1183
|
n && (r = n(r)), r);
|
|
1184
1184
|
};
|
|
1185
1185
|
}
|
|
1186
|
-
function
|
|
1186
|
+
function Lt(t) {
|
|
1187
1187
|
return function(e) {
|
|
1188
1188
|
return Math.max(0, Math.min(t, e));
|
|
1189
1189
|
};
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1191
|
+
function Rt(t) {
|
|
1192
1192
|
return Array.isArray(t) ? t : [ t ];
|
|
1193
1193
|
}
|
|
1194
1194
|
function Nt(t, e) {
|
|
@@ -1239,28 +1239,28 @@
|
|
|
1239
1239
|
alpha: function(t) {
|
|
1240
1240
|
return arguments.length ? new Ht(this.color.concat(Math.max(0, Math.min(1, t))), this.model) : this.valpha;
|
|
1241
1241
|
},
|
|
1242
|
-
red: Dt("rgb", 0,
|
|
1243
|
-
green: Dt("rgb", 1,
|
|
1244
|
-
blue: Dt("rgb", 2,
|
|
1242
|
+
red: Dt("rgb", 0, Lt(255)),
|
|
1243
|
+
green: Dt("rgb", 1, Lt(255)),
|
|
1244
|
+
blue: Dt("rgb", 2, Lt(255)),
|
|
1245
1245
|
hue: Dt([ "hsl", "hsv", "hsl", "hwb", "hcg" ], 0, (function(t) {
|
|
1246
1246
|
return (t % 360 + 360) % 360;
|
|
1247
1247
|
})),
|
|
1248
|
-
saturationl: Dt("hsl", 1,
|
|
1249
|
-
lightness: Dt("hsl", 2,
|
|
1250
|
-
saturationv: Dt("hsv", 1,
|
|
1251
|
-
value: Dt("hsv", 2,
|
|
1252
|
-
chroma: Dt("hcg", 1,
|
|
1253
|
-
gray: Dt("hcg", 2,
|
|
1254
|
-
white: Dt("hwb", 1,
|
|
1255
|
-
wblack: Dt("hwb", 2,
|
|
1256
|
-
cyan: Dt("cmyk", 0,
|
|
1257
|
-
magenta: Dt("cmyk", 1,
|
|
1258
|
-
yellow: Dt("cmyk", 2,
|
|
1259
|
-
black: Dt("cmyk", 3,
|
|
1260
|
-
x: Dt("xyz", 0,
|
|
1261
|
-
y: Dt("xyz", 1,
|
|
1262
|
-
z: Dt("xyz", 2,
|
|
1263
|
-
l: Dt("lab", 0,
|
|
1248
|
+
saturationl: Dt("hsl", 1, Lt(100)),
|
|
1249
|
+
lightness: Dt("hsl", 2, Lt(100)),
|
|
1250
|
+
saturationv: Dt("hsv", 1, Lt(100)),
|
|
1251
|
+
value: Dt("hsv", 2, Lt(100)),
|
|
1252
|
+
chroma: Dt("hcg", 1, Lt(100)),
|
|
1253
|
+
gray: Dt("hcg", 2, Lt(100)),
|
|
1254
|
+
white: Dt("hwb", 1, Lt(100)),
|
|
1255
|
+
wblack: Dt("hwb", 2, Lt(100)),
|
|
1256
|
+
cyan: Dt("cmyk", 0, Lt(100)),
|
|
1257
|
+
magenta: Dt("cmyk", 1, Lt(100)),
|
|
1258
|
+
yellow: Dt("cmyk", 2, Lt(100)),
|
|
1259
|
+
black: Dt("cmyk", 3, Lt(100)),
|
|
1260
|
+
x: Dt("xyz", 0, Lt(100)),
|
|
1261
|
+
y: Dt("xyz", 1, Lt(100)),
|
|
1262
|
+
z: Dt("xyz", 2, Lt(100)),
|
|
1263
|
+
l: Dt("lab", 0, Lt(100)),
|
|
1264
1264
|
a: Dt("lab", 1),
|
|
1265
1265
|
b: Dt("lab", 2),
|
|
1266
1266
|
keyword: function(t) {
|
|
@@ -1349,7 +1349,7 @@
|
|
|
1349
1349
|
if (this.model === t) return new Ht(this);
|
|
1350
1350
|
if (arguments.length) return new Ht(arguments, t);
|
|
1351
1351
|
var n = "number" == typeof arguments[e] ? e : this.valpha;
|
|
1352
|
-
return new Ht(
|
|
1352
|
+
return new Ht(Rt(Ot[this.model][t].raw(this.color)).concat(n), t);
|
|
1353
1353
|
}, Ht[t] = function(n) {
|
|
1354
1354
|
return "number" == typeof n && (n = Nt(Ft.call(arguments), e)), new Ht(n, t);
|
|
1355
1355
|
};
|
|
@@ -1889,17 +1889,17 @@
|
|
|
1889
1889
|
}
|
|
1890
1890
|
return t;
|
|
1891
1891
|
}
|
|
1892
|
-
function
|
|
1892
|
+
function Le(t) {
|
|
1893
1893
|
return null == t;
|
|
1894
1894
|
}
|
|
1895
|
-
function
|
|
1895
|
+
function Re(t) {
|
|
1896
1896
|
return "number" == typeof t && !isNaN(t);
|
|
1897
1897
|
}
|
|
1898
1898
|
function Ne(t) {
|
|
1899
1899
|
return "object" == typeof t && !!t;
|
|
1900
1900
|
}
|
|
1901
1901
|
function ze(t) {
|
|
1902
|
-
return !
|
|
1902
|
+
return !Le(t) && ("string" == typeof t || null !== t.constructor && t.constructor === String);
|
|
1903
1903
|
}
|
|
1904
1904
|
const Ve = Object.prototype.hasOwnProperty;
|
|
1905
1905
|
function je(t, e) {
|
|
@@ -1994,7 +1994,7 @@
|
|
|
1994
1994
|
constructor(t, e, n) {
|
|
1995
1995
|
this.options = n, this.features = this.H(t), this.symbolDef = e, this.symbol = k(e, () => [ n.zoom ]),
|
|
1996
1996
|
this.styledVectors = [], this.properties = {}, this.D = $e.genFnTypes(this.symbolDef),
|
|
1997
|
-
Ue(this.symbolDef.visible) && (this.
|
|
1997
|
+
Ue(this.symbolDef.visible) && (this.L = M(this.symbolDef.visible)), n.atlas && (this.iconAtlas = n.atlas.iconAtlas,
|
|
1998
1998
|
this.glyphAtlas = n.atlas.glyphAtlas);
|
|
1999
1999
|
}
|
|
2000
2000
|
H(t) {
|
|
@@ -2132,11 +2132,11 @@
|
|
|
2132
2132
|
for (let i = 0, r = t.length; i < r; i++) {
|
|
2133
2133
|
if (!t[i].feature.geometry) continue;
|
|
2134
2134
|
const r = Array.isArray(t[i]) ? t[i][0].feature.id : t[i].feature.id;
|
|
2135
|
-
|
|
2135
|
+
Re(r) && (Math.abs(r) > l && (l = Math.abs(r)), r < 0 && (h = !0));
|
|
2136
2136
|
const c = this.data.aPosition.length;
|
|
2137
|
-
if (Array.isArray(t[i])) for (let n = 0; n < t[i].length; n++) this.
|
|
2137
|
+
if (Array.isArray(t[i])) for (let n = 0; n < t[i].length; n++) this.R(t[i][n], e); else this.R(t[i], e);
|
|
2138
2138
|
const u = (n.aPosition.length - c) / 3;
|
|
2139
|
-
for (let e = 0; e < u; e++) s.push(t[i].featureIdx),
|
|
2139
|
+
for (let e = 0; e < u; e++) s.push(t[i].featureIdx), Re(r) && a.push(r);
|
|
2140
2140
|
o = Math.max(o, t[i].featureIdx);
|
|
2141
2141
|
}
|
|
2142
2142
|
if (this.hasElements() && !i.length) return null;
|
|
@@ -2174,8 +2174,8 @@
|
|
|
2174
2174
|
} else d.featureIds = [];
|
|
2175
2175
|
return d;
|
|
2176
2176
|
}
|
|
2177
|
-
|
|
2178
|
-
this.
|
|
2177
|
+
R(t, e) {
|
|
2178
|
+
this.L && this.L.isZoomConstant && !this.L(null, t.feature.properties) || this.placeVector(t, e, this.formatWidth);
|
|
2179
2179
|
}
|
|
2180
2180
|
addElements(...t) {
|
|
2181
2181
|
this.maxIndex = Math.max(this.maxIndex, ...t), this.elements.push(...t);
|
|
@@ -2230,11 +2230,11 @@
|
|
|
2230
2230
|
function Ke(t, e, n, i) {
|
|
2231
2231
|
const r = "__fn_textSize".trim();
|
|
2232
2232
|
let s = t.textSize;
|
|
2233
|
-
if (
|
|
2233
|
+
if (Le(e.textSize)) return [ 16, 16 ];
|
|
2234
2234
|
t[r] && (s = t[r]);
|
|
2235
2235
|
const o = [];
|
|
2236
2236
|
var a;
|
|
2237
|
-
return o[0] =
|
|
2237
|
+
return o[0] = Le(a = s) || "function" != typeof a && (null === a.constructor || a.constructor !== Function) ? s : s(i, n),
|
|
2238
2238
|
o[1] = o[0], o;
|
|
2239
2239
|
}
|
|
2240
2240
|
function Qe(t) {
|
|
@@ -2251,7 +2251,7 @@
|
|
|
2251
2251
|
return ze(t) ? t.replace(tn, (function(t, n) {
|
|
2252
2252
|
if (!e) return "";
|
|
2253
2253
|
const i = e[n];
|
|
2254
|
-
return
|
|
2254
|
+
return Le(i) ? "" : Array.isArray(i) ? i.join() : i;
|
|
2255
2255
|
})) : t;
|
|
2256
2256
|
}
|
|
2257
2257
|
const nn = t => t >= 11904 && t <= 12031, rn = t => t >= 12032 && t <= 12255, sn = t => t >= 12272 && t <= 12287, on = t => t >= 12288 && t <= 12351, an = t => t >= 12352 && t <= 12447, ln = t => t >= 12448 && t <= 12543, hn = t => t >= 12544 && t <= 12591, cn = t => t >= 12704 && t <= 12735, un = t => t >= 12736 && t <= 12783, fn = t => t >= 12784 && t <= 12799, dn = t => t >= 12800 && t <= 13055, pn = t => t >= 13056 && t <= 13311, yn = t => t >= 13312 && t <= 19903, mn = t => t >= 19968 && t <= 40959, gn = t => t >= 40960 && t <= 42127, vn = t => t >= 42128 && t <= 42191, xn = t => t >= 63744 && t <= 64255, bn = t => t >= 64336 && t <= 65023, wn = t => t >= 65040 && t <= 65055, An = t => t >= 65072 && t <= 65103, _n = t => t >= 65104 && t <= 65135, Mn = t => t >= 65136 && t <= 65279, Sn = t => t >= 65280 && t <= 65519;
|
|
@@ -2401,7 +2401,7 @@
|
|
|
2401
2401
|
let o = 0;
|
|
2402
2402
|
for (let n = 0; n < t.length; n++) {
|
|
2403
2403
|
const l = t.charCodeAt(n), h = i[l];
|
|
2404
|
-
h && !Hn[l] && (o += h.metrics.advance + e), n < t.length - 1 && (Dn[l] || !((a = l) < 11904) && (cn(a) || hn(a) || An(a) || xn(a) || pn(a) || nn(a) || un(a) || on(a) || yn(a) || mn(a) || dn(a) || Sn(a) || an(a) || sn(a) || rn(a) || fn(a) || ln(a) || wn(a) || vn(a) || gn(a))) && r.push(Nn(n + 1, o, s, r,
|
|
2404
|
+
h && !Hn[l] && (o += h.metrics.advance + e), n < t.length - 1 && (Dn[l] || !((a = l) < 11904) && (cn(a) || hn(a) || An(a) || xn(a) || pn(a) || nn(a) || un(a) || on(a) || yn(a) || mn(a) || dn(a) || Sn(a) || an(a) || sn(a) || rn(a) || fn(a) || ln(a) || wn(a) || vn(a) || gn(a))) && r.push(Nn(n + 1, o, s, r, Rn(l, t.charCodeAt(n + 1)), !1));
|
|
2405
2405
|
}
|
|
2406
2406
|
var a;
|
|
2407
2407
|
return function t(e) {
|
|
@@ -2466,19 +2466,19 @@
|
|
|
2466
2466
|
8211: !0,
|
|
2467
2467
|
8231: !0
|
|
2468
2468
|
};
|
|
2469
|
-
function
|
|
2469
|
+
function Ln(t, e, n, i) {
|
|
2470
2470
|
const r = Math.pow(t - e, 2);
|
|
2471
2471
|
return i ? t < e ? r / 2 : 2 * r : r + Math.abs(n) * n;
|
|
2472
2472
|
}
|
|
2473
|
-
function
|
|
2473
|
+
function Rn(t, e) {
|
|
2474
2474
|
let n = 0;
|
|
2475
2475
|
return 10 === t && (n -= 1e4), 40 !== t && 65288 !== t || (n += 50), 41 !== e && 65289 !== e || (n += 50),
|
|
2476
2476
|
n;
|
|
2477
2477
|
}
|
|
2478
2478
|
function Nn(t, e, n, i, r, s) {
|
|
2479
|
-
let o = null, a =
|
|
2479
|
+
let o = null, a = Ln(e, n, r, s);
|
|
2480
2480
|
for (let t = 0; t < i.length; t++) {
|
|
2481
|
-
const l = i[t], h =
|
|
2481
|
+
const l = i[t], h = Ln(e - l.x, n, r, s) + l.badness;
|
|
2482
2482
|
h <= a && (o = l, a = h);
|
|
2483
2483
|
}
|
|
2484
2484
|
return {
|
|
@@ -2584,11 +2584,11 @@
|
|
|
2584
2584
|
}
|
|
2585
2585
|
getIconAndGlyph() {
|
|
2586
2586
|
if (this.iconGlyph) return this.iconGlyph;
|
|
2587
|
-
const {markerFileFn: t, markerTypeFn: e, markerPathFn: n, markerWidthFn: i, markerHeightFn: r, markerFillFn: s, markerFillPatternFileFn: o, markerFillOpacityFn: a, markerTextFitFn: l, markerTextFitPaddingFn: h, markerLineColorFn: c, markerLineWidthFn: u, markerLineOpacityFn: f, markerLineDasharrayFn: d, markerLinePatternFileFn: p, markerPathWidthFn: y, markerPathHeightFn: m, textNameFn: g, textFaceNameFn: v, textStyleFn: x, textWeightFn: b} = this.D, {zoom: w} = this.options, A = {}, S = this.symbol, k = this.feature.properties, P = t ? t(null, k) : S.markerFile, T = e ? e(null, k) : S.markerType, O = P || T || S.markerPath, F = !
|
|
2587
|
+
const {markerFileFn: t, markerTypeFn: e, markerPathFn: n, markerWidthFn: i, markerHeightFn: r, markerFillFn: s, markerFillPatternFileFn: o, markerFillOpacityFn: a, markerTextFitFn: l, markerTextFitPaddingFn: h, markerLineColorFn: c, markerLineWidthFn: u, markerLineOpacityFn: f, markerLineDasharrayFn: d, markerLinePatternFileFn: p, markerPathWidthFn: y, markerPathHeightFn: m, textNameFn: g, textFaceNameFn: v, textStyleFn: x, textWeightFn: b} = this.D, {zoom: w} = this.options, A = {}, S = this.symbol, k = this.feature.properties, P = t ? t(null, k) : S.markerFile, T = e ? e(null, k) : S.markerType, O = P || T || S.markerPath, F = !Le(this.symbolDef.textName);
|
|
2588
2588
|
let I;
|
|
2589
2589
|
if (O) {
|
|
2590
2590
|
I = function(t, e, n, i, r, s) {
|
|
2591
|
-
if (
|
|
2591
|
+
if (Le(e.markerWidth) && Le(e.markerHeight)) return null;
|
|
2592
2592
|
const o = "__fn_markerWidth".trim(), a = "__fn_markerHeight".trim();
|
|
2593
2593
|
let l = e.markerWidth || 0, h = e.markerHeight || 0;
|
|
2594
2594
|
return Ne(l) && ("identity" !== l.type ? l = Qe(l) : (l = t.markerWidth, t[o] && (l = t[o](i, n)),
|
|
@@ -2626,43 +2626,43 @@
|
|
|
2626
2626
|
e.markerPathWidth = y ? y(null, k) : S.markerPathWidth, e.markerPathHeight = m ? m(null, k) : S.markerPathHeight),
|
|
2627
2627
|
i) {
|
|
2628
2628
|
const t = i(null, k);
|
|
2629
|
-
|
|
2629
|
+
Le(t) || (e.markerWidth = t);
|
|
2630
2630
|
} else S.markerWidth >= 0 && (e.markerWidth = S.markerWidth);
|
|
2631
2631
|
if (r) {
|
|
2632
2632
|
const t = r(null, k);
|
|
2633
|
-
|
|
2633
|
+
Le(t) || (e.markerHeight = t);
|
|
2634
2634
|
} else S.markerHeight >= 0 && (e.markerHeight = S.markerHeight);
|
|
2635
2635
|
if (s) {
|
|
2636
2636
|
const t = s(null, k);
|
|
2637
|
-
|
|
2637
|
+
Le(t) || (e.markerFill = t);
|
|
2638
2638
|
} else S.markerFill && (e.markerFill = S.markerFill);
|
|
2639
2639
|
if (o) {
|
|
2640
2640
|
const t = o(null, k);
|
|
2641
|
-
|
|
2641
|
+
Le(t) || (e.markerFillPatternFile = t);
|
|
2642
2642
|
} else S.markerFillPatternFile && (e.markerFillPatternFile = S.markerFillPatternFile);
|
|
2643
2643
|
if (a) {
|
|
2644
2644
|
const t = a(null, k);
|
|
2645
|
-
|
|
2645
|
+
Le(t) || (e.markerFillOpacity = t);
|
|
2646
2646
|
} else S.markerFillOpacity >= 0 && (e.markerFillOpacity = S.markerFillOpacity);
|
|
2647
2647
|
if (c) {
|
|
2648
2648
|
const t = c(null, k);
|
|
2649
|
-
|
|
2649
|
+
Le(t) || (e.markerLineColor = t);
|
|
2650
2650
|
} else S.markerLineColor && (e.markerLineColor = S.markerLineColor);
|
|
2651
2651
|
if (u) {
|
|
2652
2652
|
const t = u(null, k);
|
|
2653
|
-
|
|
2653
|
+
Le(t) || (e.markerLineWidth = t);
|
|
2654
2654
|
} else S.markerLineWidth >= 0 && (e.markerLineWidth = S.markerLineWidth);
|
|
2655
2655
|
if (f) {
|
|
2656
2656
|
const t = f(null, k);
|
|
2657
|
-
|
|
2657
|
+
Le(t) || (e.markerLineOpacity = t);
|
|
2658
2658
|
} else S.markerLineOpacity >= 0 && (e.markerLineOpacity = S.markerLineOpacity);
|
|
2659
2659
|
if (d) {
|
|
2660
2660
|
const t = d(null, k);
|
|
2661
|
-
|
|
2661
|
+
Le(t) || (e.markerLineDasharray = t);
|
|
2662
2662
|
} else S.markerLineDasharray && (e.markerLineDasharray = S.markerLineDasharray);
|
|
2663
2663
|
if (p) {
|
|
2664
2664
|
const t = p(null, k);
|
|
2665
|
-
|
|
2665
|
+
Le(t) || (e.markerLinePatternFile = t);
|
|
2666
2666
|
} else S.markerLinePatternFile && (e.markerLinePatternFile = S.markerLinePatternFile);
|
|
2667
2667
|
t = "vector://" + JSON.stringify(e);
|
|
2668
2668
|
} else t = P ? P.replace(Un, this.V) : S.markerPath ? function(t, e, n) {
|
|
@@ -2685,11 +2685,11 @@
|
|
|
2685
2685
|
};
|
|
2686
2686
|
return 0 === e.stroke["stroke-width"] && (e.stroke["stroke-opacity"] = 0), e;
|
|
2687
2687
|
}(t);
|
|
2688
|
-
|
|
2688
|
+
Re(t.markerOpacity) && (i = t.markerOpacity), Re(t.opacity) && (i *= t.opacity);
|
|
2689
2689
|
const s = {};
|
|
2690
2690
|
if (r) {
|
|
2691
|
-
for (const t in r.stroke) je(r.stroke, t) && (
|
|
2692
|
-
for (const t in r.fill) je(r.fill, t) && (
|
|
2691
|
+
for (const t in r.stroke) je(r.stroke, t) && (Le(r.stroke[t]) || (s[t] = r.stroke[t]));
|
|
2692
|
+
for (const t in r.fill) je(r.fill, t) && (Le(r.fill[t]) || (s[t] = r.fill[t]));
|
|
2693
2693
|
}
|
|
2694
2694
|
const o = Array.isArray(t.markerPath) ? t.markerPath : [ t.markerPath ];
|
|
2695
2695
|
let a;
|
|
@@ -3181,7 +3181,7 @@
|
|
|
3181
3181
|
e >= 1) return !1;
|
|
3182
3182
|
return !0;
|
|
3183
3183
|
}(t.getIconAndGlyph().glyph.text) ? 1 : 0, {textFillFn: u, textSizeFn: f, textHaloFillFn: d, textHaloRadiusFn: p, textHaloOpacityFn: y, textDxFn: m, textDyFn: g, textPitchAlignmentFn: v, textRotationAlignmentFn: x, textRotationFn: b, textAllowOverlapFn: w, textIgnorePlacementFn: A, textOpacityFn: M, markerWidthFn: S, markerHeightFn: k, markerDxFn: P, markerDyFn: T, markerPitchAlignmentFn: O, markerRotationAlignmentFn: F, markerRotationFn: I, markerAllowOverlapFn: C, markerIgnorePlacementFn: E, markerOpacityFn: H} = this.D;
|
|
3184
|
-
let D,
|
|
3184
|
+
let D, L, R, N, V, j, U, G, W, B, X, q, J, Y, $, Z, K;
|
|
3185
3185
|
if (h) {
|
|
3186
3186
|
const e = t.getIconAndGlyph().glyph.font;
|
|
3187
3187
|
D = function(t, e, n) {
|
|
@@ -3207,8 +3207,8 @@
|
|
|
3207
3207
|
});
|
|
3208
3208
|
}
|
|
3209
3209
|
return r;
|
|
3210
|
-
}(n.horizontal, l, this.glyphAtlas.positions[e]), u && (
|
|
3211
|
-
3 ===
|
|
3210
|
+
}(n.horizontal, l, this.glyphAtlas.positions[e]), u && (L = u(null, a), _(L) ? L = [ 0, 0, 0, 0 ] : (L = Array.isArray(L) ? L.map(t => 255 * t) : zt(L).array(),
|
|
3211
|
+
3 === L.length && L.push(255))), f && (R = f(this.options.zoom, a), Xe(R) && (R = 14)),
|
|
3212
3212
|
d && (N = d(null, a), N = Array.isArray(N) ? N.map(t => 255 * t) : zt(N).array(),
|
|
3213
3213
|
3 === N.length && N.push(255)), p && (V = p(null, a)), y && (j = 255 * y(null, a)),
|
|
3214
3214
|
m && (U = m(null, a) || 0), g && (G = g(null, a) || 0), v && (J = +("map" === v(null, a))),
|
|
@@ -3263,11 +3263,11 @@
|
|
|
3263
3263
|
for (let t = 0; t < a; t++) {
|
|
3264
3264
|
const i = D[t], {tl: a, tr: u, bl: f, br: d, tex: p} = i;
|
|
3265
3265
|
this.X(r, n, o, st, 10 * a.x, 10 * a.y, p.x, p.y + p.h), h && this.q(r, l, rt, i.glyphOffset, e, c),
|
|
3266
|
-
this.J(r,
|
|
3267
|
-
h && this.q(r, l, rt, i.glyphOffset, e, c), this.J(r,
|
|
3266
|
+
this.J(r, L, R, N, V, j, U, G, W, B, X, q, et, J, Y, $, Z, K), this.X(r, n, o, st, 10 * u.x, 10 * u.y, p.x + p.w, p.y + p.h),
|
|
3267
|
+
h && this.q(r, l, rt, i.glyphOffset, e, c), this.J(r, L, R, N, V, j, U, G, W, B, X, q, et, J, Y, $, Z, K),
|
|
3268
3268
|
this.X(r, n, o, st, 10 * f.x, 10 * f.y, p.x, p.y), h && this.q(r, l, rt, i.glyphOffset, e, c),
|
|
3269
|
-
this.J(r,
|
|
3270
|
-
h && this.q(r, l, rt, i.glyphOffset, e, c), this.J(r,
|
|
3269
|
+
this.J(r, L, R, N, V, j, U, G, W, B, X, q, et, J, Y, $, Z, K), this.X(r, n, o, st, 10 * d.x, 10 * d.y, p.x + p.w, p.y),
|
|
3270
|
+
h && this.q(r, l, rt, i.glyphOffset, e, c), this.J(r, L, R, N, V, j, U, G, W, B, X, q, et, J, Y, $, Z, K),
|
|
3271
3271
|
this.addElements(s, s + 1, s + 2), this.addElements(s + 1, s + 2, s + 3), s += 4;
|
|
3272
3272
|
const y = Math.max(Math.abs(n), Math.abs(o), Math.abs(st));
|
|
3273
3273
|
y > this.maxPos && (this.maxPos = y);
|
|
@@ -3285,12 +3285,12 @@
|
|
|
3285
3285
|
}
|
|
3286
3286
|
}
|
|
3287
3287
|
J(t, e, n, i, r, s, o, a, l, h, c, u, f, d, p, y, m, g) {
|
|
3288
|
-
const {textFillFn: v, textSizeFn: x, textHaloFillFn: b, textHaloRadiusFn: w, textHaloOpacityFn: A, textDxFn: _, textDyFn: M, textPitchAlignmentFn: S, textRotationAlignmentFn: k, textRotationFn: P, textAllowOverlapFn: T, textIgnorePlacementFn: O, textOpacityFn: F, markerWidthFn: I, markerHeightFn: C, markerDxFn: E, markerDyFn: H, markerPitchAlignmentFn: D, markerRotationAlignmentFn:
|
|
3288
|
+
const {textFillFn: v, textSizeFn: x, textHaloFillFn: b, textHaloRadiusFn: w, textHaloOpacityFn: A, textDxFn: _, textDyFn: M, textPitchAlignmentFn: S, textRotationAlignmentFn: k, textRotationFn: P, textAllowOverlapFn: T, textIgnorePlacementFn: O, textOpacityFn: F, markerWidthFn: I, markerHeightFn: C, markerDxFn: E, markerDyFn: H, markerPitchAlignmentFn: D, markerRotationAlignmentFn: L, markerRotationFn: R, markerAllowOverlapFn: N, markerIgnorePlacementFn: z, markerOpacityFn: V} = this.D;
|
|
3289
3289
|
v && t.aTextFill.push(...e), x && t.aTextSize.push(n), b && t.aTextHaloFill.push(...i),
|
|
3290
3290
|
w && t.aTextHaloRadius.push(r), A && t.aTextHaloOpacity.push(s), _ && t.aTextDx.push(o),
|
|
3291
3291
|
M && t.aTextDy.push(a), I && t.aMarkerWidth.push(l), C && t.aMarkerHeight.push(h),
|
|
3292
3292
|
E && t.aMarkerDx.push(c), H && t.aMarkerDy.push(u), (V || F) && t.aColorOpacity.push(f),
|
|
3293
|
-
(S || D) && t.aPitchAlign.push(d), (
|
|
3293
|
+
(S || D) && t.aPitchAlign.push(d), (L || k) && t.aRotationAlign.push(p), (R || P) && t.aRotation.push(9362 * y);
|
|
3294
3294
|
const j = N || T, U = z || O;
|
|
3295
3295
|
(j || U) && t.aOverlap.push((j ? 8 : 0) + 4 * m + ((U ? 2 : 0) + g)), r > 0 && (this.properties.hasHalo = 1);
|
|
3296
3296
|
}
|
|
@@ -3433,18 +3433,18 @@
|
|
|
3433
3433
|
if (e && (v = e(this.options.zoom, m) || "miter"), n && (x = n(this.options.zoom, m) || "butt"),
|
|
3434
3434
|
i) {
|
|
3435
3435
|
let t = i(this.options.zoom, m);
|
|
3436
|
-
|
|
3436
|
+
Le(t) && (t = 4), this.feaLineWidth = t;
|
|
3437
3437
|
} else this.feaLineWidth = d.lineWidth;
|
|
3438
3438
|
if (r) {
|
|
3439
3439
|
let t = r(this.options.zoom, m);
|
|
3440
|
-
|
|
3440
|
+
Le(t) && (t = 0), this.feaLineStrokeWidth = t;
|
|
3441
3441
|
} else this.feaLineStrokeWidth = d.lineStrokeWidth || 0;
|
|
3442
3442
|
if (o && (this.feaColor = o(this.options.zoom, m) || [ 0, 0, 0, 255 ], _(this.feaColor) ? this.feaColor = [ 0, 0, 0, 0 ] : (this.feaColor = Array.isArray(this.feaColor) ? this.feaColor.map(t => 255 * t) : zt(this.feaColor).array(),
|
|
3443
3443
|
3 === this.feaColor.length && this.feaColor.push(255))), s && (this.feaStrokeColor = s(this.options.zoom, m) || [ 0, 0, 0, 255 ],
|
|
3444
3444
|
_(this.feaStrokeColor) ? this.feaStrokeColor = [ 0, 0, 0, 0 ] : (this.feaStrokeColor = Array.isArray(this.feaStrokeColor) ? this.feaStrokeColor.map(t => 255 * t) : zt(this.feaStrokeColor).array(),
|
|
3445
3445
|
3 === this.feaStrokeColor.length && this.feaStrokeColor.push(255))), a) {
|
|
3446
3446
|
let t = a(this.options.zoom, m);
|
|
3447
|
-
|
|
3447
|
+
Le(t) && (t = 1), this.feaOpacity = 255 * t;
|
|
3448
3448
|
}
|
|
3449
3449
|
if (this.dasharrayFn) {
|
|
3450
3450
|
let t = this.dasharrayFn(this.options.zoom, m) || [ 0, 0, 0, 0 ];
|
|
@@ -3470,19 +3470,19 @@
|
|
|
3470
3470
|
}
|
|
3471
3471
|
if (h) {
|
|
3472
3472
|
let t = h(this.options.zoom, m);
|
|
3473
|
-
|
|
3473
|
+
Le(t) && (t = 0), this.feaLineDx = t;
|
|
3474
3474
|
}
|
|
3475
3475
|
if (c) {
|
|
3476
3476
|
let t = c(this.options.zoom, m);
|
|
3477
|
-
|
|
3477
|
+
Le(t) && (t = 0), this.feaLineDy = t;
|
|
3478
3478
|
}
|
|
3479
3479
|
if (u) {
|
|
3480
3480
|
let t = u(this.options.zoom, m);
|
|
3481
|
-
|
|
3481
|
+
Le(t) && (t = 0), 0 !== t && (this.properties.hasPatternAnim = 1), this.feaPatternAnimSpeed = t;
|
|
3482
3482
|
}
|
|
3483
3483
|
if (f) {
|
|
3484
3484
|
let t = f(this.options.zoom, m);
|
|
3485
|
-
|
|
3485
|
+
Le(t) && (t = 0), this.feaLinePatternGap = t;
|
|
3486
3486
|
}
|
|
3487
3487
|
const b = this.options.EXTENT;
|
|
3488
3488
|
let w = p.geometry;
|
|
@@ -3728,9 +3728,9 @@
|
|
|
3728
3728
|
let n, i, r, s;
|
|
3729
3729
|
const {polygonFillFn: o, polygonOpacityFn: a, uvScaleFn: l, uvOffsetFn: h} = this.D, c = e.properties;
|
|
3730
3730
|
o && (n = o(this.options.zoom, c) || [ 255, 255, 255, 255 ], _(n) ? n = [ 0, 0, 0, 0 ] : (n = Array.isArray(n) ? n.map(t => 255 * t) : zt(n).array(),
|
|
3731
|
-
3 === n.length && n.push(255))), a && (i = a(this.options.zoom, c),
|
|
3732
|
-
i *= 255), l && (r = l(this.options.zoom, c),
|
|
3733
|
-
h && (s = h(this.options.zoom, c),
|
|
3731
|
+
3 === n.length && n.push(255))), a && (i = a(this.options.zoom, c), Le(i) && (i = 1),
|
|
3732
|
+
i *= 255), l && (r = l(this.options.zoom, c), Le(r) && (r = [ 1, 1 ]), r = [ 255 * r[0], 255 * r[1] ]),
|
|
3733
|
+
h && (s = h(this.options.zoom, c), Le(s) && (s = [ 0, 0 ]), s = [ 255 * s[0], 255 * s[1] ]);
|
|
3734
3734
|
const u = !!this.iconAtlas, f = $n(t, 500), d = this.getAltitude(c), p = [ 0, 0 ], y = [ 0, 0 ];
|
|
3735
3735
|
if (u) {
|
|
3736
3736
|
const {polygonPatternFileFn: t} = this.D, e = t ? t(null, c) : this.symbol.polygonPatternFile;
|
|
@@ -4186,7 +4186,7 @@
|
|
|
4186
4186
|
layerId: n,
|
|
4187
4187
|
command: "loadTile",
|
|
4188
4188
|
params: {
|
|
4189
|
-
tileInfo:
|
|
4189
|
+
tileInfo: L(t.tileInfo),
|
|
4190
4190
|
glScale: t.glScale,
|
|
4191
4191
|
zScale: t.zScale
|
|
4192
4192
|
}
|
|
@@ -4319,25 +4319,25 @@
|
|
|
4319
4319
|
});
|
|
4320
4320
|
}
|
|
4321
4321
|
}
|
|
4322
|
-
const Di = new Uint8Array([ 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1 ]),
|
|
4323
|
-
class
|
|
4322
|
+
const Di = new Uint8Array([ 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1 ]), Li = [];
|
|
4323
|
+
class Ri {
|
|
4324
4324
|
constructor(t, e, i) {
|
|
4325
4325
|
this.Mt = t;
|
|
4326
4326
|
(this.Ht = new n.reshader.Geometry({
|
|
4327
4327
|
aPosition: Di
|
|
4328
4328
|
}, null, Di.length / 2, {
|
|
4329
4329
|
positionSize: 2
|
|
4330
|
-
})).generateBuffers(t), this.Dt = new n.reshader.Scene, this.
|
|
4330
|
+
})).generateBuffers(t), this.Dt = new n.reshader.Scene, this.Lt = [], this.Rt = 0,
|
|
4331
4331
|
this.Nt = e, this.St = i, this.Tt(t);
|
|
4332
4332
|
}
|
|
4333
4333
|
start() {
|
|
4334
|
-
this.
|
|
4334
|
+
this.Rt = 0, this.Dt.clear();
|
|
4335
4335
|
}
|
|
4336
4336
|
add(t, e, i) {
|
|
4337
4337
|
const r = this.zt(i);
|
|
4338
|
-
r.setUniform("ref", t), n.vec3.set(
|
|
4338
|
+
r.setUniform("ref", t), n.vec3.set(Li, e, e, 1);
|
|
4339
4339
|
const s = r.localTransform;
|
|
4340
|
-
n.mat4.fromScaling(s,
|
|
4340
|
+
n.mat4.fromScaling(s, Li), n.mat4.mul(s, i, s), r.setLocalTransform(s), this.Dt.addMesh(r);
|
|
4341
4341
|
}
|
|
4342
4342
|
render(t) {
|
|
4343
4343
|
this.Vt.render(this.jt, {
|
|
@@ -4345,8 +4345,8 @@
|
|
|
4345
4345
|
}, this.Dt, t);
|
|
4346
4346
|
}
|
|
4347
4347
|
zt() {
|
|
4348
|
-
const t = this.
|
|
4349
|
-
return this.
|
|
4348
|
+
const t = this.Rt++;
|
|
4349
|
+
return this.Lt[t] || (this.Lt[t] = new n.reshader.Mesh(this.Ht)), this.Lt[t];
|
|
4350
4350
|
}
|
|
4351
4351
|
Tt(t) {
|
|
4352
4352
|
const e = this.Nt, i = {
|
|
@@ -4393,8 +4393,8 @@
|
|
|
4393
4393
|
}
|
|
4394
4394
|
remove() {
|
|
4395
4395
|
this.Ht.dispose();
|
|
4396
|
-
for (let t = 0; t < this.
|
|
4397
|
-
this.
|
|
4396
|
+
for (let t = 0; t < this.Lt.length; t++) this.Lt[t].dispose();
|
|
4397
|
+
this.Lt.length = 0, this.jt.dispose();
|
|
4398
4398
|
}
|
|
4399
4399
|
}
|
|
4400
4400
|
const Ni = [], zi = [ 0, 0, 0, 0 ], Vi = new r.Point(0, 0);
|
|
@@ -4788,10 +4788,10 @@
|
|
|
4788
4788
|
}
|
|
4789
4789
|
Ee(t) {
|
|
4790
4790
|
const e = this.isEnableTileStencil(), n = this.getCurrentTileZoom();
|
|
4791
|
-
let i = this.
|
|
4792
|
-
i || (i = this.
|
|
4793
|
-
const {tiles: r} = this.
|
|
4794
|
-
let {parentTiles: s, childTiles: o} = this.
|
|
4791
|
+
let i = this.Le;
|
|
4792
|
+
i || (i = this.Le = new Ri(this.regl, this.canvas, this.getMap())), i.start();
|
|
4793
|
+
const {tiles: r} = this.Re;
|
|
4794
|
+
let {parentTiles: s, childTiles: o} = this.Re, a = 1;
|
|
4795
4795
|
o = o.sort(Gi);
|
|
4796
4796
|
for (let t = 0; t < o.length; t++) this.Ne(o[t].info, e ? a : this.getTileLevelValue(o[t].info.z, n)),
|
|
4797
4797
|
a++;
|
|
@@ -4805,7 +4805,7 @@
|
|
|
4805
4805
|
}
|
|
4806
4806
|
Ne(t, e) {
|
|
4807
4807
|
const n = this.ze, i = Vi.set(t.extent2d.xmin, t.extent2d.ymax), r = t.transform = t.transform || this.calculateTileMatrix(i, t.z);
|
|
4808
|
-
t.stencilRef = e, this.
|
|
4808
|
+
t.stencilRef = e, this.Le.add(e, n, r);
|
|
4809
4809
|
}
|
|
4810
4810
|
onDrawTileStart(t) {
|
|
4811
4811
|
super.onDrawTileStart(t);
|
|
@@ -4814,7 +4814,7 @@
|
|
|
4814
4814
|
for (let t = 0; t < e.length; t++) this.be[e[t].info.id] = 1;
|
|
4815
4815
|
for (let t = 0; t < n.length; t++) this.we[n[t].info.id] = 1;
|
|
4816
4816
|
for (let t = 0; t < i.length; t++) this.we[i[t].info.id] = 1;
|
|
4817
|
-
this.
|
|
4817
|
+
this.Re = t;
|
|
4818
4818
|
}
|
|
4819
4819
|
isEnableTileStencil() {
|
|
4820
4820
|
return this.layer.isOnly2D();
|
|
@@ -4925,7 +4925,7 @@
|
|
|
4925
4925
|
}));
|
|
4926
4926
|
}
|
|
4927
4927
|
onRemove() {
|
|
4928
|
-
this.
|
|
4928
|
+
this.Le && this.Le.remove(), this.qt && (this.qt.removeLayer(t => {
|
|
4929
4929
|
if (t) throw t;
|
|
4930
4930
|
}), this.qt.remove(), delete this.qt), this.pickingFBO && (this.canvas.pickingFBO || this.pickingFBO.destroy(),
|
|
4931
4931
|
delete this.pickingFBO), this.ne && this.ne.delete(), super.onRemove && super.onRemove(),
|
|
@@ -5658,7 +5658,7 @@
|
|
|
5658
5658
|
return t && "VectorTileLayer" === t.type ? new Qi(t.id, t.options) : null;
|
|
5659
5659
|
}
|
|
5660
5660
|
Se() {
|
|
5661
|
-
this.Je && (this.sn =
|
|
5661
|
+
this.Je && (this.sn = R(this.Je)), this.Xe && (this.an = R(this.Xe));
|
|
5662
5662
|
}
|
|
5663
5663
|
static registerPlugin(t) {
|
|
5664
5664
|
Qi.plugins || (Qi.plugins = {}), Qi.plugins[t.type] = t;
|
|
@@ -6290,7 +6290,7 @@
|
|
|
6290
6290
|
let br = new Float32Array(1);
|
|
6291
6291
|
class wr extends r.renderer.CanvasRenderer {
|
|
6292
6292
|
constructor(...t) {
|
|
6293
|
-
super(...t), this.features = {}, this.vn = {}, this.
|
|
6293
|
+
super(...t), this.features = {}, this.vn = {}, this.Rt = 1, this.xn = {}, this.bn = {},
|
|
6294
6294
|
this.wn = {}, this.An = {}, this._n = {}, this.Mn = !0, this.Sn = {
|
|
6295
6295
|
id: 0,
|
|
6296
6296
|
pickingId: 0
|
|
@@ -6314,7 +6314,7 @@
|
|
|
6314
6314
|
const t = this.Dn;
|
|
6315
6315
|
delete this.Dn, this.In(t), this.En = !1;
|
|
6316
6316
|
}
|
|
6317
|
-
if (!this.meshes && !this.
|
|
6317
|
+
if (!this.meshes && !this.Ln && !this.Rn) return void this.completeRender();
|
|
6318
6318
|
this.Nn && (this.zn(), this.Nn = !1), this.Vn(), n.options.collision && n.clearCollisionIndex(),
|
|
6319
6319
|
this.ae = t, this.ce = e || {};
|
|
6320
6320
|
const i = this.jn();
|
|
@@ -6322,10 +6322,10 @@
|
|
|
6322
6322
|
this.painter && this.meshes && (this.painter.startFrame(i), this.painter.addMesh(this.meshes, null, {
|
|
6323
6323
|
bloom: 1
|
|
6324
6324
|
}), this.painter.prepareRender(i), i.polygonOffsetIndex = r++, this.painter.render(i)),
|
|
6325
|
-
this.
|
|
6325
|
+
this.Rn && (this.On.startFrame(i), this.On.addMesh(this.Rn, null, {
|
|
6326
6326
|
bloom: 1
|
|
6327
|
-
}), this.On.prepareRender(i), i.polygonOffsetIndex = r++, this.On.render(i)), this.
|
|
6328
|
-
this.Tn.addMesh(this.
|
|
6327
|
+
}), this.On.prepareRender(i), i.polygonOffsetIndex = r++, this.On.render(i)), this.Ln && (this.Tn.startFrame(i),
|
|
6328
|
+
this.Tn.addMesh(this.Ln, null, {
|
|
6329
6329
|
bloom: 1
|
|
6330
6330
|
}), this.Tn.prepareRender(i), n.options.collision && this.Tn.updateCollision(i),
|
|
6331
6331
|
this.Tn.render(i)), this.completeRender(), this.layer.fire("canvasisdirty");
|
|
@@ -6369,8 +6369,8 @@
|
|
|
6369
6369
|
} else s.visible || (this.Nn = !0), this.Wn(s.geometry, e), t.push(s);
|
|
6370
6370
|
}
|
|
6371
6371
|
return t.length || (this.meshes && this.painter && (this.painter.deleteMesh(this.meshes),
|
|
6372
|
-
delete this.meshes), this.
|
|
6373
|
-
delete this.
|
|
6372
|
+
delete this.meshes), this.Ln && (this.Tn.deleteMesh(this.Ln), delete this.Ln), this.Rn && (this.On.deleteMesh(this.Rn),
|
|
6373
|
+
delete this.Rn)), e[3] && (e[0] /= e[3], e[1] /= e[3]), {
|
|
6374
6374
|
features: t,
|
|
6375
6375
|
center: e
|
|
6376
6376
|
};
|
|
@@ -6467,22 +6467,22 @@
|
|
|
6467
6467
|
}
|
|
6468
6468
|
Fn(t) {
|
|
6469
6469
|
const e = Object.keys(this.wn), i = Object.keys(this.An);
|
|
6470
|
-
if (!e.length && !i.length) return void (this.
|
|
6471
|
-
delete this.
|
|
6470
|
+
if (!e.length && !i.length) return void (this.Ln && (this.Tn.deleteMesh(this.Ln),
|
|
6471
|
+
delete this.Ln));
|
|
6472
6472
|
const {features: r, center: s} = this.Gn(), o = [], a = [];
|
|
6473
6473
|
for (let t = 0; t < r.length; t++) {
|
|
6474
6474
|
const e = r[t][xr];
|
|
6475
6475
|
this.wn[e] && o.push(r[t]), this.An[e] && a.push(r[t]);
|
|
6476
6476
|
}
|
|
6477
|
-
if (!o.length && !a.length) return void (this.
|
|
6478
|
-
delete this.
|
|
6477
|
+
if (!o.length && !a.length) return void (this.Ln && (this.Tn.deleteMesh(this.Ln),
|
|
6478
|
+
delete this.Ln));
|
|
6479
6479
|
const l = this.Nn;
|
|
6480
6480
|
this.$n = s;
|
|
6481
6481
|
const h = this.Zn(o, a, t, s);
|
|
6482
6482
|
this.Hn = {};
|
|
6483
6483
|
const c = [], u = [];
|
|
6484
6484
|
this.Kn = !0, Promise.all(h).then(t => {
|
|
6485
|
-
if (this.
|
|
6485
|
+
if (this.Ln && (this.Tn.deleteMesh(this.Ln), delete this.Ln), !t || !t.length) return void this.setToRedraw();
|
|
6486
6486
|
const e = this.Tn.createGeometries(t.map(t => t && t.data), this.xn);
|
|
6487
6487
|
for (let n = 0; n < e.length; n++) this.Bn(e[n].geometry, t[n] && t[n].data);
|
|
6488
6488
|
const i = t[0] && t[0].data.iconAtlas, r = t[0] && t[0].data.glyphAtlas || t[1] && t[1].data.glyphAtlas;
|
|
@@ -6492,11 +6492,11 @@
|
|
|
6492
6492
|
const a = this.Tn.createMeshes(e, o);
|
|
6493
6493
|
for (let t = 0; t < a.length; t++) a[t].geometry.properties.originElements = a[t].geometry.properties.elements.slice(),
|
|
6494
6494
|
a[t].setUniform("level", 0), a[t].material.set("flipY", 1), a[t].properties.meshKey = gr++;
|
|
6495
|
-
this.
|
|
6495
|
+
this.Ln = a, l && (this.Nn = !0), this.Kn = !1, this.setToRedraw();
|
|
6496
6496
|
});
|
|
6497
6497
|
}
|
|
6498
6498
|
zn() {
|
|
6499
|
-
if (this.
|
|
6499
|
+
if (this.Ln && (this.Qn(this.Ln[0], this.wn), this.Qn(this.Ln[1], this.An)), this.Rn) for (let t = 0; t < this.Rn.length; t++) this.Qn(this.Rn[t], this._n);
|
|
6500
6500
|
if (this.meshes) for (let t = 0; t < this.meshes.length; t++) this.Qn(this.meshes[t], this.xn);
|
|
6501
6501
|
}
|
|
6502
6502
|
Qn(t, e) {
|
|
@@ -6528,7 +6528,7 @@
|
|
|
6528
6528
|
const e = t._getInternalSymbol(), n = {
|
|
6529
6529
|
zoom: this.getMap().getZoom()
|
|
6530
6530
|
}, i = this.ei(t);
|
|
6531
|
-
if (!this.
|
|
6531
|
+
if (!this.Ln) return !1;
|
|
6532
6532
|
let r = this.features[i];
|
|
6533
6533
|
Array.isArray(r) || (r = [ r ]);
|
|
6534
6534
|
const s = [], o = [], a = this.getMap().getZoom();
|
|
@@ -6544,7 +6544,7 @@
|
|
|
6544
6544
|
const e = r[t][xr];
|
|
6545
6545
|
this.wn[e] && s.push(r[t]), this.An[e] && o.push(r[t]);
|
|
6546
6546
|
}
|
|
6547
|
-
const c = r[0].id, u = this.Zn(s, o, this.Hn, this.$n), f = this.
|
|
6547
|
+
const c = r[0].id, u = this.Zn(s, o, this.Hn, this.$n), f = this.Ln;
|
|
6548
6548
|
return Promise.all(u).then(t => {
|
|
6549
6549
|
for (let e = 0; e < t.length; e++) {
|
|
6550
6550
|
if (!t[e]) continue;
|
|
@@ -6561,7 +6561,7 @@
|
|
|
6561
6561
|
}), !0;
|
|
6562
6562
|
}
|
|
6563
6563
|
ii(t) {
|
|
6564
|
-
return this.ri(t, this.
|
|
6564
|
+
return this.ri(t, this.Rn, this.Dn, this.si, this.On, ai, mr, this.oi);
|
|
6565
6565
|
}
|
|
6566
6566
|
ri(t, e, n, i, r, s, o, a) {
|
|
6567
6567
|
if (!e) return !1;
|
|
@@ -6617,15 +6617,15 @@
|
|
|
6617
6617
|
}), !0;
|
|
6618
6618
|
}
|
|
6619
6619
|
In(t) {
|
|
6620
|
-
if (!Object.keys(this._n).length) return void (this.
|
|
6621
|
-
delete this.
|
|
6620
|
+
if (!Object.keys(this._n).length) return void (this.Rn && (this.On.deleteMesh(this.Rn),
|
|
6621
|
+
delete this.Rn));
|
|
6622
6622
|
const {features: e, center: n} = this.Gn();
|
|
6623
6623
|
if (!e.length) return;
|
|
6624
6624
|
const i = this.Nn;
|
|
6625
6625
|
this.si = n;
|
|
6626
6626
|
const r = this.oi(e), s = F({}, mr), o = r.map((e, i) => this.createMesh(this.On, ai, s, e, t && t[i], n));
|
|
6627
6627
|
this.ai = !0, Promise.all(o).then(t => {
|
|
6628
|
-
this.
|
|
6628
|
+
this.Rn && this.On.deleteMesh(this.Rn);
|
|
6629
6629
|
const e = [], n = [];
|
|
6630
6630
|
for (let i = 0; i < t.length; i++) {
|
|
6631
6631
|
const r = t[i] && t[i].meshes;
|
|
@@ -6637,7 +6637,7 @@
|
|
|
6637
6637
|
n[i] = t[i].atlas;
|
|
6638
6638
|
}
|
|
6639
6639
|
}
|
|
6640
|
-
this.
|
|
6640
|
+
this.Rn = e, this.Dn = n, i && (this.Nn = i), this.ai = !1, this.setToRedraw();
|
|
6641
6641
|
});
|
|
6642
6642
|
}
|
|
6643
6643
|
oi(t) {
|
|
@@ -6668,7 +6668,7 @@
|
|
|
6668
6668
|
}
|
|
6669
6669
|
}
|
|
6670
6670
|
ei(t) {
|
|
6671
|
-
t[fr] || (t[fr] = this.
|
|
6671
|
+
t[fr] || (t[fr] = this.Rt++);
|
|
6672
6672
|
const e = t[fr];
|
|
6673
6673
|
this.features[e] && this.ci(e), this.features[e] = dr(t, this.Sn, this.features[e]);
|
|
6674
6674
|
const n = this.features[e];
|
|
@@ -6776,7 +6776,7 @@
|
|
|
6776
6776
|
for (let i = 0; i < e.length; i++) if (!t(e[0], n[0])) return !1;
|
|
6777
6777
|
} else if (Array.isArray(e[0]) || Array.isArray(n[0])) return !1;
|
|
6778
6778
|
return !0;
|
|
6779
|
-
}(n, (Array.isArray(r) ? r[0] : r).geometry)) return this.
|
|
6779
|
+
}(n, (Array.isArray(r) ? r[0] : r).geometry)) return this.Rn && (this.En = !0),
|
|
6780
6780
|
void this.onGeometryPositionChange(t);
|
|
6781
6781
|
this.hi([ e ]), this.li(), Ar(this);
|
|
6782
6782
|
}
|
|
@@ -6825,7 +6825,9 @@
|
|
|
6825
6825
|
this.prepareRequestors(), this.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height),
|
|
6826
6826
|
this.painter = this.createPainter();
|
|
6827
6827
|
const e = cr.get3DPainterClass("icon"), n = F({}, pr, yr);
|
|
6828
|
-
this.Tn = new e(this.regl, this.layer, n, this.layer.options.sceneConfig, 0)
|
|
6828
|
+
this.Tn = new e(this.regl, this.layer, n, this.layer.options.sceneConfig, 0), this.Tn.setTextShaderDefines({
|
|
6829
|
+
REVERSE_MAP_ROTATION_ON_PITCH: 1
|
|
6830
|
+
});
|
|
6829
6831
|
const i = cr.get3DPainterClass("line"), r = F({}, mr);
|
|
6830
6832
|
this.On = new i(this.regl, this.layer, r, this.layer.options.sceneConfig, 0), this.layer.getGeometries() && this.onGeometryAdd(this.layer.getGeometries());
|
|
6831
6833
|
}
|
|
@@ -7071,7 +7073,7 @@
|
|
|
7071
7073
|
* BSD License
|
|
7072
7074
|
* https://github.com/gdsmith/jquery.easing/
|
|
7073
7075
|
*/
|
|
7074
|
-
var Hr = Math.pow, Dr = Math.sqrt,
|
|
7076
|
+
var Hr = Math.pow, Dr = Math.sqrt, Lr = Math.sin, Rr = Math.cos, Nr = Math.PI, zr = 1.70158, Vr = 1.525 * zr, jr = 2 * Nr / 3, Ur = 2 * Nr / 4.5;
|
|
7075
7077
|
function Gr(t) {
|
|
7076
7078
|
var e = 7.5625, n = 2.75;
|
|
7077
7079
|
return t < 1 / n ? e * t * t : t < 2 / n ? e * (t -= 1.5 / n) * t + .75 : t < 2.5 / n ? e * (t -= 2.25 / n) * t + .9375 : e * (t -= 2.625 / n) * t + .984375;
|
|
@@ -7143,17 +7145,17 @@
|
|
|
7143
7145
|
|
|
7144
7146
|
case "easeinsine":
|
|
7145
7147
|
return function(t) {
|
|
7146
|
-
return 1 -
|
|
7148
|
+
return 1 - Rr(t * Nr / 2);
|
|
7147
7149
|
}(e);
|
|
7148
7150
|
|
|
7149
7151
|
case "easeoutsine":
|
|
7150
7152
|
return function(t) {
|
|
7151
|
-
return
|
|
7153
|
+
return Lr(t * Nr / 2);
|
|
7152
7154
|
}(e);
|
|
7153
7155
|
|
|
7154
7156
|
case "easeinoutsine":
|
|
7155
7157
|
return function(t) {
|
|
7156
|
-
return -(
|
|
7158
|
+
return -(Rr(Nr * t) - 1) / 2;
|
|
7157
7159
|
}(e);
|
|
7158
7160
|
|
|
7159
7161
|
case "easeinexpo":
|
|
@@ -7188,17 +7190,17 @@
|
|
|
7188
7190
|
|
|
7189
7191
|
case "easeinelastic":
|
|
7190
7192
|
return function(t) {
|
|
7191
|
-
return 0 === t ? 0 : 1 === t ? 1 : -Hr(2, 10 * t - 10) *
|
|
7193
|
+
return 0 === t ? 0 : 1 === t ? 1 : -Hr(2, 10 * t - 10) * Lr((10 * t - 10.75) * jr);
|
|
7192
7194
|
}(e);
|
|
7193
7195
|
|
|
7194
7196
|
case "easeoutelastic":
|
|
7195
7197
|
return function(t) {
|
|
7196
|
-
return 0 === t ? 0 : 1 === t ? 1 : Hr(2, -10 * t) *
|
|
7198
|
+
return 0 === t ? 0 : 1 === t ? 1 : Hr(2, -10 * t) * Lr((10 * t - .75) * jr) + 1;
|
|
7197
7199
|
}(e);
|
|
7198
7200
|
|
|
7199
7201
|
case "easeinoutelastic":
|
|
7200
7202
|
return function(t) {
|
|
7201
|
-
return 0 === t ? 0 : 1 === t ? 1 : t < .5 ? -Hr(2, 20 * t - 10) *
|
|
7203
|
+
return 0 === t ? 0 : 1 === t ? 1 : t < .5 ? -Hr(2, 20 * t - 10) * Lr((20 * t - 11.125) * Ur) / 2 : Hr(2, -20 * t + 10) * Lr((20 * t - 11.125) * Ur) / 2 + 1;
|
|
7202
7204
|
}(e);
|
|
7203
7205
|
|
|
7204
7206
|
case "easeinback":
|
|
@@ -7784,13 +7786,13 @@
|
|
|
7784
7786
|
function Os(t) {
|
|
7785
7787
|
return t && _(t) && t.property;
|
|
7786
7788
|
}
|
|
7787
|
-
const {loginIBLResOnCanvas: Fs, logoutIBLResOnCanvas: Is, getIBLResOnCanvas: Cs} = n.reshader.pbr.PBRUtils, Es = [], Hs = [], Ds = t => 0 === t.getUniform("level"),
|
|
7788
|
-
class
|
|
7789
|
+
const {loginIBLResOnCanvas: Fs, logoutIBLResOnCanvas: Is, getIBLResOnCanvas: Cs} = n.reshader.pbr.PBRUtils, Es = [], Hs = [], Ds = t => 0 === t.getUniform("level"), Ls = t => t.getUniform("level") > 0;
|
|
7790
|
+
class Rs {
|
|
7789
7791
|
constructor(t, e, i, r, s, o) {
|
|
7790
7792
|
this.regl = t, this.layer = e, this.canvas = e.getRenderer().canvas, this.sceneConfig = r || {},
|
|
7791
7793
|
this.dataConfig = o || {}, this.pluginIndex = s, this.scene = new n.reshader.Scene,
|
|
7792
7794
|
this.pickingFBO = e.getRenderer().pickingFBO, this.Hi = new es, this.level0Filter = Ds,
|
|
7793
|
-
this.levelNFilter =
|
|
7795
|
+
this.levelNFilter = Ls, this.loginTextureCache(), this.symbolDef = Array.isArray(i) ? i.map(t => os(t)) : [ os(i) ],
|
|
7794
7796
|
this.Di(), this.pickingViewport = {
|
|
7795
7797
|
x: 0,
|
|
7796
7798
|
y: 0,
|
|
@@ -7806,7 +7808,7 @@
|
|
|
7806
7808
|
return n.getTileLevelValue && n.getTileLevelValue(t, e) || 0;
|
|
7807
7809
|
}
|
|
7808
7810
|
isVisible() {
|
|
7809
|
-
const t = this.
|
|
7811
|
+
const t = this.L;
|
|
7810
7812
|
if (t.length) for (let e = 0; e < t.length; e++) if (t[e] && !t[e].isFeatureConstant) return !0;
|
|
7811
7813
|
const e = this.getSymbols();
|
|
7812
7814
|
for (let t = 0; t < e.length; t++) {
|
|
@@ -7818,7 +7820,7 @@
|
|
|
7818
7820
|
isMeshVisible(t) {
|
|
7819
7821
|
const e = t && t.properties && t.properties.symbolIndex;
|
|
7820
7822
|
if (!e) return !1;
|
|
7821
|
-
const n = this.
|
|
7823
|
+
const n = this.L, i = e.index;
|
|
7822
7824
|
let r;
|
|
7823
7825
|
if (n[i]) {
|
|
7824
7826
|
if (!n[i].isFeatureConstant) return !0;
|
|
@@ -7827,7 +7829,7 @@
|
|
|
7827
7829
|
return !1 !== r && 0 !== r;
|
|
7828
7830
|
}
|
|
7829
7831
|
needToRedraw() {
|
|
7830
|
-
return this.
|
|
7832
|
+
return this.Li;
|
|
7831
7833
|
}
|
|
7832
7834
|
needToRetireFrames() {
|
|
7833
7835
|
return this.$t;
|
|
@@ -7851,7 +7853,7 @@
|
|
|
7851
7853
|
}) : n.push(null); else {
|
|
7852
7854
|
const r = this.createGeometry(t[i], e, i);
|
|
7853
7855
|
if (r && r.geometry) {
|
|
7854
|
-
const {pickingIdMap: n, idPickingMap: s, hasFeaIds: o} = this.
|
|
7856
|
+
const {pickingIdMap: n, idPickingMap: s, hasFeaIds: o} = this.Ri(t[i]), a = r.geometry.properties;
|
|
7855
7857
|
a.symbolIndex = r.symbolIndex, a.features = e, o && (a.feaIdPickingMap = n, a.feaPickingIdMap = s);
|
|
7856
7858
|
}
|
|
7857
7859
|
this.postCreateGeometry(r, n), n.push(r);
|
|
@@ -7859,7 +7861,7 @@
|
|
|
7859
7861
|
return n;
|
|
7860
7862
|
}
|
|
7861
7863
|
postCreateGeometry() {}
|
|
7862
|
-
|
|
7864
|
+
Ri(t) {
|
|
7863
7865
|
if (!t) return {};
|
|
7864
7866
|
if (Array.isArray(t) && !(t = t[0])) return {};
|
|
7865
7867
|
const e = t.featureIds, n = {}, i = {}, r = e && e.length;
|
|
@@ -7924,11 +7926,11 @@
|
|
|
7924
7926
|
this.Ni = t;
|
|
7925
7927
|
const n = this.getUniformValues(e, t);
|
|
7926
7928
|
return this.callShader(n, t), {
|
|
7927
|
-
redraw: this.
|
|
7929
|
+
redraw: this.Li
|
|
7928
7930
|
};
|
|
7929
7931
|
}
|
|
7930
7932
|
setToRedraw(t) {
|
|
7931
|
-
t && (this.$t = t), this.
|
|
7933
|
+
t && (this.$t = t), this.Li = !0;
|
|
7932
7934
|
}
|
|
7933
7935
|
callShader(t, e) {
|
|
7934
7936
|
this.callCurrentTileShader(t, e), this.callBackgroundTileShader(t, e);
|
|
@@ -8008,7 +8010,7 @@
|
|
|
8008
8010
|
}
|
|
8009
8011
|
}
|
|
8010
8012
|
startFrame(t) {
|
|
8011
|
-
this.zi || (this.init(t), this.zi = !0), this.se !== t.timestamp && (this.
|
|
8013
|
+
this.zi || (this.init(t), this.zi = !0), this.se !== t.timestamp && (this.Li = !1,
|
|
8012
8014
|
this.$t = !1), this.scene.clear();
|
|
8013
8015
|
}
|
|
8014
8016
|
resize() {}
|
|
@@ -8053,7 +8055,7 @@
|
|
|
8053
8055
|
enumerable: !0
|
|
8054
8056
|
}) : r[t] = o[t];
|
|
8055
8057
|
}
|
|
8056
|
-
return _(n.visible) && (this.
|
|
8058
|
+
return _(n.visible) && (this.L[t] = M(n.visible)), i;
|
|
8057
8059
|
}
|
|
8058
8060
|
getSymbolDef(t) {
|
|
8059
8061
|
return this.symbolDef[t.index];
|
|
@@ -8067,9 +8069,9 @@
|
|
|
8067
8069
|
}
|
|
8068
8070
|
Di() {
|
|
8069
8071
|
const t = this.getMap(), e = () => [ t.getZoom() ];
|
|
8070
|
-
this.Wi = [], this.
|
|
8072
|
+
this.Wi = [], this.L = [];
|
|
8071
8073
|
for (let t = 0; t < this.symbolDef.length; t++) this.Wi[t] = k(ns({}, this.symbolDef[t]), e),
|
|
8072
|
-
this.symbolDef[t] && _(this.symbolDef[t].visible) && (this.
|
|
8074
|
+
this.symbolDef[t] && _(this.symbolDef[t].visible) && (this.L[t] = M(this.symbolDef[t].visible));
|
|
8073
8075
|
}
|
|
8074
8076
|
getFnTypeConfig(t) {
|
|
8075
8077
|
this.Ui || (this.Ui = []);
|
|
@@ -8267,7 +8269,7 @@
|
|
|
8267
8269
|
function zs(t, e) {
|
|
8268
8270
|
return t.properties.level - e.properties.level;
|
|
8269
8271
|
}
|
|
8270
|
-
class Vs extends
|
|
8272
|
+
class Vs extends Rs {
|
|
8271
8273
|
constructor(t, e, n, i, r, s) {
|
|
8272
8274
|
super(t, e, n, i, r, s);
|
|
8273
8275
|
}
|
|
@@ -8904,13 +8906,13 @@
|
|
|
8904
8906
|
}
|
|
8905
8907
|
class Zs {
|
|
8906
8908
|
constructor(t) {
|
|
8907
|
-
this.
|
|
8909
|
+
this.Lt = t || [], this.properties = {};
|
|
8908
8910
|
}
|
|
8909
8911
|
set meshes(t) {
|
|
8910
|
-
this.
|
|
8912
|
+
this.Lt = t;
|
|
8911
8913
|
}
|
|
8912
8914
|
get meshes() {
|
|
8913
|
-
return this.
|
|
8915
|
+
return this.Lt;
|
|
8914
8916
|
}
|
|
8915
8917
|
}
|
|
8916
8918
|
const Ks = 224, Qs = 600, to = 100, eo = new Uint8Array(1), no = [], io = {
|
|
@@ -9076,7 +9078,7 @@
|
|
|
9076
9078
|
return n - Math.abs(this.Tr(t)[e]) < i;
|
|
9077
9079
|
}
|
|
9078
9080
|
Pr(t, e, n, i, r, s, o) {
|
|
9079
|
-
const a = this.getSymbol(t.properties.symbolIndex), l = this.Er(a, t, e[i]), h = this.
|
|
9081
|
+
const a = this.getSymbol(t.properties.symbolIndex), l = this.Er(a, t, e[i]), h = this.Lr(a, t, e[i]);
|
|
9080
9082
|
if (!1 === this.sceneConfig.collision || l && h) return io;
|
|
9081
9083
|
const c = this.isBoxCollides(t, e, n, i, r, s, o);
|
|
9082
9084
|
return h && (c.collides = 0, c.isAllowOverlap = 1), c;
|
|
@@ -9088,7 +9090,7 @@
|
|
|
9088
9090
|
const r = i[n], s = r % 8;
|
|
9089
9091
|
return r < 2 ? 1 == +t[this.propIgnorePlacement] : s % 2;
|
|
9090
9092
|
}
|
|
9091
|
-
|
|
9093
|
+
Lr(t, e, n) {
|
|
9092
9094
|
if (!1 === this.sceneConfig.collision) return !0;
|
|
9093
9095
|
const i = e.geometry.properties.aOverlap;
|
|
9094
9096
|
if (!i) return 1 == +t[this.propAllowOverlap];
|
|
@@ -9113,15 +9115,15 @@
|
|
|
9113
9115
|
h;
|
|
9114
9116
|
}
|
|
9115
9117
|
Tr(t) {
|
|
9116
|
-
this.
|
|
9118
|
+
this.Rr || (this.Rr = {});
|
|
9117
9119
|
const {meshKey: e} = t.properties;
|
|
9118
|
-
if (!this.
|
|
9120
|
+
if (!this.Rr[e]) {
|
|
9119
9121
|
const {frameTimestamp: t} = this.ar;
|
|
9120
|
-
this.
|
|
9122
|
+
this.Rr[e] = {
|
|
9121
9123
|
timestamp: t
|
|
9122
9124
|
};
|
|
9123
9125
|
}
|
|
9124
|
-
return this.
|
|
9126
|
+
return this.Rr[e];
|
|
9125
9127
|
}
|
|
9126
9128
|
Nr(t) {
|
|
9127
9129
|
if (!this.zr) return void (this.zr = t);
|
|
@@ -9144,10 +9146,10 @@
|
|
|
9144
9146
|
if (t) {
|
|
9145
9147
|
if (Array.isArray(t)) for (let e = 0; e < t.length; e++) {
|
|
9146
9148
|
const n = t[e].properties.meshKey;
|
|
9147
|
-
this.pr && delete this.pr.tags[n], this.
|
|
9149
|
+
this.pr && delete this.pr.tags[n], this.Rr && delete this.Rr[n];
|
|
9148
9150
|
} else {
|
|
9149
9151
|
const e = t.properties.meshKey;
|
|
9150
|
-
this.pr && delete this.pr.tags[e], this.
|
|
9152
|
+
this.pr && delete this.pr.tags[e], this.Rr && delete this.Rr[e];
|
|
9151
9153
|
}
|
|
9152
9154
|
super.deleteMesh(t, e);
|
|
9153
9155
|
}
|
|
@@ -9436,10 +9438,10 @@
|
|
|
9436
9438
|
ss(H) && (H = 15);
|
|
9437
9439
|
const D = n.vec2.set(Oo, E / 24, H / 24);
|
|
9438
9440
|
n.vec2.mul(O, O, D), n.vec2.mul(F, F, D), n.vec2.mul(I, I, D), n.vec2.mul(C, C, D);
|
|
9439
|
-
let
|
|
9440
|
-
const
|
|
9441
|
-
if (
|
|
9442
|
-
const t = xo(Ao,
|
|
9441
|
+
let L = _ ? _[i] / 9362 : -(h.markerRotation || 0) * Math.PI / 180;
|
|
9442
|
+
const R = s.getBearing() * Math.PI / 180;
|
|
9443
|
+
if (R * P || L) {
|
|
9444
|
+
const t = xo(Ao, L, R, P, k);
|
|
9443
9445
|
O = n.vec2.transformMat2(O, O, t), F = n.vec2.transformMat2(F, F, t), I = n.vec2.transformMat2(I, I, t),
|
|
9444
9446
|
C = n.vec2.transformMat2(C, C, t);
|
|
9445
9447
|
}
|
|
@@ -9447,24 +9449,24 @@
|
|
|
9447
9449
|
n.vec2.multiply(F, F, To), n.vec2.multiply(I, I, To), n.vec2.multiply(C, C, To),
|
|
9448
9450
|
vo(t, d, O, F, I, C, T, y)), t;
|
|
9449
9451
|
}
|
|
9450
|
-
const Io = [], Co = [], Eo = [], Ho = [], Do = [],
|
|
9452
|
+
const Io = [], Co = [], Eo = [], Ho = [], Do = [], Lo = [], Ro = [ 1, -1 ];
|
|
9451
9453
|
function No(t, e, i, r, s, o, a, l, h) {
|
|
9452
9454
|
const c = r.material.uniforms, u = h.cameraToCenterDistance, f = r.geometry.properties, d = this.getSymbol(f.symbolIndex), p = "line" === d.textPlacement && !ps(d), y = i[2];
|
|
9453
9455
|
let m = 1;
|
|
9454
9456
|
if (c.textPerspectiveRatio) {
|
|
9455
9457
|
m = is(.5 + .5 * (1 - (1 - u / y) * c.textPerspectiveRatio), 0, 4);
|
|
9456
9458
|
}
|
|
9457
|
-
const {aTextDx: g, aTextDy: v, aPitchAlign: x, aRotationAlign: b, aRotation: w} = r.geometry.properties, A = g ? g[a] : d.textDx, _ = v ? v[a] : d.textDy, M = x ? x[a] : c.pitchWithMap, S = b ? b[a] : c.rotateWithMap, k = n.vec2.set(
|
|
9459
|
+
const {aTextDx: g, aTextDy: v, aPitchAlign: x, aRotationAlign: b, aRotation: w} = r.geometry.properties, A = g ? g[a] : d.textDx, _ = v ? v[a] : d.textDy, M = x ? x[a] : c.pitchWithMap, S = b ? b[a] : c.rotateWithMap, k = n.vec2.set(Lo, A || 0, -(_ || 0));
|
|
9458
9460
|
if (p) {
|
|
9459
9461
|
const {aOffset: r} = f;
|
|
9460
9462
|
let s = n.vec2.set(Co, r[2 * a] / 10, r[2 * a + 1] / 10), o = n.vec2.set(Eo, r[2 * a + 2] / 10, r[2 * a + 3] / 10), u = n.vec2.set(Ho, r[2 * a + 4] / 10, r[2 * a + 5] / 10), d = n.vec2.set(Do, r[2 * a + 6] / 10, r[2 * a + 7] / 10);
|
|
9461
|
-
1 === M ? go(t, e, s, o, u, d, l, k, c, h, y, m) : (n.vec2.multiply(s, s,
|
|
9462
|
-
n.vec2.multiply(u, u,
|
|
9463
|
+
1 === M ? go(t, e, s, o, u, d, l, k, c, h, y, m) : (n.vec2.multiply(s, s, Ro), n.vec2.multiply(o, o, Ro),
|
|
9464
|
+
n.vec2.multiply(u, u, Ro), n.vec2.multiply(d, d, Ro), vo(t, i, s, o, u, d, k, m));
|
|
9463
9465
|
} else {
|
|
9464
9466
|
const {aShape: r} = f;
|
|
9465
9467
|
let o = n.vec2.set(Co, r[2 * a] / 10, r[2 * a + 1] / 10), u = n.vec2.set(Eo, r[2 * a + 2] / 10, r[2 * a + 3] / 10), g = n.vec2.set(Ho, r[2 * a + 4] / 10, r[2 * a + 5] / 10), v = n.vec2.set(Do, r[2 * a + 6] / 10, r[2 * a + 7] / 10);
|
|
9466
|
-
0 === c.flipY && 1 === M && (n.vec2.multiply(o, o,
|
|
9467
|
-
n.vec2.multiply(g, g,
|
|
9468
|
+
0 === c.flipY && 1 === M && (n.vec2.multiply(o, o, Ro), n.vec2.multiply(u, u, Ro),
|
|
9469
|
+
n.vec2.multiply(g, g, Ro), n.vec2.multiply(v, v, Ro));
|
|
9468
9470
|
let x = w ? -w[a] / 9362 : -(d.textRotation || 0) * Math.PI / 180;
|
|
9469
9471
|
const b = p ? 0 : h.getBearing() * Math.PI / 180;
|
|
9470
9472
|
if (x || b) {
|
|
@@ -9630,19 +9632,19 @@
|
|
|
9630
9632
|
function Wo(t, e) {
|
|
9631
9633
|
const i = t.getRenderer().canvas;
|
|
9632
9634
|
return {
|
|
9633
|
-
uniforms: [
|
|
9635
|
+
uniforms: [ {
|
|
9634
9636
|
name: "projViewModelMatrix",
|
|
9635
9637
|
type: "function",
|
|
9636
9638
|
fn: function(t, e) {
|
|
9637
9639
|
return n.mat4.multiply([], e.projViewMatrix, e.modelMatrix);
|
|
9638
9640
|
}
|
|
9639
|
-
},
|
|
9641
|
+
}, {
|
|
9640
9642
|
name: "zoomScale",
|
|
9641
9643
|
type: "function",
|
|
9642
9644
|
fn: function(t, e) {
|
|
9643
9645
|
return e.tileResolution / e.resolution;
|
|
9644
9646
|
}
|
|
9645
|
-
}
|
|
9647
|
+
} ],
|
|
9646
9648
|
extraCommandProps: {
|
|
9647
9649
|
viewport: {
|
|
9648
9650
|
x: 0,
|
|
@@ -9861,7 +9863,7 @@
|
|
|
9861
9863
|
}(t, e, i) : null;
|
|
9862
9864
|
}
|
|
9863
9865
|
const Ko = [], Qo = [];
|
|
9864
|
-
var ta = "#define SHADER_NAME TEXT\n#define RAD 0.0174532925\nattribute vec3 aPosition;\nattribute vec2 aShape;\nattribute vec2 aTexCoord;\n#ifdef ENABLE_COLLISION\nattribute float aOpacity;\n#endif\n#ifdef HAS_OPACITY\nattribute float aColorOpacity;\n#endif\n#ifdef HAS_TEXT_SIZE\nattribute float aTextSize;\n#else\nuniform float textSize;\n#endif\n#ifdef HAS_TEXT_DX\nattribute float aTextDx;\n#else\nuniform float textDx;\n#endif\n#ifdef HAS_TEXT_DY\nattribute float aTextDy;\n#else\nuniform float textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nattribute float aPitchAlign;\n#else\nuniform float pitchWithMap;\n#endif\n#if defined(HAS_ROTATION_ALIGN)\nattribute float aRotationAlign;\n#else\nuniform float rotateWithMap;\n#endif\nuniform float flipY;\n#if defined(HAS_ROTATION)\nattribute float aRotation;\n#else\nuniform float textRotation;\n#endif\nuniform float cameraToCenterDistance;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform vec2 texSize;\nuniform vec2 canvasSize;\nuniform float glyphSize;\nuniform float mapPitch;\nuniform float mapRotation;\nuniform float zoomScale;\nuniform float tileRatio;\nuniform float layerScale;\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vGammaScale;\nvarying float vSize;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nattribute vec4 aTextFill;\nvarying vec4 vTextFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nattribute vec4 aTextHaloFill;\nvarying vec4 vTextHaloFill;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nattribute float aTextHaloRadius;\nvarying float vTextHaloRadius;\n#endif\n#ifdef HAS_TEXT_HALO_OPACITY\nattribute float aTextHaloOpacity;\nvarying float vTextHaloOpacity;\n#endif\n#else\n#include <fbo_picking_vert>\n#endif\nvoid main() {\n vec3 c = aPosition;\n#ifdef HAS_TEXT_SIZE\nfloat d = aTextSize * layerScale;\n#else\nfloat d = textSize * layerScale;\n#endif\n#ifdef HAS_TEXT_DX\nfloat e = aTextDx;\n#else\nfloat e = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat f = aTextDy;\n#else\nfloat f = textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nfloat h = aPitchAlign;\n#else\nfloat h = pitchWithMap;\n#endif\n#if defined(HAS_ROTATION_ALIGN)\nfloat i = aRotationAlign;\n#else\nfloat i = rotateWithMap;\n#endif\nvec2 j = aShape / 10.0;\n if(h == 1. && flipY == .0) {\n j = j * vec2(1., -1.);\n }\n vec2 k = aTexCoord;\n gl_Position = projViewModelMatrix * vec4(c, 1.);\n float l = gl_Position.w;\n float m = (1. - cameraToCenterDistance / l) * textPerspectiveRatio;\n float n = clamp(.5 + .5 * (1. - m), .0, 4.);\n#ifdef HAS_ROTATION\nfloat o = aRotation / 9362. - mapRotation * i;\n#else\nfloat o = textRotation - mapRotation * i;\n#endif\nif(h == 1.) {\n
|
|
9866
|
+
var ta = "#define SHADER_NAME TEXT\n#define RAD 0.0174532925\nattribute vec3 aPosition;\nattribute vec2 aShape;\nattribute vec2 aTexCoord;\n#ifdef ENABLE_COLLISION\nattribute float aOpacity;\n#endif\n#ifdef HAS_OPACITY\nattribute float aColorOpacity;\n#endif\n#ifdef HAS_TEXT_SIZE\nattribute float aTextSize;\n#else\nuniform float textSize;\n#endif\n#ifdef HAS_TEXT_DX\nattribute float aTextDx;\n#else\nuniform float textDx;\n#endif\n#ifdef HAS_TEXT_DY\nattribute float aTextDy;\n#else\nuniform float textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nattribute float aPitchAlign;\n#else\nuniform float pitchWithMap;\n#endif\n#if defined(HAS_ROTATION_ALIGN)\nattribute float aRotationAlign;\n#else\nuniform float rotateWithMap;\n#endif\nuniform float flipY;\n#if defined(HAS_ROTATION)\nattribute float aRotation;\n#else\nuniform float textRotation;\n#endif\nuniform float cameraToCenterDistance;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform vec2 texSize;\nuniform vec2 canvasSize;\nuniform float glyphSize;\nuniform float mapPitch;\nuniform float mapRotation;\nuniform float zoomScale;\nuniform float tileRatio;\nuniform float layerScale;\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vGammaScale;\nvarying float vSize;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nattribute vec4 aTextFill;\nvarying vec4 vTextFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nattribute vec4 aTextHaloFill;\nvarying vec4 vTextHaloFill;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nattribute float aTextHaloRadius;\nvarying float vTextHaloRadius;\n#endif\n#ifdef HAS_TEXT_HALO_OPACITY\nattribute float aTextHaloOpacity;\nvarying float vTextHaloOpacity;\n#endif\n#else\n#include <fbo_picking_vert>\n#endif\nvoid main() {\n vec3 c = aPosition;\n#ifdef HAS_TEXT_SIZE\nfloat d = aTextSize * layerScale;\n#else\nfloat d = textSize * layerScale;\n#endif\n#ifdef HAS_TEXT_DX\nfloat e = aTextDx;\n#else\nfloat e = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat f = aTextDy;\n#else\nfloat f = textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nfloat h = aPitchAlign;\n#else\nfloat h = pitchWithMap;\n#endif\n#if defined(HAS_ROTATION_ALIGN)\nfloat i = aRotationAlign;\n#else\nfloat i = rotateWithMap;\n#endif\nvec2 j = aShape / 10.0;\n if(h == 1. && flipY == .0) {\n j = j * vec2(1., -1.);\n }\n vec2 k = aTexCoord;\n gl_Position = projViewModelMatrix * vec4(c, 1.);\n float l = gl_Position.w;\n float m = (1. - cameraToCenterDistance / l) * textPerspectiveRatio;\n float n = clamp(.5 + .5 * (1. - m), .0, 4.);\n#ifdef HAS_ROTATION\nfloat o = aRotation / 9362. - mapRotation * i;\n#else\nfloat o = textRotation - mapRotation * i;\n#endif\nif(h == 1.) {\n \n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\no += mapRotation;\n#else\no -= mapRotation;\n#endif\n }\n float u = sin(o);\n float v = cos(o);\n mat2 A = mat2(v, -1. * u, u, v);\n j = A * (j / glyphSize * d);\n float B = l / cameraToCenterDistance;\n if(h == .0) {\n vec2 C = j * 2. / canvasSize;\n gl_Position.xy += C * n * l;\n } else {\n vec2 C = j;\n gl_Position = projViewModelMatrix * vec4(c + vec3(C, .0) * tileRatio / zoomScale * B * n, 1.);\n }\n gl_Position.xy += vec2(e, -f) * 2. / canvasSize * l;\n#ifndef PICKING_MODE\nif(h == .0) {\n vGammaScale = mix(1., B, textPerspectiveRatio);\n } else {\n vGammaScale = B + mapPitch / 4.;\n }\n vTexCoord = k / texSize;\n vGammaScale = clamp(vGammaScale, .0, 1.);\n vSize = d;\n#ifdef ENABLE_COLLISION\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity *= aColorOpacity / 255.;\n#endif\n#ifdef HAS_TEXT_FILL\nvTextFill = aTextFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvTextHaloFill = aTextHaloFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nvTextHaloRadius = aTextHaloRadius;\n#endif\n#ifdef HAS_TEXT_HALO_OPACITY\nvTextHaloOpacity = aTextHaloOpacity;\n#endif\n#else\n#ifdef ENABLE_COLLISION\nbool D = aOpacity == 255.;\n#else\nbool D = true;\n#endif\nfbo_picking_setData(gl_Position.w, D);\n#endif\n}", ea = "#define SHADER_NAME TEXT\n#define SDF_PX 8.0\n#define DEVICE_PIXEL_RATIO 1.0\n#define EDGE_GAMMA 0.105 / DEVICE_PIXEL_RATIO\nprecision mediump float;\nuniform sampler2D texture;\nuniform float textOpacity;\nuniform highp float gammaScale;\nuniform int isHalo;\nuniform highp float textHaloBlur;\n#ifdef HAS_TEXT_HALO_OPACITY\nvarying float vTextHaloOpacity;\n#else\nuniform float textHaloOpacity;\n#endif\nvarying vec2 vTexCoord;\nvarying float vSize;\nvarying float vGammaScale;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nvarying vec4 vTextFill;\n#else\nuniform vec4 textFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvarying vec4 vTextHaloFill;\n#else\nuniform vec4 textHaloFill;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nvarying float vTextHaloRadius;\n#else\nuniform highp float textHaloRadius;\n#endif\nvoid main() {\n \n#ifdef HAS_TEXT_FILL\nvec4 c = vTextFill;\n#else\nvec4 c = textFill;\n#endif\nfloat d = vSize / 24.;\n lowp vec4 e = c;\n highp float f = EDGE_GAMMA / (d * gammaScale);\n lowp float h = 185. / 256.;\n if(isHalo == 1) {\n \n#ifdef HAS_TEXT_HALO_FILL\nvec4 i = vTextHaloFill;\n#else\nvec4 i = textHaloFill;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nfloat j = vTextHaloRadius;\n#else\nfloat j = textHaloRadius;\n#endif\ne = i;\n f = (textHaloBlur * 1.19 / SDF_PX + EDGE_GAMMA) / (d * gammaScale);\n h = (6. - j / d) / SDF_PX;\n#ifdef HAS_TEXT_HALO_OPACITY\nfloat k = vTextHaloOpacity / 255.;\n#else\nfloat k = textHaloOpacity;\n#endif\ne *= k * 1.25;\n }\n float l = texture2D(texture, vTexCoord).a;\n highp float m = f * vGammaScale * .7;\n float n = clamp(smoothstep(h - m, h + m, l), .0, 1.);\n gl_FragColor = e * (n * textOpacity * vOpacity);\n}";
|
|
9865
9867
|
const na = new Uint16Array(1), ia = new Int8Array(1);
|
|
9866
9868
|
function ra(t, e, n) {
|
|
9867
9869
|
xs(t, e, n), function(t) {
|
|
@@ -10205,6 +10207,9 @@
|
|
|
10205
10207
|
this.Ui = {}, this.isLabelCollides = $o.bind(this), this.ds = ha.bind(this), this.ps = ca.bind(this),
|
|
10206
10208
|
this.ys = ua.bind(this), this.ms = fa.bind(this), this.gs = [];
|
|
10207
10209
|
}
|
|
10210
|
+
setTextShaderDefines(t) {
|
|
10211
|
+
this.vs = t;
|
|
10212
|
+
}
|
|
10208
10213
|
createFnTypeConfig(t, e) {
|
|
10209
10214
|
return {
|
|
10210
10215
|
icon: sa.call(this, t, e),
|
|
@@ -10222,8 +10227,8 @@
|
|
|
10222
10227
|
}
|
|
10223
10228
|
postCreateGeometry(t, e) {
|
|
10224
10229
|
const {geometry: n, symbolIndex: i} = t, r = this.getSymbolDef(i), s = this.getFnTypeConfig(i);
|
|
10225
|
-
if (this.
|
|
10226
|
-
ra(n, r, s.icon); else if (this.
|
|
10230
|
+
if (this.xs(n)) n.properties.iconAtlas ? this.drawDebugAtlas(n.properties.iconAtlas) : n.properties.isEmpty = !0,
|
|
10231
|
+
ra(n, r, s.icon); else if (this.bs(n) && ps(r)) {
|
|
10227
10232
|
const t = e[e.length - 1];
|
|
10228
10233
|
if (t) {
|
|
10229
10234
|
const {geometry: e, symbolIndex: s} = t;
|
|
@@ -10234,7 +10239,7 @@
|
|
|
10234
10239
|
}
|
|
10235
10240
|
}
|
|
10236
10241
|
}
|
|
10237
|
-
|
|
10242
|
+
ws(t) {
|
|
10238
10243
|
if (!this.layer.options.collision) return;
|
|
10239
10244
|
const {collideIds: e, elements: n, aCount: i} = t.properties, r = e, s = {};
|
|
10240
10245
|
if (!n) return void (t.properties.collideBoxIndex = s);
|
|
@@ -10248,7 +10253,7 @@
|
|
|
10248
10253
|
const s = this.isEnableCollision(), o = this.layer, {geometry: a, symbolIndex: l} = t;
|
|
10249
10254
|
a.properties.symbolIndex = l;
|
|
10250
10255
|
const h = this.getSymbolDef(l), c = this.getSymbol(l), u = this.getFnTypeConfig(l), f = [];
|
|
10251
|
-
if (this.
|
|
10256
|
+
if (this.xs(a)) {
|
|
10252
10257
|
const t = function(t, e, i, r, s, o, a, l, h) {
|
|
10253
10258
|
if (e.isDisposed() || 0 === e.data.aPosition.length) return null;
|
|
10254
10259
|
const c = e.properties.iconAtlas;
|
|
@@ -10291,25 +10296,25 @@
|
|
|
10291
10296
|
d;
|
|
10292
10297
|
}(this.regl, a, e, 0, c, u.icon, o.options.collision, !s, this.isEnableUniquePlacement());
|
|
10293
10298
|
t && (delete t.geometry.properties.glyphAtlas, f.push(t));
|
|
10294
|
-
} else if (this.
|
|
10299
|
+
} else if (this.bs(a)) {
|
|
10295
10300
|
const t = jo.call(this, this.regl, a, e, h, c, u.text, o.options.collision, !s, this.isEnableUniquePlacement());
|
|
10296
10301
|
t.length && (t.forEach(t => {
|
|
10297
10302
|
delete t.geometry.properties.iconAtlas;
|
|
10298
10303
|
}), f.push(...t));
|
|
10299
10304
|
}
|
|
10300
|
-
return "line" === h.markerPlacement && this.
|
|
10301
|
-
this.
|
|
10305
|
+
return "line" === h.markerPlacement && this.As(a, r), "line" !== h.markerPlacement && "line" !== h.textPlacement || f.forEach(t => t.properties.isLinePlacement = !0),
|
|
10306
|
+
this.ws(a), f;
|
|
10302
10307
|
}
|
|
10303
|
-
|
|
10308
|
+
As(t, e) {
|
|
10304
10309
|
const {collideIds: n} = t.properties, i = new Uint16Array(n.length);
|
|
10305
|
-
if (this.
|
|
10310
|
+
if (this.xs(t)) {
|
|
10306
10311
|
let r = 0;
|
|
10307
10312
|
for (let t = 0; t < n.length; t += 4) i.fill(r++, t, t + 4);
|
|
10308
10313
|
t.properties.collideIds = i, t.properties.uniqueCollideIds = ms(i), e.markerCollideMap = {
|
|
10309
10314
|
old: n,
|
|
10310
10315
|
new: i
|
|
10311
10316
|
};
|
|
10312
|
-
} else if (this.
|
|
10317
|
+
} else if (this.bs(t)) {
|
|
10313
10318
|
const {collideIds: n, aCount: i} = t.properties;
|
|
10314
10319
|
if (!i) return;
|
|
10315
10320
|
if (e.markerCollideMap) {
|
|
@@ -10359,31 +10364,31 @@
|
|
|
10359
10364
|
if (!this.Br()) return;
|
|
10360
10365
|
super.updateCollision(t);
|
|
10361
10366
|
const e = this.scene.getMeshes();
|
|
10362
|
-
e && e.length ? (this.
|
|
10367
|
+
e && e.length ? (this._s(t.timestamp), this.gs = [], this.wr()) : this.wr();
|
|
10363
10368
|
}
|
|
10364
10369
|
callCurrentTileShader(t, e) {
|
|
10365
10370
|
this.shader.filter = e.sceneFilter ? [ this.ds, e.sceneFilter ] : this.ds, this.renderer.render(this.shader, t, this.scene, this.getRenderFBO(e)),
|
|
10366
|
-
this.
|
|
10371
|
+
this.Ms.filter = e.sceneFilter ? [ this.ys, e.sceneFilter ] : this.ys, this.renderer.render(this.Ms, t, this.scene, this.getRenderFBO(e));
|
|
10367
10372
|
}
|
|
10368
10373
|
callBackgroundTileShader(t, e) {
|
|
10369
10374
|
this.shader.filter = e.sceneFilter ? [ this.ps, e.sceneFilter ] : this.ps, this.renderer.render(this.shader, t, this.scene, this.getRenderFBO(e)),
|
|
10370
|
-
this.
|
|
10375
|
+
this.Ms.filter = e.sceneFilter ? [ this.ms, e.sceneFilter ] : this.ms, this.renderer.render(this.Ms, t, this.scene, this.getRenderFBO(e));
|
|
10371
10376
|
}
|
|
10372
10377
|
isMeshIterable(t) {
|
|
10373
10378
|
return t && t.geometry && !t.geometry.properties.isEmpty && t.material && !t.material.get("isHalo") && this.isMeshVisible(t) && !(this.shouldIgnoreBackground() && !this.layer.getRenderer().isForeground(t));
|
|
10374
10379
|
}
|
|
10375
|
-
|
|
10380
|
+
_s() {
|
|
10376
10381
|
if (!this.Br()) return;
|
|
10377
10382
|
let t = this.gs;
|
|
10378
|
-
t && t.length && this.
|
|
10383
|
+
t && t.length && this.Ss(t);
|
|
10379
10384
|
}
|
|
10380
|
-
|
|
10385
|
+
ks(t, e, n, i) {
|
|
10381
10386
|
return this.updateBoxCollisionFading(!0, t, e, n, i);
|
|
10382
10387
|
}
|
|
10383
10388
|
isEnableUniquePlacement() {
|
|
10384
10389
|
return this.isEnableCollision() && !0 === this.sceneConfig.uniquePlacement;
|
|
10385
10390
|
}
|
|
10386
|
-
|
|
10391
|
+
Ss(t) {
|
|
10387
10392
|
const e = this.layer.getRenderer();
|
|
10388
10393
|
t = t.sort(ma);
|
|
10389
10394
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -10398,12 +10403,12 @@
|
|
|
10398
10403
|
const s = e.isForeground(i.meshes[0]);
|
|
10399
10404
|
if (this.shouldIgnoreBackground() && !s) continue;
|
|
10400
10405
|
const o = i.properties.meshKey;
|
|
10401
|
-
this.startMeshCollision(i), this.
|
|
10406
|
+
this.startMeshCollision(i), this.Ps(i), this.forEachBox(i, this.ks), this.Ts(i),
|
|
10402
10407
|
this.endMeshCollision(o);
|
|
10403
|
-
for (let t = 0; t < i.meshes.length; t++) this.
|
|
10408
|
+
for (let t = 0; t < i.meshes.length; t++) this.Os(i.meshes[t]);
|
|
10404
10409
|
}
|
|
10405
10410
|
}
|
|
10406
|
-
|
|
10411
|
+
Os(t) {
|
|
10407
10412
|
const e = t && t.geometry && t.geometry.properties.aOpacity;
|
|
10408
10413
|
e && e.dirty && (t.geometry.updateData("aOpacity", e), e.dirty = !1);
|
|
10409
10414
|
}
|
|
@@ -10413,9 +10418,9 @@
|
|
|
10413
10418
|
const i = {
|
|
10414
10419
|
boxIndex: 0
|
|
10415
10420
|
}, r = n.length;
|
|
10416
|
-
for (let s = 0; s < r; s++) this.
|
|
10421
|
+
for (let s = 0; s < r; s++) this.Fs(t, n[s], e, i);
|
|
10417
10422
|
}
|
|
10418
|
-
|
|
10423
|
+
Fs(t, e, i, r) {
|
|
10419
10424
|
const s = this.getMap(), {collideBoxIndex: o} = t.meshes[0].geometry.properties;
|
|
10420
10425
|
if (!(o && o[e])) return !1;
|
|
10421
10426
|
const a = n.mat4.multiply(da, s.projViewMatrix, t.meshes[0].localTransform);
|
|
@@ -10444,16 +10449,16 @@
|
|
|
10444
10449
|
f++;
|
|
10445
10450
|
}
|
|
10446
10451
|
if (!h) return !1;
|
|
10447
|
-
return i.call(this, t, l, a, r.boxIndex++) && this.
|
|
10452
|
+
return i.call(this, t, l, a, r.boxIndex++) && this.Is(t, e), !0;
|
|
10448
10453
|
}
|
|
10449
|
-
|
|
10454
|
+
Ps(t) {
|
|
10450
10455
|
const e = t.meshes;
|
|
10451
10456
|
for (let t = 0; t < e.length; t++) {
|
|
10452
10457
|
const n = e[t], i = n && n.geometry;
|
|
10453
10458
|
i && (i.properties.visElemts.count = 0);
|
|
10454
10459
|
}
|
|
10455
10460
|
}
|
|
10456
|
-
|
|
10461
|
+
Is(t, e) {
|
|
10457
10462
|
const n = t.meshes;
|
|
10458
10463
|
for (let t = 0; t < n.length; t++) {
|
|
10459
10464
|
const i = n[t];
|
|
@@ -10468,7 +10473,7 @@
|
|
|
10468
10473
|
a.count = u;
|
|
10469
10474
|
}
|
|
10470
10475
|
}
|
|
10471
|
-
|
|
10476
|
+
Ts(t) {
|
|
10472
10477
|
const e = t.meshes;
|
|
10473
10478
|
for (let t = 0; t < e.length; t++) {
|
|
10474
10479
|
const n = e[t], i = n && n.geometry;
|
|
@@ -10478,7 +10483,7 @@
|
|
|
10478
10483
|
}
|
|
10479
10484
|
}
|
|
10480
10485
|
isBoxCollides(t, e, n, i, r, s) {
|
|
10481
|
-
if (this.
|
|
10486
|
+
if (this.bs(t.geometry)) return $o.call(this, 0, t, e, n, i, r, s);
|
|
10482
10487
|
if (t.geometry.properties.isEmpty) return pa;
|
|
10483
10488
|
const o = this.getMap(), {boxes: a, collision: l} = this.as(t, i);
|
|
10484
10489
|
let h = 0, c = 0, u = 0;
|
|
@@ -10514,13 +10519,13 @@
|
|
|
10514
10519
|
this.shader = new n.reshader.MeshShader({
|
|
10515
10520
|
vert: ao,
|
|
10516
10521
|
frag: "#define SHADER_NAME MARKER\nprecision mediump float;\nuniform sampler2D texture;\nuniform lowp float markerOpacity;\nuniform lowp float blendSrcIsOne;\nvarying vec2 vTexCoord;\nvarying float vOpacity;\nvoid main() {\n gl_FragColor = texture2D(texture, vTexCoord) * markerOpacity * vOpacity;\n if(blendSrcIsOne == 1.) {\n gl_FragColor *= gl_FragColor.a;\n }\n}",
|
|
10517
|
-
uniforms: [
|
|
10522
|
+
uniforms: [ {
|
|
10518
10523
|
name: "projViewModelMatrix",
|
|
10519
10524
|
type: "function",
|
|
10520
10525
|
fn: function(t, e) {
|
|
10521
10526
|
return n.mat4.multiply([], e.projViewMatrix, e.modelMatrix);
|
|
10522
10527
|
}
|
|
10523
|
-
},
|
|
10528
|
+
}, {
|
|
10524
10529
|
name: "zoomScale",
|
|
10525
10530
|
type: "function",
|
|
10526
10531
|
fn: function(t, e) {
|
|
@@ -10546,22 +10551,23 @@
|
|
|
10546
10551
|
}
|
|
10547
10552
|
}
|
|
10548
10553
|
});
|
|
10549
|
-
const {uniforms: r, extraCommandProps: s} = Wo.call(this, this.layer, this.sceneConfig);
|
|
10550
|
-
if (this.
|
|
10554
|
+
const {uniforms: r, extraCommandProps: s} = Wo.call(this, this.layer, this.sceneConfig), o = this.vs || {};
|
|
10555
|
+
if (this.Ms = new n.reshader.MeshShader({
|
|
10551
10556
|
vert: ta,
|
|
10552
10557
|
frag: ea,
|
|
10553
10558
|
uniforms: r,
|
|
10554
|
-
extraCommandProps: s
|
|
10559
|
+
extraCommandProps: s,
|
|
10560
|
+
defines: o
|
|
10555
10561
|
}), this.pickingFBO) {
|
|
10556
10562
|
const t = new n.reshader.FBORayPicking(this.renderer, {
|
|
10557
10563
|
vert: "#define PICKING_MODE 1\n" + ao,
|
|
10558
|
-
uniforms: [
|
|
10564
|
+
uniforms: [ {
|
|
10559
10565
|
name: "projViewModelMatrix",
|
|
10560
10566
|
type: "function",
|
|
10561
10567
|
fn: function(t, e) {
|
|
10562
10568
|
return n.mat4.multiply([], e.projViewMatrix, e.modelMatrix);
|
|
10563
10569
|
}
|
|
10564
|
-
},
|
|
10570
|
+
}, {
|
|
10565
10571
|
name: "zoomScale",
|
|
10566
10572
|
type: "function",
|
|
10567
10573
|
fn: function(t, e) {
|
|
@@ -10600,15 +10606,15 @@
|
|
|
10600
10606
|
};
|
|
10601
10607
|
}
|
|
10602
10608
|
getUniqueEntryKey(t, e) {
|
|
10603
|
-
if (!this.
|
|
10609
|
+
if (!this.bs(t.geometry)) return null;
|
|
10604
10610
|
const {elements: n} = t.geometry.properties;
|
|
10605
10611
|
return Zo(t, n[e]);
|
|
10606
10612
|
}
|
|
10607
|
-
|
|
10613
|
+
xs(t) {
|
|
10608
10614
|
const {symbolIndex: e} = t.properties;
|
|
10609
10615
|
return 0 === e.type;
|
|
10610
10616
|
}
|
|
10611
|
-
|
|
10617
|
+
bs(t) {
|
|
10612
10618
|
const {symbolIndex: e} = t.properties;
|
|
10613
10619
|
return 1 === e.type;
|
|
10614
10620
|
}
|
|
@@ -10661,14 +10667,14 @@
|
|
|
10661
10667
|
}, Ta = function(t) {
|
|
10662
10668
|
const e = this.layer.getRenderer(), n = this.getSymbol(t.properties.symbolIndex);
|
|
10663
10669
|
return !this.cs(t) && !e.isForeground(t) && "line" === n.textPlacement;
|
|
10664
|
-
}, Oa = [], Fa = [], Ia = [], Ca = [], Ea = [], Ha = [], Da = [],
|
|
10670
|
+
}, Oa = [], Fa = [], Ia = [], Ca = [], Ea = [], Ha = [], Da = [], La = [], Ra = [], Na = [ 1, -1 ], za = new Int16Array(2), Va = [], ja = [];
|
|
10665
10671
|
class Ua extends ro {
|
|
10666
10672
|
constructor(t, e, n, i, r) {
|
|
10667
10673
|
super(t, e, n, i, r), this.propAllowOverlap = "textAllowOverlap", this.propIgnorePlacement = "textIgnorePlacement",
|
|
10668
|
-
this.colorCache = {}, this.
|
|
10669
|
-
this.
|
|
10674
|
+
this.colorCache = {}, this.Cs = Sa.bind(this), this.Es = ka.bind(this), this.Hs = Pa.bind(this),
|
|
10675
|
+
this.Ds = Ta.bind(this), this.isLabelCollides = $o.bind(this), this.Ls();
|
|
10670
10676
|
}
|
|
10671
|
-
|
|
10677
|
+
Ls() {
|
|
10672
10678
|
this.Rs = [];
|
|
10673
10679
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
10674
10680
|
const e = this.symbolDef[t];
|
|
@@ -10677,7 +10683,7 @@
|
|
|
10677
10683
|
}
|
|
10678
10684
|
updateSymbol(...t) {
|
|
10679
10685
|
const e = super.updateSymbol(...t);
|
|
10680
|
-
return this.
|
|
10686
|
+
return this.Ls(), e;
|
|
10681
10687
|
}
|
|
10682
10688
|
shouldDeleteMeshOnUpdateSymbol(t) {
|
|
10683
10689
|
if (!Array.isArray(t)) return (0 === t.textHaloRadius || 0 === this.symbolDef[0].textHaloRadius) && t.textHaloRadius !== this.symbolDef[0].textHaloRadius;
|
|
@@ -10705,24 +10711,24 @@
|
|
|
10705
10711
|
r.properties.symbolIndex = s;
|
|
10706
10712
|
const o = this.getSymbol(s), a = this.getSymbolDef(s), l = this.getFnTypeConfig(s), h = jo.call(this, this.regl, r, e, a, o, l, this.layer.options.collision, !n, i);
|
|
10707
10713
|
if (h.length) {
|
|
10708
|
-
"line" === o.textPlacement ? this.
|
|
10714
|
+
"line" === o.textPlacement ? this.Ns = !0 : this.zs = !0;
|
|
10709
10715
|
}
|
|
10710
10716
|
return h;
|
|
10711
10717
|
}
|
|
10712
10718
|
updateCollision(t) {
|
|
10713
10719
|
super.updateCollision(t);
|
|
10714
10720
|
const e = this.scene.getMeshes();
|
|
10715
|
-
e && e.length ? (this.
|
|
10721
|
+
e && e.length ? (this.Vs = {}, this.js(t.timestamp), this.wr()) : this.wr();
|
|
10716
10722
|
}
|
|
10717
10723
|
callCurrentTileShader(t, e) {
|
|
10718
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
10719
|
-
this.
|
|
10724
|
+
this.shader.filter = e.sceneFilter ? [ this.Cs, e.sceneFilter ] : this.Cs, this.renderer.render(this.shader, t, this.scene, this.getRenderFBO(e)),
|
|
10725
|
+
this.Us.filter = e.sceneFilter ? [ this.Hs, e.sceneFilter ] : this.Hs, this.renderer.render(this.Us, t, this.scene, this.getRenderFBO(e));
|
|
10720
10726
|
}
|
|
10721
10727
|
callBackgroundTileShader(t, e) {
|
|
10722
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
10723
|
-
this.
|
|
10728
|
+
this.shader.filter = e.sceneFilter ? [ this.Es, e.sceneFilter ] : this.Es, this.renderer.render(this.shader, t, this.scene, this.getRenderFBO(e)),
|
|
10729
|
+
this.Us.filter = e.sceneFilter ? [ this.Ds, e.sceneFilter ] : this.Ds, this.renderer.render(this.Us, t, this.scene, this.getRenderFBO(e));
|
|
10724
10730
|
}
|
|
10725
|
-
|
|
10731
|
+
js() {
|
|
10726
10732
|
let t = this.scene.getMeshes();
|
|
10727
10733
|
if (!t || !t.length) return;
|
|
10728
10734
|
const e = -this.getMap().getBearing() * Math.PI / 180, i = n.mat2.fromRotation(Ia, e), r = (t, e, n, i) => {
|
|
@@ -10744,7 +10750,7 @@
|
|
|
10744
10750
|
const c = n.properties.meshKey;
|
|
10745
10751
|
if ("line" === h.textPlacement) {
|
|
10746
10752
|
if (!l.properties.line) continue;
|
|
10747
|
-
s && this.startMeshCollision(n), this.
|
|
10753
|
+
s && this.startMeshCollision(n), this.Gs(n, i);
|
|
10748
10754
|
const {aOffset: t, aOpacity: e} = l.properties;
|
|
10749
10755
|
t.dirty && (l.updateData("aOffset", t), t.dirty = !1), e && e.dirty && (l.updateData("aOpacity", e),
|
|
10750
10756
|
e.dirty = !1), s && this.endMeshCollision(c);
|
|
@@ -10769,7 +10775,7 @@
|
|
|
10769
10775
|
getUniqueEntryKey(t, e) {
|
|
10770
10776
|
return Zo(t, e);
|
|
10771
10777
|
}
|
|
10772
|
-
|
|
10778
|
+
Gs(t, e) {
|
|
10773
10779
|
const i = this.getMap(), r = t.geometry, s = r.properties, o = this.layer.getRenderer().isForeground(t);
|
|
10774
10780
|
if (this.shouldIgnoreBackground() && !o) return;
|
|
10775
10781
|
let a = s.line;
|
|
@@ -10777,12 +10783,12 @@
|
|
|
10777
10783
|
const l = 1 === t.material.uniforms.pitchWithMap, h = s.elements;
|
|
10778
10784
|
if (!l) {
|
|
10779
10785
|
const e = n.mat4.multiply(Oa, i.projViewMatrix, t.localTransform), r = new Array(a.length);
|
|
10780
|
-
a = this.
|
|
10786
|
+
a = this.Ws(r, a, e, i.width, i.height);
|
|
10781
10787
|
}
|
|
10782
10788
|
const c = this.Br(), u = r.properties.visElemts = r.properties.visElemts || new h.constructor(h.length);
|
|
10783
10789
|
c && (u.count = 0), this.forEachBox(t, (t, n, i, r) => {
|
|
10784
10790
|
const {start: s, end: o} = n[0];
|
|
10785
|
-
let f = this.
|
|
10791
|
+
let f = this.Bs(t, h, s, o, a, i, l ? e : null, r);
|
|
10786
10792
|
if (c && (f = this.updateBoxCollisionFading(f, t, n, i, r), f)) {
|
|
10787
10793
|
let t = u.count;
|
|
10788
10794
|
for (let e = s; e < o; e++) u[t++] = h[e];
|
|
@@ -10790,16 +10796,16 @@
|
|
|
10790
10796
|
}
|
|
10791
10797
|
}), !c || u.count === h.length && r.count === u.count || r.setElements(u, u.count);
|
|
10792
10798
|
}
|
|
10793
|
-
|
|
10799
|
+
Ws(t, e, i, r, s) {
|
|
10794
10800
|
const o = e.id + "-" + i.join();
|
|
10795
|
-
if (this.
|
|
10801
|
+
if (this.Vs[o]) return this.Vs[o];
|
|
10796
10802
|
const a = function(t, e, i, r, s) {
|
|
10797
10803
|
const o = [];
|
|
10798
10804
|
for (let a = 0; a < e.length; a += 3) n.vec4.set(o, e[a], e[a + 1], e[a + 2], 1),
|
|
10799
10805
|
ho(o, o, i, r, s), t[a] = o[0], t[a + 1] = o[1], t[a + 2] = e[a + 2];
|
|
10800
10806
|
return t;
|
|
10801
10807
|
}(t, e, i, r, s);
|
|
10802
|
-
return this.
|
|
10808
|
+
return this.Vs[o] = a, a;
|
|
10803
10809
|
}
|
|
10804
10810
|
forEachBox(t, e) {
|
|
10805
10811
|
const i = this.getMap(), r = n.mat4.multiply(Oa, i.projViewMatrix, t.localTransform), {collideIds: s, aCount: o, features: a, elements: l} = t.geometry.properties, h = s, c = this.isEnableUniquePlacement(), u = this.ls(1);
|
|
@@ -10819,7 +10825,7 @@
|
|
|
10819
10825
|
y = h[d], p = n;
|
|
10820
10826
|
}
|
|
10821
10827
|
}
|
|
10822
|
-
|
|
10828
|
+
Bs(t, e, i, r, s, o, a) {
|
|
10823
10829
|
const l = this.Br(), h = this.getMap(), c = t.geometry, u = c.desc.positionSize, {aShape: f, aOffset: d, aAnchor: p} = c.properties, y = c.properties.aTextSize, m = !a, g = e[i] * u;
|
|
10824
10830
|
let v = n.vec3.set(Ca, p[g], p[g + 1], 2 === u ? 0 : p[g + 2]);
|
|
10825
10831
|
const x = ho(Ea, v, o, h.width, h.height);
|
|
@@ -10828,7 +10834,7 @@
|
|
|
10828
10834
|
m && (v = x);
|
|
10829
10835
|
const b = m ? 1 : c.properties.tileExtent / this.layer.options.tileSize[0];
|
|
10830
10836
|
let w = !0;
|
|
10831
|
-
const A = e[i], _ = e[r - 1], M = y ? y[A] : t.properties.textSize, S = this.
|
|
10837
|
+
const A = e[i], _ = e[r - 1], M = y ? y[A] : t.properties.textSize, S = this.Xs(t, M, s, A, _, v, b, a);
|
|
10832
10838
|
if (null === S) return Ba(d, e, i, r), !1;
|
|
10833
10839
|
const k = _ - A <= 3, P = t.material.uniforms, T = 1 === P.pitchWithMap, O = Math.floor(S / 2), F = S % 2;
|
|
10834
10840
|
for (let o = i; o < r; o += 6) {
|
|
@@ -10842,15 +10848,15 @@
|
|
|
10842
10848
|
let c = h[2];
|
|
10843
10849
|
F && (c -= Math.PI / 2);
|
|
10844
10850
|
const u = xo(Da, c, 0, P.rotateWithMap, P.pitchWithMap);
|
|
10845
|
-
for (let t = 0; t < 4; t++) n.vec2.set(
|
|
10846
|
-
n.vec2.scale(
|
|
10847
|
-
n.vec2.add(
|
|
10848
|
-
za[1] = 10 *
|
|
10851
|
+
for (let t = 0; t < 4; t++) n.vec2.set(La, f[2 * (a + t)] / 10, f[2 * (a + t) + 1] / 10),
|
|
10852
|
+
n.vec2.scale(La, La, M / 24), n.vec2.transformMat2(La, La, u), T ? (n.vec2.multiply(La, La, Na),
|
|
10853
|
+
n.vec2.add(Ra, La, h)) : (n.vec2.multiply(Ra, h, Na), n.vec2.add(Ra, La, Ra)), za[0] = 10 * Ra[0],
|
|
10854
|
+
za[1] = 10 * Ra[1], d[2 * (a + t)] === za[0] && d[2 * (a + t) + 1] === za[1] || (d.dirty = !0,
|
|
10849
10855
|
d[2 * (a + t)] = za[0], d[2 * (a + t) + 1] = za[1]);
|
|
10850
10856
|
}
|
|
10851
10857
|
return w;
|
|
10852
10858
|
}
|
|
10853
|
-
|
|
10859
|
+
Xs(t, e, n, i, r, s, o, a) {
|
|
10854
10860
|
const l = r - i <= 3, h = this.getMap();
|
|
10855
10861
|
return l ? 0 : _a.call(this, Va, ja, t, e, n, i, r, s, o, h.width / h.height, a);
|
|
10856
10862
|
}
|
|
@@ -10863,7 +10869,7 @@
|
|
|
10863
10869
|
}) : t.material && delete t.material.uniforms.texture), super.deleteMesh(t, e));
|
|
10864
10870
|
}
|
|
10865
10871
|
delete() {
|
|
10866
|
-
super.delete(), this.
|
|
10872
|
+
super.delete(), this.Us.dispose(), delete this.Vs, this.qs && this.qs.dispose();
|
|
10867
10873
|
}
|
|
10868
10874
|
needClearStencil() {
|
|
10869
10875
|
return !0;
|
|
@@ -10880,7 +10886,7 @@
|
|
|
10880
10886
|
});
|
|
10881
10887
|
let r = i;
|
|
10882
10888
|
if (this.layer.getRenderer().isEnableWorkAround("win-intel-gpu-crash") && (r = ns({}, i),
|
|
10883
|
-
r.stencil = ns({}, i.stencil), r.stencil.enable = !0), this.
|
|
10889
|
+
r.stencil = ns({}, i.stencil), r.stencil.enable = !0), this.Us = new n.reshader.MeshShader({
|
|
10884
10890
|
vert: Ma,
|
|
10885
10891
|
frag: ea,
|
|
10886
10892
|
uniforms: e,
|
|
@@ -11136,7 +11142,7 @@
|
|
|
11136
11142
|
}
|
|
11137
11143
|
}
|
|
11138
11144
|
const Ka = [ 1, 1, 1 ], Qa = [ 1, 1, 1, 1 ], tl = [ 0, 0 ];
|
|
11139
|
-
class el extends
|
|
11145
|
+
class el extends Rs {
|
|
11140
11146
|
supportRenderMode(t) {
|
|
11141
11147
|
return this.isAnimating() ? "fxaa" === t || "fxaaAfterTaa" === t : "taa" === t || "fxaa" === t;
|
|
11142
11148
|
}
|
|
@@ -11199,7 +11205,7 @@
|
|
|
11199
11205
|
enumerable: !0,
|
|
11200
11206
|
get: () => {
|
|
11201
11207
|
const t = this.getSymbol(o);
|
|
11202
|
-
return s.properties.hasAlpha || t.polygonOpacity < 1;
|
|
11208
|
+
return s.properties.hasAlpha || t.polygonOpacity < 1 || t.lineOpacity < 1;
|
|
11203
11209
|
}
|
|
11204
11210
|
}), a.properties.symbolIndex = o, a;
|
|
11205
11211
|
}
|
|
@@ -11213,10 +11219,10 @@
|
|
|
11213
11219
|
r;
|
|
11214
11220
|
}
|
|
11215
11221
|
needPolygonOffset() {
|
|
11216
|
-
return this.
|
|
11222
|
+
return this.Js;
|
|
11217
11223
|
}
|
|
11218
11224
|
startFrame(...t) {
|
|
11219
|
-
return delete this.
|
|
11225
|
+
return delete this.Js, super.startFrame(...t);
|
|
11220
11226
|
}
|
|
11221
11227
|
addMesh(t, e) {
|
|
11222
11228
|
t.forEach(t => {
|
|
@@ -11229,7 +11235,7 @@
|
|
|
11229
11235
|
0 === e && (e = .01), Ka[2] = e, n.mat4.fromScaling(i, Ka), n.mat4.multiply(i, t.properties.tileTransform, i),
|
|
11230
11236
|
t.setLocalTransform(i);
|
|
11231
11237
|
} else t.setLocalTransform(t.properties.tileTransform);
|
|
11232
|
-
t.material !== this.material && t.setMaterial(this.material), t.geometry.properties.maxAltitude <= 0 && (this.
|
|
11238
|
+
t.material !== this.material && t.setMaterial(this.material), t.geometry.properties.maxAltitude <= 0 && (this.Js = !0),
|
|
11233
11239
|
this.getSymbol(t.properties.symbolIndex).ssr ? t.ssr = 1 : t.ssr = 0;
|
|
11234
11240
|
}
|
|
11235
11241
|
deleteMesh(t, e) {
|
|
@@ -11281,7 +11287,7 @@
|
|
|
11281
11287
|
}
|
|
11282
11288
|
updateSymbol(t, e) {
|
|
11283
11289
|
const n = super.updateSymbol(t, e);
|
|
11284
|
-
return t.material && this.
|
|
11290
|
+
return t.material && this.Ys(t.material), n;
|
|
11285
11291
|
}
|
|
11286
11292
|
Gi(t, e) {
|
|
11287
11293
|
return nl(t) !== nl(e);
|
|
@@ -11321,14 +11327,14 @@
|
|
|
11321
11327
|
return this.shader;
|
|
11322
11328
|
}
|
|
11323
11329
|
delete(t) {
|
|
11324
|
-
this.getMap().off("updatelights", this
|
|
11330
|
+
this.getMap().off("updatelights", this.$s, this), super.delete(t), this.material.dispose();
|
|
11325
11331
|
}
|
|
11326
11332
|
init() {
|
|
11327
|
-
this.getMap().on("updatelights", this
|
|
11333
|
+
this.getMap().on("updatelights", this.$s, this);
|
|
11328
11334
|
const t = this.regl;
|
|
11329
11335
|
this.renderer = new n.reshader.Renderer(t);
|
|
11330
11336
|
const e = this.getShaderConfig();
|
|
11331
|
-
this.shader = new n.reshader.PhongShader(e), this.
|
|
11337
|
+
this.shader = new n.reshader.PhongShader(e), this.Ys();
|
|
11332
11338
|
const i = {
|
|
11333
11339
|
vert: this.getPickingVert(),
|
|
11334
11340
|
uniforms: [ "projViewMatrix", "modelMatrix", "positionMatrix", {
|
|
@@ -11344,7 +11350,7 @@
|
|
|
11344
11350
|
};
|
|
11345
11351
|
this.picking = [ new n.reshader.FBORayPicking(this.renderer, i, this.layer.getRenderer().pickingFBO) ];
|
|
11346
11352
|
}
|
|
11347
|
-
|
|
11353
|
+
$s() {
|
|
11348
11354
|
this.setToRedraw();
|
|
11349
11355
|
}
|
|
11350
11356
|
getShaderConfig() {
|
|
@@ -11393,14 +11399,14 @@
|
|
|
11393
11399
|
}
|
|
11394
11400
|
};
|
|
11395
11401
|
}
|
|
11396
|
-
|
|
11402
|
+
Ys() {
|
|
11397
11403
|
this.material && this.material.dispose();
|
|
11398
11404
|
const t = this.getSymbols()[0].material, e = {};
|
|
11399
11405
|
for (const n in t) ys(t, n) && (e[n] = t[n]);
|
|
11400
11406
|
this.material = new n.reshader.PhongMaterial(e);
|
|
11401
11407
|
}
|
|
11402
11408
|
getUniformValues(t, e) {
|
|
11403
|
-
const n = t.viewMatrix, i = t.projMatrix, r = t.cameraPosition, s = this
|
|
11409
|
+
const n = t.viewMatrix, i = t.projMatrix, r = t.cameraPosition, s = this.Zs(), o = ns({
|
|
11404
11410
|
viewMatrix: n,
|
|
11405
11411
|
projMatrix: i,
|
|
11406
11412
|
cameraPosition: r,
|
|
@@ -11413,7 +11419,7 @@
|
|
|
11413
11419
|
getPickingVert() {
|
|
11414
11420
|
return "\n attribute vec3 aPosition;\n uniform mat4 projViewModelMatrix;\n uniform mat4 modelMatrix;\n uniform mat4 positionMatrix;\n //引入fbo picking的vert相关函数\n #include <fbo_picking_vert>\n #include <get_output>\n void main()\n {\n mat4 localPositionMatrix = getPositionMatrix();\n vec4 localPosition = getPosition(aPosition);\n\n gl_Position = projViewModelMatrix * localPositionMatrix * localPosition;\n //传入gl_Position的depth值\n fbo_picking_setData(gl_Position.w, true);\n }\n ";
|
|
11415
11421
|
}
|
|
11416
|
-
|
|
11422
|
+
Zs() {
|
|
11417
11423
|
const t = this.getMap().getLightManager(), e = t && t.getAmbientLight() || {}, n = t && t.getDirectionalLight() || {};
|
|
11418
11424
|
return {
|
|
11419
11425
|
ambientColor: e.color || [ .2, .2, .2 ],
|
|
@@ -11424,7 +11430,7 @@
|
|
|
11424
11430
|
}
|
|
11425
11431
|
}
|
|
11426
11432
|
const rl = [ 1, 1, 1 ];
|
|
11427
|
-
class sl extends
|
|
11433
|
+
class sl extends Rs {
|
|
11428
11434
|
constructor(t, e, n, i, r) {
|
|
11429
11435
|
if (super(t, e, n, i, r), _(this.symbolDef[0].lineColor)) {
|
|
11430
11436
|
const t = e.getMap(), n = S(this.symbolDef.lineColor);
|
|
@@ -11481,7 +11487,7 @@
|
|
|
11481
11487
|
const i = [];
|
|
11482
11488
|
return n.mat4.multiply(i, e.projViewMatrix, e.modelMatrix), i;
|
|
11483
11489
|
}
|
|
11484
|
-
}
|
|
11490
|
+
} ],
|
|
11485
11491
|
extraCommandProps: {
|
|
11486
11492
|
stencil: {
|
|
11487
11493
|
enable: !0,
|
|
@@ -11517,20 +11523,20 @@
|
|
|
11517
11523
|
const {getPBRUniforms: ol} = n.reshader.pbr.PBRUtils, al = [];
|
|
11518
11524
|
class ll extends el {
|
|
11519
11525
|
constructor(...t) {
|
|
11520
|
-
super(...t), this.
|
|
11526
|
+
super(...t), this.Ks = new n.reshader.ResourceLoader, this.scene.sortFunction = this.sortByCommandKey;
|
|
11521
11527
|
}
|
|
11522
11528
|
supportRenderMode(t) {
|
|
11523
11529
|
return this.getSymbols()[0].ssr ? "fxaa" === t || "fxaaAfterTaa" === t : super.supportRenderMode(t);
|
|
11524
11530
|
}
|
|
11525
11531
|
isAnimating() {
|
|
11526
|
-
const t = this.
|
|
11532
|
+
const t = this.Qs();
|
|
11527
11533
|
if (t && (t[0] || t[1])) return !0;
|
|
11528
11534
|
}
|
|
11529
11535
|
needToRedraw() {
|
|
11530
|
-
const t = this.
|
|
11536
|
+
const t = this.Qs();
|
|
11531
11537
|
return !(!t || !t[0] && !t[1]) || super.needToRedraw();
|
|
11532
11538
|
}
|
|
11533
|
-
|
|
11539
|
+
Qs() {
|
|
11534
11540
|
const t = this.getSymbols()[0];
|
|
11535
11541
|
return t.material && t.material.uvOffsetAnim;
|
|
11536
11542
|
}
|
|
@@ -11556,18 +11562,18 @@
|
|
|
11556
11562
|
const e = ns({}, r, t.ssr.defines);
|
|
11557
11563
|
i.shaderDefines = e;
|
|
11558
11564
|
}
|
|
11559
|
-
if (t.onlyUpdateDepthInTaa && (this.shader = this.
|
|
11565
|
+
if (t.onlyUpdateDepthInTaa && (this.shader = this.eo, !n && this.no && (this.shader = i,
|
|
11560
11566
|
this.setToRedraw(!0))), this.updateIBLDefines(i), super.paint(t), void 0 !== this.shadowCount && e) {
|
|
11561
11567
|
const t = this.scene.getMeshes().length;
|
|
11562
11568
|
this.shadowCount !== t && this.setToRedraw();
|
|
11563
11569
|
}
|
|
11564
11570
|
this.shader = i, n && (i.shaderDefines = r), delete this.shadowCount;
|
|
11565
|
-
const s = this.
|
|
11571
|
+
const s = this.Qs();
|
|
11566
11572
|
if (s && (s[0] || s[1])) this.material.set("uvOffset", [ 0, 0 ]); else {
|
|
11567
11573
|
const t = this.getUVOffset(s);
|
|
11568
11574
|
this.material.set("uvOffset", t);
|
|
11569
11575
|
}
|
|
11570
|
-
this.
|
|
11576
|
+
this.no = n;
|
|
11571
11577
|
}
|
|
11572
11578
|
getShadowMeshes() {
|
|
11573
11579
|
if (!this.isVisible()) return al;
|
|
@@ -11583,15 +11589,15 @@
|
|
|
11583
11589
|
ns(this.sceneConfig, t), this.setToRedraw();
|
|
11584
11590
|
}
|
|
11585
11591
|
delete() {
|
|
11586
|
-
super.delete(), this.disposeIBLTextures(), this.material.dispose(), this.
|
|
11587
|
-
this.shader && (this.shader.dispose(), delete this.shader), this.
|
|
11588
|
-
delete this.
|
|
11592
|
+
super.delete(), this.disposeIBLTextures(), this.material.dispose(), this.io && this.io.dispose(),
|
|
11593
|
+
this.shader && (this.shader.dispose(), delete this.shader), this.eo && (this.eo.dispose(),
|
|
11594
|
+
delete this.eo);
|
|
11589
11595
|
}
|
|
11590
11596
|
init(t) {
|
|
11591
|
-
this.getMap().on("updatelights", this.
|
|
11597
|
+
this.getMap().on("updatelights", this.ro, this), this.createIBLTextures(), this.or = this.or || t;
|
|
11592
11598
|
const e = this.regl;
|
|
11593
|
-
this.renderer = new n.reshader.Renderer(e), this.
|
|
11594
|
-
this.
|
|
11599
|
+
this.renderer = new n.reshader.Renderer(e), this.so = this.oo.bind(this), this.ao = this.disposeCachedTexture.bind(this),
|
|
11600
|
+
this.lo = this.ho.bind(this), this.Ys(), this.nr(t);
|
|
11595
11601
|
const i = {
|
|
11596
11602
|
vert: "\n attribute vec3 aPosition;\n uniform mat4 projViewModelMatrix;\n uniform mat4 positionMatrix;\n //引入fbo picking的vert相关函数\n #include <line_extrusion_vert>\n #include <get_output>\n #include <fbo_picking_vert>\n void main() {\n mat4 localPositionMatrix = getPositionMatrix();\n #ifdef IS_LINE_EXTRUSION\n vec3 linePosition = getLineExtrudePosition(aPosition);\n vec4 localVertex = getPosition(linePosition);\n #else\n vec4 localVertex = getPosition(aPosition);\n #endif\n\n gl_Position = projViewModelMatrix * localPositionMatrix * localVertex;\n fbo_picking_setData(gl_Position.w, true);\n }\n ",
|
|
11597
11603
|
uniforms: [ {
|
|
@@ -11647,20 +11653,20 @@
|
|
|
11647
11653
|
polygonOffset: this.getPolygonOffset()
|
|
11648
11654
|
}, o = {
|
|
11649
11655
|
uniforms: r,
|
|
11650
|
-
defines: this.
|
|
11656
|
+
defines: this.co(i),
|
|
11651
11657
|
extraCommandProps: s
|
|
11652
11658
|
};
|
|
11653
11659
|
this.shader = new n.reshader.pbr.StandardShader(o), o.frag = "\n precision mediump float;\n #include <gl2_frag>\n void main() {\n glFragColor = vec4(0.0);\n #if __VERSION__ == 100\n gl_FragColor = glFragColor;\n #endif\n }\n ",
|
|
11654
|
-
this.
|
|
11660
|
+
this.eo = new n.reshader.pbr.StandardShader(o);
|
|
11655
11661
|
}
|
|
11656
|
-
|
|
11662
|
+
oo({resources: t}) {
|
|
11657
11663
|
for (let e = 0; e < t.length; e++) this.addCachedTexture(t[e].url, t[e].data);
|
|
11658
11664
|
this.setToRedraw(!0);
|
|
11659
11665
|
}
|
|
11660
|
-
|
|
11666
|
+
ho() {
|
|
11661
11667
|
this.setToRedraw(!0);
|
|
11662
11668
|
}
|
|
11663
|
-
|
|
11669
|
+
Ys(t) {
|
|
11664
11670
|
const e = t || this.getSymbols()[0].material, i = {};
|
|
11665
11671
|
let r = !1;
|
|
11666
11672
|
for (const t in e) if (ys(e, t)) if (t.indexOf("Texture") > 0) {
|
|
@@ -11679,15 +11685,15 @@
|
|
|
11679
11685
|
} : s.data = a : o === s && (s = {
|
|
11680
11686
|
url: o,
|
|
11681
11687
|
wrap: "repeat"
|
|
11682
|
-
}), s.flipY = !0, i[t] = new n.reshader.Texture2D(s, this.
|
|
11683
|
-
i[t].once("disposed", this.
|
|
11688
|
+
}), s.flipY = !0, i[t] = new n.reshader.Texture2D(s, this.Ks), i[t].once("complete", this.so),
|
|
11689
|
+
i[t].once("disposed", this.ao), i[t].promise && this.addCachedTexture(o, i[t].promise),
|
|
11684
11690
|
r = !0;
|
|
11685
11691
|
} else i[t] = e[t];
|
|
11686
11692
|
if (this.material) {
|
|
11687
11693
|
for (let t in i) this.material.set(t, i[t]);
|
|
11688
11694
|
this.setToRedraw(!0);
|
|
11689
|
-
} else this.material = new n.reshader.pbr.StandardMaterial(i), this.material.once("complete", this.
|
|
11690
|
-
r || this.
|
|
11695
|
+
} else this.material = new n.reshader.pbr.StandardMaterial(i), this.material.once("complete", this.lo);
|
|
11696
|
+
r || this.ho();
|
|
11691
11697
|
}
|
|
11692
11698
|
getShader() {
|
|
11693
11699
|
return this.shader;
|
|
@@ -11696,29 +11702,29 @@
|
|
|
11696
11702
|
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = ol(t, n, i, e && e.ssr, e && e.jitter);
|
|
11697
11703
|
return this.setIncludeUniformValues(r, e), r;
|
|
11698
11704
|
}
|
|
11699
|
-
|
|
11705
|
+
co(t) {
|
|
11700
11706
|
return this.hasIBL() ? t.HAS_IBL_LIGHTING = 1 : delete t.HAS_IBL_LIGHTING, t;
|
|
11701
11707
|
}
|
|
11702
|
-
|
|
11708
|
+
ro() {
|
|
11703
11709
|
if (!this.shader) return;
|
|
11704
11710
|
const t = this.shader.shaderDefines;
|
|
11705
|
-
this.
|
|
11711
|
+
this.co(t), this.shader.shaderDefines = t;
|
|
11706
11712
|
}
|
|
11707
11713
|
}
|
|
11708
11714
|
const hl = [], cl = [], ul = [ 0, 0, 0 ], fl = [ 0, 0, 0 ], dl = [ 1, 1, 1 ], pl = [], yl = [ 1, 1, 1, 1 ], ml = [], gl = t => class extends t {
|
|
11709
11715
|
constructor(t, e, n, i, r) {
|
|
11710
|
-
super(t, e, n, i, r), this.
|
|
11711
|
-
this.
|
|
11716
|
+
super(t, e, n, i, r), this.uo = !1, this.scene.sortFunction = this.sortByCommandKey,
|
|
11717
|
+
this.fo = [];
|
|
11712
11718
|
}
|
|
11713
11719
|
isAnimating() {
|
|
11714
11720
|
const t = this.getSymbols();
|
|
11715
11721
|
for (let e = 0; e < t.length; e++) {
|
|
11716
|
-
if (t[e] && this.
|
|
11722
|
+
if (t[e] && this.do[e] && this.po(e)) return !0;
|
|
11717
11723
|
}
|
|
11718
11724
|
return !1;
|
|
11719
11725
|
}
|
|
11720
11726
|
createGeometry(t, e) {
|
|
11721
|
-
if (this.
|
|
11727
|
+
if (this.yo(), !this.uo) return null;
|
|
11722
11728
|
const {data: n, positionSize: i} = t;
|
|
11723
11729
|
return {
|
|
11724
11730
|
geometry: {
|
|
@@ -11742,7 +11748,7 @@
|
|
|
11742
11748
|
instance_vectorC: new Float32Array(4 * c),
|
|
11743
11749
|
aPickingId: []
|
|
11744
11750
|
};
|
|
11745
|
-
this.
|
|
11751
|
+
this.mo(u, i, r, o.properties.z, h, a);
|
|
11746
11752
|
const f = {};
|
|
11747
11753
|
for (const t in u) f[t] = {
|
|
11748
11754
|
buffer: this.regl.buffer({
|
|
@@ -11753,14 +11759,14 @@
|
|
|
11753
11759
|
};
|
|
11754
11760
|
const d = [], p = this.getSymbols();
|
|
11755
11761
|
for (let t = 0; t < p.length; t++) {
|
|
11756
|
-
const e = p[t], r = this.
|
|
11762
|
+
const e = p[t], r = this.fo[t];
|
|
11757
11763
|
if (!r) continue;
|
|
11758
|
-
const {translation: o, rotation: a, scale: h, fixSizeOnZoom: y} = e, m = this.
|
|
11764
|
+
const {translation: o, rotation: a, scale: h, fixSizeOnZoom: y} = e, m = this.vo([], o, a, h);
|
|
11759
11765
|
let g = 0;
|
|
11760
11766
|
r.forEach(t => {
|
|
11761
11767
|
const {geometry: i, nodeMatrix: r} = t, s = n.mat4.multiply(ml, m, r), o = i.boundingBox.copy();
|
|
11762
11768
|
o.transform(s);
|
|
11763
|
-
const a = this.
|
|
11769
|
+
const a = this.xo(o, e);
|
|
11764
11770
|
a > g && (g = a);
|
|
11765
11771
|
});
|
|
11766
11772
|
const v = [ 0, 0, g ], x = r.map(r => {
|
|
@@ -11796,7 +11802,7 @@
|
|
|
11796
11802
|
positionSize: a
|
|
11797
11803
|
}, d;
|
|
11798
11804
|
}
|
|
11799
|
-
|
|
11805
|
+
xo(t, e) {
|
|
11800
11806
|
const n = e.anchorZ || "bottom";
|
|
11801
11807
|
let i = 0;
|
|
11802
11808
|
return "bottom" === n ? i = -t.min[2] : "top" === n ? i = -t.max[2] : "center" === n && (i = -(t.min[2] + t.max[2]) / 2),
|
|
@@ -11807,7 +11813,7 @@
|
|
|
11807
11813
|
if (t[0].properties.level > 2) return null;
|
|
11808
11814
|
for (let e = 0; e < t.length; e++) {
|
|
11809
11815
|
if (!t[e] || !t[e].geometry) continue;
|
|
11810
|
-
const n = this.
|
|
11816
|
+
const n = this.po(t[e].properties.symbolIndex.index);
|
|
11811
11817
|
t[e].setUniform("skinAnimation", +n);
|
|
11812
11818
|
}
|
|
11813
11819
|
return this.scene.addMesh(t), this;
|
|
@@ -11817,12 +11823,12 @@
|
|
|
11817
11823
|
let n = !1;
|
|
11818
11824
|
for (let i = 0; i < e.length; i++) {
|
|
11819
11825
|
const r = e[i];
|
|
11820
|
-
if (!r || !this.
|
|
11821
|
-
if (this.
|
|
11826
|
+
if (!r || !this.do[i]) continue;
|
|
11827
|
+
if (this.po(i) && this.do[i]) {
|
|
11822
11828
|
n || (n = !0);
|
|
11823
11829
|
let e = r.speed;
|
|
11824
11830
|
const s = !!r.loop;
|
|
11825
|
-
ss(e) && (e = 1), this.
|
|
11831
|
+
ss(e) && (e = 1), this.do[i].updateAnimation(t.timestamp, s, e);
|
|
11826
11832
|
}
|
|
11827
11833
|
}
|
|
11828
11834
|
n && this.setToRedraw(!0), super.prepareRender(t);
|
|
@@ -11832,11 +11838,11 @@
|
|
|
11832
11838
|
this.shadowCount = this.scene.getMeshes().length;
|
|
11833
11839
|
return this.scene.getMeshes().filter(t => 0 === t.getUniform("level"));
|
|
11834
11840
|
}
|
|
11835
|
-
|
|
11841
|
+
po(t) {
|
|
11836
11842
|
const e = this.getSymbols()[t];
|
|
11837
|
-
return e && e.animation && this.
|
|
11843
|
+
return e && e.animation && this.do[t] && this.do[t].hasSkinAnimation();
|
|
11838
11844
|
}
|
|
11839
|
-
|
|
11845
|
+
mo(t, e, i, r, s, o) {
|
|
11840
11846
|
function a(e, n, i, r) {
|
|
11841
11847
|
t[e][4 * n] = i[r], t[e][4 * n + 1] = i[r + 4], t[e][4 * n + 2] = i[r + 8], t[e][4 * n + 3] = i[r + 12];
|
|
11842
11848
|
}
|
|
@@ -11852,26 +11858,26 @@
|
|
|
11852
11858
|
return t.positionAttribute = "POSITION", t.normalAttribute = "NORMAL", t;
|
|
11853
11859
|
}
|
|
11854
11860
|
init(t) {
|
|
11855
|
-
super.init(t), this.
|
|
11861
|
+
super.init(t), this.yo();
|
|
11856
11862
|
}
|
|
11857
|
-
|
|
11858
|
-
if (this.
|
|
11859
|
-
this.
|
|
11863
|
+
yo() {
|
|
11864
|
+
if (this.do) return;
|
|
11865
|
+
this.do = [];
|
|
11860
11866
|
const t = this.layer.getRenderer(), e = this.getSymbols();
|
|
11861
|
-
this.
|
|
11867
|
+
this.bo = 0;
|
|
11862
11868
|
for (let i = 0; i < e.length; i++) {
|
|
11863
11869
|
const r = e[i].url;
|
|
11864
11870
|
if (t.isCachePlaced(r)) continue;
|
|
11865
11871
|
const s = t.fetchCache(r);
|
|
11866
|
-
s ? (this.
|
|
11872
|
+
s ? (this.do[i] = [ s ], this.fo[i] = s.getMeshesInfo(), this.bo++, t.addToCache(r)) : (t.placeCache(r),
|
|
11867
11873
|
n.reshader.GLTFHelper.load(r).then(s => {
|
|
11868
11874
|
const o = n.reshader.GLTFHelper.exportGLTFPack(s, this.regl);
|
|
11869
|
-
this.
|
|
11875
|
+
this.do[i] = [ o ], this.fo[i] = o.getMeshesInfo(), t.addToCache(r, o, t => {
|
|
11870
11876
|
t.dispose();
|
|
11871
|
-
}), this.
|
|
11877
|
+
}), this.bo++, this.bo >= e.length && (this.uo = !0), this.setToRedraw(!0);
|
|
11872
11878
|
}));
|
|
11873
11879
|
}
|
|
11874
|
-
this.
|
|
11880
|
+
this.bo >= e.length && (this.uo = !0);
|
|
11875
11881
|
}
|
|
11876
11882
|
getPickingVert() {
|
|
11877
11883
|
return "\n attribute vec3 aPosition;\n uniform mat4 projViewModelMatrix;\n uniform mat4 modelMatrix;\n uniform mat4 positionMatrix;\n //引入fbo picking的vert相关函数\n #include <fbo_picking_vert>\n #include <get_output>\n void main()\n {\n mat4 localPositionMatrix = getPositionMatrix();\n vec4 localPosition = getPosition(aPosition);\n\n gl_Position = projViewModelMatrix * localPositionMatrix * localPosition;\n //传入gl_Position的depth值\n fbo_picking_setData(gl_Position.w, true);\n }";
|
|
@@ -11885,15 +11891,15 @@
|
|
|
11885
11891
|
delete() {
|
|
11886
11892
|
super.delete();
|
|
11887
11893
|
const t = this.getSymbols()[0].url;
|
|
11888
|
-
if (this.layer.getRenderer().removeCache(t), this.
|
|
11889
|
-
const e = this.
|
|
11894
|
+
if (this.layer.getRenderer().removeCache(t), this.fo) for (let t = 0; t < this.fo.length; t++) {
|
|
11895
|
+
const e = this.fo[t];
|
|
11890
11896
|
for (let n = 0; n < e.length; n++) {
|
|
11891
11897
|
const n = e[t], {geometry: i, materialInfo: r} = n;
|
|
11892
11898
|
if (i && i.dispose(), r) for (const t in r) r[t] && r[t].destroy && r[t].destroy();
|
|
11893
11899
|
}
|
|
11894
11900
|
}
|
|
11895
11901
|
}
|
|
11896
|
-
|
|
11902
|
+
vo(t, e, i, r) {
|
|
11897
11903
|
const s = n.vec3.set(hl, ...e || ul), o = i || fl, a = r || dl, l = n.quat.fromEuler(cl, o[0], o[1], o[2]);
|
|
11898
11904
|
return n.mat4.fromRotationTranslationScale(t, l, s, a);
|
|
11899
11905
|
}
|
|
@@ -11935,8 +11941,8 @@
|
|
|
11935
11941
|
}
|
|
11936
11942
|
callShader(t, e) {
|
|
11937
11943
|
super.callShader(t, e), this.transformWater();
|
|
11938
|
-
const n = this.
|
|
11939
|
-
this.renderer.render(this.
|
|
11944
|
+
const n = this.wo(this.getMap(), e);
|
|
11945
|
+
this.renderer.render(this.Ao, n, this._o, this.getRenderFBO(e));
|
|
11940
11946
|
}
|
|
11941
11947
|
addMesh(t, e) {
|
|
11942
11948
|
this.sr(t, e), super.addMesh(...arguments);
|
|
@@ -11946,14 +11952,14 @@
|
|
|
11946
11952
|
for (let n = 0; n < t.length; n++) t[n].ssr = e ? 1 : 0;
|
|
11947
11953
|
}
|
|
11948
11954
|
paint(t) {
|
|
11949
|
-
t.states && t.states.includesChanged && (this.shader.dispose(), this.
|
|
11955
|
+
t.states && t.states.includesChanged && (this.shader.dispose(), this.Ao.dispose(),
|
|
11950
11956
|
this.nr(t));
|
|
11951
|
-
const e = !!t.ssr && this.getSymbol(wl).ssr, n = this.
|
|
11957
|
+
const e = !!t.ssr && this.getSymbol(wl).ssr, n = this.Ao, i = n.shaderDefines;
|
|
11952
11958
|
if (e) {
|
|
11953
11959
|
const e = ns({}, i, t.ssr.defines);
|
|
11954
11960
|
n.shaderDefines = e;
|
|
11955
11961
|
}
|
|
11956
|
-
this.updateIBLDefines(n), this.
|
|
11962
|
+
this.updateIBLDefines(n), this.Mo.ssr = e ? 1 : 0, super.paint(t), e && (n.shaderDefines = i);
|
|
11957
11963
|
}
|
|
11958
11964
|
init(t) {
|
|
11959
11965
|
this.createIBLTextures();
|
|
@@ -11971,38 +11977,38 @@
|
|
|
11971
11977
|
extraCommandProps: {
|
|
11972
11978
|
viewport: this.pickingViewport
|
|
11973
11979
|
}
|
|
11974
|
-
}, this.pickingFBO) ]), this.
|
|
11980
|
+
}, this.pickingFBO) ]), this.So();
|
|
11975
11981
|
}
|
|
11976
|
-
|
|
11982
|
+
So() {
|
|
11977
11983
|
const t = this.regl;
|
|
11978
|
-
this.
|
|
11984
|
+
this.ko = t.texture(2), this.Po = [ 2, 2 ];
|
|
11979
11985
|
const e = this.getSymbol({
|
|
11980
11986
|
index: 0
|
|
11981
11987
|
}), n = e.texWaveNormal, i = this.getCachedTexture(n), r = this;
|
|
11982
|
-
if (i) i.loading || (this.
|
|
11988
|
+
if (i) i.loading || (this.To = this.Oo(t, i)); else {
|
|
11983
11989
|
const e = new Image;
|
|
11984
11990
|
e.loading = !0, e.onload = function() {
|
|
11985
|
-
delete this.loading, r.
|
|
11991
|
+
delete this.loading, r.To = r.Oo(t, this), this.Po = [ this.width, this.height ],
|
|
11986
11992
|
r.setToRedraw();
|
|
11987
11993
|
}, e.onerror = () => {
|
|
11988
11994
|
console.error("invalid water wave normal texture:" + n);
|
|
11989
11995
|
}, this.addCachedTexture(n, e), e.src = n;
|
|
11990
11996
|
}
|
|
11991
11997
|
const s = e.texWavePerturbation, o = this.getCachedTexture(s);
|
|
11992
|
-
if (o) o.loading || (this.
|
|
11998
|
+
if (o) o.loading || (this.Fo = this.Oo(t, o)); else {
|
|
11993
11999
|
const e = new Image;
|
|
11994
12000
|
e.loading = !0, e.onload = function() {
|
|
11995
|
-
delete this.loading, r.
|
|
12001
|
+
delete this.loading, r.Fo = r.Oo(t, this), this.Po = [ this.width, this.height ],
|
|
11996
12002
|
r.setToRedraw();
|
|
11997
12003
|
}, e.onerror = () => {
|
|
11998
12004
|
console.error("invalid water wave perturbation texture:" + s);
|
|
11999
12005
|
}, this.addCachedTexture(s, e), e.src = s;
|
|
12000
12006
|
}
|
|
12001
12007
|
}
|
|
12002
|
-
|
|
12003
|
-
return this.
|
|
12004
|
-
width: this.
|
|
12005
|
-
height: this.
|
|
12008
|
+
Oo(t, e) {
|
|
12009
|
+
return this.ko ? t.texture({
|
|
12010
|
+
width: this.Po[0],
|
|
12011
|
+
height: this.Po[1],
|
|
12006
12012
|
mag: "linear",
|
|
12007
12013
|
min: "linear mipmap linear",
|
|
12008
12014
|
wrapS: "repeat",
|
|
@@ -12099,7 +12105,7 @@
|
|
|
12099
12105
|
enable: !1
|
|
12100
12106
|
}
|
|
12101
12107
|
};
|
|
12102
|
-
i.push(...n.reshader.SsrPass.getUniformDeclares()), this.
|
|
12108
|
+
i.push(...n.reshader.SsrPass.getUniformDeclares()), this.Ao = new n.reshader.MeshShader({
|
|
12103
12109
|
vert: "#define SHADER_NAME WATER\nuniform mat4 modelMatrix;\nuniform mat4 projViewModelMatrix;\nattribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform vec2 uvOffset;\nuniform vec2 noiseUvOffset;\nuniform vec2 uvScale;\nvarying vec2 vUv;\nvarying vec2 vNoiseUv;\nvarying vec3 vPos;\nvarying mat3 vTbnMatrix;\n#ifdef HAS_SSR\nuniform mat4 modelViewMatrix;\nvarying vec4 vViewVertex;\n#endif\nmat3 c(in vec3 d) {\n vec3 t = normalize(cross(d, vec3(.0, 1., .0)));\n vec3 e = normalize(cross(d, t));\n return mat3(t, e, d);\n}\n#if defined(HAS_SHADOWING)\n#include <vsm_shadow_vert>\n#endif\nconst vec3 f = vec3(0., 0., 1.);\nvoid main(void) {\n vec4 h = vec4(aPosition, 1.);\n vec4 i = modelMatrix * h;\n vPos = i.xyz;\n vTbnMatrix = c(f);\n gl_Position = projViewModelMatrix * h;\n vUv = aTexCoord * uvScale + uvOffset;\n vNoiseUv = aTexCoord * uvScale * TIME_NOISE_TEXTURE_REPEAT + noiseUvOffset;\n#ifdef HAS_SSR\nvec4 j = modelViewMatrix * h;\n vViewVertex = j;\n#endif\n#if defined(HAS_SHADOWING)\nshadow_computeShadowPars(h);\n#endif\n}",
|
|
12104
12110
|
frag: "#define SHADER_NAME WATER\nprecision highp float;\nprecision highp sampler2D;\n#include <hsv_frag>\nuniform vec3 hsv;\nuniform float contrast;\n#if defined(HAS_SHADOWING)\n#include <vsm_shadow_frag>\n#endif\n#if defined(HAS_IBL_LIGHTING)\nuniform vec3 hdrHsv;\nuniform samplerCube specularPBR;\nuniform float rgbmRange;\nuniform vec3 diffuseSPH[9];\n#else\nuniform vec3 ambientColor;\n#endif\nstruct PBRShadingWater {\n float NdotL;\n float NdotV;\n float NdotH;\n float VdotH;\n float LdotH;\n float VdotN;\n};\nvec3 c(const in vec4 d, const in float e) {\n if(e <= .0)\n return d.rgb;\n return e * d.rgb * d.a;\n}\n#ifdef HAS_SSR\nvarying vec4 vViewVertex;\nuniform mat3 modelViewNormalMatrix;\nuniform sampler2D TextureDepth;\nuniform highp vec2 outSize;\nuniform float ssrFactor;\nuniform float ssrQuality;\nuniform sampler2D TextureReflected;\nuniform highp mat4 projMatrix;\nuniform mat4 invProjMatrix;\nuniform vec4 outputFovInfo[2];\nuniform mat4 reprojViewProjMatrix;\nuniform vec2 cameraNearFar;\nfloat f(const in vec4 h) {\n return h.r + h.g / 255.;\n}\nfloat i(const in vec2 j, const in float k) {\n vec3 l = vec3(.06711056, .00583715, 52.9829189);\n return fract(l.z * fract(dot(j.xy + k * vec2(47., 17.) * .695, l.xy))) * .5;\n}\nvec3 m(const in float n, const in float o, const in vec2 u) {\n float v = min(o - .01, n);\n float A = floor(v);\n float B = min(o, A + 1.);\n float C = pow(2., B);\n vec2 D = 2. * C / u;\n if(v - A > .5)\n C *= 2.;\n return vec3(D, C);\n}\nvec2 E(const in vec2 F, const in vec3 G) {\n vec2 H = max(G.xy, min(1. - G.xy, F));\n return vec2(2. * H.x, G.z - 1. - H.y) / G.z;\n}\nvec3 I(const in mat4 J, const in vec3 K) {\n vec4 L = J * vec4(K, 1.);\n return vec3(.5 + .5 * L.xy / L.w, L.w);\n}\nvec3 M(const in float N, const in vec2 H) {\n return texture2D(TextureReflected, H).rgb;\n}\nfloat O(float P) {\n highp mat4 J = projMatrix;\n highp float z = P * 2. - 1.;\n return -J[3].z / (z + J[2].z);\n}\nfloat Q(const vec2 H) {\n float P = f(texture2D(TextureDepth, H));\n return P;\n}\nvec3 R(const in float k, const in vec3 S, const in vec3 T, const in vec3 U, const in vec3 V, const in float W) {\n vec2 X;\n X.x = i(gl_FragCoord.yx, k);\n X.y = fract(X.x * 52.9829189);\n X.y = mix(X.y, 1., .7);\n float Y = 2. * 3.14159 * X.x;\n float Z = pow(max(X.y, .000001), W / (2. - W));\n float ba = sqrt(1. - Z * Z);\n vec3 bb = vec3(ba * cos(Y), ba * sin(Y), Z);\n bb = bb.x * S + bb.y * T + bb.z * U;\n return normalize((2. * dot(V, bb)) * bb - V);\n}\nfloat bc(const in float k) {\n return (i(gl_FragCoord.xy, k) - .5);\n}\nvec3 bd(const in vec3 be, const in float bf, const in vec3 bg) {\n vec3 bh = I(projMatrix, vViewVertex.xyz + bg * bf);\n bh.z = 1. / bh.z;\n bh -= be;\n float bi = min(1., .99 * (1. - be.x) / max(1e-5, bh.x));\n float bj = min(1., .99 * (1. - be.y) / max(1e-5, bh.y));\n float bk = min(1., .99 * be.x / max(1e-5, -bh.x));\n float bl = min(1., .99 * be.y / max(1e-5, -bh.y));\n return bh * min(bi, bj) * min(bk, bl);\n}\nfloat bm(const in vec3 be, const in vec3 bh, inout float bn, inout float bo) {\n float bp = (bo + bn) * .5;\n vec3 bq = be + bh * bp;\n float z = Q(bq.xy);\n float P = O(z);\n float br = -1. / bq.z;\n bn = P > br ? bn : bp;\n bo = P > br ? bp : bo;\n return bp;\n}\nvec4 bs(const in vec3 be, const in float bf, in float bt, const in vec3 bg, const in float bu, const in float k) {\n const int bv = 20;\n float bw = 1. / float(bv);\n bt *= bw;\n vec3 bh = bd(be, bf, bg);\n float bx = bw;\n vec3 by = vec3(.0, bx, 1.);\n vec3 bq;\n float z, P, br, bz, bA, bB;\n bool bC;\n float bD = 1.;\n float bp;\n for(int bE = 0; bE < bv; bE++) {\n bq = be + bh * by.y;\n z = Q(bq.xy);\n P = O(z);\n br = -1. / bq.z;\n bz = br - P;\n bz *= clamp(sign(abs(bz) - bf * bw * bw), .0, 1.);\n bC = abs(bz + bt) < bt;\n bA = clamp(by.x / (by.x - bz), .0, 1.);\n bB = bC ? by.y + bA * bw - bw : 1.;\n by.z = min(by.z, bB);\n by.x = bz;\n if(bC) {\n float bn = by.y - bw;\n float bo = by.y;\n bp = bm(be, bh, bn, bo);\n bp = bm(be, bh, bn, bo);\n bp = bm(be, bh, bn, bo);\n bD = bp;\n break;\n }\n by.y += bw;\n }\n return vec4(be + bh * bD, 1. - bD);\n}\nvec3 bF(in vec4 bG, const in float bH, const in vec3 bI, const in vec3 bJ, const in float bu) {\n vec4 bK = mix(outputFovInfo[0], outputFovInfo[1], bG.x);\n bG.xyz = vec3(mix(bK.xy, bK.zw, bG.y), 1.) * -1. / bG.z;\n bG.xyz = (reprojViewProjMatrix * vec4(bG.xyz, 1.)).xyw;\n bG.xy /= bG.z;\n float bL = clamp(6. - 6. * max(abs(bG.x), abs(bG.y)), .0, 1.);\n bG.xy = .5 + .5 * bG.xy;\n return vec3(bG.xy, 1.);\n}\nvec3 ssr(const in vec3 bI, const in vec3 bJ, const in float bu, const in vec3 bM, const in vec3 V) {\n float bN = .0;\n vec4 bO = vec4(.0);\n float W = bu * bu;\n W = W * W;\n vec3 bP = abs(bM.z) < .999 ? vec3(.0, .0, 1.) : vec3(1., .0, .0);\n vec3 S = normalize(cross(bP, bM));\n vec3 T = cross(bM, S);\n float bH = ssrFactor * clamp(-4. * dot(V, bM) + 3.8, .0, 1.);\n bH *= clamp(4.7 - bu * 5., .0, 1.);\n vec3 be = I(projMatrix, vViewVertex.xyz);\n be.z = 1. / be.z;\n vec3 bg = R(bN, S, T, bM, V, W);\n float bf = mix(cameraNearFar.y + vViewVertex.z, -vViewVertex.z - cameraNearFar.x, bg.z * .5 + .5);\n float bt = .5 * bf;\n vec4 bG;\n if(dot(bg, bM) > .001 && bH > .0) {\n bG = bs(be, bf, bt, bg, bu, bN);\n if(bG.w > .0)\n return bF(bG, bH, bI, bJ, bu);\n \n }\n return vec3(.0);\n}\n#endif\nconst vec3 bQ = vec3(0., 0., 1.);\nuniform mat4 viewMatrix;\nuniform sampler2D normalTexture;\nuniform sampler2D heightTexture;\nuniform vec4 waveParams;\nuniform vec2 waterDir;\nuniform vec4 waterBaseColor;\nuniform vec3 lightDirection;\nuniform vec3 lightColor;\nuniform vec3 camPos;\nuniform float timeElapsed;\nvarying vec2 vUv;\nvarying vec2 vNoiseUv;\nvarying vec3 vPos;\nvarying mat3 vTbnMatrix;\nfloat bR(vec3 bS, float bT) {\n float bU = max(.015, bT);\n return max((bS.x + bS.y) * .3303545 / bU + .3303545, .0);\n}\nconst vec2 bV = vec2(6. / 25., 5. / 24.);\nvec2 bW(sampler2D bX, vec2 H) {\n return 2. * texture2D(bX, H).rg - 1.;\n}\nfloat bY(vec2 H) {\n return texture2D(heightTexture, H).b;\n}\nvec3 bZ(sampler2D bX, vec2 H) {\n return 2. * texture2D(bX, H).rgb - 1.;\n}\nfloat ca(vec2 H, float cb) {\n return fract(cb);\n}\nfloat cc(vec2 H, float cb) {\n float cd = ca(H, cb);\n return 1. - abs(1. - 2. * cd);\n}\nvec3 ce(sampler2D cf, vec2 H, float cb, float cg) {\n float ch = waveParams[2];\n float ci = waveParams[3];\n vec2 cj = bW(cf, H) * ch;\n float cd = ca(H, cb + cg);\n float ck = cc(H, cb + cg);\n vec2 bO = H;\n bO -= cj * (cd + ci);\n bO += cg;\n bO += (cb - cd) * bV;\n return vec3(bO, ck);\n}\nconst float cl = 7.77;\nvec3 cm(sampler2D cn, sampler2D co, vec2 cp, vec2 cq, float cb) {\n float bT = waveParams[0];\n vec2 cr = cb * -cq;\n float cs = bY(vNoiseUv) * cl;\n vec3 ct = ce(co, cp + cr, cb + cs, .0);\n vec3 cu = ce(co, cp + cr, cb + cs, .5);\n vec3 cv = bZ(cn, ct.xy) * ct.z;\n vec3 cw = bZ(cn, cu.xy) * cu.z;\n vec3 cx = normalize(cv + cw);\n cx.xy *= bT;\n cx.z = sqrt(1. - dot(cx.xy, cx.xy));\n return cx;\n}\nvec4 cy(vec2 cp, float cz) {\n float cA = waveParams[1];\n vec3 bM = cm(normalTexture, heightTexture, cp * cA, waterDir, cz);\n float cB = bR(bM, waveParams[0]);\n return vec4(bM, cB);\n}\nconst float cC = 3.141592653589793;\nconst float cD = 1. / cC;\nconst float cE = .3183098861837907;\nconst float cF = 1.570796326794897;\nconst float cG = .4;\nfloat cH = 2.2;\nvec3 cI(float cJ, vec3 cK, float cL) {\n return cK + (cL - cK) * pow(1. - cJ, 5.);\n}\nfloat cM(float cN, float bu) {\n float cO = bu * bu;\n float cP = cN * cN;\n float cQ = pow((cP * (cO - 1.) + 1.), cH) * cC;\n return cO / cQ;\n}\nfloat cR(float cS) {\n return .25 / (cS * cS);\n}\nvec3 cT(const vec3 x) {\n return (x * (2.51 * x + .03)) / (x * (2.43 * x + .59) + .14);\n}\nconst float cU = 2.2;\nconst float cV = .4545454545;\nvec4 cW(vec4 d) {\n return vec4(pow(d.rgb, vec3(cV)), d.w);\n}\nvec3 cX(vec3 d) {\n return pow(d, vec3(cU));\n}\nconst vec3 cY = vec3(.02, 1., 5.);\nconst vec2 cZ = vec2(.02, .1);\nconst float bu = .06;\nconst float da = 1.7;\nconst vec3 db = vec3(0, .6, .9);\nconst vec3 dc = vec3(.72, .92, 1.);\nconst float dd = .65;\nconst float de = 300000.0;\nconst float df = 500000.0;\nconst float dg = .775;\nconst float dh = .8;\nvec3 di(in vec3 bS, in vec3 dj) {\n \n#ifdef HAS_IBL_LIGHTING\nvec3 dk = reflect(-dj, bS);\n return c(textureCube(specularPBR, dk), rgbmRange);\n#else\nreturn ambientColor;\n#endif\n}\nPBRShadingWater dl;\nvec3 dm(in PBRShadingWater dn, float bu, vec3 dp, float dq) {\n vec3 dr = cI(dn.VdotH, dp, dq);\n float ds = cM(dn.NdotH, bu);\n float dt = cR(dn.LdotH);\n float du = mix(bu + .045, bu + .385, 1. - dn.VdotH);\n float dv = 1.2;\n float dw = cM(dn.NdotH, du) * dv;\n return ((ds + dw) * dt) * dr;\n}\nvec3 dx(float da, float dy, vec3 db, float dz) {\n return da * (.075 * db * pow(dy, 4.) + 50. * pow(dy, 23.)) * dz;\n}\nvec3 dA(in float Z, in vec3 dB, in vec3 dC) {\n float dD = pow((1. - Z), cY[2]);\n return mix(dC, dB, dD);\n}\nvec3 dE(in vec3 bS, in vec3 dj, in vec3 dF, vec3 d, in vec3 dG, in vec3 dH, in float dI, float dJ, vec3 dK) {\n float dL = 0.;\n vec3 dM = cX(d);\n vec3 bb = normalize(dF + dj);\n dl.NdotL = clamp(dot(bS, dF), .0, 1.);\n dl.NdotV = clamp(dot(bS, dj), .001, 1.);\n dl.VdotN = clamp(dot(dj, bS), .001, 1.);\n dl.NdotH = clamp(dot(bS, bb), .0, 1.);\n dl.VdotH = clamp(dot(dj, bb), .0, 1.);\n dl.LdotH = clamp(dot(dF, bb), .0, 1.);\n float dN = max(dot(dH, dj), .0);\n vec3 dO = cX(dc);\n vec3 dP = cX(db);\n vec3 dc = dA(dN, dO, dP);\n float dQ = max(dot(dH, dF), .0);\n float dR = .1 + dQ * .9;\n dc *= dR;\n float dS = clamp(dI, .8, 1.);\n vec3 dT = cI(dl.VdotN, vec3(cY[0]), cY[1]);\n vec3 dU = dT * dc * dS;\n vec3 dV = dM * mix(dc, dQ * dG * cD, 2. / 3.) * dS;\n vec3 dW = vec3(.0);\n if(dN > .0 && dQ > .0) {\n vec3 dX = dm(dl, bu, vec3(cZ[0]), cZ[1]);\n vec3 dY = dG * cD * dI;\n dW = dl.NdotL * dY * dX;\n }\n vec3 cB = vec3(.0);\n if(dN > .0) {\n cB = dx(da, dJ, db, dR);\n }\n vec3 dZ = vec3(.0);\n#ifdef HAS_SSR\nfloat ea = smoothstep(df, de, -dK.z);\n mat4 eb = viewMatrix;\n vec4 ec = vec4(dK.xyz, 1.);\n vec3 ed = normalize(ec.xyz);\n vec4 ee = eb * vec4(bS, .0);\n vec3 ef = normalize(ee.xyz);\n vec4 eg = eb * vec4(dH, .0);\n float eh = pow(max(dot(-ed, eg.xyz), .0), cG);\n vec3 ei = mix(eg.xyz, ef, eh);\n vec3 ej = ssr(vec3(.0), vec3(1.), bu, normalize(ei), -normalize(vViewVertex.xyz));\n if(ej.z > .0) {\n vec2 ek = smoothstep(.3, .6, abs(vec2(.5) - ej.xy));\n dL = dg * clamp(1. - 1.3 * ek.y, .0, 1.) * ea;\n vec3 el = M(.0, ej.xy);\n dZ = cX(el) * dL * dT.y * dd;\n }\n#endif\nfloat em = mix(dh, dh * .5, dL);\n return cT((1. - dL) * dU + dZ + dV * em + dW + cB);\n}\nvoid main() {\n vec3 dH = bQ;\n vec4 en = cy(vUv, timeElapsed);\n vec3 bS = normalize(vTbnMatrix * en.xyz);\n vec3 dj = -normalize(vPos - camPos);\n vec3 dF = normalize(-lightDirection);\n#if defined(HAS_SHADOWING)\nfloat dI = shadow_computeShadow();\n#else\nfloat dI = 1.;\n#endif\nvec4 eo = viewMatrix * vec4(vPos, 1.);\n vec4 ep = vec4(dE(bS, dj, dF, waterBaseColor.rgb, lightColor, dH, dI, en.w, eo.xyz), waterBaseColor.a);\n gl_FragColor = cW(ep);\n if(contrast != 1.) {\n gl_FragColor = contrastMatrix(contrast) * gl_FragColor;\n }\n if(length(hsv) > .0) {\n gl_FragColor = hsv_apply(gl_FragColor, hsv);\n }\n}",
|
|
12105
12111
|
defines: r,
|
|
@@ -12120,10 +12126,10 @@
|
|
|
12120
12126
|
};
|
|
12121
12127
|
return this.setIncludeUniformValues(i, e), i;
|
|
12122
12128
|
}
|
|
12123
|
-
|
|
12129
|
+
wo(t, e) {
|
|
12124
12130
|
const {iblTexes: n} = this.getIBLRes(), i = t.projViewMatrix, r = t.getLightManager();
|
|
12125
12131
|
let s = r && r.getDirectionalLight() || {};
|
|
12126
|
-
const o = r && r.getAmbientLight() || {}, a = this.getSymbol(wl), l = this.
|
|
12132
|
+
const o = r && r.getAmbientLight() || {}, a = this.getSymbol(wl), l = this.Io = this.Io || [], h = {
|
|
12127
12133
|
hdrHsv: o.hsv || [ 0, 0, 0 ],
|
|
12128
12134
|
specularPBR: n && n.prefilterMap,
|
|
12129
12135
|
rgbmRange: n && n.rgbmRange,
|
|
@@ -12137,8 +12143,8 @@
|
|
|
12137
12143
|
lightColor: s.color || bl.color,
|
|
12138
12144
|
camPos: t.cameraPosition,
|
|
12139
12145
|
timeElapsed: a.animation ? (this.layer.getRenderer().getFrameTimestamp() || 0) / (1 / (a.waterSpeed || 1) * 1e4) : 0,
|
|
12140
|
-
normalTexture: this.
|
|
12141
|
-
heightTexture: this.
|
|
12146
|
+
normalTexture: this.To || this.ko,
|
|
12147
|
+
heightTexture: this.Fo || this.ko,
|
|
12142
12148
|
waveParams: [ .09, a.uvScale || 3, .03, -.5 ],
|
|
12143
12149
|
waterDir: Ml(l, a.waterDirection || 0),
|
|
12144
12150
|
waterBaseColor: a.waterBaseColor || [ .1451, .2588, .4863, 1 ],
|
|
@@ -12149,24 +12155,24 @@
|
|
|
12149
12155
|
h;
|
|
12150
12156
|
}
|
|
12151
12157
|
delete() {
|
|
12152
|
-
super.delete(), this.
|
|
12153
|
-
this.
|
|
12154
|
-
this.
|
|
12155
|
-
this.
|
|
12158
|
+
super.delete(), this.ko && (this.ko.destroy(), delete this.ko), this.To && this.To.destroy(),
|
|
12159
|
+
this.Fo && this.Fo.destroy(), this.shader && this.shader.dispose(), this.Ao && this.Ao.dispose(),
|
|
12160
|
+
this.Mo && (this.Mo.geometry.dispose(), this.Mo.material && this.Mo.material.dispose(),
|
|
12161
|
+
this.Mo.dispose(), delete this.Mo), this.disposeIBLTextures();
|
|
12156
12162
|
}
|
|
12157
12163
|
createGround() {
|
|
12158
12164
|
const t = new n.reshader.Plane;
|
|
12159
12165
|
t.data.aTexCoord = new Uint8Array([ 0, 1, 1, 1, 0, 0, 1, 0 ]), t.generateBuffers(this.renderer.regl),
|
|
12160
|
-
this.
|
|
12166
|
+
this.Mo = new n.reshader.Mesh(t, null, {
|
|
12161
12167
|
castShadow: !1
|
|
12162
|
-
}), this.
|
|
12168
|
+
}), this._o = new n.reshader.Scene([ this.Mo ]);
|
|
12163
12169
|
}
|
|
12164
12170
|
transformWater() {
|
|
12165
|
-
const t = this.getMap(), e = n.GroundPainter.getGroundTransform(this.
|
|
12166
|
-
this.
|
|
12167
|
-
const i = t._get2DExtentAtRes(t.getGLRes()), r = i.getWidth(), s = i.getHeight(), o = t.cameraLookAt, a = o[0] - r, l = o[1] + s, h = this.
|
|
12168
|
-
this.
|
|
12169
|
-
this.
|
|
12171
|
+
const t = this.getMap(), e = n.GroundPainter.getGroundTransform(this.Mo.localTransform, t);
|
|
12172
|
+
this.Mo.setLocalTransform(e);
|
|
12173
|
+
const i = t._get2DExtentAtRes(t.getGLRes()), r = i.getWidth(), s = i.getHeight(), o = t.cameraLookAt, a = o[0] - r, l = o[1] + s, h = this.Po, c = a / h[0], u = l / h[1], f = c % 1, d = u % 1, p = .3737 * c % 1, y = .3737 * u % 1, m = i.getWidth() / h[0] * 2, g = i.getHeight() / h[1] * 2;
|
|
12174
|
+
this.Mo.setUniform("uvOffset", [ f, d ]), this.Mo.setUniform("noiseUvOffset", [ p, y ]),
|
|
12175
|
+
this.Mo.setUniform("uvScale", [ m, -g ]);
|
|
12170
12176
|
}
|
|
12171
12177
|
}
|
|
12172
12178
|
function Ml(t, e) {
|
|
@@ -12197,7 +12203,7 @@
|
|
|
12197
12203
|
Hl.registerAt(Qi);
|
|
12198
12204
|
const Dl = ts("gltf-lit", xl);
|
|
12199
12205
|
Dl.registerAt(Qi);
|
|
12200
|
-
const
|
|
12206
|
+
const Ll = ts("heatmap", class extends Vs {
|
|
12201
12207
|
createFnTypeConfig(t, e) {
|
|
12202
12208
|
const n = M(e.heatWeight), i = new Int16Array(1);
|
|
12203
12209
|
return [ {
|
|
@@ -12238,7 +12244,7 @@
|
|
|
12238
12244
|
o;
|
|
12239
12245
|
}
|
|
12240
12246
|
callRenderer(t, e) {
|
|
12241
|
-
this.
|
|
12247
|
+
this.Co.render(this.scene, t, this.getRenderFBO(e));
|
|
12242
12248
|
}
|
|
12243
12249
|
getUniformValues(t) {
|
|
12244
12250
|
const {projViewMatrix: e} = t;
|
|
@@ -12252,7 +12258,7 @@
|
|
|
12252
12258
|
return this.scene.getMeshes();
|
|
12253
12259
|
}
|
|
12254
12260
|
delete() {
|
|
12255
|
-
super.delete(...arguments), this.
|
|
12261
|
+
super.delete(...arguments), this.Co.dispose(), delete this.Co;
|
|
12256
12262
|
}
|
|
12257
12263
|
init() {
|
|
12258
12264
|
const t = this.regl;
|
|
@@ -12271,14 +12277,14 @@
|
|
|
12271
12277
|
zpass: "replace"
|
|
12272
12278
|
}
|
|
12273
12279
|
}, r = this.getPolygonOffset(), s = this.getSymbols()[0];
|
|
12274
|
-
this.
|
|
12280
|
+
this.Co = new n.HeatmapProcess(this.regl, this.sceneConfig, this.layer, s.heatmapColor, i, r);
|
|
12275
12281
|
}
|
|
12276
12282
|
});
|
|
12277
|
-
|
|
12278
|
-
const
|
|
12279
|
-
|
|
12283
|
+
Ll.registerAt(Qi);
|
|
12284
|
+
const Rl = ts("water", _l);
|
|
12285
|
+
Rl.registerAt(Qi), cr.registerPainter("lit", ll), cr.registerPainter("icon", ya),
|
|
12280
12286
|
cr.registerPainter("fill", Ws), cr.registerPainter("line", Xs), cr.registerPainter("line-gradient", qs),
|
|
12281
|
-
cr.registerPainter("water", _l), Qi.VERSION = "0.63.
|
|
12287
|
+
cr.registerPainter("water", _l), Qi.VERSION = "0.63.8", cr.VERSION = "0.63.8";
|
|
12282
12288
|
if (s.mat4.create(), s.transcoders) {
|
|
12283
12289
|
const t = r.Map.VERSION;
|
|
12284
12290
|
if (t.indexOf("1.0.0-beta") >= 0 || t.indexOf("1.0.0-alpha") >= 0) {
|
|
@@ -12289,14 +12295,14 @@
|
|
|
12289
12295
|
}));
|
|
12290
12296
|
} else r.registerWorkerAdapter("@maptalks/vt", o);
|
|
12291
12297
|
t.FillPainter = Ws, t.FillPlugin = Sl, t.GLTFPhongPlugin = Hl, t.GLTFStandardPlugin = Dl,
|
|
12292
|
-
t.GeoJSONVectorTileLayer = ar, t.HeatmapPlugin =
|
|
12298
|
+
t.GeoJSONVectorTileLayer = ar, t.HeatmapPlugin = Ll, t.IconPainter = ya, t.IconPlugin = Tl,
|
|
12293
12299
|
t.LineGradientPlugin = Pl, t.LinePainter = Xs, t.LinePlugin = kl, t.LineStringLayer = Ir,
|
|
12294
12300
|
t.LitPlugin = El, t.MapboxVectorTileLayer = sr, t.NativeLinePainter = Za, t.NativeLinePlugin = Fl,
|
|
12295
12301
|
t.NativePointPainter = Ya, t.PackUtil = Pi, t.PhongPainter = il, t.PhongPlugin = Il,
|
|
12296
12302
|
t.PointLayer = Fr, t.PolygonLayer = Cr, t.SYMBOLS_NEED_REBUILD_IN_VECTOR = Fi, t.SYMBOLS_NEED_REBUILD_IN_VT = Oi,
|
|
12297
12303
|
t.TextPainter = Ua, t.TextPlugin = Ol, t.Vector3DLayer = cr, t.VectorTileLayer = Qi,
|
|
12298
|
-
t.VectorTileLayerRenderer = ji, t.WaterPlugin =
|
|
12304
|
+
t.VectorTileLayerRenderer = ji, t.WaterPlugin = Rl, t.WireframePainter = sl, t.WireframePlugin = Cl,
|
|
12299
12305
|
Object.defineProperty(t, "t", {
|
|
12300
12306
|
value: !0
|
|
12301
|
-
}), "undefined" != typeof console && console.log("@maptalks/vt v0.63.
|
|
12307
|
+
}), "undefined" != typeof console && console.log("@maptalks/vt v0.63.8");
|
|
12302
12308
|
}));
|