@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 5.13 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/Error.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as n}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as p}from"../../../layers/support/timeSupport.js";import a from"../../../rest/support/Query.js";import{toViewIfLocal as o}from"./support/projectExtentUtils.js";import{UpdatePolicy as l}from"../webgl-engine/lib/UpdatePolicy.js";import{defaultHighlightName as u}from"../../support/HighlightDefaults.js";const h=h=>{let y=class extends h{constructor(){super(...arguments),this.highlightOptions=null,this.updatePolicy=l.SYNC,this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){const e=this.layer;"isTable"in e&&e.isTable?this.addResolvingPromise(Promise.reject(new t("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{const e=await o(this);if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference=e;const t=await this.createGraphicsPipeline();this.destroyed?t.destroy():(this.graphicsPipeline=t,await t.when())})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=r(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return p(this.layer,this.view?.timeExtent,this._get("timeExtent"))}getHit(e){const t=this.graphicsPipeline.findGraphic((t=>t.uid===e));if(null==t)return null;const r=n(t,this.layer);return{type:"graphic",graphic:r,layer:r.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return null==e?this.createQuery():a.from(e)}highlight(e,t){return this.graphicsPipeline.highlight(e,t?.name??u)}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!(!this.graphicsPipeline||this.graphicsPipeline.destroyed)&&!(!this.graphicsPipeline?.updating&&this.view?.basemapTerrain?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new t("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}queryAttributeBins(){throw new Error("Not implemented")}queryAggregates(){throw new Error("Not implemented")}};return e([i()],y.prototype,"graphicsPipeline",void 0),e([i({readOnly:!0})],y.prototype,"dataUpdating",null),e([i()],y.prototype,"highlightOptions",void 0),e([i()],y.prototype,"suspended",void 0),e([i({readOnly:!0})],y.prototype,"legendEnabled",null),e([i({readOnly:!0})],y.prototype,"visibleAtCurrentScale",null),e([i()],y.prototype,"updating",void 0),e([i({readOnly:!0})],y.prototype,"updatePolicy",void 0),e([i({type:Boolean})],y.prototype,"slicePlaneEnabled",void 0),e([i({readOnly:!0})],y.prototype,"suspendInfo",void 0),e([i()],y.prototype,"symbologySnappingSupported",null),e([i({readOnly:!0})],y.prototype,"hasAllFeatures",null),e([i({readOnly:!0})],y.prototype,"hasAllFeaturesInView",null),e([i({readOnly:!0})],y.prototype,"hasFullGeometries",null),e([i({readOnly:!0})],y.prototype,"timeExtent",null),y=e([s("esri.views.3d.layers.FeatureLikeLayerView3D")],y),y};export{h as FeatureLikeLayerView3D};