Selaa lähdekoodia

Update DrawPolygon.js

clone一份数据,PolygonHierarchy会修改this._positions原始数据,导致_stopdHook转换之后的高度异常
tags/3.0.0
Disappear520 2 vuotta sitten
vanhempi
commit
0b052bae23
No account linked to committer's email address
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3
    1
      modules/plot/draw/DrawPolygon.js

+ 3
- 1
modules/plot/draw/DrawPolygon.js Näytä tiedosto

@@ -34,7 +34,9 @@ class DrawPolygon extends Draw {
...this._style,
hierarchy: new Cesium.CallbackProperty(() => {
if (this._positions.length > 2) {
return new Cesium.PolygonHierarchy(this._positions)
return new Cesium.PolygonHierarchy(
this._positions.map(item => item.clone())
)
} else {
return null
}

Loading…
Peruuta
Tallenna