@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 3.3 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
*/
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Promise.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{WorkerHandle as n}from"../../../../../core/workers/WorkerHandle.js";import i from"../../../../../geometry/Extent.js";import s from"../../../../../rest/support/FeatureSet.js";let a=class extends t{constructor(e){super(e),this.schedule=null,this._workerUpdating=!0}get updating(){return this._workerUpdating}initialize(){this._workerHandle=new d(this.schedule,this);const{layer:e,viewSpatialReference:t,renderSpatialReference:r}=this;this.addResolvingPromise((async()=>{await e.load();const{fullExtent:o}=e;await this._workerHandle.invokeMethod("setup",{url:e.parsedUrl?.path??"",baseQuery:e.createQuery().toJSON(),viewSpatialReference:t.toJSON(),renderSpatialReference:r.toJSON(),viewingMode:this.viewingMode,objectIdField:e.objectIdField,capabilities:e.capabilities,timeInfo:e.timeInfo?.toJSON(),fieldsIndex:e.fieldsIndex.toJSON(),fullExtent:o?.toJSON()})})()),this.addHandles(this._workerHandle.on("notify-updating",(({updating:e})=>{this._workerUpdating=e})))}onTileTreeChange({added:e,removed:t}){if(0===e.length&&0===t.length)return;const r=e.map(c),o=t.map(c);this._workerHandle.invokeMethod("onTileTreeChange",{added:r,removed:o})}async executeQuery(e,t){const r=await this._workerHandle.invokeMethod("executeQuery",e?.toJSON(),t),o=s.fromJSON(r);return this._ensureLayerOnFeatures(o),o}async executeQueryForIds(e,t){return await this._workerHandle.invokeMethod("executeQueryForIds",e?.toJSON(),t)}async executeQueryForCount(e,t){return await this._workerHandle.invokeMethod("executeQueryForCount",e?.toJSON(),t)}async executeQueryForExtent(e,t){const{count:r,extent:o}=await this._workerHandle.invokeMethod("executeQueryForExtent",e?.toJSON(),t);return{count:r,extent:i.fromJSON(o)}}async executeQueryForLatestObservations(e,t){const r=await this._workerHandle.invokeMethod("executeQueryForLatestObservations",e?.toJSON(),t),o=s.fromJSON(r);return this._ensureLayerOnFeatures(o),o}_ensureLayerOnFeatures(e){const{layer:t}=this;for(const r of e.features)r.layer=t,r.sourceLayer=t}};e([r()],a.prototype,"updating",null),e([r({constructOnly:!0})],a.prototype,"schedule",void 0),e([r({constructOnly:!0})],a.prototype,"layer",void 0),e([r({constructOnly:!0})],a.prototype,"viewSpatialReference",void 0),e([r({constructOnly:!0})],a.prototype,"renderSpatialReference",void 0),e([r({constructOnly:!0})],a.prototype,"viewingMode",void 0),e([r({constructOnly:!0})],a.prototype,"dispatchRenderCommands",void 0),e([r()],a.prototype,"_workerUpdating",void 0),a=e([o("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorkerHandle")],a);class d extends n{constructor(e,t){super("Feature3DPipelineWorker","setup",{},e,{strategy:"dedicated",client:t})}}function c({id:e,lij:t,extent:r}){return{id:e,lij:t,extent:r}}export{a as Feature3DPipelineWorkerHandle};