@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 2.77 kB
JavaScript
import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import{isSome as o,isNone as s}from"../../../../core/maybe.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{projectPoint as c}from"../../../../geometry/projection.js";import{create as p}from"../../../../geometry/support/aaBoundingBox.js";import{getObjectId as n}from"../../../../layers/graphics/dehydratedFeatures.js";import{OptimizedFeature as h}from"../../../../layers/graphics/OptimizedFeature.js";import d from"../../../../layers/graphics/OptimizedGeometry.js";import{optimizedFeatureQueryEngineAdapter as u}from"../../../../layers/graphics/data/optimizedFeatureQueryEngineAdapter.js";const l=p();let m=class extends e{constructor(t){super(t),this.events=new r,this.hasZ=null,this.hasM=null,this.objectIdField=null,this.featureAdapter={getAttribute:(t,e)=>"graphic"in t?t.graphic.attributes[e]:u.getAttribute(t,e),getAttributes:t=>"graphic"in t?t.graphic.attributes:u.getAttributes(t),getObjectId:t=>"graphic"in t?n(t.graphic,this.objectIdField)??void 0:u.getObjectId(t),getGeometry:t=>"graphic"in t?t.getAsOptimizedGeometry(this.hasZ,this.hasM):u.getGeometry(t),getCentroid:(t,e)=>{if("graphic"in t){let r=null;o(t.centroid)?r=t.centroid:"point"===t.graphic.geometry.type&&c(t.graphic.geometry,g,this.viewSpatialReference)&&(r=g);const i=new Array(2+(e.hasZ?1:0)+(e.hasM?1:0));return s(r)?(i[0]=0,i[1]=0,i[2]=0,i[3]=0):(i[0]=r.x,i[1]=r.y,e.hasZ&&(i[2]=r.hasZ?r.z:0),e.hasM&&(i[e.hasZ?3:2]=r.hasM?r.m:0)),new d([],i)}return u.getCentroid(t,e)},cloneWithGeometry:(t,e)=>"graphic"in t?new h(e,this.featureAdapter.getAttributes(t),null,this.featureAdapter.getObjectId(t)):u.cloneWithGeometry(t,e)}}forEachInBounds(t,e){this.getSpatialIndex().forEachInBounds(t,e)}forEachBounds(t,e){const r=this.getSpatialIndex();for(const s of t){const t=this.featureAdapter.getObjectId(s);o(r.getBounds(t,l))&&e(l)}}};t([i({constructOnly:!0})],m.prototype,"getSpatialIndex",void 0),t([i({constructOnly:!0})],m.prototype,"forEach",void 0),t([i({constructOnly:!0})],m.prototype,"hasZ",void 0),t([i({constructOnly:!0})],m.prototype,"hasM",void 0),t([i({constructOnly:!0})],m.prototype,"objectIdField",void 0),t([i({constructOnly:!0})],m.prototype,"viewSpatialReference",void 0),t([i({constructOnly:!0})],m.prototype,"featureSpatialReference",void 0),m=t([a("esri.views.3d.layers.graphics.Graphics3DFeatureStore")],m);const g={type:"point",x:0,y:0,hasZ:!1,hasM:!1,spatialReference:null};export{m as Graphics3DFeatureStore};