@maptalks/vt 0.63.5 → 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 +352 -343
- package/dist/maptalks.vt.mjs +344 -335
- 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(),
|
|
@@ -5022,6 +5022,9 @@
|
|
|
5022
5022
|
dataConfig: {
|
|
5023
5023
|
type: "fill",
|
|
5024
5024
|
only2D: !0
|
|
5025
|
+
},
|
|
5026
|
+
sceneConfig: {
|
|
5027
|
+
antialias: !0
|
|
5025
5028
|
}
|
|
5026
5029
|
};
|
|
5027
5030
|
break;
|
|
@@ -5655,7 +5658,7 @@
|
|
|
5655
5658
|
return t && "VectorTileLayer" === t.type ? new Qi(t.id, t.options) : null;
|
|
5656
5659
|
}
|
|
5657
5660
|
Se() {
|
|
5658
|
-
this.Je && (this.sn =
|
|
5661
|
+
this.Je && (this.sn = R(this.Je)), this.Xe && (this.an = R(this.Xe));
|
|
5659
5662
|
}
|
|
5660
5663
|
static registerPlugin(t) {
|
|
5661
5664
|
Qi.plugins || (Qi.plugins = {}), Qi.plugins[t.type] = t;
|
|
@@ -6287,7 +6290,7 @@
|
|
|
6287
6290
|
let br = new Float32Array(1);
|
|
6288
6291
|
class wr extends r.renderer.CanvasRenderer {
|
|
6289
6292
|
constructor(...t) {
|
|
6290
|
-
super(...t), this.features = {}, this.vn = {}, this.
|
|
6293
|
+
super(...t), this.features = {}, this.vn = {}, this.Rt = 1, this.xn = {}, this.bn = {},
|
|
6291
6294
|
this.wn = {}, this.An = {}, this._n = {}, this.Mn = !0, this.Sn = {
|
|
6292
6295
|
id: 0,
|
|
6293
6296
|
pickingId: 0
|
|
@@ -6311,7 +6314,7 @@
|
|
|
6311
6314
|
const t = this.Dn;
|
|
6312
6315
|
delete this.Dn, this.In(t), this.En = !1;
|
|
6313
6316
|
}
|
|
6314
|
-
if (!this.meshes && !this.
|
|
6317
|
+
if (!this.meshes && !this.Ln && !this.Rn) return void this.completeRender();
|
|
6315
6318
|
this.Nn && (this.zn(), this.Nn = !1), this.Vn(), n.options.collision && n.clearCollisionIndex(),
|
|
6316
6319
|
this.ae = t, this.ce = e || {};
|
|
6317
6320
|
const i = this.jn();
|
|
@@ -6319,10 +6322,10 @@
|
|
|
6319
6322
|
this.painter && this.meshes && (this.painter.startFrame(i), this.painter.addMesh(this.meshes, null, {
|
|
6320
6323
|
bloom: 1
|
|
6321
6324
|
}), this.painter.prepareRender(i), i.polygonOffsetIndex = r++, this.painter.render(i)),
|
|
6322
|
-
this.
|
|
6325
|
+
this.Rn && (this.On.startFrame(i), this.On.addMesh(this.Rn, null, {
|
|
6323
6326
|
bloom: 1
|
|
6324
|
-
}), this.On.prepareRender(i), i.polygonOffsetIndex = r++, this.On.render(i)), this.
|
|
6325
|
-
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, {
|
|
6326
6329
|
bloom: 1
|
|
6327
6330
|
}), this.Tn.prepareRender(i), n.options.collision && this.Tn.updateCollision(i),
|
|
6328
6331
|
this.Tn.render(i)), this.completeRender(), this.layer.fire("canvasisdirty");
|
|
@@ -6366,8 +6369,8 @@
|
|
|
6366
6369
|
} else s.visible || (this.Nn = !0), this.Wn(s.geometry, e), t.push(s);
|
|
6367
6370
|
}
|
|
6368
6371
|
return t.length || (this.meshes && this.painter && (this.painter.deleteMesh(this.meshes),
|
|
6369
|
-
delete this.meshes), this.
|
|
6370
|
-
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]), {
|
|
6371
6374
|
features: t,
|
|
6372
6375
|
center: e
|
|
6373
6376
|
};
|
|
@@ -6464,22 +6467,22 @@
|
|
|
6464
6467
|
}
|
|
6465
6468
|
Fn(t) {
|
|
6466
6469
|
const e = Object.keys(this.wn), i = Object.keys(this.An);
|
|
6467
|
-
if (!e.length && !i.length) return void (this.
|
|
6468
|
-
delete this.
|
|
6470
|
+
if (!e.length && !i.length) return void (this.Ln && (this.Tn.deleteMesh(this.Ln),
|
|
6471
|
+
delete this.Ln));
|
|
6469
6472
|
const {features: r, center: s} = this.Gn(), o = [], a = [];
|
|
6470
6473
|
for (let t = 0; t < r.length; t++) {
|
|
6471
6474
|
const e = r[t][xr];
|
|
6472
6475
|
this.wn[e] && o.push(r[t]), this.An[e] && a.push(r[t]);
|
|
6473
6476
|
}
|
|
6474
|
-
if (!o.length && !a.length) return void (this.
|
|
6475
|
-
delete this.
|
|
6477
|
+
if (!o.length && !a.length) return void (this.Ln && (this.Tn.deleteMesh(this.Ln),
|
|
6478
|
+
delete this.Ln));
|
|
6476
6479
|
const l = this.Nn;
|
|
6477
6480
|
this.$n = s;
|
|
6478
6481
|
const h = this.Zn(o, a, t, s);
|
|
6479
6482
|
this.Hn = {};
|
|
6480
6483
|
const c = [], u = [];
|
|
6481
6484
|
this.Kn = !0, Promise.all(h).then(t => {
|
|
6482
|
-
if (this.
|
|
6485
|
+
if (this.Ln && (this.Tn.deleteMesh(this.Ln), delete this.Ln), !t || !t.length) return void this.setToRedraw();
|
|
6483
6486
|
const e = this.Tn.createGeometries(t.map(t => t && t.data), this.xn);
|
|
6484
6487
|
for (let n = 0; n < e.length; n++) this.Bn(e[n].geometry, t[n] && t[n].data);
|
|
6485
6488
|
const i = t[0] && t[0].data.iconAtlas, r = t[0] && t[0].data.glyphAtlas || t[1] && t[1].data.glyphAtlas;
|
|
@@ -6489,11 +6492,11 @@
|
|
|
6489
6492
|
const a = this.Tn.createMeshes(e, o);
|
|
6490
6493
|
for (let t = 0; t < a.length; t++) a[t].geometry.properties.originElements = a[t].geometry.properties.elements.slice(),
|
|
6491
6494
|
a[t].setUniform("level", 0), a[t].material.set("flipY", 1), a[t].properties.meshKey = gr++;
|
|
6492
|
-
this.
|
|
6495
|
+
this.Ln = a, l && (this.Nn = !0), this.Kn = !1, this.setToRedraw();
|
|
6493
6496
|
});
|
|
6494
6497
|
}
|
|
6495
6498
|
zn() {
|
|
6496
|
-
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);
|
|
6497
6500
|
if (this.meshes) for (let t = 0; t < this.meshes.length; t++) this.Qn(this.meshes[t], this.xn);
|
|
6498
6501
|
}
|
|
6499
6502
|
Qn(t, e) {
|
|
@@ -6525,7 +6528,7 @@
|
|
|
6525
6528
|
const e = t._getInternalSymbol(), n = {
|
|
6526
6529
|
zoom: this.getMap().getZoom()
|
|
6527
6530
|
}, i = this.ei(t);
|
|
6528
|
-
if (!this.
|
|
6531
|
+
if (!this.Ln) return !1;
|
|
6529
6532
|
let r = this.features[i];
|
|
6530
6533
|
Array.isArray(r) || (r = [ r ]);
|
|
6531
6534
|
const s = [], o = [], a = this.getMap().getZoom();
|
|
@@ -6541,7 +6544,7 @@
|
|
|
6541
6544
|
const e = r[t][xr];
|
|
6542
6545
|
this.wn[e] && s.push(r[t]), this.An[e] && o.push(r[t]);
|
|
6543
6546
|
}
|
|
6544
|
-
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;
|
|
6545
6548
|
return Promise.all(u).then(t => {
|
|
6546
6549
|
for (let e = 0; e < t.length; e++) {
|
|
6547
6550
|
if (!t[e]) continue;
|
|
@@ -6558,7 +6561,7 @@
|
|
|
6558
6561
|
}), !0;
|
|
6559
6562
|
}
|
|
6560
6563
|
ii(t) {
|
|
6561
|
-
return this.ri(t, this.
|
|
6564
|
+
return this.ri(t, this.Rn, this.Dn, this.si, this.On, ai, mr, this.oi);
|
|
6562
6565
|
}
|
|
6563
6566
|
ri(t, e, n, i, r, s, o, a) {
|
|
6564
6567
|
if (!e) return !1;
|
|
@@ -6614,15 +6617,15 @@
|
|
|
6614
6617
|
}), !0;
|
|
6615
6618
|
}
|
|
6616
6619
|
In(t) {
|
|
6617
|
-
if (!Object.keys(this._n).length) return void (this.
|
|
6618
|
-
delete this.
|
|
6620
|
+
if (!Object.keys(this._n).length) return void (this.Rn && (this.On.deleteMesh(this.Rn),
|
|
6621
|
+
delete this.Rn));
|
|
6619
6622
|
const {features: e, center: n} = this.Gn();
|
|
6620
6623
|
if (!e.length) return;
|
|
6621
6624
|
const i = this.Nn;
|
|
6622
6625
|
this.si = n;
|
|
6623
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));
|
|
6624
6627
|
this.ai = !0, Promise.all(o).then(t => {
|
|
6625
|
-
this.
|
|
6628
|
+
this.Rn && this.On.deleteMesh(this.Rn);
|
|
6626
6629
|
const e = [], n = [];
|
|
6627
6630
|
for (let i = 0; i < t.length; i++) {
|
|
6628
6631
|
const r = t[i] && t[i].meshes;
|
|
@@ -6634,7 +6637,7 @@
|
|
|
6634
6637
|
n[i] = t[i].atlas;
|
|
6635
6638
|
}
|
|
6636
6639
|
}
|
|
6637
|
-
this.
|
|
6640
|
+
this.Rn = e, this.Dn = n, i && (this.Nn = i), this.ai = !1, this.setToRedraw();
|
|
6638
6641
|
});
|
|
6639
6642
|
}
|
|
6640
6643
|
oi(t) {
|
|
@@ -6665,7 +6668,7 @@
|
|
|
6665
6668
|
}
|
|
6666
6669
|
}
|
|
6667
6670
|
ei(t) {
|
|
6668
|
-
t[fr] || (t[fr] = this.
|
|
6671
|
+
t[fr] || (t[fr] = this.Rt++);
|
|
6669
6672
|
const e = t[fr];
|
|
6670
6673
|
this.features[e] && this.ci(e), this.features[e] = dr(t, this.Sn, this.features[e]);
|
|
6671
6674
|
const n = this.features[e];
|
|
@@ -6773,7 +6776,7 @@
|
|
|
6773
6776
|
for (let i = 0; i < e.length; i++) if (!t(e[0], n[0])) return !1;
|
|
6774
6777
|
} else if (Array.isArray(e[0]) || Array.isArray(n[0])) return !1;
|
|
6775
6778
|
return !0;
|
|
6776
|
-
}(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),
|
|
6777
6780
|
void this.onGeometryPositionChange(t);
|
|
6778
6781
|
this.hi([ e ]), this.li(), Ar(this);
|
|
6779
6782
|
}
|
|
@@ -6822,7 +6825,9 @@
|
|
|
6822
6825
|
this.prepareRequestors(), this.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height),
|
|
6823
6826
|
this.painter = this.createPainter();
|
|
6824
6827
|
const e = cr.get3DPainterClass("icon"), n = F({}, pr, yr);
|
|
6825
|
-
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
|
+
});
|
|
6826
6831
|
const i = cr.get3DPainterClass("line"), r = F({}, mr);
|
|
6827
6832
|
this.On = new i(this.regl, this.layer, r, this.layer.options.sceneConfig, 0), this.layer.getGeometries() && this.onGeometryAdd(this.layer.getGeometries());
|
|
6828
6833
|
}
|
|
@@ -7068,7 +7073,7 @@
|
|
|
7068
7073
|
* BSD License
|
|
7069
7074
|
* https://github.com/gdsmith/jquery.easing/
|
|
7070
7075
|
*/
|
|
7071
|
-
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;
|
|
7072
7077
|
function Gr(t) {
|
|
7073
7078
|
var e = 7.5625, n = 2.75;
|
|
7074
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;
|
|
@@ -7140,17 +7145,17 @@
|
|
|
7140
7145
|
|
|
7141
7146
|
case "easeinsine":
|
|
7142
7147
|
return function(t) {
|
|
7143
|
-
return 1 -
|
|
7148
|
+
return 1 - Rr(t * Nr / 2);
|
|
7144
7149
|
}(e);
|
|
7145
7150
|
|
|
7146
7151
|
case "easeoutsine":
|
|
7147
7152
|
return function(t) {
|
|
7148
|
-
return
|
|
7153
|
+
return Lr(t * Nr / 2);
|
|
7149
7154
|
}(e);
|
|
7150
7155
|
|
|
7151
7156
|
case "easeinoutsine":
|
|
7152
7157
|
return function(t) {
|
|
7153
|
-
return -(
|
|
7158
|
+
return -(Rr(Nr * t) - 1) / 2;
|
|
7154
7159
|
}(e);
|
|
7155
7160
|
|
|
7156
7161
|
case "easeinexpo":
|
|
@@ -7185,17 +7190,17 @@
|
|
|
7185
7190
|
|
|
7186
7191
|
case "easeinelastic":
|
|
7187
7192
|
return function(t) {
|
|
7188
|
-
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);
|
|
7189
7194
|
}(e);
|
|
7190
7195
|
|
|
7191
7196
|
case "easeoutelastic":
|
|
7192
7197
|
return function(t) {
|
|
7193
|
-
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;
|
|
7194
7199
|
}(e);
|
|
7195
7200
|
|
|
7196
7201
|
case "easeinoutelastic":
|
|
7197
7202
|
return function(t) {
|
|
7198
|
-
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;
|
|
7199
7204
|
}(e);
|
|
7200
7205
|
|
|
7201
7206
|
case "easeinback":
|
|
@@ -7781,13 +7786,13 @@
|
|
|
7781
7786
|
function Os(t) {
|
|
7782
7787
|
return t && _(t) && t.property;
|
|
7783
7788
|
}
|
|
7784
|
-
const {loginIBLResOnCanvas: Fs, logoutIBLResOnCanvas: Is, getIBLResOnCanvas: Cs} = n.reshader.pbr.PBRUtils, Es = [], Hs = [], Ds = t => 0 === t.getUniform("level"),
|
|
7785
|
-
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 {
|
|
7786
7791
|
constructor(t, e, i, r, s, o) {
|
|
7787
7792
|
this.regl = t, this.layer = e, this.canvas = e.getRenderer().canvas, this.sceneConfig = r || {},
|
|
7788
7793
|
this.dataConfig = o || {}, this.pluginIndex = s, this.scene = new n.reshader.Scene,
|
|
7789
7794
|
this.pickingFBO = e.getRenderer().pickingFBO, this.Hi = new es, this.level0Filter = Ds,
|
|
7790
|
-
this.levelNFilter =
|
|
7795
|
+
this.levelNFilter = Ls, this.loginTextureCache(), this.symbolDef = Array.isArray(i) ? i.map(t => os(t)) : [ os(i) ],
|
|
7791
7796
|
this.Di(), this.pickingViewport = {
|
|
7792
7797
|
x: 0,
|
|
7793
7798
|
y: 0,
|
|
@@ -7803,7 +7808,7 @@
|
|
|
7803
7808
|
return n.getTileLevelValue && n.getTileLevelValue(t, e) || 0;
|
|
7804
7809
|
}
|
|
7805
7810
|
isVisible() {
|
|
7806
|
-
const t = this.
|
|
7811
|
+
const t = this.L;
|
|
7807
7812
|
if (t.length) for (let e = 0; e < t.length; e++) if (t[e] && !t[e].isFeatureConstant) return !0;
|
|
7808
7813
|
const e = this.getSymbols();
|
|
7809
7814
|
for (let t = 0; t < e.length; t++) {
|
|
@@ -7815,7 +7820,7 @@
|
|
|
7815
7820
|
isMeshVisible(t) {
|
|
7816
7821
|
const e = t && t.properties && t.properties.symbolIndex;
|
|
7817
7822
|
if (!e) return !1;
|
|
7818
|
-
const n = this.
|
|
7823
|
+
const n = this.L, i = e.index;
|
|
7819
7824
|
let r;
|
|
7820
7825
|
if (n[i]) {
|
|
7821
7826
|
if (!n[i].isFeatureConstant) return !0;
|
|
@@ -7824,7 +7829,7 @@
|
|
|
7824
7829
|
return !1 !== r && 0 !== r;
|
|
7825
7830
|
}
|
|
7826
7831
|
needToRedraw() {
|
|
7827
|
-
return this.
|
|
7832
|
+
return this.Li;
|
|
7828
7833
|
}
|
|
7829
7834
|
needToRetireFrames() {
|
|
7830
7835
|
return this.$t;
|
|
@@ -7848,7 +7853,7 @@
|
|
|
7848
7853
|
}) : n.push(null); else {
|
|
7849
7854
|
const r = this.createGeometry(t[i], e, i);
|
|
7850
7855
|
if (r && r.geometry) {
|
|
7851
|
-
const {pickingIdMap: n, idPickingMap: s, hasFeaIds: o} = this.
|
|
7856
|
+
const {pickingIdMap: n, idPickingMap: s, hasFeaIds: o} = this.Ri(t[i]), a = r.geometry.properties;
|
|
7852
7857
|
a.symbolIndex = r.symbolIndex, a.features = e, o && (a.feaIdPickingMap = n, a.feaPickingIdMap = s);
|
|
7853
7858
|
}
|
|
7854
7859
|
this.postCreateGeometry(r, n), n.push(r);
|
|
@@ -7856,7 +7861,7 @@
|
|
|
7856
7861
|
return n;
|
|
7857
7862
|
}
|
|
7858
7863
|
postCreateGeometry() {}
|
|
7859
|
-
|
|
7864
|
+
Ri(t) {
|
|
7860
7865
|
if (!t) return {};
|
|
7861
7866
|
if (Array.isArray(t) && !(t = t[0])) return {};
|
|
7862
7867
|
const e = t.featureIds, n = {}, i = {}, r = e && e.length;
|
|
@@ -7921,11 +7926,11 @@
|
|
|
7921
7926
|
this.Ni = t;
|
|
7922
7927
|
const n = this.getUniformValues(e, t);
|
|
7923
7928
|
return this.callShader(n, t), {
|
|
7924
|
-
redraw: this.
|
|
7929
|
+
redraw: this.Li
|
|
7925
7930
|
};
|
|
7926
7931
|
}
|
|
7927
7932
|
setToRedraw(t) {
|
|
7928
|
-
t && (this.$t = t), this.
|
|
7933
|
+
t && (this.$t = t), this.Li = !0;
|
|
7929
7934
|
}
|
|
7930
7935
|
callShader(t, e) {
|
|
7931
7936
|
this.callCurrentTileShader(t, e), this.callBackgroundTileShader(t, e);
|
|
@@ -8005,7 +8010,7 @@
|
|
|
8005
8010
|
}
|
|
8006
8011
|
}
|
|
8007
8012
|
startFrame(t) {
|
|
8008
|
-
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,
|
|
8009
8014
|
this.$t = !1), this.scene.clear();
|
|
8010
8015
|
}
|
|
8011
8016
|
resize() {}
|
|
@@ -8050,7 +8055,7 @@
|
|
|
8050
8055
|
enumerable: !0
|
|
8051
8056
|
}) : r[t] = o[t];
|
|
8052
8057
|
}
|
|
8053
|
-
return _(n.visible) && (this.
|
|
8058
|
+
return _(n.visible) && (this.L[t] = M(n.visible)), i;
|
|
8054
8059
|
}
|
|
8055
8060
|
getSymbolDef(t) {
|
|
8056
8061
|
return this.symbolDef[t.index];
|
|
@@ -8064,9 +8069,9 @@
|
|
|
8064
8069
|
}
|
|
8065
8070
|
Di() {
|
|
8066
8071
|
const t = this.getMap(), e = () => [ t.getZoom() ];
|
|
8067
|
-
this.Wi = [], this.
|
|
8072
|
+
this.Wi = [], this.L = [];
|
|
8068
8073
|
for (let t = 0; t < this.symbolDef.length; t++) this.Wi[t] = k(ns({}, this.symbolDef[t]), e),
|
|
8069
|
-
this.symbolDef[t] && _(this.symbolDef[t].visible) && (this.
|
|
8074
|
+
this.symbolDef[t] && _(this.symbolDef[t].visible) && (this.L[t] = M(this.symbolDef[t].visible));
|
|
8070
8075
|
}
|
|
8071
8076
|
getFnTypeConfig(t) {
|
|
8072
8077
|
this.Ui || (this.Ui = []);
|
|
@@ -8264,7 +8269,7 @@
|
|
|
8264
8269
|
function zs(t, e) {
|
|
8265
8270
|
return t.properties.level - e.properties.level;
|
|
8266
8271
|
}
|
|
8267
|
-
class Vs extends
|
|
8272
|
+
class Vs extends Rs {
|
|
8268
8273
|
constructor(t, e, n, i, r, s) {
|
|
8269
8274
|
super(t, e, n, i, r, s);
|
|
8270
8275
|
}
|
|
@@ -8901,13 +8906,13 @@
|
|
|
8901
8906
|
}
|
|
8902
8907
|
class Zs {
|
|
8903
8908
|
constructor(t) {
|
|
8904
|
-
this.
|
|
8909
|
+
this.Lt = t || [], this.properties = {};
|
|
8905
8910
|
}
|
|
8906
8911
|
set meshes(t) {
|
|
8907
|
-
this.
|
|
8912
|
+
this.Lt = t;
|
|
8908
8913
|
}
|
|
8909
8914
|
get meshes() {
|
|
8910
|
-
return this.
|
|
8915
|
+
return this.Lt;
|
|
8911
8916
|
}
|
|
8912
8917
|
}
|
|
8913
8918
|
const Ks = 224, Qs = 600, to = 100, eo = new Uint8Array(1), no = [], io = {
|
|
@@ -9073,7 +9078,7 @@
|
|
|
9073
9078
|
return n - Math.abs(this.Tr(t)[e]) < i;
|
|
9074
9079
|
}
|
|
9075
9080
|
Pr(t, e, n, i, r, s, o) {
|
|
9076
|
-
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]);
|
|
9077
9082
|
if (!1 === this.sceneConfig.collision || l && h) return io;
|
|
9078
9083
|
const c = this.isBoxCollides(t, e, n, i, r, s, o);
|
|
9079
9084
|
return h && (c.collides = 0, c.isAllowOverlap = 1), c;
|
|
@@ -9085,7 +9090,7 @@
|
|
|
9085
9090
|
const r = i[n], s = r % 8;
|
|
9086
9091
|
return r < 2 ? 1 == +t[this.propIgnorePlacement] : s % 2;
|
|
9087
9092
|
}
|
|
9088
|
-
|
|
9093
|
+
Lr(t, e, n) {
|
|
9089
9094
|
if (!1 === this.sceneConfig.collision) return !0;
|
|
9090
9095
|
const i = e.geometry.properties.aOverlap;
|
|
9091
9096
|
if (!i) return 1 == +t[this.propAllowOverlap];
|
|
@@ -9110,15 +9115,15 @@
|
|
|
9110
9115
|
h;
|
|
9111
9116
|
}
|
|
9112
9117
|
Tr(t) {
|
|
9113
|
-
this.
|
|
9118
|
+
this.Rr || (this.Rr = {});
|
|
9114
9119
|
const {meshKey: e} = t.properties;
|
|
9115
|
-
if (!this.
|
|
9120
|
+
if (!this.Rr[e]) {
|
|
9116
9121
|
const {frameTimestamp: t} = this.ar;
|
|
9117
|
-
this.
|
|
9122
|
+
this.Rr[e] = {
|
|
9118
9123
|
timestamp: t
|
|
9119
9124
|
};
|
|
9120
9125
|
}
|
|
9121
|
-
return this.
|
|
9126
|
+
return this.Rr[e];
|
|
9122
9127
|
}
|
|
9123
9128
|
Nr(t) {
|
|
9124
9129
|
if (!this.zr) return void (this.zr = t);
|
|
@@ -9141,10 +9146,10 @@
|
|
|
9141
9146
|
if (t) {
|
|
9142
9147
|
if (Array.isArray(t)) for (let e = 0; e < t.length; e++) {
|
|
9143
9148
|
const n = t[e].properties.meshKey;
|
|
9144
|
-
this.pr && delete this.pr.tags[n], this.
|
|
9149
|
+
this.pr && delete this.pr.tags[n], this.Rr && delete this.Rr[n];
|
|
9145
9150
|
} else {
|
|
9146
9151
|
const e = t.properties.meshKey;
|
|
9147
|
-
this.pr && delete this.pr.tags[e], this.
|
|
9152
|
+
this.pr && delete this.pr.tags[e], this.Rr && delete this.Rr[e];
|
|
9148
9153
|
}
|
|
9149
9154
|
super.deleteMesh(t, e);
|
|
9150
9155
|
}
|
|
@@ -9433,10 +9438,10 @@
|
|
|
9433
9438
|
ss(H) && (H = 15);
|
|
9434
9439
|
const D = n.vec2.set(Oo, E / 24, H / 24);
|
|
9435
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);
|
|
9436
|
-
let
|
|
9437
|
-
const
|
|
9438
|
-
if (
|
|
9439
|
-
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);
|
|
9440
9445
|
O = n.vec2.transformMat2(O, O, t), F = n.vec2.transformMat2(F, F, t), I = n.vec2.transformMat2(I, I, t),
|
|
9441
9446
|
C = n.vec2.transformMat2(C, C, t);
|
|
9442
9447
|
}
|
|
@@ -9444,24 +9449,24 @@
|
|
|
9444
9449
|
n.vec2.multiply(F, F, To), n.vec2.multiply(I, I, To), n.vec2.multiply(C, C, To),
|
|
9445
9450
|
vo(t, d, O, F, I, C, T, y)), t;
|
|
9446
9451
|
}
|
|
9447
|
-
const Io = [], Co = [], Eo = [], Ho = [], Do = [],
|
|
9452
|
+
const Io = [], Co = [], Eo = [], Ho = [], Do = [], Lo = [], Ro = [ 1, -1 ];
|
|
9448
9453
|
function No(t, e, i, r, s, o, a, l, h) {
|
|
9449
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];
|
|
9450
9455
|
let m = 1;
|
|
9451
9456
|
if (c.textPerspectiveRatio) {
|
|
9452
9457
|
m = is(.5 + .5 * (1 - (1 - u / y) * c.textPerspectiveRatio), 0, 4);
|
|
9453
9458
|
}
|
|
9454
|
-
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));
|
|
9455
9460
|
if (p) {
|
|
9456
9461
|
const {aOffset: r} = f;
|
|
9457
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);
|
|
9458
|
-
1 === M ? go(t, e, s, o, u, d, l, k, c, h, y, m) : (n.vec2.multiply(s, s,
|
|
9459
|
-
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));
|
|
9460
9465
|
} else {
|
|
9461
9466
|
const {aShape: r} = f;
|
|
9462
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);
|
|
9463
|
-
0 === c.flipY && 1 === M && (n.vec2.multiply(o, o,
|
|
9464
|
-
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));
|
|
9465
9470
|
let x = w ? -w[a] / 9362 : -(d.textRotation || 0) * Math.PI / 180;
|
|
9466
9471
|
const b = p ? 0 : h.getBearing() * Math.PI / 180;
|
|
9467
9472
|
if (x || b) {
|
|
@@ -9627,19 +9632,19 @@
|
|
|
9627
9632
|
function Wo(t, e) {
|
|
9628
9633
|
const i = t.getRenderer().canvas;
|
|
9629
9634
|
return {
|
|
9630
|
-
uniforms: [
|
|
9635
|
+
uniforms: [ {
|
|
9631
9636
|
name: "projViewModelMatrix",
|
|
9632
9637
|
type: "function",
|
|
9633
9638
|
fn: function(t, e) {
|
|
9634
9639
|
return n.mat4.multiply([], e.projViewMatrix, e.modelMatrix);
|
|
9635
9640
|
}
|
|
9636
|
-
},
|
|
9641
|
+
}, {
|
|
9637
9642
|
name: "zoomScale",
|
|
9638
9643
|
type: "function",
|
|
9639
9644
|
fn: function(t, e) {
|
|
9640
9645
|
return e.tileResolution / e.resolution;
|
|
9641
9646
|
}
|
|
9642
|
-
}
|
|
9647
|
+
} ],
|
|
9643
9648
|
extraCommandProps: {
|
|
9644
9649
|
viewport: {
|
|
9645
9650
|
x: 0,
|
|
@@ -9858,7 +9863,7 @@
|
|
|
9858
9863
|
}(t, e, i) : null;
|
|
9859
9864
|
}
|
|
9860
9865
|
const Ko = [], Qo = [];
|
|
9861
|
-
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}";
|
|
9862
9867
|
const na = new Uint16Array(1), ia = new Int8Array(1);
|
|
9863
9868
|
function ra(t, e, n) {
|
|
9864
9869
|
xs(t, e, n), function(t) {
|
|
@@ -10202,6 +10207,9 @@
|
|
|
10202
10207
|
this.Ui = {}, this.isLabelCollides = $o.bind(this), this.ds = ha.bind(this), this.ps = ca.bind(this),
|
|
10203
10208
|
this.ys = ua.bind(this), this.ms = fa.bind(this), this.gs = [];
|
|
10204
10209
|
}
|
|
10210
|
+
setTextShaderDefines(t) {
|
|
10211
|
+
this.vs = t;
|
|
10212
|
+
}
|
|
10205
10213
|
createFnTypeConfig(t, e) {
|
|
10206
10214
|
return {
|
|
10207
10215
|
icon: sa.call(this, t, e),
|
|
@@ -10219,8 +10227,8 @@
|
|
|
10219
10227
|
}
|
|
10220
10228
|
postCreateGeometry(t, e) {
|
|
10221
10229
|
const {geometry: n, symbolIndex: i} = t, r = this.getSymbolDef(i), s = this.getFnTypeConfig(i);
|
|
10222
|
-
if (this.
|
|
10223
|
-
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)) {
|
|
10224
10232
|
const t = e[e.length - 1];
|
|
10225
10233
|
if (t) {
|
|
10226
10234
|
const {geometry: e, symbolIndex: s} = t;
|
|
@@ -10231,7 +10239,7 @@
|
|
|
10231
10239
|
}
|
|
10232
10240
|
}
|
|
10233
10241
|
}
|
|
10234
|
-
|
|
10242
|
+
ws(t) {
|
|
10235
10243
|
if (!this.layer.options.collision) return;
|
|
10236
10244
|
const {collideIds: e, elements: n, aCount: i} = t.properties, r = e, s = {};
|
|
10237
10245
|
if (!n) return void (t.properties.collideBoxIndex = s);
|
|
@@ -10245,7 +10253,7 @@
|
|
|
10245
10253
|
const s = this.isEnableCollision(), o = this.layer, {geometry: a, symbolIndex: l} = t;
|
|
10246
10254
|
a.properties.symbolIndex = l;
|
|
10247
10255
|
const h = this.getSymbolDef(l), c = this.getSymbol(l), u = this.getFnTypeConfig(l), f = [];
|
|
10248
|
-
if (this.
|
|
10256
|
+
if (this.xs(a)) {
|
|
10249
10257
|
const t = function(t, e, i, r, s, o, a, l, h) {
|
|
10250
10258
|
if (e.isDisposed() || 0 === e.data.aPosition.length) return null;
|
|
10251
10259
|
const c = e.properties.iconAtlas;
|
|
@@ -10288,25 +10296,25 @@
|
|
|
10288
10296
|
d;
|
|
10289
10297
|
}(this.regl, a, e, 0, c, u.icon, o.options.collision, !s, this.isEnableUniquePlacement());
|
|
10290
10298
|
t && (delete t.geometry.properties.glyphAtlas, f.push(t));
|
|
10291
|
-
} else if (this.
|
|
10299
|
+
} else if (this.bs(a)) {
|
|
10292
10300
|
const t = jo.call(this, this.regl, a, e, h, c, u.text, o.options.collision, !s, this.isEnableUniquePlacement());
|
|
10293
10301
|
t.length && (t.forEach(t => {
|
|
10294
10302
|
delete t.geometry.properties.iconAtlas;
|
|
10295
10303
|
}), f.push(...t));
|
|
10296
10304
|
}
|
|
10297
|
-
return "line" === h.markerPlacement && this.
|
|
10298
|
-
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;
|
|
10299
10307
|
}
|
|
10300
|
-
|
|
10308
|
+
As(t, e) {
|
|
10301
10309
|
const {collideIds: n} = t.properties, i = new Uint16Array(n.length);
|
|
10302
|
-
if (this.
|
|
10310
|
+
if (this.xs(t)) {
|
|
10303
10311
|
let r = 0;
|
|
10304
10312
|
for (let t = 0; t < n.length; t += 4) i.fill(r++, t, t + 4);
|
|
10305
10313
|
t.properties.collideIds = i, t.properties.uniqueCollideIds = ms(i), e.markerCollideMap = {
|
|
10306
10314
|
old: n,
|
|
10307
10315
|
new: i
|
|
10308
10316
|
};
|
|
10309
|
-
} else if (this.
|
|
10317
|
+
} else if (this.bs(t)) {
|
|
10310
10318
|
const {collideIds: n, aCount: i} = t.properties;
|
|
10311
10319
|
if (!i) return;
|
|
10312
10320
|
if (e.markerCollideMap) {
|
|
@@ -10356,31 +10364,31 @@
|
|
|
10356
10364
|
if (!this.Br()) return;
|
|
10357
10365
|
super.updateCollision(t);
|
|
10358
10366
|
const e = this.scene.getMeshes();
|
|
10359
|
-
e && e.length ? (this.
|
|
10367
|
+
e && e.length ? (this._s(t.timestamp), this.gs = [], this.wr()) : this.wr();
|
|
10360
10368
|
}
|
|
10361
10369
|
callCurrentTileShader(t, e) {
|
|
10362
10370
|
this.shader.filter = e.sceneFilter ? [ this.ds, e.sceneFilter ] : this.ds, this.renderer.render(this.shader, t, this.scene, this.getRenderFBO(e)),
|
|
10363
|
-
this.
|
|
10371
|
+
this.Ms.filter = e.sceneFilter ? [ this.ys, e.sceneFilter ] : this.ys, this.renderer.render(this.Ms, t, this.scene, this.getRenderFBO(e));
|
|
10364
10372
|
}
|
|
10365
10373
|
callBackgroundTileShader(t, e) {
|
|
10366
10374
|
this.shader.filter = e.sceneFilter ? [ this.ps, e.sceneFilter ] : this.ps, this.renderer.render(this.shader, t, this.scene, this.getRenderFBO(e)),
|
|
10367
|
-
this.
|
|
10375
|
+
this.Ms.filter = e.sceneFilter ? [ this.ms, e.sceneFilter ] : this.ms, this.renderer.render(this.Ms, t, this.scene, this.getRenderFBO(e));
|
|
10368
10376
|
}
|
|
10369
10377
|
isMeshIterable(t) {
|
|
10370
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));
|
|
10371
10379
|
}
|
|
10372
|
-
|
|
10380
|
+
_s() {
|
|
10373
10381
|
if (!this.Br()) return;
|
|
10374
10382
|
let t = this.gs;
|
|
10375
|
-
t && t.length && this.
|
|
10383
|
+
t && t.length && this.Ss(t);
|
|
10376
10384
|
}
|
|
10377
|
-
|
|
10385
|
+
ks(t, e, n, i) {
|
|
10378
10386
|
return this.updateBoxCollisionFading(!0, t, e, n, i);
|
|
10379
10387
|
}
|
|
10380
10388
|
isEnableUniquePlacement() {
|
|
10381
10389
|
return this.isEnableCollision() && !0 === this.sceneConfig.uniquePlacement;
|
|
10382
10390
|
}
|
|
10383
|
-
|
|
10391
|
+
Ss(t) {
|
|
10384
10392
|
const e = this.layer.getRenderer();
|
|
10385
10393
|
t = t.sort(ma);
|
|
10386
10394
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -10395,12 +10403,12 @@
|
|
|
10395
10403
|
const s = e.isForeground(i.meshes[0]);
|
|
10396
10404
|
if (this.shouldIgnoreBackground() && !s) continue;
|
|
10397
10405
|
const o = i.properties.meshKey;
|
|
10398
|
-
this.startMeshCollision(i), this.
|
|
10406
|
+
this.startMeshCollision(i), this.Ps(i), this.forEachBox(i, this.ks), this.Ts(i),
|
|
10399
10407
|
this.endMeshCollision(o);
|
|
10400
|
-
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]);
|
|
10401
10409
|
}
|
|
10402
10410
|
}
|
|
10403
|
-
|
|
10411
|
+
Os(t) {
|
|
10404
10412
|
const e = t && t.geometry && t.geometry.properties.aOpacity;
|
|
10405
10413
|
e && e.dirty && (t.geometry.updateData("aOpacity", e), e.dirty = !1);
|
|
10406
10414
|
}
|
|
@@ -10410,11 +10418,11 @@
|
|
|
10410
10418
|
const i = {
|
|
10411
10419
|
boxIndex: 0
|
|
10412
10420
|
}, r = n.length;
|
|
10413
|
-
for (let s = 0; s < r; s++) this.
|
|
10421
|
+
for (let s = 0; s < r; s++) this.Fs(t, n[s], e, i);
|
|
10414
10422
|
}
|
|
10415
|
-
|
|
10423
|
+
Fs(t, e, i, r) {
|
|
10416
10424
|
const s = this.getMap(), {collideBoxIndex: o} = t.meshes[0].geometry.properties;
|
|
10417
|
-
if (!o[e]) return !1;
|
|
10425
|
+
if (!(o && o[e])) return !1;
|
|
10418
10426
|
const a = n.mat4.multiply(da, s.projViewMatrix, t.meshes[0].localTransform);
|
|
10419
10427
|
let l, h = !1;
|
|
10420
10428
|
const c = t.meshes;
|
|
@@ -10441,16 +10449,16 @@
|
|
|
10441
10449
|
f++;
|
|
10442
10450
|
}
|
|
10443
10451
|
if (!h) return !1;
|
|
10444
|
-
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;
|
|
10445
10453
|
}
|
|
10446
|
-
|
|
10454
|
+
Ps(t) {
|
|
10447
10455
|
const e = t.meshes;
|
|
10448
10456
|
for (let t = 0; t < e.length; t++) {
|
|
10449
10457
|
const n = e[t], i = n && n.geometry;
|
|
10450
10458
|
i && (i.properties.visElemts.count = 0);
|
|
10451
10459
|
}
|
|
10452
10460
|
}
|
|
10453
|
-
|
|
10461
|
+
Is(t, e) {
|
|
10454
10462
|
const n = t.meshes;
|
|
10455
10463
|
for (let t = 0; t < n.length; t++) {
|
|
10456
10464
|
const i = n[t];
|
|
@@ -10465,7 +10473,7 @@
|
|
|
10465
10473
|
a.count = u;
|
|
10466
10474
|
}
|
|
10467
10475
|
}
|
|
10468
|
-
|
|
10476
|
+
Ts(t) {
|
|
10469
10477
|
const e = t.meshes;
|
|
10470
10478
|
for (let t = 0; t < e.length; t++) {
|
|
10471
10479
|
const n = e[t], i = n && n.geometry;
|
|
@@ -10475,7 +10483,7 @@
|
|
|
10475
10483
|
}
|
|
10476
10484
|
}
|
|
10477
10485
|
isBoxCollides(t, e, n, i, r, s) {
|
|
10478
|
-
if (this.
|
|
10486
|
+
if (this.bs(t.geometry)) return $o.call(this, 0, t, e, n, i, r, s);
|
|
10479
10487
|
if (t.geometry.properties.isEmpty) return pa;
|
|
10480
10488
|
const o = this.getMap(), {boxes: a, collision: l} = this.as(t, i);
|
|
10481
10489
|
let h = 0, c = 0, u = 0;
|
|
@@ -10511,13 +10519,13 @@
|
|
|
10511
10519
|
this.shader = new n.reshader.MeshShader({
|
|
10512
10520
|
vert: ao,
|
|
10513
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}",
|
|
10514
|
-
uniforms: [
|
|
10522
|
+
uniforms: [ {
|
|
10515
10523
|
name: "projViewModelMatrix",
|
|
10516
10524
|
type: "function",
|
|
10517
10525
|
fn: function(t, e) {
|
|
10518
10526
|
return n.mat4.multiply([], e.projViewMatrix, e.modelMatrix);
|
|
10519
10527
|
}
|
|
10520
|
-
},
|
|
10528
|
+
}, {
|
|
10521
10529
|
name: "zoomScale",
|
|
10522
10530
|
type: "function",
|
|
10523
10531
|
fn: function(t, e) {
|
|
@@ -10543,22 +10551,23 @@
|
|
|
10543
10551
|
}
|
|
10544
10552
|
}
|
|
10545
10553
|
});
|
|
10546
|
-
const {uniforms: r, extraCommandProps: s} = Wo.call(this, this.layer, this.sceneConfig);
|
|
10547
|
-
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({
|
|
10548
10556
|
vert: ta,
|
|
10549
10557
|
frag: ea,
|
|
10550
10558
|
uniforms: r,
|
|
10551
|
-
extraCommandProps: s
|
|
10559
|
+
extraCommandProps: s,
|
|
10560
|
+
defines: o
|
|
10552
10561
|
}), this.pickingFBO) {
|
|
10553
10562
|
const t = new n.reshader.FBORayPicking(this.renderer, {
|
|
10554
10563
|
vert: "#define PICKING_MODE 1\n" + ao,
|
|
10555
|
-
uniforms: [
|
|
10564
|
+
uniforms: [ {
|
|
10556
10565
|
name: "projViewModelMatrix",
|
|
10557
10566
|
type: "function",
|
|
10558
10567
|
fn: function(t, e) {
|
|
10559
10568
|
return n.mat4.multiply([], e.projViewMatrix, e.modelMatrix);
|
|
10560
10569
|
}
|
|
10561
|
-
},
|
|
10570
|
+
}, {
|
|
10562
10571
|
name: "zoomScale",
|
|
10563
10572
|
type: "function",
|
|
10564
10573
|
fn: function(t, e) {
|
|
@@ -10597,15 +10606,15 @@
|
|
|
10597
10606
|
};
|
|
10598
10607
|
}
|
|
10599
10608
|
getUniqueEntryKey(t, e) {
|
|
10600
|
-
if (!this.
|
|
10609
|
+
if (!this.bs(t.geometry)) return null;
|
|
10601
10610
|
const {elements: n} = t.geometry.properties;
|
|
10602
10611
|
return Zo(t, n[e]);
|
|
10603
10612
|
}
|
|
10604
|
-
|
|
10613
|
+
xs(t) {
|
|
10605
10614
|
const {symbolIndex: e} = t.properties;
|
|
10606
10615
|
return 0 === e.type;
|
|
10607
10616
|
}
|
|
10608
|
-
|
|
10617
|
+
bs(t) {
|
|
10609
10618
|
const {symbolIndex: e} = t.properties;
|
|
10610
10619
|
return 1 === e.type;
|
|
10611
10620
|
}
|
|
@@ -10658,14 +10667,14 @@
|
|
|
10658
10667
|
}, Ta = function(t) {
|
|
10659
10668
|
const e = this.layer.getRenderer(), n = this.getSymbol(t.properties.symbolIndex);
|
|
10660
10669
|
return !this.cs(t) && !e.isForeground(t) && "line" === n.textPlacement;
|
|
10661
|
-
}, 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 = [];
|
|
10662
10671
|
class Ua extends ro {
|
|
10663
10672
|
constructor(t, e, n, i, r) {
|
|
10664
10673
|
super(t, e, n, i, r), this.propAllowOverlap = "textAllowOverlap", this.propIgnorePlacement = "textIgnorePlacement",
|
|
10665
|
-
this.colorCache = {}, this.
|
|
10666
|
-
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();
|
|
10667
10676
|
}
|
|
10668
|
-
|
|
10677
|
+
Ls() {
|
|
10669
10678
|
this.Rs = [];
|
|
10670
10679
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
10671
10680
|
const e = this.symbolDef[t];
|
|
@@ -10674,7 +10683,7 @@
|
|
|
10674
10683
|
}
|
|
10675
10684
|
updateSymbol(...t) {
|
|
10676
10685
|
const e = super.updateSymbol(...t);
|
|
10677
|
-
return this.
|
|
10686
|
+
return this.Ls(), e;
|
|
10678
10687
|
}
|
|
10679
10688
|
shouldDeleteMeshOnUpdateSymbol(t) {
|
|
10680
10689
|
if (!Array.isArray(t)) return (0 === t.textHaloRadius || 0 === this.symbolDef[0].textHaloRadius) && t.textHaloRadius !== this.symbolDef[0].textHaloRadius;
|
|
@@ -10702,24 +10711,24 @@
|
|
|
10702
10711
|
r.properties.symbolIndex = s;
|
|
10703
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);
|
|
10704
10713
|
if (h.length) {
|
|
10705
|
-
"line" === o.textPlacement ? this.
|
|
10714
|
+
"line" === o.textPlacement ? this.Ns = !0 : this.zs = !0;
|
|
10706
10715
|
}
|
|
10707
10716
|
return h;
|
|
10708
10717
|
}
|
|
10709
10718
|
updateCollision(t) {
|
|
10710
10719
|
super.updateCollision(t);
|
|
10711
10720
|
const e = this.scene.getMeshes();
|
|
10712
|
-
e && e.length ? (this.
|
|
10721
|
+
e && e.length ? (this.Vs = {}, this.js(t.timestamp), this.wr()) : this.wr();
|
|
10713
10722
|
}
|
|
10714
10723
|
callCurrentTileShader(t, e) {
|
|
10715
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
10716
|
-
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));
|
|
10717
10726
|
}
|
|
10718
10727
|
callBackgroundTileShader(t, e) {
|
|
10719
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
10720
|
-
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));
|
|
10721
10730
|
}
|
|
10722
|
-
|
|
10731
|
+
js() {
|
|
10723
10732
|
let t = this.scene.getMeshes();
|
|
10724
10733
|
if (!t || !t.length) return;
|
|
10725
10734
|
const e = -this.getMap().getBearing() * Math.PI / 180, i = n.mat2.fromRotation(Ia, e), r = (t, e, n, i) => {
|
|
@@ -10741,7 +10750,7 @@
|
|
|
10741
10750
|
const c = n.properties.meshKey;
|
|
10742
10751
|
if ("line" === h.textPlacement) {
|
|
10743
10752
|
if (!l.properties.line) continue;
|
|
10744
|
-
s && this.startMeshCollision(n), this.
|
|
10753
|
+
s && this.startMeshCollision(n), this.Gs(n, i);
|
|
10745
10754
|
const {aOffset: t, aOpacity: e} = l.properties;
|
|
10746
10755
|
t.dirty && (l.updateData("aOffset", t), t.dirty = !1), e && e.dirty && (l.updateData("aOpacity", e),
|
|
10747
10756
|
e.dirty = !1), s && this.endMeshCollision(c);
|
|
@@ -10766,7 +10775,7 @@
|
|
|
10766
10775
|
getUniqueEntryKey(t, e) {
|
|
10767
10776
|
return Zo(t, e);
|
|
10768
10777
|
}
|
|
10769
|
-
|
|
10778
|
+
Gs(t, e) {
|
|
10770
10779
|
const i = this.getMap(), r = t.geometry, s = r.properties, o = this.layer.getRenderer().isForeground(t);
|
|
10771
10780
|
if (this.shouldIgnoreBackground() && !o) return;
|
|
10772
10781
|
let a = s.line;
|
|
@@ -10774,12 +10783,12 @@
|
|
|
10774
10783
|
const l = 1 === t.material.uniforms.pitchWithMap, h = s.elements;
|
|
10775
10784
|
if (!l) {
|
|
10776
10785
|
const e = n.mat4.multiply(Oa, i.projViewMatrix, t.localTransform), r = new Array(a.length);
|
|
10777
|
-
a = this.
|
|
10786
|
+
a = this.Ws(r, a, e, i.width, i.height);
|
|
10778
10787
|
}
|
|
10779
10788
|
const c = this.Br(), u = r.properties.visElemts = r.properties.visElemts || new h.constructor(h.length);
|
|
10780
10789
|
c && (u.count = 0), this.forEachBox(t, (t, n, i, r) => {
|
|
10781
10790
|
const {start: s, end: o} = n[0];
|
|
10782
|
-
let f = this.
|
|
10791
|
+
let f = this.Bs(t, h, s, o, a, i, l ? e : null, r);
|
|
10783
10792
|
if (c && (f = this.updateBoxCollisionFading(f, t, n, i, r), f)) {
|
|
10784
10793
|
let t = u.count;
|
|
10785
10794
|
for (let e = s; e < o; e++) u[t++] = h[e];
|
|
@@ -10787,16 +10796,16 @@
|
|
|
10787
10796
|
}
|
|
10788
10797
|
}), !c || u.count === h.length && r.count === u.count || r.setElements(u, u.count);
|
|
10789
10798
|
}
|
|
10790
|
-
|
|
10799
|
+
Ws(t, e, i, r, s) {
|
|
10791
10800
|
const o = e.id + "-" + i.join();
|
|
10792
|
-
if (this.
|
|
10801
|
+
if (this.Vs[o]) return this.Vs[o];
|
|
10793
10802
|
const a = function(t, e, i, r, s) {
|
|
10794
10803
|
const o = [];
|
|
10795
10804
|
for (let a = 0; a < e.length; a += 3) n.vec4.set(o, e[a], e[a + 1], e[a + 2], 1),
|
|
10796
10805
|
ho(o, o, i, r, s), t[a] = o[0], t[a + 1] = o[1], t[a + 2] = e[a + 2];
|
|
10797
10806
|
return t;
|
|
10798
10807
|
}(t, e, i, r, s);
|
|
10799
|
-
return this.
|
|
10808
|
+
return this.Vs[o] = a, a;
|
|
10800
10809
|
}
|
|
10801
10810
|
forEachBox(t, e) {
|
|
10802
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);
|
|
@@ -10816,7 +10825,7 @@
|
|
|
10816
10825
|
y = h[d], p = n;
|
|
10817
10826
|
}
|
|
10818
10827
|
}
|
|
10819
|
-
|
|
10828
|
+
Bs(t, e, i, r, s, o, a) {
|
|
10820
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;
|
|
10821
10830
|
let v = n.vec3.set(Ca, p[g], p[g + 1], 2 === u ? 0 : p[g + 2]);
|
|
10822
10831
|
const x = ho(Ea, v, o, h.width, h.height);
|
|
@@ -10825,7 +10834,7 @@
|
|
|
10825
10834
|
m && (v = x);
|
|
10826
10835
|
const b = m ? 1 : c.properties.tileExtent / this.layer.options.tileSize[0];
|
|
10827
10836
|
let w = !0;
|
|
10828
|
-
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);
|
|
10829
10838
|
if (null === S) return Ba(d, e, i, r), !1;
|
|
10830
10839
|
const k = _ - A <= 3, P = t.material.uniforms, T = 1 === P.pitchWithMap, O = Math.floor(S / 2), F = S % 2;
|
|
10831
10840
|
for (let o = i; o < r; o += 6) {
|
|
@@ -10839,15 +10848,15 @@
|
|
|
10839
10848
|
let c = h[2];
|
|
10840
10849
|
F && (c -= Math.PI / 2);
|
|
10841
10850
|
const u = xo(Da, c, 0, P.rotateWithMap, P.pitchWithMap);
|
|
10842
|
-
for (let t = 0; t < 4; t++) n.vec2.set(
|
|
10843
|
-
n.vec2.scale(
|
|
10844
|
-
n.vec2.add(
|
|
10845
|
-
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,
|
|
10846
10855
|
d[2 * (a + t)] = za[0], d[2 * (a + t) + 1] = za[1]);
|
|
10847
10856
|
}
|
|
10848
10857
|
return w;
|
|
10849
10858
|
}
|
|
10850
|
-
|
|
10859
|
+
Xs(t, e, n, i, r, s, o, a) {
|
|
10851
10860
|
const l = r - i <= 3, h = this.getMap();
|
|
10852
10861
|
return l ? 0 : _a.call(this, Va, ja, t, e, n, i, r, s, o, h.width / h.height, a);
|
|
10853
10862
|
}
|
|
@@ -10860,7 +10869,7 @@
|
|
|
10860
10869
|
}) : t.material && delete t.material.uniforms.texture), super.deleteMesh(t, e));
|
|
10861
10870
|
}
|
|
10862
10871
|
delete() {
|
|
10863
|
-
super.delete(), this.
|
|
10872
|
+
super.delete(), this.Us.dispose(), delete this.Vs, this.qs && this.qs.dispose();
|
|
10864
10873
|
}
|
|
10865
10874
|
needClearStencil() {
|
|
10866
10875
|
return !0;
|
|
@@ -10877,7 +10886,7 @@
|
|
|
10877
10886
|
});
|
|
10878
10887
|
let r = i;
|
|
10879
10888
|
if (this.layer.getRenderer().isEnableWorkAround("win-intel-gpu-crash") && (r = ns({}, i),
|
|
10880
|
-
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({
|
|
10881
10890
|
vert: Ma,
|
|
10882
10891
|
frag: ea,
|
|
10883
10892
|
uniforms: e,
|
|
@@ -11133,7 +11142,7 @@
|
|
|
11133
11142
|
}
|
|
11134
11143
|
}
|
|
11135
11144
|
const Ka = [ 1, 1, 1 ], Qa = [ 1, 1, 1, 1 ], tl = [ 0, 0 ];
|
|
11136
|
-
class el extends
|
|
11145
|
+
class el extends Rs {
|
|
11137
11146
|
supportRenderMode(t) {
|
|
11138
11147
|
return this.isAnimating() ? "fxaa" === t || "fxaaAfterTaa" === t : "taa" === t || "fxaa" === t;
|
|
11139
11148
|
}
|
|
@@ -11196,7 +11205,7 @@
|
|
|
11196
11205
|
enumerable: !0,
|
|
11197
11206
|
get: () => {
|
|
11198
11207
|
const t = this.getSymbol(o);
|
|
11199
|
-
return s.properties.hasAlpha || t.polygonOpacity < 1;
|
|
11208
|
+
return s.properties.hasAlpha || t.polygonOpacity < 1 || t.lineOpacity < 1;
|
|
11200
11209
|
}
|
|
11201
11210
|
}), a.properties.symbolIndex = o, a;
|
|
11202
11211
|
}
|
|
@@ -11210,10 +11219,10 @@
|
|
|
11210
11219
|
r;
|
|
11211
11220
|
}
|
|
11212
11221
|
needPolygonOffset() {
|
|
11213
|
-
return this.
|
|
11222
|
+
return this.Js;
|
|
11214
11223
|
}
|
|
11215
11224
|
startFrame(...t) {
|
|
11216
|
-
return delete this.
|
|
11225
|
+
return delete this.Js, super.startFrame(...t);
|
|
11217
11226
|
}
|
|
11218
11227
|
addMesh(t, e) {
|
|
11219
11228
|
t.forEach(t => {
|
|
@@ -11226,7 +11235,7 @@
|
|
|
11226
11235
|
0 === e && (e = .01), Ka[2] = e, n.mat4.fromScaling(i, Ka), n.mat4.multiply(i, t.properties.tileTransform, i),
|
|
11227
11236
|
t.setLocalTransform(i);
|
|
11228
11237
|
} else t.setLocalTransform(t.properties.tileTransform);
|
|
11229
|
-
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),
|
|
11230
11239
|
this.getSymbol(t.properties.symbolIndex).ssr ? t.ssr = 1 : t.ssr = 0;
|
|
11231
11240
|
}
|
|
11232
11241
|
deleteMesh(t, e) {
|
|
@@ -11278,7 +11287,7 @@
|
|
|
11278
11287
|
}
|
|
11279
11288
|
updateSymbol(t, e) {
|
|
11280
11289
|
const n = super.updateSymbol(t, e);
|
|
11281
|
-
return t.material && this.
|
|
11290
|
+
return t.material && this.Ys(t.material), n;
|
|
11282
11291
|
}
|
|
11283
11292
|
Gi(t, e) {
|
|
11284
11293
|
return nl(t) !== nl(e);
|
|
@@ -11318,14 +11327,14 @@
|
|
|
11318
11327
|
return this.shader;
|
|
11319
11328
|
}
|
|
11320
11329
|
delete(t) {
|
|
11321
|
-
this.getMap().off("updatelights", this
|
|
11330
|
+
this.getMap().off("updatelights", this.$s, this), super.delete(t), this.material.dispose();
|
|
11322
11331
|
}
|
|
11323
11332
|
init() {
|
|
11324
|
-
this.getMap().on("updatelights", this
|
|
11333
|
+
this.getMap().on("updatelights", this.$s, this);
|
|
11325
11334
|
const t = this.regl;
|
|
11326
11335
|
this.renderer = new n.reshader.Renderer(t);
|
|
11327
11336
|
const e = this.getShaderConfig();
|
|
11328
|
-
this.shader = new n.reshader.PhongShader(e), this.
|
|
11337
|
+
this.shader = new n.reshader.PhongShader(e), this.Ys();
|
|
11329
11338
|
const i = {
|
|
11330
11339
|
vert: this.getPickingVert(),
|
|
11331
11340
|
uniforms: [ "projViewMatrix", "modelMatrix", "positionMatrix", {
|
|
@@ -11341,7 +11350,7 @@
|
|
|
11341
11350
|
};
|
|
11342
11351
|
this.picking = [ new n.reshader.FBORayPicking(this.renderer, i, this.layer.getRenderer().pickingFBO) ];
|
|
11343
11352
|
}
|
|
11344
|
-
|
|
11353
|
+
$s() {
|
|
11345
11354
|
this.setToRedraw();
|
|
11346
11355
|
}
|
|
11347
11356
|
getShaderConfig() {
|
|
@@ -11390,14 +11399,14 @@
|
|
|
11390
11399
|
}
|
|
11391
11400
|
};
|
|
11392
11401
|
}
|
|
11393
|
-
|
|
11402
|
+
Ys() {
|
|
11394
11403
|
this.material && this.material.dispose();
|
|
11395
11404
|
const t = this.getSymbols()[0].material, e = {};
|
|
11396
11405
|
for (const n in t) ys(t, n) && (e[n] = t[n]);
|
|
11397
11406
|
this.material = new n.reshader.PhongMaterial(e);
|
|
11398
11407
|
}
|
|
11399
11408
|
getUniformValues(t, e) {
|
|
11400
|
-
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({
|
|
11401
11410
|
viewMatrix: n,
|
|
11402
11411
|
projMatrix: i,
|
|
11403
11412
|
cameraPosition: r,
|
|
@@ -11410,7 +11419,7 @@
|
|
|
11410
11419
|
getPickingVert() {
|
|
11411
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 ";
|
|
11412
11421
|
}
|
|
11413
|
-
|
|
11422
|
+
Zs() {
|
|
11414
11423
|
const t = this.getMap().getLightManager(), e = t && t.getAmbientLight() || {}, n = t && t.getDirectionalLight() || {};
|
|
11415
11424
|
return {
|
|
11416
11425
|
ambientColor: e.color || [ .2, .2, .2 ],
|
|
@@ -11421,7 +11430,7 @@
|
|
|
11421
11430
|
}
|
|
11422
11431
|
}
|
|
11423
11432
|
const rl = [ 1, 1, 1 ];
|
|
11424
|
-
class sl extends
|
|
11433
|
+
class sl extends Rs {
|
|
11425
11434
|
constructor(t, e, n, i, r) {
|
|
11426
11435
|
if (super(t, e, n, i, r), _(this.symbolDef[0].lineColor)) {
|
|
11427
11436
|
const t = e.getMap(), n = S(this.symbolDef.lineColor);
|
|
@@ -11478,7 +11487,7 @@
|
|
|
11478
11487
|
const i = [];
|
|
11479
11488
|
return n.mat4.multiply(i, e.projViewMatrix, e.modelMatrix), i;
|
|
11480
11489
|
}
|
|
11481
|
-
}
|
|
11490
|
+
} ],
|
|
11482
11491
|
extraCommandProps: {
|
|
11483
11492
|
stencil: {
|
|
11484
11493
|
enable: !0,
|
|
@@ -11514,20 +11523,20 @@
|
|
|
11514
11523
|
const {getPBRUniforms: ol} = n.reshader.pbr.PBRUtils, al = [];
|
|
11515
11524
|
class ll extends el {
|
|
11516
11525
|
constructor(...t) {
|
|
11517
|
-
super(...t), this.
|
|
11526
|
+
super(...t), this.Ks = new n.reshader.ResourceLoader, this.scene.sortFunction = this.sortByCommandKey;
|
|
11518
11527
|
}
|
|
11519
11528
|
supportRenderMode(t) {
|
|
11520
11529
|
return this.getSymbols()[0].ssr ? "fxaa" === t || "fxaaAfterTaa" === t : super.supportRenderMode(t);
|
|
11521
11530
|
}
|
|
11522
11531
|
isAnimating() {
|
|
11523
|
-
const t = this.
|
|
11532
|
+
const t = this.Qs();
|
|
11524
11533
|
if (t && (t[0] || t[1])) return !0;
|
|
11525
11534
|
}
|
|
11526
11535
|
needToRedraw() {
|
|
11527
|
-
const t = this.
|
|
11536
|
+
const t = this.Qs();
|
|
11528
11537
|
return !(!t || !t[0] && !t[1]) || super.needToRedraw();
|
|
11529
11538
|
}
|
|
11530
|
-
|
|
11539
|
+
Qs() {
|
|
11531
11540
|
const t = this.getSymbols()[0];
|
|
11532
11541
|
return t.material && t.material.uvOffsetAnim;
|
|
11533
11542
|
}
|
|
@@ -11553,18 +11562,18 @@
|
|
|
11553
11562
|
const e = ns({}, r, t.ssr.defines);
|
|
11554
11563
|
i.shaderDefines = e;
|
|
11555
11564
|
}
|
|
11556
|
-
if (t.onlyUpdateDepthInTaa && (this.shader = this.
|
|
11565
|
+
if (t.onlyUpdateDepthInTaa && (this.shader = this.eo, !n && this.no && (this.shader = i,
|
|
11557
11566
|
this.setToRedraw(!0))), this.updateIBLDefines(i), super.paint(t), void 0 !== this.shadowCount && e) {
|
|
11558
11567
|
const t = this.scene.getMeshes().length;
|
|
11559
11568
|
this.shadowCount !== t && this.setToRedraw();
|
|
11560
11569
|
}
|
|
11561
11570
|
this.shader = i, n && (i.shaderDefines = r), delete this.shadowCount;
|
|
11562
|
-
const s = this.
|
|
11571
|
+
const s = this.Qs();
|
|
11563
11572
|
if (s && (s[0] || s[1])) this.material.set("uvOffset", [ 0, 0 ]); else {
|
|
11564
11573
|
const t = this.getUVOffset(s);
|
|
11565
11574
|
this.material.set("uvOffset", t);
|
|
11566
11575
|
}
|
|
11567
|
-
this.
|
|
11576
|
+
this.no = n;
|
|
11568
11577
|
}
|
|
11569
11578
|
getShadowMeshes() {
|
|
11570
11579
|
if (!this.isVisible()) return al;
|
|
@@ -11580,15 +11589,15 @@
|
|
|
11580
11589
|
ns(this.sceneConfig, t), this.setToRedraw();
|
|
11581
11590
|
}
|
|
11582
11591
|
delete() {
|
|
11583
|
-
super.delete(), this.disposeIBLTextures(), this.material.dispose(), this.
|
|
11584
|
-
this.shader && (this.shader.dispose(), delete this.shader), this.
|
|
11585
|
-
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);
|
|
11586
11595
|
}
|
|
11587
11596
|
init(t) {
|
|
11588
|
-
this.getMap().on("updatelights", this.
|
|
11597
|
+
this.getMap().on("updatelights", this.ro, this), this.createIBLTextures(), this.or = this.or || t;
|
|
11589
11598
|
const e = this.regl;
|
|
11590
|
-
this.renderer = new n.reshader.Renderer(e), this.
|
|
11591
|
-
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);
|
|
11592
11601
|
const i = {
|
|
11593
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 ",
|
|
11594
11603
|
uniforms: [ {
|
|
@@ -11644,20 +11653,20 @@
|
|
|
11644
11653
|
polygonOffset: this.getPolygonOffset()
|
|
11645
11654
|
}, o = {
|
|
11646
11655
|
uniforms: r,
|
|
11647
|
-
defines: this.
|
|
11656
|
+
defines: this.co(i),
|
|
11648
11657
|
extraCommandProps: s
|
|
11649
11658
|
};
|
|
11650
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 ",
|
|
11651
|
-
this.
|
|
11660
|
+
this.eo = new n.reshader.pbr.StandardShader(o);
|
|
11652
11661
|
}
|
|
11653
|
-
|
|
11662
|
+
oo({resources: t}) {
|
|
11654
11663
|
for (let e = 0; e < t.length; e++) this.addCachedTexture(t[e].url, t[e].data);
|
|
11655
11664
|
this.setToRedraw(!0);
|
|
11656
11665
|
}
|
|
11657
|
-
|
|
11666
|
+
ho() {
|
|
11658
11667
|
this.setToRedraw(!0);
|
|
11659
11668
|
}
|
|
11660
|
-
|
|
11669
|
+
Ys(t) {
|
|
11661
11670
|
const e = t || this.getSymbols()[0].material, i = {};
|
|
11662
11671
|
let r = !1;
|
|
11663
11672
|
for (const t in e) if (ys(e, t)) if (t.indexOf("Texture") > 0) {
|
|
@@ -11676,15 +11685,15 @@
|
|
|
11676
11685
|
} : s.data = a : o === s && (s = {
|
|
11677
11686
|
url: o,
|
|
11678
11687
|
wrap: "repeat"
|
|
11679
|
-
}), s.flipY = !0, i[t] = new n.reshader.Texture2D(s, this.
|
|
11680
|
-
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),
|
|
11681
11690
|
r = !0;
|
|
11682
11691
|
} else i[t] = e[t];
|
|
11683
11692
|
if (this.material) {
|
|
11684
11693
|
for (let t in i) this.material.set(t, i[t]);
|
|
11685
11694
|
this.setToRedraw(!0);
|
|
11686
|
-
} else this.material = new n.reshader.pbr.StandardMaterial(i), this.material.once("complete", this.
|
|
11687
|
-
r || this.
|
|
11695
|
+
} else this.material = new n.reshader.pbr.StandardMaterial(i), this.material.once("complete", this.lo);
|
|
11696
|
+
r || this.ho();
|
|
11688
11697
|
}
|
|
11689
11698
|
getShader() {
|
|
11690
11699
|
return this.shader;
|
|
@@ -11693,29 +11702,29 @@
|
|
|
11693
11702
|
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = ol(t, n, i, e && e.ssr, e && e.jitter);
|
|
11694
11703
|
return this.setIncludeUniformValues(r, e), r;
|
|
11695
11704
|
}
|
|
11696
|
-
|
|
11705
|
+
co(t) {
|
|
11697
11706
|
return this.hasIBL() ? t.HAS_IBL_LIGHTING = 1 : delete t.HAS_IBL_LIGHTING, t;
|
|
11698
11707
|
}
|
|
11699
|
-
|
|
11708
|
+
ro() {
|
|
11700
11709
|
if (!this.shader) return;
|
|
11701
11710
|
const t = this.shader.shaderDefines;
|
|
11702
|
-
this.
|
|
11711
|
+
this.co(t), this.shader.shaderDefines = t;
|
|
11703
11712
|
}
|
|
11704
11713
|
}
|
|
11705
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 {
|
|
11706
11715
|
constructor(t, e, n, i, r) {
|
|
11707
|
-
super(t, e, n, i, r), this.
|
|
11708
|
-
this.
|
|
11716
|
+
super(t, e, n, i, r), this.uo = !1, this.scene.sortFunction = this.sortByCommandKey,
|
|
11717
|
+
this.fo = [];
|
|
11709
11718
|
}
|
|
11710
11719
|
isAnimating() {
|
|
11711
11720
|
const t = this.getSymbols();
|
|
11712
11721
|
for (let e = 0; e < t.length; e++) {
|
|
11713
|
-
if (t[e] && this.
|
|
11722
|
+
if (t[e] && this.do[e] && this.po(e)) return !0;
|
|
11714
11723
|
}
|
|
11715
11724
|
return !1;
|
|
11716
11725
|
}
|
|
11717
11726
|
createGeometry(t, e) {
|
|
11718
|
-
if (this.
|
|
11727
|
+
if (this.yo(), !this.uo) return null;
|
|
11719
11728
|
const {data: n, positionSize: i} = t;
|
|
11720
11729
|
return {
|
|
11721
11730
|
geometry: {
|
|
@@ -11739,7 +11748,7 @@
|
|
|
11739
11748
|
instance_vectorC: new Float32Array(4 * c),
|
|
11740
11749
|
aPickingId: []
|
|
11741
11750
|
};
|
|
11742
|
-
this.
|
|
11751
|
+
this.mo(u, i, r, o.properties.z, h, a);
|
|
11743
11752
|
const f = {};
|
|
11744
11753
|
for (const t in u) f[t] = {
|
|
11745
11754
|
buffer: this.regl.buffer({
|
|
@@ -11750,14 +11759,14 @@
|
|
|
11750
11759
|
};
|
|
11751
11760
|
const d = [], p = this.getSymbols();
|
|
11752
11761
|
for (let t = 0; t < p.length; t++) {
|
|
11753
|
-
const e = p[t], r = this.
|
|
11762
|
+
const e = p[t], r = this.fo[t];
|
|
11754
11763
|
if (!r) continue;
|
|
11755
|
-
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);
|
|
11756
11765
|
let g = 0;
|
|
11757
11766
|
r.forEach(t => {
|
|
11758
11767
|
const {geometry: i, nodeMatrix: r} = t, s = n.mat4.multiply(ml, m, r), o = i.boundingBox.copy();
|
|
11759
11768
|
o.transform(s);
|
|
11760
|
-
const a = this.
|
|
11769
|
+
const a = this.xo(o, e);
|
|
11761
11770
|
a > g && (g = a);
|
|
11762
11771
|
});
|
|
11763
11772
|
const v = [ 0, 0, g ], x = r.map(r => {
|
|
@@ -11793,7 +11802,7 @@
|
|
|
11793
11802
|
positionSize: a
|
|
11794
11803
|
}, d;
|
|
11795
11804
|
}
|
|
11796
|
-
|
|
11805
|
+
xo(t, e) {
|
|
11797
11806
|
const n = e.anchorZ || "bottom";
|
|
11798
11807
|
let i = 0;
|
|
11799
11808
|
return "bottom" === n ? i = -t.min[2] : "top" === n ? i = -t.max[2] : "center" === n && (i = -(t.min[2] + t.max[2]) / 2),
|
|
@@ -11804,7 +11813,7 @@
|
|
|
11804
11813
|
if (t[0].properties.level > 2) return null;
|
|
11805
11814
|
for (let e = 0; e < t.length; e++) {
|
|
11806
11815
|
if (!t[e] || !t[e].geometry) continue;
|
|
11807
|
-
const n = this.
|
|
11816
|
+
const n = this.po(t[e].properties.symbolIndex.index);
|
|
11808
11817
|
t[e].setUniform("skinAnimation", +n);
|
|
11809
11818
|
}
|
|
11810
11819
|
return this.scene.addMesh(t), this;
|
|
@@ -11814,12 +11823,12 @@
|
|
|
11814
11823
|
let n = !1;
|
|
11815
11824
|
for (let i = 0; i < e.length; i++) {
|
|
11816
11825
|
const r = e[i];
|
|
11817
|
-
if (!r || !this.
|
|
11818
|
-
if (this.
|
|
11826
|
+
if (!r || !this.do[i]) continue;
|
|
11827
|
+
if (this.po(i) && this.do[i]) {
|
|
11819
11828
|
n || (n = !0);
|
|
11820
11829
|
let e = r.speed;
|
|
11821
11830
|
const s = !!r.loop;
|
|
11822
|
-
ss(e) && (e = 1), this.
|
|
11831
|
+
ss(e) && (e = 1), this.do[i].updateAnimation(t.timestamp, s, e);
|
|
11823
11832
|
}
|
|
11824
11833
|
}
|
|
11825
11834
|
n && this.setToRedraw(!0), super.prepareRender(t);
|
|
@@ -11829,11 +11838,11 @@
|
|
|
11829
11838
|
this.shadowCount = this.scene.getMeshes().length;
|
|
11830
11839
|
return this.scene.getMeshes().filter(t => 0 === t.getUniform("level"));
|
|
11831
11840
|
}
|
|
11832
|
-
|
|
11841
|
+
po(t) {
|
|
11833
11842
|
const e = this.getSymbols()[t];
|
|
11834
|
-
return e && e.animation && this.
|
|
11843
|
+
return e && e.animation && this.do[t] && this.do[t].hasSkinAnimation();
|
|
11835
11844
|
}
|
|
11836
|
-
|
|
11845
|
+
mo(t, e, i, r, s, o) {
|
|
11837
11846
|
function a(e, n, i, r) {
|
|
11838
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];
|
|
11839
11848
|
}
|
|
@@ -11849,26 +11858,26 @@
|
|
|
11849
11858
|
return t.positionAttribute = "POSITION", t.normalAttribute = "NORMAL", t;
|
|
11850
11859
|
}
|
|
11851
11860
|
init(t) {
|
|
11852
|
-
super.init(t), this.
|
|
11861
|
+
super.init(t), this.yo();
|
|
11853
11862
|
}
|
|
11854
|
-
|
|
11855
|
-
if (this.
|
|
11856
|
-
this.
|
|
11863
|
+
yo() {
|
|
11864
|
+
if (this.do) return;
|
|
11865
|
+
this.do = [];
|
|
11857
11866
|
const t = this.layer.getRenderer(), e = this.getSymbols();
|
|
11858
|
-
this.
|
|
11867
|
+
this.bo = 0;
|
|
11859
11868
|
for (let i = 0; i < e.length; i++) {
|
|
11860
11869
|
const r = e[i].url;
|
|
11861
11870
|
if (t.isCachePlaced(r)) continue;
|
|
11862
11871
|
const s = t.fetchCache(r);
|
|
11863
|
-
s ? (this.
|
|
11872
|
+
s ? (this.do[i] = [ s ], this.fo[i] = s.getMeshesInfo(), this.bo++, t.addToCache(r)) : (t.placeCache(r),
|
|
11864
11873
|
n.reshader.GLTFHelper.load(r).then(s => {
|
|
11865
11874
|
const o = n.reshader.GLTFHelper.exportGLTFPack(s, this.regl);
|
|
11866
|
-
this.
|
|
11875
|
+
this.do[i] = [ o ], this.fo[i] = o.getMeshesInfo(), t.addToCache(r, o, t => {
|
|
11867
11876
|
t.dispose();
|
|
11868
|
-
}), this.
|
|
11877
|
+
}), this.bo++, this.bo >= e.length && (this.uo = !0), this.setToRedraw(!0);
|
|
11869
11878
|
}));
|
|
11870
11879
|
}
|
|
11871
|
-
this.
|
|
11880
|
+
this.bo >= e.length && (this.uo = !0);
|
|
11872
11881
|
}
|
|
11873
11882
|
getPickingVert() {
|
|
11874
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 }";
|
|
@@ -11882,15 +11891,15 @@
|
|
|
11882
11891
|
delete() {
|
|
11883
11892
|
super.delete();
|
|
11884
11893
|
const t = this.getSymbols()[0].url;
|
|
11885
|
-
if (this.layer.getRenderer().removeCache(t), this.
|
|
11886
|
-
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];
|
|
11887
11896
|
for (let n = 0; n < e.length; n++) {
|
|
11888
11897
|
const n = e[t], {geometry: i, materialInfo: r} = n;
|
|
11889
11898
|
if (i && i.dispose(), r) for (const t in r) r[t] && r[t].destroy && r[t].destroy();
|
|
11890
11899
|
}
|
|
11891
11900
|
}
|
|
11892
11901
|
}
|
|
11893
|
-
|
|
11902
|
+
vo(t, e, i, r) {
|
|
11894
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]);
|
|
11895
11904
|
return n.mat4.fromRotationTranslationScale(t, l, s, a);
|
|
11896
11905
|
}
|
|
@@ -11932,8 +11941,8 @@
|
|
|
11932
11941
|
}
|
|
11933
11942
|
callShader(t, e) {
|
|
11934
11943
|
super.callShader(t, e), this.transformWater();
|
|
11935
|
-
const n = this.
|
|
11936
|
-
this.renderer.render(this.
|
|
11944
|
+
const n = this.wo(this.getMap(), e);
|
|
11945
|
+
this.renderer.render(this.Ao, n, this._o, this.getRenderFBO(e));
|
|
11937
11946
|
}
|
|
11938
11947
|
addMesh(t, e) {
|
|
11939
11948
|
this.sr(t, e), super.addMesh(...arguments);
|
|
@@ -11943,14 +11952,14 @@
|
|
|
11943
11952
|
for (let n = 0; n < t.length; n++) t[n].ssr = e ? 1 : 0;
|
|
11944
11953
|
}
|
|
11945
11954
|
paint(t) {
|
|
11946
|
-
t.states && t.states.includesChanged && (this.shader.dispose(), this.
|
|
11955
|
+
t.states && t.states.includesChanged && (this.shader.dispose(), this.Ao.dispose(),
|
|
11947
11956
|
this.nr(t));
|
|
11948
|
-
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;
|
|
11949
11958
|
if (e) {
|
|
11950
11959
|
const e = ns({}, i, t.ssr.defines);
|
|
11951
11960
|
n.shaderDefines = e;
|
|
11952
11961
|
}
|
|
11953
|
-
this.updateIBLDefines(n), this.
|
|
11962
|
+
this.updateIBLDefines(n), this.Mo.ssr = e ? 1 : 0, super.paint(t), e && (n.shaderDefines = i);
|
|
11954
11963
|
}
|
|
11955
11964
|
init(t) {
|
|
11956
11965
|
this.createIBLTextures();
|
|
@@ -11968,38 +11977,38 @@
|
|
|
11968
11977
|
extraCommandProps: {
|
|
11969
11978
|
viewport: this.pickingViewport
|
|
11970
11979
|
}
|
|
11971
|
-
}, this.pickingFBO) ]), this.
|
|
11980
|
+
}, this.pickingFBO) ]), this.So();
|
|
11972
11981
|
}
|
|
11973
|
-
|
|
11982
|
+
So() {
|
|
11974
11983
|
const t = this.regl;
|
|
11975
|
-
this.
|
|
11984
|
+
this.ko = t.texture(2), this.Po = [ 2, 2 ];
|
|
11976
11985
|
const e = this.getSymbol({
|
|
11977
11986
|
index: 0
|
|
11978
11987
|
}), n = e.texWaveNormal, i = this.getCachedTexture(n), r = this;
|
|
11979
|
-
if (i) i.loading || (this.
|
|
11988
|
+
if (i) i.loading || (this.To = this.Oo(t, i)); else {
|
|
11980
11989
|
const e = new Image;
|
|
11981
11990
|
e.loading = !0, e.onload = function() {
|
|
11982
|
-
delete this.loading, r.
|
|
11991
|
+
delete this.loading, r.To = r.Oo(t, this), this.Po = [ this.width, this.height ],
|
|
11983
11992
|
r.setToRedraw();
|
|
11984
11993
|
}, e.onerror = () => {
|
|
11985
11994
|
console.error("invalid water wave normal texture:" + n);
|
|
11986
11995
|
}, this.addCachedTexture(n, e), e.src = n;
|
|
11987
11996
|
}
|
|
11988
11997
|
const s = e.texWavePerturbation, o = this.getCachedTexture(s);
|
|
11989
|
-
if (o) o.loading || (this.
|
|
11998
|
+
if (o) o.loading || (this.Fo = this.Oo(t, o)); else {
|
|
11990
11999
|
const e = new Image;
|
|
11991
12000
|
e.loading = !0, e.onload = function() {
|
|
11992
|
-
delete this.loading, r.
|
|
12001
|
+
delete this.loading, r.Fo = r.Oo(t, this), this.Po = [ this.width, this.height ],
|
|
11993
12002
|
r.setToRedraw();
|
|
11994
12003
|
}, e.onerror = () => {
|
|
11995
12004
|
console.error("invalid water wave perturbation texture:" + s);
|
|
11996
12005
|
}, this.addCachedTexture(s, e), e.src = s;
|
|
11997
12006
|
}
|
|
11998
12007
|
}
|
|
11999
|
-
|
|
12000
|
-
return this.
|
|
12001
|
-
width: this.
|
|
12002
|
-
height: this.
|
|
12008
|
+
Oo(t, e) {
|
|
12009
|
+
return this.ko ? t.texture({
|
|
12010
|
+
width: this.Po[0],
|
|
12011
|
+
height: this.Po[1],
|
|
12003
12012
|
mag: "linear",
|
|
12004
12013
|
min: "linear mipmap linear",
|
|
12005
12014
|
wrapS: "repeat",
|
|
@@ -12096,7 +12105,7 @@
|
|
|
12096
12105
|
enable: !1
|
|
12097
12106
|
}
|
|
12098
12107
|
};
|
|
12099
|
-
i.push(...n.reshader.SsrPass.getUniformDeclares()), this.
|
|
12108
|
+
i.push(...n.reshader.SsrPass.getUniformDeclares()), this.Ao = new n.reshader.MeshShader({
|
|
12100
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}",
|
|
12101
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}",
|
|
12102
12111
|
defines: r,
|
|
@@ -12117,10 +12126,10 @@
|
|
|
12117
12126
|
};
|
|
12118
12127
|
return this.setIncludeUniformValues(i, e), i;
|
|
12119
12128
|
}
|
|
12120
|
-
|
|
12129
|
+
wo(t, e) {
|
|
12121
12130
|
const {iblTexes: n} = this.getIBLRes(), i = t.projViewMatrix, r = t.getLightManager();
|
|
12122
12131
|
let s = r && r.getDirectionalLight() || {};
|
|
12123
|
-
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 = {
|
|
12124
12133
|
hdrHsv: o.hsv || [ 0, 0, 0 ],
|
|
12125
12134
|
specularPBR: n && n.prefilterMap,
|
|
12126
12135
|
rgbmRange: n && n.rgbmRange,
|
|
@@ -12134,8 +12143,8 @@
|
|
|
12134
12143
|
lightColor: s.color || bl.color,
|
|
12135
12144
|
camPos: t.cameraPosition,
|
|
12136
12145
|
timeElapsed: a.animation ? (this.layer.getRenderer().getFrameTimestamp() || 0) / (1 / (a.waterSpeed || 1) * 1e4) : 0,
|
|
12137
|
-
normalTexture: this.
|
|
12138
|
-
heightTexture: this.
|
|
12146
|
+
normalTexture: this.To || this.ko,
|
|
12147
|
+
heightTexture: this.Fo || this.ko,
|
|
12139
12148
|
waveParams: [ .09, a.uvScale || 3, .03, -.5 ],
|
|
12140
12149
|
waterDir: Ml(l, a.waterDirection || 0),
|
|
12141
12150
|
waterBaseColor: a.waterBaseColor || [ .1451, .2588, .4863, 1 ],
|
|
@@ -12146,24 +12155,24 @@
|
|
|
12146
12155
|
h;
|
|
12147
12156
|
}
|
|
12148
12157
|
delete() {
|
|
12149
|
-
super.delete(), this.
|
|
12150
|
-
this.
|
|
12151
|
-
this.
|
|
12152
|
-
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();
|
|
12153
12162
|
}
|
|
12154
12163
|
createGround() {
|
|
12155
12164
|
const t = new n.reshader.Plane;
|
|
12156
12165
|
t.data.aTexCoord = new Uint8Array([ 0, 1, 1, 1, 0, 0, 1, 0 ]), t.generateBuffers(this.renderer.regl),
|
|
12157
|
-
this.
|
|
12166
|
+
this.Mo = new n.reshader.Mesh(t, null, {
|
|
12158
12167
|
castShadow: !1
|
|
12159
|
-
}), this.
|
|
12168
|
+
}), this._o = new n.reshader.Scene([ this.Mo ]);
|
|
12160
12169
|
}
|
|
12161
12170
|
transformWater() {
|
|
12162
|
-
const t = this.getMap(), e = n.GroundPainter.getGroundTransform(this.
|
|
12163
|
-
this.
|
|
12164
|
-
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.
|
|
12165
|
-
this.
|
|
12166
|
-
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 ]);
|
|
12167
12176
|
}
|
|
12168
12177
|
}
|
|
12169
12178
|
function Ml(t, e) {
|
|
@@ -12194,7 +12203,7 @@
|
|
|
12194
12203
|
Hl.registerAt(Qi);
|
|
12195
12204
|
const Dl = ts("gltf-lit", xl);
|
|
12196
12205
|
Dl.registerAt(Qi);
|
|
12197
|
-
const
|
|
12206
|
+
const Ll = ts("heatmap", class extends Vs {
|
|
12198
12207
|
createFnTypeConfig(t, e) {
|
|
12199
12208
|
const n = M(e.heatWeight), i = new Int16Array(1);
|
|
12200
12209
|
return [ {
|
|
@@ -12235,7 +12244,7 @@
|
|
|
12235
12244
|
o;
|
|
12236
12245
|
}
|
|
12237
12246
|
callRenderer(t, e) {
|
|
12238
|
-
this.
|
|
12247
|
+
this.Co.render(this.scene, t, this.getRenderFBO(e));
|
|
12239
12248
|
}
|
|
12240
12249
|
getUniformValues(t) {
|
|
12241
12250
|
const {projViewMatrix: e} = t;
|
|
@@ -12249,7 +12258,7 @@
|
|
|
12249
12258
|
return this.scene.getMeshes();
|
|
12250
12259
|
}
|
|
12251
12260
|
delete() {
|
|
12252
|
-
super.delete(...arguments), this.
|
|
12261
|
+
super.delete(...arguments), this.Co.dispose(), delete this.Co;
|
|
12253
12262
|
}
|
|
12254
12263
|
init() {
|
|
12255
12264
|
const t = this.regl;
|
|
@@ -12268,14 +12277,14 @@
|
|
|
12268
12277
|
zpass: "replace"
|
|
12269
12278
|
}
|
|
12270
12279
|
}, r = this.getPolygonOffset(), s = this.getSymbols()[0];
|
|
12271
|
-
this.
|
|
12280
|
+
this.Co = new n.HeatmapProcess(this.regl, this.sceneConfig, this.layer, s.heatmapColor, i, r);
|
|
12272
12281
|
}
|
|
12273
12282
|
});
|
|
12274
|
-
|
|
12275
|
-
const
|
|
12276
|
-
|
|
12283
|
+
Ll.registerAt(Qi);
|
|
12284
|
+
const Rl = ts("water", _l);
|
|
12285
|
+
Rl.registerAt(Qi), cr.registerPainter("lit", ll), cr.registerPainter("icon", ya),
|
|
12277
12286
|
cr.registerPainter("fill", Ws), cr.registerPainter("line", Xs), cr.registerPainter("line-gradient", qs),
|
|
12278
|
-
cr.registerPainter("water", _l), Qi.VERSION = "0.63.
|
|
12287
|
+
cr.registerPainter("water", _l), Qi.VERSION = "0.63.8", cr.VERSION = "0.63.8";
|
|
12279
12288
|
if (s.mat4.create(), s.transcoders) {
|
|
12280
12289
|
const t = r.Map.VERSION;
|
|
12281
12290
|
if (t.indexOf("1.0.0-beta") >= 0 || t.indexOf("1.0.0-alpha") >= 0) {
|
|
@@ -12286,14 +12295,14 @@
|
|
|
12286
12295
|
}));
|
|
12287
12296
|
} else r.registerWorkerAdapter("@maptalks/vt", o);
|
|
12288
12297
|
t.FillPainter = Ws, t.FillPlugin = Sl, t.GLTFPhongPlugin = Hl, t.GLTFStandardPlugin = Dl,
|
|
12289
|
-
t.GeoJSONVectorTileLayer = ar, t.HeatmapPlugin =
|
|
12298
|
+
t.GeoJSONVectorTileLayer = ar, t.HeatmapPlugin = Ll, t.IconPainter = ya, t.IconPlugin = Tl,
|
|
12290
12299
|
t.LineGradientPlugin = Pl, t.LinePainter = Xs, t.LinePlugin = kl, t.LineStringLayer = Ir,
|
|
12291
12300
|
t.LitPlugin = El, t.MapboxVectorTileLayer = sr, t.NativeLinePainter = Za, t.NativeLinePlugin = Fl,
|
|
12292
12301
|
t.NativePointPainter = Ya, t.PackUtil = Pi, t.PhongPainter = il, t.PhongPlugin = Il,
|
|
12293
12302
|
t.PointLayer = Fr, t.PolygonLayer = Cr, t.SYMBOLS_NEED_REBUILD_IN_VECTOR = Fi, t.SYMBOLS_NEED_REBUILD_IN_VT = Oi,
|
|
12294
12303
|
t.TextPainter = Ua, t.TextPlugin = Ol, t.Vector3DLayer = cr, t.VectorTileLayer = Qi,
|
|
12295
|
-
t.VectorTileLayerRenderer = ji, t.WaterPlugin =
|
|
12304
|
+
t.VectorTileLayerRenderer = ji, t.WaterPlugin = Rl, t.WireframePainter = sl, t.WireframePlugin = Cl,
|
|
12296
12305
|
Object.defineProperty(t, "t", {
|
|
12297
12306
|
value: !0
|
|
12298
|
-
}), "undefined" != typeof console && console.log("@maptalks/vt v0.63.
|
|
12307
|
+
}), "undefined" != typeof console && console.log("@maptalks/vt v0.63.8");
|
|
12299
12308
|
}));
|