UNPKG

@doegis/core

Version:

DOE GIS API

3 lines (1 loc) 4.24 kB
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{destroyMaybe as s,unwrap as i,isNone as t}from"../../../core/maybe.js";import{when as o}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as p}from"./LayerView3D.js";import{elevationAlignPointsInFeatures as l}from"./graphics/elevationAlignPointsInFeatures.js";import{GraphicsProcessor as c}from"./graphics/GraphicsProcessor.js";import{queryForSymbologySnapping as h}from"./graphics/queryForSymbologySnapping.js";import{toViewIfLocal as u}from"./support/projectExtentUtils.js";import{UpdatePolicy as d}from"../webgl-engine/lib/UpdatePolicy.js";import m from"../../layers/LayerView.js";let y=class extends(p(m)){constructor(){super(...arguments),this.type="graphics-3d",this.symbologySnappingSupported=!0,this._slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null}initialize(){this._set("processor",new c({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.handles.add(this.layer.on("graphic-update",(e=>this.processor.graphicsCore.graphicUpdateHandler(e)))),this.addResolvingPromise(u(this).then((e=>this.fullExtentInLocalViewSpatialReference=e))),this.layer.internal?this.notifyChange("updating"):this.handles.add(o((()=>this.view?.basemapTerrain?.ready),(()=>()=>this.notifyChange("updating")),{once:!0}))}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("processor",s(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){return this.canResume()&&!this.processor?.frustumVisibilitySuspended}get slicePlaneEnabled(){const e=this.layer.internal;return this._slicePlaneEnabled&&!e}set slicePlaneEnabled(e){this._slicePlaneEnabled=e}getSuspendInfo(){const e=super.getSuspendInfo();return e.outsideScaleRange=this.processor?.scaleVisibilitySuspended??!1,e.outsideOfView=this.processor?.frustumVisibilitySuspended??!1,e}async fetchPopupFeatures(e,r){return i(r)?.clientGraphics??[]}getHit(e){return this.processor.getHit(e)}whenGraphicBounds(e,r){return this.processor.whenGraphicBounds(e,r)}computeAttachmentOrigin(e,r){return this.processor?.computeAttachmentOrigin(e,r)}getSymbolLayerSize(e,r){return this.processor.getSymbolLayerSize(e,r)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e){return this.processor.highlight(e)}async elevationAlignPointsInFeatures(e,s){const{processor:i}=this;if(t(i)||t(i.graphics3DGraphics))throw new r("graphicslayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");const{graphics3DGraphics:o}=i,a=e=>"number"==typeof e?o.get(e):void 0;return l(this.view,this.layer,a,e,s)}async queryForSymbologySnapping(e,r){return h(this.processor,e,r)}get updatePolicy(){return this.processor?.graphicsCore.effectiveUpdatePolicy||d.SYNC}canResume(){return super.canResume()&&!this.processor?.scaleVisibilitySuspended}isUpdating(){return!(!this.processor?.updating&&(this.layer.internal||this.view?.basemapTerrain?.ready))}get performanceInfo(){return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:this.processor?.elevationAlignment.updating??!1,visibilityFrustum:!this.processor?.frustumVisibilitySuspended}}getUsedMemory(){return this.processor?.graphicsCore?.usedMemory??0}getUnloadedMemory(){return this.processor?.graphicsCore?.unprocessedMemoryEstimate}ignoresMemoryFactor(){return!0}};e([a()],y.prototype,"loadedGraphics",null),e([a({readOnly:!0})],y.prototype,"legendEnabled",null),e([a()],y.prototype,"layer",void 0),e([a({readOnly:!0})],y.prototype,"processor",void 0),e([a()],y.prototype,"_slicePlaneEnabled",void 0),e([a({type:Boolean})],y.prototype,"slicePlaneEnabled",null),y=e([n("esri.views.3d.layers.GraphicsLayerView3D")],y);const g=y;export{g as default};