@maptalks/vt 0.97.1 → 0.97.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.d.ts +2 -1
- package/dist/maptalks.vt.es.js +949 -949
- package/dist/maptalks.vt.es.js.map +1 -1
- package/dist/maptalks.vt.js +979 -979
- package/dist/maptalks.vt.js.map +1 -1
- package/package.json +2 -2
package/dist/maptalks.vt.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @maptalks/vt v0.97.
|
|
2
|
+
* @maptalks/vt v0.97.2
|
|
3
3
|
* LICENSE : undefined
|
|
4
4
|
* (c) 2016-2024 maptalks.org
|
|
5
5
|
*/
|
|
@@ -7434,15 +7434,15 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7434
7434
|
n[t].tile = e;
|
|
7435
7435
|
}
|
|
7436
7436
|
}
|
|
7437
|
-
e.extent = r
|
|
7438
|
-
this.onTileLoad(r, e);
|
|
7437
|
+
e.extent = r.extent, this.Sn || (this.Sn = e.extent), r.features = Object.values(a),
|
|
7438
|
+
r.styleCounter = n.styleCounter, this.onTileLoad(r, e);
|
|
7439
7439
|
}
|
|
7440
7440
|
this.layer.fire("datareceived", {
|
|
7441
7441
|
url: t
|
|
7442
7442
|
});
|
|
7443
7443
|
}
|
|
7444
7444
|
wn(t, e, n, i) {
|
|
7445
|
-
const {style: r, isUpdated: s} = this.
|
|
7445
|
+
const {style: r, isUpdated: s} = this._n(t, e, n.data), o = this.layer, a = o.isDefaultRender(), l = r.symbol, h = No(i, n.styledFeatures, e, l, o, !(!o.getData || !o.getData()));
|
|
7446
7446
|
delete n.styledFeatures, n.features = h;
|
|
7447
7447
|
let u = n.data;
|
|
7448
7448
|
return Array.isArray(u) && (u = u[0]), {
|
|
@@ -7463,23 +7463,23 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7463
7463
|
for (const t in i) (!r[t] || r[t] && "object" !== i[t] && "object" === r[t]) && (r[t] = i[t]);
|
|
7464
7464
|
}
|
|
7465
7465
|
}
|
|
7466
|
-
|
|
7466
|
+
_n(t, e, n) {
|
|
7467
7467
|
Array.isArray(n) && (n = n[0]);
|
|
7468
7468
|
const i = this.layer;
|
|
7469
7469
|
let r, s = !1;
|
|
7470
7470
|
if (i.isDefaultRender() && 0 === t) {
|
|
7471
|
-
let t = this.
|
|
7472
|
-
t || (t = this.
|
|
7471
|
+
let t = this.Pn;
|
|
7472
|
+
t || (t = this.Pn = {});
|
|
7473
7473
|
const e = n.layer, i = n.type;
|
|
7474
7474
|
t[e] || (t[e] = []);
|
|
7475
7475
|
const o = ("plugin_" + i).trim();
|
|
7476
|
-
t[e][o] ? r = t[e][o] : (r = this.
|
|
7476
|
+
t[e][o] ? r = t[e][o] : (r = this.kn(i), r.filter = n.filter, t[e].push(r), t[e][o] = r,
|
|
7477
7477
|
s = !0);
|
|
7478
7478
|
} else {
|
|
7479
7479
|
const o = i.Ee(), a = i.Ue(t, o), l = this.Ne();
|
|
7480
7480
|
if (r = a[e], !r.renderPlugin) {
|
|
7481
7481
|
s = !0;
|
|
7482
|
-
const {plugin: t, symbol: i, renderPlugin: o} = this.
|
|
7482
|
+
const {plugin: t, symbol: i, renderPlugin: o} = this.kn(n.type);
|
|
7483
7483
|
l[e] = t, r.symbol = i, r.renderPlugin = o;
|
|
7484
7484
|
}
|
|
7485
7485
|
}
|
|
@@ -7491,21 +7491,21 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7491
7491
|
je(t) {
|
|
7492
7492
|
const e = t && t.style;
|
|
7493
7493
|
let n = this.Ne(e) || [];
|
|
7494
|
-
this.layer.isDefaultRender() && this.
|
|
7494
|
+
this.layer.isDefaultRender() && this.Pn && (n = [], t ? t.layers && t.layers.forEach((t => {
|
|
7495
7495
|
if (!t) return;
|
|
7496
7496
|
const e = ("plugin_" + t.type).trim();
|
|
7497
|
-
n.push(this.
|
|
7498
|
-
})) : Object.keys(this.
|
|
7499
|
-
for (let e = 0; e < this.
|
|
7497
|
+
n.push(this.Pn[t.layer][e].plugin);
|
|
7498
|
+
})) : Object.keys(this.Pn).forEach((t => {
|
|
7499
|
+
for (let e = 0; e < this.Pn[t].length; e++) n.push(this.Pn[t][e].plugin);
|
|
7500
7500
|
})));
|
|
7501
7501
|
const i = this.Ve(e);
|
|
7502
7502
|
return i && i.length && (n = n.slice(), go(n, i)), n;
|
|
7503
7503
|
}
|
|
7504
7504
|
pn() {
|
|
7505
|
-
if (this.layer.isDefaultRender() && this.
|
|
7505
|
+
if (this.layer.isDefaultRender() && this.Pn) {
|
|
7506
7506
|
const t = [];
|
|
7507
|
-
return Object.keys(this.
|
|
7508
|
-
for (let n = 0; n < this.
|
|
7507
|
+
return Object.keys(this.Pn).forEach((e => {
|
|
7508
|
+
for (let n = 0; n < this.Pn[e].length; n++) t.push(this.Pn[e][n].plugin);
|
|
7509
7509
|
})), t;
|
|
7510
7510
|
}
|
|
7511
7511
|
const t = [];
|
|
@@ -7520,7 +7520,7 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7520
7520
|
return yo(t) && (t = this.Pe), this.Ie[t] || la;
|
|
7521
7521
|
}
|
|
7522
7522
|
rn(t, e) {
|
|
7523
|
-
const n = !!this.
|
|
7523
|
+
const n = !!this.Tn, i = this.layer.isDefaultRender() && this.Pn, r = this.nn;
|
|
7524
7524
|
this.pn().forEach(((s, o) => {
|
|
7525
7525
|
if (!s || e && !e(s)) return;
|
|
7526
7526
|
if (!this.mn(o)) return;
|
|
@@ -7539,44 +7539,44 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7539
7539
|
}));
|
|
7540
7540
|
}
|
|
7541
7541
|
an(t) {
|
|
7542
|
-
const e = this.nn, n = e.renderMode, i = e && e.renderTarget && e.renderTarget.fbo, r = this.getMap().cameraPosition, s = this.pn(), o = !!this.
|
|
7542
|
+
const e = this.nn, n = e.renderMode, i = e && e.renderTarget && e.renderTarget.fbo, r = this.getMap().cameraPosition, s = this.pn(), o = !!this.Tn, a = !e.timestamp || e.isFinalRender;
|
|
7543
7543
|
this.layer.options.collision && !e.isPostProcess ? s.forEach((e => {
|
|
7544
7544
|
if (!this.mn(e) || !e.hasMesh()) return;
|
|
7545
7545
|
if (n && "default" !== n && !e.supportRenderMode(n)) return;
|
|
7546
7546
|
if (o && !da(e)) return;
|
|
7547
|
-
const i = this.
|
|
7547
|
+
const i = this.In(e, 0, r, t);
|
|
7548
7548
|
e.prepareRender(i), e.updateCollision(i);
|
|
7549
7549
|
})) : s.forEach((e => {
|
|
7550
7550
|
if (!this.mn(e) || !e.hasMesh()) return;
|
|
7551
7551
|
if (n && "default" !== n && !e.supportRenderMode(n)) return;
|
|
7552
7552
|
if (o && !da(e)) return;
|
|
7553
|
-
const i = this.
|
|
7553
|
+
const i = this.In(e, 0, r, t);
|
|
7554
7554
|
e.prepareRender(i);
|
|
7555
7555
|
}));
|
|
7556
7556
|
const l = this.Ke !== e.timestamp;
|
|
7557
7557
|
let h = !1;
|
|
7558
7558
|
if (l && !o) {
|
|
7559
|
-
const e = this.layer.getPolygonOffset() + this.layer.getPolygonOffsetCount(), n = this.
|
|
7559
|
+
const e = this.layer.getPolygonOffset() + this.layer.getPolygonOffsetCount(), n = this.In(null, e, r, t);
|
|
7560
7560
|
n.offsetFactor = e, n.offsetUnits = e, this.Ce.paint(n);
|
|
7561
7561
|
}
|
|
7562
7562
|
s.forEach(((e, s) => {
|
|
7563
|
-
if (!this.
|
|
7563
|
+
if (!this.Fn(e)) return;
|
|
7564
7564
|
if (n && "default" !== n && !e.supportRenderMode(n)) return;
|
|
7565
7565
|
if (o && !da(e)) return;
|
|
7566
7566
|
this.regl.clear({
|
|
7567
7567
|
stencil: 255,
|
|
7568
7568
|
framebuffer: i
|
|
7569
7569
|
});
|
|
7570
|
-
const a = this.hn[s] || 0, l = this.
|
|
7571
|
-
e.painter && e.painter.isEnableTileStencil(l) && this.
|
|
7570
|
+
const a = this.hn[s] || 0, l = this.In(e, a, r, t);
|
|
7571
|
+
e.painter && e.painter.isEnableTileStencil(l) && this.Cn(i, e.painter);
|
|
7572
7572
|
const u = e.endFrame(l);
|
|
7573
7573
|
u && u.redraw && this.setToRedraw(), h = !0;
|
|
7574
|
-
})), h && this.layer.fire("canvasisdirty"), a && this.
|
|
7574
|
+
})), h && this.layer.fire("canvasisdirty"), a && this.On();
|
|
7575
7575
|
}
|
|
7576
7576
|
getPolygonOffsetCount() {
|
|
7577
7577
|
return this.un || 0;
|
|
7578
7578
|
}
|
|
7579
|
-
|
|
7579
|
+
On() {
|
|
7580
7580
|
if (this.layer.options.debug) {
|
|
7581
7581
|
const t = this.nn, e = [], n = this.getMap().projViewMatrix;
|
|
7582
7582
|
for (const i in this.tilesInView) {
|
|
@@ -7590,13 +7590,13 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7590
7590
|
}
|
|
7591
7591
|
}
|
|
7592
7592
|
}
|
|
7593
|
-
|
|
7593
|
+
Fn(t) {
|
|
7594
7594
|
if (!t) return !0;
|
|
7595
|
-
const e = this.nn, n = this.mn(t), i = e && e.states && e.states.includesChanged, r = this.
|
|
7595
|
+
const e = this.nn, n = this.mn(t), i = e && e.states && e.states.includesChanged, r = this.En(t.painter.scene.getMeshes());
|
|
7596
7596
|
return !n || !i && !r ? 0 : r ? 2 : 1;
|
|
7597
7597
|
}
|
|
7598
|
-
|
|
7599
|
-
const r = !!this.
|
|
7598
|
+
In(t, e, n, i) {
|
|
7599
|
+
const r = !!this.Tn, s = r && t && fa(t), o = this.regl, a = this.gl, l = {
|
|
7600
7600
|
regl: o,
|
|
7601
7601
|
layer: this.layer,
|
|
7602
7602
|
gl: a,
|
|
@@ -7610,37 +7610,37 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7610
7610
|
}, h = this.nn;
|
|
7611
7611
|
return h && uo(l, h), l;
|
|
7612
7612
|
}
|
|
7613
|
-
|
|
7613
|
+
En(t) {
|
|
7614
7614
|
if (!t) return !1;
|
|
7615
7615
|
const e = this.nn && this.nn.sceneFilter;
|
|
7616
7616
|
return e ? t.filter((t => e(t) || t.properties.hlBloomMesh && e(t.properties.hlBloomMesh))).length > 0 : t.length > 0;
|
|
7617
7617
|
}
|
|
7618
|
-
|
|
7618
|
+
Cn(t, e) {
|
|
7619
7619
|
const n = e.isUniqueStencilRefPerTile(), i = this.getCurrentTileZoom();
|
|
7620
|
-
let r = this.
|
|
7621
|
-
r || (r = this.
|
|
7622
|
-
const {tiles: s} = this.
|
|
7623
|
-
let {parentTiles: o, childTiles: a} = this.
|
|
7620
|
+
let r = this.Dn;
|
|
7621
|
+
r || (r = this.Dn = new Eo(this.regl, this.canvas, this.getMap())), r.start();
|
|
7622
|
+
const {tiles: s} = this.Ln;
|
|
7623
|
+
let {parentTiles: o, childTiles: a} = this.Ln, l = 1;
|
|
7624
7624
|
a = a.sort(ya);
|
|
7625
7625
|
for (let t = 0; t < a.length; t++) {
|
|
7626
7626
|
const e = n ? l : this.getTileLevelValue(a[t].info, i);
|
|
7627
|
-
this.
|
|
7627
|
+
this.Rn(a[t].info, e), l++;
|
|
7628
7628
|
}
|
|
7629
7629
|
o = o.sort(ya);
|
|
7630
7630
|
for (let t = 0; t < o.length; t++) {
|
|
7631
7631
|
const e = n ? l : this.getTileLevelValue(o[t].info, i);
|
|
7632
|
-
this.
|
|
7632
|
+
this.Rn(o[t].info, e), l++;
|
|
7633
7633
|
}
|
|
7634
7634
|
const h = s.sort(ya);
|
|
7635
7635
|
for (let t = h.length - 1; t >= 0; t--) {
|
|
7636
7636
|
const e = n ? l : this.getTileLevelValue(h[t].info, i);
|
|
7637
|
-
this.
|
|
7637
|
+
this.Rn(h[t].info, e), l++;
|
|
7638
7638
|
}
|
|
7639
7639
|
r.render(t);
|
|
7640
7640
|
}
|
|
7641
|
-
|
|
7642
|
-
const n = ua.set(t.extent2d.xmin, t.extent2d.ymax), i = t.extent || 8192, r = t.transform = t.transform || this.calculateTileMatrix(n, t.z, i);
|
|
7643
|
-
t.stencilRef = e, this.
|
|
7641
|
+
Rn(t, e) {
|
|
7642
|
+
const n = ua.set(t.extent2d.xmin, t.extent2d.ymax), i = t.extent || this.Sn || 8192, r = t.transform = t.transform || this.calculateTileMatrix(n, t.z, i);
|
|
7643
|
+
t.stencilRef = e, this.Dn.add(e, i, r);
|
|
7644
7644
|
}
|
|
7645
7645
|
onDrawTileStart(t) {
|
|
7646
7646
|
super.onDrawTileStart(t);
|
|
@@ -7649,7 +7649,7 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7649
7649
|
for (let t = 0; t < e.length; t++) this.yn[e[t].info.id] = 1;
|
|
7650
7650
|
for (let t = 0; t < n.length; t++) this.vn[n[t].info.id] = 1;
|
|
7651
7651
|
for (let t = 0; t < i.length; t++) this.vn[i[t].info.id] = 1;
|
|
7652
|
-
this.
|
|
7652
|
+
this.Ln = t;
|
|
7653
7653
|
}
|
|
7654
7654
|
isEnableTileStencil() {
|
|
7655
7655
|
if (this.layer.options.altitude) return !1;
|
|
@@ -7658,10 +7658,10 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7658
7658
|
return !0;
|
|
7659
7659
|
}
|
|
7660
7660
|
setTerrainHelper(t) {
|
|
7661
|
-
this.
|
|
7661
|
+
this.Tn = t;
|
|
7662
7662
|
}
|
|
7663
7663
|
getTerrainHelper() {
|
|
7664
|
-
return this.
|
|
7664
|
+
return this.Tn;
|
|
7665
7665
|
}
|
|
7666
7666
|
drawTileOnTerrain(...t) {
|
|
7667
7667
|
pa.prototype.drawTile.call(this, ...t);
|
|
@@ -7674,7 +7674,7 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7674
7674
|
width: n,
|
|
7675
7675
|
height: i
|
|
7676
7676
|
});
|
|
7677
|
-
this.
|
|
7677
|
+
this.Hn || (this.Hn = t.renderbuffer({
|
|
7678
7678
|
width: n,
|
|
7679
7679
|
height: i,
|
|
7680
7680
|
format: "depth24 stencil8"
|
|
@@ -7686,7 +7686,7 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7686
7686
|
colorFormat: "rgba",
|
|
7687
7687
|
ignoreStatusCheck: !0
|
|
7688
7688
|
};
|
|
7689
|
-
s.depthStencil = this.
|
|
7689
|
+
s.depthStencil = this.Hn;
|
|
7690
7690
|
const o = t.framebuffer(s);
|
|
7691
7691
|
return o.colorTex = r, o;
|
|
7692
7692
|
}
|
|
@@ -7702,28 +7702,28 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7702
7702
|
renderTarget: {
|
|
7703
7703
|
fbo: i
|
|
7704
7704
|
}
|
|
7705
|
-
}, ca.framebuffer = i, t.clear(ca), this.nn.viewport = xa(s), this.
|
|
7705
|
+
}, ca.framebuffer = i, t.clear(ca), this.nn.viewport = xa(s), this.zn(n[e].tile, i);
|
|
7706
7706
|
}
|
|
7707
|
-
this.
|
|
7707
|
+
this.Nn(n), this.nn = r;
|
|
7708
7708
|
}
|
|
7709
|
-
|
|
7709
|
+
zn(t) {
|
|
7710
7710
|
const {info: e, image: n} = t;
|
|
7711
7711
|
this.drawTile(e, n, fa);
|
|
7712
7712
|
}
|
|
7713
|
-
|
|
7713
|
+
Nn(t) {
|
|
7714
7714
|
const e = this.pn(), n = this.getMap().cameraPosition, i = this.Ke || 0;
|
|
7715
7715
|
this.layer.options.collision ? e.forEach((t => {
|
|
7716
7716
|
if (!this.mn(t) || !t.hasMesh()) return;
|
|
7717
7717
|
if (!fa(t) || !this.layer.options.awareOfTerrain) return;
|
|
7718
|
-
const e = this.
|
|
7718
|
+
const e = this.In(t, 0, n, i);
|
|
7719
7719
|
e.isRenderingTerrainSkin = !0, t.prepareRender(e), t.updateCollision(e);
|
|
7720
7720
|
})) : e.forEach((t => {
|
|
7721
7721
|
if (!this.mn(t) || !t.hasMesh()) return;
|
|
7722
7722
|
if (!fa(t) || !this.layer.options.awareOfTerrain) return;
|
|
7723
|
-
const e = this.
|
|
7723
|
+
const e = this.In(t, 0, n, i);
|
|
7724
7724
|
e.isRenderingTerrainSkin = !0, t.prepareRender(e);
|
|
7725
7725
|
})), e.forEach(((e, n) => {
|
|
7726
|
-
if (!this.
|
|
7726
|
+
if (!this.Fn(e) || !fa(e)) return;
|
|
7727
7727
|
for (let e = 0; e < t.length; e++) {
|
|
7728
7728
|
const n = t[e].texture;
|
|
7729
7729
|
this.regl.clear({
|
|
@@ -7731,29 +7731,29 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7731
7731
|
framebuffer: n
|
|
7732
7732
|
});
|
|
7733
7733
|
}
|
|
7734
|
-
const i = this.hn[n] || 0, r = this.
|
|
7734
|
+
const i = this.hn[n] || 0, r = this.In(e, i, [ 0, 0, 0 ], this.Ke);
|
|
7735
7735
|
r.isRenderingTerrainSkin = !0, e.endFrame(r);
|
|
7736
7736
|
}));
|
|
7737
7737
|
}
|
|
7738
7738
|
drawTile(t, e, n) {
|
|
7739
7739
|
if (!e.cache) return;
|
|
7740
|
-
const i = !!this.
|
|
7741
|
-
go(
|
|
7742
|
-
this.je(e).forEach(((s,
|
|
7740
|
+
const i = !!this.Tn, r = e.cache, s = ua.set(t.extent2d.xmin, t.extent2d.ymax), o = t.extent || this.Sn || 8192, a = t.transform = t.transform || this.calculateTileMatrix(s, t.z, o), l = t.tileTranslationMatrix = t.tileTranslationMatrix || this.calculateTileTranslationMatrix(s, t.z), h = t.terrainTransform = t.terrainTransform || this.calculateTerrainTileMatrix(s, t.z, o), u = this.nn, c = [];
|
|
7741
|
+
go(c, e.data), go(c, e.featureData);
|
|
7742
|
+
this.je(e).forEach(((s, o) => {
|
|
7743
7743
|
if (!s || n && !n(s)) return;
|
|
7744
|
-
if (!
|
|
7745
|
-
if (!r[
|
|
7744
|
+
if (!c[o]) return;
|
|
7745
|
+
if (!r[o]) return;
|
|
7746
7746
|
const f = i && fa(s), d = this.regl, p = this.gl, m = {
|
|
7747
7747
|
regl: d,
|
|
7748
7748
|
layer: this.layer,
|
|
7749
7749
|
gl: p,
|
|
7750
7750
|
sceneConfig: s.config.sceneConfig,
|
|
7751
|
-
pluginIndex:
|
|
7752
|
-
tileCache: r[
|
|
7753
|
-
tileData:
|
|
7754
|
-
tileTransform: f ?
|
|
7755
|
-
tileVectorTransform:
|
|
7756
|
-
tileTranslationMatrix:
|
|
7751
|
+
pluginIndex: o,
|
|
7752
|
+
tileCache: r[o],
|
|
7753
|
+
tileData: c[o],
|
|
7754
|
+
tileTransform: f ? h : a,
|
|
7755
|
+
tileVectorTransform: a,
|
|
7756
|
+
tileTranslationMatrix: l,
|
|
7757
7757
|
tileExtent: e.extent,
|
|
7758
7758
|
timestamp: this.Qe,
|
|
7759
7759
|
tileInfo: t,
|
|
@@ -7762,17 +7762,17 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7762
7762
|
isRenderingTerrain: i,
|
|
7763
7763
|
isRenderingTerrainSkin: f
|
|
7764
7764
|
};
|
|
7765
|
-
f &&
|
|
7765
|
+
f && u && u.renderTarget && (m.renderTarget = u.renderTarget);
|
|
7766
7766
|
const y = s.paintTile(m);
|
|
7767
7767
|
!this.Le && (y.retire || y.redraw) && s.supportRenderMode("taa") && (this.Le = !0),
|
|
7768
7768
|
y.redraw && this.setToRedraw();
|
|
7769
|
-
})), e && e.style === this.Pe && this.
|
|
7769
|
+
})), e && e.style === this.Pe && this.Vn(t), this.setCanvasUpdated();
|
|
7770
7770
|
}
|
|
7771
|
-
|
|
7771
|
+
Un(t, e) {
|
|
7772
7772
|
if (!e.loadTime || e.bn) return;
|
|
7773
7773
|
let n = e.cache;
|
|
7774
7774
|
n || (n = e.cache = {});
|
|
7775
|
-
const i = !!this.
|
|
7775
|
+
const i = !!this.Tn, r = ua.set(t.extent2d.xmin, t.extent2d.ymax), s = t.transform = t.transform || this.calculateTileMatrix(r, t.z, e.extent), o = t.tileTranslationMatrix = t.tileTranslationMatrix || this.calculateTileTranslationMatrix(r, t.z), a = t.terrainTransform = t.terrainTransform || this.calculateTerrainTileMatrix(r, t.z, t.extent), l = [];
|
|
7776
7776
|
go(l, e.data), go(l, e.featureData);
|
|
7777
7777
|
this.je(e).forEach(((r, h) => {
|
|
7778
7778
|
if (!r) return;
|
|
@@ -7845,11 +7845,11 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7845
7845
|
}))));
|
|
7846
7846
|
}
|
|
7847
7847
|
onRemove() {
|
|
7848
|
-
this.
|
|
7848
|
+
this.Dn && this.Dn.remove(), this.Fe && (this.Fe.removeLayer((t => {
|
|
7849
7849
|
if (t) throw t;
|
|
7850
7850
|
})), this.Fe.remove(), delete this.Fe), this.pickingFBO && (this.canvas.pickingFBO || this.pickingFBO.destroy(),
|
|
7851
|
-
delete this.pickingFBO), this.Xe && (this.Xe.delete(), delete this.Xe), this.
|
|
7852
|
-
delete this.
|
|
7851
|
+
delete this.pickingFBO), this.Xe && (this.Xe.delete(), delete this.Xe), this.Hn && (this.Hn.destroy(),
|
|
7852
|
+
delete this.Hn), this.Ce && (this.Ce.dispose(), delete this.Ce), super.onRemove && super.onRemove(),
|
|
7853
7853
|
this.ze();
|
|
7854
7854
|
}
|
|
7855
7855
|
ze() {
|
|
@@ -7867,28 +7867,28 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7867
7867
|
const n = t.renderPlugin;
|
|
7868
7868
|
if (!n) return null;
|
|
7869
7869
|
if (!n.type) throw new Error("invalid plugin type for style at " + e);
|
|
7870
|
-
const i = this.
|
|
7870
|
+
const i = this.jn(n);
|
|
7871
7871
|
return i.styleCounter = this.Pe, i.style = t, i;
|
|
7872
7872
|
})), i = [];
|
|
7873
7873
|
e.forEach(((t, e) => {
|
|
7874
7874
|
const n = t.renderPlugin;
|
|
7875
7875
|
if (!n) return null;
|
|
7876
7876
|
if (!n.type) throw new Error("invalid plugin type for features at " + e);
|
|
7877
|
-
const r = this.
|
|
7877
|
+
const r = this.jn(n);
|
|
7878
7878
|
return r.style = t, r.styleCounter = this.Pe, i.push(r), r;
|
|
7879
7879
|
}));
|
|
7880
7880
|
const r = this.Pe;
|
|
7881
|
-
if (this.Te[r] = n, this.Ie[r] = i, this.layer.fire("pluginsinited"), this.
|
|
7882
|
-
this.layer.
|
|
7881
|
+
if (this.Te[r] = n, this.Ie[r] = i, this.layer.fire("pluginsinited"), this.Gn && this.Gn.size || this.layer.Gn) {
|
|
7882
|
+
this.layer.Gn && this.layer.Wn();
|
|
7883
7883
|
this.getMap().getRenderer().callInNextFrame((() => {
|
|
7884
7884
|
this.je().forEach((t => {
|
|
7885
|
-
t.highlight(this.
|
|
7885
|
+
t.highlight(this.Gn);
|
|
7886
7886
|
}));
|
|
7887
7887
|
}));
|
|
7888
7888
|
}
|
|
7889
7889
|
return n;
|
|
7890
7890
|
}
|
|
7891
|
-
|
|
7891
|
+
jn(t) {
|
|
7892
7892
|
const e = this.layer.constructor.getPlugins()[t.type];
|
|
7893
7893
|
if (!e) throw new Error(`Plugin for (${t.type}) is not loaded.`);
|
|
7894
7894
|
const n = new e;
|
|
@@ -7923,7 +7923,7 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7923
7923
|
const u = new ImageData(i, r);
|
|
7924
7924
|
u.data.set(o), s.putImageData(u, 0, 0);
|
|
7925
7925
|
}
|
|
7926
|
-
|
|
7926
|
+
kn(t) {
|
|
7927
7927
|
let e;
|
|
7928
7928
|
switch (t) {
|
|
7929
7929
|
case "native-line":
|
|
@@ -7984,7 +7984,7 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
7984
7984
|
};
|
|
7985
7985
|
}
|
|
7986
7986
|
return null;
|
|
7987
|
-
}(t), i = this.
|
|
7987
|
+
}(t), i = this.jn(e);
|
|
7988
7988
|
return i.defaultSymbol = n, {
|
|
7989
7989
|
plugin: i,
|
|
7990
7990
|
symbol: n,
|
|
@@ -8048,7 +8048,7 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
8048
8048
|
return this.setToRedraw(), this.Le = !0, super.setZIndex.apply(this, arguments);
|
|
8049
8049
|
}
|
|
8050
8050
|
consumeTile(t, e) {
|
|
8051
|
-
if (this.
|
|
8051
|
+
if (this.Vn(e), super.consumeTile(t, e), "transient" === this.layer.options.features && t.data) {
|
|
8052
8052
|
for (let e = 0; e < t.data.length; e++) {
|
|
8053
8053
|
if (!t.data[e]) continue;
|
|
8054
8054
|
const n = t.data[e].features;
|
|
@@ -8061,12 +8061,12 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
8061
8061
|
tileImage: t
|
|
8062
8062
|
});
|
|
8063
8063
|
}
|
|
8064
|
-
t && t.features && (t.features = []), this.
|
|
8064
|
+
t && t.features && (t.features = []), this.Un(e, t);
|
|
8065
8065
|
}
|
|
8066
8066
|
onTileError(t, e) {
|
|
8067
|
-
this.
|
|
8067
|
+
this.Vn(e), super.onTileError(t, e);
|
|
8068
8068
|
}
|
|
8069
|
-
|
|
8069
|
+
Vn(t) {
|
|
8070
8070
|
const {id: e} = t;
|
|
8071
8071
|
if (this.He && this.He[e]) {
|
|
8072
8072
|
const t = this.He[e];
|
|
@@ -8074,28 +8074,28 @@ class pa extends t.renderer.TileLayerCanvasRenderer {
|
|
|
8074
8074
|
}
|
|
8075
8075
|
}
|
|
8076
8076
|
highlight(t) {
|
|
8077
|
-
if (this.
|
|
8078
|
-
t[e].name = t[e].id), this.
|
|
8079
|
-
this.
|
|
8077
|
+
if (this.Gn || (this.Gn = new Map), Array.isArray(t)) for (let e = 0; e < t.length; e++) yo(t[e].name) && !yo(t[e].id) && (t[e] = uo({}, t[e]),
|
|
8078
|
+
t[e].name = t[e].id), this.Gn.set(t[e].name, t[e]); else yo(t.name) && !yo(t.id) && ((t = uo({}, t)).name = t.id),
|
|
8079
|
+
this.Gn.set(t.name, t);
|
|
8080
8080
|
this.je().forEach((t => {
|
|
8081
|
-
t.highlight(this.
|
|
8081
|
+
t.highlight(this.Gn);
|
|
8082
8082
|
})), this.Ge = !0;
|
|
8083
8083
|
}
|
|
8084
8084
|
cancelHighlight(t) {
|
|
8085
|
-
if (!this.
|
|
8086
|
-
if (Array.isArray(t)) for (let e = 0; e < t.length; e++) this.
|
|
8085
|
+
if (!this.Gn) return;
|
|
8086
|
+
if (Array.isArray(t)) for (let e = 0; e < t.length; e++) this.Gn.delete(t[e]); else this.Gn.delete(t);
|
|
8087
8087
|
this.je().forEach((t => {
|
|
8088
|
-
t.highlight(this.
|
|
8088
|
+
t.highlight(this.Gn);
|
|
8089
8089
|
})), this.Ge = !0;
|
|
8090
8090
|
}
|
|
8091
8091
|
cancelAllHighlight() {
|
|
8092
|
-
if (!this.
|
|
8093
|
-
delete this.
|
|
8092
|
+
if (!this.Gn) return;
|
|
8093
|
+
delete this.Gn;
|
|
8094
8094
|
this.je().forEach((t => {
|
|
8095
8095
|
t.cancelAllHighlight();
|
|
8096
8096
|
})), this.Ge = !0;
|
|
8097
8097
|
}
|
|
8098
|
-
|
|
8098
|
+
Bn() {
|
|
8099
8099
|
const t = this.layer.options.opacity;
|
|
8100
8100
|
return this.Be() ? yo(t) ? 1 : t : 1;
|
|
8101
8101
|
}
|
|
@@ -8189,62 +8189,62 @@ class _a extends t.TileLayer {
|
|
|
8189
8189
|
return fetch(t, e || {}).then((t => t.json())).then((t => _a.fromJSON(t)));
|
|
8190
8190
|
}
|
|
8191
8191
|
constructor(t, e) {
|
|
8192
|
-
super(t, e), this
|
|
8192
|
+
super(t, e), this.$n = {}, this.VERSION = _a.VERSION;
|
|
8193
8193
|
const n = e && e.style;
|
|
8194
8194
|
this.setStyle(n);
|
|
8195
8195
|
}
|
|
8196
8196
|
setURLModifier(t) {
|
|
8197
|
-
this
|
|
8197
|
+
this.Xn = t;
|
|
8198
8198
|
const e = this.getRenderer();
|
|
8199
8199
|
return e && e.updateOptions(), this;
|
|
8200
8200
|
}
|
|
8201
8201
|
getURLModifier() {
|
|
8202
|
-
return this
|
|
8202
|
+
return this.Xn;
|
|
8203
8203
|
}
|
|
8204
8204
|
onAdd() {
|
|
8205
8205
|
const t = this.getMap();
|
|
8206
|
-
this.
|
|
8206
|
+
this.Yn();
|
|
8207
8207
|
const e = this.getSpatialReference().toJSON().projection, n = t.getSpatialReference().toJSON().projection;
|
|
8208
8208
|
if ((e && e.toLowerCase()) !== (n && n.toLowerCase())) throw new Error(`VectorTileLayer's projection(${e}) must be the same with map(${n}).`);
|
|
8209
8209
|
}
|
|
8210
8210
|
setFeatureState(t, e) {
|
|
8211
8211
|
if (yo(t.id)) throw new Error("missing id in first parameter of setFeatureState.");
|
|
8212
|
-
this.
|
|
8212
|
+
this.Jn || (this.Jn = {});
|
|
8213
8213
|
const n = t.layer || "0";
|
|
8214
|
-
let i = this.
|
|
8215
|
-
return this.
|
|
8214
|
+
let i = this.Jn[n];
|
|
8215
|
+
return this.Jn[n] || (i = this.Jn[n] = new Map), i.set(t.id, e), this.qn(), this;
|
|
8216
8216
|
}
|
|
8217
8217
|
removeFeatureState(t, e) {
|
|
8218
8218
|
if (yo(t.id)) throw new Error("missing id in first parameter of removeFeatureState.");
|
|
8219
|
-
if (!this.
|
|
8220
|
-
const n = t.layer || "0", i = this.
|
|
8219
|
+
if (!this.Jn) return this;
|
|
8220
|
+
const n = t.layer || "0", i = this.Jn[n];
|
|
8221
8221
|
if (!i) return this;
|
|
8222
8222
|
if (e) {
|
|
8223
8223
|
const n = i.get(t.id);
|
|
8224
8224
|
if (mo(e)) for (const t in e) delete n[t]; else delete n[e];
|
|
8225
8225
|
i.set(t.id, n);
|
|
8226
8226
|
} else i.delete(t.id);
|
|
8227
|
-
return this.
|
|
8227
|
+
return this.qn(), this;
|
|
8228
8228
|
}
|
|
8229
8229
|
getFeatureState(t) {
|
|
8230
8230
|
if (yo(t.id)) throw new Error("missing id in first parameter of getFeatureState.");
|
|
8231
|
-
if (!this.
|
|
8231
|
+
if (!this.Jn) return null;
|
|
8232
8232
|
const e = t.layer || "0";
|
|
8233
|
-
return this.
|
|
8233
|
+
return this.Jn[e].get(t.id);
|
|
8234
8234
|
}
|
|
8235
|
-
|
|
8235
|
+
qn() {
|
|
8236
8236
|
const t = this.getRenderer();
|
|
8237
8237
|
if (!t) return;
|
|
8238
8238
|
const e = t.getFrameTimestamp();
|
|
8239
|
-
this.
|
|
8239
|
+
this.Kn = e;
|
|
8240
8240
|
}
|
|
8241
|
-
|
|
8242
|
-
return this.
|
|
8241
|
+
Zn() {
|
|
8242
|
+
return this.Kn;
|
|
8243
8243
|
}
|
|
8244
|
-
|
|
8245
|
-
return this.
|
|
8244
|
+
Qn(t) {
|
|
8245
|
+
return this.Kn && this.Kn !== t;
|
|
8246
8246
|
}
|
|
8247
|
-
|
|
8247
|
+
Yn() {
|
|
8248
8248
|
const t = this.options, e = this.getMap().getProjection(), n = "EPSG:4326" === e.code || "EPSG:4490" === e.code, i = "EPSG:3857" === e.code;
|
|
8249
8249
|
if (!t.spatialReference) {
|
|
8250
8250
|
512 === this.getTileSize().width && (i ? t.spatialReference = "preset-vt-3857" : n && (t.spatialReference = "preset-vt-4326"));
|
|
@@ -8283,19 +8283,19 @@ class _a extends t.TileLayer {
|
|
|
8283
8283
|
n.style ? (r = n, r.$root || (r.$root = i)) : r = {
|
|
8284
8284
|
$root: i,
|
|
8285
8285
|
style: n
|
|
8286
|
-
}, this.options.style = e, this.
|
|
8286
|
+
}, this.options.style = e, this.ti(r);
|
|
8287
8287
|
})), this;
|
|
8288
8288
|
}
|
|
8289
|
-
return this.options.style = t, this.
|
|
8289
|
+
return this.options.style = t, this.ti(t), this;
|
|
8290
8290
|
}
|
|
8291
|
-
|
|
8291
|
+
ei(t, e, n, i) {
|
|
8292
8292
|
const r = i / this.getTileSize().width;
|
|
8293
8293
|
return t.set(n.x + e.x / r, n.y - e.y / r);
|
|
8294
8294
|
}
|
|
8295
8295
|
queryTilePointTerrain(t, e, n, i, r) {
|
|
8296
8296
|
const s = this.getRenderer(), o = s && s.getTerrainHelper();
|
|
8297
8297
|
if (!s || !o) return Ma[0] = null, Ma[1] = 0, Ma;
|
|
8298
|
-
const a = this.
|
|
8298
|
+
const a = this.ei(wa, t, n, i);
|
|
8299
8299
|
return e && o.queryTileTerrainByPointAtRes ? o.queryTileTerrainByPointAtRes(a, r, e.id, e, Sa) : (Ma[0] = null,
|
|
8300
8300
|
Ma[1] = 0, Ma);
|
|
8301
8301
|
}
|
|
@@ -8303,7 +8303,7 @@ class _a extends t.TileLayer {
|
|
|
8303
8303
|
const e = this.getRenderer(), n = e && e.getTerrainHelper();
|
|
8304
8304
|
return e && n ? n.getTerrainTiles(t) : null;
|
|
8305
8305
|
}
|
|
8306
|
-
|
|
8306
|
+
ti(t) {
|
|
8307
8307
|
if (t && t.$root) {
|
|
8308
8308
|
let e = t.$root;
|
|
8309
8309
|
e && "/" === e[e.length - 1] && (e = e.substring(0, e.length - 1)), this.dt = function(t) {
|
|
@@ -8328,26 +8328,26 @@ class _a extends t.TileLayer {
|
|
|
8328
8328
|
featureStyle: o
|
|
8329
8329
|
};
|
|
8330
8330
|
return t.$root && (a.$root = t.$root), a;
|
|
8331
|
-
}(t = JSON.parse(JSON.stringify(t))), this.
|
|
8331
|
+
}(t = JSON.parse(JSON.stringify(t))), this.ni = t.featureStyle || [], this.ii = function(t) {
|
|
8332
8332
|
if (!t || !Array.isArray(t)) return [];
|
|
8333
8333
|
const e = [];
|
|
8334
8334
|
for (let n = 0; n < t.length; n++) {
|
|
8335
8335
|
const i = t[n].style;
|
|
8336
8336
|
if (i && Array.isArray(i) && i.length) for (let r = 0; r < i.length; r++) {
|
|
8337
8337
|
const s = uo({}, t[n], i[r]);
|
|
8338
|
-
i[r].
|
|
8338
|
+
i[r].ri = e.length, delete s.style, e.push(s);
|
|
8339
8339
|
} else e.push(uo({}, t[n]));
|
|
8340
8340
|
}
|
|
8341
8341
|
return e;
|
|
8342
|
-
}(t.featureStyle), this.
|
|
8342
|
+
}(t.featureStyle), this.si = t.style || [];
|
|
8343
8343
|
const e = t.background || {};
|
|
8344
|
-
this.
|
|
8344
|
+
this.oi = {
|
|
8345
8345
|
enable: e.enable || !1,
|
|
8346
8346
|
color: ka(e.color) || [ 0, 0, 0, 0 ],
|
|
8347
8347
|
opacity: Ta(e.opacity, 1),
|
|
8348
8348
|
patternFile: e.patternFile,
|
|
8349
8349
|
depthRange: e.depthRange
|
|
8350
|
-
}, this.validateStyle(), this.dt && this.
|
|
8350
|
+
}, this.validateStyle(), this.dt && this.ai(), this.An();
|
|
8351
8351
|
const n = this.getRenderer();
|
|
8352
8352
|
n && n.setStyle(), this.fire("setstyle", {
|
|
8353
8353
|
style: this.getStyle(),
|
|
@@ -8359,15 +8359,15 @@ class _a extends t.TileLayer {
|
|
|
8359
8359
|
return t ? t.getPolygonOffsetCount() : 0;
|
|
8360
8360
|
}
|
|
8361
8361
|
getPolygonOffset() {
|
|
8362
|
-
return this.
|
|
8362
|
+
return this.li || 0;
|
|
8363
8363
|
}
|
|
8364
8364
|
setPolygonOffset(t, e) {
|
|
8365
|
-
return this.
|
|
8365
|
+
return this.li = t, this.hi = e, this;
|
|
8366
8366
|
}
|
|
8367
8367
|
getTotalPolygonOffset() {
|
|
8368
|
-
return this.
|
|
8368
|
+
return this.hi;
|
|
8369
8369
|
}
|
|
8370
|
-
|
|
8370
|
+
ui(t) {
|
|
8371
8371
|
if (!t || !t.length) return;
|
|
8372
8372
|
const e = this._getTileConfig();
|
|
8373
8373
|
let n;
|
|
@@ -8377,7 +8377,7 @@ class _a extends t.TileLayer {
|
|
|
8377
8377
|
if (o.type) continue;
|
|
8378
8378
|
const {x: a, y: l, res: h, extent: u} = s;
|
|
8379
8379
|
undefined === a && undefined === l && undefined === h || (n = e.getTilePointNW(a, l, h));
|
|
8380
|
-
const c = r.type, f = this.
|
|
8380
|
+
const c = r.type, f = this.ci(c, o, n, u, h);
|
|
8381
8381
|
r.geometry = f;
|
|
8382
8382
|
}
|
|
8383
8383
|
}
|
|
@@ -8389,7 +8389,7 @@ class _a extends t.TileLayer {
|
|
|
8389
8389
|
const n = e[t];
|
|
8390
8390
|
if (!n) continue;
|
|
8391
8391
|
const i = n.features || [];
|
|
8392
|
-
this.
|
|
8392
|
+
this.ui(i);
|
|
8393
8393
|
}
|
|
8394
8394
|
return e;
|
|
8395
8395
|
}
|
|
@@ -8408,7 +8408,7 @@ class _a extends t.TileLayer {
|
|
|
8408
8408
|
let l = 1;
|
|
8409
8409
|
const h = () => {
|
|
8410
8410
|
const t = (l - 1) * o, e = l * o, n = s.slice(t, e);
|
|
8411
|
-
this.
|
|
8411
|
+
this.ui(n), l++;
|
|
8412
8412
|
};
|
|
8413
8413
|
t.MicroTask.runTaskAsync({
|
|
8414
8414
|
count: a,
|
|
@@ -8440,13 +8440,13 @@ class _a extends t.TileLayer {
|
|
|
8440
8440
|
return t ? (t.cancelOutline(), this) : this;
|
|
8441
8441
|
}
|
|
8442
8442
|
highlight(t) {
|
|
8443
|
-
this.
|
|
8443
|
+
this.fi(t);
|
|
8444
8444
|
const e = this.getRenderer();
|
|
8445
|
-
return e ? (e.highlight(t), this) : (this.
|
|
8445
|
+
return e ? (e.highlight(t), this) : (this.Gn || (this.Gn = []), this.Gn.push(t),
|
|
8446
8446
|
this);
|
|
8447
8447
|
}
|
|
8448
|
-
|
|
8449
|
-
if (Array.isArray(t)) for (let e = 0; e < t.length; e++) this.
|
|
8448
|
+
fi(t) {
|
|
8449
|
+
if (Array.isArray(t)) for (let e = 0; e < t.length; e++) this.fi(t[e]); else {
|
|
8450
8450
|
if (t.filter) {
|
|
8451
8451
|
if (!this.options.features) throw new Error("options.features must be turned on to support filter in highlight");
|
|
8452
8452
|
if (!t.name) throw new Error("A name is required for highlight with filter");
|
|
@@ -8454,10 +8454,10 @@ class _a extends t.TileLayer {
|
|
|
8454
8454
|
if (yo(t.filter) && yo(t.id)) throw new Error("id or filter must be provided for highlight");
|
|
8455
8455
|
}
|
|
8456
8456
|
}
|
|
8457
|
-
|
|
8458
|
-
if (this.
|
|
8459
|
-
for (let t = 0; t < this.
|
|
8460
|
-
delete this.
|
|
8457
|
+
Wn() {
|
|
8458
|
+
if (this.Gn) {
|
|
8459
|
+
for (let t = 0; t < this.Gn.length; t++) this.highlight(this.Gn[t]);
|
|
8460
|
+
delete this.Gn;
|
|
8461
8461
|
}
|
|
8462
8462
|
}
|
|
8463
8463
|
cancelHighlight(t) {
|
|
@@ -8468,22 +8468,22 @@ class _a extends t.TileLayer {
|
|
|
8468
8468
|
const t = this.getRenderer();
|
|
8469
8469
|
return t ? (t.cancelAllHighlight(), this) : this;
|
|
8470
8470
|
}
|
|
8471
|
-
|
|
8472
|
-
t.Util.convertStylePath(this.
|
|
8471
|
+
ai() {
|
|
8472
|
+
t.Util.convertStylePath(this.si, this.dt), t.Util.convertStylePath(this.ii, this.dt);
|
|
8473
8473
|
}
|
|
8474
8474
|
updateSceneConfig(t, e) {
|
|
8475
|
-
return co(t) && (t = this.
|
|
8475
|
+
return co(t) && (t = this.di(t)), this.mi(0, t, e);
|
|
8476
8476
|
}
|
|
8477
8477
|
updateFeatureSceneConfig(t, e, n) {
|
|
8478
|
-
return this.
|
|
8478
|
+
return this.mi(1, t, n, e);
|
|
8479
8479
|
}
|
|
8480
|
-
|
|
8480
|
+
mi(t, e, n, i) {
|
|
8481
8481
|
const r = this.Ue(t);
|
|
8482
8482
|
if (!r) return this;
|
|
8483
8483
|
let s, o = e;
|
|
8484
8484
|
if (r[e].renderPlugin.sceneConfig || (r[e].renderPlugin.sceneConfig = {}), uo(r[e].renderPlugin.sceneConfig, n),
|
|
8485
8485
|
void 0 !== i) {
|
|
8486
|
-
Ia(this.
|
|
8486
|
+
Ia(this.ni, e, i), o = this.ni[e].style[i].ri;
|
|
8487
8487
|
const t = r[o].renderPlugin;
|
|
8488
8488
|
t.sceneConfig || (t.sceneConfig = {}), s = t.sceneConfig;
|
|
8489
8489
|
} else Fa(r, e), s = r[e].renderPlugin.sceneConfig;
|
|
@@ -8507,16 +8507,16 @@ class _a extends t.TileLayer {
|
|
|
8507
8507
|
}), this;
|
|
8508
8508
|
}
|
|
8509
8509
|
updateDataConfig(t, e) {
|
|
8510
|
-
return co(t) && (t = this.
|
|
8510
|
+
return co(t) && (t = this.di(t)), this.yi(0, t, e);
|
|
8511
8511
|
}
|
|
8512
8512
|
updateFeatureDataConfig(t, e, n) {
|
|
8513
|
-
return this.
|
|
8513
|
+
return this.yi(1, t, n, e);
|
|
8514
8514
|
}
|
|
8515
|
-
|
|
8515
|
+
yi(t, e, n, i) {
|
|
8516
8516
|
const r = this.Ue(t);
|
|
8517
8517
|
if (!r) return this;
|
|
8518
8518
|
let s, o = e;
|
|
8519
|
-
void 0 !== i ? (Ia(this.
|
|
8519
|
+
void 0 !== i ? (Ia(this.ni, e, i), o = this.ni[e].style[i].ri, s = r[o].renderPlugin.dataConfig) : (Fa(r, e),
|
|
8520
8520
|
s = r[e].renderPlugin.dataConfig);
|
|
8521
8521
|
const a = uo({}, s);
|
|
8522
8522
|
if (uo(s, n), Array.isArray(this.options.style)) uo(this.options.style[e].renderPlugin.dataConfig, n); else {
|
|
@@ -8536,16 +8536,16 @@ class _a extends t.TileLayer {
|
|
|
8536
8536
|
}), this;
|
|
8537
8537
|
}
|
|
8538
8538
|
updateSymbol(t, e) {
|
|
8539
|
-
return co(t) && (t = this.
|
|
8539
|
+
return co(t) && (t = this.di(t)), this.gi(0, t, e);
|
|
8540
8540
|
}
|
|
8541
8541
|
updateFeatureSymbol(t, e, n) {
|
|
8542
|
-
return this.
|
|
8542
|
+
return this.gi(1, t, n, e);
|
|
8543
8543
|
}
|
|
8544
|
-
|
|
8544
|
+
gi(e, n, i, r) {
|
|
8545
8545
|
const s = this.Ue(e);
|
|
8546
8546
|
if (!s) return this;
|
|
8547
8547
|
let o = n;
|
|
8548
|
-
void 0 !== r && (Ia(this.
|
|
8548
|
+
void 0 !== r && (Ia(this.ni, n, r), o = this.ni[n].style[r].ri);
|
|
8549
8549
|
const a = s[o];
|
|
8550
8550
|
if (!a) throw new Error(`No style defined at ${n}`);
|
|
8551
8551
|
const l = this, h = this.dt;
|
|
@@ -8592,15 +8592,15 @@ class _a extends t.TileLayer {
|
|
|
8592
8592
|
if (e) {
|
|
8593
8593
|
return 0 === t ? e.style : e.featureStyle;
|
|
8594
8594
|
}
|
|
8595
|
-
return 0 === t ? this.
|
|
8595
|
+
return 0 === t ? this.si : this.ii;
|
|
8596
8596
|
}
|
|
8597
8597
|
isDefaultRender() {
|
|
8598
|
-
return !!this.
|
|
8598
|
+
return !!this.vi && this.options.defaultRendering;
|
|
8599
8599
|
}
|
|
8600
8600
|
validateStyle() {
|
|
8601
|
-
this.
|
|
8602
|
-
let t = this.
|
|
8603
|
-
this.options.style || (this.
|
|
8601
|
+
this.vi = !1;
|
|
8602
|
+
let t = this.si;
|
|
8603
|
+
this.options.style || (this.vi = !0, t = this.si = []), Array.isArray(t) || (t = this.si = [ t ]);
|
|
8604
8604
|
for (let e = 0; e < t.length; e++) {
|
|
8605
8605
|
let n = t[e].filter;
|
|
8606
8606
|
if (n && n.value && (n = n.value), n || console.warn(`render plugin at ${e} doesn't define filter, its filter will be set to 'default' by default.`),
|
|
@@ -8610,14 +8610,14 @@ class _a extends t.TileLayer {
|
|
|
8610
8610
|
getStyle() {
|
|
8611
8611
|
return this.options.style ? JSON.parse(JSON.stringify(this.options.style)) : null;
|
|
8612
8612
|
}
|
|
8613
|
-
|
|
8614
|
-
const e = this.
|
|
8613
|
+
di(t) {
|
|
8614
|
+
const e = this.si;
|
|
8615
8615
|
if (!e) return -1;
|
|
8616
8616
|
for (let n = 0; n < e.length; n++) if (e[n].name === t) return n;
|
|
8617
8617
|
throw new Error(`No style defined with name: ${t}`);
|
|
8618
8618
|
}
|
|
8619
8619
|
getGroundConfig() {
|
|
8620
|
-
this.
|
|
8620
|
+
this.xi || (this.xi = {
|
|
8621
8621
|
enable: !0,
|
|
8622
8622
|
renderPlugin: {
|
|
8623
8623
|
type: "fill",
|
|
@@ -8629,18 +8629,18 @@ class _a extends t.TileLayer {
|
|
|
8629
8629
|
}
|
|
8630
8630
|
});
|
|
8631
8631
|
const t = this.Ee().background || {};
|
|
8632
|
-
return this.
|
|
8633
|
-
this.
|
|
8634
|
-
this.
|
|
8632
|
+
return this.xi.enable = t.enable, this.xi.symbol.polygonFill = t.color, this.xi.symbol.polygonOpacity = t.opacity,
|
|
8633
|
+
this.xi.symbol.polygonPatternFile = t.patternFile, this.xi.renderPlugin.sceneConfig.depthRange = t.depthRange,
|
|
8634
|
+
this.xi;
|
|
8635
8635
|
}
|
|
8636
8636
|
getComputedStyle() {
|
|
8637
8637
|
return JSON.parse(JSON.stringify(this.Ee()));
|
|
8638
8638
|
}
|
|
8639
8639
|
Ee() {
|
|
8640
8640
|
return {
|
|
8641
|
-
background: this.
|
|
8642
|
-
style: this.
|
|
8643
|
-
featureStyle: this.
|
|
8641
|
+
background: this.oi,
|
|
8642
|
+
style: this.si || [],
|
|
8643
|
+
featureStyle: this.ii || []
|
|
8644
8644
|
};
|
|
8645
8645
|
}
|
|
8646
8646
|
identify(e, n = {}) {
|
|
@@ -8654,10 +8654,10 @@ class _a extends t.TileLayer {
|
|
|
8654
8654
|
if (!n || !i) return [];
|
|
8655
8655
|
const r = n.getDevicePixelRatio();
|
|
8656
8656
|
let s = i.pick(t.x * r, t.y * r, e);
|
|
8657
|
-
return this.options.features && "id" !== this.options.features && (s = this.
|
|
8657
|
+
return this.options.features && "id" !== this.options.features && (s = this.bi(s)),
|
|
8658
8658
|
e && e.filter ? s.filter((t => e.filter(t))) : s;
|
|
8659
8659
|
}
|
|
8660
|
-
|
|
8660
|
+
bi(t) {
|
|
8661
8661
|
if (!this.getRenderer()) return t;
|
|
8662
8662
|
const e = this._getTileConfig(), n = this.getSpatialReference();
|
|
8663
8663
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -8667,21 +8667,21 @@ class _a extends t.TileLayer {
|
|
|
8667
8667
|
if (f) {
|
|
8668
8668
|
r.data = uo({}, r.data), r.data.feature = uo({}, r.data.feature);
|
|
8669
8669
|
const t = r.data.feature.type;
|
|
8670
|
-
r.data.feature.type = "Feature", r.data.feature.geometry = this.
|
|
8670
|
+
r.data.feature.type = "Feature", r.data.feature.geometry = this.ci(t, f, c, h, u);
|
|
8671
8671
|
}
|
|
8672
8672
|
}
|
|
8673
8673
|
return t;
|
|
8674
8674
|
}
|
|
8675
|
-
|
|
8675
|
+
ci(t, e, n, i, r) {
|
|
8676
8676
|
if (e.type && e.coordinates) return e;
|
|
8677
8677
|
let s, o;
|
|
8678
|
-
if (1 === t) e.length <= 1 ? (s = "Point", o = this.
|
|
8679
|
-
o = this.
|
|
8680
|
-
o = this.
|
|
8678
|
+
if (1 === t) e.length <= 1 ? (s = "Point", o = this.wi(e, n, i, r) || []) : (s = "MultiPoint",
|
|
8679
|
+
o = this.wi(e, n, i, r)); else if (2 === t) e.length <= 1 ? (s = "LineString", o = this.wi(e, n, i, r) || []) : (s = "MultiLineString",
|
|
8680
|
+
o = this.wi(e, n, i, r)); else if (3 === t) {
|
|
8681
8681
|
o = [];
|
|
8682
8682
|
let t = [], a = 0;
|
|
8683
8683
|
for (let s = 0; s < e.length; s++) {
|
|
8684
|
-
nt(e[s]) > 0 && (a++, t && t.length && o.push(t), t = []), t.push(this.
|
|
8684
|
+
nt(e[s]) > 0 && (a++, t && t.length && o.push(t), t = []), t.push(this.wi(e[s], n, i, r));
|
|
8685
8685
|
}
|
|
8686
8686
|
t.length && o.push(t), a <= 1 ? (s = "Polygon", o = o[0]) : s = "MultiPolygon";
|
|
8687
8687
|
}
|
|
@@ -8690,7 +8690,7 @@ class _a extends t.TileLayer {
|
|
|
8690
8690
|
coordinates: o
|
|
8691
8691
|
};
|
|
8692
8692
|
}
|
|
8693
|
-
|
|
8693
|
+
wi(t, e, n, i) {
|
|
8694
8694
|
const r = n / this.getTileSize().width, s = this.getMap(), o = t => {
|
|
8695
8695
|
const n = [];
|
|
8696
8696
|
mo(t) && (t = [ t ]);
|
|
@@ -8712,7 +8712,7 @@ class _a extends t.TileLayer {
|
|
|
8712
8712
|
}
|
|
8713
8713
|
}
|
|
8714
8714
|
getDataSchema(t) {
|
|
8715
|
-
return this
|
|
8715
|
+
return this.$n || (this.$n = {}), yo(t) || this.$n[t] || (this.$n[t] = {}), yo(t) ? this.$n : this.$n[t];
|
|
8716
8716
|
}
|
|
8717
8717
|
onRemove() {
|
|
8718
8718
|
super.onRemove();
|
|
@@ -8839,14 +8839,14 @@ class Ea extends t.OverlayLayer {
|
|
|
8839
8839
|
return Ea.painters[t];
|
|
8840
8840
|
}
|
|
8841
8841
|
setURLModifier(t) {
|
|
8842
|
-
return this
|
|
8842
|
+
return this.Xn = t, this;
|
|
8843
8843
|
}
|
|
8844
8844
|
getURLModifier() {
|
|
8845
|
-
return this
|
|
8845
|
+
return this.Xn;
|
|
8846
8846
|
}
|
|
8847
8847
|
getEvents() {
|
|
8848
8848
|
let t;
|
|
8849
|
-
return t = super.getEvents ? super.getEvents() : {}, t.spatialreferencechange = this.
|
|
8849
|
+
return t = super.getEvents ? super.getEvents() : {}, t.spatialreferencechange = this.Ai,
|
|
8850
8850
|
t;
|
|
8851
8851
|
}
|
|
8852
8852
|
onConfig(t) {
|
|
@@ -8865,13 +8865,13 @@ class Ea extends t.OverlayLayer {
|
|
|
8865
8865
|
return this.isEmpty() || this.options.altitude ? 0 : 1;
|
|
8866
8866
|
}
|
|
8867
8867
|
getPolygonOffset() {
|
|
8868
|
-
return this.options.altitude ? 0 : this.
|
|
8868
|
+
return this.options.altitude ? 0 : this.li || 0;
|
|
8869
8869
|
}
|
|
8870
8870
|
setPolygonOffset(t, e) {
|
|
8871
|
-
return this.
|
|
8871
|
+
return this.li = t, this.hi = e, this;
|
|
8872
8872
|
}
|
|
8873
8873
|
getTotalPolygonOffset() {
|
|
8874
|
-
return this.
|
|
8874
|
+
return this.hi;
|
|
8875
8875
|
}
|
|
8876
8876
|
identify(e, n = {}) {
|
|
8877
8877
|
const i = this.getMap(), r = this.getRenderer();
|
|
@@ -8919,9 +8919,9 @@ class Ea extends t.OverlayLayer {
|
|
|
8919
8919
|
getTileSize() {
|
|
8920
8920
|
return Oa;
|
|
8921
8921
|
}
|
|
8922
|
-
|
|
8922
|
+
Ai() {
|
|
8923
8923
|
const t = this.getRenderer();
|
|
8924
|
-
t && t.
|
|
8924
|
+
t && t.Ai();
|
|
8925
8925
|
}
|
|
8926
8926
|
}
|
|
8927
8927
|
|
|
@@ -8955,7 +8955,7 @@ let Ra = 1;
|
|
|
8955
8955
|
function Ha(t, e) {
|
|
8956
8956
|
const n = E.extend(t, {
|
|
8957
8957
|
init: function() {
|
|
8958
|
-
this.
|
|
8958
|
+
this.Mi = {};
|
|
8959
8959
|
},
|
|
8960
8960
|
isVisible() {
|
|
8961
8961
|
return this.painter && this.painter.isVisible();
|
|
@@ -8973,10 +8973,10 @@ function Ha(t, e) {
|
|
|
8973
8973
|
const l = t.pluginIndex;
|
|
8974
8974
|
a = this.painter = new e(i, n, o, r, l, s);
|
|
8975
8975
|
}
|
|
8976
|
-
this.
|
|
8976
|
+
this.Mi || (this.Mi = {});
|
|
8977
8977
|
const l = r.excludes;
|
|
8978
|
-
this.
|
|
8979
|
-
a.startFrame(t), this.
|
|
8978
|
+
this.Si ? l !== this.Si && (this._i = l ? A(l) : null, this.Si = l) : l && (this.Si = l),
|
|
8979
|
+
a.startFrame(t), this.Pi = {};
|
|
8980
8980
|
},
|
|
8981
8981
|
updateCollision: function(t) {
|
|
8982
8982
|
const e = this.painter;
|
|
@@ -9001,7 +9001,7 @@ function Ha(t, e) {
|
|
|
9001
9001
|
if (!r) return {
|
|
9002
9002
|
retire: i
|
|
9003
9003
|
};
|
|
9004
|
-
const s = this.
|
|
9004
|
+
const s = this.ki(t);
|
|
9005
9005
|
let o = e.geometry;
|
|
9006
9006
|
if (!o) {
|
|
9007
9007
|
const s = n.features, a = n.data;
|
|
@@ -9014,23 +9014,23 @@ function Ha(t, e) {
|
|
|
9014
9014
|
for (const e in t) return !1;
|
|
9015
9015
|
return !0;
|
|
9016
9016
|
}(s)) for (let t = 0; t < a.length; t++) {
|
|
9017
|
-
const e = this.
|
|
9017
|
+
const e = this.Ti(s, a[t].data.aPickingId, a[t].indices, a[t].data.aPosition, a[t].positionSize);
|
|
9018
9018
|
a[t].data.aColor = e;
|
|
9019
9019
|
}
|
|
9020
9020
|
o = e.geometry = r.createGeometries(l, s);
|
|
9021
9021
|
for (let e = 0; e < o.length; e++) o[e] && o[e].geometry && (i = !0, o[e].geometry.properties.features = s,
|
|
9022
|
-
this.
|
|
9022
|
+
this.Ii(o[e].geometry, t));
|
|
9023
9023
|
}
|
|
9024
9024
|
let a = this.Me(s);
|
|
9025
9025
|
if (!a) {
|
|
9026
|
-
const {meshes: e, retire: n} = this.
|
|
9026
|
+
const {meshes: e, retire: n} = this.Fi(o, t);
|
|
9027
9027
|
i || (i = n), a = e;
|
|
9028
9028
|
}
|
|
9029
9029
|
return {
|
|
9030
9030
|
retire: i
|
|
9031
9031
|
};
|
|
9032
9032
|
},
|
|
9033
|
-
|
|
9033
|
+
Fi(t, e) {
|
|
9034
9034
|
const {tileInfo: n, tileExtent: i, tileTransform: r, tileTranslationMatrix: s, tileVectorTransform: o, tileZoom: a, sceneConfig: l} = e;
|
|
9035
9035
|
let h = !1;
|
|
9036
9036
|
const u = this.painter, c = [ n.extent2d.xmin, n.extent2d.ymax ], f = u.createMeshes(t, r, {
|
|
@@ -9041,10 +9041,10 @@ function Ha(t, e) {
|
|
|
9041
9041
|
tileVectorTransform: o
|
|
9042
9042
|
}, e);
|
|
9043
9043
|
if (f.length) {
|
|
9044
|
-
for (let t = 0; t < f.length; t++) f[t] && (h = !0, this.
|
|
9045
|
-
l.animation && (f.
|
|
9046
|
-
const t = this.
|
|
9047
|
-
this.
|
|
9044
|
+
for (let t = 0; t < f.length; t++) f[t] && (h = !0, this.Ci(f[t], r, e.timestamp, Ra++, u.isEnableTileStencil()));
|
|
9045
|
+
l.animation && (f.Oi = e.timestamp);
|
|
9046
|
+
const t = this.ki(e);
|
|
9047
|
+
this.Mi[t] = f;
|
|
9048
9048
|
}
|
|
9049
9049
|
return {
|
|
9050
9050
|
meshes: f,
|
|
@@ -9057,10 +9057,10 @@ function Ha(t, e) {
|
|
|
9057
9057
|
let o = e.geometry;
|
|
9058
9058
|
if (!o) return Da;
|
|
9059
9059
|
let a = !1;
|
|
9060
|
-
const l = this.
|
|
9060
|
+
const l = this.ki(t);
|
|
9061
9061
|
let h = this.Me(l);
|
|
9062
9062
|
if (!h) {
|
|
9063
|
-
const {meshes: e, retire: n} = this.
|
|
9063
|
+
const {meshes: e, retire: n} = this.Fi(o, t);
|
|
9064
9064
|
a || (a = n), h = e;
|
|
9065
9065
|
}
|
|
9066
9066
|
if (!h.length) return Da;
|
|
@@ -9069,21 +9069,21 @@ function Ha(t, e) {
|
|
|
9069
9069
|
t.properties.tile = n, t.properties.level = u;
|
|
9070
9070
|
}));
|
|
9071
9071
|
let c = !1;
|
|
9072
|
-
if (!this.
|
|
9072
|
+
if (!this.Pi[l]) {
|
|
9073
9073
|
let e = null, n = r.animation;
|
|
9074
9074
|
if (n) {
|
|
9075
|
-
const i = t.sceneConfig.animationDuration || 800, r = (t.timestamp - h.
|
|
9076
|
-
h.
|
|
9075
|
+
const i = t.sceneConfig.animationDuration || 800, r = (t.timestamp - h.Oi) / i, s = h[0].properties.createTime;
|
|
9076
|
+
h.Oi - s < i && r < 1 && (!0 !== n && 1 !== n || (n = "linear"), e = "linear" === n ? r : O(n, r),
|
|
9077
9077
|
c = !0);
|
|
9078
9078
|
}
|
|
9079
|
-
s.addMesh(h, e, t), this.
|
|
9079
|
+
s.addMesh(h, e, t), this.Pi[l] = 1;
|
|
9080
9080
|
}
|
|
9081
9081
|
return {
|
|
9082
9082
|
redraw: c,
|
|
9083
9083
|
retire: a
|
|
9084
9084
|
};
|
|
9085
9085
|
},
|
|
9086
|
-
|
|
9086
|
+
Ci: function(t, e, n, i, r) {
|
|
9087
9087
|
if (t.properties.tileTransform = e, t.properties.createTime = n, t.properties.meshKey = i,
|
|
9088
9088
|
t.needUpdateShadow = !0, r) {
|
|
9089
9089
|
const e = t.defines || {};
|
|
@@ -9096,7 +9096,7 @@ function Ha(t, e) {
|
|
|
9096
9096
|
}
|
|
9097
9097
|
});
|
|
9098
9098
|
},
|
|
9099
|
-
|
|
9099
|
+
Ii: function(t, e) {
|
|
9100
9100
|
const {layer: n, tileInfo: i} = e, r = n.getMap(), s = (n.getSpatialReference ? n.getSpatialReference() : r.getSpatialReference()).getResolution(i.z), o = e.tileExtent / n.getTileSize().width;
|
|
9101
9101
|
t.properties.tileResolution = s, t.properties.tileRatio = o, t.properties.z = i.z,
|
|
9102
9102
|
t.properties.tileExtent = e.tileExtent;
|
|
@@ -9113,8 +9113,8 @@ function Ha(t, e) {
|
|
|
9113
9113
|
const n = this.painter;
|
|
9114
9114
|
if (!n) return !1;
|
|
9115
9115
|
if (n.shouldDeleteMeshOnUpdateSymbol(t)) {
|
|
9116
|
-
if (this.
|
|
9117
|
-
delete this.
|
|
9116
|
+
if (this.Mi) for (const t in this.Mi) n.deleteMesh(this.Mi[t], !0);
|
|
9117
|
+
delete this.Mi, delete this.Pi;
|
|
9118
9118
|
}
|
|
9119
9119
|
return n.updateSymbol(t, e);
|
|
9120
9120
|
},
|
|
@@ -9122,17 +9122,17 @@ function Ha(t, e) {
|
|
|
9122
9122
|
return this.painter && this.painter.pick ? this.painter.pick(t, e, n) : null;
|
|
9123
9123
|
},
|
|
9124
9124
|
deleteTile: function(t) {
|
|
9125
|
-
if (!this.
|
|
9126
|
-
const e = this.
|
|
9127
|
-
n && this.painter && this.painter.deleteMesh(n), delete this.
|
|
9125
|
+
if (!this.Mi) return;
|
|
9126
|
+
const e = this.ki(t), n = this.Mi[e];
|
|
9127
|
+
n && this.painter && this.painter.deleteMesh(n), delete this.Mi[e], this.Pi && delete this.Pi[e];
|
|
9128
9128
|
},
|
|
9129
9129
|
remove: function() {
|
|
9130
9130
|
const t = this.painter;
|
|
9131
|
-
if (t && this.
|
|
9132
|
-
for (const e in this.
|
|
9131
|
+
if (t && this.Mi) {
|
|
9132
|
+
for (const e in this.Mi) t.deleteMesh(this.Mi[e]);
|
|
9133
9133
|
t.delete(), delete this.painter;
|
|
9134
9134
|
}
|
|
9135
|
-
delete this.
|
|
9135
|
+
delete this.Mi, delete this.Pi;
|
|
9136
9136
|
},
|
|
9137
9137
|
resize: function(t, e) {
|
|
9138
9138
|
const n = this.painter;
|
|
@@ -9156,7 +9156,7 @@ function Ha(t, e) {
|
|
|
9156
9156
|
isTerrainVector: function() {
|
|
9157
9157
|
return !!this.painter && this.painter.isTerrainVector();
|
|
9158
9158
|
},
|
|
9159
|
-
|
|
9159
|
+
Ti: function(t, e, n, i, r = 3) {
|
|
9160
9160
|
if (!i || !t || !e.length) return null;
|
|
9161
9161
|
const s = new Uint8Array(i.length / r * 4);
|
|
9162
9162
|
let o, a;
|
|
@@ -9173,31 +9173,31 @@ function Ha(t, e) {
|
|
|
9173
9173
|
}
|
|
9174
9174
|
return s;
|
|
9175
9175
|
},
|
|
9176
|
-
|
|
9176
|
+
ki: function(t) {
|
|
9177
9177
|
const e = t.tileInfo;
|
|
9178
9178
|
return e.meshKey || (e.meshKey = Ra++), e.meshKey;
|
|
9179
9179
|
},
|
|
9180
9180
|
Me: function(t) {
|
|
9181
|
-
return this.
|
|
9181
|
+
return this.Mi[t];
|
|
9182
9182
|
},
|
|
9183
|
-
|
|
9183
|
+
Ei(t, e) {
|
|
9184
9184
|
if (Array.isArray(t)) t.forEach(((t, n) => {
|
|
9185
9185
|
const {features: i} = t.properties;
|
|
9186
|
-
this.
|
|
9186
|
+
this.Di(t, e[n], i);
|
|
9187
9187
|
})); else {
|
|
9188
9188
|
const {features: n} = t.properties;
|
|
9189
|
-
this.
|
|
9189
|
+
this.Di(t, Array.isArray(e) ? e[0] : e, n);
|
|
9190
9190
|
}
|
|
9191
9191
|
},
|
|
9192
|
-
|
|
9192
|
+
Di(t, e, n) {
|
|
9193
9193
|
const i = e.featureIndexes || e.data.featureIndexes;
|
|
9194
|
-
if (i) if (this.
|
|
9194
|
+
if (i) if (this._i) {
|
|
9195
9195
|
const r = e.indices;
|
|
9196
9196
|
let s = null, o = !1;
|
|
9197
9197
|
const a = [];
|
|
9198
9198
|
for (let t = 0; t < r.length; t++) {
|
|
9199
9199
|
const e = n[i[r[t]]];
|
|
9200
|
-
null !== s && s === r[t] || (o = this.
|
|
9200
|
+
null !== s && s === r[t] || (o = this._i(e.feature), s = r[t]), o || a.push(r[t]);
|
|
9201
9201
|
}
|
|
9202
9202
|
t.setElements(new e.indices.constructor(a));
|
|
9203
9203
|
} else t.setElements(e.indices);
|
|
@@ -9318,9 +9318,9 @@ function Ba(t, e, n, i, r) {
|
|
|
9318
9318
|
const o = i.geometry.properties.layer;
|
|
9319
9319
|
for (let a = 0; a < n.length; a++) {
|
|
9320
9320
|
const l = n[a], h = l.attrName;
|
|
9321
|
-
if (!($a(s, e, l) || o.
|
|
9321
|
+
if (!($a(s, e, l) || o.Qn && o.Qn(i.geometry.Li))) {
|
|
9322
9322
|
const {aPickingId: t} = s.properties;
|
|
9323
|
-
if (!t || s.
|
|
9323
|
+
if (!t || s.Ri === r) continue;
|
|
9324
9324
|
const e = (Na + h + "Index").trim(), n = s.properties[e];
|
|
9325
9325
|
if (!n) continue;
|
|
9326
9326
|
Ja(s, n, l);
|
|
@@ -9329,7 +9329,7 @@ function Ba(t, e, n, i, r) {
|
|
|
9329
9329
|
const u = ja(s, e, l), c = l.define;
|
|
9330
9330
|
if (u) {
|
|
9331
9331
|
const e = (Na + h + "Index").trim();
|
|
9332
|
-
if (Ja(s, s.properties[e], l), o.
|
|
9332
|
+
if (Ja(s, s.properties[e], l), o.Zn && (s.Li = o.Zn()), c) {
|
|
9333
9333
|
const t = i.defines;
|
|
9334
9334
|
t[c] = 1, i.setDefines(t);
|
|
9335
9335
|
}
|
|
@@ -9339,7 +9339,7 @@ function Ba(t, e, n, i, r) {
|
|
|
9339
9339
|
t[c] && (delete t[c], i.setDefines(t));
|
|
9340
9340
|
}
|
|
9341
9341
|
}
|
|
9342
|
-
s.
|
|
9342
|
+
s.Ri = r;
|
|
9343
9343
|
}
|
|
9344
9344
|
|
|
9345
9345
|
function $a(t, e, n) {
|
|
@@ -9455,15 +9455,15 @@ class bl {
|
|
|
9455
9455
|
return [ "bloom" ];
|
|
9456
9456
|
}
|
|
9457
9457
|
constructor(t, e, n, i, s, o) {
|
|
9458
|
-
this.
|
|
9458
|
+
this.Hi = !0, this.regl = t, this.layer = e, this.canvas = t._gl.canvas, this.sceneConfig = i || {},
|
|
9459
9459
|
this.dataConfig = o || {}, this.pluginIndex = s, this.scene = new r.Scene, this.pickingFBO = e.getRenderer().pickingFBO,
|
|
9460
9460
|
this.level0Filter = vl, this.levelNFilter = xl, this.loginTextureCache(), this.symbolDef = Array.isArray(n) ? n.map((t => Jo(t))) : [ Jo(n) ],
|
|
9461
|
-
this.
|
|
9461
|
+
this.zi(), this.pickingViewport = {
|
|
9462
9462
|
x: 0,
|
|
9463
9463
|
y: 0,
|
|
9464
9464
|
width: () => this.canvas ? this.canvas.width : 1,
|
|
9465
9465
|
height: () => this.canvas ? this.canvas.height : 1
|
|
9466
|
-
}, this.sortByCommandKey = wl.bind(this), this.colorCache = {}, this.
|
|
9466
|
+
}, this.sortByCommandKey = wl.bind(this), this.colorCache = {}, this.Ni = this.symbolDef.map((t => !(!t || !1 !== t.visible)));
|
|
9467
9467
|
}
|
|
9468
9468
|
hasMesh() {
|
|
9469
9469
|
const t = this.scene && this.scene.getMeshes();
|
|
@@ -9507,7 +9507,7 @@ class bl {
|
|
|
9507
9507
|
return !1;
|
|
9508
9508
|
}
|
|
9509
9509
|
needToRedraw() {
|
|
9510
|
-
return this.isAnimating() || this.
|
|
9510
|
+
return this.isAnimating() || this.Vi;
|
|
9511
9511
|
}
|
|
9512
9512
|
needToRetireFrames() {
|
|
9513
9513
|
return this.Le;
|
|
@@ -9523,16 +9523,16 @@ class bl {
|
|
|
9523
9523
|
}
|
|
9524
9524
|
isShadowIncludeChanged(t) {
|
|
9525
9525
|
const e = t && t.isRenderingTerrain && this.isTerrainSkin();
|
|
9526
|
-
return t && t.states && t.states.includesChanged.shadow || e && this.
|
|
9526
|
+
return t && t.states && t.states.includesChanged.shadow || e && this.Ui;
|
|
9527
9527
|
}
|
|
9528
9528
|
fillIncludes(t, e, n) {
|
|
9529
|
-
if (delete this.
|
|
9529
|
+
if (delete this.Ui, n && n.isRenderingTerrain && this.isTerrainSkin()) return;
|
|
9530
9530
|
const i = n && n.includes;
|
|
9531
9531
|
if (i) {
|
|
9532
9532
|
let r = "";
|
|
9533
9533
|
for (const s in i) i[s] && (r += s, n[s].uniformDeclares && e.push(...n[s].uniformDeclares),
|
|
9534
9534
|
n[s].defines && Bo(t, n[s].defines));
|
|
9535
|
-
this.
|
|
9535
|
+
this.Ui = r;
|
|
9536
9536
|
}
|
|
9537
9537
|
}
|
|
9538
9538
|
setIncludeUniformValues(t, e) {
|
|
@@ -9548,10 +9548,10 @@ class bl {
|
|
|
9548
9548
|
symbolIndex: t[i].symbolIndex,
|
|
9549
9549
|
ref: t[i].ref
|
|
9550
9550
|
}) : n.push(null); else {
|
|
9551
|
-
t[i] && !t[i].is2D && (this.
|
|
9551
|
+
t[i] && !t[i].is2D && (this.Hi = !1);
|
|
9552
9552
|
const r = this.createGeometry(t[i], e, i);
|
|
9553
9553
|
if (r && r.geometry) {
|
|
9554
|
-
const s = r.geometry.properties, {pickingIdMap: o, idPickingMap: a, hasFeaIds: l} = this.
|
|
9554
|
+
const s = r.geometry.properties, {pickingIdMap: o, idPickingMap: a, hasFeaIds: l} = this.ji(t[i]);
|
|
9555
9555
|
l && (s.feaIdPickingMap = o, s.feaPickingIdMap = a), s.symbolIndex = r.symbolIndex,
|
|
9556
9556
|
s.features = e, s.is2D = t[i].is2D, s.layer = this.layer, s.positionBounding = t[i].positionBounding,
|
|
9557
9557
|
this.postCreateGeometry(r, n);
|
|
@@ -9561,10 +9561,10 @@ class bl {
|
|
|
9561
9561
|
return n;
|
|
9562
9562
|
}
|
|
9563
9563
|
isOnly2D() {
|
|
9564
|
-
return this.
|
|
9564
|
+
return this.Hi;
|
|
9565
9565
|
}
|
|
9566
9566
|
postCreateGeometry() {}
|
|
9567
|
-
|
|
9567
|
+
ji(t) {
|
|
9568
9568
|
if (!t) return {};
|
|
9569
9569
|
if (Array.isArray(t) && !(t = t[0])) return {};
|
|
9570
9570
|
const e = t.featureIds, n = {}, i = {}, r = e && e.length;
|
|
@@ -9587,7 +9587,7 @@ class bl {
|
|
|
9587
9587
|
if (!t[o]) continue;
|
|
9588
9588
|
if (r && i && i.isRenderingTerrain && this.isTerrainVector()) {
|
|
9589
9589
|
const e = t[o], n = e && e.geometry;
|
|
9590
|
-
this.
|
|
9590
|
+
this.Gi(n, n.data, n.properties, n.positionSize || n.desc.positionSize, i);
|
|
9591
9591
|
}
|
|
9592
9592
|
let a = this.createMesh(t[o], e, n, i || {});
|
|
9593
9593
|
Array.isArray(a) ? (a = a.filter((t => !!t)), s.push(...a)) : a && s.push(a);
|
|
@@ -9623,21 +9623,21 @@ class bl {
|
|
|
9623
9623
|
if (!!l.HAS_BLOOM !== e && (a = !0, e ? l.HAS_BLOOM = 1 : delete l.HAS_BLOOM), i) {
|
|
9624
9624
|
if (t.geometry.data.aTerrainAltitude) {
|
|
9625
9625
|
const e = t.geometry;
|
|
9626
|
-
this.
|
|
9626
|
+
this.Gi(e, e.data, e.properties, e.desc.positionSize, n);
|
|
9627
9627
|
}
|
|
9628
9628
|
t.geometry.data.aTerrainAltitude && !l.HAS_TERRAIN_ALTITUDE && (l.HAS_TERRAIN_ALTITUDE = 1,
|
|
9629
9629
|
a = !0);
|
|
9630
9630
|
} else l.HAS_TERRAIN_ALTITUDE && (delete l.HAS_TERRAIN_ALTITUDE, a = !0);
|
|
9631
9631
|
a && t.setDefines(l), r ? t.setUniform("targetFramebuffer", r) : t.uniforms.targetFramebuffer && (t.uniforms.targetFramebuffer = null),
|
|
9632
|
-
this.
|
|
9632
|
+
this.Wi(t);
|
|
9633
9633
|
})), this.scene.addMesh(t);
|
|
9634
9634
|
}
|
|
9635
9635
|
updateCollision() {}
|
|
9636
9636
|
render(t) {
|
|
9637
9637
|
return this.pluginIndex = t.pluginIndex, this.polygonOffsetIndex = t.polygonOffsetIndex,
|
|
9638
9638
|
this.paint(t), {
|
|
9639
|
-
redraw: this.
|
|
9640
|
-
drawCount: this.
|
|
9639
|
+
redraw: this.Vi,
|
|
9640
|
+
drawCount: this.Bi
|
|
9641
9641
|
};
|
|
9642
9642
|
}
|
|
9643
9643
|
prepareRender(t) {
|
|
@@ -9661,14 +9661,14 @@ class bl {
|
|
|
9661
9661
|
if (!e) return {
|
|
9662
9662
|
redraw: !1
|
|
9663
9663
|
};
|
|
9664
|
-
this
|
|
9664
|
+
this.$i = t;
|
|
9665
9665
|
const n = this.getUniformValues(e, t);
|
|
9666
9666
|
return this.callShader(n, t), {
|
|
9667
|
-
redraw: this.
|
|
9667
|
+
redraw: this.Vi
|
|
9668
9668
|
};
|
|
9669
9669
|
}
|
|
9670
9670
|
setToRedraw(t) {
|
|
9671
|
-
t && (this.Le = t), this.
|
|
9671
|
+
t && (this.Le = t), this.Vi = !0;
|
|
9672
9672
|
}
|
|
9673
9673
|
callShader(t, e) {
|
|
9674
9674
|
this.callCurrentTileShader(t, e), this.callBackgroundTileShader(t, e);
|
|
@@ -9685,12 +9685,12 @@ class bl {
|
|
|
9685
9685
|
const i = this.scene.getMeshes(), r = [];
|
|
9686
9686
|
i.forEach((t => {
|
|
9687
9687
|
t.properties.hlBloomMesh && n && n.bloom && r.push(t.properties.hlBloomMesh), r.push(t);
|
|
9688
|
-
})), this
|
|
9688
|
+
})), this.Xi(e), this.scene.setMeshes(r), this.Bi += this.renderer.render(t, e, this.scene, this.getRenderFBO(n)),
|
|
9689
9689
|
this.scene.setMeshes(i);
|
|
9690
9690
|
}
|
|
9691
|
-
|
|
9691
|
+
Xi(t) {
|
|
9692
9692
|
const e = this.layer.options.altitude || 0, n = this.layer.getRenderer();
|
|
9693
|
-
t.layerOpacity = n.
|
|
9693
|
+
t.layerOpacity = n.Bn(), t.minAltitude = e;
|
|
9694
9694
|
}
|
|
9695
9695
|
getRenderFBO(t) {
|
|
9696
9696
|
return t && t.renderTarget && t.renderTarget.fbo;
|
|
@@ -9715,7 +9715,7 @@ class bl {
|
|
|
9715
9715
|
if (!this.layer.options.picking || !1 === this.sceneConfig.picking) return null;
|
|
9716
9716
|
if (!this.pickingFBO || !this.picking) return null;
|
|
9717
9717
|
const i = this.getMap(), r = this.getUniformValues(i);
|
|
9718
|
-
this
|
|
9718
|
+
this.Xi(r);
|
|
9719
9719
|
for (let s = 0; s < this.picking.length; s++) {
|
|
9720
9720
|
const o = this.picking[s];
|
|
9721
9721
|
o.render(this.scene.getMeshes(), r, !0);
|
|
@@ -9732,7 +9732,7 @@ class bl {
|
|
|
9732
9732
|
f.features || (f = c.properties), u && u.length && (u[0] = Math.round(1e5 * u[0]) / 1e5,
|
|
9733
9733
|
u[1] = Math.round(1e5 * u[1]) / 1e5, u[2] = Math.round(1e5 * u[2]) / 1e5);
|
|
9734
9734
|
return {
|
|
9735
|
-
data: this.
|
|
9735
|
+
data: this.Yi(f && f.features && f.features[h]),
|
|
9736
9736
|
point: u,
|
|
9737
9737
|
coordinate: a.coordinate,
|
|
9738
9738
|
plugin: this.pluginIndex
|
|
@@ -9740,7 +9740,7 @@ class bl {
|
|
|
9740
9740
|
}
|
|
9741
9741
|
return null;
|
|
9742
9742
|
}
|
|
9743
|
-
|
|
9743
|
+
Yi(t) {
|
|
9744
9744
|
const e = t && t.feature;
|
|
9745
9745
|
if (!e || !e.customProps) return t;
|
|
9746
9746
|
const n = Bo({}, t);
|
|
@@ -9765,8 +9765,8 @@ class bl {
|
|
|
9765
9765
|
}
|
|
9766
9766
|
}
|
|
9767
9767
|
startFrame(t) {
|
|
9768
|
-
this.
|
|
9769
|
-
this.Le = !1, this.
|
|
9768
|
+
this.Ji || (this.init(t), this.Ji = !0), this.Ke !== t.timestamp && (this.Vi = !1,
|
|
9769
|
+
this.Le = !1, this.Bi = 0), this.scene.clear();
|
|
9770
9770
|
}
|
|
9771
9771
|
resize() {}
|
|
9772
9772
|
delete() {
|
|
@@ -9774,34 +9774,34 @@ class bl {
|
|
|
9774
9774
|
for (let t = 0; t < this.picking.length; t++) this.picking[t].dispose();
|
|
9775
9775
|
delete this.picking;
|
|
9776
9776
|
}
|
|
9777
|
-
if (this.
|
|
9778
|
-
for (let t = 0; t < this.
|
|
9779
|
-
delete this.
|
|
9777
|
+
if (this.qi) {
|
|
9778
|
+
for (let t = 0; t < this.qi.length; t++) this.qi[t].dispose();
|
|
9779
|
+
delete this.qi;
|
|
9780
9780
|
}
|
|
9781
|
-
delete this.
|
|
9781
|
+
delete this.Ki, this.logoutTextureCache();
|
|
9782
9782
|
}
|
|
9783
9783
|
updateSymbol(t, e) {
|
|
9784
9784
|
Array.isArray(t) || (t = [ t ], e = [ e ]);
|
|
9785
9785
|
let n = !1;
|
|
9786
9786
|
for (let i = 0; i < t.length; i++) if (t[i]) {
|
|
9787
|
-
const r = this.
|
|
9787
|
+
const r = this.Zi(i, t[i], e[i]);
|
|
9788
9788
|
r && (n = r);
|
|
9789
9789
|
}
|
|
9790
|
-
return delete this.
|
|
9790
|
+
return delete this.Qi, this.setToRedraw(!1), n;
|
|
9791
9791
|
}
|
|
9792
|
-
|
|
9792
|
+
er(t, e) {
|
|
9793
9793
|
for (const n in e) if (ra(e, n)) {
|
|
9794
9794
|
if (Pt(e[n]) && !this.layer.options.features && (!t[n] || t[n].property !== e[n].property)) return !0;
|
|
9795
9795
|
if (so[n] && !C(e[n], t[n])) return !0;
|
|
9796
9796
|
}
|
|
9797
9797
|
return !1;
|
|
9798
9798
|
}
|
|
9799
|
-
|
|
9800
|
-
if (!this.
|
|
9801
|
-
const i = this.
|
|
9802
|
-
if (this.
|
|
9799
|
+
Zi(t, e, n) {
|
|
9800
|
+
if (!this.nr) return !1;
|
|
9801
|
+
const i = this.er(this.symbolDef[t] || {}, n);
|
|
9802
|
+
if (this.Ni[t] && !1 !== n.visible) return this.Ni[t] = !1, !0;
|
|
9803
9803
|
this.symbolDef[t] = Jo(n);
|
|
9804
|
-
const r = this.
|
|
9804
|
+
const r = this.nr[t];
|
|
9805
9805
|
for (const t in r) delete r[t];
|
|
9806
9806
|
const s = this.getMap(), o = [], a = io(this.symbolDef[t], (() => (o[0] = s.getZoom(),
|
|
9807
9807
|
o)));
|
|
@@ -9820,29 +9820,29 @@ class bl {
|
|
|
9820
9820
|
return this.symbolDef[t.index];
|
|
9821
9821
|
}
|
|
9822
9822
|
getSymbols() {
|
|
9823
|
-
return this.
|
|
9823
|
+
return this.nr;
|
|
9824
9824
|
}
|
|
9825
9825
|
getSymbol(t) {
|
|
9826
9826
|
const e = t.index;
|
|
9827
|
-
return this.
|
|
9827
|
+
return this.nr[e];
|
|
9828
9828
|
}
|
|
9829
|
-
|
|
9829
|
+
zi() {
|
|
9830
9830
|
const t = this.getMap(), e = [], n = () => (e[0] = t.getZoom(), e);
|
|
9831
|
-
this.
|
|
9832
|
-
for (let t = 0; t < this.symbolDef.length; t++) this.
|
|
9831
|
+
this.nr = [], this.tt = [];
|
|
9832
|
+
for (let t = 0; t < this.symbolDef.length; t++) this.nr[t] = io(Bo({}, this.symbolDef[t]), n),
|
|
9833
9833
|
this.symbolDef[t] && y(this.symbolDef[t].visible) && (this.tt[t] = g(this.symbolDef[t].visible));
|
|
9834
9834
|
}
|
|
9835
9835
|
getFnTypeConfig(t) {
|
|
9836
|
-
this.
|
|
9836
|
+
this.Qi || (this.Qi = []);
|
|
9837
9837
|
const e = t.index;
|
|
9838
|
-
if (!this.
|
|
9838
|
+
if (!this.Qi[e]) {
|
|
9839
9839
|
const n = this.getSymbolDef(t), i = this.getMap();
|
|
9840
|
-
this.
|
|
9840
|
+
this.Qi[e] = this.createFnTypeConfig(i, n);
|
|
9841
9841
|
}
|
|
9842
|
-
return this.
|
|
9842
|
+
return this.Qi[e];
|
|
9843
9843
|
}
|
|
9844
|
-
|
|
9845
|
-
delete this.
|
|
9844
|
+
ir() {
|
|
9845
|
+
delete this.Qi;
|
|
9846
9846
|
}
|
|
9847
9847
|
loginTextureCache() {
|
|
9848
9848
|
const t = (fl + "").trim(), e = this.getMap();
|
|
@@ -9851,7 +9851,7 @@ class bl {
|
|
|
9851
9851
|
}), e[t].count++;
|
|
9852
9852
|
}
|
|
9853
9853
|
logoutTextureCache() {
|
|
9854
|
-
const t = (fl + "").trim(), e = this.getMap(), n = this.
|
|
9854
|
+
const t = (fl + "").trim(), e = this.getMap(), n = this.rr;
|
|
9855
9855
|
if (n) for (const i in n) ra(n, i) && e[t][i] && (e[t][i].count--, e[t][i].count <= 0 && delete e[t][i]);
|
|
9856
9856
|
e[t].count--, e[t].count <= 0 && (e[t] = {});
|
|
9857
9857
|
}
|
|
@@ -9865,13 +9865,13 @@ class bl {
|
|
|
9865
9865
|
r ? r.data = e : r = i[n][t] = {
|
|
9866
9866
|
data: e,
|
|
9867
9867
|
count: 0
|
|
9868
|
-
}, this.
|
|
9868
|
+
}, this.rr || (this.rr = {}), r.data.then || this.rr[t] || (r.count++, this.rr[t] = 1);
|
|
9869
9869
|
}
|
|
9870
9870
|
disposeCachedTexture(t) {
|
|
9871
9871
|
let e;
|
|
9872
|
-
if (e = "string" == typeof t ? t : t.url, !this.
|
|
9872
|
+
if (e = "string" == typeof t ? t : t.url, !this.rr || !this.rr[e]) return;
|
|
9873
9873
|
const n = (fl + "").trim();
|
|
9874
|
-
delete this.
|
|
9874
|
+
delete this.rr[e];
|
|
9875
9875
|
const i = this.getMap();
|
|
9876
9876
|
i[n][e] && (i[n][e].count--, i[n][e].count <= 0 && delete i[n][e]);
|
|
9877
9877
|
}
|
|
@@ -9889,33 +9889,33 @@ class bl {
|
|
|
9889
9889
|
}
|
|
9890
9890
|
outline(t, e) {
|
|
9891
9891
|
const n = {};
|
|
9892
|
-
for (let i = 0; i < e.length; i++) Yo(e[i]) || n[e[i]] || (this.
|
|
9892
|
+
for (let i = 0; i < e.length; i++) Yo(e[i]) || n[e[i]] || (this.sr(t, e[i]), n[e[i]] = 1);
|
|
9893
9893
|
}
|
|
9894
|
-
|
|
9894
|
+
sr(t, e) {
|
|
9895
9895
|
if (!this.picking) return;
|
|
9896
|
-
if (this.
|
|
9897
|
-
const n = this.getUniformValues(this.getMap(), this
|
|
9898
|
-
this
|
|
9899
|
-
const i = this.
|
|
9896
|
+
if (this.ar || (this.ar = new r.Scene), !this.qi && (this.lr(), !this.qi)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
|
|
9897
|
+
const n = this.getUniformValues(this.getMap(), this.$i);
|
|
9898
|
+
this.Xi(n);
|
|
9899
|
+
const i = this.hr(e);
|
|
9900
9900
|
if (i.length) for (let r = 0; r < i.length; r++) {
|
|
9901
9901
|
const s = i[r].geometry.properties.feaIdPickingMap;
|
|
9902
9902
|
if (s) {
|
|
9903
9903
|
const o = s[e];
|
|
9904
9904
|
if (o) {
|
|
9905
9905
|
const e = {};
|
|
9906
|
-
this.
|
|
9906
|
+
this.ar.setMeshes(i[r]);
|
|
9907
9907
|
for (let i = 0; i < o.length; i++) {
|
|
9908
9908
|
const r = o[i];
|
|
9909
9909
|
if (!e[r]) {
|
|
9910
9910
|
e[r] = 1, n.highlightPickingId = r;
|
|
9911
|
-
for (let e = 0; e < this.
|
|
9911
|
+
for (let e = 0; e < this.qi.length; e++) this.renderer.render(this.qi[e], n, this.ar, t);
|
|
9912
9912
|
}
|
|
9913
9913
|
}
|
|
9914
9914
|
}
|
|
9915
9915
|
}
|
|
9916
9916
|
}
|
|
9917
9917
|
}
|
|
9918
|
-
|
|
9918
|
+
hr(t) {
|
|
9919
9919
|
const e = [], n = this.scene.getMeshes();
|
|
9920
9920
|
for (let i = 0; i < n.length; i++) {
|
|
9921
9921
|
const r = n[i], s = r.geometry.properties.feaIdPickingMap;
|
|
@@ -9925,21 +9925,21 @@ class bl {
|
|
|
9925
9925
|
}
|
|
9926
9926
|
outlineAll(t) {
|
|
9927
9927
|
if (!this.picking) return;
|
|
9928
|
-
if (!this.
|
|
9929
|
-
const e = this.getUniformValues(this.getMap(), this
|
|
9930
|
-
this
|
|
9931
|
-
for (let n = 0; n < this.
|
|
9928
|
+
if (!this.qi && (this.lr(), !this.qi)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
|
|
9929
|
+
const e = this.getUniformValues(this.getMap(), this.$i);
|
|
9930
|
+
this.Xi(e), e.highlightPickingId = -1;
|
|
9931
|
+
for (let n = 0; n < this.qi.length; n++) this.renderer.render(this.qi[n], e, this.scene, t);
|
|
9932
9932
|
}
|
|
9933
|
-
|
|
9933
|
+
lr() {
|
|
9934
9934
|
if (!this.picking) return;
|
|
9935
9935
|
const t = this.layer.getRenderer().canvas;
|
|
9936
|
-
this.
|
|
9936
|
+
this.qi = [];
|
|
9937
9937
|
for (let e = 0; e < this.picking.length; e++) {
|
|
9938
9938
|
const n = this.picking[e].getPickingVert(), i = {
|
|
9939
9939
|
ENABLE_PICKING: 1,
|
|
9940
9940
|
HAS_PICKING_ID: 1
|
|
9941
9941
|
}, s = this.picking[e].getUniformDeclares().slice(0);
|
|
9942
|
-
void 0 !== s.uPickingId && (i.HAS_PICKING_ID = 2), this.
|
|
9942
|
+
void 0 !== s.uPickingId && (i.HAS_PICKING_ID = 2), this.qi[e] = new r.MeshShader({
|
|
9943
9943
|
vert: n,
|
|
9944
9944
|
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}",
|
|
9945
9945
|
uniforms: s,
|
|
@@ -9965,7 +9965,7 @@ class bl {
|
|
|
9965
9965
|
equation: "add"
|
|
9966
9966
|
}
|
|
9967
9967
|
}
|
|
9968
|
-
}), this.
|
|
9968
|
+
}), this.qi[e].filter = this.picking[e].filter;
|
|
9969
9969
|
}
|
|
9970
9970
|
}
|
|
9971
9971
|
hasIBL() {
|
|
@@ -9991,8 +9991,8 @@ class bl {
|
|
|
9991
9991
|
ul(t, this.getMap());
|
|
9992
9992
|
}
|
|
9993
9993
|
evaluateInFnTypeConfig(t, e, n, i, r) {
|
|
9994
|
-
let s = this.
|
|
9995
|
-
s || (s = this.
|
|
9994
|
+
let s = this.ur;
|
|
9995
|
+
s || (s = this.ur = {});
|
|
9996
9996
|
const o = function(t) {
|
|
9997
9997
|
let e = 0;
|
|
9998
9998
|
const n = t && t.length || 0;
|
|
@@ -10005,18 +10005,18 @@ class bl {
|
|
|
10005
10005
|
return a || (a = s[o] = r ? v(t) : g(t)), a(n.getZoom(), i);
|
|
10006
10006
|
}
|
|
10007
10007
|
highlight(t) {
|
|
10008
|
-
this.
|
|
10008
|
+
this.Gn = t, this.cr = this.layer.getRenderer().getFrameTimestamp(), this.setToRedraw(!0);
|
|
10009
10009
|
}
|
|
10010
10010
|
cancelAllHighlight() {
|
|
10011
|
-
this.
|
|
10011
|
+
this.Gn = null, this.cr = this.layer.getRenderer().getFrameTimestamp(), this.setToRedraw(!0);
|
|
10012
10012
|
}
|
|
10013
|
-
|
|
10013
|
+
dr(t, e) {
|
|
10014
10014
|
const {featureIds: n, pickingIdIndiceMap: i} = e;
|
|
10015
10015
|
t.properties.aFeaIds = n, t.properties.pickingIdIndiceMap = i;
|
|
10016
10016
|
}
|
|
10017
|
-
|
|
10017
|
+
Wi(t) {
|
|
10018
10018
|
if (t && t.properties.isHalo) return;
|
|
10019
|
-
const {pickingIdIndiceMap: e} = t.geometry.properties, n = this.
|
|
10019
|
+
const {pickingIdIndiceMap: e} = t.geometry.properties, n = this.Gn ? function(t, e, n) {
|
|
10020
10020
|
const {aPickingId: i, feaIdPickingMap: r, features: s} = t.geometry.properties, o = new Map, a = n.keys();
|
|
10021
10021
|
for (const t of a) {
|
|
10022
10022
|
const a = n.get(t);
|
|
@@ -10036,28 +10036,28 @@ class bl {
|
|
|
10036
10036
|
}
|
|
10037
10037
|
}
|
|
10038
10038
|
return o;
|
|
10039
|
-
}(t, this.layer, this.
|
|
10040
|
-
u.highlightMesh(this.regl, t, n, this.
|
|
10039
|
+
}(t, this.layer, this.Gn) : null;
|
|
10040
|
+
u.highlightMesh(this.regl, t, n, this.cr, e);
|
|
10041
10041
|
}
|
|
10042
|
-
|
|
10042
|
+
Gi(t, e, n, i, r) {
|
|
10043
10043
|
let s = n.aAnchor;
|
|
10044
10044
|
if (!s) {
|
|
10045
10045
|
const {aPosition: t} = e;
|
|
10046
10046
|
s = n.aAnchor = t.slice(0);
|
|
10047
10047
|
}
|
|
10048
10048
|
let o = n.aTerrainAltitude;
|
|
10049
|
-
o || (o = n.aTerrainAltitude = new Float32Array(s.length / i), o.fill(Ro)), this.
|
|
10050
|
-
e.aTerrainAltitude ? o.dirty && this.
|
|
10049
|
+
o || (o = n.aTerrainAltitude = new Float32Array(s.length / i), o.fill(Ro)), this.pr(o, s, r.tileInfo, 0, o.length - 1),
|
|
10050
|
+
e.aTerrainAltitude ? o.dirty && this.mr(t, o) : e.aTerrainAltitude = o, o.dirty = !1;
|
|
10051
10051
|
}
|
|
10052
|
-
|
|
10052
|
+
mr(t, e) {
|
|
10053
10053
|
t && t.updateData && t.updateData("aTerrainAltitude", e);
|
|
10054
10054
|
}
|
|
10055
|
-
|
|
10055
|
+
pr(e, n, i, r, s) {
|
|
10056
10056
|
const {res: o, extent: a, extent2d: l, id: h} = i, u = this.pluginIndex, c = h + "-" + u;
|
|
10057
10057
|
if (i.completeTerrainQuery || (i.completeTerrainQuery = []), i.completeTerrainQuery[u]) return;
|
|
10058
|
-
if (!i.completeTerrainQuery[u] && this.
|
|
10059
|
-
const t = this.
|
|
10060
|
-
return this.
|
|
10058
|
+
if (!i.completeTerrainQuery[u] && this.Ki && this.Ki.has(c)) {
|
|
10059
|
+
const t = this.Ki.getAndRemove(c);
|
|
10060
|
+
return this.Ki.add(c, t), e.set(t.altitudeData), i.terrainTileInfos = t.terrainTileInfos,
|
|
10061
10061
|
e.dirty = !0, void (i.completeTerrainQuery[u] = !0);
|
|
10062
10062
|
}
|
|
10063
10063
|
const f = this.layer, d = f.getMap(), p = f.getRenderer(), m = p && p.getTerrainHelper();
|
|
@@ -10101,8 +10101,8 @@ class bl {
|
|
|
10101
10101
|
}
|
|
10102
10102
|
}
|
|
10103
10103
|
x.altitudeQueryFrameTime = (x.altitudeQueryFrameTime || 0) + (performance.now() - b),
|
|
10104
|
-
i.completeTerrainQuery[u] = k, k && (this.
|
|
10105
|
-
this.
|
|
10104
|
+
i.completeTerrainQuery[u] = k, k && (this.Ki || (this.Ki = new t.LRUCache(4 * this.layer.options.maxCacheSize)),
|
|
10105
|
+
this.Ki.add(c, {
|
|
10106
10106
|
altitudeData: e,
|
|
10107
10107
|
terrainTileInfos: y
|
|
10108
10108
|
}));
|
|
@@ -10136,7 +10136,7 @@ class Ml extends bl {
|
|
|
10136
10136
|
features: e
|
|
10137
10137
|
}, t.iconAtlas && (s.properties.iconAtlas = t.iconAtlas.image, s.properties.iconPositions = t.iconAtlas.positions),
|
|
10138
10138
|
t.glyphAtlas && (s.properties.glyphAtlas = t.glyphAtlas.image), za(e) || (s.properties.aFeaIds = t.featureIds,
|
|
10139
|
-
this.
|
|
10139
|
+
this.dr(s, t)), t.markerPlacement && (s.properties.markerPlacement = t.markerPlacement),
|
|
10140
10140
|
t.textPlacement && (s.properties.textPlacement = t.textPlacement), Bo(s.properties, t.properties),
|
|
10141
10141
|
{
|
|
10142
10142
|
geometry: s,
|
|
@@ -10245,8 +10245,8 @@ class Rl extends Ml {
|
|
|
10245
10245
|
tileExtent: a.properties.tileExtent,
|
|
10246
10246
|
tileRatio: d
|
|
10247
10247
|
}, v = this.getSymbol(l), x = this.getSymbolDef(l);
|
|
10248
|
-
if (y(x.polygonPatternFileOrigin) && this.
|
|
10249
|
-
x.uvOffsetInMeter && y(x.uvOffset) && this.
|
|
10248
|
+
if (y(x.polygonPatternFileOrigin) && this.yr(x, e, u ? [ 0, 0 ] : o, p), (y(x.polygonPatternFileWidth) || y(x.polygonPatternFileWidth)) && this.gr(x, e, u ? d : 1, m, p),
|
|
10249
|
+
x.uvOffsetInMeter && y(x.uvOffset) && this.vr(x, e, m, p), qo(g, "polygonFill", v, "polygonFill", Fl.polygonFill, Qo(this.colorCache)),
|
|
10250
10250
|
qo(g, "polygonOpacity", v, "polygonOpacity", Fl.polygonOpacity), qo(g, "uvScale", v, "uvScale", Fl.uvScale),
|
|
10251
10251
|
void 0 === h) {
|
|
10252
10252
|
const t = this.getFnTypeConfig(l);
|
|
@@ -10272,7 +10272,7 @@ class Rl extends Ml {
|
|
|
10272
10272
|
if (a.data.aPatternWidth) return Fl.patternWidth;
|
|
10273
10273
|
const t = x.polygonPatternFileWidth, n = x.polygonPatternFileHeight;
|
|
10274
10274
|
if (!t && !n) return Fl.patternWidth;
|
|
10275
|
-
const [i, r] = this.
|
|
10275
|
+
const [i, r] = this.wr(Ll, t, n, u ? d : 1, m, p);
|
|
10276
10276
|
return c.set(e, i, r);
|
|
10277
10277
|
}
|
|
10278
10278
|
}), Object.defineProperty(g, "uvOffset", {
|
|
@@ -10311,7 +10311,7 @@ class Rl extends Ml {
|
|
|
10311
10311
|
u && (S.IS_VT = 1), M.setDefines(S), M.setLocalTransform(n), M.properties.symbolIndex = l,
|
|
10312
10312
|
M;
|
|
10313
10313
|
}
|
|
10314
|
-
|
|
10314
|
+
gr(t, e, n, i, r) {
|
|
10315
10315
|
if (!(e = e && e.geometry)) return;
|
|
10316
10316
|
const s = e.properties.features;
|
|
10317
10317
|
if (za(s)) return;
|
|
@@ -10334,13 +10334,13 @@ class Rl extends Ml {
|
|
|
10334
10334
|
const t = l(null, y.feature.properties);
|
|
10335
10335
|
t && (s = Dl.set(t[0], t[1]));
|
|
10336
10336
|
}
|
|
10337
|
-
const [o, a] = this.
|
|
10337
|
+
const [o, a] = this.wr(Ll, e, d, n, s, r);
|
|
10338
10338
|
v = p[2 * t] = o, x = p[2 * t + 1] = a;
|
|
10339
10339
|
} else v = p[2 * t] = 0, x = p[2 * t + 1] = 0;
|
|
10340
10340
|
}
|
|
10341
10341
|
e.data.aPatternWidth = p;
|
|
10342
10342
|
}
|
|
10343
|
-
|
|
10343
|
+
vr(t, e, n, i) {
|
|
10344
10344
|
if (!(e = e && e.geometry)) return;
|
|
10345
10345
|
const r = e.properties.features;
|
|
10346
10346
|
if (za(r)) return;
|
|
@@ -10367,7 +10367,7 @@ class Rl extends Ml {
|
|
|
10367
10367
|
}
|
|
10368
10368
|
e.data.aPatternOffset = f;
|
|
10369
10369
|
}
|
|
10370
|
-
|
|
10370
|
+
yr(t, e, n, i) {
|
|
10371
10371
|
if (!(e = e && e.geometry)) return;
|
|
10372
10372
|
const r = e.properties.features;
|
|
10373
10373
|
if (za(r)) return;
|
|
@@ -10431,7 +10431,7 @@ class Rl extends Ml {
|
|
|
10431
10431
|
} ];
|
|
10432
10432
|
}
|
|
10433
10433
|
paint(t) {
|
|
10434
|
-
this.isShadowIncludeChanged(t) && (this.shader.dispose(), this.
|
|
10434
|
+
this.isShadowIncludeChanged(t) && (this.shader.dispose(), this.Ar(t)), super.paint(t);
|
|
10435
10435
|
}
|
|
10436
10436
|
isEnableTileStencil(e) {
|
|
10437
10437
|
const n = "VectorTileLayer" === this.layer.getJSONType(), i = this.layer instanceof t.TileLayer;
|
|
@@ -10484,7 +10484,7 @@ class Rl extends Ml {
|
|
|
10484
10484
|
offset: this.getPolygonOffset()
|
|
10485
10485
|
}
|
|
10486
10486
|
};
|
|
10487
|
-
if (this.
|
|
10487
|
+
if (this.Ar(t, s), this.pickingFBO) {
|
|
10488
10488
|
const t = [];
|
|
10489
10489
|
this.picking = [ new r.FBORayPicking(this.renderer, {
|
|
10490
10490
|
vert: Sl,
|
|
@@ -10499,7 +10499,7 @@ class Rl extends Ml {
|
|
|
10499
10499
|
}, this.pickingFBO, this.getMap()) ];
|
|
10500
10500
|
}
|
|
10501
10501
|
}
|
|
10502
|
-
|
|
10502
|
+
Ar(t, e) {
|
|
10503
10503
|
const n = [], i = [ {
|
|
10504
10504
|
name: "projViewModelMatrix",
|
|
10505
10505
|
type: "function",
|
|
@@ -10524,7 +10524,7 @@ class Rl extends Ml {
|
|
|
10524
10524
|
};
|
|
10525
10525
|
return this.setIncludeUniformValues(i, e), i;
|
|
10526
10526
|
}
|
|
10527
|
-
|
|
10527
|
+
wr(t, e, n, i, r, s) {
|
|
10528
10528
|
let o, a;
|
|
10529
10529
|
const l = this.getMap();
|
|
10530
10530
|
if (e) {
|
|
@@ -10557,7 +10557,7 @@ class Vl extends Ml {
|
|
|
10557
10557
|
Array.isArray(i) && (3 === i.length && i.push(1), t.lineDashColor = i.map((t => 255 * t)));
|
|
10558
10558
|
}
|
|
10559
10559
|
isAnimating() {
|
|
10560
|
-
if (this.
|
|
10560
|
+
if (this.Mr) return !0;
|
|
10561
10561
|
const t = this.getSymbols(), e = this.sceneConfig.trailAnimation;
|
|
10562
10562
|
if (e && e.enable) return !0;
|
|
10563
10563
|
for (let e = 0; e < t.length; e++) if (t[e].linePatternFile && t[e].linePatternAnimSpeed) return !0;
|
|
@@ -10603,23 +10603,23 @@ class Vl extends Ml {
|
|
|
10603
10603
|
});
|
|
10604
10604
|
d.setLocalTransform(n), d.positionMatrix = this.getAltitudeOffsetMatrix();
|
|
10605
10605
|
const p = {};
|
|
10606
|
-
return u && (p.HAS_PATTERN = 1), d.properties.symbolIndex = s, this.
|
|
10606
|
+
return u && (p.HAS_PATTERN = 1), d.properties.symbolIndex = s, this.Sr(d, p), i.data.aColor && (p.HAS_COLOR = 1),
|
|
10607
10607
|
i.data.aStrokeColor && (p.HAS_STROKE_COLOR = 1), this.setMeshDefines(p, i, a), i.data.aAltitude && (p.HAS_ALTITUDE = 1),
|
|
10608
10608
|
d.setDefines(p), d;
|
|
10609
10609
|
}
|
|
10610
10610
|
addMesh(...t) {
|
|
10611
|
-
delete this.
|
|
10611
|
+
delete this.Mr;
|
|
10612
10612
|
const e = t[0];
|
|
10613
10613
|
Array.isArray(e) ? e.forEach((t => {
|
|
10614
|
-
this.
|
|
10615
|
-
})) : this.
|
|
10614
|
+
this._r(t);
|
|
10615
|
+
})) : this._r(e), super.addMesh(...t);
|
|
10616
10616
|
}
|
|
10617
|
-
|
|
10617
|
+
_r(t) {
|
|
10618
10618
|
if (!t.geometry.aLineWidth && t.material.get("lineWidth") <= 0 || !t.geometry.aOpacity && t.material.get("lineOpacity") <= 0) return;
|
|
10619
10619
|
const e = t.defines;
|
|
10620
|
-
this.
|
|
10620
|
+
this.Sr(t, e), t.setDefines(e), t.geometry.properties.hasPatternAnim && (this.Mr = 1);
|
|
10621
10621
|
}
|
|
10622
|
-
|
|
10622
|
+
Sr(t, e) {
|
|
10623
10623
|
const n = t.geometry, i = this.getSymbol(t.properties.symbolIndex);
|
|
10624
10624
|
n.data.aDasharray || Array.isArray(i.lineDasharray) && i.lineDasharray.reduce(((t, e) => t + e), 0) > 0 ? (e.HAS_DASHARRAY = 1,
|
|
10625
10625
|
n.data.aDasharray && (e.HAS_DASHARRAY_ATTR = 1), n.data.aDashColor && (e.HAS_DASHARRAY_COLOR = 1)) : e.HAS_DASHARRAY && delete e.HAS_DASHARRAY;
|
|
@@ -10734,7 +10734,7 @@ class Vl extends Ml {
|
|
|
10734
10734
|
} ];
|
|
10735
10735
|
}
|
|
10736
10736
|
updateSceneConfig(t) {
|
|
10737
|
-
t.trailAnimation && this.createShader(this.
|
|
10737
|
+
t.trailAnimation && this.createShader(this.Pr);
|
|
10738
10738
|
}
|
|
10739
10739
|
init(t) {
|
|
10740
10740
|
const e = this.regl;
|
|
@@ -10752,7 +10752,7 @@ class Vl extends Ml {
|
|
|
10752
10752
|
}, this.pickingFBO, this.getMap()) ]);
|
|
10753
10753
|
}
|
|
10754
10754
|
createShader(t) {
|
|
10755
|
-
this.
|
|
10755
|
+
this.Pr = t;
|
|
10756
10756
|
const e = [], n = {};
|
|
10757
10757
|
this.fillIncludes(n, e, t), this.sceneConfig.trailAnimation && this.sceneConfig.trailAnimation.enable && (n.HAS_TRAIL = 1);
|
|
10758
10758
|
const i = [];
|
|
@@ -10884,7 +10884,7 @@ class Ul extends Vl {
|
|
|
10884
10884
|
return this.createShapeFnTypeConfigs(t, e);
|
|
10885
10885
|
}
|
|
10886
10886
|
createShader(t) {
|
|
10887
|
-
this.
|
|
10887
|
+
this.Pr = t;
|
|
10888
10888
|
const e = [], n = {};
|
|
10889
10889
|
this.fillIncludes(n, e, t), this.sceneConfig.trailAnimation && this.sceneConfig.trailAnimation.enable && (n.HAS_TRAIL = 1);
|
|
10890
10890
|
const i = [];
|
|
@@ -10972,63 +10972,63 @@ class th extends Ml {
|
|
|
10972
10972
|
return super.addMesh(t, e, n);
|
|
10973
10973
|
}
|
|
10974
10974
|
startMeshCollision(t) {
|
|
10975
|
-
const {meshKey: e} = t.properties, {renderer: n} = this.
|
|
10975
|
+
const {meshKey: e} = t.properties, {renderer: n} = this.kr, i = n.isForeground(t instanceof Bl ? t.meshes[0] : t);
|
|
10976
10976
|
if (t.properties.isForeground = i, t instanceof Bl && t.meshes.length) for (let e = 0; e < t.meshes.length; e++) t.meshes[e].properties.isForeground = i;
|
|
10977
|
-
this.
|
|
10977
|
+
this.Tr = performance.now(), this.Ir = this.Fr(), this.Cr = this.Or(e);
|
|
10978
10978
|
}
|
|
10979
10979
|
endMeshCollision(e) {
|
|
10980
|
-
const n = this.
|
|
10981
|
-
if (this.
|
|
10980
|
+
const n = this.Er.tags[e];
|
|
10981
|
+
if (this.Ir && n && this.Cr) {
|
|
10982
10982
|
const e = this.getMap();
|
|
10983
|
-
this.
|
|
10984
|
-
n.anchor0 = e.containerPointToCoord(this.
|
|
10983
|
+
this.Dr || (this.Dr = new t.Coordinate(0, 0), this.Lr = new t.Coordinate(0, 0)),
|
|
10984
|
+
n.anchor0 = e.containerPointToCoord(this.Rr, this.Dr), n.anchor1 = e.containerPointToCoord(this.Hr, this.Lr),
|
|
10985
10985
|
n.anchor0.z = e.getZoom(), n.anchor0.width = e.width, n.anchor0.height = e.height,
|
|
10986
10986
|
n.anchor0.pitch = e.getPitch();
|
|
10987
10987
|
}
|
|
10988
|
-
this.getMap().collisionFrameTime += performance.now() - this.
|
|
10988
|
+
this.getMap().collisionFrameTime += performance.now() - this.Tr;
|
|
10989
10989
|
}
|
|
10990
|
-
|
|
10991
|
-
const e = this.getMap(), n = e.getZoom(), i = e.getPitch(), [r, s] = this.
|
|
10992
|
-
return !r || !s || r.z !== n || r.width !== e.width || r.height !== e.height || r.pitch !== i || r.distanceTo(this.
|
|
10990
|
+
Or(t) {
|
|
10991
|
+
const e = this.getMap(), n = e.getZoom(), i = e.getPitch(), [r, s] = this.zr(t);
|
|
10992
|
+
return !r || !s || r.z !== n || r.width !== e.width || r.height !== e.height || r.pitch !== i || r.distanceTo(this.Rr) > 3 || s.distanceTo(this.Hr) > 3;
|
|
10993
10993
|
}
|
|
10994
|
-
|
|
10994
|
+
Nr() {
|
|
10995
10995
|
const e = this.getMap();
|
|
10996
|
-
this.
|
|
10997
|
-
delete this.
|
|
10996
|
+
this.Vr = {}, this.Rr = new t.Point(e.width / 3, e.height / 2), this.Hr = new t.Point(2 * e.width / 3, e.height / 2),
|
|
10997
|
+
delete this.Ir, this.Er || (this.Er = {
|
|
10998
10998
|
tags: {}
|
|
10999
|
-
}), this.
|
|
10999
|
+
}), this.kr = {
|
|
11000
11000
|
layer: this.layer,
|
|
11001
11001
|
renderer: this.layer.getRenderer(),
|
|
11002
11002
|
frameTimestamp: this.layer.getRenderer().getFrameTimestamp(),
|
|
11003
11003
|
map: this.getMap(),
|
|
11004
11004
|
zoom: e.getZoom(),
|
|
11005
|
-
collisionTags: this.
|
|
11005
|
+
collisionTags: this.Er.tags,
|
|
11006
11006
|
isEnableUniquePlacement: this.isEnableUniquePlacement()
|
|
11007
11007
|
};
|
|
11008
11008
|
}
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
const n = this.
|
|
11009
|
+
Ur() {}
|
|
11010
|
+
jr(t, e) {
|
|
11011
|
+
const n = this.Er;
|
|
11012
11012
|
return n.tags[t] && n.tags[t][e];
|
|
11013
11013
|
}
|
|
11014
|
-
|
|
11015
|
-
const i = this.
|
|
11014
|
+
Gr(t, e, n) {
|
|
11015
|
+
const i = this.Er;
|
|
11016
11016
|
i.tags[t] = i.tags[t] || [], i.tags[t][e] = n;
|
|
11017
11017
|
}
|
|
11018
|
-
|
|
11018
|
+
Fr() {
|
|
11019
11019
|
const t = this.getMap();
|
|
11020
11020
|
if (!t.isInteracting()) return !0;
|
|
11021
11021
|
const e = this.layer.options.collisionFrameLimit;
|
|
11022
11022
|
return t.collisionFrameTime <= e;
|
|
11023
11023
|
}
|
|
11024
|
-
|
|
11025
|
-
const e = "__meshAnchorKey".trim(), n = this.
|
|
11024
|
+
zr(t) {
|
|
11025
|
+
const e = "__meshAnchorKey".trim(), n = this.Er.tags[t];
|
|
11026
11026
|
if (n && n.anchor0) {
|
|
11027
11027
|
const {anchor0: t, anchor1: i} = n, r = t[e] = t[e] || t.x + "," + t.y, s = i[e] = i[e] || i.x + "," + i.y;
|
|
11028
|
-
let o = this.
|
|
11028
|
+
let o = this.Vr[r], a = this.Vr[s];
|
|
11029
11029
|
if (!o || !a) {
|
|
11030
11030
|
const e = this.getMap();
|
|
11031
|
-
o = this.
|
|
11031
|
+
o = this.Vr[r] = e.coordToContainerPoint(t), a = this.Vr[s] = e.coordToContainerPoint(i);
|
|
11032
11032
|
}
|
|
11033
11033
|
return o.z = t.z, ql[0] = o, ql[1] = a, o.width = t.width, o.height = t.height,
|
|
11034
11034
|
ql;
|
|
@@ -11036,14 +11036,14 @@ class th extends Ml {
|
|
|
11036
11036
|
return ql[0] = ql[1] = null, ql;
|
|
11037
11037
|
}
|
|
11038
11038
|
updateBoxCollisionFading(t, e, n, i, r) {
|
|
11039
|
-
const {layer: s, renderer: o, zoom: a, collisionTags: l, isEnableUniquePlacement: h} = this.
|
|
11040
|
-
if (h && this.
|
|
11039
|
+
const {layer: s, renderer: o, zoom: a, collisionTags: l, isEnableUniquePlacement: h} = this.kr, {meshKey: u, isForeground: c} = e.properties;
|
|
11040
|
+
if (h && this.Wr(u, r)) return !1;
|
|
11041
11041
|
const f = n.length;
|
|
11042
11042
|
let d = l[u] && l[u][r];
|
|
11043
|
-
const p = d, m = this.
|
|
11043
|
+
const p = d, m = this.Br && d;
|
|
11044
11044
|
if (!(m && 0 !== d.collides) && t) {
|
|
11045
11045
|
const t = m && 0 === d.collides;
|
|
11046
|
-
if (this.
|
|
11046
|
+
if (this.Ir || t) if ((this.Cr || d && d.z !== a) && (d = null), d) {
|
|
11047
11047
|
if (d.boxes && d.boxes.length) {
|
|
11048
11048
|
const {boxes: t, isAllowOverlap: e} = d;
|
|
11049
11049
|
let n = 0;
|
|
@@ -11067,19 +11067,19 @@ class th extends Ml {
|
|
|
11067
11067
|
}, d.boxes.length = 0, d.z = a;
|
|
11068
11068
|
let t = 0;
|
|
11069
11069
|
for (let e = 0; e < f; e++) {
|
|
11070
|
-
const {mesh: s, allElements: o, boxCount: a, start: l, end: h} = n[e], u = this
|
|
11070
|
+
const {mesh: s, allElements: o, boxCount: a, start: l, end: h} = n[e], u = this.$r(s, o, a, l, h, i, r);
|
|
11071
11071
|
u.isAllowOverlap && (d.isAllowOverlap = 1), 0 === t && (t = u.collides), u.boxes && d.boxes.push(...u.boxes);
|
|
11072
11072
|
}
|
|
11073
|
-
d.collides = t, this.
|
|
11073
|
+
d.collides = t, this.Gr(u, r, d);
|
|
11074
11074
|
}
|
|
11075
11075
|
}
|
|
11076
11076
|
let y = t && d && 0 === d.collides, g = 1, v = !1;
|
|
11077
11077
|
if (this.sceneConfig.fading) {
|
|
11078
|
-
const t = this
|
|
11079
|
-
if (this.
|
|
11080
|
-
c ? (g > 0 && (y = !0), v = this.isBoxFading(e, r), v && this.setToRedraw()) : y || (this.
|
|
11078
|
+
const t = this.Xr(e);
|
|
11079
|
+
if (this.Yr) t[r] = y ? 1 : -1; else if (c && delete e.Jr, g = this.qr(c, y, t, r),
|
|
11080
|
+
c ? (g > 0 && (y = !0), v = this.isBoxFading(e, r), v && this.setToRedraw()) : y || (this.Kr(t, r),
|
|
11081
11081
|
g = 0), y) {
|
|
11082
|
-
const n = e.
|
|
11082
|
+
const n = e.Jr;
|
|
11083
11083
|
if (n && 1 === g && t[r] > 0) {
|
|
11084
11084
|
let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
|
|
11085
11085
|
Yo(e) && (e = $l), Yo(t) && (t = Yl);
|
|
@@ -11091,7 +11091,7 @@ class th extends Ml {
|
|
|
11091
11091
|
if (d && s.options.debugCollision && this.addCollisionDebugBox(d.boxes, d.collides ? 0 : 1),
|
|
11092
11092
|
y || v) {
|
|
11093
11093
|
const {mesh: t, start: e} = n[0], i = this.getSymbol(t.properties.symbolIndex);
|
|
11094
|
-
!this.
|
|
11094
|
+
!this.Zr(i, t, e) && d && d.boxes && this.Qr(d.boxes, t);
|
|
11095
11095
|
}
|
|
11096
11096
|
if (y) {
|
|
11097
11097
|
const t = Jl[0] = 255 * g;
|
|
@@ -11107,9 +11107,9 @@ class th extends Ml {
|
|
|
11107
11107
|
}
|
|
11108
11108
|
setCollisionOpacity(t, e, n, i, r) {
|
|
11109
11109
|
const s = e[i], o = e[r - 1];
|
|
11110
|
-
this.
|
|
11110
|
+
this.ts(t, n, s, o);
|
|
11111
11111
|
}
|
|
11112
|
-
|
|
11112
|
+
ts(t, e, n, i) {
|
|
11113
11113
|
const {aOpacity: r} = t.geometry.properties;
|
|
11114
11114
|
if (!r) return;
|
|
11115
11115
|
const s = n;
|
|
@@ -11120,38 +11120,38 @@ class th extends Ml {
|
|
|
11120
11120
|
}
|
|
11121
11121
|
}
|
|
11122
11122
|
isBoxFading(t, e) {
|
|
11123
|
-
const {frameTimestamp: n} = this.
|
|
11123
|
+
const {frameTimestamp: n} = this.kr;
|
|
11124
11124
|
let i = this.sceneConfig.fadingDuration;
|
|
11125
11125
|
Yo(i) && (i = $l);
|
|
11126
|
-
return n - Math.abs(this
|
|
11126
|
+
return n - Math.abs(this.Xr(t)[e]) < i;
|
|
11127
11127
|
}
|
|
11128
|
-
|
|
11129
|
-
const a = this.getSymbol(t.properties.symbolIndex), l = this.
|
|
11128
|
+
$r(t, e, n, i, r, s, o) {
|
|
11129
|
+
const a = this.getSymbol(t.properties.symbolIndex), l = this.Zr(a, t, e[i]), h = this.es(a, t, e[i]);
|
|
11130
11130
|
if (!this.isEnableCollision() || l && h) return Kl;
|
|
11131
11131
|
const u = this.isBoxCollides(t, e, n, i, r, s, o);
|
|
11132
11132
|
return h && (u.collides = 0, u.isAllowOverlap = 1), u;
|
|
11133
11133
|
}
|
|
11134
|
-
|
|
11134
|
+
Zr(t, e, n) {
|
|
11135
11135
|
if (!this.isEnableCollision()) return !0;
|
|
11136
11136
|
const i = e.geometry.properties.aOverlap;
|
|
11137
11137
|
if (!i) return 1 == +t[this.propIgnorePlacement];
|
|
11138
11138
|
const r = i[n], s = r % 8;
|
|
11139
11139
|
return r < 2 ? 1 == +t[this.propIgnorePlacement] : s % 2;
|
|
11140
11140
|
}
|
|
11141
|
-
|
|
11141
|
+
es(t, e, n) {
|
|
11142
11142
|
if (!this.isEnableCollision()) return !0;
|
|
11143
11143
|
const i = e.geometry.properties.aOverlap;
|
|
11144
11144
|
if (!i) return 1 == +t[this.propAllowOverlap];
|
|
11145
11145
|
const r = i[n], s = r >> 2;
|
|
11146
11146
|
return r < 2 ? 1 == +t[this.propAllowOverlap] : s % 2;
|
|
11147
11147
|
}
|
|
11148
|
-
|
|
11148
|
+
Qr(t) {
|
|
11149
11149
|
if (Array.isArray(t[0])) for (let e = 0; e < t.length; e++) this.insertCollisionBox(t[e]); else this.insertCollisionBox(t);
|
|
11150
11150
|
}
|
|
11151
|
-
|
|
11151
|
+
qr(t, e, n, i) {
|
|
11152
11152
|
let {fadingDuration: r, fadeInDelay: s, fadeOutDelay: o} = this.sceneConfig;
|
|
11153
11153
|
Yo(r) && (r = $l), Yo(s) && (s = Xl), Yo(o) && (o = Yl);
|
|
11154
|
-
const {frameTimestamp: a} = this.
|
|
11154
|
+
const {frameTimestamp: a} = this.kr;
|
|
11155
11155
|
let l = n[i], h = e ? 1 : 0;
|
|
11156
11156
|
if (!l) return e && t && (n[i] = a + s), 0;
|
|
11157
11157
|
if (a < Math.abs(l) && (!e && l > 0 || e && l < 0)) {
|
|
@@ -11162,31 +11162,31 @@ class th extends Ml {
|
|
|
11162
11162
|
h = (a - l) / r) : (l > 0 && (n[i] = l = -(a + o)), h = 1 - (a + l) / r), (h < 0 || h > 1) && (h = $o(h, 0, 1)),
|
|
11163
11163
|
h;
|
|
11164
11164
|
}
|
|
11165
|
-
|
|
11166
|
-
this.
|
|
11165
|
+
Xr(t) {
|
|
11166
|
+
this.ns || (this.ns = {});
|
|
11167
11167
|
const {meshKey: e} = t.properties;
|
|
11168
|
-
if (!this.
|
|
11169
|
-
const {frameTimestamp: t} = this.
|
|
11170
|
-
this.
|
|
11168
|
+
if (!this.ns[e]) {
|
|
11169
|
+
const {frameTimestamp: t} = this.kr;
|
|
11170
|
+
this.ns[e] = {
|
|
11171
11171
|
timestamp: t
|
|
11172
11172
|
};
|
|
11173
11173
|
}
|
|
11174
|
-
return this.
|
|
11174
|
+
return this.ns[e];
|
|
11175
11175
|
}
|
|
11176
|
-
|
|
11177
|
-
if (!this.
|
|
11176
|
+
rs(t) {
|
|
11177
|
+
if (!this.ss) return void (this.ss = t);
|
|
11178
11178
|
const e = this.scene.getMeshes();
|
|
11179
11179
|
if (e && e.length) {
|
|
11180
11180
|
for (let n = 0; n < e.length; n++) {
|
|
11181
|
-
const i = this
|
|
11182
|
-
i.timestamp < this.
|
|
11181
|
+
const i = this.Xr(e[n]);
|
|
11182
|
+
i.timestamp < this.ss ? delete e[n]._fading_timestamps : i.timestamp = t;
|
|
11183
11183
|
}
|
|
11184
|
-
this.
|
|
11184
|
+
this.ss = t;
|
|
11185
11185
|
}
|
|
11186
11186
|
}
|
|
11187
|
-
|
|
11187
|
+
Kr(t, e) {
|
|
11188
11188
|
if (!t) return;
|
|
11189
|
-
const {frameTimestamp: n} = this.
|
|
11189
|
+
const {frameTimestamp: n} = this.kr;
|
|
11190
11190
|
let {fadingDuration: i} = this.sceneConfig;
|
|
11191
11191
|
Yo(i) && (i = $l), t[e] = -(n - i - 1);
|
|
11192
11192
|
}
|
|
@@ -11194,17 +11194,17 @@ class th extends Ml {
|
|
|
11194
11194
|
if (t) {
|
|
11195
11195
|
if (Array.isArray(t)) for (let e = 0; e < t.length; e++) {
|
|
11196
11196
|
const n = t[e].properties.meshKey;
|
|
11197
|
-
this.
|
|
11197
|
+
this.Er && delete this.Er.tags[n], this.ns && delete this.ns[n];
|
|
11198
11198
|
} else {
|
|
11199
11199
|
const e = t.properties.meshKey;
|
|
11200
|
-
this.
|
|
11200
|
+
this.Er && delete this.Er.tags[e], this.ns && delete this.ns[e];
|
|
11201
11201
|
}
|
|
11202
11202
|
super.deleteMesh(t, e);
|
|
11203
11203
|
}
|
|
11204
11204
|
}
|
|
11205
11205
|
delete(t) {
|
|
11206
|
-
this.
|
|
11207
|
-
delete this.
|
|
11206
|
+
this.os && (this.os.geometry.dispose(), this.ls.dispose(), this.os.dispose(), delete this.os,
|
|
11207
|
+
delete this.ls, delete this.hs), delete this.Er, super.delete(t);
|
|
11208
11208
|
}
|
|
11209
11209
|
isCollides(t) {
|
|
11210
11210
|
const e = this.layer, n = e.getMap(), i = n.getDevicePixelRatio();
|
|
@@ -11215,17 +11215,17 @@ class th extends Ml {
|
|
|
11215
11215
|
insertCollisionBox(t) {
|
|
11216
11216
|
const e = this.layer, n = e.getCollisionIndex(), i = this.sceneConfig.collisionBufferSize || e.options.collisionBufferSize || 0;
|
|
11217
11217
|
let r = t;
|
|
11218
|
-
i && (r = t.
|
|
11218
|
+
i && (r = t.us = t.us || [], t = rh(r, t, i)), n.insertBox(r);
|
|
11219
11219
|
}
|
|
11220
11220
|
addCollisionDebugBox(t, e) {
|
|
11221
11221
|
if (t && t.length) if (Array.isArray(t[0])) for (let n = 0; n < t.length; n++) {
|
|
11222
11222
|
const i = t[n];
|
|
11223
|
-
this.
|
|
11224
|
-
} else this.
|
|
11223
|
+
this.cs(i, e);
|
|
11224
|
+
} else this.cs(t, e);
|
|
11225
11225
|
}
|
|
11226
|
-
|
|
11226
|
+
cs(t, e) {
|
|
11227
11227
|
if (!t) return;
|
|
11228
|
-
const n = this.
|
|
11228
|
+
const n = this.fs = this.fs || {
|
|
11229
11229
|
aPosition: [],
|
|
11230
11230
|
aVisible: [],
|
|
11231
11231
|
indices: []
|
|
@@ -11238,36 +11238,36 @@ class th extends Ml {
|
|
|
11238
11238
|
n.indices.push(o, o + 1, o + 1, o + 2, o + 2, o + 3, o + 3, o);
|
|
11239
11239
|
}
|
|
11240
11240
|
updateCollision(t) {
|
|
11241
|
-
super.updateCollision(t), this.
|
|
11242
|
-
this.
|
|
11243
|
-
(this.getMap().isZooming() || this.
|
|
11241
|
+
super.updateCollision(t), this.Nr(), this.ds(), this.ps && this.ps.length && (this.ys(),
|
|
11242
|
+
this.ps && (this.setToRedraw(), this.scene.addMesh(this.ps)));
|
|
11243
|
+
(this.getMap().isZooming() || this.ps && this.ps.length) && (this.gs(), this.vs(this.scene.getMeshes()));
|
|
11244
11244
|
}
|
|
11245
11245
|
paint(t) {
|
|
11246
11246
|
const e = super.paint(t);
|
|
11247
|
-
return this.
|
|
11247
|
+
return this.xs(t), !1 === this.Ir && this.setToRedraw(), e;
|
|
11248
11248
|
}
|
|
11249
11249
|
shouldIgnoreBackground() {
|
|
11250
|
-
return !this.getMap().isZooming() && !this.
|
|
11250
|
+
return !this.getMap().isZooming() && !this.ps;
|
|
11251
11251
|
}
|
|
11252
|
-
|
|
11252
|
+
ds() {
|
|
11253
11253
|
const t = this.getMap(), e = t.isZooming();
|
|
11254
|
-
if (!e && this.
|
|
11254
|
+
if (!e && this.Br) {
|
|
11255
11255
|
const t = this.layer.getRenderer();
|
|
11256
|
-
this.
|
|
11257
|
-
} else e && !this.
|
|
11258
|
-
if (e) this.
|
|
11256
|
+
this.ps = this.scene.getMeshes().filter((e => !t.isForeground(e) && !e.properties.isLinePlacement));
|
|
11257
|
+
} else e && !this.Br && (this.bs = t.getResolution());
|
|
11258
|
+
if (e) this.ws && (clearTimeout(this.ws), delete this.Yr, delete this.ws), this.Yr = this.bs && t.getResolution() > this.bs; else if (this.Br && !this.ws) {
|
|
11259
11259
|
let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
|
|
11260
|
-
Yo(t) && (t = Yl), Yo(e) && (e = $l), this.
|
|
11261
|
-
delete this.
|
|
11260
|
+
Yo(t) && (t = Yl), Yo(e) && (e = $l), this.ws = setTimeout((() => {
|
|
11261
|
+
delete this.Yr, delete this.ws;
|
|
11262
11262
|
}), t + e + 1);
|
|
11263
11263
|
}
|
|
11264
|
-
this.
|
|
11264
|
+
this.Br = e;
|
|
11265
11265
|
}
|
|
11266
|
-
|
|
11267
|
-
if (!this.
|
|
11268
|
-
this.
|
|
11269
|
-
const {aPosition: e, aVisible: n, indices: i} = this.
|
|
11270
|
-
if (!this.
|
|
11266
|
+
xs(t) {
|
|
11267
|
+
if (!this.fs || !this.layer.options.debugCollision) return;
|
|
11268
|
+
this.hs || this.As();
|
|
11269
|
+
const {aPosition: e, aVisible: n, indices: i} = this.fs;
|
|
11270
|
+
if (!this.os) {
|
|
11271
11271
|
const t = new r.Geometry({
|
|
11272
11272
|
aPosition: [],
|
|
11273
11273
|
aVisible: []
|
|
@@ -11275,24 +11275,24 @@ class th extends Ml {
|
|
|
11275
11275
|
positionSize: 2,
|
|
11276
11276
|
primitive: "lines"
|
|
11277
11277
|
});
|
|
11278
|
-
this.
|
|
11278
|
+
this.os = new r.Mesh(t), this.Ms = new r.Scene, this.Ms.addMesh(this.os);
|
|
11279
11279
|
}
|
|
11280
|
-
const s = this.
|
|
11280
|
+
const s = this.os.geometry;
|
|
11281
11281
|
s.updateData("aPosition", new Float32Array(e)), s.updateData("aVisible", new Uint8Array(n)),
|
|
11282
|
-
s.setElements(i), this.
|
|
11282
|
+
s.setElements(i), this.hs.render(this.ls, {
|
|
11283
11283
|
size: [ this.canvas.width, this.canvas.height ]
|
|
11284
|
-
}, this.
|
|
11284
|
+
}, this.Ms, this.getRenderFBO(t)), delete this.fs;
|
|
11285
11285
|
}
|
|
11286
|
-
|
|
11286
|
+
As() {
|
|
11287
11287
|
const t = this.regl;
|
|
11288
|
-
this.
|
|
11288
|
+
this.hs = new r.Renderer(t);
|
|
11289
11289
|
const e = this.canvas, n = {
|
|
11290
11290
|
x: 0,
|
|
11291
11291
|
y: 0,
|
|
11292
11292
|
width: () => e ? e.width : 1,
|
|
11293
11293
|
height: () => e ? e.height : 1
|
|
11294
11294
|
};
|
|
11295
|
-
this.
|
|
11295
|
+
this.ls = new r.MeshShader({
|
|
11296
11296
|
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}",
|
|
11297
11297
|
frag: "precision mediump float;\nvarying vec4 vColor;\nvoid main() {\n gl_FragColor = vec4(vColor.rgb, .5);\n}",
|
|
11298
11298
|
uniforms: [ "size" ],
|
|
@@ -11312,17 +11312,17 @@ class th extends Ml {
|
|
|
11312
11312
|
}
|
|
11313
11313
|
});
|
|
11314
11314
|
}
|
|
11315
|
-
|
|
11315
|
+
ys() {
|
|
11316
11316
|
let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
|
|
11317
11317
|
Yo(t) && (t = Yl), Yo(e) && (e = $l);
|
|
11318
11318
|
const n = this.layer.getRenderer(), i = n.getCurrentTileZoom(), r = n.getFrameTimestamp(), s = [];
|
|
11319
|
-
for (let o = 0; o < this.
|
|
11320
|
-
const a = this.
|
|
11321
|
-
!a.
|
|
11319
|
+
for (let o = 0; o < this.ps.length; o++) {
|
|
11320
|
+
const a = this.ps[o], l = a.properties.tile;
|
|
11321
|
+
!a.Jr && n.isBackTile(l.id) && (a.Jr = r);
|
|
11322
11322
|
const h = l.z - i > 0 ? 2 * (l.z - i) - 1 : 2 * (i - l.z);
|
|
11323
|
-
a.properties.level = h, n.isForeground(a) || a.
|
|
11323
|
+
a.properties.level = h, n.isForeground(a) || a.Jr && r - a.Jr > t + e ? delete a.Jr : s.push(a);
|
|
11324
11324
|
}
|
|
11325
|
-
delete this.
|
|
11325
|
+
delete this.ps, s.length && (this.ps = s);
|
|
11326
11326
|
}
|
|
11327
11327
|
isEnableCollision() {
|
|
11328
11328
|
return this.layer.options.collision && !!this.sceneConfig.collision;
|
|
@@ -11333,7 +11333,7 @@ class th extends Ml {
|
|
|
11333
11333
|
isMeshUniquePlaced(t) {
|
|
11334
11334
|
return this.isMeshIterable(t);
|
|
11335
11335
|
}
|
|
11336
|
-
|
|
11336
|
+
gs() {
|
|
11337
11337
|
if (!this.isEnableUniquePlacement()) return;
|
|
11338
11338
|
const t = this.scene.getMeshes(), e = (t, e, n, i) => {
|
|
11339
11339
|
const {start: r, end: s} = e[0], o = t.geometry.properties, a = o.elements;
|
|
@@ -11353,29 +11353,29 @@ class th extends Ml {
|
|
|
11353
11353
|
this.isMeshUniquePlaced(i) && this.forEachBox(i, e);
|
|
11354
11354
|
}
|
|
11355
11355
|
}
|
|
11356
|
-
|
|
11356
|
+
vs(t) {
|
|
11357
11357
|
if (!this.isEnableUniquePlacement()) return;
|
|
11358
11358
|
const e = this.getMap().getZoom();
|
|
11359
|
-
let n = !this.
|
|
11360
|
-
if (!n) for (let e = 0; e < t.length; e++) if (!this.
|
|
11359
|
+
let n = !this.Ss || this._s !== e;
|
|
11360
|
+
if (!n) for (let e = 0; e < t.length; e++) if (!this.Ss[t[e].properties.meshKey]) {
|
|
11361
11361
|
n = !0;
|
|
11362
11362
|
break;
|
|
11363
11363
|
}
|
|
11364
11364
|
if (!n) return;
|
|
11365
|
-
this.
|
|
11365
|
+
this._s = e, this.Ps = {}, this.Ss = {}, t = t.sort(ih);
|
|
11366
11366
|
const i = this.getMap().getGLScale(), r = {};
|
|
11367
11367
|
for (let e = 0; e < t.length; e++) {
|
|
11368
11368
|
const n = t[e];
|
|
11369
11369
|
if (!n.geometry) continue;
|
|
11370
11370
|
const {meshKey: s} = n.properties;
|
|
11371
|
-
this.
|
|
11371
|
+
this.Ss[s] = 1;
|
|
11372
11372
|
const {uniquePlacements: o} = n.geometry.properties;
|
|
11373
11373
|
if (o) for (let t = 0; t < o.length; t++) {
|
|
11374
11374
|
if (!o[t]) continue;
|
|
11375
|
-
const {key: e, index: s} = o[t], a = this
|
|
11375
|
+
const {key: e, index: s} = o[t], a = this.Xr(n), l = nh(e, i), h = r[l];
|
|
11376
11376
|
if (h) {
|
|
11377
11377
|
const t = h.length, e = h[t - 3].properties.meshKey, i = h[t - 2], r = h[t - 1];
|
|
11378
|
-
this.
|
|
11378
|
+
this.Ps[e] = this.Ps[e] || {}, this.Ps[e][r] = 1, this.ks(a, s, i, r), h.push(n, a, s);
|
|
11379
11379
|
} else r[l] = [ n, a, s ];
|
|
11380
11380
|
}
|
|
11381
11381
|
}
|
|
@@ -11388,16 +11388,16 @@ class th extends Ml {
|
|
|
11388
11388
|
}
|
|
11389
11389
|
}
|
|
11390
11390
|
}
|
|
11391
|
-
|
|
11391
|
+
ks(t, e, n, i) {
|
|
11392
11392
|
if (void 0 !== n[i]) if (void 0 === t[e]) t[e] = n[i]; else {
|
|
11393
11393
|
let r = t[e];
|
|
11394
11394
|
Math.abs(n[i]) > Math.abs(r) ? t[e] = n[i] : n[i] = t[e];
|
|
11395
11395
|
} else void 0 !== t[e] && (n[i] = t[e]);
|
|
11396
11396
|
}
|
|
11397
|
-
|
|
11398
|
-
return this.
|
|
11397
|
+
Wr(t, e) {
|
|
11398
|
+
return this.Ps && this.Ps[t] && this.Ps[t][e];
|
|
11399
11399
|
}
|
|
11400
|
-
|
|
11400
|
+
Ts(t, e) {
|
|
11401
11401
|
const {symbolIndex: n} = t.properties, i = n.type || 0;
|
|
11402
11402
|
let r = t.properties._collidesBoxes;
|
|
11403
11403
|
r || (r = t.properties._collidesBoxes = []);
|
|
@@ -11415,15 +11415,15 @@ class th extends Ml {
|
|
|
11415
11415
|
}
|
|
11416
11416
|
return s[o];
|
|
11417
11417
|
}
|
|
11418
|
-
|
|
11419
|
-
let e = this.
|
|
11420
|
-
if (e || (e = this.
|
|
11418
|
+
Is(t) {
|
|
11419
|
+
let e = this.Fs;
|
|
11420
|
+
if (e || (e = this.Fs = []), !e[t]) {
|
|
11421
11421
|
e[t] = [];
|
|
11422
11422
|
for (let n = 0; n < t; n++) e[t][n] = {};
|
|
11423
11423
|
}
|
|
11424
11424
|
return e[t];
|
|
11425
11425
|
}
|
|
11426
|
-
|
|
11426
|
+
Cs(t) {
|
|
11427
11427
|
if (!t || !t.geometry) return !0;
|
|
11428
11428
|
if (!t.geometry.properties.glyphAtlas || !t.material.get("isHalo") || t.geometry.data.aTextHaloRadius && t.geometry.properties.hasHalo) return !1;
|
|
11429
11429
|
if (t.geometry.data.aTextHaloRadius && !t.geometry.properties.hasHalo) return !0;
|
|
@@ -11914,7 +11914,7 @@ function Jh(t, e, n, i, r, s, o) {
|
|
|
11914
11914
|
let v = Yh;
|
|
11915
11915
|
const x = 3 * n[r];
|
|
11916
11916
|
g && g[x] !== Lo ? (Yh[0] = g[x], Yh[1] = g[x + 1], Yh[2] = g[x + 2]) : v = tl(Yh, y, o, a.width, a.height);
|
|
11917
|
-
const b = i, {boxes: w, collision: A} = this.
|
|
11917
|
+
const b = i, {boxes: w, collision: A} = this.Ts(e, r);
|
|
11918
11918
|
let M = 0;
|
|
11919
11919
|
if (u || 1 === e.material.uniforms.rotateWithMap || h.textRotation) {
|
|
11920
11920
|
let i = 0;
|
|
@@ -12231,10 +12231,10 @@ function uu(t, e) {
|
|
|
12231
12231
|
if (r.isFitConstant || !r.labelShape || !r.labelShape.length) return;
|
|
12232
12232
|
const s = this.getSymbolDef(e.properties.symbolIndex), o = this.getSymbolDef(n.properties.symbolIndex).textSize;
|
|
12233
12233
|
let a;
|
|
12234
|
-
y(o) && (a = i.
|
|
12234
|
+
y(o) && (a = i.Os ? i.Os : i.Os = g(o));
|
|
12235
12235
|
const l = s.markerTextFitPadding || hu;
|
|
12236
12236
|
let h;
|
|
12237
|
-
y(l) && (h = r.
|
|
12237
|
+
y(l) && (h = r.Es ? r.Es : r.Es = v(l));
|
|
12238
12238
|
const u = t.getZoom(), {fitIcons: c, fitWidthIcons: f, fitHeightIcons: d} = r, {aMarkerWidth: p, aMarkerHeight: m, labelShape: x} = r, b = r.elements || e.elements, {features: w, aPickingId: A} = r, M = (t, e, n, i) => {
|
|
12239
12239
|
const s = x[4 * e], c = x[4 * e + 1], f = x[4 * e + 2], d = x[4 * e + 3];
|
|
12240
12240
|
if (!(s || c || f || d)) return;
|
|
@@ -12289,16 +12289,16 @@ function uu(t, e) {
|
|
|
12289
12289
|
|
|
12290
12290
|
const cu = function(t) {
|
|
12291
12291
|
const e = this.layer.getRenderer();
|
|
12292
|
-
return !this.
|
|
12292
|
+
return !this.Cs(t) && e.isForeground(t) && !!t.geometry.properties.iconAtlas && !t.geometry.properties.isEmpty;
|
|
12293
12293
|
}, fu = function(t) {
|
|
12294
12294
|
const e = this.layer.getRenderer();
|
|
12295
|
-
return !(this.
|
|
12295
|
+
return !(this.Cs(t) || e.isForeground(t) || !t.geometry.properties.iconAtlas || t.geometry.properties.isEmpty);
|
|
12296
12296
|
}, du = function(t) {
|
|
12297
12297
|
const e = this.layer.getRenderer();
|
|
12298
|
-
return !this.
|
|
12298
|
+
return !this.Cs(t) && e.isForeground(t) && !!t.geometry.properties.glyphAtlas;
|
|
12299
12299
|
}, pu = function(t) {
|
|
12300
12300
|
const e = this.layer.getRenderer();
|
|
12301
|
-
return !this.
|
|
12301
|
+
return !this.Cs(t) && !e.isForeground(t) && !!t.geometry.properties.glyphAtlas;
|
|
12302
12302
|
}, mu = [], yu = {
|
|
12303
12303
|
collides: -1
|
|
12304
12304
|
}, gu = [ mh, mh ], vu = o.identity([]), xu = [];
|
|
@@ -12309,8 +12309,8 @@ class bu extends th {
|
|
|
12309
12309
|
}
|
|
12310
12310
|
constructor(t, e, n, i, r, s) {
|
|
12311
12311
|
super(t, e, n, i, r, s), this.propAllowOverlap = "markerAllowOverlap", this.propIgnorePlacement = "markerIgnorePlacement",
|
|
12312
|
-
this.
|
|
12313
|
-
this.
|
|
12312
|
+
this.Qi = {}, this.isLabelCollides = Jh.bind(this), this.Ds = cu.bind(this), this.Ls = fu.bind(this),
|
|
12313
|
+
this.Rs = du.bind(this), this.Hs = pu.bind(this), this.zs = [];
|
|
12314
12314
|
}
|
|
12315
12315
|
needToRefreshTerrainTileOnZooming() {
|
|
12316
12316
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
@@ -12326,7 +12326,7 @@ class bu extends th {
|
|
|
12326
12326
|
return super.isTerrainSkin() && this.needToRefreshTerrainTileOnZooming();
|
|
12327
12327
|
}
|
|
12328
12328
|
setTextShaderDefines(t) {
|
|
12329
|
-
this.
|
|
12329
|
+
this.Ns = t;
|
|
12330
12330
|
}
|
|
12331
12331
|
createFnTypeConfig(t, e) {
|
|
12332
12332
|
return {
|
|
@@ -12335,7 +12335,7 @@ class bu extends th {
|
|
|
12335
12335
|
};
|
|
12336
12336
|
}
|
|
12337
12337
|
startFrame(...t) {
|
|
12338
|
-
return this.
|
|
12338
|
+
return this.zs.length = 0, super.startFrame(...t);
|
|
12339
12339
|
}
|
|
12340
12340
|
createGeometry(t, e) {
|
|
12341
12341
|
return t && t.empty && (t.data = {
|
|
@@ -12345,8 +12345,8 @@ class bu extends th {
|
|
|
12345
12345
|
}
|
|
12346
12346
|
postCreateGeometry(t, e) {
|
|
12347
12347
|
const {geometry: n, symbolIndex: i} = t, r = this.getSymbolDef(i), s = this.getFnTypeConfig(i);
|
|
12348
|
-
if (this.
|
|
12349
|
-
su(n, r, s.icon); else if (this.
|
|
12348
|
+
if (this.Vs(n)) n.properties.iconAtlas ? this.drawDebugAtlas(n.properties.iconAtlas) : n.properties.isEmpty = !0,
|
|
12349
|
+
su(n, r, s.icon); else if (this.Us(n) && ia(r)) {
|
|
12350
12350
|
const t = e[e.length - 1];
|
|
12351
12351
|
if (t) {
|
|
12352
12352
|
const {geometry: e, symbolIndex: s} = t;
|
|
@@ -12372,7 +12372,7 @@ class bu extends th {
|
|
|
12372
12372
|
const s = this.isEnableCollision(), o = this.layer, {geometry: a, symbolIndex: l} = t;
|
|
12373
12373
|
a.properties.symbolIndex = l;
|
|
12374
12374
|
const h = this.getSymbolDef(l), u = this.getSymbol(l), c = this.getFnTypeConfig(l), f = [];
|
|
12375
|
-
if (this.
|
|
12375
|
+
if (this.Vs(a)) {
|
|
12376
12376
|
const t = function(t, e, n, i, s, o, a, l) {
|
|
12377
12377
|
if (e.isDisposed() || 0 === e.data.aPosition.length) return null;
|
|
12378
12378
|
const h = e.properties.iconAtlas;
|
|
@@ -12418,25 +12418,25 @@ class bu extends th {
|
|
|
12418
12418
|
}(this.regl, a, e, 0, u, c.icon, o.options.collision, !s, this.isEnableUniquePlacement());
|
|
12419
12419
|
t && (t.positionMatrix = this.getAltitudeOffsetMatrix(), delete t.geometry.properties.glyphAtlas,
|
|
12420
12420
|
f.push(t));
|
|
12421
|
-
} else if (this.
|
|
12421
|
+
} else if (this.Us(a)) {
|
|
12422
12422
|
const t = Vh.call(this, this.regl, a, e, h, u, c.text, o.options.collision, !s, this.isEnableUniquePlacement());
|
|
12423
12423
|
t.length && (t.forEach((t => {
|
|
12424
12424
|
t.positionMatrix = this.getAltitudeOffsetMatrix(), delete t.geometry.properties.iconAtlas;
|
|
12425
12425
|
})), f.push(...t));
|
|
12426
12426
|
}
|
|
12427
|
-
return "line" === a.properties.markerPlacement && this.
|
|
12427
|
+
return "line" === a.properties.markerPlacement && this.js(a, i), "line" === a.properties.markerPlacement && f.forEach((t => t.properties.isLinePlacement = !0)),
|
|
12428
12428
|
this.prepareCollideIndex(a), f;
|
|
12429
12429
|
}
|
|
12430
|
-
|
|
12430
|
+
js(e, n) {
|
|
12431
12431
|
const i = this.layer instanceof t.TileLayer, {collideIds: r} = e.properties, s = new Uint16Array(r.length);
|
|
12432
|
-
if (this.
|
|
12432
|
+
if (this.Vs(e)) {
|
|
12433
12433
|
let t = 0;
|
|
12434
12434
|
for (let e = 0; e < r.length; e += nu) s.fill(t++, e, e + nu);
|
|
12435
12435
|
e.properties.collideIds = s, e.properties.uniqueCollideIds = sa(s, !i), n.markerCollideMap = {
|
|
12436
12436
|
old: r,
|
|
12437
12437
|
new: s
|
|
12438
12438
|
};
|
|
12439
|
-
} else if (this.
|
|
12439
|
+
} else if (this.Us(e)) {
|
|
12440
12440
|
const {collideIds: t, aCount: r} = e.properties;
|
|
12441
12441
|
if (!r) return;
|
|
12442
12442
|
if (n.markerCollideMap) {
|
|
@@ -12463,7 +12463,7 @@ class bu extends th {
|
|
|
12463
12463
|
if (this.isEnableCollision() && t.length > 0) {
|
|
12464
12464
|
const e = new Bl(t);
|
|
12465
12465
|
e.properties.uniqueCollideIds = t[0].geometry.properties.uniqueCollideIds, e.properties.meshKey = t[0].properties.meshKey,
|
|
12466
|
-
e.properties.level = t[0].properties.level, this.
|
|
12466
|
+
e.properties.level = t[0].properties.level, this.zs.push(e);
|
|
12467
12467
|
}
|
|
12468
12468
|
for (let e = 0; e < t.length; e++) {
|
|
12469
12469
|
if (!this.isMeshIterable(t[e])) continue;
|
|
@@ -12486,31 +12486,31 @@ class bu extends th {
|
|
|
12486
12486
|
if (!this.isEnableCollision()) return;
|
|
12487
12487
|
super.updateCollision(t);
|
|
12488
12488
|
const e = this.scene.getMeshes();
|
|
12489
|
-
e && e.length ? (this.
|
|
12489
|
+
e && e.length ? (this.Gs(t.timestamp), this.zs = [], this.Ur()) : this.Ur();
|
|
12490
12490
|
}
|
|
12491
12491
|
callCurrentTileShader(t, e) {
|
|
12492
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
12493
|
-
this.
|
|
12492
|
+
this.shader.filter = e.sceneFilter ? [ this.Ds, e.sceneFilter ] : this.Ds, this.callRenderer(this.shader, t, e),
|
|
12493
|
+
this.Ws.filter = e.sceneFilter ? [ this.Rs, e.sceneFilter ] : this.Rs, this.callRenderer(this.Ws, t, e);
|
|
12494
12494
|
}
|
|
12495
12495
|
callBackgroundTileShader(t, e) {
|
|
12496
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
12497
|
-
this.
|
|
12496
|
+
this.shader.filter = e.sceneFilter ? [ this.Ls, e.sceneFilter ] : this.Ls, this.callRenderer(this.shader, t, e),
|
|
12497
|
+
this.Ws.filter = e.sceneFilter ? [ this.Hs, e.sceneFilter ] : this.Hs, this.callRenderer(this.Ws, t, e);
|
|
12498
12498
|
}
|
|
12499
12499
|
isMeshIterable(t) {
|
|
12500
12500
|
return t && t.geometry && !t.geometry.properties.isEmpty && t.material && !t.material.get("isHalo") && this.isMeshVisible(t) && !(this.shouldIgnoreBackground() && !this.layer.getRenderer().isForeground(t));
|
|
12501
12501
|
}
|
|
12502
|
-
|
|
12502
|
+
Gs() {
|
|
12503
12503
|
if (!this.isEnableCollision()) return;
|
|
12504
|
-
let t = this.
|
|
12505
|
-
t && t.length && this.
|
|
12504
|
+
let t = this.zs;
|
|
12505
|
+
t && t.length && this.Bs(t);
|
|
12506
12506
|
}
|
|
12507
|
-
|
|
12507
|
+
$s(t, e, n, i) {
|
|
12508
12508
|
return this.updateBoxCollisionFading(!0, t, e, n, i);
|
|
12509
12509
|
}
|
|
12510
12510
|
isEnableUniquePlacement() {
|
|
12511
12511
|
return this.isEnableCollision() && !0 === this.sceneConfig.uniquePlacement;
|
|
12512
12512
|
}
|
|
12513
|
-
|
|
12513
|
+
Bs(t) {
|
|
12514
12514
|
const e = this.layer.getRenderer();
|
|
12515
12515
|
t = t.sort(wu);
|
|
12516
12516
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -12525,12 +12525,12 @@ class bu extends th {
|
|
|
12525
12525
|
const s = e.isForeground(i.meshes[0]);
|
|
12526
12526
|
if (this.shouldIgnoreBackground() && !s) continue;
|
|
12527
12527
|
const o = i.properties.meshKey;
|
|
12528
|
-
this.startMeshCollision(i), this
|
|
12528
|
+
this.startMeshCollision(i), this.Xs(i), this.forEachBox(i, this.$s), this.Ys(i),
|
|
12529
12529
|
this.endMeshCollision(o);
|
|
12530
|
-
for (let t = 0; t < i.meshes.length; t++) this.
|
|
12530
|
+
for (let t = 0; t < i.meshes.length; t++) this.Js(i.meshes[t]);
|
|
12531
12531
|
}
|
|
12532
12532
|
}
|
|
12533
|
-
|
|
12533
|
+
Js(t) {
|
|
12534
12534
|
const e = t && t.geometry && t.geometry.properties.aOpacity;
|
|
12535
12535
|
e && e.dirty && (t.geometry.updateData("aOpacity", e), e.dirty = !1);
|
|
12536
12536
|
}
|
|
@@ -12540,9 +12540,9 @@ class bu extends th {
|
|
|
12540
12540
|
const i = {
|
|
12541
12541
|
boxIndex: 0
|
|
12542
12542
|
}, r = n.length;
|
|
12543
|
-
for (let s = 0; s < r; s++) this.
|
|
12543
|
+
for (let s = 0; s < r; s++) this.qs(t, n[s], e, i);
|
|
12544
12544
|
}
|
|
12545
|
-
|
|
12545
|
+
qs(t, e, n, i) {
|
|
12546
12546
|
const r = this.getMap(), {collideBoxIndex: s} = t.meshes[0].geometry.properties;
|
|
12547
12547
|
if (!(s && s[e])) return !1;
|
|
12548
12548
|
const a = o.multiply(mu, r.projViewMatrix, t.meshes[0].localTransform);
|
|
@@ -12555,7 +12555,7 @@ class bu extends th {
|
|
|
12555
12555
|
n[e] && c++;
|
|
12556
12556
|
}
|
|
12557
12557
|
if (!c) return !1;
|
|
12558
|
-
l = this.
|
|
12558
|
+
l = this.Is(c);
|
|
12559
12559
|
let f = 0;
|
|
12560
12560
|
for (let t = 0; t < u.length; t++) {
|
|
12561
12561
|
const n = u[t];
|
|
@@ -12571,16 +12571,16 @@ class bu extends th {
|
|
|
12571
12571
|
l[f].allElements = r, f++;
|
|
12572
12572
|
}
|
|
12573
12573
|
if (!h) return !1;
|
|
12574
|
-
return n.call(this, t, l, a, i.boxIndex++) && this.
|
|
12574
|
+
return n.call(this, t, l, a, i.boxIndex++) && this.Ks(t, e), !0;
|
|
12575
12575
|
}
|
|
12576
|
-
|
|
12576
|
+
Xs(t) {
|
|
12577
12577
|
const e = t.meshes;
|
|
12578
12578
|
for (let t = 0; t < e.length; t++) {
|
|
12579
12579
|
const n = e[t], i = n && n.geometry;
|
|
12580
12580
|
i && (i.properties.visElemts.count = 0);
|
|
12581
12581
|
}
|
|
12582
12582
|
}
|
|
12583
|
-
|
|
12583
|
+
Ks(t, e) {
|
|
12584
12584
|
const n = t.meshes;
|
|
12585
12585
|
for (let t = 0; t < n.length; t++) {
|
|
12586
12586
|
const i = n[t];
|
|
@@ -12595,7 +12595,7 @@ class bu extends th {
|
|
|
12595
12595
|
a.count = c;
|
|
12596
12596
|
}
|
|
12597
12597
|
}
|
|
12598
|
-
|
|
12598
|
+
Ys(t) {
|
|
12599
12599
|
const e = t.meshes;
|
|
12600
12600
|
for (let t = 0; t < e.length; t++) {
|
|
12601
12601
|
const n = e[t], i = n && n.geometry;
|
|
@@ -12605,13 +12605,13 @@ class bu extends th {
|
|
|
12605
12605
|
}
|
|
12606
12606
|
}
|
|
12607
12607
|
isBoxCollides(t, e, n, i, r, s) {
|
|
12608
|
-
if (this.
|
|
12608
|
+
if (this.Us(t.geometry)) return Jh.call(this, 0, t, e, n, i, r, s);
|
|
12609
12609
|
if (t.geometry.properties.isEmpty) return yu;
|
|
12610
12610
|
const {aTerrainAltitude: o} = t.geometry.properties;
|
|
12611
12611
|
if (o) {
|
|
12612
12612
|
if (o[2 * e[i]] === Ro) return yu;
|
|
12613
12613
|
}
|
|
12614
|
-
const a = this.getMap(), {boxes: l, collision: h} = this.
|
|
12614
|
+
const a = this.getMap(), {boxes: l, collision: h} = this.Ts(t, i);
|
|
12615
12615
|
let u = 0, c = 0, f = 0;
|
|
12616
12616
|
for (let n = i; n < r; n += eu) {
|
|
12617
12617
|
const i = l[f] = l[f] || [];
|
|
@@ -12692,8 +12692,8 @@ class bu extends th {
|
|
|
12692
12692
|
} ],
|
|
12693
12693
|
extraCommandProps: n
|
|
12694
12694
|
}), this.shader.version = 300;
|
|
12695
|
-
const {uniforms: i, extraCommandProps: s} = Gh.call(this, e, this.sceneConfig), a = this.
|
|
12696
|
-
if (this.
|
|
12695
|
+
const {uniforms: i, extraCommandProps: s} = Gh.call(this, e, this.sceneConfig), a = this.Ns || {};
|
|
12696
|
+
if (this.Ws = new r.MeshShader({
|
|
12697
12697
|
vert: Qh,
|
|
12698
12698
|
frag: tu,
|
|
12699
12699
|
uniforms: i,
|
|
@@ -12747,15 +12747,15 @@ class bu extends th {
|
|
|
12747
12747
|
};
|
|
12748
12748
|
}
|
|
12749
12749
|
getUniqueEntryKey(t, e) {
|
|
12750
|
-
if (!this.
|
|
12750
|
+
if (!this.Us(t.geometry)) return null;
|
|
12751
12751
|
const {elements: n} = t.geometry.properties;
|
|
12752
12752
|
return qh(t, n[e]);
|
|
12753
12753
|
}
|
|
12754
|
-
|
|
12754
|
+
Vs(t) {
|
|
12755
12755
|
const {symbolIndex: e} = t.properties;
|
|
12756
12756
|
return 0 === e.type;
|
|
12757
12757
|
}
|
|
12758
|
-
|
|
12758
|
+
Us(t) {
|
|
12759
12759
|
const {symbolIndex: e} = t.properties;
|
|
12760
12760
|
return 1 === e.type;
|
|
12761
12761
|
}
|
|
@@ -12815,16 +12815,16 @@ var Iu = "#define SHADER_NAME TEXT_LINE\n#ifdef HAS_ALTITUDE\nattribute vec2 aPo
|
|
|
12815
12815
|
|
|
12816
12816
|
const Fu = function(t) {
|
|
12817
12817
|
const e = this.layer.getRenderer();
|
|
12818
|
-
return !this.
|
|
12818
|
+
return !this.Cs(t) && e.isTileNearCamera(t) && "line" !== t.geometry.properties.textPlacement;
|
|
12819
12819
|
}, Cu = function(t) {
|
|
12820
12820
|
const e = this.layer.getRenderer();
|
|
12821
|
-
return !this.
|
|
12821
|
+
return !this.Cs(t) && !e.isForeground(t) && "line" !== t.geometry.properties.textPlacement;
|
|
12822
12822
|
}, Ou = function(t) {
|
|
12823
12823
|
const e = this.layer.getRenderer();
|
|
12824
|
-
return !this.
|
|
12824
|
+
return !this.Cs(t) && e.isTileNearCamera(t) && "line" === t.geometry.properties.textPlacement;
|
|
12825
12825
|
}, Eu = function(t) {
|
|
12826
12826
|
const e = this.layer.getRenderer(), n = t.properties.tile.z, i = e.getCurrentTileZoom();
|
|
12827
|
-
return !this.
|
|
12827
|
+
return !this.Cs(t) && !e.isForeground(t) && "line" === t.geometry.properties.textPlacement && n < i;
|
|
12828
12828
|
}, Du = [ 0, 0, 3 ], Lu = [], Ru = [], Hu = [], zu = [], Nu = [], Vu = [], Uu = [], ju = [], Gu = [ 1, -1 ], Wu = new Int16Array(3), Bu = [], $u = [], Xu = [], Yu = [], Ju = [], qu = [], Ku = [], Zu = {}, Qu = {}, tc = {}, ec = [], nc = [], ic = o.identity([]), rc = [];
|
|
12829
12829
|
|
|
12830
12830
|
class sc extends th {
|
|
@@ -12833,8 +12833,8 @@ class sc extends th {
|
|
|
12833
12833
|
}
|
|
12834
12834
|
constructor(t, e, n, i, r, s) {
|
|
12835
12835
|
super(t, e, n, i, r, s), this.propAllowOverlap = "textAllowOverlap", this.propIgnorePlacement = "textIgnorePlacement",
|
|
12836
|
-
this.colorCache = {}, this.
|
|
12837
|
-
this.
|
|
12836
|
+
this.colorCache = {}, this.Zs = Fu.bind(this), this.Qs = Cu.bind(this), this.eo = Ou.bind(this),
|
|
12837
|
+
this.no = Eu.bind(this), this.isLabelCollides = Jh.bind(this), this.io();
|
|
12838
12838
|
}
|
|
12839
12839
|
prepareRender(...t) {
|
|
12840
12840
|
super.prepareRender(...t);
|
|
@@ -12846,34 +12846,34 @@ class sc extends th {
|
|
|
12846
12846
|
}
|
|
12847
12847
|
}
|
|
12848
12848
|
updateSymbol(...t) {
|
|
12849
|
-
this.
|
|
12849
|
+
this.ro = void 0, this.so = void 0;
|
|
12850
12850
|
const e = super.updateSymbol(...t);
|
|
12851
|
-
return this.
|
|
12851
|
+
return this.io(), e;
|
|
12852
12852
|
}
|
|
12853
12853
|
isTerrainVector() {
|
|
12854
12854
|
if (!super.isTerrainSkin()) return !1;
|
|
12855
|
-
if (void 0 !== this.
|
|
12855
|
+
if (void 0 !== this.ro) return this.ro;
|
|
12856
12856
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
12857
|
-
if ("map" !== this.symbolDef[t].textPitchAlignment) return this.
|
|
12857
|
+
if ("map" !== this.symbolDef[t].textPitchAlignment) return this.ro = !0, !0;
|
|
12858
12858
|
}
|
|
12859
|
-
return this.
|
|
12859
|
+
return this.ro = !1, !1;
|
|
12860
12860
|
}
|
|
12861
12861
|
isTerrainSkin() {
|
|
12862
12862
|
if (!super.isTerrainSkin()) return !1;
|
|
12863
|
-
if (void 0 !== this.
|
|
12863
|
+
if (void 0 !== this.so) return this.so;
|
|
12864
12864
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
12865
12865
|
const e = this.symbolDef[t].textPitchAlignment;
|
|
12866
|
-
if ("map" === e || y(e) || nr(e)) return this.
|
|
12866
|
+
if ("map" === e || y(e) || nr(e)) return this.so = !0, !0;
|
|
12867
12867
|
}
|
|
12868
|
-
return this.
|
|
12868
|
+
return this.so = !1, !1;
|
|
12869
12869
|
}
|
|
12870
|
-
|
|
12871
|
-
this.
|
|
12870
|
+
io() {
|
|
12871
|
+
this.oo = [];
|
|
12872
12872
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
12873
12873
|
const e = this.symbolDef[t];
|
|
12874
12874
|
if (nr(e.textName)) {
|
|
12875
12875
|
const n = er(e.textName, "string");
|
|
12876
|
-
this.
|
|
12876
|
+
this.oo[t] = (t, e) => {
|
|
12877
12877
|
let i;
|
|
12878
12878
|
Zu.zoom = t, Qu.properties = e;
|
|
12879
12879
|
try {
|
|
@@ -12883,7 +12883,7 @@ class sc extends th {
|
|
|
12883
12883
|
}
|
|
12884
12884
|
return i;
|
|
12885
12885
|
};
|
|
12886
|
-
} else y(e.textName) && (this.
|
|
12886
|
+
} else y(e.textName) && (this.oo[t] = g(e.textName));
|
|
12887
12887
|
}
|
|
12888
12888
|
}
|
|
12889
12889
|
shouldDeleteMeshOnUpdateSymbol(t) {
|
|
@@ -12912,7 +12912,7 @@ class sc extends th {
|
|
|
12912
12912
|
s.properties.symbolIndex = o;
|
|
12913
12913
|
const a = this.getSymbol(o), l = this.getSymbolDef(o), h = this.getFnTypeConfig(o), u = Vh.call(this, this.regl, s, e, l, a, h, this.layer.options.collision, !i, r);
|
|
12914
12914
|
if (u.length) {
|
|
12915
|
-
"line" === s.properties.textPlacement ? this.
|
|
12915
|
+
"line" === s.properties.textPlacement ? this.ao = !0 : this.lo = !0;
|
|
12916
12916
|
}
|
|
12917
12917
|
return u.forEach((t => {
|
|
12918
12918
|
t.positionMatrix = this.getAltitudeOffsetMatrix(), t.properties.tileVectorTransform = n;
|
|
@@ -12921,21 +12921,21 @@ class sc extends th {
|
|
|
12921
12921
|
updateCollision(t) {
|
|
12922
12922
|
super.updateCollision(t);
|
|
12923
12923
|
const e = this.scene.getMeshes();
|
|
12924
|
-
e && e.length ? (this.
|
|
12924
|
+
e && e.length ? (this.ho = {}, this.uo(t.timestamp), this.Ur()) : this.Ur();
|
|
12925
12925
|
}
|
|
12926
12926
|
callCurrentTileShader(t, e) {
|
|
12927
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
12928
|
-
this.
|
|
12927
|
+
this.shader.filter = e.sceneFilter ? [ this.Zs, e.sceneFilter ] : this.Zs, this.callRenderer(this.shader, t, e),
|
|
12928
|
+
this.co.filter = e.sceneFilter ? [ this.eo, e.sceneFilter ] : this.eo, this.callRenderer(this.co, t, e);
|
|
12929
12929
|
}
|
|
12930
12930
|
callBackgroundTileShader(t, e) {
|
|
12931
|
-
this.shader.filter = e.sceneFilter ? [ this.
|
|
12932
|
-
this.
|
|
12931
|
+
this.shader.filter = e.sceneFilter ? [ this.Qs, e.sceneFilter ] : this.Qs, this.callRenderer(this.shader, t, e),
|
|
12932
|
+
this.co.filter = e.sceneFilter ? [ this.no, e.sceneFilter ] : this.no, this.callRenderer(this.co, t, e);
|
|
12933
12933
|
}
|
|
12934
12934
|
callRenderer(t, e, n) {
|
|
12935
12935
|
n && n.isRenderingTerrain && y(this.symbolDef.textPitchAlignment) && (n.isRenderingTerrainSkin ? e.textPitchFilter = 1 : e.textPitchFilter = 2),
|
|
12936
12936
|
super.callRenderer(t, e, n);
|
|
12937
12937
|
}
|
|
12938
|
-
|
|
12938
|
+
uo() {
|
|
12939
12939
|
let t = this.scene.getMeshes();
|
|
12940
12940
|
if (!t || !t.length) return;
|
|
12941
12941
|
const e = -this.getMap().getBearing() * Math.PI / 180, n = f.fromRotation(Hu, e), i = (t, e, n, i) => {
|
|
@@ -12960,7 +12960,7 @@ class sc extends th {
|
|
|
12960
12960
|
const h = o.properties.meshKey;
|
|
12961
12961
|
if ("line" === a.properties.textPlacement) {
|
|
12962
12962
|
if (!a.properties.line) continue;
|
|
12963
|
-
r && this.startMeshCollision(o), this.
|
|
12963
|
+
r && this.startMeshCollision(o), this.fo(o, n);
|
|
12964
12964
|
const {aOffset: t, aOpacity: e} = a.properties;
|
|
12965
12965
|
t.dirty && (a.updateData("aOffset", t), t.dirty = !1), e && e.dirty && (a.updateData("aOpacity", e),
|
|
12966
12966
|
e.dirty = !1), r && this.endMeshCollision(h);
|
|
@@ -12985,7 +12985,7 @@ class sc extends th {
|
|
|
12985
12985
|
getUniqueEntryKey(t, e) {
|
|
12986
12986
|
return qh(t, e);
|
|
12987
12987
|
}
|
|
12988
|
-
|
|
12988
|
+
fo(t, e) {
|
|
12989
12989
|
const n = this.getMap(), i = t.geometry, r = i.properties;
|
|
12990
12990
|
let s = r.line;
|
|
12991
12991
|
if (!s) return;
|
|
@@ -12993,16 +12993,16 @@ class sc extends th {
|
|
|
12993
12993
|
if (!c) {
|
|
12994
12994
|
const e = o.multiply(Lu, n.projViewMatrix, t.localTransform), i = s.id + "-" + e.join();
|
|
12995
12995
|
let a;
|
|
12996
|
-
this.
|
|
12997
|
-
s = this.
|
|
12996
|
+
this.ho[i] ? s = this.ho[i] : (a = r.projectedLine = r.projectedLine || new Array(s.length),
|
|
12997
|
+
s = this.do(a, s, e, n.width, n.height), this.ho[i] = a);
|
|
12998
12998
|
}
|
|
12999
12999
|
const d = this.isEnableCollision(), p = i.properties.visElemts = i.properties.visElemts || new f.constructor(f.length), m = i.properties.visCache = i.properties.visCache || [];
|
|
13000
13000
|
d && (p.count = 0);
|
|
13001
13001
|
const y = void 0 === h || !n.isInteracting() || Math.abs(a - h) > 2 || Math.abs(l - u) > 2;
|
|
13002
|
-
y && (this.
|
|
13002
|
+
y && (this.Cr = !0), this.forEachBox(t, ((t, n, i, r) => {
|
|
13003
13003
|
const {start: o, end: a} = n[0];
|
|
13004
13004
|
let l = m[r];
|
|
13005
|
-
if ((void 0 === l || y) && (l = this.
|
|
13005
|
+
if ((void 0 === l || y) && (l = this.po(t, f, o, a, s, i, c ? e : null, r)), m[r] = l,
|
|
13006
13006
|
d && (l = this.updateBoxCollisionFading(l, t, n, i, r), l)) {
|
|
13007
13007
|
let t = p.count;
|
|
13008
13008
|
for (let e = o; e < a; e++) p[t++] = f[e];
|
|
@@ -13012,7 +13012,7 @@ class sc extends th {
|
|
|
13012
13012
|
const g = t.geometry.properties.aAltitude;
|
|
13013
13013
|
g && g.dirty && (i.updateData("aAltitude", g), g.dirty = !1), !d || p.count === f.length && i.count === p.count || i.setElements(p, p.count);
|
|
13014
13014
|
}
|
|
13015
|
-
|
|
13015
|
+
do(t, e, n, i, r) {
|
|
13016
13016
|
const s = function(t, e, n, i, r) {
|
|
13017
13017
|
for (let s = 0; s < e.length; s += 3) h.set(Qa, e[s], e[s + 1], e[s + 2], 1), tl(Qa, Qa, n, i, r),
|
|
13018
13018
|
t[s] = Qa[0], t[s + 1] = Qa[1], t[s + 2] = e[s + 2];
|
|
@@ -13023,13 +13023,13 @@ class sc extends th {
|
|
|
13023
13023
|
forEachBox(t, e) {
|
|
13024
13024
|
const n = this.getMap(), i = o.multiply(Lu, n.projViewMatrix, t.properties.tileVectorTransform), {collideIds: r, aCount: s, features: a, elements: l} = t.geometry.properties, h = r;
|
|
13025
13025
|
if (!h) return;
|
|
13026
|
-
const u = this.isEnableUniquePlacement(), c = this.
|
|
13026
|
+
const u = this.isEnableUniquePlacement(), c = this.Is(1);
|
|
13027
13027
|
c[0].allElements = l, c[0].mesh = t;
|
|
13028
13028
|
let f = 0, d = l[0], p = 0, m = h[d];
|
|
13029
13029
|
for (let n = 0; n <= l.length; n += 6) if (d = l[n], h[d] !== m || n === l.length) {
|
|
13030
13030
|
const r = a[m] && a[m].feature;
|
|
13031
13031
|
if (u && this.isMeshUniquePlaced(t) && r && !r.label) {
|
|
13032
|
-
const e = r.properties || {}, {symbolIndex: n} = t.properties, i = Cr(n && this.
|
|
13032
|
+
const e = r.properties || {}, {symbolIndex: n} = t.properties, i = Cr(n && this.oo[n.index] ? this.oo[n.index](t.properties.z, e) : this.getSymbol(t.properties.symbolIndex).textName, e);
|
|
13033
13033
|
r.label = i;
|
|
13034
13034
|
}
|
|
13035
13035
|
const o = n, y = s[l[p]];
|
|
@@ -13038,7 +13038,7 @@ class sc extends th {
|
|
|
13038
13038
|
m = h[d], p = n;
|
|
13039
13039
|
}
|
|
13040
13040
|
}
|
|
13041
|
-
|
|
13041
|
+
po(t, e, n, i, r, a, l) {
|
|
13042
13042
|
const u = this.layer.getRenderer(), f = t.material.uniforms, p = 1 === f.pitchWithMap, m = !p && u.getTerrainHelper && u.getTerrainHelper(), y = this.isEnableCollision(), g = this.getMap(), v = t.geometry, x = v.desc.positionSize, {aShape: b, aOffset: w, aAnchor: A, aAltitude: M, aPitchRotation: S} = v.properties;
|
|
13043
13043
|
let {aProjectedAnchor: _} = v.properties;
|
|
13044
13044
|
_ || (_ = v.properties.aProjectedAnchor = new Array(A.length / x * 3));
|
|
@@ -13058,7 +13058,7 @@ class sc extends th {
|
|
|
13058
13058
|
k && (F = C), _[3 * T] = E[0], _[3 * T + 1] = E[1], _[3 * T + 2] = E[2];
|
|
13059
13059
|
const L = k ? 1 : v.properties.tileExtent / this.layer.getTileSize().width;
|
|
13060
13060
|
let R = !0;
|
|
13061
|
-
const H = e[n], z = e[i - 1], N = P ? P[H] : t.properties.textSize, V = this.
|
|
13061
|
+
const H = e[n], z = e[i - 1], N = P ? P[H] : t.properties.textSize, V = this.mo(t, N, r, H, z, F, zu, L, l);
|
|
13062
13062
|
if (null === V) return oc(w, e, n, i), !1;
|
|
13063
13063
|
const U = z - H <= 3, j = Math.floor(V / 2), G = V % 2;
|
|
13064
13064
|
for (let l = n; l < i; l += 6) {
|
|
@@ -13093,7 +13093,7 @@ class sc extends th {
|
|
|
13093
13093
|
}
|
|
13094
13094
|
return R;
|
|
13095
13095
|
}
|
|
13096
|
-
|
|
13096
|
+
mo(t, e, n, i, r, s, o, a, l) {
|
|
13097
13097
|
const h = r - i <= 3, u = this.getMap();
|
|
13098
13098
|
return h ? 0 : Tu.call(this, qu, Ku, t, e, n, i, r, s, o, a, u.width / u.height, l);
|
|
13099
13099
|
}
|
|
@@ -13106,7 +13106,7 @@ class sc extends th {
|
|
|
13106
13106
|
})) : t.material && delete t.material.uniforms.texture), super.deleteMesh(t, e));
|
|
13107
13107
|
}
|
|
13108
13108
|
delete() {
|
|
13109
|
-
super.delete(), this.
|
|
13109
|
+
super.delete(), this.co.dispose(), delete this.ho, this.yo && this.yo.dispose();
|
|
13110
13110
|
}
|
|
13111
13111
|
isUniqueStencilRefPerTile() {
|
|
13112
13112
|
return !1;
|
|
@@ -13132,7 +13132,7 @@ class sc extends th {
|
|
|
13132
13132
|
let o = n;
|
|
13133
13133
|
if (this.layer.getRenderer().isEnableWorkAround("win-intel-gpu-crash") && (o = Bo({}, n),
|
|
13134
13134
|
o.stencil = Bo({}, n.stencil), o.stencil.enable = !0, o.stencil.func.cmp = "<",
|
|
13135
|
-
o.stencil.func.ref = (t, e) => 2 * e.level + (e.isHalo || 0) + 1), this.
|
|
13135
|
+
o.stencil.func.ref = (t, e) => 2 * e.level + (e.isHalo || 0) + 1), this.co = new r.MeshShader({
|
|
13136
13136
|
vert: Iu,
|
|
13137
13137
|
frag: tu,
|
|
13138
13138
|
uniforms: e,
|
|
@@ -13504,7 +13504,7 @@ class Mc extends bl {
|
|
|
13504
13504
|
}(g, 1, x, y), w = [];
|
|
13505
13505
|
Object.defineProperty(h.uniforms, "uvOrigin", {
|
|
13506
13506
|
enumerable: !0,
|
|
13507
|
-
get: () => this.
|
|
13507
|
+
get: () => this.vo(w, a, i, y, b, l)
|
|
13508
13508
|
}), h.setUniform("uvOffset", [ 0, 0 ]), Object.defineProperty(h.uniforms, "hasAlpha", {
|
|
13509
13509
|
enumerable: !0,
|
|
13510
13510
|
get: () => {
|
|
@@ -13518,7 +13518,7 @@ class Mc extends bl {
|
|
|
13518
13518
|
get: () => v.isForeground(h) ? 0 : A - h.properties.tile.z
|
|
13519
13519
|
}), h.properties.symbolIndex = a, h;
|
|
13520
13520
|
}
|
|
13521
|
-
|
|
13521
|
+
vo(t, e, n, i, r, s) {
|
|
13522
13522
|
if (1 === this.dataConfig.topUVMode) return t[0] = 0, t[1] = 0, t;
|
|
13523
13523
|
const o = this.getMap(), a = this.getSymbol(e).material;
|
|
13524
13524
|
let l = n;
|
|
@@ -13559,23 +13559,23 @@ class Mc extends bl {
|
|
|
13559
13559
|
return s[0] = r * t[0], s[1] = r * t[0], i || (s[0] %= 1, s[1] %= 1), s;
|
|
13560
13560
|
}
|
|
13561
13561
|
needPolygonOffset() {
|
|
13562
|
-
return this.
|
|
13562
|
+
return this.xo;
|
|
13563
13563
|
}
|
|
13564
13564
|
startFrame(...t) {
|
|
13565
|
-
return delete this.
|
|
13565
|
+
return delete this.xo, super.startFrame(...t);
|
|
13566
13566
|
}
|
|
13567
13567
|
addMesh(t, e) {
|
|
13568
13568
|
t.forEach((t => {
|
|
13569
|
-
this.
|
|
13569
|
+
this._r(t, e);
|
|
13570
13570
|
})), super.addMesh(...arguments);
|
|
13571
13571
|
}
|
|
13572
|
-
|
|
13572
|
+
_r(t, e) {
|
|
13573
13573
|
if (null !== e) {
|
|
13574
13574
|
const n = t.localTransform;
|
|
13575
13575
|
0 === e && (e = .01), pc[2] = e, o.fromScaling(n, pc), o.multiply(n, t.properties.tileTransform, n),
|
|
13576
13576
|
t.setLocalTransform(n);
|
|
13577
13577
|
} else t.setLocalTransform(t.properties.tileTransform);
|
|
13578
|
-
t.material !== this.material && t.setMaterial(this.material), t.geometry.properties.maxAltitude <= 0 && (this.
|
|
13578
|
+
t.material !== this.material && t.setMaterial(this.material), t.geometry.properties.maxAltitude <= 0 && (this.xo = !0),
|
|
13579
13579
|
this.getSymbol(t.properties.symbolIndex).ssr ? t.ssr = 1 : t.ssr = 0;
|
|
13580
13580
|
}
|
|
13581
13581
|
deleteMaterial() {
|
|
@@ -13631,9 +13631,9 @@ class Mc extends bl {
|
|
|
13631
13631
|
return !1;
|
|
13632
13632
|
}(this.symbolDef[0].material || {}, t.material));
|
|
13633
13633
|
const i = super.updateSymbol(t, e);
|
|
13634
|
-
return t && t.material && this.
|
|
13634
|
+
return t && t.material && this.bo(t.material), n || i;
|
|
13635
13635
|
}
|
|
13636
|
-
|
|
13636
|
+
er(t, e) {
|
|
13637
13637
|
return Sc(t) !== Sc(e);
|
|
13638
13638
|
}
|
|
13639
13639
|
}
|
|
@@ -13658,7 +13658,7 @@ class Pc extends Mc {
|
|
|
13658
13658
|
e.aExtrusionOpacity = t;
|
|
13659
13659
|
}
|
|
13660
13660
|
const i = new r.Geometry(e, t.indices);
|
|
13661
|
-
return Bo(i.properties, t.properties), this.
|
|
13661
|
+
return Bo(i.properties, t.properties), this.dr(i, t), {
|
|
13662
13662
|
geometry: i,
|
|
13663
13663
|
symbolIndex: {
|
|
13664
13664
|
index: 0
|
|
@@ -13678,14 +13678,14 @@ class Pc extends Mc {
|
|
|
13678
13678
|
return this.shader;
|
|
13679
13679
|
}
|
|
13680
13680
|
delete(t) {
|
|
13681
|
-
this.getMap().off("updatelights", this.
|
|
13681
|
+
this.getMap().off("updatelights", this.wo, this), super.delete(t), this.material.dispose();
|
|
13682
13682
|
}
|
|
13683
13683
|
init() {
|
|
13684
|
-
this.getMap().on("updatelights", this.
|
|
13684
|
+
this.getMap().on("updatelights", this.wo, this);
|
|
13685
13685
|
const t = this.regl;
|
|
13686
13686
|
this.renderer = new r.Renderer(t);
|
|
13687
13687
|
const e = this.getShaderConfig();
|
|
13688
|
-
this.shader = new r.PhongShader(e), this.
|
|
13688
|
+
this.shader = new r.PhongShader(e), this.bo();
|
|
13689
13689
|
const n = {
|
|
13690
13690
|
vert: this.getPickingVert(),
|
|
13691
13691
|
uniforms: [ "projViewMatrix", "modelMatrix", "positionMatrix", {
|
|
@@ -13701,7 +13701,7 @@ class Pc extends Mc {
|
|
|
13701
13701
|
};
|
|
13702
13702
|
this.picking = [ new r.FBORayPicking(this.renderer, n, this.layer.getRenderer().pickingFBO, this.getMap()) ];
|
|
13703
13703
|
}
|
|
13704
|
-
|
|
13704
|
+
wo() {
|
|
13705
13705
|
this.setToRedraw();
|
|
13706
13706
|
}
|
|
13707
13707
|
getShaderConfig() {
|
|
@@ -13750,7 +13750,7 @@ class Pc extends Mc {
|
|
|
13750
13750
|
}
|
|
13751
13751
|
};
|
|
13752
13752
|
}
|
|
13753
|
-
|
|
13753
|
+
bo() {
|
|
13754
13754
|
this.material && this.material.dispose();
|
|
13755
13755
|
const e = this.layer instanceof t.TileLayer, n = this.getSymbols()[0].material, i = {};
|
|
13756
13756
|
for (const t in n) ra(n, t) && (i[t] = n[t], "uvRotation" === t && (i[t] = i[t] * Math.PI / 180,
|
|
@@ -13758,7 +13758,7 @@ class Pc extends Mc {
|
|
|
13758
13758
|
this.material = new r.PhongMaterial(i);
|
|
13759
13759
|
}
|
|
13760
13760
|
getUniformValues(t, e) {
|
|
13761
|
-
const n = t.viewMatrix, i = t.projMatrix, r = t.cameraPosition, s = this.
|
|
13761
|
+
const n = t.viewMatrix, i = t.projMatrix, r = t.cameraPosition, s = this.Ao(), o = Bo({
|
|
13762
13762
|
viewMatrix: n,
|
|
13763
13763
|
projMatrix: i,
|
|
13764
13764
|
cameraPosition: r,
|
|
@@ -13771,7 +13771,7 @@ class Pc extends Mc {
|
|
|
13771
13771
|
getPickingVert() {
|
|
13772
13772
|
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 ";
|
|
13773
13773
|
}
|
|
13774
|
-
|
|
13774
|
+
Ao() {
|
|
13775
13775
|
const t = this.getMap().getLightManager(), e = t && t.getAmbientLight() || {}, n = t && t.getDirectionalLight() || {};
|
|
13776
13776
|
return {
|
|
13777
13777
|
ambientColor: e.color || [ .2, .2, .2 ],
|
|
@@ -13871,21 +13871,21 @@ const {getPBRUniforms: Ic} = r.pbr.PBRUtils;
|
|
|
13871
13871
|
|
|
13872
13872
|
class Fc extends Mc {
|
|
13873
13873
|
constructor(...t) {
|
|
13874
|
-
super(...t), this.
|
|
13874
|
+
super(...t), this.Mo = new r.ResourceLoader(null, this.layer.getURLModifier()),
|
|
13875
13875
|
this.scene.sortFunction = this.sortByCommandKey;
|
|
13876
13876
|
}
|
|
13877
13877
|
supportRenderMode(t) {
|
|
13878
13878
|
return this.getSymbols()[0].ssr ? "fxaa" === t || "fxaaAfterTaa" === t : super.supportRenderMode(t);
|
|
13879
13879
|
}
|
|
13880
13880
|
isAnimating() {
|
|
13881
|
-
const t = this.
|
|
13881
|
+
const t = this.So();
|
|
13882
13882
|
if (t && (t[0] || t[1])) return !0;
|
|
13883
13883
|
}
|
|
13884
13884
|
needToRedraw() {
|
|
13885
|
-
const t = this.
|
|
13885
|
+
const t = this.So();
|
|
13886
13886
|
return !(!t || !t[0] && !t[1]) || super.needToRedraw();
|
|
13887
13887
|
}
|
|
13888
|
-
|
|
13888
|
+
So() {
|
|
13889
13889
|
const t = this.getSymbols()[0];
|
|
13890
13890
|
return t.material && t.material.uvOffsetAnim;
|
|
13891
13891
|
}
|
|
@@ -13898,7 +13898,7 @@ class Fc extends Mc {
|
|
|
13898
13898
|
const n = new r.Geometry(t.data, t.indices, 0, e);
|
|
13899
13899
|
return Bo(n.properties, t.properties), t.vertexColors && (n.properties.vertexColors = t.vertexColors),
|
|
13900
13900
|
this.material.uniforms.normalTexture && !n.data[n.desc.tangentAttribute] && n.data[n.desc.uv0Attribute] && (n.data[n.desc.normalAttribute] || n.createNormal(),
|
|
13901
|
-
n.createTangent()), this.
|
|
13901
|
+
n.createTangent()), this.dr(n, t), {
|
|
13902
13902
|
geometry: n,
|
|
13903
13903
|
symbolIndex: {
|
|
13904
13904
|
index: 0
|
|
@@ -13908,32 +13908,32 @@ class Fc extends Mc {
|
|
|
13908
13908
|
paint(t) {
|
|
13909
13909
|
const e = !!t.shadow;
|
|
13910
13910
|
t.states && t.states.includesChanged && (this.shader.dispose(), delete this.shader,
|
|
13911
|
-
this.
|
|
13911
|
+
this._o.dispose(), delete this._o, this.Ar(t));
|
|
13912
13912
|
let n = !!t.ssr && this.getSymbols()[0].ssr;
|
|
13913
13913
|
const i = this.shader, r = i.shaderDefines;
|
|
13914
13914
|
if (n) {
|
|
13915
13915
|
const e = Bo({}, r, t.ssr.defines);
|
|
13916
13916
|
i.shaderDefines = e;
|
|
13917
13917
|
}
|
|
13918
|
-
if (t.onlyUpdateDepthInTaa && (this.shader = this.
|
|
13918
|
+
if (t.onlyUpdateDepthInTaa && (this.shader = this._o, !n && this.Po && (this.shader = i,
|
|
13919
13919
|
this.setToRedraw(!0))), this.updateIBLDefines(i), super.paint(t), void 0 !== this.shadowCount && e) {
|
|
13920
13920
|
const t = this.scene.getMeshes().length;
|
|
13921
13921
|
this.shadowCount !== t && this.setToRedraw();
|
|
13922
13922
|
}
|
|
13923
|
-
this.shader = i, n && (i.shaderDefines = r), delete this.shadowCount, this.
|
|
13923
|
+
this.shader = i, n && (i.shaderDefines = r), delete this.shadowCount, this.Po = n;
|
|
13924
13924
|
}
|
|
13925
13925
|
updateSceneConfig(t) {
|
|
13926
13926
|
Bo(this.sceneConfig, t), this.setToRedraw();
|
|
13927
13927
|
}
|
|
13928
13928
|
delete() {
|
|
13929
|
-
super.delete(), this.disposeIBLTextures(), this.material.dispose(), this.
|
|
13930
|
-
delete this.
|
|
13929
|
+
super.delete(), this.disposeIBLTextures(), this.material.dispose(), this._o && (this._o.dispose(),
|
|
13930
|
+
delete this._o);
|
|
13931
13931
|
}
|
|
13932
13932
|
init(t) {
|
|
13933
|
-
this.getMap().on("updatelights", this.
|
|
13933
|
+
this.getMap().on("updatelights", this.ko, this), this.createIBLTextures(), this.Pr = this.Pr || t;
|
|
13934
13934
|
const e = this.regl;
|
|
13935
|
-
this.renderer = new r.Renderer(e), this.
|
|
13936
|
-
this.
|
|
13935
|
+
this.renderer = new r.Renderer(e), this.To = this.Io.bind(this), this.Fo = this.disposeCachedTexture.bind(this),
|
|
13936
|
+
this.Co = this.Oo.bind(this), this.bo(), this.Ar(t);
|
|
13937
13937
|
const n = {
|
|
13938
13938
|
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 ",
|
|
13939
13939
|
uniforms: [ {
|
|
@@ -13953,7 +13953,7 @@ class Fc extends Mc {
|
|
|
13953
13953
|
};
|
|
13954
13954
|
this.picking = [ new r.FBORayPicking(this.renderer, n, this.layer.getRenderer().pickingFBO, this.getMap()) ];
|
|
13955
13955
|
}
|
|
13956
|
-
|
|
13956
|
+
Ar(t) {
|
|
13957
13957
|
const e = {
|
|
13958
13958
|
x: 0,
|
|
13959
13959
|
y: 0,
|
|
@@ -13995,20 +13995,20 @@ class Fc extends Mc {
|
|
|
13995
13995
|
}
|
|
13996
13996
|
}, o = {
|
|
13997
13997
|
uniforms: i,
|
|
13998
|
-
defines: this.
|
|
13998
|
+
defines: this.Eo(n),
|
|
13999
13999
|
extraCommandProps: s
|
|
14000
14000
|
};
|
|
14001
14001
|
this.shader = new r.pbr.StandardShader(o), o.frag = "\n precision mediump float;\n #include <gl2_frag>\n void main() {\n glFragColor = vec4(0.0);\n #if __VERSION__ == 100\n gl_FragColor = glFragColor;\n #endif\n }\n ",
|
|
14002
|
-
this.
|
|
14002
|
+
this._o = new r.pbr.StandardShader(o);
|
|
14003
14003
|
}
|
|
14004
|
-
|
|
14004
|
+
Io({resources: t}) {
|
|
14005
14005
|
for (let e = 0; e < t.length; e++) this.addCachedTexture(t[e].url, t[e].data);
|
|
14006
14006
|
this.setToRedraw(!0);
|
|
14007
14007
|
}
|
|
14008
|
-
|
|
14008
|
+
Oo() {
|
|
14009
14009
|
this.setToRedraw(!0);
|
|
14010
14010
|
}
|
|
14011
|
-
|
|
14011
|
+
bo(e) {
|
|
14012
14012
|
if (e) {
|
|
14013
14013
|
const t = this.getSymbols()[0].material;
|
|
14014
14014
|
t && Bo(t, e);
|
|
@@ -14032,14 +14032,14 @@ class Fc extends Mc {
|
|
|
14032
14032
|
url: n,
|
|
14033
14033
|
wrap: "repeat"
|
|
14034
14034
|
}), e.flipY = !i.upsideUpTexture, e.min = "linear mipmap linear", e.mag = "linear",
|
|
14035
|
-
o[t] = new r.Texture2D(e, this.
|
|
14035
|
+
o[t] = new r.Texture2D(e, this.Mo), o[t].once("complete", this.To), o[t].once("disposed", this.Fo),
|
|
14036
14036
|
o[t].promise && this.addCachedTexture(n, o[t].promise), a = !0;
|
|
14037
14037
|
} else o[t] = s[t], "uvRotation" === t && (o[t] = Math.PI * o[t] / 180, n || (o[t] *= -1));
|
|
14038
14038
|
if (void 0 === o.alphaTest && this.getMaterialClazz && (o.alphaTest = .05), this.material) {
|
|
14039
14039
|
for (let t in o) this.material.set(t, o[t]);
|
|
14040
14040
|
this.setToRedraw(!0);
|
|
14041
|
-
} else this.material = new r.pbr.StandardMaterial(o), this.material.once("complete", this.
|
|
14042
|
-
a || this.
|
|
14041
|
+
} else this.material = new r.pbr.StandardMaterial(o), this.material.once("complete", this.Co);
|
|
14042
|
+
a || this.Oo();
|
|
14043
14043
|
}
|
|
14044
14044
|
getShader() {
|
|
14045
14045
|
return this.shader;
|
|
@@ -14048,13 +14048,13 @@ class Fc extends Mc {
|
|
|
14048
14048
|
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = Ic(t, n, i, e && e.ssr, e && e.jitter);
|
|
14049
14049
|
return this.setIncludeUniformValues(r, e), r;
|
|
14050
14050
|
}
|
|
14051
|
-
|
|
14051
|
+
Eo(t) {
|
|
14052
14052
|
return this.hasIBL() ? t.HAS_IBL_LIGHTING = 1 : delete t.HAS_IBL_LIGHTING, t;
|
|
14053
14053
|
}
|
|
14054
|
-
|
|
14054
|
+
ko() {
|
|
14055
14055
|
if (!this.shader) return;
|
|
14056
14056
|
const t = this.shader.shaderDefines;
|
|
14057
|
-
this.
|
|
14057
|
+
this.Eo(t), this.shader.shaderDefines = t;
|
|
14058
14058
|
}
|
|
14059
14059
|
}
|
|
14060
14060
|
|
|
@@ -14079,7 +14079,7 @@ class Ec extends Ml {
|
|
|
14079
14079
|
return this.isAnimating() ? "fxaa" === t || "fxaaAfterTaa" === t : "taa" === t || "fxaa" === t;
|
|
14080
14080
|
}
|
|
14081
14081
|
isAnimating() {
|
|
14082
|
-
if (this.
|
|
14082
|
+
if (this.Mr) return !0;
|
|
14083
14083
|
const t = this.getSymbols();
|
|
14084
14084
|
for (let e = 0; e < t.length; e++) if (t[e].linePatternFile && t[e].linePatternAnimSpeed) return !0;
|
|
14085
14085
|
return !1;
|
|
@@ -14133,7 +14133,7 @@ class Ec extends Ml {
|
|
|
14133
14133
|
super.paint(t);
|
|
14134
14134
|
}
|
|
14135
14135
|
init(t) {
|
|
14136
|
-
this.getMap().on("updatelights", this.
|
|
14136
|
+
this.getMap().on("updatelights", this.ko, this), this.createIBLTextures();
|
|
14137
14137
|
const e = this.regl;
|
|
14138
14138
|
if (this.renderer = new r.Renderer(e), this.createShader(t), this.pickingFBO) {
|
|
14139
14139
|
const t = [];
|
|
@@ -14156,7 +14156,7 @@ class Ec extends Ml {
|
|
|
14156
14156
|
}
|
|
14157
14157
|
}
|
|
14158
14158
|
createShader(t) {
|
|
14159
|
-
this.
|
|
14159
|
+
this.Pr = t;
|
|
14160
14160
|
const e = [], n = {};
|
|
14161
14161
|
this.fillIncludes(n, e, t), e.push({
|
|
14162
14162
|
name: "projViewModelMatrix",
|
|
@@ -14168,7 +14168,7 @@ class Ec extends Ml {
|
|
|
14168
14168
|
}), this.shader = new r.pbr.StandardShader({
|
|
14169
14169
|
vert: Cc,
|
|
14170
14170
|
uniforms: e,
|
|
14171
|
-
defines: this.
|
|
14171
|
+
defines: this.Eo(n),
|
|
14172
14172
|
extraCommandProps: this.getExtraCommandProps()
|
|
14173
14173
|
});
|
|
14174
14174
|
}
|
|
@@ -14283,13 +14283,13 @@ class Ec extends Ml {
|
|
|
14283
14283
|
}
|
|
14284
14284
|
} ];
|
|
14285
14285
|
}
|
|
14286
|
-
|
|
14286
|
+
Eo(t) {
|
|
14287
14287
|
return this.hasIBL() ? t.HAS_IBL_LIGHTING = 1 : delete t.HAS_IBL_LIGHTING, t;
|
|
14288
14288
|
}
|
|
14289
|
-
|
|
14289
|
+
ko() {
|
|
14290
14290
|
if (!this.shader) return;
|
|
14291
14291
|
const t = this.shader.shaderDefines;
|
|
14292
|
-
this.
|
|
14292
|
+
this.Eo(t), this.shader.shaderDefines = t;
|
|
14293
14293
|
}
|
|
14294
14294
|
delete() {
|
|
14295
14295
|
super.delete(), this.disposeIBLTextures(), this.shader && (this.shader.dispose(),
|
|
@@ -14299,15 +14299,15 @@ class Ec extends Ml {
|
|
|
14299
14299
|
|
|
14300
14300
|
const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0, 0 ], Uc = [ 1, 1, 1 ], jc = [], Gc = [ 1, 1, 1, 1 ], Wc = [], Bc = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], $c = t => class extends t {
|
|
14301
14301
|
constructor(t, e, n, i, s, o) {
|
|
14302
|
-
super(t, e, n, i, s, o), this.
|
|
14302
|
+
super(t, e, n, i, s, o), this.Do = !1, this.scene.sortFunction = this.sortByCommandKey;
|
|
14303
14303
|
const a = i.fetchOptions || {};
|
|
14304
|
-
a.referrer = window && window.location.href, this.
|
|
14304
|
+
a.referrer = window && window.location.href, this.Lo = new r.GLTFManager(t, {
|
|
14305
14305
|
fetchOptions: a,
|
|
14306
14306
|
urlModifier: t => {
|
|
14307
14307
|
const n = e.getURLModifier();
|
|
14308
14308
|
return n && n(t) || t;
|
|
14309
14309
|
}
|
|
14310
|
-
}), this.
|
|
14310
|
+
}), this.Ro(), this.Ho();
|
|
14311
14311
|
}
|
|
14312
14312
|
isUniqueStencilRefPerTile() {
|
|
14313
14313
|
return !1;
|
|
@@ -14315,7 +14315,7 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14315
14315
|
isAnimating() {
|
|
14316
14316
|
const t = this.getSymbols();
|
|
14317
14317
|
for (let e = 0; e < t.length; e++) {
|
|
14318
|
-
if (t[e] && this.
|
|
14318
|
+
if (t[e] && this.zo[e] && this.No(e)) return !0;
|
|
14319
14319
|
}
|
|
14320
14320
|
return !1;
|
|
14321
14321
|
}
|
|
@@ -14335,7 +14335,7 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14335
14335
|
return jc;
|
|
14336
14336
|
}
|
|
14337
14337
|
createMesh(t, e, {tileTranslationMatrix: n, tileExtent: i}, {timestamp: a}) {
|
|
14338
|
-
if (!this.
|
|
14338
|
+
if (!this.Do) return null;
|
|
14339
14339
|
const l = this.getMap(), {geometry: h} = t, {positionSize: u, features: c} = h, {aPosition: f, aPickingId: d, aXYRotation: p, aZRotation: m, aAltitude: y} = h.data, g = f.length / u;
|
|
14340
14340
|
if (0 === g) return null;
|
|
14341
14341
|
const v = {
|
|
@@ -14343,7 +14343,7 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14343
14343
|
instance_vectorB: new Float32Array(4 * g),
|
|
14344
14344
|
instance_vectorC: new Float32Array(4 * g),
|
|
14345
14345
|
aPickingId: []
|
|
14346
|
-
}, x = this.
|
|
14346
|
+
}, x = this.Vo(v, n, i, h.properties.z, f, y, p, m, u, d, c);
|
|
14347
14347
|
h.data.aTerrainAltitude && (v.aTerrainAltitude = h.data.aTerrainAltitude);
|
|
14348
14348
|
const b = {};
|
|
14349
14349
|
for (const t in v) b[t] = {
|
|
@@ -14353,22 +14353,22 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14353
14353
|
}),
|
|
14354
14354
|
divisor: 1
|
|
14355
14355
|
};
|
|
14356
|
-
const w = this.
|
|
14356
|
+
const w = this.Uo(), A = this.jo(), M = o.identity([]);
|
|
14357
14357
|
o.scale(M, M, [ A, A, A ]);
|
|
14358
14358
|
const S = [], _ = this.getSymbols();
|
|
14359
14359
|
for (let t = 0; t < _.length; t++) {
|
|
14360
|
-
const e = _[t], i = this.
|
|
14360
|
+
const e = _[t], i = this.Go[t];
|
|
14361
14361
|
if (!i) continue;
|
|
14362
|
-
const u = this.
|
|
14362
|
+
const u = this.zo[t][0], {fixSizeOnZoom: c} = e;
|
|
14363
14363
|
let f = o.identity([]);
|
|
14364
|
-
w || (f = this.
|
|
14364
|
+
w || (f = this.Wo(f));
|
|
14365
14365
|
let d = 0;
|
|
14366
14366
|
i.forEach((t => {
|
|
14367
14367
|
const {geometry: n, nodeMatrix: i} = t;
|
|
14368
14368
|
o.multiply(Wc, Bc, i), o.multiply(Wc, f, Wc);
|
|
14369
14369
|
const r = o.multiply(Wc, M, Wc), s = n.boundingBox.copy();
|
|
14370
14370
|
s.transform(r);
|
|
14371
|
-
const a = this.
|
|
14371
|
+
const a = this.Bo(s, e);
|
|
14372
14372
|
Math.abs(a) > Math.abs(d) && (d = a);
|
|
14373
14373
|
}));
|
|
14374
14374
|
const p = [ 0, 0, d ], m = i.map(((i, m) => {
|
|
@@ -14379,16 +14379,16 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14379
14379
|
picking: !0
|
|
14380
14380
|
});
|
|
14381
14381
|
if (u.hasSkinAnimation()) {
|
|
14382
|
-
const e = this
|
|
14382
|
+
const e = this.$o(T, t, 0)[_];
|
|
14383
14383
|
T.setUniform("jointTexture", e.jointTexture), T.setUniform("jointTextureSize", e.jointTextureSize),
|
|
14384
|
-
T.setUniform("numJoints", e.numJoints), T.setUniform("skinAnimation", +this.
|
|
14384
|
+
T.setUniform("numJoints", e.numJoints), T.setUniform("skinAnimation", +this.No(t)),
|
|
14385
14385
|
T.properties.startTime = a, k.HAS_SKIN = 1;
|
|
14386
14386
|
}
|
|
14387
14387
|
A && (T.setUniform("morphWeights", A), k.HAS_MORPH = 1), T.setUniform("hasAlpha", S.alphaMode && "BLEND" === S.alphaMode.toUpperCase()),
|
|
14388
14388
|
qo(T.uniforms, "polygonFill", e, "markerFill", Gc, Qo(this.colorCache)), qo(T.uniforms, "polygonOpacity", e, "markerOpacity", 1);
|
|
14389
14389
|
const I = [];
|
|
14390
14390
|
T.setPositionMatrix((() => {
|
|
14391
|
-
const e = this
|
|
14391
|
+
const e = this.Xo(t, m, _);
|
|
14392
14392
|
o.multiply(I, Bc, e), o.multiply(I, f, I), o.multiply(I, M, I);
|
|
14393
14393
|
const n = o.identity(Wc);
|
|
14394
14394
|
if (0 !== d && (o.fromTranslation(n, p), o.multiply(I, n, I)), na(c)) {
|
|
@@ -14419,19 +14419,19 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14419
14419
|
positionSize: u
|
|
14420
14420
|
}, S;
|
|
14421
14421
|
}
|
|
14422
|
+
Xo(t, e, n) {
|
|
14423
|
+
const i = t, r = this.Go[i][e];
|
|
14424
|
+
return this.No(t) && this.Yo && this.Yo[n] || r.nodeMatrix;
|
|
14425
|
+
}
|
|
14422
14426
|
$o(t, e, n) {
|
|
14423
|
-
|
|
14424
|
-
|
|
14425
|
-
|
|
14426
|
-
|
|
14427
|
-
|
|
14428
|
-
|
|
14429
|
-
|
|
14430
|
-
|
|
14431
|
-
return i.updateAnimation(n, o || !1, a || 1, h, t.properties.startTime || 0, this.Xo, this.Yo[t.uuid]),
|
|
14432
|
-
this.Yo[t.uuid];
|
|
14433
|
-
}
|
|
14434
|
-
Wo(t, e) {
|
|
14427
|
+
if (!this.zo) return;
|
|
14428
|
+
const i = this.zo[e][0];
|
|
14429
|
+
this.Jo || (this.Jo = {}), this.Yo = {}, this.Jo[t.uuid] || (this.Jo[t.uuid] = {});
|
|
14430
|
+
const r = this.getSymbols()[e], s = this.qo[e], {loop: o, speed: a, animationName: l} = r, h = l || s.animations[0].name;
|
|
14431
|
+
return i.updateAnimation(n, o || !1, a || 1, h, t.properties.startTime || 0, this.Yo, this.Jo[t.uuid]),
|
|
14432
|
+
this.Jo[t.uuid];
|
|
14433
|
+
}
|
|
14434
|
+
Bo(t, e) {
|
|
14435
14435
|
const n = e.anchorZ || "center";
|
|
14436
14436
|
let i = 0;
|
|
14437
14437
|
const r = t.max[2] - t.min[2];
|
|
@@ -14443,21 +14443,21 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14443
14443
|
const i = n.timestamp;
|
|
14444
14444
|
for (let e = 0; e < t.length; e++) {
|
|
14445
14445
|
if (!t[e] || !t[e].geometry) continue;
|
|
14446
|
-
t[e].instancedData.aTerrainAltitude && this.
|
|
14447
|
-
const r = t[e].properties.symbolIndex.index, s = this.
|
|
14448
|
-
s && this
|
|
14446
|
+
t[e].instancedData.aTerrainAltitude && this.Gi(t[e], t[e].instancedData, t[e].properties, 3, n);
|
|
14447
|
+
const r = t[e].properties.symbolIndex.index, s = this.No(r);
|
|
14448
|
+
s && this.$o(t[e], r, i), t[e].setUniform("skinAnimation", +s);
|
|
14449
14449
|
}
|
|
14450
14450
|
return this.scene.addMesh(t), this;
|
|
14451
14451
|
}
|
|
14452
|
-
|
|
14452
|
+
mr(t, e) {
|
|
14453
14453
|
t && t.updateInstancedData && t.updateInstancedData("aTerrainAltitude", e);
|
|
14454
14454
|
}
|
|
14455
14455
|
prepareRender(t) {
|
|
14456
14456
|
const e = this.getSymbols();
|
|
14457
14457
|
let n = !1;
|
|
14458
14458
|
for (let t = 0; t < e.length; t++) {
|
|
14459
|
-
if (!e[t] || !this.
|
|
14460
|
-
if (this.
|
|
14459
|
+
if (!e[t] || !this.zo[t]) continue;
|
|
14460
|
+
if (this.No(t) && this.zo[t] && !n) {
|
|
14461
14461
|
n = !0;
|
|
14462
14462
|
break;
|
|
14463
14463
|
}
|
|
@@ -14469,11 +14469,11 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14469
14469
|
this.shadowCount = this.scene.getMeshes().length;
|
|
14470
14470
|
return this.scene.getMeshes().filter((t => 0 === t.properties.level));
|
|
14471
14471
|
}
|
|
14472
|
-
|
|
14472
|
+
No(t) {
|
|
14473
14473
|
const e = this.getSymbols()[t];
|
|
14474
|
-
return !!(e && e.animation && this.
|
|
14474
|
+
return !!(e && e.animation && this.zo[t] && this.zo[t][0] && this.zo[t][0].hasSkinAnimation());
|
|
14475
14475
|
}
|
|
14476
|
-
|
|
14476
|
+
Vo(t, e, n, i, r, a, l, h, u, c, f) {
|
|
14477
14477
|
function d(e, n, i, r) {
|
|
14478
14478
|
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];
|
|
14479
14479
|
}
|
|
@@ -14486,7 +14486,7 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14486
14486
|
e[0] < v && (v = e[0]), e[0] > w && (w = e[0]), e[1] < x && (x = e[1]), e[1] > A && (A = e[1]),
|
|
14487
14487
|
e[2] < b && (b = e[2]), e[2] > M && (M = e[2]);
|
|
14488
14488
|
}
|
|
14489
|
-
const P = (v + w) / 2, k = (x + A) / 2, T = (b + M) / 2, I = [], F = this.
|
|
14489
|
+
const P = (v + w) / 2, k = (x + A) / 2, T = (b + M) / 2, I = [], F = this.Uo(), C = [ 0, 0, 1 ];
|
|
14490
14490
|
for (let e = 0; e < p; e++) {
|
|
14491
14491
|
a ? s.set(_, r[e * u], r[e * u + 1], a[e]) : Dt(_, r[e * u], r[e * u + 1], r[e * u + 2]);
|
|
14492
14492
|
const n = _[0], i = _[1], p = s.set(S, n * m - P, -i * m - k, (_[2] + g) * y - T), v = l && l[e] || 0, x = h && h[e] || 0;
|
|
@@ -14498,7 +14498,7 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14498
14498
|
o.multiply(I, r, I);
|
|
14499
14499
|
} else o.fromTranslation(I, p);
|
|
14500
14500
|
if (F) {
|
|
14501
|
-
const t = this.
|
|
14501
|
+
const t = this.Wo(Wc, f, c, e);
|
|
14502
14502
|
o.multiply(I, I, t);
|
|
14503
14503
|
}
|
|
14504
14504
|
d("instance_vectorA", e, I, 0), d("instance_vectorB", e, I, 1), d("instance_vectorC", e, I, 2),
|
|
@@ -14506,30 +14506,30 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14506
14506
|
}
|
|
14507
14507
|
return s.set(S, P, k, T), S;
|
|
14508
14508
|
}
|
|
14509
|
-
|
|
14510
|
-
if (!this.
|
|
14509
|
+
jo() {
|
|
14510
|
+
if (!this.Ko) {
|
|
14511
14511
|
const t = this.getMap();
|
|
14512
|
-
this.
|
|
14512
|
+
this.Ko = 100 * bo(t.getGLRes(), t);
|
|
14513
14513
|
}
|
|
14514
|
-
return this.
|
|
14514
|
+
return this.Ko;
|
|
14515
14515
|
}
|
|
14516
|
-
|
|
14517
|
-
const r = this.getMap(), o = this.symbolDef[0], a = this.
|
|
14516
|
+
Wo(t, e, n, i) {
|
|
14517
|
+
const r = this.getMap(), o = this.symbolDef[0], a = this.jo();
|
|
14518
14518
|
let l = o.translationX || 0, h = o.translationY || 0, u = o.translationZ || 0, c = o.rotationX || 0, f = o.rotationY || 0, d = o.rotationZ || 0, p = o.scaleX || 1, m = o.scaleY || 1, y = o.scaleZ || 1;
|
|
14519
|
-
const g = n && n[i], v = e && e[g], x = r.getZoom(), b = v && v.feature && v.feature.properties, w = this.
|
|
14520
|
-
this.
|
|
14519
|
+
const g = n && n[i], v = e && e[g], x = r.getZoom(), b = v && v.feature && v.feature.properties, w = this.Zo(x, b);
|
|
14520
|
+
this.Qo && (l = this.Qo(x, b)), this.ta && (h = this.ta(x, b)), this.ea && (u = this.ea(x, b));
|
|
14521
14521
|
const A = s.set(Lc, l * a, h * a, u * a);
|
|
14522
|
-
this.
|
|
14522
|
+
this.na && (c = this.na(x, b)), this.ia && (f = this.ia(x, b)), this.ra && (d = this.ra(x, b));
|
|
14523
14523
|
const M = s.set(Rc, c, f, d);
|
|
14524
|
-
this.
|
|
14524
|
+
this.sa && (p = this.sa(x, b)), this.oa && (m = this.oa(x, b)), this.aa && (y = this.aa(x, b));
|
|
14525
14525
|
const S = s.set(Hc, p * w, m * w, y * w);
|
|
14526
|
-
return this.
|
|
14526
|
+
return this.la(t, A, M, S);
|
|
14527
14527
|
}
|
|
14528
|
-
|
|
14528
|
+
Zo(t, e) {
|
|
14529
14529
|
const n = this.symbolDef[0];
|
|
14530
|
-
let i = this.
|
|
14530
|
+
let i = this.ha ? this.ha(t, e) : n.modelHeight;
|
|
14531
14531
|
if (yo(i)) return 1;
|
|
14532
|
-
const r = this.
|
|
14532
|
+
const r = this.ua[0];
|
|
14533
14533
|
return i / Math.abs(r.max[1] - r.min[1]);
|
|
14534
14534
|
}
|
|
14535
14535
|
getShaderConfig() {
|
|
@@ -14537,40 +14537,40 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14537
14537
|
return t.positionAttribute = "POSITION", t.normalAttribute = "NORMAL", t;
|
|
14538
14538
|
}
|
|
14539
14539
|
init(t) {
|
|
14540
|
-
super.init(t), this.
|
|
14540
|
+
super.init(t), this.Ho();
|
|
14541
14541
|
}
|
|
14542
|
-
|
|
14542
|
+
Ro() {
|
|
14543
14543
|
const t = this.symbolDef[0];
|
|
14544
|
-
y(t.modelHeight) && (this.
|
|
14545
|
-
y(t.translationY) && (this.
|
|
14546
|
-
y(t.rotationX) && (this.
|
|
14547
|
-
y(t.rotationZ) && (this.
|
|
14548
|
-
y(t.scaleY) && (this.
|
|
14544
|
+
y(t.modelHeight) && (this.ha = g(t.modelHeight)), y(t.translationX) && (this.Qo = g(t.translationX)),
|
|
14545
|
+
y(t.translationY) && (this.ta = g(t.translationY)), y(t.translationZ) && (this.ea = g(t.translationZ)),
|
|
14546
|
+
y(t.rotationX) && (this.na = g(t.rotationX)), y(t.rotationY) && (this.ia = g(t.rotationY)),
|
|
14547
|
+
y(t.rotationZ) && (this.ra = g(t.rotationZ)), y(t.scaleX) && (this.sa = g(t.scaleX)),
|
|
14548
|
+
y(t.scaleY) && (this.oa = g(t.scaleY)), y(t.scaleZ) && (this.aa = g(t.scaleZ));
|
|
14549
14549
|
}
|
|
14550
|
-
|
|
14551
|
-
return !!(this.
|
|
14550
|
+
Uo() {
|
|
14551
|
+
return !!(this.ha && !this.ha.isFeatureConstant || this.Qo && !this.Qo.isFeatureConstant || this.ta && !this.ta.isFeatureConstant || this.ea && !this.ea.isFeatureConstant || this.na && !this.na.isFeatureConstant || this.ia && !this.ia.isFeatureConstant || this.ra && !this.ra.isFeatureConstant || this.sa && !this.sa.isFeatureConstant || this.oa && !this.oa.isFeatureConstant || this.aa && !this.aa.isFeatureConstant);
|
|
14552
14552
|
}
|
|
14553
|
-
|
|
14554
|
-
if (this.
|
|
14555
|
-
this.
|
|
14553
|
+
Ho() {
|
|
14554
|
+
if (this.zo) return;
|
|
14555
|
+
this.zo = [], this.qo = [], this.ua = [], this.Go = [];
|
|
14556
14556
|
const t = this.getSymbols();
|
|
14557
|
-
this.
|
|
14557
|
+
this.ca = 0;
|
|
14558
14558
|
for (let e = 0; e < t.length; e++) {
|
|
14559
14559
|
const n = t[e].url || "pyramid";
|
|
14560
|
-
this.
|
|
14561
|
-
const i = this.
|
|
14560
|
+
this.Lo.loginGLTF(n);
|
|
14561
|
+
const i = this.Lo.getGLTF(n);
|
|
14562
14562
|
if (i.then) i.then((n => {
|
|
14563
|
-
if (!n.gltfPack) return this.
|
|
14563
|
+
if (!n.gltfPack) return this.ca++, void (this.ca >= t.length && (this.Do = !0, this.setToRedraw(!0)));
|
|
14564
14564
|
const {gltfPack: i, json: r, bbox: s} = n;
|
|
14565
|
-
this.
|
|
14566
|
-
this.
|
|
14565
|
+
this.zo[e] = [ i ], this.Go[e] = i.getMeshesInfo(), this.qo[e] = r, this.ua[e] = s,
|
|
14566
|
+
this.ca++, this.ca >= t.length && (this.Do = !0), this.setToRedraw(!0);
|
|
14567
14567
|
})); else {
|
|
14568
14568
|
const {gltfPack: t, json: n, bbox: r} = i;
|
|
14569
|
-
t && (this.
|
|
14570
|
-
this.
|
|
14569
|
+
t && (this.zo[e] = [ t ], this.Go[e] = t.getMeshesInfo(), this.qo[e] = n, this.ua[e] = r,
|
|
14570
|
+
this.ca++);
|
|
14571
14571
|
}
|
|
14572
14572
|
}
|
|
14573
|
-
this.
|
|
14573
|
+
this.ca >= t.length && (this.Do = !0);
|
|
14574
14574
|
}
|
|
14575
14575
|
getPickingVert() {
|
|
14576
14576
|
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 }";
|
|
@@ -14579,10 +14579,10 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14579
14579
|
if (t) {
|
|
14580
14580
|
this.scene.removeMesh(t);
|
|
14581
14581
|
for (let e = 0; e < t.length; e++) {
|
|
14582
|
-
const n = this.
|
|
14582
|
+
const n = this.Jo && this.Jo[t[e].uuid];
|
|
14583
14583
|
if (n) {
|
|
14584
14584
|
for (const t in n) n[t].jointTexture && n[t].jointTexture.destroy();
|
|
14585
|
-
delete this.
|
|
14585
|
+
delete this.Jo[t[e].uuid];
|
|
14586
14586
|
}
|
|
14587
14587
|
t[e].disposeInstancedData(), t[e].dispose();
|
|
14588
14588
|
}
|
|
@@ -14593,18 +14593,18 @@ const Dc = [], Lc = [], Rc = [], Hc = [], zc = [], Nc = [ 0, 0, 0 ], Vc = [ 0, 0
|
|
|
14593
14593
|
const t = this.getSymbols();
|
|
14594
14594
|
for (let e = 0; e < t.length; e++) {
|
|
14595
14595
|
const n = t[e].url || "pyramid";
|
|
14596
|
-
this.
|
|
14596
|
+
this.Lo.logoutGLTF(n);
|
|
14597
14597
|
}
|
|
14598
|
-
if (this.
|
|
14599
|
-
for (const t in this.
|
|
14600
|
-
const e = this.
|
|
14598
|
+
if (this.Jo) {
|
|
14599
|
+
for (const t in this.Jo) {
|
|
14600
|
+
const e = this.Jo[t];
|
|
14601
14601
|
for (const t in e) e[t].jointTexture && e[t].jointTexture.destroy();
|
|
14602
14602
|
}
|
|
14603
|
-
delete this.
|
|
14603
|
+
delete this.Jo;
|
|
14604
14604
|
}
|
|
14605
|
-
delete this.
|
|
14605
|
+
delete this.Yo;
|
|
14606
14606
|
}
|
|
14607
|
-
|
|
14607
|
+
la(t, e, n, i) {
|
|
14608
14608
|
const r = s.set(Dc, ...e || Nc), a = n || Vc, l = i || Uc, h = d.fromEuler(zc, a[0], a[1], a[2]);
|
|
14609
14609
|
return o.fromRotationTranslationScale(t, h, r, l);
|
|
14610
14610
|
}
|
|
@@ -14657,25 +14657,25 @@ class ef extends Ml {
|
|
|
14657
14657
|
}
|
|
14658
14658
|
callShader(t, e) {
|
|
14659
14659
|
super.callShader(t, e), this.transformWater();
|
|
14660
|
-
const n = this.
|
|
14661
|
-
this.
|
|
14660
|
+
const n = this.fa(this.getMap(), e);
|
|
14661
|
+
this.Bi += this.renderer.render(this.da, n, this.pa, this.getRenderFBO(e));
|
|
14662
14662
|
}
|
|
14663
14663
|
addMesh(t, e) {
|
|
14664
|
-
this.
|
|
14664
|
+
this._r(t, e), super.addMesh(...arguments);
|
|
14665
14665
|
}
|
|
14666
|
-
|
|
14666
|
+
_r(t) {
|
|
14667
14667
|
const e = this.getSymbol(Zc).ssr;
|
|
14668
14668
|
for (let n = 0; n < t.length; n++) t[n].ssr = e ? 1 : 0;
|
|
14669
14669
|
}
|
|
14670
14670
|
paint(t) {
|
|
14671
|
-
t.states && t.states.includesChanged && (this.shader.dispose(), this.
|
|
14672
|
-
this.
|
|
14673
|
-
const e = !!t.ssr && this.getSymbol(Zc).ssr, n = this.
|
|
14671
|
+
t.states && t.states.includesChanged && (this.shader.dispose(), this.da.dispose(),
|
|
14672
|
+
this.Ar(t));
|
|
14673
|
+
const e = !!t.ssr && this.getSymbol(Zc).ssr, n = this.da, i = n.shaderDefines;
|
|
14674
14674
|
if (e) {
|
|
14675
14675
|
const e = Bo({}, i, t.ssr.defines);
|
|
14676
14676
|
n.shaderDefines = e;
|
|
14677
14677
|
}
|
|
14678
|
-
this.updateIBLDefines(n), this.
|
|
14678
|
+
this.updateIBLDefines(n), this.ma.ssr = e ? 1 : 0, super.paint(t), e && (n.shaderDefines = i);
|
|
14679
14679
|
}
|
|
14680
14680
|
isEnableTileStencil() {
|
|
14681
14681
|
return !1;
|
|
@@ -14683,7 +14683,7 @@ class ef extends Ml {
|
|
|
14683
14683
|
init(t) {
|
|
14684
14684
|
this.createIBLTextures();
|
|
14685
14685
|
const e = this.regl;
|
|
14686
|
-
this.renderer = new r.Renderer(e), this.createGround(), this.
|
|
14686
|
+
this.renderer = new r.Renderer(e), this.createGround(), this.Ar(t), this.pickingFBO && (this.picking = [ new r.FBORayPicking(this.renderer, {
|
|
14687
14687
|
vert: Sl,
|
|
14688
14688
|
uniforms: [ {
|
|
14689
14689
|
name: "projViewModelMatrix",
|
|
@@ -14696,38 +14696,38 @@ class ef extends Ml {
|
|
|
14696
14696
|
extraCommandProps: {
|
|
14697
14697
|
viewport: this.pickingViewport
|
|
14698
14698
|
}
|
|
14699
|
-
}, this.pickingFBO, this.getMap()) ]), this.
|
|
14699
|
+
}, this.pickingFBO, this.getMap()) ]), this.ya();
|
|
14700
14700
|
}
|
|
14701
|
-
|
|
14701
|
+
ya() {
|
|
14702
14702
|
const t = this.regl;
|
|
14703
|
-
this.
|
|
14703
|
+
this.ga || (this.ga = t.texture(2));
|
|
14704
14704
|
const e = this.layer.getURLModifier(), n = this.getSymbol({
|
|
14705
14705
|
index: 0
|
|
14706
14706
|
}), i = n.texWaveNormal, r = this.getCachedTexture(i), s = this;
|
|
14707
|
-
if (r) this.
|
|
14708
|
-
this.shader && this.
|
|
14709
|
-
}), 20) : this.
|
|
14707
|
+
if (r) this.va || (r.isLoading ? setTimeout((() => {
|
|
14708
|
+
this.shader && this.ya();
|
|
14709
|
+
}), 20) : this.va = this.xa(t, r)); else {
|
|
14710
14710
|
const n = new Image;
|
|
14711
14711
|
n.isLoading = !0, n.onload = function() {
|
|
14712
|
-
delete this.isLoading, s.
|
|
14712
|
+
delete this.isLoading, s.va = s.xa(t, this), s.setToRedraw();
|
|
14713
14713
|
}, n.onerror = () => {
|
|
14714
14714
|
console.error("invalid water wave normal texture:" + i);
|
|
14715
14715
|
}, this.addCachedTexture(i, n), n.src = e && e(i) || i;
|
|
14716
14716
|
}
|
|
14717
14717
|
const o = n.texWavePerturbation, a = this.getCachedTexture(o);
|
|
14718
|
-
if (a) this.
|
|
14719
|
-
this.
|
|
14720
|
-
}), 20) : this.
|
|
14718
|
+
if (a) this.ba || (a.isLoading ? setTimeout((() => {
|
|
14719
|
+
this.ya(), this.shader;
|
|
14720
|
+
}), 20) : this.ba = this.xa(t, a)); else {
|
|
14721
14721
|
const n = new Image;
|
|
14722
14722
|
n.isLoading = !0, n.onload = function() {
|
|
14723
|
-
delete this.isLoading, s.
|
|
14723
|
+
delete this.isLoading, s.ba = s.xa(t, this), s.setToRedraw();
|
|
14724
14724
|
}, n.onerror = () => {
|
|
14725
14725
|
console.error("invalid water wave perturbation texture:" + o);
|
|
14726
14726
|
}, this.addCachedTexture(o, n), n.src = e && e(o) || o;
|
|
14727
14727
|
}
|
|
14728
14728
|
}
|
|
14729
|
-
|
|
14730
|
-
return this.
|
|
14729
|
+
xa(t, e) {
|
|
14730
|
+
return this.ga ? t.texture({
|
|
14731
14731
|
width: e.width,
|
|
14732
14732
|
height: e.height,
|
|
14733
14733
|
mag: "linear",
|
|
@@ -14738,7 +14738,7 @@ class ef extends Ml {
|
|
|
14738
14738
|
data: e
|
|
14739
14739
|
}) : null;
|
|
14740
14740
|
}
|
|
14741
|
-
|
|
14741
|
+
Ar(t) {
|
|
14742
14742
|
const e = this.canvas, n = [], i = [ {
|
|
14743
14743
|
name: "projViewModelMatrix",
|
|
14744
14744
|
type: "function",
|
|
@@ -14833,7 +14833,7 @@ class ef extends Ml {
|
|
|
14833
14833
|
enable: !1
|
|
14834
14834
|
}
|
|
14835
14835
|
};
|
|
14836
|
-
i.push(...r.SsrPass.getUniformDeclares()), this.
|
|
14836
|
+
i.push(...r.SsrPass.getUniformDeclares()), this.da = new r.MeshShader({
|
|
14837
14837
|
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}",
|
|
14838
14838
|
frag: "#define SHADER_NAME WATER\nprecision highp float;\nprecision highp sampler2D;\n#include <hsv_frag>\nuniform vec3 hsv;\nuniform float contrast;\nuniform float layerOpacity;\n#if defined(HAS_SHADOWING)\n#include <vsm_shadow_frag>\n#endif\n#include <highlight_frag>\n#if defined(HAS_IBL_LIGHTING)\nuniform vec3 hdrHSV;\nuniform samplerCube prefilterMap;\nuniform sampler2D brdfLUT;\nuniform float rgbmRange;\nuniform mat3 environmentTransform;\nuniform vec3 diffuseSPH[9];\nvec3 c(const in vec3 d) {\n vec3 e = environmentTransform * 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, environmentTransform * dK);\n float dM = clamp(1. + dot(dK, e), .0, 1.);\n dL *= dM * dM;\n vec3 i = o(dL, rgbmRange);\n vec3 dN = c(e);\n float l = clamp(50.0 * waterBaseColor.g, .0, 1.);\n vec3 dO = h(waterBaseColor.rgb, j, dot(e, dI), l);\n return i * dO + dN;\n#else\nvec3 dP = dd(di);\n vec3 dQ = dd(dh);\n vec3 di = dD(dJ, dP, dQ);\n return di;\n#endif\n}\nvec3 dR(in vec3 e, in vec3 dI, in vec3 dS, vec3 u, in vec3 dT, in vec3 dU, in float dV, float dW, vec3 dX) {\n float dY = 0.;\n vec3 dZ = dd(u);\n vec3 bm = normalize(dS + dI);\n dp.NdotL = clamp(dot(e, dS), .0, 1.);\n dp.NdotV = clamp(dot(e, dI), .001, 1.);\n dp.VdotN = clamp(dot(dI, e), .001, 1.);\n dp.NdotH = clamp(dot(e, bm), .0, 1.);\n dp.VdotH = clamp(dot(dI, bm), .0, 1.);\n dp.LdotH = clamp(dot(dS, bm), .0, 1.);\n float dJ = max(dot(dU, dI), .0);\n vec3 di = dH(e, dI, dJ, j);\n float ea = max(dot(dU, dS), .0);\n float eb = .1 + ea * .9;\n di *= eb;\n float ec = clamp(dV, .8, 1.);\n vec3 ed = cP(dp.VdotN, vec3(de[0]), de[1]);\n vec3 ee = ed * di * ec;\n vec3 ef = dZ * mix(di, ea * dT * cK, 2. / 3.) * ec;\n vec3 i = vec3(.0);\n if(dJ > .0 && ea > .0) {\n vec3 eg = dq(dp, j, vec3(df[0]), df[1]);\n vec3 eh = dT * cK * dV;\n i = dp.NdotL * eh * eg;\n }\n vec3 cI = vec3(.0);\n if(dJ > .0) {\n cI = dA(dg, dW, dh, eb);\n }\n vec3 ei = vec3(.0);\n#ifdef HAS_SSR\nfloat ej = smoothstep(dl, dk, -dX.z);\n mat4 ek = viewMatrix;\n vec4 el = vec4(dX.xyz, 1.);\n vec3 em = normalize(el.xyz);\n vec4 en = ek * vec4(e, .0);\n vec3 eo = normalize(en.xyz);\n vec4 ep = ek * vec4(dU, .0);\n float eq = pow(max(dot(-em, ep.xyz), .0), cN);\n vec3 er = mix(ep.xyz, eo, eq);\n vec3 es = ssr(vec3(.0), vec3(1.), j, normalize(er), -normalize(vViewVertex.xyz));\n if(es.z > .0) {\n vec2 et = smoothstep(.3, .6, abs(vec2(.5) - es.xy));\n dY = dm * clamp(1. - 1.3 * et.y, .0, 1.) * ej;\n vec3 eu = X(.0, es.xy);\n ei = dd(eu) * dY * ed.y * dj;\n }\n#endif\nfloat ev = mix(dn, dn * .5, dY);\n return cZ((1. - dY) * ee + ei + ef * ev + i + cI);\n}\nvoid main() {\n vec3 dU = bY;\n vec4 ew = cF(vUv, timeElapsed);\n vec3 e = normalize(vTbnMatrix * ew.xyz);\n vec3 dI = -normalize(vPos - camPos);\n vec3 dS = normalize(-lightDirection);\n#if defined(HAS_SHADOWING)\nfloat dV = shadow_computeShadow();\n#else\nfloat dV = 1.;\n#endif\nvec4 ex = viewMatrix * vec4(vPos, 1.);\n vec4 ey = vec4(dR(e, dI, dS, waterBaseColor.rgb, lightColor, dU, dV, ew.w, ex.xyz), waterBaseColor.a);\n gl_FragColor = dc(ey);\n if(contrast != 1.) {\n gl_FragColor = contrastMatrix(contrast) * gl_FragColor;\n }\n if(length(hsv) > .0) {\n gl_FragColor = hsv_apply(gl_FragColor, hsv);\n }\n gl_FragColor = highlight_blendColor(gl_FragColor) * layerOpacity;\n}",
|
|
14839
14839
|
defines: s,
|
|
@@ -14846,10 +14846,10 @@ class ef extends Ml {
|
|
|
14846
14846
|
projViewMatrix: t.projViewMatrix
|
|
14847
14847
|
};
|
|
14848
14848
|
}
|
|
14849
|
-
|
|
14849
|
+
fa(t, e) {
|
|
14850
14850
|
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = Jc(t, n, i, e && e.ssr, e && e.jitter), s = t.getLightManager();
|
|
14851
14851
|
let o = s && s.getDirectionalLight() || {};
|
|
14852
|
-
const a = s && s.getAmbientLight() || {}, l = this.getSymbol(Zc), u = this.
|
|
14852
|
+
const a = s && s.getAmbientLight() || {}, l = this.getSymbol(Zc), u = this.wa = this.wa || [], c = this.Aa = this.Aa || [];
|
|
14853
14853
|
h.set(c, .09, l.uvScale || 3, .03, -.5);
|
|
14854
14854
|
Bo(r, {
|
|
14855
14855
|
ambientColor: a.color || [ .2, .2, .2 ],
|
|
@@ -14858,8 +14858,8 @@ class ef extends Ml {
|
|
|
14858
14858
|
lightColor: o.color || qc.color,
|
|
14859
14859
|
camPos: t.cameraPosition,
|
|
14860
14860
|
timeElapsed: l.animation ? (this.layer.getRenderer().getFrameTimestamp() || 0) / (1 / (l.waterSpeed || 1) * 1e4) : 0,
|
|
14861
|
-
normalTexture: this.
|
|
14862
|
-
heightTexture: this.
|
|
14861
|
+
normalTexture: this.va || this.ga,
|
|
14862
|
+
heightTexture: this.ba || this.ga,
|
|
14863
14863
|
waveParams: c,
|
|
14864
14864
|
waterDir: nf(u, l.waterDirection || 0),
|
|
14865
14865
|
waterBaseColor: l.waterBaseColor || [ .1451, .2588, .4863, 1 ],
|
|
@@ -14867,28 +14867,28 @@ class ef extends Ml {
|
|
|
14867
14867
|
hsv: l.hsv || Qc
|
|
14868
14868
|
});
|
|
14869
14869
|
const f = this.layer.getRenderer();
|
|
14870
|
-
return r.layerOpacity = f.
|
|
14870
|
+
return r.layerOpacity = f.Bn(), this.setIncludeUniformValues(r, e), e && e.ssr && e.ssr.renderUniforms && Bo(r, e.ssr.renderUniforms),
|
|
14871
14871
|
r;
|
|
14872
14872
|
}
|
|
14873
14873
|
delete() {
|
|
14874
|
-
super.delete(), this.
|
|
14875
|
-
this.
|
|
14876
|
-
this.
|
|
14877
|
-
this.
|
|
14874
|
+
super.delete(), this.ga && (this.ga.destroy(), delete this.ga), this.va && this.va.destroy(),
|
|
14875
|
+
this.ba && this.ba.destroy(), this.shader && (this.shader.dispose(), delete this.shader),
|
|
14876
|
+
this.da && this.da.dispose(), this.ma && (this.ma.geometry.dispose(), this.ma.material && this.ma.material.dispose(),
|
|
14877
|
+
this.ma.dispose(), delete this.ma), this.disposeIBLTextures();
|
|
14878
14878
|
}
|
|
14879
14879
|
createGround() {
|
|
14880
14880
|
const t = new r.Plane;
|
|
14881
14881
|
t.data.aTexCoord = new Uint8Array([ 0, 1, 1, 1, 0, 0, 1, 0 ]), t.generateBuffers(this.renderer.regl),
|
|
14882
|
-
this.
|
|
14882
|
+
this.ma = new r.Mesh(t, null, {
|
|
14883
14883
|
castShadow: !1
|
|
14884
|
-
}), this.
|
|
14884
|
+
}), this.pa = new r.Scene([ this.ma ]);
|
|
14885
14885
|
}
|
|
14886
14886
|
transformWater() {
|
|
14887
|
-
const t = this.getMap(), e = a.getGroundTransform(this.
|
|
14888
|
-
this.
|
|
14887
|
+
const t = this.getMap(), e = a.getGroundTransform(this.ma.localTransform, t);
|
|
14888
|
+
this.ma.setLocalTransform(e);
|
|
14889
14889
|
const n = t._get2DExtentAtRes(t.getGLRes()), i = n.getWidth(), r = n.getHeight(), s = t.cameraLookAt, o = s[0] - i, l = s[1] + r, h = o / tf[0], u = l / tf[1], c = h % 1, f = u % 1, d = h * Kc % 1, p = u * Kc % 1, m = i / tf[0] * 2, y = r / tf[1] * 2;
|
|
14890
|
-
this.
|
|
14891
|
-
this.
|
|
14890
|
+
this.ma.setUniform("uvOffset", [ c, f ]), this.ma.setUniform("noiseUvOffset", [ d, p ]),
|
|
14891
|
+
this.ma.setUniform("uvScale", [ m, -y ]);
|
|
14892
14892
|
}
|
|
14893
14893
|
}
|
|
14894
14894
|
|
|
@@ -14984,7 +14984,7 @@ const yf = Ha("heatmap", class extends Ml {
|
|
|
14984
14984
|
}
|
|
14985
14985
|
callRenderer(t, e, n) {
|
|
14986
14986
|
const i = this.getRenderFBO(n);
|
|
14987
|
-
this.
|
|
14987
|
+
this.Bi += this.Ma.render(this.scene, e, i);
|
|
14988
14988
|
}
|
|
14989
14989
|
getUniformValues(t) {
|
|
14990
14990
|
const e = this.getSymbol({
|
|
@@ -15001,13 +15001,13 @@ const yf = Ha("heatmap", class extends Ml {
|
|
|
15001
15001
|
return this.scene.getMeshes();
|
|
15002
15002
|
}
|
|
15003
15003
|
delete() {
|
|
15004
|
-
super.delete(...arguments), this.
|
|
15004
|
+
super.delete(...arguments), this.Ma.dispose(), delete this.Ma;
|
|
15005
15005
|
}
|
|
15006
15006
|
init() {
|
|
15007
15007
|
const t = this.regl;
|
|
15008
15008
|
this.renderer = new r.Renderer(t);
|
|
15009
15009
|
const e = this.getPolygonOffset(), n = this.getSymbols()[0];
|
|
15010
|
-
this.
|
|
15010
|
+
this.Ma = new m(this.regl, this.sceneConfig, this.layer, n.heatmapColor, null, e);
|
|
15011
15011
|
}
|
|
15012
15012
|
});
|
|
15013
15013
|
|
|
@@ -15042,9 +15042,9 @@ class bf extends _a {
|
|
|
15042
15042
|
}).spatialReference = null, super(t, e), this.setData(e.data);
|
|
15043
15043
|
}
|
|
15044
15044
|
onAdd() {
|
|
15045
|
-
this.
|
|
15045
|
+
this.Yn();
|
|
15046
15046
|
}
|
|
15047
|
-
|
|
15047
|
+
Yn() {
|
|
15048
15048
|
const t = this.getMap(), e = t.getMaxNativeZoom(), n = t.getProjection(), i = "EPSG:4326" === n.code || "EPSG:4490" === n.code;
|
|
15049
15049
|
var r;
|
|
15050
15050
|
i && (this.options.tileSystem = [ 1, -1, -180, 90 ]), this.options.spatialReference = i ? function(t, e) {
|
|
@@ -15088,17 +15088,17 @@ class bf extends _a {
|
|
|
15088
15088
|
}
|
|
15089
15089
|
setData(t) {
|
|
15090
15090
|
if (this.options.data = t, t && (co(t) || t.url)) {
|
|
15091
|
-
return !!this.getRenderer() && this.
|
|
15091
|
+
return !!this.getRenderer() && this.Sa(), this;
|
|
15092
15092
|
}
|
|
15093
|
-
return this.
|
|
15093
|
+
return this._a(t), this.Sa(), this;
|
|
15094
15094
|
}
|
|
15095
|
-
|
|
15095
|
+
_a(t) {
|
|
15096
15096
|
if (this.options.convertFn) {
|
|
15097
15097
|
t = new Function("data", this.options.convertFn + "\nreturn convert(data)")(t);
|
|
15098
15098
|
}
|
|
15099
|
-
return this.features = t, this.
|
|
15099
|
+
return this.features = t, this.Pa(), this;
|
|
15100
15100
|
}
|
|
15101
|
-
|
|
15101
|
+
Sa() {
|
|
15102
15102
|
const t = this.getRenderer();
|
|
15103
15103
|
if (t) {
|
|
15104
15104
|
const e = t.getWorkerConnection();
|
|
@@ -15114,19 +15114,19 @@ class bf extends _a {
|
|
|
15114
15114
|
}
|
|
15115
15115
|
}
|
|
15116
15116
|
getExtent() {
|
|
15117
|
-
return this.
|
|
15117
|
+
return this.ka;
|
|
15118
15118
|
}
|
|
15119
15119
|
onWorkerReady(t, e) {
|
|
15120
15120
|
t ? this.fire("dataerror", {
|
|
15121
15121
|
error: t
|
|
15122
|
-
}) : (e && (e.extent && this.
|
|
15122
|
+
}) : (e && (e.extent && this.Ta(e.extent), e.idMap && (this.Ia = e.idMap)), this.fire("dataload", {
|
|
15123
15123
|
extent: e && e.extent
|
|
15124
15124
|
}));
|
|
15125
15125
|
}
|
|
15126
|
-
|
|
15127
|
-
this.
|
|
15126
|
+
Ta(e) {
|
|
15127
|
+
this.ka = new t.Extent(...e);
|
|
15128
15128
|
}
|
|
15129
|
-
|
|
15129
|
+
Fa(t, e) {
|
|
15130
15130
|
co(t) ? Mo.getJSON(t, e) : Mo.getJSON(t.url, t, e);
|
|
15131
15131
|
}
|
|
15132
15132
|
getData() {
|
|
@@ -15136,16 +15136,16 @@ class bf extends _a {
|
|
|
15136
15136
|
return this.getId() + "," + t + "," + e + "," + n;
|
|
15137
15137
|
}
|
|
15138
15138
|
getFeature(t) {
|
|
15139
|
-
return this.
|
|
15139
|
+
return this.Ia[t];
|
|
15140
15140
|
}
|
|
15141
15141
|
static fromJSON(t) {
|
|
15142
15142
|
return t && "GeoJSONVectorTileLayer" === t.type ? new bf(t.id, t.options) : null;
|
|
15143
15143
|
}
|
|
15144
|
-
|
|
15144
|
+
Pa() {
|
|
15145
15145
|
if (!this.features) return;
|
|
15146
15146
|
if (this.features = JSON.parse(JSON.stringify(this.features)), !this.features) return;
|
|
15147
15147
|
let t = 0;
|
|
15148
|
-
this.
|
|
15148
|
+
this.Ia = {};
|
|
15149
15149
|
const e = this.options.featureIdProperty, n = this.features;
|
|
15150
15150
|
Array.isArray(n) ? n.forEach((n => {
|
|
15151
15151
|
if (n) {
|
|
@@ -15153,7 +15153,7 @@ class bf extends _a {
|
|
|
15153
15153
|
let t = e;
|
|
15154
15154
|
mo(e) && (t = e[n.layer || "0"]), n.id = n.properties[t];
|
|
15155
15155
|
}
|
|
15156
|
-
this.
|
|
15156
|
+
this.Ia[n.id] = n;
|
|
15157
15157
|
}
|
|
15158
15158
|
})) : n.features && n.features.forEach((n => {
|
|
15159
15159
|
if (n) {
|
|
@@ -15161,7 +15161,7 @@ class bf extends _a {
|
|
|
15161
15161
|
let t = e;
|
|
15162
15162
|
mo(e) && (t = e[n.layer || "0"]), n.id = n.properties[t];
|
|
15163
15163
|
}
|
|
15164
|
-
this.
|
|
15164
|
+
this.Ia[n.id] = n;
|
|
15165
15165
|
}
|
|
15166
15166
|
}));
|
|
15167
15167
|
}
|
|
@@ -15609,24 +15609,24 @@ const Rf = [];
|
|
|
15609
15609
|
|
|
15610
15610
|
class Hf extends t.renderer.CanvasRenderer {
|
|
15611
15611
|
constructor(...t) {
|
|
15612
|
-
super(...t), this.features = {}, this.
|
|
15613
|
-
this.
|
|
15612
|
+
super(...t), this.features = {}, this.Ca = {}, this.we = 0, this.Oa = {}, this.Ea = {},
|
|
15613
|
+
this.Da = {}, this.La = {}, this.Ra = {}, this.Ha = !0, this.za = {
|
|
15614
15614
|
id: 0,
|
|
15615
15615
|
pickingId: 0
|
|
15616
|
-
}, this.
|
|
15616
|
+
}, this.Na = {};
|
|
15617
15617
|
}
|
|
15618
15618
|
setURLModifier(t) {
|
|
15619
|
-
this
|
|
15619
|
+
this.Xn = t;
|
|
15620
15620
|
}
|
|
15621
15621
|
getURLModifier() {
|
|
15622
|
-
return this
|
|
15622
|
+
return this.Xn;
|
|
15623
15623
|
}
|
|
15624
15624
|
hasNoAARendering() {
|
|
15625
15625
|
return !0;
|
|
15626
15626
|
}
|
|
15627
15627
|
needToRedraw() {
|
|
15628
15628
|
const t = super.needToRedraw();
|
|
15629
|
-
return t || (this.painter && this.painter.needToRedraw() || this.
|
|
15629
|
+
return t || (this.painter && this.painter.needToRedraw() || this.Va && this.Va.needToRedraw() || this.Ua && this.Ua.needToRedraw());
|
|
15630
15630
|
}
|
|
15631
15631
|
getAnalysisMeshes() {
|
|
15632
15632
|
return this.painter && this.painter.getAnalysisMeshes() || Rf;
|
|
@@ -15638,39 +15638,39 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15638
15638
|
this.Qe = t;
|
|
15639
15639
|
const n = this.layer;
|
|
15640
15640
|
this.prepareCanvas(), this.tn = this.en(this.getMap().getGLRes()), this.nn = e || {};
|
|
15641
|
-
const i = this.nn.renderMode, r = this.
|
|
15642
|
-
if (this.rn(r, i), this.
|
|
15643
|
-
this.
|
|
15644
|
-
const t = this.atlas, e = this
|
|
15645
|
-
delete this.atlas, delete this
|
|
15646
|
-
this.
|
|
15647
|
-
} else if (this
|
|
15648
|
-
const t = this.
|
|
15649
|
-
delete this.
|
|
15650
|
-
}
|
|
15651
|
-
if (!this.meshes && !this.
|
|
15652
|
-
this.
|
|
15641
|
+
const i = this.nn.renderMode, r = this.ja();
|
|
15642
|
+
if (this.rn(r, i), this.Ha) this.buildMesh(), this.Ga(), this.Wa(), this.Na = {},
|
|
15643
|
+
this.Ba = !1, this.Ha = !1, this.$a = !1; else if (this.Ba) {
|
|
15644
|
+
const t = this.atlas, e = this.Xa, n = this.Ya;
|
|
15645
|
+
delete this.atlas, delete this.Xa, delete this.Ya, this.buildMesh(t), this.Ga(e),
|
|
15646
|
+
this.Wa(n), this.Ba = !1, this.$a = !1;
|
|
15647
|
+
} else if (this.$a) {
|
|
15648
|
+
const t = this.Ya;
|
|
15649
|
+
delete this.Ya, this.Wa(t), this.$a = !1;
|
|
15650
|
+
}
|
|
15651
|
+
if (!this.meshes && !this.Ja && !this.qa) return void this.completeRender();
|
|
15652
|
+
this.Ka && (this.Za(), this.Ka = !1), this.Qa();
|
|
15653
15653
|
const s = !i || "default" === i;
|
|
15654
15654
|
let o = 0;
|
|
15655
|
-
0 === this.layer.options.meshRenderOrder && this.
|
|
15655
|
+
0 === this.layer.options.meshRenderOrder && this.el(r, o, i);
|
|
15656
15656
|
let a = 0;
|
|
15657
|
-
if (this.
|
|
15658
|
-
this.
|
|
15657
|
+
if (this.qa && (s || this.Ua.supportRenderMode(i))) {
|
|
15658
|
+
this.Ua.startFrame(r), this.Ua.addMesh(this.qa, null, {
|
|
15659
15659
|
bloom: this.nn.bloom
|
|
15660
|
-
}), this.
|
|
15660
|
+
}), this.Ua.prepareRender(r);
|
|
15661
15661
|
const t = r.polygonOffsetIndex || 0;
|
|
15662
15662
|
o = this.meshes && this.meshes.length ? o - 1 : o, r.polygonOffsetIndex = (r.polygonOffsetIndex || 0) + o,
|
|
15663
|
-
a = this.
|
|
15663
|
+
a = this.Ua.render(r).drawCount, r.polygonOffsetIndex = t;
|
|
15664
15664
|
}
|
|
15665
|
-
if (1 === this.layer.options.meshRenderOrder && this.
|
|
15666
|
-
const e = !this.nn.timestamp || this.nn.isFinalRender, i = !this.
|
|
15665
|
+
if (1 === this.layer.options.meshRenderOrder && this.el(r, a ? o - 1 : o, i), this.Ja && (s || this.Va.supportRenderMode(i))) {
|
|
15666
|
+
const e = !this.nn.timestamp || this.nn.isFinalRender, i = !this.nl || this.nl !== t;
|
|
15667
15667
|
n.options.collision && i && n.clearCollisionIndex();
|
|
15668
15668
|
const s = this.layer.options.sceneConfig;
|
|
15669
|
-
this.
|
|
15670
|
-
this.
|
|
15669
|
+
this.Va.sceneConfig.collision = !s || (!!yo(s.collision) || s.collision), this.Va.startFrame(r),
|
|
15670
|
+
this.Va.addMesh(this.Ja, null, {
|
|
15671
15671
|
bloom: this.nn.bloom
|
|
15672
|
-
}), this.
|
|
15673
|
-
e && (this.
|
|
15672
|
+
}), this.Va.prepareRender(r), n.options.collision && i && (this.Va.updateCollision(r),
|
|
15673
|
+
e && (this.nl = t)), this.Va.render(r);
|
|
15674
15674
|
}
|
|
15675
15675
|
(s || e && e.isFinalRender) && (this.completeRender(), this.layer.fire("canvasisdirty"));
|
|
15676
15676
|
}
|
|
@@ -15678,7 +15678,7 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15678
15678
|
const n = !e || "default" === e;
|
|
15679
15679
|
this.painter && (n || this.painter.supportRenderMode(e)) && this.painter.startFrame(t);
|
|
15680
15680
|
}
|
|
15681
|
-
|
|
15681
|
+
el(t, e, n) {
|
|
15682
15682
|
const i = !n || "default" === n;
|
|
15683
15683
|
if (this.painter && this.meshes && (i || this.painter.supportRenderMode(n))) {
|
|
15684
15684
|
this.painter.addMesh(this.meshes, null, {
|
|
@@ -15697,11 +15697,11 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15697
15697
|
isForeground() {
|
|
15698
15698
|
return !0;
|
|
15699
15699
|
}
|
|
15700
|
-
|
|
15700
|
+
ja() {
|
|
15701
15701
|
const t = {
|
|
15702
15702
|
regl: this.regl,
|
|
15703
15703
|
layer: this.layer,
|
|
15704
|
-
symbol: this.
|
|
15704
|
+
symbol: this.il,
|
|
15705
15705
|
gl: this.gl,
|
|
15706
15706
|
sceneConfig: this.layer.options.sceneConfig,
|
|
15707
15707
|
pluginIndex: 0,
|
|
@@ -15716,7 +15716,7 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15716
15716
|
getFrameTimestamp() {
|
|
15717
15717
|
return this.Qe;
|
|
15718
15718
|
}
|
|
15719
|
-
|
|
15719
|
+
rl(t, e) {
|
|
15720
15720
|
(t = t || e) === e && (e = null);
|
|
15721
15721
|
const n = [], i = [ 0, 0, 0, 0 ];
|
|
15722
15722
|
this.layer._sortGeometries();
|
|
@@ -15727,18 +15727,18 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15727
15727
|
const a = this.features[o];
|
|
15728
15728
|
if (Array.isArray(a)) for (let r = 0; r < a.length; r++) {
|
|
15729
15729
|
const s = a[r], o = s[Df];
|
|
15730
|
-
(!t || t[o] || e && (!e || e[o])) && (s.visible || (this.
|
|
15730
|
+
(!t || t[o] || e && (!e || e[o])) && (s.visible || (this.Ka = !0), this.sl(s.geometry, i, s.coordinates),
|
|
15731
15731
|
n.push(s));
|
|
15732
15732
|
} else {
|
|
15733
|
-
a.visible || (this.
|
|
15733
|
+
a.visible || (this.Ka = !0);
|
|
15734
15734
|
const r = a[Df];
|
|
15735
15735
|
if (t && !t[r] && (!e || e && !e[r])) continue;
|
|
15736
|
-
this.
|
|
15736
|
+
this.sl(a.geometry, i, a.coordinates), n.push(a);
|
|
15737
15737
|
}
|
|
15738
15738
|
}
|
|
15739
15739
|
if (n.length || (this.meshes && this.painter && (this.painter.deleteMesh(this.meshes),
|
|
15740
|
-
delete this.meshes), this.
|
|
15741
|
-
delete this.
|
|
15740
|
+
delete this.meshes), this.Ja && (this.Va.deleteMesh(this.Ja), delete this.Ja), this.qa && (this.Ua.deleteMesh(this.qa),
|
|
15741
|
+
delete this.qa)), 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()}`);
|
|
15742
15742
|
return {
|
|
15743
15743
|
features: n,
|
|
15744
15744
|
center: i
|
|
@@ -15757,12 +15757,12 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15757
15757
|
}).load();
|
|
15758
15758
|
}
|
|
15759
15759
|
createMesh(t, e, n, i, r, s) {
|
|
15760
|
-
return this.createVectorPacks(t, e, n, i, r, s).then((o => this.
|
|
15760
|
+
return this.createVectorPacks(t, e, n, i, r, s).then((o => this.ol(o, t, e, n, i, r, s)));
|
|
15761
15761
|
}
|
|
15762
|
-
|
|
15762
|
+
ol(t, e, n, i, r, a, l) {
|
|
15763
15763
|
if (!t) return null;
|
|
15764
15764
|
const h = e.createGeometries([ t.data ], No(r, null, 0, i, this.layer));
|
|
15765
|
-
for (let t = 0; t < h.length; t++) h[t] && this.
|
|
15765
|
+
for (let t = 0; t < h.length; t++) h[t] && this.Ii(h[t].geometry);
|
|
15766
15766
|
const u = o.identity([]);
|
|
15767
15767
|
o.translate(u, u, s.set([], l[0], l[1], 0)), o.scale(u, u, s.set([], 1, 1, this.tn));
|
|
15768
15768
|
const c = e.createMeshes(h, u, {
|
|
@@ -15781,22 +15781,22 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15781
15781
|
}
|
|
15782
15782
|
};
|
|
15783
15783
|
}
|
|
15784
|
-
|
|
15785
|
-
for (let i = 0; i < t.length; i++) if (Array.isArray(t[i][0])) for (let r = 0; r < t[i].length; r++) if (Array.isArray(t[i][r][0])) for (let s = 0; s < t[i][r].length; s++) isNaN(+t[i][r][s][0]) || isNaN(+t[i][r][s][1]) || this.
|
|
15784
|
+
sl(t, e, n) {
|
|
15785
|
+
for (let i = 0; i < t.length; i++) if (Array.isArray(t[i][0])) for (let r = 0; r < t[i].length; r++) if (Array.isArray(t[i][r][0])) for (let s = 0; s < t[i][r].length; s++) isNaN(+t[i][r][s][0]) || isNaN(+t[i][r][s][1]) || this.al(e, t[i][r][s][0], t[i][r][s][1], t[i][r][s][2], 1, n[i][r][s]); else isNaN(+t[i][r][0]) || isNaN(+t[i][r][1]) || this.al(e, t[i][r][0], t[i][r][1], t[i][r][2], 1, n[i][r]); else isNaN(+t[i][0]) || isNaN(+t[i][1]) || this.al(e, t[i][0], t[i][1], t[i][2], 1, n[i]);
|
|
15786
15786
|
}
|
|
15787
|
-
|
|
15787
|
+
al(t, e, n, i, r, s) {
|
|
15788
15788
|
const o = this.getMap().getProjection().isSphere();
|
|
15789
15789
|
let a = !1;
|
|
15790
15790
|
(s[0] > 180 || s[0] < -180) && (a = !0, o && console.warn(`Layer(${this.layer.getId()}) has invalid longitude value: ${s[0]}`)),
|
|
15791
15791
|
(s[1] > 90 || s[1] < -90) && (a = !0, o && console.warn(`Layer(${this.layer.getId()}) has invalid latitude value: ${s[1]}`)),
|
|
15792
15792
|
a || (t[0] += e, t[1] += n, t[2] += i || 0, t[3] += r);
|
|
15793
15793
|
}
|
|
15794
|
-
|
|
15794
|
+
Ii(t) {
|
|
15795
15795
|
const e = this.getMap().getGLRes(), n = t.properties;
|
|
15796
15796
|
n.tileResolution = e, n.tileRatio = 1, n.z = 1, n.tileExtent = 1, n.elements = t.elements,
|
|
15797
15797
|
n.aPickingId = t.data.aPickingId;
|
|
15798
15798
|
}
|
|
15799
|
-
|
|
15799
|
+
ll(t) {
|
|
15800
15800
|
return "win-intel-gpu-crash" === t && (this.layer.options.workarounds["win-intel-gpu-crash"] && Nf(this.gl));
|
|
15801
15801
|
}
|
|
15802
15802
|
prepareRequestors() {
|
|
@@ -15809,12 +15809,12 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15809
15809
|
return n && n(e) || e;
|
|
15810
15810
|
}
|
|
15811
15811
|
});
|
|
15812
|
-
const e = !this.
|
|
15812
|
+
const e = !this.ll("win-intel-gpu-crash");
|
|
15813
15813
|
this.se = new Js((e => {
|
|
15814
15814
|
t.getMap().getRenderer().callInNextFrame(e);
|
|
15815
|
-
}), t.options.glyphSdfLimitPerFrame, e), this.requestor = this.
|
|
15815
|
+
}), t.options.glyphSdfLimitPerFrame, e), this.requestor = this.hl.bind(this), this.ul = this.cl.bind(this);
|
|
15816
15816
|
}
|
|
15817
|
-
|
|
15817
|
+
hl(t, e, n) {
|
|
15818
15818
|
const i = [];
|
|
15819
15819
|
this.re.getIcons(t, ((t, e) => {
|
|
15820
15820
|
if (t) throw t;
|
|
@@ -15823,7 +15823,7 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15823
15823
|
}, i);
|
|
15824
15824
|
}));
|
|
15825
15825
|
}
|
|
15826
|
-
|
|
15826
|
+
cl(t, e, n) {
|
|
15827
15827
|
this.se.getGlyphs(e, ((e, i) => {
|
|
15828
15828
|
if (e) throw e;
|
|
15829
15829
|
const r = i.buffers || [];
|
|
@@ -15836,43 +15836,43 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15836
15836
|
}));
|
|
15837
15837
|
}));
|
|
15838
15838
|
}
|
|
15839
|
-
|
|
15840
|
-
const e = Object.keys(this.
|
|
15841
|
-
if (!e.length && !n.length) return void (this.
|
|
15842
|
-
delete this.
|
|
15843
|
-
const {features: i, center: r} = this.
|
|
15839
|
+
Ga(t) {
|
|
15840
|
+
const e = Object.keys(this.Da), n = Object.keys(this.La);
|
|
15841
|
+
if (!e.length && !n.length) return void (this.Ja && (this.Va.deleteMesh(this.Ja),
|
|
15842
|
+
delete this.Ja));
|
|
15843
|
+
const {features: i, center: r} = this.rl(this.Da, this.La), a = [], l = [];
|
|
15844
15844
|
for (let t = 0; t < i.length; t++) {
|
|
15845
15845
|
const e = i[t][Df];
|
|
15846
|
-
this.
|
|
15847
|
-
}
|
|
15848
|
-
if (!a.length && !l.length) return void (this.
|
|
15849
|
-
delete this.
|
|
15850
|
-
const h = this.
|
|
15851
|
-
this.
|
|
15852
|
-
const u = this.
|
|
15853
|
-
this
|
|
15846
|
+
this.Da[e] && a.push(i[t]), this.La[e] && l.push(i[t]);
|
|
15847
|
+
}
|
|
15848
|
+
if (!a.length && !l.length) return void (this.Ja && (this.Va.deleteMesh(this.Ja),
|
|
15849
|
+
delete this.Ja));
|
|
15850
|
+
const h = this.Ka;
|
|
15851
|
+
this.fl = r;
|
|
15852
|
+
const u = this.dl(a, l, t, r);
|
|
15853
|
+
this.Xa = {};
|
|
15854
15854
|
const c = [], f = [];
|
|
15855
|
-
this.
|
|
15856
|
-
if (this.
|
|
15857
|
-
const e = this.
|
|
15858
|
-
t && t.data))), this.
|
|
15859
|
-
for (let n = 0; n < e.length; n++) this.
|
|
15855
|
+
this.pl = !0, Promise.all(u).then((t => {
|
|
15856
|
+
if (this.Ja && (this.Va.deleteMesh(this.Ja), delete this.Ja), !t || !t.length) return void this.setToRedraw();
|
|
15857
|
+
const e = this.Va.createGeometries(t.map((t => (t && t.data && (t.data.isIdUnique = !0),
|
|
15858
|
+
t && t.data))), this.Oa);
|
|
15859
|
+
for (let n = 0; n < e.length; n++) this.Ii(e[n].geometry, t[n] && t[n].data);
|
|
15860
15860
|
const n = t[0] && t[0].data.iconAtlas, i = t[0] && t[0].data.glyphAtlas || t[1] && t[1].data.glyphAtlas;
|
|
15861
|
-
n && (this
|
|
15861
|
+
n && (this.Xa.iconAtlas = n), i && (this.Xa.glyphAtlas = i);
|
|
15862
15862
|
const a = o.identity([]);
|
|
15863
15863
|
o.translate(a, a, s.set(f, r[0], r[1], 0)), o.scale(a, a, s.set(c, 1, 1, this.tn));
|
|
15864
|
-
const l = this.
|
|
15864
|
+
const l = this.Va.createMeshes(e, a);
|
|
15865
15865
|
for (let t = 0; t < l.length; t++) l[t].geometry.properties.originElements = l[t].geometry.properties.elements.slice(),
|
|
15866
15866
|
l[t].properties.level = 0, l[t].material.set("flipY", 1), l[t].properties.meshKey = Of++;
|
|
15867
|
-
this.
|
|
15867
|
+
this.Ja = l, h && (this.Ka = !0), this.pl = !1, this.setToRedraw(), this.layer.fire("buildmarkermesh");
|
|
15868
15868
|
}));
|
|
15869
15869
|
}
|
|
15870
|
-
|
|
15871
|
-
if (this.
|
|
15872
|
-
this.
|
|
15873
|
-
if (this.meshes) for (let t = 0; t < this.meshes.length; t++) this.
|
|
15870
|
+
Za() {
|
|
15871
|
+
if (this.Ja && (this.ml(this.Ja[0], this.Da), this.ml(this.Ja[1], this.La), this.Ja[0] && this.Va.prepareCollideIndex(this.Ja[0].geometry),
|
|
15872
|
+
this.Ja[1] && this.Va.prepareCollideIndex(this.Ja[1].geometry)), this.qa) for (let t = 0; t < this.qa.length; t++) this.ml(this.qa[t], this.Ra);
|
|
15873
|
+
if (this.meshes) for (let t = 0; t < this.meshes.length; t++) this.ml(this.meshes[t], this.Oa);
|
|
15874
15874
|
}
|
|
15875
|
-
|
|
15875
|
+
ml(t, e) {
|
|
15876
15876
|
if (!t) return;
|
|
15877
15877
|
const {aPickingId: n, originElements: i} = t.geometry.properties, r = [];
|
|
15878
15878
|
for (let t = 0; t < i.length; t++) {
|
|
@@ -15882,11 +15882,11 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15882
15882
|
const s = t.geometry.properties.elements = new i.constructor(r);
|
|
15883
15883
|
t.geometry.setElements(s);
|
|
15884
15884
|
}
|
|
15885
|
-
|
|
15885
|
+
dl(t, e, n, i) {
|
|
15886
15886
|
const r = {
|
|
15887
15887
|
zoom: this.getMap().getZoom(),
|
|
15888
15888
|
EXTENT: 1 / 0,
|
|
15889
|
-
requestor: this.
|
|
15889
|
+
requestor: this.ul,
|
|
15890
15890
|
atlas: n,
|
|
15891
15891
|
center: i,
|
|
15892
15892
|
positionType: Float32Array,
|
|
@@ -15896,15 +15896,15 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15896
15896
|
markerHeightType: Uint16Array
|
|
15897
15897
|
}, s = uo({}, r);
|
|
15898
15898
|
r.allowEmptyPack = 1;
|
|
15899
|
-
return bs.splitPointSymbol(this.
|
|
15899
|
+
return bs.splitPointSymbol(this.yl).map(((n, i) => new bs(0 === i ? t : e, n, 0 === i ? r : s).load()));
|
|
15900
15900
|
}
|
|
15901
15901
|
updateMesh() {}
|
|
15902
|
-
|
|
15902
|
+
vl(t) {
|
|
15903
15903
|
const e = t._getInternalSymbol(), n = {
|
|
15904
15904
|
zoom: this.getMap().getZoom(),
|
|
15905
15905
|
isVector3D: !0
|
|
15906
|
-
}, i = this.
|
|
15907
|
-
if (!this.
|
|
15906
|
+
}, i = this.xl(t);
|
|
15907
|
+
if (!this.Ja) return !1;
|
|
15908
15908
|
let r = this.features[i];
|
|
15909
15909
|
Array.isArray(r) || (r = [ r ]);
|
|
15910
15910
|
const s = [], o = [], a = [], l = this.getMap().getZoom();
|
|
@@ -15914,14 +15914,14 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15914
15914
|
for (let t = 0; t < r.length; t++) {
|
|
15915
15915
|
if (!r[t]) continue;
|
|
15916
15916
|
const i = Array.isArray(e) ? e[t] : e, s = Array.isArray(h) ? h[t] : h, o = Array.isArray(u) ? u[t] : u, a = new Qr(r, i, s, o, n).getIconAndGlyph();
|
|
15917
|
-
if (!this
|
|
15917
|
+
if (!this.Xa || !bs.isAtlasLoaded(a, this.Xa)) return this.wl(), this.setToRedraw(),
|
|
15918
15918
|
!1;
|
|
15919
15919
|
}
|
|
15920
15920
|
for (let t = 0; t < r.length; t++) {
|
|
15921
15921
|
const e = r[t][Df];
|
|
15922
|
-
this.
|
|
15922
|
+
this.Da[e] && o.push(r[t]), this.La[e] && a.push(r[t]);
|
|
15923
15923
|
}
|
|
15924
|
-
const c = r[0].id, f = this.
|
|
15924
|
+
const c = r[0].id, f = this.dl(o, a, this.Xa, this.fl), d = this.Ja;
|
|
15925
15925
|
return Promise.all(f).then((t => {
|
|
15926
15926
|
for (let e = 0; e < t.length; e++) {
|
|
15927
15927
|
if (!t[e]) continue;
|
|
@@ -15939,12 +15939,12 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15939
15939
|
this.setToRedraw();
|
|
15940
15940
|
})), !0;
|
|
15941
15941
|
}
|
|
15942
|
-
|
|
15943
|
-
return this.
|
|
15942
|
+
Al(t) {
|
|
15943
|
+
return this.Ml(t, this.qa, this.Ya, this.Sl, this.Ua, ks, _f, this._l);
|
|
15944
15944
|
}
|
|
15945
|
-
|
|
15945
|
+
Ml(t, e, n, i, r, s, o, a) {
|
|
15946
15946
|
if (!e) return !1;
|
|
15947
|
-
if (!n) return this.
|
|
15947
|
+
if (!n) return this.wl(), this.setToRedraw(), !1;
|
|
15948
15948
|
const l = t._getInternalSymbol(), h = {
|
|
15949
15949
|
zoom: this.getMap().getZoom()
|
|
15950
15950
|
}, u = t[Tf];
|
|
@@ -15955,14 +15955,14 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15955
15955
|
const e = c[t];
|
|
15956
15956
|
if (!e) continue;
|
|
15957
15957
|
const i = Array.isArray(l) ? l[t] : l, r = Sr.genFnTypes(i), o = new Ft(c, i, r, h), a = s === ks ? o.getLineResource() : o.getPolygonResource();
|
|
15958
|
-
if (!Sr.isAtlasLoaded(a, n[t])) return this.
|
|
15958
|
+
if (!Sr.isAtlasLoaded(a, n[t])) return this.wl(), this.setToRedraw(), !1;
|
|
15959
15959
|
f.push(e);
|
|
15960
15960
|
}
|
|
15961
15961
|
const d = c[0].id, p = a.call(this, f);
|
|
15962
15962
|
for (let t = 0; t < p.length; t++) if (p[t].length) {
|
|
15963
15963
|
const n = e.filter((e => e.feaGroupIndex === t));
|
|
15964
|
-
if (!n.length) return this.
|
|
15965
|
-
if (n[0].geometry.properties.aFeaIds.indexOf(d) < 0) return this.
|
|
15964
|
+
if (!n.length) return this.wl(), this.setToRedraw(), !1;
|
|
15965
|
+
if (n[0].geometry.properties.aFeaIds.indexOf(d) < 0) return this.wl(), this.setToRedraw(),
|
|
15966
15966
|
!1;
|
|
15967
15967
|
}
|
|
15968
15968
|
const m = uo({}, o), y = p.map((t => this.createVectorPacks(r, s, m, t, n[0], i)));
|
|
@@ -15975,11 +15975,11 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15975
15975
|
break;
|
|
15976
15976
|
}
|
|
15977
15977
|
} else i = e;
|
|
15978
|
-
i && this.
|
|
15978
|
+
i && this.Pl(i, d, t[n]);
|
|
15979
15979
|
}
|
|
15980
15980
|
})), !0;
|
|
15981
15981
|
}
|
|
15982
|
-
|
|
15982
|
+
Pl(t, e, n) {
|
|
15983
15983
|
const i = t.geometry.properties.aFeaIds, r = i.indexOf(e);
|
|
15984
15984
|
if (!(r < 0)) {
|
|
15985
15985
|
if (n) {
|
|
@@ -15997,16 +15997,16 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
15997
15997
|
this.layer.fire("updatemesh"), this.setToRedraw();
|
|
15998
15998
|
}
|
|
15999
15999
|
}
|
|
16000
|
-
|
|
16001
|
-
if (!Object.keys(this.
|
|
16002
|
-
delete this.
|
|
16003
|
-
const {features: e, center: n} = this.
|
|
16000
|
+
Wa(t) {
|
|
16001
|
+
if (!Object.keys(this.Ra).length) return void (this.qa && (this.Ua.deleteMesh(this.qa),
|
|
16002
|
+
delete this.qa));
|
|
16003
|
+
const {features: e, center: n} = this.rl(this.Ra);
|
|
16004
16004
|
if (!e.length) return;
|
|
16005
|
-
const i = this.
|
|
16006
|
-
this.
|
|
16007
|
-
const r = this.
|
|
16008
|
-
this.
|
|
16009
|
-
this.
|
|
16005
|
+
const i = this.Ka;
|
|
16006
|
+
this.Sl = n;
|
|
16007
|
+
const r = this._l(e), s = uo({}, _f), o = r.map(((e, i) => this.createMesh(this.Ua, ks, s, e, t && t[i], n)));
|
|
16008
|
+
this.kl = !0, Promise.all(o).then((t => {
|
|
16009
|
+
this.qa && this.Ua.deleteMesh(this.qa);
|
|
16010
16010
|
const e = [], n = [];
|
|
16011
16011
|
for (let i = 0; i < t.length; i++) {
|
|
16012
16012
|
const r = t[i] && t[i].meshes;
|
|
@@ -16018,11 +16018,11 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
16018
16018
|
n[i] = t[i].atlas;
|
|
16019
16019
|
}
|
|
16020
16020
|
}
|
|
16021
|
-
this.
|
|
16021
|
+
this.qa = e, this.Ya = n, i && (this.Ka = i), this.kl = !1, this.setToRedraw(),
|
|
16022
16022
|
this.layer.fire("buildlinemesh");
|
|
16023
16023
|
}));
|
|
16024
16024
|
}
|
|
16025
|
-
|
|
16025
|
+
_l(t) {
|
|
16026
16026
|
const e = (Ef + "lineDasharray").trim(), n = (Ef + "linePatternFile").trim(), i = [], r = [], s = [];
|
|
16027
16027
|
for (let o = 0; o < t.length; o++) {
|
|
16028
16028
|
const a = t[o], l = a.properties && a.properties[e];
|
|
@@ -16030,13 +16030,13 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
16030
16030
|
}
|
|
16031
16031
|
return [ i, r, s ];
|
|
16032
16032
|
}
|
|
16033
|
-
|
|
16034
|
-
this.
|
|
16033
|
+
Tl() {
|
|
16034
|
+
this.Ba = !0, this.setToRedraw();
|
|
16035
16035
|
}
|
|
16036
|
-
|
|
16037
|
-
this.
|
|
16036
|
+
wl() {
|
|
16037
|
+
this.Ha = !0, this.setToRedraw();
|
|
16038
16038
|
}
|
|
16039
|
-
|
|
16039
|
+
Il(t) {
|
|
16040
16040
|
const e = this.layer.getId();
|
|
16041
16041
|
for (let n = 0; n < t.length; n++) {
|
|
16042
16042
|
const i = t[n];
|
|
@@ -16046,99 +16046,99 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
16046
16046
|
break;
|
|
16047
16047
|
}
|
|
16048
16048
|
if (!r) throw new Error(`${i.getJSONType()} can't be added to ${this.layer.getJSONType()}(id:${e}).`);
|
|
16049
|
-
this.
|
|
16049
|
+
this.xl(i);
|
|
16050
16050
|
}
|
|
16051
16051
|
}
|
|
16052
|
-
|
|
16052
|
+
xl(t) {
|
|
16053
16053
|
void 0 === t[Tf] && (t[Tf] = this.we++);
|
|
16054
16054
|
const e = t[Tf];
|
|
16055
|
-
this.features[e] && this.
|
|
16055
|
+
this.features[e] && this.Fl(e), this.features[e] = Ff(t, this.za, this.features[e]);
|
|
16056
16056
|
const n = this.features[e];
|
|
16057
|
-
return this.
|
|
16057
|
+
return this.Cl(n, e), this.Ca[e] = t, e;
|
|
16058
16058
|
}
|
|
16059
|
-
|
|
16059
|
+
Cl(t, e) {
|
|
16060
16060
|
if (!t) return;
|
|
16061
16061
|
const n = Array.isArray(t) ? t[0].id : t.id;
|
|
16062
|
-
if (this.
|
|
16062
|
+
if (this.Ea[n] = t, Array.isArray(t)) for (let n = 0; n < t.length; n++) {
|
|
16063
16063
|
const i = t[n][Df];
|
|
16064
|
-
if (t[n][Tf] = e, this.
|
|
16064
|
+
if (t[n][Tf] = e, this.Oa[i] = {
|
|
16065
16065
|
feature: t[n]
|
|
16066
|
-
}, this.
|
|
16066
|
+
}, this.Oa[i][Tf] = e, !this.needCheckPointLineSymbols()) continue;
|
|
16067
16067
|
const r = {
|
|
16068
16068
|
feature: t[n]
|
|
16069
16069
|
};
|
|
16070
|
-
(Vf(t[n]) || Uf(t[n])) && (this.
|
|
16070
|
+
(Vf(t[n]) || Uf(t[n])) && (this.Da[i] = r), Uf(t[n]) && (this.La[i] = r), Wf(t[n]) && (this.Ra[i] = r);
|
|
16071
16071
|
} else {
|
|
16072
16072
|
t[Tf] = e;
|
|
16073
16073
|
const n = {
|
|
16074
16074
|
feature: t
|
|
16075
16075
|
}, i = t[Df];
|
|
16076
|
-
if (this.
|
|
16077
|
-
(Vf(t) || Uf(t)) && (this.
|
|
16076
|
+
if (this.Oa[i] = n, !this.needCheckPointLineSymbols()) return;
|
|
16077
|
+
(Vf(t) || Uf(t)) && (this.Da[i] = n), Uf(t) && (this.La[i] = n), Wf(t) && (this.Ra[i] = n);
|
|
16078
16078
|
}
|
|
16079
16079
|
}
|
|
16080
16080
|
needCheckPointLineSymbols() {
|
|
16081
16081
|
return !0;
|
|
16082
16082
|
}
|
|
16083
|
-
|
|
16083
|
+
Fl(t) {
|
|
16084
16084
|
const e = this.features[t];
|
|
16085
16085
|
if (e) if (Array.isArray(e)) for (let t = 0; t < e.length; t++) {
|
|
16086
16086
|
const n = e[t][Df], i = e[t].id;
|
|
16087
|
-
delete this.
|
|
16087
|
+
delete this.Ea[i], delete this.Oa[n], delete this.Da[n], delete this.La[n], delete this.Ra[n];
|
|
16088
16088
|
} else {
|
|
16089
16089
|
const t = e[Df], n = e.id;
|
|
16090
|
-
delete this.
|
|
16090
|
+
delete this.Ea[n], delete this.Oa[t], delete this.Da[t], delete this.La[t], delete this.Ra[t];
|
|
16091
16091
|
}
|
|
16092
16092
|
}
|
|
16093
16093
|
pick(t, e, n) {
|
|
16094
16094
|
const i = [];
|
|
16095
16095
|
if (!this.layer.isVisible()) return i;
|
|
16096
|
-
return [ this.painter, this.
|
|
16096
|
+
return [ this.painter, this.Va, this.Ua ].forEach((r => {
|
|
16097
16097
|
if (!r) return;
|
|
16098
16098
|
const s = r.pick(t, e, n.tolerance);
|
|
16099
16099
|
if (s && s.data && s.data.feature) {
|
|
16100
|
-
const t = s.data.feature, e = this.
|
|
16100
|
+
const t = s.data.feature, e = this.Ca[t[Tf]];
|
|
16101
16101
|
n && n.includeInternals ? i.push(e) : (s.geometry = e, delete s.plugin, delete s.data,
|
|
16102
16102
|
delete s.point, i.push(s));
|
|
16103
16103
|
}
|
|
16104
16104
|
})), i;
|
|
16105
16105
|
}
|
|
16106
|
-
|
|
16106
|
+
Ol(t) {
|
|
16107
16107
|
const e = t[Tf], n = this.features[e];
|
|
16108
16108
|
return Array.isArray(n) ? n[0][Df] : n[Df];
|
|
16109
16109
|
}
|
|
16110
|
-
|
|
16110
|
+
Qa() {
|
|
16111
16111
|
let t = !1;
|
|
16112
|
-
for (const e in this.
|
|
16113
|
-
const n = this.
|
|
16114
|
-
if (!this.
|
|
16115
|
-
const e = this.
|
|
16112
|
+
for (const e in this.Na) {
|
|
16113
|
+
const n = this.Na[e], i = this.Ol(n);
|
|
16114
|
+
if (!this.pl && (this.Da[i] || this.La[i])) {
|
|
16115
|
+
const e = this.vl(n);
|
|
16116
16116
|
t = t || e;
|
|
16117
16117
|
}
|
|
16118
|
-
if (!this.
|
|
16119
|
-
const e = this.
|
|
16118
|
+
if (!this.kl && this.Ra[i]) {
|
|
16119
|
+
const e = this.Al(n);
|
|
16120
16120
|
t = t || e;
|
|
16121
16121
|
}
|
|
16122
|
-
if (!this.
|
|
16122
|
+
if (!this.El) {
|
|
16123
16123
|
const e = this.updateMesh(n);
|
|
16124
16124
|
t = t || e;
|
|
16125
16125
|
}
|
|
16126
16126
|
}
|
|
16127
|
-
this.
|
|
16127
|
+
this.Na = {}, t && (zf(this), this.layer.fire("partialupdate"));
|
|
16128
16128
|
}
|
|
16129
|
-
|
|
16130
|
-
this.
|
|
16129
|
+
Dl(t) {
|
|
16130
|
+
this.xl(t), this.wl(), zf(this);
|
|
16131
16131
|
}
|
|
16132
16132
|
onGeometryAdd(t) {
|
|
16133
|
-
this.setToRedraw(), this.canvas && t && t.length && (this.
|
|
16133
|
+
this.setToRedraw(), this.canvas && t && t.length && (this.Il(t), this.wl(), zf(this));
|
|
16134
16134
|
}
|
|
16135
16135
|
onGeometryRemove(t) {
|
|
16136
16136
|
if (t && t.length) {
|
|
16137
16137
|
for (let e = 0; e < t.length; e++) {
|
|
16138
16138
|
const n = t[e][Tf];
|
|
16139
|
-
void 0 !== n && (delete this.
|
|
16139
|
+
void 0 !== n && (delete this.Ca[n], this.Fl(n), delete this.features[n]);
|
|
16140
16140
|
}
|
|
16141
|
-
this.
|
|
16141
|
+
this.wl(), zf(this);
|
|
16142
16142
|
}
|
|
16143
16143
|
}
|
|
16144
16144
|
onGeometrySymbolChange(t) {
|
|
@@ -16154,35 +16154,35 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
16154
16154
|
for (const e in i) i[e] && uo(t, i[e]);
|
|
16155
16155
|
i = t;
|
|
16156
16156
|
}
|
|
16157
|
-
for (const t in i) if (xo(i, t) && oo[t]) return void this.
|
|
16157
|
+
for (const t in i) if (xo(i, t) && oo[t]) return void this.Dl(e);
|
|
16158
16158
|
const r = e._getInternalSymbol(), s = this.features[n];
|
|
16159
|
-
if (this.
|
|
16159
|
+
if (this.xl(e), s) if (function(t, e) {
|
|
16160
16160
|
return Array.isArray(t) ? !!Array.isArray(e) && t.length === e.length : !Array.isArray(e);
|
|
16161
16161
|
}(r, s)) {
|
|
16162
16162
|
if (Array.isArray(r)) for (let t = 0; t < r.length; t++) {
|
|
16163
|
-
if (!$f(r[t], s[t])) return void this.
|
|
16164
|
-
} else if (!$f(r, s)) return void this.
|
|
16163
|
+
if (!$f(r[t], s[t])) return void this.Dl(e);
|
|
16164
|
+
} else if (!$f(r, s)) return void this.Dl(e);
|
|
16165
16165
|
this.onGeometryPositionChange(t);
|
|
16166
|
-
} else this.
|
|
16166
|
+
} else this.Dl(e); else this.Dl(e);
|
|
16167
16167
|
}
|
|
16168
16168
|
onGeometryShapeChange(t) {
|
|
16169
16169
|
const e = t.target._getParent() || t.target;
|
|
16170
|
-
void 0 !== e[Tf] && (this.
|
|
16170
|
+
void 0 !== e[Tf] && (this.Il([ e ]), this.Tl(), zf(this));
|
|
16171
16171
|
}
|
|
16172
16172
|
onGeometryPositionChange(t) {
|
|
16173
16173
|
const e = t.target._getParent() || t.target, n = e[Tf];
|
|
16174
|
-
void 0 !== n && (this.
|
|
16174
|
+
void 0 !== n && (this.Il([ e ]), this.Na[n] = e, zf(this));
|
|
16175
16175
|
}
|
|
16176
16176
|
onGeometryZIndexChange(t) {
|
|
16177
|
-
void 0 !== (t.target._getParent() || t.target)[Tf] && this.
|
|
16177
|
+
void 0 !== (t.target._getParent() || t.target)[Tf] && this.wl();
|
|
16178
16178
|
}
|
|
16179
16179
|
onGeometryShow(t) {
|
|
16180
|
-
void 0 !== (t.target._getParent() || t.target)[Tf] && this.
|
|
16180
|
+
void 0 !== (t.target._getParent() || t.target)[Tf] && this.Ll(t);
|
|
16181
16181
|
}
|
|
16182
16182
|
onGeometryHide(t) {
|
|
16183
|
-
void 0 !== (t.target._getParent() || t.target)[Tf] && this.
|
|
16183
|
+
void 0 !== (t.target._getParent() || t.target)[Tf] && this.Ll(t);
|
|
16184
16184
|
}
|
|
16185
|
-
|
|
16185
|
+
Ll(t) {
|
|
16186
16186
|
const e = t.target._getParent() || t.target, n = e[Tf], i = this.features[n];
|
|
16187
16187
|
if (i) {
|
|
16188
16188
|
const t = e.isVisible();
|
|
@@ -16193,16 +16193,16 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
16193
16193
|
if (t === i.visible) return;
|
|
16194
16194
|
i.visible = t;
|
|
16195
16195
|
}
|
|
16196
|
-
this.
|
|
16196
|
+
this.Rl(), zf(this);
|
|
16197
16197
|
}
|
|
16198
16198
|
}
|
|
16199
|
-
|
|
16200
|
-
this.
|
|
16199
|
+
Rl() {
|
|
16200
|
+
this.Ka = !0;
|
|
16201
16201
|
}
|
|
16202
16202
|
onGeometryPropertiesChange(t) {
|
|
16203
16203
|
const e = t.target._getParent() || t.target, n = e[Tf];
|
|
16204
|
-
void 0 !== n && (this.features[n] = Ff(e, this.
|
|
16205
|
-
this.
|
|
16204
|
+
void 0 !== n && (this.features[n] = Ff(e, this.za), this.Cl(this.features[n], n),
|
|
16205
|
+
this.wl(), zf(this));
|
|
16206
16206
|
}
|
|
16207
16207
|
createContext() {
|
|
16208
16208
|
const t = this.canvas.gl && this.canvas.gl.wrap;
|
|
@@ -16213,29 +16213,29 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
16213
16213
|
const e = Ea.get3DPainterClass("icon");
|
|
16214
16214
|
let n = e.getBloomSymbol();
|
|
16215
16215
|
const i = uo({}, Mf, Sf);
|
|
16216
|
-
i.markerPerspectiveRatio = this.layer.options.markerPerspectiveRatio || 0, this.
|
|
16217
|
-
this.
|
|
16216
|
+
i.markerPerspectiveRatio = this.layer.options.markerPerspectiveRatio || 0, this.Hl(i, n),
|
|
16217
|
+
this.yl = i;
|
|
16218
16218
|
const r = uo({}, ko, this.layer.options.sceneConfig || {});
|
|
16219
|
-
this.
|
|
16219
|
+
this.Va = new e(this.regl, this.layer, i, r, 0), this.Va.setTextShaderDefines({
|
|
16220
16220
|
REVERSE_MAP_ROTATION_ON_PITCH: 1
|
|
16221
16221
|
});
|
|
16222
16222
|
const s = Ea.get3DPainterClass("line"), o = uo({}, _f);
|
|
16223
|
-
n = s.getBloomSymbol(), this.
|
|
16223
|
+
n = s.getBloomSymbol(), this.Hl(o, n), this.zl = o;
|
|
16224
16224
|
const a = uo({}, this.layer.options.sceneConfig || {});
|
|
16225
|
-
void 0 === a.depthMask && (a.depthMask = !0), this.
|
|
16225
|
+
void 0 === a.depthMask && (a.depthMask = !0), this.Ua = new s(this.regl, this.layer, o, a, 0),
|
|
16226
16226
|
this.layer.getGeometries() && this.onGeometryAdd(this.layer.getGeometries());
|
|
16227
16227
|
}
|
|
16228
16228
|
Be() {
|
|
16229
16229
|
return !!(this.canvas && this.canvas.gl && this.canvas.gl.wrap);
|
|
16230
16230
|
}
|
|
16231
|
-
|
|
16231
|
+
Hl(t, e) {
|
|
16232
16232
|
for (let n = 0; n < e.length; n++) t[e[n]] = this.layer.options.enableBloom;
|
|
16233
16233
|
}
|
|
16234
16234
|
updateBloom(t) {
|
|
16235
|
-
this.
|
|
16236
|
-
this.painter && this.
|
|
16235
|
+
this.Va && this.Nl(this.Va, this.yl, t), this.Ua && this.Nl(this.Ua, this.zl, t),
|
|
16236
|
+
this.painter && this.Nl(this.painter, this.painterSymbol, t);
|
|
16237
16237
|
}
|
|
16238
|
-
|
|
16238
|
+
Nl(t, e, n) {
|
|
16239
16239
|
const i = t.constructor.getBloomSymbol().reduce(((t, i) => (t[i] = n, e[i] = n,
|
|
16240
16240
|
t)), {});
|
|
16241
16241
|
t.updateSymbol(i, e);
|
|
@@ -16282,18 +16282,18 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
16282
16282
|
}
|
|
16283
16283
|
onRemove() {
|
|
16284
16284
|
super.onRemove(), this.painter && (this.painter.delete(), delete this.painter),
|
|
16285
|
-
this.
|
|
16285
|
+
this.Va && (this.Va.delete(), delete this.Va), this.Ua && (this.Ua.delete(), delete this.Ua);
|
|
16286
16286
|
}
|
|
16287
16287
|
drawOutline(t) {
|
|
16288
|
-
if (this.dn && (this.painter && this.painter.outlineAll(t), this.
|
|
16289
|
-
this.
|
|
16290
|
-
this.
|
|
16288
|
+
if (this.dn && (this.painter && this.painter.outlineAll(t), this.Va.outlineAll(t),
|
|
16289
|
+
this.Ua.outlineAll(t)), this.Vl) for (let e = 0; e < this.Vl.length; e++) this.painter && this.painter.outline(t, this.Vl[e]),
|
|
16290
|
+
this.Va.outline(t, this.Vl[e]), this.Ua.outline(t, this.Vl[e]);
|
|
16291
16291
|
}
|
|
16292
16292
|
outlineAll() {
|
|
16293
16293
|
this.dn = !0, this.setToRedraw();
|
|
16294
16294
|
}
|
|
16295
16295
|
outline(t) {
|
|
16296
|
-
this.
|
|
16296
|
+
this.Vl || (this.Vl = []);
|
|
16297
16297
|
const e = [];
|
|
16298
16298
|
for (let n = 0; n < t.length; n++) {
|
|
16299
16299
|
const i = this.layer.getGeometryById(t[n]);
|
|
@@ -16302,10 +16302,10 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
16302
16302
|
if (Array.isArray(t)) for (let n = 0; n < t.length; n++) e.push(t[n].id); else e.push(t.id);
|
|
16303
16303
|
}
|
|
16304
16304
|
}
|
|
16305
|
-
this.
|
|
16305
|
+
this.Vl.push(e), this.setToRedraw();
|
|
16306
16306
|
}
|
|
16307
16307
|
cancelOutline() {
|
|
16308
|
-
delete this.dn, delete this.
|
|
16308
|
+
delete this.dn, delete this.Vl, this.setToRedraw();
|
|
16309
16309
|
}
|
|
16310
16310
|
isEnableWorkAround(t) {
|
|
16311
16311
|
return "win-intel-gpu-crash" === t && (this.layer.options.workarounds["win-intel-gpu-crash"] && Nf(this.gl));
|
|
@@ -16313,11 +16313,11 @@ class Hf extends t.renderer.CanvasRenderer {
|
|
|
16313
16313
|
en(t) {
|
|
16314
16314
|
return bo(t, this.getMap());
|
|
16315
16315
|
}
|
|
16316
|
-
|
|
16316
|
+
Ai() {
|
|
16317
16317
|
const t = this.layer.getGeometries();
|
|
16318
|
-
t && this.
|
|
16318
|
+
t && this.Il(t), this.wl();
|
|
16319
16319
|
}
|
|
16320
|
-
|
|
16320
|
+
Bn() {
|
|
16321
16321
|
const t = this.layer.options.opacity;
|
|
16322
16322
|
return this.Be() ? yo(t) ? 1 : t : 1;
|
|
16323
16323
|
}
|
|
@@ -16433,25 +16433,25 @@ Jf.registerRenderer("gl", class extends Hf {
|
|
|
16433
16433
|
const t = Ea.get3DPainterClass("line-gradient");
|
|
16434
16434
|
this.painterSymbol = uo({}, {
|
|
16435
16435
|
lineGradientProperty: qf
|
|
16436
|
-
}, _f), this.
|
|
16436
|
+
}, _f), this.Hl(this.painterSymbol, t.getBloomSymbol());
|
|
16437
16437
|
const e = uo({}, this.layer.options.sceneConfig || {});
|
|
16438
16438
|
void 0 === e.depthMask && (e.depthMask = !0);
|
|
16439
16439
|
return new t(this.regl, this.layer, this.painterSymbol, e, 0);
|
|
16440
16440
|
}
|
|
16441
16441
|
buildMesh() {
|
|
16442
|
-
let {features: t, center: e} = this.
|
|
16442
|
+
let {features: t, center: e} = this.rl();
|
|
16443
16443
|
if (t = t.filter((t => !!t.properties[qf])), !t.length) return;
|
|
16444
|
-
const n = this.
|
|
16445
|
-
this.
|
|
16444
|
+
const n = this.Ka;
|
|
16445
|
+
this.Ul = e;
|
|
16446
16446
|
const i = uo({}, this.painterSymbol), r = this.createMesh(this.painter, ks, i, t, null, e);
|
|
16447
|
-
this.
|
|
16447
|
+
this.El = !0, r.then((t => {
|
|
16448
16448
|
this.meshes && this.painter.deleteMesh(this.meshes);
|
|
16449
16449
|
const e = [], i = t && t.meshes;
|
|
16450
16450
|
if (i) {
|
|
16451
16451
|
e.push(...i);
|
|
16452
16452
|
for (let t = 0; t < i.length; t++) i[t].feaGroupIndex = 0, i[t].geometry.properties.originElements = i[t].geometry.properties.elements.slice();
|
|
16453
16453
|
}
|
|
16454
|
-
this.meshes = e, n && (this.
|
|
16454
|
+
this.meshes = e, n && (this.Ka = n), this.El = !1, this.setToRedraw();
|
|
16455
16455
|
}));
|
|
16456
16456
|
}
|
|
16457
16457
|
}), Jf.registerRenderer("canvas", null);
|
|
@@ -16525,12 +16525,12 @@ class Qf extends Hf {
|
|
|
16525
16525
|
return this.options.altitude > 0 ? 0 : 2;
|
|
16526
16526
|
}
|
|
16527
16527
|
buildMesh(t) {
|
|
16528
|
-
const {features: e, center: n} = this.
|
|
16528
|
+
const {features: e, center: n} = this.rl();
|
|
16529
16529
|
if (!e.length) return;
|
|
16530
|
-
const i = this.
|
|
16531
|
-
this.
|
|
16532
|
-
const r = this.
|
|
16533
|
-
this.
|
|
16530
|
+
const i = this.Ka;
|
|
16531
|
+
this.Ul = n;
|
|
16532
|
+
const r = this.jl(e), s = uo({}, Zf), o = r.map(((e, i) => this.createMesh(this.painter, js, s, e, t && t[i], n)));
|
|
16533
|
+
this.El = !0, Promise.all(o).then((t => {
|
|
16534
16534
|
this.meshes && this.painter.deleteMesh(this.meshes), t = function(t) {
|
|
16535
16535
|
const e = [];
|
|
16536
16536
|
for (let n = 0; n < t.length; n++) Array.isArray(t[n]) ? e.push(...t[n]) : e.push(t[n]);
|
|
@@ -16546,7 +16546,7 @@ class Qf extends Hf {
|
|
|
16546
16546
|
n[i] = t[i].atlas;
|
|
16547
16547
|
}
|
|
16548
16548
|
}
|
|
16549
|
-
this.meshes = e, this.atlas = n, i && (this.
|
|
16549
|
+
this.meshes = e, this.atlas = n, i && (this.Ka = i), this.El = !1, this.setToRedraw(),
|
|
16550
16550
|
this.layer.fire("buildmesh");
|
|
16551
16551
|
}));
|
|
16552
16552
|
}
|
|
@@ -16554,9 +16554,9 @@ class Qf extends Hf {
|
|
|
16554
16554
|
const n = this.painter.getRayCastData(t, e);
|
|
16555
16555
|
if (!n || !n.feature) return null;
|
|
16556
16556
|
const i = n.feature[Tf];
|
|
16557
|
-
return this.
|
|
16557
|
+
return this.Ca[i];
|
|
16558
16558
|
}
|
|
16559
|
-
|
|
16559
|
+
jl(t) {
|
|
16560
16560
|
const e = [], n = [];
|
|
16561
16561
|
for (let i = 0; i < t.length; i++) {
|
|
16562
16562
|
const r = t[i];
|
|
@@ -16566,11 +16566,11 @@ class Qf extends Hf {
|
|
|
16566
16566
|
}
|
|
16567
16567
|
createPainter() {
|
|
16568
16568
|
const t = Ea.get3DPainterClass("fill"), e = this.painterSymbol = uo({}, Zf);
|
|
16569
|
-
this.
|
|
16569
|
+
this.Hl(e, t.getBloomSymbol());
|
|
16570
16570
|
return new t(this.regl, this.layer, e, this.layer.options.sceneConfig, 0);
|
|
16571
16571
|
}
|
|
16572
16572
|
updateMesh(t) {
|
|
16573
|
-
return this.
|
|
16573
|
+
return this.Ml(t, this.meshes, this.atlas, this.Ul, this.painter, js, Zf, this.jl);
|
|
16574
16574
|
}
|
|
16575
16575
|
}
|
|
16576
16576
|
|
|
@@ -17316,7 +17316,7 @@ class Zd extends Ea {
|
|
|
17316
17316
|
let e = !1;
|
|
17317
17317
|
this.options.sideMaterial || (this.options.sideMaterial = {}, e = !0), t ? uo(this.options.sideMaterial, t) : this.options.sideMaterial = null;
|
|
17318
17318
|
const n = this.getRenderer();
|
|
17319
|
-
return n && (e && n.
|
|
17319
|
+
return n && (e && n.Gl(), n.updateSideMaterial(t)), this;
|
|
17320
17320
|
}
|
|
17321
17321
|
updateDataConfig(t) {
|
|
17322
17322
|
if (!t) return this;
|
|
@@ -17362,7 +17362,7 @@ Zd.registerRenderer("gl", class extends Qf {
|
|
|
17362
17362
|
constructor(...e) {
|
|
17363
17363
|
super(...e), this.GeometryTypes = [ t.Polygon, t.MultiPolygon ];
|
|
17364
17364
|
}
|
|
17365
|
-
|
|
17365
|
+
jl(t) {
|
|
17366
17366
|
return [ t ];
|
|
17367
17367
|
}
|
|
17368
17368
|
onConfig(t) {
|
|
@@ -17371,21 +17371,21 @@ Zd.registerRenderer("gl", class extends Qf {
|
|
|
17371
17371
|
}));
|
|
17372
17372
|
}
|
|
17373
17373
|
updateMaterial(t) {
|
|
17374
|
-
this.painter && (this.painter.
|
|
17374
|
+
this.painter && (this.painter.bo(t), this.layer.options.sideMaterial || this.sidePainter.bo(t),
|
|
17375
17375
|
this.setToRedraw());
|
|
17376
17376
|
}
|
|
17377
|
-
|
|
17377
|
+
Gl() {
|
|
17378
17378
|
this.sidePainter && this.sidePainter.deleteMaterial();
|
|
17379
17379
|
}
|
|
17380
17380
|
updateSideMaterial(t) {
|
|
17381
|
-
this.sidePainter && (t ? this.sidePainter.
|
|
17382
|
-
this.sidePainter.
|
|
17381
|
+
this.sidePainter && (t ? this.sidePainter.bo(t) : (this.sidePainter.deleteMaterial(),
|
|
17382
|
+
this.sidePainter.bo(this.layer.options.material)), this.setToRedraw());
|
|
17383
17383
|
}
|
|
17384
17384
|
updateDataConfig(t, e) {
|
|
17385
|
-
this.painter && (this.painter.updateDataConfig(t, e), this.
|
|
17385
|
+
this.painter && (this.painter.updateDataConfig(t, e), this.wl());
|
|
17386
17386
|
}
|
|
17387
17387
|
updateBloom(t) {
|
|
17388
|
-
super.updateBloom(t), this.sidePainter && this.
|
|
17388
|
+
super.updateBloom(t), this.sidePainter && this.Nl(this.sidePainter, this.sidePainterSymbol, t);
|
|
17389
17389
|
}
|
|
17390
17390
|
needCheckPointLineSymbols() {
|
|
17391
17391
|
return !1;
|
|
@@ -17395,7 +17395,7 @@ Zd.registerRenderer("gl", class extends Qf {
|
|
|
17395
17395
|
}
|
|
17396
17396
|
createPainter() {
|
|
17397
17397
|
const t = Ea.get3DPainterClass("lit");
|
|
17398
|
-
this.painterSymbol = uo({}, Qd), this.sidePainterSymbol = uo({}, Qd), this.
|
|
17398
|
+
this.painterSymbol = uo({}, Qd), this.sidePainterSymbol = uo({}, Qd), this.Hl(this.painterSymbol, t.getBloomSymbol());
|
|
17399
17399
|
const e = this.layer, n = uo({}, tp, e.options.dataConfig || {});
|
|
17400
17400
|
e.options.material && (this.painterSymbol.material = e.options.material), e.options.sideMaterial ? this.sidePainterSymbol.material = e.options.sideMaterial : this.sidePainterSymbol.material = e.options.material;
|
|
17401
17401
|
const i = {
|
|
@@ -17419,37 +17419,37 @@ Zd.registerRenderer("gl", class extends Qf {
|
|
|
17419
17419
|
const e = this.painter;
|
|
17420
17420
|
this.painter = this.sidePainter, super.rn(...t), this.painter = e;
|
|
17421
17421
|
}
|
|
17422
|
-
|
|
17422
|
+
el(...t) {
|
|
17423
17423
|
const e = t[0], n = e.sceneFilter;
|
|
17424
17424
|
e.sceneFilter = t => (!n || n(t)) && ep(t);
|
|
17425
|
-
const i = super.
|
|
17425
|
+
const i = super.el(...t);
|
|
17426
17426
|
e.sceneFilter = t => (!n || n(t)) && ep(t);
|
|
17427
17427
|
const r = this.painter;
|
|
17428
17428
|
this.painter = this.sidePainter;
|
|
17429
17429
|
const s = e.sceneFilter = t => (!n || n(t)) && (t => 1 === t.properties.side)(t);
|
|
17430
|
-
return super.
|
|
17430
|
+
return super.el(...t), this.painter = r, e.sceneFilter = n, {
|
|
17431
17431
|
redraw: i.redraw || s.redraw,
|
|
17432
17432
|
drawCount: (i.drawCount || 0) + (s.drawCount || 0)
|
|
17433
17433
|
};
|
|
17434
17434
|
}
|
|
17435
17435
|
createMesh(t, e, n, i, r, s) {
|
|
17436
17436
|
const o = [];
|
|
17437
|
-
this.
|
|
17438
|
-
const a = this.
|
|
17437
|
+
this.Wl = s;
|
|
17438
|
+
const a = this.Bl(i, n, !0, !1), l = this.Bl(i, n, !1, !0);
|
|
17439
17439
|
if (a) {
|
|
17440
|
-
const r = this.
|
|
17440
|
+
const r = this.ol(a, t, e, n, i, null, s);
|
|
17441
17441
|
r.meshes[0].properties.top = 1, o.push(r);
|
|
17442
17442
|
}
|
|
17443
17443
|
if (l) {
|
|
17444
|
-
const r = this.
|
|
17444
|
+
const r = this.ol(l, t, e, n, i, null, s);
|
|
17445
17445
|
r.meshes[0].properties.side = 1, o.push(r);
|
|
17446
17446
|
}
|
|
17447
17447
|
return o;
|
|
17448
17448
|
}
|
|
17449
|
-
|
|
17449
|
+
Bl(e, n, i, r) {
|
|
17450
17450
|
const s = this.getMap();
|
|
17451
17451
|
n = Qd;
|
|
17452
|
-
const o = this.
|
|
17452
|
+
const o = this.Wl, a = 1 / 0, l = s.getZoom(), h = new t.Point(0, 0), u = new t.Coordinate(0, 0), c = uo({}, tp, this.layer.options.dataConfig);
|
|
17453
17453
|
if (c.uv = !0, c.top && (c.top = i), c.side && (c.side = r), !1 === c.top && !1 === c.side) return null;
|
|
17454
17454
|
if (!e.length) return null;
|
|
17455
17455
|
const f = s.getGLRes(), d = s.getProjection().code, p = i ? this.painterSymbol && this.painterSymbol.material : this.sidePainterSymbol && this.sidePainterSymbol.material, m = p && p.textureWidth || 23.25, y = [ aa(s, 1, u, f) / 100, aa(s, 1, u, f, 1) / 100 ];
|
|
@@ -17459,13 +17459,13 @@ Zd.registerRenderer("gl", class extends Qf {
|
|
|
17459
17459
|
const e = t[Tf];
|
|
17460
17460
|
let n = this.features[e];
|
|
17461
17461
|
if (!n || !this.meshes) return;
|
|
17462
|
-
const i = this.
|
|
17462
|
+
const i = this.Bl([ n ], this.painterSymbol, !0, !1);
|
|
17463
17463
|
let r = 0;
|
|
17464
|
-
i && i.data && this.
|
|
17465
|
-
const s = this.
|
|
17466
|
-
s && s.data && this.
|
|
17464
|
+
i && i.data && this.Pl(this.meshes[r++], n.id, i);
|
|
17465
|
+
const s = this.Bl([ n ], this.painterSymbol, !1, !0);
|
|
17466
|
+
s && s.data && this.Pl(this.meshes[r++], n.id, s);
|
|
17467
17467
|
}
|
|
17468
|
-
|
|
17468
|
+
xl(e) {
|
|
17469
17469
|
if (e.getProperties() || e.setProperties({}), !e.getProperties()[Ho]) {
|
|
17470
17470
|
const n = e.getCoordinates();
|
|
17471
17471
|
if (e instanceof t.MultiPolygon) {
|
|
@@ -17480,7 +17480,7 @@ Zd.registerRenderer("gl", class extends Qf {
|
|
|
17480
17480
|
e.getProperties()[Ho] = t;
|
|
17481
17481
|
}
|
|
17482
17482
|
}
|
|
17483
|
-
return super.
|
|
17483
|
+
return super.xl(e);
|
|
17484
17484
|
}
|
|
17485
17485
|
resizeCanvas(t) {
|
|
17486
17486
|
super.resizeCanvas(t), this.sidePainter && this.sidePainter.resize(this.canvas.width, this.canvas.height);
|
|
@@ -17490,7 +17490,7 @@ Zd.registerRenderer("gl", class extends Qf {
|
|
|
17490
17490
|
}
|
|
17491
17491
|
drawOutline(t) {
|
|
17492
17492
|
if (super.drawOutline(t), this.dn && this.sidePainter && this.sidePainter.outlineAll(t),
|
|
17493
|
-
this.
|
|
17493
|
+
this.Vl) for (let e = 0; e < this.Vl.length; e++) this.sidePainter && this.sidePainter.outline(t, this.Vl[e]);
|
|
17494
17494
|
}
|
|
17495
17495
|
getShadowMeshes() {
|
|
17496
17496
|
return this.painter ? this.painter.getShadowMeshes() : [];
|
|
@@ -17509,5 +17509,5 @@ if (i.mat4.create(), i.transcoders) {
|
|
|
17509
17509
|
|
|
17510
17510
|
export { Zd as ExtrudePolygonLayer, Rl as FillPainter, rf as FillPlugin, lr as FilterUtil, pf as GLTFPhongPlugin, mf as GLTFStandardPlugin, bf as GeoJSONVectorTileLayer, yf as HeatmapPlugin, bu as IconPainter, af as IconPlugin, of as LineGradientPlugin, Vl as LinePainter, sf as LinePlugin, Jf as LineStringLayer, ff as LitPlugin, vf as MapboxVectorTileLayer, dc as NativeLinePainter, hf as NativeLinePlugin, uc as NativePointPainter, Qs as PackUtil, Pc as PhongPainter, uf as PhongPlugin, Yf as PointLayer, Kf as PolygonLayer, oo as SYMBOLS_NEED_REBUILD_IN_VECTOR, so as SYMBOLS_NEED_REBUILD_IN_VT, sc as TextPainter, lf as TextPlugin, df as TubePlugin, Ea as Vector3DLayer, _a as VectorTileLayer, pa as VectorTileLayerRenderer, gf as WaterPlugin, Tc as WireframePainter, cf as WireframePlugin };
|
|
17511
17511
|
|
|
17512
|
-
"undefined" != typeof console && console.log("@maptalks/vt v0.97.
|
|
17512
|
+
"undefined" != typeof console && console.log("@maptalks/vt v0.97.2");
|
|
17513
17513
|
//# sourceMappingURL=maptalks.vt.es.js.map
|