@arcgis/core 4.26.0-next.20221221 → 4.26.0-next.20221223
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WebScene.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{2163b9ee4d639d5ed6f3.js → 05bba3ba2f9ee02f52b5.js} +1 -1
- package/assets/esri/core/workers/chunks/{bbccf69f4aa1b1761265.js → 0b8dc54801a7aa5e6be3.js} +1 -1
- package/assets/esri/core/workers/chunks/{6dbd3aabfe4d5d593205.js → 0b9c53e01d6ac1e7d5ca.js} +29 -29
- package/assets/esri/core/workers/chunks/1039cd48a12e88baa97a.js +1 -0
- package/assets/esri/core/workers/chunks/{634e7957696f72c8b8b1.js → 3fb4ae8d6e8563a1c255.js} +1 -1
- package/assets/esri/core/workers/chunks/{b61ce04af4e57b1856cb.js → d447ebc944a9867f5a99.js} +1 -1
- package/assets/esri/core/workers/chunks/e3ba96417fd75a5d2feb.js +1 -0
- package/assets/esri/core/workers/chunks/{099765dff2b7e6958d3d.js → efc9030af5aac27055a1.js} +1 -1
- package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_nb.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ar.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_bg.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_bs.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ca.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_cs.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_da.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_de.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_el.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_es.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_et.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_fi.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_fr.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_he.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_hr.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_hu.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_id.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_it.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ja.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ko.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_lt.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_lv.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_nb.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_nl.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_pl.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_pt-BR.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_pt-PT.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ro.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ru.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_sk.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_sl.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_sr.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_sv.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_th.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_tr.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_uk.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_vi.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_zh-CN.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_zh-HK.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_zh-TW.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ar.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_bg.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_bs.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ca.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_cs.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_da.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_de.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_el.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_es.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_et.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_fi.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_fr.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_he.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_hr.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_hu.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_id.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_it.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ja.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ko.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_lt.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_lv.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_nb.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_nl.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_pl.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_pt-BR.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_pt-PT.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ro.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ru.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_sk.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_sl.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_sr.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_sv.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_th.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_tr.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_uk.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_vi.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_zh-CN.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_zh-HK.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_zh-TW.json +1 -1
- package/core/workers/workers.js +1 -1
- package/geometry/support/intersects.js +1 -1
- package/geometry/support/meshUtils/elevation.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/index.js +1 -1
- package/geometry.js +1 -1
- package/interfaces.d.ts +868 -0
- package/intl.js +1 -1
- package/layers/support/ImageParameters.js +1 -1
- package/layers/support/VoxelVariable.js +1 -1
- package/layers/support/VoxelVolumeStyle.js +1 -1
- package/layers/support/domains.js +1 -1
- package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
- package/libs/maquette/projection.js +1 -1
- package/package.json +1 -1
- package/pointCloudRenderers.js +1 -1
- package/popup/content.js +1 -1
- package/rasterRenderers.js +1 -1
- package/renderers.js +1 -1
- package/rest/locator/addressesToLocations.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/unitConversionUtils.js +1 -1
- package/symbols.js +1 -1
- package/views/2d/engine/FeatureContainer.js +1 -1
- package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/GraphicsLayerView2D.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/MapNotesLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/WMSLayerView2D.js +1 -1
- package/views/2d/layers/WMTSLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureStore2D.js +1 -1
- package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
- package/views/2d/layers/features/processors/HeatmapProcessor.js +1 -1
- package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
- package/views/2d/layers/features/schemaUtils.js +1 -1
- package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
- package/views/2d/layers/features/sources/DataTileSource.js +1 -1
- package/views/2d/layers/features/sources/DataTileSubscription.js +1 -1
- package/views/2d/layers/features/sources/GeoEventSource.js +1 -1
- package/views/2d/layers/features/sources/SnapshotFeatureSource.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/rendererUtils.js +1 -1
- package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
- package/views/2d/layers/features/tileRenderers/support/HeatmapSource.js +1 -1
- package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
- package/views/2d/layers/features/tileRenderers/support/visualVariablesUtils.js +1 -1
- package/views/2d/layers/graphics/BaseGraphicContainer.js +1 -1
- package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
- package/views/2d/layers/graphics/graphicsUtils.js +1 -1
- package/views/2d/layers/imagery/ImageryView2D.js +1 -1
- package/views/2d/layers/support/DebugOverlay.js +1 -1
- package/views/2d/layers/support/ExportStrategy.js +1 -1
- package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
- package/views/2d/magnifier/MagnifierView2D.js +1 -1
- package/views/2d/navigation/MapViewNavigation.js +1 -1
- package/views/2d/navigation/ZoomBox.js +1 -1
- package/views/2d/navigation/actions/Pan.js +1 -1
- package/views/2d/navigation/actions/Pinch.js +1 -1
- package/views/2d/tiling/TileManager.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/WMTSLayerView3D.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/QueryEngine.js +1 -1
- package/views/3d/layers/graphics/SpatialIndex2D.js +1 -1
- package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
- package/views/3d/layers/graphics/featureExpressionInfoUtils.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/queryForSymbologySnapping.js +1 -1
- package/views/3d/layers/graphics/symbolComplexity.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/attributeEditing.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DDebugger.js +1 -1
- package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/layers/support/projectExtentUtils.js +1 -1
- package/views/3d/support/PBFDecoderWorker.js +1 -1
- package/views/3d/support/SharedSymbolResources.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/Directions/components/SaveLayer.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTemplates/ItemList.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/ShadowCast/components/Label.js +1 -1
- package/widgets/Slice/SlicePlane.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/assets/esri/core/workers/chunks/7ce1b3056f392cd10031.js +0 -1
- package/assets/esri/core/workers/chunks/fc197a387187daab1df3.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../request.js";import{createTask as r}from"../../../core/asyncUtils.js";import t from"../../../core/Handles.js";import{clamp as s}from"../../../core/mathUtils.js";import{
|
|
5
|
+
import e from"../../../request.js";import{createTask as r}from"../../../core/asyncUtils.js";import t from"../../../core/Handles.js";import{clamp as s}from"../../../core/mathUtils.js";import{destroyMaybe as i,abortMaybe as a,isNone as o,isSome as n,disposeMaybe as l}from"../../../core/maybe.js";import{watch as h,initial as m}from"../../../core/reactiveUtils.js";import{isSVG as u}from"../../../core/urlUtils.js";import{c}from"../../../chunks/mat3f32.js";import{DisplayObject as d}from"../engine/DisplayObject.js";import{Pos2us as _}from"../engine/webgl/DefaultVertexAttributeLayouts.js";import{WGLDrawPhase as p}from"../engine/webgl/enums.js";import{createMagnifierProgram as f,magnifierProgramTemplate as g}from"../engine/webgl/shaders/MagnifierPrograms.js";import{loadMagnifierResources as T}from"../../magnifier/resources.js";import{BufferObject as x}from"../../webgl/BufferObject.js";import{PrimitiveType as b,Usage as R,TextureType as y,PixelFormat as k,PixelType as A,TextureWrapMode as v,TextureSamplingMode as E}from"../../webgl/enums.js";import{Texture as j}from"../../webgl/Texture.js";import{VertexArrayObject as w}from"../../webgl/VertexArrayObject.js";class U extends d{constructor(){super(),this._handles=new t,this._resourcePixelRatio=1,this.visible=!1}destroy(){this._handles=i(this._handles),this._disposeRenderResources(),this._resourcesTask=a(this._resourcesTask)}get background(){return this._background}set background(e){this._background=e,this.requestRender()}get magnifier(){return this._magnifier}set magnifier(e){this._magnifier=e,this._handles.removeAll(),this._handles.add([h((()=>e.version),(()=>{this.visible=e.visible&&n(e.position)&&e.size>0,this.requestRender()}),m),h((()=>[e.maskUrl,e.overlayUrl]),(()=>this._reloadResources())),h((()=>e.size),(()=>{this._disposeRenderResources(),this.requestRender()}))])}_createTransforms(){return{dvs:c()}}doRender(e){const r=e.context;if(!this._resourcesTask)return void this._reloadResources();if(e.drawPhase!==p.MAP||!this._canRender())return;this._updateResources(e);const t=this._magnifier;if(o(t.position))return;const i=e.pixelRatio,a=t.size*i,n=1/t.factor,l=Math.ceil(n*a);this._readbackTexture.resize(l,l);const{size:h}=e.state,m=i*h[0],u=i*h[1],c=.5*l,d=.5*l,_=s(i*t.position.x,c,m-c-1),f=s(u-i*t.position.y,d,u-d-1);r.setBlendingEnabled(!0);const g=_-c,T=f-d,x=this._readbackTexture;r.bindTexture(x,0),r.gl.copyTexImage2D(x.descriptor.target,0,x.descriptor.pixelFormat,g,T,l,l,0);const R=this.background?.color,y=R?[R.a*R.r/255,R.a*R.g/255,R.a*R.b/255,R.a]:[1,1,1,1],k=(_+t.offset.x*i)/m*2-1,A=(f-t.offset.y*i)/u*2-1,v=a/m*2,E=a/u*2,j=this._program;r.bindVAO(this._vertexArrayObject),r.bindTexture(this._overlayTexture,6),r.bindTexture(this._maskTexture,7),r.useProgram(j),j.setUniform4fv("u_background",y),j.setUniform1i("u_readbackTexture",0),j.setUniform1i("u_overlayTexture",6),j.setUniform1i("u_maskTexture",7),j.setUniform4f("u_drawPos",k,A,v,E),j.setUniform1i("u_maskEnabled",t.maskEnabled?1:0),j.setUniform1i("u_overlayEnabled",t.overlayEnabled?1:0),r.setStencilTestEnabled(!1),r.setColorMask(!0,!0,!0,!0),r.drawArrays(b.TRIANGLE_STRIP,0,4),r.bindVAO()}_canRender(){return this.mask&&this.overlay&&null!=this._magnifier}_reloadResources(){this._resourcesTask&&this._resourcesTask.abort();const t=n(this._magnifier)?this._magnifier.maskUrl:null,s=n(this._magnifier)?this._magnifier.overlayUrl:null;this._resourcesTask=r((async r=>{const i=o(t)||o(s)?T(r):null,a=n(t)?e(t,{responseType:"image",signal:r}).then((e=>e.data)):i.then((e=>e.mask)),l=n(s)?e(s,{responseType:"image",signal:r}).then((e=>e.data)):i.then((e=>e.overlay)),[h,m]=await Promise.all([a,l]);this.mask=h,this.overlay=m,this._disposeRenderResources(),this.requestRender()}))}_disposeRenderResources(){this._readbackTexture=l(this._readbackTexture),this._overlayTexture=l(this._overlayTexture),this._maskTexture=l(this._maskTexture),this._vertexArrayObject=l(this._vertexArrayObject),this._program=l(this._program)}_updateResources(e){if(e.pixelRatio!==this._resourcePixelRatio&&this._disposeRenderResources(),this._readbackTexture)return;const r=e.context;this._resourcePixelRatio=e.pixelRatio;const t=Math.ceil(this._magnifier.size*e.pixelRatio);this._program=f(r);const s=new Uint16Array([0,1,0,0,1,1,1,0]),i=g.attributes;this._vertexArrayObject=new w(r,i,_,{geometry:x.createVertex(r,R.STATIC_DRAW,s)}),this.overlay.width=t,this.overlay.height=t,this._overlayTexture=new j(r,{target:y.TEXTURE_2D,pixelFormat:k.RGBA,internalFormat:k.RGBA,dataType:A.UNSIGNED_BYTE,wrapMode:v.CLAMP_TO_EDGE,samplingMode:E.NEAREST,flipped:!0,preMultiplyAlpha:!u(this.overlay.src)||!e.context.driverTest.svgPremultipliesAlpha.result},this.overlay),this.mask.width=t,this.mask.height=t,this._maskTexture=new j(r,{target:y.TEXTURE_2D,pixelFormat:k.ALPHA,internalFormat:k.ALPHA,dataType:A.UNSIGNED_BYTE,wrapMode:v.CLAMP_TO_EDGE,samplingMode:E.NEAREST,flipped:!0},this.mask);const a=1/this._magnifier.factor;this._readbackTexture=new j(r,{target:y.TEXTURE_2D,pixelFormat:k.RGBA,internalFormat:k.RGBA,dataType:A.UNSIGNED_BYTE,wrapMode:v.CLAMP_TO_EDGE,samplingMode:E.LINEAR,flipped:!1,width:Math.ceil(a*t),height:Math.ceil(a*t)})}}export{U as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import i from"../../../Viewpoint.js";import o from"../../../core/Accessor.js";import{
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import i from"../../../Viewpoint.js";import o from"../../../core/Accessor.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../../geometry/Point.js";import{rotateBy as r,translateBy as c,padAndScaleAndRotateBy as h}from"../viewpointUtils.js";import m from"./ZoomBox.js";import p from"./actions/Pan.js";import u from"./actions/Pinch.js";import l from"./actions/Rotate.js";const v=10,w=1,g=new i({targetGeometry:new a}),_=[0,0],d=250;let T=class extends o{constructor(t){super(t),this._endTimer=null,this._lastEventTimestamp=null,this.animationManager=null,this.interacting=!1}initialize(){this.pan=new p({navigation:this}),this.rotate=new l({navigation:this}),this.pinch=new u({navigation:this}),this.zoomBox=new m({view:this.view,navigation:this})}destroy(){this.pan=n(this.pan),this.rotate=n(this.rotate),this.pinch=n(this.pinch),this.zoomBox=n(this.zoomBox),this.animationManager=null}begin(){this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now(),this._startTimer(d)}async zoom(t,i=this._getDefaultAnchor()){if(this.stop(),this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return t<1?this.zoomIn(i):this.zoomOut(i);this.setViewpoint(i,t,0,[0,0])}async zoomIn(t){const i=this.view,o=i.constraints.snapToNextScale(i.scale);return this._zoomToScale(o,t)}async zoomOut(t){const i=this.view,o=i.constraints.snapToPreviousScale(i.scale);return this._zoomToScale(o,t)}setViewpoint(t,i,o,n){this.begin(),this.view.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,t,i,o,n),this.end()}setViewpointImmediate(t,i=0,o=[0,0],n=this._getDefaultAnchor()){this.view.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,n,t,i,o)}continousRotateClockwise(){const t=this.get("view.viewpoint");this.animationManager?.animateContinous(t,(t=>{r(t,t,-w)}))}continousRotateCounterclockwise(){const t=this.get("view.viewpoint");this.animationManager?.animateContinous(t,(t=>{r(t,t,w)}))}resetRotation(){this.view.rotation=0}continousPanLeft(){this._continuousPan([-v,0])}continousPanRight(){this._continuousPan([v,0])}continousPanUp(){this._continuousPan([0,v])}continousPanDown(){this._continuousPan([0,-v])}stop(){this.pan.stopMomentumNavigation(),this.animationManager?.stop(),this.end(),null!==this._endTimer&&(clearTimeout(this._endTimer),this._endTimer=null,this._set("interacting",!1))}_continuousPan(t){const i=this.view.viewpoint;this.animationManager?.animateContinous(i,(i=>{c(i,i,t),this.view.constraints.constrainByGeometry(i)}))}_startTimer(t){return null!==this._endTimer||(this._endTimer=setTimeout((()=>{this._endTimer=null;const t=performance.now()-(this._lastEventTimestamp??0);t<d?this._endTimer=this._startTimer(t):this._set("interacting",!1)}),t)),this._endTimer}_getDefaultAnchor(){const{size:t,padding:{left:i,right:o,top:n,bottom:e}}=this.view;return _[0]=.5*(t[0]-o+i),_[1]=.5*(t[1]-e+n),_}async _zoomToScale(t,i=this._getDefaultAnchor()){const{view:o}=this,{constraints:n,scale:e,viewpoint:s,size:a,padding:r}=o,c=n.canZoomInTo(t),m=n.canZoomOutTo(t);if(!(t<e&&!c||t>e&&!m))return h(g,s,t/e,0,i,a,r),n.constrainByGeometry(g),o.goTo(g,{animate:!0})}_scaleRotateTranslateViewpoint(t,i,o,n,e){const{view:s}=this,{size:a,padding:r,constraints:m,scale:p,viewpoint:u}=s,l=p*o,v=m.canZoomInTo(l),w=m.canZoomOutTo(l);return(o<1&&!v||o>1&&!w)&&(o=1),c(u,u,e),h(t,u,o,n,i,a,r),m.constrainByGeometry(t)}};t([e()],T.prototype,"animationManager",void 0),t([e({type:Boolean,readOnly:!0})],T.prototype,"interacting",void 0),t([e()],T.prototype,"pan",void 0),t([e()],T.prototype,"pinch",void 0),t([e()],T.prototype,"rotate",void 0),t([e()],T.prototype,"view",void 0),t([e()],T.prototype,"zoomBox",void 0),T=t([s("esri.views.2d.navigation.MapViewNavigation")],T);const y=T;export{y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{createScreenPoint as i}from"../../../core/screenUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{ViewEventPriorities as o}from"../../input/InputManager.js";const a="esri-zoom-box",n={container:`${a}__container`,overlay:`${a}__overlay`,background:`${a}__overlay-background`,box:`${a}__outline`},h={zoom:"Shift",counter:"Ctrl"};let l=class extends e{constructor(t){super(t),this._container=null,this._overlay=null,this._backgroundShape=null,this._boxShape=null,this._box={x:0,y:0,width:0,height:0},this._redraw=this._redraw.bind(this)}destroy(){this.view=null}set view(t){this._handles&&this._handles.forEach((t=>{t.remove()})),this._handles=null,this._destroyOverlay(),this._set("view",t),t&&(t.on("drag",[h.zoom],(t=>this._handleDrag(t,1)),o.INTERNAL),t.on("drag",[h.zoom,h.counter],(t=>this._handleDrag(t,-1)),o.INTERNAL))}_start(){this._createContainer(),this._createOverlay(),this.navigation.begin()}_update(t,e,i,r){this._box.x=t,this._box.y=e,this._box.width=i,this._box.height=r,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(t,e,r,s,o){const a=this.view,n=a.toMap(i(t+.5*r,e+.5*s));let h=Math.max(r/a.width,s/a.height);-1===o&&(h=1/h),this._destroyOverlay(),this.navigation.end(),a.goTo({center:n,scale:a.scale*h})}_updateBox(t,e,i,r){const s=this._boxShape;s.setAttributeNS(null,"x",""+t),s.setAttributeNS(null,"y",""+e),s.setAttributeNS(null,"width",""+i),s.setAttributeNS(null,"height",""+r),s.setAttributeNS(null,"class",n.box)}_updateBackground(t,e,i,r){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(t,e,i,r,this.view.width,this.view.height))}_createContainer(){const t=document.createElement("div");t.className=n.container,this.view.root.appendChild(t),this._container=t}_createOverlay(){const t=this.view.width,e=this.view.height,i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M 0 0 L "+t+" 0 L "+t+" "+e+" L 0 "+e+" Z"),i.setAttributeNS(null,"class",n.background);const r=document.createElementNS("http://www.w3.org/2000/svg","rect"),s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),s.setAttributeNS(null,"class",n.overlay),s.appendChild(i),s.appendChild(r),this._container.appendChild(s),this._backgroundShape=i,this._boxShape=r,this._overlay=s}_destroyOverlay(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=this._backgroundShape=this._boxShape=this._overlay=null}_toSVGPath(t,e,i,r,s,o){const a=t+i,n=e+r;return"M 0 0 L "+s+" 0 L "+s+" "+o+" L 0 "+o+" ZM "+t+" "+e+" L "+t+" "+n+" L "+a+" "+n+" L "+a+" "+e+" Z"}_handleDrag(t,e){const i=t.x,r=t.y,s=t.origin.x,o=t.origin.y;let a,n,h,l;switch(i>s?(a=s,h=i-s):(a=i,h=s-i),r>o?(n=o,l=r-o):(n=r,l=o-r),t.action){case"start":this._start();break;case"update":this._update(a,n,h,l);break;case"end":this._end(a,n,h,l,e)}t.stopPropagation()}_redraw(){if(!this._rafId)return;if(this._rafId=null,!this._overlay)return;const{x:t,y:e,width:i,height:r}=this._box;this._updateBox(t,e,i,r),this._updateBackground(t,e,i,r),this._rafId=requestAnimationFrame(this._redraw)}};t([r()],l.prototype,"navigation",void 0),t([r()],l.prototype,"view",null),l=t([s("esri.views.2d.navigation.ZoomBox")],l);const c=l;export{c as default};
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{createScreenPoint as i}from"../../../core/screenUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{ViewEventPriorities as o}from"../../input/InputManager.js";const a="esri-zoom-box",n={container:`${a}__container`,overlay:`${a}__overlay`,background:`${a}__overlay-background`,box:`${a}__outline`},h={zoom:"Shift",counter:"Ctrl"};let l=class extends e{constructor(t){super(t),this._container=null,this._overlay=null,this._backgroundShape=null,this._boxShape=null,this._box={x:0,y:0,width:0,height:0},this._rafId=null,this._handles=null,this._redraw=this._redraw.bind(this)}destroy(){this.view=null}set view(t){this._handles&&this._handles.forEach((t=>{t.remove()})),this._handles=null,this._destroyOverlay(),this._set("view",t),t&&(t.on("drag",[h.zoom],(t=>this._handleDrag(t,1)),o.INTERNAL),t.on("drag",[h.zoom,h.counter],(t=>this._handleDrag(t,-1)),o.INTERNAL))}_start(){this._createContainer(),this._createOverlay(),this.navigation.begin()}_update(t,e,i,r){this._box.x=t,this._box.y=e,this._box.width=i,this._box.height=r,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(t,e,r,s,o){const a=this.view,n=a.toMap(i(t+.5*r,e+.5*s));let h=Math.max(r/a.width,s/a.height);-1===o&&(h=1/h),this._destroyOverlay(),this.navigation.end(),a.goTo({center:n,scale:a.scale*h})}_updateBox(t,e,i,r){const s=this._boxShape;s.setAttributeNS(null,"x",""+t),s.setAttributeNS(null,"y",""+e),s.setAttributeNS(null,"width",""+i),s.setAttributeNS(null,"height",""+r),s.setAttributeNS(null,"class",n.box)}_updateBackground(t,e,i,r){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(t,e,i,r,this.view.width,this.view.height))}_createContainer(){const t=document.createElement("div");t.className=n.container,this.view.root.appendChild(t),this._container=t}_createOverlay(){const t=this.view.width,e=this.view.height,i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M 0 0 L "+t+" 0 L "+t+" "+e+" L 0 "+e+" Z"),i.setAttributeNS(null,"class",n.background);const r=document.createElementNS("http://www.w3.org/2000/svg","rect"),s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),s.setAttributeNS(null,"class",n.overlay),s.appendChild(i),s.appendChild(r),this._container.appendChild(s),this._backgroundShape=i,this._boxShape=r,this._overlay=s}_destroyOverlay(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=this._backgroundShape=this._boxShape=this._overlay=null}_toSVGPath(t,e,i,r,s,o){const a=t+i,n=e+r;return"M 0 0 L "+s+" 0 L "+s+" "+o+" L 0 "+o+" ZM "+t+" "+e+" L "+t+" "+n+" L "+a+" "+n+" L "+a+" "+e+" Z"}_handleDrag(t,e){const i=t.x,r=t.y,s=t.origin.x,o=t.origin.y;let a,n,h,l;switch(i>s?(a=s,h=i-s):(a=i,h=s-i),r>o?(n=o,l=r-o):(n=r,l=o-r),t.action){case"start":this._start();break;case"update":this._update(a,n,h,l);break;case"end":this._end(a,n,h,l,e)}t.stopPropagation()}_redraw(){if(!this._rafId)return;if(this._rafId=null,!this._overlay)return;const{x:t,y:e,width:i,height:r}=this._box;this._updateBox(t,e,i,r),this._updateBackground(t,e,i,r),this._rafId=requestAnimationFrame(this._redraw)}};t([r()],l.prototype,"navigation",void 0),t([r()],l.prototype,"view",null),l=t([s("esri.views.2d.navigation.ZoomBox")],l);const c=l;export{c as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import i from"../../../../Viewpoint.js";import o from"../../../../core/Accessor.js";import{when as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import i from"../../../../Viewpoint.js";import o from"../../../../core/Accessor.js";import{when as e}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as s}from"../../../../core/screenUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{g as r}from"../../../../chunks/vec3.js";import{c as a,f as p}from"../../../../chunks/vec3f64.js";import{translateBy as c}from"../../viewpointUtils.js";import{PanPlanarMomentumEstimator as u}from"../../../navigation/PanPlanarMomentumEstimator.js";import h from"../../../../geometry/Point.js";let v=class extends o{constructor(t){super(t),this.animationTime=0,this.momentumEstimator=new u(500,6,.92),this.momentum=null,this.tmpMomentum=a(),this.momentumFinished=!1,this.viewpoint=new i({targetGeometry:new h,scale:0,rotation:0}),this._previousDrag=null,e((()=>this.momentumFinished),(()=>this.navigation.stop()))}begin(t,i){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(i),this._previousDrag=i}update(t,i){this.addToEstimator(i);let o=i.center.x,e=i.center.y;const s=this._previousDrag;o=s?s.center.x-o:-o,e=s?e-s.center.y:e,t.viewpoint=c(this.viewpoint,t.viewpoint,[o||0,e||0]),this._previousDrag=i}end(t,i){this.addToEstimator(i);const o=t.navigation.momentumEnabled;this.momentum=o?this.momentumEstimator.evaluateMomentum():null,this.animationTime=0,this.momentum&&this.onAnimationUpdate(t),this._previousDrag=null,this.navigation.end()}addToEstimator(t){const i=t.center.x,o=t.center.y,e=s(-i,o),n=p(-i,o,0);this.momentumEstimator.add(e,n,.001*t.timestamp)}onAnimationUpdate(t){this.navigation.animationManager?.animateContinous(t.viewpoint,((i,o)=>{const{momentum:e,animationTime:s,tmpMomentum:n}=this,m=.001*o;if(!(this.momentumFinished=!e||e.isFinished(s))){const o=e.valueDelta(s,m);r(n,e.direction,o),c(i,i,n),t.constraints.constrainByGeometry(i)}this.animationTime+=m}))}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};t([n()],v.prototype,"momentumFinished",void 0),t([n()],v.prototype,"viewpoint",void 0),t([n()],v.prototype,"navigation",void 0),v=t([m("esri.views.2d.navigation.actions.Pan")],v);const d=v;export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import o from"../../../../Viewpoint.js";import i from"../../../../core/Accessor.js";import{when as s}from"../../../../core/reactiveUtils.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{s as m,j as a}from"../../../../chunks/vec2.js";import{a as r}from"../../../../chunks/vec2f64.js";import{getPaddingScreenTranslation as h,scaleAndRotateBy as u}from"../../viewpointUtils.js";import{RotationMomentumEstimator as p}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import o from"../../../../Viewpoint.js";import i from"../../../../core/Accessor.js";import{when as s}from"../../../../core/reactiveUtils.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{s as m,j as a}from"../../../../chunks/vec2.js";import{a as r}from"../../../../chunks/vec2f64.js";import{getPaddingScreenTranslation as h,scaleAndRotateBy as u}from"../../viewpointUtils.js";import{RotationMomentumEstimator as p}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as l}from"../../../navigation/ZoomMomentumEstimator.js";import c from"../../../../geometry/Point.js";let _=class extends i{constructor(t){super(t),this._animationTime=0,this._momentumFinished=!1,this._previousAngle=0,this._previousRadius=0,this._previousCenter=null,this._rotationMomentumEstimator=new p(.6,.15,.95),this._rotationDirection=1,this._startAngle=0,this._startRadius=0,this._updateTimestamp=null,this._zoomDirection=1,this._zoomMomentumEstimator=new l,this._zoomOnly=null,this.zoomMomentum=null,this.rotateMomentum=null,this.viewpoint=new o({targetGeometry:new c,scale:0,rotation:0}),this.addHandles(s((()=>this._momentumFinished),(()=>this.navigation.stop())))}begin(t,o){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=o.angle,this._previousRadius=this._startRadius=o.radius,this._previousCenter=o.center,this._updateTimestamp=null,t.constraints.rotationEnabled&&this.addToRotateEstimator(0,o.timestamp),this.addToZoomEstimator(o,1)}update(t,o){null===this._updateTimestamp&&(this._updateTimestamp=o.timestamp);const i=o.angle,s=o.radius,e=o.center,n=Math.abs(180*(i-this._startAngle)/Math.PI),m=Math.abs(s-this._startRadius),a=this._startRadius/s;if(this._previousRadius&&this._previousCenter){const r=s/this._previousRadius;let h=180*(i-this._previousAngle)/Math.PI;this._rotationDirection=h>=0?1:-1,this._zoomDirection=r>=1?1:-1,t.constraints.rotationEnabled?(null===this._zoomOnly&&o.timestamp-this._updateTimestamp>200&&(this._zoomOnly=m-n>0),null===this._zoomOnly||this._zoomOnly?h=0:this.addToRotateEstimator(i-this._startAngle,o.timestamp)):h=0,this.addToZoomEstimator(o,a),this.navigation.setViewpoint([e.x,e.y],1/r,h,[this._previousCenter.x-e.x,e.y-this._previousCenter.y])}this._previousAngle=i,this._previousRadius=s,this._previousCenter=e}end(t){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(t),this.navigation.end()}addToRotateEstimator(t,o){this._rotationMomentumEstimator.add(t,.001*o)}addToZoomEstimator(t,o){this._zoomMomentumEstimator.add(o,.001*t.timestamp)}canZoomIn(t){const o=t.scale,i=t.constraints.effectiveMaxScale;return 0===i||o>i}canZoomOut(t){const o=t.scale,i=t.constraints.effectiveMinScale;return 0===i||o<i}onAnimationUpdate(t){this.navigation.animationManager?.animateContinous(t.viewpoint,((o,i)=>{const s=!this.canZoomIn(t)&&this._zoomDirection>1||!this.canZoomOut(t)&&this._zoomDirection<1,e=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),n=s||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),p=.001*i;if(this._momentumFinished=e&&n,!this._momentumFinished){const i=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,p))*this._rotationDirection*180/Math.PI:0;let s=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,p)):1;const e=r(),n=r();if(this._previousCenter){m(e,this._previousCenter.x,this._previousCenter.y),h(n,t.size,t.padding),a(e,e,n);const{constraints:r,scale:p}=t,l=p*s;s<1&&!r.canZoomInTo(l)?(s=p/r.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):s>1&&!r.canZoomOutTo(l)&&(s=p/r.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),u(o,t.viewpoint,s,i,e,t.size),t.constraints.constrainByGeometry(o)}}this._animationTime+=p}))}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};t([e()],_.prototype,"_momentumFinished",void 0),t([e()],_.prototype,"viewpoint",void 0),t([e()],_.prototype,"navigation",void 0),_=t([n("esri.views.2d.navigation.actions.Pinch")],_);const d=_;export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../../../core/maybe.js";import i from"./TileCoverage.js";import t from"./TileKey.js";const s=1e-6;class l{constructor(e){this._tiles=new Map,this.buffer=0,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,this.buffer=e.buffer}destroy(){}clear(){this._tiles.forEach((e=>this._releaseTile(e)))}tileKeys(){const e=[];return this._tiles.forEach(((i,t)=>e.push(t))),e}update(e){const s=this.tileInfoView.getTileCoverage(e.state,this.buffer,"closest"),{spans:l,lodInfo:r}=s,{level:a}=r,o=[],d=[],h=new Set,n=new Set;for(const{row:i,colFrom:c,colTo:f}of l)for(let e=c;e<=f;e++){const s=t.getId(a,i,r.normalizeCol(e),r.getWorldForColumn(e)),l=this._getOrAcquireTile(o,s);h.add(s),l.isReady?l.visible=!0:n.add(l.key)}n.forEach((e=>this._addPlaceholders(h,e))),this._tiles.forEach((e=>{h.has(e.key.id)||(d.push(e.key.id),this._releaseTile(e))})),i.pool.release(s);return{hasMissingTiles:n.size>0,added:o,removed:d}}_getOrAcquireTile(e,i){if(!this._tiles.has(i)){const s=this.acquireTile(new t(i));e.push(i),this._tiles.set(i,s),s.visible=!1}return this._tiles.get(i)}_getTile(e){return this._tiles.get(e)}_releaseTile(e){this._tiles.delete(e.key.id),this.releaseTile(e)}_addPlaceholders(e,i){const t=this._addPlaceholderChildren(e,i);if(!(Math.abs(1-t)<s)){if(!this._addPlaceholderParent(e,i)){this._getTile(i.id).visible=!0}}}_addPlaceholderChildren(e,i){let t=0;return this._tiles.forEach((s=>{t+=this._addPlaceholderChild(e,s,i)})),t}_addPlaceholderChild(e,i,t){if(i.key.level<=t.level||!i.hasData||!t.contains(i.key))return 0;i.visible=!0,e.add(i.key.id);return 1/(1<<2*(i.key.level-t.level))}_addPlaceholderParent(i,t){let s=t.getParentKey(),l=0,r=null;for(;e(s);){if(i.has(s.id))return!0;const e=this._getTile(s.id);if(e?.isReady){for(const e of i){const i=this._getTile(e);s.contains(i.key)&&(i.visible=!1)}return e.visible=!0,i.add(e.key.id),!0}e?.hasData&&e.patchCount>l&&(l=e.patchCount,r=e),s=s.getParentKey()}return!!r&&(r.visible=!0,i.add(r.key.id),!0)}}export{l as TileManager};
|
|
5
|
+
import{isSome as e}from"../../../core/maybe.js";import i from"./TileCoverage.js";import t from"./TileKey.js";const s=1e-6;class l{constructor(e){this._tiles=new Map,this.buffer=0,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,this.buffer=e.buffer}destroy(){}clear(){this._tiles.forEach((e=>this._releaseTile(e)))}tileKeys(){const e=[];return this._tiles.forEach(((i,t)=>e.push(t))),e}update(e){const s=this.tileInfoView.getTileCoverage(e.state,this.buffer,"closest"),{spans:l,lodInfo:r}=s,{level:a}=r,o=[],d=[],h=new Set,n=new Set;for(const{row:i,colFrom:c,colTo:f}of l)for(let e=c;e<=f;e++){const s=t.getId(a,i,r.normalizeCol(e),r.getWorldForColumn(e)),l=this._getOrAcquireTile(o,s);h.add(s),l.isReady?l.visible=!0:n.add(l.key)}n.forEach((e=>this._addPlaceholders(h,e))),this._tiles.forEach((e=>{h.has(e.key.id)||(d.push(e.key.id),this._releaseTile(e))})),i.pool.release(s);return{hasMissingTiles:n.size>0,added:o,removed:d}}_getOrAcquireTile(e,i){if(!this._tiles.has(i)){const s=this.acquireTile(new t(i));e.push(i),this._tiles.set(i,s),s.visible=!1}return this._tiles.get(i)}_getTile(e){return this._tiles.get(e)}_releaseTile(e){this._tiles.delete(e.key.id),this.releaseTile(e)}_addPlaceholders(e,i){const t=this._addPlaceholderChildren(e,i);if(!(Math.abs(1-t)<s)){if(!this._addPlaceholderParent(e,i)){this._getTile(i.id).visible=!0}}}_addPlaceholderChildren(e,i){let t=0;return this._tiles.forEach((s=>{t+=this._addPlaceholderChild(e,s,i)})),t}_addPlaceholderChild(e,i,t){if(i.key.level<=t.level||!i.hasData||!t.contains(i.key))return 0;i.visible=!0,e.add(i.key.id);return 1/(1<<2*(i.key.level-t.level))}_addPlaceholderParent(i,t){let s=t.getParentKey(),l=0,r=null;for(;e(s);){if(i.has(s.id))return!0;const e=this._getTile(s.id);if(e?.isReady){for(const e of i){const i=this._getTile(e);i&&s.contains(i.key)&&(i.visible=!1)}return e.visible=!0,i.add(e.key.id),!0}e?.hasData&&e.patchCount>l&&(l=e.patchCount,r=e),s=s.getParentKey()}return!!r&&(r.visible=!0,i.add(r.key.id),!0)}}export{l as TileManager};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import i from"../../../core/Accessor.js";import{destroyMaybe as e,unwrapOr as a}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as n}from"../../../properties/defaultUnit.js";import{AnalysisView3D as o}from"./AnalysisView3D.js";import{MeasurementMode as r}from"./interfaces.js";import{DirectLineMeasurementController as u}from"./DirectLineMeasurement/DirectLineMeasurementController.js";import{DirectLineMeasurementVisualization as p}from"./DirectLineMeasurement/DirectLineMeasurementVisualization.js";let y=class extends(o(i)){constructor(t){super(t),this.type="direct-line-measurement-view-3d",this.analysis=null,this.result=null,this.measurementMode=r.Auto,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null}initialize(){const t=this.view,i=this.analysis;this._analysisVisualization=new p({view:t,analysis:i,analysisView:this}),this._analysisController=new u({view:t,analysis:i,viewData:this})}destroy(){this._analysisController=e(this._analysisController),this._analysisVisualization=e(this._analysisVisualization)}get updating(){return!!this._analysisVisualization?.loadingMessages}get viewMode(){return this._analysisVisualization.viewMode}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(t){this._analysisVisualization.visualElementOrientation=t}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(t){this._analysisVisualization.allowVisualElementsOrientationChange=t}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(t){this._analysisVisualization.triangleCollapseRatioThreshold=t}get directLabelText(){return this._analysisVisualization.labels.direct
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import i from"../../../core/Accessor.js";import{destroyMaybe as e,unwrapOr as a}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as n}from"../../../properties/defaultUnit.js";import{AnalysisView3D as o}from"./AnalysisView3D.js";import{MeasurementMode as r}from"./interfaces.js";import{DirectLineMeasurementController as u}from"./DirectLineMeasurement/DirectLineMeasurementController.js";import{DirectLineMeasurementVisualization as p}from"./DirectLineMeasurement/DirectLineMeasurementVisualization.js";let y=class extends(o(i)){constructor(t){super(t),this.type="direct-line-measurement-view-3d",this.analysis=null,this.result=null,this.measurementMode=r.Auto,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null}initialize(){const t=this.view,i=this.analysis;this._analysisVisualization=new p({view:t,analysis:i,analysisView:this}),this._analysisController=new u({view:t,analysis:i,viewData:this})}destroy(){this._analysisController=e(this._analysisController),this._analysisVisualization=e(this._analysisVisualization)}get updating(){return!!this._analysisVisualization?.loadingMessages}get viewMode(){return this._analysisVisualization.viewMode}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(t){this._analysisVisualization.visualElementOrientation=t}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(t){this._analysisVisualization.allowVisualElementsOrientationChange=t}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(t){this._analysisVisualization.triangleCollapseRatioThreshold=t}get directLabelText(){return this._analysisVisualization.labels.direct?.text??""}get horizontalLabelText(){return this._analysisVisualization.labels.horizontal?.text??""}get verticalLabelText(){return this._analysisVisualization.labels.vertical?.text??""}get unit(){return a(this.analysis.unit,this._defaultUnit)}get testData(){return this.destroyed?{labels:null,stripeLength:null,visualization:null,controller:null}:{...this._analysisVisualization?.testData,visualization:this._analysisVisualization,controller:this._analysisController}}};t([s()],y.prototype,"updating",null),t([s({readOnly:!0})],y.prototype,"type",void 0),t([s({constructOnly:!0,nonNullable:!0})],y.prototype,"analysis",void 0),t([s()],y.prototype,"result",void 0),t([s()],y.prototype,"measurementMode",void 0),t([s()],y.prototype,"elevationAlignedStartPoint",void 0),t([s()],y.prototype,"elevationAlignedEndPoint",void 0),t([s({readOnly:!0})],y.prototype,"viewMode",null),t([s({readOnly:!0})],y.prototype,"actualVisualizedMeasurement",null),t([s()],y.prototype,"visualElementOrientation",null),t([s()],y.prototype,"allowVisualElementsOrientationChange",null),t([s()],y.prototype,"triangleCollapseRatioThreshold",null),t([s({readOnly:!0})],y.prototype,"directLabelText",null),t([s({readOnly:!0})],y.prototype,"horizontalLabelText",null),t([s({readOnly:!0})],y.prototype,"verticalLabelText",null),t([s()],y.prototype,"_analysisVisualization",void 0),t([s()],y.prototype,"_analysisController",void 0),t([s()],y.prototype,"unit",null),t([s(n)],y.prototype,"_defaultUnit",void 0),y=t([l("esri.views.3d.analysis.DirectLineMeasurementAnalysisView3D")],y);const h=y;export{h as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{destroyMaybe as r,isNone as s,isSome as o}from"../../../core/maybe.js";import{watch as i,initial as a,when as l,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGeometry as c}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as m}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import{FeatureLikeLayerView3D as h}from"./FeatureLikeLayerView3D.js";import{LayerView3D as d}from"./LayerView3D.js";import{FeatureTileFetcher3DLayerViewContext as y}from"./support/FeatureTileFetcher3DLayerViewContext.js";import{EventedSet as f}from"../support/EventedSet.js";import{updatingProgress as g}from"../support/updatingProperties.js";import{UpdatePolicy as F}from"../webgl-engine/lib/basicInterfaces.js";import x from"../../layers/FeatureLayerView.js";import b from"../../layers/LayerView.js";import M from"../../layers/RefreshableLayerView.js";let _=class extends(M(h(x(d(b))))){constructor(e){super(e),this._controllerTotal=0,this._processorTotal=0,this.suspendResumeExtentMode="data"}initialize(){this.handles.add(i((()=>this._updatingRequiredFieldsPromise),(e=>this.updatingHandles.addPromise(e)),n))}destroy(){this.updatingHandles.removeAll(),this.handles.removeAll(),this._fetcherContext=r(this._fetcherContext)}get maximumNumberOfFeatures(){return this.controller?.maximumNumberOfFeatures??this._get("maximumNumberOfFeatures")}set maximumNumberOfFeatures(e){this._set("maximumNumberOfFeatures",e),this.controller&&(this.controller.maximumNumberOfFeatures=e)}get maximumNumberOfFeaturesExceeded(){return!!this.controller&&!(this.suspended||!this.controller.maximumNumberOfFeaturesExceeded)}get updatingProgressValue(){let e=0;if(this.controller?.updating){const t=this.controller.updatingRemaining,r=Math.max(this.controller.updatingTotal,this._controllerTotal);r>0&&(e=(r-t)/r,this._controllerTotal=r)}let t=0;if(this.processor?.updating){const e=this.processor.updatingRemaining,r=Math.max(e,this._processorTotal);r>0&&(t=(r-e)/r,this._processorTotal=r)}return.5*(e+t)}get updatePolicy(){if(!this.controller)return F.ASYNC;switch(this.controller.mode){case"snapshot":{const e=
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{destroyMaybe as r,isNone as s,isSome as o}from"../../../core/maybe.js";import{watch as i,initial as a,when as l,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGeometry as c}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as m}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import{FeatureLikeLayerView3D as h}from"./FeatureLikeLayerView3D.js";import{LayerView3D as d}from"./LayerView3D.js";import{FeatureTileFetcher3DLayerViewContext as y}from"./support/FeatureTileFetcher3DLayerViewContext.js";import{EventedSet as f}from"../support/EventedSet.js";import{updatingProgress as g}from"../support/updatingProperties.js";import{UpdatePolicy as F}from"../webgl-engine/lib/basicInterfaces.js";import x from"../../layers/FeatureLayerView.js";import b from"../../layers/LayerView.js";import M from"../../layers/RefreshableLayerView.js";let _=class extends(M(h(x(d(b))))){constructor(e){super(e),this._controllerTotal=0,this._processorTotal=0,this.suspendResumeExtentMode="data"}initialize(){this.handles.add(i((()=>this._updatingRequiredFieldsPromise),(e=>this.updatingHandles.addPromise(e)),n))}destroy(){this.updatingHandles.removeAll(),this.handles.removeAll(),this._fetcherContext=r(this._fetcherContext)}get maximumNumberOfFeatures(){return this.controller?.maximumNumberOfFeatures??this._get("maximumNumberOfFeatures")}set maximumNumberOfFeatures(e){this._set("maximumNumberOfFeatures",e),this.controller&&(this.controller.maximumNumberOfFeatures=e)}get maximumNumberOfFeaturesExceeded(){return!!this.controller&&!(this.suspended||!this.controller.maximumNumberOfFeaturesExceeded)}get updatingProgressValue(){let e=0;if(this.controller?.updating){const t=this.controller.updatingRemaining,r=Math.max(this.controller.updatingTotal,this._controllerTotal);r>0&&(e=(r-t)/r,this._controllerTotal=r)}let t=0;if(this.processor?.updating){const e=this.processor.updatingRemaining,r=Math.max(e,this._processorTotal);r>0&&(t=(r-e)/r,this._processorTotal=r)}return.5*(e+t)}get updatePolicy(){if(!this.controller)return F.ASYNC;switch(this.controller.mode){case"snapshot":{const e=v[this.layer.geometryType];return null==e||this.controller.serviceDataCount>e?F.ASYNC:F.SYNC}case"tiles":return F.ASYNC}}get hasZ(){const e=this.layer,t=e.capabilities&&e.capabilities.data;return!(!t||!t.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:t.supportsZ)}get hasM(){const e=this.layer,t=e.capabilities&&e.capabilities.data;return!(!t||!t.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}setVisibility(e,t){this.processor?.setObjectIdVisibility(e,t)}createQuery(){return super.createQuery()}queryFeatures(e,t){const r=()=>super.queryFeatures(e,t);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),r):r()}beforeSetController(e){e.maximumNumberOfFeatures=this.maximumNumberOfFeatures}createController(){this._fetcherContext=new y({layerView:this,returnZ:this.hasZ,returnM:this.hasM});const e=new m({layerView:this,context:this._fetcherContext,graphics:new f,extent:this.clippingExtent});return this.updatingHandles.add((()=>e.serviceDataExtent),(e=>{this.processor&&(this.processor.dataExtent=e)}),a),this.handles.add(i((()=>this.suspended),(t=>{t?e.suspend():e.resume()}),n)),this.updatingHandles.add((()=>this.processor?.displayFeatureLimit),(t=>e.displayFeatureLimit=t),a),this.handles.add(l((()=>!this.updating),(()=>{this._controllerTotal=0,this._processorTotal=0}))),e}async doRefresh(e){e&&!this.suspended&&this.controller&&this.controller.refetch(),this.processor.refreshFilter()}getUsedMemory(){return(this.processor?.usedMemory??0)+(this.controller?.memoryForUnusedFeatures??0)}getUnloadedMemory(){const e=this.processor?.unprocessedMemoryEstimate??0,t=this.controller?.expectedFeatureDiff??0,r=this.processor?.loadedFeatures??0,s=r/(r+t);return e+t*(this.processor?.usedMemoryPerFeature??0)*s}ignoresMemoryFactor(){return this.controller?.hasMaximumNumberOfFeaturesOverride}async _queryFeaturesMesh(e,t){await this._validateQueryFeaturesMesh(e);const r=await t();if(e&&e.outStatistics||s(this.graphics3DProcessor))return r;const o=this.layer.objectIdField,i=this.graphics3DProcessor.graphics3DGraphicsByObjectID,a=[];for(const s of r.features)if(s.geometry){const e=i.get(s.attributes[o]);e&&(s.geometry=c(e.graphic.geometry),a.push(s))}else a.push(s);return r.features=a,r}async _validateQueryFeaturesMesh(e){if(!e)return;const r=e=>{throw new t("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},s=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const t of s)null!=e[t]&&r(t);"returnM"in e&&e.returnM&&r("returnM"),"returnCentroid"in e&&e.returnCentroid&&r("returnCentroid"),o(e.outSpatialReference)&&!e.outSpatialReference.equals(this.view.spatialReference)&&r("outSpatialReference")}get performanceInfo(){const e=this.controller?.displayFeatureLimit,t=o(e)?e.averageSymbolComplexity:void 0,r=o(t)?`f:${t.primitivesPerFeature},v:${t.primitivesPerCoordinate}`:"n/a",s={...this._getResourceInfo(),storedFeatures:0,totalVertices:0,partial:this.maximumNumberOfFeaturesExceeded,mode:this.controller?.mode??"n/a",symbolComplexity:r,nodes:this.controller?.tileDescriptors.length??0};if(this.controller&&s.displayedNumberOfFeatures){const e=this.controller.debug;s.storedFeatures=e.storedFeatures,s.totalVertices=e.totalVertices}return s}get test(){return{updatePolicy:this.updatePolicy,controller:this.controller,loadedGraphics:this.controller?.graphics}}};e([u()],_.prototype,"layer",void 0),e([u()],_.prototype,"controller",void 0),e([u()],_.prototype,"_controllerTotal",void 0),e([u()],_.prototype,"_processorTotal",void 0),e([u()],_.prototype,"maximumNumberOfFeatures",null),e([u()],_.prototype,"maximumNumberOfFeaturesExceeded",null),e([u(g)],_.prototype,"updatingProgress",void 0),e([u({readOnly:!0})],_.prototype,"updatingProgressValue",null),e([u({readOnly:!0})],_.prototype,"updatePolicy",null),e([u({readOnly:!0})],_.prototype,"hasZ",null),e([u({readOnly:!0})],_.prototype,"hasM",null),e([u()],_.prototype,"suspendResumeExtentMode",void 0),_=e([p("esri.views.3d.layers.FeatureLayerViewBase3D")],_);const v={point:5e3,polygon:500,polyline:1e3},O=_;export{O as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{destroyMaybe as t,isNone as s,get as o}from"../../../core/maybe.js";import{initial as i,whenOnce as n}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as p}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as c}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import u from"../../../rest/support/Query.js";import{symbolHasExtrudeSymbolLayer as h}from"../../../symbols/support/utils.js";import{elevationAlignPointsInFeatures as d}from"./graphics/elevationAlignPointsInFeatures.js";import y from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as g}from"./graphics/QueryEngine.js";import{queryForSymbologySnapping as m}from"./graphics/queryForSymbologySnapping.js";import{HeatmapFeatureProcessor as f}from"./support/HeatmapFeatureProcessor.js";import{toViewIfLocal as b}from"./support/projectExtentUtils.js";import{UpdatePolicy as E}from"../webgl-engine/lib/basicInterfaces.js";import{TaskPriority as v}from"../../support/Scheduler.js";const w=w=>{let _=class extends w{constructor(){super(...arguments),this.controller=null,this.updatePolicy=E.SYNC,this.suspendResumeExtentMode="computed",this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.suspendResumeExtent=null,this._controllerCreated=!1,this.supportsHeightUnitConversion=!0,this._pendingController=null,this.queryEngine=null}initialize(){const e=this.layer;if("isTable"in e&&e.isTable)return void this.addResolvingPromise(Promise.reject(new r("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e})));this.addResolvingPromise(this._validateGeometryType()),this.updatingHandles.add((()=>this.layer.renderer),(e=>this._recreateProcessor(e)),i),this.addResolvingPromise((async()=>{const e=await b(this);this.fullExtentInLocalViewSpatialReference=e,await this._initializeController()})()),this.updatingHandles.add((()=>this.updatePolicy),(e=>this.processor.preferredUpdatePolicy=e));const t=()=>this.processor.featureStore;this.queryEngine=new g({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return t()},hasZ:this.hasZ,hasM:this.hasM},priority:v.FEATURE_QUERY_ENGINE}),this.notifyChange("updating")}destroy(){this._destroyPendingController(),this.controller=t(this.controller),this._set("processor",t(this.processor)),this.queryEngine=t(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this._pendingController=t(this._pendingController)}get legendEnabled(){return this.canResume()&&this.processor?.legendEnabled}get graphics3DProcessor(){return"graphics-3d"===this.processor?.type?this.processor:null}get heatmapProcessor(){return"heatmap"===this.processor?.type?this.processor:null}get symbologySnappingSupported(){const e=this.layer?.renderer?.getSymbols();return e?.some(h)??!1}getHit(e){let r
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{destroyMaybe as t,isNone as s,get as o}from"../../../core/maybe.js";import{initial as i,whenOnce as n}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as p}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as c}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import u from"../../../rest/support/Query.js";import{symbolHasExtrudeSymbolLayer as h}from"../../../symbols/support/utils.js";import{elevationAlignPointsInFeatures as d}from"./graphics/elevationAlignPointsInFeatures.js";import y from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as g}from"./graphics/QueryEngine.js";import{queryForSymbologySnapping as m}from"./graphics/queryForSymbologySnapping.js";import{HeatmapFeatureProcessor as f}from"./support/HeatmapFeatureProcessor.js";import{toViewIfLocal as b}from"./support/projectExtentUtils.js";import{UpdatePolicy as E}from"../webgl-engine/lib/basicInterfaces.js";import{TaskPriority as v}from"../../support/Scheduler.js";const w=w=>{let _=class extends w{constructor(){super(...arguments),this.controller=null,this.updatePolicy=E.SYNC,this.suspendResumeExtentMode="computed",this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.suspendResumeExtent=null,this._controllerCreated=!1,this.supportsHeightUnitConversion=!0,this._pendingController=null,this.queryEngine=null}initialize(){const e=this.layer;if("isTable"in e&&e.isTable)return void this.addResolvingPromise(Promise.reject(new r("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e})));this.addResolvingPromise(this._validateGeometryType()),this.updatingHandles.add((()=>this.layer.renderer),(e=>this._recreateProcessor(e)),i),this.addResolvingPromise((async()=>{const e=await b(this);this.fullExtentInLocalViewSpatialReference=e,await this._initializeController()})()),this.updatingHandles.add((()=>this.updatePolicy),(e=>this.processor.preferredUpdatePolicy=e));const t=()=>this.processor.featureStore;this.queryEngine=new g({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return t()},hasZ:this.hasZ,hasM:this.hasM},priority:v.FEATURE_QUERY_ENGINE}),this.notifyChange("updating")}destroy(){this._destroyPendingController(),this.controller=t(this.controller),this._set("processor",t(this.processor)),this.queryEngine=t(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this._pendingController=t(this._pendingController)}get legendEnabled(){return this.canResume()&&this.processor?.legendEnabled}get graphics3DProcessor(){return"graphics-3d"===this.processor?.type?this.processor:null}get heatmapProcessor(){return"heatmap"===this.processor?.type?this.processor:null}get symbologySnappingSupported(){const e=this.layer?.renderer?.getSymbols();return e?.some(h)??!1}getHit(e){let r;return this.loadedGraphics?.forEach((t=>{t.uid===e&&(r=p(t,this.layer))})),r?{type:"graphic",graphic:r,layer:r.layer}:null}whenGraphicBounds(e,r){return this.processor?.whenGraphicBounds(e,r)}computeAttachmentOrigin(e,r){return this.processor?.computeAttachmentOrigin(e,r)}async elevationAlignPointsInFeatures(e,t){const o=this.graphics3DProcessor;if(s(o))throw new r("featurelayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");return d(this.view,this.layer,(e=>o.getGraphics3DGraphicByObjectId(e)),e,t)}async queryForSymbologySnapping(e,r){return this.symbologySnappingSupported?m(this.graphics3DProcessor,e,r):{candidates:[],sourceCandidateIndices:[]}}queryFeatures(e,r){return this.queryEngine.executeQuery(this._ensureQuery(e),o(r,"signal"))}queryObjectIds(e,r){return this.queryEngine.executeQueryForIds(this._ensureQuery(e),o(r,"signal"))}queryFeatureCount(e,r){return this.queryEngine.executeQueryForCount(this._ensureQuery(e),o(r,"signal"))}queryExtent(e,r){return this.queryEngine.executeQueryForExtent(this._ensureQuery(e),o(r,"signal"))}_ensureQuery(e){return s(e)?this.createQuery():u.from(e)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}maskOccludee(e){return this.processor.maskOccludee(e)}canResume(){return super.canResume()&&!this.processor?.scaleVisibilitySuspended}getSuspendInfo(){const e=super.getSuspendInfo();return this.processor?{...e,...this.processor.suspendInfo}:e}isUpdating(){return!(!this.processor||this.processor.destroyed)&&!(this._controllerCreated&&!this.controller?.updating&&this.view?.basemapTerrain?.ready&&!this.processor.updating)}async _initializeController(){const e=this.createController();this._pendingController=e,await e.when(),this._setControllerWhenInitialized(e)}async _setControllerWhenInitialized(e){try{await this.when()}catch(r){}this._controllerCreated=!0,this.notifyChange("updating"),this.isResolved()&&!this.destroyed?(await n((()=>this.view?.basemapTerrain?.ready)),this.beforeSetController(e),this._pendingController=null,this.controller=e,this.loadedGraphics=e.graphics,this.notifyChange("updating")):this._destroyPendingController()}_updateClippingExtent(e){if(this.clippingExtent=e,!this.controller)return!1;switch(this.controller.type){case"stream":return!1;case"feature-tile-3d":return this.controller.extent=e,!0}}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new r("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}_recreateProcessor(e){const r="heatmap"===e?.type,t="heatmap"===this.processor?.type,s=this.processor;if(s&&r===t)return;const o=r?new f({owner:this}):new y({owner:this,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:e=>this._updateClippingExtent(e)});this._set("processor",o),s?.destroy(),this.queryEngine?.clear(),this.addResolvingPromise(o.initializePromise)}_getResourceInfo(){const e=this.controller instanceof c?this.controller:null;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:e?.maximumNumberOfFeatures??-1,totalNumberOfFeatures:e?.serviceDataCount??-1,nodes:0,...this.processor.performanceInfo}}get performanceInfo(){return this._getResourceInfo()}};return e([a()],_.prototype,"loadedGraphics",void 0),e([a()],_.prototype,"suspended",void 0),e([a({readOnly:!0})],_.prototype,"legendEnabled",null),e([a()],_.prototype,"updating",void 0),e([a()],_.prototype,"controller",void 0),e([a()],_.prototype,"processor",void 0),e([a({readOnly:!0})],_.prototype,"updatePolicy",void 0),e([a({readOnly:!0})],_.prototype,"suspendResumeExtentMode",void 0),e([a({type:Boolean})],_.prototype,"slicePlaneEnabled",void 0),e([a({readOnly:!0})],_.prototype,"suspendInfo",void 0),e([a()],_.prototype,"graphics3DProcessor",null),e([a()],_.prototype,"heatmapProcessor",null),e([a()],_.prototype,"symbologySnappingSupported",null),_=e([l("esri.views.3d.layers.FeatureLikeLayerView3D")],_),_};export{w as FeatureLikeLayerView3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as r}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{Identifiable as s}from"../../../core/Identifiable.js";import{destroyMaybe as o,
|
|
5
|
+
import{_ as r}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{Identifiable as s}from"../../../core/Identifiable.js";import{destroyMaybe as o,unwrap as t}from"../../../core/maybe.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsProcessor as c}from"./graphics/GraphicsProcessor.js";import{GraphicsView as a}from"../../layers/GraphicsView.js";let h=class extends(a(e)){constructor(r){super(r),this.processor=null,this.slicePlaneEnabled=!1,this.layer=new n}initialize(){this._set("processor",new c({owner:this}))}destroy(){this._set("processor",o(this.processor))}get graphics(){return this.view?.graphics}get loadedGraphics(){return this.graphics}get updating(){return!!this.processor?.updating}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getHit(r){return this.processor.getHit(r)}whenGraphicBounds(r,e){return this.processor.whenGraphicBounds(r,e)}graphicChanged(r){this.processor.graphicsCore.graphicUpdateHandler(r)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}async queryGraphics(){return this.loadedGraphics}async fetchPopupFeatures(r,e){return t(e)?.clientGraphics??[]}highlight(r){return this.processor.highlight(r)}maskOccludee(r){return this.processor.maskOccludee(r)}};r([i({readOnly:!0})],h.prototype,"graphics",null),r([i()],h.prototype,"loadedGraphics",null),r([i({readOnly:!0})],h.prototype,"updating",null),r([i({constructOnly:!0})],h.prototype,"view",void 0),r([i()],h.prototype,"processor",void 0),r([i({type:Boolean})],h.prototype,"slicePlaneEnabled",void 0),r([i()],h.prototype,"layer",void 0),h=r([p("esri.views.3d.layers.GraphicsView3D")],h);class n extends s{constructor(){super(),this.type="graphics-view-3d-dummy",this.id=this.uid}}const l=h;export{l as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{isSome as t,unwrap as i,isNone as s}from"../../../core/maybe.js";import{whenOnce as a}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as o}from"./LayerView3D.js";import{TiledLayerView3D as m}from"./TiledLayerView3D.js";import{RasterTile as p}from"../terrain/RasterTile.js";import h from"../../layers/ImageryTileLayerView.js";import c from"../../layers/LayerView.js";import y from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as d}from"../../support/drapedUtils.js";import{getWebGLCapabilities as f}from"../../webgl/capabilities.js";let u=class extends(h(y(m(o(c))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this.isAlignedMapTile=!0}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new r("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=a((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const e=this.view.basemapTerrain.tilingScheme,
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{isSome as t,unwrap as i,isNone as s}from"../../../core/maybe.js";import{whenOnce as a}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as o}from"./LayerView3D.js";import{TiledLayerView3D as m}from"./TiledLayerView3D.js";import{RasterTile as p}from"../terrain/RasterTile.js";import h from"../../layers/ImageryTileLayerView.js";import c from"../../layers/LayerView.js";import y from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as d}from"../../support/drapedUtils.js";import{getWebGLCapabilities as f}from"../../webgl/capabilities.js";let u=class extends(h(y(m(o(c))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this.isAlignedMapTile=!0}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new r("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=a((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const e=this.view.basemapTerrain.tilingScheme,r=this.layer.tileInfo,t=["png","png24","png32","jpg","mixed"].includes(r.format)&&e.compatibleWith(r);this.isAlignedMapTile=t;const i=t?r:e.toTileInfo();this.tileInfo=i,this.updatingHandles.add((()=>[this.layer.renderer,this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction]),(()=>this.refresh()))}));this.addResolvingPromise(e)}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this.view=null}get _blankTile(){const e=document.createElement("canvas"),r=e.getContext("2d"),[t,i]=this.tileInfo.size;return e.width=t,e.height=i,r.clearRect(0,0,t,i),r.getImageData(0,0,t,i)}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){const e=this.tileInfo.lods,r=this.layer.tileInfo.lods,t=e[0].scale,i=r[r.length-1].scale;return this.levelRangeFromScaleRange(t,i)}_getfullExtent(){return this.projectFullExtent(this.view.basemapTerrain&&t(this.view.basemapTerrain.spatialReference)?this.view.basemapTerrain.spatialReference:this.view.spatialReference)}async fetchTile(e,r,t,a){const l=this.tileInfo,n=this._canSymbolizeInWebGL(),o={tileInfo:l,requestRawData:n,signal:i(a.signal),requestAsImageElement:this.isAlignedMapTile},m=await this.layer.fetchTile(e,r,t,o);if(m instanceof HTMLImageElement)return m;let h=m&&m.pixelBlock;if(s(h))return this._blankTile;if(!n&&(h=await this.layer.applyRenderer(m),s(h)))return this._blankTile;const c=new p([e,r,t],h,l.size[0],l.size[1]);return n?(c.symbolizerRenderer=this.layer.symbolizer.rendererJSON,c.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e)),c.transformGrid=m.transformGrid):c.isRendereredSource=!0,c.interpolation=this.layer.interpolation,c.bandIds=this.layer.bandIds,c}_getSymbolizerOptions(e){const r=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:this.view.basemapTerrain&&t(this.view.basemapTerrain.spatialReference)?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:r,y:r},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,r){return d(e,r,this.view)}refresh(){this.emit("data-changed")}async doRefresh(){this.suspended||this.emit("data-changed")}_canSymbolizeInWebGL(){return f("3d").supportsTextureFloat&&this.layer.symbolizer.canRenderInWebGL}};e([l({readOnly:!0})],u.prototype,"_blankTile",null),e([l({readOnly:!0})],u.prototype,"imageFormatIsOpaque",null),e([l({readOnly:!0})],u.prototype,"hasMixedImageFormats",null),e([l({readOnly:!0})],u.prototype,"dataLevelRange",null),u=e([n("esri.views.3d.layers.ImageryTileLayerView3D")],u);const g=u;export{g as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import{binaryIndexOf as r}from"../../../core/arrayUtils.js";import s from"../../../core/Logger.js";import{destroyMaybe as i,isNone as o,isSome as a,unwrap as n}from"../../../core/maybe.js";import{initial as d,watch as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{a as c}from"../../../chunks/vec3.js";import{f as p,c as g}from"../../../chunks/vec3f64.js";import{projectBuffer as m,projectVectorToVector as y}from"../../../geometry/projection.js";import{extentContainsCoords3D as _}from"../../../geometry/support/contains.js";import{getGeometryZScaler as f}from"../../../geometry/support/zscale.js";import{fallbackObjectIDAttribute as b}from"../../../layers/LayerConstants.js";import{makeDehydratedPoint as v,estimateSize as x}from"../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as E}from"../../../layers/graphics/hydratedFeatures.js";import I from"../../../layers/graphics/controllers/I3SOnDemandController.js";import w from"../../../layers/support/FeatureFilter.js";import S from"../../../rest/support/Query.js";import{I3SPointsWorkerHandle as C}from"./I3SPointsWorkerHandle.js";import{LayerView3D as D}from"./LayerView3D.js";import A from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as F}from"./graphics/QueryEngine.js";import{createInteractiveEditSession as O,processAttributeEdits as j}from"./i3s/attributeEditing.js";import{I3SOverrides as N}from"./i3s/I3SOverrides.js";import{checkSpatialReferences as T,containsDraco as L,whenGraphicAttributes as M,getCachedAttributeValue as V}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as G}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as R}from"./support/fieldProperties.js";import{PopupSceneLayerView as P}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as H}from"./support/SceneLayerViewRequiredFields.js";import U from"../support/debugFlags.js";import{GraphicsMap as q}from"../support/GraphicsMap.js";import{compute as Q}from"../support/orientedBoundingBox.js";import{updatingProgress as k}from"../support/updatingProperties.js";import{Attribute as B}from"../webgl-engine/lib/Attribute.js";import{UpdatePolicy as z}from"../webgl-engine/lib/basicInterfaces.js";import Z from"../../layers/SceneLayerView.js";import{TaskPriority as W}from"../../support/Scheduler.js";const K=R();let Y=class extends(G(P(D(Z)))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._nodesAddedToStage=new Map,this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this.loadedGraphics=new q,this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}initialize(){const e=this.layer;this.addResolvingPromise(e.indexInfo),this._i3sOverrides=new N({view:this.view,layer:this.layer,memoryController:this.view.resourceController?.memoryController}),T(e,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new H({layerView:this}),this.updatingHandles.add((()=>e.rangeInfos),(e=>this._rangeInfosChanged(e)),d),this.updatingHandles.add((()=>e.renderer),((e,t)=>this._rendererChange(e,t))),this.updatingHandles.add((()=>[this.parsedDefinitionExpression,this._excludeObjectIdsSorted]),(()=>this._filterChange())),this.handles.add(l((()=>U.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&U.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||!this._treeDebugger||U.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)}),d)),this._set("processor",new A({owner:this,preferredUpdatePolicy:z.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:e.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",(e=>this._controller.updateElevationChanged(e.extent,e.spatialReference))),this.supportsHeightUnitConversion&&(this._verticalScale=f("point",e.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.initializePromise),this._memCache=this.view.resourceController.memoryController.newCache(e.uid),this._controller=new I({layerView:this,scaleVisibilityEnabled:!1}),L(this.layer.geometryDefinitions)&&(this._worker=new C((e=>this.view.resourceController.immediate.schedule(e)))),this.handles.add(this.layer.on("apply-edits",(e=>this.updatingHandles.addPromise(e.result)))),this.handles.add(this.layer.on("edits",(e=>this._handleEdits(e)))),this.when((()=>{const e=()=>this.processor.featureStore;this._queryEngine=new F({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return e()},hasZ:this.hasZ,hasM:this.hasM},priority:W.FEATURE_QUERY_ENGINE}),this.updatingHandles.add((()=>this.maximumNumberOfFeatures),(e=>this._controller.featureTarget=e),d),this.updatingHandles.add((()=>this.suspended),(e=>{e&&this._removeAllNodeData()}))}))}destroy(){this._treeDebugger=i(this._treeDebugger),this._i3sOverrides=i(this._i3sOverrides),this._set("processor",i(this.processor)),this._controller=i(this._controller),this._queryEngine=i(this._queryEngine),this._worker=i(this._worker),this._memCache=i(this._memCache),this._nodesAddedToStage.clear(),this._fieldsHelper=i(this._fieldsHelper)}get i3slayer(){return this.layer}get updatingProgressValue(){return this._controller?.updatingProgress??1}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds;return e.length?e.toArray().sort(((e,t)=>e-t)):null}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}async whenGraphicAttributes(e,t){return M(this.layer,e,this._getObjectIdField(),t,(()=>[...this._nodesAddedToStage.values()]))}getHit(e){if(!this.loadedGraphics)return null;const t=E(this.loadedGraphics.find((t=>t.uid===e)),this.layer),r=this._getObjectIdField();return t&&t.attributes&&t.attributes[r]?(t.layer=this.layer,t.sourceLayer=this.layer,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return O(this._attributeEditingContext,e)}async _extractBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};return o(this._worker)&&(this._worker=new C((e=>this.view.resourceController.immediate.schedule(e)))),this._worker.invoke(r,t).then((e=>{if(a(e)){return{positionData:e.positions,featureIds:e.featureIds}}throw new Error("Failed to decompress Draco point data")}))}_checkExtent(e,t){e&&!_(e,t)&&(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&s.getLogger(this.declaredClass).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&s.getLogger(this.declaredClass).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++)}async addNode(e,t,r){if(!X(t)&&!J(t))throw new Error;if(this._nodesAddedToStage.has(e.index))return void s.getLogger(this.declaredClass).error("I3S node "+e.id+" already added");const i=a(this.layer.fullExtent)?te(this.layer.fullExtent.clone(),.5):null,o=this._controller.crsVertex,n=[],d={graphics:null,featureIds:null,attributeInfo:t.attributeDataInfo,node:e};if(X(t)?await this._addNodeBinaryPointData(e,d,t,i,n,r):J(t)&&this._addNodeLegacyPointData(e,d,t,i,n),await this._i3sOverrides.apply(d.featureIds,t.attributeDataInfo,r),e.numFeatures=d.graphics.length,this._updateNodeMemory(e),ee(d),n.length>0&&(this._computeObb(e,n,o),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(d);if(a(this._verticalScale))for(const s of d.graphics)this._verticalScale(s.geometry);const l=this.view._stage.renderView.objectAndLayerIdRenderHelper;if(a(l))for(let s=0;s<d.featureIds.length;s++){const e=d.featureIds[s];l.setUidToObjectAndLayerId(e,d.graphics[s].uid,this.layer.id,this.layer.uid,this.layer.popupEnabled,d.node.resources.attributes,s)}this._nodesAddedToStage.set(e.index,d),this.loadedGraphics.addMany(d.graphics),this._controller.updateLoadStatus(e.index,!0),this._filterNode(d),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,r){const s=this._controller.crsIndex,i=s.isGeographic?this.view.renderSpatialReference:s;m(t,r,0,t,i,0,t.length/3),e.serviceObb=Q(new B(t,3)),s.isGeographic&&y(e.serviceObb.center,i,e.serviceObb.center,s)}isNodeLoaded(e){return this._nodesAddedToStage.has(e)}isNodeReloading(){return!1}updateNodeState(){}async _addNodeBinaryPointData(e,r,s,i,o,d){const l=await this._extractBinaryPointData(s,d);if(null==l)throw new Error;const h=this._getObjectIdField(),u=this._controller.crsVertex,g=this.view.spatialReference,y=this.processor.graphicsCore,{positionData:_,featureIds:f}=l,b=3,x=_.length/b,E=new Array,I=a(e.serviceObb)?e.serviceObb.center:[0,0,0],w=Math.abs(I[2])*2**-20;for(let S=0;S<x;S++){const r=S*b,s=p(_[r+0],_[r+1],_[r+2]);c(s,s,I),Math.abs(s[2])<w&&(s[2]=0),e.serviceObb||o.push(s[0],s[1],s[2]),a(i)&&this._checkExtent(i,s);const d=f[S],l={};null!=d&&(l[h]=d);const x=d??t.generateUID();m(s,u,0,se,g,0,1);const C=v(se[0],se[1],se[2],g),D=this.loadedGraphics.get(x);if(a(D))D.level<e.level&&(ie.property="geometry",ie.graphic=D,ie.oldValue=n(D.geometry),ie.newValue=C,D.geometry=C,y.graphicUpdateHandler(ie)),E.push(D);else{const r=t.generateUID();E.push({objectId:x,uid:r,geometry:C,attributes:l,visible:!0,level:e.level})}}r.graphics=E,r.featureIds=Array.from(f)}_addNodeLegacyPointData(e,r,s,i,o){const n=this._getObjectIdField(),d=this._controller.crsVertex,l=this.view.spatialReference,h=[0,0,0],u=new Array,c=new Array;for(const p of s.pointData){const r=p.featureDataPosition,s=r.length,g=p.geometries&&p.geometries[0]||re[s],y=p.featureIds[0];if("points"!==g.params.type)continue;a(i)&&this._checkExtent(i,r);const _={};null!=y&&(_[n]=y);const f=y??t.generateUID();let b;"Embedded"===g.type&&(b=g.params.vertexAttributes.position);for(let i=0;i<b.length;i+=s){for(let e=0;e<s;e++)h[e]=r[e]+b[i+e];const n=3===s;e.serviceObb||o.push(h[0],h[1],n?h[2]:0),m(h,d,0,se,l,0,1);const u=v(se[0],se[1],n?se[2]:void 0,l),p=this.loadedGraphics.get(f);a(p)?c.push(p):c.push({objectId:f,uid:t.generateUID(),geometry:u,attributes:_,visible:!0})}u.push(y)}r.graphics=c,r.featureIds=u}_updateNodeMemory(e){e.memory=4096+(a(e.numFeatures)?e.numFeatures*this.processor.graphicsCore.usedMemoryPerGraphic:0)}_cacheNodeData(e){const t=e.graphics.reduce(((e,t)=>x(t)+e),512+8*e.featureIds.length+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this._nodesAddedToStage.forEach(((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)})),this._nodesAddedToStage.clear(),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this._nodesAddedToStage.get(e);return t?(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeMany(t.graphics),this._nodesAddedToStage.delete(e),this._treeDebugger&&this._treeDebugger.update(),t):null}async loadCachedNodeData(e){return this._memCache.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,r,i){this._nodesAddedToStage.has(e.index)?s.getLogger(this.declaredClass).error("I3S node "+e.id+" already added"):(this.loadedGraphics.addMany(t.graphics),this._nodesAddedToStage.set(e.index,t),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),await this.updateAttributes(e.index,r,i),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this._nodesAddedToStage.forEach((t=>e.push(t.node.id))),e.sort()}getVisibleNodes(){const e=new Array;return this._nodesAddedToStage.forEach((t=>e.push(t.node))),e}getLoadedNodeIndices(e){this._nodesAddedToStage.forEach(((t,r)=>e.push(r)))}getLoadedAttributes(e){const t=this._nodesAddedToStage.get(e);if(t&&a(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodesAddedToStage.get(e);if(t&&a(t.attributeInfo))return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this._nodesAddedToStage.get(e);r&&!o(r.attributeInfo)&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const s=this._nodesAddedToStage.get(e);s&&(await this._i3sOverrides.apply(s.featureIds,t,r),s.attributeInfo=t,this._attributeValuesChanged(s))}_attributeValuesChanged(e){if(ee(e),this._filterNode(e),this.processor.graphicsCore.labelsEnabled){const t=e.graphics.map((e=>e.uid));this.processor.graphicsCore.updateLabelingInfo(t)}}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||b}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,s=new Set;let i,o;e?(await e.collectRequiredFields(s,r),i=Array.from(s).sort()):i=[],s.clear(),t?(await t.collectRequiredFields(s,r),o=Array.from(s).sort()):o=[],i.length===o.length&&i.every(((e,t)=>i[t]===o[t]))||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&s.getLogger(this.declaredClass).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this._nodesAddedToStage.forEach((e=>this._filterNode(e)))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,s=this._excludeObjectIdsSorted,i=this._getObjectIdField();for(const a of e.graphics){const e=a.visible,n=!t||this._evaluateClause(t,a),d=o(s)||r(s,a.attributes[i])<0;a.visible=n&&d,e!==a.visible&&(ie.graphic=a,ie.property="visible",ie.oldValue=e,ie.newValue=a.visible,this.processor.graphicsCore.graphicUpdateHandler(ie))}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return a(this.filter)?this.filter.createQuery(e):new S(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(o(e)?this.createQuery():S.from(e))}getUsedMemory(){return this.processor?.graphicsCore?.usedMemory??0}getUnloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}_handleEdits(e){j(this._attributeEditingContext,e)}get _attributeEditingContext(){const e=this._getObjectIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,forEachNode:e=>this._nodesAddedToStage.forEach((t=>e(t.node,t.featureIds))),attributeStorageInfo:this.i3slayer.attributeStorageInfo,i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,s)=>{this._setAttributeData(t,r);const i=this._nodesAddedToStage.get(t);if(a(s)){const t=this.loadedGraphics.get(s.attributes[e]);a(t)&&this.processor.graphicsCore.recreateGraphics([t])}else a(i)&&this.processor.graphicsCore.recreateGraphics(i.graphics)},clearMemCache:()=>{}}}get performanceInfo(){const e={displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:this.maximumNumberOfFeatures,totalNumberOfFeatures:-1,nodes:this._nodesAddedToStage.size,core:this.processor.graphicsCore.performanceInfo};return this._controller&&this._controller.updateStats(e),e}get test(){return{controller:this._controller,numNodes:this._nodesAddedToStage.size,loadedGraphics:this.loadedGraphics}}};e([h()],Y.prototype,"processor",void 0),e([h({type:w})],Y.prototype,"filter",void 0),e([h()],Y.prototype,"loadedGraphics",void 0),e([h()],Y.prototype,"i3slayer",null),e([h()],Y.prototype,"_controller",void 0),e([h()],Y.prototype,"updating",void 0),e([h()],Y.prototype,"suspended",void 0),e([h()],Y.prototype,"holeFilling",void 0),e([h(k)],Y.prototype,"updatingProgress",void 0),e([h()],Y.prototype,"updatingProgressValue",null),e([h(K.requiredFields)],Y.prototype,"requiredFields",null),e([h(K.availableFields)],Y.prototype,"availableFields",void 0),e([h()],Y.prototype,"_fieldsHelper",void 0),e([h({type:Number})],Y.prototype,"maximumNumberOfFeatures",null),e([h({readOnly:!0})],Y.prototype,"maximumNumberOfFeaturesExceeded",null),e([h()],Y.prototype,"_excludeObjectIdsSorted",null),e([h({readOnly:!0})],Y.prototype,"lodFactor",null),e([h({readOnly:!0})],Y.prototype,"hasM",null),e([h({readOnly:!0})],Y.prototype,"hasZ",null),Y=e([u("esri.views.3d.layers.SceneLayerGraphicsView3D")],Y);const $=Y;function J(e){return"pointData"in e}function X(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function ee(e){const t=e.attributeInfo;for(let r=0;r<e.graphics.length;r++){const s=e.graphics[r];if(s.attributes||(s.attributes={}),a(t)&&a(t.loadedAttributes))for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=V(t.attributeData[e],r))}}function te(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,e.hasZ&&(e.zmin-=t,e.zmax+=t),e.hasM&&(e.mmin-=t,e.mmax+=t),e}const re={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},se=g(),ie={graphic:null,property:null,oldValue:null,newValue:null};export{$ as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import{binaryIndexOf as r}from"../../../core/arrayUtils.js";import s from"../../../core/Logger.js";import{destroyMaybe as i,isNone as o,isSome as a,unwrap as n}from"../../../core/maybe.js";import{initial as d,watch as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{s as c}from"../../../chunks/vec3.js";import{c as p}from"../../../chunks/vec3f64.js";import{projectBuffer as g,projectVectorToVector as m}from"../../../geometry/projection.js";import{extentContainsCoords3D as y}from"../../../geometry/support/contains.js";import{getGeometryZScaler as _}from"../../../geometry/support/zscale.js";import{fallbackObjectIDAttribute as f}from"../../../layers/LayerConstants.js";import{makeDehydratedPoint as b,estimateSize as v}from"../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as x}from"../../../layers/graphics/hydratedFeatures.js";import E from"../../../layers/graphics/controllers/I3SOnDemandController.js";import w from"../../../layers/support/FeatureFilter.js";import I from"../../../rest/support/Query.js";import{I3SPointsWorkerHandle as S}from"./I3SPointsWorkerHandle.js";import{LayerView3D as C}from"./LayerView3D.js";import A from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as F}from"./graphics/QueryEngine.js";import{createInteractiveEditSession as O,processAttributeEdits as D}from"./i3s/attributeEditing.js";import{I3SOverrides as j}from"./i3s/I3SOverrides.js";import{checkSpatialReferences as N,containsDraco as T,whenGraphicAttributes as L,getCachedAttributeValue as P}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as M}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as G}from"./support/fieldProperties.js";import{PopupSceneLayerView as V}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as R}from"./support/SceneLayerViewRequiredFields.js";import H from"../support/debugFlags.js";import{GraphicsMap as q}from"../support/GraphicsMap.js";import{compute as U}from"../support/orientedBoundingBox.js";import{updatingProgress as Q}from"../support/updatingProperties.js";import{Attribute as B}from"../webgl-engine/lib/Attribute.js";import{UpdatePolicy as k}from"../webgl-engine/lib/basicInterfaces.js";import z from"../../layers/SceneLayerView.js";import{TaskPriority as Z}from"../../support/Scheduler.js";const W=G();let K=class extends(M(V(C(z)))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._nodesAddedToStage=new Map,this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this.loadedGraphics=new q,this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}initialize(){const e=this.layer;this.addResolvingPromise(e.indexInfo),this._i3sOverrides=new j({view:this.view,layer:this.layer,memoryController:this.view.resourceController?.memoryController}),N(e,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new R({layerView:this}),this.updatingHandles.add((()=>e.rangeInfos),(e=>this._rangeInfosChanged(e)),d),this.updatingHandles.add((()=>e.renderer),((e,t)=>this._rendererChange(e,t))),this.updatingHandles.add((()=>[this.parsedDefinitionExpression,this._excludeObjectIdsSorted]),(()=>this._filterChange())),this.handles.add(l((()=>H.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&H.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||!this._treeDebugger||H.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)}),d)),this._set("processor",new A({owner:this,preferredUpdatePolicy:k.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:e.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",(e=>this._controller.updateElevationChanged(e.extent,e.spatialReference))),this.supportsHeightUnitConversion&&(this._verticalScale=_("point",e.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.initializePromise),this._memCache=this.view.resourceController.memoryController.newCache(e.uid),this._controller=new E({layerView:this,scaleVisibilityEnabled:!1}),T(this.layer.geometryDefinitions)&&(this._worker=new S((e=>this.view.resourceController.immediate.schedule(e)))),this.handles.add(this.layer.on("apply-edits",(e=>this.updatingHandles.addPromise(e.result)))),this.handles.add(this.layer.on("edits",(e=>this._handleEdits(e)))),this.when((()=>{const e=()=>this.processor.featureStore;this._queryEngine=new F({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return e()},hasZ:this.hasZ,hasM:this.hasM},priority:Z.FEATURE_QUERY_ENGINE}),this.updatingHandles.add((()=>this.maximumNumberOfFeatures),(e=>this._controller.featureTarget=e),d),this.updatingHandles.add((()=>this.suspended),(e=>{e&&this._removeAllNodeData()}))}))}destroy(){this._treeDebugger=i(this._treeDebugger),this._i3sOverrides=i(this._i3sOverrides),this._set("processor",i(this.processor)),this._controller=i(this._controller),this._queryEngine=i(this._queryEngine),this._worker=i(this._worker),this._memCache=i(this._memCache),this._nodesAddedToStage.clear(),this._fieldsHelper=i(this._fieldsHelper)}get i3slayer(){return this.layer}get updatingProgressValue(){return this._controller?.updatingProgress??1}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds;return e.length?e.toArray().sort(((e,t)=>e-t)):null}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}async whenGraphicAttributes(e,t){return L(this.layer,e,this._getObjectIdField(),t,(()=>[...this._nodesAddedToStage.values()]))}getHit(e){if(!this.loadedGraphics)return null;const t=x(this.loadedGraphics.find((t=>t.uid===e)),this.layer),r=this._getObjectIdField();return t&&t.attributes&&t.attributes[r]?(t.layer=this.layer,t.sourceLayer=this.layer,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return O(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};o(this._worker)&&(this._worker=new S((e=>this.view.resourceController.immediate.schedule(e))));const s=await this._worker.invoke(r,t);if(o(s))throw new Error("Failed to decompress Draco point data");return{positionData:s.positions,featureIds:s.featureIds}}async addNode(e,t,r){if(!J(t)&&!$(t))throw new Error;if(this._nodesAddedToStage.has(e.index))return void s.getLogger(this.declaredClass).error("I3S node "+e.id+" already added");const i=a(this.layer.fullExtent)?ee(this.layer.fullExtent.clone(),.5):null,o=[],{featureIds:n,pointPositions:d}=J(t)?await this._extractBinaryPointPositions(e,t,r):this._extractLegacyPointPositions(t);this._validatePositions(e,n,d,i,o);const l=this._controller.crsVertex,h=this.view.spatialReference;g(d,l,0,d,h,0,n.length);const u=J(t)?e.level:0,c={graphics:this._createGraphics(n,d,u),featureIds:n,attributeInfo:t.attributeDataInfo,node:e};if(await this._i3sOverrides.apply(c.featureIds,t.attributeDataInfo,r),e.numFeatures=c.graphics.length,this._updateNodeMemory(e),X(c),o.length>0&&(this._computeObb(e,o,l),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(c);if(a(this._verticalScale))for(const s of c.graphics)this._verticalScale(s.geometry);const p=this.view._stage.renderView.objectAndLayerIdRenderHelper;if(a(p))for(let s=0;s<c.featureIds.length;s++){const e=c.featureIds[s];p.setUidToObjectAndLayerId(e,c.graphics[s].uid,this.layer.id,this.layer.uid,this.layer.popupEnabled,c.node.resources.attributes,s)}this._nodesAddedToStage.set(e.index,c),this.loadedGraphics.addMany(c.graphics),this._controller.updateLoadStatus(e.index,!0),this._filterNode(c),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,r){const s=this._controller.crsIndex,i=s.isGeographic?this.view.renderSpatialReference:s;g(t,r,0,t,i,0,t.length/3),e.serviceObb=U(new B(t,3)),s.isGeographic&&m(e.serviceObb.center,i,e.serviceObb.center,s)}isNodeLoaded(e){return this._nodesAddedToStage.has(e)}isNodeReloading(){return!1}updateNodeState(){}async _extractBinaryPointPositions(e,t,r){const s=await this._decompressBinaryPointData(t,r),i=s.positionData,o=3,n=i.length/o,d=new Float64Array(3*n),l=a(e.serviceObb)?e.serviceObb.center:[0,0,0],h=Math.abs(l[2])*2**-20;for(let a=0;a<n;a++){const e=a*o;d[e+0]=i[e+0]+l[0],d[e+1]=i[e+1]+l[1],d[e+2]=i[e+2]+l[2],Math.abs(d[e+2])<h&&(d[e+2]=0)}return{featureIds:Array.from(s.featureIds),pointPositions:d}}_extractLegacyPointPositions(e){const t=e.pointData.length,r=new Float64Array(3*t),s=new Array;for(let i=0;i<t;i++){const t=e.pointData[i],o=t.featureDataPosition,a=o.length,n=t.geometries?.[0]??te[a],d=t.featureIds[0];if("Embedded"!==n.type||"points"!==n.params.type||a<2||a>3)continue;const l=n.params.vertexAttributes?.position??[0,0,0],h=3*s.length;r[h+0]=o[0]+l[0],r[h+1]=o[1]+l[1],r[h+2]=3===a?o[2]+l[2]:NaN,s.push(d)}return{featureIds:s,pointPositions:r}}_validatePositions(e,t,r,i,n){if(o(i)&&e.serviceObb)return;const d=t.length,l=3;for(let o=0;o<d;o++){const t=o*l;c(re,r[t],r[t+1],r[t+2]),a(i)&&!y(i,re)&&(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&s.getLogger(this.declaredClass).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&s.getLogger(this.declaredClass).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++),e.serviceObb||n.push(re[0],re[1],re[2])}}_createGraphics(e,r,s){const i=e.length,o=3,d=this._getObjectIdField(),l=this.processor.graphicsCore,h=new Array,u=this.view.spatialReference;for(let c=0;c<i;c++){const i=e[c],p={};null!=i&&(p[d]=i);const g=i??t.generateUID(),m=c*o,y=isNaN(r[m+2])?void 0:r[m+2],_=b(r[m],r[m+1],y,u),f=this.loadedGraphics.get(g);if(a(f))(!f.level||f.level<s)&&(se.property="geometry",se.graphic=f,se.oldValue=n(f.geometry),se.newValue=_,f.geometry=_,f.level=s,l.graphicUpdateHandler(se)),h.push(f);else{const e=t.generateUID();h.push({objectId:g,uid:e,geometry:_,attributes:p,visible:!0,level:s})}}return h}_updateNodeMemory(e){e.memory=4096+(a(e.numFeatures)?e.numFeatures*this.processor.graphicsCore.usedMemoryPerGraphic:0)}_cacheNodeData(e){const t=e.graphics.reduce(((e,t)=>v(t)+e),512+8*e.featureIds.length+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this._nodesAddedToStage.forEach(((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)})),this._nodesAddedToStage.clear(),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this._nodesAddedToStage.get(e);return t?(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeMany(t.graphics),this._nodesAddedToStage.delete(e),this._treeDebugger&&this._treeDebugger.update(),t):null}async loadCachedNodeData(e){return this._memCache.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,r,i){this._nodesAddedToStage.has(e.index)?s.getLogger(this.declaredClass).error("I3S node "+e.id+" already added"):(this.loadedGraphics.addMany(t.graphics),this._nodesAddedToStage.set(e.index,t),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),await this.updateAttributes(e.index,r,i),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this._nodesAddedToStage.forEach((t=>e.push(t.node.id))),e.sort()}getVisibleNodes(){const e=new Array;return this._nodesAddedToStage.forEach((t=>e.push(t.node))),e}getLoadedNodeIndices(e){this._nodesAddedToStage.forEach(((t,r)=>e.push(r)))}getLoadedAttributes(e){const t=this._nodesAddedToStage.get(e);if(t&&a(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodesAddedToStage.get(e);if(t&&a(t.attributeInfo))return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this._nodesAddedToStage.get(e);r&&!o(r.attributeInfo)&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const s=this._nodesAddedToStage.get(e);s&&(await this._i3sOverrides.apply(s.featureIds,t,r),s.attributeInfo=t,this._attributeValuesChanged(s))}_attributeValuesChanged(e){if(X(e),this._filterNode(e),this.processor.graphicsCore.labelsEnabled){const t=e.graphics.map((e=>e.uid));this.processor.graphicsCore.updateLabelingInfo(t)}}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||f}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,s=new Set;let i,o;e?(await e.collectRequiredFields(s,r),i=Array.from(s).sort()):i=[],s.clear(),t?(await t.collectRequiredFields(s,r),o=Array.from(s).sort()):o=[],i.length===o.length&&i.every(((e,t)=>i[t]===o[t]))||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&s.getLogger(this.declaredClass).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this._nodesAddedToStage.forEach((e=>this._filterNode(e)))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,s=this._excludeObjectIdsSorted,i=this._getObjectIdField();for(const a of e.graphics){const e=a.visible,n=!t||this._evaluateClause(t,a),d=o(s)||r(s,a.attributes[i])<0;a.visible=n&&d,e!==a.visible&&(se.graphic=a,se.property="visible",se.oldValue=e,se.newValue=a.visible,this.processor.graphicsCore.graphicUpdateHandler(se))}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return a(this.filter)?this.filter.createQuery(e):new I(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(o(e)?this.createQuery():I.from(e))}getUsedMemory(){return this.processor?.graphicsCore?.usedMemory??0}getUnloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}_handleEdits(e){D(this._attributeEditingContext,e)}get _attributeEditingContext(){const e=this._getObjectIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,forEachNode:e=>this._nodesAddedToStage.forEach((t=>e(t.node,t.featureIds))),attributeStorageInfo:this.i3slayer.attributeStorageInfo,i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,s)=>{this._setAttributeData(t,r);const i=this._nodesAddedToStage.get(t);if(a(s)){const t=this.loadedGraphics.get(s.attributes[e]);a(t)&&this.processor.graphicsCore.recreateGraphics([t])}else a(i)&&this.processor.graphicsCore.recreateGraphics(i.graphics)},clearMemCache:()=>{}}}get performanceInfo(){const e={displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:this.maximumNumberOfFeatures,totalNumberOfFeatures:-1,nodes:this._nodesAddedToStage.size,core:this.processor.graphicsCore.performanceInfo};return this._controller&&this._controller.updateStats(e),e}get test(){return{controller:this._controller,numNodes:this._nodesAddedToStage.size,loadedGraphics:this.loadedGraphics}}};e([h()],K.prototype,"processor",void 0),e([h({type:w})],K.prototype,"filter",void 0),e([h()],K.prototype,"loadedGraphics",void 0),e([h()],K.prototype,"i3slayer",null),e([h()],K.prototype,"_controller",void 0),e([h()],K.prototype,"updating",void 0),e([h()],K.prototype,"suspended",void 0),e([h()],K.prototype,"holeFilling",void 0),e([h(Q)],K.prototype,"updatingProgress",void 0),e([h()],K.prototype,"updatingProgressValue",null),e([h(W.requiredFields)],K.prototype,"requiredFields",null),e([h(W.availableFields)],K.prototype,"availableFields",void 0),e([h()],K.prototype,"_fieldsHelper",void 0),e([h({type:Number})],K.prototype,"maximumNumberOfFeatures",null),e([h({readOnly:!0})],K.prototype,"maximumNumberOfFeaturesExceeded",null),e([h()],K.prototype,"_excludeObjectIdsSorted",null),e([h({readOnly:!0})],K.prototype,"lodFactor",null),e([h({readOnly:!0})],K.prototype,"hasM",null),e([h({readOnly:!0})],K.prototype,"hasZ",null),K=e([u("esri.views.3d.layers.SceneLayerGraphicsView3D")],K);const Y=K;function $(e){return"pointData"in e}function J(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function X(e){const t=e.attributeInfo;for(let r=0;r<e.graphics.length;r++){const s=e.graphics[r];if(s.attributes||(s.attributes={}),a(t)&&a(t.loadedAttributes))for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=P(t.attributeData[e],r))}}function ee(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,e.hasZ&&(e.zmin-=t,e.zmax+=t),e.hasM&&(e.mmin-=t,e.mmax+=t),e}const te={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},re=p(),se={graphic:null,property:null,oldValue:null,newValue:null};export{Y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{isNone as r,isSome as i}from"../../../core/maybe.js";import{whenOnce as a}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{updatingProgress as o,updatingProgressValue as n}from"../support/updatingProperties.js";import{checkIfTileInfoSupportedForView as p}from"../terrain/terrainUtils.js";const c=c=>{let m=class extends c{get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return this.fullOpacity>=1&&this.imageFormatIsOpaque}get dataLevelRange(){const e=this.tileInfo.lods,t=e[0].scale,r=e[e.length-1].scale;return this.levelRangeFromScaleRange(t,r)}get displayLevelRange(){const e=this.tileInfo.lods,t=this.layer.minScale||e[0].scale,r=this.layer.maxScale||e[e.length-1].scale,i=this.levelRangeFromScaleRange(t,r);return this.layer.maxScale&&i.maxLevel++,i}getTileUrl(e,t,r){return this.layer.getTileUrl(e,t,r)}_addTilingSchemeMatchPromise(){if(r(this.fullExtent))return this.addResolvingPromise(Promise.reject(new t("tilingscheme:extent-not-defined","This layer doesn't define a fullExtent.")));const e=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(i(e))return this.addResolvingPromise(Promise.reject(e));const s=a((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const e=this.view.basemapTerrain.tilingScheme,t=this._getTileInfoCompatibilityError(this.tileInfo,e);if(t)throw t}));this.addResolvingPromise(s)}_getTileInfoSupportError(e,r){const i=p(e,r,this.view.spatialReference,this.view.state.viewingMode);if(i){const e={layer:this.layer,error:i};let r;switch(i.name){case"tilingscheme:spatial-reference-mismatch":case"tilingscheme:global-unsupported-spatial-reference":case"tilingscheme:local-unsupported-spatial-reference":r=new t("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",e);break;default:r=new t("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",e)}return r}return null}_getTileInfoCompatibilityError(e,
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{isNone as r,isSome as i}from"../../../core/maybe.js";import{whenOnce as a}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{updatingProgress as o,updatingProgressValue as n}from"../support/updatingProperties.js";import{checkIfTileInfoSupportedForView as p}from"../terrain/terrainUtils.js";const c=c=>{let m=class extends c{get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return this.fullOpacity>=1&&this.imageFormatIsOpaque}get dataLevelRange(){const e=this.tileInfo.lods,t=e[0].scale,r=e[e.length-1].scale;return this.levelRangeFromScaleRange(t,r)}get displayLevelRange(){const e=this.tileInfo.lods,t=this.layer.minScale||e[0].scale,r=this.layer.maxScale||e[e.length-1].scale,i=this.levelRangeFromScaleRange(t,r);return this.layer.maxScale&&i.maxLevel++,i}getTileUrl(e,t,r){return this.layer.getTileUrl(e,t,r)}_addTilingSchemeMatchPromise(){if(r(this.fullExtent))return this.addResolvingPromise(Promise.reject(new t("tilingscheme:extent-not-defined","This layer doesn't define a fullExtent.")));const e=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(i(e))return this.addResolvingPromise(Promise.reject(e));const s=a((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const e=this.view.basemapTerrain.tilingScheme,t=this._getTileInfoCompatibilityError(this.tileInfo,e);if(t)throw t}));this.addResolvingPromise(s)}_getTileInfoSupportError(e,r){const i=p(e,r,this.view.spatialReference,this.view.state.viewingMode);if(i){const e={layer:this.layer,error:i};let r;switch(i.name){case"tilingscheme:spatial-reference-mismatch":case"tilingscheme:global-unsupported-spatial-reference":case"tilingscheme:local-unsupported-spatial-reference":r=new t("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",e);break;default:r=new t("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",e)}return r}return null}_getTileInfoCompatibilityError(e,i){return r(e)||!i.compatibleWith(e)?new t("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface"):null}levelRangeFromScaleRange(e,t){const r={minLevel:0,maxLevel:1/0},i=this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.tilingScheme;if(!i)return r;const a=i.levels[0],s=e=>{const t=Math.log(a.scale/e)/Math.LN2;return.5-Math.abs(.5-t%1)<1e-9?Math.round(t):Math.ceil(t)};return null!=e&&e>0&&(r.minLevel=Math.max(0,s(e))),null!=t&&t>0&&(r.maxLevel=Math.max(0,s(t))),r}isUpdating(){return!!(this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.updating)}};return e([s({readOnly:!0})],m.prototype,"imageFormatIsOpaque",null),e([s({readOnly:!0})],m.prototype,"updating",void 0),e([s(o)],m.prototype,"updatingProgress",void 0),e([s(n)],m.prototype,"updatingProgressValue",void 0),e([s()],m.prototype,"fullExtent",null),e([s({readOnly:!0})],m.prototype,"isOpaque",null),e([s({readOnly:!0})],m.prototype,"dataLevelRange",null),e([s({readOnly:!0})],m.prototype,"displayLevelRange",null),e([s()],m.prototype,"layer",void 0),e([s()],m.prototype,"tileInfo",void 0),m=e([l("esri.views.3d.layers.TiledLayerView3D")],m),m};export{c as TiledLayerView3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{isNone as i,isSome as r,disposeMaybe as l,destroyMaybe as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{isNone as i,isSome as r,disposeMaybe as l,abortMaybe as s,destroyMaybe as o}from"../../../core/maybe.js";import{isAborted as a}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{SchemaHelper as p}from"../../2d/engine/vectorTiles/SchemaHelper.js";import m from"../../2d/engine/vectorTiles/TileHandler3D.js";import d from"../../2d/engine/vectorTiles/VTLPainter3D.js";import f from"../../2d/engine/vectorTiles/style/StyleRepository.js";import{LayerView3D as y}from"./LayerView3D.js";import{TiledLayerView3D as g}from"./TiledLayerView3D.js";import{vtlAssumes256PixelSizeAsDefault as u,test as _}from"../terrain/terrainUtils.js";import C from"../../layers/LayerView.js";let v=class extends(g(y(C))){constructor(){super(...arguments),this._tileHandlerController=null,this.type="vector-tile-3d"}initialize(){if(i(this.layer.fullExtent))return void this.addResolvingPromise(Promise.reject(new t("vectortilelayerview:full-extent-undefined","This layer view's layer does not define a fullExtent.")));const{basemapTerrain:e,spatialReference:l,state:s,viewingMode:o}=this.view,{pixelRatio:h}=s,c="local"===o&&!u(l)||_.force512VTL,y=this.layer.tileInfo.spatialReference.isGeographic,g=c?this.layer.tileInfo:this.layer.tileInfo.getOrCreateCompatible(256,y?1:2),C=this._getTileInfoSupportError(g,this.layer.fullExtent);if(r(C))return this.addResolvingPromise(Promise.reject(C));const v=n((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const t=e.tilingScheme,i=t.pixelSize;let l;if(this.schemaHelper=new p(i,r(e.spatialReference)&&e.spatialReference.isGeographic),256===i){const e=this.layer.tileInfo.spatialReference.isGeographic;l=this.layer.tileInfo.getOrCreateCompatible(256,e?1:2)}else l=this.view.spatialReference.isGeographic?this.layer.tileInfo.getOrCreateCompatible(512,.5):this.layer.tileInfo;const s=this._getTileInfoCompatibilityError(l,t);if(s)throw s;this.tileInfo=l}));this._tileHandlerController=new AbortController;const w=this.view.resourceController;this._memCache=w.memoryController.newCache(this.layer.uid,(e=>{e.release()}));const H=new f(this.layer.currentStyleInfo.style),j=e.mapTileRequester;this._tileHandler=new m(this.layer,H,h,this._memCache,j);const R=this._tileHandlerController.signal,T=e=>w.immediate.schedule(e),I=this._tileHandler.start({signal:R,schedule:T}),b=this._tileHandler.spriteMosaic;b.then((e=>{!a(R)&&this._tileHandler&&(this.painter=new d(e,this._tileHandler.glyphMosaic))})),I.then((()=>this._tileHandlerController=null)),this.updatingHandles.add((()=>({style:this.layer.currentStyleInfo.style,newPixelRatio:this.view.state?.pixelRatio})),(({style:e})=>{this._tileHandlerController&&this._tileHandlerController.abort(),this._tileHandlerController=new AbortController,this._memCache.clear();const t=new f(e),i=new m(this.layer,t,h,this._memCache,j),r=i.start({signal:this._tileHandlerController.signal,schedule:T}),l=i.spriteMosaic;r.then((()=>this._tileHandlerController=null)),this.updatingHandles.addPromise(Promise.all([r,l]).then((([,e])=>{const t=this._tileHandler,r=this.painter;this.painter=new d(e,i.glyphMosaic),this._tileHandler=i,this.emit("data-changed"),t.destroy(),r&&r.dispose()})))}));const S=Promise.all([v,I,b]);this.addResolvingPromise(S)}destroy(){this.painter=l(this.painter),this._tileHandlerController=s(this._tileHandlerController),o(this._tileHandler),this._memCache=o(this._memCache),this._tileHandler=null}get dataLevelRange(){const e=this.tileInfo.lods,t=e[0].scale,i=e[e.length-1].scale,r=this.levelRangeFromScaleRange(t,i);return 1===r.minLevel&&256===this.tileInfo.size[0]&&(r.minLevel=0),r}async fetchTile(e,t,i,r){return this._tileHandler.getVectorTile(e,t,i,r)}};e([h()],v.prototype,"layer",void 0),e([h()],v.prototype,"dataLevelRange",null),e([h()],v.prototype,"updatingProgressValue",void 0),v=e([c("esri.views.3d.layers.VectorTileLayerView3D")],v);const w=v;export{w as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Collection.js";import i from"../../../core/Logger.js";import{isSome as r,isNone as s}from"../../../core/maybe.js";import{whenOnce as o}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{getTileMaxtrixSetFromActiveLayer as n}from"../../../layers/support/layerUtils.js";import{LayerView3D as h}from"./LayerView3D.js";import{TiledLayerView3D as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Collection.js";import i from"../../../core/Logger.js";import{isSome as r,isNone as s}from"../../../core/maybe.js";import{whenOnce as o}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{getTileMaxtrixSetFromActiveLayer as n}from"../../../layers/support/layerUtils.js";import{LayerView3D as h}from"./LayerView3D.js";import{TiledLayerView3D as d}from"./TiledLayerView3D.js";import c from"../../layers/LayerView.js";import m from"../../layers/RefreshableLayerView.js";let p=class extends(m(d(h(c)))){constructor(){super(...arguments),this.type="wmts-3d"}get hasMixedImageFormats(){return!0}_getCompatibleTileInfoMatrixSet(e,s=!1){const o=n(this.layer);if(r(o)){if(t.isCollection(o)){const t=o.find((t=>{const o=e(t);return r(o)&&(s?i.getLogger(this.declaredClass).error("The selected tile matrix set is not compatible with the view",o):this.addResolvingPromise(Promise.reject(o))),null==o}));return t}const a=e(o);return r(a)&&(s?i.getLogger(this.declaredClass).error("The selected tile matrix set is not compatible with the view",a):this.addResolvingPromise(Promise.reject(a))),o}return null}initialize(){this._getCompatibleTileInfoMatrixSet((e=>this._getTileInfoSupportError(e.tileInfo,e.fullExtent)));const e=o((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const e=this._getCompatibleTileInfoMatrixSet((e=>this._getTileInfoError(e.tileInfo,e.fullExtent)));s(e)||(null!==e.id&&this.layer.activeLayer.tileMatrixSetId!==e.id&&(this.layer.activeLayer.tileMatrixSetId=e.id),e.tileInfo&&(this.tileInfo=e.tileInfo),this.layer.fullExtent=e.fullExtent)}));this.addResolvingPromise(e),this.when((()=>this._postInitialize()))}refresh(){this.emit("data-changed")}canResume(){if(!super.canResume())return!1;const e=this.layer.activeLayer.tileMatrixSet;return r(e)&&!this._getTileInfoError(e.tileInfo,e.fullExtent)}async doRefresh(){this.suspended||this.emit("data-changed")}_postInitialize(){this.updatingHandles.add((()=>this.layer?.activeLayer?.styleId),(()=>this.refresh())),this.updatingHandles.add((()=>this.layer?.activeLayer),(e=>{const t=this._getCompatibleTileInfoMatrixSet((e=>this._getTileInfoError(e.tileInfo,e.fullExtent)),!0);r(t)&&null!==t.id&&e.tileMatrixSetId!==t.id&&(this.layer.activeLayer.tileMatrixSetId=t.id),this.notifyChange("suspended"),this.canResume()&&this.refresh()}))}_getTileInfoError(e,t){return this._getTileInfoSupportError(e,t)||this._getTileInfoCompatibilityError(e,this.view.basemapTerrain.tilingScheme)}};e([a({readOnly:!0})],p.prototype,"hasMixedImageFormats",null),e([a()],p.prototype,"layer",void 0),e([a()],p.prototype,"suspended",void 0),p=e([l("esri.views.3d.layers.WMTSLayerView3d")],p);const f=p;export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as t}from"../../../../core/maybe.js";import{c as e}from"../../../../chunks/mat4.js";import{c as o}from"../../../../chunks/mat4f64.js";import{s as n}from"../../../../chunks/vec3.js";import{c as a}from"../../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as r,projectBuffer as s}from"../../../../geometry/projection.js";import{SampleElevationInfo as i}from"./elevationAlignmentUtils.js";import{updateVertexAttributeAuxpos1w as l}from"./graphicUtils.js";import m from"../../support/debugFlags.js";import{SamplePosition as c}from"../../support/ElevationProvider.js";import{isGeometryWithMapPositions as f}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{VertexAttribute as u}from"../../webgl-engine/lib/VertexAttribute.js";function p(t,e,o,n,a){const r=t.stageObject,s=r.geometries;let i=0;for(const l of s){if(!f(l))continue;const{update:t,averageGeometrySampledElevation:s}=O(l,e,o,n,a);i+=s,t&&r.geometryVertexAttrsUpdated(l)}return i/s.length}function d(t,o,a,s,i){const c=t.stageObject,f=o.centerPointInElevationSR;let u=0;if(c.metadata
|
|
5
|
+
import{isNone as t}from"../../../../core/maybe.js";import{c as e}from"../../../../chunks/mat4.js";import{c as o}from"../../../../chunks/mat4f64.js";import{s as n}from"../../../../chunks/vec3.js";import{c as a}from"../../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as r,projectBuffer as s}from"../../../../geometry/projection.js";import{SampleElevationInfo as i}from"./elevationAlignmentUtils.js";import{updateVertexAttributeAuxpos1w as l}from"./graphicUtils.js";import m from"../../support/debugFlags.js";import{SamplePosition as c}from"../../support/ElevationProvider.js";import{isGeometryWithMapPositions as f}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{VertexAttribute as u}from"../../webgl-engine/lib/VertexAttribute.js";function p(t,e,o,n,a){const r=t.stageObject,s=r.geometries;let i=0;for(const l of s){if(!f(l))continue;const{update:t,averageGeometrySampledElevation:s}=O(l,e,o,n,a);i+=s,t&&r.geometryVertexAttrsUpdated(l)}return i/s.length}function d(t,o,a,s,i){const c=t.stageObject,f=o.centerPointInElevationSR;let u=0;if(c.metadata?.usesVerticalDistanceToGround)s(f,A),l(c,A.verticalDistanceToGround),u=A.sampledElevation;else{s(f,A);"absolute-height"!==o.mode&&(u=A.sampledElevation)}const p=e(g,c.transformation),d=n(M,p[12],p[13],p[14]);m.TESTS_DISABLE_OPTIMIZATIONS?(h[0]=f.x,h[1]=f.y,h[2]=A.z,r(f.spatialReference,h,p,i.spatialReference)&&(c.transformation=p)):i.setAltitudeOfTransformation(A.z,p);const b=T/i.unitInMeters;return(Math.abs(p[12]-d[0])>=b||Math.abs(p[13]-d[1])>=b||Math.abs(p[14]-d[2])>=b)&&(c.transformation=p),u}const g=o();function b(e,o,a,s,i){const l=e.graphics3DSymbolLayer.lodRenderer;if(t(l))return 0;const c=o.centerPointInElevationSR;s(c,A);const f="absolute-height"!==o.mode?A.sampledElevation:0,u=l.instanceData,p=e.instanceIndex,d=E;u.getGlobalTransform(p,d);const g=n(M,d[12],d[13],d[14]);m.TESTS_DISABLE_OPTIMIZATIONS?(h[0]=c.x,h[1]=c.y,h[2]=A.z,r(c.spatialReference,h,d,i.spatialReference)&&u.setGlobalTransform(p,d)):i.setAltitudeOfTransformation(A.z,d);const b=T/i.unitInMeters;return(m.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(d[12]-g[0])>=b||Math.abs(d[13]-g[1])>=b||Math.abs(d[14]-g[2])>=b)&&u.setGlobalTransform(p,d),f}function I(t,e,o,n,a){const r=t.stageObject,s=r.geometries;if(0===s.length)return 0;let i=0,l=null,m=0,c=!1;for(const p of s){if(!f(p))continue;const t=p.vertexAttributes.get(u.POSITION);if(t!==l){const{update:r,averageGeometrySampledElevation:s}=O(p,e,o,n,a);m=s,l=t,c=r}c&&r.geometryVertexAttrsUpdated(p),i+=m}return i/s.length}const T=.01,h=a(),S=a(),v=a(),E=o(),M=a(),A=new i;function O(t,e,o,n,a){let r=!1;const i=t.shaderTransformation,l=e.requiresSampledElevationInfo;S[0]=i[12],S[1]=i[13],S[2]=i[14],t.invalidateBoundingInfo();const f=t.getMutableAttribute(u.POSITION),p=f.data,d=f.size,g=p.length/d,b=new c(t.mapPositions,o);let I=0,E=0;for(let c=0;c<g;c++){if(v[0]=p[I],v[1]=p[I+1],v[2]=p[I+2],n(b,A),l&&(E+=A.sampledElevation),m.TESTS_DISABLE_OPTIMIZATIONS)p[I]=b.array[b.offset],p[I+1]=b.array[b.offset+1],p[I+2]=A.z,s(p,o,I,p,a.spatialReference,I,1),p[I]-=S[0],p[I+1]-=S[1],p[I+2]-=S[2],r=!0;else{h[0]=p[I]+S[0],h[1]=p[I+1]+S[1],h[2]=p[I+2]+S[2],a.setAltitude(h,A.z),p[I]=h[0]-S[0],p[I+1]=h[1]-S[1],p[I+2]=h[2]-S[2];const t=T/a.unitInMeters;(Math.abs(v[0]-p[I])>=t||Math.abs(v[1]-p[I+1])>=t||Math.abs(v[2]-p[I+2])>=t)&&(r=!0)}I+=d,b.offset+=3}return E/=g,{update:r,averageGeometrySampledElevation:E}}export{b as perLodInstanceElevationAligner,d as perObjectElevationAligner,p as perVertexElevationAligner,I as sharedGeometryElevationAligner};
|