@arcgis/core 5.0.0-next.120 → 5.0.0-next.121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WebScene.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/09cf8aed89a1ea1f8b28.js +1 -0
- package/assets/esri/core/workers/chunks/{8c5e834c2d243fc369fe.js → 18b0776aef1536867ab8.js} +1 -1
- package/assets/esri/core/workers/chunks/22d12c309af9c19a1a48.js +1 -0
- package/assets/esri/core/workers/chunks/{aefc089928ada18bc4d4.js → 2762149a922275136171.js} +2 -2
- package/assets/esri/core/workers/chunks/{5aab1db039b2b61c6c6b.js → 2bb7bb7901bd343201fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{a990650a83e971444838.js → 2d1a772abd730b61854f.js} +1 -1
- package/assets/esri/core/workers/chunks/{ee2ae61fc747b5f9827b.js → 2e7d4a437717606bc39c.js} +1 -1
- package/assets/esri/core/workers/chunks/360b3499e2a671c309ce.js +1 -0
- package/assets/esri/core/workers/chunks/3b0cfe3db8d90e02d6c6.js +1 -0
- package/assets/esri/core/workers/chunks/3d78e9b3c97c0ce21d16.js +1 -0
- package/assets/esri/core/workers/chunks/4550b7620932cd6de20e.js +1 -0
- package/assets/esri/core/workers/chunks/{618832e86ba9ec13ffcb.js → 455fbddd814e4681f0c0.js} +1 -1
- package/assets/esri/core/workers/chunks/{3db4938b3f89b9b8234e.js → 4742a8c19b86a5f859f0.js} +1 -1
- package/assets/esri/core/workers/chunks/{904ad26ad7c3bde63d33.js → 5062ed46edb88c0d343c.js} +1 -1
- package/assets/esri/core/workers/chunks/58cf3d35771b87bd74e5.js +1 -0
- package/assets/esri/core/workers/chunks/{d84af069f1057044c879.js → 5c12a9b0db317620dce2.js} +1 -1
- package/assets/esri/core/workers/chunks/65ad8838911a6d71816b.js +1 -0
- package/assets/esri/core/workers/chunks/{7a85e08cb968586f8d74.js → 72acfb74fd9ab9bae923.js} +2 -2
- package/assets/esri/core/workers/chunks/79ee97609f72e4cf989c.js +1 -0
- package/assets/esri/core/workers/chunks/7e6309bfed6692e8d2d7.js +2 -0
- package/assets/esri/core/workers/chunks/{dc65843654dc25bd8f97.js → 8177e95596b71bf020aa.js} +1 -1
- package/assets/esri/core/workers/chunks/8f26e93eb539ee66c5ac.js +1 -0
- package/assets/esri/core/workers/chunks/{ca767f0e3aa559b13699.js → 90aeef17af12cfbecb36.js} +1 -1
- package/assets/esri/core/workers/chunks/{4bd98d025bcd713eddca.js → 91858b02da40ff251ab2.js} +2 -2
- package/assets/esri/core/workers/chunks/{c064025d0dc69bb44f0d.js → a115984b794a7f90b2c0.js} +1 -1
- package/assets/esri/core/workers/chunks/{723c5286771704b864ab.js → a32b274404dfd2fb70ee.js} +9 -9
- package/assets/esri/core/workers/chunks/a3e8b7185d63a0f85931.js +1 -0
- package/assets/esri/core/workers/chunks/{6be2dc8331ecf944efdc.js → a5af20f3d484d2d3bafe.js} +1 -1
- package/assets/esri/core/workers/chunks/{29b30526ddac8d3ee997.js → a6006718fe22d9f2fa87.js} +1 -1
- package/assets/esri/core/workers/chunks/b0b24fb60a21b995b348.js +1 -0
- package/assets/esri/core/workers/chunks/b6e155b42a4a423139e7.js +1 -0
- package/assets/esri/core/workers/chunks/{8f4626f06b8ec1053469.js → bc9997d15ec0a86793c6.js} +1 -1
- package/assets/esri/core/workers/chunks/bf9b2aa2e67ca746ec7c.js +1 -0
- package/assets/esri/core/workers/chunks/c9babe86c00ae69e63ee.js +2 -0
- package/assets/esri/core/workers/chunks/{da40c63408affee86ac4.js → d0d1378e714ff0e43e26.js} +1 -1
- package/assets/esri/core/workers/chunks/d9c1e1ec5c56f09fb82f.js +1 -0
- package/assets/esri/core/workers/chunks/eaf5d55060ffc55aac39.js +1 -0
- package/assets/esri/core/workers/chunks/f0b8de5b3cfbe9223df6.js +1 -0
- package/assets/esri/core/workers/chunks/fd5a5b05a1551cdb8c87.js +1 -0
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +1 -0
- package/assets/esri/themes/base/widgets/_Grid.scss +8 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/config.js +1 -1
- package/core/Version.js +1 -1
- package/kernel.js +1 -1
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/support/relativeTimeQueryUtils.js +1 -1
- package/networks/support/jsonTypes.d.ts +2 -2
- package/package.json +2 -2
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/rest/print.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
- package/views/SelectionManager.d.ts +242 -0
- package/views/draw/plugins/BezierSegmentPlugin.js +1 -1
- package/views/draw/plugins/CircularArcSegmentPlugin.js +2 -0
- package/views/selection/types.d.ts +140 -0
- package/views/support/selectionUtils.js +1 -1
- package/webscene/support/schemaValidator.js +1 -1
- package/webscene/support/versionUtils.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable.d.ts +9 -3
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/assets/esri/core/workers/chunks/012992dc3910466ed207.js +0 -1
- package/assets/esri/core/workers/chunks/0485ae33a8b327974751.js +0 -1
- package/assets/esri/core/workers/chunks/0f5d033babc5c8440785.js +0 -1
- package/assets/esri/core/workers/chunks/127b1ff5c50d10a4e288.js +0 -1
- package/assets/esri/core/workers/chunks/147d0f7a2e471442c95c.js +0 -2
- package/assets/esri/core/workers/chunks/18c63f79c8ec398bc501.js +0 -1
- package/assets/esri/core/workers/chunks/1f613c599eff3b16c1d2.js +0 -1
- package/assets/esri/core/workers/chunks/2431a5480f0d22f00e00.js +0 -1
- package/assets/esri/core/workers/chunks/360dd5cd63d132b5c7d5.js +0 -2
- package/assets/esri/core/workers/chunks/3e4c5cc24bdc1c807125.js +0 -1
- package/assets/esri/core/workers/chunks/495e00c2a4ed45a0d00b.js +0 -1
- package/assets/esri/core/workers/chunks/545d801c4ba6f49df726.js +0 -1
- package/assets/esri/core/workers/chunks/8556d06f522914e71bb8.js +0 -1
- package/assets/esri/core/workers/chunks/8ac7a552189143ab4f91.js +0 -1
- package/assets/esri/core/workers/chunks/a37a003da59bdaf7ec0e.js +0 -1
- package/assets/esri/core/workers/chunks/ad688eee6a9f2be6df4a.js +0 -1
- package/assets/esri/core/workers/chunks/cc245eb1c5aaaac5916e.js +0 -1
- package/assets/esri/core/workers/chunks/dee14ddc753eec27a9bf.js +0 -1
- package/assets/esri/core/workers/chunks/f27c32f0fac5cf635bab.js +0 -1
- package/assets/esri/core/workers/chunks/fb4bcf366ba1b51668f6.js +0 -1
- /package/assets/esri/core/workers/chunks/{aefc089928ada18bc4d4.js.LICENSE.txt → 2762149a922275136171.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{7a85e08cb968586f8d74.js.LICENSE.txt → 72acfb74fd9ab9bae923.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{360dd5cd63d132b5c7d5.js.LICENSE.txt → 7e6309bfed6692e8d2d7.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{4bd98d025bcd713eddca.js.LICENSE.txt → 91858b02da40ff251ab2.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{147d0f7a2e471442c95c.js.LICENSE.txt → c9babe86c00ae69e63ee.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import has from"../../../../core/has.js";import{nextPowerOfTwo as e}from"../../../../core/mathUtils.js";import{disposeMaybe as i,destroyMaybe as r}from"../../../../core/maybe.js";import{property as s,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{ortho as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{set as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UNIT_X as c,ZEROS as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeOutput as d,InternalRenderCategory as p}from"../../webgl.js";import{Frustum as _}from"../../state/Frustum.js";import{glLayout as f}from"../../support/buffer/glUtil.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import g from"../../webgl/RenderCamera.js";import F from"../../webgl/RenderNode.js";import{ShaderOutputConfiguration as C}from"../core/shaderLibrary/ShaderOutputConfiguration.js";import{VertexArrayObject as w}from"./VertexArrayObject.js";import{C as R}from"../../../../chunks/CutFillDepth.glsl.js";import{CutFillDepthTechnique as P}from"../shaders/CutFillDepthTechnique.js";import{CutFillDepthTechniqueConfiguration as T}from"../shaders/CutFillDepthTechniqueConfiguration.js";import{C as b}from"../../../../chunks/CutFillReduction.glsl.js";import{CutFillReductionTechnique as x}from"../shaders/CutFillReductionTechnique.js";import{CutFillReductionTechniqueConfiguration as D}from"../shaders/CutFillReductionTechniqueConfiguration.js";import{C as B}from"../../../../chunks/CutFillTargetDepth.glsl.js";import{CutFillTargetDepthTechnique as y}from"../shaders/CutFillTargetDepthTechnique.js";import{ImmediateTask as j,TaskPriority as q}from"../../../support/Scheduler.js";import{Yield as S}from"../../../support/Yield.js";import{PrimitiveType as v,DataType as E}from"../../../webgl/enums.js";import{Sync as V}from"../../../webgl/Sync.js";import{VertexBuffer as O}from"../../../webgl/VertexBuffer.js";let A=class extends F{constructor(t){super(t),this.consumes={required:[d.TRANSPARENT]},this.produces=p.CUTFILL_DEPTH,this._cutFillTargetDepthConfiguration=new C,this._cutFillDepthConfiguration=new T,this._cutFillReductionConfiguration=new D,this._cutFillTargetDepthParameters=new B,this._cutFillDepthParameters=new R,this._cutFillReductionParameters=new b,this.needsRender=!1,this.readyToRun=!1,this.done=!0,this._frameTask=j,this._results=new k,this._localOrigin=u(),this._maxTextureSize=4096,this._width=0,this._height=0,this._reducedWidth=0,this._reducedHeight=0,this._depthFormat=14,this._colorFormat=11,this._numChannels=2,this._targetVao=null,this._numReductions=3,this._reductionPasses=0,this._pixelBufferSize=0,this._pixelBufferOffset=0,this._perReductionPixelBufferSize=0}initialize(){this._frameTask=this.view.resourceController.scheduler.registerTask(q.VOLUME_MEASUREMENT,this),this.addHandles(this._frameTask),this._maxTextureSize=Math.min(has("esri-mobile")?1024:this._maxTextureSize,this.fboCache.rctx.parameters.maxTextureSize),this._cutFillTargetDepthConfiguration.output=7,this._frustum=new _(this.view.renderCoordsHelper)}destroy(){this._targetVao=i(this._targetVao);const t=this.gl;this._sync=r(this._sync),this._pixelBuffer&&(t.deleteBuffer(this._pixelBuffer),this._pixelBuffer=null,this._pixelBufferSize=0)}precompile(){this.techniques.precompile(y,this._cutFillTargetDepthConfiguration),this._cutFillDepthConfiguration.preparePass=0,this.techniques.precompile(P,this._cutFillDepthConfiguration),this._cutFillDepthConfiguration.preparePass=1,this.techniques.precompile(P,this._cutFillDepthConfiguration),this._cutFillReductionConfiguration.reductionPass=0,this.techniques.precompile(x,this._cutFillReductionConfiguration),this._cutFillReductionConfiguration.reductionPass=1,this.techniques.precompile(x,this._cutFillReductionConfiguration),this._cutFillReductionConfiguration.reductionPass=2,this.techniques.precompile(x,this._cutFillReductionConfiguration),this.view.stage.renderer.precompileCutFill()}render(t){const e=t.find(({name:t})=>t===p.CUTFILL_DEPTH);if(!this._orthographicCamera||!this._targetVao||!this.needsRender||this._sync)return e;const i=this.techniques.get(y,this._cutFillTargetDepthConfiguration);this._cutFillDepthConfiguration.preparePass=0;const r=this.techniques.get(P,this._cutFillDepthConfiguration);this._cutFillDepthConfiguration.preparePass=1;const s=this.techniques.get(P,this._cutFillDepthConfiguration);this._cutFillReductionConfiguration.reductionPass=0;const h=this.techniques.get(x,this._cutFillReductionConfiguration);this._cutFillReductionConfiguration.reductionPass=1;const o=this.techniques.get(x,this._cutFillReductionConfiguration);this._cutFillReductionConfiguration.reductionPass=2;const n=this.techniques.get(x,this._cutFillReductionConfiguration);if(!(i.compiled&&r.compiled&&s.compiled&&h.compiled&&o.compiled&&n.compiled))return this.requestRender(1),e;this.needsRender=!1;const a=this.renderingContext,u=this.fboCache,d=this.gl,_=a.getViewport(),f=u.acquire(this._width,this._height,"cutfill reference depth",this._depthFormat);a.bindFramebuffer(f.fbo),a.setViewport(0,0,this._width,this._height),a.clear(1280),this.view.stage.renderer.renderCutFillReferenceDepth(this._orthographicCamera);const m=u.acquire(this._width,this._height,"cutfill target depth",this._depthFormat);a.bindFramebuffer(m.fbo),a.setViewport(0,0,this._width,this._height),a.setClearDepth(1),a.clear(256),this._cutFillTargetDepthParameters.origin=this._localOrigin,this._cutFillTargetDepthParameters.cutFillCamera=this._orthographicCamera,a.bindTechnique(i,this.bindParameters,this._cutFillTargetDepthParameters),a.bindVAO(this._targetVao),a.drawArrays(v.TRIANGLES,0,this._targetVao.vertexCount("geometry"));const g=u.acquire(this._width,this._height,"cutfill reduction even",this._colorFormat),F=u.acquire(this._width,this._height,"cutfill reduction odd",this._colorFormat);return this._cutFillDepthParameters.referenceDepthTexture=f.depthTexture,this._cutFillDepthParameters.targetDepthTexture=m.depthTexture,this._pixelBuffer||(this._pixelBuffer=d.createBuffer()),d.bindBuffer(d.PIXEL_PACK_BUFFER,this._pixelBuffer),d.bufferData(d.PIXEL_PACK_BUFFER,this._pixelBufferSize,d.STREAM_READ),this._prepareFBO(g,this.width,this.height),a.bindTechnique(r,this.bindParameters,this._cutFillDepthParameters),a.screen.draw(),this._runPyramidReduction(g,F,h),this._prepareFBO(g,this.width,this.height,c),a.bindTechnique(s,this.bindParameters,this._cutFillDepthParameters),a.screen.draw(),this._runPyramidReduction(g,F,o),this._prepareFBO(g,this.width,this.height,l),a.bindTechnique(s,this.bindParameters,this._cutFillDepthParameters),a.screen.draw(),this._runPyramidReduction(g,F,n),f.release(),m.release(),g.release(),F.release(),d.bindBuffer(d.PIXEL_PACK_BUFFER,null),a.setViewport(_.x,_.y,_.width,_.height),this._sync=new V(d),setTimeout(()=>this.readyToRun=!0,0),e}update(t,i){if(!this.done)return;this.done=!1;const r=this.renderingContext,{cameraDimensions:{width:s,height:h},localOriginRenderSpace:o}=t,n=this._maxTextureSize,a=h/s,u=s>h?n:n/a,c=s>h?n*a:n;this._width=e(u),this._height=e(c);const l=[this._width,this._height];this._orthographicCamera=this._createCamera(t,l),this._frustum?.update(this._orthographicCamera),this._updateTargetVao(r,i),this._localOrigin=o,this._reductionPasses=Math.ceil(Math.log2(Math.min(this._width,this._height))),this._reducedWidth=Math.ceil(this._width/2**this._reductionPasses),this._reducedHeight=Math.ceil(this._height/2**this._reductionPasses),this._perReductionPixelBufferSize=this._reducedWidth*this._reducedHeight*this._numChannels*4,this._pixelBufferSize=this._perReductionPixelBufferSize*this._numReductions,this._pixelBufferOffset=0,this.needsRender=!0,this.requestRender(1)}runTask(){if(!this._sync)return void(this.readyToRun=!1);try{if(!this._sync.poll())return S}catch(e){return this.readyToRun=!1,void(this._sync=r(this._sync))}this.readyToRun=!1,this._sync=r(this._sync);const t=this.gl;this._cpuBuffer=new Float32Array(this._pixelBufferSize/4),t.bindBuffer(t.PIXEL_PACK_BUFFER,this._pixelBuffer),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this._cpuBuffer),t.bindBuffer(t.PIXEL_PACK_BUFFER,null),this._updateResults(this._cpuBuffer),this.done=!0}getResults(){return this._results}get frustum(){return this._frustum}get width(){return this._width}get height(){return this._height}get updating(){return this.readyToRun||!this.done||this._frameTask.updating}_runPyramidReduction(t,e,i){const r=this.renderingContext,s=this.gl;let h=this._width,o=this._height;for(let n=0;n<this._reductionPasses;n++)h=Math.ceil(h/2),o=Math.ceil(o/2),this._cutFillReductionParameters.depthTexture=t.getTexture(),this._prepareFBO(e,h,o),r.bindTechnique(i,this.bindParameters,this._cutFillReductionParameters),r.screen.draw(),[t,e]=[e,t];s.readPixels(0,0,h,o,33319,E.FLOAT,this._pixelBufferOffset),this._pixelBufferOffset+=this._perReductionPixelBufferSize}_updateResults(t){const e=new U(0,1,a()),i=new U(0,0,a());for(let r=0;r<this._reducedWidth;r++)for(let s=0;s<this._reducedHeight;s++){let h=(r+s*this._reducedWidth)*this._numChannels;const o=this._reducedWidth*this._reducedHeight*this._numChannels;e.totalDepth+=t[h],i.totalDepth+=t[h+1],h+=o;const n=t[h];n<e.labelDepth&&(e.labelDepth=n,L(e.labelCoords,t[h+1],this._width)),h+=o;const a=t[h];a>i.labelDepth&&(i.labelDepth=a,L(i.labelCoords,t[h+1],this._width))}this._results=new k(this._width,this._height,e,i)}_prepareFBO(t,e,i,r=l){const s=this.renderingContext;s.bindFramebuffer(t.fbo),s.setViewport(0,0,e,i),s.setClearColor(r[0],r[1],r[2],r[3]),s.clear(16384)}_createCamera(t,e){const{cameraPositionRenderSpace:i,localOriginRenderSpace:r,northVector:s,cameraDimensions:{width:h,height:n},cameraNearFar:{near:a,far:u}}=t,c=new g({eye:i,center:r,up:s,near:a,far:u});return c.viewport=[0,0,e[0],e[1]],o(c.projectionMatrix,-h/2,h/2,-n/2,n/2,a,u),c}_updateTargetVao(t,e){this._targetVao=i(this._targetVao);const r=e.reduce((t,e)=>t+e.indices.length,0),s=z.createBuffer(r),h=s.position;let o=0;for(const i of e){const{positions:t,indices:e}=i;for(let i=0;i<e.length;++i){const r=3*e[i];h.set(o,0,t[r]),h.set(o,1,t[r+1]),h.set(o,2,t[r+2]),o++}}const n=new O(t,f(z),s.buffer);this._targetVao=new w(t,n)}};t([s()],A.prototype,"consumes",void 0),t([s()],A.prototype,"produces",void 0),t([s()],A.prototype,"needsRender",void 0),t([s()],A.prototype,"readyToRun",void 0),t([s()],A.prototype,"done",void 0),t([s()],A.prototype,"updating",null),t([s()],A.prototype,"_frameTask",void 0),A=t([h("esri.views.3d.webgl-engine.lib.CutFillDepth")],A);const z=m().vec3f("position").freeze();function L(t,e,i){const r=e%i,s=Math.floor(e/i);n(t,r,s)}class M{constructor(t,e){this.positions=t,this.indices=e}}class U{constructor(t,e,i){this.totalDepth=t,this.labelDepth=e,this.labelCoords=i}}class k{constructor(t=0,e=0,i=new U(0,1,a()),r=new U(0,0,a())){this.width=t,this.height=e,this.cut=i,this.fill=r}}export{A as CutFillDepth,U as DepthResult,k as RenderResult,M as TargetGeometryRenderInfo};
|
|
2
|
+
import{__decorate as t}from"tslib";import{nextPowerOfTwo as e}from"../../../../core/mathUtils.js";import{disposeMaybe as i,destroyMaybe as r}from"../../../../core/maybe.js";import{property as s,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{ortho as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{set as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UNIT_X as c,ZEROS as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeOutput as d,InternalRenderCategory as p}from"../../webgl.js";import{Frustum as _}from"../../state/Frustum.js";import{glLayout as f}from"../../support/buffer/glUtil.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import g from"../../webgl/RenderCamera.js";import F from"../../webgl/RenderNode.js";import{ShaderOutputConfiguration as C}from"../core/shaderLibrary/ShaderOutputConfiguration.js";import{VertexArrayObject as w}from"./VertexArrayObject.js";import{C as R}from"../../../../chunks/CutFillDepth.glsl.js";import{CutFillDepthTechnique as P}from"../shaders/CutFillDepthTechnique.js";import{CutFillDepthTechniqueConfiguration as T}from"../shaders/CutFillDepthTechniqueConfiguration.js";import{C as b}from"../../../../chunks/CutFillReduction.glsl.js";import{CutFillReductionTechnique as x}from"../shaders/CutFillReductionTechnique.js";import{CutFillReductionTechniqueConfiguration as D}from"../shaders/CutFillReductionTechniqueConfiguration.js";import{C as B}from"../../../../chunks/CutFillTargetDepth.glsl.js";import{CutFillTargetDepthTechnique as y}from"../shaders/CutFillTargetDepthTechnique.js";import{ImmediateTask as j,TaskPriority as q}from"../../../support/Scheduler.js";import{Yield as S}from"../../../support/Yield.js";import{PrimitiveType as v,DataType as E}from"../../../webgl/enums.js";import{Sync as V}from"../../../webgl/Sync.js";import{VertexBuffer as O}from"../../../webgl/VertexBuffer.js";let A=class extends F{constructor(t){super(t),this.consumes={required:[d.TRANSPARENT]},this.produces=p.CUTFILL_DEPTH,this._cutFillTargetDepthConfiguration=new C,this._cutFillDepthConfiguration=new T,this._cutFillReductionConfiguration=new D,this._cutFillTargetDepthParameters=new B,this._cutFillDepthParameters=new R,this._cutFillReductionParameters=new b,this.needsRender=!1,this.readyToRun=!1,this.done=!0,this._frameTask=j,this._results=new k,this._localOrigin=u(),this._maxTextureSize=512,this._width=0,this._height=0,this._reducedWidth=0,this._reducedHeight=0,this._depthFormat=14,this._colorFormat=11,this._numChannels=2,this._targetVao=null,this._numReductions=3,this._reductionPasses=0,this._pixelBufferSize=0,this._pixelBufferOffset=0,this._perReductionPixelBufferSize=0}initialize(){this._frameTask=this.view.resourceController.scheduler.registerTask(q.VOLUME_MEASUREMENT,this),this.addHandles(this._frameTask),this._maxTextureSize=Math.min(this._maxTextureSize,this.fboCache.rctx.parameters.maxTextureSize),this._cutFillTargetDepthConfiguration.output=7,this._frustum=new _(this.view.renderCoordsHelper)}destroy(){this._targetVao=i(this._targetVao);const t=this.gl;this._sync=r(this._sync),this._pixelBuffer&&(t.deleteBuffer(this._pixelBuffer),this._pixelBuffer=null,this._pixelBufferSize=0)}precompile(){this.techniques.precompile(y,this._cutFillTargetDepthConfiguration),this._cutFillDepthConfiguration.preparePass=0,this.techniques.precompile(P,this._cutFillDepthConfiguration),this._cutFillDepthConfiguration.preparePass=1,this.techniques.precompile(P,this._cutFillDepthConfiguration),this._cutFillReductionConfiguration.reductionPass=0,this.techniques.precompile(x,this._cutFillReductionConfiguration),this._cutFillReductionConfiguration.reductionPass=1,this.techniques.precompile(x,this._cutFillReductionConfiguration),this._cutFillReductionConfiguration.reductionPass=2,this.techniques.precompile(x,this._cutFillReductionConfiguration),this.view.stage.renderer.precompileCutFill()}render(t){const e=t.find(({name:t})=>t===p.CUTFILL_DEPTH);if(!this._orthographicCamera||!this._targetVao||!this.needsRender||this._sync)return e;const i=this.techniques.get(y,this._cutFillTargetDepthConfiguration);this._cutFillDepthConfiguration.preparePass=0;const r=this.techniques.get(P,this._cutFillDepthConfiguration);this._cutFillDepthConfiguration.preparePass=1;const s=this.techniques.get(P,this._cutFillDepthConfiguration);this._cutFillReductionConfiguration.reductionPass=0;const h=this.techniques.get(x,this._cutFillReductionConfiguration);this._cutFillReductionConfiguration.reductionPass=1;const o=this.techniques.get(x,this._cutFillReductionConfiguration);this._cutFillReductionConfiguration.reductionPass=2;const n=this.techniques.get(x,this._cutFillReductionConfiguration);if(!(i.compiled&&r.compiled&&s.compiled&&h.compiled&&o.compiled&&n.compiled))return this.requestRender(1),e;this.needsRender=!1;const a=this.renderingContext,u=this.fboCache,d=this.gl,_=a.getViewport(),f=u.acquire(this._width,this._height,"cutfill reference depth",this._depthFormat);a.bindFramebuffer(f.fbo),a.setViewport(0,0,this._width,this._height),a.clear(1280),this.view.stage.renderer.renderCutFillReferenceDepth(this._orthographicCamera);const m=u.acquire(this._width,this._height,"cutfill target depth",this._depthFormat);a.bindFramebuffer(m.fbo),a.setViewport(0,0,this._width,this._height),a.setClearDepth(1),a.clear(256),this._cutFillTargetDepthParameters.origin=this._localOrigin,this._cutFillTargetDepthParameters.cutFillCamera=this._orthographicCamera,a.bindTechnique(i,this.bindParameters,this._cutFillTargetDepthParameters),a.bindVAO(this._targetVao),a.drawArrays(v.TRIANGLES,0,this._targetVao.vertexCount("geometry"));const g=u.acquire(this._width,this._height,"cutfill reduction even",this._colorFormat),F=u.acquire(this._width,this._height,"cutfill reduction odd",this._colorFormat);return this._cutFillDepthParameters.referenceDepthTexture=f.depthTexture,this._cutFillDepthParameters.targetDepthTexture=m.depthTexture,this._pixelBuffer||(this._pixelBuffer=d.createBuffer()),d.bindBuffer(d.PIXEL_PACK_BUFFER,this._pixelBuffer),d.bufferData(d.PIXEL_PACK_BUFFER,this._pixelBufferSize,d.STREAM_READ),this._prepareFBO(g,this.width,this.height),a.bindTechnique(r,this.bindParameters,this._cutFillDepthParameters),a.screen.draw(),this._runPyramidReduction(g,F,h),this._prepareFBO(g,this.width,this.height,c),a.bindTechnique(s,this.bindParameters,this._cutFillDepthParameters),a.screen.draw(),this._runPyramidReduction(g,F,o),this._prepareFBO(g,this.width,this.height,l),a.bindTechnique(s,this.bindParameters,this._cutFillDepthParameters),a.screen.draw(),this._runPyramidReduction(g,F,n),f.release(),m.release(),g.release(),F.release(),d.bindBuffer(d.PIXEL_PACK_BUFFER,null),a.setViewport(_.x,_.y,_.width,_.height),this._sync=new V(d),setTimeout(()=>this.readyToRun=!0,0),e}update(t,i){if(!this.done)return;this.done=!1;const r=this.renderingContext,{cameraDimensions:{width:s,height:h},localOriginRenderSpace:o}=t,n=this._maxTextureSize,a=h/s,u=s>h?n:n/a,c=s>h?n*a:n;this._width=e(u),this._height=e(c);const l=[this._width,this._height];this._orthographicCamera=this._createCamera(t,l),this._frustum?.update(this._orthographicCamera),this._updateTargetVao(r,i),this._localOrigin=o,this._reductionPasses=Math.ceil(Math.log2(Math.min(this._width,this._height))),this._reducedWidth=Math.ceil(this._width/2**this._reductionPasses),this._reducedHeight=Math.ceil(this._height/2**this._reductionPasses),this._perReductionPixelBufferSize=this._reducedWidth*this._reducedHeight*this._numChannels*4,this._pixelBufferSize=this._perReductionPixelBufferSize*this._numReductions,this._pixelBufferOffset=0,this.needsRender=!0,this.requestRender(1)}runTask(){if(!this._sync)return void(this.readyToRun=!1);try{if(!this._sync.poll())return S}catch(e){return this.readyToRun=!1,void(this._sync=r(this._sync))}this.readyToRun=!1,this._sync=r(this._sync);const t=this.gl;this._cpuBuffer=new Float32Array(this._pixelBufferSize/4),t.bindBuffer(t.PIXEL_PACK_BUFFER,this._pixelBuffer),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this._cpuBuffer),t.bindBuffer(t.PIXEL_PACK_BUFFER,null),this._updateResults(this._cpuBuffer),this.done=!0}getResults(){return this._results}get frustum(){return this._frustum}get width(){return this._width}get height(){return this._height}get updating(){return this.readyToRun||!this.done||this._frameTask.updating}_runPyramidReduction(t,e,i){const r=this.renderingContext,s=this.gl;let h=this._width,o=this._height;for(let n=0;n<this._reductionPasses;n++)h=Math.ceil(h/2),o=Math.ceil(o/2),this._cutFillReductionParameters.depthTexture=t.getTexture(),this._prepareFBO(e,h,o),r.bindTechnique(i,this.bindParameters,this._cutFillReductionParameters),r.screen.draw(),[t,e]=[e,t];s.readPixels(0,0,h,o,33319,E.FLOAT,this._pixelBufferOffset),this._pixelBufferOffset+=this._perReductionPixelBufferSize}_updateResults(t){const e=new U(0,1,a()),i=new U(0,0,a());for(let r=0;r<this._reducedWidth;r++)for(let s=0;s<this._reducedHeight;s++){let h=(r+s*this._reducedWidth)*this._numChannels;const o=this._reducedWidth*this._reducedHeight*this._numChannels;e.totalDepth+=t[h],i.totalDepth+=t[h+1],h+=o;const n=t[h];n<e.labelDepth&&(e.labelDepth=n,L(e.labelCoords,t[h+1],this._width)),h+=o;const a=t[h];a>i.labelDepth&&(i.labelDepth=a,L(i.labelCoords,t[h+1],this._width))}this._results=new k(this._width,this._height,e,i)}_prepareFBO(t,e,i,r=l){const s=this.renderingContext;s.bindFramebuffer(t.fbo),s.setViewport(0,0,e,i),s.setClearColor(r[0],r[1],r[2],r[3]),s.clear(16384)}_createCamera(t,e){const{cameraPositionRenderSpace:i,localOriginRenderSpace:r,northVector:s,cameraDimensions:{width:h,height:n},cameraNearFar:{near:a,far:u}}=t,c=new g({eye:i,center:r,up:s,near:a,far:u});return c.viewport=[0,0,e[0],e[1]],o(c.projectionMatrix,-h/2,h/2,-n/2,n/2,a,u),c}_updateTargetVao(t,e){this._targetVao=i(this._targetVao);const r=e.reduce((t,e)=>t+e.indices.length,0),s=z.createBuffer(r),h=s.position;let o=0;for(const i of e){const{positions:t,indices:e}=i;for(let i=0;i<e.length;++i){const r=3*e[i];h.set(o,0,t[r]),h.set(o,1,t[r+1]),h.set(o,2,t[r+2]),o++}}const n=new O(t,f(z),s.buffer);this._targetVao=new w(t,n)}};t([s()],A.prototype,"consumes",void 0),t([s()],A.prototype,"produces",void 0),t([s()],A.prototype,"needsRender",void 0),t([s()],A.prototype,"readyToRun",void 0),t([s()],A.prototype,"done",void 0),t([s()],A.prototype,"updating",null),t([s()],A.prototype,"_frameTask",void 0),A=t([h("esri.views.3d.webgl-engine.lib.CutFillDepth")],A);const z=m().vec3f("position").freeze();function L(t,e,i){const r=e%i,s=Math.floor(e/i);n(t,r,s)}class M{constructor(t,e){this.positions=t,this.indices=e}}class U{constructor(t,e,i){this.totalDepth=t,this.labelDepth=e,this.labelCoords=i}}class k{constructor(t=0,e=0,i=new U(0,1,a()),r=new U(0,0,a())){this.width=t,this.height=e,this.cut=i,this.fill=r}}export{A as CutFillDepth,U as DepthResult,k as RenderResult,M as TargetGeometryRenderInfo};
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import type Graphic from "../Graphic.js";
|
|
2
|
+
import type Collection from "../core/Collection.js";
|
|
3
|
+
import type GraphicsLayer from "../layers/GraphicsLayer.js";
|
|
4
|
+
import type View from "./View.js";
|
|
5
|
+
import type { EventedAccessor } from "../core/Evented.js";
|
|
6
|
+
import type { QueryProperties } from "../rest/support/Query.js";
|
|
7
|
+
import type { ObjectId } from "./types.js";
|
|
8
|
+
import type { LayerFeatureSet, LayerSelectionChange, SelectableLayer, SelectableLayerWithObjectIds, SelectionIdentifier, LayerSelection } from "./selection/types.js";
|
|
9
|
+
|
|
10
|
+
export interface SelectionManagerProperties extends Partial<Pick<SelectionManager, "highlightEnabled" | "highlightName" | "view">> {
|
|
11
|
+
/**
|
|
12
|
+
* A collection of selectable layers managed by the selection manager. Use `syncSources` to automatically populate this collection from the layers and tables in a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
|
|
13
|
+
*
|
|
14
|
+
* > [!CAUTION]
|
|
15
|
+
* > When setting the sources property to an external Collection or array, the selection
|
|
16
|
+
* > manager adds its contents to an internal Collection.
|
|
17
|
+
* > Therefore, when the `SelectionManager` is destroyed, this internal `sources`
|
|
18
|
+
* > Collection is always destroyed.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Create a selection manager and set its view.
|
|
22
|
+
* // Then, add a layer to its sources.
|
|
23
|
+
* const selectionManager = new SelectionManager({
|
|
24
|
+
* view,
|
|
25
|
+
* sources: [featureLayer]
|
|
26
|
+
* });
|
|
27
|
+
* @example
|
|
28
|
+
* // Later, if you want to add more layers, you can do so like this:
|
|
29
|
+
* selectionManager.sources.add(anotherFeatureLayer);
|
|
30
|
+
* // Or, if you want to replace the existing sources with a new set of layers:
|
|
31
|
+
* selectionManager.sources = [differentFeatureLayer];
|
|
32
|
+
* @see [syncSources](#syncSources)
|
|
33
|
+
*/
|
|
34
|
+
sources?: Collection<SelectableLayer> | SelectableLayer[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** @since 5.0 */
|
|
38
|
+
export interface SelectionManagerEvents {
|
|
39
|
+
/** @since 5.0 */
|
|
40
|
+
"selection-change": {
|
|
41
|
+
view: View | null | undefined;
|
|
42
|
+
changes: LayerSelectionChange[];
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A selection manager controls the selection of features in layers and tables within a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) to help manage feature selection. It can be wired up to listen for edits made to selectable layers and have the selection update accordingly.
|
|
48
|
+
*
|
|
49
|
+
* @since 5.0
|
|
50
|
+
* @beta
|
|
51
|
+
* @example
|
|
52
|
+
* // Create a selection manager and set its view.
|
|
53
|
+
* // Then, add a layer to its sources.
|
|
54
|
+
* const selectionManager = new SelectionManager({
|
|
55
|
+
* view,
|
|
56
|
+
* sources: [featureLayer]
|
|
57
|
+
* });
|
|
58
|
+
* // Select the features in the layer with specified Object IDs.
|
|
59
|
+
* selectionManager.replace(featureLayer, [1, 2, 3]);
|
|
60
|
+
*/
|
|
61
|
+
export default class SelectionManager extends EventedAccessor {
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated
|
|
64
|
+
* Do not directly reference this property.
|
|
65
|
+
* Use EventNames and EventTypes helpers from \@arcgis/core/Evented
|
|
66
|
+
*/
|
|
67
|
+
"@eventTypes": SelectionManagerEvents;
|
|
68
|
+
constructor(properties?: SelectionManagerProperties);
|
|
69
|
+
/** The total number of selected features across all sources. */
|
|
70
|
+
get count(): number;
|
|
71
|
+
/** Returns `true` if at least one source has an active selection. */
|
|
72
|
+
get hasSelection(): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Indicates whether to display a visual representation of the selection with a highlight.
|
|
75
|
+
*
|
|
76
|
+
* @default true
|
|
77
|
+
*/
|
|
78
|
+
accessor highlightEnabled: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* The [highlights name](https://developers.arcgis.com/javascript/latest/references/core/views/support/HighlightOptions/#name) to use when specifying a set of [highlight options](https://developers.arcgis.com/javascript/latest/references/core/views/support/HighlightOptions/).
|
|
81
|
+
*
|
|
82
|
+
* @default "default"
|
|
83
|
+
* @see [MapView.highlights](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#highlights)
|
|
84
|
+
* @see [HighlightOptions](https://developers.arcgis.com/javascript/latest/references/core/views/support/HighlightOptions/)
|
|
85
|
+
*/
|
|
86
|
+
accessor highlightName: string;
|
|
87
|
+
/** A read-only copy of the selection. To modify selections, use [add](#add), [replace](#replace), [remove](#remove), or [toggle](#toggle). */
|
|
88
|
+
get selections(): LayerSelection[];
|
|
89
|
+
/**
|
|
90
|
+
* A collection of selectable layers managed by the selection manager. Use `syncSources` to automatically populate this collection from the layers and tables in a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
|
|
91
|
+
*
|
|
92
|
+
* > [!CAUTION]
|
|
93
|
+
* > When setting the sources property to an external Collection or array, the selection
|
|
94
|
+
* > manager adds its contents to an internal Collection.
|
|
95
|
+
* > Therefore, when the `SelectionManager` is destroyed, this internal `sources`
|
|
96
|
+
* > Collection is always destroyed.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* // Create a selection manager and set its view.
|
|
100
|
+
* // Then, add a layer to its sources.
|
|
101
|
+
* const selectionManager = new SelectionManager({
|
|
102
|
+
* view,
|
|
103
|
+
* sources: [featureLayer]
|
|
104
|
+
* });
|
|
105
|
+
* @example
|
|
106
|
+
* // Later, if you want to add more layers, you can do so like this:
|
|
107
|
+
* selectionManager.sources.add(anotherFeatureLayer);
|
|
108
|
+
* // Or, if you want to replace the existing sources with a new set of layers:
|
|
109
|
+
* selectionManager.sources = [differentFeatureLayer];
|
|
110
|
+
* @see [syncSources](#syncSources)
|
|
111
|
+
*/
|
|
112
|
+
get sources(): Collection<SelectableLayer>;
|
|
113
|
+
set sources(value: Collection<SelectableLayer> | SelectableLayer[]);
|
|
114
|
+
/**
|
|
115
|
+
* Indicates whether the selection manager is currently updating the view's visualization of selections.
|
|
116
|
+
*
|
|
117
|
+
* @default false
|
|
118
|
+
*/
|
|
119
|
+
get updating(): boolean;
|
|
120
|
+
/** A reference to the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/), or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). This property must be set if wanting to highlight a corresponding feature within the map when a row is selected. In addition, setting the `view` is required if working with [layer views](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/). */
|
|
121
|
+
accessor view: View | null | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Adds features to the current selection. It does not replace the existing selection.
|
|
124
|
+
*
|
|
125
|
+
* @param layer - The selectable layer to which to add the selection. This must be a layer with graphics in the [sources](#sources).
|
|
126
|
+
* @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) to add to the current selection.
|
|
127
|
+
*/
|
|
128
|
+
add(layer: GraphicsLayer, selection: Graphic[]): void;
|
|
129
|
+
/**
|
|
130
|
+
* Adds features to the current selection. It does not replace the existing selection.
|
|
131
|
+
*
|
|
132
|
+
* @param layer - The selectable layer to which to add the selection. This must be a layer with object IDs in the [sources](#sources).
|
|
133
|
+
* @param selection - An array of features, ie. [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to add to the current selection.
|
|
134
|
+
*/
|
|
135
|
+
add(layer: SelectableLayerWithObjectIds, selection: ObjectId[]): void;
|
|
136
|
+
/**
|
|
137
|
+
* Adds features to the current selection. It does not replace the existing selection.
|
|
138
|
+
*
|
|
139
|
+
* @param layer - The selectable layer to which to add the selection. This must be a layer in the [sources](#sources). It can be a layer with graphics or object IDs.
|
|
140
|
+
* @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) or [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to add to the current selection.
|
|
141
|
+
*/
|
|
142
|
+
add(layer: SelectableLayer, selection: SelectionIdentifier[]): void;
|
|
143
|
+
/** Clears all selections from all layers. */
|
|
144
|
+
clear(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Queries the selected features for one or more layers. It uses the
|
|
147
|
+
* current selection identifiers to fetch feature data from
|
|
148
|
+
* the layer which may include attributes, geometry, etc. depending on the layer's capabilities and the supplied `queryParams`.
|
|
149
|
+
*
|
|
150
|
+
* @param includeLayers - Specifies the layer from which to fetch features. If not provided, all layers with active selections are queried.
|
|
151
|
+
* @param queryParams - If supplied, it may include any supplemental parameters to thin out the feature results. The object IDs will also be part of the generated query.
|
|
152
|
+
* @param queryTarget - If `"layer"`, applies all queries to the layer itself rather than the layer view. This can be used to bypass any client-side filtering that may be applied within the layer view. Note that not all layers support querying on the layer itself, so this option should be used with caution. If a layer does not support querying on the layer itself, the query will automatically be applied to the layer view instead.
|
|
153
|
+
* @returns A promise that resolves to an array of [LayerFeatureSet](https://developers.arcgis.com/javascript/latest/references/core/views/selection/types/#LayerFeatureSet), which includes the layer and the resulting features for that layer.
|
|
154
|
+
* @name getSelectedFeatures
|
|
155
|
+
*/
|
|
156
|
+
getSelectedFeatures(includeLayers: SelectableLayerWithObjectIds[] | undefined, queryParams: QueryProperties | undefined, queryTarget?: "layerView" | "layer"): Promise<LayerFeatureSet[]>;
|
|
157
|
+
/**
|
|
158
|
+
* Gets the active selection for the provided layer. If the layer is not part of the [sources](#sources) or has no active selection, this method returns `undefined`. Otherwise, it returns an array of selected features, which can be either [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) or [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] depending on the layer's capabilities. To retrieve the full graphic representations of selected features from a layer that supports only object ID selection, use the [getSelectedFeatures](#getSelectedFeatures) method. This method queries the layer using the selected object IDs and returns the corresponding feature graphics.
|
|
159
|
+
*
|
|
160
|
+
* @param target - The selectable layer that provides the selected features. This must be a layer with graphics in the [sources](#sources).
|
|
161
|
+
* @returns Returns an array of [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/)s representing the selected features.
|
|
162
|
+
*/
|
|
163
|
+
getSelection(target: GraphicsLayer): Graphic[] | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* @param target - The selectable layer that provides the selected features. This must be a layer with object IDs in the [sources](#sources).
|
|
166
|
+
* @returns Returns an array of [ObjectId's](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId) representing the selected features.
|
|
167
|
+
*/
|
|
168
|
+
getSelection(target: SelectableLayerWithObjectIds): ObjectId[] | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* @param target - The selectable layer that provides the selected features.This must be a layer in the [sources](#sources). It can be a layer with graphics or object IDs.
|
|
171
|
+
* @returns Returns an array of selected features represented as either [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) or [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] dependent upon the layer's capabilities.
|
|
172
|
+
*/
|
|
173
|
+
getSelection(target: SelectableLayer): SelectionIdentifier[] | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Removes the provided features from the current selection for the provided layer.
|
|
176
|
+
*
|
|
177
|
+
* @param target - The selectable layer from which to remove the selection. This must be a layer with graphics in the [sources](#sources).
|
|
178
|
+
* @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) to remove from the current selection.
|
|
179
|
+
*/
|
|
180
|
+
remove(target: GraphicsLayer, selection: Graphic[]): void;
|
|
181
|
+
/**
|
|
182
|
+
* @param target - The selectable layer from which to remove the selection. This must be a layer with object IDs in the [sources](#sources).
|
|
183
|
+
* @param selection - An array of features, ie. [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to remove from the current selection.
|
|
184
|
+
*/
|
|
185
|
+
remove(target: SelectableLayerWithObjectIds, selection: ObjectId[]): void;
|
|
186
|
+
/**
|
|
187
|
+
* @param target - The selectable layer from which to remove the selection. This must be a layer in the [sources](#sources). It can be a layer with graphics or object IDs.
|
|
188
|
+
* @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) or [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to remove from the current selection.
|
|
189
|
+
*/
|
|
190
|
+
remove(target: SelectableLayer, selection: SelectionIdentifier[]): void;
|
|
191
|
+
/**
|
|
192
|
+
* Replaces the current selection for the provided layer with the provided features.
|
|
193
|
+
*
|
|
194
|
+
* @param layer - The selectable layer for which to replace the selection. This must be a layer with graphics in the [sources](#sources).
|
|
195
|
+
* @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) to set as the current selection.
|
|
196
|
+
*/
|
|
197
|
+
replace(layer: GraphicsLayer, selection: Graphic[]): void;
|
|
198
|
+
/**
|
|
199
|
+
* @param layer - The selectable layer for which to replace the selection. This must be a layer with object IDs in the [sources](#sources).
|
|
200
|
+
* @param selection - An array of features, ie. [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to set as the current selection.
|
|
201
|
+
*/
|
|
202
|
+
replace(layer: SelectableLayerWithObjectIds, selection: ObjectId[]): void;
|
|
203
|
+
/**
|
|
204
|
+
* @param layer - The selectable layer for which to replace the selection. This must be a layer in the [sources](#sources). It can be a layer with graphics or object IDs.
|
|
205
|
+
* @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) or [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to set as the current selection.
|
|
206
|
+
*/
|
|
207
|
+
replace(layer: SelectableLayer, selection: SelectionIdentifier[]): void;
|
|
208
|
+
/**
|
|
209
|
+
* A convenience method to synchronize the [sources](#sources) with the layers and tables in the provided view. This is useful when layers or tables have been added or removed from the [View](https://developers.arcgis.com/javascript/latest/references/core/views/View/). This method is not applicable if [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/) is not provided with the view.
|
|
210
|
+
*
|
|
211
|
+
* @see [sources](#sources)
|
|
212
|
+
* @example
|
|
213
|
+
* // Add a layer to the view's map after the selection manager has already been created
|
|
214
|
+
* // and synced with the existing layers.
|
|
215
|
+
* // Then, call syncSources to update the selection manager with the new layer.
|
|
216
|
+
* const selectionManager = new SelectionManager({
|
|
217
|
+
* view: someView
|
|
218
|
+
* });
|
|
219
|
+
* someView.map.add(featureLayer);
|
|
220
|
+
* selectionManager.syncSources();
|
|
221
|
+
*/
|
|
222
|
+
syncSources(): void;
|
|
223
|
+
/**
|
|
224
|
+
* Toggles selection for the provided features within the provided layer's selection set.
|
|
225
|
+
* If a given feature is part of the current set it will be removed, otherwise it will be added.
|
|
226
|
+
* This method is designed to make it easy to toggle features in/out of the selected set in response to a query or UI event.
|
|
227
|
+
*
|
|
228
|
+
* @param layer - The selectable layer for which to toggle the selection. This must be a layer with graphics in the [sources](#sources).
|
|
229
|
+
* @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) to toggle within the current selection.
|
|
230
|
+
*/
|
|
231
|
+
toggle(layer: GraphicsLayer, selection: Graphic[]): void;
|
|
232
|
+
/**
|
|
233
|
+
* @param layer - The selectable layer for which to toggle the selection. This must be a layer with object IDs in the [sources](#sources).
|
|
234
|
+
* @param selection - An array of features, ie. [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to toggle within the current selection.
|
|
235
|
+
*/
|
|
236
|
+
toggle(layer: SelectableLayerWithObjectIds, selection: ObjectId[]): void;
|
|
237
|
+
/**
|
|
238
|
+
* @param layer - The selectable layer for which to toggle the selection. This must be a layer in the [sources](#sources). It can be a layer with graphics or object IDs.
|
|
239
|
+
* @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) or [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to toggle within the current selection.
|
|
240
|
+
*/
|
|
241
|
+
toggle(layer: SelectableLayer, selection: SelectionIdentifier[]): void;
|
|
242
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{isSome as e}from"../../../core/arrayUtils.js";import o from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import{watch as i,initial as r}from"../../../core/reactiveUtils.js";import{property as s,subclass as a}from"../../../core/accessorSupport/decorators.js";import p from"../../../geometry/Point.js";import l from"../../../geometry/Polyline.js";import{isBezierCurve as c}from"../../../geometry/support/curves/curveUtils.js";import{PluginBase as h}from"./PluginBase.js";const d=Symbol("left-vertex"),u=Symbol("right-vertex"),_=Symbol("cp1"),P=Symbol("cp2"),m=Symbol("endpoint"),f=Symbol("anchor");let y=class extends h{constructor(){super(...arguments),this._controlPoint1LineId=Symbol(),this._controlPoint2LineId=Symbol(),this._mirroredCp2VisualId=Symbol(),this.enableSplineBehavior=!0,this.state="placing-anchor"}get
|
|
2
|
+
import{__decorate as t}from"tslib";import{isSome as e}from"../../../core/arrayUtils.js";import o from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import{watch as i,initial as r}from"../../../core/reactiveUtils.js";import{property as s,subclass as a}from"../../../core/accessorSupport/decorators.js";import p from"../../../geometry/Point.js";import l from"../../../geometry/Polyline.js";import{isBezierCurve as c}from"../../../geometry/support/curves/curveUtils.js";import{PluginBase as h}from"./PluginBase.js";const d=Symbol("left-vertex"),u=Symbol("right-vertex"),_=Symbol("cp1"),P=Symbol("cp2"),m=Symbol("endpoint"),f=Symbol("anchor");let y=class extends h{constructor(){super(...arguments),this._controlPoint1LineId=Symbol(),this._controlPoint2LineId=Symbol(),this._mirroredCp2VisualId=Symbol(),this.enableSplineBehavior=!0,this.state="placing-anchor"}get test(){return{computeCurve:this._computeCurve.bind(this),recomputeAndApply:this._recomputeAndApply.bind(this),cp1LineSymbol:this._controlPoint1LineId,cp2LineSymbol:this._controlPoint2LineId,controlPointId:this._mirroredCp2VisualId}}start(t,e){super.start(t,e);const o=t.session;o.preserveSharedRedoAfterOperation=!0,this.ownPlacedLeftAnchor=e?.ownPlacedLeftAnchor,this.leftAnchor=o.getInformationAboutPoint(-1,-1)?.point;let n=e?.state;if(!this.leftAnchor&&this.ownPlacedLeftAnchor?(this.leftAnchor=this.ownPlacedLeftAnchor,o.appendOrReplacePoint(d,this.leftAnchor),o?.groupGeometryChanges()):this.leftAnchor&&"placing-anchor"===e?.state&&(n="placing-control-point-1",this.ownPlacedLeftAnchor=null),this.state=this.leftAnchor?n??"placing-control-point-1":"placing-anchor",this.controlPoint1=e?.controlPoint1,this.endPoint=e?.endPoint,this.controlPoint2=e?.controlPoint2,this.enableSplineBehavior&&"placing-control-point-1"===this.state&&!n){const t=o.getInformationAboutPoint(-1,-1);if(t?.curveInfo&&c(t.curveInfo)){const[e,n]=t.curveInfo.b[2],{spatialReference:i}=t.point,r=new p({x:e,y:n,spatialReference:i}),s=g(t.point,r);this.controlPoint1=s,o?.pushUndoStep(this._captureState()),this.state="placing-endpoint",o?.pushUndoStep(this._captureState())}}this.addHandles([i(()=>this._anchorCursor?.outputMapPosition,t=>{t&&(this.leftAnchor=this.ownPlacedLeftAnchor=t,this._session?.appendOrReplacePoint(d,t))}),i(()=>this._cp1Cursor?.outputMapPosition,t=>{t&&(this.controlPoint1=t,this._recomputeAndApply())}),i(()=>this._endpointCursor?.outputMapPosition,t=>{t&&(this.endPoint=t,this._recomputeAndApply())}),i(()=>this._cp2Cursor?.outputMapPosition,t=>{t&&(this.controlPoint2=t,this._recomputeAndApply())})],this._ownHandlesKey),this._applyState(this.state),this._setupRendering(t)}completeStep(){if(this._isComplete)return;const t=this._session?.peekUndoStep();if(t){const e=this._captureState();t&&t.state===e?.state&&(t.controlPoint1=e.controlPoint1,t.controlPoint2=e.controlPoint2,t.endPoint=e.endPoint,t.leftAnchor=e.leftAnchor)}else this._session?.pushUndoStep(this._captureState());try{switch(this._session.preserveSharedRedoAfterOperation=!1,this.state){case"placing-anchor":this._applyState(this.state="placing-control-point-1");break;case"placing-control-point-1":this._applyState(this.state="placing-endpoint");break;case"placing-endpoint":this._applyState(this.state="placing-control-point-2");break;case"placing-control-point-2":this._context?.requestComplete()}}finally{this._session.preserveSharedRedoAfterOperation=!0}this._session?.pushUndoStep(this._captureState())}beforeAttachPlugin(t){return{useStandaloneSession:!0}}suspend(){return this._captureState()}_applyState(t){const e=this._session;if(!e)throw new o("drawTool:invalid-state","Bezier: attempted to apply state while context invalid");switch(e.automaticRestart=!1,this.removeHandles(_),this.removeHandles(m),this.removeHandles(P),this.removeHandles(f),t){case"placing-anchor":e.automaticRestart=!0,this._setupAnchorCursor();break;case"placing-control-point-1":{const{ownPlacedLeftAnchor:t}=this;e.automaticRestart=!t,t&&e.groupGeometryChanges(),this._setupCP1Cursor();break}case"placing-endpoint":this._setupCP1Cursor(),this._setupEndpointCursor();break;case"placing-control-point-2":this._setupCP1Cursor(),this._setupEndpointCursor(),this._setupCP2Cursor()}}_setupAnchorCursor(){this._anchorCursor=this._context.createInteractiveHandle({defaultCaptureMode:"capture-always",inputMapPosition:this._context.positionOfLastUserInput,role:"primary",selfSnappingEnabled:!1,snappingEnabled:!0}),this.addHandles(n(()=>{this._anchorCursor&&(this._context?.removeInteractiveHandle(this._anchorCursor),this._anchorCursor=null)}),f)}_setupCP1Cursor(){const t="placing-control-point-1"===this.state?"capture-always":"grabbable-object";this._cp1Cursor=this._context.createInteractiveHandle({defaultCaptureMode:t,inputMapPosition:"capture-always"===t?void 0:this.controlPoint1,role:"secondary",selfSnappingEnabled:!1,snappingEnabled:!0}),this.addHandles(n(()=>{this._cp1Cursor&&(this._context?.removeInteractiveHandle(this._cp1Cursor),this._cp1Cursor=null)}),_)}_setupEndpointCursor(){const t="placing-endpoint"===this.state?"capture-always":"grabbable-object";this._endpointCursor=this._context.createInteractiveHandle({defaultCaptureMode:t,inputMapPosition:"capture-always"===t?void 0:this.endPoint??this.controlPoint1,role:"primary",selfSnappingEnabled:!0,snappingEnabled:!0}),this.addHandles(n(()=>{this._endpointCursor&&(this._context?.removeInteractiveHandle(this._endpointCursor),this._endpointCursor=null)}),m)}_setupCP2Cursor(){const t="placing-control-point-2"===this.state?"capture-always":"grabbable-object";this._cp2Cursor=this._context.createInteractiveHandle({defaultCaptureMode:t,inputMapPosition:"capture-always"===t?void 0:this.controlPoint2??this.endPoint??this._context.positionOfLastUserInput,role:"secondary",selfSnappingEnabled:!1,snappingEnabled:!0}),this.addHandles(n(()=>{this._cp2Cursor&&(this._context?.removeInteractiveHandle(this._cp2Cursor),this._cp2Cursor=null)}),P)}_computeCurve(){const{leftAnchor:t,controlPoint1:e,endPoint:o,controlPoint2:n,state:i}=this;return t?"placing-control-point-1"===i&&e?C(e,e,e):"placing-endpoint"===i&&e&&o?C(o,e,o):e&&o&&n?C(o,e,n,{flipControlPoint2:!0}):null:null}_recomputeAndApply(){const t=this._computeCurve();t&&this._session?.appendOrReplaceCurve(u,t)}_setupRendering(t){t.addOrUpdateVisual(this._controlPoint1LineId,{role:"constructionLine",state:"idle"}),t.addOrUpdateVisual(this._controlPoint2LineId,{role:"constructionLine",state:"idle"}),t.addOrUpdateVisual(this._mirroredCp2VisualId,{role:"controlPoint",state:"idle"}),this.addHandles([i(()=>[this.controlPoint1,this.controlPoint2,this.endPoint,this.leftAnchor],([e,o,n,i])=>{const{state:r}=this;if(i&&e&&"placing-control-point-1"!==r&&"placing-anchor"!==r){const o=new l({paths:[[[i.x,i.y],[e.x,e.y]]],spatialReference:i.spatialReference});t.addOrUpdateVisual(this._controlPoint1LineId,{geometry:o})}else t.addOrUpdateVisual(this._controlPoint1LineId,{geometry:null});if(o&&n&&i){const e=g(n,o),i=new l({paths:[[[o.x,o.y],[e.x,e.y]]],spatialReference:o.spatialReference});t.addOrUpdateVisual(this._controlPoint2LineId,{geometry:i}),t.addOrUpdateVisual(this._mirroredCp2VisualId,{geometry:e})}else t.addOrUpdateVisual(this._controlPoint2LineId,{geometry:null}),t.addOrUpdateVisual(this._mirroredCp2VisualId,{geometry:null})},r)],this._ownHandlesKey)}_captureState(){const{state:t,controlPoint1:e,controlPoint2:o,endPoint:n,leftAnchor:i,ownPlacedLeftAnchor:r}=this;return{state:t,controlPoint1:e,endPoint:n,controlPoint2:o,leftAnchor:i,ownPlacedLeftAnchor:r}}};function C(t,o,n,i){const r=[t.x,t.y,t.z,t.m].filter(e),s=i?.flipControlPoint2?g(t,n):n;return{b:[r,[o.x,o.y],[s.x,s.y]]}}function g(t,e){const{x:o,y:n,spatialReference:i}=t,{x:r,y:s}=e;return new p({x:o+(o-r),y:n+(n-s),spatialReference:i})}t([s()],y.prototype,"_anchorCursor",void 0),t([s()],y.prototype,"_cp1Cursor",void 0),t([s()],y.prototype,"_endpointCursor",void 0),t([s()],y.prototype,"_cp2Cursor",void 0),t([s()],y.prototype,"enableSplineBehavior",void 0),t([s()],y.prototype,"state",void 0),t([s()],y.prototype,"controlPoint1",void 0),t([s()],y.prototype,"controlPoint2",void 0),t([s()],y.prototype,"endPoint",void 0),t([s()],y.prototype,"leftAnchor",void 0),t([s()],y.prototype,"ownPlacedLeftAnchor",void 0),y=t([a("esri.views.draw.plugins.BezierSegmentPlugin")],y);export{y as BezierSegmentPlugin,C as createBezier,g as mirrorControlPoint};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{makeHandle as i}from"../../../core/handleUtils.js";import{watch as r}from"../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../core/accessorSupport/decorators.js";import{geometryToCoordinates as s}from"../../../geometry/support/coordsUtils.js";import{PluginBase as a}from"./PluginBase.js";const p=Symbol("left-anchor-vertex"),c=Symbol("right-vertex"),h=Symbol("anchor"),l=Symbol("endpoint"),d=Symbol("interior-point");let u=class extends a{constructor(){super(...arguments),this.arcDrawingMode="interior-first",this.state="placing-anchor"}get test(){return{state:this.state,captureState:()=>this._captureState()}}start(t,e){super.start(t,e);const i=t.session;i.preserveSharedRedoAfterOperation=!0,this.ownPlacedLeftAnchor=e?.ownPlacedLeftAnchor,this.leftAnchor=i.getInformationAboutPoint(-1,-1)?.point;let o=e?.state;!this.leftAnchor&&this.ownPlacedLeftAnchor?(this.leftAnchor=this.ownPlacedLeftAnchor,i.appendOrReplacePoint(p,this.leftAnchor),i?.groupGeometryChanges()):this.leftAnchor&&"placing-anchor"===e?.state&&(o=this._getNextState("placing-anchor"),this.ownPlacedLeftAnchor=null),this.state=this.leftAnchor?o??this._getNextState("placing-anchor"):"placing-anchor",this.interiorPoint=e?.interiorPoint,this.endpoint=e?.endpoint,this.addHandles([r(()=>this._anchorCursor?.outputMapPosition,t=>{t&&(this.leftAnchor=this.ownPlacedLeftAnchor=t,this._session?.appendOrReplacePoint(p,t))}),r(()=>this._interiorPointCursor?.outputMapPosition,t=>{t&&(this.interiorPoint=t,this._recomputeAndApply())}),r(()=>this._endpointCursor?.outputMapPosition,t=>{t&&(this.endpoint=t,this._recomputeAndApply())})],this._ownHandlesKey),this._applyState(this.state)}async completeStep(){if(this._isComplete)return;const t=this._session?.peekUndoStep();if(t){const e=this._captureState();t&&t.state===e.state&&(t.leftAnchor=e.leftAnchor,t.interiorPoint=e.interiorPoint,t.endpoint=e.endpoint)}else this._session?.pushUndoStep(this._captureState());"placing-anchor"===this.state&&this.ownPlacedLeftAnchor&&this._session?.groupGeometryChanges();try{this._session.preserveSharedRedoAfterOperation=!1;const t=this._getNextState(this.state);null===t?this._context?.requestComplete():this._applyState(this.state=t)}finally{this._session.preserveSharedRedoAfterOperation=!0}this._session?.pushUndoStep(this._captureState())}beforeAttachPlugin(t){return{useStandaloneSession:!0}}suspend(){return this._captureState()}_applyState(t){const i=this._session;if(!i)throw new e("drawTool:invalid-state","Circular Arc: attempted to apply state while context invalid");this.removeHandles(h),this.removeHandles(l),this.removeHandles(d),i.automaticRestart=this._computeAutomaticRestart(),"placing-anchor"!==t?("placing-interior"!==t&&"interior-first"!==this.arcDrawingMode||this._setupInteriorPointCursor(),"placing-endpoint"!==t&&"end-first"!==this.arcDrawingMode||this._setupEndpointCursor()):this._setupAnchorCursor()}_setupAnchorCursor(){this._anchorCursor=this._context.createInteractiveHandle({defaultCaptureMode:"capture-always",inputMapPosition:this._context.positionOfLastUserInput,role:"primary",selfSnappingEnabled:!1,snappingEnabled:!0}),this.addHandles(i(()=>{this._anchorCursor&&(this._context?.removeInteractiveHandle(this._anchorCursor),this._anchorCursor=null)}),h)}_setupInteriorPointCursor(){const t="placing-interior"===this.state?"capture-always":"grabbable-object";this._interiorPointCursor=this._context.createInteractiveHandle({defaultCaptureMode:t,inputMapPosition:"capture-always"===t?void 0:this.interiorPoint??this.endpoint,role:"secondary",selfSnappingEnabled:!1,snappingEnabled:!0}),this.addHandles(i(()=>{this._interiorPointCursor&&(this._context?.removeInteractiveHandle(this._interiorPointCursor),this._interiorPointCursor=null)}),d)}_setupEndpointCursor(){const t="placing-endpoint"===this.state?"capture-always":"grabbable-object";this._endpointCursor=this._context.createInteractiveHandle({defaultCaptureMode:t,inputMapPosition:"capture-always"===t?void 0:this.endpoint??this.interiorPoint,role:"primary",selfSnappingEnabled:!0,snappingEnabled:!0}),this.addHandles(i(()=>{this._endpointCursor&&(this._context?.removeInteractiveHandle(this._endpointCursor),this._endpointCursor=null)}),l)}_captureState(){const{state:t,endpoint:e,interiorPoint:i,leftAnchor:r,ownPlacedLeftAnchor:o}=this;return{state:t,endpoint:e,interiorPoint:i,leftAnchor:r,ownPlacedLeftAnchor:o}}_computeAutomaticRestart(){return"placing-anchor"===this.state||("placing-interior"===this.state?"interior-first"===this.arcDrawingMode&&!this.ownPlacedLeftAnchor:"end-first"===this.arcDrawingMode&&!this.ownPlacedLeftAnchor)}_makeCurve(){const{interiorPoint:t,endpoint:e}=this;if(!t&&!e)return null;const i=e??t,r=s(t??e);return{c:[s(i),_(r)]}}_recomputeAndApply(){const t=this._makeCurve();t&&this._session?.appendOrReplaceCurve(c,t)}_getNextState(t){switch(t){case"placing-anchor":return"interior-first"===this.arcDrawingMode?"placing-interior":"placing-endpoint";case"placing-interior":return"interior-first"===this.arcDrawingMode?"placing-endpoint":null;case"placing-endpoint":return"end-first"===this.arcDrawingMode?"placing-interior":null}}};function _(t){return 2===t.length?t:[t[0]??0,t[1]??0]}t([o()],u.prototype,"_anchorCursor",void 0),t([o()],u.prototype,"_endpointCursor",void 0),t([o()],u.prototype,"_interiorPointCursor",void 0),t([o()],u.prototype,"arcDrawingMode",void 0),t([o()],u.prototype,"interiorPoint",void 0),t([o()],u.prototype,"endpoint",void 0),t([o()],u.prototype,"leftAnchor",void 0),t([o()],u.prototype,"ownPlacedLeftAnchor",void 0),t([o()],u.prototype,"state",void 0),u=t([n("esri.views.draw.plugins.CircularArcSegmentPlugin")],u);export{u as CircularArcSegmentPlugin};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types and interfaces for feature selection in layers and views.
|
|
3
|
+
*
|
|
4
|
+
* @since 5.0
|
|
5
|
+
*/
|
|
6
|
+
import type Graphic from "../../Graphic.js";
|
|
7
|
+
import type Accessor from "../../core/Accessor.js";
|
|
8
|
+
import type GraphicsLayer from "../../layers/GraphicsLayer.js";
|
|
9
|
+
import type Field from "../../layers/support/Field.js";
|
|
10
|
+
import type FieldsIndex from "../../layers/support/FieldsIndex.js";
|
|
11
|
+
import type FeatureSet from "../../rest/support/FeatureSet.js";
|
|
12
|
+
import type Query from "../../rest/support/Query.js";
|
|
13
|
+
import type { LoadableMixin } from "../../core/Loadable.js";
|
|
14
|
+
import type { FeatureTitleOptions } from "../../layers/types.js";
|
|
15
|
+
import type { RendererUnion } from "../../renderers/types.js";
|
|
16
|
+
import type { RequestOptions } from "../../request/types.js";
|
|
17
|
+
import type { ObjectId } from "../types.js";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* An identifier used to represent a selected feature in a layer. This can either be a [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) (for layers with graphics) or an object ID (for layers with object IDs).
|
|
21
|
+
*
|
|
22
|
+
* @since 5.0
|
|
23
|
+
*/
|
|
24
|
+
export type SelectionIdentifier = Graphic | ObjectId;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A simple object representing the selected features in a layer.
|
|
28
|
+
*
|
|
29
|
+
* @since 5.0
|
|
30
|
+
*/
|
|
31
|
+
export interface LayerSelection {
|
|
32
|
+
/** The layer associated with the selection. */
|
|
33
|
+
layer: SelectableLayer;
|
|
34
|
+
/** The selected features in the layer. The selection identifiers can either be [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/)s or object IDs depending on the capabilities of the layer. */
|
|
35
|
+
selection: SelectionIdentifier[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* An object storing the changes in selection for a given layer.
|
|
40
|
+
*
|
|
41
|
+
* @since 5.0
|
|
42
|
+
*/
|
|
43
|
+
export interface LayerSelectionChange extends LayerSelection {
|
|
44
|
+
/** The features that were added to the selection for the layer. */
|
|
45
|
+
added?: SelectionIdentifier[];
|
|
46
|
+
/** The features that were removed from the selection for the layer. */
|
|
47
|
+
removed?: SelectionIdentifier[];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** An object representing the selected features in a layer, including the layer and the feature set containing the selected features. */
|
|
51
|
+
export interface LayerFeatureSet {
|
|
52
|
+
/** The layer for which the feature set is stored. */
|
|
53
|
+
layer: SelectableLayerWithObjectIds;
|
|
54
|
+
/** The feature set containing the selected features. */
|
|
55
|
+
data: FeatureSet;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** The types of layers that can be selected. */
|
|
59
|
+
export type SelectableLayerType = "csv" | "feature" | "geojson" | "parquet" | "graphics" | "knowledge-graph" | "knowledge-graph-sublayer" | "map-image" | "ogc-feature" | "stream" | "wfs" | "sublayer" | "subtype-sublayer" | "subtype-group";
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The underlying base type for selectable layers which contains common properties and methods for both layers with graphics and layers with object IDs.
|
|
63
|
+
*
|
|
64
|
+
* @since 5.0
|
|
65
|
+
*/
|
|
66
|
+
export interface SelectableLayerBase extends Accessor, LoadableMixin {
|
|
67
|
+
/** The unique identifier of the layer. */
|
|
68
|
+
id: string;
|
|
69
|
+
/** The type of the layer. */
|
|
70
|
+
type: SelectableLayerType;
|
|
71
|
+
/** **Optional:** The name of the field used to display features in the layer. */
|
|
72
|
+
displayField?: string | null;
|
|
73
|
+
/** **Optional:** The fields used to create feature titles. It can be a single field name or an array of field names. */
|
|
74
|
+
featureTitleFields?: string[];
|
|
75
|
+
/** **Optional:** The name of the global ID field in the layer. */
|
|
76
|
+
globalIdField?: string | null;
|
|
77
|
+
/** **Optional:** Indicates whether the layer is a table. */
|
|
78
|
+
isTable?: boolean | null;
|
|
79
|
+
/** **Optional:** The numeric ID of the layer in a service. */
|
|
80
|
+
layerId?: number | null;
|
|
81
|
+
/** **Optional:** The renderer assigned to the layer. */
|
|
82
|
+
renderer?: RendererUnion | null;
|
|
83
|
+
/** **Optional:** The name of the subtype field in the layer. */
|
|
84
|
+
subtypeField?: string | null;
|
|
85
|
+
/** **Optional:** The title of the layer. */
|
|
86
|
+
title?: string | null;
|
|
87
|
+
/** **Optional:** Indicates whether the layer is visible. */
|
|
88
|
+
visible?: boolean | null;
|
|
89
|
+
/**
|
|
90
|
+
* **Optional:** Gets the title for a specific feature represented by a graphic.
|
|
91
|
+
*
|
|
92
|
+
* @param graphic - The graphic for which to get the title.
|
|
93
|
+
* @param options - The options for getting the feature title.
|
|
94
|
+
* @returns A promise that resolves to the feature title.
|
|
95
|
+
*/
|
|
96
|
+
getFeatureTitle?(graphic: Graphic, options?: FeatureTitleOptions): Promise<string>;
|
|
97
|
+
/**
|
|
98
|
+
* Gets the titles for multiple features represented by an array of graphics.
|
|
99
|
+
*
|
|
100
|
+
* @param graphics - An array of graphics for which to get the titles.
|
|
101
|
+
* @param options - The options for getting the feature titles.
|
|
102
|
+
* @returns A promise that resolves to a map of object IDs to feature titles.
|
|
103
|
+
*/
|
|
104
|
+
getFeatureTitles?(graphics: Graphic[], options?: FeatureTitleOptions): Promise<Map<ObjectId, string>>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* This applies only to layer types that support object IDs.
|
|
109
|
+
*
|
|
110
|
+
* @since 5.0
|
|
111
|
+
*/
|
|
112
|
+
export interface SelectableLayerWithObjectIds extends SelectableLayerBase {
|
|
113
|
+
/** An array of fields in the layer. */
|
|
114
|
+
fields: Field[];
|
|
115
|
+
/** A fields index for a specific field in the layer. This helps to quickly look up field information by field name. */
|
|
116
|
+
fieldsIndex: FieldsIndex<Field>;
|
|
117
|
+
/** The name of the Object ID field in the layer. */
|
|
118
|
+
objectIdField: string;
|
|
119
|
+
/**
|
|
120
|
+
* Creates a new query object for the layer.
|
|
121
|
+
*
|
|
122
|
+
* @returns A new query object for the layer.
|
|
123
|
+
*/
|
|
124
|
+
createQuery(): Query;
|
|
125
|
+
/**
|
|
126
|
+
* Queries features from the layer based on the provided query parameters.
|
|
127
|
+
*
|
|
128
|
+
* @param query - The query parameters.
|
|
129
|
+
* @param requestOptions - Additional options for the request.
|
|
130
|
+
* @returns A promise that resolves to the feature set containing the queried features.
|
|
131
|
+
*/
|
|
132
|
+
queryFeatures(query?: Query, requestOptions?: RequestOptions): Promise<FeatureSet>;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* A selectable layer which can either be layers containing object IDs or layers with graphics.
|
|
137
|
+
*
|
|
138
|
+
* @since 5.0
|
|
139
|
+
*/
|
|
140
|
+
export type SelectableLayer = SelectableLayerWithObjectIds | GraphicsLayer;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{isGraphic as n}from"../../support/graphicInstanceUtils.js";function e(n){return!(null==n||"object"!=typeof n||!("id"in n)||!("type"in n))}function r(n){return!!(e(n)&&"on"in n&&n.on)}function t(n){return!!(e(n)&&"graphics"in n&&n.graphics)}function i(n){return!!(e(n)&&"fields"in n&&"fieldsIndex"in n&&"objectIdField"in n&&"createQuery"in n&&n.createQuery&&"queryFeatures"in n&&n.queryFeatures)}function u(n){return i(n)||t(n)}function c(n){return!!(null!=n&&"object"==typeof n&&"layer"in n&&n.layer&&e(n.layer)&&"view"in n)}function o(n){return!(!c(n)||!("queryGraphics"in n))}function a(n){return!!(c(n)&&"highlight"in n&&n.highlight)}function f(n){return!!(c(n)&&"createQuery"in n&&n.createQuery&&"queryFeatures"in n&&n.queryFeatures)}function l(n){return f(n)||o(n)}function y(n){return
|
|
2
|
+
import{isGraphic as n}from"../../support/graphicInstanceUtils.js";function e(n){return!(null==n||"object"!=typeof n||!("id"in n)||!("type"in n))}function r(n){return!!(e(n)&&"on"in n&&n.on)}function t(n){return!!(e(n)&&"graphics"in n&&n.graphics)}function i(n){return!!(e(n)&&"fields"in n&&"fieldsIndex"in n&&"objectIdField"in n&&"createQuery"in n&&n.createQuery&&"queryFeatures"in n&&n.queryFeatures)}function u(n){return i(n)||t(n)}function c(n){return!!(null!=n&&"object"==typeof n&&"layer"in n&&n.layer&&e(n.layer)&&"view"in n)}function o(n){return!(!c(n)||!("queryGraphics"in n))}function a(n){return!!(c(n)&&"highlight"in n&&n.highlight)}function f(n){return!!(c(n)&&"createQuery"in n&&n.createQuery&&"queryFeatures"in n&&n.queryFeatures)}function l(n){return f(n)||o(n)}function y(n){return!(null==n||"object"!=typeof n||!("isTable"in n)||!n.isTable)}function s(e){return!!e.length&&n(e[0])}export{s as isGraphicsSelectionIdentifier,u as isISelectableLayer,e as isISelectableLayerBase,r as isISelectableLayerBaseWithEditing,l as isISelectableLayerView,c as isISelectableLayerViewBase,o as isISelectableLayerViewWithGraphics,a as isISelectableLayerViewWithHighlights,f as isISelectableLayerViewWithObjectIds,t as isISelectableLayerWithGraphics,i as isISelectableLayerWithObjectIds,y as isTableLayer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{A as
|
|
2
|
+
import e from"../../WebScene.js";import n from"../../core/Error.js";import r from"../../core/Version.js";import{A as o}from"../../chunks/ajv.bundle.js";import{json as t}from"../../portal/schemas/webScene.js";import{convertAjvErrors as s}from"../../support/validationUtilsAjv.js";let i=null;function c(e,n){d(n);const r=h();return r.validate(j(n),e)?[]:s(r.errors??[])}async function a(n){let o=r.parse(n.version||"","webscene");const t=r.parse(e.version,"webscene");if(o.major===t.major&&o.minor===t.minor)return c(n);o.lessThan(1,38)&&(o=new r(1,38,"webscene"));const i=h(),a=m(o);if(null==i.getSchema(a)){const e=await fetch(l(o));if(e.ok){const n=await e.json();i.addSchema(n,a)}}return i.validate(a,n)?[]:s(i.errors??[])}async function f(e){const n=await a(e);if(n.length)throw new p(n)}function m(e){return`webscene-schema-v${e.major}.${e.minor}.json`}function l(e){return`https://js.arcgis.com/webscene-spec/${m(e)}`}function u(e){const n=e?t.definitions[j(e)]:void 0;if(!n)throw new Error(`invalid schema name to validate against '${e}'`);const r={};for(const o in n)r[o]=n[o];return r.definitions=t.definitions,r}function d(e){const n=j(e),r=h();if(!r.getSchema(n)){const o=u(e);r.addSchema(o,n)}}function h(){return i||(i=new o({allErrors:!0,extendRefs:!0}),i.addSchema(t,j()),i)}function w(){i=null}function j(e){return e?`${e}_schema.json`:"webScene_schema.json"}class p extends n{constructor(e){super("webscene:validation-failed",`WebScene validation failed with ${e.length} ${1===e.length?"error":"errors"}.`,{errors:e})}}export{p as WebSceneValidationError,f as assertValidWebScene,w as clearValidator,l as getVersionedWebSceneSchemaCDNUrl,c as validate,a as validateWebScene};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
function n(
|
|
2
|
+
import r from"../../core/Version.js";function n(r){return!!r?.greaterEqual(1,8)}function e(r){return!!r?.lessThan(1,8)}function o(n){const e=8,o=[],t=n.major;for(let u=e;u<=n.minor;u++)o.push(new r(t,u,"webscene"));return o}export{o as generateWebSceneVersions,e as supportsVisibleElevationLayersInSlides,n as versionSupportsGround};
|
|
@@ -1086,7 +1086,7 @@ export default class FeatureTableViewModel extends GridViewModel {
|
|
|
1086
1086
|
* // Discard all pending edits
|
|
1087
1087
|
* table.discardPendingEdits();
|
|
1088
1088
|
*/
|
|
1089
|
-
discardPendingEdits(edits?: DiscardPendingEditsParameters[]):
|
|
1089
|
+
discardPendingEdits(edits?: DiscardPendingEditsParameters[] | null | undefined): Promise<boolean>;
|
|
1090
1090
|
/**
|
|
1091
1091
|
* Exports features associated with currently selected rows to a CSV file and displays a download prompt. When invoked from the table's menu, it automatically includes geometry for features with a `point` geometry type. Geometry information is excluded on all other layer types.
|
|
1092
1092
|
*
|