@maptalks/vt 0.92.1 → 0.92.3
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.es.js +389 -373
- package/dist/maptalks.vt.js +636 -621
- package/package.json +5 -5
package/dist/maptalks.vt.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @maptalks/vt v0.92.
|
|
2
|
+
* @maptalks/vt v0.92.3
|
|
3
3
|
* LICENSE : undefined
|
|
4
4
|
* (c) 2016-2024 maptalks.org
|
|
5
5
|
*/
|
|
@@ -267,8 +267,8 @@
|
|
|
267
267
|
return n / 100 / 100;
|
|
268
268
|
}
|
|
269
269
|
"undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
|
|
270
|
-
var
|
|
271
|
-
function
|
|
270
|
+
var z = L;
|
|
271
|
+
function L(t, e) {
|
|
272
272
|
this.x = t, this.y = e;
|
|
273
273
|
}
|
|
274
274
|
function H(t, e, n) {
|
|
@@ -282,9 +282,9 @@
|
|
|
282
282
|
this.id = t, this.x = e, this.y = n, this.w = i, this.h = r, this.maxw = s || i,
|
|
283
283
|
this.maxh = o || r, this.refcount = 0;
|
|
284
284
|
}
|
|
285
|
-
|
|
285
|
+
L.prototype = {
|
|
286
286
|
clone: function() {
|
|
287
|
-
return new
|
|
287
|
+
return new L(this.x, this.y);
|
|
288
288
|
},
|
|
289
289
|
add: function(t) {
|
|
290
290
|
return this.clone().o(t);
|
|
@@ -387,8 +387,8 @@
|
|
|
387
387
|
O: function() {
|
|
388
388
|
return this.x = Math.round(this.x), this.y = Math.round(this.y), this;
|
|
389
389
|
}
|
|
390
|
-
},
|
|
391
|
-
return t instanceof
|
|
390
|
+
}, L.convert = function(t) {
|
|
391
|
+
return t instanceof L ? t : Array.isArray(t) ? new L(t[0], t[1]) : t;
|
|
392
392
|
}, H.prototype.pack = function(t, e) {
|
|
393
393
|
t = [].concat(t), e = e || {};
|
|
394
394
|
for (var n, i, r, s, o = [], a = 0; a < t.length; a++) if (n = t[a].w || t[a].width,
|
|
@@ -1318,7 +1318,7 @@
|
|
|
1318
1318
|
if (!t) return "true";
|
|
1319
1319
|
const e = t[0];
|
|
1320
1320
|
if (t.length <= 1) return "any" === e ? "false" : "true";
|
|
1321
|
-
return `(${"==" === e ? Rt(t[1], t[2], "===", !1) : "!=" === e ? Rt(t[1], t[2], "!==", !1) : "<" === e || ">" === e || "<=" === e || ">=" === e ? Rt(t[1], t[2], e, !0) : "any" === e ?
|
|
1321
|
+
return `(${"==" === e ? Rt(t[1], t[2], "===", !1) : "!=" === e ? Rt(t[1], t[2], "!==", !1) : "<" === e || ">" === e || "<=" === e || ">=" === e ? Rt(t[1], t[2], e, !0) : "any" === e ? Lt(t.slice(1), "||") : "all" === e ? Lt(t.slice(1), "&&") : "none" === e ? Vt(Lt(t.slice(1), "||")) : "in" === e ? Ht(t[1], t.slice(2)) : "!in" === e ? Vt(Ht(t[1], t.slice(2))) : "has" === e ? Ut(t[1]) : "!has" === e ? Vt(Ut(t[1])) : "contains" === e ? function(t, e, n) {
|
|
1322
1322
|
const i = Nt(t);
|
|
1323
1323
|
return void 0 !== n ? `(${i} + '').indexOf("${e}") === ${n}` : `(${i} + '').indexOf("${e}") >= 0`;
|
|
1324
1324
|
}(t[1], t[2], t[3]) : "true"})`;
|
|
@@ -1331,16 +1331,16 @@
|
|
|
1331
1331
|
const r = t.property, s = t.op;
|
|
1332
1332
|
let o = Nt(r);
|
|
1333
1333
|
return "length" !== s ? (console.error(`not support ${s} op`), "false") : (o = `((${o}+='').length)`,
|
|
1334
|
-
|
|
1334
|
+
zt(o, r, e, n, i));
|
|
1335
1335
|
}(t, e, n, i);
|
|
1336
1336
|
var r;
|
|
1337
|
-
return
|
|
1337
|
+
return zt(Nt(t), t, e, n, i);
|
|
1338
1338
|
}
|
|
1339
|
-
function
|
|
1339
|
+
function zt(t, e, n, i, r) {
|
|
1340
1340
|
const s = "$type" === e ? Ct.indexOf(n) : JSON.stringify(n);
|
|
1341
1341
|
return (r ? `typeof ${t}=== typeof ${s}&&` : "") + t + i + s;
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1343
|
+
function Lt(t, e) {
|
|
1344
1344
|
return t.map(Dt).join(e);
|
|
1345
1345
|
}
|
|
1346
1346
|
function Ht(t, e) {
|
|
@@ -1626,7 +1626,7 @@
|
|
|
1626
1626
|
}(t, i, r, s);
|
|
1627
1627
|
for (var a, l, h = t; t.prev !== t.next; ) if (a = t.prev, l = t.next, s ? Re(t, i, r, s) : Ne(t)) e.push(a.i / n | 0),
|
|
1628
1628
|
e.push(t.i / n | 0), e.push(l.i / n | 0), tn(t), t = l.next, h = l.next; else if ((t = l) === h) {
|
|
1629
|
-
o ? 1 === o ? De(t =
|
|
1629
|
+
o ? 1 === o ? De(t = ze(Ee(t), e, n), e, n, i, r, s, 2) : 2 === o && Le(t, e, n, i, r, s) : De(Ee(t), e, n, i, r, s, 1);
|
|
1630
1630
|
break;
|
|
1631
1631
|
}
|
|
1632
1632
|
}
|
|
@@ -1658,7 +1658,7 @@
|
|
|
1658
1658
|
}
|
|
1659
1659
|
return !0;
|
|
1660
1660
|
}
|
|
1661
|
-
function
|
|
1661
|
+
function ze(t, e, n) {
|
|
1662
1662
|
var i = t;
|
|
1663
1663
|
do {
|
|
1664
1664
|
var r = i.prev, s = i.next.next;
|
|
@@ -1667,7 +1667,7 @@
|
|
|
1667
1667
|
} while (i !== t);
|
|
1668
1668
|
return Ee(i);
|
|
1669
1669
|
}
|
|
1670
|
-
function
|
|
1670
|
+
function Le(t, e, n, i, r, s) {
|
|
1671
1671
|
var o = t;
|
|
1672
1672
|
do {
|
|
1673
1673
|
for (var a = o.next.next; a !== o.prev; ) {
|
|
@@ -1856,12 +1856,12 @@
|
|
|
1856
1856
|
}
|
|
1857
1857
|
}
|
|
1858
1858
|
function ln(t, e) {
|
|
1859
|
-
const n = new
|
|
1859
|
+
const n = new z(t[0], t[1]);
|
|
1860
1860
|
n.z = 100 * (t[2] || 0), e.push([ n ]);
|
|
1861
1861
|
}
|
|
1862
1862
|
function hn(t, e) {
|
|
1863
1863
|
for (let n = 0; n < t.length; n++) {
|
|
1864
|
-
const i = new
|
|
1864
|
+
const i = new z(t[n][0], t[n][1]);
|
|
1865
1865
|
i.z = 100 * (t[n][2] || 0), e.push(i);
|
|
1866
1866
|
}
|
|
1867
1867
|
}
|
|
@@ -2123,16 +2123,16 @@
|
|
|
2123
2123
|
function Rn(t) {
|
|
2124
2124
|
return t && x(t) && t.property;
|
|
2125
2125
|
}
|
|
2126
|
-
function
|
|
2126
|
+
function zn(t) {
|
|
2127
2127
|
const {verticalCentimeterToPoint: e, tileRatio: n} = t;
|
|
2128
2128
|
return e * n;
|
|
2129
2129
|
}
|
|
2130
|
-
const
|
|
2130
|
+
const Ln = {};
|
|
2131
2131
|
function Hn(t, e) {
|
|
2132
2132
|
if (!Array.isArray(e)) {
|
|
2133
2133
|
if (e && void 0 !== e.r && void 0 !== e.g && void 0 !== e.b) return t[0] = 255 * e.r,
|
|
2134
2134
|
t[1] = 255 * e.g, t[2] = 255 * e.b, t[3] = void 0 !== e.a ? 255 * e.a : 255, t;
|
|
2135
|
-
e =
|
|
2135
|
+
e = Ln[e] = Ln[e] || It(e).unitArray();
|
|
2136
2136
|
}
|
|
2137
2137
|
for (let n = 0; n < e.length; n++) t[n] = 255 * e[n];
|
|
2138
2138
|
return 3 === e.length && (t[3] = 255), t;
|
|
@@ -2189,7 +2189,7 @@
|
|
|
2189
2189
|
return Cn(t) ? t(void 0 !== n ? n : null, e) : t;
|
|
2190
2190
|
},
|
|
2191
2191
|
isFnTypeSymbol: Rn,
|
|
2192
|
-
getAltitudeToLocal:
|
|
2192
|
+
getAltitudeToLocal: zn,
|
|
2193
2193
|
getTubeSizeScale: function(t) {
|
|
2194
2194
|
return "centimeter" === t || "cm" === t ? 1 : "millimeter" === t || "mm" === t ? .1 : 100;
|
|
2195
2195
|
},
|
|
@@ -2755,10 +2755,10 @@
|
|
|
2755
2755
|
return [ "image", this.name ];
|
|
2756
2756
|
}
|
|
2757
2757
|
}
|
|
2758
|
-
function
|
|
2758
|
+
function zi(t, e, n, i) {
|
|
2759
2759
|
return "number" == typeof t && t >= 0 && t <= 255 && "number" == typeof e && e >= 0 && e <= 255 && "number" == typeof n && n >= 0 && n <= 255 ? void 0 === i || "number" == typeof i && i >= 0 && i <= 1 ? null : `Invalid rgba value [${[ t, e, n, i ].join(", ")}]: 'a' must be between 0 and 1.` : `Invalid rgba value [${("number" == typeof i ? [ t, e, n, i ] : [ t, e, n ]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`;
|
|
2760
2760
|
}
|
|
2761
|
-
function
|
|
2761
|
+
function Li(t) {
|
|
2762
2762
|
if (null === t) return !0;
|
|
2763
2763
|
if ("string" == typeof t) return !0;
|
|
2764
2764
|
if ("boolean" == typeof t) return !0;
|
|
@@ -2768,11 +2768,11 @@
|
|
|
2768
2768
|
if (t instanceof Ni) return !0;
|
|
2769
2769
|
if (t instanceof Ri) return !0;
|
|
2770
2770
|
if (Array.isArray(t)) {
|
|
2771
|
-
for (const e of t) if (!
|
|
2771
|
+
for (const e of t) if (!Li(e)) return !1;
|
|
2772
2772
|
return !0;
|
|
2773
2773
|
}
|
|
2774
2774
|
if ("object" == typeof t) {
|
|
2775
|
-
for (const e in t) if (!
|
|
2775
|
+
for (const e in t) if (!Li(t[e])) return !1;
|
|
2776
2776
|
return !0;
|
|
2777
2777
|
}
|
|
2778
2778
|
return !1;
|
|
@@ -2812,7 +2812,7 @@
|
|
|
2812
2812
|
}
|
|
2813
2813
|
static parse(t, e) {
|
|
2814
2814
|
if (2 !== t.length) return e.error(`'literal' expression requires exactly one argument, but found ${t.length - 1} instead.`);
|
|
2815
|
-
if (!
|
|
2815
|
+
if (!Li(t[1])) return e.error("invalid value");
|
|
2816
2816
|
const n = t[1];
|
|
2817
2817
|
let i = Hi(n);
|
|
2818
2818
|
const r = e.expectedType;
|
|
@@ -3017,7 +3017,7 @@
|
|
|
3017
3017
|
if ("string" == typeof e) {
|
|
3018
3018
|
const n = t.parseColor(e);
|
|
3019
3019
|
if (n) return n;
|
|
3020
|
-
} else if (Array.isArray(e) && (n = e.length < 3 || e.length > 4 ? `Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.` :
|
|
3020
|
+
} else if (Array.isArray(e) && (n = e.length < 3 || e.length > 4 ? `Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.` : zi(e[0], e[1], e[2], e[3]),
|
|
3021
3021
|
!n)) return new Ci(e[0] / 255, e[1] / 255, e[2] / 255, e[3]);
|
|
3022
3022
|
}
|
|
3023
3023
|
throw new Bi(n || `Could not parse color from value '${"string" == typeof e ? e : String(JSON.stringify(e))}'`);
|
|
@@ -3289,7 +3289,7 @@
|
|
|
3289
3289
|
}
|
|
3290
3290
|
static parse(t, e) {
|
|
3291
3291
|
if (2 !== t.length) return e.error(`'within' expression requires exactly one argument, but found ${t.length - 1} instead.`);
|
|
3292
|
-
if (
|
|
3292
|
+
if (Li(t[1])) {
|
|
3293
3293
|
const e = t[1];
|
|
3294
3294
|
if ("FeatureCollection" === e.type) for (let t = 0; t < e.features.length; ++t) {
|
|
3295
3295
|
const n = e.features[t].geometry.type;
|
|
@@ -3565,10 +3565,10 @@
|
|
|
3565
3565
|
}
|
|
3566
3566
|
});
|
|
3567
3567
|
const Dr = 6 / 29 * 3 * (6 / 29), Nr = Math.PI / 180, Rr = 180 / Math.PI;
|
|
3568
|
-
function
|
|
3568
|
+
function zr(t) {
|
|
3569
3569
|
return t > .008856451679035631 ? Math.pow(t, 1 / 3) : t / Dr + 4 / 29;
|
|
3570
3570
|
}
|
|
3571
|
-
function
|
|
3571
|
+
function Lr(t) {
|
|
3572
3572
|
return t > 6 / 29 ? t * t * t : Dr * (t - 4 / 29);
|
|
3573
3573
|
}
|
|
3574
3574
|
function Hr(t) {
|
|
@@ -3578,17 +3578,17 @@
|
|
|
3578
3578
|
return (t /= 255) <= .04045 ? t / 12.92 : Math.pow((t + .055) / 1.055, 2.4);
|
|
3579
3579
|
}
|
|
3580
3580
|
function Vr(t) {
|
|
3581
|
-
const e = Ur(t.r), n = Ur(t.g), i = Ur(t.b), r =
|
|
3581
|
+
const e = Ur(t.r), n = Ur(t.g), i = Ur(t.b), r = zr((.4124564 * e + .3575761 * n + .1804375 * i) / .95047), s = zr((.2126729 * e + .7151522 * n + .072175 * i) / 1);
|
|
3582
3582
|
return {
|
|
3583
3583
|
l: 116 * s - 16,
|
|
3584
3584
|
a: 500 * (r - s),
|
|
3585
|
-
b: 200 * (s -
|
|
3585
|
+
b: 200 * (s - zr((.0193339 * e + .119192 * n + .9503041 * i) / 1.08883)),
|
|
3586
3586
|
alpha: t.a
|
|
3587
3587
|
};
|
|
3588
3588
|
}
|
|
3589
3589
|
function jr(t) {
|
|
3590
3590
|
let e = (t.l + 16) / 116, n = isNaN(t.a) ? e : e + t.a / 500, i = isNaN(t.b) ? e : e - t.b / 200;
|
|
3591
|
-
return e = 1 *
|
|
3591
|
+
return e = 1 * Lr(e), n = .95047 * Lr(n), i = 1.08883 * Lr(i), new Ci(Hr(3.2404542 * n - 1.5371385 * e - .4985314 * i), Hr(-.969266 * n + 1.8760108 * e + .041556 * i), Hr(.0556434 * n - .2040259 * e + 1.0572252 * i), t.alpha);
|
|
3592
3592
|
}
|
|
3593
3593
|
function Br(t, e, n) {
|
|
3594
3594
|
const i = e - t;
|
|
@@ -4223,7 +4223,7 @@
|
|
|
4223
4223
|
};
|
|
4224
4224
|
function _s(t, [e, n, i, r]) {
|
|
4225
4225
|
e = e.evaluate(t), n = n.evaluate(t), i = i.evaluate(t);
|
|
4226
|
-
const s = r ? r.evaluate(t) : 1, o =
|
|
4226
|
+
const s = r ? r.evaluate(t) : 1, o = zi(e, n, i, s);
|
|
4227
4227
|
if (o) throw new Bi(o);
|
|
4228
4228
|
return new Ci(e / 255 * s, n / 255 * s, i / 255 * s, s);
|
|
4229
4229
|
}
|
|
@@ -4410,7 +4410,7 @@
|
|
|
4410
4410
|
function Rs(t, e, n, i, r) {
|
|
4411
4411
|
return Ns(typeof n === r ? i[n] : void 0, t.default, e.default);
|
|
4412
4412
|
}
|
|
4413
|
-
function
|
|
4413
|
+
function zs(t, e, n) {
|
|
4414
4414
|
if ("number" !== Cs(n)) return Ns(t.default, e.default);
|
|
4415
4415
|
const i = t.stops.length;
|
|
4416
4416
|
if (1 === i) return t.stops[0][1];
|
|
@@ -4419,7 +4419,7 @@
|
|
|
4419
4419
|
const r = Pr(t.stops.map(t => t[0]), n);
|
|
4420
4420
|
return t.stops[r][1];
|
|
4421
4421
|
}
|
|
4422
|
-
function
|
|
4422
|
+
function Ls(t, e, n) {
|
|
4423
4423
|
const i = void 0 !== t.base ? t.base : 1;
|
|
4424
4424
|
if ("number" !== Cs(n)) return Ns(t.default, e.default);
|
|
4425
4425
|
const r = t.stops.length;
|
|
@@ -4552,7 +4552,7 @@
|
|
|
4552
4552
|
if (i && ((e = ri({}, e)).stops && (e.stops = e.stops.map(t => [ t[0], Ci.parse(t[1]) ])),
|
|
4553
4553
|
e.default = Ci.parse(e.default ? e.default : n.default)), e.colorSpace && "rgb" !== e.colorSpace && !$r[e.colorSpace]) throw new Error("Unknown color space: " + e.colorSpace);
|
|
4554
4554
|
let a, l, h;
|
|
4555
|
-
if ("exponential" === o) a =
|
|
4555
|
+
if ("exponential" === o) a = Ls; else if ("interval" === o) a = zs; else if ("categorical" === o) {
|
|
4556
4556
|
a = Rs, l = Object.create(null);
|
|
4557
4557
|
for (const t of e.stops) l[t[0]] = t[1];
|
|
4558
4558
|
h = typeof e.stops[0][0];
|
|
@@ -4582,7 +4582,7 @@
|
|
|
4582
4582
|
interpolationType: o,
|
|
4583
4583
|
interpolationFactor: qr.interpolationFactor.bind(void 0, o),
|
|
4584
4584
|
zoomStops: s.map(t => t[0]),
|
|
4585
|
-
evaluate: ({zoom: t}, i) =>
|
|
4585
|
+
evaluate: ({zoom: t}, i) => Ls({
|
|
4586
4586
|
stops: s,
|
|
4587
4587
|
base: e.base
|
|
4588
4588
|
}, n, t).evaluate(t, i)
|
|
@@ -5045,7 +5045,7 @@
|
|
|
5045
5045
|
if (Array.isArray(r.geometry) && r.properties) {
|
|
5046
5046
|
let e = r.geometry[0];
|
|
5047
5047
|
for (;Array.isArray(e); ) e = e[0];
|
|
5048
|
-
e instanceof
|
|
5048
|
+
e instanceof z && (n = t);
|
|
5049
5049
|
}
|
|
5050
5050
|
if (!n) if (n = [], Array.isArray(r.geometry)) for (let e = 0; e < t.length; e++) {
|
|
5051
5051
|
const i = Pn({}, t[e]);
|
|
@@ -5359,16 +5359,16 @@
|
|
|
5359
5359
|
if (2 !== n.length || "get" !== n[0]) for (let i = 0; i < n.length; i++) 2 === n[i].length && "get" === n[i][0] ? e.push(n[i][1]) : Array.isArray(n[i]) && t(e, n[i]); else e.push(n[1]);
|
|
5360
5360
|
}
|
|
5361
5361
|
});
|
|
5362
|
-
const Co = t => t >= 11904 && t <= 12031, Eo = t => t >= 12032 && t <= 12255, Do = t => t >= 12272 && t <= 12287, No = t => t >= 12288 && t <= 12351, Ro = t => t >= 12352 && t <= 12447,
|
|
5362
|
+
const Co = t => t >= 11904 && t <= 12031, Eo = t => t >= 12032 && t <= 12255, Do = t => t >= 12272 && t <= 12287, No = t => t >= 12288 && t <= 12351, Ro = t => t >= 12352 && t <= 12447, zo = t => t >= 12448 && t <= 12543, Lo = t => t >= 12544 && t <= 12591, Ho = t => t >= 12704 && t <= 12735, Uo = t => t >= 12736 && t <= 12783, Vo = t => t >= 12784 && t <= 12799, jo = t => t >= 12800 && t <= 13055, Bo = t => t >= 13056 && t <= 13311, Go = t => t >= 13312 && t <= 19903, Wo = t => t >= 19968 && t <= 40959, $o = t => t >= 40960 && t <= 42127, Xo = t => t >= 42128 && t <= 42191, Yo = t => t >= 63744 && t <= 64255, qo = t => t >= 64336 && t <= 65023, Jo = t => t >= 65040 && t <= 65055, Ko = t => t >= 65072 && t <= 65103, Zo = t => t >= 65104 && t <= 65135, Qo = t => t >= 65136 && t <= 65279, ta = t => t >= 65280 && t <= 65519;
|
|
5363
5363
|
function ea(t) {
|
|
5364
5364
|
return !((t => t >= 1536 && t <= 1791)(t) || (t => t >= 1872 && t <= 1919)(t) || (t => t >= 2208 && t <= 2303)(t) || qo(t) || Qo(t));
|
|
5365
5365
|
}
|
|
5366
5366
|
function na(t) {
|
|
5367
|
-
return !!(746 === t || 747 === t || !(t < 4352) && (Ho(t) ||
|
|
5367
|
+
return !!(746 === t || 747 === t || !(t < 4352) && (Ho(t) || Lo(t) || Ko(t) && !(t >= 65097 && t <= 65103) || Yo(t) || Bo(t) || Co(t) || Uo(t) || !(!No(t) || t >= 12296 && t <= 12305 || t >= 12308 && t <= 12319 || 12336 === t) || Go(t) || Wo(t) || jo(t) || (t => t >= 12592 && t <= 12687)(t) || (t => t >= 43360 && t <= 43391)(t) || (t => t >= 55216 && t <= 55295)(t) || (t => t >= 4352 && t <= 4607)(t) || (t => t >= 44032 && t <= 55215)(t) || Ro(t) || Do(t) || (t => t >= 12688 && t <= 12703)(t) || Eo(t) || Vo(t) || zo(t) && 12540 !== t || !(!ta(t) || 65288 === t || 65289 === t || 65293 === t || t >= 65306 && t <= 65310 || 65339 === t || 65341 === t || 65343 === t || t >= 65371 && t <= 65503 || 65507 === t || t >= 65512 && t <= 65519) || !(!Zo(t) || t >= 65112 && t <= 65118 || t >= 65123 && t <= 65126) || (t => t >= 5120 && t <= 5759)(t) || (t => t >= 6320 && t <= 6399)(t) || Jo(t) || (t => t >= 19904 && t <= 19967)(t) || $o(t) || Xo(t)));
|
|
5368
5368
|
}
|
|
5369
5369
|
function ia(t) {
|
|
5370
5370
|
return !(na(t) || function(t) {
|
|
5371
|
-
return !!((t => t >= 128 && t <= 255)(t) && (167 === t || 169 === t || 174 === t || 177 === t || 188 === t || 189 === t || 190 === t || 215 === t || 247 === t) || (t => t >= 8192 && t <= 8303)(t) && (8214 === t || 8224 === t || 8225 === t || 8240 === t || 8241 === t || 8251 === t || 8252 === t || 8258 === t || 8263 === t || 8264 === t || 8265 === t || 8273 === t) || (t => t >= 8448 && t <= 8527)(t) || (t => t >= 8528 && t <= 8591)(t) || (t => t >= 8960 && t <= 9215)(t) && (t >= 8960 && t <= 8967 || t >= 8972 && t <= 8991 || t >= 8996 && t <= 9e3 || 9003 === t || t >= 9085 && t <= 9114 || t >= 9150 && t <= 9165 || 9167 === t || t >= 9169 && t <= 9179 || t >= 9186 && t <= 9215) || (t => t >= 9216 && t <= 9279)(t) && 9251 !== t || (t => t >= 9280 && t <= 9311)(t) || (t => t >= 9312 && t <= 9471)(t) || (t => t >= 9632 && t <= 9727)(t) || (t => t >= 9728 && t <= 9983)(t) && !(t >= 9754 && t <= 9759) || (t => t >= 11008 && t <= 11263)(t) && (t >= 11026 && t <= 11055 || t >= 11088 && t <= 11097 || t >= 11192 && t <= 11243) || No(t) ||
|
|
5371
|
+
return !!((t => t >= 128 && t <= 255)(t) && (167 === t || 169 === t || 174 === t || 177 === t || 188 === t || 189 === t || 190 === t || 215 === t || 247 === t) || (t => t >= 8192 && t <= 8303)(t) && (8214 === t || 8224 === t || 8225 === t || 8240 === t || 8241 === t || 8251 === t || 8252 === t || 8258 === t || 8263 === t || 8264 === t || 8265 === t || 8273 === t) || (t => t >= 8448 && t <= 8527)(t) || (t => t >= 8528 && t <= 8591)(t) || (t => t >= 8960 && t <= 9215)(t) && (t >= 8960 && t <= 8967 || t >= 8972 && t <= 8991 || t >= 8996 && t <= 9e3 || 9003 === t || t >= 9085 && t <= 9114 || t >= 9150 && t <= 9165 || 9167 === t || t >= 9169 && t <= 9179 || t >= 9186 && t <= 9215) || (t => t >= 9216 && t <= 9279)(t) && 9251 !== t || (t => t >= 9280 && t <= 9311)(t) || (t => t >= 9312 && t <= 9471)(t) || (t => t >= 9632 && t <= 9727)(t) || (t => t >= 9728 && t <= 9983)(t) && !(t >= 9754 && t <= 9759) || (t => t >= 11008 && t <= 11263)(t) && (t >= 11026 && t <= 11055 || t >= 11088 && t <= 11097 || t >= 11192 && t <= 11243) || No(t) || zo(t) || (t => t >= 57344 && t <= 63743)(t) || Ko(t) || Zo(t) || ta(t) || 8734 === t || 8756 === t || 8757 === t || t >= 9984 && t <= 10087 || t >= 10102 && t <= 10131 || 65532 === t || 65533 === t);
|
|
5372
5372
|
}(t));
|
|
5373
5373
|
}
|
|
5374
5374
|
function ra(t) {
|
|
@@ -5506,7 +5506,7 @@
|
|
|
5506
5506
|
let o = 0;
|
|
5507
5507
|
for (let n = 0; n < t.length; n++) {
|
|
5508
5508
|
const l = t.charCodeAt(n), h = i[l];
|
|
5509
|
-
h && !ha[l] && (o += h.metrics.advance + e), n < t.length - 1 && (ua[l] || !((a = l) < 11904) && (Ho(a) ||
|
|
5509
|
+
h && !ha[l] && (o += h.metrics.advance + e), n < t.length - 1 && (ua[l] || !((a = l) < 11904) && (Ho(a) || Lo(a) || Ko(a) || Yo(a) || Bo(a) || Co(a) || Uo(a) || No(a) || Go(a) || Wo(a) || jo(a) || ta(a) || Ro(a) || Do(a) || Eo(a) || Vo(a) || zo(a) || Jo(a) || Xo(a) || $o(a))) && r.push(da(n + 1, o, s, r, fa(l, t.charCodeAt(n + 1)), !1));
|
|
5510
5510
|
}
|
|
5511
5511
|
var a;
|
|
5512
5512
|
return function t(e) {
|
|
@@ -5852,25 +5852,25 @@
|
|
|
5852
5852
|
let h, u = !1;
|
|
5853
5853
|
for (let t = 0; t < l.length - 1; t++) {
|
|
5854
5854
|
let a = l[t], c = l[t + 1];
|
|
5855
|
-
a.x < e && c.x < e || (a.x < e ? (o = a, a = new
|
|
5855
|
+
a.x < e && c.x < e || (a.x < e ? (o = a, a = new z(e, a.y + (e - a.x) / (c.x - a.x) * (c.y - a.y)).O(),
|
|
5856
5856
|
a.z = o.z + (e - o.x) / (c.x - o.x) * (c.z - o.z), u = !0) : c.x < e && (o = c,
|
|
5857
|
-
c = new
|
|
5858
|
-
u = !0), a.y < n && c.y < n || (a.y < n ? (o = a, a = new
|
|
5857
|
+
c = new z(e, a.y + (e - a.x) / (c.x - a.x) * (c.y - a.y)).O(), c.z = a.z + (e - a.x) / (o.x - a.x) * (o.z - a.z),
|
|
5858
|
+
u = !0), a.y < n && c.y < n || (a.y < n ? (o = a, a = new z(a.x + (n - a.y) / (c.y - a.y) * (c.x - a.x), n).O(),
|
|
5859
5859
|
a.z = o.z + (n - o.y) / (c.y - o.y) * (c.z - o.z), u = !0) : c.y < n && (o = c,
|
|
5860
|
-
c = new
|
|
5861
|
-
u = !0), a.x >= i && c.x >= i || (a.x >= i ? (o = a, a = new
|
|
5860
|
+
c = new z(a.x + (n - a.y) / (c.y - a.y) * (c.x - a.x), n).O(), c.z = a.z + (n - a.y) / (o.y - a.y) * (o.z - a.z),
|
|
5861
|
+
u = !0), a.x >= i && c.x >= i || (a.x >= i ? (o = a, a = new z(i, a.y + (i - a.x) / (c.x - a.x) * (c.y - a.y)).O(),
|
|
5862
5862
|
a.z = o.z + (i - o.x) / (c.x - o.x) * (c.z - o.z), u = !0) : c.x >= i && (o = c,
|
|
5863
|
-
c = new
|
|
5864
|
-
u = !0), a.y >= r && c.y >= r || (a.y >= r ? (o = a, a = new
|
|
5863
|
+
c = new z(i, a.y + (i - a.x) / (c.x - a.x) * (c.y - a.y)).O(), c.z = a.z + (i - a.x) / (o.x - a.x) * (o.z - a.z),
|
|
5864
|
+
u = !0), a.y >= r && c.y >= r || (a.y >= r ? (o = a, a = new z(a.x + (r - a.y) / (c.y - a.y) * (c.x - a.x), r).O(),
|
|
5865
5865
|
a.z = o.z + (r - o.y) / (c.y - o.y) * (c.z - o.z), u = !0) : c.y >= r && (o = c,
|
|
5866
|
-
c = new
|
|
5866
|
+
c = new z(a.x + (r - a.y) / (c.y - a.y) * (c.x - a.x), r).O(), c.z = a.z + (r - a.y) / (o.y - a.y) * (o.z - a.z),
|
|
5867
5867
|
u = !0), h && a.equals(h[h.length - 1]) || (h = [ a ], s.push(h)), u && (h.clipped = !0),
|
|
5868
5868
|
h.push(c)))));
|
|
5869
5869
|
}
|
|
5870
5870
|
}
|
|
5871
5871
|
return s;
|
|
5872
5872
|
}
|
|
5873
|
-
class wa extends
|
|
5873
|
+
class wa extends z {
|
|
5874
5874
|
constructor(t, e, n, i) {
|
|
5875
5875
|
super(t, e), this.angle = n, void 0 !== i && (this.segment = i);
|
|
5876
5876
|
}
|
|
@@ -5973,7 +5973,7 @@
|
|
|
5973
5973
|
const l = Math.min(s - i, o - r);
|
|
5974
5974
|
let h = l / 2;
|
|
5975
5975
|
const u = new Wt([], Fa);
|
|
5976
|
-
if (0 === l) return new
|
|
5976
|
+
if (0 === l) return new z(i, r);
|
|
5977
5977
|
for (let e = i; e < s; e += l) for (let n = r; n < o; n += l) u.push(new Oa(e + h, n + h, h, t));
|
|
5978
5978
|
let c = function(t) {
|
|
5979
5979
|
let e = 0, n = 0, i = 0;
|
|
@@ -5998,7 +5998,7 @@
|
|
|
5998
5998
|
return e.max - t.max;
|
|
5999
5999
|
}
|
|
6000
6000
|
function Oa(t, e, n, i) {
|
|
6001
|
-
this.p = new
|
|
6001
|
+
this.p = new z(t, e), this.h = n, this.d = function(t, e) {
|
|
6002
6002
|
let n = !1, i = 1 / 0;
|
|
6003
6003
|
for (let r = 0; r < e.length; r++) {
|
|
6004
6004
|
const s = e[r];
|
|
@@ -6315,7 +6315,7 @@
|
|
|
6315
6315
|
e >= 1) return !1;
|
|
6316
6316
|
return !0;
|
|
6317
6317
|
}(t.getIconAndGlyph().glyph.text) ? 1 : 0, {textFillFn: f, textSizeFn: d, textHaloFillFn: p, textHaloRadiusFn: y, textHaloOpacityFn: m, textDxFn: g, textDyFn: v, textPitchAlignmentFn: b, textRotationAlignmentFn: w, textRotationFn: A, textAllowOverlapFn: M, textIgnorePlacementFn: _, textOpacityFn: S, markerWidthFn: k, markerHeightFn: P, markerDxFn: T, markerDyFn: F, markerPitchAlignmentFn: O, markerRotationAlignmentFn: I, markerRotationFn: C, markerAllowOverlapFn: E, markerIgnorePlacementFn: D, markerOpacityFn: N} = this.J;
|
|
6318
|
-
let R,
|
|
6318
|
+
let R, L, H, U, V, j, B, G, W, $, X, Y, q, J, K, Z, Q;
|
|
6319
6319
|
if (u) {
|
|
6320
6320
|
const e = t.getIconAndGlyph().glyph.font;
|
|
6321
6321
|
R = function(t, e, n) {
|
|
@@ -6325,9 +6325,9 @@
|
|
|
6325
6325
|
if (!a) continue;
|
|
6326
6326
|
const l = a.rect;
|
|
6327
6327
|
if (!l) continue;
|
|
6328
|
-
const h = 4, u = a.metrics.advance / 2, c = a.metrics.height / 2, f = e ? [ o.x + u, 0 ] : [ 0, 0 ], d = e ? [ 0, o.y - c ] : [ o.x + u, o.y - c ], p = a.metrics.left - h - u + d[0], y = a.metrics.top - h + d[1], m = p + l.w, g = y + l.h, v = new
|
|
6328
|
+
const h = 4, u = a.metrics.advance / 2, c = a.metrics.height / 2, f = e ? [ o.x + u, 0 ] : [ 0, 0 ], d = e ? [ 0, o.y - c ] : [ o.x + u, o.y - c ], p = a.metrics.left - h - u + d[0], y = a.metrics.top - h + d[1], m = p + l.w, g = y + l.h, v = new z(p, y), x = new z(m, y), b = new z(p, g), w = new z(m, g);
|
|
6329
6329
|
if (e && o.vertical) {
|
|
6330
|
-
const t = new
|
|
6330
|
+
const t = new z(-u, u), e = -Math.PI / 2, n = new z(5, 0);
|
|
6331
6331
|
v.k(e, t).o(n), x.k(e, t).o(n), b.k(e, t).o(n), w.k(e, t).o(n);
|
|
6332
6332
|
}
|
|
6333
6333
|
r.push({
|
|
@@ -6341,8 +6341,8 @@
|
|
|
6341
6341
|
});
|
|
6342
6342
|
}
|
|
6343
6343
|
return r;
|
|
6344
|
-
}(n.horizontal, h, this.glyphAtlas.positions[e]), f && (
|
|
6345
|
-
|
|
6344
|
+
}(n.horizontal, h, this.glyphAtlas.positions[e]), f && (L = f(null, l), x(L) ? (this.dynamicAttrs.aTextFill = 1,
|
|
6345
|
+
L = [ 0, 0, 0, 0 ]) : L = Hn([], L)), d && (H = d(this.options.zoom, l), Xn(H) && (H = 14)),
|
|
6346
6346
|
p && (U = p(null, l), x(U) ? (this.dynamicAttrs.aTextHaloFill = 1, U = [ 0, 0, 0, 0 ]) : U = Hn([], U)),
|
|
6347
6347
|
y && (V = y(null, l)), m && (j = 255 * m(null, l)), g && (B = g(null, l) || 0),
|
|
6348
6348
|
v && (G = v(null, l) || 0), b && (q = +("map" === b(null, l))), w && (J = +("map" === w(null, l))),
|
|
@@ -6350,7 +6350,7 @@
|
|
|
6350
6350
|
} else R = n ? function(t) {
|
|
6351
6351
|
const e = t.image, n = t.top - 1 / e.pixelRatio, i = t.left - 1 / e.pixelRatio, r = t.bottom + 1 / e.pixelRatio, s = t.right + 1 / e.pixelRatio;
|
|
6352
6352
|
let o, a, l, h;
|
|
6353
|
-
return o = new
|
|
6353
|
+
return o = new z(i, n), a = new z(s, n), l = new z(s, r), h = new z(i, r), [ {
|
|
6354
6354
|
tl: o,
|
|
6355
6355
|
tr: a,
|
|
6356
6356
|
bl: h,
|
|
@@ -6365,11 +6365,11 @@
|
|
|
6365
6365
|
glyphOffset: [ 0, 0 ]
|
|
6366
6366
|
} ];
|
|
6367
6367
|
}(n) : function() {
|
|
6368
|
-
const t = new
|
|
6368
|
+
const t = new z(0, 0), e = new z(0, 0), n = new z(0, 0);
|
|
6369
6369
|
return [ {
|
|
6370
6370
|
tl: t,
|
|
6371
6371
|
tr: e,
|
|
6372
|
-
bl: new
|
|
6372
|
+
bl: new z(0, 0),
|
|
6373
6373
|
br: n,
|
|
6374
6374
|
tex: {
|
|
6375
6375
|
x: 0,
|
|
@@ -6404,11 +6404,11 @@
|
|
|
6404
6404
|
for (let t = 0; t < l; t++) {
|
|
6405
6405
|
const i = R[t], {tl: l, tr: f, bl: d, br: p, tex: y} = i;
|
|
6406
6406
|
this.wt(r, s, a, n, 10 * l.x, 10 * l.y, y.x, y.y + y.h), u && this.At(r, h, st, i.glyphOffset, e, c, e.axis, e.angleR),
|
|
6407
|
-
this.Mt(r,
|
|
6408
|
-
u && this.At(r, h, st, i.glyphOffset, e, c, e.axis, e.angleR), this.Mt(r,
|
|
6407
|
+
this.Mt(r, L, H, U, V, j, B, G, W, $, X, Y, nt, q, J, K, Z, Q), this.wt(r, s, a, n, 10 * f.x, 10 * f.y, y.x + y.w, y.y + y.h),
|
|
6408
|
+
u && this.At(r, h, st, i.glyphOffset, e, c, e.axis, e.angleR), this.Mt(r, L, H, U, V, j, B, G, W, $, X, Y, nt, q, J, K, Z, Q),
|
|
6409
6409
|
this.wt(r, s, a, n, 10 * d.x, 10 * d.y, y.x, y.y), u && this.At(r, h, st, i.glyphOffset, e, c, e.axis, e.angleR),
|
|
6410
|
-
this.Mt(r,
|
|
6411
|
-
u && this.At(r, h, st, i.glyphOffset, e, c, e.axis, e.angleR), this.Mt(r,
|
|
6410
|
+
this.Mt(r, L, H, U, V, j, B, G, W, $, X, Y, nt, q, J, K, Z, Q), this.wt(r, s, a, n, 10 * p.x, 10 * p.y, y.x + y.w, y.y),
|
|
6411
|
+
u && this.At(r, h, st, i.glyphOffset, e, c, e.axis, e.angleR), this.Mt(r, L, H, U, V, j, B, G, W, $, X, Y, nt, q, J, K, Z, Q),
|
|
6412
6412
|
this.addElements(o, o + 1, o + 2), this.addElements(o + 1, o + 2, o + 3), o += 4;
|
|
6413
6413
|
const m = Math.max(Math.abs(s), Math.abs(a), Math.abs(n));
|
|
6414
6414
|
m > this.maxPos && (this.maxPos = m);
|
|
@@ -6426,13 +6426,13 @@
|
|
|
6426
6426
|
}
|
|
6427
6427
|
}
|
|
6428
6428
|
Mt(t, e, n, i, r, s, o, a, l, h, u, c, f, d, p, y, m, g) {
|
|
6429
|
-
const {textFillFn: v, textSizeFn: x, textHaloFillFn: b, textHaloRadiusFn: w, textHaloOpacityFn: A, textDxFn: M, textDyFn: _, textPitchAlignmentFn: S, textRotationAlignmentFn: k, textRotationFn: P, textAllowOverlapFn: T, textIgnorePlacementFn: F, textOpacityFn: O, markerWidthFn: I, markerHeightFn: C, markerDxFn: E, markerDyFn: D, markerPitchAlignmentFn: N, markerRotationAlignmentFn: R, markerRotationFn:
|
|
6429
|
+
const {textFillFn: v, textSizeFn: x, textHaloFillFn: b, textHaloRadiusFn: w, textHaloOpacityFn: A, textDxFn: M, textDyFn: _, textPitchAlignmentFn: S, textRotationAlignmentFn: k, textRotationFn: P, textAllowOverlapFn: T, textIgnorePlacementFn: F, textOpacityFn: O, markerWidthFn: I, markerHeightFn: C, markerDxFn: E, markerDyFn: D, markerPitchAlignmentFn: N, markerRotationAlignmentFn: R, markerRotationFn: z, markerAllowOverlapFn: L, markerIgnorePlacementFn: H, markerOpacityFn: U} = this.J;
|
|
6430
6430
|
v && t.aTextFill.push(...e), x && t.aTextSize.push(n), b && t.aTextHaloFill.push(...i),
|
|
6431
6431
|
w && t.aTextHaloRadius.push(r), A && t.aTextHaloOpacity.push(s), M && t.aTextDx.push(o),
|
|
6432
6432
|
_ && t.aTextDy.push(a), I && t.aMarkerWidth.push(l), C && t.aMarkerHeight.push(h),
|
|
6433
6433
|
E && t.aMarkerDx.push(u), D && t.aMarkerDy.push(c), (U || O) && t.aColorOpacity.push(f),
|
|
6434
|
-
(S || N) && t.aPitchAlign.push(d), (R || k) && t.aRotationAlign.push(p), (
|
|
6435
|
-
const V =
|
|
6434
|
+
(S || N) && t.aPitchAlign.push(d), (R || k) && t.aRotationAlign.push(p), (z || P) && t.aRotation.push(9362 * y);
|
|
6435
|
+
const V = L || T, j = H || F;
|
|
6436
6436
|
(V || j) && t.aOverlap.push((V ? 8 : 0) + 4 * m + ((j ? 2 : 0) + g)), r > 0 && (this.properties.hasHalo = 1);
|
|
6437
6437
|
}
|
|
6438
6438
|
bt(t, e, n) {
|
|
@@ -6563,7 +6563,7 @@
|
|
|
6563
6563
|
return Math.atan2(this.y - t.y, this.x - t.x);
|
|
6564
6564
|
}
|
|
6565
6565
|
}
|
|
6566
|
-
const Ra = Math.cos(Math.PI / 180 * 37.5),
|
|
6566
|
+
const Ra = Math.cos(Math.PI / 180 * 37.5), za = Math.pow(2, 16) / 1, La = new z, Ha = new z, Ua = new z;
|
|
6567
6567
|
class Va extends Mo {
|
|
6568
6568
|
constructor(t, e, n) {
|
|
6569
6569
|
super(t, e, n);
|
|
@@ -6806,15 +6806,15 @@
|
|
|
6806
6806
|
const o = e.x + e.y * n, a = e.y - e.x * n, l = e.y * i - e.x, h = -e.y - e.x * i;
|
|
6807
6807
|
let u = 0, c = 0;
|
|
6808
6808
|
if (r.middleVertex) {
|
|
6809
|
-
|
|
6809
|
+
La.x = o, La.y = a, Ha.x = l, Ha.y = h;
|
|
6810
6810
|
const t = r.currentNormal;
|
|
6811
|
-
if (u = Xa(t,
|
|
6811
|
+
if (u = Xa(t, La), 0 === n && 0 === i) c = -u; else {
|
|
6812
6812
|
const e = Ua;
|
|
6813
6813
|
e.x = t.x, e.y = t.y, e.M(-1), c = Xa(e, Ha);
|
|
6814
6814
|
}
|
|
6815
6815
|
}
|
|
6816
6816
|
this.addHalfVertex(t, o, a, s, !1, n, r, u), this.addHalfVertex(t, l, h, s, !0, -i, r, c),
|
|
6817
|
-
this.prevVertex && Ya(t, this.prevVertex) || (this.prevVertex = t), this.distance >
|
|
6817
|
+
this.prevVertex && Ya(t, this.prevVertex) || (this.prevVertex = t), this.distance > za / 2 && 0 === this.totalDistance && (this.distance = 0,
|
|
6818
6818
|
this.updateScaledDistance(), this.addCurrentVertex(t, e, n, i, r, s));
|
|
6819
6819
|
}
|
|
6820
6820
|
addHalfVertex({x: t, y: e, z: n}, i, r, s, o, a, l, h) {
|
|
@@ -6857,13 +6857,13 @@
|
|
|
6857
6857
|
}
|
|
6858
6858
|
updateDistance(t, e) {
|
|
6859
6859
|
if (this.options.isTube) {
|
|
6860
|
-
const n = t.dist(e), i =
|
|
6860
|
+
const n = t.dist(e), i = zn(this.options) * (e.z - t.z);
|
|
6861
6861
|
this.distance += Math.sqrt(n * n + i * i);
|
|
6862
6862
|
} else this.distance += t.dist(e);
|
|
6863
6863
|
this.updateScaledDistance();
|
|
6864
6864
|
}
|
|
6865
6865
|
updateScaledDistance() {
|
|
6866
|
-
this.scaledDistance = this.totalDistance > 0 ? (this.clipStart + (this.clipEnd - this.clipStart) * this.distance / this.totalDistance) * (
|
|
6866
|
+
this.scaledDistance = this.totalDistance > 0 ? (this.clipStart + (this.clipEnd - this.clipStart) * this.distance / this.totalDistance) * (za - 1) : this.distance;
|
|
6867
6867
|
}
|
|
6868
6868
|
}
|
|
6869
6869
|
function ja(t, e, n) {
|
|
@@ -6879,7 +6879,7 @@
|
|
|
6879
6879
|
for (let e = 0; e < t.length; e++) if (t[e]) return !0;
|
|
6880
6880
|
return !1;
|
|
6881
6881
|
}
|
|
6882
|
-
const Wa = new
|
|
6882
|
+
const Wa = new z(0, 0), $a = new z(0, 0);
|
|
6883
6883
|
function Xa(t, e) {
|
|
6884
6884
|
const n = t.mag(), i = e.mag();
|
|
6885
6885
|
Wa.x = e.x, Wa.y = e.y;
|
|
@@ -6900,7 +6900,7 @@
|
|
|
6900
6900
|
for (n = [], s = !(Qa(r = t[t.length - 1], e) & i), o = 0; o < t.length; o++) {
|
|
6901
6901
|
if ((l = !(Qa(a = t[o], e) & i)) !== s) {
|
|
6902
6902
|
const t = Za(r, a, i, e);
|
|
6903
|
-
n.push(void 0 !== a.x ? new
|
|
6903
|
+
n.push(void 0 !== a.x ? new z(t[0], t[1]) : t);
|
|
6904
6904
|
}
|
|
6905
6905
|
l && n.push(a), r = a, s = l;
|
|
6906
6906
|
}
|
|
@@ -7130,7 +7130,7 @@
|
|
|
7130
7130
|
if (h++, h <= i) continue;
|
|
7131
7131
|
const t = e.split(" "), c = r && "normal" === t[0] && !na(+u), f = e + ":" + u + ":" + c;
|
|
7132
7132
|
let d;
|
|
7133
|
-
if (this.Et.has(f) ? d = this.Et.get(f) : (d = this.
|
|
7133
|
+
if (this.Et.has(f) ? d = this.Et.get(f) : (d = this.zt(n[e], t, u, c), this.Et.add(f, d),
|
|
7134
7134
|
l++), d = hl(d), s[e][u] = d, a.push(d.bitmap.data.buffer), this.Dt && l > this.Nt) return void this.Dt(o(h, s, a));
|
|
7135
7135
|
}
|
|
7136
7136
|
}
|
|
@@ -7146,7 +7146,7 @@
|
|
|
7146
7146
|
}
|
|
7147
7147
|
s(0, {}, []);
|
|
7148
7148
|
}
|
|
7149
|
-
|
|
7149
|
+
zt(t, e, n, i) {
|
|
7150
7150
|
const r = e[0], s = e[1], o = e.slice(3).join(" ");
|
|
7151
7151
|
let a = t.tinySDF, l = "normal" !== r ? 5 : 2;
|
|
7152
7152
|
const h = i ? -1 : 2;
|
|
@@ -7191,7 +7191,7 @@
|
|
|
7191
7191
|
}
|
|
7192
7192
|
class ul {
|
|
7193
7193
|
constructor(t) {
|
|
7194
|
-
this.options = t || {}, this.
|
|
7194
|
+
this.options = t || {}, this.Lt = {}, this.Et = new nl(256, (function() {}));
|
|
7195
7195
|
const e = document.createElement("canvas");
|
|
7196
7196
|
this.ctx = e.getContext("2d", {
|
|
7197
7197
|
willReadFrequently: !0
|
|
@@ -7212,9 +7212,9 @@
|
|
|
7212
7212
|
});
|
|
7213
7213
|
}
|
|
7214
7214
|
function u(t) {
|
|
7215
|
-
const e = l.
|
|
7215
|
+
const e = l.Lt[t.url];
|
|
7216
7216
|
for (let n = 0; n < e.length; n++) e[n].call(t, t.url, t.size);
|
|
7217
|
-
delete l.
|
|
7217
|
+
delete l.Lt[t.url];
|
|
7218
7218
|
}
|
|
7219
7219
|
function c() {
|
|
7220
7220
|
const t = l.ctx;
|
|
@@ -7267,11 +7267,11 @@
|
|
|
7267
7267
|
}, s.push(r[a].data.data.buffer), this.Vt(a, o, e, n);
|
|
7268
7268
|
}
|
|
7269
7269
|
} else {
|
|
7270
|
-
if (this.
|
|
7271
|
-
p = !0, o++, this.
|
|
7270
|
+
if (this.Lt[a]) {
|
|
7271
|
+
p = !0, o++, this.Lt[a].push(h);
|
|
7272
7272
|
continue;
|
|
7273
7273
|
}
|
|
7274
|
-
this.
|
|
7274
|
+
this.Lt[a] = [], this.Lt[a].push(h);
|
|
7275
7275
|
const t = new Image;
|
|
7276
7276
|
t.index = n, t.size = l, t.onload = c, t.onerror = f, t.onabort = f, t.url = a,
|
|
7277
7277
|
t.crossOrigin = "Anonymous", p = !0, o++, t.src = m;
|
|
@@ -7746,7 +7746,7 @@
|
|
|
7746
7746
|
for (let l = 0, h = (e || t).length; l < h; l++) {
|
|
7747
7747
|
let h = e ? t[e[l]] : t[l];
|
|
7748
7748
|
"id" === s.options.features && s.getFeature && (h = s.getFeature(h), h.layer = n),
|
|
7749
|
-
s instanceof r.TileLayer && (h =
|
|
7749
|
+
s instanceof r.TileLayer && (h = zl(h, o));
|
|
7750
7750
|
a[e ? e[l] : h[Il]] = {
|
|
7751
7751
|
feature: h,
|
|
7752
7752
|
symbol: i
|
|
@@ -7763,7 +7763,7 @@
|
|
|
7763
7763
|
return e in t || e in t[El] || t[Dl] && e in t[Dl];
|
|
7764
7764
|
}
|
|
7765
7765
|
}, Rl = {};
|
|
7766
|
-
function
|
|
7766
|
+
function zl(t, e) {
|
|
7767
7767
|
const n = t.properties;
|
|
7768
7768
|
if (n && n[El]) return t;
|
|
7769
7769
|
e && (t = P({}, t)), t.customProps = t.customProps || {};
|
|
@@ -7771,7 +7771,7 @@
|
|
|
7771
7771
|
return i.$layer = t.layer, i.$type = t.type, i[El] = n || Rl, t.properties = new Proxy(i, Nl),
|
|
7772
7772
|
t;
|
|
7773
7773
|
}
|
|
7774
|
-
function
|
|
7774
|
+
function Ll(t) {
|
|
7775
7775
|
for (let e = 1; e < arguments.length; e++) {
|
|
7776
7776
|
const n = arguments[e];
|
|
7777
7777
|
for (const e in n) t[e] = n[e];
|
|
@@ -8012,9 +8012,9 @@
|
|
|
8012
8012
|
if (super._drawTiles(t, e, n, i, r), this.ke) if (Object.keys(this.ke).length) for (const t in this.ke) {
|
|
8013
8013
|
const e = this.ke[t];
|
|
8014
8014
|
this.tileCache.has(e.id) || this._drawTile(e.info, e.image, r);
|
|
8015
|
-
} else this.
|
|
8015
|
+
} else this.ze(), delete this.ke;
|
|
8016
8016
|
}
|
|
8017
|
-
|
|
8017
|
+
ze() {
|
|
8018
8018
|
const t = this.me, e = [], n = [];
|
|
8019
8019
|
for (const n in this.ve) if (+n !== t) {
|
|
8020
8020
|
e.push(n);
|
|
@@ -8032,7 +8032,7 @@
|
|
|
8032
8032
|
for (let t = 0; t < n.length; t++) delete this.xe[n[t]];
|
|
8033
8033
|
}
|
|
8034
8034
|
draw(t, e) {
|
|
8035
|
-
this.
|
|
8035
|
+
this.Le !== t && (this._e = !1, this.He());
|
|
8036
8036
|
const n = this.layer;
|
|
8037
8037
|
if (this.prepareCanvas(), !this.ready || !n.ready) return void this.completeRender();
|
|
8038
8038
|
let i = this.ve[this.me];
|
|
@@ -8040,7 +8040,7 @@
|
|
|
8040
8040
|
const r = this.Fe();
|
|
8041
8041
|
n.isDefaultRender() || i.length || r.length ? (n.options.collision && n.clearCollisionIndex(),
|
|
8042
8042
|
this.Ue = t, this.Ve = this.je(this.getMap().getGLRes()), this.Be = e || {}, this.Ge(t),
|
|
8043
|
-
super.draw(t), this.
|
|
8043
|
+
super.draw(t), this.Le !== t && this.We(t), this.$e(t), this.completeRender(), this.Le = t) : this.completeRender();
|
|
8044
8044
|
}
|
|
8045
8045
|
He() {
|
|
8046
8046
|
this.Ie().forEach((t, e) => {
|
|
@@ -8333,7 +8333,7 @@
|
|
|
8333
8333
|
const i = this.yn(e, 0, r, t);
|
|
8334
8334
|
e.prepareRender(i);
|
|
8335
8335
|
});
|
|
8336
|
-
const l = this.
|
|
8336
|
+
const l = this.Le !== e.timestamp;
|
|
8337
8337
|
let h = !1;
|
|
8338
8338
|
if (l && !o) {
|
|
8339
8339
|
const e = this.layer.getPolygonOffset() + this.layer.getPolygonOffsetCount(), n = this.yn(null, e, r, t);
|
|
@@ -8464,7 +8464,7 @@
|
|
|
8464
8464
|
t.destroy(), t.colorTex && (t.colorTex.destroy(), delete t.colorTex);
|
|
8465
8465
|
}
|
|
8466
8466
|
renderTerrainSkin(t, e, n) {
|
|
8467
|
-
const i = this.
|
|
8467
|
+
const i = this.Le, r = this.Be, s = this.layer.getTileSize().width;
|
|
8468
8468
|
this.Ge(i);
|
|
8469
8469
|
for (let e = 0; e < n.length; e++) {
|
|
8470
8470
|
const i = n[e].texture;
|
|
@@ -8481,7 +8481,7 @@
|
|
|
8481
8481
|
this.drawTile(e, n, sh);
|
|
8482
8482
|
}
|
|
8483
8483
|
Sn(t) {
|
|
8484
|
-
const e = this.Ke(), n = this.getMap().cameraPosition, i = this.
|
|
8484
|
+
const e = this.Ke(), n = this.getMap().cameraPosition, i = this.Le || 0;
|
|
8485
8485
|
this.layer.options.collision ? e.forEach(t => {
|
|
8486
8486
|
if (!this.Ze(t) || !t.hasMesh()) return;
|
|
8487
8487
|
if (!sh(t) || !this.layer.options.awareOfTerrain) return;
|
|
@@ -8501,7 +8501,7 @@
|
|
|
8501
8501
|
framebuffer: n
|
|
8502
8502
|
});
|
|
8503
8503
|
}
|
|
8504
|
-
const i = this.Xe[n] || 0, r = this.yn(e, i, [ 0, 0, 0 ], this.
|
|
8504
|
+
const i = this.Xe[n] || 0, r = this.yn(e, i, [ 0, 0, 0 ], this.Le);
|
|
8505
8505
|
r.isRenderingTerrainSkin = !0, e.endFrame(r);
|
|
8506
8506
|
});
|
|
8507
8507
|
}
|
|
@@ -9084,7 +9084,7 @@
|
|
|
9084
9084
|
this.Rn || (this.Rn = {});
|
|
9085
9085
|
const n = t.layer || "0";
|
|
9086
9086
|
let i = this.Rn[n];
|
|
9087
|
-
return this.Rn[n] || (i = this.Rn[n] = new Map), i.set(t.id, e), this.
|
|
9087
|
+
return this.Rn[n] || (i = this.Rn[n] = new Map), i.set(t.id, e), this.zn(), this;
|
|
9088
9088
|
}
|
|
9089
9089
|
removeFeatureState(t, e) {
|
|
9090
9090
|
if (C(t.id)) throw new Error("missing id in first parameter of removeFeatureState.");
|
|
@@ -9096,7 +9096,7 @@
|
|
|
9096
9096
|
if (I(e)) for (const t in e) delete n[t]; else delete n[e];
|
|
9097
9097
|
i.set(t.id, n);
|
|
9098
9098
|
} else i.delete(t.id);
|
|
9099
|
-
return this.
|
|
9099
|
+
return this.zn(), this;
|
|
9100
9100
|
}
|
|
9101
9101
|
getFeatureState(t) {
|
|
9102
9102
|
if (C(t.id)) throw new Error("missing id in first parameter of getFeatureState.");
|
|
@@ -9104,17 +9104,17 @@
|
|
|
9104
9104
|
const e = t.layer || "0";
|
|
9105
9105
|
return this.Rn[e].get(t.id);
|
|
9106
9106
|
}
|
|
9107
|
-
|
|
9107
|
+
zn() {
|
|
9108
9108
|
const t = this.getRenderer();
|
|
9109
9109
|
if (!t) return;
|
|
9110
9110
|
const e = t.getFrameTimestamp();
|
|
9111
|
-
this.
|
|
9111
|
+
this.Ln = e;
|
|
9112
9112
|
}
|
|
9113
9113
|
Hn() {
|
|
9114
|
-
return this.
|
|
9114
|
+
return this.Ln;
|
|
9115
9115
|
}
|
|
9116
9116
|
Un(t) {
|
|
9117
|
-
return this.
|
|
9117
|
+
return this.Ln && this.Ln !== t;
|
|
9118
9118
|
}
|
|
9119
9119
|
Nn() {
|
|
9120
9120
|
const t = this.getMap().getProjection(), e = "EPSG:4326" === t.code || "EPSG:4490" === t.code, n = "EPSG:3857" === t.code;
|
|
@@ -9585,13 +9585,14 @@
|
|
|
9585
9585
|
schema: !1,
|
|
9586
9586
|
cascadeTiles: !0,
|
|
9587
9587
|
collision: !0,
|
|
9588
|
+
collisionBuffserSize: 0,
|
|
9588
9589
|
picking: !0,
|
|
9589
9590
|
pickingPoint: !0,
|
|
9590
9591
|
pickingGeometry: !1,
|
|
9591
9592
|
glyphSdfLimitPerFrame: 15,
|
|
9592
9593
|
tileLimitPerFrame: 1,
|
|
9593
|
-
loadingLimitOnInteracting:
|
|
9594
|
-
loadingLimit:
|
|
9594
|
+
loadingLimitOnInteracting: 5,
|
|
9595
|
+
loadingLimit: 0,
|
|
9595
9596
|
antialias: !1,
|
|
9596
9597
|
iconErrorUrl: null,
|
|
9597
9598
|
collisionFrameLimit: 1.5,
|
|
@@ -9754,12 +9755,12 @@
|
|
|
9754
9755
|
generateOMBB: !0
|
|
9755
9756
|
});
|
|
9756
9757
|
const Rh = new r.Size(1, 1);
|
|
9757
|
-
class
|
|
9758
|
+
class zh extends r.OverlayLayer {
|
|
9758
9759
|
static registerPainter(t, e) {
|
|
9759
|
-
|
|
9760
|
+
zh.painters || (zh.painters = {}), zh.painters[t] = e;
|
|
9760
9761
|
}
|
|
9761
9762
|
static get3DPainterClass(t) {
|
|
9762
|
-
return
|
|
9763
|
+
return zh.painters[t];
|
|
9763
9764
|
}
|
|
9764
9765
|
getEvents() {
|
|
9765
9766
|
let t;
|
|
@@ -9841,11 +9842,12 @@
|
|
|
9841
9842
|
t && t.gi();
|
|
9842
9843
|
}
|
|
9843
9844
|
}
|
|
9844
|
-
|
|
9845
|
+
zh.mergeOptions({
|
|
9845
9846
|
picking: !0,
|
|
9846
9847
|
pickingPoint: !0,
|
|
9847
9848
|
renderer: "gl",
|
|
9848
9849
|
collision: !1,
|
|
9850
|
+
collisionBufferSize: 0,
|
|
9849
9851
|
textGamma: 1,
|
|
9850
9852
|
geometryEvents: !0,
|
|
9851
9853
|
styleScale: 1,
|
|
@@ -9859,7 +9861,7 @@
|
|
|
9859
9861
|
"win-intel-gpu-crash": !0
|
|
9860
9862
|
}
|
|
9861
9863
|
});
|
|
9862
|
-
const
|
|
9864
|
+
const Lh = {
|
|
9863
9865
|
markerFile: {
|
|
9864
9866
|
type: "identity",
|
|
9865
9867
|
default: null,
|
|
@@ -10314,14 +10316,14 @@
|
|
|
10314
10316
|
const t = this.Ni;
|
|
10315
10317
|
delete this.Ni, this.Ii(t), this.Ei = !1;
|
|
10316
10318
|
}
|
|
10317
|
-
if (!this.meshes && !this.Ri && !this.
|
|
10318
|
-
this.
|
|
10319
|
+
if (!this.meshes && !this.Ri && !this.zi) return void this.completeRender();
|
|
10320
|
+
this.Li && (this.Hi(), this.Li = !1), this.Ui();
|
|
10319
10321
|
const s = !i || "default" === i;
|
|
10320
10322
|
let o = 0;
|
|
10321
10323
|
0 === this.layer.options.meshRenderOrder && this.Vi(r, o, i);
|
|
10322
10324
|
let a = 0;
|
|
10323
|
-
if (this.
|
|
10324
|
-
this.Ti.startFrame(r), this.Ti.addMesh(this.
|
|
10325
|
+
if (this.zi && (s || this.Ti.supportRenderMode(i))) {
|
|
10326
|
+
this.Ti.startFrame(r), this.Ti.addMesh(this.zi, null, {
|
|
10325
10327
|
bloom: this.Be.bloom
|
|
10326
10328
|
}), this.Ti.prepareRender(r);
|
|
10327
10329
|
const t = r.polygonOffsetIndex || 0;
|
|
@@ -10393,18 +10395,18 @@
|
|
|
10393
10395
|
const a = this.features[o];
|
|
10394
10396
|
if (Array.isArray(a)) for (let r = 0; r < a.length; r++) {
|
|
10395
10397
|
const s = a[r], o = s[Yh];
|
|
10396
|
-
(!t || t[o] || e && (!e || e[o])) && (s.visible || (this.
|
|
10398
|
+
(!t || t[o] || e && (!e || e[o])) && (s.visible || (this.Li = !0), this.Wi(s.geometry, i, s.coordinates),
|
|
10397
10399
|
n.push(s));
|
|
10398
10400
|
} else {
|
|
10399
|
-
a.visible || (this.
|
|
10401
|
+
a.visible || (this.Li = !0);
|
|
10400
10402
|
const r = a[Yh];
|
|
10401
10403
|
if (t && !t[r] && (!e || e && !e[r])) continue;
|
|
10402
10404
|
this.Wi(a.geometry, i, a.coordinates), n.push(a);
|
|
10403
10405
|
}
|
|
10404
10406
|
}
|
|
10405
10407
|
if (n.length || (this.meshes && this.painter && (this.painter.deleteMesh(this.meshes),
|
|
10406
|
-
delete this.meshes), this.Ri && (this.Pi.deleteMesh(this.Ri), delete this.Ri), this.
|
|
10407
|
-
delete this.
|
|
10408
|
+
delete this.meshes), this.Ri && (this.Pi.deleteMesh(this.Ri), delete this.Ri), this.zi && (this.Ti.deleteMesh(this.zi),
|
|
10409
|
+
delete this.zi)), i[3] && (i[0] /= i[3], i[1] /= i[3]), isNaN(i[0]) || isNaN(i[1])) throw new Error("invalid geometry coordinates for " + this.layer.getJSONType());
|
|
10408
10410
|
return {
|
|
10409
10411
|
features: n,
|
|
10410
10412
|
center: i
|
|
@@ -10512,7 +10514,7 @@
|
|
|
10512
10514
|
}
|
|
10513
10515
|
if (!o.length && !a.length) return void (this.Ri && (this.Pi.deleteMesh(this.Ri),
|
|
10514
10516
|
delete this.Ri));
|
|
10515
|
-
const l = this.
|
|
10517
|
+
const l = this.Li;
|
|
10516
10518
|
this.Qi = s;
|
|
10517
10519
|
const h = this.er(o, a, t, s);
|
|
10518
10520
|
this.Di = {};
|
|
@@ -10529,11 +10531,12 @@
|
|
|
10529
10531
|
const a = this.Pi.createMeshes(e, o);
|
|
10530
10532
|
for (let t = 0; t < a.length; t++) a[t].geometry.properties.originElements = a[t].geometry.properties.elements.slice(),
|
|
10531
10533
|
a[t].properties.level = 0, a[t].material.set("flipY", 1), a[t].properties.meshKey = $h++;
|
|
10532
|
-
this.Ri = a, l && (this.
|
|
10534
|
+
this.Ri = a, l && (this.Li = !0), this.nr = !1, this.setToRedraw(), this.layer.fire("buildmarkermesh");
|
|
10533
10535
|
});
|
|
10534
10536
|
}
|
|
10535
10537
|
Hi() {
|
|
10536
|
-
if (this.Ri && (this.ir(this.Ri[0], this.wi), this.ir(this.Ri[1], this.Ai)
|
|
10538
|
+
if (this.Ri && (this.ir(this.Ri[0], this.wi), this.ir(this.Ri[1], this.Ai), this.Ri[0] && this.Pi.prepareCollideIndex(this.Ri[0].geometry),
|
|
10539
|
+
this.Ri[1] && this.Pi.prepareCollideIndex(this.Ri[1].geometry)), this.zi) for (let t = 0; t < this.zi.length; t++) this.ir(this.zi[t], this.Mi);
|
|
10537
10540
|
if (this.meshes) for (let t = 0; t < this.meshes.length; t++) this.ir(this.meshes[t], this.xi);
|
|
10538
10541
|
}
|
|
10539
10542
|
ir(t, e) {
|
|
@@ -10604,7 +10607,7 @@
|
|
|
10604
10607
|
}), !0;
|
|
10605
10608
|
}
|
|
10606
10609
|
lr(t) {
|
|
10607
|
-
return this.hr(t, this.
|
|
10610
|
+
return this.hr(t, this.zi, this.Ni, this.ur, this.Ti, Va, Uh, this.cr);
|
|
10608
10611
|
}
|
|
10609
10612
|
hr(t, e, n, i, r, s, o, a) {
|
|
10610
10613
|
if (!e) return !1;
|
|
@@ -10662,15 +10665,15 @@
|
|
|
10662
10665
|
}
|
|
10663
10666
|
}
|
|
10664
10667
|
Ii(t) {
|
|
10665
|
-
if (!Object.keys(this.Mi).length) return void (this.
|
|
10666
|
-
delete this.
|
|
10668
|
+
if (!Object.keys(this.Mi).length) return void (this.zi && (this.Ti.deleteMesh(this.zi),
|
|
10669
|
+
delete this.zi));
|
|
10667
10670
|
const {features: e, center: n} = this.Gi(this.Mi);
|
|
10668
10671
|
if (!e.length) return;
|
|
10669
|
-
const i = this.
|
|
10672
|
+
const i = this.Li;
|
|
10670
10673
|
this.ur = n;
|
|
10671
10674
|
const r = this.cr(e), s = P({}, Uh), o = r.map((e, i) => this.createMesh(this.Ti, Va, s, e, t && t[i], n));
|
|
10672
10675
|
this.pr = !0, Promise.all(o).then(t => {
|
|
10673
|
-
this.
|
|
10676
|
+
this.zi && this.Ti.deleteMesh(this.zi);
|
|
10674
10677
|
const e = [], n = [];
|
|
10675
10678
|
for (let i = 0; i < t.length; i++) {
|
|
10676
10679
|
const r = t[i] && t[i].meshes;
|
|
@@ -10682,7 +10685,7 @@
|
|
|
10682
10685
|
n[i] = t[i].atlas;
|
|
10683
10686
|
}
|
|
10684
10687
|
}
|
|
10685
|
-
this.
|
|
10688
|
+
this.zi = e, this.Ni = n, i && (this.Li = i), this.pr = !1, this.setToRedraw(),
|
|
10686
10689
|
this.layer.fire("buildlinemesh");
|
|
10687
10690
|
});
|
|
10688
10691
|
}
|
|
@@ -10861,7 +10864,7 @@
|
|
|
10861
10864
|
}
|
|
10862
10865
|
}
|
|
10863
10866
|
_r() {
|
|
10864
|
-
this.
|
|
10867
|
+
this.Li = !0;
|
|
10865
10868
|
}
|
|
10866
10869
|
onGeometryPropertiesChange(t) {
|
|
10867
10870
|
const e = t.target._getParent() || t.target, n = e[jh];
|
|
@@ -10874,16 +10877,16 @@
|
|
|
10874
10877
|
t && (this.canvas.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height)),
|
|
10875
10878
|
this.prepareRequestors(), this.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height),
|
|
10876
10879
|
this.painter = this.createPainter();
|
|
10877
|
-
const e =
|
|
10880
|
+
const e = zh.get3DPainterClass("icon");
|
|
10878
10881
|
let n = e.getBloomSymbol();
|
|
10879
|
-
const i = P({},
|
|
10882
|
+
const i = P({}, Lh, Hh);
|
|
10880
10883
|
i.markerPerspectiveRatio = this.layer.options.markerPerspectiveRatio || 0, this.Sr(i, n),
|
|
10881
10884
|
this.rr = i;
|
|
10882
10885
|
const r = P({}, Ml, this.layer.options.sceneConfig || {});
|
|
10883
10886
|
this.Pi = new e(this.regl, this.layer, i, r, 0), this.Pi.setTextShaderDefines({
|
|
10884
10887
|
REVERSE_MAP_ROTATION_ON_PITCH: 1
|
|
10885
10888
|
});
|
|
10886
|
-
const s =
|
|
10889
|
+
const s = zh.get3DPainterClass("line"), o = P({}, Uh);
|
|
10887
10890
|
n = s.getBloomSymbol(), this.Sr(o, n), this.kr = o;
|
|
10888
10891
|
const a = P({}, this.layer.options.sceneConfig || {});
|
|
10889
10892
|
void 0 === a.depthMask && (a.depthMask = !0), this.Ti = new s(this.regl, this.layer, o, a, 0),
|
|
@@ -11030,7 +11033,7 @@
|
|
|
11030
11033
|
}
|
|
11031
11034
|
return i.addGeometry(o), i;
|
|
11032
11035
|
}
|
|
11033
|
-
class lu extends
|
|
11036
|
+
class lu extends zh {
|
|
11034
11037
|
static fromJSON(t) {
|
|
11035
11038
|
return au(t, "PointLayer", lu);
|
|
11036
11039
|
}
|
|
@@ -11063,7 +11066,7 @@
|
|
|
11063
11066
|
}) : t.options.maxMarkerWidth = t.options.maxMarkerHeight = 255, super.onGeometryAdd(t));
|
|
11064
11067
|
}
|
|
11065
11068
|
});
|
|
11066
|
-
class hu extends
|
|
11069
|
+
class hu extends zh {
|
|
11067
11070
|
static fromJSON(t) {
|
|
11068
11071
|
return au(t, "LineStringLayer", hu);
|
|
11069
11072
|
}
|
|
@@ -11077,7 +11080,7 @@
|
|
|
11077
11080
|
super(...t), this.GeometryTypes = [ r.LineString, r.MultiLineString ];
|
|
11078
11081
|
}
|
|
11079
11082
|
createPainter() {
|
|
11080
|
-
const t =
|
|
11083
|
+
const t = zh.get3DPainterClass("line-gradient");
|
|
11081
11084
|
this.painterSymbol = P({}, {
|
|
11082
11085
|
lineGradientProperty: uu
|
|
11083
11086
|
}, Uh), this.Sr(this.painterSymbol, t.getBloomSymbol());
|
|
@@ -11088,7 +11091,7 @@
|
|
|
11088
11091
|
buildMesh() {
|
|
11089
11092
|
let {features: t, center: e} = this.Gi();
|
|
11090
11093
|
if (t = t.filter(t => !!t.properties[uu]), !t.length) return;
|
|
11091
|
-
const n = this.
|
|
11094
|
+
const n = this.Li;
|
|
11092
11095
|
this.Fr = e;
|
|
11093
11096
|
const i = P({}, this.painterSymbol), r = this.createMesh(this.painter, Va, i, t, null, e);
|
|
11094
11097
|
this.wr = !0, r.then(t => {
|
|
@@ -11098,11 +11101,11 @@
|
|
|
11098
11101
|
e.push(...i);
|
|
11099
11102
|
for (let t = 0; t < i.length; t++) i[t].feaGroupIndex = 0, i[t].geometry.properties.originElements = i[t].geometry.properties.elements.slice();
|
|
11100
11103
|
}
|
|
11101
|
-
this.meshes = e, n && (this.
|
|
11104
|
+
this.meshes = e, n && (this.Li = n), this.wr = !1, this.setToRedraw();
|
|
11102
11105
|
});
|
|
11103
11106
|
}
|
|
11104
11107
|
}), hu.registerRenderer("canvas", null);
|
|
11105
|
-
class cu extends
|
|
11108
|
+
class cu extends zh {
|
|
11106
11109
|
static fromJSON(t) {
|
|
11107
11110
|
return au(t, "PolygonLayer", cu);
|
|
11108
11111
|
}
|
|
@@ -11170,7 +11173,7 @@
|
|
|
11170
11173
|
buildMesh(t) {
|
|
11171
11174
|
const {features: e, center: n} = this.Gi();
|
|
11172
11175
|
if (!e.length) return;
|
|
11173
|
-
const i = this.
|
|
11176
|
+
const i = this.Li;
|
|
11174
11177
|
this.Fr = n;
|
|
11175
11178
|
const r = this.Or(e), s = P({}, fu), o = r.map((e, i) => this.createMesh(this.painter, el, s, e, t && t[i], n));
|
|
11176
11179
|
this.wr = !0, Promise.all(o).then(t => {
|
|
@@ -11189,7 +11192,7 @@
|
|
|
11189
11192
|
n[i] = t[i].atlas;
|
|
11190
11193
|
}
|
|
11191
11194
|
}
|
|
11192
|
-
this.meshes = e, this.atlas = n, i && (this.
|
|
11195
|
+
this.meshes = e, this.atlas = n, i && (this.Li = i), this.wr = !1, this.setToRedraw(),
|
|
11193
11196
|
this.layer.fire("buildmesh");
|
|
11194
11197
|
});
|
|
11195
11198
|
}
|
|
@@ -11208,7 +11211,7 @@
|
|
|
11208
11211
|
return [ e, n ];
|
|
11209
11212
|
}
|
|
11210
11213
|
createPainter() {
|
|
11211
|
-
const t =
|
|
11214
|
+
const t = zh.get3DPainterClass("fill"), e = this.painterSymbol = P({}, fu);
|
|
11212
11215
|
this.Sr(e, t.getBloomSymbol());
|
|
11213
11216
|
return new t(this.regl, this.layer, e, this.layer.options.sceneConfig, 0);
|
|
11214
11217
|
}
|
|
@@ -11326,10 +11329,10 @@
|
|
|
11326
11329
|
const ku = mo.getInstance();
|
|
11327
11330
|
function Pu(t, e, n, i, r, s, o, a, l, h, u, c, f, d, p, y) {
|
|
11328
11331
|
void 0 === e.top && (e.top = !0), void 0 === e.side && (e.side = !0), ku.reset();
|
|
11329
|
-
const {altitudeScale: m, altitudeProperty: g, defaultAltitude: v, heightProperty: A, minHeightProperty: M, defaultHeight: _, tangent: S, uv: k, topUVMode: P, sideUVMode: T, sideVerticalUVMode: O, top: I, side: C, textureYOrigin: N, topThickness: R} = e,
|
|
11332
|
+
const {altitudeScale: m, altitudeProperty: g, defaultAltitude: v, heightProperty: A, minHeightProperty: M, defaultHeight: _, tangent: S, uv: k, topUVMode: P, sideUVMode: T, sideVerticalUVMode: O, top: I, side: C, textureYOrigin: N, topThickness: R} = e, z = !!y, L = function(t, e, {altitudeScale: n, altitudeProperty: i, defaultAltitude: r, heightProperty: s, minHeightProperty: o, defaultHeight: a}, {center: l, side: h, top: u, topThickness: c, uvOrigin: f, uv: d, uvSize: p, topUVMode: y, sideUVMode: m, sideVerticalUVMode: g, textureYOrigin: v, tileRatio: x, centimeterToPoint: b, verticalCentimeterToPoint: w, positionType: A, res: M, glScale: _, projectionCode: S}, k, P) {
|
|
11330
11333
|
let T = e / t[0].extent;
|
|
11331
11334
|
e === 1 / 0 && (T = 1);
|
|
11332
|
-
const O = e === 1 / 0, I = P.get(), C = P.get(), D = P.get(), N = P.get(), R = P.get(),
|
|
11335
|
+
const O = e === 1 / 0, I = P.get(), C = P.get(), D = P.get(), N = P.get(), R = P.get(), z = P.get(), L = P.get(), H = !!d, U = !!u, V = !!h, j = H ? P.get() : null;
|
|
11333
11336
|
function B(t, n, i, r, s, o) {
|
|
11334
11337
|
let a = n;
|
|
11335
11338
|
if (U) {
|
|
@@ -11341,15 +11344,15 @@
|
|
|
11341
11344
|
for (let n = 2, i = r.length; n < i; n += 3) e = r[n - 1], r[n - 1] = r[n] + t / 3,
|
|
11342
11345
|
r[n] = e + t / 3, r[n - 2] += t / 3;
|
|
11343
11346
|
}
|
|
11344
|
-
E(
|
|
11345
|
-
|
|
11347
|
+
E(z, r), H && bu(y || 0, t, n, j, R, f, b, x, p[0], p[1], s, M, _, S, l), c > 0 && !V && (n = Mu(R, N, i, z, n, j, 0, c, e, H, m || 0, g || 0, v, p, x, w, o)),
|
|
11348
|
+
L.setLength(n / 3), L.fill(1, a / 3, n / 3);
|
|
11346
11349
|
}
|
|
11347
11350
|
if (V) {
|
|
11348
|
-
U && (c = 0), a = n, n = Mu(R, N, i,
|
|
11349
|
-
|
|
11351
|
+
U && (c = 0), a = n, n = Mu(R, N, i, z, n, j, c, r, e, H, m || 0, g || 0, v, p, x, w, o),
|
|
11352
|
+
L.setLength(n / 3);
|
|
11350
11353
|
const t = N.length / 3;
|
|
11351
|
-
|
|
11352
|
-
|
|
11354
|
+
L.fill(1, a / 3, a / 3 + t), L.fill(0, a / 3 + t, a / 3 + 2 * t), L.fill(1, a / 3 + 2 * t, a / 3 + 3 * t),
|
|
11355
|
+
L.fill(0, a / 3 + 3 * t, n / 3);
|
|
11353
11356
|
}
|
|
11354
11357
|
return n;
|
|
11355
11358
|
}
|
|
@@ -11389,8 +11392,8 @@
|
|
|
11389
11392
|
const Z = fl.getUnsignedArrayType(C.length ? C[C.length - 1] : 0), Q = {
|
|
11390
11393
|
maxAltitude: G,
|
|
11391
11394
|
vertices: R,
|
|
11392
|
-
verticeTypes:
|
|
11393
|
-
indices:
|
|
11395
|
+
verticeTypes: L,
|
|
11396
|
+
indices: z,
|
|
11394
11397
|
pickingIds: mo.createTypedArray(C, Z),
|
|
11395
11398
|
featureIndexes: I
|
|
11396
11399
|
};
|
|
@@ -11425,8 +11428,8 @@
|
|
|
11425
11428
|
res: s,
|
|
11426
11429
|
glScale: o,
|
|
11427
11430
|
projectionCode: f
|
|
11428
|
-
}, d, ku), H = [], U =
|
|
11429
|
-
delete
|
|
11431
|
+
}, d, ku), H = [], U = L.vertices.length / 3, V = fl.getIndexArrayType(U), j = mo.createTypedArray(L.indices, V);
|
|
11432
|
+
delete L.indices, H.push(j.buffer, L.pickingIds.buffer);
|
|
11430
11433
|
const B = S ? ku.get() : new Float32Array(3 * U);
|
|
11431
11434
|
B.setLength && B.setLength(3 * U);
|
|
11432
11435
|
const G = function(t, e, n) {
|
|
@@ -11441,14 +11444,14 @@
|
|
|
11441
11444
|
0 !== e ? (i[t] /= e, i[t + 1] /= e, i[t + 2] /= e) : (i[t] = 0, i[t + 1] = 0, i[t + 2] = 0);
|
|
11442
11445
|
}
|
|
11443
11446
|
return i;
|
|
11444
|
-
}(
|
|
11447
|
+
}(L.vertices, j, B);
|
|
11445
11448
|
let W = !0;
|
|
11446
11449
|
for (let t = 0; t < G.length; t++) {
|
|
11447
|
-
|
|
11450
|
+
z || (G[t] = -G[t]);
|
|
11448
11451
|
const e = G[t] % 1;
|
|
11449
11452
|
1 - Math.abs(e) > 1e-6 ? W = !1 : 0 !== e && (G[t] = Math.round(G[t]));
|
|
11450
11453
|
}
|
|
11451
|
-
if (
|
|
11454
|
+
if (L.normals = G, S) {
|
|
11452
11455
|
let t = ku.get();
|
|
11453
11456
|
t.setLength(4 * U), t = function(t, e, n, i, r) {
|
|
11454
11457
|
const s = t.length / 3, o = r || new Array(4 * s), a = [], l = [];
|
|
@@ -11473,7 +11476,7 @@
|
|
|
11473
11476
|
}
|
|
11474
11477
|
for (let t = 0, e = i.length; t < e; t += 3) S(i[t + 0]), S(i[t + 1]), S(i[t + 2]);
|
|
11475
11478
|
return o;
|
|
11476
|
-
}(
|
|
11479
|
+
}(L.vertices, L.normals, L.uvs, j, t), t = function(t, e) {
|
|
11477
11480
|
const n = new Float32Array(e.length), i = [], r = [], s = [];
|
|
11478
11481
|
for (let o = 0; o < e.length; o += 4) {
|
|
11479
11482
|
const a = o / 4 * 3;
|
|
@@ -11481,18 +11484,18 @@
|
|
|
11481
11484
|
ve(s, r, i), ie(n.subarray(o, o + 4), s);
|
|
11482
11485
|
}
|
|
11483
11486
|
return n;
|
|
11484
|
-
}(
|
|
11487
|
+
}(L.normals, t), L.tangents = t, H.push(t.buffer), delete L.normals;
|
|
11485
11488
|
}
|
|
11486
|
-
if (
|
|
11487
|
-
H.push(
|
|
11488
|
-
const t =
|
|
11489
|
-
|
|
11489
|
+
if (L.normals && (W && (L.normals = mo.createTypedArray(L.normals, Int8Array)),
|
|
11490
|
+
H.push(L.normals.buffer)), L.uvs) {
|
|
11491
|
+
const t = L.uvs;
|
|
11492
|
+
L.uvs = mo.createTypedArray(t, Float32Array), H.push(L.uvs.buffer);
|
|
11490
11493
|
}
|
|
11491
11494
|
if (y) {
|
|
11492
|
-
const t =
|
|
11495
|
+
const t = L.vertices;
|
|
11493
11496
|
for (let e = 0; e < t.length; e += 3) t[e] -= y[0], t[e + 1] -= y[1];
|
|
11494
11497
|
}
|
|
11495
|
-
const $ = p || fl.getPosArrayType(Math.max(512,
|
|
11498
|
+
const $ = p || fl.getPosArrayType(Math.max(512, L.maxAltitude)), X = function(t, e, n, i) {
|
|
11496
11499
|
const r = {}, s = {};
|
|
11497
11500
|
if (D(e.polygonFill)) {
|
|
11498
11501
|
let o = w(e.polygonFill);
|
|
@@ -11522,7 +11525,7 @@
|
|
|
11522
11525
|
s.aOpacity = a;
|
|
11523
11526
|
}
|
|
11524
11527
|
return s.dynamicAttributes = r, s;
|
|
11525
|
-
}(t, u, c,
|
|
11528
|
+
}(t, u, c, L.featureIndexes), Y = function(t, e, n, i, r) {
|
|
11526
11529
|
const s = [ [], [] ], o = D(i.topPolygonFill), a = D(i.bottomPolygonFill), l = [ 255, 255, 255, 255 ];
|
|
11527
11530
|
if (o || a) {
|
|
11528
11531
|
let h = o && w(i.topPolygonFill), u = a && w(i.bottomPolygonFill), c = null, f = null, d = null, p = null;
|
|
@@ -11548,26 +11551,26 @@
|
|
|
11548
11551
|
}
|
|
11549
11552
|
}
|
|
11550
11553
|
return s.slice(2);
|
|
11551
|
-
}(
|
|
11554
|
+
}(L.verticeTypes, L.featureIndexes, t, u, c), q = {
|
|
11552
11555
|
data: {
|
|
11553
11556
|
data: {
|
|
11554
|
-
aVertexColorType: Y.length <= 252 ? mo.createTypedArray(
|
|
11555
|
-
aPosition: mo.createTypedArray(
|
|
11556
|
-
aNormal:
|
|
11557
|
-
aTexCoord0:
|
|
11558
|
-
aTangent:
|
|
11559
|
-
aPickingId:
|
|
11557
|
+
aVertexColorType: Y.length <= 252 ? mo.createTypedArray(L.verticeTypes, Uint8Array) : mo.createTypedArray(L.verticeTypes, Uint16Array),
|
|
11558
|
+
aPosition: mo.createTypedArray(L.vertices, $),
|
|
11559
|
+
aNormal: L.normals,
|
|
11560
|
+
aTexCoord0: L.uvs,
|
|
11561
|
+
aTangent: L.tangents,
|
|
11562
|
+
aPickingId: L.pickingIds
|
|
11560
11563
|
},
|
|
11561
11564
|
indices: j,
|
|
11562
11565
|
properties: {
|
|
11563
|
-
maxAltitude:
|
|
11566
|
+
maxAltitude: L.maxAltitude
|
|
11564
11567
|
},
|
|
11565
11568
|
dynamicAttributes: X.dynamicAttributes,
|
|
11566
11569
|
vertexColors: Y
|
|
11567
11570
|
},
|
|
11568
11571
|
buffers: H
|
|
11569
11572
|
};
|
|
11570
|
-
return
|
|
11573
|
+
return L.featureIds.length ? (q.data.featureIds = L.featureIds, H.push(q.data.featureIds.buffer)) : q.data.featureIds = [],
|
|
11571
11574
|
X.aColor && (q.data.data.aColor = X.aColor, q.buffers.push(X.aColor.buffer)), X.aOpacity && (q.data.data.aOpacity = X.aOpacity,
|
|
11572
11575
|
q.buffers.push(X.aOpacity.buffer)), q.buffers.push(q.data.data.aPosition.buffer),
|
|
11573
11576
|
q.data.pickingIdIndiceMap = fl.generatePickingIndiceIndex(q.data.data.aPickingId, q.data.indices),
|
|
@@ -11668,7 +11671,7 @@
|
|
|
11668
11671
|
for (;n || r.length; ) {
|
|
11669
11672
|
if (n || (n = r.pop(), a = r[r.length - 1], o = s.pop(), l = !0), n.leaf) {
|
|
11670
11673
|
const i = Du(t, n.children, e);
|
|
11671
|
-
if (-1 !== i) return n.children.splice(i, 1), r.push(n), this.
|
|
11674
|
+
if (-1 !== i) return n.children.splice(i, 1), r.push(n), this.zr(r), this;
|
|
11672
11675
|
}
|
|
11673
11676
|
l || n.leaf || !Gu(n, i) ? a ? (o++, n = a.children[o], l = !1) : n = null : (r.push(n),
|
|
11674
11677
|
s.push(o), o = 0, a = n, n = n.children[0]);
|
|
@@ -11713,7 +11716,7 @@
|
|
|
11713
11716
|
}
|
|
11714
11717
|
return Nu(s, this.toBBox), s;
|
|
11715
11718
|
}
|
|
11716
|
-
|
|
11719
|
+
Lr(t, e, n, i) {
|
|
11717
11720
|
for (;i.push(e), !e.leaf && i.length - 1 !== n; ) {
|
|
11718
11721
|
let n, i = 1 / 0, r = 1 / 0;
|
|
11719
11722
|
for (let s = 0; s < e.children.length; s++) {
|
|
@@ -11725,8 +11728,8 @@
|
|
|
11725
11728
|
return e;
|
|
11726
11729
|
}
|
|
11727
11730
|
Rr(t, e, n) {
|
|
11728
|
-
const i = n ? t : this.toBBox(t), r = [], s = this.
|
|
11729
|
-
for (s.children.push(t),
|
|
11731
|
+
const i = n ? t : this.toBBox(t), r = [], s = this.Lr(i, this.data, e, r);
|
|
11732
|
+
for (s.children.push(t), zu(s, i); e >= 0 && r[e].children.length > this.Ir; ) this.Hr(r, e),
|
|
11730
11733
|
e--;
|
|
11731
11734
|
this.Ur(i, r, e);
|
|
11732
11735
|
}
|
|
@@ -11749,7 +11752,7 @@
|
|
|
11749
11752
|
return i || n - e;
|
|
11750
11753
|
}
|
|
11751
11754
|
Vr(t, e, n) {
|
|
11752
|
-
const i = t.leaf ? this.compareMinX :
|
|
11755
|
+
const i = t.leaf ? this.compareMinX : Lu, r = t.leaf ? this.compareMinY : Hu;
|
|
11753
11756
|
this.Br(t, e, n, i) < this.Br(t, e, n, r) && t.children.sort(i);
|
|
11754
11757
|
}
|
|
11755
11758
|
Br(t, e, n, i) {
|
|
@@ -11758,18 +11761,18 @@
|
|
|
11758
11761
|
let a = Vu(s) + Vu(o);
|
|
11759
11762
|
for (let i = e; i < n - e; i++) {
|
|
11760
11763
|
const e = t.children[i];
|
|
11761
|
-
|
|
11764
|
+
zu(s, t.leaf ? r(e) : e), a += Vu(s);
|
|
11762
11765
|
}
|
|
11763
11766
|
for (let i = n - e - 1; i >= e; i--) {
|
|
11764
11767
|
const e = t.children[i];
|
|
11765
|
-
|
|
11768
|
+
zu(o, t.leaf ? r(e) : e), a += Vu(o);
|
|
11766
11769
|
}
|
|
11767
11770
|
return a;
|
|
11768
11771
|
}
|
|
11769
11772
|
Ur(t, e, n) {
|
|
11770
|
-
for (let i = n; i >= 0; i--)
|
|
11773
|
+
for (let i = n; i >= 0; i--) zu(e[i], t);
|
|
11771
11774
|
}
|
|
11772
|
-
|
|
11775
|
+
zr(t) {
|
|
11773
11776
|
for (let e, n = t.length - 1; n >= 0; n--) 0 === t[n].children.length ? n > 0 ? (e = t[n - 1].children,
|
|
11774
11777
|
e.splice(e.indexOf(t[n]), 1)) : this.clear() : Nu(t[n], this.toBBox);
|
|
11775
11778
|
}
|
|
@@ -11786,15 +11789,15 @@
|
|
|
11786
11789
|
r || (r = $u(null)), r.minX = 1 / 0, r.minY = 1 / 0, r.maxX = -1 / 0, r.maxY = -1 / 0;
|
|
11787
11790
|
for (let s = e; s < n; s++) {
|
|
11788
11791
|
const e = t.children[s];
|
|
11789
|
-
|
|
11792
|
+
zu(r, t.leaf ? i(e) : e);
|
|
11790
11793
|
}
|
|
11791
11794
|
return r;
|
|
11792
11795
|
}
|
|
11793
|
-
function
|
|
11796
|
+
function zu(t, e) {
|
|
11794
11797
|
return t.minX = Math.min(t.minX, e.minX), t.minY = Math.min(t.minY, e.minY), t.maxX = Math.max(t.maxX, e.maxX),
|
|
11795
11798
|
t.maxY = Math.max(t.maxY, e.maxY), t;
|
|
11796
11799
|
}
|
|
11797
|
-
function
|
|
11800
|
+
function Lu(t, e) {
|
|
11798
11801
|
return t.minX - e.minX;
|
|
11799
11802
|
}
|
|
11800
11803
|
function Hu(t, e) {
|
|
@@ -12176,7 +12179,7 @@
|
|
|
12176
12179
|
return null;
|
|
12177
12180
|
}
|
|
12178
12181
|
}
|
|
12179
|
-
class _c extends
|
|
12182
|
+
class _c extends zh {
|
|
12180
12183
|
static fromJSON(t) {
|
|
12181
12184
|
return au(t, "ExtrudePolygonLayer", _c);
|
|
12182
12185
|
}
|
|
@@ -12274,7 +12277,7 @@
|
|
|
12274
12277
|
return super.draw(t, e);
|
|
12275
12278
|
}
|
|
12276
12279
|
createPainter() {
|
|
12277
|
-
const t =
|
|
12280
|
+
const t = zh.get3DPainterClass("lit");
|
|
12278
12281
|
this.painterSymbol = P({}, Sc), this.sidePainterSymbol = P({}, Sc), this.Sr(this.painterSymbol, t.getBloomSymbol());
|
|
12279
12282
|
const e = P({}, kc, this.layer.options.dataConfig || {});
|
|
12280
12283
|
this.layer.options.material && (this.painterSymbol.material = this.layer.options.material),
|
|
@@ -12380,11 +12383,11 @@
|
|
|
12380
12383
|
* https://github.com/gdsmith/jquery.easing/
|
|
12381
12384
|
*/
|
|
12382
12385
|
var Tc = Math.pow, Fc = Math.sqrt, Oc = Math.sin, Ic = Math.cos, Cc = Math.PI, Ec = 1.70158, Dc = 1.525 * Ec, Nc = 2 * Cc / 3, Rc = 2 * Cc / 4.5;
|
|
12383
|
-
function
|
|
12386
|
+
function zc(t) {
|
|
12384
12387
|
var e = 7.5625, n = 2.75;
|
|
12385
12388
|
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;
|
|
12386
12389
|
}
|
|
12387
|
-
function
|
|
12390
|
+
function Lc(t, e) {
|
|
12388
12391
|
switch (t = t.toLowerCase()) {
|
|
12389
12392
|
case "swing":
|
|
12390
12393
|
return function(t) {
|
|
@@ -12526,17 +12529,17 @@
|
|
|
12526
12529
|
|
|
12527
12530
|
case "easeinbounce":
|
|
12528
12531
|
return function(t) {
|
|
12529
|
-
return 1 -
|
|
12532
|
+
return 1 - zc(1 - t);
|
|
12530
12533
|
}(e);
|
|
12531
12534
|
|
|
12532
12535
|
case "easeoutbounce":
|
|
12533
12536
|
return function(t) {
|
|
12534
|
-
return
|
|
12537
|
+
return zc(t);
|
|
12535
12538
|
}(e);
|
|
12536
12539
|
|
|
12537
12540
|
case "easeinoutbounce":
|
|
12538
12541
|
return function(t) {
|
|
12539
|
-
return t < .5 ? (1 -
|
|
12542
|
+
return t < .5 ? (1 - zc(1 - 2 * t)) / 2 : (1 + zc(2 * t - 1)) / 2;
|
|
12540
12543
|
}(e);
|
|
12541
12544
|
}
|
|
12542
12545
|
throw new Error("Unsupported easing function:" + t);
|
|
@@ -12728,7 +12731,7 @@
|
|
|
12728
12731
|
let e = null, n = r.animation;
|
|
12729
12732
|
if (n) {
|
|
12730
12733
|
const i = t.sceneConfig.animationDuration || 800, r = (t.timestamp - h.ns) / i, s = h[0].properties.createTime;
|
|
12731
|
-
h.ns - s < i && r < 1 && (!0 !== n && 1 !== n || (n = "linear"), e = "linear" === n ? r :
|
|
12734
|
+
h.ns - s < i && r < 1 && (!0 !== n && 1 !== n || (n = "linear"), e = "linear" === n ? r : Lc(n, r),
|
|
12732
12735
|
c = !0);
|
|
12733
12736
|
}
|
|
12734
12737
|
s.addMesh(h, e, t), this.Kr[l] = 1;
|
|
@@ -13169,14 +13172,14 @@
|
|
|
13169
13172
|
if (i) {
|
|
13170
13173
|
let r = "";
|
|
13171
13174
|
for (const s in i) i[s] && (r += s, n[s].uniformDeclares && e.push(...n[s].uniformDeclares),
|
|
13172
|
-
n[s].defines &&
|
|
13175
|
+
n[s].defines && Ll(t, n[s].defines));
|
|
13173
13176
|
this.ys = r;
|
|
13174
13177
|
}
|
|
13175
13178
|
}
|
|
13176
13179
|
setIncludeUniformValues(t, e) {
|
|
13177
13180
|
if (e && e.isRenderingTerrain && this.isTerrainSkin()) return;
|
|
13178
13181
|
const n = e && e.includes;
|
|
13179
|
-
if (n) for (const i in n) n[i] && e[i].renderUniforms &&
|
|
13182
|
+
if (n) for (const i in n) n[i] && e[i].renderUniforms && Ll(t, e[i].renderUniforms);
|
|
13180
13183
|
}
|
|
13181
13184
|
createGeometries(t, e) {
|
|
13182
13185
|
if (!t.length) return Tf;
|
|
@@ -13279,7 +13282,7 @@
|
|
|
13279
13282
|
};
|
|
13280
13283
|
}
|
|
13281
13284
|
prepareRender(t) {
|
|
13282
|
-
if (this.
|
|
13285
|
+
if (this.Le === t.timestamp) return;
|
|
13283
13286
|
if (!this.createFnTypeConfig) return;
|
|
13284
13287
|
const e = this.scene.getMeshes();
|
|
13285
13288
|
if (!e || !e.length) return;
|
|
@@ -13289,7 +13292,7 @@
|
|
|
13289
13292
|
if (n && !n(e[r])) continue;
|
|
13290
13293
|
const {symbolIndex: s} = e[r].properties, o = this.getSymbolDef(s);
|
|
13291
13294
|
if (!o) continue;
|
|
13292
|
-
this.
|
|
13295
|
+
this.Le = t.timestamp;
|
|
13293
13296
|
const a = this.getFnTypeConfig(s);
|
|
13294
13297
|
ef(this.regl, o, a, e[r], i);
|
|
13295
13298
|
}
|
|
@@ -13381,14 +13384,14 @@
|
|
|
13381
13384
|
As(t) {
|
|
13382
13385
|
const e = t && t.feature;
|
|
13383
13386
|
if (!e || !e.customProps) return t;
|
|
13384
|
-
const n =
|
|
13385
|
-
return n.feature =
|
|
13387
|
+
const n = Ll({}, t);
|
|
13388
|
+
return n.feature = Ll({}, t.feature), delete n.feature.customProps, n.feature.properties = Ll({}, e.properties, e.properties[El], e.properties[Dl]),
|
|
13386
13389
|
delete n.feature.properties[Dl], delete n.feature.properties[El], delete n.feature.properties.$layer,
|
|
13387
13390
|
delete n.feature.properties.$type, n;
|
|
13388
13391
|
}
|
|
13389
13392
|
updateSceneConfig() {}
|
|
13390
13393
|
updateDataConfig(t) {
|
|
13391
|
-
return
|
|
13394
|
+
return Ll(this.dataConfig, t), !0;
|
|
13392
13395
|
}
|
|
13393
13396
|
deleteMesh(t, e) {
|
|
13394
13397
|
if (t) if (this.scene.removeMesh(t), Array.isArray(t)) for (let i = 0; i < t.length; i++) {
|
|
@@ -13403,7 +13406,7 @@
|
|
|
13403
13406
|
}
|
|
13404
13407
|
}
|
|
13405
13408
|
startFrame(t) {
|
|
13406
|
-
this.Ms || (this.init(t), this.Ms = !0), this.
|
|
13409
|
+
this.Ms || (this.init(t), this.Ms = !0), this.Le !== t.timestamp && (this.ps = !1,
|
|
13407
13410
|
this._e = !1, this.xs = 0), this.scene.clear();
|
|
13408
13411
|
}
|
|
13409
13412
|
resize() {}
|
|
@@ -13467,7 +13470,7 @@
|
|
|
13467
13470
|
fs() {
|
|
13468
13471
|
const t = this.getMap(), e = [], n = () => (e[0] = t.getZoom(), e);
|
|
13469
13472
|
this.Fs = [], this.K = [];
|
|
13470
|
-
for (let t = 0; t < this.symbolDef.length; t++) this.Fs[t] = ml.loadSymbolFnTypes(
|
|
13473
|
+
for (let t = 0; t < this.symbolDef.length; t++) this.Fs[t] = ml.loadSymbolFnTypes(Ll({}, this.symbolDef[t]), n),
|
|
13471
13474
|
this.symbolDef[t] && x(this.symbolDef[t].visible) && (this.K[t] = b(this.symbolDef[t].visible));
|
|
13472
13475
|
}
|
|
13473
13476
|
getFnTypeConfig(t) {
|
|
@@ -13549,10 +13552,10 @@
|
|
|
13549
13552
|
}
|
|
13550
13553
|
Ns(t, e) {
|
|
13551
13554
|
if (!this.picking) return;
|
|
13552
|
-
if (this.Rs || (this.Rs = new n.reshader.Scene), !this._s && (this.
|
|
13555
|
+
if (this.Rs || (this.Rs = new n.reshader.Scene), !this._s && (this.zs(), !this._s)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
|
|
13553
13556
|
const i = this.getUniformValues(this.getMap(), this.bs);
|
|
13554
13557
|
this.ws(i);
|
|
13555
|
-
const r = this.
|
|
13558
|
+
const r = this.Ls(e);
|
|
13556
13559
|
if (r.length) for (let n = 0; n < r.length; n++) {
|
|
13557
13560
|
const s = r[n].geometry.properties.feaIdPickingMap;
|
|
13558
13561
|
if (s) {
|
|
@@ -13571,7 +13574,7 @@
|
|
|
13571
13574
|
}
|
|
13572
13575
|
}
|
|
13573
13576
|
}
|
|
13574
|
-
|
|
13577
|
+
Ls(t) {
|
|
13575
13578
|
const e = [], n = this.scene.getMeshes();
|
|
13576
13579
|
for (let i = 0; i < n.length; i++) {
|
|
13577
13580
|
const r = n[i], s = r.geometry.properties.feaIdPickingMap;
|
|
@@ -13581,12 +13584,12 @@
|
|
|
13581
13584
|
}
|
|
13582
13585
|
outlineAll(t) {
|
|
13583
13586
|
if (!this.picking) return;
|
|
13584
|
-
if (!this._s && (this.
|
|
13587
|
+
if (!this._s && (this.zs(), !this._s)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
|
|
13585
13588
|
const e = this.getUniformValues(this.getMap(), this.bs);
|
|
13586
13589
|
this.ws(e), e.highlightPickingId = -1;
|
|
13587
13590
|
for (let n = 0; n < this._s.length; n++) this.renderer.render(this._s[n], e, this.scene, t);
|
|
13588
13591
|
}
|
|
13589
|
-
|
|
13592
|
+
zs() {
|
|
13590
13593
|
if (!this.picking) return;
|
|
13591
13594
|
const t = this.layer.getRenderer().canvas;
|
|
13592
13595
|
this._s = [];
|
|
@@ -13779,7 +13782,7 @@
|
|
|
13779
13782
|
};
|
|
13780
13783
|
t.iconAtlas && t.iconAtlas.image && (t.iconAtlas.image.dataType = t.type, t.iconAtlas.image.type = "icon"),
|
|
13781
13784
|
t.glyphAtlas && t.glyphAtlas.image && (t.glyphAtlas.image.type = "glyph");
|
|
13782
|
-
const i =
|
|
13785
|
+
const i = Ll({}, t.data), r = {
|
|
13783
13786
|
primitive: this.getPrimitive(),
|
|
13784
13787
|
positionSize: t.positionSize
|
|
13785
13788
|
};
|
|
@@ -13790,7 +13793,7 @@
|
|
|
13790
13793
|
}, t.iconAtlas && (s.properties.iconAtlas = t.iconAtlas.image, s.properties.iconPositions = t.iconAtlas.positions),
|
|
13791
13794
|
t.glyphAtlas && (s.properties.glyphAtlas = t.glyphAtlas.image), qc(e) || (s.properties.aFeaIds = t.featureIds,
|
|
13792
13795
|
this.Vs(s, t)), t.markerPlacement && (s.properties.markerPlacement = t.markerPlacement),
|
|
13793
|
-
t.textPlacement && (s.properties.textPlacement = t.textPlacement),
|
|
13796
|
+
t.textPlacement && (s.properties.textPlacement = t.textPlacement), Ll(s.properties, t.properties),
|
|
13794
13797
|
{
|
|
13795
13798
|
geometry: s,
|
|
13796
13799
|
symbolIndex: t.symbolIndex
|
|
@@ -13846,14 +13849,14 @@
|
|
|
13846
13849
|
}
|
|
13847
13850
|
return t.texture(o);
|
|
13848
13851
|
}
|
|
13849
|
-
const
|
|
13852
|
+
const zf = [ 0, 0 ], Lf = [];
|
|
13850
13853
|
function Hf(t) {
|
|
13851
|
-
if (!t.properties.iconPositions) return
|
|
13854
|
+
if (!t.properties.iconPositions) return zf;
|
|
13852
13855
|
let e, n = 0;
|
|
13853
|
-
for (const i in t.properties.iconPositions) if (e = i, n++, n > 1) return
|
|
13854
|
-
if (!e) return
|
|
13856
|
+
for (const i in t.properties.iconPositions) if (e = i, n++, n > 1) return zf;
|
|
13857
|
+
if (!e) return zf;
|
|
13855
13858
|
const i = t.properties.iconPositions[e], r = i.displaySize[0], s = i.displaySize[1];
|
|
13856
|
-
return
|
|
13859
|
+
return Lf[0] = r, Lf[1] = s, Lf;
|
|
13857
13860
|
}
|
|
13858
13861
|
const Uf = n.mat4.identity([]), Vf = {
|
|
13859
13862
|
polygonFill: [ 1, 1, 1, 1 ],
|
|
@@ -14078,6 +14081,10 @@
|
|
|
14078
14081
|
paint(t) {
|
|
14079
14082
|
this.isShadowIncludeChanged(t) && (this.shader.dispose(), this.Ys(t)), super.paint(t);
|
|
14080
14083
|
}
|
|
14084
|
+
isEnableStencil(t) {
|
|
14085
|
+
const e = this.layer.getRenderer();
|
|
14086
|
+
return !(!!(t && t.isRenderingTerrain && this.isTerrainSkin()) || !e.isEnableTileStencil || !e.isEnableTileStencil()) && "VectorTileLayer" === this.layer.getJSONType();
|
|
14087
|
+
}
|
|
14081
14088
|
init(t) {
|
|
14082
14089
|
const e = this.regl, i = this.canvas, r = {
|
|
14083
14090
|
x: (t, e) => e.viewport ? e.viewport.x : 0,
|
|
@@ -14086,18 +14093,18 @@
|
|
|
14086
14093
|
height: (t, e) => e.viewport ? e.viewport.height : i ? i.height : 1
|
|
14087
14094
|
};
|
|
14088
14095
|
this.renderer = new n.reshader.Renderer(e);
|
|
14089
|
-
const s =
|
|
14096
|
+
const s = this.layer.getRenderer(), o = {
|
|
14090
14097
|
viewport: r,
|
|
14091
14098
|
stencil: {
|
|
14092
|
-
enable: () =>
|
|
14099
|
+
enable: () => this.isEnableStencil(t),
|
|
14093
14100
|
func: {
|
|
14094
|
-
cmp: () =>
|
|
14095
|
-
ref: (t, e) =>
|
|
14101
|
+
cmp: () => s.isEnableTileStencil && s.isEnableTileStencil() ? "=" : "<=",
|
|
14102
|
+
ref: (t, e) => s.isEnableTileStencil && s.isEnableTileStencil() ? e.stencilRef : e.level
|
|
14096
14103
|
},
|
|
14097
14104
|
op: {
|
|
14098
14105
|
fail: "keep",
|
|
14099
14106
|
zfail: "keep",
|
|
14100
|
-
zpass: () =>
|
|
14107
|
+
zpass: () => s.isEnableTileStencil && s.isEnableTileStencil() ? "zero" : "replace"
|
|
14101
14108
|
}
|
|
14102
14109
|
},
|
|
14103
14110
|
depth: {
|
|
@@ -14122,7 +14129,7 @@
|
|
|
14122
14129
|
offset: this.getPolygonOffset()
|
|
14123
14130
|
}
|
|
14124
14131
|
};
|
|
14125
|
-
if (this.Ys(t,
|
|
14132
|
+
if (this.Ys(t, o), this.pickingFBO) {
|
|
14126
14133
|
const t = [];
|
|
14127
14134
|
this.picking = [ new n.reshader.FBORayPicking(this.renderer, {
|
|
14128
14135
|
vert: Nf,
|
|
@@ -14133,7 +14140,7 @@
|
|
|
14133
14140
|
return n.mat4.multiply(t, i.projViewMatrix, i.modelMatrix), t;
|
|
14134
14141
|
}
|
|
14135
14142
|
} ],
|
|
14136
|
-
extraCommandProps:
|
|
14143
|
+
extraCommandProps: o
|
|
14137
14144
|
}, this.pickingFBO, this.getMap()) ];
|
|
14138
14145
|
}
|
|
14139
14146
|
}
|
|
@@ -14828,58 +14835,63 @@
|
|
|
14828
14835
|
isCollides(t) {
|
|
14829
14836
|
const e = this.layer, i = e.getMap(), r = i.getDevicePixelRatio();
|
|
14830
14837
|
if (n.vec4.scale(ud, t, 1 / r), i.isOffscreen(ud)) return -1;
|
|
14831
|
-
|
|
14838
|
+
const s = e.getCollisionIndex(), o = this.sceneConfig.collisionBufferSize || e.options.collisionBufferSize || 0;
|
|
14839
|
+
return o && (t = pd(ud, t, o)), +s.collides(t);
|
|
14832
14840
|
}
|
|
14833
14841
|
insertCollisionBox(t) {
|
|
14834
|
-
this.layer.getCollisionIndex().
|
|
14842
|
+
const e = this.layer, n = e.getCollisionIndex(), i = this.sceneConfig.collisionBufferSize || e.options.collisionBufferSize || 0;
|
|
14843
|
+
let r = t;
|
|
14844
|
+
i && (r = t.Ro = t.Ro || [], t = pd(r, t, i)), n.insertBox(r);
|
|
14835
14845
|
}
|
|
14836
14846
|
addCollisionDebugBox(t, e) {
|
|
14837
14847
|
if (t && t.length) if (Array.isArray(t[0])) for (let n = 0; n < t.length; n++) {
|
|
14838
14848
|
const i = t[n];
|
|
14839
|
-
this.
|
|
14840
|
-
} else this.
|
|
14849
|
+
this.zo(i, e);
|
|
14850
|
+
} else this.zo(t, e);
|
|
14841
14851
|
}
|
|
14842
|
-
|
|
14852
|
+
zo(t, e) {
|
|
14843
14853
|
if (!t) return;
|
|
14844
14854
|
const i = this.Lo = this.Lo || {
|
|
14845
14855
|
aPosition: [],
|
|
14846
14856
|
aVisible: [],
|
|
14847
14857
|
indices: []
|
|
14848
|
-
}, r = this.
|
|
14849
|
-
|
|
14850
|
-
const
|
|
14858
|
+
}, r = this.sceneConfig.collisionBufferSize || this.layer.options.collisionBufferSize || 0;
|
|
14859
|
+
r && (t = pd(ud, t, r));
|
|
14860
|
+
const s = this.getMap(), o = s.getDevicePixelRatio();
|
|
14861
|
+
if (n.vec4.scale(ud, t, 1 / o), s.isOffscreen(ud)) return;
|
|
14862
|
+
const a = i.aPosition.length / 2;
|
|
14851
14863
|
i.aPosition.push(t[0], t[1], t[2], t[1], t[2], t[3], t[0], t[3]), i.aVisible.push(e, e, e, e),
|
|
14852
|
-
i.indices.push(
|
|
14864
|
+
i.indices.push(a, a + 1, a + 1, a + 2, a + 2, a + 3, a + 3, a);
|
|
14853
14865
|
}
|
|
14854
14866
|
updateCollision(t) {
|
|
14855
|
-
super.updateCollision(t), this.fo(), this.
|
|
14856
|
-
this.
|
|
14857
|
-
(this.getMap().isZooming() || this.
|
|
14867
|
+
super.updateCollision(t), this.fo(), this.Ho(), this.Uo && this.Uo.length && (this.Vo(),
|
|
14868
|
+
this.Uo && (this.setToRedraw(), this.scene.addMesh(this.Uo)));
|
|
14869
|
+
(this.getMap().isZooming() || this.Uo && this.Uo.length) && (this.jo(), this.Bo(this.scene.getMeshes()));
|
|
14858
14870
|
}
|
|
14859
14871
|
paint(t) {
|
|
14860
14872
|
const e = super.paint(t);
|
|
14861
|
-
return this.
|
|
14873
|
+
return this.Go(t), !1 === this.no && this.setToRedraw(), e;
|
|
14862
14874
|
}
|
|
14863
14875
|
shouldIgnoreBackground() {
|
|
14864
|
-
return !this.getMap().isZooming() && !this.
|
|
14876
|
+
return !this.getMap().isZooming() && !this.Uo;
|
|
14865
14877
|
}
|
|
14866
|
-
|
|
14878
|
+
Ho() {
|
|
14867
14879
|
const t = this.getMap(), e = t.isZooming();
|
|
14868
14880
|
if (!e && this.xo) {
|
|
14869
14881
|
const t = this.layer.getRenderer();
|
|
14870
|
-
this.
|
|
14871
|
-
} else e && !this.xo && (this.
|
|
14872
|
-
if (e) this
|
|
14882
|
+
this.Uo = this.scene.getMeshes().filter(e => !t.isForeground(e) && !e.properties.isLinePlacement);
|
|
14883
|
+
} else e && !this.xo && (this.Wo = t.getResolution());
|
|
14884
|
+
if (e) this.$o && (clearTimeout(this.$o), delete this.Ao, delete this.$o), this.Ao = this.Wo && t.getResolution() > this.Wo; else if (this.xo && !this.$o) {
|
|
14873
14885
|
let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
|
|
14874
|
-
Vl(t) && (t = sd), Vl(e) && (e = id), this
|
|
14875
|
-
delete this.Ao, delete this
|
|
14886
|
+
Vl(t) && (t = sd), Vl(e) && (e = id), this.$o = setTimeout(() => {
|
|
14887
|
+
delete this.Ao, delete this.$o;
|
|
14876
14888
|
}, t + e + 1);
|
|
14877
14889
|
}
|
|
14878
14890
|
this.xo = e;
|
|
14879
14891
|
}
|
|
14880
|
-
|
|
14892
|
+
Go(t) {
|
|
14881
14893
|
if (!this.Lo || !this.layer.options.debugCollision) return;
|
|
14882
|
-
this.No || this
|
|
14894
|
+
this.No || this.Xo();
|
|
14883
14895
|
const {aPosition: e, aVisible: i, indices: r} = this.Lo;
|
|
14884
14896
|
if (!this.Eo) {
|
|
14885
14897
|
const t = new n.reshader.Geometry({
|
|
@@ -14889,15 +14901,15 @@
|
|
|
14889
14901
|
positionSize: 2,
|
|
14890
14902
|
primitive: "lines"
|
|
14891
14903
|
});
|
|
14892
|
-
this.Eo = new n.reshader.Mesh(t), this.
|
|
14904
|
+
this.Eo = new n.reshader.Mesh(t), this.Yo = new n.reshader.Scene, this.Yo.addMesh(this.Eo);
|
|
14893
14905
|
}
|
|
14894
14906
|
const s = this.Eo.geometry;
|
|
14895
14907
|
s.updateData("aPosition", new Float32Array(e)), s.updateData("aVisible", new Uint8Array(i)),
|
|
14896
14908
|
s.setElements(r), this.No.render(this.Do, {
|
|
14897
14909
|
size: [ this.canvas.width, this.canvas.height ]
|
|
14898
|
-
}, this.
|
|
14910
|
+
}, this.Yo, this.getRenderFBO(t)), delete this.Lo;
|
|
14899
14911
|
}
|
|
14900
|
-
|
|
14912
|
+
Xo() {
|
|
14901
14913
|
const t = this.regl;
|
|
14902
14914
|
this.No = new n.reshader.Renderer(t);
|
|
14903
14915
|
const e = this.canvas, i = {
|
|
@@ -14926,17 +14938,17 @@
|
|
|
14926
14938
|
}
|
|
14927
14939
|
});
|
|
14928
14940
|
}
|
|
14929
|
-
|
|
14941
|
+
Vo() {
|
|
14930
14942
|
let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
|
|
14931
14943
|
Vl(t) && (t = sd), Vl(e) && (e = id);
|
|
14932
14944
|
const n = this.layer.getRenderer(), i = n.getCurrentTileZoom(), r = n.getFrameTimestamp(), s = [];
|
|
14933
|
-
for (let o = 0; o < this.
|
|
14934
|
-
const a = this.
|
|
14945
|
+
for (let o = 0; o < this.Uo.length; o++) {
|
|
14946
|
+
const a = this.Uo[o], l = a.properties.tile;
|
|
14935
14947
|
!a.Mo && n.isBackTile(l.id) && (a.Mo = r);
|
|
14936
14948
|
const h = l.z - i > 0 ? 2 * (l.z - i) - 1 : 2 * (i - l.z);
|
|
14937
14949
|
a.properties.level = h, n.isForeground(a) || a.Mo && r - a.Mo > t + e ? delete a.Mo : s.push(a);
|
|
14938
14950
|
}
|
|
14939
|
-
delete this.
|
|
14951
|
+
delete this.Uo, s.length && (this.Uo = s);
|
|
14940
14952
|
}
|
|
14941
14953
|
isEnableCollision() {
|
|
14942
14954
|
return this.layer.options.collision && !!this.sceneConfig.collision;
|
|
@@ -14947,7 +14959,7 @@
|
|
|
14947
14959
|
isMeshUniquePlaced(t) {
|
|
14948
14960
|
return this.isMeshIterable(t);
|
|
14949
14961
|
}
|
|
14950
|
-
|
|
14962
|
+
jo() {
|
|
14951
14963
|
if (!this.isEnableUniquePlacement()) return;
|
|
14952
14964
|
const t = this.scene.getMeshes(), e = (t, e, n, i) => {
|
|
14953
14965
|
const {start: r, end: s} = e[0], o = t.geometry.properties, a = o.elements;
|
|
@@ -14967,29 +14979,29 @@
|
|
|
14967
14979
|
this.isMeshUniquePlaced(i) && this.forEachBox(i, e);
|
|
14968
14980
|
}
|
|
14969
14981
|
}
|
|
14970
|
-
|
|
14982
|
+
Bo(t) {
|
|
14971
14983
|
if (!this.isEnableUniquePlacement()) return;
|
|
14972
14984
|
const e = this.getMap().getZoom();
|
|
14973
|
-
let n = !this.
|
|
14974
|
-
if (!n) for (let e = 0; e < t.length; e++) if (!this.
|
|
14985
|
+
let n = !this.qo || this.Jo !== e;
|
|
14986
|
+
if (!n) for (let e = 0; e < t.length; e++) if (!this.qo[t[e].properties.meshKey]) {
|
|
14975
14987
|
n = !0;
|
|
14976
14988
|
break;
|
|
14977
14989
|
}
|
|
14978
14990
|
if (!n) return;
|
|
14979
|
-
this.
|
|
14991
|
+
this.Jo = e, this.Ko = {}, this.qo = {}, t = t.sort(dd);
|
|
14980
14992
|
const i = this.getMap().getGLScale(), r = {};
|
|
14981
14993
|
for (let e = 0; e < t.length; e++) {
|
|
14982
14994
|
const n = t[e];
|
|
14983
14995
|
if (!n.geometry) continue;
|
|
14984
14996
|
const {meshKey: s} = n.properties;
|
|
14985
|
-
this.
|
|
14997
|
+
this.qo[s] = 1;
|
|
14986
14998
|
const {uniquePlacements: o} = n.geometry.properties;
|
|
14987
14999
|
if (o) for (let t = 0; t < o.length; t++) {
|
|
14988
15000
|
if (!o[t]) continue;
|
|
14989
15001
|
const {key: e, index: s} = o[t], a = this.wo(n), l = fd(e, i), h = r[l];
|
|
14990
15002
|
if (h) {
|
|
14991
15003
|
const t = h.length, e = h[t - 3].properties.meshKey, i = h[t - 2], r = h[t - 1];
|
|
14992
|
-
this.
|
|
15004
|
+
this.Ko[e] = this.Ko[e] || {}, this.Ko[e][r] = 1, this.Zo(a, s, i, r), h.push(n, a, s);
|
|
14993
15005
|
} else r[l] = [ n, a, s ];
|
|
14994
15006
|
}
|
|
14995
15007
|
}
|
|
@@ -15002,16 +15014,16 @@
|
|
|
15002
15014
|
}
|
|
15003
15015
|
}
|
|
15004
15016
|
}
|
|
15005
|
-
|
|
15017
|
+
Zo(t, e, n, i) {
|
|
15006
15018
|
if (void 0 !== n[i]) if (void 0 === t[e]) t[e] = n[i]; else {
|
|
15007
15019
|
let r = t[e];
|
|
15008
15020
|
Math.abs(n[i]) > Math.abs(r) ? t[e] = n[i] : n[i] = t[e];
|
|
15009
15021
|
} else void 0 !== t[e] && (n[i] = t[e]);
|
|
15010
15022
|
}
|
|
15011
15023
|
vo(t, e) {
|
|
15012
|
-
return this.
|
|
15024
|
+
return this.Ko && this.Ko[t] && this.Ko[t][e];
|
|
15013
15025
|
}
|
|
15014
|
-
|
|
15026
|
+
Qo(t, e) {
|
|
15015
15027
|
const {symbolIndex: n} = t.properties, i = n.type || 0;
|
|
15016
15028
|
let r = t.properties._collidesBoxes;
|
|
15017
15029
|
r || (r = t.properties._collidesBoxes = []);
|
|
@@ -15029,15 +15041,15 @@
|
|
|
15029
15041
|
}
|
|
15030
15042
|
return s[o];
|
|
15031
15043
|
}
|
|
15032
|
-
|
|
15033
|
-
let e = this.
|
|
15034
|
-
if (e || (e = this.
|
|
15044
|
+
ta(t) {
|
|
15045
|
+
let e = this.ea;
|
|
15046
|
+
if (e || (e = this.ea = []), !e[t]) {
|
|
15035
15047
|
e[t] = [];
|
|
15036
15048
|
for (let n = 0; n < t; n++) e[t][n] = {};
|
|
15037
15049
|
}
|
|
15038
15050
|
return e[t];
|
|
15039
15051
|
}
|
|
15040
|
-
|
|
15052
|
+
na(t) {
|
|
15041
15053
|
if (!t || !t.geometry) return !0;
|
|
15042
15054
|
if (!t.geometry.properties.glyphAtlas || !t.material.get("isHalo") || t.geometry.data.aTextHaloRadius && t.geometry.properties.hasHalo) return !1;
|
|
15043
15055
|
if (t.geometry.data.aTextHaloRadius && !t.geometry.properties.hasHalo) return !0;
|
|
@@ -15051,105 +15063,108 @@
|
|
|
15051
15063
|
const n = e.properties.level - t.properties.level;
|
|
15052
15064
|
return 0 === n ? t.properties.meshKey - e.properties.meshKey : n;
|
|
15053
15065
|
}
|
|
15054
|
-
|
|
15055
|
-
|
|
15056
|
-
|
|
15066
|
+
function pd(t, e, n) {
|
|
15067
|
+
return t[0] = e[0] - n, t[1] = e[1] - n, t[2] = e[2] + n, t[3] = e[3] + n, t;
|
|
15068
|
+
}
|
|
15069
|
+
var yd = "#include <gl2_vert>\n#define SHADER_NAME MARKER\n#define RAD 0.0174532925\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\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_MARKER_WIDTH\nattribute float aMarkerWidth;\n#else\nuniform float markerWidth;\n#endif\n#ifdef HAS_MARKER_HEIGHT\nattribute float aMarkerHeight;\n#else\nuniform float markerHeight;\n#endif\n#ifdef HAS_MARKER_DX\nattribute float aMarkerDx;\n#else\nuniform float markerDx;\n#endif\n#ifdef HAS_MARKER_DY\nattribute float aMarkerDy;\n#else\nuniform float markerDy;\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#ifdef HAS_ROTATION\nattribute float aRotation;\n#else\nuniform float markerRotation;\n#endif\n#ifdef HAS_PAD_OFFSET\nattribute float aPadOffsetX;\nattribute float aPadOffsetY;\n#endif\nuniform float cameraToCenterDistance;\nuniform mat4 positionMatrix;\nuniform mat4 projViewModelMatrix;\nuniform float markerPerspectiveRatio;\nuniform vec2 iconSize;\nuniform vec2 texSize;\nuniform vec2 canvasSize;\nuniform float mapPitch;\nuniform float mapRotation;\nuniform float zoomScale;\nuniform float tileRatio;\nuniform float layerScale;\nuniform float isRenderingTerrain;\n#include <vt_position_vert>\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vOpacity;\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\nvoid main() {\n vec3 c = unpackVTPosition();\n#ifdef HAS_MARKER_WIDTH\nfloat d = aMarkerWidth;\n#else\nfloat d = markerWidth;\n#endif\n#ifdef HAS_MARKER_HEIGHT\nfloat e = aMarkerHeight;\n#else\nfloat e = markerHeight;\n#endif\n#ifdef HAS_MARKER_DX\nfloat f = aMarkerDx;\n#else\nfloat f = markerDx;\n#endif\n#ifdef HAS_MARKER_DY\nfloat h = aMarkerDy;\n#else\nfloat h = markerDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nfloat i = aPitchAlign;\n#else\nfloat i = pitchWithMap;\n#endif\n#if defined(HAS_ROTATION_ALIGN)\nfloat j = aRotationAlign;\n#else\nfloat j = rotateWithMap;\n#endif\ngl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\n float k = gl_Position.w;\n float l;\n if(isRenderingTerrain == 1. && i == 1.) {\n l = 1.;\n } else {\n float m = (1. - cameraToCenterDistance / k) * markerPerspectiveRatio;\n l = clamp(.5 + .5 * (1. - m), .0, 4.);\n }\n#ifdef HAS_ROTATION\nfloat n = -aRotation / 9362. - mapRotation * j;\n#else\nfloat n = -markerRotation - mapRotation * j;\n#endif\nif(i == 1.) {\n n += mapRotation;\n }\n float o = sin(n);\n float u = cos(n);\n mat2 v = mat2(u, -1. * o, o, u);\n vec2 A = (aShape / 10.0);\n if(i == 1. && flipY == .0) {\n A *= vec2(1., -1.);\n }\n#ifdef HAS_PAD_OFFSET\nA = (A / iconSize * vec2(d, e) + vec2(aPadOffsetX - 1., aPadOffsetY)) * layerScale;\n#else\nA = A / iconSize * vec2(d, e) * layerScale;\n#endif\nA = v * A;\n if(i == .0) {\n vec2 B = A * 2. / canvasSize;\n gl_Position.xy += B * l * k;\n } else {\n float C;\n if(isRenderingTerrain == 1.) {\n C = 1.;\n } else {\n C = k / cameraToCenterDistance;\n }\n vec2 B = A;\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c + vec3(B, .0) * tileRatio / zoomScale * C * l, 1.);\n }\n gl_Position.xy += vec2(f, -h) * 2. / canvasSize * k;\n#ifndef PICKING_MODE\nvTexCoord = aTexCoord / texSize;\n#ifdef ENABLE_COLLISION\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity *= aColorOpacity / 255.;\n#endif\nhighlight_setVarying();\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}";
|
|
15070
|
+
const md = [], gd = [], vd = [], xd = [], bd = [], wd = [];
|
|
15071
|
+
function Ad(t, e, i, r, s, o, a, l, h, u, c, f, d, p) {
|
|
15057
15072
|
const {tileRatio: y, tileResolution: m} = h, g = y / (m / u.getResolution()) * (c / u.cameraToCenterDistance) * f;
|
|
15058
15073
|
n.vec2.scale(i, i, g), n.vec2.scale(r, r, g), n.vec2.scale(s, s, g), n.vec2.scale(o, o, g),
|
|
15059
|
-
n.vec3.set(
|
|
15060
|
-
n.vec3.set(
|
|
15061
|
-
n.vec3.add(
|
|
15062
|
-
cf(i,
|
|
15063
|
-
cf(o,
|
|
15064
|
-
n.vec2.set(
|
|
15065
|
-
n.vec4.set(t,
|
|
15066
|
-
}
|
|
15067
|
-
function
|
|
15074
|
+
n.vec3.set(md, i[0], i[1], d ? i[2] / p : 0), n.vec3.set(gd, r[0], r[1], d ? r[2] / p : 0),
|
|
15075
|
+
n.vec3.set(vd, s[0], s[1], d ? s[2] / p : 0), n.vec3.set(xd, o[0], o[1], d ? o[2] / p : 0),
|
|
15076
|
+
n.vec3.add(md, md, e), n.vec3.add(gd, gd, e), n.vec3.add(vd, vd, e), n.vec3.add(xd, xd, e),
|
|
15077
|
+
cf(i, md, a, u.width, u.height), cf(r, gd, a, u.width, u.height), cf(s, vd, a, u.width, u.height),
|
|
15078
|
+
cf(o, xd, a, u.width, u.height), n.vec2.set(bd, Math.min(i[0], r[0], s[0], o[0]), Math.min(i[1], r[1], s[1], o[1])),
|
|
15079
|
+
n.vec2.set(wd, Math.max(i[0], r[0], s[0], o[0]), Math.max(i[1], r[1], s[1], o[1])),
|
|
15080
|
+
n.vec4.set(t, bd[0] + l[0], bd[1] + l[1], wd[0] + l[0], wd[1] + l[1]);
|
|
15081
|
+
}
|
|
15082
|
+
function Md(t, e, i, r, s, o, a, l) {
|
|
15068
15083
|
1 !== l && (n.vec2.scale(i, i, l), n.vec2.scale(r, r, l), n.vec2.scale(s, s, l),
|
|
15069
|
-
n.vec2.scale(o, o, l)), n.vec2.set(
|
|
15070
|
-
n.vec2.set(
|
|
15071
|
-
n.vec4.set(t, e[0] +
|
|
15084
|
+
n.vec2.scale(o, o, l)), n.vec2.set(bd, Math.min(i[0], r[0], s[0], o[0]), Math.min(i[1], r[1], s[1], o[1])),
|
|
15085
|
+
n.vec2.set(wd, Math.max(i[0], r[0], s[0], o[0]), Math.max(i[1], r[1], s[1], o[1])),
|
|
15086
|
+
n.vec4.set(t, e[0] + bd[0] + a[0], e[1] + bd[1] - a[1], e[0] + wd[0] + a[0], e[1] + wd[1] - a[1]);
|
|
15072
15087
|
}
|
|
15073
|
-
function
|
|
15088
|
+
function _d(t, e, i, r, s) {
|
|
15074
15089
|
e -= i * r, 1 === s && (e += i);
|
|
15075
15090
|
const o = Math.sin(e), a = Math.cos(e);
|
|
15076
15091
|
return n.mat2.set(t, a, -o, o, a);
|
|
15077
15092
|
}
|
|
15078
|
-
const
|
|
15079
|
-
function
|
|
15080
|
-
const o = e.material.uniforms, a = s.cameraToCenterDistance, l = e.geometry.properties, h = this.getSymbol(l.symbolIndex), u = e.geometry.desc.positionSize, c = l.aAnchor, f = n.vec3.set(
|
|
15093
|
+
const Sd = [], kd = [], Pd = [], Td = [], Fd = [], Od = [], Id = [], Cd = [], Ed = [ 1, -1 ], Dd = [ 1, 1 ];
|
|
15094
|
+
function Nd(t, e, i, r, s) {
|
|
15095
|
+
const o = e.material.uniforms, a = s.cameraToCenterDistance, l = e.geometry.properties, h = this.getSymbol(l.symbolIndex), u = e.geometry.desc.positionSize, c = l.aAnchor, f = n.vec3.set(Sd, c[i * u], c[i * u + 1], 2 === u ? 0 : c[i * u + 2]), {aTerrainAltitude: d} = l;
|
|
15081
15096
|
if (d) {
|
|
15082
15097
|
const t = 100 * d[2 * i];
|
|
15083
15098
|
t && (f[2] += t);
|
|
15084
15099
|
}
|
|
15085
|
-
let p = cf(
|
|
15100
|
+
let p = cf(kd, f, r, s.width, s.height);
|
|
15086
15101
|
const y = p[2];
|
|
15087
15102
|
let m = 1;
|
|
15088
15103
|
if (o.markerPerspectiveRatio) {
|
|
15089
15104
|
m = Hl(.5 + .5 * (1 - (1 - a / y) * o.markerPerspectiveRatio), 0, 4);
|
|
15090
15105
|
}
|
|
15091
|
-
const {aShape: g, aMarkerDx: v, aMarkerDy: x, aMarkerWidth: b, aMarkerHeight: w, aPitchAlign: A, aRotationAlign: M, aRotation: _} = l, S = v ? v[i] : h.markerDx, k = x ? x[i] : h.markerDy, P = A ? A[i] : o.pitchWithMap, T = M ? M[i] : o.rotateWithMap, F = n.vec2.set(
|
|
15092
|
-
let O = n.vec2.set(
|
|
15093
|
-
0 === o.flipY && 1 === P && (n.vec2.multiply(O, O,
|
|
15094
|
-
n.vec2.multiply(C, C,
|
|
15106
|
+
const {aShape: g, aMarkerDx: v, aMarkerDy: x, aMarkerWidth: b, aMarkerHeight: w, aPitchAlign: A, aRotationAlign: M, aRotation: _} = l, S = v ? v[i] : h.markerDx, k = x ? x[i] : h.markerDy, P = A ? A[i] : o.pitchWithMap, T = M ? M[i] : o.rotateWithMap, F = n.vec2.set(Cd, S || 0, -(k || 0));
|
|
15107
|
+
let O = n.vec2.set(Td, g[2 * i] / 10, g[2 * i + 1] / 10), I = n.vec2.set(Fd, g[2 * i + 2] / 10, g[2 * i + 3] / 10), C = n.vec2.set(Od, g[2 * i + 4] / 10, g[2 * i + 5] / 10), E = n.vec2.set(Id, g[2 * i + 6] / 10, g[2 * i + 7] / 10);
|
|
15108
|
+
0 === o.flipY && 1 === P && (n.vec2.multiply(O, O, Ed), n.vec2.multiply(I, I, Ed),
|
|
15109
|
+
n.vec2.multiply(C, C, Ed), n.vec2.multiply(E, E, Ed));
|
|
15095
15110
|
const [D, N] = Hf(e.geometry);
|
|
15096
15111
|
let R = b ? b[i] : h.markerWidth;
|
|
15097
15112
|
Vl(R) && (R = D || 15);
|
|
15098
|
-
let
|
|
15099
|
-
Vl(
|
|
15100
|
-
const
|
|
15101
|
-
n.vec2.mul(O, O,
|
|
15113
|
+
let z = w ? w[i] : h.markerHeight;
|
|
15114
|
+
Vl(z) && (z = N || 15);
|
|
15115
|
+
const L = n.vec2.set(Dd, R / 2048, z / 2048);
|
|
15116
|
+
n.vec2.mul(O, O, L), n.vec2.mul(I, I, L), n.vec2.mul(C, C, L), n.vec2.mul(E, E, L);
|
|
15102
15117
|
const H = -(_ ? _[i] / 9362 : -(h.markerRotation || 0) * Math.PI / 180), U = s.getBearing() * Math.PI / 180;
|
|
15103
15118
|
if (U * T || H) {
|
|
15104
|
-
const t =
|
|
15119
|
+
const t = _d(Pd, H, U, T, P);
|
|
15105
15120
|
O = n.vec2.transformMat2(O, O, t), I = n.vec2.transformMat2(I, I, t), C = n.vec2.transformMat2(C, C, t),
|
|
15106
15121
|
E = n.vec2.transformMat2(E, E, t);
|
|
15107
15122
|
}
|
|
15108
|
-
1 === P ?
|
|
15109
|
-
n.vec2.multiply(C, C,
|
|
15123
|
+
1 === P ? Ad(t, f, O, I, C, E, r, F, o, s, y, m) : (n.vec2.multiply(O, O, Ed), n.vec2.multiply(I, I, Ed),
|
|
15124
|
+
n.vec2.multiply(C, C, Ed), n.vec2.multiply(E, E, Ed), Md(t, p, O, I, C, E, F, m));
|
|
15110
15125
|
const V = this.getMap().getDevicePixelRatio();
|
|
15111
15126
|
return 1 !== V && (t[0] *= V, t[1] *= V, t[2] *= V, t[3] *= V), t;
|
|
15112
15127
|
}
|
|
15113
|
-
const
|
|
15114
|
-
function
|
|
15128
|
+
const Rd = [], zd = [], Ld = [], Hd = [], Ud = [], Vd = [], jd = [ 1, -1 ];
|
|
15129
|
+
function Bd(t, e, i, r, s, o, a, l, h) {
|
|
15115
15130
|
const u = r.material.uniforms, c = h.cameraToCenterDistance, f = r.geometry.properties, d = this.getSymbol(f.symbolIndex), p = "line" === d.textPlacement && !Jl(d), y = i[2];
|
|
15116
15131
|
let m = 1;
|
|
15117
15132
|
if (u.textPerspectiveRatio) {
|
|
15118
15133
|
m = Hl(.5 + .5 * (1 - (1 - c / y) * u.textPerspectiveRatio), 0, 4);
|
|
15119
15134
|
}
|
|
15120
|
-
const {aTextDx: g, aTextDy: v, aPitchAlign: x, aRotationAlign: b, aRotation: w} = r.geometry.properties, A = g ? g[a] : d.textDx, M = v ? v[a] : d.textDy, _ = x ? x[a] : u.pitchWithMap, S = b ? b[a] : u.rotateWithMap, k = n.vec2.set(
|
|
15135
|
+
const {aTextDx: g, aTextDy: v, aPitchAlign: x, aRotationAlign: b, aRotation: w} = r.geometry.properties, A = g ? g[a] : d.textDx, M = v ? v[a] : d.textDy, _ = x ? x[a] : u.pitchWithMap, S = b ? b[a] : u.rotateWithMap, k = n.vec2.set(Vd, A || 0, -(M || 0));
|
|
15121
15136
|
if (p) {
|
|
15122
15137
|
const {aOffset: r, aShape: s} = f, o = r.length !== s.length;
|
|
15123
15138
|
let c, d, p, g;
|
|
15124
|
-
if (o ? (c = n.vec3.set(
|
|
15125
|
-
d = n.vec3.set(Ld, r[3 * a + 3] / 10, r[3 * a + 4] / 10, r[3 * a + 5] / 10), p = n.vec3.set(
|
|
15126
|
-
g = n.vec3.set(
|
|
15127
|
-
d = n.vec2.set(Ld, r[2 * a + 2] / 10, r[2 * a + 3] / 10), p = n.vec2.set(
|
|
15128
|
-
g = n.vec2.set(
|
|
15139
|
+
if (o ? (c = n.vec3.set(zd, r[3 * a] / 10, r[3 * a + 1] / 10, r[3 * a + 2] / 10),
|
|
15140
|
+
d = n.vec3.set(Ld, r[3 * a + 3] / 10, r[3 * a + 4] / 10, r[3 * a + 5] / 10), p = n.vec3.set(Hd, r[3 * a + 6] / 10, r[3 * a + 7] / 10, r[3 * a + 8] / 10),
|
|
15141
|
+
g = n.vec3.set(Ud, r[3 * a + 9] / 10, r[3 * a + 10] / 10, r[3 * a + 11] / 10)) : (c = n.vec2.set(zd, r[2 * a] / 10, r[2 * a + 1] / 10),
|
|
15142
|
+
d = n.vec2.set(Ld, r[2 * a + 2] / 10, r[2 * a + 3] / 10), p = n.vec2.set(Hd, r[2 * a + 4] / 10, r[2 * a + 5] / 10),
|
|
15143
|
+
g = n.vec2.set(Ud, r[2 * a + 6] / 10, r[2 * a + 7] / 10)), 1 === _) {
|
|
15129
15144
|
const n = R(h.getResolution(), h);
|
|
15130
|
-
|
|
15131
|
-
} else n.vec2.multiply(c, c,
|
|
15132
|
-
n.vec2.multiply(g, g,
|
|
15145
|
+
Ad(t, e, c, d, p, g, l, k, u, h, y, m, o, n);
|
|
15146
|
+
} else n.vec2.multiply(c, c, jd), n.vec2.multiply(d, d, jd), n.vec2.multiply(p, p, jd),
|
|
15147
|
+
n.vec2.multiply(g, g, jd), Md(t, i, c, d, p, g, k, m);
|
|
15133
15148
|
} else {
|
|
15134
15149
|
const {aShape: r} = f;
|
|
15135
|
-
let o = n.vec2.set(
|
|
15136
|
-
0 === u.flipY && 1 === _ && (n.vec2.multiply(o, o,
|
|
15137
|
-
n.vec2.multiply(g, g,
|
|
15150
|
+
let o = n.vec2.set(zd, r[2 * a] / 10, -r[2 * a + 1] / 10), c = n.vec2.set(Ld, r[2 * a + 2] / 10, -r[2 * a + 3] / 10), g = n.vec2.set(Hd, r[2 * a + 4] / 10, -r[2 * a + 5] / 10), v = n.vec2.set(Ud, r[2 * a + 6] / 10, -r[2 * a + 7] / 10);
|
|
15151
|
+
0 === u.flipY && 1 === _ && (n.vec2.multiply(o, o, jd), n.vec2.multiply(c, c, jd),
|
|
15152
|
+
n.vec2.multiply(g, g, jd), n.vec2.multiply(v, v, jd));
|
|
15138
15153
|
const x = w ? w[a] / 9362 : (d.textRotation || 0) * Math.PI / 180, b = p ? 0 : h.getBearing() * Math.PI / 180;
|
|
15139
15154
|
if (x || b) {
|
|
15140
|
-
const t =
|
|
15155
|
+
const t = _d(Rd, x, b, S, _);
|
|
15141
15156
|
o = n.vec2.transformMat2(o, o, t), c = n.vec2.transformMat2(c, c, t), g = n.vec2.transformMat2(g, g, t),
|
|
15142
15157
|
v = n.vec2.transformMat2(v, v, t);
|
|
15143
15158
|
}
|
|
15144
15159
|
const A = s / 24;
|
|
15145
15160
|
n.vec2.scale(o, o, A), n.vec2.scale(c, c, A), n.vec2.scale(g, g, A), n.vec2.scale(v, v, A),
|
|
15146
|
-
1 === _ ?
|
|
15161
|
+
1 === _ ? Ad(t, e, o, c, g, v, l, k, u, h, y, m) : Md(t, i, o, c, g, v, k, m);
|
|
15147
15162
|
}
|
|
15148
15163
|
o = o || 0, t[0] -= o + 1, t[1] -= o + 1, t[2] += o + 1, t[3] += o + 1;
|
|
15149
15164
|
const P = this.getMap().getDevicePixelRatio();
|
|
15150
15165
|
return 1 !== P && (t[0] *= P, t[1] *= P, t[2] *= P, t[3] *= P), t;
|
|
15151
15166
|
}
|
|
15152
|
-
function
|
|
15167
|
+
function Gd(t, e, i) {
|
|
15153
15168
|
const r = e.geometry.desc.positionSize, {aAnchor: s, aAltitude: o, aTerrainAltitude: a} = e.geometry.properties, l = i * r;
|
|
15154
15169
|
if (o ? n.vec3.set(t, s[l], s[l + 1], o[i]) : 3 === r ? fl.unpackPosition(t, s[l], s[l + 1], s[l + 2]) : n.vec3.set(t, s[l], s[l + 1], 0),
|
|
15155
15170
|
a) {
|
|
@@ -15158,7 +15173,7 @@
|
|
|
15158
15173
|
}
|
|
15159
15174
|
return t;
|
|
15160
15175
|
}
|
|
15161
|
-
const
|
|
15176
|
+
const Wd = {
|
|
15162
15177
|
textFill: [ 0, 0, 0, 1 ],
|
|
15163
15178
|
textOpacity: 1,
|
|
15164
15179
|
textPitchAlignment: 0,
|
|
@@ -15173,14 +15188,14 @@
|
|
|
15173
15188
|
textDy: 0,
|
|
15174
15189
|
textRotation: 0
|
|
15175
15190
|
};
|
|
15176
|
-
function
|
|
15191
|
+
function $d(t, e, i, r, s, o, a, l, h) {
|
|
15177
15192
|
const u = [];
|
|
15178
15193
|
if (e.isDisposed() || 0 === e.data.aPosition.length) return u;
|
|
15179
15194
|
const c = e.properties.glyphAtlas;
|
|
15180
15195
|
if (!c) return u;
|
|
15181
15196
|
if (0 === r.textSize || 0 === r.textOpacity) return u;
|
|
15182
15197
|
if (Kc(e, r, o), !e.properties.aCount) {
|
|
15183
|
-
|
|
15198
|
+
Xd.call(this, e, a || h, l);
|
|
15184
15199
|
const {aTextSize: t, aTextDx: n, aTextDy: i, aPitchAlign: r, aRotationAlign: s, aRotation: o, aOverlap: u, aAltitude: c} = e.data;
|
|
15185
15200
|
if (t) {
|
|
15186
15201
|
const n = (Jc + "aTextSize").trim();
|
|
@@ -15222,12 +15237,12 @@
|
|
|
15222
15237
|
texture: f,
|
|
15223
15238
|
texSize: [ c.width, c.height ]
|
|
15224
15239
|
};
|
|
15225
|
-
|
|
15240
|
+
Yd(e, d, s);
|
|
15226
15241
|
let p = !1;
|
|
15227
15242
|
s.textOpacity < 1 && (p = !0), e.properties.memorySize = e.getMemorySize(), e.generateBuffers(t, {
|
|
15228
15243
|
excludeElementsInVAO: !0
|
|
15229
15244
|
});
|
|
15230
|
-
const y = new n.reshader.Material(d,
|
|
15245
|
+
const y = new n.reshader.Material(d, Wd), m = new n.reshader.Mesh(e, y, {
|
|
15231
15246
|
disableVAO: !0,
|
|
15232
15247
|
transparent: p,
|
|
15233
15248
|
castShadow: !1,
|
|
@@ -15245,8 +15260,8 @@
|
|
|
15245
15260
|
texSize: [ c.width, c.height ],
|
|
15246
15261
|
isHalo: 0
|
|
15247
15262
|
};
|
|
15248
|
-
|
|
15249
|
-
const r = new n.reshader.Material(t,
|
|
15263
|
+
Yd(e, t, s);
|
|
15264
|
+
const r = new n.reshader.Material(t, Wd), o = new n.reshader.Mesh(e, r, {
|
|
15250
15265
|
disableVAO: !0,
|
|
15251
15266
|
transparent: p,
|
|
15252
15267
|
castShadow: !1,
|
|
@@ -15273,7 +15288,7 @@
|
|
|
15273
15288
|
t.setDefines(n), t.properties.symbolIndex = e.properties.symbolIndex;
|
|
15274
15289
|
}), u;
|
|
15275
15290
|
}
|
|
15276
|
-
function
|
|
15291
|
+
function Xd(t, e, n) {
|
|
15277
15292
|
const i = this.getSymbol(t.properties.symbolIndex), r = "line" === t.properties.textPlacement && !Jl(i), {aPosition: s, aShape: o} = t.data, a = s.length / t.desc.positionSize;
|
|
15278
15293
|
if (t.properties.aPickingId = t.data.aPickingId, t.properties.aCount = t.data.aCount,
|
|
15279
15294
|
delete t.data.aCount, (e || r) && (t.properties.aAnchor = s, t.properties.aShape = o),
|
|
@@ -15302,17 +15317,17 @@
|
|
|
15302
15317
|
}
|
|
15303
15318
|
}
|
|
15304
15319
|
}
|
|
15305
|
-
function
|
|
15306
|
-
void 0 === e.isHalo && (e.isHalo = 1), Bl(e, "textOpacity", n, "textOpacity",
|
|
15307
|
-
Bl(e, "textFill", n, "textFill",
|
|
15308
|
-
Bl(e, "textHaloBlur", n, "textHaloBlur",
|
|
15309
|
-
Bl(e, "textHaloOpacity", n, "textHaloOpacity",
|
|
15310
|
-
Bl(e, "rotateWithMap", n, "textRotationAlignment",
|
|
15311
|
-
Bl(e, "pitchWithMap", n, "textPitchAlignment",
|
|
15312
|
-
Bl(e, "textSize", n, "textSize",
|
|
15313
|
-
Bl(e, "textDy", n, "textDy",
|
|
15314
|
-
}
|
|
15315
|
-
function
|
|
15320
|
+
function Yd(t, e, n) {
|
|
15321
|
+
void 0 === e.isHalo && (e.isHalo = 1), Bl(e, "textOpacity", n, "textOpacity", Wd.textOpacity),
|
|
15322
|
+
Bl(e, "textFill", n, "textFill", Wd.textFill, $l()), Bl(e, "textHaloFill", n, "textHaloFill", Wd.textHaloFill, $l()),
|
|
15323
|
+
Bl(e, "textHaloBlur", n, "textHaloBlur", Wd.textHaloBlur), Bl(e, "textHaloRadius", n, "textHaloRadius", Wd.textHaloRadius),
|
|
15324
|
+
Bl(e, "textHaloOpacity", n, "textHaloOpacity", Wd.textHaloOpacity), Bl(e, "textPerspectiveRatio", n, "textPerspectiveRatio", Wd.textPerspectiveRatio, e => "line" === t.properties.textPlacement ? 1 : e),
|
|
15325
|
+
Bl(e, "rotateWithMap", n, "textRotationAlignment", Wd.textRotationAlignment, t => +("map" === t)),
|
|
15326
|
+
Bl(e, "pitchWithMap", n, "textPitchAlignment", Wd.textPitchAlignment, t => +("map" === t)),
|
|
15327
|
+
Bl(e, "textSize", n, "textSize", Wd.textSize), Bl(e, "textDx", n, "textDx", Wd.textDx),
|
|
15328
|
+
Bl(e, "textDy", n, "textDy", Wd.textDy), Bl(e, "textRotation", n, "textRotation", Wd.textRotation, t => t * Math.PI / 180);
|
|
15329
|
+
}
|
|
15330
|
+
function qd(t, e) {
|
|
15316
15331
|
const i = [];
|
|
15317
15332
|
return {
|
|
15318
15333
|
uniforms: [ {
|
|
@@ -15370,7 +15385,7 @@
|
|
|
15370
15385
|
}
|
|
15371
15386
|
};
|
|
15372
15387
|
}
|
|
15373
|
-
function
|
|
15388
|
+
function Jd(t, e) {
|
|
15374
15389
|
const n = b(e.textFill), i = b(e.textSize), r = b(e.textHaloFill), s = b(e.textHaloRadius), o = b(e.textHaloOpacity), a = b(e.textDx), l = b(e.textDy), h = b(e.textOpacity), u = w(e.textPitchAlignment), c = w(e.textRotationAlignment), f = b(e.textRotation), d = w(e.textAllowOverlapFn), p = w(e.textIgnorePlacement), y = {}, m = new Int16Array(1), g = new Uint16Array(1);
|
|
15375
15390
|
return [ {
|
|
15376
15391
|
attrName: "aTextFill",
|
|
@@ -15390,7 +15405,7 @@
|
|
|
15390
15405
|
type: Uint8Array,
|
|
15391
15406
|
width: 1,
|
|
15392
15407
|
evaluate: (e, n) => {
|
|
15393
|
-
let r = i(t.getZoom(), e) ||
|
|
15408
|
+
let r = i(t.getZoom(), e) || Wd.textSize;
|
|
15394
15409
|
return x(r) && (r = this.evaluateInFnTypeConfig(r, n, t, e)), m[0] = r, m[0];
|
|
15395
15410
|
}
|
|
15396
15411
|
}, {
|
|
@@ -15497,24 +15512,24 @@
|
|
|
15497
15512
|
}
|
|
15498
15513
|
} ];
|
|
15499
15514
|
}
|
|
15500
|
-
const
|
|
15501
|
-
function
|
|
15515
|
+
const Kd = [], Zd = [], Qd = [], tp = [];
|
|
15516
|
+
function ep(t, e, n, i, r, s, o) {
|
|
15502
15517
|
t = 1 === t ? 1 : 0;
|
|
15503
15518
|
const a = this.getMap(), l = e.geometry.properties, h = this.getSymbol(l.symbolIndex), u = "line" === l.textPlacement && !Jl(h), {aTextSize: c, aTextHaloRadius: f, aShape: d} = l;
|
|
15504
15519
|
let p = c ? c[n[r]] : e.properties.textSize;
|
|
15505
|
-
null == p && (p =
|
|
15506
|
-
const y = f ? f[n[r]] : e.properties.textHaloRadius, m =
|
|
15507
|
-
let v =
|
|
15520
|
+
null == p && (p = Wd.textSize);
|
|
15521
|
+
const y = f ? f[n[r]] : e.properties.textHaloRadius, m = Gd(Qd, e, n[r]), {aProjectedAnchor: g} = e.geometry.properties;
|
|
15522
|
+
let v = tp;
|
|
15508
15523
|
const x = 3 * n[r];
|
|
15509
|
-
g && -999999 !== g[x] ? (
|
|
15510
|
-
const b = i, {boxes: w, collision: A} = this.
|
|
15524
|
+
g && -999999 !== g[x] ? (tp[0] = g[x], tp[1] = g[x + 1], tp[2] = g[x + 2]) : v = cf(tp, m, o, a.width, a.height);
|
|
15525
|
+
const b = i, {boxes: w, collision: A} = this.Qo(e, r);
|
|
15511
15526
|
let M = 0;
|
|
15512
15527
|
if (u || 1 === e.material.uniforms.rotateWithMap || h.textRotation) {
|
|
15513
15528
|
let i = 0;
|
|
15514
15529
|
for (let s = r; s < r + 6 * b; s += 6) {
|
|
15515
15530
|
const r = w[M] = w[M] || [];
|
|
15516
15531
|
M++;
|
|
15517
|
-
const l =
|
|
15532
|
+
const l = Bd.call(this, r, m, v, e, p, y, n[s], o, a);
|
|
15518
15533
|
if (!t) {
|
|
15519
15534
|
const e = this.isCollides(l);
|
|
15520
15535
|
1 === e ? t = 1 : -1 === e && i++;
|
|
@@ -15526,7 +15541,7 @@
|
|
|
15526
15541
|
for (let h = r; h < s; h += 6) {
|
|
15527
15542
|
const r = d[2 * n[h] + 1];
|
|
15528
15543
|
if (l !== r || h === s - 6) {
|
|
15529
|
-
const u = n[h === s - 6 ? h : h - 6], c =
|
|
15544
|
+
const u = n[h === s - 6 ? h : h - 6], c = Bd.call(this, Kd, m, v, e, p, y, i, o, a), f = Bd.call(this, Zd, m, v, e, p, y, u, o, a), d = w[M] = w[M] || [];
|
|
15530
15545
|
M++, d[0] = Math.min(c[0], f[0]), d[1] = Math.min(c[1], f[1]), d[2] = Math.max(c[2], f[2]),
|
|
15531
15546
|
d[3] = Math.max(c[3], f[3]), i = n[h], l = r, !t && this.isCollides(d) && (t = 1);
|
|
15532
15547
|
}
|
|
@@ -15534,25 +15549,25 @@
|
|
|
15534
15549
|
}
|
|
15535
15550
|
return A.collides = t, A;
|
|
15536
15551
|
}
|
|
15537
|
-
function
|
|
15552
|
+
function np(t, e) {
|
|
15538
15553
|
const i = function(t, e) {
|
|
15539
15554
|
const {aPickingId: n, features: i} = t.geometry.properties, r = n[e];
|
|
15540
15555
|
return (i && i[r] && i[r].feature).label;
|
|
15541
15556
|
}(t, e);
|
|
15542
15557
|
return i ? function(t, e, i) {
|
|
15543
15558
|
if (!i) return null;
|
|
15544
|
-
const r = t.localTransform, s =
|
|
15545
|
-
n.vec4.set(
|
|
15546
|
-
const o = n.vec4.transformMat4(
|
|
15559
|
+
const r = t.localTransform, s = Gd(ip, t, e);
|
|
15560
|
+
n.vec4.set(rp, s[0], s[1], s[2], 1);
|
|
15561
|
+
const o = n.vec4.transformMat4(rp, rp, r);
|
|
15547
15562
|
let a = 0;
|
|
15548
15563
|
for (let t = 0; t < i.length; t++) a += i.charCodeAt(t);
|
|
15549
15564
|
return [ Math.floor(o[0]), Math.floor(o[1]), Math.floor(o[2]), a ];
|
|
15550
15565
|
}(t, e, i) : null;
|
|
15551
15566
|
}
|
|
15552
|
-
const
|
|
15553
|
-
var
|
|
15554
|
-
const
|
|
15555
|
-
function
|
|
15567
|
+
const ip = [], rp = [];
|
|
15568
|
+
var sp = "#define SHADER_NAME TEXT_VERT\n#define RAD 0.0174532925\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\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 positionMatrix;\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;\nuniform float isRenderingTerrain;\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#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\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 * positionMatrix * vec4(c, 1.);\n float l = gl_Position.w;\n float m;\n if(isRenderingTerrain == 1. && h == 1.) {\n m = 1.;\n } else {\n float n = (1. - cameraToCenterDistance / l) * textPerspectiveRatio;\n m = clamp(.5 + .5 * (1. - n), .0, 4.);\n }\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;\n if(isRenderingTerrain == 1.) {\n B = 1.;\n } else {\n B = l / cameraToCenterDistance;\n }\n if(h == .0) {\n vec2 C = j * 2. / canvasSize;\n gl_Position.xy += C * m * l;\n } else {\n float D;\n if(isRenderingTerrain == 1.) {\n D = tileRatio / zoomScale;\n } else {\n D = tileRatio / zoomScale * B * m;\n }\n vec2 C = j;\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c + vec3(C, .0) * D, 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\nhighlight_setVarying();\n#else\n#ifdef ENABLE_COLLISION\nbool E = aOpacity == 255.;\n#else\nbool E = true;\n#endif\nfbo_picking_setData(gl_Position.w, E);\n#endif\n}", op = "#define SHADER_NAME TEXT_FRAG\n#define HAS_HIGHLIGHT_COLOR_POINT 1\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;\nuniform float alphaTest;\n#ifdef HAS_TEXT_HALO_OPACITY\nvarying float vTextHaloOpacity;\n#else\nuniform float textHaloOpacity;\n#endif\nuniform float layerOpacity;\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\n#include <highlight_frag>\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 * layerOpacity);\n if(gl_FragColor.a < alphaTest) {\n discard;\n }\n gl_FragColor = highlight_blendColor(gl_FragColor);\n}";
|
|
15569
|
+
const ap = new Uint16Array(1), lp = new Int8Array(1);
|
|
15570
|
+
function hp(t, e, n) {
|
|
15556
15571
|
Kc(t, e, n), function(t) {
|
|
15557
15572
|
const {aMarkerWidth: e, aMarkerHeight: n, aMarkerDx: i, aMarkerDy: r, aPitchAlign: s, aRotationAlign: o, aRotation: a, aOverlap: l} = t.data;
|
|
15558
15573
|
if (e) {
|
|
@@ -15589,7 +15604,7 @@
|
|
|
15589
15604
|
}
|
|
15590
15605
|
}(t);
|
|
15591
15606
|
}
|
|
15592
|
-
function
|
|
15607
|
+
function up(t, e) {
|
|
15593
15608
|
const n = b(e.markerWidth), i = b(e.markerHeight), r = b(e.markerDx), s = b(e.markerDy), o = b(e.markerOpacity), a = b(e.markerTextFit), l = w(e.markerPitchAlignment), h = w(e.markerRotationAlignment), u = b(e.markerRotation), c = w(e.markerAllowOverlapFn), f = w(e.markerIgnorePlacement), d = new Int16Array(1), p = new Uint16Array(1);
|
|
15594
15609
|
return [ {
|
|
15595
15610
|
attrName: "aMarkerWidth",
|
|
@@ -15689,7 +15704,7 @@
|
|
|
15689
15704
|
}
|
|
15690
15705
|
} ];
|
|
15691
15706
|
}
|
|
15692
|
-
function
|
|
15707
|
+
function cp(t, e, n, i) {
|
|
15693
15708
|
if (!n || !i || "none" === i) return;
|
|
15694
15709
|
const r = function(t, e, n) {
|
|
15695
15710
|
let i = t.properties.textFitFn;
|
|
@@ -15758,10 +15773,10 @@
|
|
|
15758
15773
|
if (!s) return [];
|
|
15759
15774
|
return n;
|
|
15760
15775
|
}(e, n);
|
|
15761
|
-
i.length && (e.properties.labelShape = i,
|
|
15776
|
+
i.length && (e.properties.labelShape = i, fp.call(this, t, e, n));
|
|
15762
15777
|
}
|
|
15763
15778
|
}
|
|
15764
|
-
function
|
|
15779
|
+
function fp(t, e) {
|
|
15765
15780
|
const n = this.getSymbolDef(e.properties.symbolIndex), i = n.markerTextFit, r = e.properties;
|
|
15766
15781
|
let s = "both" === i || "width" === i, o = "both" === i || "height" === i;
|
|
15767
15782
|
if (x(n.markerTextFit)) {
|
|
@@ -15804,20 +15819,20 @@
|
|
|
15804
15819
|
e.data.aMarkerHeight = new Uint16Array(u);
|
|
15805
15820
|
}
|
|
15806
15821
|
const c = this.getSymbolDef(e.properties.textGeo.properties.symbolIndex), f = b(c.textSize);
|
|
15807
|
-
|
|
15822
|
+
pp.call(this, t, e), (!x(c.textSize) || f.isZoomConstant && f.isFeatureConstant) && (r.isFitConstant = !0);
|
|
15808
15823
|
}
|
|
15809
|
-
const
|
|
15810
|
-
function
|
|
15824
|
+
const dp = [ 0, 0, 0, 0 ];
|
|
15825
|
+
function pp(t, e) {
|
|
15811
15826
|
const n = e.properties.textGeo;
|
|
15812
15827
|
if (!n) return;
|
|
15813
15828
|
const i = n.properties, r = e.properties;
|
|
15814
15829
|
if (r.isFitConstant || !r.labelShape || !r.labelShape.length) return;
|
|
15815
15830
|
const s = this.getSymbolDef(e.properties.symbolIndex), o = this.getSymbolDef(n.properties.symbolIndex).textSize;
|
|
15816
15831
|
let a;
|
|
15817
|
-
x(o) && (a = i.
|
|
15818
|
-
const l = s.markerTextFitPadding ||
|
|
15832
|
+
x(o) && (a = i.ia ? i.ia : i.ia = b(o));
|
|
15833
|
+
const l = s.markerTextFitPadding || dp;
|
|
15819
15834
|
let h;
|
|
15820
|
-
x(l) && (h = r.
|
|
15835
|
+
x(l) && (h = r.ra ? r.ra : r.ra = w(l));
|
|
15821
15836
|
const u = t.getZoom(), {fitIcons: c, fitWidthIcons: f, fitHeightIcons: d} = r, {aMarkerWidth: p, aMarkerHeight: y, labelShape: m} = r, g = r.elements || e.elements, {features: v, aPickingId: A} = r, M = (t, e, n, i) => {
|
|
15822
15837
|
const s = m[4 * e], c = m[4 * e + 1], f = m[4 * e + 2], d = m[4 * e + 3];
|
|
15823
15838
|
if (!(s || c || f || d)) return;
|
|
@@ -15831,20 +15846,20 @@
|
|
|
15831
15846
|
if (x(T)) {
|
|
15832
15847
|
T = (_.fitPaddingFn = _.fitPaddingFn || w(T))(u, _);
|
|
15833
15848
|
}
|
|
15834
|
-
if (T = T ||
|
|
15849
|
+
if (T = T || dp, T[0] === T[2] && T[1] === T[3] || (k = r.aPadOffsetX, P = r.aPadOffsetY,
|
|
15835
15850
|
k || (k = r.aPadOffsetX = new Int8Array(p.length), P = r.aPadOffsetY = new Int8Array(p.length))),
|
|
15836
15851
|
p && n) {
|
|
15837
15852
|
const e = Math.abs((f - s) / 10 * S) + (T[1] + T[3] || 0);
|
|
15838
|
-
if (
|
|
15853
|
+
if (ap[0] = e, p[t] !== ap[0] && (Yl(p, ap[0], t, t + 4), p.dirty = !0), k) {
|
|
15839
15854
|
const e = (T[1] + T[3]) / 2 - T[3];
|
|
15840
|
-
|
|
15855
|
+
lp[0] = e, k[t] !== lp[0] && (Yl(k, e, t, t + 4), k.dirty = !0);
|
|
15841
15856
|
}
|
|
15842
15857
|
}
|
|
15843
15858
|
if (y && i) {
|
|
15844
15859
|
const e = Math.abs((d - c) / 10 * S) + (T[0] + T[2] || 0);
|
|
15845
|
-
if (
|
|
15860
|
+
if (ap[0] = e, y[t] !== ap[0] && (Yl(y, ap[0], t, t + 4), y.dirty = !0), P) {
|
|
15846
15861
|
const e = T[0] - (T[0] + T[2]) / 2;
|
|
15847
|
-
|
|
15862
|
+
lp[0] = e, P[t] !== lp[0] && (Yl(P, e, t, t + 4), P.dirty = !0);
|
|
15848
15863
|
}
|
|
15849
15864
|
}
|
|
15850
15865
|
};
|
|
@@ -15869,29 +15884,29 @@
|
|
|
15869
15884
|
const {aPadOffsetX: _, aPadOffsetY: S} = r;
|
|
15870
15885
|
_ && (e.data.aPadOffsetX = _, e.data.aPadOffsetY = S);
|
|
15871
15886
|
}
|
|
15872
|
-
const
|
|
15887
|
+
const yp = function(t) {
|
|
15873
15888
|
const e = this.layer.getRenderer();
|
|
15874
|
-
return !this.
|
|
15875
|
-
}, yp = function(t) {
|
|
15876
|
-
const e = this.layer.getRenderer();
|
|
15877
|
-
return !(this.ea(t) || e.isForeground(t) || !t.geometry.properties.iconAtlas || t.geometry.properties.isEmpty);
|
|
15889
|
+
return !this.na(t) && e.isForeground(t) && !!t.geometry.properties.iconAtlas && !t.geometry.properties.isEmpty;
|
|
15878
15890
|
}, mp = function(t) {
|
|
15879
15891
|
const e = this.layer.getRenderer();
|
|
15880
|
-
return !this.
|
|
15892
|
+
return !(this.na(t) || e.isForeground(t) || !t.geometry.properties.iconAtlas || t.geometry.properties.isEmpty);
|
|
15881
15893
|
}, gp = function(t) {
|
|
15882
15894
|
const e = this.layer.getRenderer();
|
|
15883
|
-
return !this.
|
|
15884
|
-
}, vp =
|
|
15895
|
+
return !this.na(t) && e.isForeground(t) && !!t.geometry.properties.glyphAtlas;
|
|
15896
|
+
}, vp = function(t) {
|
|
15897
|
+
const e = this.layer.getRenderer();
|
|
15898
|
+
return !this.na(t) && !e.isForeground(t) && !!t.geometry.properties.glyphAtlas;
|
|
15899
|
+
}, xp = [], bp = {
|
|
15885
15900
|
collides: -1
|
|
15886
|
-
},
|
|
15887
|
-
class
|
|
15901
|
+
}, wp = [ 2048, 2048 ], Ap = n.mat4.identity([]), Mp = [];
|
|
15902
|
+
class _p extends cd {
|
|
15888
15903
|
static getBloomSymbol() {
|
|
15889
15904
|
return [ "markerBloom", "textBloom" ];
|
|
15890
15905
|
}
|
|
15891
15906
|
constructor(t, e, n, i, r, s) {
|
|
15892
15907
|
super(t, e, n, i, r, s), this.propAllowOverlap = "markerAllowOverlap", this.propIgnorePlacement = "markerIgnorePlacement",
|
|
15893
|
-
this.Ps = {}, this.isLabelCollides =
|
|
15894
|
-
this.
|
|
15908
|
+
this.Ps = {}, this.isLabelCollides = ep.bind(this), this.sa = yp.bind(this), this.oa = mp.bind(this),
|
|
15909
|
+
this.aa = gp.bind(this), this.la = vp.bind(this), this.ha = [];
|
|
15895
15910
|
}
|
|
15896
15911
|
needToRefreshTerrainTileOnZooming() {
|
|
15897
15912
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
@@ -15907,16 +15922,16 @@
|
|
|
15907
15922
|
return super.isTerrainSkin() && this.needToRefreshTerrainTileOnZooming();
|
|
15908
15923
|
}
|
|
15909
15924
|
setTextShaderDefines(t) {
|
|
15910
|
-
this.
|
|
15925
|
+
this.ua = t;
|
|
15911
15926
|
}
|
|
15912
15927
|
createFnTypeConfig(t, e) {
|
|
15913
15928
|
return {
|
|
15914
|
-
icon:
|
|
15915
|
-
text:
|
|
15929
|
+
icon: up.call(this, t, e),
|
|
15930
|
+
text: Jd.call(this, t, e)
|
|
15916
15931
|
};
|
|
15917
15932
|
}
|
|
15918
15933
|
startFrame(...t) {
|
|
15919
|
-
return this.
|
|
15934
|
+
return this.ha.length = 0, super.startFrame(...t);
|
|
15920
15935
|
}
|
|
15921
15936
|
createGeometry(t, e) {
|
|
15922
15937
|
return t && t.empty && (t.data = {
|
|
@@ -15926,19 +15941,19 @@
|
|
|
15926
15941
|
}
|
|
15927
15942
|
postCreateGeometry(t, e) {
|
|
15928
15943
|
const {geometry: n, symbolIndex: i} = t, r = this.getSymbolDef(i), s = this.getFnTypeConfig(i);
|
|
15929
|
-
if (this.
|
|
15930
|
-
|
|
15944
|
+
if (this.ca(n)) n.properties.iconAtlas ? this.drawDebugAtlas(n.properties.iconAtlas) : n.properties.isEmpty = !0,
|
|
15945
|
+
hp(n, r, s.icon); else if (this.fa(n) && Jl(r)) {
|
|
15931
15946
|
const t = e[e.length - 1];
|
|
15932
15947
|
if (t) {
|
|
15933
15948
|
const {geometry: e, symbolIndex: s} = t;
|
|
15934
15949
|
if (e && s.index === i.index) {
|
|
15935
15950
|
const t = this.getMap(), i = r.markerTextFit;
|
|
15936
|
-
e.properties.textGeo = n,
|
|
15951
|
+
e.properties.textGeo = n, cp.call(this, t, e, n, i);
|
|
15937
15952
|
}
|
|
15938
15953
|
}
|
|
15939
15954
|
}
|
|
15940
15955
|
}
|
|
15941
|
-
|
|
15956
|
+
prepareCollideIndex(t) {
|
|
15942
15957
|
const {collideIds: e, elements: n, aCount: i} = t.properties;
|
|
15943
15958
|
if (!e) return;
|
|
15944
15959
|
const r = e, s = {};
|
|
@@ -15953,7 +15968,7 @@
|
|
|
15953
15968
|
const s = this.isEnableCollision(), o = this.layer, {geometry: a, symbolIndex: l} = t;
|
|
15954
15969
|
a.properties.symbolIndex = l;
|
|
15955
15970
|
const h = this.getSymbolDef(l), u = this.getSymbol(l), c = this.getFnTypeConfig(l), f = [];
|
|
15956
|
-
if (this.
|
|
15971
|
+
if (this.ca(a)) {
|
|
15957
15972
|
const t = function(t, e, i, r, s, o, a, l) {
|
|
15958
15973
|
if (e.isDisposed() || 0 === e.data.aPosition.length) return null;
|
|
15959
15974
|
const h = e.properties.iconAtlas;
|
|
@@ -15998,25 +16013,25 @@
|
|
|
15998
16013
|
}(this.regl, a, e, 0, u, c.icon, o.options.collision, !s, this.isEnableUniquePlacement());
|
|
15999
16014
|
t && (t.positionMatrix = this.getAltitudeOffsetMatrix(), delete t.geometry.properties.glyphAtlas,
|
|
16000
16015
|
f.push(t));
|
|
16001
|
-
} else if (this.
|
|
16002
|
-
const t =
|
|
16016
|
+
} else if (this.fa(a)) {
|
|
16017
|
+
const t = $d.call(this, this.regl, a, e, h, u, c.text, o.options.collision, !s, this.isEnableUniquePlacement());
|
|
16003
16018
|
t.length && (t.forEach(t => {
|
|
16004
16019
|
t.positionMatrix = this.getAltitudeOffsetMatrix(), delete t.geometry.properties.iconAtlas;
|
|
16005
16020
|
}), f.push(...t));
|
|
16006
16021
|
}
|
|
16007
16022
|
return "line" === a.properties.markerPlacement && this.da(a, r), "line" === a.properties.markerPlacement && f.forEach(t => t.properties.isLinePlacement = !0),
|
|
16008
|
-
this.
|
|
16023
|
+
this.prepareCollideIndex(a), f;
|
|
16009
16024
|
}
|
|
16010
16025
|
da(t, e) {
|
|
16011
16026
|
const {collideIds: n} = t.properties, i = new Uint16Array(n.length);
|
|
16012
|
-
if (this.
|
|
16027
|
+
if (this.ca(t)) {
|
|
16013
16028
|
let r = 0;
|
|
16014
16029
|
for (let t = 0; t < n.length; t += 4) i.fill(r++, t, t + 4);
|
|
16015
16030
|
t.properties.collideIds = i, t.properties.uniqueCollideIds = Zl(i), e.markerCollideMap = {
|
|
16016
16031
|
old: n,
|
|
16017
16032
|
new: i
|
|
16018
16033
|
};
|
|
16019
|
-
} else if (this.
|
|
16034
|
+
} else if (this.fa(t)) {
|
|
16020
16035
|
const {collideIds: n, aCount: i} = t.properties;
|
|
16021
16036
|
if (!i) return;
|
|
16022
16037
|
if (e.markerCollideMap) {
|
|
@@ -16043,12 +16058,12 @@
|
|
|
16043
16058
|
if (this.isEnableCollision() && t.length > 0) {
|
|
16044
16059
|
const e = new nd(t);
|
|
16045
16060
|
e.properties.uniqueCollideIds = t[0].geometry.properties.uniqueCollideIds, e.properties.meshKey = t[0].properties.meshKey,
|
|
16046
|
-
e.properties.level = t[0].properties.level, this.
|
|
16061
|
+
e.properties.level = t[0].properties.level, this.ha.push(e);
|
|
16047
16062
|
}
|
|
16048
16063
|
for (let e = 0; e < t.length; e++) {
|
|
16049
16064
|
if (!this.isMeshIterable(t[e])) continue;
|
|
16050
16065
|
const n = t[e].geometry, {symbolIndex: i} = n.properties;
|
|
16051
|
-
Jl(this.getSymbolDef(i)) &&
|
|
16066
|
+
Jl(this.getSymbolDef(i)) && pp.call(this, this.getMap(), n);
|
|
16052
16067
|
}
|
|
16053
16068
|
const e = this.getMap().getZoom();
|
|
16054
16069
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -16066,22 +16081,22 @@
|
|
|
16066
16081
|
if (!this.isEnableCollision()) return;
|
|
16067
16082
|
super.updateCollision(t);
|
|
16068
16083
|
const e = this.scene.getMeshes();
|
|
16069
|
-
e && e.length ? (this.pa(t.timestamp), this.
|
|
16084
|
+
e && e.length ? (this.pa(t.timestamp), this.ha = [], this.po()) : this.po();
|
|
16070
16085
|
}
|
|
16071
16086
|
callCurrentTileShader(t, e) {
|
|
16072
|
-
this.shader.filter = e.sceneFilter ? [ this.ra, e.sceneFilter ] : this.ra, this.callRenderer(this.shader, t, e),
|
|
16073
|
-
this.ya.filter = e.sceneFilter ? [ this.oa, e.sceneFilter ] : this.oa, this.callRenderer(this.ya, t, e);
|
|
16074
|
-
}
|
|
16075
|
-
callBackgroundTileShader(t, e) {
|
|
16076
16087
|
this.shader.filter = e.sceneFilter ? [ this.sa, e.sceneFilter ] : this.sa, this.callRenderer(this.shader, t, e),
|
|
16077
16088
|
this.ya.filter = e.sceneFilter ? [ this.aa, e.sceneFilter ] : this.aa, this.callRenderer(this.ya, t, e);
|
|
16078
16089
|
}
|
|
16090
|
+
callBackgroundTileShader(t, e) {
|
|
16091
|
+
this.shader.filter = e.sceneFilter ? [ this.oa, e.sceneFilter ] : this.oa, this.callRenderer(this.shader, t, e),
|
|
16092
|
+
this.ya.filter = e.sceneFilter ? [ this.la, e.sceneFilter ] : this.la, this.callRenderer(this.ya, t, e);
|
|
16093
|
+
}
|
|
16079
16094
|
isMeshIterable(t) {
|
|
16080
16095
|
return t && t.geometry && !t.geometry.properties.isEmpty && t.material && !t.material.get("isHalo") && this.isMeshVisible(t) && !(this.shouldIgnoreBackground() && !this.layer.getRenderer().isForeground(t));
|
|
16081
16096
|
}
|
|
16082
16097
|
pa() {
|
|
16083
16098
|
if (!this.isEnableCollision()) return;
|
|
16084
|
-
let t = this.
|
|
16099
|
+
let t = this.ha;
|
|
16085
16100
|
t && t.length && this.ma(t);
|
|
16086
16101
|
}
|
|
16087
16102
|
ga(t, e, n, i) {
|
|
@@ -16092,7 +16107,7 @@
|
|
|
16092
16107
|
}
|
|
16093
16108
|
ma(t) {
|
|
16094
16109
|
const e = this.layer.getRenderer();
|
|
16095
|
-
t = t.sort(
|
|
16110
|
+
t = t.sort(Sp);
|
|
16096
16111
|
for (let n = 0; n < t.length; n++) {
|
|
16097
16112
|
const i = t[n];
|
|
16098
16113
|
if (!i || !i.meshes.length) continue;
|
|
@@ -16125,7 +16140,7 @@
|
|
|
16125
16140
|
wa(t, e, i, r) {
|
|
16126
16141
|
const s = this.getMap(), {collideBoxIndex: o} = t.meshes[0].geometry.properties;
|
|
16127
16142
|
if (!(o && o[e])) return !1;
|
|
16128
|
-
const a = n.mat4.multiply(
|
|
16143
|
+
const a = n.mat4.multiply(xp, s.projViewMatrix, t.meshes[0].localTransform);
|
|
16129
16144
|
let l, h = !1;
|
|
16130
16145
|
const u = t.meshes;
|
|
16131
16146
|
let c = 0;
|
|
@@ -16135,7 +16150,7 @@
|
|
|
16135
16150
|
n[e] && c++;
|
|
16136
16151
|
}
|
|
16137
16152
|
if (!c) return !1;
|
|
16138
|
-
l = this.
|
|
16153
|
+
l = this.ta(c);
|
|
16139
16154
|
let f = 0;
|
|
16140
16155
|
for (let t = 0; t < u.length; t++) {
|
|
16141
16156
|
const n = u[t];
|
|
@@ -16185,18 +16200,18 @@
|
|
|
16185
16200
|
}
|
|
16186
16201
|
}
|
|
16187
16202
|
isBoxCollides(t, e, n, i, r, s) {
|
|
16188
|
-
if (this.
|
|
16189
|
-
if (t.geometry.properties.isEmpty) return
|
|
16203
|
+
if (this.fa(t.geometry)) return ep.call(this, 0, t, e, n, i, r, s);
|
|
16204
|
+
if (t.geometry.properties.isEmpty) return bp;
|
|
16190
16205
|
const {aTerrainAltitude: o} = t.geometry.properties;
|
|
16191
16206
|
if (o) {
|
|
16192
|
-
if (o[2 * e[i]] === Ol) return
|
|
16207
|
+
if (o[2 * e[i]] === Ol) return bp;
|
|
16193
16208
|
}
|
|
16194
|
-
const a = this.getMap(), {boxes: l, collision: h} = this.
|
|
16209
|
+
const a = this.getMap(), {boxes: l, collision: h} = this.Qo(t, i);
|
|
16195
16210
|
let u = 0, c = 0, f = 0;
|
|
16196
16211
|
for (let n = i; n < r; n += 6) {
|
|
16197
16212
|
const i = l[f] = l[f] || [];
|
|
16198
16213
|
f++;
|
|
16199
|
-
const r =
|
|
16214
|
+
const r = Nd.call(this, i, t, e[n], s, a);
|
|
16200
16215
|
if (!u) {
|
|
16201
16216
|
const t = this.isCollides(r);
|
|
16202
16217
|
1 === t ? u = 1 : -1 === t && c++;
|
|
@@ -16240,7 +16255,7 @@
|
|
|
16240
16255
|
}
|
|
16241
16256
|
};
|
|
16242
16257
|
this.shader = new n.reshader.MeshShader({
|
|
16243
|
-
vert:
|
|
16258
|
+
vert: yd,
|
|
16244
16259
|
frag: "#define SHADER_NAME MARKER\n#define HAS_HIGHLIGHT_COLOR_POINT 1\nprecision mediump float;\n#include <gl2_frag>\nuniform float alphaTest;\nuniform sampler2D iconTex;\nuniform lowp float markerOpacity;\nuniform lowp float blendSrcIsOne;\nuniform float layerOpacity;\n#include <highlight_frag>\nvarying vec2 vTexCoord;\nvarying float vOpacity;\nvoid main() {\n vec4 c = texture2D(iconTex, vTexCoord) * markerOpacity * vOpacity * layerOpacity;\n if(c.a < .05) {\n discard;\n }\n glFragColor = c;\n glFragColor = highlight_blendColor(glFragColor);\n if(glFragColor.a < alphaTest) {\n discard;\n }\n glFragColor = highlight_blendColor(glFragColor);\n#if __VERSION__ == 100\ngl_FragColor = glFragColor;\n#endif\n}",
|
|
16245
16260
|
uniforms: [ {
|
|
16246
16261
|
name: "projViewModelMatrix",
|
|
@@ -16257,16 +16272,16 @@
|
|
|
16257
16272
|
} ],
|
|
16258
16273
|
extraCommandProps: i
|
|
16259
16274
|
}), this.shader.version = 300;
|
|
16260
|
-
const {uniforms: r, extraCommandProps: s} =
|
|
16275
|
+
const {uniforms: r, extraCommandProps: s} = qd.call(this, e, this.sceneConfig), o = this.ua || {};
|
|
16261
16276
|
if (this.ya = new n.reshader.MeshShader({
|
|
16262
|
-
vert:
|
|
16263
|
-
frag:
|
|
16277
|
+
vert: sp,
|
|
16278
|
+
frag: op,
|
|
16264
16279
|
uniforms: r,
|
|
16265
16280
|
extraCommandProps: s,
|
|
16266
16281
|
defines: o
|
|
16267
16282
|
}), this.pickingFBO) {
|
|
16268
16283
|
const t = new n.reshader.FBORayPicking(this.renderer, {
|
|
16269
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
16284
|
+
vert: "#define PICKING_MODE 1\n" + yd,
|
|
16270
16285
|
uniforms: [ {
|
|
16271
16286
|
name: "projViewModelMatrix",
|
|
16272
16287
|
type: "function",
|
|
@@ -16284,7 +16299,7 @@
|
|
|
16284
16299
|
}, this.pickingFBO, this.getMap());
|
|
16285
16300
|
t.filter = t => !!t.geometry.properties.iconAtlas;
|
|
16286
16301
|
const e = new n.reshader.FBORayPicking(this.renderer, {
|
|
16287
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
16302
|
+
vert: "#define PICKING_MODE 1\n" + sp,
|
|
16288
16303
|
uniforms: r,
|
|
16289
16304
|
extraCommandProps: s
|
|
16290
16305
|
}, this.pickingFBO, this.getMap());
|
|
@@ -16292,7 +16307,7 @@
|
|
|
16292
16307
|
}
|
|
16293
16308
|
}
|
|
16294
16309
|
getUniformValues(t, e) {
|
|
16295
|
-
const i = e && e.isRenderingTerrainSkin, s = this.layer.getTileSize().width, o = i ?
|
|
16310
|
+
const i = e && e.isRenderingTerrainSkin, s = this.layer.getTileSize().width, o = i ? Ap : t.projViewMatrix, a = t.cameraToCenterDistance, l = n.vec2.set(Mp, t.width, t.height);
|
|
16296
16311
|
i && n.vec2.set(l, s, s);
|
|
16297
16312
|
const h = this.getBlendFunc(), u = r.Util.isFunction(h.src) ? h.src() : h.src;
|
|
16298
16313
|
return {
|
|
@@ -16302,7 +16317,7 @@
|
|
|
16302
16317
|
projViewMatrix: o,
|
|
16303
16318
|
cameraToCenterDistance: a,
|
|
16304
16319
|
canvasSize: l,
|
|
16305
|
-
iconSize:
|
|
16320
|
+
iconSize: wp,
|
|
16306
16321
|
resolution: t.getResolution(),
|
|
16307
16322
|
glyphSize: 24,
|
|
16308
16323
|
gammaScale: 1,
|
|
@@ -16312,32 +16327,32 @@
|
|
|
16312
16327
|
};
|
|
16313
16328
|
}
|
|
16314
16329
|
getUniqueEntryKey(t, e) {
|
|
16315
|
-
if (!this.
|
|
16330
|
+
if (!this.fa(t.geometry)) return null;
|
|
16316
16331
|
const {elements: n} = t.geometry.properties;
|
|
16317
|
-
return
|
|
16332
|
+
return np(t, n[e]);
|
|
16318
16333
|
}
|
|
16319
|
-
|
|
16334
|
+
ca(t) {
|
|
16320
16335
|
const {symbolIndex: e} = t.properties;
|
|
16321
16336
|
return 0 === e.type;
|
|
16322
16337
|
}
|
|
16323
|
-
|
|
16338
|
+
fa(t) {
|
|
16324
16339
|
const {symbolIndex: e} = t.properties;
|
|
16325
16340
|
return 1 === e.type;
|
|
16326
16341
|
}
|
|
16327
16342
|
}
|
|
16328
|
-
function
|
|
16343
|
+
function Sp(t, e) {
|
|
16329
16344
|
return t.properties.level - e.properties.level || t.properties.meshKey - e.properties.meshKey;
|
|
16330
16345
|
}
|
|
16331
|
-
const
|
|
16332
|
-
function
|
|
16333
|
-
const {aGlyphOffset: p, aSegment: y, aTextDx: m, aTextDy: g, symbolIndex: v} = e.geometry.properties, x = this.getSymbol(v), b = m ? m[s] : x.textDx, w = g ? g[s] : x.textDy, A = n.vec2.set(
|
|
16346
|
+
const kp = [], Pp = [], Tp = [];
|
|
16347
|
+
function Fp(t, e, i, r, s, o, a, l, h, u, c, f, d) {
|
|
16348
|
+
const {aGlyphOffset: p, aSegment: y, aTextDx: m, aTextDy: g, symbolIndex: v} = e.geometry.properties, x = this.getSymbol(v), b = m ? m[s] : x.textDx, w = g ? g[s] : x.textDy, A = n.vec2.set(Tp, b || 0, w || 0), M = n.vec2.set(kp, p[2 * s], p[2 * s + 1]), _ = n.vec3.set(Pp, y[3 * s], y[3 * s + 1], y[3 * s + 2]);
|
|
16334
16349
|
return function(t, e, n, i, r, s, o, a, l, h, u, c, f, d, p, y, m, g) {
|
|
16335
16350
|
p || (p = i);
|
|
16336
16351
|
const v = e.geometry.properties.line, x = s[0] * c, b = f ? x - o : x + o;
|
|
16337
16352
|
let w = b > 0 ? 1 : -1, A = 0;
|
|
16338
16353
|
f && (w *= -1, A = Math.PI), w < 0 && (A += Math.PI);
|
|
16339
16354
|
const M = h + u, _ = Math.abs(b);
|
|
16340
|
-
let S = w > 0 ? l : l + 1, k =
|
|
16355
|
+
let S = w > 0 ? l : l + 1, k = z.convert(i), P = z.convert(i), T = z.convert(r), F = z.convert(r), O = 0, I = 0;
|
|
16341
16356
|
for (;O + I <= _; ) {
|
|
16342
16357
|
if (S += w, S < h || S >= M) return null;
|
|
16343
16358
|
P.x = k.x, P.y = k.y, F.x = T.x, F.y = T.y, k.x = n[3 * S], k.y = n[3 * S + 1],
|
|
@@ -16351,47 +16366,47 @@
|
|
|
16351
16366
|
const o = A + Math.atan2(k[1] - P[1], k[0] - P[0]);
|
|
16352
16367
|
return t[0] = (s[0] - p[0]) / d, t[1] = (s[1] - p[1]) / d, t[2] = o, t;
|
|
16353
16368
|
}
|
|
16354
|
-
const R = k.sub(P),
|
|
16355
|
-
|
|
16369
|
+
const R = k.sub(P), L = R.mult(C).o(P);
|
|
16370
|
+
L.o(R.T().F().M(a * w));
|
|
16356
16371
|
const H = A + Math.atan2(k.y - P.y, k.x - P.x);
|
|
16357
|
-
return t[0] = (
|
|
16372
|
+
return t[0] = (L.x - i[0]) / d, t[1] = (L.y - i[1]) / d, t[2] = H, t;
|
|
16358
16373
|
}(t, e, r, o, a, M, A[0], A[1], _[0], _[1], _[2], i / 24, h, l, u, c, f, d);
|
|
16359
16374
|
}
|
|
16360
|
-
const
|
|
16361
|
-
function
|
|
16375
|
+
const Op = [], Ip = [];
|
|
16376
|
+
function Cp(t, e, i, r, s, o, a, l, h, u, c, f) {
|
|
16362
16377
|
const {aVertical: d} = i.geometry.properties, p = d[o];
|
|
16363
|
-
let y, m, g =
|
|
16378
|
+
let y, m, g = Fp.call(this, Op, i, r, s, o, l, h, u, !1);
|
|
16364
16379
|
if (!g) return null;
|
|
16365
|
-
if (n.vec3.copy(t, g), g =
|
|
16366
|
-
if (n.vec3.copy(e, g), f && (n.vec2.transformMat2(
|
|
16380
|
+
if (n.vec3.copy(t, g), g = Fp.call(this, Ip, i, r, s, a, l, h, u, !1), !g) return null;
|
|
16381
|
+
if (n.vec3.copy(e, g), f && (n.vec2.transformMat2(Op, Op, f), n.vec2.transformMat2(Ip, Ip, f)),
|
|
16367
16382
|
p) {
|
|
16368
|
-
const t = Math.abs(
|
|
16369
|
-
m =
|
|
16370
|
-
} else y = 0, m =
|
|
16383
|
+
const t = Math.abs(Ip[1] - Op[1]), e = Math.abs(Ip[0] - Op[0]) * c;
|
|
16384
|
+
m = Op[0] > Ip[0] ? 1 : 0, t > e ? (y = 1, m = Op[1] < Ip[1] ? 0 : 1) : y = 0;
|
|
16385
|
+
} else y = 0, m = Op[0] > Ip[0] ? 1 : 0;
|
|
16371
16386
|
return 2 * m + y;
|
|
16372
16387
|
}
|
|
16373
|
-
var
|
|
16374
|
-
const
|
|
16388
|
+
var Ep = "#define SHADER_NAME TEXT_LINE\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec2 aTexCoord;\n#ifdef HAS_OFFSET_Z\nattribute vec3 aOffset;\nuniform float altitudeScale;\n#else\nattribute vec2 aOffset;\n#endif\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\nuniform float zoomScale;\nuniform float cameraToCenterDistance;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform float mapPitch;\nuniform vec2 texSize;\nuniform vec2 canvasSize;\nuniform float tileRatio;\nuniform float layerScale;\nuniform float isRenderingTerrain;\nuniform float textPitchFilter;\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#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n#ifdef HAS_TEXT_DX\nfloat d = aTextDx;\n#else\nfloat d = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat e = aTextDy;\n#else\nfloat e = textDy;\n#endif\n#ifdef HAS_TEXT_SIZE\nfloat f = aTextSize * layerScale;\n#else\nfloat f = textSize * layerScale;\n#endif\n#ifdef HAS_PITCH_ALIGN\nfloat h = aPitchAlign;\n#else\nfloat h = pitchWithMap;\n#endif\ngl_Position = projViewModelMatrix * vec4(c, 1.);\n float i = gl_Position.w;\n float j = i / cameraToCenterDistance;\n float k;\n if(isRenderingTerrain == 1.) {\n k = 1.;\n } else {\n float l = (1. - cameraToCenterDistance / i) * textPerspectiveRatio;\n k = clamp(.5 + .5 * (1. - l), .0, 4.);\n }\n#ifdef HAS_OFFSET_Z\nvec3 m = aOffset / 10.0;\n m[2] /= altitudeScale;\n#else\nvec3 m = vec3(aOffset / 10.0, .0);\n#endif\nvec2 n = aTexCoord;\n if(h == 1.) {\n float o;\n if(isRenderingTerrain == 1.) {\n o = tileRatio;\n } else {\n o = tileRatio / zoomScale * j * k;\n }\n m.xy *= o;\n gl_Position = projViewModelMatrix * vec4(c + m, 1.);\n } else {\n gl_Position.xy += m.xy * 2. / canvasSize * k * i;\n }\n gl_Position.xy += vec2(d, -e) * 2. / canvasSize * i;\n if(textPitchFilter > .0) {\n if(textPitchFilter == 1. && h == .0 || textPitchFilter == 2. && h == 1.) {\n gl_Position = vec4(-9999., -9999., .0, 1.);\n }\n }\n#ifndef PICKING_MODE\nif(h == 1.) {\n vGammaScale = j + mapPitch / 4.;\n } else {\n vGammaScale = mix(1., j, textPerspectiveRatio);\n }\n vGammaScale = clamp(vGammaScale, .0, 1.);\n vTexCoord = n / texSize;\n vSize = f;\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\nhighlight_setVarying();\n#else\n#ifdef ENABLE_COLLISION\nbool u = aOpacity == 255.;\n#else\nbool u = true;\n#endif\nfbo_picking_setData(gl_Position.w, u);\n#endif\n}";
|
|
16389
|
+
const Dp = function(t) {
|
|
16375
16390
|
const e = this.layer.getRenderer();
|
|
16376
|
-
return !this.
|
|
16377
|
-
}, Dp = function(t) {
|
|
16378
|
-
const e = this.layer.getRenderer();
|
|
16379
|
-
return !this.ea(t) && !e.isForeground(t) && "line" !== t.geometry.properties.textPlacement;
|
|
16391
|
+
return !this.na(t) && e.isTileNearCamera(t) && "line" !== t.geometry.properties.textPlacement;
|
|
16380
16392
|
}, Np = function(t) {
|
|
16381
16393
|
const e = this.layer.getRenderer();
|
|
16382
|
-
return !this.
|
|
16394
|
+
return !this.na(t) && !e.isForeground(t) && "line" !== t.geometry.properties.textPlacement;
|
|
16383
16395
|
}, Rp = function(t) {
|
|
16396
|
+
const e = this.layer.getRenderer();
|
|
16397
|
+
return !this.na(t) && e.isTileNearCamera(t) && "line" === t.geometry.properties.textPlacement;
|
|
16398
|
+
}, zp = function(t) {
|
|
16384
16399
|
const e = this.layer.getRenderer(), n = t.properties.tile.z, i = e.getCurrentTileZoom();
|
|
16385
|
-
return !this.
|
|
16386
|
-
}, Lp = [ 0, 0, 3 ],
|
|
16387
|
-
class
|
|
16400
|
+
return !this.na(t) && !e.isForeground(t) && "line" === t.geometry.properties.textPlacement && n < i;
|
|
16401
|
+
}, Lp = [ 0, 0, 3 ], Hp = [], Up = [], Vp = [], jp = [], Bp = [], Gp = [], Wp = [], $p = [], Xp = [ 1, -1 ], Yp = new Int16Array(3), qp = [], Jp = [], Kp = [], Zp = [], Qp = [], ty = [], ey = [], ny = {}, iy = {}, ry = {}, sy = [], oy = [], ay = n.mat4.identity([]), ly = [];
|
|
16402
|
+
class hy extends cd {
|
|
16388
16403
|
static getBloomSymbol() {
|
|
16389
16404
|
return [ "textBloom" ];
|
|
16390
16405
|
}
|
|
16391
16406
|
constructor(t, e, n, i, r, s) {
|
|
16392
16407
|
super(t, e, n, i, r, s), this.propAllowOverlap = "textAllowOverlap", this.propIgnorePlacement = "textIgnorePlacement",
|
|
16393
|
-
this.colorCache = {}, this.Ma =
|
|
16394
|
-
this.ka =
|
|
16408
|
+
this.colorCache = {}, this.Ma = Dp.bind(this), this._a = Np.bind(this), this.Sa = Rp.bind(this),
|
|
16409
|
+
this.ka = zp.bind(this), this.isLabelCollides = ep.bind(this), this.Pa();
|
|
16395
16410
|
}
|
|
16396
16411
|
prepareRender(...t) {
|
|
16397
16412
|
super.prepareRender(...t);
|
|
@@ -16432,9 +16447,9 @@
|
|
|
16432
16447
|
const n = ho.createExpression(e.textName, "string");
|
|
16433
16448
|
this.Oa[t] = (t, e) => {
|
|
16434
16449
|
let i;
|
|
16435
|
-
|
|
16450
|
+
ny.zoom = t, iy.properties = e;
|
|
16436
16451
|
try {
|
|
16437
|
-
i = n.evaluateWithoutErrorHandling(
|
|
16452
|
+
i = n.evaluateWithoutErrorHandling(ny, iy, ry, null, sy);
|
|
16438
16453
|
} catch (t) {
|
|
16439
16454
|
i = null;
|
|
16440
16455
|
}
|
|
@@ -16449,10 +16464,10 @@
|
|
|
16449
16464
|
return !1;
|
|
16450
16465
|
}
|
|
16451
16466
|
createFnTypeConfig(t, e) {
|
|
16452
|
-
return
|
|
16467
|
+
return Jd(t, e);
|
|
16453
16468
|
}
|
|
16454
16469
|
isBloom(t) {
|
|
16455
|
-
return !!this.getSymbol(t.properties.symbolIndex)[
|
|
16470
|
+
return !!this.getSymbol(t.properties.symbolIndex)[hy.getBloomSymbol()[0]];
|
|
16456
16471
|
}
|
|
16457
16472
|
createGeometry(t, e, n) {
|
|
16458
16473
|
const i = t;
|
|
@@ -16467,7 +16482,7 @@
|
|
|
16467
16482
|
createMesh(t, e, {tileVectorTransform: n}) {
|
|
16468
16483
|
const i = this.isEnableCollision(), r = this.isEnableUniquePlacement(), {geometry: s, symbolIndex: o} = t;
|
|
16469
16484
|
s.properties.symbolIndex = o;
|
|
16470
|
-
const a = this.getSymbol(o), l = this.getSymbolDef(o), h = this.getFnTypeConfig(o), u =
|
|
16485
|
+
const a = this.getSymbol(o), l = this.getSymbolDef(o), h = this.getFnTypeConfig(o), u = $d.call(this, this.regl, s, e, l, a, h, this.layer.options.collision, !i, r);
|
|
16471
16486
|
if (u.length) {
|
|
16472
16487
|
"line" === s.properties.textPlacement ? this.Ia = !0 : this.Ca = !0;
|
|
16473
16488
|
}
|
|
@@ -16495,7 +16510,7 @@
|
|
|
16495
16510
|
Da() {
|
|
16496
16511
|
let t = this.scene.getMeshes();
|
|
16497
16512
|
if (!t || !t.length) return;
|
|
16498
|
-
const e = -this.getMap().getBearing() * Math.PI / 180, i = n.mat2.fromRotation(
|
|
16513
|
+
const e = -this.getMap().getBearing() * Math.PI / 180, i = n.mat2.fromRotation(Vp, e), r = (t, e, n, i) => {
|
|
16499
16514
|
const {start: r, end: s, mesh: o, allElements: a} = e[0];
|
|
16500
16515
|
if (this.updateBoxCollisionFading(!0, o, e, n, i)) {
|
|
16501
16516
|
let e = t.count;
|
|
@@ -16503,7 +16518,7 @@
|
|
|
16503
16518
|
t.count = e;
|
|
16504
16519
|
}
|
|
16505
16520
|
}, s = this.isEnableCollision(), o = this.layer.getRenderer();
|
|
16506
|
-
t = t.sort(
|
|
16521
|
+
t = t.sort(cy);
|
|
16507
16522
|
for (let e = 0; e < t.length; e++) {
|
|
16508
16523
|
const n = t[e];
|
|
16509
16524
|
if (!this.isMeshIterable(n)) continue;
|
|
@@ -16513,7 +16528,7 @@
|
|
|
16513
16528
|
continue;
|
|
16514
16529
|
}
|
|
16515
16530
|
const a = n.geometry, l = this.getSymbol(n.properties.symbolIndex);
|
|
16516
|
-
n.properties.textHaloRadius = Vl(l.textHaloRadius) ?
|
|
16531
|
+
n.properties.textHaloRadius = Vl(l.textHaloRadius) ? Wd.textHaloRadius : l.textHaloRadius;
|
|
16517
16532
|
const h = n.properties.meshKey;
|
|
16518
16533
|
if ("line" === a.properties.textPlacement) {
|
|
16519
16534
|
if (!a.properties.line) continue;
|
|
@@ -16540,7 +16555,7 @@
|
|
|
16540
16555
|
return "line" !== this.getSymbol(t.properties.symbolIndex).textPlacement;
|
|
16541
16556
|
}
|
|
16542
16557
|
getUniqueEntryKey(t, e) {
|
|
16543
|
-
return
|
|
16558
|
+
return np(t, e);
|
|
16544
16559
|
}
|
|
16545
16560
|
Ra(t, e) {
|
|
16546
16561
|
const i = this.getMap(), r = t.geometry, s = r.properties;
|
|
@@ -16548,10 +16563,10 @@
|
|
|
16548
16563
|
if (!o) return;
|
|
16549
16564
|
const a = i.getPitch(), l = i.getBearing(), {lineTextPitch: h, lineTextBearing: u} = t.properties, c = 1 === t.material.uniforms.pitchWithMap, f = s.elements;
|
|
16550
16565
|
if (!c) {
|
|
16551
|
-
const e = n.mat4.multiply(
|
|
16566
|
+
const e = n.mat4.multiply(Hp, i.projViewMatrix, t.localTransform), r = o.id + "-" + e.join();
|
|
16552
16567
|
let a;
|
|
16553
16568
|
this.Ea[r] ? o = this.Ea[r] : (a = s.projectedLine = s.projectedLine || new Array(o.length),
|
|
16554
|
-
o = this.
|
|
16569
|
+
o = this.za(a, o, e, i.width, i.height), this.Ea[r] = a);
|
|
16555
16570
|
}
|
|
16556
16571
|
const d = this.isEnableCollision(), p = r.properties.visElemts = r.properties.visElemts || new f.constructor(f.length), y = r.properties.visCache = r.properties.visCache || [];
|
|
16557
16572
|
d && (p.count = 0);
|
|
@@ -16559,7 +16574,7 @@
|
|
|
16559
16574
|
this.forEachBox(t, (t, n, i, r) => {
|
|
16560
16575
|
const {start: s, end: a} = n[0];
|
|
16561
16576
|
let l = y[r];
|
|
16562
|
-
if ((void 0 === l || m) && (l = this.
|
|
16577
|
+
if ((void 0 === l || m) && (l = this.La(t, f, s, a, o, i, c ? e : null, r)), y[r] = l,
|
|
16563
16578
|
d && (l = this.updateBoxCollisionFading(l, t, n, i, r), l)) {
|
|
16564
16579
|
let t = p.count;
|
|
16565
16580
|
for (let e = s; e < a; e++) p[t++] = f[e];
|
|
@@ -16569,7 +16584,7 @@
|
|
|
16569
16584
|
const g = t.geometry.properties.aAltitude;
|
|
16570
16585
|
g && g.dirty && (r.updateData("aAltitude", g), g.dirty = !1), !d || p.count === f.length && r.count === p.count || r.setElements(p, p.count);
|
|
16571
16586
|
}
|
|
16572
|
-
|
|
16587
|
+
za(t, e, i, r, s) {
|
|
16573
16588
|
return function(t, e, i, r, s) {
|
|
16574
16589
|
for (let o = 0; o < e.length; o += 3) n.vec4.set(uf, e[o], e[o + 1], e[o + 2], 1),
|
|
16575
16590
|
cf(uf, uf, i, r, s), t[o] = uf[0], t[o + 1] = uf[1], t[o + 2] = e[o + 2];
|
|
@@ -16577,9 +16592,9 @@
|
|
|
16577
16592
|
}(t, e, i, r, s);
|
|
16578
16593
|
}
|
|
16579
16594
|
forEachBox(t, e) {
|
|
16580
|
-
const i = this.getMap(), r = n.mat4.multiply(
|
|
16595
|
+
const i = this.getMap(), r = n.mat4.multiply(Hp, i.projViewMatrix, t.properties.tileVectorTransform), {collideIds: s, aCount: o, features: a, elements: l} = t.geometry.properties, h = s;
|
|
16581
16596
|
if (!h) return;
|
|
16582
|
-
const u = this.isEnableUniquePlacement(), c = this.
|
|
16597
|
+
const u = this.isEnableUniquePlacement(), c = this.ta(1);
|
|
16583
16598
|
c[0].allElements = l, c[0].mesh = t;
|
|
16584
16599
|
let f = 0, d = l[0], p = 0, y = h[d];
|
|
16585
16600
|
for (let n = 0; n <= l.length; n += 6) if (d = l[n], h[d] !== y || n === l.length) {
|
|
@@ -16594,65 +16609,65 @@
|
|
|
16594
16609
|
y = h[d], p = n;
|
|
16595
16610
|
}
|
|
16596
16611
|
}
|
|
16597
|
-
|
|
16612
|
+
La(t, e, i, r, s, o, a) {
|
|
16598
16613
|
const l = this.layer.getRenderer(), h = t.material.uniforms, u = 1 === h.pitchWithMap, c = !u && l.getTerrainHelper && l.getTerrainHelper(), f = this.isEnableCollision(), d = this.getMap(), p = t.geometry, y = p.desc.positionSize, {aShape: m, aOffset: g, aAnchor: v, aAltitude: x, aPitchRotation: b} = p.properties;
|
|
16599
16614
|
let {aProjectedAnchor: w} = p.properties;
|
|
16600
16615
|
w || (w = p.properties.aProjectedAnchor = new Array(v.length / y * 3));
|
|
16601
16616
|
const A = p.properties.aTextSize, M = !a, _ = e[i], S = _ * y;
|
|
16602
16617
|
let k;
|
|
16603
|
-
k = p.data.aAltitude ? n.vec3.set(
|
|
16604
|
-
const P = cf(
|
|
16618
|
+
k = p.data.aAltitude ? n.vec3.set(jp, v[S], v[S + 1], x[_]) : fl.unpackPosition(jp, v[S], v[S + 1], v[S + 2]);
|
|
16619
|
+
const P = cf(Bp, k, o, d.width, d.height), T = p.properties.aTerrainAltitude;
|
|
16605
16620
|
let F;
|
|
16606
16621
|
if (T) {
|
|
16607
16622
|
const t = T[_];
|
|
16608
16623
|
if (t === Ol) return w[3 * _] = -999999, w[3 * _ + 1] = -999999, w[3 * _ + 2] = -999999,
|
|
16609
16624
|
!1;
|
|
16610
|
-
t ? (F = n.vec3.set(
|
|
16625
|
+
t ? (F = n.vec3.set(oy, ...k), F[2] = 100 * t, F = cf(F, F, o, d.width, d.height)) : F = P;
|
|
16611
16626
|
} else F = P;
|
|
16612
16627
|
const O = d.getDevicePixelRatio();
|
|
16613
|
-
if (n.vec4.scale(
|
|
16628
|
+
if (n.vec4.scale(ly, F, 1 / O), d.isOffscreen(ly)) return f || uy(g, e, i, r), w[3 * _] = -999999,
|
|
16614
16629
|
w[3 * _ + 1] = -999999, w[3 * _ + 2] = -999999, !1;
|
|
16615
16630
|
M && (k = P), w[3 * _] = F[0], w[3 * _ + 1] = F[1], w[3 * _ + 2] = F[2];
|
|
16616
16631
|
const I = M ? 1 : p.properties.tileExtent / this.layer.getTileSize().width;
|
|
16617
16632
|
let C = !0;
|
|
16618
|
-
const E = e[i], D = e[r - 1], N = A ? A[E] : t.properties.textSize, R = this.Ha(t, N, s, E, D, k,
|
|
16619
|
-
if (null === R) return
|
|
16620
|
-
const
|
|
16633
|
+
const E = e[i], D = e[r - 1], N = A ? A[E] : t.properties.textSize, R = this.Ha(t, N, s, E, D, k, jp, I, a);
|
|
16634
|
+
if (null === R) return uy(g, e, i, r), !1;
|
|
16635
|
+
const z = D - E <= 3, L = Math.floor(R / 2), H = R % 2;
|
|
16621
16636
|
for (let a = i; a < r; a += 6) {
|
|
16622
16637
|
const l = e[a];
|
|
16623
16638
|
let d;
|
|
16624
|
-
if (d =
|
|
16639
|
+
if (d = L || a !== i || z || c ? L || a !== r - 6 || z || c ? Fp.call(this, Up, t, N, s, l, k, jp, I, L, F, this.layer, o, u) : ey : ty,
|
|
16625
16640
|
!d) {
|
|
16626
|
-
C = !1, f ||
|
|
16641
|
+
C = !1, f || uy(g, e, i, r);
|
|
16627
16642
|
break;
|
|
16628
16643
|
}
|
|
16629
16644
|
let p = d[2];
|
|
16630
16645
|
H && (p -= Math.PI / 2);
|
|
16631
|
-
const y =
|
|
16646
|
+
const y = _d(Gp, p, 0, h.rotateWithMap, h.pitchWithMap), v = g.length > m.length;
|
|
16632
16647
|
let x;
|
|
16633
16648
|
if (v) {
|
|
16634
|
-
n.vec3.set(
|
|
16635
|
-
const t = n.vec3.normalize(
|
|
16649
|
+
n.vec3.set(Zp, b[3 * l], b[3 * l + 1], 0);
|
|
16650
|
+
const t = n.vec3.normalize(Zp, Zp), e = -b[3 * l + 2];
|
|
16636
16651
|
if (e) {
|
|
16637
|
-
const i = n.quat.setAxisAngle(
|
|
16638
|
-
n.mat4.fromTranslation(
|
|
16652
|
+
const i = n.quat.setAxisAngle(qp, t, e);
|
|
16653
|
+
n.mat4.fromTranslation(Jp, Lp), n.mat4.fromQuat(Kp, i), x = n.mat4.multiply(Kp, Kp, Jp);
|
|
16639
16654
|
}
|
|
16640
16655
|
}
|
|
16641
16656
|
for (let t = 0; t < 4; t++) {
|
|
16642
16657
|
const e = 2 * (l + t);
|
|
16643
|
-
n.vec2.set(
|
|
16644
|
-
u ? (n.vec2.multiply(
|
|
16645
|
-
n.vec2.add(
|
|
16658
|
+
n.vec2.set(Wp, m[e] / 10, m[e + 1] / 10), n.vec2.scale(Wp, Wp, N / 24), n.vec2.transformMat2(Wp, Wp, y),
|
|
16659
|
+
u ? (n.vec2.multiply(Wp, Wp, Xp), n.vec2.add($p, Wp, d), v && ($p[2] = 0, x && n.vec3.transformMat4($p, $p, x))) : (n.vec2.multiply($p, d, Xp),
|
|
16660
|
+
n.vec2.add($p, Wp, $p)), Yp[0] = 10 * $p[0], Yp[1] = 10 * $p[1], v && (Yp[2] = 10 * $p[2]);
|
|
16646
16661
|
const i = (v ? 3 : 2) * (l + t);
|
|
16647
|
-
(g[i] !==
|
|
16648
|
-
g[i] =
|
|
16662
|
+
(g[i] !== Yp[0] || g[i + 1] !== Yp[1] || v && g[i + 2] !== Yp[2]) && (g.dirty = !0,
|
|
16663
|
+
g[i] = Yp[0], g[i + 1] = Yp[1], v && (g[i + 2] = Yp[2]));
|
|
16649
16664
|
}
|
|
16650
16665
|
}
|
|
16651
16666
|
return C;
|
|
16652
16667
|
}
|
|
16653
16668
|
Ha(t, e, n, i, r, s, o, a, l) {
|
|
16654
16669
|
const h = r - i <= 3, u = this.getMap();
|
|
16655
|
-
return h ? 0 :
|
|
16670
|
+
return h ? 0 : Cp.call(this, ty, ey, t, e, n, i, r, s, o, a, u.width / u.height, l);
|
|
16656
16671
|
}
|
|
16657
16672
|
isBoxCollides(t, e, n, i, r, s) {
|
|
16658
16673
|
return this.isLabelCollides(0, t, e, n, i, r, s);
|
|
@@ -16671,28 +16686,28 @@
|
|
|
16671
16686
|
init() {
|
|
16672
16687
|
const t = this.regl;
|
|
16673
16688
|
this.renderer = new n.reshader.Renderer(t);
|
|
16674
|
-
const {uniforms: e, extraCommandProps: i} =
|
|
16689
|
+
const {uniforms: e, extraCommandProps: i} = qd.call(this, this.canvas, this.sceneConfig), r = this.canvas, s = {
|
|
16675
16690
|
x: (t, e) => e.viewport ? e.viewport.x : 0,
|
|
16676
16691
|
y: (t, e) => e.viewport ? e.viewport.y : 0,
|
|
16677
16692
|
width: (t, e) => e.viewport ? e.viewport.width : r ? r.width : 1,
|
|
16678
16693
|
height: (t, e) => e.viewport ? e.viewport.height : r ? r.height : 1
|
|
16679
16694
|
};
|
|
16680
16695
|
i.viewport = s, this.shader = new n.reshader.MeshShader({
|
|
16681
|
-
vert:
|
|
16682
|
-
frag:
|
|
16696
|
+
vert: sp,
|
|
16697
|
+
frag: op,
|
|
16683
16698
|
uniforms: e,
|
|
16684
16699
|
extraCommandProps: i
|
|
16685
16700
|
});
|
|
16686
16701
|
let o = i;
|
|
16687
|
-
if (this.layer.getRenderer().isEnableWorkAround("win-intel-gpu-crash") && (o =
|
|
16688
|
-
o.stencil =
|
|
16689
|
-
vert:
|
|
16690
|
-
frag:
|
|
16702
|
+
if (this.layer.getRenderer().isEnableWorkAround("win-intel-gpu-crash") && (o = Ll({}, i),
|
|
16703
|
+
o.stencil = Ll({}, i.stencil), o.stencil.enable = !0), this.Na = new n.reshader.MeshShader({
|
|
16704
|
+
vert: Ep,
|
|
16705
|
+
frag: op,
|
|
16691
16706
|
uniforms: e,
|
|
16692
16707
|
extraCommandProps: o
|
|
16693
16708
|
}), this.pickingFBO) {
|
|
16694
16709
|
const t = new n.reshader.FBORayPicking(this.renderer, {
|
|
16695
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
16710
|
+
vert: "#define PICKING_MODE 1\n" + sp,
|
|
16696
16711
|
uniforms: e,
|
|
16697
16712
|
extraCommandProps: {
|
|
16698
16713
|
viewport: this.pickingViewport
|
|
@@ -16703,7 +16718,7 @@
|
|
|
16703
16718
|
return "line" !== this.getSymbol(e).textPlacement;
|
|
16704
16719
|
};
|
|
16705
16720
|
const i = new n.reshader.FBORayPicking(this.renderer, {
|
|
16706
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
16721
|
+
vert: "#define PICKING_MODE 1\n" + Ep,
|
|
16707
16722
|
uniforms: e,
|
|
16708
16723
|
extraCommandProps: {
|
|
16709
16724
|
viewport: this.pickingViewport
|
|
@@ -16713,7 +16728,7 @@
|
|
|
16713
16728
|
}
|
|
16714
16729
|
}
|
|
16715
16730
|
getUniformValues(t, e) {
|
|
16716
|
-
const i = e && e.isRenderingTerrainSkin, r = this.layer.getTileSize().width, s = i ?
|
|
16731
|
+
const i = e && e.isRenderingTerrainSkin, r = this.layer.getTileSize().width, s = i ? ay : t.projViewMatrix, o = t.cameraToCenterDistance, a = n.vec2.set(Qp, t.width, t.height);
|
|
16717
16732
|
i && n.vec2.set(a, r, r);
|
|
16718
16733
|
const l = R(t.getResolution(), t);
|
|
16719
16734
|
return {
|
|
@@ -16734,7 +16749,7 @@
|
|
|
16734
16749
|
};
|
|
16735
16750
|
}
|
|
16736
16751
|
}
|
|
16737
|
-
function
|
|
16752
|
+
function uy(t, e, n, i) {
|
|
16738
16753
|
for (let r = n; r < i; r += 6) {
|
|
16739
16754
|
const n = e[r];
|
|
16740
16755
|
for (let e = 0; e < 4; e++) {
|
|
@@ -16743,17 +16758,17 @@
|
|
|
16743
16758
|
}
|
|
16744
16759
|
}
|
|
16745
16760
|
}
|
|
16746
|
-
function
|
|
16761
|
+
function cy(t, e) {
|
|
16747
16762
|
const n = t.properties.level - e.properties.level;
|
|
16748
16763
|
return 0 === n ? t.properties.meshKey - e.properties.meshKey : n;
|
|
16749
16764
|
}
|
|
16750
|
-
var
|
|
16751
|
-
const
|
|
16765
|
+
var fy = "#define SHADER_NAME NATIVE_POINT\n#include <gl2_vert>\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\n#ifdef HAS_COLOR\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\nuniform mat4 positionMatrix;\nuniform mat4 projViewModelMatrix;\nuniform float markerSize;\n#ifdef PICKING_MODE\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\n gl_PointSize = markerSize;\n#ifdef HAS_COLOR\nvColor = aColor / 255.;\n#endif\n#ifdef PICKING_MODE\nfbo_picking_setData(gl_Position.w, true);\n#endif\n}";
|
|
16766
|
+
const dy = {
|
|
16752
16767
|
markerFill: [ 0, 0, 0 ],
|
|
16753
16768
|
markerOpacity: 1,
|
|
16754
16769
|
markerSize: 10
|
|
16755
16770
|
};
|
|
16756
|
-
class
|
|
16771
|
+
class py extends Df {
|
|
16757
16772
|
getPrimitive() {
|
|
16758
16773
|
return "points";
|
|
16759
16774
|
}
|
|
@@ -16771,7 +16786,7 @@
|
|
|
16771
16786
|
const a = {};
|
|
16772
16787
|
Bl(a, "markerOpacity", o, "markerOpacity", 1), Bl(a, "markerSize", o, "markerSize", 10),
|
|
16773
16788
|
Bl(a, "markerFill", o, "markerFill", "#000", $l(this.colorCache, 3));
|
|
16774
|
-
const l = new n.reshader.Material(a,
|
|
16789
|
+
const l = new n.reshader.Material(a, dy);
|
|
16775
16790
|
l.createDefines = () => "square" !== o.markerType ? {
|
|
16776
16791
|
USE_CIRCLE: 1
|
|
16777
16792
|
} : null, l.appendDefines = t => ("square" !== o.markerType && (t.USE_CIRCLE = 1),
|
|
@@ -16803,7 +16818,7 @@
|
|
|
16803
16818
|
const t = this.regl;
|
|
16804
16819
|
this.renderer = new n.reshader.Renderer(t);
|
|
16805
16820
|
const e = [], i = {
|
|
16806
|
-
vert:
|
|
16821
|
+
vert: fy,
|
|
16807
16822
|
frag: "#define SHADER_NAME NATIVE_POINT\nprecision mediump float;\n#include <gl2_frag>\n#ifdef USE_CIRCLE\n#if __VERSION__ == 100\n#ifdef GL_OES_standard_derivatives\n#define STANDARD_DERIVATIVES_ENABLED 1\n#extension GL_OES_standard_derivatives : enable\n#endif\n#else\n#define STANDARD_DERIVATIVES_ENABLED 1\n#endif\n#endif\n#ifdef HAS_COLOR\nvarying vec4 vColor;\n#else\nuniform vec3 markerFill;\n#endif\nuniform float markerOpacity;\nuniform float layerOpacity;\nvoid main() {\n float c = 1.;\n#ifdef USE_CIRCLE\nfloat r = .0, d = .0;\n vec2 e = 2. * gl_PointCoord - 1.;\n r = dot(e, e);\n if(r > 1.) {\n discard;\n }\n#ifdef STANDARD_DERIVATIVES_ENABLED\nd = fwidth(r);\n c = 1. - smoothstep(1. - d, 1. + d, r);\n#endif\n#endif\n#ifdef HAS_COLOR\nvec4 f = vColor;\n#else\nvec4 f = vec4(markerFill, 1.);\n#endif\nglFragColor = f * markerOpacity * c * layerOpacity;\n#if __VERSION__ == 100\ngl_FragColor = glFragColor;\n#endif\n}",
|
|
16808
16823
|
uniforms: [ {
|
|
16809
16824
|
name: "projViewModelMatrix",
|
|
@@ -16836,7 +16851,7 @@
|
|
|
16836
16851
|
if (this.shader = new n.reshader.MeshShader(i), this.shader.version = 300, this.pickingFBO) {
|
|
16837
16852
|
const t = [];
|
|
16838
16853
|
this.picking = [ new n.reshader.FBORayPicking(this.renderer, {
|
|
16839
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
16854
|
+
vert: "#define PICKING_MODE 1\n" + fy,
|
|
16840
16855
|
uniforms: [ {
|
|
16841
16856
|
name: "projViewModelMatrix",
|
|
16842
16857
|
type: "function",
|
|
@@ -16856,9 +16871,9 @@
|
|
|
16856
16871
|
};
|
|
16857
16872
|
}
|
|
16858
16873
|
}
|
|
16859
|
-
var
|
|
16860
|
-
const
|
|
16861
|
-
class
|
|
16874
|
+
var yy = "#define SHADER_NAME NATIVE_LINE\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nuniform mat4 projViewModelMatrix;\n#ifndef PICKING_MODE\n#if defined(HAS_COLOR)\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\n#else\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n gl_Position = projViewModelMatrix * vec4(c, 1.);\n#ifndef PICKING_MODE\n#if defined(HAS_COLOR)\nvColor = aColor / 255.;\n#endif\n#else\nfbo_picking_setData(gl_Position.w, true);\n#endif\n}";
|
|
16875
|
+
const my = n.mat4.identity([]);
|
|
16876
|
+
class gy extends Df {
|
|
16862
16877
|
constructor(t, e, n, i, r, s) {
|
|
16863
16878
|
if (super(t, e, n, i, r, s), this.primitive = "lines", x(this.symbolDef.lineColor)) {
|
|
16864
16879
|
const t = e.getMap(), n = w(this.symbolDef.lineColor);
|
|
@@ -16900,7 +16915,7 @@
|
|
|
16900
16915
|
return n.mat4.multiply(i, e.projViewMatrix, e.modelMatrix), i;
|
|
16901
16916
|
}
|
|
16902
16917
|
} ], a = this.sceneConfig.depthRange, l = {
|
|
16903
|
-
vert:
|
|
16918
|
+
vert: yy,
|
|
16904
16919
|
frag: "#define SHADER_NAME NATIVE_LINE\nprecision mediump float;\nuniform float lineOpacity;\nuniform vec4 lineColor;\nuniform float layerOpacity;\n#if defined(HAS_COLOR)\nvarying vec4 vColor;\n#endif\nvoid main() {\n gl_FragColor = lineColor * lineOpacity;\n#if defined(HAS_COLOR)\ngl_FragColor *= vColor;\n#endif\ngl_FragColor *= layerOpacity;\n}",
|
|
16905
16920
|
uniforms: o,
|
|
16906
16921
|
defines: null,
|
|
@@ -16937,7 +16952,7 @@
|
|
|
16937
16952
|
}
|
|
16938
16953
|
};
|
|
16939
16954
|
this.shader = new n.reshader.MeshShader(l), this.pickingFBO && (this.picking = [ new n.reshader.FBORayPicking(this.renderer, {
|
|
16940
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
16955
|
+
vert: "#define PICKING_MODE 1\n" + yy,
|
|
16941
16956
|
uniforms: o,
|
|
16942
16957
|
extraCommandProps: {
|
|
16943
16958
|
viewport: this.pickingViewport
|
|
@@ -16947,7 +16962,7 @@
|
|
|
16947
16962
|
getUniformValues(t, e) {
|
|
16948
16963
|
const n = e && e.isRenderingTerrainSkin;
|
|
16949
16964
|
return {
|
|
16950
|
-
projViewMatrix: n ?
|
|
16965
|
+
projViewMatrix: n ? my : t.projViewMatrix,
|
|
16951
16966
|
viewport: n && e && e.viewport
|
|
16952
16967
|
};
|
|
16953
16968
|
}
|
|
@@ -16955,8 +16970,8 @@
|
|
|
16955
16970
|
return "lines";
|
|
16956
16971
|
}
|
|
16957
16972
|
}
|
|
16958
|
-
const
|
|
16959
|
-
class
|
|
16973
|
+
const vy = [ 0, 0 ], xy = [ 1, 1, 1 ], by = [ 1, 1, 1, 1 ], wy = [ 0, 0 ], Ay = [ 1, 1 ], My = [], _y = new r.Coordinate(0, 0), Sy = new r.Coordinate(0, 0), ky = [], Py = [];
|
|
16974
|
+
class Ty extends If {
|
|
16960
16975
|
supportRenderMode(t) {
|
|
16961
16976
|
return this.isAnimating() ? "fxaa" === t || "fxaaAfterTaa" === t : "taa" === t || "fxaa" === t;
|
|
16962
16977
|
}
|
|
@@ -16973,9 +16988,9 @@
|
|
|
16973
16988
|
if (!this.material) return this.setToRedraw(), null;
|
|
16974
16989
|
const {geometry: s, symbolIndex: o} = t, a = this.layer instanceof r.TileLayer, l = new n.reshader.Mesh(s, this.material);
|
|
16975
16990
|
if (this.sceneConfig.animation) {
|
|
16976
|
-
|
|
16991
|
+
xy[2] = .01;
|
|
16977
16992
|
const t = [];
|
|
16978
|
-
n.mat4.fromScaling(t,
|
|
16993
|
+
n.mat4.fromScaling(t, xy), n.mat4.multiply(t, e, t), e = t;
|
|
16979
16994
|
}
|
|
16980
16995
|
const h = this.getSymbolDef(o), u = this.getFnTypeConfig(o);
|
|
16981
16996
|
Kc(s, h, u);
|
|
@@ -16997,12 +17012,12 @@
|
|
|
16997
17012
|
}
|
|
16998
17013
|
});
|
|
16999
17014
|
} else {
|
|
17000
|
-
Bl(l.uniforms, "polygonFill", d, "polygonFill",
|
|
17015
|
+
Bl(l.uniforms, "polygonFill", d, "polygonFill", by, p), Bl(l.uniforms, "polygonOpacity", d, "polygonOpacity", 1);
|
|
17001
17016
|
const t = [];
|
|
17002
17017
|
Object.defineProperty(l.uniforms, "vertexColorsOfType", {
|
|
17003
17018
|
enumerable: !0,
|
|
17004
17019
|
get: () => {
|
|
17005
|
-
const e = p(d.bottomPolygonFill ||
|
|
17020
|
+
const e = p(d.bottomPolygonFill || by), n = p(d.topPolygonFill || by);
|
|
17006
17021
|
t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t[4] = n[0], t[5] = n[1], t[6] = n[2],
|
|
17007
17022
|
t[7] = n[3];
|
|
17008
17023
|
const i = l.geometry.properties.vertexColors;
|
|
@@ -17067,16 +17082,16 @@
|
|
|
17067
17082
|
}), l.properties.symbolIndex = o, l;
|
|
17068
17083
|
}
|
|
17069
17084
|
Va(t, e, i, r, s, o) {
|
|
17070
|
-
if (1 === this.dataConfig.topUVMode) return
|
|
17085
|
+
if (1 === this.dataConfig.topUVMode) return vy;
|
|
17071
17086
|
const a = this.getMap(), l = this.getSymbol(e).material;
|
|
17072
17087
|
let h = i;
|
|
17073
|
-
!this.dataConfig.side && l && l.textureOrigin && (
|
|
17074
|
-
a.coordToPointAtRes(
|
|
17088
|
+
!this.dataConfig.side && l && l.textureOrigin && (_y.set(l.textureOrigin[0], l.textureOrigin[1]),
|
|
17089
|
+
a.coordToPointAtRes(_y, r, Sy), h = n.vec2.set(ky, i[0] - Sy.x, i[1] - Sy.y));
|
|
17075
17090
|
const u = !!l && l.uvOffsetInMeter;
|
|
17076
|
-
let c = l && l.uvOffset ||
|
|
17091
|
+
let c = l && l.uvOffset || wy;
|
|
17077
17092
|
const f = this.getUVOffsetAnim();
|
|
17078
17093
|
f && (c = this.getUVOffset(f));
|
|
17079
|
-
const d = l && l.uvScale ||
|
|
17094
|
+
const d = l && l.uvScale || Ay;
|
|
17080
17095
|
let p = this.dataConfig.side ? 0 : h[0], y = this.dataConfig.side ? 0 : h[1];
|
|
17081
17096
|
const m = l && l.textureWidth || 23.25, g = m * d[1] / d[0];
|
|
17082
17097
|
u && (p += c[0] / s, y += c[1] / s);
|
|
@@ -17089,7 +17104,7 @@
|
|
|
17089
17104
|
super.callShader(t, e);
|
|
17090
17105
|
}
|
|
17091
17106
|
getShadowMeshes() {
|
|
17092
|
-
if (!this.isVisible()) return
|
|
17107
|
+
if (!this.isVisible()) return My;
|
|
17093
17108
|
this.shadowCount = this.scene.getMeshes().length;
|
|
17094
17109
|
const t = this.scene.getMeshes().filter(t => 0 === t.properties.level);
|
|
17095
17110
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -17103,7 +17118,7 @@
|
|
|
17103
17118
|
return t.material && t.material.uvOffsetAnim;
|
|
17104
17119
|
}
|
|
17105
17120
|
getUVOffset(t) {
|
|
17106
|
-
const e = this.getSymbols()[0], i = e.material && e.material.uvOffset ||
|
|
17121
|
+
const e = this.getSymbols()[0], i = e.material && e.material.uvOffset || wy, r = !!e.material && e.material.uvOffsetInMeter, s = performance.now() / 1e3, o = n.vec2.set(Py, i[0], i[1]);
|
|
17107
17122
|
return o[0] = s * t[0], o[1] = s * t[0], r || (o[0] %= 1, o[1] %= 1), o;
|
|
17108
17123
|
}
|
|
17109
17124
|
needPolygonOffset() {
|
|
@@ -17120,7 +17135,7 @@
|
|
|
17120
17135
|
Ks(t, e) {
|
|
17121
17136
|
if (null !== e) {
|
|
17122
17137
|
const i = t.localTransform;
|
|
17123
|
-
0 === e && (e = .01),
|
|
17138
|
+
0 === e && (e = .01), xy[2] = e, n.mat4.fromScaling(i, xy), n.mat4.multiply(i, t.properties.tileTransform, i),
|
|
17124
17139
|
t.setLocalTransform(i);
|
|
17125
17140
|
} else t.setLocalTransform(t.properties.tileTransform);
|
|
17126
17141
|
t.material !== this.material && t.setMaterial(this.material), t.geometry.properties.maxAltitude <= 0 && (this.ja = !0),
|
|
@@ -17175,26 +17190,26 @@
|
|
|
17175
17190
|
updateSymbol(t, e) {
|
|
17176
17191
|
let n = !1;
|
|
17177
17192
|
t && t.material && (n = function(t, e) {
|
|
17178
|
-
for (const n in e) if (
|
|
17193
|
+
for (const n in e) if (Oy[n] && e[n] !== t[n] && (!t[n] || !e[n])) return !0;
|
|
17179
17194
|
return !1;
|
|
17180
17195
|
}(this.symbolDef[0].material || {}, t.material));
|
|
17181
17196
|
const i = super.updateSymbol(t, e);
|
|
17182
17197
|
return t && t.material && this.Wr(t.material), n || i;
|
|
17183
17198
|
}
|
|
17184
17199
|
Ts(t, e) {
|
|
17185
|
-
return
|
|
17200
|
+
return Fy(t) !== Fy(e);
|
|
17186
17201
|
}
|
|
17187
17202
|
}
|
|
17188
|
-
function
|
|
17203
|
+
function Fy(t) {
|
|
17189
17204
|
if (!t || !t.material) return !1;
|
|
17190
17205
|
for (const e in t.material) if (e.indexOf("Texture") > 0 && t.material[e]) return !0;
|
|
17191
17206
|
return !1;
|
|
17192
17207
|
}
|
|
17193
|
-
const
|
|
17208
|
+
const Oy = {
|
|
17194
17209
|
normalTexture: 1,
|
|
17195
17210
|
bumpTexture: 1
|
|
17196
17211
|
};
|
|
17197
|
-
class
|
|
17212
|
+
class Iy extends Ty {
|
|
17198
17213
|
createGeometry(t) {
|
|
17199
17214
|
const e = t.data, i = this.getSymbols()[0];
|
|
17200
17215
|
if (i.material && i.material.extrusionOpacity) {
|
|
@@ -17203,7 +17218,7 @@
|
|
|
17203
17218
|
e.aExtrusionOpacity = t;
|
|
17204
17219
|
}
|
|
17205
17220
|
const r = new n.reshader.Geometry(e, t.indices);
|
|
17206
|
-
return
|
|
17221
|
+
return Ll(r.properties, t.properties), this.Vs(r, t), {
|
|
17207
17222
|
geometry: r,
|
|
17208
17223
|
symbolIndex: {
|
|
17209
17224
|
index: 0
|
|
@@ -17212,7 +17227,7 @@
|
|
|
17212
17227
|
}
|
|
17213
17228
|
updateSceneConfig(t) {
|
|
17214
17229
|
let e;
|
|
17215
|
-
if (this.sceneConfig.cullFace !== t.cullFace && (e = !0),
|
|
17230
|
+
if (this.sceneConfig.cullFace !== t.cullFace && (e = !0), Ll(this.sceneConfig, t),
|
|
17216
17231
|
e) {
|
|
17217
17232
|
const t = this.getShaderConfig();
|
|
17218
17233
|
this.shader.dispose(), this.shader = new n.reshader.PhongShader(t);
|
|
@@ -17302,7 +17317,7 @@
|
|
|
17302
17317
|
this.material = new n.reshader.PhongMaterial(e);
|
|
17303
17318
|
}
|
|
17304
17319
|
getUniformValues(t, e) {
|
|
17305
|
-
const n = t.viewMatrix, i = t.projMatrix, r = t.cameraPosition, s = this.Ga(), o =
|
|
17320
|
+
const n = t.viewMatrix, i = t.projMatrix, r = t.cameraPosition, s = this.Ga(), o = Ll({
|
|
17306
17321
|
viewMatrix: n,
|
|
17307
17322
|
projMatrix: i,
|
|
17308
17323
|
cameraPosition: r,
|
|
@@ -17325,8 +17340,8 @@
|
|
|
17325
17340
|
};
|
|
17326
17341
|
}
|
|
17327
17342
|
}
|
|
17328
|
-
const
|
|
17329
|
-
class
|
|
17343
|
+
const Cy = [ 1, 1, 1 ];
|
|
17344
|
+
class Ey extends If {
|
|
17330
17345
|
createGeometry(t) {
|
|
17331
17346
|
const {data: e, indices: i} = t, r = new n.reshader.Geometry(e, i, 0, {
|
|
17332
17347
|
primitive: "lines"
|
|
@@ -17341,9 +17356,9 @@
|
|
|
17341
17356
|
createMesh(t, e) {
|
|
17342
17357
|
const {geometry: i} = t, r = new n.reshader.Mesh(i);
|
|
17343
17358
|
if (r.castShadow = !1, this.sceneConfig.animation) {
|
|
17344
|
-
|
|
17359
|
+
Cy[2] = .01;
|
|
17345
17360
|
const t = [];
|
|
17346
|
-
n.mat4.fromScaling(t,
|
|
17361
|
+
n.mat4.fromScaling(t, Cy), n.mat4.multiply(t, e, t), e = t;
|
|
17347
17362
|
}
|
|
17348
17363
|
return r.setLocalTransform(e), r.properties.symbolIndex = {
|
|
17349
17364
|
index: 0
|
|
@@ -17352,7 +17367,7 @@
|
|
|
17352
17367
|
addMesh(t, e) {
|
|
17353
17368
|
if (!t.length) return this;
|
|
17354
17369
|
let i;
|
|
17355
|
-
null !== e ? (0 === e && (e = .01), i = t[0].localTransform,
|
|
17370
|
+
null !== e ? (0 === e && (e = .01), i = t[0].localTransform, Cy[2] = e, n.mat4.fromScaling(i, Cy),
|
|
17356
17371
|
n.mat4.multiply(i, t[0].properties.tileTransform, i)) : i = t[0].properties.tileTransform;
|
|
17357
17372
|
for (let e = 0; e < t.length; e++) t[e].setLocalTransform(i);
|
|
17358
17373
|
return this.scene.addMesh(t), this;
|
|
@@ -17408,8 +17423,8 @@
|
|
|
17408
17423
|
};
|
|
17409
17424
|
}
|
|
17410
17425
|
}
|
|
17411
|
-
const {getPBRUniforms:
|
|
17412
|
-
class
|
|
17426
|
+
const {getPBRUniforms: Dy} = n.reshader.pbr.PBRUtils;
|
|
17427
|
+
class Ny extends Ty {
|
|
17413
17428
|
constructor(...t) {
|
|
17414
17429
|
super(...t), this.Wa = new n.reshader.ResourceLoader, this.scene.sortFunction = this.sortByCommandKey;
|
|
17415
17430
|
}
|
|
@@ -17435,7 +17450,7 @@
|
|
|
17435
17450
|
};
|
|
17436
17451
|
t.aAltitude && (e.altitudeAttribute = "aAltitude");
|
|
17437
17452
|
const i = new n.reshader.Geometry(t.data, t.indices, 0, e);
|
|
17438
|
-
return
|
|
17453
|
+
return Ll(i.properties, t.properties), t.vertexColors && (i.properties.vertexColors = t.vertexColors),
|
|
17439
17454
|
this.material.uniforms.normalTexture && !i.data[i.desc.tangentAttribute] && i.data[i.desc.uv0Attribute] && (i.data[i.desc.normalAttribute] || i.createNormal(),
|
|
17440
17455
|
i.createTangent()), this.Vs(i, t), {
|
|
17441
17456
|
geometry: i,
|
|
@@ -17451,7 +17466,7 @@
|
|
|
17451
17466
|
let n = !!t.ssr && this.getSymbols()[0].ssr;
|
|
17452
17467
|
const i = this.shader, r = i.shaderDefines;
|
|
17453
17468
|
if (n) {
|
|
17454
|
-
const e =
|
|
17469
|
+
const e = Ll({}, r, t.ssr.defines);
|
|
17455
17470
|
i.shaderDefines = e;
|
|
17456
17471
|
}
|
|
17457
17472
|
if (t.onlyUpdateDepthInTaa && (this.shader = this.Xa, !n && this.Ya && (this.shader = i,
|
|
@@ -17462,7 +17477,7 @@
|
|
|
17462
17477
|
this.shader = i, n && (i.shaderDefines = r), delete this.shadowCount, this.Ya = n;
|
|
17463
17478
|
}
|
|
17464
17479
|
updateSceneConfig(t) {
|
|
17465
|
-
|
|
17480
|
+
Ll(this.sceneConfig, t), this.setToRedraw();
|
|
17466
17481
|
}
|
|
17467
17482
|
delete() {
|
|
17468
17483
|
super.delete(), this.disposeIBLTextures(), this.material.dispose(), this.Xa && (this.Xa.dispose(),
|
|
@@ -17550,7 +17565,7 @@
|
|
|
17550
17565
|
Wr(t) {
|
|
17551
17566
|
if (t) {
|
|
17552
17567
|
const e = this.getSymbols()[0].material;
|
|
17553
|
-
e &&
|
|
17568
|
+
e && Ll(e, t);
|
|
17554
17569
|
}
|
|
17555
17570
|
const e = this.dataConfig, i = t || this.getSymbols()[0].material, r = {};
|
|
17556
17571
|
let s = !1;
|
|
@@ -17584,7 +17599,7 @@
|
|
|
17584
17599
|
return this.shader;
|
|
17585
17600
|
}
|
|
17586
17601
|
getUniformValues(t, e) {
|
|
17587
|
-
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r =
|
|
17602
|
+
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = Dy(t, n, i, e && e.ssr, e && e.jitter);
|
|
17588
17603
|
return this.setIncludeUniformValues(r, e), r;
|
|
17589
17604
|
}
|
|
17590
17605
|
nl(t) {
|
|
@@ -17596,8 +17611,8 @@
|
|
|
17596
17611
|
this.nl(t), this.shader.shaderDefines = t;
|
|
17597
17612
|
}
|
|
17598
17613
|
}
|
|
17599
|
-
var
|
|
17600
|
-
const {getPBRUniforms:
|
|
17614
|
+
var Ry = "#include <gl2_vert>\n#define EXTRUDE_SCALE 63.0\n#define EXTRUDE_MOD 64.0\n#define MAX_LINE_DISTANCE 65535.0\nuniform mat4 projViewModelMatrix;\nuniform vec2 centiMeterToLocal;\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec4 aTubeNormal;\n#ifdef HAS_LINE_WIDTH\nattribute float aLineWidth;\n#else\nuniform float lineWidth;\n#endif\n#include <vt_position_vert>\n#ifdef PICKING_MODE\n#include <fbo_picking_vert>\n#else\nuniform mat4 modelViewMatrix;\nuniform mat3 modelNormalMatrix;\nuniform mat4 modelMatrix;\n#if defined(HAS_PATTERN)\nuniform float resolution;\nuniform float tileResolution;\nuniform float tileRatio;\nattribute float aLinesofar;\nvarying highp float vLinesofar;\nattribute vec4 aTexInfo;\nvarying vec4 vTexInfo;\nvarying float vNormalY;\nvarying float vPatternHeight;\nattribute float aNormalDistance;\n#if defined(HAS_PATTERN_ANIM)\nattribute float aLinePatternAnimSpeed;\nvarying float vLinePatternAnimSpeed;\n#endif\n#if defined(HAS_PATTERN_GAP)\nattribute float aLinePatternGap;\nvarying float vLinePatternGap;\n#endif\n#endif\n#ifdef HAS_COLOR\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\n#ifdef HAS_OPACITY\nattribute float aOpacity;\n#endif\nvarying float vOpacity;\nvarying vec3 vModelNormal;\nvarying vec4 vViewVertex;\nvarying vec3 vModelVertex;\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_vert>\n#endif\n#include <highlight_vert>\nvoid main() {\n \n#ifdef HAS_LINE_WIDTH\nfloat c = aLineWidth;\n#else\nfloat c = lineWidth;\n#endif\nfloat d = c / 2.;\n vec3 e = aTubeNormal.xyz / EXTRUDE_SCALE;\n vec3 f = unpackVTPosition();\n vec4 h = vec4(f, 1.);\n h.xy += e.xy * d * centiMeterToLocal;\n h.z += e.z * d;\n gl_Position = projViewModelMatrix * h;\n#ifdef PICKING_MODE\nfbo_picking_setData(gl_Position.w, true);\n#else\nvViewVertex = modelViewMatrix * h;\n vec3 i = normalize(e);\n vModelNormal = modelNormalMatrix * i;\n vModelVertex = (modelMatrix * h).xyz;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nshadow_computeShadowPars(h);\n#endif\n#ifdef HAS_COLOR\nvColor = aColor / 255.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_PATTERN\nfloat j = tileResolution / resolution;\n float k = aLinesofar - d * centiMeterToLocal.y * aNormalDistance / EXTRUDE_SCALE;\n vLinesofar = k / tileRatio * j;\n vTexInfo = vec4(aTexInfo.xy, aTexInfo.zw + 1.);\n vPatternHeight = c * centiMeterToLocal.x / tileRatio * j;\n vNormalY = aTubeNormal.w / EXTRUDE_SCALE;\n#if defined(HAS_PATTERN_ANIM)\nvLinePatternAnimSpeed = aLinePatternAnimSpeed / 127.;\n#endif\n#if defined(HAS_PATTERN_GAP)\nvLinePatternGap = aLinePatternGap / 10.0;\n#endif\n#endif\nhighlight_setVarying();\n#endif\n}";
|
|
17615
|
+
const {getPBRUniforms: zy} = n.reshader.pbr.PBRUtils;
|
|
17601
17616
|
class Ly extends Df {
|
|
17602
17617
|
needToRedraw() {
|
|
17603
17618
|
return super.needToRedraw() || this.isAnimating();
|
|
@@ -17669,7 +17684,7 @@
|
|
|
17669
17684
|
if (this.renderer = new n.reshader.Renderer(e), this.createShader(t), this.pickingFBO) {
|
|
17670
17685
|
const t = [];
|
|
17671
17686
|
this.picking = [ new n.reshader.FBORayPicking(this.renderer, {
|
|
17672
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
17687
|
+
vert: "#define PICKING_MODE 1\n" + Ry,
|
|
17673
17688
|
uniforms: [ {
|
|
17674
17689
|
name: "projViewModelMatrix",
|
|
17675
17690
|
type: "function",
|
|
@@ -17697,7 +17712,7 @@
|
|
|
17697
17712
|
return n.mat4.multiply(i, e.projViewMatrix, e.modelMatrix), i;
|
|
17698
17713
|
}
|
|
17699
17714
|
}), this.shader = new n.reshader.pbr.StandardShader({
|
|
17700
|
-
vert:
|
|
17715
|
+
vert: Ry,
|
|
17701
17716
|
uniforms: e,
|
|
17702
17717
|
defines: this.nl(i),
|
|
17703
17718
|
extraCommandProps: this.getExtraCommandProps()
|
|
@@ -17746,7 +17761,7 @@
|
|
|
17746
17761
|
};
|
|
17747
17762
|
}
|
|
17748
17763
|
getUniformValues(t, e) {
|
|
17749
|
-
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r =
|
|
17764
|
+
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = zy(t, n, i, null, e && e.jitter), s = t.projViewMatrix, o = t.viewMatrix;
|
|
17750
17765
|
return r.projViewMatrix = s, r.viewMatrix = o, r.resolution = t.getResolution(),
|
|
17751
17766
|
r.currentTime = this.layer.getRenderer().getFrameTimestamp() || 0, this.setIncludeUniformValues(r, e),
|
|
17752
17767
|
r;
|
|
@@ -17827,7 +17842,7 @@
|
|
|
17827
17842
|
delete this.shader);
|
|
17828
17843
|
}
|
|
17829
17844
|
}
|
|
17830
|
-
const
|
|
17845
|
+
const Hy = [], Uy = [], Vy = [], jy = [], By = [], Gy = [ 0, 0, 0 ], Wy = [ 0, 0, 0 ], $y = [ 1, 1, 1 ], Xy = [], Yy = [ 1, 1, 1, 1 ], qy = [], Jy = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], Ky = t => class extends t {
|
|
17831
17846
|
constructor(t, e, i, r, s, o) {
|
|
17832
17847
|
super(t, e, i, r, s, o), this.il = !1, this.scene.sortFunction = this.sortByCommandKey,
|
|
17833
17848
|
this.rl = new n.reshader.GLTFManager(t), this.sl(), this.ol();
|
|
@@ -17843,7 +17858,7 @@
|
|
|
17843
17858
|
const {data: n, positionSize: i} = t;
|
|
17844
17859
|
return {
|
|
17845
17860
|
geometry: {
|
|
17846
|
-
properties:
|
|
17861
|
+
properties: Ll({}, t.properties),
|
|
17847
17862
|
data: n,
|
|
17848
17863
|
positionSize: i,
|
|
17849
17864
|
features: e
|
|
@@ -17852,7 +17867,7 @@
|
|
|
17852
17867
|
};
|
|
17853
17868
|
}
|
|
17854
17869
|
getFnTypeConfig() {
|
|
17855
|
-
return
|
|
17870
|
+
return Xy;
|
|
17856
17871
|
}
|
|
17857
17872
|
createMesh(t, e, {tileTranslationMatrix: i, tileExtent: r}, {timestamp: s}) {
|
|
17858
17873
|
if (!this.il) return null;
|
|
@@ -17885,8 +17900,8 @@
|
|
|
17885
17900
|
let c = 0;
|
|
17886
17901
|
r.forEach(t => {
|
|
17887
17902
|
const {geometry: i, nodeMatrix: r} = t;
|
|
17888
|
-
n.mat4.multiply(
|
|
17889
|
-
const s = n.mat4.multiply(
|
|
17903
|
+
n.mat4.multiply(qy, Jy, r), n.mat4.multiply(qy, u, qy);
|
|
17904
|
+
const s = n.mat4.multiply(qy, w, qy), o = i.boundingBox.copy();
|
|
17890
17905
|
o.transform(s);
|
|
17891
17906
|
const a = this.pl(o, e);
|
|
17892
17907
|
Math.abs(a) > Math.abs(c) && (c = a);
|
|
@@ -17905,15 +17920,15 @@
|
|
|
17905
17920
|
k.properties.startTime = s, S.HAS_SKIN = 1;
|
|
17906
17921
|
}
|
|
17907
17922
|
b && (k.setUniform("morphWeights", b), S.HAS_MORPH = 1), k.setUniform("hasAlpha", A.alphaMode && "BLEND" === A.alphaMode.toUpperCase()),
|
|
17908
|
-
Bl(k.uniforms, "polygonFill", e, "markerFill",
|
|
17923
|
+
Bl(k.uniforms, "polygonFill", e, "markerFill", Yy, $l(this.colorCache)), Bl(k.uniforms, "polygonOpacity", e, "markerOpacity", 1);
|
|
17909
17924
|
const P = [];
|
|
17910
17925
|
k.setPositionMatrix(() => {
|
|
17911
17926
|
const e = this.ml(t, d, M);
|
|
17912
|
-
n.mat4.multiply(P,
|
|
17913
|
-
const i = n.mat4.identity(
|
|
17927
|
+
n.mat4.multiply(P, Jy, e), this.dl(u), n.mat4.multiply(P, u, P), n.mat4.multiply(P, w, P);
|
|
17928
|
+
const i = n.mat4.identity(qy);
|
|
17914
17929
|
if (0 !== c && (n.mat4.fromTranslation(i, f), n.mat4.multiply(P, i, P)), ql(h)) {
|
|
17915
17930
|
const t = o.getGLScale() / o.getGLScale(h);
|
|
17916
|
-
return n.vec3.set(
|
|
17931
|
+
return n.vec3.set(Hy, t, t, t), n.mat4.fromScaling(i, Hy), n.mat4.multiply(i, i, P);
|
|
17917
17932
|
}
|
|
17918
17933
|
return P;
|
|
17919
17934
|
});
|
|
@@ -17925,7 +17940,7 @@
|
|
|
17925
17940
|
excludeElementsInVAO: !0
|
|
17926
17941
|
}), m.instance_color && (S.HAS_INSTANCE_COLOR = 1), m.aTerrainAltitude && (S.HAS_INSTANCE_TERRAIN_ALTITUDE = 1,
|
|
17927
17942
|
k.setUniform("terrainAltitudeScale", 100 * this.layer.getRenderer().getZScale())),
|
|
17928
|
-
S.HAS_LAYER_OPACITY = 1,
|
|
17943
|
+
S.HAS_LAYER_OPACITY = 1, Ll(k.properties, a.properties), k.setDefines(S), k.properties.symbolIndex = {
|
|
17929
17944
|
index: t
|
|
17930
17945
|
}, k;
|
|
17931
17946
|
});
|
|
@@ -17985,7 +18000,7 @@
|
|
|
17985
18000
|
n && this.setToRedraw(!0), super.prepareRender(t);
|
|
17986
18001
|
}
|
|
17987
18002
|
getShadowMeshes() {
|
|
17988
|
-
if (!this.isVisible()) return
|
|
18003
|
+
if (!this.isVisible()) return Xy;
|
|
17989
18004
|
this.shadowCount = this.scene.getMeshes().length;
|
|
17990
18005
|
return this.scene.getMeshes().filter(t => 0 === t.properties.level);
|
|
17991
18006
|
}
|
|
@@ -18012,13 +18027,13 @@
|
|
|
18012
18027
|
const i = _[0], r = _[1], d = n.vec3.set(M, i * p - S, -r * p - k, (_[2] + m) * y - P), g = a && a[e] || 0, v = l && l[e] || 0;
|
|
18013
18028
|
if (g || v) {
|
|
18014
18029
|
n.mat4.fromRotation(T, v, O);
|
|
18015
|
-
const t = n.vec3.set(
|
|
18030
|
+
const t = n.vec3.set(Hy, i, r, 0), e = n.vec3.normalize(t, n.vec3.cross(t, t, O));
|
|
18016
18031
|
n.mat4.rotate(T, T, g, e);
|
|
18017
|
-
const s = n.mat4.fromTranslation(
|
|
18032
|
+
const s = n.mat4.fromTranslation(qy, d);
|
|
18018
18033
|
n.mat4.multiply(T, s, T);
|
|
18019
18034
|
} else n.mat4.fromTranslation(T, d);
|
|
18020
18035
|
if (F) {
|
|
18021
|
-
const t = this.dl(
|
|
18036
|
+
const t = this.dl(qy, c, u, e);
|
|
18022
18037
|
n.mat4.multiply(T, T, t);
|
|
18023
18038
|
}
|
|
18024
18039
|
f("instance_vectorA", e, T, 0), f("instance_vectorB", e, T, 1), f("instance_vectorC", e, T, 2),
|
|
@@ -18038,11 +18053,11 @@
|
|
|
18038
18053
|
let l = o.translationX || 0, h = o.translationY || 0, u = o.translationZ || 0, c = o.rotationX || 0, f = o.rotationY || 0, d = o.rotationZ || 0, p = o.scaleX || 1, y = o.scaleY || 1, m = o.scaleZ || 1;
|
|
18039
18054
|
const g = i && i[r], v = e && e[g], x = s.getZoom(), b = v && v.feature && v.feature.properties, w = this.Ml(x, b);
|
|
18040
18055
|
this._l && (l = this._l(x, b)), this.Sl && (h = this.Sl(x, b)), this.kl && (u = this.kl(x, b));
|
|
18041
|
-
const A = n.vec3.set(
|
|
18056
|
+
const A = n.vec3.set(Uy, l * a, h * a, u * a);
|
|
18042
18057
|
this.Pl && (c = this.Pl(x, b)), this.Tl && (f = this.Tl(x, b)), this.Fl && (d = this.Fl(x, b));
|
|
18043
|
-
const M = n.vec3.set(
|
|
18058
|
+
const M = n.vec3.set(Vy, c, f, d);
|
|
18044
18059
|
this.Ol && (p = this.Ol(x, b)), this.Il && (y = this.Il(x, b)), this.Cl && (m = this.Cl(x, b));
|
|
18045
|
-
const _ = n.vec3.set(
|
|
18060
|
+
const _ = n.vec3.set(jy, p * w, y * w, m * w);
|
|
18046
18061
|
return this.El(t, A, M, _);
|
|
18047
18062
|
}
|
|
18048
18063
|
Ml(t, e) {
|
|
@@ -18125,27 +18140,27 @@
|
|
|
18125
18140
|
delete this.vl;
|
|
18126
18141
|
}
|
|
18127
18142
|
El(t, e, i, r) {
|
|
18128
|
-
const s = n.vec3.set(
|
|
18143
|
+
const s = n.vec3.set(Hy, ...e || Gy), o = i || Wy, a = r || $y, l = n.quat.fromEuler(By, o[0], o[1], o[2]);
|
|
18129
18144
|
return n.mat4.fromRotationTranslationScale(t, l, s, a);
|
|
18130
18145
|
}
|
|
18131
18146
|
};
|
|
18132
|
-
class
|
|
18147
|
+
class Zy extends(Ky(Iy)){
|
|
18133
18148
|
getMaterialClazz(t) {
|
|
18134
18149
|
return t.diffuseFactor ? n.reshader.PhongSpecularGlossinessMaterial : n.reshader.PhongMaterial;
|
|
18135
18150
|
}
|
|
18136
18151
|
}
|
|
18137
|
-
class
|
|
18152
|
+
class Qy extends(Ky(Ny)){
|
|
18138
18153
|
getMaterialClazz(t) {
|
|
18139
18154
|
return t.specularGlossinessTexture || t.diffuseTexture ? n.reshader.pbr.StandardSpecularGlossinessMaterial : n.reshader.pbr.StandardMaterial;
|
|
18140
18155
|
}
|
|
18141
18156
|
}
|
|
18142
|
-
const {getPBRUniforms:
|
|
18157
|
+
const {getPBRUniforms: tm} = n.reshader.pbr.PBRUtils, em = {
|
|
18143
18158
|
color: [ 2.0303, 2.028, 2.028 ],
|
|
18144
18159
|
direction: [ 0, -.2717, -1 ]
|
|
18145
|
-
},
|
|
18160
|
+
}, nm = {
|
|
18146
18161
|
index: 0
|
|
18147
|
-
},
|
|
18148
|
-
class
|
|
18162
|
+
}, im = [ 0, 0, 0 ], rm = [ 2, 2 ];
|
|
18163
|
+
class sm extends Df {
|
|
18149
18164
|
supportRenderMode(t) {
|
|
18150
18165
|
return "fxaa" === t || "fxaaBeforeTaa" === t;
|
|
18151
18166
|
}
|
|
@@ -18160,7 +18175,7 @@
|
|
|
18160
18175
|
}
|
|
18161
18176
|
needToRedraw() {
|
|
18162
18177
|
if (super.needToRedraw()) return !0;
|
|
18163
|
-
return this.getSymbol(
|
|
18178
|
+
return this.getSymbol(nm).animation;
|
|
18164
18179
|
}
|
|
18165
18180
|
createMesh(t, e) {
|
|
18166
18181
|
const {geometry: i} = t;
|
|
@@ -18169,26 +18184,26 @@
|
|
|
18169
18184
|
castShadow: !1,
|
|
18170
18185
|
picking: !0
|
|
18171
18186
|
});
|
|
18172
|
-
return r.properties.symbolIndex =
|
|
18187
|
+
return r.properties.symbolIndex = nm, r.setLocalTransform(e), r;
|
|
18173
18188
|
}
|
|
18174
18189
|
callShader(t, e) {
|
|
18175
18190
|
super.callShader(t, e), this.transformWater();
|
|
18176
|
-
const n = this.
|
|
18177
|
-
this.xs += this.renderer.render(this.
|
|
18191
|
+
const n = this.zl(this.getMap(), e);
|
|
18192
|
+
this.xs += this.renderer.render(this.Ll, n, this.Hl, this.getRenderFBO(e));
|
|
18178
18193
|
}
|
|
18179
18194
|
addMesh(t, e) {
|
|
18180
18195
|
this.Ks(t, e), super.addMesh(...arguments);
|
|
18181
18196
|
}
|
|
18182
18197
|
Ks(t) {
|
|
18183
|
-
const e = this.getSymbol(
|
|
18198
|
+
const e = this.getSymbol(nm).ssr;
|
|
18184
18199
|
for (let n = 0; n < t.length; n++) t[n].ssr = e ? 1 : 0;
|
|
18185
18200
|
}
|
|
18186
18201
|
paint(t) {
|
|
18187
|
-
t.states && t.states.includesChanged && (this.shader.dispose(), this.
|
|
18202
|
+
t.states && t.states.includesChanged && (this.shader.dispose(), this.Ll.dispose(),
|
|
18188
18203
|
this.Ys(t));
|
|
18189
|
-
const e = !!t.ssr && this.getSymbol(
|
|
18204
|
+
const e = !!t.ssr && this.getSymbol(nm).ssr, n = this.Ll, i = n.shaderDefines;
|
|
18190
18205
|
if (e) {
|
|
18191
|
-
const e =
|
|
18206
|
+
const e = Ll({}, i, t.ssr.defines);
|
|
18192
18207
|
n.shaderDefines = e;
|
|
18193
18208
|
}
|
|
18194
18209
|
this.updateIBLDefines(n), this.Ul.ssr = e ? 1 : 0, super.paint(t), e && (n.shaderDefines = i);
|
|
@@ -18346,7 +18361,7 @@
|
|
|
18346
18361
|
enable: !1
|
|
18347
18362
|
}
|
|
18348
18363
|
};
|
|
18349
|
-
r.push(...n.reshader.SsrPass.getUniformDeclares()), this.
|
|
18364
|
+
r.push(...n.reshader.SsrPass.getUniformDeclares()), this.Ll = new n.reshader.MeshShader({
|
|
18350
18365
|
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\n#include <highlight_vert>\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\nhighlight_setVarying();\n}",
|
|
18351
18366
|
frag: "#define SHADER_NAME WATER\nprecision highp float;\nprecision highp sampler2D;\n#include <hsv_frag>\nuniform vec3 hsv;\nuniform float contrast;\nuniform float layerOpacity;\n#if defined(HAS_SHADOWING)\n#include <vsm_shadow_frag>\n#endif\n#include <highlight_frag>\n#if defined(HAS_IBL_LIGHTING)\nuniform vec3 hdrHSV;\nuniform samplerCube prefilterMap;\nuniform sampler2D brdfLUT;\nuniform float rgbmRange;\nuniform mat3 uEnvironmentTransform;\nuniform vec3 diffuseSPH[9];\nvec3 c(const in vec3 d) {\n vec3 e = uEnvironmentTransform * d;\n float x = e.x;\n float y = e.y;\n float z = e.z;\n vec3 f = (diffuseSPH[0] + diffuseSPH[1] * x + diffuseSPH[2] * y + diffuseSPH[3] * z + diffuseSPH[4] * z * x + diffuseSPH[5] * y * z + diffuseSPH[6] * y * x + diffuseSPH[7] * (3. * z * z - 1.) + diffuseSPH[8] * (x * x - y * y));\n if(length(hdrHSV) > .0) {\n f = hsv_apply(f, hdrHSV);\n }\n return max(f, vec3(.0));\n}\nvec3 h(const in vec3 i, const in float j, const in float k, const in float l) {\n vec4 rgba = texture2D(brdfLUT, vec2(k, j));\n float b = (rgba[3] * 65280.0 + rgba[2] * 255.);\n float a = (rgba[1] * 65280.0 + rgba[0] * 255.);\n const float m = 1. / 65535.;\n return (i * a + b * l) * m;\n}\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 o(const in vec4 u, const in float v) {\n if(v <= .0)\n return u.rgb;\n return v * u.rgb * u.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 A(const in vec4 B) {\n return B.r + B.g / 255.;\n}\nfloat C(const in vec2 D, const in float E) {\n vec3 F = vec3(.06711056, .00583715, 52.9829189);\n return fract(F.z * fract(dot(D.xy + E * vec2(47., 17.) * .695, F.xy))) * .5;\n}\nvec3 G(const in float H, const in float I, const in vec2 J) {\n float K = min(I - .01, H);\n float L = floor(K);\n float M = min(I, L + 1.);\n float N = pow(2., M);\n vec2 O = 2. * N / J;\n if(K - L > .5)\n N *= 2.;\n return vec3(O, N);\n}\nvec2 P(const in vec2 Q, const in vec3 R) {\n vec2 S = max(R.xy, min(1. - R.xy, Q));\n return vec2(2. * S.x, R.z - 1. - S.y) / R.z;\n}\nvec3 T(const in mat4 U, const in vec3 V) {\n vec4 W = U * vec4(V, 1.);\n return vec3(.5 + .5 * W.xy / W.w, W.w);\n}\nvec3 X(const in float Y, const in vec2 S) {\n return texture2D(TextureReflected, S).rgb;\n}\nfloat Z(float ba) {\n highp mat4 U = projMatrix;\n highp float z = ba * 2. - 1.;\n return -U[3].z / (z + U[2].z);\n}\nfloat bb(const vec2 S) {\n float ba = A(texture2D(TextureDepth, S));\n return ba;\n}\nvec3 bc(const in float E, const in vec3 bd, const in vec3 be, const in vec3 bf, const in vec3 bg, const in float bh) {\n vec2 bi;\n bi.x = C(gl_FragCoord.yx, E);\n bi.y = fract(bi.x * 52.9829189);\n bi.y = mix(bi.y, 1., .7);\n float bj = 2. * 3.14159 * bi.x;\n float bk = pow(max(bi.y, .000001), bh / (2. - bh));\n float bl = sqrt(1. - bk * bk);\n vec3 bm = vec3(bl * cos(bj), bl * sin(bj), bk);\n bm = bm.x * bd + bm.y * be + bm.z * bf;\n return normalize((2. * dot(bg, bm)) * bm - bg);\n}\nfloat bn(const in float E) {\n return (C(gl_FragCoord.xy, E) - .5);\n}\nvec3 bo(const in vec3 bp, const in float bq, const in vec3 br) {\n vec3 bs = T(projMatrix, vViewVertex.xyz + br * bq);\n bs.z = 1. / bs.z;\n bs -= bp;\n float bt = min(1., .99 * (1. - bp.x) / max(1e-5, bs.x));\n float bu = min(1., .99 * (1. - bp.y) / max(1e-5, bs.y));\n float bv = min(1., .99 * bp.x / max(1e-5, -bs.x));\n float bw = min(1., .99 * bp.y / max(1e-5, -bs.y));\n return bs * min(bt, bu) * min(bv, bw);\n}\nfloat bx(const in vec3 bp, const in vec3 bs, inout float by, inout float bz) {\n float bA = (bz + by) * .5;\n vec3 bB = bp + bs * bA;\n float z = bb(bB.xy);\n float ba = Z(z);\n float bC = -1. / bB.z;\n by = ba > bC ? by : bA;\n bz = ba > bC ? bA : bz;\n return bA;\n}\nvec4 bD(const in vec3 bp, const in float bq, in float bE, const in vec3 br, const in float j, const in float E) {\n const int bF = 20;\n float bG = 1. / float(bF);\n bE *= bG;\n vec3 bs = bo(bp, bq, br);\n float bH = bG;\n vec3 bI = vec3(.0, bH, 1.);\n vec3 bB;\n float z, ba, bC, bJ, bK, bL;\n bool bM;\n float bN = 1.;\n float bA;\n for(int bO = 0; bO < bF; bO++) {\n bB = bp + bs * bI.y;\n z = bb(bB.xy);\n ba = Z(z);\n bC = -1. / bB.z;\n bJ = bC - ba;\n bJ *= clamp(sign(abs(bJ) - bq * bG * bG), .0, 1.);\n bM = abs(bJ + bE) < bE;\n bK = clamp(bI.x / (bI.x - bJ), .0, 1.);\n bL = bM ? bI.y + bK * bG - bG : 1.;\n bI.z = min(bI.z, bL);\n bI.x = bJ;\n if(bM) {\n float by = bI.y - bG;\n float bz = bI.y;\n bA = bx(bp, bs, by, bz);\n bA = bx(bp, bs, by, bz);\n bA = bx(bp, bs, by, bz);\n bN = bA;\n break;\n }\n bI.y += bG;\n }\n return vec4(bp + bs * bN, 1. - bN);\n}\nvec3 bP(in vec4 bQ, const in float bR, const in vec3 bS, const in vec3 bT, const in float j) {\n vec4 bU = mix(outputFovInfo[0], outputFovInfo[1], bQ.x);\n bQ.xyz = vec3(mix(bU.xy, bU.zw, bQ.y), 1.) * -1. / bQ.z;\n bQ.xyz = (reprojViewProjMatrix * vec4(bQ.xyz, 1.)).xyw;\n bQ.xy /= bQ.z;\n float bV = clamp(6. - 6. * max(abs(bQ.x), abs(bQ.y)), .0, 1.);\n bQ.xy = .5 + .5 * bQ.xy;\n return vec3(bQ.xy, 1.);\n}\nvec3 ssr(const in vec3 bS, const in vec3 bT, const in float j, const in vec3 d, const in vec3 bg) {\n float bW = .0;\n vec4 f = vec4(.0);\n float bh = j * j;\n bh = bh * bh;\n vec3 bX = abs(d.z) < .999 ? vec3(.0, .0, 1.) : vec3(1., .0, .0);\n vec3 bd = normalize(cross(bX, d));\n vec3 be = cross(d, bd);\n float bR = ssrFactor * clamp(-4. * dot(bg, d) + 3.8, .0, 1.);\n bR *= clamp(4.7 - j * 5., .0, 1.);\n vec3 bp = T(projMatrix, vViewVertex.xyz);\n bp.z = 1. / bp.z;\n vec3 br = bc(bW, bd, be, d, bg, bh);\n float bq = mix(cameraNearFar.y + vViewVertex.z, -vViewVertex.z - cameraNearFar.x, br.z * .5 + .5);\n float bE = .5 * bq;\n vec4 bQ;\n if(dot(br, d) > .001 && bR > .0) {\n bQ = bD(bp, bq, bE, br, j, bW);\n if(bQ.w > .0)\n return bP(bQ, bR, bS, bT, j);\n \n }\n return vec3(.0);\n}\n#endif\nconst vec3 bY = 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 bZ(vec3 e, float ca) {\n float cb = max(.015, ca);\n return max((e.x + e.y) * .3303545 / cb + .3303545, .0);\n}\nconst vec2 cc = vec2(6. / 25., 5. / 24.);\nvec2 cd(sampler2D ce, vec2 S) {\n return 2. * texture2D(ce, S).rg - 1.;\n}\nfloat cf(vec2 S) {\n return texture2D(heightTexture, S).b;\n}\nvec3 cg(sampler2D ce, vec2 S) {\n return 2. * texture2D(ce, S).rgb - 1.;\n}\nfloat ch(vec2 S, float ci) {\n return fract(ci);\n}\nfloat cj(vec2 S, float ci) {\n float ck = ch(S, ci);\n return 1. - abs(1. - 2. * ck);\n}\nvec3 cl(sampler2D cm, vec2 S, float ci, float cn) {\n float co = waveParams[2];\n float cp = waveParams[3];\n vec2 cq = cd(cm, S) * co;\n float ck = ch(S, ci + cn);\n float cr = cj(S, ci + cn);\n vec2 f = S;\n f -= cq * (ck + cp);\n f += cn;\n f += (ci - ck) * cc;\n return vec3(f, cr);\n}\nconst float cs = 7.77;\nvec3 ct(sampler2D cu, sampler2D cv, vec2 cw, vec2 cx, float ci) {\n float ca = waveParams[0];\n vec2 cy = ci * -cx;\n float cz = cf(vNoiseUv) * cs;\n vec3 cA = cl(cv, cw + cy, ci + cz, .0);\n vec3 cB = cl(cv, cw + cy, ci + cz, .5);\n vec3 cC = cg(cu, cA.xy) * cA.z;\n vec3 cD = cg(cu, cB.xy) * cB.z;\n vec3 cE = normalize(cC + cD);\n cE.xy *= ca;\n cE.z = sqrt(1. - dot(cE.xy, cE.xy));\n return cE;\n}\nvec4 cF(vec2 cw, float cG) {\n float cH = waveParams[1];\n vec3 d = ct(normalTexture, heightTexture, cw * cH, waterDir, cG);\n float cI = bZ(d, waveParams[0]);\n return vec4(d, cI);\n}\nconst float cJ = 3.141592653589793;\nconst float cK = 1. / cJ;\nconst float cL = .3183098861837907;\nconst float cM = 1.570796326794897;\nconst float cN = .4;\nfloat cO = 2.2;\nvec3 cP(float cQ, vec3 cR, float l) {\n return cR + (l - cR) * pow(1. - cQ, 5.);\n}\nfloat cS(float cT, float j) {\n float cU = j * j;\n float cV = cT * cT;\n float cW = pow((cV * (cU - 1.) + 1.), cO) * cJ;\n return cU / cW;\n}\nfloat cX(float cY) {\n return .25 / (cY * cY);\n}\nvec3 cZ(const vec3 x) {\n return (x * (2.51 * x + .03)) / (x * (2.43 * x + .59) + .14);\n}\nconst float da = 2.2;\nconst float db = .4545454545;\nvec4 dc(vec4 u) {\n return vec4(pow(u.rgb, vec3(db)), u.w);\n}\nvec3 dd(vec3 u) {\n return pow(u, vec3(da));\n}\nconst vec3 de = vec3(.02, 1., 5.);\nconst vec2 df = vec2(.02, .1);\nconst float j = .06;\nconst float dg = 1.7;\nconst vec3 dh = vec3(0, .6, .9);\nconst vec3 di = vec3(.72, .92, 1.);\nconst float dj = .65;\nconst float dk = 300000.0;\nconst float dl = 500000.0;\nconst float dm = .775;\nconst float dn = .8;\nPBRShadingWater dp;\nvec3 dq(in PBRShadingWater dr, float j, vec3 ds, float dt) {\n vec3 du = cP(dr.VdotH, ds, dt);\n float dv = cS(dr.NdotH, j);\n float dw = cX(dr.LdotH);\n float dx = mix(j + .045, j + .385, 1. - dr.VdotH);\n float dy = 1.2;\n float dz = cS(dr.NdotH, dx) * dy;\n return ((dv + dz) * dw) * du;\n}\nvec3 dA(float dg, float dB, vec3 dh, float dC) {\n return dg * (.075 * dh * pow(dB, 4.) + 50. * pow(dB, 23.)) * dC;\n}\nvec3 dD(in float bk, in vec3 dE, in vec3 dF) {\n float dG = pow((1. - bk), de[2]);\n return mix(dF, dE, dG);\n}\nvec3 dH(in vec3 e, in vec3 dI, in float dJ, in float j) {\n \n#ifdef HAS_IBL_LIGHTING\nvec3 dK = reflect(-dI, e);\n vec4 dL = textureCube(prefilterMap, uEnvironmentTransform * dK);\n float dM = clamp(1. + dot(dK, e), .0, 1.);\n dL *= dM * dM;\n vec3 i = o(dL, rgbmRange);\n vec3 dN = c(e);\n float l = clamp(50.0 * waterBaseColor.g, .0, 1.);\n vec3 dO = h(waterBaseColor.rgb, j, dot(e, dI), l);\n return i * dO + dN;\n#else\nvec3 dP = dd(di);\n vec3 dQ = dd(dh);\n vec3 di = dD(dJ, dP, dQ);\n return di;\n#endif\n}\nvec3 dR(in vec3 e, in vec3 dI, in vec3 dS, vec3 u, in vec3 dT, in vec3 dU, in float dV, float dW, vec3 dX) {\n float dY = 0.;\n vec3 dZ = dd(u);\n vec3 bm = normalize(dS + dI);\n dp.NdotL = clamp(dot(e, dS), .0, 1.);\n dp.NdotV = clamp(dot(e, dI), .001, 1.);\n dp.VdotN = clamp(dot(dI, e), .001, 1.);\n dp.NdotH = clamp(dot(e, bm), .0, 1.);\n dp.VdotH = clamp(dot(dI, bm), .0, 1.);\n dp.LdotH = clamp(dot(dS, bm), .0, 1.);\n float dJ = max(dot(dU, dI), .0);\n vec3 di = dH(e, dI, dJ, j);\n float ea = max(dot(dU, dS), .0);\n float eb = .1 + ea * .9;\n di *= eb;\n float ec = clamp(dV, .8, 1.);\n vec3 ed = cP(dp.VdotN, vec3(de[0]), de[1]);\n vec3 ee = ed * di * ec;\n vec3 ef = dZ * mix(di, ea * dT * cK, 2. / 3.) * ec;\n vec3 i = vec3(.0);\n if(dJ > .0 && ea > .0) {\n vec3 eg = dq(dp, j, vec3(df[0]), df[1]);\n vec3 eh = dT * cK * dV;\n i = dp.NdotL * eh * eg;\n }\n vec3 cI = vec3(.0);\n if(dJ > .0) {\n cI = dA(dg, dW, dh, eb);\n }\n vec3 ei = vec3(.0);\n#ifdef HAS_SSR\nfloat ej = smoothstep(dl, dk, -dX.z);\n mat4 ek = viewMatrix;\n vec4 el = vec4(dX.xyz, 1.);\n vec3 em = normalize(el.xyz);\n vec4 en = ek * vec4(e, .0);\n vec3 eo = normalize(en.xyz);\n vec4 ep = ek * vec4(dU, .0);\n float eq = pow(max(dot(-em, ep.xyz), .0), cN);\n vec3 er = mix(ep.xyz, eo, eq);\n vec3 es = ssr(vec3(.0), vec3(1.), j, normalize(er), -normalize(vViewVertex.xyz));\n if(es.z > .0) {\n vec2 et = smoothstep(.3, .6, abs(vec2(.5) - es.xy));\n dY = dm * clamp(1. - 1.3 * et.y, .0, 1.) * ej;\n vec3 eu = X(.0, es.xy);\n ei = dd(eu) * dY * ed.y * dj;\n }\n#endif\nfloat ev = mix(dn, dn * .5, dY);\n return cZ((1. - dY) * ee + ei + ef * ev + i + cI);\n}\nvoid main() {\n vec3 dU = bY;\n vec4 ew = cF(vUv, timeElapsed);\n vec3 e = normalize(vTbnMatrix * ew.xyz);\n vec3 dI = -normalize(vPos - camPos);\n vec3 dS = normalize(-lightDirection);\n#if defined(HAS_SHADOWING)\nfloat dV = shadow_computeShadow();\n#else\nfloat dV = 1.;\n#endif\nvec4 ex = viewMatrix * vec4(vPos, 1.);\n vec4 ey = vec4(dR(e, dI, dS, waterBaseColor.rgb, lightColor, dU, dV, ew.w, ex.xyz), waterBaseColor.a);\n gl_FragColor = dc(ey);\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 gl_FragColor = highlight_blendColor(gl_FragColor) * layerOpacity;\n}",
|
|
18352
18367
|
defines: s,
|
|
@@ -18362,34 +18377,34 @@
|
|
|
18362
18377
|
projViewMatrix: t.projViewMatrix
|
|
18363
18378
|
};
|
|
18364
18379
|
}
|
|
18365
|
-
|
|
18366
|
-
const {iblTexes: i, dfgLUT: r} = this.getIBLRes(), s =
|
|
18380
|
+
zl(t, e) {
|
|
18381
|
+
const {iblTexes: i, dfgLUT: r} = this.getIBLRes(), s = tm(t, i, r, e && e.ssr, e && e.jitter), o = t.getLightManager();
|
|
18367
18382
|
let a = o && o.getDirectionalLight() || {};
|
|
18368
|
-
const l = o && o.getAmbientLight() || {}, h = this.getSymbol(
|
|
18383
|
+
const l = o && o.getAmbientLight() || {}, h = this.getSymbol(nm), u = this.$l = this.$l || [], c = this.Xl = this.Xl || [];
|
|
18369
18384
|
n.vec4.set(c, .09, h.uvScale || 3, .03, -.5);
|
|
18370
|
-
|
|
18385
|
+
Ll(s, {
|
|
18371
18386
|
ambientColor: l.color || [ .2, .2, .2 ],
|
|
18372
18387
|
viewMatrix: t.viewMatrix,
|
|
18373
|
-
lightDirection: a.direction ||
|
|
18374
|
-
lightColor: a.color ||
|
|
18388
|
+
lightDirection: a.direction || em.direction,
|
|
18389
|
+
lightColor: a.color || em.color,
|
|
18375
18390
|
camPos: t.cameraPosition,
|
|
18376
18391
|
timeElapsed: h.animation ? (this.layer.getRenderer().getFrameTimestamp() || 0) / (1 / (h.waterSpeed || 1) * 1e4) : 0,
|
|
18377
18392
|
normalTexture: this.Bl || this.jl,
|
|
18378
18393
|
heightTexture: this.Wl || this.jl,
|
|
18379
18394
|
waveParams: c,
|
|
18380
|
-
waterDir:
|
|
18395
|
+
waterDir: om(u, h.waterDirection || 0),
|
|
18381
18396
|
waterBaseColor: h.waterBaseColor || [ .1451, .2588, .4863, 1 ],
|
|
18382
18397
|
contrast: h.contrast || 1,
|
|
18383
|
-
hsv: h.hsv ||
|
|
18398
|
+
hsv: h.hsv || im
|
|
18384
18399
|
});
|
|
18385
18400
|
const f = this.layer.getRenderer();
|
|
18386
|
-
return s.layerOpacity = f.In(), this.setIncludeUniformValues(s, e), e && e.ssr && e.ssr.renderUniforms &&
|
|
18401
|
+
return s.layerOpacity = f.In(), this.setIncludeUniformValues(s, e), e && e.ssr && e.ssr.renderUniforms && Ll(s, e.ssr.renderUniforms),
|
|
18387
18402
|
s;
|
|
18388
18403
|
}
|
|
18389
18404
|
delete() {
|
|
18390
18405
|
super.delete(), this.jl && (this.jl.destroy(), delete this.jl), this.Bl && this.Bl.destroy(),
|
|
18391
18406
|
this.Wl && this.Wl.destroy(), this.shader && (this.shader.dispose(), delete this.shader),
|
|
18392
|
-
this.
|
|
18407
|
+
this.Ll && this.Ll.dispose(), this.Ul && (this.Ul.geometry.dispose(), this.Ul.material && this.Ul.material.dispose(),
|
|
18393
18408
|
this.Ul.dispose(), delete this.Ul), this.disposeIBLTextures();
|
|
18394
18409
|
}
|
|
18395
18410
|
createGround() {
|
|
@@ -18402,42 +18417,42 @@
|
|
|
18402
18417
|
transformWater() {
|
|
18403
18418
|
const t = this.getMap(), e = n.GroundPainter.getGroundTransform(this.Ul.localTransform, t);
|
|
18404
18419
|
this.Ul.setLocalTransform(e);
|
|
18405
|
-
const i = t._get2DExtentAtRes(t.getGLRes()), r = i.getWidth(), s = i.getHeight(), o = t.cameraLookAt, a = o[0] - r, l = o[1] + s, h = a /
|
|
18420
|
+
const i = t._get2DExtentAtRes(t.getGLRes()), r = i.getWidth(), s = i.getHeight(), o = t.cameraLookAt, a = o[0] - r, l = o[1] + s, h = a / rm[0], u = l / rm[1], c = h % 1, f = u % 1, d = .3737 * h % 1, p = .3737 * u % 1, y = r / rm[0] * 2, m = s / rm[1] * 2;
|
|
18406
18421
|
this.Ul.setUniform("uvOffset", [ c, f ]), this.Ul.setUniform("noiseUvOffset", [ d, p ]),
|
|
18407
18422
|
this.Ul.setUniform("uvScale", [ y, -m ]);
|
|
18408
18423
|
}
|
|
18409
18424
|
}
|
|
18410
|
-
function
|
|
18425
|
+
function om(t, e) {
|
|
18411
18426
|
return e = function(t) {
|
|
18412
18427
|
return Math.PI * t / 180;
|
|
18413
18428
|
}(e), t[0] = Math.sin(e), t[1] = Math.cos(e), t;
|
|
18414
18429
|
}
|
|
18415
|
-
const
|
|
18416
|
-
om.registerAt(_h);
|
|
18417
|
-
const am = Xc("line", Kf);
|
|
18430
|
+
const am = Xc("fill", Xf);
|
|
18418
18431
|
am.registerAt(_h);
|
|
18419
|
-
const lm = Xc("line
|
|
18432
|
+
const lm = Xc("line", Kf);
|
|
18420
18433
|
lm.registerAt(_h);
|
|
18421
|
-
const hm = Xc("
|
|
18434
|
+
const hm = Xc("line-gradient", Zf);
|
|
18422
18435
|
hm.registerAt(_h);
|
|
18423
|
-
const um = Xc("
|
|
18436
|
+
const um = Xc("icon", _p);
|
|
18424
18437
|
um.registerAt(_h);
|
|
18425
|
-
const cm = Xc("
|
|
18438
|
+
const cm = Xc("text", hy);
|
|
18426
18439
|
cm.registerAt(_h);
|
|
18427
|
-
Xc("native-
|
|
18428
|
-
const fm = Xc("phong", Oy);
|
|
18440
|
+
const fm = Xc("native-line", gy);
|
|
18429
18441
|
fm.registerAt(_h);
|
|
18430
|
-
|
|
18442
|
+
Xc("native-point", py).registerAt(_h);
|
|
18443
|
+
const dm = Xc("phong", Iy);
|
|
18431
18444
|
dm.registerAt(_h);
|
|
18432
|
-
const pm = Xc("
|
|
18445
|
+
const pm = Xc("wireframe", Ey);
|
|
18433
18446
|
pm.registerAt(_h);
|
|
18434
|
-
const ym = Xc("
|
|
18447
|
+
const ym = Xc("lit", Ny);
|
|
18435
18448
|
ym.registerAt(_h);
|
|
18436
|
-
const mm = Xc("
|
|
18449
|
+
const mm = Xc("tube", Ly);
|
|
18437
18450
|
mm.registerAt(_h);
|
|
18438
|
-
const gm = Xc("gltf-
|
|
18451
|
+
const gm = Xc("gltf-phong", Zy);
|
|
18439
18452
|
gm.registerAt(_h);
|
|
18440
|
-
const vm = Xc("
|
|
18453
|
+
const vm = Xc("gltf-lit", Qy);
|
|
18454
|
+
vm.registerAt(_h);
|
|
18455
|
+
const xm = Xc("heatmap", class extends Df {
|
|
18441
18456
|
createFnTypeConfig(t, e) {
|
|
18442
18457
|
const n = b(e.heatmapWeight), i = new Int16Array(1);
|
|
18443
18458
|
return [ {
|
|
@@ -18500,12 +18515,12 @@
|
|
|
18500
18515
|
this.Yl = new n.HeatmapProcess(this.regl, this.sceneConfig, this.layer, i.heatmapColor, null, e);
|
|
18501
18516
|
}
|
|
18502
18517
|
});
|
|
18503
|
-
|
|
18504
|
-
const
|
|
18505
|
-
|
|
18506
|
-
|
|
18507
|
-
|
|
18508
|
-
_h.VERSION = "0.92.
|
|
18518
|
+
xm.registerAt(_h);
|
|
18519
|
+
const bm = Xc("water", sm);
|
|
18520
|
+
bm.registerAt(_h), zh.registerPainter("lit", Ny), zh.registerPainter("icon", _p),
|
|
18521
|
+
zh.registerPainter("fill", Xf), zh.registerPainter("line", Kf), zh.registerPainter("line-gradient", Zf),
|
|
18522
|
+
zh.registerPainter("water", sm), zh.registerPainter("tube", Ly), n.reshader.ShaderLib.register("vt_position_vert", "#ifdef HAS_TERRAIN_ALTITUDE\n attribute float aTerrainAltitude;\n#endif\nuniform float minAltitude;\n#ifdef HAS_ALTITUDE\n vec3 unpackVTPosition() {\n float altitude = aAltitude;\n #ifdef HAS_TERRAIN_ALTITUDE\n altitude += aTerrainAltitude * 100.0;\n #endif\n altitude += minAltitude * 100.0;\n return vec3(aPosition, altitude);\n }\n#else\n float position_modValue = 16384.0;\n float position_delta = 0.00001;\n vec3 unpackVTPosition() {\n float z = aPosition.z;\n vec2 pos = sign(aPosition.xy + position_delta) * mod(abs(aPosition.xy), position_modValue);\n vec2 highs = floor(abs(aPosition.xy) / position_modValue);\n float altitude = sign(z + position_delta) * (highs.x * 2.0 + highs.y) * pow(2.0, 15.0) + z;\n #ifdef HAS_TERRAIN_ALTITUDE\n altitude += aTerrainAltitude * 100.0;\n #endif\n altitude += minAltitude * 100.0;\n return vec3(pos, altitude);\n }\n#endif"),
|
|
18523
|
+
_h.VERSION = "0.92.3", zh.VERSION = "0.92.3";
|
|
18509
18524
|
if (s.mat4.create(), s.transcoders) {
|
|
18510
18525
|
const t = r.Map.VERSION;
|
|
18511
18526
|
if (t.indexOf("1.0.0-beta") >= 0 || t.indexOf("1.0.0-alpha") >= 0) {
|
|
@@ -18515,16 +18530,16 @@
|
|
|
18515
18530
|
return s.transcoders.inject(o);
|
|
18516
18531
|
}));
|
|
18517
18532
|
} else r.registerWorkerAdapter("@maptalks/vt", o);
|
|
18518
|
-
t.ExtrudePolygonLayer = _c, t.FillPainter = Xf, t.FillPlugin =
|
|
18519
|
-
t.GLTFPhongPlugin =
|
|
18520
|
-
t.HeatmapPlugin =
|
|
18521
|
-
t.LinePainter = Kf, t.LinePlugin =
|
|
18522
|
-
t.MapboxVectorTileLayer = Ih, t.NativeLinePainter =
|
|
18523
|
-
t.NativePointPainter =
|
|
18533
|
+
t.ExtrudePolygonLayer = _c, t.FillPainter = Xf, t.FillPlugin = am, t.FilterUtil = ho,
|
|
18534
|
+
t.GLTFPhongPlugin = gm, t.GLTFStandardPlugin = vm, t.GeoJSONVectorTileLayer = Eh,
|
|
18535
|
+
t.HeatmapPlugin = xm, t.IconPainter = _p, t.IconPlugin = um, t.LineGradientPlugin = hm,
|
|
18536
|
+
t.LinePainter = Kf, t.LinePlugin = lm, t.LineStringLayer = hu, t.LitPlugin = ym,
|
|
18537
|
+
t.MapboxVectorTileLayer = Ih, t.NativeLinePainter = gy, t.NativeLinePlugin = fm,
|
|
18538
|
+
t.NativePointPainter = py, t.PackUtil = fl, t.PhongPainter = Iy, t.PhongPlugin = dm,
|
|
18524
18539
|
t.PointLayer = lu, t.PolygonLayer = cu, t.SYMBOLS_NEED_REBUILD_IN_VECTOR = xl, t.SYMBOLS_NEED_REBUILD_IN_VT = vl,
|
|
18525
|
-
t.TextPainter =
|
|
18526
|
-
t.VectorTileLayer = _h, t.VectorTileLayerRenderer = ah, t.WaterPlugin =
|
|
18527
|
-
t.WireframePlugin =
|
|
18540
|
+
t.TextPainter = hy, t.TextPlugin = cm, t.TubePlugin = mm, t.Vector3DLayer = zh,
|
|
18541
|
+
t.VectorTileLayer = _h, t.VectorTileLayerRenderer = ah, t.WaterPlugin = bm, t.WireframePainter = Ey,
|
|
18542
|
+
t.WireframePlugin = pm, Object.defineProperty(t, "t", {
|
|
18528
18543
|
value: !0
|
|
18529
|
-
}), "undefined" != typeof console && console.log("@maptalks/vt v0.92.
|
|
18544
|
+
}), "undefined" != typeof console && console.log("@maptalks/vt v0.92.3");
|
|
18530
18545
|
}));
|