@arcgis/core 6.0.0-next.20 → 6.0.0-next.21
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/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0049b66ccbfb168caa76.js +1 -0
- package/assets/esri/core/workers/chunks/17c6d66b47aa690df0d4.js +1 -0
- package/assets/esri/core/workers/chunks/{564565246dae080f5e6c.js → 1f6b601147521a42e65c.js} +1 -1
- package/assets/esri/core/workers/chunks/25d14874198773d2d836.js +1 -0
- package/assets/esri/core/workers/chunks/{00d66e3fba5ab4d2aa3c.js → 461e63a0f436c41a9f4a.js} +1 -1
- package/assets/esri/core/workers/chunks/{8a485130781b49dbf608.js → 601e1d020b8115497944.js} +1 -1
- package/assets/esri/core/workers/chunks/728837812940d7f2ef43.js +1 -0
- package/assets/esri/core/workers/chunks/{9401cc22373566e1171e.js → 8a7b02037151767542f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{9fab290090ef2ccae810.js → 9e0559cd0bb01a0ed9d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{597db9c90f19092d8d66.js → a0c9e3f8b7d55d6dc1d5.js} +10 -10
- package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +1 -0
- package/assets/esri/core/workers/chunks/{9d61740ef8bdcc162be1.js → a8df3f59728f841b608e.js} +1 -1
- package/assets/esri/core/workers/chunks/{28b74bc77f7c13080074.js → be97a629e2ae4d13ceb3.js} +1 -1
- package/assets/esri/core/workers/chunks/db9921fbda556f142c4a.js +1 -0
- package/assets/esri/core/workers/chunks/{612104dff305ff062dfa.js → dfc81e66196c402f39b4.js} +2 -2
- package/assets/esri/core/workers/chunks/{a34b3d2e11a777e1ff3f.js → f28b63c1179366dac8a2.js} +1 -1
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +113 -121
- package/config.d.ts +62 -34
- package/config.js +1 -1
- package/core/workers/Connection.d.ts +58 -89
- package/core/workers.d.ts +45 -54
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +7 -5
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeospatialPDFLayer.js +1 -1
- package/layers/MapImageLayer.d.ts +9 -3
- package/layers/MapNotesLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.d.ts +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +16 -16
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/mixins/ArcGISMapService.js +1 -1
- package/layers/ogc/ogcFeatureUtils.js +1 -1
- package/layers/support/Sublayer.d.ts +29 -15
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/package.json +3 -3
- package/rest/layerSources/DynamicDataLayer.d.ts +4 -2
- package/rest/layerSources/DynamicDataLayer.js +1 -1
- package/rest/layerSources/DynamicMapLayer.d.ts +1 -1
- package/rest/layerSources/DynamicWorkspaceLayer.d.ts +45 -0
- package/rest/layerSources/DynamicWorkspaceLayer.js +2 -0
- package/rest/layerSources/typeUtils.js +2 -0
- package/rest/print.js +1 -1
- package/rest/query/operations/queryRelatedRecords.js +1 -1
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/RelationshipQuery.js +1 -1
- package/symbols/LineSymbol3D.d.ts +5 -3
- package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +6 -0
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/layers/AnnotationFeatureLayerView2D.js +1 -1
- package/views/2d/layers/CSVLayerView2D.js +1 -1
- package/views/2d/layers/CatalogFootprintLayerView2D.js +1 -1
- package/views/2d/layers/DimensionFeatureLayerView2D.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/GeoJSONLayerView2D.js +1 -1
- package/views/2d/layers/KnowledgeGraphSublayerView2D.js +1 -1
- package/views/2d/layers/OGCFeatureLayerView2D.js +1 -1
- package/views/2d/layers/OrientedImageryLayerView2D.js +1 -1
- package/views/2d/layers/ParquetLayerView2D.js +1 -1
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
- package/views/2d/layers/WFSLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +6 -0
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/manipulators/ResizeManipulator.js +1 -1
- package/views/3d/interactive/manipulators/RotateManipulator.js +1 -1
- package/views/3d/interactive/manipulators/ShiftManipulator.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/support/elevationUpdateUtils.js +1 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js +2 -2
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/BreakpointsOwner.d.ts +6 -0
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/types.d.ts +3 -0
- package/views/ui/UI.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/1e40a26dcce4d1dadc28.js +0 -1
- package/assets/esri/core/workers/chunks/370aad23df597db80d65.js +0 -1
- package/assets/esri/core/workers/chunks/510502a4c9a2ba8d3f7b.js +0 -1
- package/assets/esri/core/workers/chunks/6ad309154fe84210d23c.js +0 -1
- package/assets/esri/core/workers/chunks/a49fe94933b65b4b64f8.js +0 -1
- package/assets/esri/core/workers/chunks/e8bf653376a607f00897.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import n from"../../../Graphic.js";import r from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{makeHandle as s,handlesGroup as c}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import l from"../../../core/Logger.js";import{destroyMaybe as u}from"../../../core/maybe.js";import{notDeepEqual as d}from"../../../core/object.js";import{createAbortError as f,ignoreAbortErrors as p,throwIfNotAbortError as m,isAbortError as h}from"../../../core/promiseUtils.js";import{watch as g,sync as _}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{getMetersPerUnitForSR as y}from"../../../core/units.js";import{property as b,subclass as x}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import C from"../../../geometry/Extent.js";import{fromJSON as w,getJsonType as T}from"../../../geometry/support/jsonUtils.js";import E from"../../../geometry/support/rotate.js";import{isCurvedGeometry as D}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as O}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import ee from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as k}from"../../../layers/graphics/featureConversionUtils.js";import A from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as te}from"../../../layers/support/featureLayerUtils.js";import{packFields as ne}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as re}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as ie}from"../../../layers/support/timeSupport.js";import ae from"../../../rest/support/AggregateFeatureSet.js";import oe from"../../../rest/support/AttributeBinsFeatureSet.js";import se from"../../../rest/support/AttributeBinsQuery.js";import j from"../../../rest/support/FeatureSet.js";import M from"../../../rest/support/Query.js";import{HittestDrawHelper as N}from"../../../symbols/cim/CIMSymbolDrawHelper.js";import{resolveSymbolToCIM as P}from"../../../symbols/cim/CIMSymbolHelper.js";import{getDisplayedSymbol as F}from"../../../symbols/support/symbolUtils.js";import{LayerView2D as I}from"./LayerView2D.js";import{FeatureContainer as L}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as R}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as z}from"./features/FeatureSourceEventLog.js";import{AnnotationLayerAdapter as B}from"./features/layerAdapters/AnnotationLayerAdapter.js";import{CatalogFootprintLayerAdapter as V}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{DimensionLayerAdapter as H}from"./features/layerAdapters/DimensionLayerAdapter.js";import{FeatureLayerAdapter as U}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as W}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as G}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as K}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as ce}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as le}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as ue}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as de}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as fe}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as q}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as J}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as pe}from"./support/FeatureCommandQueue.js";import{createFilterSchemas as me}from"./support/FilterSchema.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as X}from"./support/util.js";import{getMapPointsFromScreen as he,getHittestType as Z}from"../support/hitTestUtils.js";import{FeatureTileSubscriptionManager as ge}from"../tiling/FeatureTileSubscriptionManager.js";import{RefreshableLayerView as _e}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ve}from"../../support/highlightOptionsUtils.js";function ye(e,t){let n=new Set;return e&&e.forEach(e=>n.add(e)),t&&t.forEach(e=>n.add(e)),n.has(`*`)?[`*`]:Array.from(n)}const Q=4294967294;function be(e,t){return c(e.map(e=>g(()=>{let t=e();return t&&typeof t==`object`?`getTime`in t&&typeof t.getTime==`function`?t.getTime():JSON.stringify(t):t},t,_)))}function $(e){if(!e.geometry||!D(e.geometry))return e;let t=.001/y(e.geometry.spatialReference);return{geometry:O(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:100*t,maxDeviation:0}),attributes:e.attributes}}const xe=c=>{let _=_e(I(c)),y=class extends _{constructor(){super(...arguments),this._commandsQueue=new pe({process:e=>{switch(e.type){case`override-batch`:return this._doOverride(e);case`update`:return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this._stationaryRotation=0,this._lastSnappingComplexityExceeded=!0,this.eventLog=new z,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._hittestDrawHelper=null,this._sourceUpdating=!1,this.featureEffectView=new ee}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(f()),this._commandsQueue.destroy(),this._hittestDrawHelper?.destroy()}initialize(){this._workerAttached=Promise.withResolvers(),p(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){let e=this.layer;if(`isTable`in e&&e.isTable)throw new o(`featurelayerview:table-not-supported`,`table feature layer can't be displayed`,{layer:e});if((e.type===`feature`||e.type===`subtype-group`)&&re(e)?.operations.supportsQuery===!1)throw new o(`featurelayerview:query-not-supported`,`layer view requires a layer with query capability`,{layer:e});this._workerProxy&&this._workerProxy.destroy();let t=this._createClientOptions();this._workerProxy=await R(t)}async _attachProxy(){let e=E(this.view.extent,this.view.rotation,this.view.center),t={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON(),initialViewExtent:e.toJSON()};try{await this._workerProxy.pipeline.onAttach(t),this._workerAttached.resolve()}catch(e){this._workerAttached.reject(f()),m(e)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){let e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&e!=null&&e!==`1=1`;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get snappingComplexityExceeded(){if(this.eventLog.willQueryAllFeatures)return!1;let e=this.view.featuresTilingScheme.getClosestInfoForScale(this.view.scale).level,t=this.eventLog.getGeometryDensity(e),n=t?.sampleCount??0;return this.updating&&(this._lastSnappingComplexityExceeded||n<100)||(this._lastSnappingComplexityExceeded=t!=null&&n>0&&t.densePairCount/n>.95),this._lastSnappingComplexityExceeded}get layerAdapter(){switch(this.layer.type){case`annotation-feature`:return new B(this.layer);case`dimension-feature`:return new H(this.layer);case`feature`:return this.layer.source.type===`memory`?new G(this.layer):new U(this.layer);case`geojson`:case`csv`:case`wfs`:return new G(this.layer);case`parquet`:return new ue(this.layer);case`subtype-group`:return new fe(this.layer);case`ogc-feature`:return new ce(this.layer);case`stream`:return new de(this.layer);case`oriented-imagery`:return new le(this.layer);case`knowledge-graph-sublayer`:return new K(this.layer);case`catalog-footprint`:return new V(this.layer);default:this.layer}return null}get timeExtent(){return ie(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get(`timeExtent`))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}highlight(e,t){let r=ve(t),o;if(e instanceof A)o=e;else{let t;e instanceof n?t=[e.getObjectId()]:typeof e==`number`||typeof e==`string`?t=[e]:a.isCollection(e)&&e.length>0?t=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(t=typeof e[0]==`number`||typeof e[0]==`string`?e:e.map(e=>e?.getObjectId()));let r=t?.filter(i);if(!r?.length)return s();o=new A({objectIds:r})}let c=this._addHighlightFilter(o,r);return s(()=>!this.destroyed&&this._removeHighlight(c))}async hitTest(e,i,a){let o=Z(i);if(!o)return null;let s=o===`point`,{trueHitIds:c,candidateHitIds:l}=await this.featureContainer.hitTest(i,a??null),u=await this.getWorker(),[d,f]=await Promise.all([u.pipeline.getDisplayFeatures(l),u.pipeline.getDisplayFeatures(c)]),{features:p,aggregates:m,tracks:h}=d,{features:g,aggregates:_,tracks:v}=f,y=s?p:this.hasRenderer()?await this._filterCandidateHits(p,i,o):[],b=[...g,...y],x=[..._,...m],S=[...v,...h],C=this.featureContainer.getSortKeys(b.map(e=>e.displayId)),w=({displayId:e},{displayId:t})=>C.has(e)&&C.has(t)?C.get(e)-C.get(t):e-t;return b.sort(w).reverse(),x.sort(w).reverse(),[...x.map(n=>this._createAggregateGraphicHit(e,t.fromJSON(n))),...S.map(t=>this._createTrackGraphicHit(e,r.fromJSON(t))),...b.map(t=>this._createFeatureGraphicHit(s?e:null,n.fromJSON(t)))]}async _filterCandidateHits(e,t,r){let i=[],a=new n,{resolution:o,rotation:s}=this.view.state,c=he(this.view,t);for(let t of e){a.attributes=t.attributes,a.geometry=w(t.geometry),a.symbol=null;let e=this.layerAdapter.getRenderer(a);if(!e){i.push(t);continue}let n=await F(a,{renderer:e,scale:this.view.scale,resolution:this.view.resolution,spatialReference:this.view.spatialReference,viewingMode:`2d`,timeZone:this.view.timeZone});if(!n)continue;let l=await P(n,null,this.view.spatialReference,T(t.geometry),{scale:this.view.scale,viewingMode:`2d`});if(!l)continue;let u=this.view.stage.cimAnalyzer.analyzeSymbolReference({type:`CIMSymbolReference`,symbol:l},!1).some(e=>`alignment`in e&&e.alignment===0);this._hittestDrawHelper??=new N(this.view.stage.painter.textureManager.resourceManager);let d={hittestType:r,textInfo:null,mapRotation:s,resolution:o,searchDist:0,isScreenAligned:u};this._hittestDrawHelper.hitTest(c,l,t.geometry,d)&&i.push(t)}return i}async queryAggregateSummaryStatistics(e,t,n){let r={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),r,n);return Y(i,{})}async queryUniqueValues(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,n);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,n);return Y(a,{uniqueValueInfos:[]})}async queryAggregateClassBreaks(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,n);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForHistogram(this._cleanUpQuery(e),i,n);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateCount(e,t){let n=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(n,0)}async queryAggregateHistogram(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,n);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateIds(e,t){let n=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(n,[])}async queryAggregateJSON(e,t){let n=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(n,{features:[]})}async queryAttributeBins(e,t){let n=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),r=await Y(n,{features:[]});return oe.fromJSON(r)}async queryAggregates(e,t){let n=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),r=await Y(n,{features:[]}),i=ae.fromJSON(r);return i.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),i}async queryClassBreaks(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,n);return Y(a,{classBreakInfos:[]})}async queryExtent(e,t){let n=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),r=await Y(n,{count:0,extent:null});return{count:r.count,extent:C.fromJSON(r.extent)}}async queryFeatureCount(e,t){let n=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(n,0)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{let t=j.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryFeaturesJSON(e,t){let n=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(n,{features:[]})}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}async queryObjectIds(e,t){let n=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(n,[])}async queryStatistics(){let e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,n);return Y(a,{})}async queryVisibleFeatures(e,t){let n=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),r=await Y(n,{features:[]}),i=j.fromJSON(r);return i.features.forEach(e=>this._setOriginForFeature(e)),i}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptions)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);let t=this.featureContainer.getPresenting(),n=this._subscriptions.update(e.targetState,this._lastTargetState,t);n&&(this.featureContainer.updateSubscriptions(n),p(this._updatingHandles.addPromise(this.getWorker().then(e=>e.pipeline.updateSubscriptions(n))))),this._subscriptions.coverage&&this.featureContainer.setCoverage(this._subscriptions.coverage)}attach(){has(`esri-2d-update-debug`)&&console.debug(`FeatureLayerView2D.attach`),p(this._updatingHandles.addPromise(this._workerAttached.promise)),p(this._attachProxy()),this.featureContainer=new L(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptions=new ge(this.view.featuresTilingScheme),this._stationaryRotation=this.view.rotation,this.requestUpdate(),this.addAttachHandles([be([()=>this._displayRefreshVersion,()=>`displayFilterInfo`in this.layer&&this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),g(()=>this.updateSuspended,e=>{e||this._subscriptions.resume(this.featureContainer.getPresenting())}),g(()=>this.view.stationary,e=>{if(!e)return;let t=this.view.rotation;t!==this._stationaryRotation&&(this._stationaryRotation=t,this._update()),this.getWorker().then(e=>{if(this.destroyed)return;let t=E(this.view.extent,this.view.rotation,this.view.center);return e.pipeline.updateViewExtent(t.toJSON(),this.featureContainer.requiresRefresh)}).catch(()=>{})})]),this._update(),this.layer.type!==`stream`&&this.layer.type!==`parquet`&&this.layer.type!==`catalog-footprint`&&this.addAttachHandles(this.layer.on(`edits`,e=>this._editUpdatingHandles.addPromise(this._edit(e))))}emitFirstDraw(e){this.emit(`first-draw`,{timestamp:e})}detach(){has(`esri-2d-update-debug`)&&console.debug(`FeatureLayerView2D.detach`),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptions=u(this._subscriptions),this._workerProxy.pipeline.onDetach(),this._workerAttached=Promise.withResolvers(),p(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:`override`,options:{...e,release:[]}})}removeOverrides(e){for(let t of e)if(t==null)throw new o(`featurelayerview:bad-override`,`Tried to remove an override for an invalid objectId`,{objectId:t});let t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:`override`,options:t})}onProxyClientEvent(e){}hasRenderer(){return`renderer`in this.layer&&this.layer.renderer!=null}isUpdating(){let e=this.hasRenderer(),t=this._commandsQueue.updateTracking.updating,n=this._updatingRequiredPromise!=null,r=this.featureContainer.updating;return this.updateRequested||e&&(t||n)||r||this._pipelineUpdating||this.dataUpdating}_createClientOptions(){let e=this;return{updateSchemaStart(){return e.updateSchemaStart()},updateSchemaEnd(t){return e.updateSchemaEnd(t)},openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){let e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw Error(`InternalError: Layer adapter does not support opening message ports`)},openGlyphPorts:async()=>{let t=await e.container.stage.textureManager.openMessagePorts();return{result:t,transferList:t}},get container(){return e.featureContainer},setUpdating:e=>{this._set(`_pipelineUpdating`,e.pipeline),this._set(`_sourceUpdating`,e.source)},emitEvent:e=>{this.onProxyClientEvent(e)},get eventLog(){return e.eventLog},fetch:async t=>{if(has(`esri-2d-stabilize-glyphs`)){let n=[];for(let r of t)n.push(await e.view.stage.painter.textureManager.rasterizeItem(r));return n}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e))),fetchMesh:e=>Promise.all(e.map(e=>this._fetchMeshRequest(e)))}}async _fetchDictionaryRequest(e){try{if(!(`renderer`in this.layer)||!this.layer.renderer||this.layer.renderer.type!==`dictionary`)throw Error(`InternalError: Expected renderer to be of type 'dictionary'`);let t=this.layer.renderer,n=this._lastSchema.processor.mesh.factory.symbology;if(n.type!==`dictionary`)throw Error(`InternalError: Expected schema to be of type 'dictionary'`);let r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:n.scaleExpression,viewRotation:this._stationaryRotation};this._fields||=this.layer.fields.map(e=>e.toJSON());let i=n.visualVariableUniforms,a=X(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);return!o||!o.data?{type:`dictionary-response`,meshes:[]}:{type:`dictionary-response`,meshes:await q({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:`renderer`,schemaOptions:r})}}catch{return{type:`dictionary-response`,meshes:[]}}}async _fetchMeshRequest(e){let{layer:t}=this;try{let n={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:null,viewRotation:this._stationaryRotation};return this._fields||=t.fields.map(e=>e.toJSON()),{type:`mesh-response`,meshes:await q({...e.symbolReference,hasTextStringTemplates:!0},{path:`anno-like`,schemaOptions:n,uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null}})}}catch{return{type:`mesh-response`,meshes:[]}}}_cleanUpQuery(e){let t=M.from(e)||this.createQuery();return t.outSpatialReference||=this.view.spatialReference,`returnZ`in this.layer&&(t.returnZ??=this.layer.returnZ),`returnM`in this.layer&&(t.returnM??=this.layer.returnM),t.toJSON()}_cleanUpAttributeBinsQuery(e){let t=se.from(e);return t.outSpatialReference||=this.view.spatialReference,t.toJSON()}_cleanUpAggregateQuery(e){let t=M.from(e)||this.createAggregateQuery();t.outSpatialReference||=this.view.spatialReference;let n=t.objectIds??[];for(let e of t.aggregateIds??[])n.push(e);return t.objectIds=n,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:`update`})}_edit(e){return this._commandsQueue.push({type:`edit`,event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%Q+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%Q+1}async _resolveIdenifiers(e){let t=[],n=[];for(let r of e)r.objectId!=null&&r.objectId!==-1?t.push(r.objectId):r.globalId==null?l.getLogger(this).warn(`mapview-apply-edits`,`A feature identifier must contain either a GlobalId or ObjectId. Ignoring`,{identifier:r}):n.push(r.globalId);let r=`globalIdField`in this.layer&&this.layer.globalIdField,i=r&&this.availableFields.includes(r);if(n.length&&!i)return l.getLogger(this).error(new o(`mapview-apply-edits`,`Editing the specified service requires the layer's globalIdField, ${r} to be included the layer's outFields for updates to be reflected on the map`)),t;if(n.length){let e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(n);for(let n of e)t.push(n)}return t}_resolveOverrides(e){let t=X(this.layer.geometryType),n=W(this.layer),r=[];for(let i of e.added){let e=k($(i),t,!1,!1,n);if(e.objectId==null)throw new o(`featurelayerview:bad-override`,`Feature does not have an objectId`,{feature:i});r.push(e)}for(let i of e.updated){let e=k($(i),t,!1,!1,n);if(e.objectId==null)throw new o(`featurelayerview:bad-override`,`Feature does not have an objectId`,{feature:i});r.push(e)}for(let t of e.removed)if(t==null)throw new o(`featurelayerview:bad-override`,`Tried to remove an invalid objectId`,{objectId:t});return{type:`override`,updates:r,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){let t=this.layer,n=e.historicMoment?.getTime()??null,r=`layerId`in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(r&&this._canEditByFeature(r)){let{adds:e,deletes:t,updates:i}=r.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),s=t.map(e=>`attributes`in e?{objectId:a?e.attributes[a]:null}:e),c=await this._resolveIdenifiers(s);return this._resolveOverrides({added:e,updated:o,removed:c,historicMoment:n,isWeak:!0,release:[]})}let[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:`override-by-id`,updates:[...i,...a],removed:o,historicMoment:n,isWeak:!0}}_canEditByFeature(e){let{adds:t,updates:n}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&n.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async updateSchemaStart(){let e=this.layer;`featureReduction`in e&&e.featureReduction&&e.featureReduction!==this._lastFeatureReduction&&(e.featureReduction=e.featureReduction?.clone(),this._lastFeatureReduction=e.featureReduction);try{if(await Promise.allSettled([this._handleChange(),te(e)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptions)return null;let t=this.featureContainer.updateStart(e.type===`subtype-group`);this._lastFeatureEffect=this.featureEffect;let n={store:t,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0,viewRotation:this._stationaryRotation},r=await this._createViewSchemaConfig(),i={source:await this.layerAdapter.createSourceSchema(r,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(n,r,this._displayRefreshVersion)};return d(this._lastSchema?.source.strategy,i.source.strategy)||d(this._lastSchema?.processor,i.processor)?(this._lastSchema=i,this._fields=null,i):null}catch{}return null}async updateSchemaEnd(e){try{this.featureEffectView.featureEffect=this._lastFeatureEffect,e&&this.featureEffectView.endTransition(),await this.featureContainer.updateEnd(this._lastSchema.processor,this.layerAdapter.getLabelingDeconflictionInfo(),e),has(`esri-2d-update-debug`)&&console.debug(`FeatureLayerView2D.updateEnd`)}catch{}}async _doUpdate(){let e=Math.round(performance.now());await(await this.getWorker()).pipeline.updateSchema(e),this.requestUpdate()}async _doOverride(e){let t=await this.getWorker();try{let n=new J;for(let r of e.messages)switch(r.type){case`edit`:n.tryAdd(await this._resolveEdit(r.event))||(await t.pipeline.onOverride(n.toMessage()),n=new J,n.tryAdd(await this._resolveEdit(r.event)));break;case`override`:n.tryAdd(this._resolveOverrides(r.options))||(await t.pipeline.onOverride(n.toMessage()),n=new J,n.tryAdd(this._resolveOverrides(r.options)))}await t.pipeline.onOverride(n.toMessage())}catch(e){h(e)}}_getEffectiveAvailableFields(e){let t=ye(this._lastAvailableFields,e);return this._lastAvailableFields=t,ne(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){let e=this.requiresCurrentUser?await this.signedInUser:null,t=D(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),n=this.featureEffect?.filter?.toJSON()??null,r=this._getHighlightFilterGroups().map(({order:e,filters:t})=>({order:e,filters:t.map(e=>e.toJSON())})),i=me({layerFilter:t,effectFilter:n,highlightFilters:r});return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:i,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent,returnZ:this.hasZ,returnM:this.hasM}}_onHighlightChange(){this._commandsQueue.push({type:`update`})}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return t.geometry!=null&&(t.geometry.spatialReference=this.view.spatialReference),{type:`graphic`,graphic:t,layer:this.layer,mapPoint:e}}};e([b()],y.prototype,`_commandsQueue`,void 0),e([b()],y.prototype,`_sourceRefreshVersion`,void 0),e([b()],y.prototype,`_displayRefreshVersion`,void 0),e([b({readOnly:!0})],y.prototype,`_pipelineUpdating`,void 0),e([b()],y.prototype,`_sourceUpdating`,void 0),e([b({readOnly:!0})],y.prototype,`dataUpdating`,null),e([b({readOnly:!0})],y.prototype,`hasAllFeatures`,null),e([b({readOnly:!0})],y.prototype,`hasAllFeaturesInView`,null),e([b({readOnly:!0})],y.prototype,`hasFullGeometries`,null),e([b({readOnly:!0})],y.prototype,`snappingComplexityExceeded`,null),e([b()],y.prototype,`featureEffectView`,void 0),e([b()],y.prototype,`layerAdapter`,null),e([b({readOnly:!0})],y.prototype,`timeExtent`,null),y=e([x(`esri.views.2d.layers.FeatureLikeLayerView2D`)],y);function D(e,t,n,r,i,a){i&&=i.clone();let o=i==null?null:i.timeExtent,s=n!=null&&o!=null?n.intersection(o):n||o;s&&(i??=new A,i.timeExtent=s),i=t.addFilters?.(i,e)??i,a&&(i??=new A,i.where=v(i.where,a));let c=i?.toJSON()??null;return r.size&&(c??=new A().toJSON(),c.hiddenIds=Array.from(r)),c}return y};export{xe as FeatureLikeLayerView2D};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import n from"../../../Graphic.js";import r from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{makeHandle as s,handlesGroup as c}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import l from"../../../core/Logger.js";import{destroyMaybe as u}from"../../../core/maybe.js";import{notDeepEqual as d}from"../../../core/object.js";import{createAbortError as f,ignoreAbortErrors as p,throwIfNotAbortError as m,isAbortError as h}from"../../../core/promiseUtils.js";import{watch as g,sync as _}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{getMetersPerUnitForSR as y}from"../../../core/units.js";import{property as b,subclass as x}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import C from"../../../geometry/Extent.js";import{fromJSON as w,getJsonType as T}from"../../../geometry/support/jsonUtils.js";import E from"../../../geometry/support/rotate.js";import{isCurvedGeometry as D}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as O}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import k from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as A}from"../../../layers/graphics/featureConversionUtils.js";import j from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as M}from"../../../layers/support/featureLayerUtils.js";import{packFields as N}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as ee}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as te}from"../../../layers/support/timeSupport.js";import ne from"../../../rest/support/AggregateFeatureSet.js";import re from"../../../rest/support/AttributeBinsFeatureSet.js";import P from"../../../rest/support/AttributeBinsQuery.js";import F from"../../../rest/support/FeatureSet.js";import I from"../../../rest/support/Query.js";import{HittestDrawHelper as L}from"../../../symbols/cim/CIMSymbolDrawHelper.js";import{resolveSymbolToCIM as R}from"../../../symbols/cim/CIMSymbolHelper.js";import{getDisplayedSymbol as z}from"../../../symbols/support/symbolUtils.js";import{LayerView2D as B}from"./LayerView2D.js";import{FeatureContainer as V}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as H}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as U}from"./features/FeatureSourceEventLog.js";import{createFeatureIdInfo as W}from"./features/layerAdapters/featureServiceUtils.js";import{createComplexSymbolInstances as G}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as K}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as q}from"./support/FeatureCommandQueue.js";import{createFilterSchemas as J}from"./support/FilterSchema.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as X}from"./support/util.js";import{getMapPointsFromScreen as ie,getHittestType as ae}from"../support/hitTestUtils.js";import{FeatureTileSubscriptionManager as oe}from"../tiling/FeatureTileSubscriptionManager.js";import{RefreshableLayerView as se}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ce}from"../../support/highlightOptionsUtils.js";function Z(e,t){let n=new Set;return e&&e.forEach(e=>n.add(e)),t&&t.forEach(e=>n.add(e)),n.has(`*`)?[`*`]:Array.from(n)}const Q=4294967294;function le(e,t){return c(e.map(e=>g(()=>{let t=e();return t&&typeof t==`object`?`getTime`in t&&typeof t.getTime==`function`?t.getTime():JSON.stringify(t):t},t,_)))}function $(e){if(!e.geometry||!D(e.geometry))return e;let t=.001/y(e.geometry.spatialReference);return{geometry:O(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:100*t,maxDeviation:0}),attributes:e.attributes}}const ue=c=>{let _=se(B(c)),y=class extends _{constructor(){super(...arguments),this._commandsQueue=new q({process:e=>{switch(e.type){case`override-batch`:return this._doOverride(e);case`update`:return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this._stationaryRotation=0,this._lastSnappingComplexityExceeded=!0,this.eventLog=new U,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._hittestDrawHelper=null,this._sourceUpdating=!1,this.featureEffectView=new k}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(f()),this._commandsQueue.destroy(),this._hittestDrawHelper?.destroy()}initialize(){this._workerAttached=Promise.withResolvers(),p(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){let e=this.layer;if(`isTable`in e&&e.isTable)throw new o(`featurelayerview:table-not-supported`,`table feature layer can't be displayed`,{layer:e});if((e.type===`feature`||e.type===`subtype-group`)&&ee(e)?.operations.supportsQuery===!1)throw new o(`featurelayerview:query-not-supported`,`layer view requires a layer with query capability`,{layer:e});this._workerProxy&&this._workerProxy.destroy();let t=this._createClientOptions();this._workerProxy=await H(t)}async _attachProxy(){let e=E(this.view.extent,this.view.rotation,this.view.center),t={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON(),initialViewExtent:e.toJSON()};try{await this._workerProxy.pipeline.onAttach(t),this._workerAttached.resolve()}catch(e){this._workerAttached.reject(f()),m(e)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){let e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&e!=null&&e!==`1=1`;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get snappingComplexityExceeded(){if(this.eventLog.willQueryAllFeatures)return!1;let e=this.view.featuresTilingScheme.getClosestInfoForScale(this.view.scale).level,t=this.eventLog.getGeometryDensity(e),n=t?.sampleCount??0;return this.updating&&(this._lastSnappingComplexityExceeded||n<100)||(this._lastSnappingComplexityExceeded=t!=null&&n>0&&t.densePairCount/n>.95),this._lastSnappingComplexityExceeded}get timeExtent(){return te(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get(`timeExtent`))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}highlight(e,t){let r=ce(t),o;if(e instanceof j)o=e;else{let t;e instanceof n?t=[e.getObjectId()]:typeof e==`number`||typeof e==`string`?t=[e]:a.isCollection(e)&&e.length>0?t=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(t=typeof e[0]==`number`||typeof e[0]==`string`?e:e.map(e=>e?.getObjectId()));let r=t?.filter(i);if(!r?.length)return s();o=new j({objectIds:r})}let c=this._addHighlightFilter(o,r);return s(()=>!this.destroyed&&this._removeHighlight(c))}async hitTest(e,i,a){let o=ae(i);if(!o)return null;let s=o===`point`,{trueHitIds:c,candidateHitIds:l}=await this.featureContainer.hitTest(i,a??null),u=await this.getWorker(),[d,f]=await Promise.all([u.pipeline.getDisplayFeatures(l),u.pipeline.getDisplayFeatures(c)]),{features:p,aggregates:m,tracks:h}=d,{features:g,aggregates:_,tracks:v}=f,y=s?p:this.hasRenderer()?await this._filterCandidateHits(p,i,o):[],b=[...g,...y],x=[..._,...m],S=[...v,...h],C=this.featureContainer.getSortKeys(b.map(e=>e.displayId)),w=({displayId:e},{displayId:t})=>C.has(e)&&C.has(t)?C.get(e)-C.get(t):e-t;return b.sort(w).reverse(),x.sort(w).reverse(),[...x.map(n=>this._createAggregateGraphicHit(e,t.fromJSON(n))),...S.map(t=>this._createTrackGraphicHit(e,r.fromJSON(t))),...b.map(t=>this._createFeatureGraphicHit(s?e:null,n.fromJSON(t)))]}async _filterCandidateHits(e,t,r){let i=[],a=new n,{resolution:o,rotation:s}=this.view.state,c=ie(this.view,t);for(let t of e){a.attributes=t.attributes,a.geometry=w(t.geometry),a.symbol=null;let e=this.layerAdapter.getRenderer(a);if(!e){i.push(t);continue}let n=await z(a,{renderer:e,scale:this.view.scale,resolution:this.view.resolution,spatialReference:this.view.spatialReference,viewingMode:`2d`,timeZone:this.view.timeZone});if(!n)continue;let l=await R(n,null,this.view.spatialReference,T(t.geometry),{scale:this.view.scale,viewingMode:`2d`});if(!l)continue;let u=this.view.stage.cimAnalyzer.analyzeSymbolReference({type:`CIMSymbolReference`,symbol:l},!1).some(e=>`alignment`in e&&e.alignment===0);this._hittestDrawHelper??=new L(this.view.stage.painter.textureManager.resourceManager);let d={hittestType:r,textInfo:null,mapRotation:s,resolution:o,searchDist:0,isScreenAligned:u};this._hittestDrawHelper.hitTest(c,l,t.geometry,d)&&i.push(t)}return i}async queryAggregateSummaryStatistics(e,t,n){let r={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),r,n);return Y(i,{})}async queryUniqueValues(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,n);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,n);return Y(a,{uniqueValueInfos:[]})}async queryAggregateClassBreaks(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,n);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForHistogram(this._cleanUpQuery(e),i,n);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateCount(e,t){let n=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(n,0)}async queryAggregateHistogram(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,n);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateIds(e,t){let n=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(n,[])}async queryAggregateJSON(e,t){let n=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(n,{features:[]})}async queryAttributeBins(e,t){let n=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),r=await Y(n,{features:[]});return re.fromJSON(r)}async queryAggregates(e,t){let n=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),r=await Y(n,{features:[]}),i=ne.fromJSON(r);return i.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),i}async queryClassBreaks(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,n);return Y(a,{classBreakInfos:[]})}async queryExtent(e,t){let n=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),r=await Y(n,{count:0,extent:null});return{count:r.count,extent:C.fromJSON(r.extent)}}async queryFeatureCount(e,t){let n=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(n,0)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{let t=F.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryFeaturesJSON(e,t){let n=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(n,{features:[]})}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}async queryObjectIds(e,t){let n=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(n,[])}async queryStatistics(){let e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,n){let r=await this.getWorker(),i={...t,scale:this.view.scale},a=r.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,n);return Y(a,{})}async queryVisibleFeatures(e,t){let n=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),r=await Y(n,{features:[]}),i=F.fromJSON(r);return i.features.forEach(e=>this._setOriginForFeature(e)),i}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptions)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);let t=this.featureContainer.getPresenting(),n=this._subscriptions.update(e.targetState,this._lastTargetState,t);n&&(this.featureContainer.updateSubscriptions(n),p(this._updatingHandles.addPromise(this.getWorker().then(e=>e.pipeline.updateSubscriptions(n))))),this._subscriptions.coverage&&this.featureContainer.setCoverage(this._subscriptions.coverage)}attach(){has(`esri-2d-update-debug`)&&console.debug(`FeatureLayerView2D.attach`),p(this._updatingHandles.addPromise(this._workerAttached.promise)),p(this._attachProxy()),this.featureContainer=new V(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptions=new oe(this.view.featuresTilingScheme),this._stationaryRotation=this.view.rotation,this.requestUpdate(),this.addAttachHandles([le([()=>this._displayRefreshVersion,()=>`displayFilterInfo`in this.layer&&this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),g(()=>this.updateSuspended,e=>{e||this._subscriptions.resume(this.featureContainer.getPresenting())}),g(()=>this.view.stationary,e=>{if(!e)return;let t=this.view.rotation;t!==this._stationaryRotation&&(this._stationaryRotation=t,this._update()),this.getWorker().then(e=>{if(this.destroyed)return;let t=E(this.view.extent,this.view.rotation,this.view.center);return e.pipeline.updateViewExtent(t.toJSON(),this.featureContainer.requiresRefresh)}).catch(()=>{})})]),this._update(),this.layer.type!==`stream`&&this.layer.type!==`parquet`&&this.layer.type!==`catalog-footprint`&&this.addAttachHandles(this.layer.on(`edits`,e=>this._editUpdatingHandles.addPromise(this._edit(e))))}emitFirstDraw(e){this.emit(`first-draw`,{timestamp:e})}detach(){has(`esri-2d-update-debug`)&&console.debug(`FeatureLayerView2D.detach`),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptions=u(this._subscriptions),this._workerProxy.pipeline.onDetach(),this._workerAttached=Promise.withResolvers(),p(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:`override`,options:{...e,release:[]}})}removeOverrides(e){for(let t of e)if(t==null)throw new o(`featurelayerview:bad-override`,`Tried to remove an override for an invalid objectId`,{objectId:t});let t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:`override`,options:t})}onProxyClientEvent(e){}hasRenderer(){return`renderer`in this.layer&&this.layer.renderer!=null}isUpdating(){let e=this.hasRenderer(),t=this._commandsQueue.updateTracking.updating,n=this._updatingRequiredPromise!=null,r=this.featureContainer.updating;return this.updateRequested||e&&(t||n)||r||this._pipelineUpdating||this.dataUpdating}_createClientOptions(){let e=this;return{updateSchemaStart(){return e.updateSchemaStart()},updateSchemaEnd(t){return e.updateSchemaEnd(t)},openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){let e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw Error(`InternalError: Layer adapter does not support opening message ports`)},openGlyphPorts:async()=>{let t=await e.container.stage.textureManager.openMessagePorts();return{result:t,transferList:t}},get container(){return e.featureContainer},setUpdating:e=>{this._set(`_pipelineUpdating`,e.pipeline),this._set(`_sourceUpdating`,e.source)},emitEvent:e=>{this.onProxyClientEvent(e)},get eventLog(){return e.eventLog},fetch:async t=>{if(has(`esri-2d-stabilize-glyphs`)){let n=[];for(let r of t)n.push(await e.view.stage.painter.textureManager.rasterizeItem(r));return n}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e))),fetchMesh:e=>Promise.all(e.map(e=>this._fetchMeshRequest(e)))}}async _fetchDictionaryRequest(e){try{if(!(`renderer`in this.layer)||!this.layer.renderer||this.layer.renderer.type!==`dictionary`)throw Error(`InternalError: Expected renderer to be of type 'dictionary'`);let t=this.layer.renderer,n=this._lastSchema.processor.mesh.factory.symbology;if(n.type!==`dictionary`)throw Error(`InternalError: Expected schema to be of type 'dictionary'`);let r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:n.scaleExpression,viewRotation:this._stationaryRotation};this._fields||=this.layer.fields.map(e=>e.toJSON());let i=n.visualVariableUniforms,a=X(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);return!o||!o.data?{type:`dictionary-response`,meshes:[]}:{type:`dictionary-response`,meshes:await G({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:`renderer`,schemaOptions:r})}}catch{return{type:`dictionary-response`,meshes:[]}}}async _fetchMeshRequest(e){let{layer:t}=this;try{let n={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:null,viewRotation:this._stationaryRotation};return this._fields||=t.fields.map(e=>e.toJSON()),{type:`mesh-response`,meshes:await G({...e.symbolReference,hasTextStringTemplates:!0},{path:`anno-like`,schemaOptions:n,uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null}})}}catch{return{type:`mesh-response`,meshes:[]}}}_cleanUpQuery(e){let t=I.from(e)||this.createQuery();return t.outSpatialReference||=this.view.spatialReference,`returnZ`in this.layer&&(t.returnZ??=this.layer.returnZ),`returnM`in this.layer&&(t.returnM??=this.layer.returnM),t.toJSON()}_cleanUpAttributeBinsQuery(e){let t=P.from(e);return t.outSpatialReference||=this.view.spatialReference,t.toJSON()}_cleanUpAggregateQuery(e){let t=I.from(e)||this.createAggregateQuery();t.outSpatialReference||=this.view.spatialReference;let n=t.objectIds??[];for(let e of t.aggregateIds??[])n.push(e);return t.objectIds=n,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:`update`})}_edit(e){return this._commandsQueue.push({type:`edit`,event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%Q+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%Q+1}async _resolveIdenifiers(e){let t=[],n=[];for(let r of e)r.objectId!=null&&r.objectId!==-1?t.push(r.objectId):r.globalId==null?l.getLogger(this).warn(`mapview-apply-edits`,`A feature identifier must contain either a GlobalId or ObjectId. Ignoring`,{identifier:r}):n.push(r.globalId);let r=`globalIdField`in this.layer&&this.layer.globalIdField,i=r&&this.availableFields.includes(r);if(n.length&&!i)return l.getLogger(this).error(new o(`mapview-apply-edits`,`Editing the specified service requires the layer's globalIdField, ${r} to be included the layer's outFields for updates to be reflected on the map`)),t;if(n.length){let e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(n);for(let n of e)t.push(n)}return t}_resolveOverrides(e){let t=X(this.layer.geometryType),n=W(this.layer),r=[];for(let i of e.added){let e=A($(i),t,!1,!1,n);if(e.objectId==null)throw new o(`featurelayerview:bad-override`,`Feature does not have an objectId`,{feature:i});r.push(e)}for(let i of e.updated){let e=A($(i),t,!1,!1,n);if(e.objectId==null)throw new o(`featurelayerview:bad-override`,`Feature does not have an objectId`,{feature:i});r.push(e)}for(let t of e.removed)if(t==null)throw new o(`featurelayerview:bad-override`,`Tried to remove an invalid objectId`,{objectId:t});return{type:`override`,updates:r,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){let t=this.layer,n=e.historicMoment?.getTime()??null,r=`layerId`in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(r&&this._canEditByFeature(r)){let{adds:e,deletes:t,updates:i}=r.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),s=t.map(e=>`attributes`in e?{objectId:a?e.attributes[a]:null}:e),c=await this._resolveIdenifiers(s);return this._resolveOverrides({added:e,updated:o,removed:c,historicMoment:n,isWeak:!0,release:[]})}let[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:`override-by-id`,updates:[...i,...a],removed:o,historicMoment:n,isWeak:!0}}_canEditByFeature(e){let{adds:t,updates:n}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&n.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async updateSchemaStart(){let e=this.layer;`featureReduction`in e&&e.featureReduction&&e.featureReduction!==this._lastFeatureReduction&&(e.featureReduction=e.featureReduction?.clone(),this._lastFeatureReduction=e.featureReduction);try{if(await Promise.allSettled([this._handleChange(),M(e)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptions)return null;let t=this.featureContainer.updateStart(e.type===`subtype-group`);this._lastFeatureEffect=this.featureEffect;let n={store:t,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0,viewRotation:this._stationaryRotation},r=await this._createViewSchemaConfig(),i={source:await this.layerAdapter.createSourceSchema(r,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(n,r,this._displayRefreshVersion)};return d(this._lastSchema?.source.strategy,i.source.strategy)||d(this._lastSchema?.processor,i.processor)?(this._lastSchema=i,this._fields=null,i):null}catch{}return null}async updateSchemaEnd(e){try{this.featureEffectView.featureEffect=this._lastFeatureEffect,e&&this.featureEffectView.endTransition(),await this.featureContainer.updateEnd(this._lastSchema.processor,this.layerAdapter.getLabelingDeconflictionInfo(),e),has(`esri-2d-update-debug`)&&console.debug(`FeatureLayerView2D.updateEnd`)}catch{}}async _doUpdate(){let e=Math.round(performance.now());await(await this.getWorker()).pipeline.updateSchema(e),this.requestUpdate()}async _doOverride(e){let t=await this.getWorker();try{let n=new K;for(let r of e.messages)switch(r.type){case`edit`:n.tryAdd(await this._resolveEdit(r.event))||(await t.pipeline.onOverride(n.toMessage()),n=new K,n.tryAdd(await this._resolveEdit(r.event)));break;case`override`:n.tryAdd(this._resolveOverrides(r.options))||(await t.pipeline.onOverride(n.toMessage()),n=new K,n.tryAdd(this._resolveOverrides(r.options)))}await t.pipeline.onOverride(n.toMessage())}catch(e){h(e)}}_getEffectiveAvailableFields(e){let t=Z(this._lastAvailableFields,e);return this._lastAvailableFields=t,N(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){let e=this.requiresCurrentUser?await this.signedInUser:null,t=D(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),n=this.featureEffect?.filter?.toJSON()??null,r=this._getHighlightFilterGroups().map(({order:e,filters:t})=>({order:e,filters:t.map(e=>e.toJSON())})),i=J({layerFilter:t,effectFilter:n,highlightFilters:r});return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:i,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent,returnZ:this.hasZ,returnM:this.hasM}}_onHighlightChange(){this._commandsQueue.push({type:`update`})}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return t.geometry!=null&&(t.geometry.spatialReference=this.view.spatialReference),{type:`graphic`,graphic:t,layer:this.layer,mapPoint:e}}};e([b()],y.prototype,`_commandsQueue`,void 0),e([b()],y.prototype,`_sourceRefreshVersion`,void 0),e([b()],y.prototype,`_displayRefreshVersion`,void 0),e([b({readOnly:!0})],y.prototype,`_pipelineUpdating`,void 0),e([b()],y.prototype,`_sourceUpdating`,void 0),e([b({readOnly:!0})],y.prototype,`dataUpdating`,null),e([b({readOnly:!0})],y.prototype,`hasAllFeatures`,null),e([b({readOnly:!0})],y.prototype,`hasAllFeaturesInView`,null),e([b({readOnly:!0})],y.prototype,`hasFullGeometries`,null),e([b({readOnly:!0})],y.prototype,`snappingComplexityExceeded`,null),e([b()],y.prototype,`featureEffectView`,void 0),e([b({readOnly:!0})],y.prototype,`timeExtent`,null),y=e([x(`esri.views.2d.layers.FeatureLikeLayerView2D`)],y);function D(e,t,n,r,i,a){i&&=i.clone();let o=i==null?null:i.timeExtent,s=n!=null&&o!=null?n.intersection(o):n||o;s&&(i??=new j,i.timeExtent=s),i=t.addFilters?.(i,e)??i,a&&(i??=new j,i.where=v(i.where,a));let c=i?.toJSON()??null;return r.size&&(c??=new j().toJSON(),c.hiddenIds=Array.from(r)),c}return y};export{ue as FeatureLikeLayerView2D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{FeatureLikeLayerView2D as r}from"./FeatureLikeLayerView2D.js";import{InMemoryLayerAdapter as i}from"./features/layerAdapters/InMemoryLayerAdapter.js";import a from"../../layers/GeoJSONLayerView.js";let o=class extends r(a){get layerAdapter(){return new i(this.layer)}};e([t()],o.prototype,`layerAdapter`,null),o=e([n(`esri.views.2d.layers.GeoJSONLayerView2D`)],o);const s=o;export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{FeatureLikeLayerView2D as r}from"./FeatureLikeLayerView2D.js";import{KnowledgeGraphSublayerAdapter as i}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import a from"../../layers/KnowledgeGraphSublayerView.js";let o=class extends r(a){get layerAdapter(){return new i(this.layer)}};e([t()],o.prototype,`layerAdapter`,null),o=e([n(`esri.views.2d.layers.KnowledgeGraphSublayerView2D`)],o);const s=o;export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{FeatureLikeLayerView2D as r}from"./FeatureLikeLayerView2D.js";import{OGCFeatureLayerAdapter as i}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import a from"../../layers/OGCFeatureLayerView.js";let o=class extends r(a){get layerAdapter(){return new i(this.layer)}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}};e([t()],o.prototype,`layerAdapter`,null),o=e([n(`esri.views.2d.layers.OGCFeatureLayerView2D`)],o);const s=o;export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{FeatureLikeLayerView2D as r}from"./FeatureLikeLayerView2D.js";import{OrientedImageryLayerAdapter as i}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import a from"../../layers/OrientedImageryLayerView.js";let o=class extends r(a){get layerAdapter(){return new i(this.layer)}};e([t()],o.prototype,`layerAdapter`,null),o=e([n(`esri.views.2d.layers.OrientedImageryLayerView2D`)],o);const s=o;export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{FeatureLikeLayerView2D as r}from"./FeatureLikeLayerView2D.js";import{ParquetLayerAdapter as i}from"./features/layerAdapters/ParquetLayerAdapter.js";import a from"../../layers/ParquetLayerView.js";let o=class extends r(a){get layerAdapter(){return new i(this.layer)}};e([t()],o.prototype,`layerAdapter`,null),o=e([n(`esri.views.2d.layers.ParquetLayerView2D`)],o);const s=o;export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{handlesGroup as n,makeHandle as r}from"../../../core/handleUtils.js";import{watch as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import s from"../../../rest/support/FeatureSet.js";import{isNumber as c}from"../../../support/guards.js";import{FeatureLikeLayerView2D as l}from"./FeatureLikeLayerView2D.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{handlesGroup as n,makeHandle as r}from"../../../core/handleUtils.js";import{watch as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import s from"../../../rest/support/FeatureSet.js";import{isNumber as c}from"../../../support/guards.js";import{FeatureLikeLayerView2D as l}from"./FeatureLikeLayerView2D.js";import{StreamLayerAdapter as u}from"./features/layerAdapters/StreamLayerAdapter.js";import{handleNoEngineError as d}from"./support/handleNoEngineError.js";import f from"../../layers/StreamLayerView.js";let p=class extends l(f){constructor(){super(...arguments),this.pipelineConnectionStatus=`disconnected`,this.pipelineErrorString=null}initialize(){this.addHandles([i(()=>this.layer.customParameters,async e=>{(await this.getWorker()).streamMessenger.updateCustomParameters(e)}),this.layer.on(`send-message-to-socket`,async e=>{(await this.getWorker()).streamMessenger.sendMessageToSocket(e)}),this.layer.on(`send-message-to-client`,async e=>{(await this.getWorker()).streamMessenger.sendMessageToClient(e),this._isUserPaused&&`type`in e&&e.type===`clear`&&this.incrementSourceRefreshVersion()}),i(()=>this.layer.purgeOptions,()=>this._update()),i(()=>this.suspended,this._onSuspendedChange.bind(this))],`constructor`),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new t(`stream-controller`,this.pipelineErrorString):null}get layerAdapter(){return new u(this.layer)}on(e,t){if(Array.isArray(e))return n(e.map(e=>this.on(e,t)));let i=[`data-received`,`message-received`].includes(e);i&&this.getWorker().then(t=>t.streamMessenger.enableEvent(e,!0));let a=super.on(e,t),o=this;return r(()=>{a.remove(),i&&!o._workerProxy.closed&&!o.hasEventListener(e)&&o.getWorker().then(t=>t.streamMessenger.enableEvent(e,!1))})}async queryLatestObservations(e,n){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new t(`streamlayer-no-timeField`,`queryLatestObservation can only be used with services that define a TrackIdField`);let r=await this.getWorker();return d(r.features.executeQueryForLatestObservations(this._cleanUpQuery(e),n).then(e=>{let t=s.fromJSON(e);return t.features.forEach(e=>{e.layer=this.layer,e.sourceLayer=this.layer,e.origin=this.layer.graphicOrigin}),t}),new s({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus=`disconnected`}onProxyClientEvent(e){this.emit(e.name,e.event)}async queryObjectIds(e,t){return(await super.queryObjectIds(e,t)).filter(c)}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){this._refreshInterval!=null&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval??=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval)}_doDisconnect(){this.getWorker().then(e=>e.streamMessenger.disconnect()),this._doPause()}_doConnect(){this.getWorker().then(e=>e.streamMessenger.connect()),this.resume()}_doClear(){this.getWorker().then(e=>e.streamMessenger.clear()),this._refreshInterval??this.incrementSourceRefreshVersion()}_createClientOptions(){let e=super._createClientOptions(),t=this;return{...e,get container(){return t.featureContainer},setProperty:e=>{this.set(e.propertyName,e.value)}}}};e([a({readOnly:!0})],p.prototype,`connectionError`,null),e([a()],p.prototype,`layerAdapter`,null),e([a()],p.prototype,`pipelineConnectionStatus`,void 0),e([a()],p.prototype,`pipelineErrorString`,void 0),e([a({readOnly:!0})],p.prototype,`_streamConnectionStatus`,null),p=e([o(`esri.views.2d.layers.StreamLayerView2D`)],p);const m=p;export{m as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as t,initial as n}from"../../../core/reactiveUtils.js";import{subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as t,initial as n}from"../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{FeatureLikeLayerView2D as a}from"./FeatureLikeLayerView2D.js";import{SubtypeGroupLayerAdapter as o}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import s from"../../layers/SubtypeGroupLayerView.js";let c=class extends a(s){initialize(){this.addHandles([t(()=>this.view.scale,()=>this._update(),n)],`constructor`)}get layerAdapter(){return new o(this.layer)}hasRenderer(){return this.layer.sublayers.some(e=>e.renderer!=null)}};e([r()],c.prototype,`layerAdapter`,null),c=e([i(`esri.views.2d.layers.SubtypeGroupLayerView2D`)],c);const l=c;export{l as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{FeatureLikeLayerView2D as r}from"./FeatureLikeLayerView2D.js";import{InMemoryLayerAdapter as i}from"./features/layerAdapters/InMemoryLayerAdapter.js";import a from"../../layers/WFSLayerView.js";let o=class extends r(a){get layerAdapter(){return new i(this.layer)}};e([t()],o.prototype,`layerAdapter`,null),o=e([n(`esri.views.2d.layers.WFSLayerView2D`)],o);const s=o;export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as t}from"../../../../../core/sql.js";import{isHostedAgolService as n}from"../../../../../layers/support/arcgisLayerUrl.js";import{canConvertSqlRelativeTime as r,sqlRelativeTimeToAbsolute as i}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as a}from"../../../../../networks/support/networkFieldUtils.js";import{getEffectiveFeatureReduction as o}from"./featureReductionUtils.js";import{createFeatureIdInfo as s}from"./featureServiceUtils.js";import{addFloorFilter as c,hasFloorFilter as l}from"./floorFilterUtils.js";import{getServiceGeometryType as u}from"./geometryUtils.js";import{createLabelVVEvaluator as d}from"./labelingUtils.js";import{ExceedsLimitCache as f}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as m}from"../schema/SourceSchema.js";import{createServiceTimeSchema as h}from"../schema/TimeSchema.js";import{createSimpleProcessorSchema as g}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as _}from"../support/rendererUtils.js";class v{constructor(e){this.layer=e,this._cache=new f}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:d(this.layer.renderer)}}]}async createSourceSchema(e,n){let a=this._createServiceInfo(e),o=this.layer.editingInfo?.lastEditDate!=null,s=this.layer.refreshInterval>0,c=!o&&s,l=p(a.isSourceHosted,c,this.layer.capabilities,a.metadata.geometryType,e.extent,this.layer.fullExtent),u=this.layer.subtypeCode==null?null:`${this.layer.subtypeField} = ${this.layer.subtypeCode}`,d=t(this.layer.definitionExpression,u),f=r(d)?await i(this.layer.fieldsIndex,d,this.layer.capabilities.query.relativeTimeBinWindow):d,h=d===f?null:{where:d},{gdbVersion:g,apiKey:_,historicMoment:v,timeExtent:y,customParameters:b,displayFilterInfo:x}=this.layer;return m(a,l,{definitionExpression:f,returnZ:e.returnZ,returnM:e.returnM,postQueryFilter:h,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:x,customParameters:b,gdbVersion:g,historicMoment:v,timeExtent:y,apiKey:_,sourceRefreshVersion:n,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,t,n){let{fields:r,renderer:i,geometryType:a,labelingInfo:s,labelsVisible:c,orderBy:l,objectIdField:u,trackInfo:d,symbolLayerDrawing:f}=this.layer,p={fields:r.map(e=>e.toJSON()),renderer:i?.clone(),labelingInfoSource:this.layer.id,featureReduction:o(this.layer,t),geometryType:a,labelingInfo:s,labelsVisible:c,objectIdField:u,orderBy:l??`default`,trackInfo:d,symbolLayerDrawing:f};return g(e,t,p,n)}get hasRequiredSupport(){return _(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,t){return c(this.layer,e,t)}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>o(this.layer,e),()=>l(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.subtypeCode,()=>this.layer.trackInfo,()=>this.layer.symbolLayerDrawing?.drawOrder,()=>this.layer.symbolLayerDrawing?.enabled,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&a(e,this.layer)]}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(t){let r=this.layer,{capabilities:i,editingInfo:a,typeIdField:o,globalIdField:c,datesInUnknownTimezone:l,dateFieldsTimeZone:d,orderBy:f,subtypeField:p}=r,m=r.fieldsIndex.toJSON(),g=u(r),{hasZ:_,hasM:v}=r,y=h(r.timeInfo),b=r.spatialReference.toJSON(),x=r.types?.map(e=>e.toJSON()),S=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(S.query={layer:JSON.stringify(
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as t}from"../../../../../core/sql.js";import{isHostedAgolService as n}from"../../../../../layers/support/arcgisLayerUrl.js";import{canConvertSqlRelativeTime as r,sqlRelativeTimeToAbsolute as i}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as a}from"../../../../../networks/support/networkFieldUtils.js";import{getEffectiveFeatureReduction as o}from"./featureReductionUtils.js";import{createFeatureIdInfo as s}from"./featureServiceUtils.js";import{addFloorFilter as c,hasFloorFilter as l}from"./floorFilterUtils.js";import{getServiceGeometryType as u}from"./geometryUtils.js";import{createLabelVVEvaluator as d}from"./labelingUtils.js";import{ExceedsLimitCache as f}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as m}from"../schema/SourceSchema.js";import{createServiceTimeSchema as h}from"../schema/TimeSchema.js";import{createSimpleProcessorSchema as g}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as _}from"../support/rendererUtils.js";class v{constructor(e){this.layer=e,this._cache=new f}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:d(this.layer.renderer)}}]}async createSourceSchema(e,n){let a=this._createServiceInfo(e),o=this.layer.editingInfo?.lastEditDate!=null,s=this.layer.refreshInterval>0,c=!o&&s,l=p(a.isSourceHosted,c,this.layer.capabilities,a.metadata.geometryType,e.extent,this.layer.fullExtent),u=this.layer.subtypeCode==null?null:`${this.layer.subtypeField} = ${this.layer.subtypeCode}`,d=t(this.layer.definitionExpression,u),f=r(d)?await i(this.layer.fieldsIndex,d,this.layer.capabilities.query.relativeTimeBinWindow):d,h=d===f?null:{where:d},{gdbVersion:g,apiKey:_,historicMoment:v,timeExtent:y,customParameters:b,displayFilterInfo:x}=this.layer;return m(a,l,{definitionExpression:f,returnZ:e.returnZ,returnM:e.returnM,postQueryFilter:h,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:x,customParameters:b,gdbVersion:g,historicMoment:v,timeExtent:y,apiKey:_,sourceRefreshVersion:n,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,t,n){let{fields:r,renderer:i,geometryType:a,labelingInfo:s,labelsVisible:c,orderBy:l,objectIdField:u,trackInfo:d,symbolLayerDrawing:f}=this.layer,p={fields:r.map(e=>e.toJSON()),renderer:i?.clone(),labelingInfoSource:this.layer.id,featureReduction:o(this.layer,t),geometryType:a,labelingInfo:s,labelsVisible:c,objectIdField:u,orderBy:l??`default`,trackInfo:d,symbolLayerDrawing:f};return g(e,t,p,n)}get hasRequiredSupport(){return _(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,t){return c(this.layer,e,t)}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>o(this.layer,e),()=>l(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.subtypeCode,()=>this.layer.trackInfo,()=>this.layer.symbolLayerDrawing?.drawOrder,()=>this.layer.symbolLayerDrawing?.enabled,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&a(e,this.layer)]}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(t){let r=this.layer,{capabilities:i,editingInfo:a,typeIdField:o,globalIdField:c,datesInUnknownTimezone:l,dateFieldsTimeZone:d,orderBy:f,subtypeField:p}=r,m=r.fieldsIndex.toJSON(),g=u(r),{hasZ:_,hasM:v}=r,y=h(r.timeInfo),b=r.spatialReference.toJSON(),x=r.types?.map(e=>e.toJSON()),S=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(S.query={layer:JSON.stringify(this.layer.dynamicDataSource.toLayerSourceJSON())});let C=this.layer.objectIdField;if(f?.length){let e=!f[0].valueExpression&&f[0].field;e&&(C=e)}let w=n(S.path),T=t.spatialReference.toJSON();return{type:`feature-service`,source:S,isSourceHosted:w,orderByFields:C,outSpatialReference:T,metadata:{typeIdField:o??void 0,types:x,timeReferenceUnknownClient:l,dateFieldsTimeZone:d,subtypeField:p,globalIdField:c,fieldsIndex:m,geometryType:g,hasZ:_,hasM:v,featureIdInfo:s(r),timeInfo:y,spatialReference:b,outSpatialReference:T,attributeSpatialReference:null,subtypes:this.layer.subtypes?.map(e=>e.toJSON())},queryMetadata:{supportsCacheHint:i.query.supportsCacheHint,maxRecordCount:i.query.maxRecordCount,tileMaxRecordCount:i.query.tileMaxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:i.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:i.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:i.query.supportsReturnExceededLimitGeometries,lastEditDate:a?.lastEditDate?.getTime()}}}}export{v as FeatureLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as n}from"../../../../../core/sql.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../layers/support/FeatureFilter.js";import{canConvertSqlRelativeTime as a,sqlRelativeTimeToAbsolute as o}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as s}from"../../../../../networks/support/networkFieldUtils.js";import{createFeatureIdInfo as c}from"./featureServiceUtils.js";import{addFloorFilter as l,hasFloorFilter as u}from"./floorFilterUtils.js";import{getServiceGeometryType as d}from"./geometryUtils.js";import{ExceedsLimitCache as f}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as m}from"../schema/SourceSchema.js";import{createServiceTimeSchema as h}from"../schema/TimeSchema.js";import{createSubtypeProcessorSchema as g}from"../schema/processor/SubtypeProcessorSchema.js";class _{constructor(e){this.layer=e,this._cache=new f}getLabelingDeconflictionInfo(){return[{vvEvaluators:{}}]}async createSourceSchema(e,t){let{definitionExpression:n,customParameters:r,gdbVersion:i,historicMoment:s,timeExtent:c,apiKey:l,displayFilterInfo:u}=this.layer,d=this._createServiceInfo(e),f=this.layer.editingInfo?.lastEditDate!=null,h=this.layer.refreshInterval>0,g=!f&&h,_=p(d.isSourceHosted,g,this.layer.capabilities,d.metadata.geometryType,e.extent,this.layer.fullExtent),v=a(n)?await o(this.layer.fieldsIndex,n,this.layer.capabilities.query.relativeTimeBinWindow):n,y=n===v?null:{where:n};return m(d,_,{definitionExpression:v,returnZ:e.returnZ,returnM:e.returnM,postQueryFilter:y,queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:u,customParameters:r,gdbVersion:i,historicMoment:s,timeExtent:c,apiKey:l,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,t,n){let r={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,t)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${t}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return g(e,t,r,n)}addFilters(e,t){e=l(this.layer,e,t);let r=this.layer.sublayers.filter(e=>!v(e,t)).map(e=>e.subtypeCode);if(!r.length)return e;e??=new i;let a=`NOT ${this.layer.subtypeField} IN (${r.join(`,`)})`;return e.where=n(e.where,a),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>u(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&s(e,this.layer),()=>this.layer.sublayers.map(({renderer:e,labelsVisible:t,labelingInfo:n,visible:r,minScale:i,maxScale:a})=>({renderer:e,labelsVisible:t,labelingInfo:n,visible:r,minScale:i,maxScale:a}))]}setGraphicOrigin(e){let t=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=t,e.origin=t?.graphicOrigin}getRenderer(e){return this.layer.findSublayerForFeature(e)?.renderer}_createServiceInfo(t){let{capabilities:n,datesInUnknownTimezone:i,dateFieldsTimeZone:a,editingInfo:o,globalIdField:s,objectIdField:l,subtypeField:u}=this.layer,f=this.layer.fieldsIndex.toJSON(),p=d(this.layer),m=h(this.layer.timeInfo),g=this.layer.spatialReference.toJSON(),_=e(this.layer.parsedUrl),v=l,y=r(_.path),b=t.spatialReference.toJSON();return{type:`feature-service`,source:_,isSourceHosted:y,orderByFields:v,outSpatialReference:b,metadata:{timeReferenceUnknownClient:i,dateFieldsTimeZone:a,subtypeField:u,globalIdField:s,fieldsIndex:f,geometryType:p,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:c(this.layer),timeInfo:m,spatialReference:g,outSpatialReference:b,attributeSpatialReference:null,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{supportsCacheHint:n.query.supportsCacheHint,maxRecordCount:n.query.maxRecordCount,tileMaxRecordCount:n.query.tileMaxRecordCount,supportsCompactGeometry:n.query.supportsCompactGeometry,supportsDefaultSpatialReference:n.query.supportsDefaultSpatialReference,supportsFormatPBF:n.query.supportsFormatPBF,supportsMaxRecordCountFactor:n.query.supportsMaxRecordCountFactor,supportsQuantization:n.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:n.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:n.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:n.query.supportsReturnExceededLimitGeometries,lastEditDate:o?.lastEditDate?.getTime()}}}}function v(e,n){return e.visible&&(e.minScale===0||t(n.scale,e.minScale)||n.scale<e.minScale)&&(e.maxScale===0||t(n.scale,e.maxScale)||n.scale>e.maxScale)}export{_ as SubtypeGroupLayerAdapter};
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as n}from"../../../../../core/sql.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../layers/support/FeatureFilter.js";import{canConvertSqlRelativeTime as a,sqlRelativeTimeToAbsolute as o}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as s}from"../../../../../networks/support/networkFieldUtils.js";import{createFeatureIdInfo as c}from"./featureServiceUtils.js";import{addFloorFilter as l,hasFloorFilter as u}from"./floorFilterUtils.js";import{getServiceGeometryType as d}from"./geometryUtils.js";import{ExceedsLimitCache as f}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as m}from"../schema/SourceSchema.js";import{createServiceTimeSchema as h}from"../schema/TimeSchema.js";import{createSubtypeProcessorSchema as g}from"../schema/processor/SubtypeProcessorSchema.js";class _{constructor(e){this.layer=e,this._cache=new f}getLabelingDeconflictionInfo(){return[{vvEvaluators:{}}]}async createSourceSchema(e,t){let{definitionExpression:n,customParameters:r,gdbVersion:i,historicMoment:s,timeExtent:c,apiKey:l,displayFilterInfo:u}=this.layer,d=this._createServiceInfo(e),f=this.layer.editingInfo?.lastEditDate!=null,h=this.layer.refreshInterval>0,g=!f&&h,_=p(d.isSourceHosted,g,this.layer.capabilities,d.metadata.geometryType,e.extent,this.layer.fullExtent),v=a(n)?await o(this.layer.fieldsIndex,n,this.layer.capabilities.query.relativeTimeBinWindow):n,y=n===v?null:{where:n};return m(d,_,{definitionExpression:v,returnZ:e.returnZ,returnM:e.returnM,postQueryFilter:y,queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:u,customParameters:r,gdbVersion:i,historicMoment:s,timeExtent:c,apiKey:l,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,t,n){let r={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,t)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${t}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return g(e,t,r,n)}addFilters(e,t){e=l(this.layer,e,t);let r=this.layer.sublayers.filter(e=>!v(e,t)).map(e=>e.subtypeCode);if(!r.length)return e;e??=new i;let a=`NOT ${this.layer.subtypeField} IN (${r.join(`,`)})`;return e.where=n(e.where,a),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>u(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&s(e,this.layer),()=>this.layer.sublayers.map(({renderer:e,labelsVisible:t,labelingInfo:n,visible:r,minScale:i,maxScale:a})=>({renderer:e,labelsVisible:t,labelingInfo:n,visible:r,minScale:i,maxScale:a}))]}setGraphicOrigin(e){let t=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=t,e.origin=t?.graphicOrigin}getRenderer(e){return this.layer.findSublayerForFeature(e)?.renderer}_createServiceInfo(t){let{capabilities:n,datesInUnknownTimezone:i,dateFieldsTimeZone:a,editingInfo:o,globalIdField:s,objectIdField:l,subtypeField:u}=this.layer,f=this.layer.fieldsIndex.toJSON(),p=d(this.layer),m=h(this.layer.timeInfo),g=this.layer.spatialReference.toJSON(),_=e(this.layer.parsedUrl),v=l,y=r(_.path),b=t.spatialReference.toJSON();return this.layer.dynamicDataSource&&(_.query={layer:JSON.stringify(this.layer.dynamicDataSource.toLayerSourceJSON())}),{type:`feature-service`,source:_,isSourceHosted:y,orderByFields:v,outSpatialReference:b,metadata:{timeReferenceUnknownClient:i,dateFieldsTimeZone:a,subtypeField:u,globalIdField:s,fieldsIndex:f,geometryType:p,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:c(this.layer),timeInfo:m,spatialReference:g,outSpatialReference:b,attributeSpatialReference:null,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{supportsCacheHint:n.query.supportsCacheHint,maxRecordCount:n.query.maxRecordCount,tileMaxRecordCount:n.query.tileMaxRecordCount,supportsCompactGeometry:n.query.supportsCompactGeometry,supportsDefaultSpatialReference:n.query.supportsDefaultSpatialReference,supportsFormatPBF:n.query.supportsFormatPBF,supportsMaxRecordCountFactor:n.query.supportsMaxRecordCountFactor,supportsQuantization:n.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:n.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:n.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:n.query.supportsReturnExceededLimitGeometries,lastEditDate:o?.lastEditDate?.getTime()}}}}function v(e,n){return e.visible&&(e.minScale===0||t(n.scale,e.minScale)||n.scale<e.minScale)&&(e.maxScale===0||t(n.scale,e.maxScale)||n.scale>e.maxScale)}export{_ as SubtypeGroupLayerAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{onLocaleChange as t,fetchMessageBundle as n}from"../../../../intl.js";import r from"../../../../core/Accessor.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as a}from"../../../../core/mapCollectionUtils.js";import{watch as o,syncAndInitial as s,when as c,sync as l}from"../../../../core/reactiveUtils.js";import{pt2px as u}from"../../../../core/screenUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{LengthDimensionVisualization as m}from"./LengthDimensionVisualization.js";import{markerLineSizeFraction as h,offsetLineSizeFraction as g}from"./settings.js";import{LineMarkerMaterial as _}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{createStipplePatternSimple as v}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as y}from"../../webgl-engine/materials/RibbonLineMaterial.js";let b=class extends r{get analysis(){return this.analysisViewData.analysis}get visible(){return this.analysisViewData.visible}constructor(e){super(e),this.loadingMessages=!1,this._messages=null}initialize(){let e=this.isDecoration,n=this.view.state.isGlobal;this._markerMaterial=new _({width:1,anchor:1,color:p,placement:`begin-end`,worldSpace:!0,hideOnShortSegments:!0,hasTip:!0,renderOccluded:4,markerPrimitive:`triangle`,isDecoration:e},n),this._dimensionLineMaterial=new y({width:1,color:p,renderOccluded:4,markerParameters:this._markerMaterial.parameters,isDecoration:e},
|
|
2
|
+
import{__decorate as e}from"tslib";import{onLocaleChange as t,fetchMessageBundle as n}from"../../../../intl.js";import r from"../../../../core/Accessor.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as a}from"../../../../core/mapCollectionUtils.js";import{watch as o,syncAndInitial as s,when as c,sync as l}from"../../../../core/reactiveUtils.js";import{pt2px as u}from"../../../../core/screenUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{LengthDimensionVisualization as m}from"./LengthDimensionVisualization.js";import{markerLineSizeFraction as h,offsetLineSizeFraction as g}from"./settings.js";import{LineMarkerMaterial as _}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{createStipplePatternSimple as v}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as y}from"../../webgl-engine/materials/RibbonLineMaterial.js";let b=class extends r{get analysis(){return this.analysisViewData.analysis}get visible(){return this.analysisViewData.visible}constructor(e){super(e),this.loadingMessages=!1,this._messages=null}initialize(){let e=this.isDecoration,n=this.view.state.isGlobal;this._markerMaterial=new _({width:1,anchor:1,color:p,placement:`begin-end`,worldSpace:!0,hideOnShortSegments:!0,hasTip:!0,renderOccluded:4,markerPrimitive:`triangle`,isDecoration:e},n),this._dimensionLineMaterial=new y({width:1,color:p,renderOccluded:4,markerParameters:this._markerMaterial.parameters,isDecoration:e},this.view),this._offsetLineMaterial=new y({width:1,color:p,renderOccluded:4,stipplePattern:v(5),isDecoration:e},this.view),this._smallDimensionLineMaterial=new y({width:1,color:p,renderOccluded:4,isDecoration:e},this.view),this._smallOffsetLineMaterial=new y({width:1,color:p,renderOccluded:4,stipplePattern:v(5),isDecoration:e},this.view);let r=a(()=>this.analysisViewData.computations,({computation:e})=>this._createVisualization(e));this._dimensionVisualizations=r,this.addHandles([i(r),o(()=>this.analysis.style.color.toUnitRGBA(),e=>{for(let t of this._lineMaterials())t.setParameters({color:e})},s),o(()=>this.analysis.style.lineSize,e=>{let t=u(e);this._markerMaterial.setParameters({width:t*h}),this._dimensionLineMaterial.setParameters({width:t,markerParameters:this._markerMaterial.parameters});let n=Math.max(t*g,1);this._offsetLineMaterial.setParameters({width:n})},s),o(()=>({camera:this.view.state.camera,style:x(this.analysis)}),({camera:e,style:t})=>{for(let{visualization:n}of this._dimensionVisualizations)n.updateCameraDependentElements(e,n.computation.geometry,t),n.updateLabelStyle(t)}),o(()=>this.visible,e=>{for(let{visualization:t}of this._dimensionVisualizations)t.visible=e})]),this.addHandles([t(()=>this._updateMessageBundle()),c(()=>!this.loadingMessages,()=>{for(let{visualization:e}of this._dimensionVisualizations)e.updateUnitsMessages(this._messages)},l)]),this._updateMessageBundle()}get testInfo(){}_createVisualization(e){let t=new m({analysis:this.analysis,computation:e,view:this.view,visible:this.visible,markerMaterial:this._markerMaterial,dimensionLineMaterial:this._dimensionLineMaterial,offsetLineMaterial:this._offsetLineMaterial,smallDimensionLineMaterial:this._smallDimensionLineMaterial,smallOffsetLineMaterial:this._smallOffsetLineMaterial,messages:this._messages,isDecoration:this.isDecoration});return{visualization:t,remove:()=>t.destroy()}}_lineMaterials(){return[this._markerMaterial,this._dimensionLineMaterial,this._offsetLineMaterial,this._smallDimensionLineMaterial,this._smallOffsetLineMaterial]}async _updateMessageBundle(){this.loadingMessages=!0;try{this._messages=await n(`esri/core/t9n/Units`)}finally{this.loadingMessages=!1}}};e([d({constructOnly:!0})],b.prototype,`analysisViewData`,void 0),e([d({constructOnly:!0,nonNullable:!0})],b.prototype,`view`,void 0),e([d({constructOnly:!0})],b.prototype,`isDecoration`,void 0),e([d()],b.prototype,`analysis`,null),e([d()],b.prototype,`visible`,null),e([d()],b.prototype,`loadingMessages`,void 0),b=e([f(`esri.views.3d.analysis.Dimension.DimensionVisualization`)],b);function x(e){let{fontSize:t,lineSize:n,textColor:r,textBackgroundColor:i}=e.style;return{fontSize:t,lineSize:n,textBackgroundColor:i.clone(),textColor:r.clone()}}export{b as DimensionVisualization};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../analysis/LengthDimension.js";import n from"../../../../core/Accessor.js";import r from"../../../../core/Handles.js";import{destroyHandle as i,handlesGroup as a}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as o}from"../../../../core/lang.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as c,destroyMaybe as l}from"../../../../core/maybe.js";import{memoize as u}from"../../../../core/memoize.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as f,watch as p,sync as m,syncAndInitial as h,when as g}from"../../../../core/reactiveUtils.js";import{property as _,subclass as v}from"../../../../core/accessorSupport/decorators.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import x from"../../../../geometry/Point.js";import{clonePoint as S}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as C,applyConstraint as ee,computeConstraint as te,constraintDependencies as ne}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as re,LengthDimensionPointManipulator as w,pointManipulatorHandles as T,createOffsetManipulator as E,offsetManipulatorHandles as D,LineOfSightOrientationManipulator as O,headingManipulatorHandles as k,rotationManipulatorHandles as A,createMeasureTypeManipulator as j,measureTypeManipulatorHandles as M,updateOffsetManipulatorTransform as N,updateHeadingManipulatorTransform as P,updateRotationManipulatorTransform as F,updateMeasureTypeManipulatorTransform as I,unfocusedOffsetWidth as L,focusedOffsetWidth as R}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as z,arePointsVerticallyAligned as B,computationToGeometryDependencies as V,computeGeometryFromDimension as H}from"./lengthDimensionUtils.js";import{disabledPointColor as U,pointRadius as ie,getTransparentAccentColor as W,getContrastColor as G,initialOffsetPx as K}from"./settings.js";import{getRotateHeadingTexture as q}from"../images/Factory.js";import{SnappingVisualizer3D as J}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as Y}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as ae}from"../../interactive/visualElements/VerticesVisualElement.js";import{Parameters as oe,ImageMaterial as se}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as X}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as ce}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as Z}from"../../../interactive/coordinateHelper.js";import{EditGeometry as le}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as ue}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as de}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as fe}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquireForFeaturePlacement as pe}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as me}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as he}from"../../../interactive/snapping/snappingUtils.js";let Q=class extends n{constructor(e){super(e),this._stagedDimension=null,this._snappingManagerResult=null,this._computationManipulators=new Map,this._computationHandles=new r,this._updatingHandles=new b,this._getSnappingContext=u(e=>new de({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new ue(new le(`point`,Z(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new J}));let{view:t}=e;this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(t),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(t),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(t),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:X(2)}),this._constraintSnappingIndicator=new Y({view:t,attached:!0,width:1,renderOccluded:4,stipplePattern:X(5),isDecoration:!0});let n=U.toUnitRGBA();this._stagedStartIndicator=new ae({view:t,attached:!1,elevationInfo:{mode:`absolute-height`,offset:0},spatialReference:e.view.renderCoordsHelper.spatialReference,color:n,size:ie*2,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){let{view:e}=this;this._snappingOperation=new me({view:e});let t=W(e.effectiveTheme),n=G(e.effectiveTheme),r=!e.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=q(e.stage.textures,{accentColor:t,contrastColor:n,preMultiplyAlpha:r});let a=new oe(this._textureHandle.managedTexture,!1);a.renderOccluded=16,a.isDecoration=!0,this._orientationManipulatorMaterial=new se(a);let o=s(()=>this.analysisViewData.computations,({computation:e})=>this._createManipulators(e));this.addHandles([this._updatingHandles.add(()=>({accentColor:W(e.effectiveTheme),contrastColor:G(e.effectiveTheme)}),({accentColor:t,contrastColor:n})=>{let i=this._textureHandle;this._textureHandle=q(e.stage.textures,{accentColor:t,contrastColor:n,preMultiplyAlpha:r}),this._orientationManipulatorMaterial.setParameters({managedTexture:this._textureHandle.managedTexture}),i?.release();let a=t.toUnitRGBA();this._unfocusedOffsetManipulatorMaterial.setParameters({color:a}),this._focusedOffsetManipulatorMaterial.setParameters({color:a}),this._thinOffsetManipulatorMaterial.setParameters({color:a}),this._constraintSnappingIndicator.color=a},f),i(o),p(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:e,stagedComputation:t})=>{if(t==null||e==null)return;let n=S(e,new x);this._applyPointUpdate(t,{endPoint:n})},m),p(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(e,t)=>{let{stagedDimension:n,selectedComputation:r,firstGrabbedManipulator:i}=e;if(n!==t?.stagedDimension||i!==t?.firstGrabbedManipulator)for(let[t,n]of this._computationManipulators)this._updateManipulators(t,n,e);else for(let n of[r,t?.selectedComputation])if(n!=null){let t=this._computationManipulators.get(n);t!=null&&this._updateManipulators(n,t,e)}},h),this._updatingHandles.add(()=>this.analysis.style.lineSize,e=>this._updateManipulatorStyle(e),f),this._updatingHandles.add(()=>this.view.state.camera,()=>{this._stagedComputation!=null&&this._updateStagedDimensionOffset(this._stagedComputation)}),this._updatingHandles.add(()=>{let e=this._stagedComputation;if(!e)return null;let t=e.elevationAlignedStartPoint,n=y();return t!=null&&this.view.renderCoordsHelper.toRenderCoords(t,n)?n:null},e=>{e==null?this._stagedStartIndicator.attached=!1:(this._stagedStartIndicator.vertices=[e],this._stagedStartIndicator.attached=!0)})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),he(this,()=>{let e=this._activeComputation,t=this._stagedComputation;if(e==null||t!=null){let e=this.view.inputManager.latestPointerInfo?.type??`mouse`,t=this._getSnappingContext(e);this._updatingHandles.consumePromise(d(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),t)))}if(e!=null){let{start:t,end:n}=this._computationManipulators.get(e);if(t.grabbing||n.grabbing){let n=t.grabbing?`start`:`end`,r=this._computeConstraint(e);C(e,n,{constraint:r,view:this.view})}}})}destroy(){this._textureHandle=c(this._textureHandle),this._snappingOperation=l(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy()}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager?.options}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){return this._snappingManagerResult||(this._snappingManagerResult=pe(this.view),this.addHandles(this._snappingManagerResult)),this._snappingManagerResult.snappingManager}get _activeComputation(){if(this._stagedComputation!=null)return this._stagedComputation;let{selectedComputation:e}=this.analysisViewData;return this.hasGrabbedManipulators&&e!=null?e:null}get _stagedComputation(){let e=this._stagedDimension,t=this.analysisViewData.computations.at(-1)?.computation;return e==null||t==null||t.dimension!==e?null:t}get _constraintHandles(){return[g(()=>this.analysisViewData.selectedComputation,e=>{e.previousConstraint=this._computeConstraint(e)},{...h,equals:o}),p(()=>{let e=this._activeComputation;if(e==null)return null;let{measureType:t,orientation:n}=e.dimension;return{measureType:t,orientation:n,computation:e}},(e,t)=>{if(e!=null&&t==null){let{measureType:t,orientation:n,computation:r}=e;switch(r.previousConstraint){case 0:r.preConstraintProperties={measureType:`horizontal`,orientation:0};break;case 1:r.preConstraintProperties={measureType:`vertical`,orientation:0};break;case 2:r.preConstraintProperties={measureType:`direct`,orientation:n};break;default:r.preConstraintProperties={measureType:t,orientation:n}}}e==null&&t!=null&&(t.computation.preConstraintProperties=null)},m)]}get _snappingIndicatorHandles(){let e=`snapping-indicator-event-handles`;return[this._updatingHandles.add(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:t,activeComputation:n})=>{let r=this._constraintSnappingIndicator;if(this.removeHandles(e),n==null)r.attached=!1;else if(n===t)r.attached=!0;else{let{start:t,end:i}=this._computationManipulators.get(n),a=()=>{r.attached=t.grabbing||i.grabbing};a(),this.addHandles([t.events.on(`grab-changed`,a),i.events.on(`grab-changed`,a)],e)}}),this._updatingHandles.add(()=>{let e=this._activeComputation;return e==null?{}:{geometry:e.geometry,constraint:e.previousConstraint}},({geometry:e,constraint:t})=>{let n=this._constraintSnappingIndicator;e!=null&&t!=null&&t!==2?(n.visible=!0,n.setGeometryFromSegment(e.directSegment)):n.visible=!1})]}removeStaged(){return this._stagedDimension!=null&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(e){let{_stagedDimension:t}=this;if(t==null){let t=this._onUnstagedClick(e);return this.analysis.dimensions.add(t),null}return this._onStagedClick(e),t}onPointerMove({mapPoint:e,pointerType:t}){if(t===`touch`)return;let n=this._getSnappingContext(t);this._updatingHandles.consumePromise(d(this._snappingOperation.snap({point:e},this._ensureSnappingManager(),n)))}onManipulatorSelectionChanged(){this.analysisViewData.selectedComputation!=null&&(this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null))}_onUnstagedClick({mapPoint:e,pointerType:n}){let r=e;if(n===`mouse`){let t=this._getSnappingContext(n);r=this._ensureSnappingManager().update({point:e,context:t})}let i=new t({startPoint:S(r,new x),endPoint:null,measureType:`horizontal`});return this._stagedDimension=i,this._resetSnappingState(),i}_onStagedClick({mapPoint:e,pointerType:t}){let n=this._stagedComputation;if(n==null)return;let r=e;if(t===`mouse`){let n=this._getSnappingContext(t);r=this._ensureSnappingManager().update({point:e,context:n})}let i=S(r,new x);this._applyPointUpdate(n,{endPoint:i}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(e){let t=this._setupPointManipulator(e,{isStart:!0}),n=this._setupPointManipulator(e,{isStart:!1}),r=this._setupOffsetManipulator(e),i=this._setupHeadingManipulator(e),o=this._setupRotationManipulator(e),s=this._setupMeasureTypeManipulator(e,`direct`),c=this._setupMeasureTypeManipulator(e,`horizontal`),l=this._setupMeasureTypeManipulator(e,`vertical`),u=new re({start:t,end:n,offset:r,heading:i,rotation:o,direct:s,horizontal:c,vertical:l});this._setupComputationToManipulatorsSync(e,u),this._computationManipulators.set(e,u),this.manipulators.addMany(u.values());let d=a(u.values().map(e=>e.events.on(`focus-changed`,()=>{u.values().some(e=>e.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(e),this._computationManipulators.delete(e);for(let e of u.values())this.manipulators.remove(e)}}}_setupComputationToManipulatorsSync(e,t){this._computationHandles.add([p(()=>e.geometry,()=>this._updateManipulators(e,t),{...h,equals:o})],e)}_setupPointManipulator(e,t){let{view:n}=this,{dimension:r}=e,i=new w(n,{metadata:r}),a=T(i,{isStart:t.isStart,createSnappingPipelineStep:e=>fe({snappingContext:this._getSnappingContext(e),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:r,onUpdate:t=>this._applyPointUpdate(e,t),view:n});return this._computationHandles.add(a,e),i}_setupOffsetManipulator(e){let{view:t}=this,n=E(t,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:e.dimension}),r=D(n,{computation:e,view:t});return this._computationHandles.add(r,e),n}_setupHeadingManipulator(e){let{view:t}=this,n=new O(t,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:e.dimension}),r=k(n,{computation:e,view:t});return this._computationHandles.add(r,e),n}_setupRotationManipulator(e){let{view:t}=this,n=new O(t,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:e.dimension}),r=A(n,{computation:e,view:t});return this._computationHandles.add(r,e),n}_setupMeasureTypeManipulator(e,t){let{view:n}=this,r=j(n,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:e.dimension}),i=M(r,{computation:e,manipulatorMeasureType:t,view:n});return this._computationHandles.add(i,e),r}_updateManipulators(e,t,n={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){let{stagedDimension:r,selectedComputation:i,firstGrabbedManipulator:a}=n,{start:o,end:s,offset:c,heading:l,rotation:u}=t,d=i===e,f=z(e),{dimension:p}=e;for(let e of t.values()){let t=f&&r==null&&(a==null||e===a);e===c?(e.available=t,e.selected=d):e.available=t&&d}if(!f)return;this._computeConstraint(e)==null?t.manipulatorForMeasureType(p.measureType).available=!1:t.forEachMeasureTypeManipulator(e=>e.available=!1);for(let e of[l,u])(p.measureType!==`direct`||p.offset===0)&&(e.available=!1);B(e)?u.available=!1:l.available=!1;let{geometry:m}=e;o.renderLocation=m.directSegment.startRenderSpace,s.renderLocation=m.directSegment.endRenderSpace;let{renderCoordsHelper:h}=this.view;N(c,m,h),l.available&&P(l,e,h),u.available&&F(u,e,h),t.forEachMeasureTypeManipulator((t,n)=>{t.available&&I(t,e,n,h)})}_updateManipulatorStyle(e){let t=L(e),n=R(e),r={lineSizePt:e,material:this._orientationManipulatorMaterial};for(let{offset:e,heading:t,rotation:i}of this._computationManipulators.values())e.radius=n/2,t.update(r),i.update(r);this._unfocusedOffsetManipulatorMaterial.setParameters({width:t}),this._focusedOffsetManipulatorMaterial.setParameters({width:n})}_applyPointUpdate(e,t){let{view:n}=this,r=V(e);`startPoint`in t&&(r.elevationAlignedStartPoint=t.startPoint),`endPoint`in t&&(r.elevationAlignedEndPoint=t.endPoint);let i=H(r,n.renderCoordsHelper);if(i==null)return;let a=this._computeConstraint({...r,geometry:i});ee(e,t,{...r,constraint:a,unconstrainedGeometry:i,view:n}),e===this._stagedComputation&&this._updateStagedDimensionOffset(e)}_updateStagedDimensionOffset(e){if(e.geometry==null)return;e.geometry.directSegment.eval(.5,$);let{state:t,renderCoordsHelper:n}=this.view,r=t.camera.computeScreenPixelSizeAt($);e.dimension.offset=K*r*n.unitInMeters}_computeConstraint(e){return te(ne(e,this._ensureSnappingManager().options),this.view)}_createOffsetManipulatorMaterial(e){return new ce({width:1,renderOccluded:4,writeDepth:!1,polygonOffset:3,isDecoration:!0},e.state.isGlobal)}get test(){}};e([_({constructOnly:!0})],Q.prototype,`analysis`,void 0),e([_({constructOnly:!0})],Q.prototype,`analysisViewData`,void 0),e([_({constructOnly:!0})],Q.prototype,`manipulators`,void 0),e([_({constructOnly:!0})],Q.prototype,`parentTool`,void 0),e([_({constructOnly:!0,nonNullable:!0})],Q.prototype,`view`,void 0),e([_({readOnly:!0})],Q.prototype,`updating`,null),e([_()],Q.prototype,`firstGrabbedManipulator`,null),e([_()],Q.prototype,`hasGrabbedManipulators`,null),e([_()],Q.prototype,`snappingOptions`,null),e([_()],Q.prototype,`_stagedDimension`,void 0),e([_()],Q.prototype,`_snappingManager`,null),e([_()],Q.prototype,`_activeComputation`,null),e([_()],Q.prototype,`_stagedComputation`,null),e([_()],Q.prototype,`_snappingManagerResult`,void 0),Q=e([v(`esri.views.3d.analysis.Dimension.LengthDimensionSubTool`)],Q);const $=y();export{Q as LengthDimensionSubTool};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../analysis/LengthDimension.js";import n from"../../../../core/Accessor.js";import r from"../../../../core/Handles.js";import{destroyHandle as i,handlesGroup as a}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as o}from"../../../../core/lang.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as c,destroyMaybe as l}from"../../../../core/maybe.js";import{memoize as u}from"../../../../core/memoize.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as f,watch as p,sync as m,syncAndInitial as h,when as g}from"../../../../core/reactiveUtils.js";import{property as _,subclass as v}from"../../../../core/accessorSupport/decorators.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import x from"../../../../geometry/Point.js";import{clonePoint as S}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as C,applyConstraint as ee,computeConstraint as te,constraintDependencies as ne}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as re,LengthDimensionPointManipulator as w,pointManipulatorHandles as T,createOffsetManipulator as E,offsetManipulatorHandles as D,LineOfSightOrientationManipulator as O,headingManipulatorHandles as k,rotationManipulatorHandles as A,createMeasureTypeManipulator as j,measureTypeManipulatorHandles as M,updateOffsetManipulatorTransform as N,updateHeadingManipulatorTransform as P,updateRotationManipulatorTransform as F,updateMeasureTypeManipulatorTransform as I,unfocusedOffsetWidth as L,focusedOffsetWidth as R}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as z,arePointsVerticallyAligned as B,computationToGeometryDependencies as V,computeGeometryFromDimension as H}from"./lengthDimensionUtils.js";import{disabledPointColor as U,pointRadius as ie,getTransparentAccentColor as W,getContrastColor as G,initialOffsetPx as K}from"./settings.js";import{getRotateHeadingTexture as q}from"../images/Factory.js";import{SnappingVisualizer3D as J}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as Y}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as ae}from"../../interactive/visualElements/VerticesVisualElement.js";import{Parameters as oe,ImageMaterial as se}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as X}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as ce}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as Z}from"../../../interactive/coordinateHelper.js";import{EditGeometry as le}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as ue}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as de}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as fe}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquireForFeaturePlacement as pe}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as me}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as he}from"../../../interactive/snapping/snappingUtils.js";let Q=class extends n{constructor(e){super(e),this._stagedDimension=null,this._snappingManagerResult=null,this._computationManipulators=new Map,this._computationHandles=new r,this._updatingHandles=new b,this._getSnappingContext=u(e=>new de({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new ue(new le(`point`,Z(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new J}));let{view:t}=e;this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(t),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(t),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(t),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:X(2)}),this._constraintSnappingIndicator=new Y({view:t,attached:!0,width:1,renderOccluded:4,stipplePattern:X(5),isDecoration:!0});let n=U.toUnitRGBA();this._stagedStartIndicator=new ae({view:t,attached:!1,elevationInfo:{mode:`absolute-height`,offset:0},spatialReference:e.view.renderCoordsHelper.spatialReference,color:n,size:ie*2,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){let{view:e}=this;this._snappingOperation=new me({view:e});let t=W(e.effectiveTheme),n=G(e.effectiveTheme),r=!e.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=q(e.stage.textures,{accentColor:t,contrastColor:n,preMultiplyAlpha:r});let a=new oe(this._textureHandle.managedTexture,!1);a.renderOccluded=16,a.isDecoration=!0,this._orientationManipulatorMaterial=new se(a);let o=s(()=>this.analysisViewData.computations,({computation:e})=>this._createManipulators(e));this.addHandles([this._updatingHandles.add(()=>({accentColor:W(e.effectiveTheme),contrastColor:G(e.effectiveTheme)}),({accentColor:t,contrastColor:n})=>{let i=this._textureHandle;this._textureHandle=q(e.stage.textures,{accentColor:t,contrastColor:n,preMultiplyAlpha:r}),this._orientationManipulatorMaterial.setParameters({managedTexture:this._textureHandle.managedTexture}),i?.release();let a=t.toUnitRGBA();this._unfocusedOffsetManipulatorMaterial.setParameters({color:a}),this._focusedOffsetManipulatorMaterial.setParameters({color:a}),this._thinOffsetManipulatorMaterial.setParameters({color:a}),this._constraintSnappingIndicator.color=a},f),i(o),p(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:e,stagedComputation:t})=>{if(t==null||e==null)return;let n=S(e,new x);this._applyPointUpdate(t,{endPoint:n})},m),p(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(e,t)=>{let{stagedDimension:n,selectedComputation:r,firstGrabbedManipulator:i}=e;if(n!==t?.stagedDimension||i!==t?.firstGrabbedManipulator)for(let[t,n]of this._computationManipulators)this._updateManipulators(t,n,e);else for(let n of[r,t?.selectedComputation])if(n!=null){let t=this._computationManipulators.get(n);t!=null&&this._updateManipulators(n,t,e)}},h),this._updatingHandles.add(()=>this.analysis.style.lineSize,e=>this._updateManipulatorStyle(e),f),this._updatingHandles.add(()=>this.view.state.camera,()=>{this._stagedComputation!=null&&this._updateStagedDimensionOffset(this._stagedComputation)}),this._updatingHandles.add(()=>{let e=this._stagedComputation;if(!e)return null;let t=e.elevationAlignedStartPoint,n=y();return t!=null&&this.view.renderCoordsHelper.toRenderCoords(t,n)?n:null},e=>{e==null?this._stagedStartIndicator.attached=!1:(this._stagedStartIndicator.vertices=[e],this._stagedStartIndicator.attached=!0)})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),he(this,()=>{let e=this._activeComputation,t=this._stagedComputation;if(e==null||t!=null){let e=this.view.inputManager.latestPointerInfo?.type??`mouse`,t=this._getSnappingContext(e);this._updatingHandles.consumePromise(d(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),t)))}if(e!=null){let{start:t,end:n}=this._computationManipulators.get(e);if(t.grabbing||n.grabbing){let n=t.grabbing?`start`:`end`,r=this._computeConstraint(e);C(e,n,{constraint:r,view:this.view})}}})}destroy(){this._textureHandle=c(this._textureHandle),this._snappingOperation=l(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy()}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager?.options}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){return this._snappingManagerResult||(this._snappingManagerResult=pe(this.view),this.addHandles(this._snappingManagerResult)),this._snappingManagerResult.snappingManager}get _activeComputation(){if(this._stagedComputation!=null)return this._stagedComputation;let{selectedComputation:e}=this.analysisViewData;return this.hasGrabbedManipulators&&e!=null?e:null}get _stagedComputation(){let e=this._stagedDimension,t=this.analysisViewData.computations.at(-1)?.computation;return e==null||t==null||t.dimension!==e?null:t}get _constraintHandles(){return[g(()=>this.analysisViewData.selectedComputation,e=>{e.previousConstraint=this._computeConstraint(e)},{...h,equals:o}),p(()=>{let e=this._activeComputation;if(e==null)return null;let{measureType:t,orientation:n}=e.dimension;return{measureType:t,orientation:n,computation:e}},(e,t)=>{if(e!=null&&t==null){let{measureType:t,orientation:n,computation:r}=e;switch(r.previousConstraint){case 0:r.preConstraintProperties={measureType:`horizontal`,orientation:0};break;case 1:r.preConstraintProperties={measureType:`vertical`,orientation:0};break;case 2:r.preConstraintProperties={measureType:`direct`,orientation:n};break;default:r.preConstraintProperties={measureType:t,orientation:n}}}e==null&&t!=null&&(t.computation.preConstraintProperties=null)},m)]}get _snappingIndicatorHandles(){let e=`snapping-indicator-event-handles`;return[this._updatingHandles.add(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:t,activeComputation:n})=>{let r=this._constraintSnappingIndicator;if(this.removeHandles(e),n==null)r.attached=!1;else if(n===t)r.attached=!0;else{let{start:t,end:i}=this._computationManipulators.get(n),a=()=>{r.attached=t.grabbing||i.grabbing};a(),this.addHandles([t.events.on(`grab-changed`,a),i.events.on(`grab-changed`,a)],e)}}),this._updatingHandles.add(()=>{let e=this._activeComputation;return e==null?{}:{geometry:e.geometry,constraint:e.previousConstraint}},({geometry:e,constraint:t})=>{let n=this._constraintSnappingIndicator;e!=null&&t!=null&&t!==2?(n.visible=!0,n.setGeometryFromSegment(e.directSegment)):n.visible=!1})]}removeStaged(){return this._stagedDimension!=null&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(e){let{_stagedDimension:t}=this;if(t==null){let t=this._onUnstagedClick(e);return this.analysis.dimensions.add(t),null}return this._onStagedClick(e),t}onPointerMove({mapPoint:e,pointerType:t}){if(t===`touch`)return;let n=this._getSnappingContext(t);this._updatingHandles.consumePromise(d(this._snappingOperation.snap({point:e},this._ensureSnappingManager(),n)))}onManipulatorSelectionChanged(){this.analysisViewData.selectedComputation!=null&&(this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null))}_onUnstagedClick({mapPoint:e,pointerType:n}){let r=e;if(n===`mouse`){let t=this._getSnappingContext(n);r=this._ensureSnappingManager().update({point:e,context:t})}let i=new t({startPoint:S(r,new x),endPoint:null,measureType:`horizontal`});return this._stagedDimension=i,this._resetSnappingState(),i}_onStagedClick({mapPoint:e,pointerType:t}){let n=this._stagedComputation;if(n==null)return;let r=e;if(t===`mouse`){let n=this._getSnappingContext(t);r=this._ensureSnappingManager().update({point:e,context:n})}let i=S(r,new x);this._applyPointUpdate(n,{endPoint:i}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(e){let t=this._setupPointManipulator(e,{isStart:!0}),n=this._setupPointManipulator(e,{isStart:!1}),r=this._setupOffsetManipulator(e),i=this._setupHeadingManipulator(e),o=this._setupRotationManipulator(e),s=this._setupMeasureTypeManipulator(e,`direct`),c=this._setupMeasureTypeManipulator(e,`horizontal`),l=this._setupMeasureTypeManipulator(e,`vertical`),u=new re({start:t,end:n,offset:r,heading:i,rotation:o,direct:s,horizontal:c,vertical:l});this._setupComputationToManipulatorsSync(e,u),this._computationManipulators.set(e,u),this.manipulators.addMany(u.values());let d=a(u.values().map(e=>e.events.on(`focus-changed`,()=>{u.values().some(e=>e.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(e),this._computationManipulators.delete(e);for(let e of u.values())this.manipulators.remove(e)}}}_setupComputationToManipulatorsSync(e,t){this._computationHandles.add([p(()=>e.geometry,()=>this._updateManipulators(e,t),{...h,equals:o})],e)}_setupPointManipulator(e,t){let{view:n}=this,{dimension:r}=e,i=new w(n,{metadata:r}),a=T(i,{isStart:t.isStart,createSnappingPipelineStep:e=>fe({snappingContext:this._getSnappingContext(e),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:r,onUpdate:t=>this._applyPointUpdate(e,t),view:n});return this._computationHandles.add(a,e),i}_setupOffsetManipulator(e){let{view:t}=this,n=E(t,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:e.dimension}),r=D(n,{computation:e,view:t});return this._computationHandles.add(r,e),n}_setupHeadingManipulator(e){let{view:t}=this,n=new O(t,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:e.dimension}),r=k(n,{computation:e,view:t});return this._computationHandles.add(r,e),n}_setupRotationManipulator(e){let{view:t}=this,n=new O(t,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:e.dimension}),r=A(n,{computation:e,view:t});return this._computationHandles.add(r,e),n}_setupMeasureTypeManipulator(e,t){let{view:n}=this,r=j(n,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:e.dimension}),i=M(r,{computation:e,manipulatorMeasureType:t,view:n});return this._computationHandles.add(i,e),r}_updateManipulators(e,t,n={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){let{stagedDimension:r,selectedComputation:i,firstGrabbedManipulator:a}=n,{start:o,end:s,offset:c,heading:l,rotation:u}=t,d=i===e,f=z(e),{dimension:p}=e;for(let e of t.values()){let t=f&&r==null&&(a==null||e===a);e===c?(e.available=t,e.selected=d):e.available=t&&d}if(!f)return;this._computeConstraint(e)==null?t.manipulatorForMeasureType(p.measureType).available=!1:t.forEachMeasureTypeManipulator(e=>e.available=!1);for(let e of[l,u])(p.measureType!==`direct`||p.offset===0)&&(e.available=!1);B(e)?u.available=!1:l.available=!1;let{geometry:m}=e;o.renderLocation=m.directSegment.startRenderSpace,s.renderLocation=m.directSegment.endRenderSpace;let{renderCoordsHelper:h}=this.view;N(c,m,h),l.available&&P(l,e,h),u.available&&F(u,e,h),t.forEachMeasureTypeManipulator((t,n)=>{t.available&&I(t,e,n,h)})}_updateManipulatorStyle(e){let t=L(e),n=R(e),r={lineSizePt:e,material:this._orientationManipulatorMaterial};for(let{offset:e,heading:t,rotation:i}of this._computationManipulators.values())e.radius=n/2,t.update(r),i.update(r);this._unfocusedOffsetManipulatorMaterial.setParameters({width:t}),this._focusedOffsetManipulatorMaterial.setParameters({width:n})}_applyPointUpdate(e,t){let{view:n}=this,r=V(e);`startPoint`in t&&(r.elevationAlignedStartPoint=t.startPoint),`endPoint`in t&&(r.elevationAlignedEndPoint=t.endPoint);let i=H(r,n.renderCoordsHelper);if(i==null)return;let a=this._computeConstraint({...r,geometry:i});ee(e,t,{...r,constraint:a,unconstrainedGeometry:i,view:n}),e===this._stagedComputation&&this._updateStagedDimensionOffset(e)}_updateStagedDimensionOffset(e){if(e.geometry==null)return;e.geometry.directSegment.eval(.5,$);let{state:t,renderCoordsHelper:n}=this.view,r=t.camera.computeScreenPixelSizeAt($);e.dimension.offset=K*r*n.unitInMeters}_computeConstraint(e){return te(ne(e,this._ensureSnappingManager().options),this.view)}_createOffsetManipulatorMaterial(e){return new ce({width:1,renderOccluded:4,writeDepth:!1,polygonOffset:3,isDecoration:!0},e)}get test(){}};e([_({constructOnly:!0})],Q.prototype,`analysis`,void 0),e([_({constructOnly:!0})],Q.prototype,`analysisViewData`,void 0),e([_({constructOnly:!0})],Q.prototype,`manipulators`,void 0),e([_({constructOnly:!0})],Q.prototype,`parentTool`,void 0),e([_({constructOnly:!0,nonNullable:!0})],Q.prototype,`view`,void 0),e([_({readOnly:!0})],Q.prototype,`updating`,null),e([_()],Q.prototype,`firstGrabbedManipulator`,null),e([_()],Q.prototype,`hasGrabbedManipulators`,null),e([_()],Q.prototype,`snappingOptions`,null),e([_()],Q.prototype,`_stagedDimension`,void 0),e([_()],Q.prototype,`_snappingManager`,null),e([_()],Q.prototype,`_activeComputation`,null),e([_()],Q.prototype,`_stagedComputation`,null),e([_()],Q.prototype,`_snappingManagerResult`,void 0),Q=e([v(`esri.views.3d.analysis.Dimension.LengthDimensionSubTool`)],Q);const $=y();export{Q as LengthDimensionSubTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{lengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import{cyclicalDegrees as t}from"../../../../core/Cyclical.js";import{rad2deg as n}from"../../../../core/mathUtils.js";import{watch as r,initial as i}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{identity as o,scale as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as l,copy as u,exactEquals as d,length as f,set as p,sub as m,subtract as h,cross as g,dot as ee}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,ZEROS as v,fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as te}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import ne from"../../../../geometry/Point.js";import{fromPositionAndNormal as b,create as x,signedDistance as re,getNormal as ie}from"../../../../geometry/support/plane.js";import{sv3d as S}from"../../../../geometry/support/vectorStacks.js";import{clonePoint as ae}from"../../../../layers/graphics/hydratedFeatures.js";import{isValidComputation as C,computeOffsetForPoint as oe,computeSegmentForMeasureType as se,computeOffsetAxis as ce,dimensionStartToEnd as le,headingFromGeometry as w,computeGeometryFromDimension as ue,computationToGeometryDependencies as T,directUp as E,directStartToEnd as D}from"./lengthDimensionUtils.js";import{getTransparentAccentColor as O,pointRadius as de,lengthFraction as k,minLengthMeters as fe,linePaddingPx as pe,focusedLinePaddingPx as me,orientationFocusMultiplier as he,orientationDiscScale as ge,orientationCalloutWidth as _e,markerLineSizeFraction as ve,orientationCalloutOffsetPx as ye,orientationSnapThresholdDegrees as be}from"./settings.js";import{Manipulator3D as A}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as xe,worldScaledManipulatorSettings as j,calculateTranslateRotateFromBases as M,rotateManipulatorDefaults as N,calculateInputRotationTransform as Se}from"../../interactive/manipulatorUtils.js";import{RenderObject as P}from"../../interactive/RenderObject.js";import{screenToMap3D as Ce,hideManipulatorWhileDragging as F,screenToRenderPlane as I}from"../../interactive/editingTools/dragEventPipeline3D.js";import{EuclideanSegment as we}from"../../interactive/visualElements/support/Segment.js";import{markerSizePerLineWidth as Te}from"../../support/engineContent/marker.js";import{Attribute as L}from"../../webgl-engine/lib/Attribute.js";import{Geometry as Ee}from"../../webgl-engine/lib/Geometry.js";import{createSphereGeometry as De,createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RibbonLineMaterial as Oe}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as z,resetProperties as B,EventPipeline as ke}from"../../../interactive/dragEventPipeline.js";class Ae{constructor(e){this.start=e.start,this.end=e.end,this.offset=e.offset,this.heading=e.heading,this.rotation=e.rotation,this.direct=e.direct,this.horizontal=e.horizontal,this.vertical=e.vertical}manipulatorName(e){return Object.keys(this).find(t=>this.hasOwnProperty(t)&&e===this[t])}values(){return[this.start,this.end,this.offset,this.heading,this.rotation,this.direct,this.horizontal,this.vertical]}forEachMeasureTypeManipulator(t){for(let n of e)t(this.manipulatorForMeasureType(n),n)}manipulatorForMeasureType(e){switch(e){case`direct`:return this.direct;case`horizontal`:return this.horizontal;case`vertical`:return this.vertical}}}class je extends A{constructor(e,t){let n=xe(O(e.effectiveTheme).toUnitRGBA()),i=[new P(De(n,1,32,32),X)];super({view:e,renderObjects:i,metadata:t.metadata,available:!1,grabCursor:`crosshair`,radius:de,collisionPriority:1}),this._themeHandle=r(()=>({color:O(e.effectiveTheme).toUnitRGBA()}),e=>n.setParameters(e))}destroy(){this._themeHandle.remove(),super.destroy()}}function Me(e,t){let n=[y(-.5,0,0),y(.5,0,0)],r=R(t.unfocusedMaterial,n.map(e=>l(_(),e,k))),i=r.instantiate({material:t.focusedMaterial});return new A({view:e,renderObjects:[new P(r,9|X),new P(i,2|X)],collisionType:{type:`line`,paths:[n]},radius:J(t.lineSizePt)/2,metadata:t.metadata,available:!1,...j})}class Ne extends A{constructor(e,{lineSizePt:t,material:n,metadata:a}){super({view:e,autoScaleRenderObjects:!1,collisionPriority:1,metadata:a}),this._options={calloutColor:te(),lineSizePt:t,material:n},this._themeHandle=r(()=>O(e.effectiveTheme).toUnitRGBA(),e=>{this._options.calloutColor=e,Y(this,V({...this._options,metadata:this.metadata}))},i)}update({lineSizePt:e,material:t}){this._options.lineSizePt=e,this._options.material=t,Y(this,V({...this._options,metadata:this.metadata}))}destroy(){this._themeHandle.remove(),super.destroy()}}function V({calloutColor:e,lineSizePt:t,material:n,metadata:r}){return{calloutLength:.25*Te*ve*a(t)+ye,calloutColor:e,calloutWidth:_e,customStateMask:X,discScale:ge,focusMultiplier:he,material:n,metadata:r}}function Pe(e,t){let n=[y(-.5,0,0),y(.5,0,0)],r=R(t.thinOffsetManipulatorMaterial,n),i=R(t.unfocusedMaterial,n.map(e=>l(_(),e,k))),a=i.instantiate({material:t.focusedMaterial});return new A({view:e,renderObjects:[new P(i,1|X),new P(a,2|X),new P(r,X)],collisionType:{type:`line`,paths:[n]},radius:J(t.lineSizePt)/2,available:!1,metadata:t.metadata,...j})}function Fe(e,{isStart:t,createSnappingPipelineStep:n,dimension:r,onUpdate:i,view:a}){let o=t?`startPoint`:`endPoint`;return[z(e,(e,t,s,c)=>{let l=F(e),{snappingStep:u,cancelSnapping:d}=n(c);s.next(l).next(B(r,[o,`measureType`,`orientation`])).next(d),t.next(l).next(Ce(a)).next(...u).next(e=>{let t=ae(e.mapEnd,new ne);i(o===`startPoint`?{startPoint:t}:{endPoint:t})})})]}function Ie(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{if(!C(t)||!e.selected)return;let{geometry:a,dimension:o}=t,s=F(e);r.next(s).next(W(n,o,a.dimensionSegment,a.primaryOffsetAxis)),i.next(s).next(B(o,[`offset`]))})]}function Le(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{H({cancel:i,computation:t,settingHeading:!0,steps:r,view:n})})]}function Re(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{H({cancel:i,computation:t,settingHeading:!1,steps:r,view:n})}),e.events.on(`immediate-click`,e=>{ze(e,t,n)})]}function ze(e,n,r){let{dimension:i,geometry:a}=n;if(i.orientation===90||i.orientation===270){i.orientation=0,e.stopPropagation();return}if(a==null)return;let{renderCoordsHelper:o}=r,s=ue({...T(n),orientation:90},o),c=ue({...T(n),orientation:270},o);if(s==null||c==null)return;let l=w(s,o),u=w(c,o),d=G(a,r),f=t.shortestSignedDiff(d,l),p=t.shortestSignedDiff(d,u);i.orientation=Math.abs(f)<Math.abs(p)?90:270,e.stopPropagation()}function H(e){let{cancel:t,computation:r,settingHeading:i,steps:a,view:o}=e;if(!C(r))return;let{renderCoordsHelper:s}=o,{dimension:c,geometry:l}=r,d=_(),f=q(_(),l,l.directSegment,s),p=qe(S.get(),{forHeading:i,geometry:l,renderCoordsHelper:s}),m=b(f,p,x()),h=i?c.orientation??w(l,o.renderCoordsHelper):c.orientation??0;a.next(I(o,m)).next(e=>{e.action===`start`&&u(d,e.renderStart);let t=ie(m),r=Se(d,e.renderEnd,f,t),a=h-n(r);i||(a=U(a)),c.orientation=a}),t.next(B(c,[`orientation`]))}function U(e){let n=t.normalize(e)%90;return n<be?e-n:90-n<be?e+(90-n):e}function Be(e,{computation:t,manipulatorMeasureType:n,view:r}){let i=`direct`,a=0,o=0;return[e.events.on(`grab-changed`,s=>{if(s.action!==`start`||!C(t))return;let{dimension:c,geometry:l}=t;i=c.measureType,a=c.offset,o=c.orientation;let d=u(S.get(),e.renderLocation);c.measureType=n,c.offset=oe(d,n,l,r.renderCoordsHelper),c.orientation=0}),z(e,(e,s,c)=>{if(!C(t))return;let{geometry:l,dimension:u}=t,{renderCoordsHelper:d}=r,f=se(Qe,n,t,d),p=ce(S.get(),{measureType:n,directSegment:l.directSegment,renderCoordsHelper:d}),m=F(e);s.next(m).next(W(r,u,f,p)),c.next(m).next(e=>(u.measureType=i,u.offset=a,u.orientation=o,e))})]}function W(e,t,n,r){let i=h(S.get(),n.endRenderSpace,n.startRenderSpace);g(i,i,r);let a=b(n.startRenderSpace,i,x()),o=b(n.startRenderSpace,r,x()),s=t.offset,c=0,l,u=new ke;return u.next(I(e,a)).next(n=>{n.action===`start`&&(c=re(o,n.renderStart));let r=(re(o,n.renderEnd)-c)*e.renderCoordsHelper.unitInMeters;t.offset=s+r,l=n}),e=>(u.execute(e),l)}function G(e,t){let{directSegment:n}=e,{renderCoordsHelper:r}=t,i=E(S.get(),e,r),a=D(S.get(),e),o=g(S.get(),a,i),{viewForward:s}=t.state.camera;ee(o,s)>0&&l(o,o,-1);let c=n.eval(.5,S.get());return r.headingAtPosition(c,o)}function Ve(e,t,n){let{dimensionSegment:r,primaryOffsetAxis:i}=t,a=le(Z,t),c=d(a,v)?o($):M(a,i,v,$),l=Math.max(f(a),fe/n.unitInMeters);s(c,c,p(Z,l,l,l)),e.modelTransform=c,e.renderLocation=r.eval(.5,Z)}function He(e,t,n){K(e,t,n,{forHeading:!0})}function Ue(e,t,n){K(e,t,n,{forHeading:!1})}function K(e,t,n,{forHeading:r}){let{dimension:i,geometry:a}=t,{primaryOffsetAxis:o}=a,s=l(We,o,i.offset>=0?1:-1),c=qe(Ge,{forHeading:r,geometry:a,renderCoordsHelper:n});g(c,c,s),e.modelTransform=M(s,c,v,$),e.renderLocation=q(Z,a,a.dimensionSegment,n)}const We=_(),Ge=_();function Ke(e,t,n,r){let{geometry:i}=t,a=se(Qe,n,t,r),o=ce(Z,{measureType:n,directSegment:i.directSegment,renderCoordsHelper:r}),c=m(Q,a.endRenderSpace,a.startRenderSpace),l=M(c,o,v,$),u=f(c);s(l,l,p(Q,u,u,u)),e.modelTransform=l,e.renderLocation=a.eval(.5,Q)}function q(e,t,n,r){let{startRenderSpace:i,endRenderSpace:a}=n,o=Je(t,r)?i:a;return u(e,o)}function qe(e,{forHeading:t,geometry:n,renderCoordsHelper:r}){return t?E(e,n,r):le(e,n,{invert:!0})}function Je(e,t){let n=D(Ye,e),r=E(Xe,e,t);return ee(n,r)>0}const Ye=_(),Xe=_();function Ze(e){return a(e)+pe}function J(e){return a(e)+me}function Y(e,t){let n=t.material,r=t.focusMultiplier??N.focusMultiplier,i=t.calloutLength??N.calloutLength,a=N.discRadius*(t.discScale??1),o=a*r,s=(e,t)=>{let n=[0,1,2,2,3,0];return new Ee(t,[[`position`,new L([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],n,3,!0)],[`uv0`,new L([0,0,1,0,1,1,0,1],n,2,!0)]])},c=t.calloutWidth??N.calloutWidth,l=new Oe({width:c,color:t.calloutColor,renderOccluded:4,isDecoration:!0},e.view.state.isGlobal),u=R(l,[[0,0,0],[i-a,0,0]]),d=R(l,[[0,0,0],[i-o,0,0]]),f=t.customStateMask??0;e.collisionType={type:`disc`,direction:[0,0,1],offset:[i,0,0]},e.focusMultiplier=r,e.metadata=t.metadata,e.radius=a,e.renderObjects=[new P(s(a,n),1|f),new P(u,1|f),new P(s(o,n),2|f),new P(d,2|f)]}const X=16,Z=_(),Q=_(),$=c(),Qe=new we;export{X as DidPointerMoveRecentlyFlag,Ae as LengthDimensionManipulators,je as LengthDimensionPointManipulator,Ne as LineOfSightOrientationManipulator,G as automaticHeadingFromCamera,Pe as createMeasureTypeManipulator,Me as createOffsetManipulator,J as focusedOffsetWidth,Le as headingManipulatorHandles,Be as measureTypeManipulatorHandles,Ie as offsetManipulatorHandles,Fe as pointManipulatorHandles,Re as rotationManipulatorHandles,U as snapOrientationToNearestRightAngle,Ze as unfocusedOffsetWidth,He as updateHeadingManipulatorTransform,Ke as updateMeasureTypeManipulatorTransform,Ve as updateOffsetManipulatorTransform,Ue as updateRotationManipulatorTransform};
|
|
2
|
+
import{lengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import{cyclicalDegrees as t}from"../../../../core/Cyclical.js";import{rad2deg as n}from"../../../../core/mathUtils.js";import{watch as r,initial as i}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{identity as o,scale as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as l,copy as u,exactEquals as d,length as f,set as p,sub as m,subtract as h,cross as g,dot as ee}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,ZEROS as v,fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as te}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import ne from"../../../../geometry/Point.js";import{fromPositionAndNormal as b,create as x,signedDistance as re,getNormal as ie}from"../../../../geometry/support/plane.js";import{sv3d as S}from"../../../../geometry/support/vectorStacks.js";import{clonePoint as ae}from"../../../../layers/graphics/hydratedFeatures.js";import{isValidComputation as C,computeOffsetForPoint as oe,computeSegmentForMeasureType as se,computeOffsetAxis as ce,dimensionStartToEnd as le,headingFromGeometry as w,computeGeometryFromDimension as ue,computationToGeometryDependencies as T,directUp as E,directStartToEnd as D}from"./lengthDimensionUtils.js";import{getTransparentAccentColor as O,pointRadius as de,lengthFraction as k,minLengthMeters as fe,linePaddingPx as pe,focusedLinePaddingPx as me,orientationFocusMultiplier as he,orientationDiscScale as ge,orientationCalloutWidth as _e,markerLineSizeFraction as ve,orientationCalloutOffsetPx as ye,orientationSnapThresholdDegrees as be}from"./settings.js";import{Manipulator3D as A}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as xe,worldScaledManipulatorSettings as j,calculateTranslateRotateFromBases as M,rotateManipulatorDefaults as N,calculateInputRotationTransform as Se}from"../../interactive/manipulatorUtils.js";import{RenderObject as P}from"../../interactive/RenderObject.js";import{screenToMap3D as Ce,hideManipulatorWhileDragging as F,screenToRenderPlane as I}from"../../interactive/editingTools/dragEventPipeline3D.js";import{EuclideanSegment as we}from"../../interactive/visualElements/support/Segment.js";import{markerSizePerLineWidth as Te}from"../../support/engineContent/marker.js";import{Attribute as L}from"../../webgl-engine/lib/Attribute.js";import{Geometry as Ee}from"../../webgl-engine/lib/Geometry.js";import{createSphereGeometry as De,createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RibbonLineMaterial as Oe}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as z,resetProperties as B,EventPipeline as ke}from"../../../interactive/dragEventPipeline.js";class Ae{constructor(e){this.start=e.start,this.end=e.end,this.offset=e.offset,this.heading=e.heading,this.rotation=e.rotation,this.direct=e.direct,this.horizontal=e.horizontal,this.vertical=e.vertical}manipulatorName(e){return Object.keys(this).find(t=>this.hasOwnProperty(t)&&e===this[t])}values(){return[this.start,this.end,this.offset,this.heading,this.rotation,this.direct,this.horizontal,this.vertical]}forEachMeasureTypeManipulator(t){for(let n of e)t(this.manipulatorForMeasureType(n),n)}manipulatorForMeasureType(e){switch(e){case`direct`:return this.direct;case`horizontal`:return this.horizontal;case`vertical`:return this.vertical}}}class je extends A{constructor(e,t){let n=xe(O(e.effectiveTheme).toUnitRGBA()),i=[new P(De(n,1,32,32),X)];super({view:e,renderObjects:i,metadata:t.metadata,available:!1,grabCursor:`crosshair`,radius:de,collisionPriority:1}),this._themeHandle=r(()=>({color:O(e.effectiveTheme).toUnitRGBA()}),e=>n.setParameters(e))}destroy(){this._themeHandle.remove(),super.destroy()}}function Me(e,t){let n=[y(-.5,0,0),y(.5,0,0)],r=R(t.unfocusedMaterial,n.map(e=>l(_(),e,k))),i=r.instantiate({material:t.focusedMaterial});return new A({view:e,renderObjects:[new P(r,9|X),new P(i,2|X)],collisionType:{type:`line`,paths:[n]},radius:J(t.lineSizePt)/2,metadata:t.metadata,available:!1,...j})}class Ne extends A{constructor(e,{lineSizePt:t,material:n,metadata:a}){super({view:e,autoScaleRenderObjects:!1,collisionPriority:1,metadata:a}),this._options={calloutColor:te(),lineSizePt:t,material:n},this._themeHandle=r(()=>O(e.effectiveTheme).toUnitRGBA(),e=>{this._options.calloutColor=e,Y(this,V({...this._options,metadata:this.metadata}))},i)}update({lineSizePt:e,material:t}){this._options.lineSizePt=e,this._options.material=t,Y(this,V({...this._options,metadata:this.metadata}))}destroy(){this._themeHandle.remove(),super.destroy()}}function V({calloutColor:e,lineSizePt:t,material:n,metadata:r}){return{calloutLength:.25*Te*ve*a(t)+ye,calloutColor:e,calloutWidth:_e,customStateMask:X,discScale:ge,focusMultiplier:he,material:n,metadata:r}}function Pe(e,t){let n=[y(-.5,0,0),y(.5,0,0)],r=R(t.thinOffsetManipulatorMaterial,n),i=R(t.unfocusedMaterial,n.map(e=>l(_(),e,k))),a=i.instantiate({material:t.focusedMaterial});return new A({view:e,renderObjects:[new P(i,1|X),new P(a,2|X),new P(r,X)],collisionType:{type:`line`,paths:[n]},radius:J(t.lineSizePt)/2,available:!1,metadata:t.metadata,...j})}function Fe(e,{isStart:t,createSnappingPipelineStep:n,dimension:r,onUpdate:i,view:a}){let o=t?`startPoint`:`endPoint`;return[z(e,(e,t,s,c)=>{let l=F(e),{snappingStep:u,cancelSnapping:d}=n(c);s.next(l).next(B(r,[o,`measureType`,`orientation`])).next(d),t.next(l).next(Ce(a)).next(...u).next(e=>{let t=ae(e.mapEnd,new ne);i(o===`startPoint`?{startPoint:t}:{endPoint:t})})})]}function Ie(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{if(!C(t)||!e.selected)return;let{geometry:a,dimension:o}=t,s=F(e);r.next(s).next(W(n,o,a.dimensionSegment,a.primaryOffsetAxis)),i.next(s).next(B(o,[`offset`]))})]}function Le(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{H({cancel:i,computation:t,settingHeading:!0,steps:r,view:n})})]}function Re(e,{computation:t,view:n}){return[z(e,(e,r,i)=>{H({cancel:i,computation:t,settingHeading:!1,steps:r,view:n})}),e.events.on(`immediate-click`,e=>{ze(e,t,n)})]}function ze(e,n,r){let{dimension:i,geometry:a}=n;if(i.orientation===90||i.orientation===270){i.orientation=0,e.stopPropagation();return}if(a==null)return;let{renderCoordsHelper:o}=r,s=ue({...T(n),orientation:90},o),c=ue({...T(n),orientation:270},o);if(s==null||c==null)return;let l=w(s,o),u=w(c,o),d=G(a,r),f=t.shortestSignedDiff(d,l),p=t.shortestSignedDiff(d,u);i.orientation=Math.abs(f)<Math.abs(p)?90:270,e.stopPropagation()}function H(e){let{cancel:t,computation:r,settingHeading:i,steps:a,view:o}=e;if(!C(r))return;let{renderCoordsHelper:s}=o,{dimension:c,geometry:l}=r,d=_(),f=q(_(),l,l.directSegment,s),p=qe(S.get(),{forHeading:i,geometry:l,renderCoordsHelper:s}),m=b(f,p,x()),h=i?c.orientation??w(l,o.renderCoordsHelper):c.orientation??0;a.next(I(o,m)).next(e=>{e.action===`start`&&u(d,e.renderStart);let t=ie(m),r=Se(d,e.renderEnd,f,t),a=h-n(r);i||(a=U(a)),c.orientation=a}),t.next(B(c,[`orientation`]))}function U(e){let n=t.normalize(e)%90;return n<be?e-n:90-n<be?e+(90-n):e}function Be(e,{computation:t,manipulatorMeasureType:n,view:r}){let i=`direct`,a=0,o=0;return[e.events.on(`grab-changed`,s=>{if(s.action!==`start`||!C(t))return;let{dimension:c,geometry:l}=t;i=c.measureType,a=c.offset,o=c.orientation;let d=u(S.get(),e.renderLocation);c.measureType=n,c.offset=oe(d,n,l,r.renderCoordsHelper),c.orientation=0}),z(e,(e,s,c)=>{if(!C(t))return;let{geometry:l,dimension:u}=t,{renderCoordsHelper:d}=r,f=se(Qe,n,t,d),p=ce(S.get(),{measureType:n,directSegment:l.directSegment,renderCoordsHelper:d}),m=F(e);s.next(m).next(W(r,u,f,p)),c.next(m).next(e=>(u.measureType=i,u.offset=a,u.orientation=o,e))})]}function W(e,t,n,r){let i=h(S.get(),n.endRenderSpace,n.startRenderSpace);g(i,i,r);let a=b(n.startRenderSpace,i,x()),o=b(n.startRenderSpace,r,x()),s=t.offset,c=0,l,u=new ke;return u.next(I(e,a)).next(n=>{n.action===`start`&&(c=re(o,n.renderStart));let r=(re(o,n.renderEnd)-c)*e.renderCoordsHelper.unitInMeters;t.offset=s+r,l=n}),e=>(u.execute(e),l)}function G(e,t){let{directSegment:n}=e,{renderCoordsHelper:r}=t,i=E(S.get(),e,r),a=D(S.get(),e),o=g(S.get(),a,i),{viewForward:s}=t.state.camera;ee(o,s)>0&&l(o,o,-1);let c=n.eval(.5,S.get());return r.headingAtPosition(c,o)}function Ve(e,t,n){let{dimensionSegment:r,primaryOffsetAxis:i}=t,a=le(Z,t),c=d(a,v)?o($):M(a,i,v,$),l=Math.max(f(a),fe/n.unitInMeters);s(c,c,p(Z,l,l,l)),e.modelTransform=c,e.renderLocation=r.eval(.5,Z)}function He(e,t,n){K(e,t,n,{forHeading:!0})}function Ue(e,t,n){K(e,t,n,{forHeading:!1})}function K(e,t,n,{forHeading:r}){let{dimension:i,geometry:a}=t,{primaryOffsetAxis:o}=a,s=l(We,o,i.offset>=0?1:-1),c=qe(Ge,{forHeading:r,geometry:a,renderCoordsHelper:n});g(c,c,s),e.modelTransform=M(s,c,v,$),e.renderLocation=q(Z,a,a.dimensionSegment,n)}const We=_(),Ge=_();function Ke(e,t,n,r){let{geometry:i}=t,a=se(Qe,n,t,r),o=ce(Z,{measureType:n,directSegment:i.directSegment,renderCoordsHelper:r}),c=m(Q,a.endRenderSpace,a.startRenderSpace),l=M(c,o,v,$),u=f(c);s(l,l,p(Q,u,u,u)),e.modelTransform=l,e.renderLocation=a.eval(.5,Q)}function q(e,t,n,r){let{startRenderSpace:i,endRenderSpace:a}=n,o=Je(t,r)?i:a;return u(e,o)}function qe(e,{forHeading:t,geometry:n,renderCoordsHelper:r}){return t?E(e,n,r):le(e,n,{invert:!0})}function Je(e,t){let n=D(Ye,e),r=E(Xe,e,t);return ee(n,r)>0}const Ye=_(),Xe=_();function Ze(e){return a(e)+pe}function J(e){return a(e)+me}function Y(e,t){let n=t.material,r=t.focusMultiplier??N.focusMultiplier,i=t.calloutLength??N.calloutLength,a=N.discRadius*(t.discScale??1),o=a*r,s=(e,t)=>{let n=[0,1,2,2,3,0];return new Ee(t,[[`position`,new L([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],n,3,!0)],[`uv0`,new L([0,0,1,0,1,1,0,1],n,2,!0)]])},c=t.calloutWidth??N.calloutWidth,l=new Oe({width:c,color:t.calloutColor,renderOccluded:4,isDecoration:!0},e.view),u=R(l,[[0,0,0],[i-a,0,0]]),d=R(l,[[0,0,0],[i-o,0,0]]),f=t.customStateMask??0;e.collisionType={type:`disc`,direction:[0,0,1],offset:[i,0,0]},e.focusMultiplier=r,e.metadata=t.metadata,e.radius=a,e.renderObjects=[new P(s(a,n),1|f),new P(u,1|f),new P(s(o,n),2|f),new P(d,2|f)]}const X=16,Z=_(),Q=_(),$=c(),Qe=new we;export{X as DidPointerMoveRecentlyFlag,Ae as LengthDimensionManipulators,je as LengthDimensionPointManipulator,Ne as LineOfSightOrientationManipulator,G as automaticHeadingFromCamera,Pe as createMeasureTypeManipulator,Me as createOffsetManipulator,J as focusedOffsetWidth,Le as headingManipulatorHandles,Be as measureTypeManipulatorHandles,Ie as offsetManipulatorHandles,Fe as pointManipulatorHandles,Re as rotationManipulatorHandles,U as snapOrientationToNearestRightAngle,Ze as unfocusedOffsetWidth,He as updateHeadingManipulatorTransform,Ke as updateMeasureTypeManipulatorTransform,Ve as updateOffsetManipulatorTransform,Ue as updateRotationManipulatorTransform};
|
|
@@ -38,6 +38,12 @@ import type { ElevationProfileStatistics, ElevationProfileEffectiveDisplayUnits,
|
|
|
38
38
|
export default abstract class ElevationProfileAnalysisView3D extends AnalysisView3D {
|
|
39
39
|
/** The elevation profile analysis associated with the analysis view. */
|
|
40
40
|
get analysis(): ElevationProfileAnalysis;
|
|
41
|
+
/**
|
|
42
|
+
* Whether placement has at least two committed vertices and can be stopped.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
get canStopPlacing(): boolean;
|
|
41
47
|
/**
|
|
42
48
|
* Units used for all the [results](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ElevationProfileAnalysisView3D/#results) and [statistics](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ElevationProfileAnalysisView3D/#statistics) of the elevation profile analysis.
|
|
43
49
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"./AnalysisView3D.js";import{ElevationProfileLineSceneComputation as a}from"./ElevationProfile/ElevationProfileLineSceneComputation.js";import{ElevationProfileVisualization3D as o}from"./ElevationProfile/ElevationProfileVisualization3D.js";import{ElevationProfileController as s}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as c}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as l}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as u}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as d}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let f=class extends i{constructor(e){super(e),this.type=`elevation-profile-view-3d`,this.analysis=null,this.indicatorRelativePosition=null}initialize(){let{analysis:e,view:t}=this;this._controller=new s({analysis:e,analysisViewData:this,view:t,computationFactory:{create:e=>{switch(e.profile.type){case`ground`:return new c(e);case`input`:return new l(e);case`query`:return new u(e);case`scene`:return new a(e)}}}}),this._visualization=new o({view:t,analysisViewData:this}),this._sketchTool=new d({view:t,analysisViewData:this})}destroy(){this._controller?.destroy(),this._visualization?.destroy(),this._sketchTool?.destroy()}get effectiveDisplayUnits(){return this._controller?.effectiveDisplayUnits??{distance:`meters`,elevation:`meters`}}get error(){return this._controller?.error}get flatProfiles(){return this._controller?.flatProfiles??m}get indicatorPoints(){return this._controller?.indicatorPoints??[]}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get progress(){return this._controller?.progress??0}get results(){return this._controller?.results??[]}get statistics(){return this._controller?.statistics}get updating(){return this._controller?.updating===!0||this._visualization?.updating===!0||this._sketchTool?.updating===!0}get visible(){return super.visible}set visible(e){super.visible=e}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??`idle`}place(e){return this._sketchTool.place(e)}pickFeature(e){return this._sketchTool.pickFeature(e)}get testData(){return{visualization:this._visualization}}};e([n({readOnly:!0})],f.prototype,`type`,void 0),e([n({constructOnly:!0,nonNullable:!0})],f.prototype,`analysis`,void 0),e([n({readOnly:!0})],f.prototype,`effectiveDisplayUnits`,null),e([n({readOnly:!0})],f.prototype,`error`,null),e([n()],f.prototype,`flatProfiles`,null),e([n()],f.prototype,`indicatorRelativePosition`,void 0),e([n()],f.prototype,`indicatorPoints`,null),e([n({readOnly:!0})],f.prototype,`progress`,null),e([n({readOnly:!0})],f.prototype,`results`,null),e([n({readOnly:!0})],f.prototype,`statistics`,null),e([n({readOnly:!0})],f.prototype,`updating`,null),e([n()],f.prototype,`sketchGraphic`,null),e([n()],f.prototype,`toolState`,null),e([n()],f.prototype,`_controller`,void 0),e([n()],f.prototype,`_visualization`,void 0),e([n()],f.prototype,`_sketchTool`,void 0),f=e([r(`esri.views.3d.analysis.ElevationProfileAnalysisView3D`)],f);const p=f,m=new t;export{p as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"./AnalysisView3D.js";import{ElevationProfileLineSceneComputation as a}from"./ElevationProfile/ElevationProfileLineSceneComputation.js";import{ElevationProfileVisualization3D as o}from"./ElevationProfile/ElevationProfileVisualization3D.js";import{ElevationProfileController as s}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as c}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as l}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as u}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as d}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let f=class extends i{constructor(e){super(e),this.type=`elevation-profile-view-3d`,this.analysis=null,this.indicatorRelativePosition=null}initialize(){let{analysis:e,view:t}=this;this._controller=new s({analysis:e,analysisViewData:this,view:t,computationFactory:{create:e=>{switch(e.profile.type){case`ground`:return new c(e);case`input`:return new l(e);case`query`:return new u(e);case`scene`:return new a(e)}}}}),this._visualization=new o({view:t,analysisViewData:this}),this._sketchTool=new d({view:t,analysisViewData:this})}destroy(){this._controller?.destroy(),this._visualization?.destroy(),this._sketchTool?.destroy()}get effectiveDisplayUnits(){return this._controller?.effectiveDisplayUnits??{distance:`meters`,elevation:`meters`}}get error(){return this._controller?.error}get flatProfiles(){return this._controller?.flatProfiles??m}get indicatorPoints(){return this._controller?.indicatorPoints??[]}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get progress(){return this._controller?.progress??0}get results(){return this._controller?.results??[]}get statistics(){return this._controller?.statistics}get updating(){return this._controller?.updating===!0||this._visualization?.updating===!0||this._sketchTool?.updating===!0}get visible(){return super.visible}set visible(e){super.visible=e}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??`idle`}get canStopPlacing(){return this._sketchTool?.canStopPlacing??!1}place(e){return this._sketchTool.place(e)}pickFeature(e){return this._sketchTool.pickFeature(e)}get testData(){return{visualization:this._visualization}}};e([n({readOnly:!0})],f.prototype,`type`,void 0),e([n({constructOnly:!0,nonNullable:!0})],f.prototype,`analysis`,void 0),e([n({readOnly:!0})],f.prototype,`effectiveDisplayUnits`,null),e([n({readOnly:!0})],f.prototype,`error`,null),e([n()],f.prototype,`flatProfiles`,null),e([n()],f.prototype,`indicatorRelativePosition`,void 0),e([n()],f.prototype,`indicatorPoints`,null),e([n({readOnly:!0})],f.prototype,`progress`,null),e([n({readOnly:!0})],f.prototype,`results`,null),e([n({readOnly:!0})],f.prototype,`statistics`,null),e([n({readOnly:!0})],f.prototype,`updating`,null),e([n()],f.prototype,`sketchGraphic`,null),e([n()],f.prototype,`toolState`,null),e([n()],f.prototype,`canStopPlacing`,null),e([n()],f.prototype,`_controller`,void 0),e([n()],f.prototype,`_visualization`,void 0),e([n()],f.prototype,`_sketchTool`,void 0),f=e([r(`esri.views.3d.analysis.ElevationProfileAnalysisView3D`)],f);const p=f,m=new t;export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{lineOfSightPlacementLeafPluginMarker as a}from"./LineOfSightPlacementLeafPlugin.js";import{PluginBase as o}from"../../../draw/plugins/PluginBase.js";var s,c;const l=Symbol(`line-of-sight-observer-vertex`),u=Symbol(`line-of-sight-observer-plugin-marker`);let d=class extends o{constructor(){super(...arguments),this[s]=!0,this[c]=!0,this.observer=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null}static{s=u,c=a}start(e){super.start(e),this.preservedIntersection=null;let{session:r,positionOfLastUserInput:i}=e,a=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??i:this.inputMapPosition??i;a&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&r.appendOrReplacePoint(l,a),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?a??void 0:void 0}
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{lineOfSightPlacementLeafPluginMarker as a}from"./LineOfSightPlacementLeafPlugin.js";import{PluginBase as o}from"../../../draw/plugins/PluginBase.js";var s,c;const l=Symbol(`line-of-sight-observer-vertex`),u=Symbol(`line-of-sight-observer-plugin-marker`);let d=class extends o{constructor(){super(...arguments),this[s]=!0,this[c]=!0,this.observer=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null}static{s=u,c=a}start(e){super.start(e),this.preservedIntersection=null;let{session:r,positionOfLastUserInput:i}=e,a=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??i:this.inputMapPosition??i;a&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&r.appendOrReplacePoint(l,a),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?a??void 0:void 0}),this.addHandles(t(()=>this._interactiveHandle?.outputMapPosition,e=>{e&&!this._isComplete&&this._session?.appendOrReplacePoint(l,e)},n),this._ownHandlesKey))}};e([r({constructOnly:!0})],d.prototype,`observer`,void 0),e([r()],d.prototype,`defaultCaptureMode`,void 0),e([r()],d.prototype,`inputMapPosition`,void 0),e([r()],d.prototype,`preservedIntersection`,void 0),e([r()],d.prototype,`_interactiveHandle`,void 0),d=e([i(`esri.views.3d.analysis.LineOfSight.LineOfSightObserverPlugin`)],d);function f(e){return!!e&&u in e}function p(e={}){return{uniqueId:Symbol(`line-of-sight-observer-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new d(e)}}export{d as LineOfSightObserverPlugin,p as createLineOfSightObserverPluginConfiguration,f as isLineOfSightObserverPlugin,u as lineOfSightObserverPluginMarker};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisTarget.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,sync as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{updateLineOfSightItemFromIntersection as s,updateLineOfSightItemFromAuthoredPoint as c,convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{lineOfSightPlacementLeafPluginMarker as u}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as d}from"./LineOfSightRayIntersector.js";import{PluginBase as f}from"../../../draw/plugins/PluginBase.js";var p,m;const h=Symbol(`line-of-sight-target-vertex`),g=Symbol(`line-of-sight-target-plugin-marker`);let _=class extends f{constructor(){super(...arguments),this[p]=!0,this[m]=!0,this.target=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null,this._intersector=null,this._changingElevationMode=!1}static{p=g,m=u}initialize(){this._intersector=new d({view:this.view})}destroy(){this._intersector=n(this._intersector)}start(e){super.start(e),this.preservedIntersection=null;let{positionOfLastUserInput:a,session:o}=e,l=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??a:this.inputMapPosition??a;l&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&o.appendOrReplacePoint(h,l);let u=this.defaultCaptureMode===`capture-always`&&l!=null;this._interactiveHandle&&this._clearCursorTarget(),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?l??void 0:void 0}
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisTarget.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,sync as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{updateLineOfSightItemFromIntersection as s,updateLineOfSightItemFromAuthoredPoint as c,convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{lineOfSightPlacementLeafPluginMarker as u}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as d}from"./LineOfSightRayIntersector.js";import{PluginBase as f}from"../../../draw/plugins/PluginBase.js";var p,m;const h=Symbol(`line-of-sight-target-vertex`),g=Symbol(`line-of-sight-target-plugin-marker`);let _=class extends f{constructor(){super(...arguments),this[p]=!0,this[m]=!0,this.target=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null,this._intersector=null,this._changingElevationMode=!1}static{p=g,m=u}initialize(){this._intersector=new d({view:this.view})}destroy(){this._intersector=n(this._intersector)}start(e){super.start(e),this.preservedIntersection=null;let{positionOfLastUserInput:a,session:o}=e,l=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??a:this.inputMapPosition??a;l&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&o.appendOrReplacePoint(h,l);let u=this.defaultCaptureMode===`capture-always`&&l!=null;this._interactiveHandle&&this._clearCursorTarget(),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?l??void 0:void 0}),this.addHandles(r(()=>[this._interactiveHandle?.outputMapPosition,this.getElevationInfo()],([e,r])=>{if(!e||this._isComplete||this._changingElevationMode)return;let i=this.analysisViewData.cursorTarget??new t,a={elevationInfo:r},o=this._interactiveHandle?.screenPosition,l=o&&this._intersector?this._intersector.getScreenPointIntersection(o):null;this._session?.appendOrReplacePoint(h,e),u?(u=!1,this._clearCursorTarget()):l==null?o!=null&&this.preservedIntersection!=null?(this.analysisViewData.cursorTarget=i,s(this.view,i,this.preservedIntersection,{...a,snappedMapPoint:e})):o==null?!this._intersector||!c(this.view,i,this._intersector,e,{...a,preservedIntersection:this.preservedIntersection})?this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget):this.analysisViewData.cursorTarget=i:this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget):(this.analysisViewData.cursorTarget=i,s(this.view,i,l,{...a,snappedMapPoint:e}))},i),this._ownHandlesKey))}changeElevationMode(e,t,n){let r=this.analysisViewData.cursorTarget,i=r?.position,a=i?l({view:this.view,point:i,sourceElevationInfo:r.elevationInfo,mode:e,preserveZ:t}):null;this._changingElevationMode=!0;try{n();let e=this._interactiveHandle?.outputMapPosition;e&&this._session?.appendOrReplacePoint(h,e),r&&a&&(r.position=a.position,r.elevationInfo=a.elevationInfo)}finally{this._changingElevationMode=!1}}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}_clearCursorTarget(){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget)}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`target`,void 0),e([a({constructOnly:!0})],_.prototype,`getElevationInfo`,void 0),e([a()],_.prototype,`defaultCaptureMode`,void 0),e([a()],_.prototype,`inputMapPosition`,void 0),e([a()],_.prototype,`preservedIntersection`,void 0),e([a()],_.prototype,`_interactiveHandle`,void 0),e([a()],_.prototype,`_intersector`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.LineOfSightTargetPlugin`)],_);function v(e){return!!e&&g in e}function y(e){return{uniqueId:Symbol(`line-of-sight-target-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new _(e)}}export{_ as LineOfSightTargetPlugin,y as createLineOfSightTargetPluginConfiguration,v as isLineOfSightTargetPlugin,g as lineOfSightTargetPluginMarker};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Handles.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import{deg2rad as n,clamp as r}from"../../../../core/mathUtils.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as a,initial as o}from"../../../../core/reactiveUtils.js";import{fromYRotation as s,fromXRotation as c,fromScaling as l,fromZRotation as u,fromRotation as d,multiply as f}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as m,sub as h,scale as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as y}from"../../../../chunks/boundedPlane.js";import{viewshedToolManipulatorConfiguration as b}from"./ViewshedConfiguration.js";import{screenToCircleAngle as x,getViewshedRotationMatrix as S}from"./viewshedToolUtils.js";import{Manipulator3D as C}from"../../interactive/Manipulator3D.js";import{RenderObject as w}from"../../interactive/RenderObject.js";import{InteractiveManipulation as T}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createPolylineGeometry as E}from"../../webgl-engine/lib/GeometryUtil.js";import{assert as D}from"../../webgl-engine/lib/Util.js";import{RibbonLineMaterial as O}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as k}from"../../../interactive/dragEventPipeline.js";class A extends T{constructor(t){super(),this._handles=new e,this._tool=t.tool,this._view=t.view,this._focusedArcMaterial=this._createArcMaterial(!0),this._unfocusedArcMaterial=this._createArcMaterial(!1),this._createManipulators(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._handles=i(this._handles),this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulators=null}createDragPipeline(e,n){let r=Object.values(this._manipulators);return t(r.map(({manipulator:t,side:r})=>k(t,(t,i,a,o,s)=>{let c=L(r,n),l=i.next(e=>({...e,manipulatorType:2,side:r}));e(t,x(l,this._view,c,n),a)})))}updateManipulatorsTransform(e){e.arcCentersPoints(H),this._forEachManipulatorInfo(t=>this._updateArcManipulatorTransform(t,e,H[t.side]))}updateManipulatorVisuals(e){this._forEachManipulatorInfo(t=>this._updateArcManipulatorVisuals(t,e))}_updateArcManipulatorVisuals({manipulator:e,side:t},n){let r=[];if(n!=null){let[i,a]=j(t,n,this._unfocusedArcMaterial);r.push(new w(i,1),new w(i.instantiate({material:this._focusedArcMaterial}),2)),e.collisionType={type:`line`,paths:[a]}}e.renderObjects=r,e.radius=b.collisionRadius}_updateArcManipulatorTransform({manipulator:e,side:t},r,i){let a=r.horizontalFieldOfView,o=n(r.verticalFieldOfView/2),h=n(a/2),g=F(t);e.renderLocation=i;let _=p(),v=e=>{f(_,e,_)};v(s(z,n(-90))),g||v(c(z,o));let y=r.farDistanceRenderSpace;v(l(z,m(B,y,y,y))),v(u(z,P(t))),v(S(r,z));let b,x;g?(b=h,x=r.tiltedUpVector):(x=r.rightVector,b=o),b*=t===`right`||t===`bottom`?-1:1;let C=d(z,b,x);C!=null&&v(C),e.modelTransform=_}_createManipulators(){let e=this._createArcManipulator(`left`),t=this._createArcManipulator(`right`),n=this._createArcManipulator(`top`),r=this._createArcManipulator(`bottom`);this._manipulators={left:e,right:t,top:n,bottom:r},[[r.manipulator,n.manipulator],[e.manipulator,t.manipulator]].forEach(([e,t])=>{e.metadata={pairedManipulator:t},t.metadata={pairedManipulator:e}})}_createArcManipulator(e){let t=new C({view:this._view,autoScaleRenderObjects:!1,worldSized:!0}),n={manipulator:t,side:e};return this._updateArcManipulatorVisuals(n),this._handles.add(t.events.on([`focus-changed`,`grab-changed`],e=>{let n=t.metadata?.pairedManipulator;n!=null&&(n.hovering!==t.hovering&&(n.hovering=t.hovering),n.grabbing!==t.grabbing&&(n.grabbing=t.grabbing))})),n}_createArcMaterial(e){let t=b.getFovArcWidth(e),n=new O({renderOccluded:4,isDecoration:!0,width:t},this._view
|
|
2
|
+
import e from"../../../../core/Handles.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import{deg2rad as n,clamp as r}from"../../../../core/mathUtils.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as a,initial as o}from"../../../../core/reactiveUtils.js";import{fromYRotation as s,fromXRotation as c,fromScaling as l,fromZRotation as u,fromRotation as d,multiply as f}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as m,sub as h,scale as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as y}from"../../../../chunks/boundedPlane.js";import{viewshedToolManipulatorConfiguration as b}from"./ViewshedConfiguration.js";import{screenToCircleAngle as x,getViewshedRotationMatrix as S}from"./viewshedToolUtils.js";import{Manipulator3D as C}from"../../interactive/Manipulator3D.js";import{RenderObject as w}from"../../interactive/RenderObject.js";import{InteractiveManipulation as T}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createPolylineGeometry as E}from"../../webgl-engine/lib/GeometryUtil.js";import{assert as D}from"../../webgl-engine/lib/Util.js";import{RibbonLineMaterial as O}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as k}from"../../../interactive/dragEventPipeline.js";class A extends T{constructor(t){super(),this._handles=new e,this._tool=t.tool,this._view=t.view,this._focusedArcMaterial=this._createArcMaterial(!0),this._unfocusedArcMaterial=this._createArcMaterial(!1),this._createManipulators(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._handles=i(this._handles),this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulators=null}createDragPipeline(e,n){let r=Object.values(this._manipulators);return t(r.map(({manipulator:t,side:r})=>k(t,(t,i,a,o,s)=>{let c=L(r,n),l=i.next(e=>({...e,manipulatorType:2,side:r}));e(t,x(l,this._view,c,n),a)})))}updateManipulatorsTransform(e){e.arcCentersPoints(H),this._forEachManipulatorInfo(t=>this._updateArcManipulatorTransform(t,e,H[t.side]))}updateManipulatorVisuals(e){this._forEachManipulatorInfo(t=>this._updateArcManipulatorVisuals(t,e))}_updateArcManipulatorVisuals({manipulator:e,side:t},n){let r=[];if(n!=null){let[i,a]=j(t,n,this._unfocusedArcMaterial);r.push(new w(i,1),new w(i.instantiate({material:this._focusedArcMaterial}),2)),e.collisionType={type:`line`,paths:[a]}}e.renderObjects=r,e.radius=b.collisionRadius}_updateArcManipulatorTransform({manipulator:e,side:t},r,i){let a=r.horizontalFieldOfView,o=n(r.verticalFieldOfView/2),h=n(a/2),g=F(t);e.renderLocation=i;let _=p(),v=e=>{f(_,e,_)};v(s(z,n(-90))),g||v(c(z,o));let y=r.farDistanceRenderSpace;v(l(z,m(B,y,y,y))),v(u(z,P(t))),v(S(r,z));let b,x;g?(b=h,x=r.tiltedUpVector):(x=r.rightVector,b=o),b*=t===`right`||t===`bottom`?-1:1;let C=d(z,b,x);C!=null&&v(C),e.modelTransform=_}_createManipulators(){let e=this._createArcManipulator(`left`),t=this._createArcManipulator(`right`),n=this._createArcManipulator(`top`),r=this._createArcManipulator(`bottom`);this._manipulators={left:e,right:t,top:n,bottom:r},[[r.manipulator,n.manipulator],[e.manipulator,t.manipulator]].forEach(([e,t])=>{e.metadata={pairedManipulator:t},t.metadata={pairedManipulator:e}})}_createArcManipulator(e){let t=new C({view:this._view,autoScaleRenderObjects:!1,worldSized:!0}),n={manipulator:t,side:e};return this._updateArcManipulatorVisuals(n),this._handles.add(t.events.on([`focus-changed`,`grab-changed`],e=>{let n=t.metadata?.pairedManipulator;n!=null&&(n.hovering!==t.hovering&&(n.hovering=t.hovering),n.grabbing!==t.grabbing&&(n.grabbing=t.grabbing))})),n}_createArcMaterial(e){let t=b.getFovArcWidth(e),n=new O({renderOccluded:4,isDecoration:!0,width:t},this._view);return this._handles.add(a(()=>this._view.effectiveTheme.accentColor.toUnitRGBA(),e=>n.setParameters({color:e}),o)),n}forEachManipulator(e){Object.values(this._manipulators).forEach(({manipulator:t})=>e(t,2))}_forEachManipulatorInfo(e){Object.values(this._manipulators).forEach(t=>e(t))}get test(){return{manipulators:this._manipulators}}}function j(e,t,i){let{horizontalFieldOfView:a,verticalFieldOfView:o}=t,s=F(e),c=(s?o:a)/2,l=n(r(c,0,15)),u=s?1:Math.max(Math.sin(n(90-o/2)),.1),d=M(-l/2,l/2,u);return[E(i,d),d]}function M(e,t,n,r=10){D(r>1,`createArcPolylineGeometry() needs at least 2 for numVertices`);let i=t-e;if(i<=0||n<=0)return[v(0,0,.01),v(0,0,-.01)];let a=[],o=i/r;for(let i=0;i<r;i++){let s=e+i*o;i===r-1&&(s=t);let c=Math.cos(s)*n,l=Math.sin(s)*n,u=v(c-n,0,l);a.push(u)}return a}function N(e){switch(e){case`left`:return 0;case`bottom`:return 1;case`right`:return 2;case`top`:return 3}}function P(e){return N(e)*R}function F(e){return e===`left`||e===`right`}function I(e){return e===`left`?`right`:e===`right`?`left`:e===`top`?`bottom`:`top`}function L(e,t){let{elevationAlignedObserverRenderSpace:n,elevationAlignedTargetRenderSpace:r,tiltedUpVector:i,rightVector:a,farDistanceRenderSpace:o}=t,s=h(B,r,n),c=F(e)?a:i,l=g(V,c,o);return y(n,s,l)}const R=Math.PI/2,z=p(),B=_(),V=_(),H={top:_(),bottom:_(),left:_(),right:_()};export{A as ViewshedFieldOfViewManipulation,M as createArcPolylineVertices,I as flipSide,F as isSideHorizontal,P as sideToRad};
|