| 1 |
- import e from'./../../../../src/core/Thing';import{mergeDeep as t}from'@vci/helper/src/object';import{isEmpty as o}from'@vci/helper/src/other';import r from'../Polygon';export default class Polygon3D extends e{constructor(e){super(t({isInGroup:!1,enableCreateFlatPolygon:!1,urlGeoJSON:null},e))}init(){super.init(),this.isPolygon3D=!0,this.option.isInGroup&&t(this.option,{enableUpdateMatrix:!1,enableDisposeO3OnUpdate:!1,enableDisposeO3OnDestroy:!1,enableRemoveO3FromParentOnDestroy:!1,enableRemovedWhenDestroyOnUpdate:!1,enableAddO3ToParent:!1})}afterInstantiation(){super.afterInstantiation();const{qt:e}=this,{enableCreateFlatPolygon:t,urlGeoJSON:n}=this.option;t&&(o(n)?e.log.warn('缺少urlGeoJSON,无法创建2D区块'):this.thingArea=new r({qt:e,urlGeoJSON:n}))}destroy(e=!1,t=!0){return this.thingArea&&!this.thingArea.isDestroyed&&this.thingArea.destroy(e,t),super.destroy(e,t)}}
|