@maptalks/vt 0.86.1 → 0.86.2
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 +748 -720
- package/dist/maptalks.vt.js +1114 -1086
- package/package.json +2 -2
package/dist/maptalks.vt.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @maptalks/vt v0.86.
|
|
2
|
+
* @maptalks/vt v0.86.2
|
|
3
3
|
* LICENSE : undefined
|
|
4
4
|
* (c) 2016-2023 maptalks.org
|
|
5
5
|
*/
|
|
@@ -2296,6 +2296,12 @@ class ee extends t.OverlayLayer {
|
|
|
2296
2296
|
static get3DPainterClass(t) {
|
|
2297
2297
|
return ee.painters[t];
|
|
2298
2298
|
}
|
|
2299
|
+
onConfig(t) {
|
|
2300
|
+
if (super.onConfig(t), void 0 !== t.enableBloom) {
|
|
2301
|
+
const e = this.getRenderer();
|
|
2302
|
+
e && e.updateBloom(t.enableBloom);
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2299
2305
|
updateSymbol(t, e) {
|
|
2300
2306
|
if (!this.options.style) throw new Error("can't call update symbol when style is not set");
|
|
2301
2307
|
const n = Array.isArray(this.options.style) ? this.options.style : this.options.style.style;
|
|
@@ -2382,17 +2388,17 @@ ee.mergeOptions({
|
|
|
2382
2388
|
const ne = {
|
|
2383
2389
|
markerFile: {
|
|
2384
2390
|
type: "identity",
|
|
2385
|
-
default:
|
|
2391
|
+
default: null,
|
|
2386
2392
|
property: "_symbol_markerFile"
|
|
2387
2393
|
},
|
|
2388
2394
|
markerWidth: {
|
|
2389
2395
|
type: "identity",
|
|
2390
|
-
default:
|
|
2396
|
+
default: null,
|
|
2391
2397
|
property: "_symbol_markerWidth"
|
|
2392
2398
|
},
|
|
2393
2399
|
markerHeight: {
|
|
2394
2400
|
type: "identity",
|
|
2395
|
-
default:
|
|
2401
|
+
default: null,
|
|
2396
2402
|
property: "_symbol_markerHeight"
|
|
2397
2403
|
},
|
|
2398
2404
|
markerPathWidth: {
|
|
@@ -2407,62 +2413,62 @@ const ne = {
|
|
|
2407
2413
|
},
|
|
2408
2414
|
markerDx: {
|
|
2409
2415
|
type: "identity",
|
|
2410
|
-
default:
|
|
2416
|
+
default: null,
|
|
2411
2417
|
property: "_symbol_markerDx"
|
|
2412
2418
|
},
|
|
2413
2419
|
markerDy: {
|
|
2414
2420
|
type: "identity",
|
|
2415
|
-
default:
|
|
2421
|
+
default: null,
|
|
2416
2422
|
property: "_symbol_markerDy"
|
|
2417
2423
|
},
|
|
2418
2424
|
markerType: {
|
|
2419
2425
|
type: "identity",
|
|
2420
|
-
default:
|
|
2426
|
+
default: null,
|
|
2421
2427
|
property: "_symbol_markerType"
|
|
2422
2428
|
},
|
|
2423
2429
|
markerPath: {
|
|
2424
2430
|
type: "identity",
|
|
2425
|
-
default:
|
|
2431
|
+
default: null,
|
|
2426
2432
|
property: "_symbol_markerPath"
|
|
2427
2433
|
},
|
|
2428
2434
|
markerFill: {
|
|
2429
2435
|
type: "identity",
|
|
2430
|
-
default:
|
|
2436
|
+
default: null,
|
|
2431
2437
|
property: "_symbol_markerFill"
|
|
2432
2438
|
},
|
|
2433
2439
|
markerFillPatternFile: {
|
|
2434
2440
|
type: "identity",
|
|
2435
|
-
default:
|
|
2441
|
+
default: null,
|
|
2436
2442
|
property: "_symbol_markerFillPatternFile"
|
|
2437
2443
|
},
|
|
2438
2444
|
markerFillOpacity: {
|
|
2439
2445
|
type: "identity",
|
|
2440
|
-
default:
|
|
2446
|
+
default: null,
|
|
2441
2447
|
property: "_symbol_markerFillOpacity"
|
|
2442
2448
|
},
|
|
2443
2449
|
markerLineColor: {
|
|
2444
2450
|
type: "identity",
|
|
2445
|
-
default:
|
|
2451
|
+
default: null,
|
|
2446
2452
|
property: "_symbol_markerLineColor"
|
|
2447
2453
|
},
|
|
2448
2454
|
markerLineWidth: {
|
|
2449
2455
|
type: "identity",
|
|
2450
|
-
default:
|
|
2456
|
+
default: null,
|
|
2451
2457
|
property: "_symbol_markerLineWidth"
|
|
2452
2458
|
},
|
|
2453
2459
|
markerLineOpacity: {
|
|
2454
2460
|
type: "identity",
|
|
2455
|
-
default:
|
|
2461
|
+
default: null,
|
|
2456
2462
|
property: "_symbol_markerLineOpacity"
|
|
2457
2463
|
},
|
|
2458
2464
|
markerLineDasharray: {
|
|
2459
2465
|
type: "identity",
|
|
2460
|
-
default:
|
|
2466
|
+
default: null,
|
|
2461
2467
|
property: "_symbol_markerLineDasharray"
|
|
2462
2468
|
},
|
|
2463
2469
|
markerLinePatternFile: {
|
|
2464
2470
|
type: "identity",
|
|
2465
|
-
default:
|
|
2471
|
+
default: null,
|
|
2466
2472
|
property: "_symbol_markerLinePatternFile"
|
|
2467
2473
|
},
|
|
2468
2474
|
markerVerticalAlignment: {
|
|
@@ -2528,57 +2534,57 @@ const ne = {
|
|
|
2528
2534
|
}, ie = {
|
|
2529
2535
|
textName: {
|
|
2530
2536
|
type: "identity",
|
|
2531
|
-
default:
|
|
2537
|
+
default: null,
|
|
2532
2538
|
property: "_symbol_textName"
|
|
2533
2539
|
},
|
|
2534
2540
|
textFaceName: {
|
|
2535
2541
|
type: "identity",
|
|
2536
|
-
default:
|
|
2542
|
+
default: null,
|
|
2537
2543
|
property: "_symbol_textFaceName"
|
|
2538
2544
|
},
|
|
2539
2545
|
textWeight: {
|
|
2540
2546
|
type: "identity",
|
|
2541
|
-
default:
|
|
2547
|
+
default: null,
|
|
2542
2548
|
property: "_symbol_textWeight"
|
|
2543
2549
|
},
|
|
2544
2550
|
textStyle: {
|
|
2545
2551
|
type: "identity",
|
|
2546
|
-
default:
|
|
2552
|
+
default: null,
|
|
2547
2553
|
property: "_symbol_textStyle"
|
|
2548
2554
|
},
|
|
2549
2555
|
textWrapWidth: {
|
|
2550
2556
|
type: "identity",
|
|
2551
|
-
default:
|
|
2557
|
+
default: null,
|
|
2552
2558
|
property: "_symbol_textWrapWidth"
|
|
2553
2559
|
},
|
|
2554
2560
|
textHorizontalAlignment: {
|
|
2555
2561
|
type: "identity",
|
|
2556
|
-
default:
|
|
2562
|
+
default: null,
|
|
2557
2563
|
property: "_symbol_textHorizontalAlignment"
|
|
2558
2564
|
},
|
|
2559
2565
|
textVerticalAlignment: {
|
|
2560
2566
|
type: "identity",
|
|
2561
|
-
default:
|
|
2567
|
+
default: null,
|
|
2562
2568
|
property: "_symbol_textVerticalAlignment"
|
|
2563
2569
|
},
|
|
2564
2570
|
textFill: {
|
|
2565
2571
|
type: "identity",
|
|
2566
|
-
default:
|
|
2572
|
+
default: null,
|
|
2567
2573
|
property: "_symbol_textFill"
|
|
2568
2574
|
},
|
|
2569
2575
|
textSize: {
|
|
2570
2576
|
type: "identity",
|
|
2571
|
-
default:
|
|
2577
|
+
default: null,
|
|
2572
2578
|
property: "_symbol_textSize"
|
|
2573
2579
|
},
|
|
2574
2580
|
textHaloRadius: {
|
|
2575
2581
|
type: "identity",
|
|
2576
|
-
default:
|
|
2582
|
+
default: null,
|
|
2577
2583
|
property: "_symbol_textHaloRadius"
|
|
2578
2584
|
},
|
|
2579
2585
|
textHaloFill: {
|
|
2580
2586
|
type: "identity",
|
|
2581
|
-
default:
|
|
2587
|
+
default: null,
|
|
2582
2588
|
property: "_symbol_textHaloFill"
|
|
2583
2589
|
},
|
|
2584
2590
|
textHaloOpacity: {
|
|
@@ -2588,12 +2594,12 @@ const ne = {
|
|
|
2588
2594
|
},
|
|
2589
2595
|
textDx: {
|
|
2590
2596
|
type: "identity",
|
|
2591
|
-
default:
|
|
2597
|
+
default: null,
|
|
2592
2598
|
property: "_symbol_textDx"
|
|
2593
2599
|
},
|
|
2594
2600
|
textDy: {
|
|
2595
2601
|
type: "identity",
|
|
2596
|
-
default:
|
|
2602
|
+
default: null,
|
|
2597
2603
|
property: "_symbol_textDy"
|
|
2598
2604
|
},
|
|
2599
2605
|
textOpacity: {
|
|
@@ -2669,7 +2675,7 @@ const ne = {
|
|
|
2669
2675
|
},
|
|
2670
2676
|
linePatternFile: {
|
|
2671
2677
|
type: "identity",
|
|
2672
|
-
default:
|
|
2678
|
+
default: null,
|
|
2673
2679
|
property: "_symbol_linePatternFile"
|
|
2674
2680
|
},
|
|
2675
2681
|
linePatternAnimSpeed: {
|
|
@@ -2689,22 +2695,22 @@ const ne = {
|
|
|
2689
2695
|
},
|
|
2690
2696
|
lineJoin: {
|
|
2691
2697
|
type: "identity",
|
|
2692
|
-
default:
|
|
2698
|
+
default: null,
|
|
2693
2699
|
property: "_symbol_lineJoin"
|
|
2694
2700
|
},
|
|
2695
2701
|
lineCap: {
|
|
2696
2702
|
type: "identity",
|
|
2697
|
-
default:
|
|
2703
|
+
default: null,
|
|
2698
2704
|
property: "_symbol_lineCap"
|
|
2699
2705
|
},
|
|
2700
2706
|
lineDasharray: {
|
|
2701
2707
|
type: "identity",
|
|
2702
|
-
default:
|
|
2708
|
+
default: null,
|
|
2703
2709
|
property: "_symbol_lineDasharray"
|
|
2704
2710
|
},
|
|
2705
2711
|
lineDashColor: {
|
|
2706
2712
|
type: "identity",
|
|
2707
|
-
default:
|
|
2713
|
+
default: null,
|
|
2708
2714
|
property: "_symbol_lineDashColor"
|
|
2709
2715
|
}
|
|
2710
2716
|
}, oe = new t.Point(0, 0), se = "_vector3dlayer_id", ae = "_line_gradient_property".trim();
|
|
@@ -2808,14 +2814,14 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
2808
2814
|
this.De = {}, this.Ne = {}, this.Le = {}, this.He = !0, this.Ve = {
|
|
2809
2815
|
id: 0,
|
|
2810
2816
|
pickingId: 0
|
|
2811
|
-
}, this.Ue =
|
|
2817
|
+
}, this.Ue = {};
|
|
2812
2818
|
}
|
|
2813
2819
|
hasNoAARendering() {
|
|
2814
2820
|
return !0;
|
|
2815
2821
|
}
|
|
2816
2822
|
needToRedraw() {
|
|
2817
2823
|
const t = super.needToRedraw();
|
|
2818
|
-
return t || (this.painter && this.painter.needToRedraw() || this.
|
|
2824
|
+
return t || (this.painter && this.painter.needToRedraw() || this.Ge && this.Ge.needToRedraw() || this.We && this.We.needToRedraw());
|
|
2819
2825
|
}
|
|
2820
2826
|
getAnalysisMeshes() {
|
|
2821
2827
|
return pe;
|
|
@@ -2827,33 +2833,33 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
2827
2833
|
this.dt = t;
|
|
2828
2834
|
const n = this.layer;
|
|
2829
2835
|
this.prepareCanvas(), this.pt = this.yt(this.getMap().getGLRes()), this.gt = e || {};
|
|
2830
|
-
const i = this.gt.renderMode, r = this.
|
|
2831
|
-
if (this.vt(r, i), this.He) this.buildMesh(), this.
|
|
2832
|
-
this
|
|
2833
|
-
const t = this.atlas, e = this.
|
|
2834
|
-
delete this.atlas, delete this.
|
|
2835
|
-
this
|
|
2836
|
-
} else if (this.
|
|
2837
|
-
const t = this.
|
|
2838
|
-
delete this.
|
|
2839
|
-
}
|
|
2840
|
-
if (!this.meshes && !this.
|
|
2841
|
-
this.
|
|
2836
|
+
const i = this.gt.renderMode, r = this.Be();
|
|
2837
|
+
if (this.vt(r, i), this.He) this.buildMesh(), this.qe(), this.Xe(), this.Ue = {},
|
|
2838
|
+
this.$e = !1, this.He = !1, this.Ye = !1; else if (this.$e) {
|
|
2839
|
+
const t = this.atlas, e = this.Je, n = this.Ze;
|
|
2840
|
+
delete this.atlas, delete this.Je, delete this.Ze, this.buildMesh(t), this.qe(e),
|
|
2841
|
+
this.Xe(n), this.$e = !1, this.Ye = !1;
|
|
2842
|
+
} else if (this.Ye) {
|
|
2843
|
+
const t = this.Ze;
|
|
2844
|
+
delete this.Ze, this.Xe(t), this.Ye = !1;
|
|
2845
|
+
}
|
|
2846
|
+
if (!this.meshes && !this.Ke && !this.Qe) return void this.completeRender();
|
|
2847
|
+
this.tn && (this.en(), this.tn = !1), this.nn();
|
|
2842
2848
|
const o = !i || "default" === i;
|
|
2843
|
-
let s = this.
|
|
2844
|
-
if (0 === this.layer.options.meshRenderOrder && this.
|
|
2845
|
-
this.
|
|
2849
|
+
let s = this.Qe && (o || this.We.supportRenderMode(i)) ? 2 : 1;
|
|
2850
|
+
if (0 === this.layer.options.meshRenderOrder && this.in(r, s--, i), this.Qe && (o || this.We.supportRenderMode(i)) && (this.We.startFrame(r),
|
|
2851
|
+
this.We.addMesh(this.Qe, null, {
|
|
2846
2852
|
bloom: this.gt.bloom
|
|
2847
|
-
}), this.
|
|
2848
|
-
this.
|
|
2849
|
-
const e = !this.gt.timestamp || this.gt.isFinalRender, i = !this.
|
|
2853
|
+
}), this.We.prepareRender(r), r.polygonOffsetIndex = s--, this.We.render(r)), 1 === this.layer.options.meshRenderOrder && this.in(r, s--, i),
|
|
2854
|
+
this.Ke && (o || this.Ge.supportRenderMode(i))) {
|
|
2855
|
+
const e = !this.gt.timestamp || this.gt.isFinalRender, i = !this.rn || this.rn !== t;
|
|
2850
2856
|
n.options.collision && i && n.clearCollisionIndex();
|
|
2851
2857
|
const o = this.layer.options.sceneConfig;
|
|
2852
|
-
this.
|
|
2853
|
-
this.
|
|
2858
|
+
this.Ge.sceneConfig.collision = !o || (!!et(o.collision) || o.collision), this.Ge.startFrame(r),
|
|
2859
|
+
this.Ge.addMesh(this.Ke, null, {
|
|
2854
2860
|
bloom: this.gt.bloom
|
|
2855
|
-
}), this.
|
|
2856
|
-
e && (this.
|
|
2861
|
+
}), this.Ge.prepareRender(r), n.options.collision && i && (this.Ge.updateCollision(r),
|
|
2862
|
+
e && (this.rn = t)), this.Ge.render(r);
|
|
2857
2863
|
}
|
|
2858
2864
|
(o || e && e.isFinalRender) && (this.completeRender(), this.layer.fire("canvasisdirty"));
|
|
2859
2865
|
}
|
|
@@ -2861,7 +2867,7 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
2861
2867
|
const n = !e || "default" === e;
|
|
2862
2868
|
this.painter && (n || this.painter.supportRenderMode(e)) && this.painter.startFrame(t);
|
|
2863
2869
|
}
|
|
2864
|
-
|
|
2870
|
+
in(t, e, n) {
|
|
2865
2871
|
const i = !n || "default" === n;
|
|
2866
2872
|
this.painter && this.meshes && (i || this.painter.supportRenderMode(n)) && (this.painter.addMesh(this.meshes, null, {
|
|
2867
2873
|
bloom: t && t.bloom
|
|
@@ -2873,11 +2879,11 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
2873
2879
|
isForeground() {
|
|
2874
2880
|
return !0;
|
|
2875
2881
|
}
|
|
2876
|
-
|
|
2882
|
+
Be() {
|
|
2877
2883
|
const t = {
|
|
2878
2884
|
regl: this.regl,
|
|
2879
2885
|
layer: this.layer,
|
|
2880
|
-
symbol: this.
|
|
2886
|
+
symbol: this.sn,
|
|
2881
2887
|
gl: this.gl,
|
|
2882
2888
|
sceneConfig: this.layer.options.sceneConfig,
|
|
2883
2889
|
pluginIndex: 0,
|
|
@@ -2892,7 +2898,7 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
2892
2898
|
getFrameTimestamp() {
|
|
2893
2899
|
return this.dt;
|
|
2894
2900
|
}
|
|
2895
|
-
|
|
2901
|
+
an(t, e) {
|
|
2896
2902
|
(t = t || e) === e && (e = null);
|
|
2897
2903
|
const n = [], i = [ 0, 0, 0, 0 ];
|
|
2898
2904
|
this.layer._sortGeometries();
|
|
@@ -2903,18 +2909,18 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
2903
2909
|
const a = this.features[s];
|
|
2904
2910
|
if (Array.isArray(a)) for (let r = 0; r < a.length; r++) {
|
|
2905
2911
|
const o = a[r], s = o[fe];
|
|
2906
|
-
(!t || t[s] || e && (!e || e[s])) && (o.visible || (this.
|
|
2912
|
+
(!t || t[s] || e && (!e || e[s])) && (o.visible || (this.tn = !0), this.ln(o.geometry, i),
|
|
2907
2913
|
n.push(o));
|
|
2908
2914
|
} else {
|
|
2909
|
-
a.visible || (this.
|
|
2915
|
+
a.visible || (this.tn = !0);
|
|
2910
2916
|
const r = a[fe];
|
|
2911
2917
|
if (t && !t[r] && (!e || e && !e[r])) continue;
|
|
2912
|
-
this.
|
|
2918
|
+
this.ln(a.geometry, i), n.push(a);
|
|
2913
2919
|
}
|
|
2914
2920
|
}
|
|
2915
2921
|
if (n.length || (this.meshes && this.painter && (this.painter.deleteMesh(this.meshes),
|
|
2916
|
-
delete this.meshes), this.
|
|
2917
|
-
delete this.
|
|
2922
|
+
delete this.meshes), this.Ke && (this.Ge.deleteMesh(this.Ke), delete this.Ke), this.Qe && (this.We.deleteMesh(this.Qe),
|
|
2923
|
+
delete this.Qe)), 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());
|
|
2918
2924
|
return {
|
|
2919
2925
|
features: n,
|
|
2920
2926
|
center: i
|
|
@@ -2933,12 +2939,12 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
2933
2939
|
}).load();
|
|
2934
2940
|
}
|
|
2935
2941
|
createMesh(t, e, n, i, r, o) {
|
|
2936
|
-
return this.createVectorPacks(t, e, n, i, r, o).then(s => this.
|
|
2942
|
+
return this.createVectorPacks(t, e, n, i, r, o).then(s => this.hn(s, t, e, n, i, r, o));
|
|
2937
2943
|
}
|
|
2938
|
-
|
|
2944
|
+
hn(t, e, n, o, s, a, l) {
|
|
2939
2945
|
if (!t) return null;
|
|
2940
2946
|
const h = e.createGeometries([ t.data ], vt(s, null, 0, o, this.layer));
|
|
2941
|
-
for (let t = 0; t < h.length; t++) h[t] && this.
|
|
2947
|
+
for (let t = 0; t < h.length; t++) h[t] && this.cn(h[t].geometry);
|
|
2942
2948
|
const c = r.identity([]);
|
|
2943
2949
|
r.translate(c, c, i.set([], l[0], l[1], 0)), r.scale(c, c, i.set([], 1, 1, this.pt));
|
|
2944
2950
|
const u = e.createMeshes(h, c, {
|
|
@@ -2957,13 +2963,13 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
2957
2963
|
}
|
|
2958
2964
|
};
|
|
2959
2965
|
}
|
|
2960
|
-
|
|
2966
|
+
ln(t, e) {
|
|
2961
2967
|
for (let n = 0; n < t.length; n++) if (Array.isArray(t[n][0])) for (let i = 0; i < t[n].length; i++) if (Array.isArray(t[n][i][0])) for (let r = 0; r < t[n][i].length; r++) isNaN(+t[n][i][r][0]) || isNaN(+t[n][i][r][1]) || (e[0] += t[n][i][r][0],
|
|
2962
2968
|
e[1] += t[n][i][r][1], e[3] += 1); else isNaN(+t[n][i][0]) || isNaN(+t[n][i][1]) || (e[0] += t[n][i][0],
|
|
2963
2969
|
e[1] += t[n][i][1], e[3] += 1); else isNaN(+t[n][0]) || isNaN(+t[n][1]) || (e[0] += t[n][0],
|
|
2964
2970
|
e[1] += t[n][1], e[3] += 1);
|
|
2965
2971
|
}
|
|
2966
|
-
|
|
2972
|
+
cn(t) {
|
|
2967
2973
|
const e = this.getMap(), n = t.properties;
|
|
2968
2974
|
Object.defineProperty(n, "tileResolution", {
|
|
2969
2975
|
enumerable: !0,
|
|
@@ -2972,7 +2978,7 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
2972
2978
|
}
|
|
2973
2979
|
}), n.tileRatio = 1, n.z = 1, n.tileExtent = 1, n.elements = t.elements, n.aPickingId = t.data.aPickingId;
|
|
2974
2980
|
}
|
|
2975
|
-
|
|
2981
|
+
un(t) {
|
|
2976
2982
|
return "win-intel-gpu-crash" === t && (this.layer.options.workarounds["win-intel-gpu-crash"] && ge(this.gl));
|
|
2977
2983
|
}
|
|
2978
2984
|
prepareRequestors() {
|
|
@@ -2981,12 +2987,12 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
2981
2987
|
this.h = new v({
|
|
2982
2988
|
iconErrorUrl: t.options.iconErrorUrl
|
|
2983
2989
|
});
|
|
2984
|
-
const e = !this.
|
|
2990
|
+
const e = !this.un("win-intel-gpu-crash");
|
|
2985
2991
|
this.u = new b(e => {
|
|
2986
2992
|
t.getMap().getRenderer().callInNextFrame(e);
|
|
2987
|
-
}, t.options.glyphSdfLimitPerFrame, e), this.requestor = this.
|
|
2993
|
+
}, t.options.glyphSdfLimitPerFrame, e), this.requestor = this.dn.bind(this), this.pn = this.mn.bind(this);
|
|
2988
2994
|
}
|
|
2989
|
-
|
|
2995
|
+
dn(t, e, n) {
|
|
2990
2996
|
const i = [];
|
|
2991
2997
|
this.h.getIcons(t, (t, e) => {
|
|
2992
2998
|
if (t) throw t;
|
|
@@ -2995,7 +3001,7 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
2995
3001
|
}, i);
|
|
2996
3002
|
});
|
|
2997
3003
|
}
|
|
2998
|
-
|
|
3004
|
+
mn(t, e, n) {
|
|
2999
3005
|
this.u.getGlyphs(e, (e, i) => {
|
|
3000
3006
|
if (e) throw e;
|
|
3001
3007
|
const r = i.buffers || [];
|
|
@@ -3008,42 +3014,42 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3008
3014
|
});
|
|
3009
3015
|
});
|
|
3010
3016
|
}
|
|
3011
|
-
|
|
3017
|
+
qe(t) {
|
|
3012
3018
|
const e = Object.keys(this.De), n = Object.keys(this.Ne);
|
|
3013
|
-
if (!e.length && !n.length) return void (this.
|
|
3014
|
-
delete this.
|
|
3015
|
-
const {features: o, center: s} = this.
|
|
3019
|
+
if (!e.length && !n.length) return void (this.Ke && (this.Ge.deleteMesh(this.Ke),
|
|
3020
|
+
delete this.Ke));
|
|
3021
|
+
const {features: o, center: s} = this.an(this.De, this.Ne), a = [], l = [];
|
|
3016
3022
|
for (let t = 0; t < o.length; t++) {
|
|
3017
3023
|
const e = o[t][fe];
|
|
3018
3024
|
this.De[e] && a.push(o[t]), this.Ne[e] && l.push(o[t]);
|
|
3019
3025
|
}
|
|
3020
|
-
if (!a.length && !l.length) return void (this.
|
|
3021
|
-
delete this.
|
|
3022
|
-
const h = this.
|
|
3023
|
-
this.
|
|
3024
|
-
const c = this.
|
|
3025
|
-
this.
|
|
3026
|
+
if (!a.length && !l.length) return void (this.Ke && (this.Ge.deleteMesh(this.Ke),
|
|
3027
|
+
delete this.Ke));
|
|
3028
|
+
const h = this.tn;
|
|
3029
|
+
this.yn = s;
|
|
3030
|
+
const c = this.gn(a, l, t, s);
|
|
3031
|
+
this.Je = {};
|
|
3026
3032
|
const u = [], f = [];
|
|
3027
|
-
this.
|
|
3028
|
-
if (this.
|
|
3029
|
-
const e = this.
|
|
3033
|
+
this.vn = !0, Promise.all(c).then(t => {
|
|
3034
|
+
if (this.Ke && (this.Ge.deleteMesh(this.Ke), delete this.Ke), !t || !t.length) return void this.setToRedraw();
|
|
3035
|
+
const e = this.Ge.createGeometries(t.map(t => (t && t.data && (t.data.isIdUnique = !0),
|
|
3030
3036
|
t && t.data)), this.je);
|
|
3031
|
-
for (let n = 0; n < e.length; n++) this.
|
|
3037
|
+
for (let n = 0; n < e.length; n++) this.cn(e[n].geometry, t[n] && t[n].data);
|
|
3032
3038
|
const n = t[0] && t[0].data.iconAtlas, o = t[0] && t[0].data.glyphAtlas || t[1] && t[1].data.glyphAtlas;
|
|
3033
|
-
n && (this.
|
|
3039
|
+
n && (this.Je.iconAtlas = n), o && (this.Je.glyphAtlas = o);
|
|
3034
3040
|
const a = r.identity([]);
|
|
3035
3041
|
r.translate(a, a, i.set(f, s[0], s[1], 0)), r.scale(a, a, i.set(u, 1, 1, this.pt));
|
|
3036
|
-
const l = this.
|
|
3042
|
+
const l = this.Ge.createMeshes(e, a);
|
|
3037
3043
|
for (let t = 0; t < l.length; t++) l[t].geometry.properties.originElements = l[t].geometry.properties.elements.slice(),
|
|
3038
3044
|
l[t].properties.level = 0, l[t].material.set("flipY", 1), l[t].properties.meshKey = ce++;
|
|
3039
|
-
this.
|
|
3045
|
+
this.Ke = l, h && (this.tn = !0), this.vn = !1, this.setToRedraw(), this.layer.fire("buildmarkermesh");
|
|
3040
3046
|
});
|
|
3041
3047
|
}
|
|
3042
|
-
|
|
3043
|
-
if (this.
|
|
3044
|
-
if (this.meshes) for (let t = 0; t < this.meshes.length; t++) this.
|
|
3048
|
+
en() {
|
|
3049
|
+
if (this.Ke && (this.bn(this.Ke[0], this.De), this.bn(this.Ke[1], this.Ne)), this.Qe) for (let t = 0; t < this.Qe.length; t++) this.bn(this.Qe[t], this.Le);
|
|
3050
|
+
if (this.meshes) for (let t = 0; t < this.meshes.length; t++) this.bn(this.meshes[t], this.je);
|
|
3045
3051
|
}
|
|
3046
|
-
|
|
3052
|
+
bn(t, e) {
|
|
3047
3053
|
if (!t) return;
|
|
3048
3054
|
const {aPickingId: n, originElements: i} = t.geometry.properties, r = [];
|
|
3049
3055
|
for (let t = 0; t < i.length; t++) {
|
|
@@ -3053,11 +3059,11 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3053
3059
|
const o = t.geometry.properties.elements = new i.constructor(r);
|
|
3054
3060
|
t.geometry.setElements(o);
|
|
3055
3061
|
}
|
|
3056
|
-
|
|
3062
|
+
gn(t, e, n, i) {
|
|
3057
3063
|
const r = {
|
|
3058
3064
|
zoom: this.getMap().getZoom(),
|
|
3059
3065
|
EXTENT: 1 / 0,
|
|
3060
|
-
requestor: this.
|
|
3066
|
+
requestor: this.pn,
|
|
3061
3067
|
atlas: n,
|
|
3062
3068
|
center: i,
|
|
3063
3069
|
positionType: Float32Array,
|
|
@@ -3067,14 +3073,14 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3067
3073
|
markerHeightType: Uint16Array
|
|
3068
3074
|
}, o = Z({}, r);
|
|
3069
3075
|
r.allowEmptyPack = 1;
|
|
3070
|
-
return A.splitPointSymbol(this.
|
|
3076
|
+
return A.splitPointSymbol(this.xn).map((n, i) => new A(0 === i ? t : e, n, 0 === i ? r : o).load());
|
|
3071
3077
|
}
|
|
3072
3078
|
updateMesh() {}
|
|
3073
3079
|
wn(t) {
|
|
3074
3080
|
const e = t._getInternalSymbol(), n = {
|
|
3075
3081
|
zoom: this.getMap().getZoom()
|
|
3076
3082
|
}, i = this.An(t);
|
|
3077
|
-
if (!this.
|
|
3083
|
+
if (!this.Ke) return !1;
|
|
3078
3084
|
let r = this.features[i];
|
|
3079
3085
|
Array.isArray(r) || (r = [ r ]);
|
|
3080
3086
|
const o = [], s = [], a = [], l = this.getMap().getZoom();
|
|
@@ -3084,14 +3090,14 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3084
3090
|
for (let t = 0; t < r.length; t++) {
|
|
3085
3091
|
if (!r[t]) continue;
|
|
3086
3092
|
const i = Array.isArray(e) ? e[t] : e, o = Array.isArray(h) ? h[t] : h, s = Array.isArray(c) ? c[t] : c, a = new _(r, i, o, s, n).getIconAndGlyph();
|
|
3087
|
-
if (!this.
|
|
3093
|
+
if (!this.Je || !A.isAtlasLoaded(a, this.Je)) return this.kn(), this.setToRedraw(),
|
|
3088
3094
|
!1;
|
|
3089
3095
|
}
|
|
3090
3096
|
for (let t = 0; t < r.length; t++) {
|
|
3091
3097
|
const e = r[t][fe];
|
|
3092
3098
|
this.De[e] && s.push(r[t]), this.Ne[e] && a.push(r[t]);
|
|
3093
3099
|
}
|
|
3094
|
-
const u = r[0].id, f = this.
|
|
3100
|
+
const u = r[0].id, f = this.gn(s, a, this.Je, this.yn), d = this.Ke;
|
|
3095
3101
|
return Promise.all(f).then(t => {
|
|
3096
3102
|
for (let e = 0; e < t.length; e++) {
|
|
3097
3103
|
if (!t[e]) continue;
|
|
@@ -3110,7 +3116,7 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3110
3116
|
}), !0;
|
|
3111
3117
|
}
|
|
3112
3118
|
_n(t) {
|
|
3113
|
-
return this.Tn(t, this.
|
|
3119
|
+
return this.Tn(t, this.Qe, this.Ze, this.Sn, this.We, T, re, this.Mn);
|
|
3114
3120
|
}
|
|
3115
3121
|
Tn(t, e, n, i, r, o, s, a) {
|
|
3116
3122
|
if (!e) return !1;
|
|
@@ -3167,16 +3173,16 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3167
3173
|
this.layer.fire("updatemesh"), this.setToRedraw();
|
|
3168
3174
|
}
|
|
3169
3175
|
}
|
|
3170
|
-
|
|
3171
|
-
if (!Object.keys(this.Le).length) return void (this.
|
|
3172
|
-
delete this.
|
|
3173
|
-
const {features: e, center: n} = this.
|
|
3176
|
+
Xe(t) {
|
|
3177
|
+
if (!Object.keys(this.Le).length) return void (this.Qe && (this.We.deleteMesh(this.Qe),
|
|
3178
|
+
delete this.Qe));
|
|
3179
|
+
const {features: e, center: n} = this.an(this.Le);
|
|
3174
3180
|
if (!e.length) return;
|
|
3175
|
-
const i = this.
|
|
3181
|
+
const i = this.tn;
|
|
3176
3182
|
this.Sn = n;
|
|
3177
|
-
const r = this.Mn(e), o = Z({}, re), s = r.map((e, i) => this.createMesh(this.
|
|
3183
|
+
const r = this.Mn(e), o = Z({}, re), s = r.map((e, i) => this.createMesh(this.We, T, o, e, t && t[i], n));
|
|
3178
3184
|
this.In = !0, Promise.all(s).then(t => {
|
|
3179
|
-
this.
|
|
3185
|
+
this.Qe && this.We.deleteMesh(this.Qe);
|
|
3180
3186
|
const e = [], n = [];
|
|
3181
3187
|
for (let i = 0; i < t.length; i++) {
|
|
3182
3188
|
const r = t[i] && t[i].meshes;
|
|
@@ -3188,7 +3194,7 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3188
3194
|
n[i] = t[i].atlas;
|
|
3189
3195
|
}
|
|
3190
3196
|
}
|
|
3191
|
-
this.
|
|
3197
|
+
this.Qe = e, this.Ze = n, i && (this.tn = i), this.In = !1, this.setToRedraw(),
|
|
3192
3198
|
this.layer.fire("buildlinemesh");
|
|
3193
3199
|
});
|
|
3194
3200
|
}
|
|
@@ -3201,7 +3207,7 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3201
3207
|
return [ i, r, o ];
|
|
3202
3208
|
}
|
|
3203
3209
|
On() {
|
|
3204
|
-
this
|
|
3210
|
+
this.$e = !0, this.setToRedraw();
|
|
3205
3211
|
}
|
|
3206
3212
|
kn() {
|
|
3207
3213
|
this.He = !0, this.setToRedraw();
|
|
@@ -3263,7 +3269,7 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3263
3269
|
pick(t, e, n) {
|
|
3264
3270
|
const i = [];
|
|
3265
3271
|
if (!this.layer.isVisible()) return i;
|
|
3266
|
-
return [ this.painter, this.
|
|
3272
|
+
return [ this.painter, this.Ge, this.We ].forEach(r => {
|
|
3267
3273
|
if (!r) return;
|
|
3268
3274
|
const o = r.pick(t, e, n.tolerance);
|
|
3269
3275
|
if (o && o.data && o.data.feature) {
|
|
@@ -3276,11 +3282,11 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3276
3282
|
const e = t[se], n = this.features[e];
|
|
3277
3283
|
return Array.isArray(n) ? n[0][fe] : n[fe];
|
|
3278
3284
|
}
|
|
3279
|
-
|
|
3285
|
+
nn() {
|
|
3280
3286
|
let t = !1;
|
|
3281
|
-
for (const e in this.
|
|
3282
|
-
const n = this.
|
|
3283
|
-
if (!this.
|
|
3287
|
+
for (const e in this.Ue) {
|
|
3288
|
+
const n = this.Ue[e], i = this.zn(n);
|
|
3289
|
+
if (!this.vn && (this.De[i] || this.Ne[i])) {
|
|
3284
3290
|
const e = this.wn(n);
|
|
3285
3291
|
t = t || e;
|
|
3286
3292
|
}
|
|
@@ -3293,7 +3299,7 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3293
3299
|
t = t || e;
|
|
3294
3300
|
}
|
|
3295
3301
|
}
|
|
3296
|
-
this.
|
|
3302
|
+
this.Ue = {}, t && (ye(this), this.layer.fire("partialupdate"));
|
|
3297
3303
|
}
|
|
3298
3304
|
Rn(t) {
|
|
3299
3305
|
this.An(t), this.kn(), ye(this);
|
|
@@ -3339,7 +3345,7 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3339
3345
|
}
|
|
3340
3346
|
onGeometryPositionChange(t) {
|
|
3341
3347
|
const e = t.target._getParent() || t.target, n = e[se];
|
|
3342
|
-
this.Cn([ e ]), this.
|
|
3348
|
+
this.Cn([ e ]), this.Ue[n] = e, ye(this);
|
|
3343
3349
|
}
|
|
3344
3350
|
onGeometryZIndexChange() {
|
|
3345
3351
|
this.kn();
|
|
@@ -3365,7 +3371,7 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3365
3371
|
}
|
|
3366
3372
|
}
|
|
3367
3373
|
Nn() {
|
|
3368
|
-
this.
|
|
3374
|
+
this.tn = !0;
|
|
3369
3375
|
}
|
|
3370
3376
|
onGeometryPropertiesChange(t) {
|
|
3371
3377
|
const e = t.target, n = e[se];
|
|
@@ -3377,27 +3383,31 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3377
3383
|
t && (this.canvas.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height)),
|
|
3378
3384
|
this.prepareRequestors(), this.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height),
|
|
3379
3385
|
this.painter = this.createPainter();
|
|
3380
|
-
const e = ee.get3DPainterClass("icon")
|
|
3381
|
-
n
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
this.
|
|
3386
|
+
const e = ee.get3DPainterClass("icon");
|
|
3387
|
+
let n = e.getBloomSymbol();
|
|
3388
|
+
const i = Z({}, ne, ie);
|
|
3389
|
+
i.markerPerspectiveRatio = this.layer.options.markerPerspectiveRatio || 0, this.Ln(i, n),
|
|
3390
|
+
this.xn = i;
|
|
3391
|
+
const r = Z({}, ht, this.layer.options.sceneConfig || {});
|
|
3392
|
+
this.Ge = new e(this.regl, this.layer, i, r, 0), this.Ge.setTextShaderDefines({
|
|
3385
3393
|
REVERSE_MAP_ROTATION_ON_PITCH: 1
|
|
3386
3394
|
});
|
|
3387
|
-
const
|
|
3388
|
-
this.Ln(
|
|
3389
|
-
const
|
|
3390
|
-
void 0 ===
|
|
3395
|
+
const o = ee.get3DPainterClass("line"), s = Z({}, re);
|
|
3396
|
+
n = o.getBloomSymbol(), this.Ln(s, n), this.Hn = s;
|
|
3397
|
+
const a = Z({}, this.layer.options.sceneConfig || {});
|
|
3398
|
+
void 0 === a.depthMask && (a.depthMask = !0), this.We = new o(this.regl, this.layer, s, a, 0),
|
|
3391
3399
|
this.layer.getGeometries() && this.onGeometryAdd(this.layer.getGeometries());
|
|
3392
3400
|
}
|
|
3393
3401
|
Ln(t, e) {
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3402
|
+
for (let n = 0; n < e.length; n++) t[e[n]] = this.layer.options.enableBloom;
|
|
3403
|
+
}
|
|
3404
|
+
updateBloom(t) {
|
|
3405
|
+
this.Ge && this.Vn(this.Ge, this.xn, t), this.We && this.Vn(this.We, this.Hn, t),
|
|
3406
|
+
this.painter && this.Vn(this.painter, this.painterSymbol, t);
|
|
3407
|
+
}
|
|
3408
|
+
Vn(t, e, n) {
|
|
3409
|
+
const i = t.constructor.getBloomSymbol().reduce((t, i) => (t[i] = n, e[i] = n, t), {});
|
|
3410
|
+
t.updateSymbol(i, e);
|
|
3401
3411
|
}
|
|
3402
3412
|
createPainter() {}
|
|
3403
3413
|
ot() {
|
|
@@ -3441,18 +3451,18 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3441
3451
|
}
|
|
3442
3452
|
onRemove() {
|
|
3443
3453
|
super.onRemove(), this.painter && (this.painter.delete(), delete this.painter),
|
|
3444
|
-
this.
|
|
3454
|
+
this.Ge && (this.Ge.delete(), delete this.Ge), this.We && (this.We.delete(), delete this.We);
|
|
3445
3455
|
}
|
|
3446
3456
|
drawOutline(t) {
|
|
3447
|
-
if (this._t && (this.painter && this.painter.outlineAll(t), this.
|
|
3448
|
-
this.
|
|
3449
|
-
this.
|
|
3457
|
+
if (this._t && (this.painter && this.painter.outlineAll(t), this.Ge.outlineAll(t),
|
|
3458
|
+
this.We.outlineAll(t)), this.Un) for (let e = 0; e < this.Un.length; e++) this.painter && this.painter.outline(t, this.Un[e]),
|
|
3459
|
+
this.Ge.outline(t, this.Un[e]), this.We.outline(t, this.Un[e]);
|
|
3450
3460
|
}
|
|
3451
3461
|
outlineAll() {
|
|
3452
3462
|
this._t = !0, this.setToRedraw();
|
|
3453
3463
|
}
|
|
3454
3464
|
outline(t) {
|
|
3455
|
-
this.
|
|
3465
|
+
this.Un || (this.Un = []);
|
|
3456
3466
|
const e = [];
|
|
3457
3467
|
for (let n = 0; n < t.length; n++) {
|
|
3458
3468
|
const i = this.layer.getGeometryById(t[n]);
|
|
@@ -3461,10 +3471,10 @@ class me extends t.renderer.CanvasRenderer {
|
|
|
3461
3471
|
if (Array.isArray(t)) for (let n = 0; n < t.length; n++) e.push(t[n].id); else e.push(t.id);
|
|
3462
3472
|
}
|
|
3463
3473
|
}
|
|
3464
|
-
this.
|
|
3474
|
+
this.Un.push(e), this.setToRedraw();
|
|
3465
3475
|
}
|
|
3466
3476
|
cancelOutline() {
|
|
3467
|
-
delete this._t, delete this.
|
|
3477
|
+
delete this._t, delete this.Un, this.setToRedraw();
|
|
3468
3478
|
}
|
|
3469
3479
|
isEnableWorkAround(t) {
|
|
3470
3480
|
return "win-intel-gpu-crash" === t && (this.layer.options.workarounds["win-intel-gpu-crash"] && ge(this.gl));
|
|
@@ -3578,16 +3588,16 @@ Me.registerRenderer("gl", class extends me {
|
|
|
3578
3588
|
const t = ee.get3DPainterClass("line-gradient");
|
|
3579
3589
|
this.painterSymbol = Z({}, {
|
|
3580
3590
|
lineGradientProperty: Pe
|
|
3581
|
-
}, re), this.Ln(this.painterSymbol,
|
|
3591
|
+
}, re), this.Ln(this.painterSymbol, t.getBloomSymbol());
|
|
3582
3592
|
const e = Z({}, this.layer.options.sceneConfig || {});
|
|
3583
3593
|
void 0 === e.depthMask && (e.depthMask = !0);
|
|
3584
3594
|
return new t(this.regl, this.layer, this.painterSymbol, e, 0);
|
|
3585
3595
|
}
|
|
3586
3596
|
buildMesh() {
|
|
3587
|
-
let {features: t, center: e} = this.
|
|
3597
|
+
let {features: t, center: e} = this.an();
|
|
3588
3598
|
if (t = t.filter(t => !!t.properties[Pe]), !t.length) return;
|
|
3589
|
-
const n = this.
|
|
3590
|
-
this.
|
|
3599
|
+
const n = this.tn;
|
|
3600
|
+
this.Gn = e;
|
|
3591
3601
|
const i = Z({}, this.painterSymbol), r = this.createMesh(this.painter, T, i, t, null, e);
|
|
3592
3602
|
this.jn = !0, r.then(t => {
|
|
3593
3603
|
this.meshes && this.painter.deleteMesh(this.meshes);
|
|
@@ -3596,7 +3606,7 @@ Me.registerRenderer("gl", class extends me {
|
|
|
3596
3606
|
e.push(...i);
|
|
3597
3607
|
for (let t = 0; t < i.length; t++) i[t].feaGroupIndex = 0, i[t].geometry.properties.originElements = i[t].geometry.properties.elements.slice();
|
|
3598
3608
|
}
|
|
3599
|
-
this.meshes = e, n && (this.
|
|
3609
|
+
this.meshes = e, n && (this.tn = n), this.jn = !1, this.setToRedraw();
|
|
3600
3610
|
});
|
|
3601
3611
|
}
|
|
3602
3612
|
}), Me.registerRenderer("canvas", null);
|
|
@@ -3642,11 +3652,11 @@ class Ce extends me {
|
|
|
3642
3652
|
super(...e), this.GeometryTypes = [ t.Polygon, t.MultiPolygon ];
|
|
3643
3653
|
}
|
|
3644
3654
|
buildMesh(t) {
|
|
3645
|
-
const {features: e, center: n} = this.
|
|
3655
|
+
const {features: e, center: n} = this.an();
|
|
3646
3656
|
if (!e.length) return;
|
|
3647
|
-
const i = this.
|
|
3648
|
-
this.
|
|
3649
|
-
const r = this.
|
|
3657
|
+
const i = this.tn;
|
|
3658
|
+
this.Gn = n;
|
|
3659
|
+
const r = this.Wn(e), o = Z({}, Oe), s = r.map((e, i) => this.createMesh(this.painter, P, o, e, t && t[i], n));
|
|
3650
3660
|
this.jn = !0, Promise.all(s).then(t => {
|
|
3651
3661
|
this.meshes && this.painter.deleteMesh(this.meshes), t = function(t) {
|
|
3652
3662
|
const e = [];
|
|
@@ -3663,7 +3673,7 @@ class Ce extends me {
|
|
|
3663
3673
|
n[i] = t[i].atlas;
|
|
3664
3674
|
}
|
|
3665
3675
|
}
|
|
3666
|
-
this.meshes = e, this.atlas = n, i && (this.
|
|
3676
|
+
this.meshes = e, this.atlas = n, i && (this.tn = i), this.jn = !1, this.setToRedraw(),
|
|
3667
3677
|
this.layer.fire("buildmesh");
|
|
3668
3678
|
});
|
|
3669
3679
|
}
|
|
@@ -3676,7 +3686,7 @@ class Ce extends me {
|
|
|
3676
3686
|
const i = n.feature[se];
|
|
3677
3687
|
return this.ze[i];
|
|
3678
3688
|
}
|
|
3679
|
-
|
|
3689
|
+
Wn(t) {
|
|
3680
3690
|
const e = [], n = [];
|
|
3681
3691
|
for (let i = 0; i < t.length; i++) {
|
|
3682
3692
|
const r = t[i];
|
|
@@ -3686,11 +3696,11 @@ class Ce extends me {
|
|
|
3686
3696
|
}
|
|
3687
3697
|
createPainter() {
|
|
3688
3698
|
const t = ee.get3DPainterClass("fill"), e = Z({}, Oe);
|
|
3689
|
-
this.Ln(e,
|
|
3699
|
+
this.Ln(e, t.getBloomSymbol());
|
|
3690
3700
|
return new t(this.regl, this.layer, e, this.layer.options.sceneConfig, 0);
|
|
3691
3701
|
}
|
|
3692
3702
|
updateMesh(t) {
|
|
3693
|
-
return this.Tn(t, this.meshes, this.atlas, this.
|
|
3703
|
+
return this.Tn(t, this.meshes, this.atlas, this.Gn, this.painter, P, Oe, this.Wn);
|
|
3694
3704
|
}
|
|
3695
3705
|
}
|
|
3696
3706
|
|
|
@@ -4038,20 +4048,20 @@ function qe(t, e) {
|
|
|
4038
4048
|
|
|
4039
4049
|
class Xe {
|
|
4040
4050
|
constructor(t = [], e = $e) {
|
|
4041
|
-
if (this.data = t, this.length = this.data.length, this.compare = e, this.length > 0) for (let t = (this.length >> 1) - 1; t >= 0; t--) this.
|
|
4051
|
+
if (this.data = t, this.length = this.data.length, this.compare = e, this.length > 0) for (let t = (this.length >> 1) - 1; t >= 0; t--) this.Bn(t);
|
|
4042
4052
|
}
|
|
4043
4053
|
push(t) {
|
|
4044
|
-
this.data.push(t), this.length++, this.
|
|
4054
|
+
this.data.push(t), this.length++, this.qn(this.length - 1);
|
|
4045
4055
|
}
|
|
4046
4056
|
pop() {
|
|
4047
4057
|
if (0 === this.length) return;
|
|
4048
4058
|
const t = this.data[0], e = this.data.pop();
|
|
4049
|
-
return this.length--, this.length > 0 && (this.data[0] = e, this.
|
|
4059
|
+
return this.length--, this.length > 0 && (this.data[0] = e, this.Bn(0)), t;
|
|
4050
4060
|
}
|
|
4051
4061
|
peek() {
|
|
4052
4062
|
return this.data[0];
|
|
4053
4063
|
}
|
|
4054
|
-
|
|
4064
|
+
qn(t) {
|
|
4055
4065
|
const {data: e, compare: n} = this, i = e[t];
|
|
4056
4066
|
for (;t > 0; ) {
|
|
4057
4067
|
const r = t - 1 >> 1, o = e[r];
|
|
@@ -4060,7 +4070,7 @@ class Xe {
|
|
|
4060
4070
|
}
|
|
4061
4071
|
e[t] = i;
|
|
4062
4072
|
}
|
|
4063
|
-
|
|
4073
|
+
Bn(t) {
|
|
4064
4074
|
const {data: e, compare: n} = this, i = this.length >> 1, r = e[t];
|
|
4065
4075
|
for (;t < i; ) {
|
|
4066
4076
|
let i = 1 + (t << 1), o = e[i];
|
|
@@ -4500,7 +4510,7 @@ Sn.registerRenderer("gl", class extends Ce {
|
|
|
4500
4510
|
constructor(...e) {
|
|
4501
4511
|
super(...e), this.GeometryTypes = [ t.Polygon, t.MultiPolygon ];
|
|
4502
4512
|
}
|
|
4503
|
-
|
|
4513
|
+
Wn(t) {
|
|
4504
4514
|
return [ t ];
|
|
4505
4515
|
}
|
|
4506
4516
|
onConfig(t) {
|
|
@@ -4509,15 +4519,18 @@ Sn.registerRenderer("gl", class extends Ce {
|
|
|
4509
4519
|
}));
|
|
4510
4520
|
}
|
|
4511
4521
|
updateMaterial(t) {
|
|
4512
|
-
this.painter && (this.painter.
|
|
4522
|
+
this.painter && (this.painter.Xn(t), this.layer.options.sideMaterial || this.sidePainter.Xn(t),
|
|
4513
4523
|
this.setToRedraw());
|
|
4514
4524
|
}
|
|
4515
4525
|
updateSideMaterial(t) {
|
|
4516
|
-
this.sidePainter && (this.sidePainter.
|
|
4526
|
+
this.sidePainter && (this.sidePainter.Xn(t), this.setToRedraw());
|
|
4517
4527
|
}
|
|
4518
4528
|
updateDataConfig(t) {
|
|
4519
4529
|
this.painter && (this.painter.updateDataConfig(t), this.kn());
|
|
4520
4530
|
}
|
|
4531
|
+
updateBloom(t) {
|
|
4532
|
+
super.updateBloom(t), this.sidePainter && this.Vn(this.sidePainter, this.sidePainterSymbol, t);
|
|
4533
|
+
}
|
|
4521
4534
|
needCheckPointLineSymbols() {
|
|
4522
4535
|
return !1;
|
|
4523
4536
|
}
|
|
@@ -4526,7 +4539,7 @@ Sn.registerRenderer("gl", class extends Ce {
|
|
|
4526
4539
|
}
|
|
4527
4540
|
createPainter() {
|
|
4528
4541
|
const t = ee.get3DPainterClass("lit");
|
|
4529
|
-
this.painterSymbol = Z({}, Mn), this.sidePainterSymbol = Z({}, Mn), this.Ln(this.painterSymbol,
|
|
4542
|
+
this.painterSymbol = Z({}, Mn), this.sidePainterSymbol = Z({}, Mn), this.Ln(this.painterSymbol, t.getBloomSymbol());
|
|
4530
4543
|
const e = Z({}, Pn, this.layer.options.dataConfig || {});
|
|
4531
4544
|
this.layer.options.material && (this.painterSymbol.material = this.layer.options.material),
|
|
4532
4545
|
this.layer.options.sideMaterial ? this.sidePainterSymbol.material = this.layer.options.sideMaterial : this.sidePainterSymbol.material = this.layer.options.material;
|
|
@@ -4541,31 +4554,31 @@ Sn.registerRenderer("gl", class extends Ce {
|
|
|
4541
4554
|
const e = this.painter;
|
|
4542
4555
|
this.painter = this.sidePainter, super.vt(...t), this.painter = e;
|
|
4543
4556
|
}
|
|
4544
|
-
|
|
4557
|
+
in(...t) {
|
|
4545
4558
|
const e = t[0], n = e.sceneFilter;
|
|
4546
|
-
e.sceneFilter = t => (!n || n(t)) && In(t), super.
|
|
4559
|
+
e.sceneFilter = t => (!n || n(t)) && In(t), super.in(...t), e.sceneFilter = t => (!n || n(t)) && In(t);
|
|
4547
4560
|
const i = this.painter;
|
|
4548
4561
|
this.painter = this.sidePainter, e.sceneFilter = t => (!n || n(t)) && (t => 1 === t.properties.side)(t),
|
|
4549
|
-
super.
|
|
4562
|
+
super.in(...t), this.painter = i, e.sceneFilter = n;
|
|
4550
4563
|
}
|
|
4551
4564
|
createMesh(t, e, n, i, r, o) {
|
|
4552
4565
|
const s = [];
|
|
4553
|
-
this
|
|
4554
|
-
const a = this.
|
|
4566
|
+
this.$n = o;
|
|
4567
|
+
const a = this.Yn(i, n, !0, !1), l = this.Yn(i, n, !1, !0);
|
|
4555
4568
|
if (a) {
|
|
4556
|
-
const r = this.
|
|
4569
|
+
const r = this.hn(a, t, e, n, i, null, o);
|
|
4557
4570
|
r.meshes[0].properties.top = 1, s.push(r);
|
|
4558
4571
|
}
|
|
4559
4572
|
if (l) {
|
|
4560
|
-
const r = this.
|
|
4573
|
+
const r = this.hn(l, t, e, n, i, null, o);
|
|
4561
4574
|
r.meshes[0].properties.side = 1, s.push(r);
|
|
4562
4575
|
}
|
|
4563
4576
|
return s;
|
|
4564
4577
|
}
|
|
4565
|
-
|
|
4578
|
+
Yn(e, n, i, r) {
|
|
4566
4579
|
const o = this.getMap();
|
|
4567
4580
|
n = Mn;
|
|
4568
|
-
const s = this
|
|
4581
|
+
const s = this.$n, a = o.getZoom(), l = new t.Point(0, 0), h = Z({}, Pn, this.layer.options.dataConfig);
|
|
4569
4582
|
if (h.tangent = 1, h.top && (h.top = i), h.side && (h.side = r), !1 === h.top && !1 === h.side) return null;
|
|
4570
4583
|
if (!e.length) return null;
|
|
4571
4584
|
const c = o.getProjection().code;
|
|
@@ -4575,10 +4588,10 @@ Sn.registerRenderer("gl", class extends Ce {
|
|
|
4575
4588
|
const e = t[se];
|
|
4576
4589
|
let n = this.features[e];
|
|
4577
4590
|
if (!n) return;
|
|
4578
|
-
const i = this.
|
|
4591
|
+
const i = this.Yn([ n ], this.painterSymbol, !0, !1);
|
|
4579
4592
|
let r = 0;
|
|
4580
4593
|
i && i.data && this.Pn(this.meshes[r++], n.id, i);
|
|
4581
|
-
const o = this.
|
|
4594
|
+
const o = this.Yn([ n ], this.painterSymbol, !1, !0);
|
|
4582
4595
|
o && o.data && this.Pn(this.meshes[r++], n.id, o);
|
|
4583
4596
|
}
|
|
4584
4597
|
An(e) {
|
|
@@ -4606,7 +4619,7 @@ Sn.registerRenderer("gl", class extends Ce {
|
|
|
4606
4619
|
}
|
|
4607
4620
|
drawOutline(t) {
|
|
4608
4621
|
if (super.drawOutline(t), this._t && this.sidePainter && this.sidePainter.outlineAll(t),
|
|
4609
|
-
this.
|
|
4622
|
+
this.Un) for (let e = 0; e < this.Un.length; e++) this.sidePainter && this.sidePainter.outline(t, this.Un[e]);
|
|
4610
4623
|
}
|
|
4611
4624
|
getShadowMeshes() {
|
|
4612
4625
|
return this.painter ? this.meshes : [];
|
|
@@ -4623,7 +4636,7 @@ let Fn = 1;
|
|
|
4623
4636
|
function En(t, e) {
|
|
4624
4637
|
return q.extend(t, {
|
|
4625
4638
|
init: function() {
|
|
4626
|
-
this
|
|
4639
|
+
this.Jn = {};
|
|
4627
4640
|
},
|
|
4628
4641
|
isVisible() {
|
|
4629
4642
|
return this.painter && this.painter.isVisible();
|
|
@@ -4638,10 +4651,10 @@ function En(t, e) {
|
|
|
4638
4651
|
const l = t.pluginIndex;
|
|
4639
4652
|
a = this.painter = new e(i, n, s, r, l, o);
|
|
4640
4653
|
}
|
|
4641
|
-
this
|
|
4654
|
+
this.Jn || (this.Jn = {});
|
|
4642
4655
|
const l = r.excludes;
|
|
4643
|
-
this.
|
|
4644
|
-
a.startFrame(t), this.
|
|
4656
|
+
this.Zn ? l !== this.Zn && (this.Kn = l ? B(l) : null, this.Zn = l) : l && (this.Zn = l),
|
|
4657
|
+
a.startFrame(t), this.Qn = {};
|
|
4645
4658
|
},
|
|
4646
4659
|
updateCollision: function(t) {
|
|
4647
4660
|
const e = this.painter;
|
|
@@ -4666,7 +4679,7 @@ function En(t, e) {
|
|
|
4666
4679
|
if (!r) return {
|
|
4667
4680
|
retire: i
|
|
4668
4681
|
};
|
|
4669
|
-
const o = this.
|
|
4682
|
+
const o = this.ti(t);
|
|
4670
4683
|
let s = e.geometry;
|
|
4671
4684
|
if (!s) {
|
|
4672
4685
|
const o = n.features, a = n.data;
|
|
@@ -4679,23 +4692,23 @@ function En(t, e) {
|
|
|
4679
4692
|
for (const e in t) return !1;
|
|
4680
4693
|
return !0;
|
|
4681
4694
|
}(o)) for (let t = 0; t < a.length; t++) {
|
|
4682
|
-
const e = this.
|
|
4695
|
+
const e = this.ei(o, a[t].data.aPickingId, a[t].indices, a[t].data.aPosition, a[t].positionSize);
|
|
4683
4696
|
a[t].data.aColor = e;
|
|
4684
4697
|
}
|
|
4685
4698
|
s = e.geometry = r.createGeometries(l, o);
|
|
4686
4699
|
for (let e = 0; e < s.length; e++) s[e] && s[e].geometry && (i = !0, s[e].geometry.properties.features = o,
|
|
4687
|
-
this.
|
|
4700
|
+
this.cn(s[e].geometry, t));
|
|
4688
4701
|
}
|
|
4689
4702
|
let a = this.L(o);
|
|
4690
4703
|
if (!a) {
|
|
4691
|
-
const {meshes: e, retire: n} = this.
|
|
4704
|
+
const {meshes: e, retire: n} = this.ni(s, t);
|
|
4692
4705
|
i || (i = n), a = e;
|
|
4693
4706
|
}
|
|
4694
4707
|
return {
|
|
4695
4708
|
retire: i
|
|
4696
4709
|
};
|
|
4697
4710
|
},
|
|
4698
|
-
|
|
4711
|
+
ni(t, e) {
|
|
4699
4712
|
const {layer: n, tileInfo: i, tileExtent: r, tileTransform: o, tileTranslationMatrix: s, tileVectorTransform: a, tileZoom: l, sceneConfig: h} = e;
|
|
4700
4713
|
let c = !1;
|
|
4701
4714
|
const u = this.painter, f = [ i.extent2d.xmin, i.extent2d.ymax ], d = u.createMeshes(t, o, {
|
|
@@ -4707,10 +4720,10 @@ function En(t, e) {
|
|
|
4707
4720
|
}, e);
|
|
4708
4721
|
if (d.length) {
|
|
4709
4722
|
const t = n.getRenderer().isEnableTileStencil();
|
|
4710
|
-
for (let n = 0; n < d.length; n++) d[n] && (c = !0, this.
|
|
4711
|
-
h.animation && (d.
|
|
4712
|
-
const i = this.
|
|
4713
|
-
this
|
|
4723
|
+
for (let n = 0; n < d.length; n++) d[n] && (c = !0, this.ii(d[n], o, e.timestamp, Fn++, t));
|
|
4724
|
+
h.animation && (d.ri = e.timestamp);
|
|
4725
|
+
const i = this.ti(e);
|
|
4726
|
+
this.Jn[i] = d;
|
|
4714
4727
|
}
|
|
4715
4728
|
return {
|
|
4716
4729
|
meshes: d,
|
|
@@ -4723,10 +4736,10 @@ function En(t, e) {
|
|
|
4723
4736
|
let s = e.geometry;
|
|
4724
4737
|
if (!s) return On;
|
|
4725
4738
|
let a = !1;
|
|
4726
|
-
const l = this.
|
|
4739
|
+
const l = this.ti(t);
|
|
4727
4740
|
let h = this.L(l);
|
|
4728
4741
|
if (!h) {
|
|
4729
|
-
const {meshes: e, retire: n} = this.
|
|
4742
|
+
const {meshes: e, retire: n} = this.ni(s, t);
|
|
4730
4743
|
a || (a = n), h = e;
|
|
4731
4744
|
}
|
|
4732
4745
|
if (!h.length) return On;
|
|
@@ -4735,21 +4748,21 @@ function En(t, e) {
|
|
|
4735
4748
|
t.properties.tile = n, t.properties.level = c;
|
|
4736
4749
|
});
|
|
4737
4750
|
let u = !1;
|
|
4738
|
-
if (!this.
|
|
4751
|
+
if (!this.Qn[l]) {
|
|
4739
4752
|
let e = null, n = r.animation;
|
|
4740
4753
|
if (n) {
|
|
4741
|
-
const i = t.sceneConfig.animationDuration || 800, r = (t.timestamp - h.
|
|
4742
|
-
h.
|
|
4754
|
+
const i = t.sceneConfig.animationDuration || 800, r = (t.timestamp - h.ri) / i, o = h[0].properties.createTime;
|
|
4755
|
+
h.ri - o < i && r < 1 && (!0 !== n && 1 !== n || (n = "linear"), e = "linear" === n ? r : W(n, r),
|
|
4743
4756
|
u = !0);
|
|
4744
4757
|
}
|
|
4745
|
-
o.addMesh(h, e, t), this.
|
|
4758
|
+
o.addMesh(h, e, t), this.Qn[l] = 1;
|
|
4746
4759
|
}
|
|
4747
4760
|
return {
|
|
4748
4761
|
redraw: u,
|
|
4749
4762
|
retire: a
|
|
4750
4763
|
};
|
|
4751
4764
|
},
|
|
4752
|
-
|
|
4765
|
+
ii: function(t, e, n, i, r) {
|
|
4753
4766
|
if (t.properties.tileTransform = e, t.properties.createTime = n, t.properties.meshKey = i,
|
|
4754
4767
|
t.needUpdateShadow = !0, r) {
|
|
4755
4768
|
const e = t.defines || {};
|
|
@@ -4761,7 +4774,7 @@ function En(t, e) {
|
|
|
4761
4774
|
});
|
|
4762
4775
|
}
|
|
4763
4776
|
},
|
|
4764
|
-
|
|
4777
|
+
cn: function(t, e) {
|
|
4765
4778
|
const {layer: n, tileInfo: i} = e, r = n.getMap(), o = (n.getSpatialReference ? n.getSpatialReference() : r.getSpatialReference()).getResolution(i.z), s = e.tileExtent / n.getTileSize().width;
|
|
4766
4779
|
t.properties.tileResolution = o, t.properties.tileRatio = s, t.properties.z = i.z,
|
|
4767
4780
|
t.properties.tileExtent = e.tileExtent;
|
|
@@ -4778,8 +4791,8 @@ function En(t, e) {
|
|
|
4778
4791
|
const n = this.painter;
|
|
4779
4792
|
if (!n) return !1;
|
|
4780
4793
|
if (n.shouldDeleteMeshOnUpdateSymbol(t)) {
|
|
4781
|
-
if (this
|
|
4782
|
-
delete this
|
|
4794
|
+
if (this.Jn) for (const t in this.Jn) n.deleteMesh(this.Jn[t], !0);
|
|
4795
|
+
delete this.Jn, delete this.Qn;
|
|
4783
4796
|
}
|
|
4784
4797
|
return n.updateSymbol(t, e);
|
|
4785
4798
|
},
|
|
@@ -4787,17 +4800,17 @@ function En(t, e) {
|
|
|
4787
4800
|
return this.painter && this.painter.pick ? this.painter.pick(t, e, n) : null;
|
|
4788
4801
|
},
|
|
4789
4802
|
deleteTile: function(t) {
|
|
4790
|
-
if (!this
|
|
4791
|
-
const e = this.
|
|
4792
|
-
n && this.painter && this.painter.deleteMesh(n), delete this
|
|
4803
|
+
if (!this.Jn) return;
|
|
4804
|
+
const e = this.ti(t), n = this.Jn[e];
|
|
4805
|
+
n && this.painter && this.painter.deleteMesh(n), delete this.Jn[e], this.Qn && delete this.Qn[e];
|
|
4793
4806
|
},
|
|
4794
4807
|
remove: function() {
|
|
4795
4808
|
const t = this.painter;
|
|
4796
|
-
if (t && this
|
|
4797
|
-
for (const e in this
|
|
4809
|
+
if (t && this.Jn) {
|
|
4810
|
+
for (const e in this.Jn) t.deleteMesh(this.Jn[e]);
|
|
4798
4811
|
t.delete(), delete this.painter;
|
|
4799
4812
|
}
|
|
4800
|
-
delete this
|
|
4813
|
+
delete this.Jn, delete this.Qn;
|
|
4801
4814
|
},
|
|
4802
4815
|
resize: function(t, e) {
|
|
4803
4816
|
const n = this.painter;
|
|
@@ -4818,7 +4831,7 @@ function En(t, e) {
|
|
|
4818
4831
|
isTerrainVector: function() {
|
|
4819
4832
|
return !!this.painter && this.painter.isTerrainVector();
|
|
4820
4833
|
},
|
|
4821
|
-
|
|
4834
|
+
ei: function(t, e, n, i, r = 3) {
|
|
4822
4835
|
if (!i || !t || !e.length) return null;
|
|
4823
4836
|
const o = new Uint8Array(i.length / r * 4);
|
|
4824
4837
|
let s, a;
|
|
@@ -4835,31 +4848,31 @@ function En(t, e) {
|
|
|
4835
4848
|
}
|
|
4836
4849
|
return o;
|
|
4837
4850
|
},
|
|
4838
|
-
|
|
4851
|
+
ti: function(t) {
|
|
4839
4852
|
const e = t.tileInfo;
|
|
4840
4853
|
return e.meshKey || (e.meshKey = Fn++), e.meshKey;
|
|
4841
4854
|
},
|
|
4842
4855
|
L: function(t) {
|
|
4843
|
-
return this
|
|
4856
|
+
return this.Jn[t];
|
|
4844
4857
|
},
|
|
4845
|
-
|
|
4858
|
+
oi(t, e) {
|
|
4846
4859
|
if (Array.isArray(t)) t.forEach((t, n) => {
|
|
4847
4860
|
const {features: i} = t.properties;
|
|
4848
|
-
this.
|
|
4861
|
+
this.si(t, e[n], i);
|
|
4849
4862
|
}); else {
|
|
4850
4863
|
const {features: n} = t.properties;
|
|
4851
|
-
this.
|
|
4864
|
+
this.si(t, Array.isArray(e) ? e[0] : e, n);
|
|
4852
4865
|
}
|
|
4853
4866
|
},
|
|
4854
|
-
|
|
4867
|
+
si(t, e, n) {
|
|
4855
4868
|
const i = e.featureIndexes || e.data.featureIndexes;
|
|
4856
|
-
if (i) if (this.
|
|
4869
|
+
if (i) if (this.Kn) {
|
|
4857
4870
|
const r = e.indices;
|
|
4858
4871
|
let o = null, s = !1;
|
|
4859
4872
|
const a = [];
|
|
4860
4873
|
for (let t = 0; t < r.length; t++) {
|
|
4861
4874
|
const e = n[i[r[t]]];
|
|
4862
|
-
null !== o && o === r[t] || (s = this.
|
|
4875
|
+
null !== o && o === r[t] || (s = this.Kn(e.feature), o = r[t]), s || a.push(r[t]);
|
|
4863
4876
|
}
|
|
4864
4877
|
t.setElements(new e.indices.constructor(a));
|
|
4865
4878
|
} else t.setElements(e.indices);
|
|
@@ -4899,15 +4912,15 @@ function En(t, e) {
|
|
|
4899
4912
|
|
|
4900
4913
|
class zn {
|
|
4901
4914
|
constructor() {
|
|
4902
|
-
this.
|
|
4915
|
+
this.ai = 1;
|
|
4903
4916
|
}
|
|
4904
4917
|
write(t, e) {
|
|
4905
|
-
const n = t.gl, i = this.
|
|
4918
|
+
const n = t.gl, i = this.ai++;
|
|
4906
4919
|
return t.stencilFunc(n.ALWAYS, i, 255), t.draw(e), i;
|
|
4907
4920
|
}
|
|
4908
4921
|
start(t) {
|
|
4909
4922
|
const e = t.gl;
|
|
4910
|
-
e.clearStencil(255), e.clear(e.STENCIL_BUFFER_BIT), this.
|
|
4923
|
+
e.clearStencil(255), e.clear(e.STENCIL_BUFFER_BIT), this.ai = 1, t.start();
|
|
4911
4924
|
}
|
|
4912
4925
|
end(t) {
|
|
4913
4926
|
t.end();
|
|
@@ -5006,7 +5019,7 @@ const Zn = "_fn_type_";
|
|
|
5006
5019
|
function Kn(t, e, n) {
|
|
5007
5020
|
if (!Jn(t.properties.features)) for (let i = 0; i < n.length; i++) {
|
|
5008
5021
|
const {symbolName: r} = n[i];
|
|
5009
|
-
(t.
|
|
5022
|
+
(t.li = t.li || {})[r] = e[r], Qn(t, e, n[i]);
|
|
5010
5023
|
}
|
|
5011
5024
|
}
|
|
5012
5025
|
|
|
@@ -5067,7 +5080,7 @@ function ni(t, e, n, i, r) {
|
|
|
5067
5080
|
const a = n[s], l = a.attrName;
|
|
5068
5081
|
if (!ii(o, e, a)) {
|
|
5069
5082
|
const {aPickingId: t} = o.properties;
|
|
5070
|
-
if (!t || o.
|
|
5083
|
+
if (!t || o.hi === r) continue;
|
|
5071
5084
|
const e = (Zn + l + "Index").trim(), n = o.properties[e];
|
|
5072
5085
|
if (!n) continue;
|
|
5073
5086
|
si(o, n, a);
|
|
@@ -5086,13 +5099,13 @@ function ni(t, e, n, i, r) {
|
|
|
5086
5099
|
t[c] && (delete t[c], i.setDefines(t));
|
|
5087
5100
|
}
|
|
5088
5101
|
}
|
|
5089
|
-
o.
|
|
5102
|
+
o.hi = r;
|
|
5090
5103
|
}
|
|
5091
5104
|
}
|
|
5092
5105
|
|
|
5093
5106
|
function ii(t, e, n) {
|
|
5094
|
-
const i = e[n.symbolName], r = t.
|
|
5095
|
-
return i
|
|
5107
|
+
const i = e[n.symbolName], r = t.li;
|
|
5108
|
+
return !z(i, r[n.symbolName]) && (r[n.symbolName] = i, !0);
|
|
5096
5109
|
}
|
|
5097
5110
|
|
|
5098
5111
|
function ri(t, e, n) {
|
|
@@ -5166,40 +5179,40 @@ ci.prototype = {
|
|
|
5166
5179
|
return new ci(this.x, this.y);
|
|
5167
5180
|
},
|
|
5168
5181
|
add: function(t) {
|
|
5169
|
-
return this.clone().
|
|
5182
|
+
return this.clone().ci(t);
|
|
5170
5183
|
},
|
|
5171
5184
|
sub: function(t) {
|
|
5172
|
-
return this.clone().
|
|
5185
|
+
return this.clone().ui(t);
|
|
5173
5186
|
},
|
|
5174
5187
|
multByPoint: function(t) {
|
|
5175
|
-
return this.clone().
|
|
5188
|
+
return this.clone().fi(t);
|
|
5176
5189
|
},
|
|
5177
5190
|
divByPoint: function(t) {
|
|
5178
|
-
return this.clone().
|
|
5191
|
+
return this.clone().di(t);
|
|
5179
5192
|
},
|
|
5180
5193
|
mult: function(t) {
|
|
5181
|
-
return this.clone().
|
|
5194
|
+
return this.clone().pi(t);
|
|
5182
5195
|
},
|
|
5183
5196
|
div: function(t) {
|
|
5184
|
-
return this.clone().
|
|
5197
|
+
return this.clone().mi(t);
|
|
5185
5198
|
},
|
|
5186
5199
|
rotate: function(t) {
|
|
5187
|
-
return this.clone().
|
|
5200
|
+
return this.clone().yi(t);
|
|
5188
5201
|
},
|
|
5189
5202
|
rotateAround: function(t, e) {
|
|
5190
|
-
return this.clone().
|
|
5203
|
+
return this.clone().gi(t, e);
|
|
5191
5204
|
},
|
|
5192
5205
|
matMult: function(t) {
|
|
5193
|
-
return this.clone().
|
|
5206
|
+
return this.clone().vi(t);
|
|
5194
5207
|
},
|
|
5195
5208
|
unit: function() {
|
|
5196
|
-
return this.clone().
|
|
5209
|
+
return this.clone().bi();
|
|
5197
5210
|
},
|
|
5198
5211
|
perp: function() {
|
|
5199
|
-
return this.clone().
|
|
5212
|
+
return this.clone().xi();
|
|
5200
5213
|
},
|
|
5201
5214
|
round: function() {
|
|
5202
|
-
return this.clone().
|
|
5215
|
+
return this.clone().wi();
|
|
5203
5216
|
},
|
|
5204
5217
|
mag: function() {
|
|
5205
5218
|
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
@@ -5226,44 +5239,44 @@ ci.prototype = {
|
|
|
5226
5239
|
angleWithSep: function(t, e) {
|
|
5227
5240
|
return Math.atan2(this.x * e - this.y * t, this.x * t + this.y * e);
|
|
5228
5241
|
},
|
|
5229
|
-
|
|
5242
|
+
vi: function(t) {
|
|
5230
5243
|
var e = t[0] * this.x + t[1] * this.y, n = t[2] * this.x + t[3] * this.y;
|
|
5231
5244
|
return this.x = e, this.y = n, this;
|
|
5232
5245
|
},
|
|
5233
|
-
|
|
5246
|
+
ci: function(t) {
|
|
5234
5247
|
return this.x += t.x, this.y += t.y, this;
|
|
5235
5248
|
},
|
|
5236
|
-
|
|
5249
|
+
ui: function(t) {
|
|
5237
5250
|
return this.x -= t.x, this.y -= t.y, this;
|
|
5238
5251
|
},
|
|
5239
|
-
|
|
5252
|
+
pi: function(t) {
|
|
5240
5253
|
return this.x *= t, this.y *= t, this;
|
|
5241
5254
|
},
|
|
5242
|
-
|
|
5255
|
+
mi: function(t) {
|
|
5243
5256
|
return this.x /= t, this.y /= t, this;
|
|
5244
5257
|
},
|
|
5245
|
-
|
|
5258
|
+
fi: function(t) {
|
|
5246
5259
|
return this.x *= t.x, this.y *= t.y, this;
|
|
5247
5260
|
},
|
|
5248
|
-
|
|
5261
|
+
di: function(t) {
|
|
5249
5262
|
return this.x /= t.x, this.y /= t.y, this;
|
|
5250
5263
|
},
|
|
5251
|
-
|
|
5252
|
-
return this.
|
|
5264
|
+
bi: function() {
|
|
5265
|
+
return this.mi(this.mag()), this;
|
|
5253
5266
|
},
|
|
5254
|
-
|
|
5267
|
+
xi: function() {
|
|
5255
5268
|
var t = this.y;
|
|
5256
5269
|
return this.y = this.x, this.x = -t, this;
|
|
5257
5270
|
},
|
|
5258
|
-
|
|
5271
|
+
yi: function(t) {
|
|
5259
5272
|
var e = Math.cos(t), n = Math.sin(t), i = e * this.x - n * this.y, r = n * this.x + e * this.y;
|
|
5260
5273
|
return this.x = i, this.y = r, this;
|
|
5261
5274
|
},
|
|
5262
|
-
|
|
5275
|
+
gi: function(t, e) {
|
|
5263
5276
|
var n = Math.cos(t), i = Math.sin(t), r = e.x + n * (this.x - e.x) - i * (this.y - e.y), o = e.y + i * (this.x - e.x) + n * (this.y - e.y);
|
|
5264
5277
|
return this.x = r, this.y = o, this;
|
|
5265
5278
|
},
|
|
5266
|
-
|
|
5279
|
+
wi: function() {
|
|
5267
5280
|
return this.x = Math.round(this.x), this.y = Math.round(this.y), this;
|
|
5268
5281
|
}
|
|
5269
5282
|
}, ci.convert = function(t) {
|
|
@@ -5306,16 +5319,19 @@ function xi(t, e, n, i) {
|
|
|
5306
5319
|
const {loginIBLResOnCanvas: wi, logoutIBLResOnCanvas: Ai, getIBLResOnCanvas: ki} = n.pbr.PBRUtils, _i = [], Ti = [], Si = new t.Point(0, 0), Mi = new t.Point(0, 0), Pi = new Float32Array(1), Ii = [], Oi = t => 0 === t.properties.level, Ci = t => t.properties.level > 0;
|
|
5307
5320
|
|
|
5308
5321
|
class Fi {
|
|
5322
|
+
static getBloomSymbol() {
|
|
5323
|
+
return "bloom";
|
|
5324
|
+
}
|
|
5309
5325
|
constructor(t, e, i, r, o, s) {
|
|
5310
|
-
this.
|
|
5326
|
+
this.Ai = !0, this.regl = t, this.layer = e, this.canvas = t._gl.canvas, this.sceneConfig = r || {},
|
|
5311
5327
|
this.dataConfig = s || {}, this.pluginIndex = o, this.scene = new n.Scene, this.pickingFBO = e.getRenderer().pickingFBO,
|
|
5312
|
-
this.
|
|
5313
|
-
this.symbolDef = Array.isArray(i) ? i.map(t => Ln(t)) : [ Ln(i) ], this.
|
|
5328
|
+
this.ki = new zn, this.level0Filter = Oi, this.levelNFilter = Ci, this.loginTextureCache(),
|
|
5329
|
+
this.symbolDef = Array.isArray(i) ? i.map(t => Ln(t)) : [ Ln(i) ], this._i(), this.pickingViewport = {
|
|
5314
5330
|
x: 0,
|
|
5315
5331
|
y: 0,
|
|
5316
5332
|
width: () => this.canvas ? this.canvas.width : 1,
|
|
5317
5333
|
height: () => this.canvas ? this.canvas.height : 1
|
|
5318
|
-
}, this.sortByCommandKey = Ei.bind(this), this.colorCache = {}, this.
|
|
5334
|
+
}, this.sortByCommandKey = Ei.bind(this), this.colorCache = {}, this.Ti = this.symbolDef.map(t => !(!t || !1 !== t.visible));
|
|
5319
5335
|
}
|
|
5320
5336
|
getMap() {
|
|
5321
5337
|
return this.layer ? this.layer.getMap() : null;
|
|
@@ -5328,7 +5344,7 @@ class Fi {
|
|
|
5328
5344
|
const {minZoom: t, maxZoom: e} = this.sceneConfig, n = this.getMap().getZoom();
|
|
5329
5345
|
if (!Nn(t) && n < t) return !1;
|
|
5330
5346
|
if (!Nn(e) && n > e) return !1;
|
|
5331
|
-
const i = this.
|
|
5347
|
+
const i = this.Si;
|
|
5332
5348
|
if (i.length) for (let t = 0; t < i.length; t++) if (i[t] && !i[t].isFeatureConstant) return !0;
|
|
5333
5349
|
const r = this.getSymbols();
|
|
5334
5350
|
for (let t = 0; t < r.length; t++) {
|
|
@@ -5340,7 +5356,7 @@ class Fi {
|
|
|
5340
5356
|
isMeshVisible(t) {
|
|
5341
5357
|
const e = t && t.properties && t.properties.symbolIndex;
|
|
5342
5358
|
if (!e) return !1;
|
|
5343
|
-
const n = this.
|
|
5359
|
+
const n = this.Si, i = e.index;
|
|
5344
5360
|
let r;
|
|
5345
5361
|
if (n[i]) {
|
|
5346
5362
|
if (!n[i].isFeatureConstant) return !0;
|
|
@@ -5352,7 +5368,7 @@ class Fi {
|
|
|
5352
5368
|
return !1;
|
|
5353
5369
|
}
|
|
5354
5370
|
needToRedraw() {
|
|
5355
|
-
return this.isAnimating() || this.
|
|
5371
|
+
return this.isAnimating() || this.Mi;
|
|
5356
5372
|
}
|
|
5357
5373
|
needToRetireFrames() {
|
|
5358
5374
|
return this.J;
|
|
@@ -5368,16 +5384,16 @@ class Fi {
|
|
|
5368
5384
|
}
|
|
5369
5385
|
isShadowIncludeChanged(t) {
|
|
5370
5386
|
const e = t && t.isRenderingTerrain && this.isTerrainSkin();
|
|
5371
|
-
return t && t.states && t.states.includesChanged.shadow || e && this.
|
|
5387
|
+
return t && t.states && t.states.includesChanged.shadow || e && this.Pi;
|
|
5372
5388
|
}
|
|
5373
5389
|
fillIncludes(t, e, n) {
|
|
5374
|
-
if (delete this.
|
|
5390
|
+
if (delete this.Pi, n && n.isRenderingTerrain && this.isTerrainSkin()) return;
|
|
5375
5391
|
const i = n && n.includes;
|
|
5376
5392
|
if (i) {
|
|
5377
5393
|
let r = "";
|
|
5378
5394
|
for (const o in i) i[o] && (r += o, n[o].uniformDeclares && e.push(...n[o].uniformDeclares),
|
|
5379
5395
|
n[o].defines && jn(t, n[o].defines));
|
|
5380
|
-
this.
|
|
5396
|
+
this.Pi = r;
|
|
5381
5397
|
}
|
|
5382
5398
|
}
|
|
5383
5399
|
setIncludeUniformValues(t, e) {
|
|
@@ -5393,10 +5409,10 @@ class Fi {
|
|
|
5393
5409
|
symbolIndex: t[i].symbolIndex,
|
|
5394
5410
|
ref: t[i].ref
|
|
5395
5411
|
}) : n.push(null); else {
|
|
5396
|
-
t[i] && !t[i].is2D && (this.
|
|
5412
|
+
t[i] && !t[i].is2D && (this.Ai = !1);
|
|
5397
5413
|
const r = this.createGeometry(t[i], e, i);
|
|
5398
5414
|
if (r && r.geometry) {
|
|
5399
|
-
const o = r.geometry.properties, {pickingIdMap: s, idPickingMap: a, hasFeaIds: l} = this.
|
|
5415
|
+
const o = r.geometry.properties, {pickingIdMap: s, idPickingMap: a, hasFeaIds: l} = this.Ii(t[i]);
|
|
5400
5416
|
l && (o.feaIdPickingMap = s, o.feaPickingIdMap = a), o.symbolIndex = r.symbolIndex,
|
|
5401
5417
|
o.features = e, o.is2D = t[i].is2D, this.postCreateGeometry(r, n);
|
|
5402
5418
|
}
|
|
@@ -5405,10 +5421,10 @@ class Fi {
|
|
|
5405
5421
|
return n;
|
|
5406
5422
|
}
|
|
5407
5423
|
isOnly2D() {
|
|
5408
|
-
return this.
|
|
5424
|
+
return this.Ai;
|
|
5409
5425
|
}
|
|
5410
5426
|
postCreateGeometry() {}
|
|
5411
|
-
|
|
5427
|
+
Ii(t) {
|
|
5412
5428
|
if (!t) return {};
|
|
5413
5429
|
if (Array.isArray(t) && !(t = t[0])) return {};
|
|
5414
5430
|
const e = t.featureIds, n = {}, i = {}, r = e && e.length;
|
|
@@ -5431,7 +5447,7 @@ class Fi {
|
|
|
5431
5447
|
if (!t[s]) continue;
|
|
5432
5448
|
if (r && i && i.isRenderingTerrain && this.isTerrainVector()) {
|
|
5433
5449
|
const e = t[s], n = e && e.geometry;
|
|
5434
|
-
this.
|
|
5450
|
+
this.Oi(n, n.data, n.properties, n.positionSize || n.desc.positionSize, i);
|
|
5435
5451
|
}
|
|
5436
5452
|
let a = this.createMesh(t[s], e, n, i || {});
|
|
5437
5453
|
Array.isArray(a) ? (a = a.filter(t => !!t), o.push(...a)) : a && o.push(a);
|
|
@@ -5467,13 +5483,13 @@ class Fi {
|
|
|
5467
5483
|
if (!!a.HAS_BLOOM !== e && (s = !0, e ? a.HAS_BLOOM = 1 : delete a.HAS_BLOOM), i) {
|
|
5468
5484
|
if (t.geometry.data.aTerrainAltitude) {
|
|
5469
5485
|
const e = t.geometry;
|
|
5470
|
-
this.
|
|
5486
|
+
this.Oi(e, e.data, e.properties, e.desc.positionSize, n);
|
|
5471
5487
|
}
|
|
5472
5488
|
t.geometry.data.aTerrainAltitude && !a.HAS_TERRAIN_ALTITUDE && (a.HAS_TERRAIN_ALTITUDE = 1,
|
|
5473
5489
|
s = !0);
|
|
5474
5490
|
} else a.HAS_TERRAIN_ALTITUDE && (delete a.HAS_TERRAIN_ALTITUDE, s = !0);
|
|
5475
5491
|
s && t.setDefines(a), r ? t.setUniform("targetFramebuffer", r) : t.uniforms.targetFramebuffer && (t.uniforms.targetFramebuffer = null),
|
|
5476
|
-
this.
|
|
5492
|
+
this.Ci(t);
|
|
5477
5493
|
}), this.scene.addMesh(t);
|
|
5478
5494
|
}
|
|
5479
5495
|
updateCollision() {}
|
|
@@ -5483,17 +5499,18 @@ class Fi {
|
|
|
5483
5499
|
}
|
|
5484
5500
|
prepareRender(t) {
|
|
5485
5501
|
if (this.ut === t.timestamp) return;
|
|
5486
|
-
if (
|
|
5502
|
+
if (!this.createFnTypeConfig) return;
|
|
5487
5503
|
const e = this.scene.getMeshes();
|
|
5488
5504
|
if (!e || !e.length) return;
|
|
5489
5505
|
const n = t && t.sceneFilter, i = this.getMap().getZoom();
|
|
5490
|
-
for (let
|
|
5491
|
-
if (!e[
|
|
5492
|
-
if (n && !n(e[
|
|
5493
|
-
const {symbolIndex:
|
|
5494
|
-
if (!
|
|
5495
|
-
|
|
5496
|
-
|
|
5506
|
+
for (let r = 0; r < e.length; r++) {
|
|
5507
|
+
if (!e[r] || !e[r].geometry) continue;
|
|
5508
|
+
if (n && !n(e[r])) continue;
|
|
5509
|
+
const {symbolIndex: o} = e[r].properties, s = this.getSymbolDef(o);
|
|
5510
|
+
if (!s) continue;
|
|
5511
|
+
this.ut = t.timestamp;
|
|
5512
|
+
const a = this.getFnTypeConfig(o);
|
|
5513
|
+
ni(this.regl, s, a, e[r], i);
|
|
5497
5514
|
}
|
|
5498
5515
|
}
|
|
5499
5516
|
paint(t) {
|
|
@@ -5501,14 +5518,14 @@ class Fi {
|
|
|
5501
5518
|
if (!e) return {
|
|
5502
5519
|
redraw: !1
|
|
5503
5520
|
};
|
|
5504
|
-
this.
|
|
5521
|
+
this.Fi = t;
|
|
5505
5522
|
const n = this.getUniformValues(e, t);
|
|
5506
5523
|
return this.callShader(n, t), {
|
|
5507
|
-
redraw: this.
|
|
5524
|
+
redraw: this.Mi
|
|
5508
5525
|
};
|
|
5509
5526
|
}
|
|
5510
5527
|
setToRedraw(t) {
|
|
5511
|
-
t && (this.J = t), this.
|
|
5528
|
+
t && (this.J = t), this.Mi = !0;
|
|
5512
5529
|
}
|
|
5513
5530
|
callShader(t, e) {
|
|
5514
5531
|
this.callCurrentTileShader(t, e), this.callBackgroundTileShader(t, e);
|
|
@@ -5573,7 +5590,7 @@ class Fi {
|
|
|
5573
5590
|
f.features || (f = u.properties), c && c.length && (c[0] = Math.round(1e5 * c[0]) / 1e5,
|
|
5574
5591
|
c[1] = Math.round(1e5 * c[1]) / 1e5, c[2] = Math.round(1e5 * c[2]) / 1e5);
|
|
5575
5592
|
return {
|
|
5576
|
-
data: this.
|
|
5593
|
+
data: this.Ei(f && f.features && f.features[h]),
|
|
5577
5594
|
point: c,
|
|
5578
5595
|
coordinate: a.coordinate,
|
|
5579
5596
|
plugin: this.pluginIndex
|
|
@@ -5581,7 +5598,7 @@ class Fi {
|
|
|
5581
5598
|
}
|
|
5582
5599
|
return null;
|
|
5583
5600
|
}
|
|
5584
|
-
|
|
5601
|
+
Ei(t) {
|
|
5585
5602
|
const e = t && t.feature;
|
|
5586
5603
|
if (!e || !e.customProps) return t;
|
|
5587
5604
|
const n = jn({}, t);
|
|
@@ -5605,7 +5622,7 @@ class Fi {
|
|
|
5605
5622
|
}
|
|
5606
5623
|
}
|
|
5607
5624
|
startFrame(t) {
|
|
5608
|
-
this.
|
|
5625
|
+
this.zi || (this.init(t), this.zi = !0), this.ut !== t.timestamp && (this.Mi = !1,
|
|
5609
5626
|
this.J = !1), this.scene.clear();
|
|
5610
5627
|
}
|
|
5611
5628
|
resize() {}
|
|
@@ -5614,35 +5631,34 @@ class Fi {
|
|
|
5614
5631
|
for (let t = 0; t < this.picking.length; t++) this.picking[t].dispose();
|
|
5615
5632
|
delete this.picking;
|
|
5616
5633
|
}
|
|
5617
|
-
if (this.
|
|
5618
|
-
for (let t = 0; t < this.
|
|
5619
|
-
delete this.
|
|
5634
|
+
if (this.ji) {
|
|
5635
|
+
for (let t = 0; t < this.ji.length; t++) this.ji[t].dispose();
|
|
5636
|
+
delete this.ji;
|
|
5620
5637
|
}
|
|
5621
|
-
delete this.
|
|
5638
|
+
delete this.Ri, this.logoutTextureCache();
|
|
5622
5639
|
}
|
|
5623
5640
|
updateSymbol(t, e) {
|
|
5624
|
-
const n = this.supportRenderMode("taa");
|
|
5625
5641
|
Array.isArray(t) || (t = [ t ], e = [ e ]);
|
|
5626
|
-
let
|
|
5627
|
-
for (let
|
|
5628
|
-
const r = this.
|
|
5629
|
-
r && (
|
|
5642
|
+
let n = !1;
|
|
5643
|
+
for (let i = 0; i < t.length; i++) if (t[i]) {
|
|
5644
|
+
const r = this.Di(i, t[i], e[i]);
|
|
5645
|
+
r && (n = r);
|
|
5630
5646
|
}
|
|
5631
|
-
return delete this.
|
|
5647
|
+
return delete this.Ni, this.setToRedraw(!1), n;
|
|
5632
5648
|
}
|
|
5633
|
-
|
|
5649
|
+
Li(t, e) {
|
|
5634
5650
|
for (const n in e) if ($n(e, n)) {
|
|
5635
5651
|
if (O.isFnTypeSymbol(e[n]) && !this.layer.options.features && (!t[n] || t[n].property !== e[n].property)) return !0;
|
|
5636
5652
|
if (C[n] && !z(e[n], t[n])) return !0;
|
|
5637
5653
|
}
|
|
5638
5654
|
return !1;
|
|
5639
5655
|
}
|
|
5640
|
-
|
|
5641
|
-
if (!this.
|
|
5642
|
-
const i = this.
|
|
5643
|
-
if (this.
|
|
5656
|
+
Di(t, e, n) {
|
|
5657
|
+
if (!this.Hi) return !1;
|
|
5658
|
+
const i = this.Li(this.symbolDef[t] || {}, n);
|
|
5659
|
+
if (this.Ti[t] && !1 !== n.visible) return this.Ti[t] = !1, !0;
|
|
5644
5660
|
this.symbolDef[t] = Ln(n);
|
|
5645
|
-
const r = this.
|
|
5661
|
+
const r = this.Hi[t];
|
|
5646
5662
|
for (const t in r) delete r[t];
|
|
5647
5663
|
const o = this.getMap(), s = [], a = F.loadSymbolFnTypes(this.symbolDef[t], () => (s[0] = o.getZoom(),
|
|
5648
5664
|
s));
|
|
@@ -5655,35 +5671,35 @@ class Fi {
|
|
|
5655
5671
|
enumerable: !0
|
|
5656
5672
|
}) : r[t] = a[t];
|
|
5657
5673
|
}
|
|
5658
|
-
return p(n.visible) && (this.
|
|
5674
|
+
return p(n.visible) && (this.Si[t] = g(n.visible)), i;
|
|
5659
5675
|
}
|
|
5660
5676
|
getSymbolDef(t) {
|
|
5661
5677
|
return this.symbolDef[t.index];
|
|
5662
5678
|
}
|
|
5663
5679
|
getSymbols() {
|
|
5664
|
-
return this.
|
|
5680
|
+
return this.Hi;
|
|
5665
5681
|
}
|
|
5666
5682
|
getSymbol(t) {
|
|
5667
5683
|
const e = t.index;
|
|
5668
|
-
return this.
|
|
5684
|
+
return this.Hi[e];
|
|
5669
5685
|
}
|
|
5670
|
-
|
|
5686
|
+
_i() {
|
|
5671
5687
|
const t = this.getMap(), e = [], n = () => (e[0] = t.getZoom(), e);
|
|
5672
|
-
this.
|
|
5673
|
-
for (let t = 0; t < this.symbolDef.length; t++) this.
|
|
5674
|
-
this.symbolDef[t] && p(this.symbolDef[t].visible) && (this.
|
|
5688
|
+
this.Hi = [], this.Si = [];
|
|
5689
|
+
for (let t = 0; t < this.symbolDef.length; t++) this.Hi[t] = F.loadSymbolFnTypes(jn({}, this.symbolDef[t]), n),
|
|
5690
|
+
this.symbolDef[t] && p(this.symbolDef[t].visible) && (this.Si[t] = g(this.symbolDef[t].visible));
|
|
5675
5691
|
}
|
|
5676
5692
|
getFnTypeConfig(t) {
|
|
5677
|
-
this.
|
|
5693
|
+
this.Ni || (this.Ni = []);
|
|
5678
5694
|
const e = t.index;
|
|
5679
|
-
if (!this.
|
|
5695
|
+
if (!this.Ni[e]) {
|
|
5680
5696
|
const n = this.getSymbolDef(t), i = this.getMap();
|
|
5681
|
-
this.
|
|
5697
|
+
this.Ni[e] = this.createFnTypeConfig(i, n);
|
|
5682
5698
|
}
|
|
5683
|
-
return this.
|
|
5699
|
+
return this.Ni[e];
|
|
5684
5700
|
}
|
|
5685
|
-
|
|
5686
|
-
delete this.
|
|
5701
|
+
Vi() {
|
|
5702
|
+
delete this.Ni;
|
|
5687
5703
|
}
|
|
5688
5704
|
loginTextureCache() {
|
|
5689
5705
|
const t = "__gl_textures".trim(), e = this.getMap();
|
|
@@ -5692,7 +5708,7 @@ class Fi {
|
|
|
5692
5708
|
}), e[t].count++;
|
|
5693
5709
|
}
|
|
5694
5710
|
logoutTextureCache() {
|
|
5695
|
-
const t = "__gl_textures".trim(), e = this.getMap(), n = this.
|
|
5711
|
+
const t = "__gl_textures".trim(), e = this.getMap(), n = this.Ui;
|
|
5696
5712
|
if (n) for (const i in n) $n(n, i) && e[t][i] && (e[t][i].count--, e[t][i].count <= 0 && delete e[t][i]);
|
|
5697
5713
|
e[t].count--, e[t].count <= 0 && (e[t] = {});
|
|
5698
5714
|
}
|
|
@@ -5706,13 +5722,13 @@ class Fi {
|
|
|
5706
5722
|
r ? r.data = e : r = i[n][t] = {
|
|
5707
5723
|
data: e,
|
|
5708
5724
|
count: 0
|
|
5709
|
-
}, this.
|
|
5725
|
+
}, this.Ui || (this.Ui = {}), r.data.then || this.Ui[t] || (r.count++, this.Ui[t] = 1);
|
|
5710
5726
|
}
|
|
5711
5727
|
disposeCachedTexture(t) {
|
|
5712
5728
|
let e;
|
|
5713
|
-
if (e = "string" == typeof t ? t : t.url, !this.
|
|
5729
|
+
if (e = "string" == typeof t ? t : t.url, !this.Ui || !this.Ui[e]) return;
|
|
5714
5730
|
const n = "__gl_textures".trim();
|
|
5715
|
-
delete this.
|
|
5731
|
+
delete this.Ui[e];
|
|
5716
5732
|
const i = this.getMap();
|
|
5717
5733
|
i[n][e] && (i[n][e].count--, i[n][e].count <= 0 && delete i[n][e]);
|
|
5718
5734
|
}
|
|
@@ -5725,54 +5741,54 @@ class Fi {
|
|
|
5725
5741
|
supportRenderMode(t) {
|
|
5726
5742
|
return "taa" === t || "fxaa" === t;
|
|
5727
5743
|
}
|
|
5728
|
-
|
|
5744
|
+
Gi(t) {
|
|
5729
5745
|
const e = this.scene.getMeshes();
|
|
5730
5746
|
if (!e.length) return;
|
|
5731
5747
|
const n = e.map(t => ({
|
|
5732
5748
|
transform: t.localTransform,
|
|
5733
5749
|
level: t.properties.level,
|
|
5734
5750
|
mesh: t
|
|
5735
|
-
})).sort(this.
|
|
5736
|
-
this.
|
|
5751
|
+
})).sort(this.Wi), i = this.getMap().projViewMatrix;
|
|
5752
|
+
this.ki.start(t);
|
|
5737
5753
|
const o = {};
|
|
5738
5754
|
for (let e = 0; e < n.length; e++) {
|
|
5739
5755
|
const s = n[e].mesh;
|
|
5740
5756
|
let a = o[s.properties.tile.id];
|
|
5741
|
-
void 0 === a && (r.multiply(_i, i, n[e].transform), a = this.
|
|
5757
|
+
void 0 === a && (r.multiply(_i, i, n[e].transform), a = this.ki.write(t, _i), o[s.properties.tile.id] = a),
|
|
5742
5758
|
s.setUniform("ref", a);
|
|
5743
5759
|
}
|
|
5744
|
-
this.
|
|
5760
|
+
this.ki.end(t), this.regl.Bi();
|
|
5745
5761
|
}
|
|
5746
|
-
|
|
5762
|
+
Wi(t, e) {
|
|
5747
5763
|
return e.level - t.level;
|
|
5748
5764
|
}
|
|
5749
5765
|
outline(t, e) {
|
|
5750
5766
|
const n = {};
|
|
5751
|
-
for (let i = 0; i < e.length; i++) Nn(e[i]) || n[e[i]] || (this.
|
|
5767
|
+
for (let i = 0; i < e.length; i++) Nn(e[i]) || n[e[i]] || (this.qi(t, e[i]), n[e[i]] = 1);
|
|
5752
5768
|
}
|
|
5753
|
-
|
|
5769
|
+
qi(t, e) {
|
|
5754
5770
|
if (!this.picking) return;
|
|
5755
|
-
if (this.
|
|
5756
|
-
const i = this.getUniformValues(this.getMap(), this.
|
|
5771
|
+
if (this.Xi || (this.Xi = new n.Scene), !this.ji && (this.$i(), !this.ji)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
|
|
5772
|
+
const i = this.getUniformValues(this.getMap(), this.Fi), r = this.Yi(e);
|
|
5757
5773
|
if (r.length) for (let n = 0; n < r.length; n++) {
|
|
5758
5774
|
const o = r[n].geometry.properties.feaIdPickingMap;
|
|
5759
5775
|
if (o) {
|
|
5760
5776
|
const s = o[e];
|
|
5761
5777
|
if (s) {
|
|
5762
5778
|
const e = {};
|
|
5763
|
-
this.
|
|
5779
|
+
this.Xi.setMeshes(r[n]);
|
|
5764
5780
|
for (let n = 0; n < s.length; n++) {
|
|
5765
5781
|
const r = s[n];
|
|
5766
5782
|
if (!e[r]) {
|
|
5767
5783
|
e[r] = 1, i.highlightPickingId = r;
|
|
5768
|
-
for (let e = 0; e < this.
|
|
5784
|
+
for (let e = 0; e < this.ji.length; e++) this.renderer.render(this.ji[e], i, this.Xi, t);
|
|
5769
5785
|
}
|
|
5770
5786
|
}
|
|
5771
5787
|
}
|
|
5772
5788
|
}
|
|
5773
5789
|
}
|
|
5774
5790
|
}
|
|
5775
|
-
|
|
5791
|
+
Yi(t) {
|
|
5776
5792
|
const e = [], n = this.scene.getMeshes();
|
|
5777
5793
|
for (let i = 0; i < n.length; i++) {
|
|
5778
5794
|
const r = n[i], o = r.geometry.properties.feaIdPickingMap;
|
|
@@ -5782,21 +5798,21 @@ class Fi {
|
|
|
5782
5798
|
}
|
|
5783
5799
|
outlineAll(t) {
|
|
5784
5800
|
if (!this.picking) return;
|
|
5785
|
-
if (!this.
|
|
5786
|
-
const e = this.getUniformValues(this.getMap(), this.
|
|
5801
|
+
if (!this.ji && (this.$i(), !this.ji)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
|
|
5802
|
+
const e = this.getUniformValues(this.getMap(), this.Fi);
|
|
5787
5803
|
e.highlightPickingId = -1;
|
|
5788
|
-
for (let n = 0; n < this.
|
|
5804
|
+
for (let n = 0; n < this.ji.length; n++) this.renderer.render(this.ji[n], e, this.scene, t);
|
|
5789
5805
|
}
|
|
5790
|
-
|
|
5806
|
+
$i() {
|
|
5791
5807
|
if (!this.picking) return;
|
|
5792
5808
|
const t = this.layer.getRenderer().canvas;
|
|
5793
|
-
this.
|
|
5809
|
+
this.ji = [];
|
|
5794
5810
|
for (let e = 0; e < this.picking.length; e++) {
|
|
5795
5811
|
const i = this.picking[e].getPickingVert(), r = {
|
|
5796
5812
|
ENABLE_PICKING: 1,
|
|
5797
5813
|
HAS_PICKING_ID: 1
|
|
5798
5814
|
}, o = this.picking[e].getUniformDeclares().slice(0);
|
|
5799
|
-
void 0 !== o.uPickingId && (r.HAS_PICKING_ID = 2), this.
|
|
5815
|
+
void 0 !== o.uPickingId && (r.HAS_PICKING_ID = 2), this.ji[e] = new n.MeshShader({
|
|
5800
5816
|
vert: i,
|
|
5801
5817
|
frag: "precision highp float;\nuniform float highlightPickingId;\nvarying float vPickingId;\nvoid main() {\n if(highlightPickingId < .0 || floor(highlightPickingId + .5) == floor(vPickingId + .5)) {\n gl_FragColor = vec4(1.);\n } else {\n discard;\n }\n}",
|
|
5802
5818
|
uniforms: o,
|
|
@@ -5822,7 +5838,7 @@ class Fi {
|
|
|
5822
5838
|
equation: "add"
|
|
5823
5839
|
}
|
|
5824
5840
|
}
|
|
5825
|
-
}), this.
|
|
5841
|
+
}), this.ji[e].filter = this.picking[e].filter;
|
|
5826
5842
|
}
|
|
5827
5843
|
}
|
|
5828
5844
|
hasIBL() {
|
|
@@ -5848,8 +5864,8 @@ class Fi {
|
|
|
5848
5864
|
Ai(t, this.getMap());
|
|
5849
5865
|
}
|
|
5850
5866
|
evaluateInFnTypeConfig(t, e, n, i, r) {
|
|
5851
|
-
let o = this
|
|
5852
|
-
o || (o = this
|
|
5867
|
+
let o = this.Ji;
|
|
5868
|
+
o || (o = this.Ji = {});
|
|
5853
5869
|
const s = function(t) {
|
|
5854
5870
|
let e = 0;
|
|
5855
5871
|
const n = t && t.length || 0;
|
|
@@ -5862,16 +5878,16 @@ class Fi {
|
|
|
5862
5878
|
return a || (a = o[s] = r ? y(t) : g(t)), a(n.getZoom(), i);
|
|
5863
5879
|
}
|
|
5864
5880
|
highlight(t) {
|
|
5865
|
-
this.Kt = t, this.
|
|
5881
|
+
this.Kt = t, this.Zi = this.layer.getRenderer().getFrameTimestamp(), this.setToRedraw(!0);
|
|
5866
5882
|
}
|
|
5867
5883
|
cancelAllHighlight() {
|
|
5868
|
-
this.Kt = null, this.
|
|
5884
|
+
this.Kt = null, this.Zi = this.layer.getRenderer().getFrameTimestamp(), this.setToRedraw(!0);
|
|
5869
5885
|
}
|
|
5870
|
-
|
|
5886
|
+
Ki(t, e) {
|
|
5871
5887
|
const {featureIds: n, pickingIdIndiceMap: i} = e;
|
|
5872
5888
|
t.properties.aFeaIds = n, t.properties.pickingIdIndiceMap = i;
|
|
5873
5889
|
}
|
|
5874
|
-
|
|
5890
|
+
Ci(t) {
|
|
5875
5891
|
const {pickingIdIndiceMap: e} = t.geometry.properties, n = this.Kt ? function(t, e, n) {
|
|
5876
5892
|
const {aPickingId: i, feaIdPickingMap: r, features: o} = t.geometry.properties, s = new Map, a = n.keys();
|
|
5877
5893
|
for (const t of a) {
|
|
@@ -5893,27 +5909,27 @@ class Fi {
|
|
|
5893
5909
|
}
|
|
5894
5910
|
return s;
|
|
5895
5911
|
}(t, this.layer, this.Kt) : null;
|
|
5896
|
-
l.highlightMesh(this.regl, t, n, this.
|
|
5912
|
+
l.highlightMesh(this.regl, t, n, this.Zi, e);
|
|
5897
5913
|
}
|
|
5898
|
-
|
|
5914
|
+
Oi(t, e, n, i, r) {
|
|
5899
5915
|
let o = n.aAnchor;
|
|
5900
5916
|
if (!o) {
|
|
5901
5917
|
const {aPosition: t} = e;
|
|
5902
5918
|
o = n.aAnchor = t.slice(0);
|
|
5903
5919
|
}
|
|
5904
5920
|
let s = n.aTerrainAltitude;
|
|
5905
|
-
s || (s = n.aTerrainAltitude = new Float32Array(o.length / i), s.fill(yt)), this.
|
|
5906
|
-
e.aTerrainAltitude ? s.dirty && this.
|
|
5921
|
+
s || (s = n.aTerrainAltitude = new Float32Array(o.length / i), s.fill(yt)), this.Qi(s, o, r.tileInfo, 0, s.length - 1),
|
|
5922
|
+
e.aTerrainAltitude ? s.dirty && this.tr(t, s) : e.aTerrainAltitude = s, s.dirty = !1;
|
|
5907
5923
|
}
|
|
5908
|
-
|
|
5924
|
+
tr(t, e) {
|
|
5909
5925
|
t && t.updateData && t.updateData("aTerrainAltitude", e);
|
|
5910
5926
|
}
|
|
5911
|
-
|
|
5927
|
+
Qi(e, n, i, r, o) {
|
|
5912
5928
|
const {res: s, extent: a, extent2d: l, id: h} = i, c = this.pluginIndex, u = h + "-" + c;
|
|
5913
5929
|
if (i.completeTerrainQuery || (i.completeTerrainQuery = []), i.completeTerrainQuery[c]) return;
|
|
5914
|
-
if (!i.completeTerrainQuery[c] && this.
|
|
5915
|
-
const t = this.
|
|
5916
|
-
return this.
|
|
5930
|
+
if (!i.completeTerrainQuery[c] && this.Ri && this.Ri.has(u)) {
|
|
5931
|
+
const t = this.Ri.getAndRemove(u);
|
|
5932
|
+
return this.Ri.add(u, t), e.set(t.altitudeData), i.terrainTileInfos = t.terrainTileInfos,
|
|
5917
5933
|
e.dirty = !0, void (i.completeTerrainQuery[c] = !0);
|
|
5918
5934
|
}
|
|
5919
5935
|
const f = this.layer, d = f.getMap(), p = f.getRenderer(), m = p && p.getTerrainHelper();
|
|
@@ -5957,8 +5973,8 @@ class Fi {
|
|
|
5957
5973
|
}
|
|
5958
5974
|
}
|
|
5959
5975
|
b.altitudeQueryFrameTime = (b.altitudeQueryFrameTime || 0) + (performance.now() - x),
|
|
5960
|
-
i.completeTerrainQuery[c] = M, M && (this.
|
|
5961
|
-
this.
|
|
5976
|
+
i.completeTerrainQuery[c] = M, M && (this.Ri || (this.Ri = new t.LRUCache(4 * this.layer.options.maxCacheSize)),
|
|
5977
|
+
this.Ri.add(u, {
|
|
5962
5978
|
altitudeData: e,
|
|
5963
5979
|
terrainTileInfos: y
|
|
5964
5980
|
}));
|
|
@@ -5992,7 +6008,7 @@ class ji extends Fi {
|
|
|
5992
6008
|
features: e
|
|
5993
6009
|
}, t.iconAtlas && (o.properties.iconAtlas = t.iconAtlas.image, o.properties.iconPositions = t.iconAtlas.positions),
|
|
5994
6010
|
t.glyphAtlas && (o.properties.glyphAtlas = t.glyphAtlas.image), Jn(e) || (o.properties.aFeaIds = t.featureIds,
|
|
5995
|
-
this.
|
|
6011
|
+
this.Ki(o, t)), t.markerPlacement && (o.properties.markerPlacement = t.markerPlacement),
|
|
5996
6012
|
t.textPlacement && (o.properties.textPlacement = t.textPlacement), jn(o.properties, t.properties),
|
|
5997
6013
|
{
|
|
5998
6014
|
geometry: o,
|
|
@@ -6067,6 +6083,9 @@ const Vi = r.identity([]), Ui = {
|
|
|
6067
6083
|
}, Gi = [];
|
|
6068
6084
|
|
|
6069
6085
|
class Wi extends ji {
|
|
6086
|
+
static getBloomSymbol() {
|
|
6087
|
+
return [ "polygonBloom" ];
|
|
6088
|
+
}
|
|
6070
6089
|
prepareSymbol(t) {
|
|
6071
6090
|
const e = t.polygonFill;
|
|
6072
6091
|
Array.isArray(e) && (3 === e.length && e.push(1), t.polygonFill = e.map(t => 255 * t));
|
|
@@ -6075,7 +6094,7 @@ class Wi extends ji {
|
|
|
6075
6094
|
return this.sceneConfig.antialias || void 0 === this.sceneConfig.antialias ? "fxaa" === t || "fxaaBeforeTaa" === t : super.supportRenderMode(t);
|
|
6076
6095
|
}
|
|
6077
6096
|
isBloom(t) {
|
|
6078
|
-
return !!this.getSymbol(t.properties.symbolIndex).
|
|
6097
|
+
return !!this.getSymbol(t.properties.symbolIndex)[Wi.getBloomSymbol()[0]];
|
|
6079
6098
|
}
|
|
6080
6099
|
forbiddenTerrainUpscale() {
|
|
6081
6100
|
return !0;
|
|
@@ -6164,7 +6183,7 @@ class Wi extends ji {
|
|
|
6164
6183
|
} ];
|
|
6165
6184
|
}
|
|
6166
6185
|
paint(t) {
|
|
6167
|
-
this.isShadowIncludeChanged(t) && (this.shader.dispose(), this.
|
|
6186
|
+
this.isShadowIncludeChanged(t) && (this.shader.dispose(), this.er(t)), super.paint(t);
|
|
6168
6187
|
}
|
|
6169
6188
|
init(t) {
|
|
6170
6189
|
const e = this.regl, i = this.canvas, o = {
|
|
@@ -6210,7 +6229,7 @@ class Wi extends ji {
|
|
|
6210
6229
|
offset: this.getPolygonOffset()
|
|
6211
6230
|
}
|
|
6212
6231
|
};
|
|
6213
|
-
if (this.
|
|
6232
|
+
if (this.er(t, l), this.pickingFBO) {
|
|
6214
6233
|
const t = [];
|
|
6215
6234
|
this.picking = [ new n.FBORayPicking(this.renderer, {
|
|
6216
6235
|
vert: Ri,
|
|
@@ -6225,7 +6244,7 @@ class Wi extends ji {
|
|
|
6225
6244
|
}, this.pickingFBO, this.getMap()) ];
|
|
6226
6245
|
}
|
|
6227
6246
|
}
|
|
6228
|
-
|
|
6247
|
+
er(t, e) {
|
|
6229
6248
|
const i = [], o = [ {
|
|
6230
6249
|
name: "projViewModelMatrix",
|
|
6231
6250
|
type: "function",
|
|
@@ -6257,6 +6276,9 @@ var Bi = "#define SHADER_NAME LINE\n#define AA_CLIP_LIMIT 2.0\n#define AA_LINE_W
|
|
|
6257
6276
|
const qi = r.identity([]), Xi = [];
|
|
6258
6277
|
|
|
6259
6278
|
class $i extends ji {
|
|
6279
|
+
static getBloomSymbol() {
|
|
6280
|
+
return [ "lineBloom" ];
|
|
6281
|
+
}
|
|
6260
6282
|
prepareSymbol(t) {
|
|
6261
6283
|
const e = t.lineColor;
|
|
6262
6284
|
Array.isArray(e) && (3 === e.length && e.push(1), t.lineColor = e.map(t => 255 * t));
|
|
@@ -6269,7 +6291,7 @@ class $i extends ji {
|
|
|
6269
6291
|
return !0;
|
|
6270
6292
|
}
|
|
6271
6293
|
isAnimating() {
|
|
6272
|
-
if (this.
|
|
6294
|
+
if (this.nr) return !0;
|
|
6273
6295
|
const t = this.getSymbols(), e = this.sceneConfig.trailAnimation;
|
|
6274
6296
|
if (e && e.enable) return !0;
|
|
6275
6297
|
for (let e = 0; e < t.length; e++) if (t[e].linePatternFile && t[e].linePatternAnimSpeed) return !0;
|
|
@@ -6279,7 +6301,7 @@ class $i extends ji {
|
|
|
6279
6301
|
return !!super.needToRedraw() || !!this.isAnimating();
|
|
6280
6302
|
}
|
|
6281
6303
|
isBloom(t) {
|
|
6282
|
-
return !!this.getSymbol(t.properties.symbolIndex).
|
|
6304
|
+
return !!this.getSymbol(t.properties.symbolIndex)[$i.getBloomSymbol()[0]];
|
|
6283
6305
|
}
|
|
6284
6306
|
needPolygonOffset() {
|
|
6285
6307
|
return !0;
|
|
@@ -6315,23 +6337,23 @@ class $i extends ji {
|
|
|
6315
6337
|
});
|
|
6316
6338
|
f.setLocalTransform(e), f.positionMatrix = this.getAltitudeOffsetMatrix();
|
|
6317
6339
|
const d = {};
|
|
6318
|
-
return h && (d.HAS_PATTERN = 1), f.properties.symbolIndex = r, this.
|
|
6340
|
+
return h && (d.HAS_PATTERN = 1), f.properties.symbolIndex = r, this.ir(f, d), i.data.aColor && (d.HAS_COLOR = 1),
|
|
6319
6341
|
i.data.aStrokeColor && (d.HAS_STROKE_COLOR = 1), this.setMeshDefines(d, i, s), i.data.aAltitude && (d.HAS_ALTITUDE = 1),
|
|
6320
6342
|
f.setDefines(d), f;
|
|
6321
6343
|
}
|
|
6322
6344
|
addMesh(...t) {
|
|
6323
|
-
delete this.
|
|
6345
|
+
delete this.nr;
|
|
6324
6346
|
const e = t[0];
|
|
6325
6347
|
Array.isArray(e) && e.forEach(t => {
|
|
6326
|
-
this.
|
|
6348
|
+
this.rr(t);
|
|
6327
6349
|
}), super.addMesh(...t);
|
|
6328
6350
|
}
|
|
6329
|
-
|
|
6351
|
+
rr(t) {
|
|
6330
6352
|
if (!t.geometry.aLineWidth && t.material.get("lineWidth") <= 0 || !t.geometry.aOpacity && t.material.get("lineOpacity") <= 0) return;
|
|
6331
6353
|
const e = t.defines;
|
|
6332
|
-
this.
|
|
6354
|
+
this.ir(t, e), t.setDefines(e), t.geometry.properties.hasPatternAnim && (this.nr = 1);
|
|
6333
6355
|
}
|
|
6334
|
-
|
|
6356
|
+
ir(t, e) {
|
|
6335
6357
|
const n = t.geometry, i = this.getSymbol(t.properties.symbolIndex);
|
|
6336
6358
|
n.data.aDasharray || Array.isArray(i.lineDasharray) && i.lineDasharray.reduce((t, e) => t + e, 0) > 0 ? (e.HAS_DASHARRAY = 1,
|
|
6337
6359
|
n.data.aDasharray && (e.HAS_DASHARRAY_ATTR = 1), n.data.aDashColor && (e.HAS_DASHARRAY_COLOR = 1)) : e.HAS_DASHARRAY && delete e.HAS_DASHARRAY;
|
|
@@ -6446,7 +6468,7 @@ class $i extends ji {
|
|
|
6446
6468
|
} ];
|
|
6447
6469
|
}
|
|
6448
6470
|
updateSceneConfig(t) {
|
|
6449
|
-
t.trailAnimation && this.createShader(this.
|
|
6471
|
+
t.trailAnimation && this.createShader(this.or);
|
|
6450
6472
|
}
|
|
6451
6473
|
init(t) {
|
|
6452
6474
|
const e = this.regl;
|
|
@@ -6464,7 +6486,7 @@ class $i extends ji {
|
|
|
6464
6486
|
}, this.pickingFBO, this.getMap()) ]);
|
|
6465
6487
|
}
|
|
6466
6488
|
createShader(t) {
|
|
6467
|
-
this.
|
|
6489
|
+
this.or = t;
|
|
6468
6490
|
const e = [], i = {};
|
|
6469
6491
|
this.fillIncludes(i, e, t), this.sceneConfig.trailAnimation && this.sceneConfig.trailAnimation.enable && (i.HAS_TRAIL = 1);
|
|
6470
6492
|
const o = [];
|
|
@@ -6598,7 +6620,7 @@ class Yi extends $i {
|
|
|
6598
6620
|
return this.createShapeFnTypeConfigs(t, e);
|
|
6599
6621
|
}
|
|
6600
6622
|
createShader(t) {
|
|
6601
|
-
this.
|
|
6623
|
+
this.or = t;
|
|
6602
6624
|
const e = [], i = {};
|
|
6603
6625
|
this.fillIncludes(i, e, t), this.sceneConfig.trailAnimation && this.sceneConfig.trailAnimation.enable && (i.HAS_TRAIL = 1);
|
|
6604
6626
|
const o = [];
|
|
@@ -6685,61 +6707,61 @@ class ar extends ji {
|
|
|
6685
6707
|
return super.addMesh(t, e, n);
|
|
6686
6708
|
}
|
|
6687
6709
|
startMeshCollision(t) {
|
|
6688
|
-
const {meshKey: e} = t.properties, {renderer: n} = this.
|
|
6710
|
+
const {meshKey: e} = t.properties, {renderer: n} = this.sr, i = n.isForeground(t instanceof Qi ? t.meshes[0] : t);
|
|
6689
6711
|
if (t.properties.isForeground = i, t instanceof Qi && t.meshes.length) for (let e = 0; e < t.meshes.length; e++) t.meshes[e].properties.isForeground = i;
|
|
6690
|
-
this.
|
|
6712
|
+
this.ar = performance.now(), this.lr = this.hr(), this.cr = this.ur(e);
|
|
6691
6713
|
}
|
|
6692
6714
|
endMeshCollision(t) {
|
|
6693
|
-
const e = this.
|
|
6694
|
-
if (this.
|
|
6715
|
+
const e = this.dr.tags[t];
|
|
6716
|
+
if (this.lr && e && this.cr) {
|
|
6695
6717
|
const t = this.getMap();
|
|
6696
|
-
e.anchor0 = t.containerPointToCoord(this.
|
|
6718
|
+
e.anchor0 = t.containerPointToCoord(this.pr), e.anchor1 = t.containerPointToCoord(this.mr),
|
|
6697
6719
|
e.anchor0.z = t.getZoom(), e.anchor0.width = t.width, e.anchor0.height = t.height;
|
|
6698
6720
|
}
|
|
6699
|
-
this.getMap().collisionFrameTime += performance.now() - this.
|
|
6721
|
+
this.getMap().collisionFrameTime += performance.now() - this.ar;
|
|
6700
6722
|
}
|
|
6701
|
-
|
|
6702
|
-
const e = this.getMap(), n = e.getZoom(), [i, r] = this.
|
|
6703
|
-
return !i || !r || i.z !== n || i.width !== e.width || i.height !== e.height || i.distanceTo(this.
|
|
6723
|
+
ur(t) {
|
|
6724
|
+
const e = this.getMap(), n = e.getZoom(), [i, r] = this.yr(t);
|
|
6725
|
+
return !i || !r || i.z !== n || i.width !== e.width || i.height !== e.height || i.distanceTo(this.pr) > 2 || r.distanceTo(this.mr) > 2;
|
|
6704
6726
|
}
|
|
6705
|
-
|
|
6727
|
+
gr() {
|
|
6706
6728
|
const e = this.getMap();
|
|
6707
|
-
this.
|
|
6708
|
-
delete this.
|
|
6729
|
+
this.vr = {}, this.pr = new t.Point(e.width / 2, e.height / 3), this.mr = new t.Point(e.width / 2, 2 * e.height / 3),
|
|
6730
|
+
delete this.lr, this.dr || (this.dr = {
|
|
6709
6731
|
tags: {}
|
|
6710
|
-
}), this.
|
|
6732
|
+
}), this.sr = {
|
|
6711
6733
|
layer: this.layer,
|
|
6712
6734
|
renderer: this.layer.getRenderer(),
|
|
6713
6735
|
frameTimestamp: this.layer.getRenderer().getFrameTimestamp(),
|
|
6714
6736
|
map: this.getMap(),
|
|
6715
6737
|
zoom: e.getZoom(),
|
|
6716
|
-
collisionTags: this.
|
|
6738
|
+
collisionTags: this.dr.tags,
|
|
6717
6739
|
isEnableUniquePlacement: this.isEnableUniquePlacement()
|
|
6718
6740
|
};
|
|
6719
6741
|
}
|
|
6720
|
-
|
|
6721
|
-
|
|
6722
|
-
const n = this.
|
|
6742
|
+
br() {}
|
|
6743
|
+
xr(t, e) {
|
|
6744
|
+
const n = this.dr;
|
|
6723
6745
|
return n.tags[t] && n.tags[t][e];
|
|
6724
6746
|
}
|
|
6725
|
-
|
|
6726
|
-
const i = this.
|
|
6747
|
+
wr(t, e, n) {
|
|
6748
|
+
const i = this.dr;
|
|
6727
6749
|
i.tags[t] = i.tags[t] || [], i.tags[t][e] = n;
|
|
6728
6750
|
}
|
|
6729
|
-
|
|
6751
|
+
hr() {
|
|
6730
6752
|
const t = this.getMap();
|
|
6731
6753
|
if (!t.isInteracting()) return !0;
|
|
6732
6754
|
const e = this.layer.options.collisionFrameLimit;
|
|
6733
6755
|
return t.collisionFrameTime <= e;
|
|
6734
6756
|
}
|
|
6735
|
-
|
|
6736
|
-
const e = "__meshAnchorKey".trim(), n = this.
|
|
6757
|
+
yr(t) {
|
|
6758
|
+
const e = "__meshAnchorKey".trim(), n = this.dr.tags[t];
|
|
6737
6759
|
if (n && n.anchor0) {
|
|
6738
6760
|
const {anchor0: t, anchor1: i} = n, r = t[e] = t[e] || t.x + "," + t.y, o = i[e] = i[e] || i.x + "," + i.y;
|
|
6739
|
-
let s = this.
|
|
6761
|
+
let s = this.vr[r], a = this.vr[o];
|
|
6740
6762
|
if (!s || !a) {
|
|
6741
6763
|
const e = this.getMap();
|
|
6742
|
-
s = this.
|
|
6764
|
+
s = this.vr[r] = e.coordToContainerPoint(t), a = this.vr[o] = e.coordToContainerPoint(i);
|
|
6743
6765
|
}
|
|
6744
6766
|
return s.z = t.z, rr[0] = s, rr[1] = a, s.width = t.width, s.height = t.height,
|
|
6745
6767
|
rr;
|
|
@@ -6747,14 +6769,14 @@ class ar extends ji {
|
|
|
6747
6769
|
return rr[0] = rr[1] = null, rr;
|
|
6748
6770
|
}
|
|
6749
6771
|
updateBoxCollisionFading(t, e, n, i, r) {
|
|
6750
|
-
const {layer: o, renderer: s, zoom: a, collisionTags: l, isEnableUniquePlacement: h} = this.
|
|
6751
|
-
if (h && this.
|
|
6772
|
+
const {layer: o, renderer: s, zoom: a, collisionTags: l, isEnableUniquePlacement: h} = this.sr, {meshKey: c, isForeground: u} = e.properties;
|
|
6773
|
+
if (h && this.Ar(c, r)) return !1;
|
|
6752
6774
|
const f = n.length;
|
|
6753
6775
|
let d = l[c] && l[c][r];
|
|
6754
|
-
const p = d, m = this.
|
|
6776
|
+
const p = d, m = this.kr && d;
|
|
6755
6777
|
if (!(m && 0 !== d.collides) && t) {
|
|
6756
6778
|
const t = m && 0 === d.collides;
|
|
6757
|
-
if (this.
|
|
6779
|
+
if (this.lr || t) if ((this.cr || d && d.z !== a) && (d = null), d) {
|
|
6758
6780
|
if (d.boxes && d.boxes.length) {
|
|
6759
6781
|
const {boxes: t, isAllowOverlap: e} = d;
|
|
6760
6782
|
let n = 0;
|
|
@@ -6778,19 +6800,19 @@ class ar extends ji {
|
|
|
6778
6800
|
}, d.boxes.length = 0, d.z = a;
|
|
6779
6801
|
let t = 0;
|
|
6780
6802
|
for (let e = 0; e < f; e++) {
|
|
6781
|
-
const {mesh: o, allElements: s, boxCount: a, start: l, end: h} = n[e], c = this.
|
|
6803
|
+
const {mesh: o, allElements: s, boxCount: a, start: l, end: h} = n[e], c = this._r(o, s, a, l, h, i, r);
|
|
6782
6804
|
c.isAllowOverlap && (d.isAllowOverlap = 1), 0 === t && (t = c.collides), c.boxes && d.boxes.push(...c.boxes);
|
|
6783
6805
|
}
|
|
6784
|
-
d.collides = t, this.
|
|
6806
|
+
d.collides = t, this.wr(c, r, d);
|
|
6785
6807
|
}
|
|
6786
6808
|
}
|
|
6787
6809
|
let y = t && d && 0 === d.collides, g = 1, v = !1;
|
|
6788
6810
|
if (this.sceneConfig.fading) {
|
|
6789
|
-
const t = this.
|
|
6790
|
-
if (this.
|
|
6791
|
-
u ? (g > 0 && (y = !0), v = this.isBoxFading(e, r), v && this.setToRedraw()) : y || (this.
|
|
6811
|
+
const t = this.Tr(e);
|
|
6812
|
+
if (this.Sr) t[r] = y ? 1 : -1; else if (u && delete e.Mr, g = this.Pr(u, y, t, r),
|
|
6813
|
+
u ? (g > 0 && (y = !0), v = this.isBoxFading(e, r), v && this.setToRedraw()) : y || (this.Ir(t, r),
|
|
6792
6814
|
g = 0), y) {
|
|
6793
|
-
const n = e.
|
|
6815
|
+
const n = e.Mr;
|
|
6794
6816
|
if (n && 1 === g && t[r] > 0) {
|
|
6795
6817
|
let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
|
|
6796
6818
|
Nn(e) && (e = tr), Nn(t) && (t = nr);
|
|
@@ -6802,7 +6824,7 @@ class ar extends ji {
|
|
|
6802
6824
|
if (d && o.options.debugCollision && this.addCollisionDebugBox(d.boxes, d.collides ? 0 : 1),
|
|
6803
6825
|
y || v) {
|
|
6804
6826
|
const {mesh: t, start: e} = n[0], i = this.getSymbol(t.properties.symbolIndex);
|
|
6805
|
-
!this.
|
|
6827
|
+
!this.Or(i, t, e) && d && d.boxes && this.Cr(d.boxes, t);
|
|
6806
6828
|
}
|
|
6807
6829
|
if (y) {
|
|
6808
6830
|
const t = ir[0] = 255 * g;
|
|
@@ -6818,9 +6840,9 @@ class ar extends ji {
|
|
|
6818
6840
|
}
|
|
6819
6841
|
setCollisionOpacity(t, e, n, i, r) {
|
|
6820
6842
|
const o = e[i], s = e[r - 1];
|
|
6821
|
-
this.
|
|
6843
|
+
this.Fr(t, n, o, s);
|
|
6822
6844
|
}
|
|
6823
|
-
|
|
6845
|
+
Fr(t, e, n, i) {
|
|
6824
6846
|
const {aOpacity: r} = t.geometry.properties;
|
|
6825
6847
|
if (!r) return;
|
|
6826
6848
|
const o = n;
|
|
@@ -6831,38 +6853,38 @@ class ar extends ji {
|
|
|
6831
6853
|
}
|
|
6832
6854
|
}
|
|
6833
6855
|
isBoxFading(t, e) {
|
|
6834
|
-
const {frameTimestamp: n} = this.
|
|
6856
|
+
const {frameTimestamp: n} = this.sr;
|
|
6835
6857
|
let i = this.sceneConfig.fadingDuration;
|
|
6836
6858
|
Nn(i) && (i = tr);
|
|
6837
|
-
return n - Math.abs(this.
|
|
6859
|
+
return n - Math.abs(this.Tr(t)[e]) < i;
|
|
6838
6860
|
}
|
|
6839
|
-
|
|
6840
|
-
const a = this.getSymbol(t.properties.symbolIndex), l = this.
|
|
6861
|
+
_r(t, e, n, i, r, o, s) {
|
|
6862
|
+
const a = this.getSymbol(t.properties.symbolIndex), l = this.Or(a, t, e[i]), h = this.Er(a, t, e[i]);
|
|
6841
6863
|
if (!this.isEnableCollision() || l && h) return or;
|
|
6842
6864
|
const c = this.isBoxCollides(t, e, n, i, r, o, s);
|
|
6843
6865
|
return h && (c.collides = 0, c.isAllowOverlap = 1), c;
|
|
6844
6866
|
}
|
|
6845
|
-
|
|
6867
|
+
Or(t, e, n) {
|
|
6846
6868
|
if (!this.isEnableCollision()) return !0;
|
|
6847
6869
|
const i = e.geometry.properties.aOverlap;
|
|
6848
6870
|
if (!i) return 1 == +t[this.propIgnorePlacement];
|
|
6849
6871
|
const r = i[n], o = r % 8;
|
|
6850
6872
|
return r < 2 ? 1 == +t[this.propIgnorePlacement] : o % 2;
|
|
6851
6873
|
}
|
|
6852
|
-
|
|
6874
|
+
Er(t, e, n) {
|
|
6853
6875
|
if (!this.isEnableCollision()) return !0;
|
|
6854
6876
|
const i = e.geometry.properties.aOverlap;
|
|
6855
6877
|
if (!i) return 1 == +t[this.propAllowOverlap];
|
|
6856
6878
|
const r = i[n], o = r >> 2;
|
|
6857
6879
|
return r < 2 ? 1 == +t[this.propAllowOverlap] : o % 2;
|
|
6858
6880
|
}
|
|
6859
|
-
|
|
6881
|
+
Cr(t) {
|
|
6860
6882
|
if (Array.isArray(t[0])) for (let e = 0; e < t.length; e++) this.insertCollisionBox(t[e]); else this.insertCollisionBox(t);
|
|
6861
6883
|
}
|
|
6862
|
-
|
|
6884
|
+
Pr(t, e, n, i) {
|
|
6863
6885
|
let {fadingDuration: r, fadeInDelay: o, fadeOutDelay: s} = this.sceneConfig;
|
|
6864
6886
|
Nn(r) && (r = tr), Nn(o) && (o = er), Nn(s) && (s = nr);
|
|
6865
|
-
const {frameTimestamp: a} = this.
|
|
6887
|
+
const {frameTimestamp: a} = this.sr;
|
|
6866
6888
|
let l = n[i], h = e ? 1 : 0;
|
|
6867
6889
|
if (!l) return e && t && (n[i] = a + o), 0;
|
|
6868
6890
|
if (a < Math.abs(l) && (!e && l > 0 || e && l < 0)) {
|
|
@@ -6873,31 +6895,31 @@ class ar extends ji {
|
|
|
6873
6895
|
h = (a - l) / r) : (l > 0 && (n[i] = l = -(a + s)), h = 1 - (a + l) / r), (h < 0 || h > 1) && (h = Rn(h, 0, 1)),
|
|
6874
6896
|
h;
|
|
6875
6897
|
}
|
|
6876
|
-
|
|
6877
|
-
this.
|
|
6898
|
+
Tr(t) {
|
|
6899
|
+
this.zr || (this.zr = {});
|
|
6878
6900
|
const {meshKey: e} = t.properties;
|
|
6879
|
-
if (!this.
|
|
6880
|
-
const {frameTimestamp: t} = this.
|
|
6881
|
-
this.
|
|
6901
|
+
if (!this.zr[e]) {
|
|
6902
|
+
const {frameTimestamp: t} = this.sr;
|
|
6903
|
+
this.zr[e] = {
|
|
6882
6904
|
timestamp: t
|
|
6883
6905
|
};
|
|
6884
6906
|
}
|
|
6885
|
-
return this.
|
|
6907
|
+
return this.zr[e];
|
|
6886
6908
|
}
|
|
6887
|
-
|
|
6888
|
-
if (!this.
|
|
6909
|
+
jr(t) {
|
|
6910
|
+
if (!this.Rr) return void (this.Rr = t);
|
|
6889
6911
|
const e = this.scene.getMeshes();
|
|
6890
6912
|
if (e && e.length) {
|
|
6891
6913
|
for (let n = 0; n < e.length; n++) {
|
|
6892
|
-
const i = this.
|
|
6893
|
-
i.timestamp < this.
|
|
6914
|
+
const i = this.Tr(e[n]);
|
|
6915
|
+
i.timestamp < this.Rr ? delete e[n]._fading_timestamps : i.timestamp = t;
|
|
6894
6916
|
}
|
|
6895
|
-
this.
|
|
6917
|
+
this.Rr = t;
|
|
6896
6918
|
}
|
|
6897
6919
|
}
|
|
6898
|
-
|
|
6920
|
+
Ir(t, e) {
|
|
6899
6921
|
if (!t) return;
|
|
6900
|
-
const {frameTimestamp: n} = this.
|
|
6922
|
+
const {frameTimestamp: n} = this.sr;
|
|
6901
6923
|
let {fadingDuration: i} = this.sceneConfig;
|
|
6902
6924
|
Nn(i) && (i = tr), t[e] = -(n - i - 1);
|
|
6903
6925
|
}
|
|
@@ -6905,17 +6927,17 @@ class ar extends ji {
|
|
|
6905
6927
|
if (t) {
|
|
6906
6928
|
if (Array.isArray(t)) for (let e = 0; e < t.length; e++) {
|
|
6907
6929
|
const n = t[e].properties.meshKey;
|
|
6908
|
-
this.
|
|
6930
|
+
this.dr && delete this.dr.tags[n], this.zr && delete this.zr[n];
|
|
6909
6931
|
} else {
|
|
6910
6932
|
const e = t.properties.meshKey;
|
|
6911
|
-
this.
|
|
6933
|
+
this.dr && delete this.dr.tags[e], this.zr && delete this.zr[e];
|
|
6912
6934
|
}
|
|
6913
6935
|
super.deleteMesh(t, e);
|
|
6914
6936
|
}
|
|
6915
6937
|
}
|
|
6916
6938
|
delete(t) {
|
|
6917
|
-
this.
|
|
6918
|
-
delete this.
|
|
6939
|
+
this.Dr && (this.Dr.geometry.dispose(), this.Nr.dispose(), this.Dr.dispose(), delete this.Dr,
|
|
6940
|
+
delete this.Nr, delete this.Lr), delete this.dr, super.delete(t);
|
|
6919
6941
|
}
|
|
6920
6942
|
isCollides(t) {
|
|
6921
6943
|
const e = this.layer;
|
|
@@ -6928,12 +6950,12 @@ class ar extends ji {
|
|
|
6928
6950
|
addCollisionDebugBox(t, e) {
|
|
6929
6951
|
if (t && t.length) if (Array.isArray(t[0])) for (let n = 0; n < t.length; n++) {
|
|
6930
6952
|
const i = t[n];
|
|
6931
|
-
this.
|
|
6932
|
-
} else this.
|
|
6953
|
+
this.Hr(i, e);
|
|
6954
|
+
} else this.Hr(t, e);
|
|
6933
6955
|
}
|
|
6934
|
-
|
|
6956
|
+
Hr(t, e) {
|
|
6935
6957
|
if (!t) return;
|
|
6936
|
-
const n = this.
|
|
6958
|
+
const n = this.Vr = this.Vr || {
|
|
6937
6959
|
aPosition: [],
|
|
6938
6960
|
aVisible: [],
|
|
6939
6961
|
indices: []
|
|
@@ -6944,36 +6966,36 @@ class ar extends ji {
|
|
|
6944
6966
|
n.indices.push(i, i + 1, i + 1, i + 2, i + 2, i + 3, i + 3, i);
|
|
6945
6967
|
}
|
|
6946
6968
|
updateCollision(t) {
|
|
6947
|
-
super.updateCollision(t), this.
|
|
6948
|
-
this.
|
|
6949
|
-
(this.getMap().isZooming() || this.
|
|
6969
|
+
super.updateCollision(t), this.gr(), this.Ur(), this.Gr && this.Gr.length && (this.Wr(),
|
|
6970
|
+
this.Gr && (this.setToRedraw(), this.scene.addMesh(this.Gr)));
|
|
6971
|
+
(this.getMap().isZooming() || this.Gr && this.Gr.length) && (this.Br(), this.qr(this.scene.getMeshes()));
|
|
6950
6972
|
}
|
|
6951
6973
|
paint(t) {
|
|
6952
6974
|
const e = super.paint(t);
|
|
6953
|
-
return this.
|
|
6975
|
+
return this.Xr(t), !1 === this.lr && this.setToRedraw(), e;
|
|
6954
6976
|
}
|
|
6955
6977
|
shouldIgnoreBackground() {
|
|
6956
|
-
return !this.getMap().isZooming() && !this.
|
|
6978
|
+
return !this.getMap().isZooming() && !this.Gr;
|
|
6957
6979
|
}
|
|
6958
|
-
|
|
6980
|
+
Ur() {
|
|
6959
6981
|
const t = this.getMap(), e = t.isZooming();
|
|
6960
|
-
if (!e && this.
|
|
6982
|
+
if (!e && this.kr) {
|
|
6961
6983
|
const t = this.layer.getRenderer();
|
|
6962
|
-
this.
|
|
6963
|
-
} else e && !this.
|
|
6964
|
-
if (e) this.
|
|
6984
|
+
this.Gr = this.scene.getMeshes().filter(e => !t.isForeground(e) && !e.properties.isLinePlacement);
|
|
6985
|
+
} else e && !this.kr && (this.$r = t.getResolution());
|
|
6986
|
+
if (e) this.Yr && (clearTimeout(this.Yr), delete this.Sr, delete this.Yr), this.Sr = this.$r && t.getResolution() > this.$r; else if (this.kr && !this.Yr) {
|
|
6965
6987
|
let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
|
|
6966
|
-
Nn(t) && (t = nr), Nn(e) && (e = tr), this.
|
|
6967
|
-
delete this.
|
|
6988
|
+
Nn(t) && (t = nr), Nn(e) && (e = tr), this.Yr = setTimeout(() => {
|
|
6989
|
+
delete this.Sr, delete this.Yr;
|
|
6968
6990
|
}, t + e + 1);
|
|
6969
6991
|
}
|
|
6970
|
-
this.
|
|
6992
|
+
this.kr = e;
|
|
6971
6993
|
}
|
|
6972
|
-
|
|
6973
|
-
if (!this.
|
|
6974
|
-
this.
|
|
6975
|
-
const {aPosition: e, aVisible: i, indices: r} = this.
|
|
6976
|
-
if (!this.
|
|
6994
|
+
Xr(t) {
|
|
6995
|
+
if (!this.Vr || !this.layer.options.debugCollision) return;
|
|
6996
|
+
this.Lr || this.Jr();
|
|
6997
|
+
const {aPosition: e, aVisible: i, indices: r} = this.Vr;
|
|
6998
|
+
if (!this.Dr) {
|
|
6977
6999
|
const t = new n.Geometry({
|
|
6978
7000
|
aPosition: [],
|
|
6979
7001
|
aVisible: []
|
|
@@ -6981,24 +7003,24 @@ class ar extends ji {
|
|
|
6981
7003
|
positionSize: 2,
|
|
6982
7004
|
primitive: "lines"
|
|
6983
7005
|
});
|
|
6984
|
-
this.
|
|
7006
|
+
this.Dr = new n.Mesh(t), this.Zr = new n.Scene, this.Zr.addMesh(this.Dr);
|
|
6985
7007
|
}
|
|
6986
|
-
const o = this.
|
|
7008
|
+
const o = this.Dr.geometry;
|
|
6987
7009
|
o.updateData("aPosition", new Float32Array(e)), o.updateData("aVisible", new Uint8Array(i)),
|
|
6988
|
-
o.setElements(r), this.
|
|
7010
|
+
o.setElements(r), this.Lr.render(this.Nr, {
|
|
6989
7011
|
size: [ this.canvas.width, this.canvas.height ]
|
|
6990
|
-
}, this.
|
|
7012
|
+
}, this.Zr, this.getRenderFBO(t)), delete this.Vr;
|
|
6991
7013
|
}
|
|
6992
|
-
|
|
7014
|
+
Jr() {
|
|
6993
7015
|
const t = this.regl;
|
|
6994
|
-
this.
|
|
7016
|
+
this.Lr = new n.Renderer(t);
|
|
6995
7017
|
const e = this.canvas, i = {
|
|
6996
7018
|
x: 0,
|
|
6997
7019
|
y: 0,
|
|
6998
7020
|
width: () => e ? e.width : 1,
|
|
6999
7021
|
height: () => e ? e.height : 1
|
|
7000
7022
|
};
|
|
7001
|
-
this.
|
|
7023
|
+
this.Nr = new n.MeshShader({
|
|
7002
7024
|
vert: "attribute vec2 aPosition;\nattribute float aVisible;\nuniform vec2 size;\nvarying vec4 vColor;\nvoid main() {\n vec2 c = (aPosition / size - .5) * 2. * vec2(1., -1.);\n gl_Position = vec4(c, .0, 1.);\n vColor = mix(vec4(1., .0, .0, 1.5) * .5, vec4(.0, 1., .0, 1.) * .4, aVisible);\n}",
|
|
7003
7025
|
frag: "precision mediump float;\nvarying vec4 vColor;\nvoid main() {\n gl_FragColor = vec4(vColor.rgb, .5);\n}",
|
|
7004
7026
|
uniforms: [ "size" ],
|
|
@@ -7018,17 +7040,17 @@ class ar extends ji {
|
|
|
7018
7040
|
}
|
|
7019
7041
|
});
|
|
7020
7042
|
}
|
|
7021
|
-
|
|
7043
|
+
Wr() {
|
|
7022
7044
|
let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
|
|
7023
7045
|
Nn(t) && (t = nr), Nn(e) && (e = tr);
|
|
7024
7046
|
const n = this.layer.getRenderer(), i = n.getCurrentTileZoom(), r = n.getFrameTimestamp(), o = [];
|
|
7025
|
-
for (let s = 0; s < this.
|
|
7026
|
-
const a = this.
|
|
7027
|
-
!a.
|
|
7047
|
+
for (let s = 0; s < this.Gr.length; s++) {
|
|
7048
|
+
const a = this.Gr[s], l = a.properties.tile;
|
|
7049
|
+
!a.Mr && n.isBackTile(l.id) && (a.Mr = r);
|
|
7028
7050
|
const h = l.z - i > 0 ? 2 * (l.z - i) - 1 : 2 * (i - l.z);
|
|
7029
|
-
a.properties.level = h, n.isForeground(a) || a.
|
|
7051
|
+
a.properties.level = h, n.isForeground(a) || a.Mr && r - a.Mr > t + e ? delete a.Mr : o.push(a);
|
|
7030
7052
|
}
|
|
7031
|
-
delete this.
|
|
7053
|
+
delete this.Gr, o.length && (this.Gr = o);
|
|
7032
7054
|
}
|
|
7033
7055
|
isEnableCollision() {
|
|
7034
7056
|
return this.layer.options.collision && !!this.sceneConfig.collision;
|
|
@@ -7039,7 +7061,7 @@ class ar extends ji {
|
|
|
7039
7061
|
isMeshUniquePlaced(t) {
|
|
7040
7062
|
return this.isMeshIterable(t);
|
|
7041
7063
|
}
|
|
7042
|
-
|
|
7064
|
+
Br() {
|
|
7043
7065
|
if (!this.isEnableUniquePlacement()) return;
|
|
7044
7066
|
const t = this.scene.getMeshes(), e = (t, e, n, i) => {
|
|
7045
7067
|
const {start: r, end: o} = e[0], s = t.geometry.properties, a = s.elements;
|
|
@@ -7059,29 +7081,29 @@ class ar extends ji {
|
|
|
7059
7081
|
this.isMeshUniquePlaced(i) && this.forEachBox(i, e);
|
|
7060
7082
|
}
|
|
7061
7083
|
}
|
|
7062
|
-
|
|
7084
|
+
qr(t) {
|
|
7063
7085
|
if (!this.isEnableUniquePlacement()) return;
|
|
7064
7086
|
const e = this.getMap().getZoom();
|
|
7065
|
-
let n = !this.
|
|
7066
|
-
if (!n) for (let e = 0; e < t.length; e++) if (!this.
|
|
7087
|
+
let n = !this.Kr || this.Qr !== e;
|
|
7088
|
+
if (!n) for (let e = 0; e < t.length; e++) if (!this.Kr[t[e].properties.meshKey]) {
|
|
7067
7089
|
n = !0;
|
|
7068
7090
|
break;
|
|
7069
7091
|
}
|
|
7070
7092
|
if (!n) return;
|
|
7071
|
-
this.
|
|
7093
|
+
this.Qr = e, this.to = {}, this.Kr = {}, t = t.sort(hr);
|
|
7072
7094
|
const i = this.getMap().getGLScale(), r = {};
|
|
7073
7095
|
for (let e = 0; e < t.length; e++) {
|
|
7074
7096
|
const n = t[e];
|
|
7075
7097
|
if (!n.geometry) continue;
|
|
7076
7098
|
const {meshKey: o} = n.properties;
|
|
7077
|
-
this.
|
|
7099
|
+
this.Kr[o] = 1;
|
|
7078
7100
|
const {uniquePlacements: s} = n.geometry.properties;
|
|
7079
7101
|
if (s) for (let t = 0; t < s.length; t++) {
|
|
7080
7102
|
if (!s[t]) continue;
|
|
7081
|
-
const {key: e, index: o} = s[t], a = this.
|
|
7103
|
+
const {key: e, index: o} = s[t], a = this.Tr(n), l = lr(e, i), h = r[l];
|
|
7082
7104
|
if (h) {
|
|
7083
7105
|
const t = h.length, e = h[t - 3].properties.meshKey, i = h[t - 2], r = h[t - 1];
|
|
7084
|
-
this.
|
|
7106
|
+
this.to[e] = this.to[e] || {}, this.to[e][r] = 1, this.eo(a, o, i, r), h.push(n, a, o);
|
|
7085
7107
|
} else r[l] = [ n, a, o ];
|
|
7086
7108
|
}
|
|
7087
7109
|
}
|
|
@@ -7094,16 +7116,16 @@ class ar extends ji {
|
|
|
7094
7116
|
}
|
|
7095
7117
|
}
|
|
7096
7118
|
}
|
|
7097
|
-
|
|
7119
|
+
eo(t, e, n, i) {
|
|
7098
7120
|
if (void 0 !== n[i]) if (void 0 === t[e]) t[e] = n[i]; else {
|
|
7099
7121
|
let r = t[e];
|
|
7100
7122
|
Math.abs(n[i]) > Math.abs(r) ? t[e] = n[i] : n[i] = t[e];
|
|
7101
7123
|
} else void 0 !== t[e] && (n[i] = t[e]);
|
|
7102
7124
|
}
|
|
7103
|
-
|
|
7104
|
-
return this.
|
|
7125
|
+
Ar(t, e) {
|
|
7126
|
+
return this.to && this.to[t] && this.to[t][e];
|
|
7105
7127
|
}
|
|
7106
|
-
|
|
7128
|
+
no(t, e) {
|
|
7107
7129
|
const {symbolIndex: n} = t.properties, i = n.type || 0;
|
|
7108
7130
|
let r = t.properties._collidesBoxes;
|
|
7109
7131
|
r || (r = t.properties._collidesBoxes = []);
|
|
@@ -7121,15 +7143,15 @@ class ar extends ji {
|
|
|
7121
7143
|
}
|
|
7122
7144
|
return o[s];
|
|
7123
7145
|
}
|
|
7124
|
-
|
|
7125
|
-
let e = this.
|
|
7126
|
-
if (e || (e = this.
|
|
7146
|
+
io(t) {
|
|
7147
|
+
let e = this.ro;
|
|
7148
|
+
if (e || (e = this.ro = []), !e[t]) {
|
|
7127
7149
|
e[t] = [];
|
|
7128
7150
|
for (let n = 0; n < t; n++) e[t][n] = {};
|
|
7129
7151
|
}
|
|
7130
7152
|
return e[t];
|
|
7131
7153
|
}
|
|
7132
|
-
|
|
7154
|
+
oo(t) {
|
|
7133
7155
|
if (!t || !t.geometry) return !0;
|
|
7134
7156
|
if (!t.geometry.properties.glyphAtlas || !t.material.get("isHalo") || t.geometry.data.aTextHaloRadius && t.geometry.properties.hasHalo) return !1;
|
|
7135
7157
|
if (t.geometry.data.aTextHaloRadius && !t.geometry.properties.hasHalo) return !0;
|
|
@@ -7613,7 +7635,7 @@ function Jr(t, e, n, i, r, o, s) {
|
|
|
7613
7635
|
let v = Yr;
|
|
7614
7636
|
const b = 3 * n[r];
|
|
7615
7637
|
g && -999999 !== g[b] ? (Yr[0] = g[b], Yr[1] = g[b + 1], Yr[2] = g[b + 2]) : v = fi(Yr, y, s, a.width, a.height);
|
|
7616
|
-
const x = i, {boxes: w, collision: A} = this.
|
|
7638
|
+
const x = i, {boxes: w, collision: A} = this.no(e, r);
|
|
7617
7639
|
let k = 0;
|
|
7618
7640
|
if (c || 1 === e.material.uniforms.rotateWithMap || h.textRotation) {
|
|
7619
7641
|
let i = 0;
|
|
@@ -7706,7 +7728,7 @@ function oo(t, e) {
|
|
|
7706
7728
|
return [ {
|
|
7707
7729
|
attrName: "aMarkerWidth",
|
|
7708
7730
|
symbolName: "markerWidth",
|
|
7709
|
-
type:
|
|
7731
|
+
type: Uint16Array,
|
|
7710
7732
|
width: 1,
|
|
7711
7733
|
define: "HAS_MARKER_WIDTH",
|
|
7712
7734
|
evaluate: (i, r, o, s) => {
|
|
@@ -7718,7 +7740,7 @@ function oo(t, e) {
|
|
|
7718
7740
|
}, {
|
|
7719
7741
|
attrName: "aMarkerHeight",
|
|
7720
7742
|
symbolName: "markerHeight",
|
|
7721
|
-
type:
|
|
7743
|
+
type: Uint16Array,
|
|
7722
7744
|
width: 1,
|
|
7723
7745
|
define: "HAS_MARKER_HEIGHT",
|
|
7724
7746
|
evaluate: (n, r, o, s) => {
|
|
@@ -7934,10 +7956,10 @@ function ho(t, e) {
|
|
|
7934
7956
|
if (r.isFitConstant || !r.labelShape || !r.labelShape.length) return;
|
|
7935
7957
|
const o = this.getSymbolDef(e.properties.symbolIndex), s = this.getSymbolDef(n.properties.symbolIndex).textSize;
|
|
7936
7958
|
let a;
|
|
7937
|
-
p(s) && (a = i.
|
|
7959
|
+
p(s) && (a = i.so ? i.so : i.so = g(s));
|
|
7938
7960
|
const l = o.markerTextFitPadding || lo;
|
|
7939
7961
|
let h;
|
|
7940
|
-
p(l) && (h = r.
|
|
7962
|
+
p(l) && (h = r.ao ? r.ao : r.ao = y(l));
|
|
7941
7963
|
const c = t.getZoom(), {fitIcons: u, fitWidthIcons: f, fitHeightIcons: d} = r, {aMarkerWidth: m, aMarkerHeight: v, labelShape: b} = r, x = r.elements || e.elements, {features: w, aPickingId: A} = r, k = (t, e, n, i) => {
|
|
7942
7964
|
const o = b[4 * e], u = b[4 * e + 1], f = b[4 * e + 2], d = b[4 * e + 3];
|
|
7943
7965
|
if (!(o || u || f || d)) return;
|
|
@@ -7993,25 +8015,28 @@ function ho(t, e) {
|
|
|
7993
8015
|
|
|
7994
8016
|
const co = function(t) {
|
|
7995
8017
|
const e = this.layer.getRenderer();
|
|
7996
|
-
return !this.
|
|
8018
|
+
return !this.oo(t) && e.isForeground(t) && !!t.geometry.properties.iconAtlas && !t.geometry.properties.isEmpty;
|
|
7997
8019
|
}, uo = function(t) {
|
|
7998
8020
|
const e = this.layer.getRenderer();
|
|
7999
|
-
return !(this.
|
|
8021
|
+
return !(this.oo(t) || e.isForeground(t) || !t.geometry.properties.iconAtlas || t.geometry.properties.isEmpty);
|
|
8000
8022
|
}, fo = function(t) {
|
|
8001
8023
|
const e = this.layer.getRenderer();
|
|
8002
|
-
return !this.
|
|
8024
|
+
return !this.oo(t) && e.isForeground(t) && !!t.geometry.properties.glyphAtlas;
|
|
8003
8025
|
}, po = function(t) {
|
|
8004
8026
|
const e = this.layer.getRenderer();
|
|
8005
|
-
return !this.
|
|
8027
|
+
return !this.oo(t) && !e.isForeground(t) && !!t.geometry.properties.glyphAtlas;
|
|
8006
8028
|
}, mo = [], yo = {
|
|
8007
8029
|
collides: -1
|
|
8008
8030
|
}, go = [ 2048, 2048 ], vo = r.identity([]), bo = [];
|
|
8009
8031
|
|
|
8010
8032
|
class xo extends ar {
|
|
8033
|
+
static getBloomSymbol() {
|
|
8034
|
+
return [ "markerBloom", "textBloom" ];
|
|
8035
|
+
}
|
|
8011
8036
|
constructor(t, e, n, i, r, o) {
|
|
8012
8037
|
super(t, e, n, i, r, o), this.propAllowOverlap = "markerAllowOverlap", this.propIgnorePlacement = "markerIgnorePlacement",
|
|
8013
|
-
this.
|
|
8014
|
-
this.
|
|
8038
|
+
this.Ni = {}, this.isLabelCollides = Jr.bind(this), this.lo = co.bind(this), this.ho = uo.bind(this),
|
|
8039
|
+
this.co = fo.bind(this), this.uo = po.bind(this), this.fo = [];
|
|
8015
8040
|
}
|
|
8016
8041
|
needToRefreshTerrainTile() {
|
|
8017
8042
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
@@ -8027,7 +8052,7 @@ class xo extends ar {
|
|
|
8027
8052
|
return super.isTerrainSkin() && this.needToRefreshTerrainTile();
|
|
8028
8053
|
}
|
|
8029
8054
|
setTextShaderDefines(t) {
|
|
8030
|
-
this.
|
|
8055
|
+
this.do = t;
|
|
8031
8056
|
}
|
|
8032
8057
|
createFnTypeConfig(t, e) {
|
|
8033
8058
|
return {
|
|
@@ -8036,7 +8061,7 @@ class xo extends ar {
|
|
|
8036
8061
|
};
|
|
8037
8062
|
}
|
|
8038
8063
|
startFrame(...t) {
|
|
8039
|
-
return this.
|
|
8064
|
+
return this.fo.length = 0, super.startFrame(...t);
|
|
8040
8065
|
}
|
|
8041
8066
|
createGeometry(t, e) {
|
|
8042
8067
|
return t && t.empty && (t.data = {
|
|
@@ -8046,8 +8071,8 @@ class xo extends ar {
|
|
|
8046
8071
|
}
|
|
8047
8072
|
postCreateGeometry(t, e) {
|
|
8048
8073
|
const {geometry: n, symbolIndex: i} = t, r = this.getSymbolDef(i), o = this.getFnTypeConfig(i);
|
|
8049
|
-
if (this.
|
|
8050
|
-
ro(n, r, o.icon); else if (this.
|
|
8074
|
+
if (this.po(n)) n.properties.iconAtlas ? this.drawDebugAtlas(n.properties.iconAtlas) : n.properties.isEmpty = !0,
|
|
8075
|
+
ro(n, r, o.icon); else if (this.mo(n) && Xn(r)) {
|
|
8051
8076
|
const t = e[e.length - 1];
|
|
8052
8077
|
if (t) {
|
|
8053
8078
|
const {geometry: e, symbolIndex: o} = t;
|
|
@@ -8058,7 +8083,7 @@ class xo extends ar {
|
|
|
8058
8083
|
}
|
|
8059
8084
|
}
|
|
8060
8085
|
}
|
|
8061
|
-
|
|
8086
|
+
yo(t) {
|
|
8062
8087
|
const {collideIds: e, elements: n, aCount: i} = t.properties;
|
|
8063
8088
|
if (!e) return;
|
|
8064
8089
|
const r = e, o = {};
|
|
@@ -8073,7 +8098,7 @@ class xo extends ar {
|
|
|
8073
8098
|
const o = this.isEnableCollision(), s = this.layer, {geometry: a, symbolIndex: l} = t;
|
|
8074
8099
|
a.properties.symbolIndex = l;
|
|
8075
8100
|
const h = this.getSymbolDef(l), c = this.getSymbol(l), u = this.getFnTypeConfig(l), f = [];
|
|
8076
|
-
if (this.
|
|
8101
|
+
if (this.po(a)) {
|
|
8077
8102
|
const t = function(t, e, i, r, o, s, a, l) {
|
|
8078
8103
|
if (e.isDisposed() || 0 === e.data.aPosition.length) return null;
|
|
8079
8104
|
const h = e.properties.iconAtlas;
|
|
@@ -8118,25 +8143,25 @@ class xo extends ar {
|
|
|
8118
8143
|
}(this.regl, a, e, 0, c, u.icon, s.options.collision, !o, this.isEnableUniquePlacement());
|
|
8119
8144
|
t && (t.positionMatrix = this.getAltitudeOffsetMatrix(), delete t.geometry.properties.glyphAtlas,
|
|
8120
8145
|
f.push(t));
|
|
8121
|
-
} else if (this.
|
|
8146
|
+
} else if (this.mo(a)) {
|
|
8122
8147
|
const t = Vr.call(this, this.regl, a, e, h, c, u.text, s.options.collision, !o, this.isEnableUniquePlacement());
|
|
8123
8148
|
t.length && (t.forEach(t => {
|
|
8124
8149
|
t.positionMatrix = this.getAltitudeOffsetMatrix(), delete t.geometry.properties.iconAtlas;
|
|
8125
8150
|
}), f.push(...t));
|
|
8126
8151
|
}
|
|
8127
|
-
return "line" === a.properties.markerPlacement && this.
|
|
8128
|
-
this.
|
|
8152
|
+
return "line" === a.properties.markerPlacement && this.vo(a, r), "line" === a.properties.markerPlacement && f.forEach(t => t.properties.isLinePlacement = !0),
|
|
8153
|
+
this.yo(a), f;
|
|
8129
8154
|
}
|
|
8130
|
-
|
|
8155
|
+
vo(t, e) {
|
|
8131
8156
|
const {collideIds: n} = t.properties, i = new Uint16Array(n.length);
|
|
8132
|
-
if (this.
|
|
8157
|
+
if (this.po(t)) {
|
|
8133
8158
|
let r = 0;
|
|
8134
8159
|
for (let t = 0; t < n.length; t += 4) i.fill(r++, t, t + 4);
|
|
8135
8160
|
t.properties.collideIds = i, t.properties.uniqueCollideIds = Yn(i), e.markerCollideMap = {
|
|
8136
8161
|
old: n,
|
|
8137
8162
|
new: i
|
|
8138
8163
|
};
|
|
8139
|
-
} else if (this.
|
|
8164
|
+
} else if (this.mo(t)) {
|
|
8140
8165
|
const {collideIds: n, aCount: i} = t.properties;
|
|
8141
8166
|
if (!i) return;
|
|
8142
8167
|
if (e.markerCollideMap) {
|
|
@@ -8163,7 +8188,7 @@ class xo extends ar {
|
|
|
8163
8188
|
if (this.isEnableCollision() && t.length > 0) {
|
|
8164
8189
|
const e = new Qi(t);
|
|
8165
8190
|
e.properties.uniqueCollideIds = t[0].geometry.properties.uniqueCollideIds, e.properties.meshKey = t[0].properties.meshKey,
|
|
8166
|
-
e.properties.level = t[0].properties.level, this.
|
|
8191
|
+
e.properties.level = t[0].properties.level, this.fo.push(e);
|
|
8167
8192
|
}
|
|
8168
8193
|
for (let e = 0; e < t.length; e++) {
|
|
8169
8194
|
if (!this.isMeshIterable(t[e])) continue;
|
|
@@ -8186,31 +8211,31 @@ class xo extends ar {
|
|
|
8186
8211
|
if (!this.isEnableCollision()) return;
|
|
8187
8212
|
super.updateCollision(t);
|
|
8188
8213
|
const e = this.scene.getMeshes();
|
|
8189
|
-
e && e.length ? (this.
|
|
8214
|
+
e && e.length ? (this.bo(t.timestamp), this.fo = [], this.br()) : this.br();
|
|
8190
8215
|
}
|
|
8191
8216
|
callCurrentTileShader(t, e) {
|
|
8192
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
8193
|
-
this.
|
|
8217
|
+
this.shader.filter = e.sceneFilter ? [ this.lo, e.sceneFilter ] : this.lo, this.callRenderer(this.shader, t, e),
|
|
8218
|
+
this.xo.filter = e.sceneFilter ? [ this.co, e.sceneFilter ] : this.co, this.callRenderer(this.xo, t, e);
|
|
8194
8219
|
}
|
|
8195
8220
|
callBackgroundTileShader(t, e) {
|
|
8196
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
8197
|
-
this.
|
|
8221
|
+
this.shader.filter = e.sceneFilter ? [ this.ho, e.sceneFilter ] : this.ho, this.callRenderer(this.shader, t, e),
|
|
8222
|
+
this.xo.filter = e.sceneFilter ? [ this.uo, e.sceneFilter ] : this.uo, this.callRenderer(this.xo, t, e);
|
|
8198
8223
|
}
|
|
8199
8224
|
isMeshIterable(t) {
|
|
8200
8225
|
return t && t.geometry && !t.geometry.properties.isEmpty && t.material && !t.material.get("isHalo") && this.isMeshVisible(t) && !(this.shouldIgnoreBackground() && !this.layer.getRenderer().isForeground(t));
|
|
8201
8226
|
}
|
|
8202
|
-
|
|
8227
|
+
bo() {
|
|
8203
8228
|
if (!this.isEnableCollision()) return;
|
|
8204
|
-
let t = this.
|
|
8205
|
-
t && t.length && this.
|
|
8229
|
+
let t = this.fo;
|
|
8230
|
+
t && t.length && this.wo(t);
|
|
8206
8231
|
}
|
|
8207
|
-
|
|
8232
|
+
Ao(t, e, n, i) {
|
|
8208
8233
|
return this.updateBoxCollisionFading(!0, t, e, n, i);
|
|
8209
8234
|
}
|
|
8210
8235
|
isEnableUniquePlacement() {
|
|
8211
8236
|
return this.isEnableCollision() && !0 === this.sceneConfig.uniquePlacement;
|
|
8212
8237
|
}
|
|
8213
|
-
|
|
8238
|
+
wo(t) {
|
|
8214
8239
|
const e = this.layer.getRenderer();
|
|
8215
8240
|
t = t.sort(wo);
|
|
8216
8241
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -8225,12 +8250,12 @@ class xo extends ar {
|
|
|
8225
8250
|
const o = e.isForeground(i.meshes[0]);
|
|
8226
8251
|
if (this.shouldIgnoreBackground() && !o) continue;
|
|
8227
8252
|
const s = i.properties.meshKey;
|
|
8228
|
-
this.startMeshCollision(i), this.
|
|
8253
|
+
this.startMeshCollision(i), this.ko(i), this.forEachBox(i, this.Ao), this._o(i),
|
|
8229
8254
|
this.endMeshCollision(s);
|
|
8230
|
-
for (let t = 0; t < i.meshes.length; t++) this.
|
|
8255
|
+
for (let t = 0; t < i.meshes.length; t++) this.To(i.meshes[t]);
|
|
8231
8256
|
}
|
|
8232
8257
|
}
|
|
8233
|
-
|
|
8258
|
+
To(t) {
|
|
8234
8259
|
const e = t && t.geometry && t.geometry.properties.aOpacity;
|
|
8235
8260
|
e && e.dirty && (t.geometry.updateData("aOpacity", e), e.dirty = !1);
|
|
8236
8261
|
}
|
|
@@ -8240,9 +8265,9 @@ class xo extends ar {
|
|
|
8240
8265
|
const i = {
|
|
8241
8266
|
boxIndex: 0
|
|
8242
8267
|
}, r = n.length;
|
|
8243
|
-
for (let o = 0; o < r; o++) this.
|
|
8268
|
+
for (let o = 0; o < r; o++) this.So(t, n[o], e, i);
|
|
8244
8269
|
}
|
|
8245
|
-
|
|
8270
|
+
So(t, e, n, i) {
|
|
8246
8271
|
const o = this.getMap(), {collideBoxIndex: s} = t.meshes[0].geometry.properties;
|
|
8247
8272
|
if (!(s && s[e])) return !1;
|
|
8248
8273
|
const a = r.multiply(mo, o.projViewMatrix, t.meshes[0].localTransform);
|
|
@@ -8255,7 +8280,7 @@ class xo extends ar {
|
|
|
8255
8280
|
n[e] && u++;
|
|
8256
8281
|
}
|
|
8257
8282
|
if (!u) return !1;
|
|
8258
|
-
l = this.
|
|
8283
|
+
l = this.io(u);
|
|
8259
8284
|
let f = 0;
|
|
8260
8285
|
for (let t = 0; t < c.length; t++) {
|
|
8261
8286
|
const n = c[t];
|
|
@@ -8271,16 +8296,16 @@ class xo extends ar {
|
|
|
8271
8296
|
l[f].allElements = r, f++;
|
|
8272
8297
|
}
|
|
8273
8298
|
if (!h) return !1;
|
|
8274
|
-
return n.call(this, t, l, a, i.boxIndex++) && this.
|
|
8299
|
+
return n.call(this, t, l, a, i.boxIndex++) && this.Mo(t, e), !0;
|
|
8275
8300
|
}
|
|
8276
|
-
|
|
8301
|
+
ko(t) {
|
|
8277
8302
|
const e = t.meshes;
|
|
8278
8303
|
for (let t = 0; t < e.length; t++) {
|
|
8279
8304
|
const n = e[t], i = n && n.geometry;
|
|
8280
8305
|
i && (i.properties.visElemts.count = 0);
|
|
8281
8306
|
}
|
|
8282
8307
|
}
|
|
8283
|
-
|
|
8308
|
+
Mo(t, e) {
|
|
8284
8309
|
const n = t.meshes;
|
|
8285
8310
|
for (let t = 0; t < n.length; t++) {
|
|
8286
8311
|
const i = n[t];
|
|
@@ -8295,7 +8320,7 @@ class xo extends ar {
|
|
|
8295
8320
|
a.count = u;
|
|
8296
8321
|
}
|
|
8297
8322
|
}
|
|
8298
|
-
|
|
8323
|
+
_o(t) {
|
|
8299
8324
|
const e = t.meshes;
|
|
8300
8325
|
for (let t = 0; t < e.length; t++) {
|
|
8301
8326
|
const n = e[t], i = n && n.geometry;
|
|
@@ -8305,13 +8330,13 @@ class xo extends ar {
|
|
|
8305
8330
|
}
|
|
8306
8331
|
}
|
|
8307
8332
|
isBoxCollides(t, e, n, i, r, o) {
|
|
8308
|
-
if (this.
|
|
8333
|
+
if (this.mo(t.geometry)) return Jr.call(this, 0, t, e, n, i, r, o);
|
|
8309
8334
|
if (t.geometry.properties.isEmpty) return yo;
|
|
8310
8335
|
const {aTerrainAltitude: s} = t.geometry.properties;
|
|
8311
8336
|
if (s) {
|
|
8312
8337
|
if (s[2 * e[i]] === yt) return yo;
|
|
8313
8338
|
}
|
|
8314
|
-
const a = this.getMap(), {boxes: l, collision: h} = this.
|
|
8339
|
+
const a = this.getMap(), {boxes: l, collision: h} = this.no(t, i);
|
|
8315
8340
|
let c = 0, u = 0, f = 0;
|
|
8316
8341
|
for (let n = i; n < r; n += 6) {
|
|
8317
8342
|
const i = l[f] = l[f] || [];
|
|
@@ -8377,8 +8402,8 @@ class xo extends ar {
|
|
|
8377
8402
|
} ],
|
|
8378
8403
|
extraCommandProps: i
|
|
8379
8404
|
}), this.shader.version = 300;
|
|
8380
|
-
const {uniforms: o, extraCommandProps: s} = Wr.call(this, e, this.sceneConfig), a = this.
|
|
8381
|
-
if (this.
|
|
8405
|
+
const {uniforms: o, extraCommandProps: s} = Wr.call(this, e, this.sceneConfig), a = this.do || {};
|
|
8406
|
+
if (this.xo = new n.MeshShader({
|
|
8382
8407
|
vert: to,
|
|
8383
8408
|
frag: eo,
|
|
8384
8409
|
uniforms: o,
|
|
@@ -8438,15 +8463,15 @@ class xo extends ar {
|
|
|
8438
8463
|
};
|
|
8439
8464
|
}
|
|
8440
8465
|
getUniqueEntryKey(t, e) {
|
|
8441
|
-
if (!this.
|
|
8466
|
+
if (!this.mo(t.geometry)) return null;
|
|
8442
8467
|
const {elements: n} = t.geometry.properties;
|
|
8443
8468
|
return Zr(t, n[e]);
|
|
8444
8469
|
}
|
|
8445
|
-
|
|
8470
|
+
po(t) {
|
|
8446
8471
|
const {symbolIndex: e} = t.properties;
|
|
8447
8472
|
return 0 === e.type;
|
|
8448
8473
|
}
|
|
8449
|
-
|
|
8474
|
+
mo(t) {
|
|
8450
8475
|
const {symbolIndex: e} = t.properties;
|
|
8451
8476
|
return 1 === e.type;
|
|
8452
8477
|
}
|
|
@@ -8475,13 +8500,13 @@ function To(t, e, n, r, o, s, a, l, c, u, f, d, p) {
|
|
|
8475
8500
|
const F = (_ - O) / C, E = m && m.getRenderer(), z = E && E.getTerrainHelper(), j = e.properties.tile.terrainTileInfos;
|
|
8476
8501
|
if (!g && z) {
|
|
8477
8502
|
const {extent: n} = e.properties.tile, i = m.getTileSize().width / n, r = m.getMap();
|
|
8478
|
-
let o = P.sub(I).mult(F).
|
|
8503
|
+
let o = P.sub(I).mult(F).ci(I);
|
|
8479
8504
|
S = bi(di, r, e, P, i, m, y, j), M = bi(pi, r, e, I, i, m, y, j), o = bi(mi, r, e, o, i, m, y, j);
|
|
8480
8505
|
const s = A + Math.atan2(S[1] - M[1], S[0] - M[0]);
|
|
8481
8506
|
return t[0] = (o[0] - p[0]) / d, t[1] = (o[1] - p[1]) / d, t[2] = s, t;
|
|
8482
8507
|
}
|
|
8483
|
-
const R = S.sub(M), D = R.mult(F).
|
|
8484
|
-
D.
|
|
8508
|
+
const R = S.sub(M), D = R.mult(F).ci(M);
|
|
8509
|
+
D.ci(R.bi().xi().pi(a * w));
|
|
8485
8510
|
const N = A + Math.atan2(S.y - M.y, S.x - M.x);
|
|
8486
8511
|
return t[0] = (D.x - i[0]) / d, t[1] = (D.y - i[1]) / d, t[2] = N, t;
|
|
8487
8512
|
}(t, e, r, s, a, _, k[0], k[1], T[0], T[1], T[2], n / 24, c, l, u, f, d, p);
|
|
@@ -8506,23 +8531,26 @@ var Io = "#define SHADER_NAME TEXT_LINE\n#ifdef HAS_ALTITUDE\nattribute vec2 aPo
|
|
|
8506
8531
|
|
|
8507
8532
|
const Oo = function(t) {
|
|
8508
8533
|
const e = this.layer.getRenderer();
|
|
8509
|
-
return !this.
|
|
8534
|
+
return !this.oo(t) && e.isTileNearCamera(t) && "line" !== t.geometry.properties.textPlacement;
|
|
8510
8535
|
}, Co = function(t) {
|
|
8511
8536
|
const e = this.layer.getRenderer();
|
|
8512
|
-
return !this.
|
|
8537
|
+
return !this.oo(t) && !e.isForeground(t) && "line" !== t.geometry.properties.textPlacement;
|
|
8513
8538
|
}, Fo = function(t) {
|
|
8514
8539
|
const e = this.layer.getRenderer();
|
|
8515
|
-
return !this.
|
|
8540
|
+
return !this.oo(t) && e.isTileNearCamera(t) && "line" === t.geometry.properties.textPlacement;
|
|
8516
8541
|
}, Eo = function(t) {
|
|
8517
8542
|
const e = this.layer.getRenderer(), n = t.properties.tile.z, i = e.getCurrentTileZoom();
|
|
8518
|
-
return !this.
|
|
8543
|
+
return !this.oo(t) && !e.isForeground(t) && "line" === t.geometry.properties.textPlacement && n < i;
|
|
8519
8544
|
}, zo = [ 0, 0, 3 ], jo = [], Ro = [], Do = [], No = [], Lo = [], Ho = [], Vo = [], Uo = [], Go = [ 1, -1 ], Wo = new Int16Array(3), Bo = [], qo = [], Xo = [], $o = [], Yo = [], Jo = [], Zo = [], Ko = {}, Qo = {}, ts = {}, es = [], ns = [], is = r.identity([]);
|
|
8520
8545
|
|
|
8521
8546
|
class rs extends ar {
|
|
8547
|
+
static getBloomSymbol() {
|
|
8548
|
+
return [ "textBloom" ];
|
|
8549
|
+
}
|
|
8522
8550
|
constructor(t, e, n, i, r, o) {
|
|
8523
8551
|
super(t, e, n, i, r, o), this.propAllowOverlap = "textAllowOverlap", this.propIgnorePlacement = "textIgnorePlacement",
|
|
8524
|
-
this.colorCache = {}, this.
|
|
8525
|
-
this.
|
|
8552
|
+
this.colorCache = {}, this.Po = Oo.bind(this), this.Io = Co.bind(this), this.Oo = Fo.bind(this),
|
|
8553
|
+
this.Co = Eo.bind(this), this.isLabelCollides = Jr.bind(this), this.Fo();
|
|
8526
8554
|
}
|
|
8527
8555
|
prepareRender(...t) {
|
|
8528
8556
|
super.prepareRender(...t);
|
|
@@ -8534,34 +8562,34 @@ class rs extends ar {
|
|
|
8534
8562
|
}
|
|
8535
8563
|
}
|
|
8536
8564
|
updateSymbol(...t) {
|
|
8537
|
-
this.
|
|
8565
|
+
this.Eo = void 0, this.zo = void 0;
|
|
8538
8566
|
const e = super.updateSymbol(...t);
|
|
8539
|
-
return this.
|
|
8567
|
+
return this.Fo(), e;
|
|
8540
8568
|
}
|
|
8541
8569
|
isTerrainVector() {
|
|
8542
8570
|
if (!super.isTerrainSkin()) return !1;
|
|
8543
|
-
if (void 0 !== this.
|
|
8571
|
+
if (void 0 !== this.Eo) return this.Eo;
|
|
8544
8572
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
8545
|
-
if ("map" !== this.symbolDef[t].textPitchAlignment) return this.
|
|
8573
|
+
if ("map" !== this.symbolDef[t].textPitchAlignment) return this.Eo = !0, !0;
|
|
8546
8574
|
}
|
|
8547
|
-
return this.
|
|
8575
|
+
return this.Eo = !1, !1;
|
|
8548
8576
|
}
|
|
8549
8577
|
isTerrainSkin() {
|
|
8550
8578
|
if (!super.isTerrainSkin()) return !1;
|
|
8551
|
-
if (void 0 !== this.
|
|
8579
|
+
if (void 0 !== this.zo) return this.zo;
|
|
8552
8580
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
8553
8581
|
const e = this.symbolDef[t].textPitchAlignment;
|
|
8554
|
-
if ("map" === e || p(e) || x.isExpression(e)) return this.
|
|
8582
|
+
if ("map" === e || p(e) || x.isExpression(e)) return this.zo = !0, !0;
|
|
8555
8583
|
}
|
|
8556
|
-
return this.
|
|
8584
|
+
return this.zo = !1, !1;
|
|
8557
8585
|
}
|
|
8558
|
-
|
|
8559
|
-
this.
|
|
8586
|
+
Fo() {
|
|
8587
|
+
this.jo = [];
|
|
8560
8588
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
8561
8589
|
const e = this.symbolDef[t];
|
|
8562
8590
|
if (x.isExpression(e.textName)) {
|
|
8563
8591
|
const n = x.createExpression(e.textName, "string");
|
|
8564
|
-
this.
|
|
8592
|
+
this.jo[t] = (t, e) => {
|
|
8565
8593
|
let i;
|
|
8566
8594
|
Ko.zoom = t, Qo.properties = e;
|
|
8567
8595
|
try {
|
|
@@ -8571,7 +8599,7 @@ class rs extends ar {
|
|
|
8571
8599
|
}
|
|
8572
8600
|
return i;
|
|
8573
8601
|
};
|
|
8574
|
-
} else p(e.textName) && (this.
|
|
8602
|
+
} else p(e.textName) && (this.jo[t] = g(e.textName));
|
|
8575
8603
|
}
|
|
8576
8604
|
}
|
|
8577
8605
|
shouldDeleteMeshOnUpdateSymbol(t) {
|
|
@@ -8583,7 +8611,7 @@ class rs extends ar {
|
|
|
8583
8611
|
return Br(t, e);
|
|
8584
8612
|
}
|
|
8585
8613
|
isBloom(t) {
|
|
8586
|
-
return !!this.getSymbol(t.properties.symbolIndex).
|
|
8614
|
+
return !!this.getSymbol(t.properties.symbolIndex)[rs.getBloomSymbol()[0]];
|
|
8587
8615
|
}
|
|
8588
8616
|
createGeometry(t, e, n) {
|
|
8589
8617
|
const i = t;
|
|
@@ -8600,7 +8628,7 @@ class rs extends ar {
|
|
|
8600
8628
|
o.properties.symbolIndex = s;
|
|
8601
8629
|
const a = this.getSymbol(s), l = this.getSymbolDef(s), h = this.getFnTypeConfig(s), c = Vr.call(this, this.regl, o, e, l, a, h, this.layer.options.collision, !i, r);
|
|
8602
8630
|
if (c.length) {
|
|
8603
|
-
"line" === o.properties.textPlacement ? this.
|
|
8631
|
+
"line" === o.properties.textPlacement ? this.Ro = !0 : this.Do = !0;
|
|
8604
8632
|
}
|
|
8605
8633
|
return c.forEach(t => {
|
|
8606
8634
|
t.positionMatrix = this.getAltitudeOffsetMatrix(), t.properties.tileVectorTransform = n;
|
|
@@ -8609,21 +8637,21 @@ class rs extends ar {
|
|
|
8609
8637
|
updateCollision(t) {
|
|
8610
8638
|
super.updateCollision(t);
|
|
8611
8639
|
const e = this.scene.getMeshes();
|
|
8612
|
-
e && e.length ? (this.
|
|
8640
|
+
e && e.length ? (this.No = {}, this.Lo(t.timestamp), this.br()) : this.br();
|
|
8613
8641
|
}
|
|
8614
8642
|
callCurrentTileShader(t, e) {
|
|
8615
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
8616
|
-
this.
|
|
8643
|
+
this.shader.filter = e.sceneFilter ? [ this.Po, e.sceneFilter ] : this.Po, this.callRenderer(this.shader, t, e),
|
|
8644
|
+
this.Ho.filter = e.sceneFilter ? [ this.Oo, e.sceneFilter ] : this.Oo, this.callRenderer(this.Ho, t, e);
|
|
8617
8645
|
}
|
|
8618
8646
|
callBackgroundTileShader(t, e) {
|
|
8619
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
8620
|
-
this.
|
|
8647
|
+
this.shader.filter = e.sceneFilter ? [ this.Io, e.sceneFilter ] : this.Io, this.callRenderer(this.shader, t, e),
|
|
8648
|
+
this.Ho.filter = e.sceneFilter ? [ this.Co, e.sceneFilter ] : this.Co, this.callRenderer(this.Ho, t, e);
|
|
8621
8649
|
}
|
|
8622
8650
|
callRenderer(t, e, n) {
|
|
8623
8651
|
n && n.isRenderingTerrain && p(this.symbolDef.textPitchAlignment) && (n.isRenderingTerrainSkin ? e.textPitchFilter = 1 : e.textPitchFilter = 2),
|
|
8624
8652
|
super.callRenderer(t, e, n);
|
|
8625
8653
|
}
|
|
8626
|
-
|
|
8654
|
+
Lo() {
|
|
8627
8655
|
let t = this.scene.getMeshes();
|
|
8628
8656
|
if (!t || !t.length) return;
|
|
8629
8657
|
const e = -this.getMap().getBearing() * Math.PI / 180, n = c.fromRotation(Do, e), i = (t, e, n, i) => {
|
|
@@ -8648,7 +8676,7 @@ class rs extends ar {
|
|
|
8648
8676
|
const h = s.properties.meshKey;
|
|
8649
8677
|
if ("line" === a.properties.textPlacement) {
|
|
8650
8678
|
if (!a.properties.line) continue;
|
|
8651
|
-
r && this.startMeshCollision(s), this.
|
|
8679
|
+
r && this.startMeshCollision(s), this.Vo(s, n);
|
|
8652
8680
|
const {aOffset: t, aOpacity: e} = a.properties;
|
|
8653
8681
|
t.dirty && (a.updateData("aOffset", t), t.dirty = !1), e && e.dirty && (a.updateData("aOpacity", e),
|
|
8654
8682
|
e.dirty = !1), r && this.endMeshCollision(h);
|
|
@@ -8673,7 +8701,7 @@ class rs extends ar {
|
|
|
8673
8701
|
getUniqueEntryKey(t, e) {
|
|
8674
8702
|
return Zr(t, e);
|
|
8675
8703
|
}
|
|
8676
|
-
|
|
8704
|
+
Vo(t, e) {
|
|
8677
8705
|
const n = this.getMap(), i = t.geometry, o = i.properties;
|
|
8678
8706
|
let s = o.line;
|
|
8679
8707
|
if (!s) return;
|
|
@@ -8681,13 +8709,13 @@ class rs extends ar {
|
|
|
8681
8709
|
if (!a) {
|
|
8682
8710
|
const e = r.multiply(jo, n.projViewMatrix, t.localTransform), i = s.id + "-" + e.join();
|
|
8683
8711
|
let a;
|
|
8684
|
-
this.
|
|
8685
|
-
s = this.
|
|
8712
|
+
this.No[i] ? s = this.No[i] : (a = o.projectedLine = o.projectedLine || new Array(s.length),
|
|
8713
|
+
s = this.Uo(a, s, e, n.width, n.height), this.No[i] = a);
|
|
8686
8714
|
}
|
|
8687
8715
|
const h = this.isEnableCollision(), c = i.properties.visElemts = i.properties.visElemts || new l.constructor(l.length);
|
|
8688
8716
|
h && (c.count = 0), this.forEachBox(t, (t, n, i, r) => {
|
|
8689
8717
|
const {start: o, end: u} = n[0];
|
|
8690
|
-
let f = this.
|
|
8718
|
+
let f = this.Go(t, l, o, u, s, i, a ? e : null, r);
|
|
8691
8719
|
if (h && (f = this.updateBoxCollisionFading(f, t, n, i, r), f)) {
|
|
8692
8720
|
let t = c.count;
|
|
8693
8721
|
for (let e = o; e < u; e++) c[t++] = l[e];
|
|
@@ -8697,7 +8725,7 @@ class rs extends ar {
|
|
|
8697
8725
|
const u = t.geometry.properties.aAltitude;
|
|
8698
8726
|
u && u.dirty && (i.updateData("aAltitude", u), u.dirty = !1), !h || c.count === l.length && i.count === c.count || i.setElements(c, c.count);
|
|
8699
8727
|
}
|
|
8700
|
-
|
|
8728
|
+
Uo(t, e, n, i, r) {
|
|
8701
8729
|
return function(t, e, n, i, r) {
|
|
8702
8730
|
for (let o = 0; o < e.length; o += 3) a.set(ui, e[o], e[o + 1], e[o + 2], 1), fi(ui, ui, n, i, r),
|
|
8703
8731
|
t[o] = ui[0], t[o + 1] = ui[1], t[o + 2] = e[o + 2];
|
|
@@ -8707,7 +8735,7 @@ class rs extends ar {
|
|
|
8707
8735
|
forEachBox(t, e) {
|
|
8708
8736
|
const n = this.getMap(), i = r.multiply(jo, n.projViewMatrix, t.properties.tileVectorTransform), {collideIds: o, aCount: s, features: a, elements: l} = t.geometry.properties, h = o;
|
|
8709
8737
|
if (!h) return;
|
|
8710
|
-
const c = this.isEnableUniquePlacement(), u = this.
|
|
8738
|
+
const c = this.isEnableUniquePlacement(), u = this.io(1);
|
|
8711
8739
|
u[0].allElements = l, u[0].mesh = t;
|
|
8712
8740
|
let f = 0, d = l[0], p = 0, m = h[d];
|
|
8713
8741
|
for (let n = 0; n <= l.length; n += 6) if (d = l[n], h[d] !== m || n === l.length) {
|
|
@@ -8715,7 +8743,7 @@ class rs extends ar {
|
|
|
8715
8743
|
if (c && this.isMeshUniquePlaced(t) && r && !r.label) {
|
|
8716
8744
|
const e = r.properties || {};
|
|
8717
8745
|
e.$layer = r.layer, e.$type = r.type;
|
|
8718
|
-
const {symbolIndex: n} = t.properties, i = n && this.
|
|
8746
|
+
const {symbolIndex: n} = t.properties, i = n && this.jo[n.index] ? this.jo[n.index](t.properties.z, e) : this.getSymbol(t.properties.symbolIndex).textName, o = E.resolveText(i, e);
|
|
8719
8747
|
delete e.$layer, delete e.$type, r.label = o;
|
|
8720
8748
|
}
|
|
8721
8749
|
const o = n, y = s[l[p]];
|
|
@@ -8724,7 +8752,7 @@ class rs extends ar {
|
|
|
8724
8752
|
m = h[d], p = n;
|
|
8725
8753
|
}
|
|
8726
8754
|
}
|
|
8727
|
-
|
|
8755
|
+
Go(t, e, n, o, s, a, l) {
|
|
8728
8756
|
const c = this.layer.getRenderer(), f = t.material.uniforms, d = 1 === f.pitchWithMap, p = !d && c.getTerrainHelper && c.getTerrainHelper(), m = this.isEnableCollision(), y = this.getMap(), g = t.geometry, v = g.desc.positionSize, {aShape: b, aOffset: x, aAnchor: A, aAltitude: k, aPitchRotation: _} = g.properties;
|
|
8729
8757
|
let {aProjectedAnchor: T} = g.properties;
|
|
8730
8758
|
T || (T = g.properties.aProjectedAnchor = new Array(A.length / v * 3)), T.fill(-999999);
|
|
@@ -8742,7 +8770,7 @@ class rs extends ar {
|
|
|
8742
8770
|
M && (O = C), T[3 * P] = E[0], T[3 * P + 1] = E[1], T[3 * P + 2] = E[2];
|
|
8743
8771
|
const z = M ? 1 : g.properties.tileExtent / this.layer.getTileSize().width;
|
|
8744
8772
|
let j = !0;
|
|
8745
|
-
const R = e[n], D = e[o - 1], N = S ? S[R] : t.properties.textSize, L = this.
|
|
8773
|
+
const R = e[n], D = e[o - 1], N = S ? S[R] : t.properties.textSize, L = this.Wo(t, N, s, R, D, O, No, z, l);
|
|
8746
8774
|
if (null === L) return os(x, e, n, o), !1;
|
|
8747
8775
|
const H = D - R <= 3, V = Math.floor(L / 2), U = L % 2;
|
|
8748
8776
|
for (let l = n; l < o; l += 6) {
|
|
@@ -8777,7 +8805,7 @@ class rs extends ar {
|
|
|
8777
8805
|
}
|
|
8778
8806
|
return j;
|
|
8779
8807
|
}
|
|
8780
|
-
|
|
8808
|
+
Wo(t, e, n, i, r, o, s, a, l) {
|
|
8781
8809
|
const h = r - i <= 3, c = this.getMap();
|
|
8782
8810
|
return h ? 0 : Po.call(this, Jo, Zo, t, e, n, i, r, o, s, a, c.width / c.height, l);
|
|
8783
8811
|
}
|
|
@@ -8790,7 +8818,7 @@ class rs extends ar {
|
|
|
8790
8818
|
}) : t.material && delete t.material.uniforms.texture), super.deleteMesh(t, e));
|
|
8791
8819
|
}
|
|
8792
8820
|
delete() {
|
|
8793
|
-
super.delete(), this.
|
|
8821
|
+
super.delete(), this.Ho.dispose(), delete this.No, this.Bo && this.Bo.dispose();
|
|
8794
8822
|
}
|
|
8795
8823
|
needClearStencil() {
|
|
8796
8824
|
return !0;
|
|
@@ -8812,7 +8840,7 @@ class rs extends ar {
|
|
|
8812
8840
|
});
|
|
8813
8841
|
let s = i;
|
|
8814
8842
|
if (this.layer.getRenderer().isEnableWorkAround("win-intel-gpu-crash") && (s = jn({}, i),
|
|
8815
|
-
s.stencil = jn({}, i.stencil), s.stencil.enable = !0), this.
|
|
8843
|
+
s.stencil = jn({}, i.stencil), s.stencil.enable = !0), this.Ho = new n.MeshShader({
|
|
8816
8844
|
vert: Io,
|
|
8817
8845
|
frag: eo,
|
|
8818
8846
|
uniforms: e,
|
|
@@ -9200,23 +9228,23 @@ class vs extends Fi {
|
|
|
9200
9228
|
r;
|
|
9201
9229
|
}
|
|
9202
9230
|
needPolygonOffset() {
|
|
9203
|
-
return this.
|
|
9231
|
+
return this.qo;
|
|
9204
9232
|
}
|
|
9205
9233
|
startFrame(...t) {
|
|
9206
|
-
return delete this.
|
|
9234
|
+
return delete this.qo, super.startFrame(...t);
|
|
9207
9235
|
}
|
|
9208
9236
|
addMesh(t, e) {
|
|
9209
9237
|
t.forEach(t => {
|
|
9210
|
-
this.
|
|
9238
|
+
this.rr(t, e);
|
|
9211
9239
|
}), super.addMesh(...arguments);
|
|
9212
9240
|
}
|
|
9213
|
-
|
|
9241
|
+
rr(t, e) {
|
|
9214
9242
|
if (null !== e) {
|
|
9215
9243
|
const n = t.localTransform;
|
|
9216
9244
|
0 === e && (e = .01), ps[2] = e, r.fromScaling(n, ps), r.multiply(n, t.properties.tileTransform, n),
|
|
9217
9245
|
t.setLocalTransform(n);
|
|
9218
9246
|
} else t.setLocalTransform(t.properties.tileTransform);
|
|
9219
|
-
t.material !== this.material && t.setMaterial(this.material), t.geometry.properties.maxAltitude <= 0 && (this.
|
|
9247
|
+
t.material !== this.material && t.setMaterial(this.material), t.geometry.properties.maxAltitude <= 0 && (this.qo = !0),
|
|
9220
9248
|
this.getSymbol(t.properties.symbolIndex).ssr ? t.ssr = 1 : t.ssr = 0;
|
|
9221
9249
|
}
|
|
9222
9250
|
deleteMesh(t, e) {
|
|
@@ -9274,9 +9302,9 @@ class vs extends Fi {
|
|
|
9274
9302
|
return !1;
|
|
9275
9303
|
}(this.symbolDef[0].material || {}, t.material));
|
|
9276
9304
|
const i = super.updateSymbol(t, e);
|
|
9277
|
-
return t && t.material && this.
|
|
9305
|
+
return t && t.material && this.Xn(t.material), n || i;
|
|
9278
9306
|
}
|
|
9279
|
-
|
|
9307
|
+
Li(t, e) {
|
|
9280
9308
|
return bs(t) !== bs(e);
|
|
9281
9309
|
}
|
|
9282
9310
|
}
|
|
@@ -9301,7 +9329,7 @@ class ws extends vs {
|
|
|
9301
9329
|
e.aExtrusionOpacity = t;
|
|
9302
9330
|
}
|
|
9303
9331
|
const r = new n.Geometry(e, t.indices);
|
|
9304
|
-
return jn(r.properties, t.properties), this.
|
|
9332
|
+
return jn(r.properties, t.properties), this.Ki(r, t), {
|
|
9305
9333
|
geometry: r,
|
|
9306
9334
|
symbolIndex: {
|
|
9307
9335
|
index: 0
|
|
@@ -9321,14 +9349,14 @@ class ws extends vs {
|
|
|
9321
9349
|
return this.shader;
|
|
9322
9350
|
}
|
|
9323
9351
|
delete(t) {
|
|
9324
|
-
this.getMap().off("updatelights", this.
|
|
9352
|
+
this.getMap().off("updatelights", this.Xo, this), super.delete(t), this.material.dispose();
|
|
9325
9353
|
}
|
|
9326
9354
|
init() {
|
|
9327
|
-
this.getMap().on("updatelights", this.
|
|
9355
|
+
this.getMap().on("updatelights", this.Xo, this);
|
|
9328
9356
|
const t = this.regl;
|
|
9329
9357
|
this.renderer = new n.Renderer(t);
|
|
9330
9358
|
const e = this.getShaderConfig();
|
|
9331
|
-
this.shader = new n.PhongShader(e), this.
|
|
9359
|
+
this.shader = new n.PhongShader(e), this.Xn();
|
|
9332
9360
|
const i = {
|
|
9333
9361
|
vert: this.getPickingVert(),
|
|
9334
9362
|
uniforms: [ "projViewMatrix", "modelMatrix", "positionMatrix", {
|
|
@@ -9344,7 +9372,7 @@ class ws extends vs {
|
|
|
9344
9372
|
};
|
|
9345
9373
|
this.picking = [ new n.FBORayPicking(this.renderer, i, this.layer.getRenderer().pickingFBO, this.getMap()) ];
|
|
9346
9374
|
}
|
|
9347
|
-
|
|
9375
|
+
Xo() {
|
|
9348
9376
|
this.setToRedraw();
|
|
9349
9377
|
}
|
|
9350
9378
|
getShaderConfig() {
|
|
@@ -9393,14 +9421,14 @@ class ws extends vs {
|
|
|
9393
9421
|
}
|
|
9394
9422
|
};
|
|
9395
9423
|
}
|
|
9396
|
-
|
|
9424
|
+
Xn() {
|
|
9397
9425
|
this.material && this.material.dispose();
|
|
9398
9426
|
const t = this.getSymbols()[0].material, e = {};
|
|
9399
9427
|
for (const n in t) $n(t, n) && (e[n] = t[n]);
|
|
9400
9428
|
this.material = new n.PhongMaterial(e);
|
|
9401
9429
|
}
|
|
9402
9430
|
getUniformValues(t, e) {
|
|
9403
|
-
const n = t.viewMatrix, i = t.projMatrix, r = t.cameraPosition, o = this
|
|
9431
|
+
const n = t.viewMatrix, i = t.projMatrix, r = t.cameraPosition, o = this.$o(), s = jn({
|
|
9404
9432
|
viewMatrix: n,
|
|
9405
9433
|
projMatrix: i,
|
|
9406
9434
|
cameraPosition: r,
|
|
@@ -9413,7 +9441,7 @@ class ws extends vs {
|
|
|
9413
9441
|
getPickingVert() {
|
|
9414
9442
|
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 ";
|
|
9415
9443
|
}
|
|
9416
|
-
|
|
9444
|
+
$o() {
|
|
9417
9445
|
const t = this.getMap().getLightManager(), e = t && t.getAmbientLight() || {}, n = t && t.getDirectionalLight() || {};
|
|
9418
9446
|
return {
|
|
9419
9447
|
ambientColor: e.color || [ .2, .2, .2 ],
|
|
@@ -9513,20 +9541,20 @@ const {getPBRUniforms: _s} = n.pbr.PBRUtils;
|
|
|
9513
9541
|
|
|
9514
9542
|
class Ts extends vs {
|
|
9515
9543
|
constructor(...t) {
|
|
9516
|
-
super(...t), this.
|
|
9544
|
+
super(...t), this.Yo = new n.ResourceLoader, this.scene.sortFunction = this.sortByCommandKey;
|
|
9517
9545
|
}
|
|
9518
9546
|
supportRenderMode(t) {
|
|
9519
9547
|
return this.getSymbols()[0].ssr ? "fxaa" === t || "fxaaAfterTaa" === t : super.supportRenderMode(t);
|
|
9520
9548
|
}
|
|
9521
9549
|
isAnimating() {
|
|
9522
|
-
const t = this
|
|
9550
|
+
const t = this.Jo();
|
|
9523
9551
|
if (t && (t[0] || t[1])) return !0;
|
|
9524
9552
|
}
|
|
9525
9553
|
needToRedraw() {
|
|
9526
|
-
const t = this
|
|
9554
|
+
const t = this.Jo();
|
|
9527
9555
|
return !(!t || !t[0] && !t[1]) || super.needToRedraw();
|
|
9528
9556
|
}
|
|
9529
|
-
|
|
9557
|
+
Jo() {
|
|
9530
9558
|
const t = this.getSymbols()[0];
|
|
9531
9559
|
return t.material && t.material.uvOffsetAnim;
|
|
9532
9560
|
}
|
|
@@ -9539,7 +9567,7 @@ class Ts extends vs {
|
|
|
9539
9567
|
const i = new n.Geometry(t.data, t.indices, 0, e);
|
|
9540
9568
|
return jn(i.properties, t.properties), t.vertexColors && (i.properties.vertexColors = t.vertexColors),
|
|
9541
9569
|
this.material.uniforms.normalTexture && !i.data[i.desc.tangentAttribute] && (i.data[i.desc.normalAttribute] || i.createNormal(),
|
|
9542
|
-
i.createTangent()), this.
|
|
9570
|
+
i.createTangent()), this.Ki(i, t), {
|
|
9543
9571
|
geometry: i,
|
|
9544
9572
|
symbolIndex: {
|
|
9545
9573
|
index: 0
|
|
@@ -9549,38 +9577,38 @@ class Ts extends vs {
|
|
|
9549
9577
|
paint(t) {
|
|
9550
9578
|
const e = !!t.shadow;
|
|
9551
9579
|
t.states && t.states.includesChanged && (this.shader.dispose(), delete this.shader,
|
|
9552
|
-
this.
|
|
9580
|
+
this.Zo.dispose(), delete this.Zo, this.er(t));
|
|
9553
9581
|
let n = !!t.ssr && this.getSymbols()[0].ssr;
|
|
9554
9582
|
const i = this.shader, r = i.shaderDefines;
|
|
9555
9583
|
if (n) {
|
|
9556
9584
|
const e = jn({}, r, t.ssr.defines);
|
|
9557
9585
|
i.shaderDefines = e;
|
|
9558
9586
|
}
|
|
9559
|
-
if (t.onlyUpdateDepthInTaa && (this.shader = this.
|
|
9587
|
+
if (t.onlyUpdateDepthInTaa && (this.shader = this.Zo, !n && this.Ko && (this.shader = i,
|
|
9560
9588
|
this.setToRedraw(!0))), this.updateIBLDefines(i), super.paint(t), void 0 !== this.shadowCount && e) {
|
|
9561
9589
|
const t = this.scene.getMeshes().length;
|
|
9562
9590
|
this.shadowCount !== t && this.setToRedraw();
|
|
9563
9591
|
}
|
|
9564
9592
|
this.shader = i, n && (i.shaderDefines = r), delete this.shadowCount;
|
|
9565
|
-
const o = this
|
|
9593
|
+
const o = this.Jo();
|
|
9566
9594
|
if (o && (o[0] || o[1])) this.material.set("uvOffset", [ 0, 0 ]); else {
|
|
9567
9595
|
const t = this.getUVOffset(o);
|
|
9568
9596
|
this.material.set("uvOffset", t);
|
|
9569
9597
|
}
|
|
9570
|
-
this.
|
|
9598
|
+
this.Ko = n;
|
|
9571
9599
|
}
|
|
9572
9600
|
updateSceneConfig(t) {
|
|
9573
9601
|
jn(this.sceneConfig, t), this.setToRedraw();
|
|
9574
9602
|
}
|
|
9575
9603
|
delete() {
|
|
9576
|
-
super.delete(), this.disposeIBLTextures(), this.material.dispose(), this.
|
|
9577
|
-
delete this.
|
|
9604
|
+
super.delete(), this.disposeIBLTextures(), this.material.dispose(), this.Zo && (this.Zo.dispose(),
|
|
9605
|
+
delete this.Zo);
|
|
9578
9606
|
}
|
|
9579
9607
|
init(t) {
|
|
9580
|
-
this.getMap().on("updatelights", this.
|
|
9608
|
+
this.getMap().on("updatelights", this.Qo, this), this.createIBLTextures(), this.or = this.or || t;
|
|
9581
9609
|
const e = this.regl;
|
|
9582
|
-
this.renderer = new n.Renderer(e), this.
|
|
9583
|
-
this.
|
|
9610
|
+
this.renderer = new n.Renderer(e), this.ts = this.es.bind(this), this.ns = this.disposeCachedTexture.bind(this),
|
|
9611
|
+
this.rs = this.os.bind(this), this.Xn(), this.er(t);
|
|
9584
9612
|
const i = {
|
|
9585
9613
|
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 ",
|
|
9586
9614
|
uniforms: [ {
|
|
@@ -9600,7 +9628,7 @@ class Ts extends vs {
|
|
|
9600
9628
|
};
|
|
9601
9629
|
this.picking = [ new n.FBORayPicking(this.renderer, i, this.layer.getRenderer().pickingFBO, this.getMap()) ];
|
|
9602
9630
|
}
|
|
9603
|
-
|
|
9631
|
+
er(t) {
|
|
9604
9632
|
const e = {
|
|
9605
9633
|
x: 0,
|
|
9606
9634
|
y: 0,
|
|
@@ -9642,20 +9670,20 @@ class Ts extends vs {
|
|
|
9642
9670
|
polygonOffset: this.getPolygonOffset()
|
|
9643
9671
|
}, s = {
|
|
9644
9672
|
uniforms: r,
|
|
9645
|
-
defines: this.
|
|
9673
|
+
defines: this.ss(i),
|
|
9646
9674
|
extraCommandProps: o
|
|
9647
9675
|
};
|
|
9648
9676
|
this.shader = new n.pbr.StandardShader(s), s.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 ",
|
|
9649
|
-
this.
|
|
9677
|
+
this.Zo = new n.pbr.StandardShader(s);
|
|
9650
9678
|
}
|
|
9651
|
-
|
|
9679
|
+
es({resources: t}) {
|
|
9652
9680
|
for (let e = 0; e < t.length; e++) this.addCachedTexture(t[e].url, t[e].data);
|
|
9653
9681
|
this.setToRedraw(!0);
|
|
9654
9682
|
}
|
|
9655
|
-
|
|
9683
|
+
os() {
|
|
9656
9684
|
this.setToRedraw(!0);
|
|
9657
9685
|
}
|
|
9658
|
-
|
|
9686
|
+
Xn(t) {
|
|
9659
9687
|
if (t) {
|
|
9660
9688
|
const e = this.getSymbols()[0].material;
|
|
9661
9689
|
e && jn(e, t);
|
|
@@ -9679,15 +9707,15 @@ class Ts extends vs {
|
|
|
9679
9707
|
url: s,
|
|
9680
9708
|
wrap: "repeat"
|
|
9681
9709
|
}), o.flipY = !0, //!dataConfig.side && !isNil(dataConfig.side) || this.dataConfig.textureYOrigin === 'bottom';
|
|
9682
|
-
o.min = "linear mipmap linear", o.mag = "linear", i[t] = new n.Texture2D(o, this.
|
|
9683
|
-
i[t].once("complete", this.
|
|
9710
|
+
o.min = "linear mipmap linear", o.mag = "linear", i[t] = new n.Texture2D(o, this.Yo),
|
|
9711
|
+
i[t].once("complete", this.ts), i[t].once("disposed", this.ns), i[t].promise && this.addCachedTexture(s, i[t].promise),
|
|
9684
9712
|
r = !0;
|
|
9685
9713
|
} else i[t] = e[t];
|
|
9686
9714
|
if (this.material) {
|
|
9687
9715
|
for (let t in i) this.material.set(t, i[t]);
|
|
9688
9716
|
this.setToRedraw(!0);
|
|
9689
|
-
} else this.material = new n.pbr.StandardMaterial(i), this.material.once("complete", this.
|
|
9690
|
-
r || this.
|
|
9717
|
+
} else this.material = new n.pbr.StandardMaterial(i), this.material.once("complete", this.rs);
|
|
9718
|
+
r || this.os();
|
|
9691
9719
|
}
|
|
9692
9720
|
getShader() {
|
|
9693
9721
|
return this.shader;
|
|
@@ -9696,13 +9724,13 @@ class Ts extends vs {
|
|
|
9696
9724
|
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = _s(t, n, i, e && e.ssr, e && e.jitter);
|
|
9697
9725
|
return this.setIncludeUniformValues(r, e), r;
|
|
9698
9726
|
}
|
|
9699
|
-
|
|
9727
|
+
ss(t) {
|
|
9700
9728
|
return this.hasIBL() ? t.HAS_IBL_LIGHTING = 1 : delete t.HAS_IBL_LIGHTING, t;
|
|
9701
9729
|
}
|
|
9702
|
-
|
|
9730
|
+
Qo() {
|
|
9703
9731
|
if (!this.shader) return;
|
|
9704
9732
|
const t = this.shader.shaderDefines;
|
|
9705
|
-
this.
|
|
9733
|
+
this.ss(t), this.shader.shaderDefines = t;
|
|
9706
9734
|
}
|
|
9707
9735
|
}
|
|
9708
9736
|
|
|
@@ -9718,7 +9746,7 @@ class Ps extends ji {
|
|
|
9718
9746
|
return this.isAnimating() ? "fxaa" === t || "fxaaAfterTaa" === t : "taa" === t || "fxaa" === t;
|
|
9719
9747
|
}
|
|
9720
9748
|
isAnimating() {
|
|
9721
|
-
if (this.
|
|
9749
|
+
if (this.nr) return !0;
|
|
9722
9750
|
const t = this.getSymbols();
|
|
9723
9751
|
for (let e = 0; e < t.length; e++) if (t[e].linePatternFile && t[e].linePatternAnimSpeed) return !0;
|
|
9724
9752
|
return !1;
|
|
@@ -9768,7 +9796,7 @@ class Ps extends ji {
|
|
|
9768
9796
|
super.paint(t);
|
|
9769
9797
|
}
|
|
9770
9798
|
init(t) {
|
|
9771
|
-
this.getMap().on("updatelights", this.
|
|
9799
|
+
this.getMap().on("updatelights", this.Qo, this), this.createIBLTextures();
|
|
9772
9800
|
const e = this.regl;
|
|
9773
9801
|
if (this.renderer = new n.Renderer(e), this.createShader(t), this.pickingFBO) {
|
|
9774
9802
|
const t = [];
|
|
@@ -9791,7 +9819,7 @@ class Ps extends ji {
|
|
|
9791
9819
|
}
|
|
9792
9820
|
}
|
|
9793
9821
|
createShader(t) {
|
|
9794
|
-
this.
|
|
9822
|
+
this.or = t;
|
|
9795
9823
|
const e = [], i = {};
|
|
9796
9824
|
this.fillIncludes(i, e, t), e.push({
|
|
9797
9825
|
name: "projViewModelMatrix",
|
|
@@ -9803,7 +9831,7 @@ class Ps extends ji {
|
|
|
9803
9831
|
}), this.shader = new n.pbr.StandardShader({
|
|
9804
9832
|
vert: Ss,
|
|
9805
9833
|
uniforms: e,
|
|
9806
|
-
defines: this.
|
|
9834
|
+
defines: this.ss(i),
|
|
9807
9835
|
extraCommandProps: this.getExtraCommandProps()
|
|
9808
9836
|
});
|
|
9809
9837
|
}
|
|
@@ -9918,13 +9946,13 @@ class Ps extends ji {
|
|
|
9918
9946
|
}
|
|
9919
9947
|
} ];
|
|
9920
9948
|
}
|
|
9921
|
-
|
|
9949
|
+
ss(t) {
|
|
9922
9950
|
return this.hasIBL() ? t.HAS_IBL_LIGHTING = 1 : delete t.HAS_IBL_LIGHTING, t;
|
|
9923
9951
|
}
|
|
9924
|
-
|
|
9952
|
+
Qo() {
|
|
9925
9953
|
if (!this.shader) return;
|
|
9926
9954
|
const t = this.shader.shaderDefines;
|
|
9927
|
-
this.
|
|
9955
|
+
this.ss(t), this.shader.shaderDefines = t;
|
|
9928
9956
|
}
|
|
9929
9957
|
delete() {
|
|
9930
9958
|
super.delete(), this.disposeIBLTextures(), this.shader && (this.shader.dispose(),
|
|
@@ -9934,13 +9962,13 @@ class Ps extends ji {
|
|
|
9934
9962
|
|
|
9935
9963
|
const Is = [], Os = [], Cs = [], Fs = [], Es = [], zs = [ 0, 0, 0 ], js = [ 0, 0, 0 ], Rs = [ 1, 1, 1 ], Ds = [], Ns = [ 1, 1, 1, 1 ], Ls = [], Hs = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], Vs = t => class extends t {
|
|
9936
9964
|
constructor(t, e, i, r, o, s) {
|
|
9937
|
-
super(t, e, i, r, o, s), this.
|
|
9938
|
-
this.
|
|
9965
|
+
super(t, e, i, r, o, s), this.as = !1, this.scene.sortFunction = this.sortByCommandKey,
|
|
9966
|
+
this.ls = [], this.hs = new n.GLTFManager(t), this.cs(), this.us();
|
|
9939
9967
|
}
|
|
9940
9968
|
isAnimating() {
|
|
9941
9969
|
const t = this.getSymbols();
|
|
9942
9970
|
for (let e = 0; e < t.length; e++) {
|
|
9943
|
-
if (t[e] && this.
|
|
9971
|
+
if (t[e] && this.fs[e] && this.ds(e)) return !0;
|
|
9944
9972
|
}
|
|
9945
9973
|
return !1;
|
|
9946
9974
|
}
|
|
@@ -9960,7 +9988,7 @@ const Is = [], Os = [], Cs = [], Fs = [], Es = [], zs = [ 0, 0, 0 ], js = [ 0, 0
|
|
|
9960
9988
|
return Ds;
|
|
9961
9989
|
}
|
|
9962
9990
|
createMesh(t, e, {tileTranslationMatrix: o, tileExtent: s}) {
|
|
9963
|
-
if (!this.
|
|
9991
|
+
if (!this.as) return null;
|
|
9964
9992
|
const a = this.getMap(), {geometry: l} = t, {positionSize: h, features: c} = l, {aPosition: u, aPickingId: f, aXYRotation: d, aZRotation: p} = l.data, m = u.length / h;
|
|
9965
9993
|
if (0 === m) return null;
|
|
9966
9994
|
const y = {
|
|
@@ -9968,7 +9996,7 @@ const Is = [], Os = [], Cs = [], Fs = [], Es = [], zs = [ 0, 0, 0 ], js = [ 0, 0
|
|
|
9968
9996
|
instance_vectorB: new Float32Array(4 * m),
|
|
9969
9997
|
instance_vectorC: new Float32Array(4 * m),
|
|
9970
9998
|
aPickingId: []
|
|
9971
|
-
}, g = this.
|
|
9999
|
+
}, g = this.ps(y, o, s, l.properties.z, u, d, p, h, f, c);
|
|
9972
10000
|
l.data.aTerrainAltitude && (y.aTerrainAltitude = l.data.aTerrainAltitude);
|
|
9973
10001
|
const v = {};
|
|
9974
10002
|
for (const t in y) v[t] = {
|
|
@@ -9978,22 +10006,22 @@ const Is = [], Os = [], Cs = [], Fs = [], Es = [], zs = [ 0, 0, 0 ], js = [ 0, 0
|
|
|
9978
10006
|
}),
|
|
9979
10007
|
divisor: 1
|
|
9980
10008
|
};
|
|
9981
|
-
const b = this.
|
|
10009
|
+
const b = this.ms(), x = this.ys(), w = r.identity([]);
|
|
9982
10010
|
r.scale(w, w, [ x, x, x ]);
|
|
9983
10011
|
const A = [], k = this.getSymbols();
|
|
9984
10012
|
for (let t = 0; t < k.length; t++) {
|
|
9985
|
-
const e = k[t], s = this.
|
|
10013
|
+
const e = k[t], s = this.ls[t];
|
|
9986
10014
|
if (!s) continue;
|
|
9987
10015
|
const {fixSizeOnZoom: h} = e;
|
|
9988
10016
|
let c = r.identity([]);
|
|
9989
|
-
b || (c = this.
|
|
10017
|
+
b || (c = this.gs(c));
|
|
9990
10018
|
let u = 0;
|
|
9991
10019
|
s.forEach(t => {
|
|
9992
10020
|
const {geometry: n, nodeMatrix: i} = t;
|
|
9993
10021
|
r.multiply(Ls, Hs, i), r.multiply(Ls, c, Ls);
|
|
9994
10022
|
const o = r.multiply(Ls, w, Ls), s = n.boundingBox.copy();
|
|
9995
10023
|
s.transform(o);
|
|
9996
|
-
const a = this.
|
|
10024
|
+
const a = this.vs(s, e);
|
|
9997
10025
|
Math.abs(a) > Math.abs(u) && (u = a);
|
|
9998
10026
|
});
|
|
9999
10027
|
const f = [ 0, 0, u ], d = s.map(s => {
|
|
@@ -10036,7 +10064,7 @@ const Is = [], Os = [], Cs = [], Fs = [], Es = [], zs = [ 0, 0, 0 ], js = [ 0, 0
|
|
|
10036
10064
|
positionSize: h
|
|
10037
10065
|
}, A;
|
|
10038
10066
|
}
|
|
10039
|
-
|
|
10067
|
+
vs(t, e) {
|
|
10040
10068
|
const n = e.anchorZ || "center";
|
|
10041
10069
|
let i = 0;
|
|
10042
10070
|
const r = t.max[2] - t.min[2];
|
|
@@ -10047,13 +10075,13 @@ const Is = [], Os = [], Cs = [], Fs = [], Es = [], zs = [ 0, 0, 0 ], js = [ 0, 0
|
|
|
10047
10075
|
if (t[0].properties.level > 2) return null;
|
|
10048
10076
|
for (let e = 0; e < t.length; e++) {
|
|
10049
10077
|
if (!t[e] || !t[e].geometry) continue;
|
|
10050
|
-
t[e].instancedData.aTerrainAltitude && this.
|
|
10051
|
-
const i = this.
|
|
10078
|
+
t[e].instancedData.aTerrainAltitude && this.Oi(t[e], t[e].instancedData, t[e].properties, 3, n);
|
|
10079
|
+
const i = this.ds(t[e].properties.symbolIndex.index);
|
|
10052
10080
|
t[e].setUniform("skinAnimation", +i);
|
|
10053
10081
|
}
|
|
10054
10082
|
return this.scene.addMesh(t), this;
|
|
10055
10083
|
}
|
|
10056
|
-
|
|
10084
|
+
tr(t, e) {
|
|
10057
10085
|
t && t.updateInstancedData && t.updateInstancedData("aTerrainAltitude", e);
|
|
10058
10086
|
}
|
|
10059
10087
|
prepareRender(t) {
|
|
@@ -10061,12 +10089,12 @@ const Is = [], Os = [], Cs = [], Fs = [], Es = [], zs = [ 0, 0, 0 ], js = [ 0, 0
|
|
|
10061
10089
|
let n = !1;
|
|
10062
10090
|
for (let i = 0; i < e.length; i++) {
|
|
10063
10091
|
const r = e[i];
|
|
10064
|
-
if (!r || !this.
|
|
10065
|
-
if (this.
|
|
10092
|
+
if (!r || !this.fs[i]) continue;
|
|
10093
|
+
if (this.ds(i) && this.fs[i]) {
|
|
10066
10094
|
n || (n = !0);
|
|
10067
10095
|
let e = r.speed;
|
|
10068
10096
|
const o = !!r.loop;
|
|
10069
|
-
Nn(e) && (e = 1), this.
|
|
10097
|
+
Nn(e) && (e = 1), this.fs[i].updateAnimation(t.timestamp, o, e);
|
|
10070
10098
|
}
|
|
10071
10099
|
}
|
|
10072
10100
|
n && this.setToRedraw(!0), super.prepareRender(t);
|
|
@@ -10076,11 +10104,11 @@ const Is = [], Os = [], Cs = [], Fs = [], Es = [], zs = [ 0, 0, 0 ], js = [ 0, 0
|
|
|
10076
10104
|
this.shadowCount = this.scene.getMeshes().length;
|
|
10077
10105
|
return this.scene.getMeshes().filter(t => 0 === t.properties.level);
|
|
10078
10106
|
}
|
|
10079
|
-
|
|
10107
|
+
ds(t) {
|
|
10080
10108
|
const e = this.getSymbols()[t];
|
|
10081
|
-
return e && e.animation && this.
|
|
10109
|
+
return e && e.animation && this.fs[t] && this.fs[t].hasSkinAnimation();
|
|
10082
10110
|
}
|
|
10083
|
-
|
|
10111
|
+
ps(t, e, n, o, s, a, l, h, c, u) {
|
|
10084
10112
|
function f(e, n, i, r) {
|
|
10085
10113
|
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];
|
|
10086
10114
|
}
|
|
@@ -10092,7 +10120,7 @@ const Is = [], Os = [], Cs = [], Fs = [], Es = [], zs = [ 0, 0, 0 ], js = [ 0, 0
|
|
|
10092
10120
|
e[0] < g && (g = e[0]), e[0] > x && (x = e[0]), e[1] < v && (v = e[1]), e[1] > w && (w = e[1]),
|
|
10093
10121
|
e[2] < b && (b = e[2]), e[2] > A && (A = e[2]);
|
|
10094
10122
|
}
|
|
10095
|
-
const _ = g + x / 2, T = v + w / 2, S = b + A / 2, M = [], P = this.
|
|
10123
|
+
const _ = g + x / 2, T = v + w / 2, S = b + A / 2, M = [], P = this.ms(), I = [ 0, 0, 1 ];
|
|
10096
10124
|
for (let e = 0; e < d; e++) {
|
|
10097
10125
|
const n = s[e * h], o = s[e * h + 1], d = i.set(k, n * p - _, -o * p - T, 2 === h ? 0 : (s[e * h + 2] + y) * m - S), g = a && a[e] || 0, v = l && l[e] || 0;
|
|
10098
10126
|
if (g || v) {
|
|
@@ -10103,7 +10131,7 @@ const Is = [], Os = [], Cs = [], Fs = [], Es = [], zs = [ 0, 0, 0 ], js = [ 0, 0
|
|
|
10103
10131
|
r.multiply(M, s, M);
|
|
10104
10132
|
} else r.fromTranslation(M, d);
|
|
10105
10133
|
if (P) {
|
|
10106
|
-
const t = this.
|
|
10134
|
+
const t = this.gs(Ls, u, c, e);
|
|
10107
10135
|
r.multiply(M, M, t);
|
|
10108
10136
|
}
|
|
10109
10137
|
f("instance_vectorA", e, M, 0), f("instance_vectorB", e, M, 1), f("instance_vectorC", e, M, 2),
|
|
@@ -10111,63 +10139,63 @@ const Is = [], Os = [], Cs = [], Fs = [], Es = [], zs = [ 0, 0, 0 ], js = [ 0, 0
|
|
|
10111
10139
|
}
|
|
10112
10140
|
return i.set(k, _, T, S), k;
|
|
10113
10141
|
}
|
|
10114
|
-
|
|
10115
|
-
if (!this.
|
|
10142
|
+
ys() {
|
|
10143
|
+
if (!this.bs) {
|
|
10116
10144
|
const t = this.getMap();
|
|
10117
|
-
this.
|
|
10145
|
+
this.bs = 100 * ot(t.getGLRes(), t);
|
|
10118
10146
|
}
|
|
10119
|
-
return this.
|
|
10147
|
+
return this.bs;
|
|
10120
10148
|
}
|
|
10121
|
-
|
|
10122
|
-
const o = this.getMap(), s = this.symbolDef[0], a = this.
|
|
10149
|
+
gs(t, e, n, r) {
|
|
10150
|
+
const o = this.getMap(), s = this.symbolDef[0], a = this.ys();
|
|
10123
10151
|
let l = s.translationX || 0, h = s.translationY || 0, c = s.translationZ || 0, u = s.rotationX || 0, f = s.rotationY || 0, d = s.rotationZ || 0, p = s.scaleX || 0, m = s.scaleY || 0, y = s.scaleZ || 0;
|
|
10124
10152
|
const g = n && n[r], v = e && e[g], b = o.getZoom(), x = v && v.feature && v.feature.properties;
|
|
10125
|
-
this.
|
|
10153
|
+
this.xs && (l = this.xs(b, x)), this.ws && (h = this.ws(b, x)), this.As && (c = this.As(b, x));
|
|
10126
10154
|
const w = i.set(Os, l * a, h * a, c * a);
|
|
10127
|
-
this.
|
|
10155
|
+
this.ks && (u = this.ks(b, x)), this._s && (f = this._s(b, x)), this.Ts && (d = this.Ts(b, x));
|
|
10128
10156
|
const A = i.set(Cs, u, f, d);
|
|
10129
|
-
this.
|
|
10157
|
+
this.Ss && (p = this.Ss(b, x)), this.Ms && (m = this.Ms(b, x)), this.Ps && (y = this.Ps(b, x));
|
|
10130
10158
|
const k = i.set(Fs, p, m, y);
|
|
10131
|
-
return this.
|
|
10159
|
+
return this.Is(t, w, A, k);
|
|
10132
10160
|
}
|
|
10133
10161
|
getShaderConfig() {
|
|
10134
10162
|
const t = super.getShaderConfig();
|
|
10135
10163
|
return t.positionAttribute = "POSITION", t.normalAttribute = "NORMAL", t;
|
|
10136
10164
|
}
|
|
10137
10165
|
init(t) {
|
|
10138
|
-
super.init(t), this.
|
|
10166
|
+
super.init(t), this.us();
|
|
10139
10167
|
}
|
|
10140
|
-
|
|
10168
|
+
cs() {
|
|
10141
10169
|
const t = this.symbolDef[0];
|
|
10142
|
-
p(t.translationX) && (this.
|
|
10143
|
-
p(t.translationZ) && (this.
|
|
10144
|
-
p(t.rotationY) && (this.
|
|
10145
|
-
p(t.scaleX) && (this.
|
|
10146
|
-
p(t.scaleZ) && (this.
|
|
10147
|
-
}
|
|
10148
|
-
|
|
10149
|
-
return !!(this.
|
|
10150
|
-
}
|
|
10151
|
-
|
|
10152
|
-
if (this.
|
|
10153
|
-
this.
|
|
10170
|
+
p(t.translationX) && (this.xs = g(t.translationX)), p(t.translationY) && (this.ws = g(t.translationY)),
|
|
10171
|
+
p(t.translationZ) && (this.As = g(t.translationZ)), p(t.rotationX) && (this.ks = g(t.rotationX)),
|
|
10172
|
+
p(t.rotationY) && (this._s = g(t.rotationY)), p(t.rotationZ) && (this.Ts = g(t.rotationZ)),
|
|
10173
|
+
p(t.scaleX) && (this.Ss = g(t.scaleX)), p(t.scaleY) && (this.Ms = g(t.scaleY)),
|
|
10174
|
+
p(t.scaleZ) && (this.Ps = g(t.scaleZ));
|
|
10175
|
+
}
|
|
10176
|
+
ms() {
|
|
10177
|
+
return !!(this.xs && !this.xs.isFeatureConstant || this.ws && !this.ws.isFeatureConstant || this.As && !this.As.isFeatureConstant || this.ks && !this.ks.isFeatureConstant || this._s && !this._s.isFeatureConstant || this.Ts && !this.Ts.isFeatureConstant || this.Ss && !this.Ss.isFeatureConstant || this.Ms && !this.Ms.isFeatureConstant || this.Ps && !this.Ps.isFeatureConstant);
|
|
10178
|
+
}
|
|
10179
|
+
us() {
|
|
10180
|
+
if (this.fs) return;
|
|
10181
|
+
this.fs = [];
|
|
10154
10182
|
const t = this.getSymbols();
|
|
10155
|
-
this.
|
|
10183
|
+
this.Os = 0;
|
|
10156
10184
|
for (let e = 0; e < t.length; e++) {
|
|
10157
10185
|
const n = t[e].url || "pyramid";
|
|
10158
|
-
this.
|
|
10159
|
-
const i = this.
|
|
10186
|
+
this.hs.loginGLTF(n);
|
|
10187
|
+
const i = this.hs.getGLTF(n);
|
|
10160
10188
|
if (i.then) i.then(n => {
|
|
10161
|
-
if (!n.gltfPack) return this.
|
|
10189
|
+
if (!n.gltfPack) return this.Os++, void (this.Os >= t.length && (this.as = !0, this.setToRedraw(!0)));
|
|
10162
10190
|
const {gltfPack: i} = n;
|
|
10163
|
-
this.
|
|
10191
|
+
this.fs[e] = [ i ], this.ls[e] = i.getMeshesInfo(), this.Os++, this.Os >= t.length && (this.as = !0),
|
|
10164
10192
|
this.setToRedraw(!0);
|
|
10165
10193
|
}); else {
|
|
10166
10194
|
const {gltfPack: t} = i;
|
|
10167
|
-
t && (this.
|
|
10195
|
+
t && (this.fs[e] = [ t ], this.ls[e] = t.getMeshesInfo(), this.Os++);
|
|
10168
10196
|
}
|
|
10169
10197
|
}
|
|
10170
|
-
this.
|
|
10198
|
+
this.Os >= t.length && (this.as = !0);
|
|
10171
10199
|
}
|
|
10172
10200
|
getPickingVert() {
|
|
10173
10201
|
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 }";
|
|
@@ -10183,10 +10211,10 @@ const Is = [], Os = [], Cs = [], Fs = [], Es = [], zs = [ 0, 0, 0 ], js = [ 0, 0
|
|
|
10183
10211
|
const t = this.getSymbols();
|
|
10184
10212
|
for (let e = 0; e < t.length; e++) {
|
|
10185
10213
|
const n = t[e].url || "pyramid";
|
|
10186
|
-
this.
|
|
10214
|
+
this.hs.logoutGLTF(n);
|
|
10187
10215
|
}
|
|
10188
10216
|
}
|
|
10189
|
-
|
|
10217
|
+
Is(t, e, n, o) {
|
|
10190
10218
|
const s = i.set(Is, ...e || zs), a = n || js, l = o || Rs, h = u.fromEuler(Es, a[0], a[1], a[2]);
|
|
10191
10219
|
return r.fromRotationTranslationScale(t, h, s, l);
|
|
10192
10220
|
}
|
|
@@ -10239,30 +10267,30 @@ class Ys extends ji {
|
|
|
10239
10267
|
}
|
|
10240
10268
|
callShader(t, e) {
|
|
10241
10269
|
super.callShader(t, e), this.transformWater();
|
|
10242
|
-
const n = this.
|
|
10243
|
-
this.renderer.render(this.
|
|
10270
|
+
const n = this.Cs(this.getMap(), e);
|
|
10271
|
+
this.renderer.render(this.Fs, n, this.Es, this.getRenderFBO(e));
|
|
10244
10272
|
}
|
|
10245
10273
|
addMesh(t, e) {
|
|
10246
|
-
this.
|
|
10274
|
+
this.rr(t, e), super.addMesh(...arguments);
|
|
10247
10275
|
}
|
|
10248
|
-
|
|
10276
|
+
rr(t) {
|
|
10249
10277
|
const e = this.getSymbol(qs).ssr;
|
|
10250
10278
|
for (let n = 0; n < t.length; n++) t[n].ssr = e ? 1 : 0;
|
|
10251
10279
|
}
|
|
10252
10280
|
paint(t) {
|
|
10253
|
-
t.states && t.states.includesChanged && (this.shader.dispose(), this.
|
|
10254
|
-
this.
|
|
10255
|
-
const e = !!t.ssr && this.getSymbol(qs).ssr, n = this.
|
|
10281
|
+
t.states && t.states.includesChanged && (this.shader.dispose(), this.Fs.dispose(),
|
|
10282
|
+
this.er(t));
|
|
10283
|
+
const e = !!t.ssr && this.getSymbol(qs).ssr, n = this.Fs, i = n.shaderDefines;
|
|
10256
10284
|
if (e) {
|
|
10257
10285
|
const e = jn({}, i, t.ssr.defines);
|
|
10258
10286
|
n.shaderDefines = e;
|
|
10259
10287
|
}
|
|
10260
|
-
this.updateIBLDefines(n), this.
|
|
10288
|
+
this.updateIBLDefines(n), this.zs.ssr = e ? 1 : 0, super.paint(t), e && (n.shaderDefines = i);
|
|
10261
10289
|
}
|
|
10262
10290
|
init(t) {
|
|
10263
10291
|
this.createIBLTextures();
|
|
10264
10292
|
const e = this.regl;
|
|
10265
|
-
this.renderer = new n.Renderer(e), this.createGround(), this.
|
|
10293
|
+
this.renderer = new n.Renderer(e), this.createGround(), this.er(t), this.pickingFBO && (this.picking = [ new n.FBORayPicking(this.renderer, {
|
|
10266
10294
|
vert: Ri,
|
|
10267
10295
|
uniforms: [ {
|
|
10268
10296
|
name: "projViewModelMatrix",
|
|
@@ -10275,38 +10303,38 @@ class Ys extends ji {
|
|
|
10275
10303
|
extraCommandProps: {
|
|
10276
10304
|
viewport: this.pickingViewport
|
|
10277
10305
|
}
|
|
10278
|
-
}, this.pickingFBO, this.getMap()) ]), this.
|
|
10306
|
+
}, this.pickingFBO, this.getMap()) ]), this.js();
|
|
10279
10307
|
}
|
|
10280
|
-
|
|
10308
|
+
js() {
|
|
10281
10309
|
const t = this.regl;
|
|
10282
|
-
this.
|
|
10310
|
+
this.Rs || (this.Rs = t.texture(2));
|
|
10283
10311
|
const e = this.getSymbol({
|
|
10284
10312
|
index: 0
|
|
10285
10313
|
}), n = e.texWaveNormal, i = this.getCachedTexture(n), r = this;
|
|
10286
|
-
if (i) this.
|
|
10287
|
-
this.shader && this.
|
|
10288
|
-
}, 20) : this.
|
|
10314
|
+
if (i) this.Ds || (i.isLoading ? setTimeout(() => {
|
|
10315
|
+
this.shader && this.js();
|
|
10316
|
+
}, 20) : this.Ds = this.Ns(t, i)); else {
|
|
10289
10317
|
const e = new Image;
|
|
10290
10318
|
e.isLoading = !0, e.onload = function() {
|
|
10291
|
-
delete this.isLoading, r.
|
|
10319
|
+
delete this.isLoading, r.Ds = r.Ns(t, this), r.setToRedraw();
|
|
10292
10320
|
}, e.onerror = () => {
|
|
10293
10321
|
console.error("invalid water wave normal texture:" + n);
|
|
10294
10322
|
}, this.addCachedTexture(n, e), e.src = n;
|
|
10295
10323
|
}
|
|
10296
10324
|
const o = e.texWavePerturbation, s = this.getCachedTexture(o);
|
|
10297
|
-
if (s) this.
|
|
10298
|
-
this.
|
|
10299
|
-
}, 20) : this.
|
|
10325
|
+
if (s) this.Ls || (s.isLoading ? setTimeout(() => {
|
|
10326
|
+
this.js(), this.shader;
|
|
10327
|
+
}, 20) : this.Ls = this.Ns(t, s)); else {
|
|
10300
10328
|
const e = new Image;
|
|
10301
10329
|
e.isLoading = !0, e.onload = function() {
|
|
10302
|
-
delete this.isLoading, r.
|
|
10330
|
+
delete this.isLoading, r.Ls = r.Ns(t, this), r.setToRedraw();
|
|
10303
10331
|
}, e.onerror = () => {
|
|
10304
10332
|
console.error("invalid water wave perturbation texture:" + o);
|
|
10305
10333
|
}, this.addCachedTexture(o, e), e.src = o;
|
|
10306
10334
|
}
|
|
10307
10335
|
}
|
|
10308
|
-
|
|
10309
|
-
return this.
|
|
10336
|
+
Ns(t, e) {
|
|
10337
|
+
return this.Rs ? t.texture({
|
|
10310
10338
|
width: e.width,
|
|
10311
10339
|
height: e.height,
|
|
10312
10340
|
mag: "linear",
|
|
@@ -10317,7 +10345,7 @@ class Ys extends ji {
|
|
|
10317
10345
|
data: e
|
|
10318
10346
|
}) : null;
|
|
10319
10347
|
}
|
|
10320
|
-
|
|
10348
|
+
er(t) {
|
|
10321
10349
|
const e = this.canvas, i = [], o = [ {
|
|
10322
10350
|
name: "projViewModelMatrix",
|
|
10323
10351
|
type: "function",
|
|
@@ -10412,7 +10440,7 @@ class Ys extends ji {
|
|
|
10412
10440
|
enable: !1
|
|
10413
10441
|
}
|
|
10414
10442
|
};
|
|
10415
|
-
o.push(...n.SsrPass.getUniformDeclares()), this.
|
|
10443
|
+
o.push(...n.SsrPass.getUniformDeclares()), this.Fs = new n.MeshShader({
|
|
10416
10444
|
vert: "#define SHADER_NAME WATER\nuniform mat4 modelMatrix;\nuniform mat4 projViewModelMatrix;\nattribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform vec2 uvOffset;\nuniform vec2 noiseUvOffset;\nuniform vec2 uvScale;\nvarying vec2 vUv;\nvarying vec2 vNoiseUv;\nvarying vec3 vPos;\nvarying mat3 vTbnMatrix;\n#ifdef HAS_SSR\nuniform mat4 modelViewMatrix;\nvarying vec4 vViewVertex;\n#endif\n#include <highlight_vert>\nmat3 c(in vec3 d) {\n vec3 t = normalize(cross(d, vec3(.0, 1., .0)));\n vec3 e = normalize(cross(d, t));\n return mat3(t, e, d);\n}\n#if defined(HAS_SHADOWING)\n#include <vsm_shadow_vert>\n#endif\nconst vec3 f = vec3(0., 0., 1.);\nvoid main(void) {\n vec4 h = vec4(aPosition, 1.);\n vec4 i = modelMatrix * h;\n vPos = i.xyz;\n vTbnMatrix = c(f);\n gl_Position = projViewModelMatrix * h;\n vUv = aTexCoord * uvScale + uvOffset;\n vNoiseUv = aTexCoord * uvScale * TIME_NOISE_TEXTURE_REPEAT + noiseUvOffset;\n#ifdef HAS_SSR\nvec4 j = modelViewMatrix * h;\n vViewVertex = j;\n#endif\n#if defined(HAS_SHADOWING)\nshadow_computeShadowPars(h);\n#endif\nhighlight_setVarying();\n}",
|
|
10417
10445
|
frag: "#define SHADER_NAME WATER\nprecision highp float;\nprecision highp sampler2D;\n#include <hsv_frag>\nuniform vec3 hsv;\nuniform float contrast;\n#if defined(HAS_SHADOWING)\n#include <vsm_shadow_frag>\n#endif\n#include <highlight_frag>\n#if defined(HAS_IBL_LIGHTING)\nuniform vec3 hdrHSV;\nuniform samplerCube prefilterMap;\nuniform sampler2D brdfLUT;\nuniform float rgbmRange;\nuniform mat3 uEnvironmentTransform;\nuniform vec3 diffuseSPH[9];\nvec3 c(const in vec3 d) {\n vec3 e = uEnvironmentTransform * d;\n float x = e.x;\n float y = e.y;\n float z = e.z;\n vec3 f = (diffuseSPH[0] + diffuseSPH[1] * x + diffuseSPH[2] * y + diffuseSPH[3] * z + diffuseSPH[4] * z * x + diffuseSPH[5] * y * z + diffuseSPH[6] * y * x + diffuseSPH[7] * (3. * z * z - 1.) + diffuseSPH[8] * (x * x - y * y));\n if(length(hdrHSV) > .0) {\n f = hsv_apply(f, hdrHSV);\n }\n return max(f, vec3(.0));\n}\nvec3 h(const in vec3 i, const in float j, const in float k, const in float l) {\n vec4 rgba = texture2D(brdfLUT, vec2(k, j));\n float b = (rgba[3] * 65280.0 + rgba[2] * 255.);\n float a = (rgba[1] * 65280.0 + rgba[0] * 255.);\n const float m = 1. / 65535.;\n return (i * a + b * l) * m;\n}\n#else\nuniform vec3 ambientColor;\n#endif\nstruct PBRShadingWater {\n float NdotL;\n float NdotV;\n float NdotH;\n float VdotH;\n float LdotH;\n float VdotN;\n};\nvec3 o(const in vec4 u, const in float v) {\n if(v <= .0)\n return u.rgb;\n return v * u.rgb * u.a;\n}\n#ifdef HAS_SSR\nvarying vec4 vViewVertex;\nuniform mat3 modelViewNormalMatrix;\nuniform sampler2D TextureDepth;\nuniform highp vec2 outSize;\nuniform float ssrFactor;\nuniform float ssrQuality;\nuniform sampler2D TextureReflected;\nuniform highp mat4 projMatrix;\nuniform mat4 invProjMatrix;\nuniform vec4 outputFovInfo[2];\nuniform mat4 reprojViewProjMatrix;\nuniform vec2 cameraNearFar;\nfloat A(const in vec4 B) {\n return B.r + B.g / 255.;\n}\nfloat C(const in vec2 D, const in float E) {\n vec3 F = vec3(.06711056, .00583715, 52.9829189);\n return fract(F.z * fract(dot(D.xy + E * vec2(47., 17.) * .695, F.xy))) * .5;\n}\nvec3 G(const in float H, const in float I, const in vec2 J) {\n float K = min(I - .01, H);\n float L = floor(K);\n float M = min(I, L + 1.);\n float N = pow(2., M);\n vec2 O = 2. * N / J;\n if(K - L > .5)\n N *= 2.;\n return vec3(O, N);\n}\nvec2 P(const in vec2 Q, const in vec3 R) {\n vec2 S = max(R.xy, min(1. - R.xy, Q));\n return vec2(2. * S.x, R.z - 1. - S.y) / R.z;\n}\nvec3 T(const in mat4 U, const in vec3 V) {\n vec4 W = U * vec4(V, 1.);\n return vec3(.5 + .5 * W.xy / W.w, W.w);\n}\nvec3 X(const in float Y, const in vec2 S) {\n return texture2D(TextureReflected, S).rgb;\n}\nfloat Z(float ba) {\n highp mat4 U = projMatrix;\n highp float z = ba * 2. - 1.;\n return -U[3].z / (z + U[2].z);\n}\nfloat bb(const vec2 S) {\n float ba = A(texture2D(TextureDepth, S));\n return ba;\n}\nvec3 bc(const in float E, const in vec3 bd, const in vec3 be, const in vec3 bf, const in vec3 bg, const in float bh) {\n vec2 bi;\n bi.x = C(gl_FragCoord.yx, E);\n bi.y = fract(bi.x * 52.9829189);\n bi.y = mix(bi.y, 1., .7);\n float bj = 2. * 3.14159 * bi.x;\n float bk = pow(max(bi.y, .000001), bh / (2. - bh));\n float bl = sqrt(1. - bk * bk);\n vec3 bm = vec3(bl * cos(bj), bl * sin(bj), bk);\n bm = bm.x * bd + bm.y * be + bm.z * bf;\n return normalize((2. * dot(bg, bm)) * bm - bg);\n}\nfloat bn(const in float E) {\n return (C(gl_FragCoord.xy, E) - .5);\n}\nvec3 bo(const in vec3 bp, const in float bq, const in vec3 br) {\n vec3 bs = T(projMatrix, vViewVertex.xyz + br * bq);\n bs.z = 1. / bs.z;\n bs -= bp;\n float bt = min(1., .99 * (1. - bp.x) / max(1e-5, bs.x));\n float bu = min(1., .99 * (1. - bp.y) / max(1e-5, bs.y));\n float bv = min(1., .99 * bp.x / max(1e-5, -bs.x));\n float bw = min(1., .99 * bp.y / max(1e-5, -bs.y));\n return bs * min(bt, bu) * min(bv, bw);\n}\nfloat bx(const in vec3 bp, const in vec3 bs, inout float by, inout float bz) {\n float bA = (bz + by) * .5;\n vec3 bB = bp + bs * bA;\n float z = bb(bB.xy);\n float ba = Z(z);\n float bC = -1. / bB.z;\n by = ba > bC ? by : bA;\n bz = ba > bC ? bA : bz;\n return bA;\n}\nvec4 bD(const in vec3 bp, const in float bq, in float bE, const in vec3 br, const in float j, const in float E) {\n const int bF = 20;\n float bG = 1. / float(bF);\n bE *= bG;\n vec3 bs = bo(bp, bq, br);\n float bH = bG;\n vec3 bI = vec3(.0, bH, 1.);\n vec3 bB;\n float z, ba, bC, bJ, bK, bL;\n bool bM;\n float bN = 1.;\n float bA;\n for(int bO = 0; bO < bF; bO++) {\n bB = bp + bs * bI.y;\n z = bb(bB.xy);\n ba = Z(z);\n bC = -1. / bB.z;\n bJ = bC - ba;\n bJ *= clamp(sign(abs(bJ) - bq * bG * bG), .0, 1.);\n bM = abs(bJ + bE) < bE;\n bK = clamp(bI.x / (bI.x - bJ), .0, 1.);\n bL = bM ? bI.y + bK * bG - bG : 1.;\n bI.z = min(bI.z, bL);\n bI.x = bJ;\n if(bM) {\n float by = bI.y - bG;\n float bz = bI.y;\n bA = bx(bp, bs, by, bz);\n bA = bx(bp, bs, by, bz);\n bA = bx(bp, bs, by, bz);\n bN = bA;\n break;\n }\n bI.y += bG;\n }\n return vec4(bp + bs * bN, 1. - bN);\n}\nvec3 bP(in vec4 bQ, const in float bR, const in vec3 bS, const in vec3 bT, const in float j) {\n vec4 bU = mix(outputFovInfo[0], outputFovInfo[1], bQ.x);\n bQ.xyz = vec3(mix(bU.xy, bU.zw, bQ.y), 1.) * -1. / bQ.z;\n bQ.xyz = (reprojViewProjMatrix * vec4(bQ.xyz, 1.)).xyw;\n bQ.xy /= bQ.z;\n float bV = clamp(6. - 6. * max(abs(bQ.x), abs(bQ.y)), .0, 1.);\n bQ.xy = .5 + .5 * bQ.xy;\n return vec3(bQ.xy, 1.);\n}\nvec3 ssr(const in vec3 bS, const in vec3 bT, const in float j, const in vec3 d, const in vec3 bg) {\n float bW = .0;\n vec4 f = vec4(.0);\n float bh = j * j;\n bh = bh * bh;\n vec3 bX = abs(d.z) < .999 ? vec3(.0, .0, 1.) : vec3(1., .0, .0);\n vec3 bd = normalize(cross(bX, d));\n vec3 be = cross(d, bd);\n float bR = ssrFactor * clamp(-4. * dot(bg, d) + 3.8, .0, 1.);\n bR *= clamp(4.7 - j * 5., .0, 1.);\n vec3 bp = T(projMatrix, vViewVertex.xyz);\n bp.z = 1. / bp.z;\n vec3 br = bc(bW, bd, be, d, bg, bh);\n float bq = mix(cameraNearFar.y + vViewVertex.z, -vViewVertex.z - cameraNearFar.x, br.z * .5 + .5);\n float bE = .5 * bq;\n vec4 bQ;\n if(dot(br, d) > .001 && bR > .0) {\n bQ = bD(bp, bq, bE, br, j, bW);\n if(bQ.w > .0)\n return bP(bQ, bR, bS, bT, j);\n \n }\n return vec3(.0);\n}\n#endif\nconst vec3 bY = vec3(0., 0., 1.);\nuniform mat4 viewMatrix;\nuniform sampler2D normalTexture;\nuniform sampler2D heightTexture;\nuniform vec4 waveParams;\nuniform vec2 waterDir;\nuniform vec4 waterBaseColor;\nuniform vec3 lightDirection;\nuniform vec3 lightColor;\nuniform vec3 camPos;\nuniform float timeElapsed;\nvarying vec2 vUv;\nvarying vec2 vNoiseUv;\nvarying vec3 vPos;\nvarying mat3 vTbnMatrix;\nfloat bZ(vec3 e, float ca) {\n float cb = max(.015, ca);\n return max((e.x + e.y) * .3303545 / cb + .3303545, .0);\n}\nconst vec2 cc = vec2(6. / 25., 5. / 24.);\nvec2 cd(sampler2D ce, vec2 S) {\n return 2. * texture2D(ce, S).rg - 1.;\n}\nfloat cf(vec2 S) {\n return texture2D(heightTexture, S).b;\n}\nvec3 cg(sampler2D ce, vec2 S) {\n return 2. * texture2D(ce, S).rgb - 1.;\n}\nfloat ch(vec2 S, float ci) {\n return fract(ci);\n}\nfloat cj(vec2 S, float ci) {\n float ck = ch(S, ci);\n return 1. - abs(1. - 2. * ck);\n}\nvec3 cl(sampler2D cm, vec2 S, float ci, float cn) {\n float co = waveParams[2];\n float cp = waveParams[3];\n vec2 cq = cd(cm, S) * co;\n float ck = ch(S, ci + cn);\n float cr = cj(S, ci + cn);\n vec2 f = S;\n f -= cq * (ck + cp);\n f += cn;\n f += (ci - ck) * cc;\n return vec3(f, cr);\n}\nconst float cs = 7.77;\nvec3 ct(sampler2D cu, sampler2D cv, vec2 cw, vec2 cx, float ci) {\n float ca = waveParams[0];\n vec2 cy = ci * -cx;\n float cz = cf(vNoiseUv) * cs;\n vec3 cA = cl(cv, cw + cy, ci + cz, .0);\n vec3 cB = cl(cv, cw + cy, ci + cz, .5);\n vec3 cC = cg(cu, cA.xy) * cA.z;\n vec3 cD = cg(cu, cB.xy) * cB.z;\n vec3 cE = normalize(cC + cD);\n cE.xy *= ca;\n cE.z = sqrt(1. - dot(cE.xy, cE.xy));\n return cE;\n}\nvec4 cF(vec2 cw, float cG) {\n float cH = waveParams[1];\n vec3 d = ct(normalTexture, heightTexture, cw * cH, waterDir, cG);\n float cI = bZ(d, waveParams[0]);\n return vec4(d, cI);\n}\nconst float cJ = 3.141592653589793;\nconst float cK = 1. / cJ;\nconst float cL = .3183098861837907;\nconst float cM = 1.570796326794897;\nconst float cN = .4;\nfloat cO = 2.2;\nvec3 cP(float cQ, vec3 cR, float l) {\n return cR + (l - cR) * pow(1. - cQ, 5.);\n}\nfloat cS(float cT, float j) {\n float cU = j * j;\n float cV = cT * cT;\n float cW = pow((cV * (cU - 1.) + 1.), cO) * cJ;\n return cU / cW;\n}\nfloat cX(float cY) {\n return .25 / (cY * cY);\n}\nvec3 cZ(const vec3 x) {\n return (x * (2.51 * x + .03)) / (x * (2.43 * x + .59) + .14);\n}\nconst float da = 2.2;\nconst float db = .4545454545;\nvec4 dc(vec4 u) {\n return vec4(pow(u.rgb, vec3(db)), u.w);\n}\nvec3 dd(vec3 u) {\n return pow(u, vec3(da));\n}\nconst vec3 de = vec3(.02, 1., 5.);\nconst vec2 df = vec2(.02, .1);\nconst float j = .06;\nconst float dg = 1.7;\nconst vec3 dh = vec3(0, .6, .9);\nconst vec3 di = vec3(.72, .92, 1.);\nconst float dj = .65;\nconst float dk = 300000.0;\nconst float dl = 500000.0;\nconst float dm = .775;\nconst float dn = .8;\nPBRShadingWater dp;\nvec3 dq(in PBRShadingWater dr, float j, vec3 ds, float dt) {\n vec3 du = cP(dr.VdotH, ds, dt);\n float dv = cS(dr.NdotH, j);\n float dw = cX(dr.LdotH);\n float dx = mix(j + .045, j + .385, 1. - dr.VdotH);\n float dy = 1.2;\n float dz = cS(dr.NdotH, dx) * dy;\n return ((dv + dz) * dw) * du;\n}\nvec3 dA(float dg, float dB, vec3 dh, float dC) {\n return dg * (.075 * dh * pow(dB, 4.) + 50. * pow(dB, 23.)) * dC;\n}\nvec3 dD(in float bk, in vec3 dE, in vec3 dF) {\n float dG = pow((1. - bk), de[2]);\n return mix(dF, dE, dG);\n}\nvec3 dH(in vec3 e, in vec3 dI, in float dJ, in float j) {\n \n#ifdef HAS_IBL_LIGHTING\nvec3 dK = reflect(-dI, e);\n vec4 dL = textureCube(prefilterMap, uEnvironmentTransform * dK);\n float dM = clamp(1. + dot(dK, e), .0, 1.);\n dL *= dM * dM;\n vec3 i = o(dL, rgbmRange);\n vec3 dN = c(e);\n float l = clamp(50.0 * waterBaseColor.g, .0, 1.);\n vec3 dO = h(waterBaseColor.rgb, j, dot(e, dI), l);\n return i * dO + dN;\n#else\nvec3 dP = dd(di);\n vec3 dQ = dd(dh);\n vec3 di = dD(dJ, dP, dQ);\n return di;\n#endif\n}\nvec3 dR(in vec3 e, in vec3 dI, in vec3 dS, vec3 u, in vec3 dT, in vec3 dU, in float dV, float dW, vec3 dX) {\n float dY = 0.;\n vec3 dZ = dd(u);\n vec3 bm = normalize(dS + dI);\n dp.NdotL = clamp(dot(e, dS), .0, 1.);\n dp.NdotV = clamp(dot(e, dI), .001, 1.);\n dp.VdotN = clamp(dot(dI, e), .001, 1.);\n dp.NdotH = clamp(dot(e, bm), .0, 1.);\n dp.VdotH = clamp(dot(dI, bm), .0, 1.);\n dp.LdotH = clamp(dot(dS, bm), .0, 1.);\n float dJ = max(dot(dU, dI), .0);\n vec3 di = dH(e, dI, dJ, j);\n float ea = max(dot(dU, dS), .0);\n float eb = .1 + ea * .9;\n di *= eb;\n float ec = clamp(dV, .8, 1.);\n vec3 ed = cP(dp.VdotN, vec3(de[0]), de[1]);\n vec3 ee = ed * di * ec;\n vec3 ef = dZ * mix(di, ea * dT * cK, 2. / 3.) * ec;\n vec3 i = vec3(.0);\n if(dJ > .0 && ea > .0) {\n vec3 eg = dq(dp, j, vec3(df[0]), df[1]);\n vec3 eh = dT * cK * dV;\n i = dp.NdotL * eh * eg;\n }\n vec3 cI = vec3(.0);\n if(dJ > .0) {\n cI = dA(dg, dW, dh, eb);\n }\n vec3 ei = vec3(.0);\n#ifdef HAS_SSR\nfloat ej = smoothstep(dl, dk, -dX.z);\n mat4 ek = viewMatrix;\n vec4 el = vec4(dX.xyz, 1.);\n vec3 em = normalize(el.xyz);\n vec4 en = ek * vec4(e, .0);\n vec3 eo = normalize(en.xyz);\n vec4 ep = ek * vec4(dU, .0);\n float eq = pow(max(dot(-em, ep.xyz), .0), cN);\n vec3 er = mix(ep.xyz, eo, eq);\n vec3 es = ssr(vec3(.0), vec3(1.), j, normalize(er), -normalize(vViewVertex.xyz));\n if(es.z > .0) {\n vec2 et = smoothstep(.3, .6, abs(vec2(.5) - es.xy));\n dY = dm * clamp(1. - 1.3 * et.y, .0, 1.) * ej;\n vec3 eu = X(.0, es.xy);\n ei = dd(eu) * dY * ed.y * dj;\n }\n#endif\nfloat ev = mix(dn, dn * .5, dY);\n return cZ((1. - dY) * ee + ei + ef * ev + i + cI);\n}\nvoid main() {\n vec3 dU = bY;\n vec4 ew = cF(vUv, timeElapsed);\n vec3 e = normalize(vTbnMatrix * ew.xyz);\n vec3 dI = -normalize(vPos - camPos);\n vec3 dS = normalize(-lightDirection);\n#if defined(HAS_SHADOWING)\nfloat dV = shadow_computeShadow();\n#else\nfloat dV = 1.;\n#endif\nvec4 ex = viewMatrix * vec4(vPos, 1.);\n vec4 ey = vec4(dR(e, dI, dS, waterBaseColor.rgb, lightColor, dU, dV, ew.w, ex.xyz), waterBaseColor.a);\n gl_FragColor = dc(ey);\n if(contrast != 1.) {\n gl_FragColor = contrastMatrix(contrast) * gl_FragColor;\n }\n if(length(hsv) > .0) {\n gl_FragColor = hsv_apply(gl_FragColor, hsv);\n }\n gl_FragColor = highlight_blendColor(gl_FragColor);\n}",
|
|
10418
10446
|
defines: s,
|
|
@@ -10428,10 +10456,10 @@ class Ys extends ji {
|
|
|
10428
10456
|
projViewMatrix: t.projViewMatrix
|
|
10429
10457
|
};
|
|
10430
10458
|
}
|
|
10431
|
-
|
|
10459
|
+
Cs(t, e) {
|
|
10432
10460
|
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = Ws(t, n, i, e && e.ssr, e && e.jitter), o = t.getLightManager();
|
|
10433
10461
|
let s = o && o.getDirectionalLight() || {};
|
|
10434
|
-
const l = o && o.getAmbientLight() || {}, h = this.getSymbol(qs), c = this.
|
|
10462
|
+
const l = o && o.getAmbientLight() || {}, h = this.getSymbol(qs), c = this.Hs = this.Hs || [], u = this.Vs = this.Vs || [];
|
|
10435
10463
|
a.set(u, .09, h.uvScale || 3, .03, -.5);
|
|
10436
10464
|
return jn(r, {
|
|
10437
10465
|
ambientColor: l.color || [ .2, .2, .2 ],
|
|
@@ -10440,8 +10468,8 @@ class Ys extends ji {
|
|
|
10440
10468
|
lightColor: s.color || Bs.color,
|
|
10441
10469
|
camPos: t.cameraPosition,
|
|
10442
10470
|
timeElapsed: h.animation ? (this.layer.getRenderer().getFrameTimestamp() || 0) / (1 / (h.waterSpeed || 1) * 1e4) : 0,
|
|
10443
|
-
normalTexture: this.
|
|
10444
|
-
heightTexture: this.
|
|
10471
|
+
normalTexture: this.Ds || this.Rs,
|
|
10472
|
+
heightTexture: this.Ls || this.Rs,
|
|
10445
10473
|
waveParams: u,
|
|
10446
10474
|
waterDir: Js(c, h.waterDirection || 0),
|
|
10447
10475
|
waterBaseColor: h.waterBaseColor || [ .1451, .2588, .4863, 1 ],
|
|
@@ -10451,24 +10479,24 @@ class Ys extends ji {
|
|
|
10451
10479
|
r;
|
|
10452
10480
|
}
|
|
10453
10481
|
delete() {
|
|
10454
|
-
super.delete(), this.
|
|
10455
|
-
this.
|
|
10456
|
-
this.
|
|
10457
|
-
this.
|
|
10482
|
+
super.delete(), this.Rs && (this.Rs.destroy(), delete this.Rs), this.Ds && this.Ds.destroy(),
|
|
10483
|
+
this.Ls && this.Ls.destroy(), this.shader && (this.shader.dispose(), delete this.shader),
|
|
10484
|
+
this.Fs && this.Fs.dispose(), this.zs && (this.zs.geometry.dispose(), this.zs.material && this.zs.material.dispose(),
|
|
10485
|
+
this.zs.dispose(), delete this.zs), this.disposeIBLTextures();
|
|
10458
10486
|
}
|
|
10459
10487
|
createGround() {
|
|
10460
10488
|
const t = new n.Plane;
|
|
10461
10489
|
t.data.aTexCoord = new Uint8Array([ 0, 1, 1, 1, 0, 0, 1, 0 ]), t.generateBuffers(this.renderer.regl),
|
|
10462
|
-
this.
|
|
10490
|
+
this.zs = new n.Mesh(t, null, {
|
|
10463
10491
|
castShadow: !1
|
|
10464
|
-
}), this.
|
|
10492
|
+
}), this.Es = new n.Scene([ this.zs ]);
|
|
10465
10493
|
}
|
|
10466
10494
|
transformWater() {
|
|
10467
|
-
const t = this.getMap(), e = o.getGroundTransform(this.
|
|
10468
|
-
this.
|
|
10495
|
+
const t = this.getMap(), e = o.getGroundTransform(this.zs.localTransform, t);
|
|
10496
|
+
this.zs.setLocalTransform(e);
|
|
10469
10497
|
const n = t._get2DExtentAtRes(t.getGLRes()), i = n.getWidth(), r = n.getHeight(), s = t.cameraLookAt, a = s[0] - i, l = s[1] + r, h = a / $s[0], c = l / $s[1], u = h % 1, f = c % 1, d = .3737 * h % 1, p = .3737 * c % 1, m = i / $s[0] * 2, y = r / $s[1] * 2;
|
|
10470
|
-
this.
|
|
10471
|
-
this.
|
|
10498
|
+
this.zs.setUniform("uvOffset", [ u, f ]), this.zs.setUniform("noiseUvOffset", [ d, p ]),
|
|
10499
|
+
this.zs.setUniform("uvScale", [ m, -y ]);
|
|
10472
10500
|
}
|
|
10473
10501
|
}
|
|
10474
10502
|
|
|
@@ -10563,7 +10591,7 @@ const ha = En("heatmap", class extends ji {
|
|
|
10563
10591
|
}
|
|
10564
10592
|
callRenderer(t, e, n) {
|
|
10565
10593
|
const i = this.getRenderFBO(n);
|
|
10566
|
-
this.
|
|
10594
|
+
this.Us.render(this.scene, e, i);
|
|
10567
10595
|
}
|
|
10568
10596
|
getUniformValues(t) {
|
|
10569
10597
|
const e = this.getSymbol({
|
|
@@ -10580,13 +10608,13 @@ const ha = En("heatmap", class extends ji {
|
|
|
10580
10608
|
return this.scene.getMeshes();
|
|
10581
10609
|
}
|
|
10582
10610
|
delete() {
|
|
10583
|
-
super.delete(...arguments), this.
|
|
10611
|
+
super.delete(...arguments), this.Us.dispose(), delete this.Us;
|
|
10584
10612
|
}
|
|
10585
10613
|
init() {
|
|
10586
10614
|
const t = this.regl;
|
|
10587
10615
|
this.renderer = new n.Renderer(t);
|
|
10588
10616
|
const e = this.getPolygonOffset(), i = this.getSymbols()[0];
|
|
10589
|
-
this.
|
|
10617
|
+
this.Us = new d(this.regl, this.sceneConfig, this.layer, i.heatmapColor, null, e);
|
|
10590
10618
|
}
|
|
10591
10619
|
});
|
|
10592
10620
|
|
|
@@ -10597,7 +10625,7 @@ const ca = En("water", Ys);
|
|
|
10597
10625
|
ca.registerAt(Ut), ee.registerPainter("lit", Ts), ee.registerPainter("icon", xo),
|
|
10598
10626
|
ee.registerPainter("fill", Wi), ee.registerPainter("line", $i), ee.registerPainter("line-gradient", Yi),
|
|
10599
10627
|
ee.registerPainter("water", Ys), ee.registerPainter("tube", Ps), n.ShaderLib.register("vt_position_vert", "#ifdef HAS_TERRAIN_ALTITUDE\n attribute float aTerrainAltitude;\n#endif\n#ifdef HAS_ALTITUDE\n vec3 unpackVTPosition() {\n float altitude = aAltitude;\n #ifdef HAS_TERRAIN_ALTITUDE\n altitude += aTerrainAltitude * 100.0;\n #endif\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 return vec3(pos, altitude);\n }\n#endif"),
|
|
10600
|
-
Ut.VERSION = "0.86.
|
|
10628
|
+
Ut.VERSION = "0.86.2", ee.VERSION = "0.86.2";
|
|
10601
10629
|
|
|
10602
10630
|
if (e.mat4.create(), e.transcoders) {
|
|
10603
10631
|
const n = t.Map.VERSION;
|
|
@@ -10611,4 +10639,4 @@ if (e.mat4.create(), e.transcoders) {
|
|
|
10611
10639
|
|
|
10612
10640
|
export { Sn as ExtrudePolygonLayer, Wi as FillPainter, Zs as FillPlugin, aa as GLTFPhongPlugin, la as GLTFStandardPlugin, Zt as GeoJSONVectorTileLayer, ha as HeatmapPlugin, xo as IconPainter, ta as IconPlugin, Qs as LineGradientPlugin, $i as LinePainter, Ks as LinePlugin, Me as LineStringLayer, oa as LitPlugin, Yt as MapboxVectorTileLayer, fs as NativeLinePainter, na as NativeLinePlugin, hs as NativePointPainter, ws as PhongPainter, ia as PhongPlugin, Se as PointLayer, Ie as PolygonLayer, rs as TextPainter, ea as TextPlugin, sa as TubePlugin, ee as Vector3DLayer, Ut as VectorTileLayer, It as VectorTileLayerRenderer, ca as WaterPlugin, ks as WireframePainter, ra as WireframePlugin };
|
|
10613
10641
|
|
|
10614
|
-
"undefined" != typeof console && console.log("@maptalks/vt v0.86.
|
|
10642
|
+
"undefined" != typeof console && console.log("@maptalks/vt v0.86.2");
|