@maptalks/vt 0.92.2 → 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 +570 -559
- package/dist/maptalks.vt.js +802 -792
- package/package.json +4 -4
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,12 +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
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),
|
|
10537
|
-
this.Ri[1] && this.Pi.prepareCollideIndex(this.Ri[1].geometry)), this.
|
|
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);
|
|
10538
10540
|
if (this.meshes) for (let t = 0; t < this.meshes.length; t++) this.ir(this.meshes[t], this.xi);
|
|
10539
10541
|
}
|
|
10540
10542
|
ir(t, e) {
|
|
@@ -10605,7 +10607,7 @@
|
|
|
10605
10607
|
}), !0;
|
|
10606
10608
|
}
|
|
10607
10609
|
lr(t) {
|
|
10608
|
-
return this.hr(t, this.
|
|
10610
|
+
return this.hr(t, this.zi, this.Ni, this.ur, this.Ti, Va, Uh, this.cr);
|
|
10609
10611
|
}
|
|
10610
10612
|
hr(t, e, n, i, r, s, o, a) {
|
|
10611
10613
|
if (!e) return !1;
|
|
@@ -10663,15 +10665,15 @@
|
|
|
10663
10665
|
}
|
|
10664
10666
|
}
|
|
10665
10667
|
Ii(t) {
|
|
10666
|
-
if (!Object.keys(this.Mi).length) return void (this.
|
|
10667
|
-
delete this.
|
|
10668
|
+
if (!Object.keys(this.Mi).length) return void (this.zi && (this.Ti.deleteMesh(this.zi),
|
|
10669
|
+
delete this.zi));
|
|
10668
10670
|
const {features: e, center: n} = this.Gi(this.Mi);
|
|
10669
10671
|
if (!e.length) return;
|
|
10670
|
-
const i = this.
|
|
10672
|
+
const i = this.Li;
|
|
10671
10673
|
this.ur = n;
|
|
10672
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));
|
|
10673
10675
|
this.pr = !0, Promise.all(o).then(t => {
|
|
10674
|
-
this.
|
|
10676
|
+
this.zi && this.Ti.deleteMesh(this.zi);
|
|
10675
10677
|
const e = [], n = [];
|
|
10676
10678
|
for (let i = 0; i < t.length; i++) {
|
|
10677
10679
|
const r = t[i] && t[i].meshes;
|
|
@@ -10683,7 +10685,7 @@
|
|
|
10683
10685
|
n[i] = t[i].atlas;
|
|
10684
10686
|
}
|
|
10685
10687
|
}
|
|
10686
|
-
this.
|
|
10688
|
+
this.zi = e, this.Ni = n, i && (this.Li = i), this.pr = !1, this.setToRedraw(),
|
|
10687
10689
|
this.layer.fire("buildlinemesh");
|
|
10688
10690
|
});
|
|
10689
10691
|
}
|
|
@@ -10862,7 +10864,7 @@
|
|
|
10862
10864
|
}
|
|
10863
10865
|
}
|
|
10864
10866
|
_r() {
|
|
10865
|
-
this.
|
|
10867
|
+
this.Li = !0;
|
|
10866
10868
|
}
|
|
10867
10869
|
onGeometryPropertiesChange(t) {
|
|
10868
10870
|
const e = t.target._getParent() || t.target, n = e[jh];
|
|
@@ -10875,16 +10877,16 @@
|
|
|
10875
10877
|
t && (this.canvas.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height)),
|
|
10876
10878
|
this.prepareRequestors(), this.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height),
|
|
10877
10879
|
this.painter = this.createPainter();
|
|
10878
|
-
const e =
|
|
10880
|
+
const e = zh.get3DPainterClass("icon");
|
|
10879
10881
|
let n = e.getBloomSymbol();
|
|
10880
|
-
const i = P({},
|
|
10882
|
+
const i = P({}, Lh, Hh);
|
|
10881
10883
|
i.markerPerspectiveRatio = this.layer.options.markerPerspectiveRatio || 0, this.Sr(i, n),
|
|
10882
10884
|
this.rr = i;
|
|
10883
10885
|
const r = P({}, Ml, this.layer.options.sceneConfig || {});
|
|
10884
10886
|
this.Pi = new e(this.regl, this.layer, i, r, 0), this.Pi.setTextShaderDefines({
|
|
10885
10887
|
REVERSE_MAP_ROTATION_ON_PITCH: 1
|
|
10886
10888
|
});
|
|
10887
|
-
const s =
|
|
10889
|
+
const s = zh.get3DPainterClass("line"), o = P({}, Uh);
|
|
10888
10890
|
n = s.getBloomSymbol(), this.Sr(o, n), this.kr = o;
|
|
10889
10891
|
const a = P({}, this.layer.options.sceneConfig || {});
|
|
10890
10892
|
void 0 === a.depthMask && (a.depthMask = !0), this.Ti = new s(this.regl, this.layer, o, a, 0),
|
|
@@ -11031,7 +11033,7 @@
|
|
|
11031
11033
|
}
|
|
11032
11034
|
return i.addGeometry(o), i;
|
|
11033
11035
|
}
|
|
11034
|
-
class lu extends
|
|
11036
|
+
class lu extends zh {
|
|
11035
11037
|
static fromJSON(t) {
|
|
11036
11038
|
return au(t, "PointLayer", lu);
|
|
11037
11039
|
}
|
|
@@ -11064,7 +11066,7 @@
|
|
|
11064
11066
|
}) : t.options.maxMarkerWidth = t.options.maxMarkerHeight = 255, super.onGeometryAdd(t));
|
|
11065
11067
|
}
|
|
11066
11068
|
});
|
|
11067
|
-
class hu extends
|
|
11069
|
+
class hu extends zh {
|
|
11068
11070
|
static fromJSON(t) {
|
|
11069
11071
|
return au(t, "LineStringLayer", hu);
|
|
11070
11072
|
}
|
|
@@ -11078,7 +11080,7 @@
|
|
|
11078
11080
|
super(...t), this.GeometryTypes = [ r.LineString, r.MultiLineString ];
|
|
11079
11081
|
}
|
|
11080
11082
|
createPainter() {
|
|
11081
|
-
const t =
|
|
11083
|
+
const t = zh.get3DPainterClass("line-gradient");
|
|
11082
11084
|
this.painterSymbol = P({}, {
|
|
11083
11085
|
lineGradientProperty: uu
|
|
11084
11086
|
}, Uh), this.Sr(this.painterSymbol, t.getBloomSymbol());
|
|
@@ -11089,7 +11091,7 @@
|
|
|
11089
11091
|
buildMesh() {
|
|
11090
11092
|
let {features: t, center: e} = this.Gi();
|
|
11091
11093
|
if (t = t.filter(t => !!t.properties[uu]), !t.length) return;
|
|
11092
|
-
const n = this.
|
|
11094
|
+
const n = this.Li;
|
|
11093
11095
|
this.Fr = e;
|
|
11094
11096
|
const i = P({}, this.painterSymbol), r = this.createMesh(this.painter, Va, i, t, null, e);
|
|
11095
11097
|
this.wr = !0, r.then(t => {
|
|
@@ -11099,11 +11101,11 @@
|
|
|
11099
11101
|
e.push(...i);
|
|
11100
11102
|
for (let t = 0; t < i.length; t++) i[t].feaGroupIndex = 0, i[t].geometry.properties.originElements = i[t].geometry.properties.elements.slice();
|
|
11101
11103
|
}
|
|
11102
|
-
this.meshes = e, n && (this.
|
|
11104
|
+
this.meshes = e, n && (this.Li = n), this.wr = !1, this.setToRedraw();
|
|
11103
11105
|
});
|
|
11104
11106
|
}
|
|
11105
11107
|
}), hu.registerRenderer("canvas", null);
|
|
11106
|
-
class cu extends
|
|
11108
|
+
class cu extends zh {
|
|
11107
11109
|
static fromJSON(t) {
|
|
11108
11110
|
return au(t, "PolygonLayer", cu);
|
|
11109
11111
|
}
|
|
@@ -11171,7 +11173,7 @@
|
|
|
11171
11173
|
buildMesh(t) {
|
|
11172
11174
|
const {features: e, center: n} = this.Gi();
|
|
11173
11175
|
if (!e.length) return;
|
|
11174
|
-
const i = this.
|
|
11176
|
+
const i = this.Li;
|
|
11175
11177
|
this.Fr = n;
|
|
11176
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));
|
|
11177
11179
|
this.wr = !0, Promise.all(o).then(t => {
|
|
@@ -11190,7 +11192,7 @@
|
|
|
11190
11192
|
n[i] = t[i].atlas;
|
|
11191
11193
|
}
|
|
11192
11194
|
}
|
|
11193
|
-
this.meshes = e, this.atlas = n, i && (this.
|
|
11195
|
+
this.meshes = e, this.atlas = n, i && (this.Li = i), this.wr = !1, this.setToRedraw(),
|
|
11194
11196
|
this.layer.fire("buildmesh");
|
|
11195
11197
|
});
|
|
11196
11198
|
}
|
|
@@ -11209,7 +11211,7 @@
|
|
|
11209
11211
|
return [ e, n ];
|
|
11210
11212
|
}
|
|
11211
11213
|
createPainter() {
|
|
11212
|
-
const t =
|
|
11214
|
+
const t = zh.get3DPainterClass("fill"), e = this.painterSymbol = P({}, fu);
|
|
11213
11215
|
this.Sr(e, t.getBloomSymbol());
|
|
11214
11216
|
return new t(this.regl, this.layer, e, this.layer.options.sceneConfig, 0);
|
|
11215
11217
|
}
|
|
@@ -11327,10 +11329,10 @@
|
|
|
11327
11329
|
const ku = mo.getInstance();
|
|
11328
11330
|
function Pu(t, e, n, i, r, s, o, a, l, h, u, c, f, d, p, y) {
|
|
11329
11331
|
void 0 === e.top && (e.top = !0), void 0 === e.side && (e.side = !0), ku.reset();
|
|
11330
|
-
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) {
|
|
11331
11333
|
let T = e / t[0].extent;
|
|
11332
11334
|
e === 1 / 0 && (T = 1);
|
|
11333
|
-
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;
|
|
11334
11336
|
function B(t, n, i, r, s, o) {
|
|
11335
11337
|
let a = n;
|
|
11336
11338
|
if (U) {
|
|
@@ -11342,15 +11344,15 @@
|
|
|
11342
11344
|
for (let n = 2, i = r.length; n < i; n += 3) e = r[n - 1], r[n - 1] = r[n] + t / 3,
|
|
11343
11345
|
r[n] = e + t / 3, r[n - 2] += t / 3;
|
|
11344
11346
|
}
|
|
11345
|
-
E(
|
|
11346
|
-
|
|
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);
|
|
11347
11349
|
}
|
|
11348
11350
|
if (V) {
|
|
11349
|
-
U && (c = 0), a = n, n = Mu(R, N, i,
|
|
11350
|
-
|
|
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);
|
|
11351
11353
|
const t = N.length / 3;
|
|
11352
|
-
|
|
11353
|
-
|
|
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);
|
|
11354
11356
|
}
|
|
11355
11357
|
return n;
|
|
11356
11358
|
}
|
|
@@ -11390,8 +11392,8 @@
|
|
|
11390
11392
|
const Z = fl.getUnsignedArrayType(C.length ? C[C.length - 1] : 0), Q = {
|
|
11391
11393
|
maxAltitude: G,
|
|
11392
11394
|
vertices: R,
|
|
11393
|
-
verticeTypes:
|
|
11394
|
-
indices:
|
|
11395
|
+
verticeTypes: L,
|
|
11396
|
+
indices: z,
|
|
11395
11397
|
pickingIds: mo.createTypedArray(C, Z),
|
|
11396
11398
|
featureIndexes: I
|
|
11397
11399
|
};
|
|
@@ -11426,8 +11428,8 @@
|
|
|
11426
11428
|
res: s,
|
|
11427
11429
|
glScale: o,
|
|
11428
11430
|
projectionCode: f
|
|
11429
|
-
}, d, ku), H = [], U =
|
|
11430
|
-
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);
|
|
11431
11433
|
const B = S ? ku.get() : new Float32Array(3 * U);
|
|
11432
11434
|
B.setLength && B.setLength(3 * U);
|
|
11433
11435
|
const G = function(t, e, n) {
|
|
@@ -11442,14 +11444,14 @@
|
|
|
11442
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);
|
|
11443
11445
|
}
|
|
11444
11446
|
return i;
|
|
11445
|
-
}(
|
|
11447
|
+
}(L.vertices, j, B);
|
|
11446
11448
|
let W = !0;
|
|
11447
11449
|
for (let t = 0; t < G.length; t++) {
|
|
11448
|
-
|
|
11450
|
+
z || (G[t] = -G[t]);
|
|
11449
11451
|
const e = G[t] % 1;
|
|
11450
11452
|
1 - Math.abs(e) > 1e-6 ? W = !1 : 0 !== e && (G[t] = Math.round(G[t]));
|
|
11451
11453
|
}
|
|
11452
|
-
if (
|
|
11454
|
+
if (L.normals = G, S) {
|
|
11453
11455
|
let t = ku.get();
|
|
11454
11456
|
t.setLength(4 * U), t = function(t, e, n, i, r) {
|
|
11455
11457
|
const s = t.length / 3, o = r || new Array(4 * s), a = [], l = [];
|
|
@@ -11474,7 +11476,7 @@
|
|
|
11474
11476
|
}
|
|
11475
11477
|
for (let t = 0, e = i.length; t < e; t += 3) S(i[t + 0]), S(i[t + 1]), S(i[t + 2]);
|
|
11476
11478
|
return o;
|
|
11477
|
-
}(
|
|
11479
|
+
}(L.vertices, L.normals, L.uvs, j, t), t = function(t, e) {
|
|
11478
11480
|
const n = new Float32Array(e.length), i = [], r = [], s = [];
|
|
11479
11481
|
for (let o = 0; o < e.length; o += 4) {
|
|
11480
11482
|
const a = o / 4 * 3;
|
|
@@ -11482,18 +11484,18 @@
|
|
|
11482
11484
|
ve(s, r, i), ie(n.subarray(o, o + 4), s);
|
|
11483
11485
|
}
|
|
11484
11486
|
return n;
|
|
11485
|
-
}(
|
|
11487
|
+
}(L.normals, t), L.tangents = t, H.push(t.buffer), delete L.normals;
|
|
11486
11488
|
}
|
|
11487
|
-
if (
|
|
11488
|
-
H.push(
|
|
11489
|
-
const t =
|
|
11490
|
-
|
|
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);
|
|
11491
11493
|
}
|
|
11492
11494
|
if (y) {
|
|
11493
|
-
const t =
|
|
11495
|
+
const t = L.vertices;
|
|
11494
11496
|
for (let e = 0; e < t.length; e += 3) t[e] -= y[0], t[e + 1] -= y[1];
|
|
11495
11497
|
}
|
|
11496
|
-
const $ = p || fl.getPosArrayType(Math.max(512,
|
|
11498
|
+
const $ = p || fl.getPosArrayType(Math.max(512, L.maxAltitude)), X = function(t, e, n, i) {
|
|
11497
11499
|
const r = {}, s = {};
|
|
11498
11500
|
if (D(e.polygonFill)) {
|
|
11499
11501
|
let o = w(e.polygonFill);
|
|
@@ -11523,7 +11525,7 @@
|
|
|
11523
11525
|
s.aOpacity = a;
|
|
11524
11526
|
}
|
|
11525
11527
|
return s.dynamicAttributes = r, s;
|
|
11526
|
-
}(t, u, c,
|
|
11528
|
+
}(t, u, c, L.featureIndexes), Y = function(t, e, n, i, r) {
|
|
11527
11529
|
const s = [ [], [] ], o = D(i.topPolygonFill), a = D(i.bottomPolygonFill), l = [ 255, 255, 255, 255 ];
|
|
11528
11530
|
if (o || a) {
|
|
11529
11531
|
let h = o && w(i.topPolygonFill), u = a && w(i.bottomPolygonFill), c = null, f = null, d = null, p = null;
|
|
@@ -11549,26 +11551,26 @@
|
|
|
11549
11551
|
}
|
|
11550
11552
|
}
|
|
11551
11553
|
return s.slice(2);
|
|
11552
|
-
}(
|
|
11554
|
+
}(L.verticeTypes, L.featureIndexes, t, u, c), q = {
|
|
11553
11555
|
data: {
|
|
11554
11556
|
data: {
|
|
11555
|
-
aVertexColorType: Y.length <= 252 ? mo.createTypedArray(
|
|
11556
|
-
aPosition: mo.createTypedArray(
|
|
11557
|
-
aNormal:
|
|
11558
|
-
aTexCoord0:
|
|
11559
|
-
aTangent:
|
|
11560
|
-
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
|
|
11561
11563
|
},
|
|
11562
11564
|
indices: j,
|
|
11563
11565
|
properties: {
|
|
11564
|
-
maxAltitude:
|
|
11566
|
+
maxAltitude: L.maxAltitude
|
|
11565
11567
|
},
|
|
11566
11568
|
dynamicAttributes: X.dynamicAttributes,
|
|
11567
11569
|
vertexColors: Y
|
|
11568
11570
|
},
|
|
11569
11571
|
buffers: H
|
|
11570
11572
|
};
|
|
11571
|
-
return
|
|
11573
|
+
return L.featureIds.length ? (q.data.featureIds = L.featureIds, H.push(q.data.featureIds.buffer)) : q.data.featureIds = [],
|
|
11572
11574
|
X.aColor && (q.data.data.aColor = X.aColor, q.buffers.push(X.aColor.buffer)), X.aOpacity && (q.data.data.aOpacity = X.aOpacity,
|
|
11573
11575
|
q.buffers.push(X.aOpacity.buffer)), q.buffers.push(q.data.data.aPosition.buffer),
|
|
11574
11576
|
q.data.pickingIdIndiceMap = fl.generatePickingIndiceIndex(q.data.data.aPickingId, q.data.indices),
|
|
@@ -11669,7 +11671,7 @@
|
|
|
11669
11671
|
for (;n || r.length; ) {
|
|
11670
11672
|
if (n || (n = r.pop(), a = r[r.length - 1], o = s.pop(), l = !0), n.leaf) {
|
|
11671
11673
|
const i = Du(t, n.children, e);
|
|
11672
|
-
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;
|
|
11673
11675
|
}
|
|
11674
11676
|
l || n.leaf || !Gu(n, i) ? a ? (o++, n = a.children[o], l = !1) : n = null : (r.push(n),
|
|
11675
11677
|
s.push(o), o = 0, a = n, n = n.children[0]);
|
|
@@ -11714,7 +11716,7 @@
|
|
|
11714
11716
|
}
|
|
11715
11717
|
return Nu(s, this.toBBox), s;
|
|
11716
11718
|
}
|
|
11717
|
-
|
|
11719
|
+
Lr(t, e, n, i) {
|
|
11718
11720
|
for (;i.push(e), !e.leaf && i.length - 1 !== n; ) {
|
|
11719
11721
|
let n, i = 1 / 0, r = 1 / 0;
|
|
11720
11722
|
for (let s = 0; s < e.children.length; s++) {
|
|
@@ -11726,8 +11728,8 @@
|
|
|
11726
11728
|
return e;
|
|
11727
11729
|
}
|
|
11728
11730
|
Rr(t, e, n) {
|
|
11729
|
-
const i = n ? t : this.toBBox(t), r = [], s = this.
|
|
11730
|
-
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),
|
|
11731
11733
|
e--;
|
|
11732
11734
|
this.Ur(i, r, e);
|
|
11733
11735
|
}
|
|
@@ -11750,7 +11752,7 @@
|
|
|
11750
11752
|
return i || n - e;
|
|
11751
11753
|
}
|
|
11752
11754
|
Vr(t, e, n) {
|
|
11753
|
-
const i = t.leaf ? this.compareMinX :
|
|
11755
|
+
const i = t.leaf ? this.compareMinX : Lu, r = t.leaf ? this.compareMinY : Hu;
|
|
11754
11756
|
this.Br(t, e, n, i) < this.Br(t, e, n, r) && t.children.sort(i);
|
|
11755
11757
|
}
|
|
11756
11758
|
Br(t, e, n, i) {
|
|
@@ -11759,18 +11761,18 @@
|
|
|
11759
11761
|
let a = Vu(s) + Vu(o);
|
|
11760
11762
|
for (let i = e; i < n - e; i++) {
|
|
11761
11763
|
const e = t.children[i];
|
|
11762
|
-
|
|
11764
|
+
zu(s, t.leaf ? r(e) : e), a += Vu(s);
|
|
11763
11765
|
}
|
|
11764
11766
|
for (let i = n - e - 1; i >= e; i--) {
|
|
11765
11767
|
const e = t.children[i];
|
|
11766
|
-
|
|
11768
|
+
zu(o, t.leaf ? r(e) : e), a += Vu(o);
|
|
11767
11769
|
}
|
|
11768
11770
|
return a;
|
|
11769
11771
|
}
|
|
11770
11772
|
Ur(t, e, n) {
|
|
11771
|
-
for (let i = n; i >= 0; i--)
|
|
11773
|
+
for (let i = n; i >= 0; i--) zu(e[i], t);
|
|
11772
11774
|
}
|
|
11773
|
-
|
|
11775
|
+
zr(t) {
|
|
11774
11776
|
for (let e, n = t.length - 1; n >= 0; n--) 0 === t[n].children.length ? n > 0 ? (e = t[n - 1].children,
|
|
11775
11777
|
e.splice(e.indexOf(t[n]), 1)) : this.clear() : Nu(t[n], this.toBBox);
|
|
11776
11778
|
}
|
|
@@ -11787,15 +11789,15 @@
|
|
|
11787
11789
|
r || (r = $u(null)), r.minX = 1 / 0, r.minY = 1 / 0, r.maxX = -1 / 0, r.maxY = -1 / 0;
|
|
11788
11790
|
for (let s = e; s < n; s++) {
|
|
11789
11791
|
const e = t.children[s];
|
|
11790
|
-
|
|
11792
|
+
zu(r, t.leaf ? i(e) : e);
|
|
11791
11793
|
}
|
|
11792
11794
|
return r;
|
|
11793
11795
|
}
|
|
11794
|
-
function
|
|
11796
|
+
function zu(t, e) {
|
|
11795
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),
|
|
11796
11798
|
t.maxY = Math.max(t.maxY, e.maxY), t;
|
|
11797
11799
|
}
|
|
11798
|
-
function
|
|
11800
|
+
function Lu(t, e) {
|
|
11799
11801
|
return t.minX - e.minX;
|
|
11800
11802
|
}
|
|
11801
11803
|
function Hu(t, e) {
|
|
@@ -12177,7 +12179,7 @@
|
|
|
12177
12179
|
return null;
|
|
12178
12180
|
}
|
|
12179
12181
|
}
|
|
12180
|
-
class _c extends
|
|
12182
|
+
class _c extends zh {
|
|
12181
12183
|
static fromJSON(t) {
|
|
12182
12184
|
return au(t, "ExtrudePolygonLayer", _c);
|
|
12183
12185
|
}
|
|
@@ -12275,7 +12277,7 @@
|
|
|
12275
12277
|
return super.draw(t, e);
|
|
12276
12278
|
}
|
|
12277
12279
|
createPainter() {
|
|
12278
|
-
const t =
|
|
12280
|
+
const t = zh.get3DPainterClass("lit");
|
|
12279
12281
|
this.painterSymbol = P({}, Sc), this.sidePainterSymbol = P({}, Sc), this.Sr(this.painterSymbol, t.getBloomSymbol());
|
|
12280
12282
|
const e = P({}, kc, this.layer.options.dataConfig || {});
|
|
12281
12283
|
this.layer.options.material && (this.painterSymbol.material = this.layer.options.material),
|
|
@@ -12381,11 +12383,11 @@
|
|
|
12381
12383
|
* https://github.com/gdsmith/jquery.easing/
|
|
12382
12384
|
*/
|
|
12383
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;
|
|
12384
|
-
function
|
|
12386
|
+
function zc(t) {
|
|
12385
12387
|
var e = 7.5625, n = 2.75;
|
|
12386
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;
|
|
12387
12389
|
}
|
|
12388
|
-
function
|
|
12390
|
+
function Lc(t, e) {
|
|
12389
12391
|
switch (t = t.toLowerCase()) {
|
|
12390
12392
|
case "swing":
|
|
12391
12393
|
return function(t) {
|
|
@@ -12527,17 +12529,17 @@
|
|
|
12527
12529
|
|
|
12528
12530
|
case "easeinbounce":
|
|
12529
12531
|
return function(t) {
|
|
12530
|
-
return 1 -
|
|
12532
|
+
return 1 - zc(1 - t);
|
|
12531
12533
|
}(e);
|
|
12532
12534
|
|
|
12533
12535
|
case "easeoutbounce":
|
|
12534
12536
|
return function(t) {
|
|
12535
|
-
return
|
|
12537
|
+
return zc(t);
|
|
12536
12538
|
}(e);
|
|
12537
12539
|
|
|
12538
12540
|
case "easeinoutbounce":
|
|
12539
12541
|
return function(t) {
|
|
12540
|
-
return t < .5 ? (1 -
|
|
12542
|
+
return t < .5 ? (1 - zc(1 - 2 * t)) / 2 : (1 + zc(2 * t - 1)) / 2;
|
|
12541
12543
|
}(e);
|
|
12542
12544
|
}
|
|
12543
12545
|
throw new Error("Unsupported easing function:" + t);
|
|
@@ -12729,7 +12731,7 @@
|
|
|
12729
12731
|
let e = null, n = r.animation;
|
|
12730
12732
|
if (n) {
|
|
12731
12733
|
const i = t.sceneConfig.animationDuration || 800, r = (t.timestamp - h.ns) / i, s = h[0].properties.createTime;
|
|
12732
|
-
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),
|
|
12733
12735
|
c = !0);
|
|
12734
12736
|
}
|
|
12735
12737
|
s.addMesh(h, e, t), this.Kr[l] = 1;
|
|
@@ -13170,14 +13172,14 @@
|
|
|
13170
13172
|
if (i) {
|
|
13171
13173
|
let r = "";
|
|
13172
13174
|
for (const s in i) i[s] && (r += s, n[s].uniformDeclares && e.push(...n[s].uniformDeclares),
|
|
13173
|
-
n[s].defines &&
|
|
13175
|
+
n[s].defines && Ll(t, n[s].defines));
|
|
13174
13176
|
this.ys = r;
|
|
13175
13177
|
}
|
|
13176
13178
|
}
|
|
13177
13179
|
setIncludeUniformValues(t, e) {
|
|
13178
13180
|
if (e && e.isRenderingTerrain && this.isTerrainSkin()) return;
|
|
13179
13181
|
const n = e && e.includes;
|
|
13180
|
-
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);
|
|
13181
13183
|
}
|
|
13182
13184
|
createGeometries(t, e) {
|
|
13183
13185
|
if (!t.length) return Tf;
|
|
@@ -13280,7 +13282,7 @@
|
|
|
13280
13282
|
};
|
|
13281
13283
|
}
|
|
13282
13284
|
prepareRender(t) {
|
|
13283
|
-
if (this.
|
|
13285
|
+
if (this.Le === t.timestamp) return;
|
|
13284
13286
|
if (!this.createFnTypeConfig) return;
|
|
13285
13287
|
const e = this.scene.getMeshes();
|
|
13286
13288
|
if (!e || !e.length) return;
|
|
@@ -13290,7 +13292,7 @@
|
|
|
13290
13292
|
if (n && !n(e[r])) continue;
|
|
13291
13293
|
const {symbolIndex: s} = e[r].properties, o = this.getSymbolDef(s);
|
|
13292
13294
|
if (!o) continue;
|
|
13293
|
-
this.
|
|
13295
|
+
this.Le = t.timestamp;
|
|
13294
13296
|
const a = this.getFnTypeConfig(s);
|
|
13295
13297
|
ef(this.regl, o, a, e[r], i);
|
|
13296
13298
|
}
|
|
@@ -13382,14 +13384,14 @@
|
|
|
13382
13384
|
As(t) {
|
|
13383
13385
|
const e = t && t.feature;
|
|
13384
13386
|
if (!e || !e.customProps) return t;
|
|
13385
|
-
const n =
|
|
13386
|
-
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]),
|
|
13387
13389
|
delete n.feature.properties[Dl], delete n.feature.properties[El], delete n.feature.properties.$layer,
|
|
13388
13390
|
delete n.feature.properties.$type, n;
|
|
13389
13391
|
}
|
|
13390
13392
|
updateSceneConfig() {}
|
|
13391
13393
|
updateDataConfig(t) {
|
|
13392
|
-
return
|
|
13394
|
+
return Ll(this.dataConfig, t), !0;
|
|
13393
13395
|
}
|
|
13394
13396
|
deleteMesh(t, e) {
|
|
13395
13397
|
if (t) if (this.scene.removeMesh(t), Array.isArray(t)) for (let i = 0; i < t.length; i++) {
|
|
@@ -13404,7 +13406,7 @@
|
|
|
13404
13406
|
}
|
|
13405
13407
|
}
|
|
13406
13408
|
startFrame(t) {
|
|
13407
|
-
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,
|
|
13408
13410
|
this._e = !1, this.xs = 0), this.scene.clear();
|
|
13409
13411
|
}
|
|
13410
13412
|
resize() {}
|
|
@@ -13468,7 +13470,7 @@
|
|
|
13468
13470
|
fs() {
|
|
13469
13471
|
const t = this.getMap(), e = [], n = () => (e[0] = t.getZoom(), e);
|
|
13470
13472
|
this.Fs = [], this.K = [];
|
|
13471
|
-
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),
|
|
13472
13474
|
this.symbolDef[t] && x(this.symbolDef[t].visible) && (this.K[t] = b(this.symbolDef[t].visible));
|
|
13473
13475
|
}
|
|
13474
13476
|
getFnTypeConfig(t) {
|
|
@@ -13550,10 +13552,10 @@
|
|
|
13550
13552
|
}
|
|
13551
13553
|
Ns(t, e) {
|
|
13552
13554
|
if (!this.picking) return;
|
|
13553
|
-
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.`);
|
|
13554
13556
|
const i = this.getUniformValues(this.getMap(), this.bs);
|
|
13555
13557
|
this.ws(i);
|
|
13556
|
-
const r = this.
|
|
13558
|
+
const r = this.Ls(e);
|
|
13557
13559
|
if (r.length) for (let n = 0; n < r.length; n++) {
|
|
13558
13560
|
const s = r[n].geometry.properties.feaIdPickingMap;
|
|
13559
13561
|
if (s) {
|
|
@@ -13572,7 +13574,7 @@
|
|
|
13572
13574
|
}
|
|
13573
13575
|
}
|
|
13574
13576
|
}
|
|
13575
|
-
|
|
13577
|
+
Ls(t) {
|
|
13576
13578
|
const e = [], n = this.scene.getMeshes();
|
|
13577
13579
|
for (let i = 0; i < n.length; i++) {
|
|
13578
13580
|
const r = n[i], s = r.geometry.properties.feaIdPickingMap;
|
|
@@ -13582,12 +13584,12 @@
|
|
|
13582
13584
|
}
|
|
13583
13585
|
outlineAll(t) {
|
|
13584
13586
|
if (!this.picking) return;
|
|
13585
|
-
if (!this._s && (this.
|
|
13587
|
+
if (!this._s && (this.zs(), !this._s)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
|
|
13586
13588
|
const e = this.getUniformValues(this.getMap(), this.bs);
|
|
13587
13589
|
this.ws(e), e.highlightPickingId = -1;
|
|
13588
13590
|
for (let n = 0; n < this._s.length; n++) this.renderer.render(this._s[n], e, this.scene, t);
|
|
13589
13591
|
}
|
|
13590
|
-
|
|
13592
|
+
zs() {
|
|
13591
13593
|
if (!this.picking) return;
|
|
13592
13594
|
const t = this.layer.getRenderer().canvas;
|
|
13593
13595
|
this._s = [];
|
|
@@ -13780,7 +13782,7 @@
|
|
|
13780
13782
|
};
|
|
13781
13783
|
t.iconAtlas && t.iconAtlas.image && (t.iconAtlas.image.dataType = t.type, t.iconAtlas.image.type = "icon"),
|
|
13782
13784
|
t.glyphAtlas && t.glyphAtlas.image && (t.glyphAtlas.image.type = "glyph");
|
|
13783
|
-
const i =
|
|
13785
|
+
const i = Ll({}, t.data), r = {
|
|
13784
13786
|
primitive: this.getPrimitive(),
|
|
13785
13787
|
positionSize: t.positionSize
|
|
13786
13788
|
};
|
|
@@ -13791,7 +13793,7 @@
|
|
|
13791
13793
|
}, t.iconAtlas && (s.properties.iconAtlas = t.iconAtlas.image, s.properties.iconPositions = t.iconAtlas.positions),
|
|
13792
13794
|
t.glyphAtlas && (s.properties.glyphAtlas = t.glyphAtlas.image), qc(e) || (s.properties.aFeaIds = t.featureIds,
|
|
13793
13795
|
this.Vs(s, t)), t.markerPlacement && (s.properties.markerPlacement = t.markerPlacement),
|
|
13794
|
-
t.textPlacement && (s.properties.textPlacement = t.textPlacement),
|
|
13796
|
+
t.textPlacement && (s.properties.textPlacement = t.textPlacement), Ll(s.properties, t.properties),
|
|
13795
13797
|
{
|
|
13796
13798
|
geometry: s,
|
|
13797
13799
|
symbolIndex: t.symbolIndex
|
|
@@ -13847,14 +13849,14 @@
|
|
|
13847
13849
|
}
|
|
13848
13850
|
return t.texture(o);
|
|
13849
13851
|
}
|
|
13850
|
-
const
|
|
13852
|
+
const zf = [ 0, 0 ], Lf = [];
|
|
13851
13853
|
function Hf(t) {
|
|
13852
|
-
if (!t.properties.iconPositions) return
|
|
13854
|
+
if (!t.properties.iconPositions) return zf;
|
|
13853
13855
|
let e, n = 0;
|
|
13854
|
-
for (const i in t.properties.iconPositions) if (e = i, n++, n > 1) return
|
|
13855
|
-
if (!e) return
|
|
13856
|
+
for (const i in t.properties.iconPositions) if (e = i, n++, n > 1) return zf;
|
|
13857
|
+
if (!e) return zf;
|
|
13856
13858
|
const i = t.properties.iconPositions[e], r = i.displaySize[0], s = i.displaySize[1];
|
|
13857
|
-
return
|
|
13859
|
+
return Lf[0] = r, Lf[1] = s, Lf;
|
|
13858
13860
|
}
|
|
13859
13861
|
const Uf = n.mat4.identity([]), Vf = {
|
|
13860
13862
|
polygonFill: [ 1, 1, 1, 1 ],
|
|
@@ -14833,58 +14835,63 @@
|
|
|
14833
14835
|
isCollides(t) {
|
|
14834
14836
|
const e = this.layer, i = e.getMap(), r = i.getDevicePixelRatio();
|
|
14835
14837
|
if (n.vec4.scale(ud, t, 1 / r), i.isOffscreen(ud)) return -1;
|
|
14836
|
-
|
|
14838
|
+
const s = e.getCollisionIndex(), o = this.sceneConfig.collisionBufferSize || e.options.collisionBufferSize || 0;
|
|
14839
|
+
return o && (t = pd(ud, t, o)), +s.collides(t);
|
|
14837
14840
|
}
|
|
14838
14841
|
insertCollisionBox(t) {
|
|
14839
|
-
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);
|
|
14840
14845
|
}
|
|
14841
14846
|
addCollisionDebugBox(t, e) {
|
|
14842
14847
|
if (t && t.length) if (Array.isArray(t[0])) for (let n = 0; n < t.length; n++) {
|
|
14843
14848
|
const i = t[n];
|
|
14844
|
-
this.
|
|
14845
|
-
} else this.
|
|
14849
|
+
this.zo(i, e);
|
|
14850
|
+
} else this.zo(t, e);
|
|
14846
14851
|
}
|
|
14847
|
-
|
|
14852
|
+
zo(t, e) {
|
|
14848
14853
|
if (!t) return;
|
|
14849
14854
|
const i = this.Lo = this.Lo || {
|
|
14850
14855
|
aPosition: [],
|
|
14851
14856
|
aVisible: [],
|
|
14852
14857
|
indices: []
|
|
14853
|
-
}, r = this.
|
|
14854
|
-
|
|
14855
|
-
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;
|
|
14856
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),
|
|
14857
|
-
i.indices.push(
|
|
14864
|
+
i.indices.push(a, a + 1, a + 1, a + 2, a + 2, a + 3, a + 3, a);
|
|
14858
14865
|
}
|
|
14859
14866
|
updateCollision(t) {
|
|
14860
|
-
super.updateCollision(t), this.fo(), this.
|
|
14861
|
-
this.
|
|
14862
|
-
(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()));
|
|
14863
14870
|
}
|
|
14864
14871
|
paint(t) {
|
|
14865
14872
|
const e = super.paint(t);
|
|
14866
|
-
return this.
|
|
14873
|
+
return this.Go(t), !1 === this.no && this.setToRedraw(), e;
|
|
14867
14874
|
}
|
|
14868
14875
|
shouldIgnoreBackground() {
|
|
14869
|
-
return !this.getMap().isZooming() && !this.
|
|
14876
|
+
return !this.getMap().isZooming() && !this.Uo;
|
|
14870
14877
|
}
|
|
14871
|
-
|
|
14878
|
+
Ho() {
|
|
14872
14879
|
const t = this.getMap(), e = t.isZooming();
|
|
14873
14880
|
if (!e && this.xo) {
|
|
14874
14881
|
const t = this.layer.getRenderer();
|
|
14875
|
-
this.
|
|
14876
|
-
} else e && !this.xo && (this.
|
|
14877
|
-
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) {
|
|
14878
14885
|
let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
|
|
14879
|
-
Vl(t) && (t = sd), Vl(e) && (e = id), this
|
|
14880
|
-
delete this.Ao, delete this
|
|
14886
|
+
Vl(t) && (t = sd), Vl(e) && (e = id), this.$o = setTimeout(() => {
|
|
14887
|
+
delete this.Ao, delete this.$o;
|
|
14881
14888
|
}, t + e + 1);
|
|
14882
14889
|
}
|
|
14883
14890
|
this.xo = e;
|
|
14884
14891
|
}
|
|
14885
|
-
|
|
14892
|
+
Go(t) {
|
|
14886
14893
|
if (!this.Lo || !this.layer.options.debugCollision) return;
|
|
14887
|
-
this.No || this
|
|
14894
|
+
this.No || this.Xo();
|
|
14888
14895
|
const {aPosition: e, aVisible: i, indices: r} = this.Lo;
|
|
14889
14896
|
if (!this.Eo) {
|
|
14890
14897
|
const t = new n.reshader.Geometry({
|
|
@@ -14894,15 +14901,15 @@
|
|
|
14894
14901
|
positionSize: 2,
|
|
14895
14902
|
primitive: "lines"
|
|
14896
14903
|
});
|
|
14897
|
-
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);
|
|
14898
14905
|
}
|
|
14899
14906
|
const s = this.Eo.geometry;
|
|
14900
14907
|
s.updateData("aPosition", new Float32Array(e)), s.updateData("aVisible", new Uint8Array(i)),
|
|
14901
14908
|
s.setElements(r), this.No.render(this.Do, {
|
|
14902
14909
|
size: [ this.canvas.width, this.canvas.height ]
|
|
14903
|
-
}, this.
|
|
14910
|
+
}, this.Yo, this.getRenderFBO(t)), delete this.Lo;
|
|
14904
14911
|
}
|
|
14905
|
-
|
|
14912
|
+
Xo() {
|
|
14906
14913
|
const t = this.regl;
|
|
14907
14914
|
this.No = new n.reshader.Renderer(t);
|
|
14908
14915
|
const e = this.canvas, i = {
|
|
@@ -14931,17 +14938,17 @@
|
|
|
14931
14938
|
}
|
|
14932
14939
|
});
|
|
14933
14940
|
}
|
|
14934
|
-
|
|
14941
|
+
Vo() {
|
|
14935
14942
|
let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
|
|
14936
14943
|
Vl(t) && (t = sd), Vl(e) && (e = id);
|
|
14937
14944
|
const n = this.layer.getRenderer(), i = n.getCurrentTileZoom(), r = n.getFrameTimestamp(), s = [];
|
|
14938
|
-
for (let o = 0; o < this.
|
|
14939
|
-
const a = this.
|
|
14945
|
+
for (let o = 0; o < this.Uo.length; o++) {
|
|
14946
|
+
const a = this.Uo[o], l = a.properties.tile;
|
|
14940
14947
|
!a.Mo && n.isBackTile(l.id) && (a.Mo = r);
|
|
14941
14948
|
const h = l.z - i > 0 ? 2 * (l.z - i) - 1 : 2 * (i - l.z);
|
|
14942
14949
|
a.properties.level = h, n.isForeground(a) || a.Mo && r - a.Mo > t + e ? delete a.Mo : s.push(a);
|
|
14943
14950
|
}
|
|
14944
|
-
delete this.
|
|
14951
|
+
delete this.Uo, s.length && (this.Uo = s);
|
|
14945
14952
|
}
|
|
14946
14953
|
isEnableCollision() {
|
|
14947
14954
|
return this.layer.options.collision && !!this.sceneConfig.collision;
|
|
@@ -14952,7 +14959,7 @@
|
|
|
14952
14959
|
isMeshUniquePlaced(t) {
|
|
14953
14960
|
return this.isMeshIterable(t);
|
|
14954
14961
|
}
|
|
14955
|
-
|
|
14962
|
+
jo() {
|
|
14956
14963
|
if (!this.isEnableUniquePlacement()) return;
|
|
14957
14964
|
const t = this.scene.getMeshes(), e = (t, e, n, i) => {
|
|
14958
14965
|
const {start: r, end: s} = e[0], o = t.geometry.properties, a = o.elements;
|
|
@@ -14972,29 +14979,29 @@
|
|
|
14972
14979
|
this.isMeshUniquePlaced(i) && this.forEachBox(i, e);
|
|
14973
14980
|
}
|
|
14974
14981
|
}
|
|
14975
|
-
|
|
14982
|
+
Bo(t) {
|
|
14976
14983
|
if (!this.isEnableUniquePlacement()) return;
|
|
14977
14984
|
const e = this.getMap().getZoom();
|
|
14978
|
-
let n = !this.
|
|
14979
|
-
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]) {
|
|
14980
14987
|
n = !0;
|
|
14981
14988
|
break;
|
|
14982
14989
|
}
|
|
14983
14990
|
if (!n) return;
|
|
14984
|
-
this.
|
|
14991
|
+
this.Jo = e, this.Ko = {}, this.qo = {}, t = t.sort(dd);
|
|
14985
14992
|
const i = this.getMap().getGLScale(), r = {};
|
|
14986
14993
|
for (let e = 0; e < t.length; e++) {
|
|
14987
14994
|
const n = t[e];
|
|
14988
14995
|
if (!n.geometry) continue;
|
|
14989
14996
|
const {meshKey: s} = n.properties;
|
|
14990
|
-
this.
|
|
14997
|
+
this.qo[s] = 1;
|
|
14991
14998
|
const {uniquePlacements: o} = n.geometry.properties;
|
|
14992
14999
|
if (o) for (let t = 0; t < o.length; t++) {
|
|
14993
15000
|
if (!o[t]) continue;
|
|
14994
15001
|
const {key: e, index: s} = o[t], a = this.wo(n), l = fd(e, i), h = r[l];
|
|
14995
15002
|
if (h) {
|
|
14996
15003
|
const t = h.length, e = h[t - 3].properties.meshKey, i = h[t - 2], r = h[t - 1];
|
|
14997
|
-
this.
|
|
15004
|
+
this.Ko[e] = this.Ko[e] || {}, this.Ko[e][r] = 1, this.Zo(a, s, i, r), h.push(n, a, s);
|
|
14998
15005
|
} else r[l] = [ n, a, s ];
|
|
14999
15006
|
}
|
|
15000
15007
|
}
|
|
@@ -15007,16 +15014,16 @@
|
|
|
15007
15014
|
}
|
|
15008
15015
|
}
|
|
15009
15016
|
}
|
|
15010
|
-
|
|
15017
|
+
Zo(t, e, n, i) {
|
|
15011
15018
|
if (void 0 !== n[i]) if (void 0 === t[e]) t[e] = n[i]; else {
|
|
15012
15019
|
let r = t[e];
|
|
15013
15020
|
Math.abs(n[i]) > Math.abs(r) ? t[e] = n[i] : n[i] = t[e];
|
|
15014
15021
|
} else void 0 !== t[e] && (n[i] = t[e]);
|
|
15015
15022
|
}
|
|
15016
15023
|
vo(t, e) {
|
|
15017
|
-
return this.
|
|
15024
|
+
return this.Ko && this.Ko[t] && this.Ko[t][e];
|
|
15018
15025
|
}
|
|
15019
|
-
|
|
15026
|
+
Qo(t, e) {
|
|
15020
15027
|
const {symbolIndex: n} = t.properties, i = n.type || 0;
|
|
15021
15028
|
let r = t.properties._collidesBoxes;
|
|
15022
15029
|
r || (r = t.properties._collidesBoxes = []);
|
|
@@ -15034,15 +15041,15 @@
|
|
|
15034
15041
|
}
|
|
15035
15042
|
return s[o];
|
|
15036
15043
|
}
|
|
15037
|
-
|
|
15038
|
-
let e = this.
|
|
15039
|
-
if (e || (e = this.
|
|
15044
|
+
ta(t) {
|
|
15045
|
+
let e = this.ea;
|
|
15046
|
+
if (e || (e = this.ea = []), !e[t]) {
|
|
15040
15047
|
e[t] = [];
|
|
15041
15048
|
for (let n = 0; n < t; n++) e[t][n] = {};
|
|
15042
15049
|
}
|
|
15043
15050
|
return e[t];
|
|
15044
15051
|
}
|
|
15045
|
-
|
|
15052
|
+
na(t) {
|
|
15046
15053
|
if (!t || !t.geometry) return !0;
|
|
15047
15054
|
if (!t.geometry.properties.glyphAtlas || !t.material.get("isHalo") || t.geometry.data.aTextHaloRadius && t.geometry.properties.hasHalo) return !1;
|
|
15048
15055
|
if (t.geometry.data.aTextHaloRadius && !t.geometry.properties.hasHalo) return !0;
|
|
@@ -15056,105 +15063,108 @@
|
|
|
15056
15063
|
const n = e.properties.level - t.properties.level;
|
|
15057
15064
|
return 0 === n ? t.properties.meshKey - e.properties.meshKey : n;
|
|
15058
15065
|
}
|
|
15059
|
-
|
|
15060
|
-
|
|
15061
|
-
|
|
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) {
|
|
15062
15072
|
const {tileRatio: y, tileResolution: m} = h, g = y / (m / u.getResolution()) * (c / u.cameraToCenterDistance) * f;
|
|
15063
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),
|
|
15064
|
-
n.vec3.set(
|
|
15065
|
-
n.vec3.set(
|
|
15066
|
-
n.vec3.add(
|
|
15067
|
-
cf(i,
|
|
15068
|
-
cf(o,
|
|
15069
|
-
n.vec2.set(
|
|
15070
|
-
n.vec4.set(t,
|
|
15071
|
-
}
|
|
15072
|
-
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) {
|
|
15073
15083
|
1 !== l && (n.vec2.scale(i, i, l), n.vec2.scale(r, r, l), n.vec2.scale(s, s, l),
|
|
15074
|
-
n.vec2.scale(o, o, l)), n.vec2.set(
|
|
15075
|
-
n.vec2.set(
|
|
15076
|
-
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]);
|
|
15077
15087
|
}
|
|
15078
|
-
function
|
|
15088
|
+
function _d(t, e, i, r, s) {
|
|
15079
15089
|
e -= i * r, 1 === s && (e += i);
|
|
15080
15090
|
const o = Math.sin(e), a = Math.cos(e);
|
|
15081
15091
|
return n.mat2.set(t, a, -o, o, a);
|
|
15082
15092
|
}
|
|
15083
|
-
const
|
|
15084
|
-
function
|
|
15085
|
-
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;
|
|
15086
15096
|
if (d) {
|
|
15087
15097
|
const t = 100 * d[2 * i];
|
|
15088
15098
|
t && (f[2] += t);
|
|
15089
15099
|
}
|
|
15090
|
-
let p = cf(
|
|
15100
|
+
let p = cf(kd, f, r, s.width, s.height);
|
|
15091
15101
|
const y = p[2];
|
|
15092
15102
|
let m = 1;
|
|
15093
15103
|
if (o.markerPerspectiveRatio) {
|
|
15094
15104
|
m = Hl(.5 + .5 * (1 - (1 - a / y) * o.markerPerspectiveRatio), 0, 4);
|
|
15095
15105
|
}
|
|
15096
|
-
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(
|
|
15097
|
-
let O = n.vec2.set(
|
|
15098
|
-
0 === o.flipY && 1 === P && (n.vec2.multiply(O, O,
|
|
15099
|
-
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));
|
|
15100
15110
|
const [D, N] = Hf(e.geometry);
|
|
15101
15111
|
let R = b ? b[i] : h.markerWidth;
|
|
15102
15112
|
Vl(R) && (R = D || 15);
|
|
15103
|
-
let
|
|
15104
|
-
Vl(
|
|
15105
|
-
const
|
|
15106
|
-
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);
|
|
15107
15117
|
const H = -(_ ? _[i] / 9362 : -(h.markerRotation || 0) * Math.PI / 180), U = s.getBearing() * Math.PI / 180;
|
|
15108
15118
|
if (U * T || H) {
|
|
15109
|
-
const t =
|
|
15119
|
+
const t = _d(Pd, H, U, T, P);
|
|
15110
15120
|
O = n.vec2.transformMat2(O, O, t), I = n.vec2.transformMat2(I, I, t), C = n.vec2.transformMat2(C, C, t),
|
|
15111
15121
|
E = n.vec2.transformMat2(E, E, t);
|
|
15112
15122
|
}
|
|
15113
|
-
1 === P ?
|
|
15114
|
-
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));
|
|
15115
15125
|
const V = this.getMap().getDevicePixelRatio();
|
|
15116
15126
|
return 1 !== V && (t[0] *= V, t[1] *= V, t[2] *= V, t[3] *= V), t;
|
|
15117
15127
|
}
|
|
15118
|
-
const
|
|
15119
|
-
function
|
|
15128
|
+
const Rd = [], zd = [], Ld = [], Hd = [], Ud = [], Vd = [], jd = [ 1, -1 ];
|
|
15129
|
+
function Bd(t, e, i, r, s, o, a, l, h) {
|
|
15120
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];
|
|
15121
15131
|
let m = 1;
|
|
15122
15132
|
if (u.textPerspectiveRatio) {
|
|
15123
15133
|
m = Hl(.5 + .5 * (1 - (1 - c / y) * u.textPerspectiveRatio), 0, 4);
|
|
15124
15134
|
}
|
|
15125
|
-
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));
|
|
15126
15136
|
if (p) {
|
|
15127
15137
|
const {aOffset: r, aShape: s} = f, o = r.length !== s.length;
|
|
15128
15138
|
let c, d, p, g;
|
|
15129
|
-
if (o ? (c = n.vec3.set(
|
|
15130
|
-
d = n.vec3.set(Ld, r[3 * a + 3] / 10, r[3 * a + 4] / 10, r[3 * a + 5] / 10), p = n.vec3.set(
|
|
15131
|
-
g = n.vec3.set(
|
|
15132
|
-
d = n.vec2.set(Ld, r[2 * a + 2] / 10, r[2 * a + 3] / 10), p = n.vec2.set(
|
|
15133
|
-
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 === _) {
|
|
15134
15144
|
const n = R(h.getResolution(), h);
|
|
15135
|
-
|
|
15136
|
-
} else n.vec2.multiply(c, c,
|
|
15137
|
-
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);
|
|
15138
15148
|
} else {
|
|
15139
15149
|
const {aShape: r} = f;
|
|
15140
|
-
let o = n.vec2.set(
|
|
15141
|
-
0 === u.flipY && 1 === _ && (n.vec2.multiply(o, o,
|
|
15142
|
-
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));
|
|
15143
15153
|
const x = w ? w[a] / 9362 : (d.textRotation || 0) * Math.PI / 180, b = p ? 0 : h.getBearing() * Math.PI / 180;
|
|
15144
15154
|
if (x || b) {
|
|
15145
|
-
const t =
|
|
15155
|
+
const t = _d(Rd, x, b, S, _);
|
|
15146
15156
|
o = n.vec2.transformMat2(o, o, t), c = n.vec2.transformMat2(c, c, t), g = n.vec2.transformMat2(g, g, t),
|
|
15147
15157
|
v = n.vec2.transformMat2(v, v, t);
|
|
15148
15158
|
}
|
|
15149
15159
|
const A = s / 24;
|
|
15150
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),
|
|
15151
|
-
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);
|
|
15152
15162
|
}
|
|
15153
15163
|
o = o || 0, t[0] -= o + 1, t[1] -= o + 1, t[2] += o + 1, t[3] += o + 1;
|
|
15154
15164
|
const P = this.getMap().getDevicePixelRatio();
|
|
15155
15165
|
return 1 !== P && (t[0] *= P, t[1] *= P, t[2] *= P, t[3] *= P), t;
|
|
15156
15166
|
}
|
|
15157
|
-
function
|
|
15167
|
+
function Gd(t, e, i) {
|
|
15158
15168
|
const r = e.geometry.desc.positionSize, {aAnchor: s, aAltitude: o, aTerrainAltitude: a} = e.geometry.properties, l = i * r;
|
|
15159
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),
|
|
15160
15170
|
a) {
|
|
@@ -15163,7 +15173,7 @@
|
|
|
15163
15173
|
}
|
|
15164
15174
|
return t;
|
|
15165
15175
|
}
|
|
15166
|
-
const
|
|
15176
|
+
const Wd = {
|
|
15167
15177
|
textFill: [ 0, 0, 0, 1 ],
|
|
15168
15178
|
textOpacity: 1,
|
|
15169
15179
|
textPitchAlignment: 0,
|
|
@@ -15178,14 +15188,14 @@
|
|
|
15178
15188
|
textDy: 0,
|
|
15179
15189
|
textRotation: 0
|
|
15180
15190
|
};
|
|
15181
|
-
function
|
|
15191
|
+
function $d(t, e, i, r, s, o, a, l, h) {
|
|
15182
15192
|
const u = [];
|
|
15183
15193
|
if (e.isDisposed() || 0 === e.data.aPosition.length) return u;
|
|
15184
15194
|
const c = e.properties.glyphAtlas;
|
|
15185
15195
|
if (!c) return u;
|
|
15186
15196
|
if (0 === r.textSize || 0 === r.textOpacity) return u;
|
|
15187
15197
|
if (Kc(e, r, o), !e.properties.aCount) {
|
|
15188
|
-
|
|
15198
|
+
Xd.call(this, e, a || h, l);
|
|
15189
15199
|
const {aTextSize: t, aTextDx: n, aTextDy: i, aPitchAlign: r, aRotationAlign: s, aRotation: o, aOverlap: u, aAltitude: c} = e.data;
|
|
15190
15200
|
if (t) {
|
|
15191
15201
|
const n = (Jc + "aTextSize").trim();
|
|
@@ -15227,12 +15237,12 @@
|
|
|
15227
15237
|
texture: f,
|
|
15228
15238
|
texSize: [ c.width, c.height ]
|
|
15229
15239
|
};
|
|
15230
|
-
|
|
15240
|
+
Yd(e, d, s);
|
|
15231
15241
|
let p = !1;
|
|
15232
15242
|
s.textOpacity < 1 && (p = !0), e.properties.memorySize = e.getMemorySize(), e.generateBuffers(t, {
|
|
15233
15243
|
excludeElementsInVAO: !0
|
|
15234
15244
|
});
|
|
15235
|
-
const y = new n.reshader.Material(d,
|
|
15245
|
+
const y = new n.reshader.Material(d, Wd), m = new n.reshader.Mesh(e, y, {
|
|
15236
15246
|
disableVAO: !0,
|
|
15237
15247
|
transparent: p,
|
|
15238
15248
|
castShadow: !1,
|
|
@@ -15250,8 +15260,8 @@
|
|
|
15250
15260
|
texSize: [ c.width, c.height ],
|
|
15251
15261
|
isHalo: 0
|
|
15252
15262
|
};
|
|
15253
|
-
|
|
15254
|
-
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, {
|
|
15255
15265
|
disableVAO: !0,
|
|
15256
15266
|
transparent: p,
|
|
15257
15267
|
castShadow: !1,
|
|
@@ -15278,7 +15288,7 @@
|
|
|
15278
15288
|
t.setDefines(n), t.properties.symbolIndex = e.properties.symbolIndex;
|
|
15279
15289
|
}), u;
|
|
15280
15290
|
}
|
|
15281
|
-
function
|
|
15291
|
+
function Xd(t, e, n) {
|
|
15282
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;
|
|
15283
15293
|
if (t.properties.aPickingId = t.data.aPickingId, t.properties.aCount = t.data.aCount,
|
|
15284
15294
|
delete t.data.aCount, (e || r) && (t.properties.aAnchor = s, t.properties.aShape = o),
|
|
@@ -15307,17 +15317,17 @@
|
|
|
15307
15317
|
}
|
|
15308
15318
|
}
|
|
15309
15319
|
}
|
|
15310
|
-
function
|
|
15311
|
-
void 0 === e.isHalo && (e.isHalo = 1), Bl(e, "textOpacity", n, "textOpacity",
|
|
15312
|
-
Bl(e, "textFill", n, "textFill",
|
|
15313
|
-
Bl(e, "textHaloBlur", n, "textHaloBlur",
|
|
15314
|
-
Bl(e, "textHaloOpacity", n, "textHaloOpacity",
|
|
15315
|
-
Bl(e, "rotateWithMap", n, "textRotationAlignment",
|
|
15316
|
-
Bl(e, "pitchWithMap", n, "textPitchAlignment",
|
|
15317
|
-
Bl(e, "textSize", n, "textSize",
|
|
15318
|
-
Bl(e, "textDy", n, "textDy",
|
|
15319
|
-
}
|
|
15320
|
-
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) {
|
|
15321
15331
|
const i = [];
|
|
15322
15332
|
return {
|
|
15323
15333
|
uniforms: [ {
|
|
@@ -15375,7 +15385,7 @@
|
|
|
15375
15385
|
}
|
|
15376
15386
|
};
|
|
15377
15387
|
}
|
|
15378
|
-
function
|
|
15388
|
+
function Jd(t, e) {
|
|
15379
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);
|
|
15380
15390
|
return [ {
|
|
15381
15391
|
attrName: "aTextFill",
|
|
@@ -15395,7 +15405,7 @@
|
|
|
15395
15405
|
type: Uint8Array,
|
|
15396
15406
|
width: 1,
|
|
15397
15407
|
evaluate: (e, n) => {
|
|
15398
|
-
let r = i(t.getZoom(), e) ||
|
|
15408
|
+
let r = i(t.getZoom(), e) || Wd.textSize;
|
|
15399
15409
|
return x(r) && (r = this.evaluateInFnTypeConfig(r, n, t, e)), m[0] = r, m[0];
|
|
15400
15410
|
}
|
|
15401
15411
|
}, {
|
|
@@ -15502,24 +15512,24 @@
|
|
|
15502
15512
|
}
|
|
15503
15513
|
} ];
|
|
15504
15514
|
}
|
|
15505
|
-
const
|
|
15506
|
-
function
|
|
15515
|
+
const Kd = [], Zd = [], Qd = [], tp = [];
|
|
15516
|
+
function ep(t, e, n, i, r, s, o) {
|
|
15507
15517
|
t = 1 === t ? 1 : 0;
|
|
15508
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;
|
|
15509
15519
|
let p = c ? c[n[r]] : e.properties.textSize;
|
|
15510
|
-
null == p && (p =
|
|
15511
|
-
const y = f ? f[n[r]] : e.properties.textHaloRadius, m =
|
|
15512
|
-
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;
|
|
15513
15523
|
const x = 3 * n[r];
|
|
15514
|
-
g && -999999 !== g[x] ? (
|
|
15515
|
-
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);
|
|
15516
15526
|
let M = 0;
|
|
15517
15527
|
if (u || 1 === e.material.uniforms.rotateWithMap || h.textRotation) {
|
|
15518
15528
|
let i = 0;
|
|
15519
15529
|
for (let s = r; s < r + 6 * b; s += 6) {
|
|
15520
15530
|
const r = w[M] = w[M] || [];
|
|
15521
15531
|
M++;
|
|
15522
|
-
const l =
|
|
15532
|
+
const l = Bd.call(this, r, m, v, e, p, y, n[s], o, a);
|
|
15523
15533
|
if (!t) {
|
|
15524
15534
|
const e = this.isCollides(l);
|
|
15525
15535
|
1 === e ? t = 1 : -1 === e && i++;
|
|
@@ -15531,7 +15541,7 @@
|
|
|
15531
15541
|
for (let h = r; h < s; h += 6) {
|
|
15532
15542
|
const r = d[2 * n[h] + 1];
|
|
15533
15543
|
if (l !== r || h === s - 6) {
|
|
15534
|
-
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] || [];
|
|
15535
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]),
|
|
15536
15546
|
d[3] = Math.max(c[3], f[3]), i = n[h], l = r, !t && this.isCollides(d) && (t = 1);
|
|
15537
15547
|
}
|
|
@@ -15539,25 +15549,25 @@
|
|
|
15539
15549
|
}
|
|
15540
15550
|
return A.collides = t, A;
|
|
15541
15551
|
}
|
|
15542
|
-
function
|
|
15552
|
+
function np(t, e) {
|
|
15543
15553
|
const i = function(t, e) {
|
|
15544
15554
|
const {aPickingId: n, features: i} = t.geometry.properties, r = n[e];
|
|
15545
15555
|
return (i && i[r] && i[r].feature).label;
|
|
15546
15556
|
}(t, e);
|
|
15547
15557
|
return i ? function(t, e, i) {
|
|
15548
15558
|
if (!i) return null;
|
|
15549
|
-
const r = t.localTransform, s =
|
|
15550
|
-
n.vec4.set(
|
|
15551
|
-
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);
|
|
15552
15562
|
let a = 0;
|
|
15553
15563
|
for (let t = 0; t < i.length; t++) a += i.charCodeAt(t);
|
|
15554
15564
|
return [ Math.floor(o[0]), Math.floor(o[1]), Math.floor(o[2]), a ];
|
|
15555
15565
|
}(t, e, i) : null;
|
|
15556
15566
|
}
|
|
15557
|
-
const
|
|
15558
|
-
var
|
|
15559
|
-
const
|
|
15560
|
-
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) {
|
|
15561
15571
|
Kc(t, e, n), function(t) {
|
|
15562
15572
|
const {aMarkerWidth: e, aMarkerHeight: n, aMarkerDx: i, aMarkerDy: r, aPitchAlign: s, aRotationAlign: o, aRotation: a, aOverlap: l} = t.data;
|
|
15563
15573
|
if (e) {
|
|
@@ -15594,7 +15604,7 @@
|
|
|
15594
15604
|
}
|
|
15595
15605
|
}(t);
|
|
15596
15606
|
}
|
|
15597
|
-
function
|
|
15607
|
+
function up(t, e) {
|
|
15598
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);
|
|
15599
15609
|
return [ {
|
|
15600
15610
|
attrName: "aMarkerWidth",
|
|
@@ -15694,7 +15704,7 @@
|
|
|
15694
15704
|
}
|
|
15695
15705
|
} ];
|
|
15696
15706
|
}
|
|
15697
|
-
function
|
|
15707
|
+
function cp(t, e, n, i) {
|
|
15698
15708
|
if (!n || !i || "none" === i) return;
|
|
15699
15709
|
const r = function(t, e, n) {
|
|
15700
15710
|
let i = t.properties.textFitFn;
|
|
@@ -15763,10 +15773,10 @@
|
|
|
15763
15773
|
if (!s) return [];
|
|
15764
15774
|
return n;
|
|
15765
15775
|
}(e, n);
|
|
15766
|
-
i.length && (e.properties.labelShape = i,
|
|
15776
|
+
i.length && (e.properties.labelShape = i, fp.call(this, t, e, n));
|
|
15767
15777
|
}
|
|
15768
15778
|
}
|
|
15769
|
-
function
|
|
15779
|
+
function fp(t, e) {
|
|
15770
15780
|
const n = this.getSymbolDef(e.properties.symbolIndex), i = n.markerTextFit, r = e.properties;
|
|
15771
15781
|
let s = "both" === i || "width" === i, o = "both" === i || "height" === i;
|
|
15772
15782
|
if (x(n.markerTextFit)) {
|
|
@@ -15809,20 +15819,20 @@
|
|
|
15809
15819
|
e.data.aMarkerHeight = new Uint16Array(u);
|
|
15810
15820
|
}
|
|
15811
15821
|
const c = this.getSymbolDef(e.properties.textGeo.properties.symbolIndex), f = b(c.textSize);
|
|
15812
|
-
|
|
15822
|
+
pp.call(this, t, e), (!x(c.textSize) || f.isZoomConstant && f.isFeatureConstant) && (r.isFitConstant = !0);
|
|
15813
15823
|
}
|
|
15814
|
-
const
|
|
15815
|
-
function
|
|
15824
|
+
const dp = [ 0, 0, 0, 0 ];
|
|
15825
|
+
function pp(t, e) {
|
|
15816
15826
|
const n = e.properties.textGeo;
|
|
15817
15827
|
if (!n) return;
|
|
15818
15828
|
const i = n.properties, r = e.properties;
|
|
15819
15829
|
if (r.isFitConstant || !r.labelShape || !r.labelShape.length) return;
|
|
15820
15830
|
const s = this.getSymbolDef(e.properties.symbolIndex), o = this.getSymbolDef(n.properties.symbolIndex).textSize;
|
|
15821
15831
|
let a;
|
|
15822
|
-
x(o) && (a = i.
|
|
15823
|
-
const l = s.markerTextFitPadding ||
|
|
15832
|
+
x(o) && (a = i.ia ? i.ia : i.ia = b(o));
|
|
15833
|
+
const l = s.markerTextFitPadding || dp;
|
|
15824
15834
|
let h;
|
|
15825
|
-
x(l) && (h = r.
|
|
15835
|
+
x(l) && (h = r.ra ? r.ra : r.ra = w(l));
|
|
15826
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) => {
|
|
15827
15837
|
const s = m[4 * e], c = m[4 * e + 1], f = m[4 * e + 2], d = m[4 * e + 3];
|
|
15828
15838
|
if (!(s || c || f || d)) return;
|
|
@@ -15836,20 +15846,20 @@
|
|
|
15836
15846
|
if (x(T)) {
|
|
15837
15847
|
T = (_.fitPaddingFn = _.fitPaddingFn || w(T))(u, _);
|
|
15838
15848
|
}
|
|
15839
|
-
if (T = T ||
|
|
15849
|
+
if (T = T || dp, T[0] === T[2] && T[1] === T[3] || (k = r.aPadOffsetX, P = r.aPadOffsetY,
|
|
15840
15850
|
k || (k = r.aPadOffsetX = new Int8Array(p.length), P = r.aPadOffsetY = new Int8Array(p.length))),
|
|
15841
15851
|
p && n) {
|
|
15842
15852
|
const e = Math.abs((f - s) / 10 * S) + (T[1] + T[3] || 0);
|
|
15843
|
-
if (
|
|
15853
|
+
if (ap[0] = e, p[t] !== ap[0] && (Yl(p, ap[0], t, t + 4), p.dirty = !0), k) {
|
|
15844
15854
|
const e = (T[1] + T[3]) / 2 - T[3];
|
|
15845
|
-
|
|
15855
|
+
lp[0] = e, k[t] !== lp[0] && (Yl(k, e, t, t + 4), k.dirty = !0);
|
|
15846
15856
|
}
|
|
15847
15857
|
}
|
|
15848
15858
|
if (y && i) {
|
|
15849
15859
|
const e = Math.abs((d - c) / 10 * S) + (T[0] + T[2] || 0);
|
|
15850
|
-
if (
|
|
15860
|
+
if (ap[0] = e, y[t] !== ap[0] && (Yl(y, ap[0], t, t + 4), y.dirty = !0), P) {
|
|
15851
15861
|
const e = T[0] - (T[0] + T[2]) / 2;
|
|
15852
|
-
|
|
15862
|
+
lp[0] = e, P[t] !== lp[0] && (Yl(P, e, t, t + 4), P.dirty = !0);
|
|
15853
15863
|
}
|
|
15854
15864
|
}
|
|
15855
15865
|
};
|
|
@@ -15874,29 +15884,29 @@
|
|
|
15874
15884
|
const {aPadOffsetX: _, aPadOffsetY: S} = r;
|
|
15875
15885
|
_ && (e.data.aPadOffsetX = _, e.data.aPadOffsetY = S);
|
|
15876
15886
|
}
|
|
15877
|
-
const
|
|
15887
|
+
const yp = function(t) {
|
|
15878
15888
|
const e = this.layer.getRenderer();
|
|
15879
|
-
return !this.
|
|
15880
|
-
}, yp = function(t) {
|
|
15881
|
-
const e = this.layer.getRenderer();
|
|
15882
|
-
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;
|
|
15883
15890
|
}, mp = function(t) {
|
|
15884
15891
|
const e = this.layer.getRenderer();
|
|
15885
|
-
return !this.
|
|
15892
|
+
return !(this.na(t) || e.isForeground(t) || !t.geometry.properties.iconAtlas || t.geometry.properties.isEmpty);
|
|
15886
15893
|
}, gp = function(t) {
|
|
15887
15894
|
const e = this.layer.getRenderer();
|
|
15888
|
-
return !this.
|
|
15889
|
-
}, 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 = {
|
|
15890
15900
|
collides: -1
|
|
15891
|
-
},
|
|
15892
|
-
class
|
|
15901
|
+
}, wp = [ 2048, 2048 ], Ap = n.mat4.identity([]), Mp = [];
|
|
15902
|
+
class _p extends cd {
|
|
15893
15903
|
static getBloomSymbol() {
|
|
15894
15904
|
return [ "markerBloom", "textBloom" ];
|
|
15895
15905
|
}
|
|
15896
15906
|
constructor(t, e, n, i, r, s) {
|
|
15897
15907
|
super(t, e, n, i, r, s), this.propAllowOverlap = "markerAllowOverlap", this.propIgnorePlacement = "markerIgnorePlacement",
|
|
15898
|
-
this.Ps = {}, this.isLabelCollides =
|
|
15899
|
-
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 = [];
|
|
15900
15910
|
}
|
|
15901
15911
|
needToRefreshTerrainTileOnZooming() {
|
|
15902
15912
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
@@ -15912,16 +15922,16 @@
|
|
|
15912
15922
|
return super.isTerrainSkin() && this.needToRefreshTerrainTileOnZooming();
|
|
15913
15923
|
}
|
|
15914
15924
|
setTextShaderDefines(t) {
|
|
15915
|
-
this.
|
|
15925
|
+
this.ua = t;
|
|
15916
15926
|
}
|
|
15917
15927
|
createFnTypeConfig(t, e) {
|
|
15918
15928
|
return {
|
|
15919
|
-
icon:
|
|
15920
|
-
text:
|
|
15929
|
+
icon: up.call(this, t, e),
|
|
15930
|
+
text: Jd.call(this, t, e)
|
|
15921
15931
|
};
|
|
15922
15932
|
}
|
|
15923
15933
|
startFrame(...t) {
|
|
15924
|
-
return this.
|
|
15934
|
+
return this.ha.length = 0, super.startFrame(...t);
|
|
15925
15935
|
}
|
|
15926
15936
|
createGeometry(t, e) {
|
|
15927
15937
|
return t && t.empty && (t.data = {
|
|
@@ -15931,14 +15941,14 @@
|
|
|
15931
15941
|
}
|
|
15932
15942
|
postCreateGeometry(t, e) {
|
|
15933
15943
|
const {geometry: n, symbolIndex: i} = t, r = this.getSymbolDef(i), s = this.getFnTypeConfig(i);
|
|
15934
|
-
if (this.
|
|
15935
|
-
|
|
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)) {
|
|
15936
15946
|
const t = e[e.length - 1];
|
|
15937
15947
|
if (t) {
|
|
15938
15948
|
const {geometry: e, symbolIndex: s} = t;
|
|
15939
15949
|
if (e && s.index === i.index) {
|
|
15940
15950
|
const t = this.getMap(), i = r.markerTextFit;
|
|
15941
|
-
e.properties.textGeo = n,
|
|
15951
|
+
e.properties.textGeo = n, cp.call(this, t, e, n, i);
|
|
15942
15952
|
}
|
|
15943
15953
|
}
|
|
15944
15954
|
}
|
|
@@ -15958,7 +15968,7 @@
|
|
|
15958
15968
|
const s = this.isEnableCollision(), o = this.layer, {geometry: a, symbolIndex: l} = t;
|
|
15959
15969
|
a.properties.symbolIndex = l;
|
|
15960
15970
|
const h = this.getSymbolDef(l), u = this.getSymbol(l), c = this.getFnTypeConfig(l), f = [];
|
|
15961
|
-
if (this.
|
|
15971
|
+
if (this.ca(a)) {
|
|
15962
15972
|
const t = function(t, e, i, r, s, o, a, l) {
|
|
15963
15973
|
if (e.isDisposed() || 0 === e.data.aPosition.length) return null;
|
|
15964
15974
|
const h = e.properties.iconAtlas;
|
|
@@ -16003,25 +16013,25 @@
|
|
|
16003
16013
|
}(this.regl, a, e, 0, u, c.icon, o.options.collision, !s, this.isEnableUniquePlacement());
|
|
16004
16014
|
t && (t.positionMatrix = this.getAltitudeOffsetMatrix(), delete t.geometry.properties.glyphAtlas,
|
|
16005
16015
|
f.push(t));
|
|
16006
|
-
} else if (this.
|
|
16007
|
-
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());
|
|
16008
16018
|
t.length && (t.forEach(t => {
|
|
16009
16019
|
t.positionMatrix = this.getAltitudeOffsetMatrix(), delete t.geometry.properties.iconAtlas;
|
|
16010
16020
|
}), f.push(...t));
|
|
16011
16021
|
}
|
|
16012
|
-
return "line" === a.properties.markerPlacement && this.
|
|
16022
|
+
return "line" === a.properties.markerPlacement && this.da(a, r), "line" === a.properties.markerPlacement && f.forEach(t => t.properties.isLinePlacement = !0),
|
|
16013
16023
|
this.prepareCollideIndex(a), f;
|
|
16014
16024
|
}
|
|
16015
|
-
|
|
16025
|
+
da(t, e) {
|
|
16016
16026
|
const {collideIds: n} = t.properties, i = new Uint16Array(n.length);
|
|
16017
|
-
if (this.
|
|
16027
|
+
if (this.ca(t)) {
|
|
16018
16028
|
let r = 0;
|
|
16019
16029
|
for (let t = 0; t < n.length; t += 4) i.fill(r++, t, t + 4);
|
|
16020
16030
|
t.properties.collideIds = i, t.properties.uniqueCollideIds = Zl(i), e.markerCollideMap = {
|
|
16021
16031
|
old: n,
|
|
16022
16032
|
new: i
|
|
16023
16033
|
};
|
|
16024
|
-
} else if (this.
|
|
16034
|
+
} else if (this.fa(t)) {
|
|
16025
16035
|
const {collideIds: n, aCount: i} = t.properties;
|
|
16026
16036
|
if (!i) return;
|
|
16027
16037
|
if (e.markerCollideMap) {
|
|
@@ -16048,12 +16058,12 @@
|
|
|
16048
16058
|
if (this.isEnableCollision() && t.length > 0) {
|
|
16049
16059
|
const e = new nd(t);
|
|
16050
16060
|
e.properties.uniqueCollideIds = t[0].geometry.properties.uniqueCollideIds, e.properties.meshKey = t[0].properties.meshKey,
|
|
16051
|
-
e.properties.level = t[0].properties.level, this.
|
|
16061
|
+
e.properties.level = t[0].properties.level, this.ha.push(e);
|
|
16052
16062
|
}
|
|
16053
16063
|
for (let e = 0; e < t.length; e++) {
|
|
16054
16064
|
if (!this.isMeshIterable(t[e])) continue;
|
|
16055
16065
|
const n = t[e].geometry, {symbolIndex: i} = n.properties;
|
|
16056
|
-
Jl(this.getSymbolDef(i)) &&
|
|
16066
|
+
Jl(this.getSymbolDef(i)) && pp.call(this, this.getMap(), n);
|
|
16057
16067
|
}
|
|
16058
16068
|
const e = this.getMap().getZoom();
|
|
16059
16069
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -16071,33 +16081,33 @@
|
|
|
16071
16081
|
if (!this.isEnableCollision()) return;
|
|
16072
16082
|
super.updateCollision(t);
|
|
16073
16083
|
const e = this.scene.getMeshes();
|
|
16074
|
-
e && e.length ? (this.
|
|
16084
|
+
e && e.length ? (this.pa(t.timestamp), this.ha = [], this.po()) : this.po();
|
|
16075
16085
|
}
|
|
16076
16086
|
callCurrentTileShader(t, e) {
|
|
16077
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
16078
|
-
this.
|
|
16087
|
+
this.shader.filter = e.sceneFilter ? [ this.sa, e.sceneFilter ] : this.sa, this.callRenderer(this.shader, t, e),
|
|
16088
|
+
this.ya.filter = e.sceneFilter ? [ this.aa, e.sceneFilter ] : this.aa, this.callRenderer(this.ya, t, e);
|
|
16079
16089
|
}
|
|
16080
16090
|
callBackgroundTileShader(t, e) {
|
|
16081
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
16082
|
-
this.
|
|
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);
|
|
16083
16093
|
}
|
|
16084
16094
|
isMeshIterable(t) {
|
|
16085
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));
|
|
16086
16096
|
}
|
|
16087
|
-
|
|
16097
|
+
pa() {
|
|
16088
16098
|
if (!this.isEnableCollision()) return;
|
|
16089
|
-
let t = this.
|
|
16090
|
-
t && t.length && this.
|
|
16099
|
+
let t = this.ha;
|
|
16100
|
+
t && t.length && this.ma(t);
|
|
16091
16101
|
}
|
|
16092
|
-
|
|
16102
|
+
ga(t, e, n, i) {
|
|
16093
16103
|
return this.updateBoxCollisionFading(!0, t, e, n, i);
|
|
16094
16104
|
}
|
|
16095
16105
|
isEnableUniquePlacement() {
|
|
16096
16106
|
return this.isEnableCollision() && !0 === this.sceneConfig.uniquePlacement;
|
|
16097
16107
|
}
|
|
16098
|
-
|
|
16108
|
+
ma(t) {
|
|
16099
16109
|
const e = this.layer.getRenderer();
|
|
16100
|
-
t = t.sort(
|
|
16110
|
+
t = t.sort(Sp);
|
|
16101
16111
|
for (let n = 0; n < t.length; n++) {
|
|
16102
16112
|
const i = t[n];
|
|
16103
16113
|
if (!i || !i.meshes.length) continue;
|
|
@@ -16110,12 +16120,12 @@
|
|
|
16110
16120
|
const s = e.isForeground(i.meshes[0]);
|
|
16111
16121
|
if (this.shouldIgnoreBackground() && !s) continue;
|
|
16112
16122
|
const o = i.properties.meshKey;
|
|
16113
|
-
this.startMeshCollision(i), this.
|
|
16123
|
+
this.startMeshCollision(i), this.va(i), this.forEachBox(i, this.ga), this.xa(i),
|
|
16114
16124
|
this.endMeshCollision(o);
|
|
16115
|
-
for (let t = 0; t < i.meshes.length; t++) this.
|
|
16125
|
+
for (let t = 0; t < i.meshes.length; t++) this.ba(i.meshes[t]);
|
|
16116
16126
|
}
|
|
16117
16127
|
}
|
|
16118
|
-
|
|
16128
|
+
ba(t) {
|
|
16119
16129
|
const e = t && t.geometry && t.geometry.properties.aOpacity;
|
|
16120
16130
|
e && e.dirty && (t.geometry.updateData("aOpacity", e), e.dirty = !1);
|
|
16121
16131
|
}
|
|
@@ -16125,12 +16135,12 @@
|
|
|
16125
16135
|
const i = {
|
|
16126
16136
|
boxIndex: 0
|
|
16127
16137
|
}, r = n.length;
|
|
16128
|
-
for (let s = 0; s < r; s++) this.
|
|
16138
|
+
for (let s = 0; s < r; s++) this.wa(t, n[s], e, i);
|
|
16129
16139
|
}
|
|
16130
|
-
|
|
16140
|
+
wa(t, e, i, r) {
|
|
16131
16141
|
const s = this.getMap(), {collideBoxIndex: o} = t.meshes[0].geometry.properties;
|
|
16132
16142
|
if (!(o && o[e])) return !1;
|
|
16133
|
-
const a = n.mat4.multiply(
|
|
16143
|
+
const a = n.mat4.multiply(xp, s.projViewMatrix, t.meshes[0].localTransform);
|
|
16134
16144
|
let l, h = !1;
|
|
16135
16145
|
const u = t.meshes;
|
|
16136
16146
|
let c = 0;
|
|
@@ -16140,7 +16150,7 @@
|
|
|
16140
16150
|
n[e] && c++;
|
|
16141
16151
|
}
|
|
16142
16152
|
if (!c) return !1;
|
|
16143
|
-
l = this.
|
|
16153
|
+
l = this.ta(c);
|
|
16144
16154
|
let f = 0;
|
|
16145
16155
|
for (let t = 0; t < u.length; t++) {
|
|
16146
16156
|
const n = u[t];
|
|
@@ -16156,16 +16166,16 @@
|
|
|
16156
16166
|
l[f].allElements = r, f++;
|
|
16157
16167
|
}
|
|
16158
16168
|
if (!h) return !1;
|
|
16159
|
-
return i.call(this, t, l, a, r.boxIndex++) && this.
|
|
16169
|
+
return i.call(this, t, l, a, r.boxIndex++) && this.Aa(t, e), !0;
|
|
16160
16170
|
}
|
|
16161
|
-
|
|
16171
|
+
va(t) {
|
|
16162
16172
|
const e = t.meshes;
|
|
16163
16173
|
for (let t = 0; t < e.length; t++) {
|
|
16164
16174
|
const n = e[t], i = n && n.geometry;
|
|
16165
16175
|
i && (i.properties.visElemts.count = 0);
|
|
16166
16176
|
}
|
|
16167
16177
|
}
|
|
16168
|
-
|
|
16178
|
+
Aa(t, e) {
|
|
16169
16179
|
const n = t.meshes;
|
|
16170
16180
|
for (let t = 0; t < n.length; t++) {
|
|
16171
16181
|
const i = n[t];
|
|
@@ -16180,7 +16190,7 @@
|
|
|
16180
16190
|
a.count = c;
|
|
16181
16191
|
}
|
|
16182
16192
|
}
|
|
16183
|
-
|
|
16193
|
+
xa(t) {
|
|
16184
16194
|
const e = t.meshes;
|
|
16185
16195
|
for (let t = 0; t < e.length; t++) {
|
|
16186
16196
|
const n = e[t], i = n && n.geometry;
|
|
@@ -16190,18 +16200,18 @@
|
|
|
16190
16200
|
}
|
|
16191
16201
|
}
|
|
16192
16202
|
isBoxCollides(t, e, n, i, r, s) {
|
|
16193
|
-
if (this.
|
|
16194
|
-
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;
|
|
16195
16205
|
const {aTerrainAltitude: o} = t.geometry.properties;
|
|
16196
16206
|
if (o) {
|
|
16197
|
-
if (o[2 * e[i]] === Ol) return
|
|
16207
|
+
if (o[2 * e[i]] === Ol) return bp;
|
|
16198
16208
|
}
|
|
16199
|
-
const a = this.getMap(), {boxes: l, collision: h} = this.
|
|
16209
|
+
const a = this.getMap(), {boxes: l, collision: h} = this.Qo(t, i);
|
|
16200
16210
|
let u = 0, c = 0, f = 0;
|
|
16201
16211
|
for (let n = i; n < r; n += 6) {
|
|
16202
16212
|
const i = l[f] = l[f] || [];
|
|
16203
16213
|
f++;
|
|
16204
|
-
const r =
|
|
16214
|
+
const r = Nd.call(this, i, t, e[n], s, a);
|
|
16205
16215
|
if (!u) {
|
|
16206
16216
|
const t = this.isCollides(r);
|
|
16207
16217
|
1 === t ? u = 1 : -1 === t && c++;
|
|
@@ -16245,7 +16255,7 @@
|
|
|
16245
16255
|
}
|
|
16246
16256
|
};
|
|
16247
16257
|
this.shader = new n.reshader.MeshShader({
|
|
16248
|
-
vert:
|
|
16258
|
+
vert: yd,
|
|
16249
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}",
|
|
16250
16260
|
uniforms: [ {
|
|
16251
16261
|
name: "projViewModelMatrix",
|
|
@@ -16262,16 +16272,16 @@
|
|
|
16262
16272
|
} ],
|
|
16263
16273
|
extraCommandProps: i
|
|
16264
16274
|
}), this.shader.version = 300;
|
|
16265
|
-
const {uniforms: r, extraCommandProps: s} =
|
|
16266
|
-
if (this.
|
|
16267
|
-
vert:
|
|
16268
|
-
frag:
|
|
16275
|
+
const {uniforms: r, extraCommandProps: s} = qd.call(this, e, this.sceneConfig), o = this.ua || {};
|
|
16276
|
+
if (this.ya = new n.reshader.MeshShader({
|
|
16277
|
+
vert: sp,
|
|
16278
|
+
frag: op,
|
|
16269
16279
|
uniforms: r,
|
|
16270
16280
|
extraCommandProps: s,
|
|
16271
16281
|
defines: o
|
|
16272
16282
|
}), this.pickingFBO) {
|
|
16273
16283
|
const t = new n.reshader.FBORayPicking(this.renderer, {
|
|
16274
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
16284
|
+
vert: "#define PICKING_MODE 1\n" + yd,
|
|
16275
16285
|
uniforms: [ {
|
|
16276
16286
|
name: "projViewModelMatrix",
|
|
16277
16287
|
type: "function",
|
|
@@ -16289,7 +16299,7 @@
|
|
|
16289
16299
|
}, this.pickingFBO, this.getMap());
|
|
16290
16300
|
t.filter = t => !!t.geometry.properties.iconAtlas;
|
|
16291
16301
|
const e = new n.reshader.FBORayPicking(this.renderer, {
|
|
16292
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
16302
|
+
vert: "#define PICKING_MODE 1\n" + sp,
|
|
16293
16303
|
uniforms: r,
|
|
16294
16304
|
extraCommandProps: s
|
|
16295
16305
|
}, this.pickingFBO, this.getMap());
|
|
@@ -16297,7 +16307,7 @@
|
|
|
16297
16307
|
}
|
|
16298
16308
|
}
|
|
16299
16309
|
getUniformValues(t, e) {
|
|
16300
|
-
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);
|
|
16301
16311
|
i && n.vec2.set(l, s, s);
|
|
16302
16312
|
const h = this.getBlendFunc(), u = r.Util.isFunction(h.src) ? h.src() : h.src;
|
|
16303
16313
|
return {
|
|
@@ -16307,7 +16317,7 @@
|
|
|
16307
16317
|
projViewMatrix: o,
|
|
16308
16318
|
cameraToCenterDistance: a,
|
|
16309
16319
|
canvasSize: l,
|
|
16310
|
-
iconSize:
|
|
16320
|
+
iconSize: wp,
|
|
16311
16321
|
resolution: t.getResolution(),
|
|
16312
16322
|
glyphSize: 24,
|
|
16313
16323
|
gammaScale: 1,
|
|
@@ -16317,32 +16327,32 @@
|
|
|
16317
16327
|
};
|
|
16318
16328
|
}
|
|
16319
16329
|
getUniqueEntryKey(t, e) {
|
|
16320
|
-
if (!this.
|
|
16330
|
+
if (!this.fa(t.geometry)) return null;
|
|
16321
16331
|
const {elements: n} = t.geometry.properties;
|
|
16322
|
-
return
|
|
16332
|
+
return np(t, n[e]);
|
|
16323
16333
|
}
|
|
16324
|
-
|
|
16334
|
+
ca(t) {
|
|
16325
16335
|
const {symbolIndex: e} = t.properties;
|
|
16326
16336
|
return 0 === e.type;
|
|
16327
16337
|
}
|
|
16328
|
-
|
|
16338
|
+
fa(t) {
|
|
16329
16339
|
const {symbolIndex: e} = t.properties;
|
|
16330
16340
|
return 1 === e.type;
|
|
16331
16341
|
}
|
|
16332
16342
|
}
|
|
16333
|
-
function
|
|
16343
|
+
function Sp(t, e) {
|
|
16334
16344
|
return t.properties.level - e.properties.level || t.properties.meshKey - e.properties.meshKey;
|
|
16335
16345
|
}
|
|
16336
|
-
const
|
|
16337
|
-
function
|
|
16338
|
-
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]);
|
|
16339
16349
|
return function(t, e, n, i, r, s, o, a, l, h, u, c, f, d, p, y, m, g) {
|
|
16340
16350
|
p || (p = i);
|
|
16341
16351
|
const v = e.geometry.properties.line, x = s[0] * c, b = f ? x - o : x + o;
|
|
16342
16352
|
let w = b > 0 ? 1 : -1, A = 0;
|
|
16343
16353
|
f && (w *= -1, A = Math.PI), w < 0 && (A += Math.PI);
|
|
16344
16354
|
const M = h + u, _ = Math.abs(b);
|
|
16345
|
-
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;
|
|
16346
16356
|
for (;O + I <= _; ) {
|
|
16347
16357
|
if (S += w, S < h || S >= M) return null;
|
|
16348
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],
|
|
@@ -16356,47 +16366,47 @@
|
|
|
16356
16366
|
const o = A + Math.atan2(k[1] - P[1], k[0] - P[0]);
|
|
16357
16367
|
return t[0] = (s[0] - p[0]) / d, t[1] = (s[1] - p[1]) / d, t[2] = o, t;
|
|
16358
16368
|
}
|
|
16359
|
-
const R = k.sub(P),
|
|
16360
|
-
|
|
16369
|
+
const R = k.sub(P), L = R.mult(C).o(P);
|
|
16370
|
+
L.o(R.T().F().M(a * w));
|
|
16361
16371
|
const H = A + Math.atan2(k.y - P.y, k.x - P.x);
|
|
16362
|
-
return t[0] = (
|
|
16372
|
+
return t[0] = (L.x - i[0]) / d, t[1] = (L.y - i[1]) / d, t[2] = H, t;
|
|
16363
16373
|
}(t, e, r, o, a, M, A[0], A[1], _[0], _[1], _[2], i / 24, h, l, u, c, f, d);
|
|
16364
16374
|
}
|
|
16365
|
-
const
|
|
16366
|
-
function
|
|
16375
|
+
const Op = [], Ip = [];
|
|
16376
|
+
function Cp(t, e, i, r, s, o, a, l, h, u, c, f) {
|
|
16367
16377
|
const {aVertical: d} = i.geometry.properties, p = d[o];
|
|
16368
|
-
let y, m, g =
|
|
16378
|
+
let y, m, g = Fp.call(this, Op, i, r, s, o, l, h, u, !1);
|
|
16369
16379
|
if (!g) return null;
|
|
16370
|
-
if (n.vec3.copy(t, g), g =
|
|
16371
|
-
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)),
|
|
16372
16382
|
p) {
|
|
16373
|
-
const t = Math.abs(
|
|
16374
|
-
m =
|
|
16375
|
-
} 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;
|
|
16376
16386
|
return 2 * m + y;
|
|
16377
16387
|
}
|
|
16378
|
-
var
|
|
16379
|
-
const
|
|
16380
|
-
const e = this.layer.getRenderer();
|
|
16381
|
-
return !this.ea(t) && e.isTileNearCamera(t) && "line" !== t.geometry.properties.textPlacement;
|
|
16382
|
-
}, Dp = function(t) {
|
|
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) {
|
|
16383
16390
|
const e = this.layer.getRenderer();
|
|
16384
|
-
return !this.
|
|
16391
|
+
return !this.na(t) && e.isTileNearCamera(t) && "line" !== t.geometry.properties.textPlacement;
|
|
16385
16392
|
}, Np = function(t) {
|
|
16386
16393
|
const e = this.layer.getRenderer();
|
|
16387
|
-
return !this.
|
|
16394
|
+
return !this.na(t) && !e.isForeground(t) && "line" !== t.geometry.properties.textPlacement;
|
|
16388
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) {
|
|
16389
16399
|
const e = this.layer.getRenderer(), n = t.properties.tile.z, i = e.getCurrentTileZoom();
|
|
16390
|
-
return !this.
|
|
16391
|
-
}, Lp = [ 0, 0, 3 ],
|
|
16392
|
-
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 {
|
|
16393
16403
|
static getBloomSymbol() {
|
|
16394
16404
|
return [ "textBloom" ];
|
|
16395
16405
|
}
|
|
16396
16406
|
constructor(t, e, n, i, r, s) {
|
|
16397
16407
|
super(t, e, n, i, r, s), this.propAllowOverlap = "textAllowOverlap", this.propIgnorePlacement = "textIgnorePlacement",
|
|
16398
|
-
this.colorCache = {}, this.
|
|
16399
|
-
this.
|
|
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();
|
|
16400
16410
|
}
|
|
16401
16411
|
prepareRender(...t) {
|
|
16402
16412
|
super.prepareRender(...t);
|
|
@@ -16408,44 +16418,44 @@
|
|
|
16408
16418
|
}
|
|
16409
16419
|
}
|
|
16410
16420
|
updateSymbol(...t) {
|
|
16411
|
-
this.
|
|
16421
|
+
this.Ta = void 0, this.Fa = void 0;
|
|
16412
16422
|
const e = super.updateSymbol(...t);
|
|
16413
|
-
return this.
|
|
16423
|
+
return this.Pa(), e;
|
|
16414
16424
|
}
|
|
16415
16425
|
isTerrainVector() {
|
|
16416
16426
|
if (!super.isTerrainSkin()) return !1;
|
|
16417
|
-
if (void 0 !== this.
|
|
16427
|
+
if (void 0 !== this.Ta) return this.Ta;
|
|
16418
16428
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
16419
|
-
if ("map" !== this.symbolDef[t].textPitchAlignment) return this.
|
|
16429
|
+
if ("map" !== this.symbolDef[t].textPitchAlignment) return this.Ta = !0, !0;
|
|
16420
16430
|
}
|
|
16421
|
-
return this.
|
|
16431
|
+
return this.Ta = !1, !1;
|
|
16422
16432
|
}
|
|
16423
16433
|
isTerrainSkin() {
|
|
16424
16434
|
if (!super.isTerrainSkin()) return !1;
|
|
16425
|
-
if (void 0 !== this.
|
|
16435
|
+
if (void 0 !== this.Fa) return this.Fa;
|
|
16426
16436
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
16427
16437
|
const e = this.symbolDef[t].textPitchAlignment;
|
|
16428
|
-
if ("map" === e || x(e) || ho.isExpression(e)) return this.
|
|
16438
|
+
if ("map" === e || x(e) || ho.isExpression(e)) return this.Fa = !0, !0;
|
|
16429
16439
|
}
|
|
16430
|
-
return this.
|
|
16440
|
+
return this.Fa = !1, !1;
|
|
16431
16441
|
}
|
|
16432
|
-
|
|
16433
|
-
this.
|
|
16442
|
+
Pa() {
|
|
16443
|
+
this.Oa = [];
|
|
16434
16444
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
16435
16445
|
const e = this.symbolDef[t];
|
|
16436
16446
|
if (ho.isExpression(e.textName)) {
|
|
16437
16447
|
const n = ho.createExpression(e.textName, "string");
|
|
16438
|
-
this.
|
|
16448
|
+
this.Oa[t] = (t, e) => {
|
|
16439
16449
|
let i;
|
|
16440
|
-
|
|
16450
|
+
ny.zoom = t, iy.properties = e;
|
|
16441
16451
|
try {
|
|
16442
|
-
i = n.evaluateWithoutErrorHandling(
|
|
16452
|
+
i = n.evaluateWithoutErrorHandling(ny, iy, ry, null, sy);
|
|
16443
16453
|
} catch (t) {
|
|
16444
16454
|
i = null;
|
|
16445
16455
|
}
|
|
16446
16456
|
return i;
|
|
16447
16457
|
};
|
|
16448
|
-
} else x(e.textName) && (this.
|
|
16458
|
+
} else x(e.textName) && (this.Oa[t] = b(e.textName));
|
|
16449
16459
|
}
|
|
16450
16460
|
}
|
|
16451
16461
|
shouldDeleteMeshOnUpdateSymbol(t) {
|
|
@@ -16454,10 +16464,10 @@
|
|
|
16454
16464
|
return !1;
|
|
16455
16465
|
}
|
|
16456
16466
|
createFnTypeConfig(t, e) {
|
|
16457
|
-
return
|
|
16467
|
+
return Jd(t, e);
|
|
16458
16468
|
}
|
|
16459
16469
|
isBloom(t) {
|
|
16460
|
-
return !!this.getSymbol(t.properties.symbolIndex)[
|
|
16470
|
+
return !!this.getSymbol(t.properties.symbolIndex)[hy.getBloomSymbol()[0]];
|
|
16461
16471
|
}
|
|
16462
16472
|
createGeometry(t, e, n) {
|
|
16463
16473
|
const i = t;
|
|
@@ -16472,9 +16482,9 @@
|
|
|
16472
16482
|
createMesh(t, e, {tileVectorTransform: n}) {
|
|
16473
16483
|
const i = this.isEnableCollision(), r = this.isEnableUniquePlacement(), {geometry: s, symbolIndex: o} = t;
|
|
16474
16484
|
s.properties.symbolIndex = o;
|
|
16475
|
-
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);
|
|
16476
16486
|
if (u.length) {
|
|
16477
|
-
"line" === s.properties.textPlacement ? this.
|
|
16487
|
+
"line" === s.properties.textPlacement ? this.Ia = !0 : this.Ca = !0;
|
|
16478
16488
|
}
|
|
16479
16489
|
return u.forEach(t => {
|
|
16480
16490
|
t.positionMatrix = this.getAltitudeOffsetMatrix(), t.properties.tileVectorTransform = n;
|
|
@@ -16483,24 +16493,24 @@
|
|
|
16483
16493
|
updateCollision(t) {
|
|
16484
16494
|
super.updateCollision(t);
|
|
16485
16495
|
const e = this.scene.getMeshes();
|
|
16486
|
-
e && e.length ? (this.
|
|
16496
|
+
e && e.length ? (this.Ea = {}, this.Da(t.timestamp), this.po()) : this.po();
|
|
16487
16497
|
}
|
|
16488
16498
|
callCurrentTileShader(t, e) {
|
|
16489
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
16490
|
-
this.
|
|
16499
|
+
this.shader.filter = e.sceneFilter ? [ this.Ma, e.sceneFilter ] : this.Ma, this.callRenderer(this.shader, t, e),
|
|
16500
|
+
this.Na.filter = e.sceneFilter ? [ this.Sa, e.sceneFilter ] : this.Sa, this.callRenderer(this.Na, t, e);
|
|
16491
16501
|
}
|
|
16492
16502
|
callBackgroundTileShader(t, e) {
|
|
16493
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
16494
|
-
this.
|
|
16503
|
+
this.shader.filter = e.sceneFilter ? [ this._a, e.sceneFilter ] : this._a, this.callRenderer(this.shader, t, e),
|
|
16504
|
+
this.Na.filter = e.sceneFilter ? [ this.ka, e.sceneFilter ] : this.ka, this.callRenderer(this.Na, t, e);
|
|
16495
16505
|
}
|
|
16496
16506
|
callRenderer(t, e, n) {
|
|
16497
16507
|
n && n.isRenderingTerrain && x(this.symbolDef.textPitchAlignment) && (n.isRenderingTerrainSkin ? e.textPitchFilter = 1 : e.textPitchFilter = 2),
|
|
16498
16508
|
super.callRenderer(t, e, n);
|
|
16499
16509
|
}
|
|
16500
|
-
|
|
16510
|
+
Da() {
|
|
16501
16511
|
let t = this.scene.getMeshes();
|
|
16502
16512
|
if (!t || !t.length) return;
|
|
16503
|
-
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) => {
|
|
16504
16514
|
const {start: r, end: s, mesh: o, allElements: a} = e[0];
|
|
16505
16515
|
if (this.updateBoxCollisionFading(!0, o, e, n, i)) {
|
|
16506
16516
|
let e = t.count;
|
|
@@ -16508,7 +16518,7 @@
|
|
|
16508
16518
|
t.count = e;
|
|
16509
16519
|
}
|
|
16510
16520
|
}, s = this.isEnableCollision(), o = this.layer.getRenderer();
|
|
16511
|
-
t = t.sort(
|
|
16521
|
+
t = t.sort(cy);
|
|
16512
16522
|
for (let e = 0; e < t.length; e++) {
|
|
16513
16523
|
const n = t[e];
|
|
16514
16524
|
if (!this.isMeshIterable(n)) continue;
|
|
@@ -16518,11 +16528,11 @@
|
|
|
16518
16528
|
continue;
|
|
16519
16529
|
}
|
|
16520
16530
|
const a = n.geometry, l = this.getSymbol(n.properties.symbolIndex);
|
|
16521
|
-
n.properties.textHaloRadius = Vl(l.textHaloRadius) ?
|
|
16531
|
+
n.properties.textHaloRadius = Vl(l.textHaloRadius) ? Wd.textHaloRadius : l.textHaloRadius;
|
|
16522
16532
|
const h = n.properties.meshKey;
|
|
16523
16533
|
if ("line" === a.properties.textPlacement) {
|
|
16524
16534
|
if (!a.properties.line) continue;
|
|
16525
|
-
s && this.startMeshCollision(n), this.
|
|
16535
|
+
s && this.startMeshCollision(n), this.Ra(n, i);
|
|
16526
16536
|
const {aOffset: t, aOpacity: e} = a.properties;
|
|
16527
16537
|
t.dirty && (a.updateData("aOffset", t), t.dirty = !1), e && e.dirty && (a.updateData("aOpacity", e),
|
|
16528
16538
|
e.dirty = !1), s && this.endMeshCollision(h);
|
|
@@ -16545,18 +16555,18 @@
|
|
|
16545
16555
|
return "line" !== this.getSymbol(t.properties.symbolIndex).textPlacement;
|
|
16546
16556
|
}
|
|
16547
16557
|
getUniqueEntryKey(t, e) {
|
|
16548
|
-
return
|
|
16558
|
+
return np(t, e);
|
|
16549
16559
|
}
|
|
16550
|
-
|
|
16560
|
+
Ra(t, e) {
|
|
16551
16561
|
const i = this.getMap(), r = t.geometry, s = r.properties;
|
|
16552
16562
|
let o = s.line;
|
|
16553
16563
|
if (!o) return;
|
|
16554
16564
|
const a = i.getPitch(), l = i.getBearing(), {lineTextPitch: h, lineTextBearing: u} = t.properties, c = 1 === t.material.uniforms.pitchWithMap, f = s.elements;
|
|
16555
16565
|
if (!c) {
|
|
16556
|
-
const e = n.mat4.multiply(
|
|
16566
|
+
const e = n.mat4.multiply(Hp, i.projViewMatrix, t.localTransform), r = o.id + "-" + e.join();
|
|
16557
16567
|
let a;
|
|
16558
|
-
this.
|
|
16559
|
-
o = this.
|
|
16568
|
+
this.Ea[r] ? o = this.Ea[r] : (a = s.projectedLine = s.projectedLine || new Array(o.length),
|
|
16569
|
+
o = this.za(a, o, e, i.width, i.height), this.Ea[r] = a);
|
|
16560
16570
|
}
|
|
16561
16571
|
const d = this.isEnableCollision(), p = r.properties.visElemts = r.properties.visElemts || new f.constructor(f.length), y = r.properties.visCache = r.properties.visCache || [];
|
|
16562
16572
|
d && (p.count = 0);
|
|
@@ -16574,7 +16584,7 @@
|
|
|
16574
16584
|
const g = t.geometry.properties.aAltitude;
|
|
16575
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);
|
|
16576
16586
|
}
|
|
16577
|
-
|
|
16587
|
+
za(t, e, i, r, s) {
|
|
16578
16588
|
return function(t, e, i, r, s) {
|
|
16579
16589
|
for (let o = 0; o < e.length; o += 3) n.vec4.set(uf, e[o], e[o + 1], e[o + 2], 1),
|
|
16580
16590
|
cf(uf, uf, i, r, s), t[o] = uf[0], t[o + 1] = uf[1], t[o + 2] = e[o + 2];
|
|
@@ -16582,15 +16592,15 @@
|
|
|
16582
16592
|
}(t, e, i, r, s);
|
|
16583
16593
|
}
|
|
16584
16594
|
forEachBox(t, e) {
|
|
16585
|
-
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;
|
|
16586
16596
|
if (!h) return;
|
|
16587
|
-
const u = this.isEnableUniquePlacement(), c = this.
|
|
16597
|
+
const u = this.isEnableUniquePlacement(), c = this.ta(1);
|
|
16588
16598
|
c[0].allElements = l, c[0].mesh = t;
|
|
16589
16599
|
let f = 0, d = l[0], p = 0, y = h[d];
|
|
16590
16600
|
for (let n = 0; n <= l.length; n += 6) if (d = l[n], h[d] !== y || n === l.length) {
|
|
16591
16601
|
const i = a[y] && a[y].feature;
|
|
16592
16602
|
if (u && this.isMeshUniquePlaced(t) && i && !i.label) {
|
|
16593
|
-
const e = i.properties || {}, {symbolIndex: n} = t.properties, r = n && this.
|
|
16603
|
+
const e = i.properties || {}, {symbolIndex: n} = t.properties, r = n && this.Oa[n.index] ? this.Oa[n.index](t.properties.z, e) : this.getSymbol(t.properties.symbolIndex).textName, s = Io.resolveText(r, e);
|
|
16594
16604
|
i.label = s;
|
|
16595
16605
|
}
|
|
16596
16606
|
const s = n, m = o[l[p]];
|
|
@@ -16605,59 +16615,59 @@
|
|
|
16605
16615
|
w || (w = p.properties.aProjectedAnchor = new Array(v.length / y * 3));
|
|
16606
16616
|
const A = p.properties.aTextSize, M = !a, _ = e[i], S = _ * y;
|
|
16607
16617
|
let k;
|
|
16608
|
-
k = p.data.aAltitude ? n.vec3.set(
|
|
16609
|
-
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;
|
|
16610
16620
|
let F;
|
|
16611
16621
|
if (T) {
|
|
16612
16622
|
const t = T[_];
|
|
16613
16623
|
if (t === Ol) return w[3 * _] = -999999, w[3 * _ + 1] = -999999, w[3 * _ + 2] = -999999,
|
|
16614
16624
|
!1;
|
|
16615
|
-
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;
|
|
16616
16626
|
} else F = P;
|
|
16617
16627
|
const O = d.getDevicePixelRatio();
|
|
16618
|
-
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,
|
|
16619
16629
|
w[3 * _ + 1] = -999999, w[3 * _ + 2] = -999999, !1;
|
|
16620
16630
|
M && (k = P), w[3 * _] = F[0], w[3 * _ + 1] = F[1], w[3 * _ + 2] = F[2];
|
|
16621
16631
|
const I = M ? 1 : p.properties.tileExtent / this.layer.getTileSize().width;
|
|
16622
16632
|
let C = !0;
|
|
16623
|
-
const E = e[i], D = e[r - 1], N = A ? A[E] : t.properties.textSize, R = this.
|
|
16624
|
-
if (null === R) return
|
|
16625
|
-
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;
|
|
16626
16636
|
for (let a = i; a < r; a += 6) {
|
|
16627
16637
|
const l = e[a];
|
|
16628
16638
|
let d;
|
|
16629
|
-
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,
|
|
16630
16640
|
!d) {
|
|
16631
|
-
C = !1, f ||
|
|
16641
|
+
C = !1, f || uy(g, e, i, r);
|
|
16632
16642
|
break;
|
|
16633
16643
|
}
|
|
16634
16644
|
let p = d[2];
|
|
16635
16645
|
H && (p -= Math.PI / 2);
|
|
16636
|
-
const y =
|
|
16646
|
+
const y = _d(Gp, p, 0, h.rotateWithMap, h.pitchWithMap), v = g.length > m.length;
|
|
16637
16647
|
let x;
|
|
16638
16648
|
if (v) {
|
|
16639
|
-
n.vec3.set(
|
|
16640
|
-
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];
|
|
16641
16651
|
if (e) {
|
|
16642
|
-
const i = n.quat.setAxisAngle(
|
|
16643
|
-
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);
|
|
16644
16654
|
}
|
|
16645
16655
|
}
|
|
16646
16656
|
for (let t = 0; t < 4; t++) {
|
|
16647
16657
|
const e = 2 * (l + t);
|
|
16648
|
-
n.vec2.set(
|
|
16649
|
-
u ? (n.vec2.multiply(
|
|
16650
|
-
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]);
|
|
16651
16661
|
const i = (v ? 3 : 2) * (l + t);
|
|
16652
|
-
(g[i] !==
|
|
16653
|
-
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]));
|
|
16654
16664
|
}
|
|
16655
16665
|
}
|
|
16656
16666
|
return C;
|
|
16657
16667
|
}
|
|
16658
|
-
|
|
16668
|
+
Ha(t, e, n, i, r, s, o, a, l) {
|
|
16659
16669
|
const h = r - i <= 3, u = this.getMap();
|
|
16660
|
-
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);
|
|
16661
16671
|
}
|
|
16662
16672
|
isBoxCollides(t, e, n, i, r, s) {
|
|
16663
16673
|
return this.isLabelCollides(0, t, e, n, i, r, s);
|
|
@@ -16668,7 +16678,7 @@
|
|
|
16668
16678
|
}) : t.material && delete t.material.uniforms.texture), super.deleteMesh(t, e));
|
|
16669
16679
|
}
|
|
16670
16680
|
delete() {
|
|
16671
|
-
super.delete(), this.
|
|
16681
|
+
super.delete(), this.Na.dispose(), delete this.Ea, this.Ua && this.Ua.dispose();
|
|
16672
16682
|
}
|
|
16673
16683
|
needClearStencil() {
|
|
16674
16684
|
return !0;
|
|
@@ -16676,28 +16686,28 @@
|
|
|
16676
16686
|
init() {
|
|
16677
16687
|
const t = this.regl;
|
|
16678
16688
|
this.renderer = new n.reshader.Renderer(t);
|
|
16679
|
-
const {uniforms: e, extraCommandProps: i} =
|
|
16689
|
+
const {uniforms: e, extraCommandProps: i} = qd.call(this, this.canvas, this.sceneConfig), r = this.canvas, s = {
|
|
16680
16690
|
x: (t, e) => e.viewport ? e.viewport.x : 0,
|
|
16681
16691
|
y: (t, e) => e.viewport ? e.viewport.y : 0,
|
|
16682
16692
|
width: (t, e) => e.viewport ? e.viewport.width : r ? r.width : 1,
|
|
16683
16693
|
height: (t, e) => e.viewport ? e.viewport.height : r ? r.height : 1
|
|
16684
16694
|
};
|
|
16685
16695
|
i.viewport = s, this.shader = new n.reshader.MeshShader({
|
|
16686
|
-
vert:
|
|
16687
|
-
frag:
|
|
16696
|
+
vert: sp,
|
|
16697
|
+
frag: op,
|
|
16688
16698
|
uniforms: e,
|
|
16689
16699
|
extraCommandProps: i
|
|
16690
16700
|
});
|
|
16691
16701
|
let o = i;
|
|
16692
|
-
if (this.layer.getRenderer().isEnableWorkAround("win-intel-gpu-crash") && (o =
|
|
16693
|
-
o.stencil =
|
|
16694
|
-
vert:
|
|
16695
|
-
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,
|
|
16696
16706
|
uniforms: e,
|
|
16697
16707
|
extraCommandProps: o
|
|
16698
16708
|
}), this.pickingFBO) {
|
|
16699
16709
|
const t = new n.reshader.FBORayPicking(this.renderer, {
|
|
16700
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
16710
|
+
vert: "#define PICKING_MODE 1\n" + sp,
|
|
16701
16711
|
uniforms: e,
|
|
16702
16712
|
extraCommandProps: {
|
|
16703
16713
|
viewport: this.pickingViewport
|
|
@@ -16708,7 +16718,7 @@
|
|
|
16708
16718
|
return "line" !== this.getSymbol(e).textPlacement;
|
|
16709
16719
|
};
|
|
16710
16720
|
const i = new n.reshader.FBORayPicking(this.renderer, {
|
|
16711
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
16721
|
+
vert: "#define PICKING_MODE 1\n" + Ep,
|
|
16712
16722
|
uniforms: e,
|
|
16713
16723
|
extraCommandProps: {
|
|
16714
16724
|
viewport: this.pickingViewport
|
|
@@ -16718,7 +16728,7 @@
|
|
|
16718
16728
|
}
|
|
16719
16729
|
}
|
|
16720
16730
|
getUniformValues(t, e) {
|
|
16721
|
-
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);
|
|
16722
16732
|
i && n.vec2.set(a, r, r);
|
|
16723
16733
|
const l = R(t.getResolution(), t);
|
|
16724
16734
|
return {
|
|
@@ -16739,7 +16749,7 @@
|
|
|
16739
16749
|
};
|
|
16740
16750
|
}
|
|
16741
16751
|
}
|
|
16742
|
-
function
|
|
16752
|
+
function uy(t, e, n, i) {
|
|
16743
16753
|
for (let r = n; r < i; r += 6) {
|
|
16744
16754
|
const n = e[r];
|
|
16745
16755
|
for (let e = 0; e < 4; e++) {
|
|
@@ -16748,17 +16758,17 @@
|
|
|
16748
16758
|
}
|
|
16749
16759
|
}
|
|
16750
16760
|
}
|
|
16751
|
-
function
|
|
16761
|
+
function cy(t, e) {
|
|
16752
16762
|
const n = t.properties.level - e.properties.level;
|
|
16753
16763
|
return 0 === n ? t.properties.meshKey - e.properties.meshKey : n;
|
|
16754
16764
|
}
|
|
16755
|
-
var
|
|
16756
|
-
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 = {
|
|
16757
16767
|
markerFill: [ 0, 0, 0 ],
|
|
16758
16768
|
markerOpacity: 1,
|
|
16759
16769
|
markerSize: 10
|
|
16760
16770
|
};
|
|
16761
|
-
class
|
|
16771
|
+
class py extends Df {
|
|
16762
16772
|
getPrimitive() {
|
|
16763
16773
|
return "points";
|
|
16764
16774
|
}
|
|
@@ -16776,7 +16786,7 @@
|
|
|
16776
16786
|
const a = {};
|
|
16777
16787
|
Bl(a, "markerOpacity", o, "markerOpacity", 1), Bl(a, "markerSize", o, "markerSize", 10),
|
|
16778
16788
|
Bl(a, "markerFill", o, "markerFill", "#000", $l(this.colorCache, 3));
|
|
16779
|
-
const l = new n.reshader.Material(a,
|
|
16789
|
+
const l = new n.reshader.Material(a, dy);
|
|
16780
16790
|
l.createDefines = () => "square" !== o.markerType ? {
|
|
16781
16791
|
USE_CIRCLE: 1
|
|
16782
16792
|
} : null, l.appendDefines = t => ("square" !== o.markerType && (t.USE_CIRCLE = 1),
|
|
@@ -16808,7 +16818,7 @@
|
|
|
16808
16818
|
const t = this.regl;
|
|
16809
16819
|
this.renderer = new n.reshader.Renderer(t);
|
|
16810
16820
|
const e = [], i = {
|
|
16811
|
-
vert:
|
|
16821
|
+
vert: fy,
|
|
16812
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}",
|
|
16813
16823
|
uniforms: [ {
|
|
16814
16824
|
name: "projViewModelMatrix",
|
|
@@ -16841,7 +16851,7 @@
|
|
|
16841
16851
|
if (this.shader = new n.reshader.MeshShader(i), this.shader.version = 300, this.pickingFBO) {
|
|
16842
16852
|
const t = [];
|
|
16843
16853
|
this.picking = [ new n.reshader.FBORayPicking(this.renderer, {
|
|
16844
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
16854
|
+
vert: "#define PICKING_MODE 1\n" + fy,
|
|
16845
16855
|
uniforms: [ {
|
|
16846
16856
|
name: "projViewModelMatrix",
|
|
16847
16857
|
type: "function",
|
|
@@ -16861,9 +16871,9 @@
|
|
|
16861
16871
|
};
|
|
16862
16872
|
}
|
|
16863
16873
|
}
|
|
16864
|
-
var
|
|
16865
|
-
const
|
|
16866
|
-
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 {
|
|
16867
16877
|
constructor(t, e, n, i, r, s) {
|
|
16868
16878
|
if (super(t, e, n, i, r, s), this.primitive = "lines", x(this.symbolDef.lineColor)) {
|
|
16869
16879
|
const t = e.getMap(), n = w(this.symbolDef.lineColor);
|
|
@@ -16905,7 +16915,7 @@
|
|
|
16905
16915
|
return n.mat4.multiply(i, e.projViewMatrix, e.modelMatrix), i;
|
|
16906
16916
|
}
|
|
16907
16917
|
} ], a = this.sceneConfig.depthRange, l = {
|
|
16908
|
-
vert:
|
|
16918
|
+
vert: yy,
|
|
16909
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}",
|
|
16910
16920
|
uniforms: o,
|
|
16911
16921
|
defines: null,
|
|
@@ -16942,7 +16952,7 @@
|
|
|
16942
16952
|
}
|
|
16943
16953
|
};
|
|
16944
16954
|
this.shader = new n.reshader.MeshShader(l), this.pickingFBO && (this.picking = [ new n.reshader.FBORayPicking(this.renderer, {
|
|
16945
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
16955
|
+
vert: "#define PICKING_MODE 1\n" + yy,
|
|
16946
16956
|
uniforms: o,
|
|
16947
16957
|
extraCommandProps: {
|
|
16948
16958
|
viewport: this.pickingViewport
|
|
@@ -16952,7 +16962,7 @@
|
|
|
16952
16962
|
getUniformValues(t, e) {
|
|
16953
16963
|
const n = e && e.isRenderingTerrainSkin;
|
|
16954
16964
|
return {
|
|
16955
|
-
projViewMatrix: n ?
|
|
16965
|
+
projViewMatrix: n ? my : t.projViewMatrix,
|
|
16956
16966
|
viewport: n && e && e.viewport
|
|
16957
16967
|
};
|
|
16958
16968
|
}
|
|
@@ -16960,8 +16970,8 @@
|
|
|
16960
16970
|
return "lines";
|
|
16961
16971
|
}
|
|
16962
16972
|
}
|
|
16963
|
-
const
|
|
16964
|
-
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 {
|
|
16965
16975
|
supportRenderMode(t) {
|
|
16966
16976
|
return this.isAnimating() ? "fxaa" === t || "fxaaAfterTaa" === t : "taa" === t || "fxaa" === t;
|
|
16967
16977
|
}
|
|
@@ -16978,9 +16988,9 @@
|
|
|
16978
16988
|
if (!this.material) return this.setToRedraw(), null;
|
|
16979
16989
|
const {geometry: s, symbolIndex: o} = t, a = this.layer instanceof r.TileLayer, l = new n.reshader.Mesh(s, this.material);
|
|
16980
16990
|
if (this.sceneConfig.animation) {
|
|
16981
|
-
|
|
16991
|
+
xy[2] = .01;
|
|
16982
16992
|
const t = [];
|
|
16983
|
-
n.mat4.fromScaling(t,
|
|
16993
|
+
n.mat4.fromScaling(t, xy), n.mat4.multiply(t, e, t), e = t;
|
|
16984
16994
|
}
|
|
16985
16995
|
const h = this.getSymbolDef(o), u = this.getFnTypeConfig(o);
|
|
16986
16996
|
Kc(s, h, u);
|
|
@@ -17002,12 +17012,12 @@
|
|
|
17002
17012
|
}
|
|
17003
17013
|
});
|
|
17004
17014
|
} else {
|
|
17005
|
-
Bl(l.uniforms, "polygonFill", d, "polygonFill",
|
|
17015
|
+
Bl(l.uniforms, "polygonFill", d, "polygonFill", by, p), Bl(l.uniforms, "polygonOpacity", d, "polygonOpacity", 1);
|
|
17006
17016
|
const t = [];
|
|
17007
17017
|
Object.defineProperty(l.uniforms, "vertexColorsOfType", {
|
|
17008
17018
|
enumerable: !0,
|
|
17009
17019
|
get: () => {
|
|
17010
|
-
const e = p(d.bottomPolygonFill ||
|
|
17020
|
+
const e = p(d.bottomPolygonFill || by), n = p(d.topPolygonFill || by);
|
|
17011
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],
|
|
17012
17022
|
t[7] = n[3];
|
|
17013
17023
|
const i = l.geometry.properties.vertexColors;
|
|
@@ -17047,7 +17057,7 @@
|
|
|
17047
17057
|
Object.defineProperty(l.uniforms, "uvOrigin", {
|
|
17048
17058
|
enumerable: !0,
|
|
17049
17059
|
get: () => {
|
|
17050
|
-
const t = this.
|
|
17060
|
+
const t = this.Va(w, o, i, y, x, a);
|
|
17051
17061
|
return n.vec2.set(b, t[0] - t[0] % 1, t[1] - t[1] % 1);
|
|
17052
17062
|
}
|
|
17053
17063
|
});
|
|
@@ -17055,7 +17065,7 @@
|
|
|
17055
17065
|
Object.defineProperty(l.uniforms, "uvOffset", {
|
|
17056
17066
|
enumerable: !0,
|
|
17057
17067
|
get: () => {
|
|
17058
|
-
const t = this.
|
|
17068
|
+
const t = this.Va(w, o, i, y, x, a);
|
|
17059
17069
|
return n.vec2.set(b, t[0] % 1, t[1] % 1);
|
|
17060
17070
|
}
|
|
17061
17071
|
}), Object.defineProperty(l.uniforms, "hasAlpha", {
|
|
@@ -17071,17 +17081,17 @@
|
|
|
17071
17081
|
get: () => g.isForeground(l) ? 0 : A - l.properties.tile.z
|
|
17072
17082
|
}), l.properties.symbolIndex = o, l;
|
|
17073
17083
|
}
|
|
17074
|
-
|
|
17075
|
-
if (1 === this.dataConfig.topUVMode) return
|
|
17084
|
+
Va(t, e, i, r, s, o) {
|
|
17085
|
+
if (1 === this.dataConfig.topUVMode) return vy;
|
|
17076
17086
|
const a = this.getMap(), l = this.getSymbol(e).material;
|
|
17077
17087
|
let h = i;
|
|
17078
|
-
!this.dataConfig.side && l && l.textureOrigin && (
|
|
17079
|
-
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));
|
|
17080
17090
|
const u = !!l && l.uvOffsetInMeter;
|
|
17081
|
-
let c = l && l.uvOffset ||
|
|
17091
|
+
let c = l && l.uvOffset || wy;
|
|
17082
17092
|
const f = this.getUVOffsetAnim();
|
|
17083
17093
|
f && (c = this.getUVOffset(f));
|
|
17084
|
-
const d = l && l.uvScale ||
|
|
17094
|
+
const d = l && l.uvScale || Ay;
|
|
17085
17095
|
let p = this.dataConfig.side ? 0 : h[0], y = this.dataConfig.side ? 0 : h[1];
|
|
17086
17096
|
const m = l && l.textureWidth || 23.25, g = m * d[1] / d[0];
|
|
17087
17097
|
u && (p += c[0] / s, y += c[1] / s);
|
|
@@ -17094,7 +17104,7 @@
|
|
|
17094
17104
|
super.callShader(t, e);
|
|
17095
17105
|
}
|
|
17096
17106
|
getShadowMeshes() {
|
|
17097
|
-
if (!this.isVisible()) return
|
|
17107
|
+
if (!this.isVisible()) return My;
|
|
17098
17108
|
this.shadowCount = this.scene.getMeshes().length;
|
|
17099
17109
|
const t = this.scene.getMeshes().filter(t => 0 === t.properties.level);
|
|
17100
17110
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -17108,14 +17118,14 @@
|
|
|
17108
17118
|
return t.material && t.material.uvOffsetAnim;
|
|
17109
17119
|
}
|
|
17110
17120
|
getUVOffset(t) {
|
|
17111
|
-
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]);
|
|
17112
17122
|
return o[0] = s * t[0], o[1] = s * t[0], r || (o[0] %= 1, o[1] %= 1), o;
|
|
17113
17123
|
}
|
|
17114
17124
|
needPolygonOffset() {
|
|
17115
|
-
return this.
|
|
17125
|
+
return this.ja;
|
|
17116
17126
|
}
|
|
17117
17127
|
startFrame(...t) {
|
|
17118
|
-
return delete this.
|
|
17128
|
+
return delete this.ja, super.startFrame(...t);
|
|
17119
17129
|
}
|
|
17120
17130
|
addMesh(t, e) {
|
|
17121
17131
|
t.forEach(t => {
|
|
@@ -17125,10 +17135,10 @@
|
|
|
17125
17135
|
Ks(t, e) {
|
|
17126
17136
|
if (null !== e) {
|
|
17127
17137
|
const i = t.localTransform;
|
|
17128
|
-
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),
|
|
17129
17139
|
t.setLocalTransform(i);
|
|
17130
17140
|
} else t.setLocalTransform(t.properties.tileTransform);
|
|
17131
|
-
t.material !== this.material && t.setMaterial(this.material), t.geometry.properties.maxAltitude <= 0 && (this.
|
|
17141
|
+
t.material !== this.material && t.setMaterial(this.material), t.geometry.properties.maxAltitude <= 0 && (this.ja = !0),
|
|
17132
17142
|
this.getSymbol(t.properties.symbolIndex).ssr ? t.ssr = 1 : t.ssr = 0;
|
|
17133
17143
|
}
|
|
17134
17144
|
deleteMaterial() {
|
|
@@ -17180,26 +17190,26 @@
|
|
|
17180
17190
|
updateSymbol(t, e) {
|
|
17181
17191
|
let n = !1;
|
|
17182
17192
|
t && t.material && (n = function(t, e) {
|
|
17183
|
-
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;
|
|
17184
17194
|
return !1;
|
|
17185
17195
|
}(this.symbolDef[0].material || {}, t.material));
|
|
17186
17196
|
const i = super.updateSymbol(t, e);
|
|
17187
17197
|
return t && t.material && this.Wr(t.material), n || i;
|
|
17188
17198
|
}
|
|
17189
17199
|
Ts(t, e) {
|
|
17190
|
-
return
|
|
17200
|
+
return Fy(t) !== Fy(e);
|
|
17191
17201
|
}
|
|
17192
17202
|
}
|
|
17193
|
-
function
|
|
17203
|
+
function Fy(t) {
|
|
17194
17204
|
if (!t || !t.material) return !1;
|
|
17195
17205
|
for (const e in t.material) if (e.indexOf("Texture") > 0 && t.material[e]) return !0;
|
|
17196
17206
|
return !1;
|
|
17197
17207
|
}
|
|
17198
|
-
const
|
|
17208
|
+
const Oy = {
|
|
17199
17209
|
normalTexture: 1,
|
|
17200
17210
|
bumpTexture: 1
|
|
17201
17211
|
};
|
|
17202
|
-
class
|
|
17212
|
+
class Iy extends Ty {
|
|
17203
17213
|
createGeometry(t) {
|
|
17204
17214
|
const e = t.data, i = this.getSymbols()[0];
|
|
17205
17215
|
if (i.material && i.material.extrusionOpacity) {
|
|
@@ -17208,7 +17218,7 @@
|
|
|
17208
17218
|
e.aExtrusionOpacity = t;
|
|
17209
17219
|
}
|
|
17210
17220
|
const r = new n.reshader.Geometry(e, t.indices);
|
|
17211
|
-
return
|
|
17221
|
+
return Ll(r.properties, t.properties), this.Vs(r, t), {
|
|
17212
17222
|
geometry: r,
|
|
17213
17223
|
symbolIndex: {
|
|
17214
17224
|
index: 0
|
|
@@ -17217,7 +17227,7 @@
|
|
|
17217
17227
|
}
|
|
17218
17228
|
updateSceneConfig(t) {
|
|
17219
17229
|
let e;
|
|
17220
|
-
if (this.sceneConfig.cullFace !== t.cullFace && (e = !0),
|
|
17230
|
+
if (this.sceneConfig.cullFace !== t.cullFace && (e = !0), Ll(this.sceneConfig, t),
|
|
17221
17231
|
e) {
|
|
17222
17232
|
const t = this.getShaderConfig();
|
|
17223
17233
|
this.shader.dispose(), this.shader = new n.reshader.PhongShader(t);
|
|
@@ -17228,10 +17238,10 @@
|
|
|
17228
17238
|
return this.shader;
|
|
17229
17239
|
}
|
|
17230
17240
|
delete(t) {
|
|
17231
|
-
this.getMap().off("updatelights", this.
|
|
17241
|
+
this.getMap().off("updatelights", this.Ba, this), super.delete(t), this.material.dispose();
|
|
17232
17242
|
}
|
|
17233
17243
|
init() {
|
|
17234
|
-
this.getMap().on("updatelights", this.
|
|
17244
|
+
this.getMap().on("updatelights", this.Ba, this);
|
|
17235
17245
|
const t = this.regl;
|
|
17236
17246
|
this.renderer = new n.reshader.Renderer(t);
|
|
17237
17247
|
const e = this.getShaderConfig();
|
|
@@ -17251,7 +17261,7 @@
|
|
|
17251
17261
|
};
|
|
17252
17262
|
this.picking = [ new n.reshader.FBORayPicking(this.renderer, i, this.layer.getRenderer().pickingFBO, this.getMap()) ];
|
|
17253
17263
|
}
|
|
17254
|
-
|
|
17264
|
+
Ba() {
|
|
17255
17265
|
this.setToRedraw();
|
|
17256
17266
|
}
|
|
17257
17267
|
getShaderConfig() {
|
|
@@ -17307,7 +17317,7 @@
|
|
|
17307
17317
|
this.material = new n.reshader.PhongMaterial(e);
|
|
17308
17318
|
}
|
|
17309
17319
|
getUniformValues(t, e) {
|
|
17310
|
-
const n = t.viewMatrix, i = t.projMatrix, r = t.cameraPosition, s = this.
|
|
17320
|
+
const n = t.viewMatrix, i = t.projMatrix, r = t.cameraPosition, s = this.Ga(), o = Ll({
|
|
17311
17321
|
viewMatrix: n,
|
|
17312
17322
|
projMatrix: i,
|
|
17313
17323
|
cameraPosition: r,
|
|
@@ -17320,7 +17330,7 @@
|
|
|
17320
17330
|
getPickingVert() {
|
|
17321
17331
|
return "\n attribute vec3 aPosition;\n uniform mat4 projViewModelMatrix;\n uniform mat4 modelMatrix;\n uniform mat4 positionMatrix;\n //引入fbo picking的vert相关函数\n #include <fbo_picking_vert>\n #include <get_output>\n void main()\n {\n mat4 localPositionMatrix = getPositionMatrix();\n vec4 localPosition = getPosition(aPosition);\n\n gl_Position = projViewModelMatrix * localPositionMatrix * localPosition;\n //传入gl_Position的depth值\n fbo_picking_setData(gl_Position.w, true);\n }\n ";
|
|
17322
17332
|
}
|
|
17323
|
-
|
|
17333
|
+
Ga() {
|
|
17324
17334
|
const t = this.getMap().getLightManager(), e = t && t.getAmbientLight() || {}, n = t && t.getDirectionalLight() || {};
|
|
17325
17335
|
return {
|
|
17326
17336
|
ambientColor: e.color || [ .2, .2, .2 ],
|
|
@@ -17330,8 +17340,8 @@
|
|
|
17330
17340
|
};
|
|
17331
17341
|
}
|
|
17332
17342
|
}
|
|
17333
|
-
const
|
|
17334
|
-
class
|
|
17343
|
+
const Cy = [ 1, 1, 1 ];
|
|
17344
|
+
class Ey extends If {
|
|
17335
17345
|
createGeometry(t) {
|
|
17336
17346
|
const {data: e, indices: i} = t, r = new n.reshader.Geometry(e, i, 0, {
|
|
17337
17347
|
primitive: "lines"
|
|
@@ -17346,9 +17356,9 @@
|
|
|
17346
17356
|
createMesh(t, e) {
|
|
17347
17357
|
const {geometry: i} = t, r = new n.reshader.Mesh(i);
|
|
17348
17358
|
if (r.castShadow = !1, this.sceneConfig.animation) {
|
|
17349
|
-
|
|
17359
|
+
Cy[2] = .01;
|
|
17350
17360
|
const t = [];
|
|
17351
|
-
n.mat4.fromScaling(t,
|
|
17361
|
+
n.mat4.fromScaling(t, Cy), n.mat4.multiply(t, e, t), e = t;
|
|
17352
17362
|
}
|
|
17353
17363
|
return r.setLocalTransform(e), r.properties.symbolIndex = {
|
|
17354
17364
|
index: 0
|
|
@@ -17357,7 +17367,7 @@
|
|
|
17357
17367
|
addMesh(t, e) {
|
|
17358
17368
|
if (!t.length) return this;
|
|
17359
17369
|
let i;
|
|
17360
|
-
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),
|
|
17361
17371
|
n.mat4.multiply(i, t[0].properties.tileTransform, i)) : i = t[0].properties.tileTransform;
|
|
17362
17372
|
for (let e = 0; e < t.length; e++) t[e].setLocalTransform(i);
|
|
17363
17373
|
return this.scene.addMesh(t), this;
|
|
@@ -17413,23 +17423,23 @@
|
|
|
17413
17423
|
};
|
|
17414
17424
|
}
|
|
17415
17425
|
}
|
|
17416
|
-
const {getPBRUniforms:
|
|
17417
|
-
class
|
|
17426
|
+
const {getPBRUniforms: Dy} = n.reshader.pbr.PBRUtils;
|
|
17427
|
+
class Ny extends Ty {
|
|
17418
17428
|
constructor(...t) {
|
|
17419
|
-
super(...t), this.
|
|
17429
|
+
super(...t), this.Wa = new n.reshader.ResourceLoader, this.scene.sortFunction = this.sortByCommandKey;
|
|
17420
17430
|
}
|
|
17421
17431
|
supportRenderMode(t) {
|
|
17422
17432
|
return this.getSymbols()[0].ssr ? "fxaa" === t || "fxaaAfterTaa" === t : super.supportRenderMode(t);
|
|
17423
17433
|
}
|
|
17424
17434
|
isAnimating() {
|
|
17425
|
-
const t = this
|
|
17435
|
+
const t = this.$a();
|
|
17426
17436
|
if (t && (t[0] || t[1])) return !0;
|
|
17427
17437
|
}
|
|
17428
17438
|
needToRedraw() {
|
|
17429
|
-
const t = this
|
|
17439
|
+
const t = this.$a();
|
|
17430
17440
|
return !(!t || !t[0] && !t[1]) || super.needToRedraw();
|
|
17431
17441
|
}
|
|
17432
|
-
|
|
17442
|
+
$a() {
|
|
17433
17443
|
const t = this.getSymbols()[0];
|
|
17434
17444
|
return t.material && t.material.uvOffsetAnim;
|
|
17435
17445
|
}
|
|
@@ -17440,7 +17450,7 @@
|
|
|
17440
17450
|
};
|
|
17441
17451
|
t.aAltitude && (e.altitudeAttribute = "aAltitude");
|
|
17442
17452
|
const i = new n.reshader.Geometry(t.data, t.indices, 0, e);
|
|
17443
|
-
return
|
|
17453
|
+
return Ll(i.properties, t.properties), t.vertexColors && (i.properties.vertexColors = t.vertexColors),
|
|
17444
17454
|
this.material.uniforms.normalTexture && !i.data[i.desc.tangentAttribute] && i.data[i.desc.uv0Attribute] && (i.data[i.desc.normalAttribute] || i.createNormal(),
|
|
17445
17455
|
i.createTangent()), this.Vs(i, t), {
|
|
17446
17456
|
geometry: i,
|
|
@@ -17452,32 +17462,32 @@
|
|
|
17452
17462
|
paint(t) {
|
|
17453
17463
|
const e = !!t.shadow;
|
|
17454
17464
|
t.states && t.states.includesChanged && (this.shader.dispose(), delete this.shader,
|
|
17455
|
-
this
|
|
17465
|
+
this.Xa.dispose(), delete this.Xa, this.Ys(t));
|
|
17456
17466
|
let n = !!t.ssr && this.getSymbols()[0].ssr;
|
|
17457
17467
|
const i = this.shader, r = i.shaderDefines;
|
|
17458
17468
|
if (n) {
|
|
17459
|
-
const e =
|
|
17469
|
+
const e = Ll({}, r, t.ssr.defines);
|
|
17460
17470
|
i.shaderDefines = e;
|
|
17461
17471
|
}
|
|
17462
|
-
if (t.onlyUpdateDepthInTaa && (this.shader = this
|
|
17472
|
+
if (t.onlyUpdateDepthInTaa && (this.shader = this.Xa, !n && this.Ya && (this.shader = i,
|
|
17463
17473
|
this.setToRedraw(!0))), this.updateIBLDefines(i), super.paint(t), void 0 !== this.shadowCount && e) {
|
|
17464
17474
|
const t = this.scene.getMeshes().length;
|
|
17465
17475
|
this.shadowCount !== t && this.setToRedraw();
|
|
17466
17476
|
}
|
|
17467
|
-
this.shader = i, n && (i.shaderDefines = r), delete this.shadowCount, this.
|
|
17477
|
+
this.shader = i, n && (i.shaderDefines = r), delete this.shadowCount, this.Ya = n;
|
|
17468
17478
|
}
|
|
17469
17479
|
updateSceneConfig(t) {
|
|
17470
|
-
|
|
17480
|
+
Ll(this.sceneConfig, t), this.setToRedraw();
|
|
17471
17481
|
}
|
|
17472
17482
|
delete() {
|
|
17473
|
-
super.delete(), this.disposeIBLTextures(), this.material.dispose(), this
|
|
17474
|
-
delete this
|
|
17483
|
+
super.delete(), this.disposeIBLTextures(), this.material.dispose(), this.Xa && (this.Xa.dispose(),
|
|
17484
|
+
delete this.Xa);
|
|
17475
17485
|
}
|
|
17476
17486
|
init(t) {
|
|
17477
|
-
this.getMap().on("updatelights", this.
|
|
17487
|
+
this.getMap().on("updatelights", this.qa, this), this.createIBLTextures(), this.Zs = this.Zs || t;
|
|
17478
17488
|
const e = this.regl;
|
|
17479
|
-
this.renderer = new n.reshader.Renderer(e), this.
|
|
17480
|
-
this.
|
|
17489
|
+
this.renderer = new n.reshader.Renderer(e), this.Ja = this.Ka.bind(this), this.Za = this.disposeCachedTexture.bind(this),
|
|
17490
|
+
this.Qa = this.el.bind(this), this.Wr(), this.Ys(t);
|
|
17481
17491
|
const i = {
|
|
17482
17492
|
vert: "\n #include <gl2_vert>\n attribute vec3 aPosition;\n uniform mat4 projViewModelMatrix;\n uniform mat4 positionMatrix;\n //引入fbo picking的vert相关函数\n #include <line_extrusion_vert>\n #include <get_output>\n #include <fbo_picking_vert>\n void main() {\n mat4 localPositionMatrix = getPositionMatrix();\n #ifdef IS_LINE_EXTRUSION\n vec3 linePosition = getLineExtrudePosition(aPosition);\n vec4 localVertex = getPosition(linePosition);\n #else\n vec4 localVertex = getPosition(aPosition);\n #endif\n\n gl_Position = projViewModelMatrix * localPositionMatrix * localVertex;\n fbo_picking_setData(gl_Position.w, true);\n }\n ",
|
|
17483
17493
|
uniforms: [ {
|
|
@@ -17539,23 +17549,23 @@
|
|
|
17539
17549
|
}
|
|
17540
17550
|
}, o = {
|
|
17541
17551
|
uniforms: r,
|
|
17542
|
-
defines: this.
|
|
17552
|
+
defines: this.nl(i),
|
|
17543
17553
|
extraCommandProps: s
|
|
17544
17554
|
};
|
|
17545
17555
|
this.shader = new n.reshader.pbr.StandardShader(o), o.frag = "\n precision mediump float;\n #include <gl2_frag>\n void main() {\n glFragColor = vec4(0.0);\n #if __VERSION__ == 100\n gl_FragColor = glFragColor;\n #endif\n }\n ",
|
|
17546
|
-
this
|
|
17556
|
+
this.Xa = new n.reshader.pbr.StandardShader(o);
|
|
17547
17557
|
}
|
|
17548
|
-
|
|
17558
|
+
Ka({resources: t}) {
|
|
17549
17559
|
for (let e = 0; e < t.length; e++) this.addCachedTexture(t[e].url, t[e].data);
|
|
17550
17560
|
this.setToRedraw(!0);
|
|
17551
17561
|
}
|
|
17552
|
-
|
|
17562
|
+
el() {
|
|
17553
17563
|
this.setToRedraw(!0);
|
|
17554
17564
|
}
|
|
17555
17565
|
Wr(t) {
|
|
17556
17566
|
if (t) {
|
|
17557
17567
|
const e = this.getSymbols()[0].material;
|
|
17558
|
-
e &&
|
|
17568
|
+
e && Ll(e, t);
|
|
17559
17569
|
}
|
|
17560
17570
|
const e = this.dataConfig, i = t || this.getSymbols()[0].material, r = {};
|
|
17561
17571
|
let s = !1;
|
|
@@ -17576,33 +17586,33 @@
|
|
|
17576
17586
|
url: a,
|
|
17577
17587
|
wrap: "repeat"
|
|
17578
17588
|
}), o.flipY = !e.upsideUpTexture, o.min = "linear mipmap linear", o.mag = "linear",
|
|
17579
|
-
r[t] = new n.reshader.Texture2D(o, this.
|
|
17589
|
+
r[t] = new n.reshader.Texture2D(o, this.Wa), r[t].once("complete", this.Ja), r[t].once("disposed", this.Za),
|
|
17580
17590
|
r[t].promise && this.addCachedTexture(a, r[t].promise), s = !0;
|
|
17581
17591
|
} else r[t] = i[t];
|
|
17582
17592
|
if (void 0 === r.alphaTest && this.getMaterialClazz && (r.alphaTest = .05), this.material) {
|
|
17583
17593
|
for (let t in r) this.material.set(t, r[t]);
|
|
17584
17594
|
this.setToRedraw(!0);
|
|
17585
|
-
} else this.material = new n.reshader.pbr.StandardMaterial(r), this.material.once("complete", this.
|
|
17586
|
-
s || this.
|
|
17595
|
+
} else this.material = new n.reshader.pbr.StandardMaterial(r), this.material.once("complete", this.Qa);
|
|
17596
|
+
s || this.el();
|
|
17587
17597
|
}
|
|
17588
17598
|
getShader() {
|
|
17589
17599
|
return this.shader;
|
|
17590
17600
|
}
|
|
17591
17601
|
getUniformValues(t, e) {
|
|
17592
|
-
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);
|
|
17593
17603
|
return this.setIncludeUniformValues(r, e), r;
|
|
17594
17604
|
}
|
|
17595
|
-
|
|
17605
|
+
nl(t) {
|
|
17596
17606
|
return this.hasIBL() ? t.HAS_IBL_LIGHTING = 1 : delete t.HAS_IBL_LIGHTING, t;
|
|
17597
17607
|
}
|
|
17598
|
-
|
|
17608
|
+
qa() {
|
|
17599
17609
|
if (!this.shader) return;
|
|
17600
17610
|
const t = this.shader.shaderDefines;
|
|
17601
|
-
this.
|
|
17611
|
+
this.nl(t), this.shader.shaderDefines = t;
|
|
17602
17612
|
}
|
|
17603
17613
|
}
|
|
17604
|
-
var
|
|
17605
|
-
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;
|
|
17606
17616
|
class Ly extends Df {
|
|
17607
17617
|
needToRedraw() {
|
|
17608
17618
|
return super.needToRedraw() || this.isAnimating();
|
|
@@ -17669,12 +17679,12 @@
|
|
|
17669
17679
|
super.paint(t);
|
|
17670
17680
|
}
|
|
17671
17681
|
init(t) {
|
|
17672
|
-
this.getMap().on("updatelights", this.
|
|
17682
|
+
this.getMap().on("updatelights", this.qa, this), this.createIBLTextures();
|
|
17673
17683
|
const e = this.regl;
|
|
17674
17684
|
if (this.renderer = new n.reshader.Renderer(e), this.createShader(t), this.pickingFBO) {
|
|
17675
17685
|
const t = [];
|
|
17676
17686
|
this.picking = [ new n.reshader.FBORayPicking(this.renderer, {
|
|
17677
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
17687
|
+
vert: "#define PICKING_MODE 1\n" + Ry,
|
|
17678
17688
|
uniforms: [ {
|
|
17679
17689
|
name: "projViewModelMatrix",
|
|
17680
17690
|
type: "function",
|
|
@@ -17702,9 +17712,9 @@
|
|
|
17702
17712
|
return n.mat4.multiply(i, e.projViewMatrix, e.modelMatrix), i;
|
|
17703
17713
|
}
|
|
17704
17714
|
}), this.shader = new n.reshader.pbr.StandardShader({
|
|
17705
|
-
vert:
|
|
17715
|
+
vert: Ry,
|
|
17706
17716
|
uniforms: e,
|
|
17707
|
-
defines: this.
|
|
17717
|
+
defines: this.nl(i),
|
|
17708
17718
|
extraCommandProps: this.getExtraCommandProps()
|
|
17709
17719
|
});
|
|
17710
17720
|
}
|
|
@@ -17751,7 +17761,7 @@
|
|
|
17751
17761
|
};
|
|
17752
17762
|
}
|
|
17753
17763
|
getUniformValues(t, e) {
|
|
17754
|
-
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;
|
|
17755
17765
|
return r.projViewMatrix = s, r.viewMatrix = o, r.resolution = t.getResolution(),
|
|
17756
17766
|
r.currentTime = this.layer.getRenderer().getFrameTimestamp() || 0, this.setIncludeUniformValues(r, e),
|
|
17757
17767
|
r;
|
|
@@ -17819,28 +17829,28 @@
|
|
|
17819
17829
|
}
|
|
17820
17830
|
} ];
|
|
17821
17831
|
}
|
|
17822
|
-
|
|
17832
|
+
nl(t) {
|
|
17823
17833
|
return this.hasIBL() ? t.HAS_IBL_LIGHTING = 1 : delete t.HAS_IBL_LIGHTING, t;
|
|
17824
17834
|
}
|
|
17825
|
-
|
|
17835
|
+
qa() {
|
|
17826
17836
|
if (!this.shader) return;
|
|
17827
17837
|
const t = this.shader.shaderDefines;
|
|
17828
|
-
this.
|
|
17838
|
+
this.nl(t), this.shader.shaderDefines = t;
|
|
17829
17839
|
}
|
|
17830
17840
|
delete() {
|
|
17831
17841
|
super.delete(), this.disposeIBLTextures(), this.shader && (this.shader.dispose(),
|
|
17832
17842
|
delete this.shader);
|
|
17833
17843
|
}
|
|
17834
17844
|
}
|
|
17835
|
-
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 {
|
|
17836
17846
|
constructor(t, e, i, r, s, o) {
|
|
17837
|
-
super(t, e, i, r, s, o), this.
|
|
17838
|
-
this.
|
|
17847
|
+
super(t, e, i, r, s, o), this.il = !1, this.scene.sortFunction = this.sortByCommandKey,
|
|
17848
|
+
this.rl = new n.reshader.GLTFManager(t), this.sl(), this.ol();
|
|
17839
17849
|
}
|
|
17840
17850
|
isAnimating() {
|
|
17841
17851
|
const t = this.getSymbols();
|
|
17842
17852
|
for (let e = 0; e < t.length; e++) {
|
|
17843
|
-
if (t[e] && this.
|
|
17853
|
+
if (t[e] && this.al[e] && this.ll(e)) return !0;
|
|
17844
17854
|
}
|
|
17845
17855
|
return !1;
|
|
17846
17856
|
}
|
|
@@ -17848,7 +17858,7 @@
|
|
|
17848
17858
|
const {data: n, positionSize: i} = t;
|
|
17849
17859
|
return {
|
|
17850
17860
|
geometry: {
|
|
17851
|
-
properties:
|
|
17861
|
+
properties: Ll({}, t.properties),
|
|
17852
17862
|
data: n,
|
|
17853
17863
|
positionSize: i,
|
|
17854
17864
|
features: e
|
|
@@ -17857,10 +17867,10 @@
|
|
|
17857
17867
|
};
|
|
17858
17868
|
}
|
|
17859
17869
|
getFnTypeConfig() {
|
|
17860
|
-
return
|
|
17870
|
+
return Xy;
|
|
17861
17871
|
}
|
|
17862
17872
|
createMesh(t, e, {tileTranslationMatrix: i, tileExtent: r}, {timestamp: s}) {
|
|
17863
|
-
if (!this.
|
|
17873
|
+
if (!this.il) return null;
|
|
17864
17874
|
const o = this.getMap(), {geometry: a} = t, {positionSize: l, features: h} = a, {aPosition: u, aPickingId: c, aXYRotation: f, aZRotation: d, aAltitude: p} = a.data, y = u.length / l;
|
|
17865
17875
|
if (0 === y) return null;
|
|
17866
17876
|
const m = {
|
|
@@ -17868,7 +17878,7 @@
|
|
|
17868
17878
|
instance_vectorB: new Float32Array(4 * y),
|
|
17869
17879
|
instance_vectorC: new Float32Array(4 * y),
|
|
17870
17880
|
aPickingId: []
|
|
17871
|
-
}, g = this.
|
|
17881
|
+
}, g = this.hl(m, i, r, a.properties.z, u, p, f, d, l, c, h);
|
|
17872
17882
|
a.data.aTerrainAltitude && (m.aTerrainAltitude = a.data.aTerrainAltitude);
|
|
17873
17883
|
const v = {};
|
|
17874
17884
|
for (const t in m) v[t] = {
|
|
@@ -17878,22 +17888,22 @@
|
|
|
17878
17888
|
}),
|
|
17879
17889
|
divisor: 1
|
|
17880
17890
|
};
|
|
17881
|
-
const x = this.
|
|
17891
|
+
const x = this.ul(), b = this.cl(), w = n.mat4.identity([]);
|
|
17882
17892
|
n.mat4.scale(w, w, [ b, b, b ]);
|
|
17883
17893
|
const A = [], M = this.getSymbols();
|
|
17884
17894
|
for (let t = 0; t < M.length; t++) {
|
|
17885
|
-
const e = M[t], r = this.
|
|
17895
|
+
const e = M[t], r = this.fl[t];
|
|
17886
17896
|
if (!r) continue;
|
|
17887
|
-
const l = this.
|
|
17897
|
+
const l = this.al[t][0], {fixSizeOnZoom: h} = e;
|
|
17888
17898
|
let u = n.mat4.identity([]);
|
|
17889
|
-
x || (u = this.
|
|
17899
|
+
x || (u = this.dl(u));
|
|
17890
17900
|
let c = 0;
|
|
17891
17901
|
r.forEach(t => {
|
|
17892
17902
|
const {geometry: i, nodeMatrix: r} = t;
|
|
17893
|
-
n.mat4.multiply(
|
|
17894
|
-
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();
|
|
17895
17905
|
o.transform(s);
|
|
17896
|
-
const a = this.
|
|
17906
|
+
const a = this.pl(o, e);
|
|
17897
17907
|
Math.abs(a) > Math.abs(c) && (c = a);
|
|
17898
17908
|
});
|
|
17899
17909
|
const f = [ 0, 0, c ], d = r.map((r, d) => {
|
|
@@ -17904,21 +17914,21 @@
|
|
|
17904
17914
|
picking: !0
|
|
17905
17915
|
});
|
|
17906
17916
|
if (l.hasSkinAnimation()) {
|
|
17907
|
-
const e = this.
|
|
17917
|
+
const e = this.yl(k, t, 0)[M];
|
|
17908
17918
|
k.setUniform("jointTexture", e.jointTexture), k.setUniform("jointTextureSize", e.jointTextureSize),
|
|
17909
|
-
k.setUniform("numJoints", e.numJoints), k.setUniform("skinAnimation", +this.
|
|
17919
|
+
k.setUniform("numJoints", e.numJoints), k.setUniform("skinAnimation", +this.ll(t)),
|
|
17910
17920
|
k.properties.startTime = s, S.HAS_SKIN = 1;
|
|
17911
17921
|
}
|
|
17912
17922
|
b && (k.setUniform("morphWeights", b), S.HAS_MORPH = 1), k.setUniform("hasAlpha", A.alphaMode && "BLEND" === A.alphaMode.toUpperCase()),
|
|
17913
|
-
Bl(k.uniforms, "polygonFill", e, "markerFill",
|
|
17923
|
+
Bl(k.uniforms, "polygonFill", e, "markerFill", Yy, $l(this.colorCache)), Bl(k.uniforms, "polygonOpacity", e, "markerOpacity", 1);
|
|
17914
17924
|
const P = [];
|
|
17915
17925
|
k.setPositionMatrix(() => {
|
|
17916
|
-
const e = this.
|
|
17917
|
-
n.mat4.multiply(P,
|
|
17918
|
-
const i = n.mat4.identity(
|
|
17926
|
+
const e = this.ml(t, d, M);
|
|
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);
|
|
17919
17929
|
if (0 !== c && (n.mat4.fromTranslation(i, f), n.mat4.multiply(P, i, P)), ql(h)) {
|
|
17920
17930
|
const t = o.getGLScale() / o.getGLScale(h);
|
|
17921
|
-
return n.vec3.set(
|
|
17931
|
+
return n.vec3.set(Hy, t, t, t), n.mat4.fromScaling(i, Hy), n.mat4.multiply(i, i, P);
|
|
17922
17932
|
}
|
|
17923
17933
|
return P;
|
|
17924
17934
|
});
|
|
@@ -17930,7 +17940,7 @@
|
|
|
17930
17940
|
excludeElementsInVAO: !0
|
|
17931
17941
|
}), m.instance_color && (S.HAS_INSTANCE_COLOR = 1), m.aTerrainAltitude && (S.HAS_INSTANCE_TERRAIN_ALTITUDE = 1,
|
|
17932
17942
|
k.setUniform("terrainAltitudeScale", 100 * this.layer.getRenderer().getZScale())),
|
|
17933
|
-
S.HAS_LAYER_OPACITY = 1,
|
|
17943
|
+
S.HAS_LAYER_OPACITY = 1, Ll(k.properties, a.properties), k.setDefines(S), k.properties.symbolIndex = {
|
|
17934
17944
|
index: t
|
|
17935
17945
|
}, k;
|
|
17936
17946
|
});
|
|
@@ -17944,19 +17954,19 @@
|
|
|
17944
17954
|
positionSize: l
|
|
17945
17955
|
}, A;
|
|
17946
17956
|
}
|
|
17957
|
+
ml(t, e, n) {
|
|
17958
|
+
const i = t, r = this.fl[i][e];
|
|
17959
|
+
return this.ll(t) && this.vl && this.vl[n] || r.nodeMatrix;
|
|
17960
|
+
}
|
|
17947
17961
|
yl(t, e, n) {
|
|
17948
|
-
|
|
17949
|
-
|
|
17950
|
-
|
|
17951
|
-
|
|
17952
|
-
|
|
17953
|
-
|
|
17954
|
-
|
|
17955
|
-
|
|
17956
|
-
return i.updateAnimation(n, o || !1, a || 1, h, t.properties.startTime || 0, this.ml, this.vl[t.uuid]),
|
|
17957
|
-
this.vl[t.uuid];
|
|
17958
|
-
}
|
|
17959
|
-
dl(t, e) {
|
|
17962
|
+
if (!this.al) return;
|
|
17963
|
+
const i = this.al[e][0];
|
|
17964
|
+
this.xl || (this.xl = {}), this.vl = {}, this.xl[t.uuid] || (this.xl[t.uuid] = {});
|
|
17965
|
+
const r = this.getSymbols()[e], s = this.wl[e], {loop: o, speed: a, animationName: l} = r, h = l || s.animations[0].name;
|
|
17966
|
+
return i.updateAnimation(n, o || !1, a || 1, h, t.properties.startTime || 0, this.vl, this.xl[t.uuid]),
|
|
17967
|
+
this.xl[t.uuid];
|
|
17968
|
+
}
|
|
17969
|
+
pl(t, e) {
|
|
17960
17970
|
const n = e.anchorZ || "center";
|
|
17961
17971
|
let i = 0;
|
|
17962
17972
|
const r = t.max[2] - t.min[2];
|
|
@@ -17969,8 +17979,8 @@
|
|
|
17969
17979
|
for (let e = 0; e < t.length; e++) {
|
|
17970
17980
|
if (!t[e] || !t[e].geometry) continue;
|
|
17971
17981
|
t[e].instancedData.aTerrainAltitude && this.gs(t[e], t[e].instancedData, t[e].properties, 3, n);
|
|
17972
|
-
const r = t[e].properties.symbolIndex.index, s = this.
|
|
17973
|
-
s && this.
|
|
17982
|
+
const r = t[e].properties.symbolIndex.index, s = this.ll(r);
|
|
17983
|
+
s && this.yl(t[e], r, i), t[e].setUniform("skinAnimation", +s);
|
|
17974
17984
|
}
|
|
17975
17985
|
return this.scene.addMesh(t), this;
|
|
17976
17986
|
}
|
|
@@ -17981,8 +17991,8 @@
|
|
|
17981
17991
|
const e = this.getSymbols();
|
|
17982
17992
|
let n = !1;
|
|
17983
17993
|
for (let t = 0; t < e.length; t++) {
|
|
17984
|
-
if (!e[t] || !this.
|
|
17985
|
-
if (this.
|
|
17994
|
+
if (!e[t] || !this.al[t]) continue;
|
|
17995
|
+
if (this.ll(t) && this.al[t] && !n) {
|
|
17986
17996
|
n = !0;
|
|
17987
17997
|
break;
|
|
17988
17998
|
}
|
|
@@ -17990,15 +18000,15 @@
|
|
|
17990
18000
|
n && this.setToRedraw(!0), super.prepareRender(t);
|
|
17991
18001
|
}
|
|
17992
18002
|
getShadowMeshes() {
|
|
17993
|
-
if (!this.isVisible()) return
|
|
18003
|
+
if (!this.isVisible()) return Xy;
|
|
17994
18004
|
this.shadowCount = this.scene.getMeshes().length;
|
|
17995
18005
|
return this.scene.getMeshes().filter(t => 0 === t.properties.level);
|
|
17996
18006
|
}
|
|
17997
|
-
|
|
18007
|
+
ll(t) {
|
|
17998
18008
|
const e = this.getSymbols()[t];
|
|
17999
|
-
return !!(e && e.animation && this.
|
|
18009
|
+
return !!(e && e.animation && this.al[t] && this.al[t][0] && this.al[t][0].hasSkinAnimation());
|
|
18000
18010
|
}
|
|
18001
|
-
|
|
18011
|
+
hl(t, e, i, r, s, o, a, l, h, u, c) {
|
|
18002
18012
|
function f(e, n, i, r) {
|
|
18003
18013
|
t[e][4 * n] = i[r], t[e][4 * n + 1] = i[r + 4], t[e][4 * n + 2] = i[r + 8], t[e][4 * n + 3] = i[r + 12];
|
|
18004
18014
|
}
|
|
@@ -18011,19 +18021,19 @@
|
|
|
18011
18021
|
e[0] < g && (g = e[0]), e[0] > b && (b = e[0]), e[1] < v && (v = e[1]), e[1] > w && (w = e[1]),
|
|
18012
18022
|
e[2] < x && (x = e[2]), e[2] > A && (A = e[2]);
|
|
18013
18023
|
}
|
|
18014
|
-
const S = (g + b) / 2, k = (v + w) / 2, P = (x + A) / 2, T = [], F = this.
|
|
18024
|
+
const S = (g + b) / 2, k = (v + w) / 2, P = (x + A) / 2, T = [], F = this.ul(), O = [ 0, 0, 1 ];
|
|
18015
18025
|
for (let e = 0; e < d; e++) {
|
|
18016
18026
|
o ? n.vec3.set(_, s[e * h], s[e * h + 1], o[e]) : fl.unpackPosition(_, s[e * h], s[e * h + 1], s[e * h + 2]);
|
|
18017
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;
|
|
18018
18028
|
if (g || v) {
|
|
18019
18029
|
n.mat4.fromRotation(T, v, O);
|
|
18020
|
-
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));
|
|
18021
18031
|
n.mat4.rotate(T, T, g, e);
|
|
18022
|
-
const s = n.mat4.fromTranslation(
|
|
18032
|
+
const s = n.mat4.fromTranslation(qy, d);
|
|
18023
18033
|
n.mat4.multiply(T, s, T);
|
|
18024
18034
|
} else n.mat4.fromTranslation(T, d);
|
|
18025
18035
|
if (F) {
|
|
18026
|
-
const t = this.
|
|
18036
|
+
const t = this.dl(qy, c, u, e);
|
|
18027
18037
|
n.mat4.multiply(T, T, t);
|
|
18028
18038
|
}
|
|
18029
18039
|
f("instance_vectorA", e, T, 0), f("instance_vectorB", e, T, 1), f("instance_vectorC", e, T, 2),
|
|
@@ -18031,30 +18041,30 @@
|
|
|
18031
18041
|
}
|
|
18032
18042
|
return n.vec3.set(M, S, k, P), M;
|
|
18033
18043
|
}
|
|
18034
|
-
|
|
18035
|
-
if (!this.
|
|
18044
|
+
cl() {
|
|
18045
|
+
if (!this.Al) {
|
|
18036
18046
|
const t = this.getMap();
|
|
18037
|
-
this.
|
|
18047
|
+
this.Al = 100 * R(t.getGLRes(), t);
|
|
18038
18048
|
}
|
|
18039
|
-
return this.
|
|
18049
|
+
return this.Al;
|
|
18040
18050
|
}
|
|
18041
|
-
|
|
18042
|
-
const s = this.getMap(), o = this.symbolDef[0], a = this.
|
|
18051
|
+
dl(t, e, i, r) {
|
|
18052
|
+
const s = this.getMap(), o = this.symbolDef[0], a = this.cl();
|
|
18043
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;
|
|
18044
|
-
const g = i && i[r], v = e && e[g], x = s.getZoom(), b = v && v.feature && v.feature.properties, w = this.
|
|
18045
|
-
this.
|
|
18046
|
-
const A = n.vec3.set(
|
|
18047
|
-
this.
|
|
18048
|
-
const M = n.vec3.set(
|
|
18049
|
-
this.
|
|
18050
|
-
const _ = n.vec3.set(
|
|
18051
|
-
return this.
|
|
18052
|
-
}
|
|
18053
|
-
|
|
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);
|
|
18055
|
+
this._l && (l = this._l(x, b)), this.Sl && (h = this.Sl(x, b)), this.kl && (u = this.kl(x, b));
|
|
18056
|
+
const A = n.vec3.set(Uy, l * a, h * a, u * a);
|
|
18057
|
+
this.Pl && (c = this.Pl(x, b)), this.Tl && (f = this.Tl(x, b)), this.Fl && (d = this.Fl(x, b));
|
|
18058
|
+
const M = n.vec3.set(Vy, c, f, d);
|
|
18059
|
+
this.Ol && (p = this.Ol(x, b)), this.Il && (y = this.Il(x, b)), this.Cl && (m = this.Cl(x, b));
|
|
18060
|
+
const _ = n.vec3.set(jy, p * w, y * w, m * w);
|
|
18061
|
+
return this.El(t, A, M, _);
|
|
18062
|
+
}
|
|
18063
|
+
Ml(t, e) {
|
|
18054
18064
|
const n = this.symbolDef[0];
|
|
18055
|
-
let i = this.
|
|
18065
|
+
let i = this.Dl ? this.Dl(t, e) : n.modelHeight;
|
|
18056
18066
|
if (C(i)) return 1;
|
|
18057
|
-
const r = this.
|
|
18067
|
+
const r = this.Nl[0];
|
|
18058
18068
|
return i / Math.abs(r.max[1] - r.min[1]);
|
|
18059
18069
|
}
|
|
18060
18070
|
getShaderConfig() {
|
|
@@ -18062,40 +18072,40 @@
|
|
|
18062
18072
|
return t.positionAttribute = "POSITION", t.normalAttribute = "NORMAL", t;
|
|
18063
18073
|
}
|
|
18064
18074
|
init(t) {
|
|
18065
|
-
super.init(t), this.
|
|
18075
|
+
super.init(t), this.ol();
|
|
18066
18076
|
}
|
|
18067
|
-
|
|
18077
|
+
sl() {
|
|
18068
18078
|
const t = this.symbolDef[0];
|
|
18069
|
-
x(t.modelHeight) && (this.
|
|
18070
|
-
x(t.translationY) && (this.
|
|
18071
|
-
x(t.rotationX) && (this.
|
|
18072
|
-
x(t.rotationZ) && (this.
|
|
18073
|
-
x(t.scaleY) && (this.
|
|
18079
|
+
x(t.modelHeight) && (this.Dl = b(t.modelHeight)), x(t.translationX) && (this._l = b(t.translationX)),
|
|
18080
|
+
x(t.translationY) && (this.Sl = b(t.translationY)), x(t.translationZ) && (this.kl = b(t.translationZ)),
|
|
18081
|
+
x(t.rotationX) && (this.Pl = b(t.rotationX)), x(t.rotationY) && (this.Tl = b(t.rotationY)),
|
|
18082
|
+
x(t.rotationZ) && (this.Fl = b(t.rotationZ)), x(t.scaleX) && (this.Ol = b(t.scaleX)),
|
|
18083
|
+
x(t.scaleY) && (this.Il = b(t.scaleY)), x(t.scaleZ) && (this.Cl = b(t.scaleZ));
|
|
18074
18084
|
}
|
|
18075
|
-
|
|
18076
|
-
return !!(this.
|
|
18085
|
+
ul() {
|
|
18086
|
+
return !!(this.Dl && !this.Dl.isFeatureConstant || this._l && !this._l.isFeatureConstant || this.Sl && !this.Sl.isFeatureConstant || this.kl && !this.kl.isFeatureConstant || this.Pl && !this.Pl.isFeatureConstant || this.Tl && !this.Tl.isFeatureConstant || this.Fl && !this.Fl.isFeatureConstant || this.Ol && !this.Ol.isFeatureConstant || this.Il && !this.Il.isFeatureConstant || this.Cl && !this.Cl.isFeatureConstant);
|
|
18077
18087
|
}
|
|
18078
|
-
|
|
18079
|
-
if (this.
|
|
18080
|
-
this.
|
|
18088
|
+
ol() {
|
|
18089
|
+
if (this.al) return;
|
|
18090
|
+
this.al = [], this.wl = [], this.Nl = [], this.fl = [];
|
|
18081
18091
|
const t = this.getSymbols();
|
|
18082
|
-
this.
|
|
18092
|
+
this.Rl = 0;
|
|
18083
18093
|
for (let e = 0; e < t.length; e++) {
|
|
18084
18094
|
const n = t[e].url || "pyramid";
|
|
18085
|
-
this.
|
|
18086
|
-
const i = this.
|
|
18095
|
+
this.rl.loginGLTF(n);
|
|
18096
|
+
const i = this.rl.getGLTF(n);
|
|
18087
18097
|
if (i.then) i.then(n => {
|
|
18088
|
-
if (!n.gltfPack) return this.
|
|
18098
|
+
if (!n.gltfPack) return this.Rl++, void (this.Rl >= t.length && (this.il = !0, this.setToRedraw(!0)));
|
|
18089
18099
|
const {gltfPack: i, json: r, bbox: s} = n;
|
|
18090
|
-
this.
|
|
18091
|
-
this.
|
|
18100
|
+
this.al[e] = [ i ], this.fl[e] = i.getMeshesInfo(), this.wl[e] = r, this.Nl[e] = s,
|
|
18101
|
+
this.Rl++, this.Rl >= t.length && (this.il = !0), this.setToRedraw(!0);
|
|
18092
18102
|
}); else {
|
|
18093
18103
|
const {gltfPack: t, json: n, bbox: r} = i;
|
|
18094
|
-
t && (this.
|
|
18095
|
-
this.
|
|
18104
|
+
t && (this.al[e] = [ t ], this.fl[e] = t.getMeshesInfo(), this.wl[e] = n, this.Nl[e] = r,
|
|
18105
|
+
this.Rl++);
|
|
18096
18106
|
}
|
|
18097
18107
|
}
|
|
18098
|
-
this.
|
|
18108
|
+
this.Rl >= t.length && (this.il = !0);
|
|
18099
18109
|
}
|
|
18100
18110
|
getPickingVert() {
|
|
18101
18111
|
return "\n attribute vec3 aPosition;\n uniform mat4 projViewModelMatrix;\n uniform mat4 modelMatrix;\n uniform mat4 positionMatrix;\n //引入fbo picking的vert相关函数\n #include <fbo_picking_vert>\n #include <get_output>\n void main()\n {\n mat4 localPositionMatrix = getPositionMatrix();\n vec4 localPosition = getPosition(aPosition);\n\n gl_Position = projViewModelMatrix * localPositionMatrix * localPosition;\n //传入gl_Position的depth值\n fbo_picking_setData(gl_Position.w, true);\n }";
|
|
@@ -18104,10 +18114,10 @@
|
|
|
18104
18114
|
if (t) {
|
|
18105
18115
|
this.scene.removeMesh(t);
|
|
18106
18116
|
for (let e = 0; e < t.length; e++) {
|
|
18107
|
-
const n = this.
|
|
18117
|
+
const n = this.xl && this.xl[t[e].uuid];
|
|
18108
18118
|
if (n) {
|
|
18109
18119
|
for (const t in n) n[t].jointTexture && n[t].jointTexture.destroy();
|
|
18110
|
-
delete this.
|
|
18120
|
+
delete this.xl[t[e].uuid];
|
|
18111
18121
|
}
|
|
18112
18122
|
t[e].disposeInstanceData(), t[e].dispose();
|
|
18113
18123
|
}
|
|
@@ -18118,39 +18128,39 @@
|
|
|
18118
18128
|
const t = this.getSymbols();
|
|
18119
18129
|
for (let e = 0; e < t.length; e++) {
|
|
18120
18130
|
const n = t[e].url || "pyramid";
|
|
18121
|
-
this.
|
|
18131
|
+
this.rl.logoutGLTF(n);
|
|
18122
18132
|
}
|
|
18123
|
-
if (this.
|
|
18124
|
-
for (const t in this.
|
|
18125
|
-
const e = this.
|
|
18133
|
+
if (this.xl) {
|
|
18134
|
+
for (const t in this.xl) {
|
|
18135
|
+
const e = this.xl[t];
|
|
18126
18136
|
for (const t in e) e[t].jointTexture && e[t].jointTexture.destroy();
|
|
18127
18137
|
}
|
|
18128
|
-
delete this.
|
|
18138
|
+
delete this.xl;
|
|
18129
18139
|
}
|
|
18130
|
-
delete this.
|
|
18140
|
+
delete this.vl;
|
|
18131
18141
|
}
|
|
18132
|
-
|
|
18133
|
-
const s = n.vec3.set(
|
|
18142
|
+
El(t, e, i, r) {
|
|
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]);
|
|
18134
18144
|
return n.mat4.fromRotationTranslationScale(t, l, s, a);
|
|
18135
18145
|
}
|
|
18136
18146
|
};
|
|
18137
|
-
class
|
|
18147
|
+
class Zy extends(Ky(Iy)){
|
|
18138
18148
|
getMaterialClazz(t) {
|
|
18139
18149
|
return t.diffuseFactor ? n.reshader.PhongSpecularGlossinessMaterial : n.reshader.PhongMaterial;
|
|
18140
18150
|
}
|
|
18141
18151
|
}
|
|
18142
|
-
class
|
|
18152
|
+
class Qy extends(Ky(Ny)){
|
|
18143
18153
|
getMaterialClazz(t) {
|
|
18144
18154
|
return t.specularGlossinessTexture || t.diffuseTexture ? n.reshader.pbr.StandardSpecularGlossinessMaterial : n.reshader.pbr.StandardMaterial;
|
|
18145
18155
|
}
|
|
18146
18156
|
}
|
|
18147
|
-
const {getPBRUniforms:
|
|
18157
|
+
const {getPBRUniforms: tm} = n.reshader.pbr.PBRUtils, em = {
|
|
18148
18158
|
color: [ 2.0303, 2.028, 2.028 ],
|
|
18149
18159
|
direction: [ 0, -.2717, -1 ]
|
|
18150
|
-
},
|
|
18160
|
+
}, nm = {
|
|
18151
18161
|
index: 0
|
|
18152
|
-
},
|
|
18153
|
-
class
|
|
18162
|
+
}, im = [ 0, 0, 0 ], rm = [ 2, 2 ];
|
|
18163
|
+
class sm extends Df {
|
|
18154
18164
|
supportRenderMode(t) {
|
|
18155
18165
|
return "fxaa" === t || "fxaaBeforeTaa" === t;
|
|
18156
18166
|
}
|
|
@@ -18165,7 +18175,7 @@
|
|
|
18165
18175
|
}
|
|
18166
18176
|
needToRedraw() {
|
|
18167
18177
|
if (super.needToRedraw()) return !0;
|
|
18168
|
-
return this.getSymbol(
|
|
18178
|
+
return this.getSymbol(nm).animation;
|
|
18169
18179
|
}
|
|
18170
18180
|
createMesh(t, e) {
|
|
18171
18181
|
const {geometry: i} = t;
|
|
@@ -18174,29 +18184,29 @@
|
|
|
18174
18184
|
castShadow: !1,
|
|
18175
18185
|
picking: !0
|
|
18176
18186
|
});
|
|
18177
|
-
return r.properties.symbolIndex =
|
|
18187
|
+
return r.properties.symbolIndex = nm, r.setLocalTransform(e), r;
|
|
18178
18188
|
}
|
|
18179
18189
|
callShader(t, e) {
|
|
18180
18190
|
super.callShader(t, e), this.transformWater();
|
|
18181
|
-
const n = this.
|
|
18182
|
-
this.xs += this.renderer.render(this.Ll, n, this.
|
|
18191
|
+
const n = this.zl(this.getMap(), e);
|
|
18192
|
+
this.xs += this.renderer.render(this.Ll, n, this.Hl, this.getRenderFBO(e));
|
|
18183
18193
|
}
|
|
18184
18194
|
addMesh(t, e) {
|
|
18185
18195
|
this.Ks(t, e), super.addMesh(...arguments);
|
|
18186
18196
|
}
|
|
18187
18197
|
Ks(t) {
|
|
18188
|
-
const e = this.getSymbol(
|
|
18198
|
+
const e = this.getSymbol(nm).ssr;
|
|
18189
18199
|
for (let n = 0; n < t.length; n++) t[n].ssr = e ? 1 : 0;
|
|
18190
18200
|
}
|
|
18191
18201
|
paint(t) {
|
|
18192
18202
|
t.states && t.states.includesChanged && (this.shader.dispose(), this.Ll.dispose(),
|
|
18193
18203
|
this.Ys(t));
|
|
18194
|
-
const e = !!t.ssr && this.getSymbol(
|
|
18204
|
+
const e = !!t.ssr && this.getSymbol(nm).ssr, n = this.Ll, i = n.shaderDefines;
|
|
18195
18205
|
if (e) {
|
|
18196
|
-
const e =
|
|
18206
|
+
const e = Ll({}, i, t.ssr.defines);
|
|
18197
18207
|
n.shaderDefines = e;
|
|
18198
18208
|
}
|
|
18199
|
-
this.updateIBLDefines(n), this.
|
|
18209
|
+
this.updateIBLDefines(n), this.Ul.ssr = e ? 1 : 0, super.paint(t), e && (n.shaderDefines = i);
|
|
18200
18210
|
}
|
|
18201
18211
|
init(t) {
|
|
18202
18212
|
this.createIBLTextures();
|
|
@@ -18214,38 +18224,38 @@
|
|
|
18214
18224
|
extraCommandProps: {
|
|
18215
18225
|
viewport: this.pickingViewport
|
|
18216
18226
|
}
|
|
18217
|
-
}, this.pickingFBO, this.getMap()) ]), this.
|
|
18227
|
+
}, this.pickingFBO, this.getMap()) ]), this.Vl();
|
|
18218
18228
|
}
|
|
18219
|
-
|
|
18229
|
+
Vl() {
|
|
18220
18230
|
const t = this.regl;
|
|
18221
|
-
this.
|
|
18231
|
+
this.jl || (this.jl = t.texture(2));
|
|
18222
18232
|
const e = this.getSymbol({
|
|
18223
18233
|
index: 0
|
|
18224
18234
|
}), n = e.texWaveNormal, i = this.getCachedTexture(n), r = this;
|
|
18225
|
-
if (i) this.
|
|
18226
|
-
this.shader && this.
|
|
18227
|
-
}, 20) : this.
|
|
18235
|
+
if (i) this.Bl || (i.isLoading ? setTimeout(() => {
|
|
18236
|
+
this.shader && this.Vl();
|
|
18237
|
+
}, 20) : this.Bl = this.Gl(t, i)); else {
|
|
18228
18238
|
const e = new Image;
|
|
18229
18239
|
e.isLoading = !0, e.onload = function() {
|
|
18230
|
-
delete this.isLoading, r.
|
|
18240
|
+
delete this.isLoading, r.Bl = r.Gl(t, this), r.setToRedraw();
|
|
18231
18241
|
}, e.onerror = () => {
|
|
18232
18242
|
console.error("invalid water wave normal texture:" + n);
|
|
18233
18243
|
}, this.addCachedTexture(n, e), e.src = n;
|
|
18234
18244
|
}
|
|
18235
18245
|
const s = e.texWavePerturbation, o = this.getCachedTexture(s);
|
|
18236
|
-
if (o) this.
|
|
18237
|
-
this.
|
|
18238
|
-
}, 20) : this.
|
|
18246
|
+
if (o) this.Wl || (o.isLoading ? setTimeout(() => {
|
|
18247
|
+
this.Vl(), this.shader;
|
|
18248
|
+
}, 20) : this.Wl = this.Gl(t, o)); else {
|
|
18239
18249
|
const e = new Image;
|
|
18240
18250
|
e.isLoading = !0, e.onload = function() {
|
|
18241
|
-
delete this.isLoading, r.
|
|
18251
|
+
delete this.isLoading, r.Wl = r.Gl(t, this), r.setToRedraw();
|
|
18242
18252
|
}, e.onerror = () => {
|
|
18243
18253
|
console.error("invalid water wave perturbation texture:" + s);
|
|
18244
18254
|
}, this.addCachedTexture(s, e), e.src = s;
|
|
18245
18255
|
}
|
|
18246
18256
|
}
|
|
18247
|
-
|
|
18248
|
-
return this.
|
|
18257
|
+
Gl(t, e) {
|
|
18258
|
+
return this.jl ? t.texture({
|
|
18249
18259
|
width: e.width,
|
|
18250
18260
|
height: e.height,
|
|
18251
18261
|
mag: "linear",
|
|
@@ -18367,82 +18377,82 @@
|
|
|
18367
18377
|
projViewMatrix: t.projViewMatrix
|
|
18368
18378
|
};
|
|
18369
18379
|
}
|
|
18370
|
-
|
|
18371
|
-
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();
|
|
18372
18382
|
let a = o && o.getDirectionalLight() || {};
|
|
18373
|
-
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 || [];
|
|
18374
18384
|
n.vec4.set(c, .09, h.uvScale || 3, .03, -.5);
|
|
18375
|
-
|
|
18385
|
+
Ll(s, {
|
|
18376
18386
|
ambientColor: l.color || [ .2, .2, .2 ],
|
|
18377
18387
|
viewMatrix: t.viewMatrix,
|
|
18378
|
-
lightDirection: a.direction ||
|
|
18379
|
-
lightColor: a.color ||
|
|
18388
|
+
lightDirection: a.direction || em.direction,
|
|
18389
|
+
lightColor: a.color || em.color,
|
|
18380
18390
|
camPos: t.cameraPosition,
|
|
18381
18391
|
timeElapsed: h.animation ? (this.layer.getRenderer().getFrameTimestamp() || 0) / (1 / (h.waterSpeed || 1) * 1e4) : 0,
|
|
18382
|
-
normalTexture: this.
|
|
18383
|
-
heightTexture: this.
|
|
18392
|
+
normalTexture: this.Bl || this.jl,
|
|
18393
|
+
heightTexture: this.Wl || this.jl,
|
|
18384
18394
|
waveParams: c,
|
|
18385
|
-
waterDir:
|
|
18395
|
+
waterDir: om(u, h.waterDirection || 0),
|
|
18386
18396
|
waterBaseColor: h.waterBaseColor || [ .1451, .2588, .4863, 1 ],
|
|
18387
18397
|
contrast: h.contrast || 1,
|
|
18388
|
-
hsv: h.hsv ||
|
|
18398
|
+
hsv: h.hsv || im
|
|
18389
18399
|
});
|
|
18390
18400
|
const f = this.layer.getRenderer();
|
|
18391
|
-
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),
|
|
18392
18402
|
s;
|
|
18393
18403
|
}
|
|
18394
18404
|
delete() {
|
|
18395
|
-
super.delete(), this.
|
|
18396
|
-
this.
|
|
18397
|
-
this.Ll && this.Ll.dispose(), this.
|
|
18398
|
-
this.
|
|
18405
|
+
super.delete(), this.jl && (this.jl.destroy(), delete this.jl), this.Bl && this.Bl.destroy(),
|
|
18406
|
+
this.Wl && this.Wl.destroy(), this.shader && (this.shader.dispose(), delete this.shader),
|
|
18407
|
+
this.Ll && this.Ll.dispose(), this.Ul && (this.Ul.geometry.dispose(), this.Ul.material && this.Ul.material.dispose(),
|
|
18408
|
+
this.Ul.dispose(), delete this.Ul), this.disposeIBLTextures();
|
|
18399
18409
|
}
|
|
18400
18410
|
createGround() {
|
|
18401
18411
|
const t = new n.reshader.Plane;
|
|
18402
18412
|
t.data.aTexCoord = new Uint8Array([ 0, 1, 1, 1, 0, 0, 1, 0 ]), t.generateBuffers(this.renderer.regl),
|
|
18403
|
-
this.
|
|
18413
|
+
this.Ul = new n.reshader.Mesh(t, null, {
|
|
18404
18414
|
castShadow: !1
|
|
18405
|
-
}), this.
|
|
18415
|
+
}), this.Hl = new n.reshader.Scene([ this.Ul ]);
|
|
18406
18416
|
}
|
|
18407
18417
|
transformWater() {
|
|
18408
|
-
const t = this.getMap(), e = n.GroundPainter.getGroundTransform(this.
|
|
18409
|
-
this.
|
|
18410
|
-
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 /
|
|
18411
|
-
this.
|
|
18412
|
-
this.
|
|
18418
|
+
const t = this.getMap(), e = n.GroundPainter.getGroundTransform(this.Ul.localTransform, t);
|
|
18419
|
+
this.Ul.setLocalTransform(e);
|
|
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;
|
|
18421
|
+
this.Ul.setUniform("uvOffset", [ c, f ]), this.Ul.setUniform("noiseUvOffset", [ d, p ]),
|
|
18422
|
+
this.Ul.setUniform("uvScale", [ y, -m ]);
|
|
18413
18423
|
}
|
|
18414
18424
|
}
|
|
18415
|
-
function
|
|
18425
|
+
function om(t, e) {
|
|
18416
18426
|
return e = function(t) {
|
|
18417
18427
|
return Math.PI * t / 180;
|
|
18418
18428
|
}(e), t[0] = Math.sin(e), t[1] = Math.cos(e), t;
|
|
18419
18429
|
}
|
|
18420
|
-
const
|
|
18421
|
-
om.registerAt(_h);
|
|
18422
|
-
const am = Xc("line", Kf);
|
|
18430
|
+
const am = Xc("fill", Xf);
|
|
18423
18431
|
am.registerAt(_h);
|
|
18424
|
-
const lm = Xc("line
|
|
18432
|
+
const lm = Xc("line", Kf);
|
|
18425
18433
|
lm.registerAt(_h);
|
|
18426
|
-
const hm = Xc("
|
|
18434
|
+
const hm = Xc("line-gradient", Zf);
|
|
18427
18435
|
hm.registerAt(_h);
|
|
18428
|
-
const um = Xc("
|
|
18436
|
+
const um = Xc("icon", _p);
|
|
18429
18437
|
um.registerAt(_h);
|
|
18430
|
-
const cm = Xc("
|
|
18438
|
+
const cm = Xc("text", hy);
|
|
18431
18439
|
cm.registerAt(_h);
|
|
18432
|
-
Xc("native-
|
|
18433
|
-
const fm = Xc("phong", Oy);
|
|
18440
|
+
const fm = Xc("native-line", gy);
|
|
18434
18441
|
fm.registerAt(_h);
|
|
18435
|
-
|
|
18442
|
+
Xc("native-point", py).registerAt(_h);
|
|
18443
|
+
const dm = Xc("phong", Iy);
|
|
18436
18444
|
dm.registerAt(_h);
|
|
18437
|
-
const pm = Xc("
|
|
18445
|
+
const pm = Xc("wireframe", Ey);
|
|
18438
18446
|
pm.registerAt(_h);
|
|
18439
|
-
const ym = Xc("
|
|
18447
|
+
const ym = Xc("lit", Ny);
|
|
18440
18448
|
ym.registerAt(_h);
|
|
18441
|
-
const mm = Xc("
|
|
18449
|
+
const mm = Xc("tube", Ly);
|
|
18442
18450
|
mm.registerAt(_h);
|
|
18443
|
-
const gm = Xc("gltf-
|
|
18451
|
+
const gm = Xc("gltf-phong", Zy);
|
|
18444
18452
|
gm.registerAt(_h);
|
|
18445
|
-
const vm = Xc("
|
|
18453
|
+
const vm = Xc("gltf-lit", Qy);
|
|
18454
|
+
vm.registerAt(_h);
|
|
18455
|
+
const xm = Xc("heatmap", class extends Df {
|
|
18446
18456
|
createFnTypeConfig(t, e) {
|
|
18447
18457
|
const n = b(e.heatmapWeight), i = new Int16Array(1);
|
|
18448
18458
|
return [ {
|
|
@@ -18479,7 +18489,7 @@
|
|
|
18479
18489
|
}
|
|
18480
18490
|
callRenderer(t, e, n) {
|
|
18481
18491
|
const i = this.getRenderFBO(n);
|
|
18482
|
-
this.xs += this.
|
|
18492
|
+
this.xs += this.Yl.render(this.scene, e, i);
|
|
18483
18493
|
}
|
|
18484
18494
|
getUniformValues(t) {
|
|
18485
18495
|
const e = this.getSymbol({
|
|
@@ -18496,21 +18506,21 @@
|
|
|
18496
18506
|
return this.scene.getMeshes();
|
|
18497
18507
|
}
|
|
18498
18508
|
delete() {
|
|
18499
|
-
super.delete(...arguments), this.
|
|
18509
|
+
super.delete(...arguments), this.Yl.dispose(), delete this.Yl;
|
|
18500
18510
|
}
|
|
18501
18511
|
init() {
|
|
18502
18512
|
const t = this.regl;
|
|
18503
18513
|
this.renderer = new n.reshader.Renderer(t);
|
|
18504
18514
|
const e = this.getPolygonOffset(), i = this.getSymbols()[0];
|
|
18505
|
-
this.
|
|
18515
|
+
this.Yl = new n.HeatmapProcess(this.regl, this.sceneConfig, this.layer, i.heatmapColor, null, e);
|
|
18506
18516
|
}
|
|
18507
18517
|
});
|
|
18508
|
-
|
|
18509
|
-
const
|
|
18510
|
-
|
|
18511
|
-
|
|
18512
|
-
|
|
18513
|
-
_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";
|
|
18514
18524
|
if (s.mat4.create(), s.transcoders) {
|
|
18515
18525
|
const t = r.Map.VERSION;
|
|
18516
18526
|
if (t.indexOf("1.0.0-beta") >= 0 || t.indexOf("1.0.0-alpha") >= 0) {
|
|
@@ -18520,16 +18530,16 @@
|
|
|
18520
18530
|
return s.transcoders.inject(o);
|
|
18521
18531
|
}));
|
|
18522
18532
|
} else r.registerWorkerAdapter("@maptalks/vt", o);
|
|
18523
|
-
t.ExtrudePolygonLayer = _c, t.FillPainter = Xf, t.FillPlugin =
|
|
18524
|
-
t.GLTFPhongPlugin =
|
|
18525
|
-
t.HeatmapPlugin =
|
|
18526
|
-
t.LinePainter = Kf, t.LinePlugin =
|
|
18527
|
-
t.MapboxVectorTileLayer = Ih, t.NativeLinePainter =
|
|
18528
|
-
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,
|
|
18529
18539
|
t.PointLayer = lu, t.PolygonLayer = cu, t.SYMBOLS_NEED_REBUILD_IN_VECTOR = xl, t.SYMBOLS_NEED_REBUILD_IN_VT = vl,
|
|
18530
|
-
t.TextPainter =
|
|
18531
|
-
t.VectorTileLayer = _h, t.VectorTileLayerRenderer = ah, t.WaterPlugin =
|
|
18532
|
-
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", {
|
|
18533
18543
|
value: !0
|
|
18534
|
-
}), "undefined" != typeof console && console.log("@maptalks/vt v0.92.
|
|
18544
|
+
}), "undefined" != typeof console && console.log("@maptalks/vt v0.92.3");
|
|
18535
18545
|
}));
|