@arcgis/core 6.0.0-next.55 → 6.0.0-next.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/033b9fcd9833db3b6e7d.js +1 -0
- package/assets/esri/core/workers/chunks/0978e12dd6a1cbc50b80.js +1 -0
- package/assets/esri/core/workers/chunks/{e956845255bce0910944.js → 1507297550c3cd1268e2.js} +1 -1
- package/assets/esri/core/workers/chunks/1c0f5c42331fb6fc26cb.js +1 -0
- package/assets/esri/core/workers/chunks/2cd2fcf4a37d180d5d5c.js +1 -0
- package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +1 -0
- package/assets/esri/core/workers/chunks/3982409149571a827390.js +1 -0
- package/assets/esri/core/workers/chunks/3d851710f7fcc27c5b60.js +2 -0
- package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +1 -0
- package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +1 -0
- package/assets/esri/core/workers/chunks/{e61082f56c08abe54b3a.js → 5954f02c3901b28d8e73.js} +1 -1
- package/assets/esri/core/workers/chunks/5ba6007c3c49a8153256.js +1 -0
- package/assets/esri/core/workers/chunks/5bdd95eeb8f34dbf26f2.js +2 -0
- package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js → 5e47026c681238038955.js} +2 -2
- package/assets/esri/core/workers/chunks/{2baf35b1b19482d603b5.js → 5f7505ada0991cfbdd84.js} +1 -1
- package/assets/esri/core/workers/chunks/{976303f47c342b9d1cc0.js → 62ddd3a82864e26f009a.js} +1 -1
- package/assets/esri/core/workers/chunks/{542a9c414c99d84d52ab.js → 6a202ef9ba9b89e09153.js} +1 -1
- package/assets/esri/core/workers/chunks/{0826feebdca8a31eb630.js → 6ba6fece5c11fe2a6ace.js} +1 -1
- package/assets/esri/core/workers/chunks/{5eb69e2895e5aec81051.js → 6fd10891506925560443.js} +1 -1
- package/assets/esri/core/workers/chunks/7b6fd287e7043ad50f4e.js +1 -0
- package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +1 -0
- package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +1 -0
- package/assets/esri/core/workers/chunks/{c3c0f24a9e0047232ae1.js → 8679dfc0c53355b6feb0.js} +1 -1
- package/assets/esri/core/workers/chunks/8a636dc51372e14c98f5.js +1 -0
- package/assets/esri/core/workers/chunks/{14259910f44c08fd5bbd.js → 9117c9b720c9ba6e7a6e.js} +1 -1
- package/assets/esri/core/workers/chunks/a22458e5272332d86cb9.js +1 -0
- package/assets/esri/core/workers/chunks/{3ea480cebf8ee56228a5.js → a7dfca326883384d2751.js} +1 -1
- package/assets/esri/core/workers/chunks/{723d8316f5d4b6ce2942.js → a9539393e2f1812a973a.js} +1 -1
- package/assets/esri/core/workers/chunks/{be0b8bb4f09aae6ff5de.js → ab784764ddf9d7f693a1.js} +1 -1
- package/assets/esri/core/workers/chunks/b38b6fe08a367e9de4f5.js +1 -0
- package/assets/esri/core/workers/chunks/{4e651869e9a196494694.js → b6e628b5d2643af4c19b.js} +1 -1
- package/assets/esri/core/workers/chunks/{b37ab6b1cb4cfc85cd9d.js → b7828d7e2c5b75644057.js} +1 -1
- package/assets/esri/core/workers/chunks/{ec465abb0344ad719e9d.js → bd8e329ec74d921d311a.js} +1 -1
- package/assets/esri/core/workers/chunks/{56e6e70aa40e51827290.js → c3f94024c6c9eed9f273.js} +1 -1
- package/assets/esri/core/workers/chunks/{6d17b45022dfd2548098.js → c5ddf8b347c31fe772a3.js} +1 -1
- package/assets/esri/core/workers/chunks/{ee9af58ae202b803bba7.js → c7a0c4ca37ebd1d98cf1.js} +1 -1
- package/assets/esri/core/workers/chunks/d7763c42754152510e13.js +2 -0
- package/assets/esri/core/workers/chunks/{9e508f930086d2ef5f22.js → dfa1b0308e5e82d1ddfe.js} +40 -41
- package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +1 -0
- package/assets/esri/core/workers/chunks/e74586b074d0fa6abb4b.js +1 -0
- package/assets/esri/core/workers/chunks/e7dff025780726d5feae.js +1 -0
- package/assets/esri/core/workers/chunks/e96fa029acba59c04e4e.js +2 -0
- package/assets/esri/core/workers/chunks/{4401b3f8ebb658abe789.js → efd6ea0966f60ab19520.js} +1 -1
- package/assets/esri/core/workers/chunks/fdfbd201be372d3796bf.js +2 -0
- package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +1 -0
- package/chunks/BlendLayers.glsl.js +1 -1
- package/chunks/ColorMaterial.glsl.js +14 -14
- package/chunks/Component.glsl.js +37 -37
- package/chunks/DefaultMaterial.glsl.js +15 -15
- package/chunks/HUDMaterial.glsl.js +3 -3
- package/chunks/Path.glsl.js +15 -15
- package/chunks/Pattern.glsl.js +20 -20
- package/chunks/RasterColorizer.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +24 -24
- package/chunks/Water.glsl.js +29 -20
- package/chunks/pdf.js +57 -0
- package/config.js +1 -1
- package/core/accessorSupport/write.js +1 -1
- package/core/scheduling.js +1 -1
- package/kernel.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -56
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/geospatialPDF/parserUtils.js +2 -0
- package/layers/support/ControlPoint.js +1 -1
- package/layers/support/ControlPointsGeoreference.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/layers/support/geospatialPDFUtils.d.ts +63 -0
- package/layers/support/geospatialPDFUtils.js +2 -0
- package/package.json +5 -5
- package/symbols/CIMSymbol.d.ts +9 -9
- package/symbols/PathSymbol3DLayer.d.ts +1 -1
- package/symbols/WaterSymbol3DLayer.d.ts +13 -1
- package/symbols/WaterSymbol3DLayer.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/EnvironmentView.js +1 -1
- package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/Manipulator3DBase.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/support/Tiles3DBVH.js +1 -1
- package/views/3d/layers/support/createTileBVHForLayer.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
- package/views/3d/terrain/BlendLayersTechniqueConfiguration.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/RasterColorizerTechniqueConfiguration.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/clampShadowPosition.glsl.js +2 -0
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +14 -14
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -3
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Program.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/Attribution.js +5 -5
- package/views/DOMContainer.d.ts +2 -1
- package/views/SceneView.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/webgl/Program.js +3 -3
- package/views/webgl/ShaderBuilder.js +23 -23
- package/webscene/Slide.js +1 -1
- package/webscene/VirtualLighting.d.ts +2 -4
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +17 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.d.ts +7 -0
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/support/ContingentValuesManager.js +1 -1
- package/widgets/support/forms/types.d.ts +23 -1
- package/assets/esri/core/workers/chunks/144f18a3dd2c8cf07cf7.js +0 -1
- package/assets/esri/core/workers/chunks/23fc1c1ed483ed3b2298.js +0 -1
- package/assets/esri/core/workers/chunks/249a687ce1b6d0815242.js +0 -1
- package/assets/esri/core/workers/chunks/2634927d26cb1139c6d0.js +0 -1
- package/assets/esri/core/workers/chunks/2d1b8154ee40afc9d40b.js +0 -1
- package/assets/esri/core/workers/chunks/4a41bf3d1e2e9bb79771.js +0 -2
- package/assets/esri/core/workers/chunks/5f324d88785ffcb73ae0.js +0 -1
- package/assets/esri/core/workers/chunks/70695e0fb53018d48e7b.js +0 -2
- package/assets/esri/core/workers/chunks/723c9ad4c25be2b82476.js +0 -1
- package/assets/esri/core/workers/chunks/766a1357be2ed7f4e125.js +0 -1
- package/assets/esri/core/workers/chunks/844c593754b2692257f4.js +0 -1
- package/assets/esri/core/workers/chunks/846248697c398468d8e6.js +0 -1
- package/assets/esri/core/workers/chunks/89e55895683369b5277a.js +0 -1
- package/assets/esri/core/workers/chunks/8c94e987754b3919181e.js +0 -1
- package/assets/esri/core/workers/chunks/919115788da38049aea7.js +0 -2
- package/assets/esri/core/workers/chunks/a116dd204921e7464944.js +0 -1
- package/assets/esri/core/workers/chunks/b33e7e74cf8fa3926617.js +0 -1
- package/assets/esri/core/workers/chunks/bb2af16e55cb39163827.js +0 -1
- package/assets/esri/core/workers/chunks/d5bb9f9b7b341c671525.js +0 -1
- package/assets/esri/core/workers/chunks/d96e63d66f7b1f4ea54a.js +0 -2
- package/assets/esri/core/workers/chunks/e3bcd2e356f75afc316a.js +0 -1
- package/assets/esri/core/workers/chunks/e80526571f1a34de3278.js +0 -1
- package/assets/esri/core/workers/chunks/ea71850ba87ae6038000.js +0 -1
- package/assets/esri/core/workers/chunks/f537a5e808dc546813c7.js +0 -1
- package/assets/esri/core/workers/chunks/fe811d651d201f698b8f.js +0 -2
- package/chunks/NativeLine.glsl.js +0 -8
- package/layers/geospatialPDF/geospatialPDFParserUtils.js +0 -2
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +0 -2
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +0 -2
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +0 -2
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +0 -2
- /package/assets/esri/core/workers/chunks/{919115788da38049aea7.js.LICENSE.txt → 3d851710f7fcc27c5b60.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{fe811d651d201f698b8f.js.LICENSE.txt → 5bdd95eeb8f34dbf26f2.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js.LICENSE.txt → 5e47026c681238038955.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{4a41bf3d1e2e9bb79771.js.LICENSE.txt → d7763c42754152510e13.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d96e63d66f7b1f4ea54a.js.LICENSE.txt → e96fa029acba59c04e4e.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{70695e0fb53018d48e7b.js.LICENSE.txt → fdfbd201be372d3796bf.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../core/accessorSupport/decorators.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../core/accessorSupport/decorators.js";import"../../core/has.js";import{Loadable as n}from"../../core/Loadable.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{open as i}from"../../core/workers.js";import{parse as a}from"./parserUtils.js";let o=class extends n{constructor(){super(...arguments),this._connection=null,this._workerHandler=null}load(e){let t=i(`GeospatialPDFLayerWorker`,{...e,strategy:`dedicated`,registryTarget:this}).then(e=>{this._connection=e,this._workerHandler=this._connection.createInvokeProxy()});return this.addResolvingPromise(t),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null,super.destroy()}async loadPDF(e,t={}){await this.load(t);let{geospatialMetadata:n,pageNumber:i,numPages:o}=await this._workerHandler.loadPDF(e,t),s=await a(n,0);return r(t),{frame:s,sourceSpatialReference:s.spatialReference.toJSON(),neatlineExtent:s.toExtent()}}async render(e,t,n,r,i,a){let o={sourceExtentAsJSON:e.toJSON(),width:t,height:n,ctm:r,currentRing:i};return this._workerHandler.renderPDF(o,a)}};o=e([t(`esri.layers.geospatialPDF.GeospatialPDFWorkerClient`)],o);export{o as GeospatialPDFWorkerClient};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import e from"../../core/Error.js";import"../../core/has.js";import t from"./GeospatialPDFFrame.js";import{LGIDictMapFrame as n}from"./LGIDictMapFrame.js";import{projectionToSpatialReference as r}from"./support/projectionToSpatialReference.js";import{ViewportMeasureFrame as i}from"./ViewportMeasureFrame.js";async function a(t,n=0){_(t.MediaBox),x(t.Rotate),t.LGIDict,t.VP;let{mapFrames:r,errors:i}=await o(t);if(!r.length){if(i.length){let t=i[0];throw new e(`geospatial-pdf-layer:load`,`${t.sourceType} frame ${t.frameIndex} is invalid`,`${t.message}`)}throw new e(`geospatial-pdf-layer:load`,`PDF does not contain LGIDict or VP/Measure geospatial metadata.`)}let a=n??0;if(!Number.isInteger(a)||a<0||a>=r.length)throw new e(`geospatial-pdf-layer:invalid-frame`,`Invalid map frame index: ${a}.`);return r[a].frame}async function o(n){let r=[],i=[],a=_(n.MediaBox),o=[{sourceType:`VP`,value:n.VP},{sourceType:`LGIDict`,value:n.LGIDict}];for(let{sourceType:d,value:f}of o){if(f==null)continue;let o=Array.isArray(f)?f:[f];for(let f=0;f<o.length;f++)try{let i=d===`VP`?await c(u(o[f]),a,n.geographicBounds):await s(l(o[f]),a,n.geographicBounds),[p,m,h,g]=i.ctm,_=p*g-m*h;if(!i.ctm.every(Number.isFinite)||!Number.isFinite(_)||_===0)throw new e(`geospatial-pdf-layer:invalid-frame`,`Map frame has an invalid CTM.`);let v=new t(i),y=v.getPageCoveragePercent();r.push({sourceType:d,frameIndex:f,frame:v,pageCoveragePercent:y})}catch(e){i.push({sourceType:d,frameIndex:f,message:e instanceof Error?e.message:String(e)})}}return r.sort((e,t)=>t.pageCoveragePercent-e.pageCoveragePercent),{mapFrames:r,errors:i}}async function s(t,i,a){if(!t.Projection)throw new e(`geospatial-pdf-layer:parse`,`LGIDict map frame missing Projection.`);let o=r(t.Projection),s;try{s=t.Display?r(t.Display):void 0}catch{s=o}return await n.create({ctm:t.CTM,registration:t.Registration,projection:o,display:s,neatline:t.Neatline,mediaBox:i,geographicBounds:a})}async function c(e,t,n){return await i.create({bbox:e.BBox,bounds:e.Measure?.Bounds,gpts:e.Measure?.GPTS,lpts:e.Measure?.LPTS,gcs:e.Measure?.GCS,mediaBox:t,geographicBounds:n})}function l(e){let t=C(e,`LGIDict map frame must be an object.`);return{CTM:_(t.CTM),Registration:v(t.Registration),Neatline:_(t.Neatline),Projection:p(t.Projection),Display:p(t.Display)}}function u(e){let t=C(e,`Viewport frame must be an object.`),n=d(t.Measure);return{BBox:_(t.BBox),Measure_Raw:t.Measure,Measure:n,Raw:t}}function d(e){if(S(e))return{Bounds:_(e.Bounds),GPTS:_(e.GPTS),LPTS:_(e.LPTS),GCS:f(e.GCS)}}function f(e){if(S(e))return{WKT:y(e.WKT),EPSG:x(e.EPSG)}}function p(e){if(S(e))return{Type:b(e.Type),Units:b(e.Units),Datum:m(e.Datum),Projection_Type:b(e.ProjectionType),Central_Meridian:x(e.CentralMeridian),False_Easting:x(e.FalseEasting),False_Northing:x(e.FalseNorthing),Height:x(e.Height),Hemisphere:b(e.Hemisphere),Latitude_One:x(e.LatitudeOne),Latitude_Two:x(e.LatitudeTwo),Latitude_Of_True_Scale:x(e.LatitudeOfTrueScale),Longitude_One:x(e.LongitudeOne),Longitude_Two:x(e.LongitudeTwo),Longitude_Down_From_Pole:x(e.LongitudeDownFromPole),Orientation:b(e.Orientation),Origin_Height:x(e.OriginHeight),Origin_Latitude:x(e.OriginLatitude),Origin_Longitude:x(e.OriginLongitude),Scale_Factor:x(e.ScaleFactor),Standard_Parallel:x(e.StandardParallel),Standard_Parallel_One:x(e.StandardParallelOne),Standard_Parallel_Two:x(e.StandardParallelTwo),Zone:x(e.Zone),Description:b(e.Description),raw:e}}function m(e){return e==null?null:typeof e==`string`?{kind:`name`,name:b(e),ellipsoid:null,to_WGS84:null,raw:e}:S(e)?{kind:`definition`,name:b(e.Description),ellipsoid:h(e.Ellipsoid),to_WGS84:g(e.ToWGS84),raw:e}:{kind:`unknown`,name:b(e),ellipsoid:null,to_WGS84:null,raw:e}}function h(e){if(S(e))return{semi_Major_Axis:x(e.SemiMajorAxis),inverse_Flattening:x(e.InvFlattening),semi_Minor_Axis:x(e.SemiMinorAxis),description:b(e.Description)}}function g(e){if(S(e))return{dx:x(e.dx)??0,dy:x(e.dy)??0,dz:x(e.dz)??0,rx:x(e.rx)??0,ry:x(e.ry)??0,rz:x(e.rz)??0,sf:x(e.sf)??0}}function _(e){if(!Array.isArray(e))return;let t=[];for(let n of e){let e=x(n);if(e===void 0)return;t.push(e)}return t}function v(e){if(Array.isArray(e))return e.filter(e=>Array.isArray(e)).map(e=>e.map(e=>x(e)).filter(e=>e!==void 0))}function y(e){if(e!=null)return typeof e==`string`?e:String(e)}function b(e){let t=y(e);if(t!==void 0)return t.trim()}function x(e){if(e==null)return;if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(typeof e!=`string`)return;let t=e.trim();if(t===``)return;let n=Number(t);return Number.isFinite(n)?n:void 0}function S(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function C(t,n){if(!S(t))throw new e(`geospatial-pdf-layer:parse`,n);return t}export{a as parse,o as parseAllFrames};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{Clonable as r}from"../../core/Clonable.js";import i from"../../geometry/Point.js";let a=class extends r{constructor(e){super(e),this.sourcePoint=null,this.mapPoint=null}};e([t()],a.prototype,`sourcePoint`,void 0),e([t({type:i})],a.prototype,`mapPoint`,void 0),a=e([n(`esri.layers.support.ControlPoint`)],a);
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{Clonable as r}from"../../core/Clonable.js";import i from"../../geometry/Point.js";let a=class extends r{constructor(e){super(e),this.sourcePoint=null,this.mapPoint=null}};e([t()],a.prototype,`sourcePoint`,void 0),e([t({type:i})],a.prototype,`mapPoint`,void 0),a=e([n(`esri.layers.support.ControlPoint`)],a);export{a as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{Clonable as r}from"../../core/Clonable.js";import i from"../../core/Error.js";import{JSONSupportMixin as a,JSONSupport as o}from"../../core/JSONSupport.js";import{invert as s}from"../../core/libs/gl-matrix-2/math/mat3.js";import{fromValues as c,create as l}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as u,
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{Clonable as r}from"../../core/Clonable.js";import i from"../../core/Error.js";import{JSONSupportMixin as a,JSONSupport as o}from"../../core/JSONSupport.js";import{invert as s}from"../../core/libs/gl-matrix-2/math/mat3.js";import{fromValues as c,create as l}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as u,lerp as d,rotate as f}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as p,fromValues as m}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import h from"../../core/Logger.js";import{transformProjective as g,getProjectiveTransform as _}from"../../core/perspectiveUtils.js";import{createScreenPoint as v}from"../../core/screenUtils.js";import y from"../../geometry/Point.js";import b from"../../geometry/Polygon.js";import{projectOrLoad as x}from"../../geometry/projectionUtils.js";import S from"../../geometry/SpatialReference.js";import C from"./ControlPoint.js";import{GeoreferenceBaseMixin as w}from"./GeoreferenceBaseMixin.js";import{reader as T}from"../../core/accessorSupport/decorators/reader.js";import{writer as E}from"../../core/accessorSupport/decorators/writer.js";const D=l(),O=p();let k=class extends o{};e([t({type:Number,json:{write:{isRequired:!0}}})],k.prototype,`x`,void 0),e([t({type:Number,json:{write:{isRequired:!0}}})],k.prototype,`y`,void 0),k=e([n(`esri.layers.support.ControlPointsGeoreference.ControlPointJSONType`)],k);let A=class extends a(w(r)){constructor(e){super(e),this.height=0,this.type=`control-points`,this.width=0}get controlPoints(){return this._get(`controlPoints`)??null}set controlPoints(e){this._set(`controlPoints`,e)}readControlPoints(e,t){let n=S.fromJSON(t.spatialReference),r=c(...t.coefficients,1);return e.map(e=>(u(O,e.x,e.y),g(O,O,r),{sourcePoint:e,mapPoint:new y({x:O[0],y:O[1],spatialReference:n})}))}writeControlPoints(e,t,n,r){if(this.transform==null){let e=new i(`web-document-write:invalid-georeference`,`Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.`,{layer:r?.layer,georeference:this});r?.messages?r.messages.push(e):h.getLogger(this).error(e.name,e.message)}else e!=null&&j(e[0])&&(t.controlPoints=e.map(e=>{let t=e.sourcePoint;return{x:t.x,y:t.y}}),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8))}get coords(){if(this.controlPoints==null)return null;let e=this._updateTransform(D);if(e==null||!j(this.controlPoints[0]))return null;let t=this.controlPoints[0].mapPoint.spatialReference;return Y(e,this.width,this.height,t)}set coords(e){if(this.controlPoints==null||!j(this.controlPoints[0]))return;let t=this.controlPoints[0].mapPoint.spatialReference;if(e=this.projectOrWarn(e,t),e==null)return;let{width:n,height:r}=this,{rings:[[i,a,o,s]]}=e,c=new C({sourcePoint:v(0,r),mapPoint:new y({x:i[0],y:i[1],spatialReference:t})}),l=new C({sourcePoint:v(0,0),mapPoint:new y({x:a[0],y:a[1],spatialReference:t})}),d=new C({sourcePoint:v(n,0),mapPoint:new y({x:o[0],y:o[1],spatialReference:t})}),f=new C({sourcePoint:v(n,r),mapPoint:new y({x:s[0],y:s[1],spatialReference:t})});j(c)&&j(l)&&j(d)&&j(f)&&(W(D,c,l,d,f),this.controlPoints=this.controlPoints.map(({sourcePoint:e})=>(u(O,e.x,e.y),g(O,O,D),{sourcePoint:e,mapPoint:new y({x:O[0],y:O[1],spatialReference:t})})))}get inverseTransform(){return this.transform==null?null:s(l(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(e==null||this.transform==null||this.controlPoints==null||!j(this.controlPoints[0]))return null;u(O,e.x,e.y);let t=this.controlPoints[0].mapPoint.spatialReference;return g(O,O,this.transform),new y({x:O[0],y:O[1],spatialReference:t})}toSource(e){if(e==null||this.inverseTransform==null||this.controlPoints==null||!j(this.controlPoints[0]))return null;let t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),e=x(e,t).geometry,e==null?null:(u(O,e.x,e.y),g(O,O,this.inverseTransform),v(O[0],O[1]))}toSourceNormalized(e){let t=this.toSource(e);return t!=null&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){let{controlPoints:t,width:n,height:r}=this;if(t==null||!(n>0)||!(r>0))return null;let[i,a,o,s]=t;if(!j(i))return null;let c=i.mapPoint.spatialReference,u=this._projectControlPoint(a,c),d=this._projectControlPoint(o,c),f=this._projectControlPoint(s,c);if(!u.valid||!d.valid||!f.valid||!j(u.controlPoint))return null;e??=l();let p=null;return p=j(d.controlPoint)&&j(f.controlPoint)?W(e,i,u.controlPoint,d.controlPoint,f.controlPoint):j(d.controlPoint)?U(e,i,u.controlPoint,d.controlPoint):H(e,i,u.controlPoint),p.every(e=>e===0)?null:p}_projectControlPoint(e,t){if(!j(e))return{valid:!0,controlPoint:e};let{sourcePoint:n,mapPoint:r}=e,{geometry:i,pending:a}=x(r,t);return a?{valid:!1,controlPoint:null}:!a&&!i?(h.getLogger(this).warn(`map point could not be projected to the spatial reference`,{georeference:this,controlPoint:e,sourceSpatialReference:r.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null}):{valid:!0,controlPoint:new C({sourcePoint:n,mapPoint:i})}}};e([t({type:[C],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[k],isRequired:!0},coefficients:{type:[Number],isRequired:!0},spatialReference:{type:S,isRequired:!0}}}}})],A.prototype,`controlPoints`,null),e([T(`controlPoints`)],A.prototype,`readControlPoints`,null),e([E(`controlPoints`)],A.prototype,`writeControlPoints`,null),e([t({clonable:!1})],A.prototype,`coords`,null),e([t({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],A.prototype,`height`,void 0),e([t({readOnly:!0})],A.prototype,`inverseTransform`,null),e([t({readOnly:!0})],A.prototype,`transform`,null),e([t({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],A.prototype,`width`,void 0),A=e([n(`esri.layers.support.ControlPointsGeoreference`)],A);function j(e){return e?.sourcePoint!=null&&e.mapPoint!=null}const M=p(),N=p(),P=p(),F=p(),I=p(),L=p(),R=p(),z=p(),B=Math.PI/2;function V(e,t,n){u(e,n.sourcePoint.x,n.sourcePoint.y),u(t,n.mapPoint.x,n.mapPoint.y)}function H(e,t,n){return V(M,I,t),V(N,L,n),f(P,N,M,B),f(F,M,N,B),f(R,L,I,-B),f(z,I,L,-B),J(e,M,N,P,F,I,L,R,z)}function U(e,t,n,r){return V(M,I,t),V(N,L,n),V(P,R,r),d(F,M,N,.5),f(F,P,F,Math.PI),d(z,I,L,.5),f(z,R,z,Math.PI),J(e,M,N,P,F,I,L,R,z)}function W(e,t,n,r,i){return V(M,I,t),V(N,L,n),V(P,R,r),V(F,z,i),J(e,M,N,P,F,I,L,R,z)}const G=Array(8).fill(0),K=Array(8).fill(0);function q(e,t,n,r,i){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=r[0],e[5]=r[1],e[6]=i[0],e[7]=i[1],e}function J(e,t,n,r,i,a,o,s,c){return _(e,q(G,t,n,r,i),q(K,a,o,s,c))}function Y(e,t,n,r){let i=m(0,n),a=m(0,0),o=m(t,0),s=m(t,n);return g(i,i,e),g(a,a,e),g(o,o,e),g(s,s,e),new b({rings:[[i,a,o,s,i]],spatialReference:r})}export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{excludeTables as e}from"../../core/accessorSupport/layerContainerType.js";import{JSONMap as t}from"../../core/jsonMap.js";import n from"../../geometry/Extent.js";import r from"../../geometry/SpatialReference.js";import{w as i}from"../../chunks/persistableUrlUtils.js";import a from"../../symbols/support/ElevationInfo.js";import o from"../../tables/AttributeTableTemplate.js";import{transparencyToOpacity as s}from"../../webdoc/support/opacityUtils.js";import c from"./TimeInfo.js";const l={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:`screenSizePerspective`,write:{enabled:!0,layerContainerTypes:e}}},u={type:Boolean,value:!0,json:{name:`disablePopup`,read:{reader(e,t){return!t.disablePopup}},write:{enabled:!0,writer(e,t,n){t[n]=!e}}}},d={type:Boolean,value:!0,nonNullable:!0,json:{name:`showLabels`,write:{enabled:!0,layerContainerTypes:e}}},f={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:i}}},p={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:`showLegend`,write:{enabled:!0,layerContainerTypes:e}}},m={value:null,type:a,json:{origins:{service:{name:`elevationInfo`,write:!0}},name:`layerDefinition.elevationInfo`,write:{enabled:!0,layerContainerTypes:e}}};function h(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const g={write:{enabled:!0,layerContainerTypes:e},read:!0},_={type:Number,json:{origins:{"web-document":g,"portal-item":{write:{layerContainerTypes:e}}}}},v={..._,json:{..._.json,origins:{"web-document":{...g,write:{enabled:!0,layerContainerTypes:e,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:[`layerDefinition.drawingInfo.transparency`,`drawingInfo.transparency`],reader(e,t,n){if((!n||n.origin===`service`)&&t.drawingInfo&&t.drawingInfo.transparency!==void 0)return s(t.drawingInfo.transparency);if(t.layerDefinition?.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0)return s(t.layerDefinition.drawingInfo.transparency)}}}},y={type:n,readOnly:!0,json:{origins:{service:{read:{source:[`fullExtent`,`spatialReference`],reader:(e,t)=>{let i=n.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference==`object`&&(i.spatialReference=r.fromJSON(t.spatialReference)),i}}}},read:!1}},b={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},x={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:`layerDefinition.minScale`,write:{layerContainerTypes:e}}},S={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:`layerDefinition.maxScale`,write:{layerContainerTypes:e}}},C={json:{write:{ignoreOrigin:!0,layerContainerTypes:e},origins:{"web-map":{read:!1,write:!1}}}},w={type:o,json:{name:`attributeTableInfo`,write:!0}},T=new t({High:`high`,Medium:`medium`,Low:`low`,None:`none`}),E={type:T.apiValues,json:{name:`layerDefinition.barrierWeight`,default:`high`,read:T.read,write:T.write,origins:{service:{read:!1}}}};function D(e){return{name:`layerDefinition.timeInfo`,read:!0,write:{enabled:!0,overridePolicy(t,n){return{enabled:!0,allowNull:this.originIdOf(n)>=3,ignoreOrigin:e?this.originIdOf(n)<3:!1}}}}}function O(e){let t=e?.alwaysWriteNonItemOrigin,n={[e?.webDocumentOrigin??`web-document`]:D(t),"portal-item":D(t)};return e?.disableServiceOrigin&&(n.service={read:!1,write:!1}),{type:c,json:{name:e?.name,origins:n}}}export{w as attributeTableTemplate,E as barrierWeight,m as elevationInfo,b as id,d as labelsVisible,p as legendEnabled,C as listMode,S as maxScale,x as minScale,_ as opacity,v as opacityDrawingInfo,u as popupEnabled,h as readOnlyService,y as sceneLayerFullExtent,l as screenSizePerspectiveEnabled,O as timeInfo,f as url};
|
|
2
|
+
import{excludeTables as e}from"../../core/accessorSupport/layerContainerType.js";import{JSONMap as t}from"../../core/jsonMap.js";import n from"../../geometry/Extent.js";import r from"../../geometry/SpatialReference.js";import{w as i}from"../../chunks/persistableUrlUtils.js";import a from"../../symbols/support/ElevationInfo.js";import o from"../../tables/AttributeTableTemplate.js";import{transparencyToOpacity as s}from"../../webdoc/support/opacityUtils.js";import c from"./TimeInfo.js";const l={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:`screenSizePerspective`,write:{enabled:!0,layerContainerTypes:e}}},u={type:Boolean,value:!0,json:{name:`disablePopup`,read:{reader(e,t){return!t.disablePopup}},write:{enabled:!0,writer(e,t,n){t[n]=!e}}}},d={type:Boolean,value:!0,nonNullable:!0,json:{name:`showLabels`,write:{enabled:!0,layerContainerTypes:e},origins:{"web-scene":{name:`showLabels`,default:!1,write:{enabled:!0,layerContainerTypes:e}}}}},f={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:i}}},p={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:`showLegend`,write:{enabled:!0,layerContainerTypes:e}}},m={value:null,type:a,json:{origins:{service:{name:`elevationInfo`,write:!0}},name:`layerDefinition.elevationInfo`,write:{enabled:!0,layerContainerTypes:e}}};function h(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const g={write:{enabled:!0,layerContainerTypes:e},read:!0},_={type:Number,json:{origins:{"web-document":g,"portal-item":{write:{layerContainerTypes:e}}}}},v={..._,json:{..._.json,origins:{"web-document":{...g,write:{enabled:!0,layerContainerTypes:e,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:[`layerDefinition.drawingInfo.transparency`,`drawingInfo.transparency`],reader(e,t,n){if((!n||n.origin===`service`)&&t.drawingInfo&&t.drawingInfo.transparency!==void 0)return s(t.drawingInfo.transparency);if(t.layerDefinition?.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0)return s(t.layerDefinition.drawingInfo.transparency)}}}},y={type:n,readOnly:!0,json:{origins:{service:{read:{source:[`fullExtent`,`spatialReference`],reader:(e,t)=>{let i=n.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference==`object`&&(i.spatialReference=r.fromJSON(t.spatialReference)),i}}}},read:!1}},b={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},x={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:`layerDefinition.minScale`,write:{layerContainerTypes:e}}},S={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:`layerDefinition.maxScale`,write:{layerContainerTypes:e}}},C={json:{write:{ignoreOrigin:!0,layerContainerTypes:e},origins:{"web-map":{read:!1,write:!1}}}},w={type:o,json:{name:`attributeTableInfo`,write:!0}},T=new t({High:`high`,Medium:`medium`,Low:`low`,None:`none`}),E={type:T.apiValues,json:{name:`layerDefinition.barrierWeight`,default:`high`,read:T.read,write:T.write,origins:{service:{read:!1}}}};function D(e){return{name:`layerDefinition.timeInfo`,read:!0,write:{enabled:!0,overridePolicy(t,n){return{enabled:!0,allowNull:this.originIdOf(n)>=3,ignoreOrigin:e?this.originIdOf(n)<3:!1}}}}}function O(e){let t=e?.alwaysWriteNonItemOrigin,n={[e?.webDocumentOrigin??`web-document`]:D(t),"portal-item":D(t)};return e?.disableServiceOrigin&&(n.service={read:!1,write:!1}),{type:c,json:{name:e?.name,origins:n}}}export{w as attributeTableTemplate,E as barrierWeight,m as elevationInfo,b as id,d as labelsVisible,p as legendEnabled,C as listMode,S as maxScale,x as minScale,_ as opacity,v as opacityDrawingInfo,u as popupEnabled,h as readOnlyService,y as sceneLayerFullExtent,l as screenSizePerspectiveEnabled,O as timeInfo,f as url};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides utility functions for the [GeospatialPDFLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeospatialPDFLayer/).
|
|
3
|
+
*
|
|
4
|
+
* @since 6.0
|
|
5
|
+
* @see [GeospatialPDFLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeospatialPDFLayer/)
|
|
6
|
+
*/
|
|
7
|
+
import type Extent from "../../geometry/Extent.js";
|
|
8
|
+
import type SpatialReference from "../../geometry/SpatialReference.js";
|
|
9
|
+
import type GeospatialPDFLayer from "../GeospatialPDFLayer.js";
|
|
10
|
+
import type { AbortOptions } from "../../core/promiseUtils.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* todo: doc information about the unsupported PDF for the [getGeospatialPDFInfo()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/geospatialPDFUtils/#getGeospatialPDFInfo) function.
|
|
14
|
+
* is supported - false (it wont work for layer)
|
|
15
|
+
* loaded - was the data for the pdf downloaded
|
|
16
|
+
* corrupted - is the pdf corrupt
|
|
17
|
+
* password protected - is the pdf password protected
|
|
18
|
+
* hasValidGeoreference - is the PDF properly georeferenced
|
|
19
|
+
*/
|
|
20
|
+
export interface UnsupportedGeospatialPDFInfo {
|
|
21
|
+
isSupported: false;
|
|
22
|
+
loaded: boolean;
|
|
23
|
+
corrupted: boolean;
|
|
24
|
+
passwordProtected: boolean;
|
|
25
|
+
hasValidGeoreference: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** todo: doc information about a supported geospatial PDF map frame. */
|
|
29
|
+
export interface GeospatialPDFMapFrameInfo {
|
|
30
|
+
spatialReference: SpatialReference;
|
|
31
|
+
page: number;
|
|
32
|
+
fullExtent: Extent;
|
|
33
|
+
neatlineExtent: Extent;
|
|
34
|
+
coverage: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* todo: total result for PDF [getGeospatialPDFInfo()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/geospatialPDFUtils/#getGeospatialPDFInfo) function.
|
|
39
|
+
* isSupported - true ( it will work for layer)
|
|
40
|
+
* data - the data type that it is
|
|
41
|
+
* loaded data- array buffer that represents the data of PDF
|
|
42
|
+
* coverage - the percent of the frame area compared to the page area
|
|
43
|
+
* mapframe - the map frames found in document. One per page. Max area of each page is picked.
|
|
44
|
+
*/
|
|
45
|
+
export interface SupportedGeospatialPDFInfo {
|
|
46
|
+
isSupported: true;
|
|
47
|
+
title: string | null;
|
|
48
|
+
data: GeospatialPDFLayer["data"];
|
|
49
|
+
loadedData: ArrayBuffer;
|
|
50
|
+
mapFrames: GeospatialPDFMapFrameInfo[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Result of [getGeospatialPDFInfo()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/geospatialPDFUtils/#getGeospatialPDFInfo). */
|
|
54
|
+
export type GeospatialPDFInfo = UnsupportedGeospatialPDFInfo | SupportedGeospatialPDFInfo;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The GeospatialPDF info inferred for the layer
|
|
58
|
+
*
|
|
59
|
+
* @param pdfSource - The PDF file or URL.
|
|
60
|
+
* @param options - An object specifying additional options.
|
|
61
|
+
* @returns A promise that resolves to the PDF information.
|
|
62
|
+
*/
|
|
63
|
+
export function getGeospatialPDFInfo(pdfSource: File | string, options?: AbortOptions): Promise<GeospatialPDFInfo>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import{getAssetUrl as e}from"../../assets.js";import{throwIfAborted as t,onAbort as n,throwIfAbortError as r}from"../../core/promiseUtils.js";import{G as i,g as a}from"../../chunks/pdf.js";import o from"../../request.js";import{parseAttachments as s}from"../geospatialPDF/parseAttachmentUtils.js";import{parseAllFrames as c}from"../geospatialPDF/parserUtils.js";async function l(c,l={}){let p=null,m=null,h=null,g=null,_=()=>(g||=p?.destroy().catch(()=>{})??Promise.resolve(),g),v=!1,y=!1;try{t(l);let g=typeof c==`string`?c:URL.createObjectURL(c);typeof c!=`string`&&(m=g);let{data:b}=await o(g,{responseType:`array-buffer`,signal:l.signal});t(l),v=!0,i.workerSrc=e(`esri/libs/pdfjs/pdf.worker.mjs`),p=a({data:b.slice(),wasmUrl:e(`esri/libs/pdfjs/wasm/`),useWasm:!0,useWorkerFetch:!0,verbosity:0}),h=n(l,()=>{_()})??null;let x=await p.promise;t(l);let S=await x.getAttachments();t(l);let C=s(S),w=[];for(let e=1;e<=x.numPages;e++){let n=null;try{n=await x.getPage(e),t(l);let r=await n.getGeospatialPDFMetadata();t(l);let i=await u({...r,geographicBounds:C},e);t(l),i.length>0&&(w.push(i[0]),y=!0)}catch(e){r(e)}finally{n?.cleanup()}}return w.length?{isSupported:!0,title:await f(x,l),data:c,loadedData:b,mapFrames:w}:d(null,v,y)}catch(e){return t(l),r(e),d(e,v,y)}finally{m&&URL.revokeObjectURL(m),h?.remove(),await _()}}async function u(e,t){let{mapFrames:n}=await c(e);return n.map(({frame:e,pageCoveragePercent:n})=>({spatialReference:e.spatialReference,fullExtent:e.outerExtentMediabox,neatlineExtent:e.toExtent(),page:t,coverage:Math.round(n)}))}function d(e,t,n){let r=e instanceof Error?e.name:null;return{isSupported:!1,loaded:t,corrupted:r===`InvalidPDFException`,passwordProtected:r===`PasswordException`,hasValidGeoreference:n}}async function f(e,n){let{info:r}=await e.getMetadata();return t(n),r.Title||null}export{l as getGeospatialPDFInfo};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "6.0.0-next.
|
|
3
|
+
"version": "6.0.0-next.56",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"type": "module",
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@amcharts/amcharts5": "~5.
|
|
23
|
-
"@arcgis/toolkit": "6.0.0-next.
|
|
22
|
+
"@amcharts/amcharts5": "~5.25.0",
|
|
23
|
+
"@arcgis/toolkit": "6.0.0-next.56",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.2.0",
|
|
25
|
-
"@esri/calcite-components": "^5.2.
|
|
25
|
+
"@esri/calcite-components": "^5.2.2",
|
|
26
26
|
"@vaadin/grid": "~25.3.7",
|
|
27
27
|
"@zip.js/zip.js": "~2.25.1",
|
|
28
28
|
"luxon": "~3.7.2",
|
|
29
|
-
"marked": "~18.
|
|
29
|
+
"marked": "~18.4.0",
|
|
30
30
|
"tslib": "^2.8.1"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/symbols/CIMSymbol.d.ts
CHANGED
|
@@ -64,30 +64,30 @@ export interface CIMSymbolProperties extends SymbolProperties, Partial<Pick<CIMS
|
|
|
64
64
|
* <th>Role</th>
|
|
65
65
|
* </tr>
|
|
66
66
|
* <tr>
|
|
67
|
-
* <td><a href="
|
|
68
|
-
* <td>Marker layers: <a href="
|
|
67
|
+
* <td><a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPointSymbol">CIMPointSymbol</a></td>
|
|
68
|
+
* <td>Marker layers: <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMVectorMarker">CIMVectorMarker</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPictureMarker">CIMPictureMarker</a></td>
|
|
69
69
|
* <td>Draw relative to the point geometry</td>
|
|
70
70
|
* </tr>
|
|
71
71
|
* <tr>
|
|
72
|
-
* <td rowspan="2"><a href="
|
|
73
|
-
* <td>Marker layers: <a href="
|
|
72
|
+
* <td rowspan="2"><a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMLineSymbol">CIMLineSymbol</a></td>
|
|
73
|
+
* <td>Marker layers: <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMVectorMarker">CIMVectorMarker</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPictureMarker">CIMPictureMarker</a></td>
|
|
74
74
|
* <td>Draw at specified locations relative to the line geometry.</td>
|
|
75
75
|
* </tr>
|
|
76
76
|
* <tr>
|
|
77
|
-
* <td>Stroke layers: <a href="
|
|
77
|
+
* <td>Stroke layers: <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSolidStroke">CIMSolidStroke</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPictureStroke">CIMPictureStroke</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMGradientStroke">CIMGradientStroke</a></td>
|
|
78
78
|
* <td>Draw relative to the line geometry. </td>
|
|
79
79
|
* </tr>
|
|
80
80
|
* <tr>
|
|
81
|
-
* <td rowspan="3"><a href="
|
|
82
|
-
* <td>Marker layers: <a href="
|
|
81
|
+
* <td rowspan="3"><a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPolygonSymbol">CIMPolygonSymbol</a></td>
|
|
82
|
+
* <td>Marker layers: <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMVectorMarker">CIMVectorMarker</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPictureMarker">CIMPictureMarker</a></td>
|
|
83
83
|
* <td>Draw relative to the polygon outline or within the polygon interior, depending on the marker placement setting.</td>
|
|
84
84
|
* </tr>
|
|
85
85
|
* <tr>
|
|
86
|
-
* <td>Stroke layers: <a href="
|
|
86
|
+
* <td>Stroke layers: <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSolidStroke">CIMSolidStroke</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPictureStroke">CIMPictureStroke</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMGradientStroke">CIMGradientStroke</a></td>
|
|
87
87
|
* <td>Draw relative to the polygon outline. </td>
|
|
88
88
|
* </tr>
|
|
89
89
|
* <tr>
|
|
90
|
-
* <td>Fill layers: <a href="
|
|
90
|
+
* <td>Fill layers: <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSolidFill">CIMSolidFill</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMHatchFill">CIMHatchFill</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPictureFill">CIMPictureFill</a>, <a href="https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMGradientFill">CIMGradientFill</a></td>
|
|
91
91
|
* <td>Draw relative to the polygon interior.</td>
|
|
92
92
|
* </tr>
|
|
93
93
|
* </tbody>
|
|
@@ -150,7 +150,7 @@ export default class PathSymbol3DLayer extends Symbol3DLayer {
|
|
|
150
150
|
* @default true
|
|
151
151
|
* @since 4.11
|
|
152
152
|
* @example
|
|
153
|
-
* //
|
|
153
|
+
* // disable shadow casting
|
|
154
154
|
* symbolLayer.castShadows = false;
|
|
155
155
|
*/
|
|
156
156
|
accessor castShadows: boolean;
|
|
@@ -4,7 +4,7 @@ import type { WaterBodySize, WaveStrength } from "./types.js";
|
|
|
4
4
|
import type { ColorLike } from "../Color.js";
|
|
5
5
|
import type { Symbol3DLayerProperties } from "./Symbol3DLayer.js";
|
|
6
6
|
|
|
7
|
-
export interface WaterSymbol3DLayerProperties extends Symbol3DLayerProperties, Partial<Pick<WaterSymbol3DLayer, "waterbodySize" | "waveDirection" | "waveStrength">> {
|
|
7
|
+
export interface WaterSymbol3DLayerProperties extends Symbol3DLayerProperties, Partial<Pick<WaterSymbol3DLayer, "castShadows" | "waterbodySize" | "waveDirection" | "waveStrength">> {
|
|
8
8
|
/**
|
|
9
9
|
* The dominant color used to shade the water. The water has different shades of the dominant color based
|
|
10
10
|
* on the reflection of the light. The image below shows how different types of water can be represented with
|
|
@@ -58,6 +58,18 @@ export interface WaterSymbol3DLayerProperties extends Symbol3DLayerProperties, P
|
|
|
58
58
|
*/
|
|
59
59
|
export default class WaterSymbol3DLayer extends Symbol3DLayer {
|
|
60
60
|
constructor(properties?: WaterSymbol3DLayerProperties);
|
|
61
|
+
/**
|
|
62
|
+
* Indicates whether the symbol layer geometry casts shadows in the scene.
|
|
63
|
+
* Shadows require direct shadows to be enabled in [SceneView.environment](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#environment).
|
|
64
|
+
* This property has no effect when the symbol layer is draped on the ground.
|
|
65
|
+
*
|
|
66
|
+
* @default true
|
|
67
|
+
* @since 6.0
|
|
68
|
+
* @example
|
|
69
|
+
* // disable shadow casting
|
|
70
|
+
* symbolLayer.castShadows = false;
|
|
71
|
+
*/
|
|
72
|
+
accessor castShadows: boolean;
|
|
61
73
|
/**
|
|
62
74
|
* The dominant color used to shade the water. The water has different shades of the dominant color based
|
|
63
75
|
* on the reflection of the light. The image below shows how different types of water can be represented with
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Color.js";import{property as n,subclass as r}from"../core/accessorSupport/decorators.js";import{Integer as i}from"../core/accessorSupport/ensureType.js";import a from"./Symbol3DLayer.js";import{enumeration as o}from"../core/accessorSupport/decorators/enumeration.js";var s;let c=class extends a{static{s=this}constructor(e){super(e),this.color=l.clone(),this.type=`water`,this.waterbodySize=`medium`,this.waveDirection=null,this.waveStrength=`moderate`}clone(){return new s({color:this.color.clone(),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};e([n({type:t,nonNullable:!0,json:{type:[i],write:(e,t,n)=>t[n]=e.toArray(1),default:()=>l.clone(),defaultEquals:e=>e.toCss(!0)===l.toCss(!0)}})],c.prototype,`color`,void 0),e([o({Water:`water`},{readOnly:!0})],c.prototype,`type`,void 0),e([n({type:[`small`,`medium`,`large`],json:{write:!0,default:`medium`}})],c.prototype,`waterbodySize`,void 0),e([n({type:Number,json:{write:!0,default:null}})],c.prototype,`waveDirection`,void 0),e([n({type:[`calm`,`rippled`,`slight`,`moderate`],json:{write:!0,default:`moderate`}})],c.prototype,`waveStrength`,void 0),c=s=e([r(`esri.symbols.WaterSymbol3DLayer`)],c);const l=new t([0,119,190]);export{c as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Color.js";import{property as n,subclass as r}from"../core/accessorSupport/decorators.js";import{Integer as i}from"../core/accessorSupport/ensureType.js";import a from"./Symbol3DLayer.js";import{enumeration as o}from"../core/accessorSupport/decorators/enumeration.js";var s;let c=class extends a{static{s=this}constructor(e){super(e),this.color=l.clone(),this.castShadows=!0,this.type=`water`,this.waterbodySize=`medium`,this.waveDirection=null,this.waveStrength=`moderate`}clone(){return new s({castShadows:this.castShadows,color:this.color.clone(),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};e([n({type:t,nonNullable:!0,json:{type:[i],write:(e,t,n)=>t[n]=e.toArray(1),default:()=>l.clone(),defaultEquals:e=>e.toCss(!0)===l.toCss(!0)}})],c.prototype,`color`,void 0),e([n({type:Boolean,nonNullable:!0,json:{write:!1,read:!0}})],c.prototype,`castShadows`,void 0),e([o({Water:`water`},{readOnly:!0})],c.prototype,`type`,void 0),e([n({type:[`small`,`medium`,`large`],json:{write:!0,default:`medium`}})],c.prototype,`waterbodySize`,void 0),e([n({type:Number,json:{write:!0,default:null}})],c.prototype,`waveDirection`,void 0),e([n({type:[`calm`,`rippled`,`slight`,`moderate`],json:{write:!0,default:`moderate`}})],c.prototype,`waveStrength`,void 0),c=s=e([r(`esri.symbols.WaterSymbol3DLayer`)],c);const l=new t([0,119,190]);export{c as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{isSome as r,equals as i}from"../../../core/arrayUtils.js";import{createTask as a}from"../../../core/asyncUtils.js";import o from"../../../core/Error.js";import"../../../core/has.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as c}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import l from"../../../core/Logger.js";import{abortMaybe as u,destroyMaybe as d}from"../../../core/maybe.js";import{after as f,throwIfAborted as p,isPromiseLike as m}from"../../../core/promiseUtils.js";import{watch as h,syncAndInitial as g}from"../../../core/reactiveUtils.js";import{createScreenPointArray as _,createRenderScreenPointArray as v}from"../../../core/screenUtils.js";import{UpdatingHandles as y}from"../../../core/support/UpdatingHandles.js";import{convertTime as b,getDateTimeUTC as x}from"../../../core/timeUtils.js";import{containsExecute as S}from"../../../geometry/operators/containsOperator.js";import{projectAsync as C}from"../../../geometry/projectionUtils.js";import{equals as w}from"../../../geometry/support/boundedPlane.js";import{getSunlightIntervals as T}from"../../../time/daylightUtils.js";import{breadthFirstBinaryPartitioning as E}from"../../../widgets/support/traversalUtils.js";import{polygonToVolume as D}from"../focusAreaUtils.js";import{ElevationContext as O}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as k}from"../support/earthUtils.js";import{computeDirectionsOverTime as A}from"../support/sunUtils.js";import{maxColorRampSize as j}from"../webgl-engine/shaders/colorRampParameters.js";import M from"./AnalysisView3D.js";import{registerAnalysisView as N,hideOtherAnalysisViews as P}from"./ShadowCast/analysisViewRegister.js";import F from"./ShadowCast/ShadowCastError.js";import{ShadowCastTooltip as I}from"./ShadowCast/ShadowCastTooltip.js";let L=class extends M{constructor(e){super(e),this.type=`shadow-cast-view-3d`,this.analysis=null,this._updatingHandles=new y,this._visibleOverride=null,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([N(this.view,this),h(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{u(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=a(async e=>{await f(W,e),p(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>H(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),h(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t},n)=>{t&&P(this.view,this),(t||n?.visible)&&e?.setParameters({shadowCast:{enabled:t}})},g),h(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:n})=>{z(e,n,t)},g),h(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:n,visible:r})=>{z(e,r,{lightDirections:t,lightDirectionsContext:n})},g),h(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:n})=>{z(e,n,{previewing:t})},{sync:!0,initial:!0,equals:()=>!1}),h(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:n})=>{z(e,t,{analysisVolume:n})},g)]),this.interactive=!0,this._tooltip=new I({getDuration:(e,t)=>this._getDurationAtScreen(e,t),getMode:()=>this.analysis.mode,getShowsSeparateZeroBucketInHourlyMode:()=>this._showsSeparateZeroBucketInHourlyMode,getTotalDuration:()=>this._totalDuration,getTotalDurationMode:()=>this.analysis.totalDurationOptions.mode,getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&z(this._renderer,!0,{enabled:!1}),this._tooltip=d(this._tooltip),this._stopPreviewingTask=u(this._stopPreviewingTask),this._updatingHandles=d(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||this._stopPreviewingTask!=null&&!this._stopPreviewingTask.finished||this._tooltip?.updating===!0||this._updatingHandles.updating}get visible(){let e=(this.parent?.visible&&!this.parent.suspended)??!0;return(this._visibleOverride??e)&&this.error==null}set visible(e){this._visibleOverride=e}get error(){let e=this._sunlightIntervals;switch(e.state){case`ready`:break;case`unavailable`:return new F(e.state,`The camera's geographic reference position is not available.`);default:return new F(e.state,`The selected date, time zone, or daylight calculation could not be resolved.`)}let{startTimeOfDay:t,endTimeOfDay:n}=this.analysis;if(!Number.isFinite(t)||!Number.isFinite(n)||t<0||n>b(1,`days`,`milliseconds`)||n<t)return new F(`invalid`,`The selected time range must be ordered and within the calendar day.`);let r=this._startDateTimeUTC.getTime(),i=this._endDateTimeUTC.getTime();if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return new F(`invalid`,`The selected time range could not be resolved to ordered UTC instants.`);let{intervals:a}=e;return a.length?a.some(e=>r>=e.start&&i<=e.end)?null:a.length>1?new F(`split-daylight`,`Daylight crosses midnight in the selected time zone and the selected time range includes nighttime.`):new F(`outside-daylight`,`The selected time range includes nighttime at the current camera location.`):new F(`no-daylight`,`No daylight is expected at the current camera location on the selected date.`)}get _sunlightIntervals(){let{date:e}=this.analysis,t=this._timeZone;return T({date:e,timeZone:t,utcOffset:t==null?this._effectiveUtcOffset:0,position:this._referencePosition})}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews.some(e=>e.updating),s=!i?.suspended&&!!i?.updating;return a||o||s}get _timeZone(){return this.analysis.timeZoneMode===`region`?this.view.timeZone:null}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:k(e[0],!1)}get _startDateTimeUTC(){return this._getDateTimeUTC(this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return this._getDateTimeUTC(this.analysis.endTimeOfDay)}_getDateTimeUTC(e){let{date:t}=this.analysis,n=this._timeZone,r=x({date:t,millisecondsSinceMidnight:e,timeZone:n,utcOffset:n==null?this._effectiveUtcOffset:0});if(r==null)throw RangeError(`Invalid shadow cast date or time zone`);return r}get _referencePosition(){return this.view?.environmentView?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(G-1)):G}get _interval(){let e=this._totalDurationInterval;switch(this.analysis.mode){case`min-duration`:return this._totalDuration>0?e:0;case`total-duration`:return e;case`discrete`:return this.analysis.discreteOptions.interval||e}}get _intervalContext(){let{mode:e,minDurationOptions:t}=this.analysis;return e===`min-duration`&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){return this._endDateTimeUTC.getTime()-this._startDateTimeUTC.getTime()}get _lightDirections(){return this.error==null?this._calculateLightDirections(this._interval):[]}get _lightDirectionsContext(){return this.error==null?this._calculateLightDirections(this._intervalContext):[]}_calculateLightDirections(e){let{view:t}=this;if(e<=0)return[];let n=t.viewingMode===`global`?K:this._referencePosition;if(n==null)return[];let r=A(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.isGlobal,G),i=r.length;q.length=0;let a=E(0,i,q),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _analysisVolume(){let{geometry:e}=this.analysis;if(e==null)return this._previousVolume=null,null;try{let t=D(e,this.view,J);return t==null?(this._previousVolume=null,null):m(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return l.getLogger(this).error(new o(`shadowcastanalysisview3d:projection-failed`,`Failed to project analysis area geometry to view spatial reference`,{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case`min-duration`:return this._minDurationVisualizationParameters;case`total-duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){let{color:e,minDuration:t}=this.analysis.minDurationOptions,n=this._totalDuration;return{rendersSunlight:this.analysis.visualizeSunlight,visualization:2,thresholdColor:e.toUnitRGBA(),threshold:n>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){let{minDurationOptions:e,visualizeSunlight:t}=this.analysis;if(!e.contextEnabled||t)return{};let{color:n,colorStops:r}=e.contextOptions,i=1/this._lightDirectionsContext.length;return{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(n,r,i)}}get _durationVisualizationParameters(){let{color:e,colorStops:t,mode:n}=this.analysis.totalDurationOptions,r=this._totalDuration,i=r>0&&n===`hourly`?U/r:0,a=this._getEffectiveShadowCastColorRamp(e,t,1/r);return i===0?{...this._discreteVisualizationParameters,gradientColorRamp:a}:{rendersSunlight:this.analysis.visualizeSunlight,bandedGradientColorRamp:a,visualization:1,bandSize:i}}get _showsSeparateZeroBucketInHourlyMode(){let{colorStops:e}=this.analysis.totalDurationOptions;return e==null||e.length===0||e.reduce((e,t)=>Math.min(e,t.value),1/0)<=0}get _discreteVisualizationParameters(){let{color:e,colorStops:t}=this.analysis.discreteOptions,n=1/this._lightDirections.length;return{rendersSunlight:this.analysis.visualizeSunlight,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,n),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(V)}get _previewDependencies(){if(this.error!=null)return null;let{view:e}=this,t=e.slice.plane,n=this._shadowLayerViews,i=n.map(e=>e.layer).filter(r),a=n.map(e=>e.suspended),o=i.map(e=>e.visible),s=i.map(e=>e.opacity),c=!!e.graphicsView?.suspended,l=i.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),u=n.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:t,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:a,graphicsViewSuspended:c,layerVisibilities:o,layerOpacities:s,filters:u,definitionExpressions:l}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){return this._getDurationAtScreen(e)}async _getDurationAtScreen(e,t){if(!await this._isScreenPointInAnalysisArea(e,t))return-1;let{_renderer:n,_totalDurationSampleCount:r}=this;if(n==null||r===0)return 0;let i=this.view.state.camera.screenToRender(_(e.x,e.y),v()),a=n.readAccumulatedShadow(i);return(this.analysis.visualizeSunlight?1-a:a)*this._totalDuration}async _isScreenPointInAnalysisArea(e,t){let{geometry:n}=this.analysis;if(!n)return!0;let r=await this.view.hitTest(e);p(t);let i=r.results.find(e=>e.mapPoint)?.mapPoint??r?.ground?.mapPoint;if(!i)return!1;let a=await C(i,n.spatialReference,{signal:t});return p(t),a!=null&&S(n,a)}_getEffectiveShadowCastColorRamp(e,t,n){if(t!=null){t.length>j&&l.getLogger(this).warnOnce(`ShadowCastAnalysis supports at most 8 color stops`);let e=t.map(e=>[e.value*n,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return B(e)}};e([t({readOnly:!0,type:[`shadow-cast-view-3d`]})],L.prototype,`type`,void 0),e([t({constructOnly:!0,nonNullable:!0})],L.prototype,`analysis`,void 0),e([t({readOnly:!0})],L.prototype,`updating`,null),e([t()],L.prototype,`visible`,null),e([t()],L.prototype,`error`,null),e([t()],L.prototype,`_visibleOverride`,void 0),e([t()],L.prototype,`_sunlightIntervals`,null),e([t()],L.prototype,`_stopPreviewingTask`,void 0),e([t()],L.prototype,`_updatedRecently`,void 0),e([t()],L.prototype,`_tooltip`,void 0),e([t()],L.prototype,`_sceneUpdating`,null),e([t()],L.prototype,`_timeZone`,null),e([t()],L.prototype,`_effectiveUtcOffset`,null),e([t()],L.prototype,`_utcOffsetAuto`,null),e([t()],L.prototype,`_startDateTimeUTC`,null),e([t()],L.prototype,`_endDateTimeUTC`,null),e([t()],L.prototype,`_referencePosition`,null),e([t()],L.prototype,`_interval`,null),e([t()],L.prototype,`_intervalContext`,null),e([t()],L.prototype,`_totalDurationSampleCount`,null),e([t()],L.prototype,`_totalDuration`,null),e([t()],L.prototype,`_lightDirections`,null),e([t()],L.prototype,`_lightDirectionsContext`,null),e([t()],L.prototype,`_analysisVolume`,null),e([t()],L.prototype,`_visualizationParameters`,null),e([t()],L.prototype,`_minDurationVisualizationParameters`,null),e([t()],L.prototype,`_minDurationContextVisualizationParameters`,null),e([t()],L.prototype,`_durationVisualizationParameters`,null),e([t()],L.prototype,`_showsSeparateZeroBucketInHourlyMode`,null),e([t()],L.prototype,`_discreteVisualizationParameters`,null),e([t()],L.prototype,`_shadowLayerViews`,null),e([t()],L.prototype,`_previewDependencies`,null),e([t()],L.prototype,`_renderer`,null),L=e([n(`esri.views.3d.analysis.ShadowCastAnalysisView3D`)],L);const R=L;function z(e,t,n){t&&n!=null&&e?.setParameters({shadowCast:n})}function B(e){let t=e.toUnitRGBA();return[[0,c(t[0],t[1],t[2],0)],[1,t]]}function V(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`gaussian-splat-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:case`group`:return!1;case`graphics-3d`:case`sketch-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function H(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let n=w(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=i(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=i(e.layerVisibilities,t.layerVisibilities),s=i(e.layerOpacities,t.layerOpacities),c=i(e.filters,t.filters),l=i(e.definitionExpressions,t.definitionExpressions);return n&&r&&a&&o&&s&&c&&l}const U=b(1,`hours`,`milliseconds`),W=500,G=255,K=s(),q=[],J=new O;export{R as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{isSome as r,equals as i}from"../../../core/arrayUtils.js";import{createTask as a}from"../../../core/asyncUtils.js";import o from"../../../core/Error.js";import"../../../core/has.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as c}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import l from"../../../core/Logger.js";import{abortMaybe as u,destroyMaybe as d}from"../../../core/maybe.js";import{after as f,throwIfAborted as p,isPromiseLike as m}from"../../../core/promiseUtils.js";import{watch as h,syncAndInitial as g}from"../../../core/reactiveUtils.js";import{createScreenPointArray as _,createRenderScreenPointArray as v}from"../../../core/screenUtils.js";import{UpdatingHandles as y}from"../../../core/support/UpdatingHandles.js";import{convertTime as b,getDateTimeUTC as x}from"../../../core/timeUtils.js";import{containsExecute as S}from"../../../geometry/operators/containsOperator.js";import{projectAsync as C}from"../../../geometry/projectionUtils.js";import{equals as w}from"../../../geometry/support/boundedPlane.js";import{getSunlightIntervals as T}from"../../../time/daylightUtils.js";import{breadthFirstBinaryPartitioning as E}from"../../../widgets/support/traversalUtils.js";import{polygonToVolume as D}from"../focusAreaUtils.js";import{ElevationContext as O}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as k}from"../support/earthUtils.js";import{computeDirectionsOverTime as A}from"../support/sunUtils.js";import{maxColorRampSize as j}from"../webgl-engine/shaders/colorRampParameters.js";import M from"./AnalysisView3D.js";import{registerAnalysisView as N,hideOtherAnalysisViews as P}from"./ShadowCast/analysisViewRegister.js";import F from"./ShadowCast/ShadowCastError.js";import{ShadowCastTooltip as I}from"./ShadowCast/ShadowCastTooltip.js";let L=class extends M{constructor(e){super(e),this.type=`shadow-cast-view-3d`,this.analysis=null,this._updatingHandles=new y,this._visibleOverride=null,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([N(this.view,this),h(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{u(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=a(async e=>{await f(W,e),p(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>H(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),h(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t},n)=>{t&&P(this.view,this),(t||n?.visible)&&e?.setParameters({shadowCast:{enabled:t}})},g),h(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:n})=>{z(e,n,t)},g),h(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:n,visible:r})=>{z(e,r,{lightDirections:t,lightDirectionsContext:n})},g),h(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:n})=>{z(e,n,{previewing:t})},{sync:!0,initial:!0,equals:()=>!1}),h(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:n})=>{z(e,t,{analysisVolume:n})},g)]),this.interactive=!0,this._tooltip=new I({getDuration:(e,t)=>this._getDurationAtScreen(e,t),getMode:()=>this.analysis.mode,getShowsSeparateZeroBucketInHourlyMode:()=>this._showsSeparateZeroBucketInHourlyMode,getTotalDuration:()=>this._totalDuration,getTotalDurationMode:()=>this.analysis.totalDurationOptions.mode,getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&z(this._renderer,!0,{enabled:!1}),this._tooltip=d(this._tooltip),this._stopPreviewingTask=u(this._stopPreviewingTask),this._updatingHandles=d(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||this._stopPreviewingTask!=null&&!this._stopPreviewingTask.finished||this._tooltip?.updating===!0||this._updatingHandles.updating}get visible(){let e=(this.parent?.visible&&!this.parent.suspended)??!0;return(this._visibleOverride??e)&&this.error==null}set visible(e){this._visibleOverride=e}get error(){let e=this._sunlightIntervals;switch(e.state){case`ready`:break;case`unavailable`:return new F(e.state,`The camera's geographic reference position is not available.`);default:return new F(e.state,`The selected date, time zone, or daylight calculation could not be resolved.`)}let{startTimeOfDay:t,endTimeOfDay:n}=this.analysis;if(!Number.isFinite(t)||!Number.isFinite(n)||t<0||n>b(1,`days`,`milliseconds`)||n<t)return new F(`invalid`,`The selected time range must be ordered and within the calendar day.`);let r=this._startDateTimeUTC.getTime(),i=this._endDateTimeUTC.getTime();if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return new F(`invalid`,`The selected time range could not be resolved to ordered UTC instants.`);let{intervals:a}=e;return a.length?a.some(e=>r>=e.start&&i<=e.end)?null:a.length>1?new F(`split-daylight`,`Daylight crosses midnight in the selected time zone and the selected time range includes nighttime.`):new F(`outside-daylight`,`The selected time range includes nighttime at the current camera location.`):new F(`no-daylight`,`No daylight is expected at the current camera location on the selected date.`)}get _sunlightIntervals(){let{date:e}=this.analysis,t=this._timeZone;return T({date:e,timeZone:t,utcOffset:t==null?this._effectiveUtcOffset:0,position:this._referencePosition})}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews.some(e=>e.updating),s=!i?.suspended&&!!i?.updating;return a||o||s}get _timeZone(){return this.analysis.timeZoneMode===`region`?this.view.timeZone:null}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:k(e[0],!1)}get _startDateTimeUTC(){return this._getDateTimeUTC(this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return this._getDateTimeUTC(this.analysis.endTimeOfDay)}_getDateTimeUTC(e){let{date:t}=this.analysis,n=this._timeZone,r=x({date:t,millisecondsSinceMidnight:e,timeZone:n,utcOffset:n==null?this._effectiveUtcOffset:0});if(r==null)throw RangeError(`Invalid shadow cast date or time zone`);return r}get _referencePosition(){return this.view?.environmentView?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(G-1)):G}get _interval(){let e=this._totalDurationInterval;switch(this.analysis.mode){case`min-duration`:return this._totalDuration>0?e:0;case`total-duration`:return e;case`discrete`:return this.analysis.discreteOptions.interval||e}}get _intervalContext(){let{mode:e,minDurationOptions:t}=this.analysis;return e===`min-duration`&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){return this._endDateTimeUTC.getTime()-this._startDateTimeUTC.getTime()}get _lightDirections(){return this.error==null?this._calculateLightDirections(this._interval):[]}get _lightDirectionsContext(){return this.error==null?this._calculateLightDirections(this._intervalContext):[]}_calculateLightDirections(e){let{view:t}=this;if(e<=0)return[];let n=t.state.isGlobal?K:this._referencePosition;if(n==null)return[];let r=A(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.isGlobal,G),i=r.length;q.length=0;let a=E(0,i,q),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _analysisVolume(){let{geometry:e}=this.analysis;if(e==null)return this._previousVolume=null,null;try{let t=D(e,this.view,J);return t==null?(this._previousVolume=null,null):m(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return l.getLogger(this).error(new o(`shadowcastanalysisview3d:projection-failed`,`Failed to project analysis area geometry to view spatial reference`,{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case`min-duration`:return this._minDurationVisualizationParameters;case`total-duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){let{color:e,minDuration:t}=this.analysis.minDurationOptions,n=this._totalDuration;return{rendersSunlight:this.analysis.visualizeSunlight,visualization:2,thresholdColor:e.toUnitRGBA(),threshold:n>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){let{minDurationOptions:e,visualizeSunlight:t}=this.analysis;if(!e.contextEnabled||t)return{};let{color:n,colorStops:r}=e.contextOptions,i=1/this._lightDirectionsContext.length;return{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(n,r,i)}}get _durationVisualizationParameters(){let{color:e,colorStops:t,mode:n}=this.analysis.totalDurationOptions,r=this._totalDuration,i=r>0&&n===`hourly`?U/r:0,a=this._getEffectiveShadowCastColorRamp(e,t,1/r);return i===0?{...this._discreteVisualizationParameters,gradientColorRamp:a}:{rendersSunlight:this.analysis.visualizeSunlight,bandedGradientColorRamp:a,visualization:1,bandSize:i}}get _showsSeparateZeroBucketInHourlyMode(){let{colorStops:e}=this.analysis.totalDurationOptions;return e==null||e.length===0||e.reduce((e,t)=>Math.min(e,t.value),1/0)<=0}get _discreteVisualizationParameters(){let{color:e,colorStops:t}=this.analysis.discreteOptions,n=1/this._lightDirections.length;return{rendersSunlight:this.analysis.visualizeSunlight,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,n),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(V)}get _previewDependencies(){if(this.error!=null)return null;let{view:e}=this,t=e.slice.plane,n=this._shadowLayerViews,i=n.map(e=>e.layer).filter(r),a=n.map(e=>e.suspended),o=i.map(e=>e.visible),s=i.map(e=>e.opacity),c=!!e.graphicsView?.suspended,l=i.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),u=n.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:t,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:a,graphicsViewSuspended:c,layerVisibilities:o,layerOpacities:s,filters:u,definitionExpressions:l}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){return this._getDurationAtScreen(e)}async _getDurationAtScreen(e,t){if(!await this._isScreenPointInAnalysisArea(e,t))return-1;let{_renderer:n,_totalDurationSampleCount:r}=this;if(n==null||r===0)return 0;let i=this.view.state.camera.screenToRender(_(e.x,e.y),v()),a=n.readAccumulatedShadow(i);return(this.analysis.visualizeSunlight?1-a:a)*this._totalDuration}async _isScreenPointInAnalysisArea(e,t){let{geometry:n}=this.analysis;if(!n)return!0;let r=await this.view.hitTest(e);p(t);let i=r.results.find(e=>e.mapPoint)?.mapPoint??r?.ground?.mapPoint;if(!i)return!1;let a=await C(i,n.spatialReference,{signal:t});return p(t),a!=null&&S(n,a)}_getEffectiveShadowCastColorRamp(e,t,n){if(t!=null){t.length>j&&l.getLogger(this).warnOnce(`ShadowCastAnalysis supports at most 8 color stops`);let e=t.map(e=>[e.value*n,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return B(e)}};e([t({readOnly:!0,type:[`shadow-cast-view-3d`]})],L.prototype,`type`,void 0),e([t({constructOnly:!0,nonNullable:!0})],L.prototype,`analysis`,void 0),e([t({readOnly:!0})],L.prototype,`updating`,null),e([t()],L.prototype,`visible`,null),e([t()],L.prototype,`error`,null),e([t()],L.prototype,`_visibleOverride`,void 0),e([t()],L.prototype,`_sunlightIntervals`,null),e([t()],L.prototype,`_stopPreviewingTask`,void 0),e([t()],L.prototype,`_updatedRecently`,void 0),e([t()],L.prototype,`_tooltip`,void 0),e([t()],L.prototype,`_sceneUpdating`,null),e([t()],L.prototype,`_timeZone`,null),e([t()],L.prototype,`_effectiveUtcOffset`,null),e([t()],L.prototype,`_utcOffsetAuto`,null),e([t()],L.prototype,`_startDateTimeUTC`,null),e([t()],L.prototype,`_endDateTimeUTC`,null),e([t()],L.prototype,`_referencePosition`,null),e([t()],L.prototype,`_interval`,null),e([t()],L.prototype,`_intervalContext`,null),e([t()],L.prototype,`_totalDurationSampleCount`,null),e([t()],L.prototype,`_totalDuration`,null),e([t()],L.prototype,`_lightDirections`,null),e([t()],L.prototype,`_lightDirectionsContext`,null),e([t()],L.prototype,`_analysisVolume`,null),e([t()],L.prototype,`_visualizationParameters`,null),e([t()],L.prototype,`_minDurationVisualizationParameters`,null),e([t()],L.prototype,`_minDurationContextVisualizationParameters`,null),e([t()],L.prototype,`_durationVisualizationParameters`,null),e([t()],L.prototype,`_showsSeparateZeroBucketInHourlyMode`,null),e([t()],L.prototype,`_discreteVisualizationParameters`,null),e([t()],L.prototype,`_shadowLayerViews`,null),e([t()],L.prototype,`_previewDependencies`,null),e([t()],L.prototype,`_renderer`,null),L=e([n(`esri.views.3d.analysis.ShadowCastAnalysisView3D`)],L);const R=L;function z(e,t,n){t&&n!=null&&e?.setParameters({shadowCast:n})}function B(e){let t=e.toUnitRGBA();return[[0,c(t[0],t[1],t[2],0)],[1,t]]}function V(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`gaussian-splat-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:case`group`:return!1;case`graphics-3d`:case`sketch-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function H(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let n=w(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=i(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=i(e.layerVisibilities,t.layerVisibilities),s=i(e.layerOpacities,t.layerOpacities),c=i(e.filters,t.filters),l=i(e.definitionExpressions,t.definitionExpressions);return n&&r&&a&&o&&s&&c&&l}const U=b(1,`hours`,`milliseconds`),W=500,G=255,K=s(),q=[],J=new O;export{R as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../../../core/Evented.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as a,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{tryProject as s}from"../../../../geometry/projectionUtils.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import l from"../../../../symbols/support/ElevationInfo.js";import{EditGeometryOperations as u}from"../../../interactive/editGeometry/EditGeometryOperations.js";
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../../../core/Evented.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as a,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{tryProject as s}from"../../../../geometry/projectionUtils.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import l from"../../../../symbols/support/ElevationInfo.js";import{EditGeometryOperations as u}from"../../../interactive/editGeometry/EditGeometryOperations.js";const d=Symbol(`observerOperations`);let f=class extends r{constructor(e){super(e),this._operations=null}initialize(){this.addHandles(a(()=>this.subTool.observer,e=>this._syncObserver(e),o))}destroy(){this.removeHandles(d),this._operations=i(this._operations)}get operations(){return this._operations}get elevationInfo(){return this.subTool.viewshedComputedData?.effectiveElevationInfo??c}get visible(){return this.subTool.analysisViewData.visible&&(this.subTool.viewshedComputedData?.valid??!1)}get isDraped(){return this.elevationInfo.mode===`on-the-ground`}get origin(){return this.subTool.observer}get updating(){return!1}toMap(e){return this.view.toMap(e)}setElevationMode(e){let t=this.subTool.viewshed;if(!t?.observer||e===this.elevationInfo.mode)return;let n=t.elevationInfo?.clone()??new l;n.mode=e,t.elevationInfo=n,this.emit(`committed`)}_syncObserver(e){let t=e==null?null:s(e,this.view.spatialReference);if(t==null){this.removeHandles(d),this._operations=i(this._operations),this.emit(`committed`);return}let n=this._operations?.data.geometry;if(n?.type===`point`&&n.equals(t))return;if(this._operations?.trySetGeometry(t)){this.emit(`modified-externally`),this.emit(`committed`);return}this.removeHandles(d),this._operations=i(this._operations);let r=u.fromGeometry(t,this.view.state.isGlobal);this._operations=r,this.addHandles(r.data.on(`change`,()=>{let e=r.data.geometry;e.type===`point`&&(this.subTool.observer=e,this.emit(`committed`))}),d),this.emit(`committed`)}};e([t({constructOnly:!0})],f.prototype,`view`,void 0),e([t({constructOnly:!0})],f.prototype,`subTool`,void 0),f=e([n(`esri.views.3d.analysis.Viewshed.ViewshedObserverManipulatedObject3D`)],f);export{f as ViewshedObserverManipulatedObject3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{fromRotation as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as n,transformMat4 as r,scale as i,add as a,squaredLength as o,distance as s,dot as c,normalize as l,length as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{acosClamped as f,clamp as p,asinClamped as m,deg2rad as h}from"../../../../core/mathUtils.js";import{getReferenceEllipsoid as g}from"../../../../geometry/ellipsoidUtils.js";import{Sphere as _}from"../../../../geometry/support/sphere.js";import{viewAngle as v}from"../../state/utils/viewUtils.js";import{defaultConstraintOptions as y,hasConstraintType as b,adjustRangeForInteraction as x}from"./common.js";function S(t,o,s,c=!0){W.eyeCenterDistance=0,W.requiresTwoSteps=!1;let l=C(t,o,s,y,W);if(l===0)return!1;switch(e(R,-l,o.viewRight),s.tiltMode){case 1:r(L,o.viewForward,R),i(L,L,W.eyeCenterDistance),o.center=a(z,o.eye,L);break;case 0:n(L,o.center,o.eye),r(L,L,R),o.eye=n(z,o.center,L);break;default:s.tiltMode}return o.up=r(z,o.up,R),W.requiresTwoSteps&&c?S(t,o,s,!1):!0}function C(e,t,n,r=y,i){if(!e.state.constraints.tilt)return 0;let a=Math.min(t.relativeElevation*V,t.distance),o=e.state.constraints.tilt(a,H);return F(e,n,o),r.interactionType===2&&b(r.selection,2)&&I(e,r.interactionStartCamera,o),n.tiltMode===1||r.tiltMode===1?T(e,t,o,i):w(e,t,o)}function w(e,t,n){let r=v(e.renderCoordsHelper,t.center,t.eye),i=r-p(r,n.min,n.max);return A(i)?i:0}function T(e,t,n,r){
|
|
2
|
+
import{fromRotation as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as n,transformMat4 as r,scale as i,add as a,squaredLength as o,distance as s,dot as c,normalize as l,length as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{acosClamped as f,clamp as p,asinClamped as m,deg2rad as h}from"../../../../core/mathUtils.js";import{getReferenceEllipsoid as g}from"../../../../geometry/ellipsoidUtils.js";import{Sphere as _}from"../../../../geometry/support/sphere.js";import{viewAngle as v}from"../../state/utils/viewUtils.js";import{defaultConstraintOptions as y,hasConstraintType as b,adjustRangeForInteraction as x}from"./common.js";function S(t,o,s,c=!0){W.eyeCenterDistance=0,W.requiresTwoSteps=!1;let l=C(t,o,s,y,W);if(l===0)return!1;switch(e(R,-l,o.viewRight),s.tiltMode){case 1:r(L,o.viewForward,R),i(L,L,W.eyeCenterDistance),o.center=a(z,o.eye,L);break;case 0:n(L,o.center,o.eye),r(L,L,R),o.eye=n(z,o.center,L);break;default:s.tiltMode}return o.up=r(z,o.up,R),W.requiresTwoSteps&&c?S(t,o,s,!1):!0}function C(e,t,n,r=y,i){if(!e.state.constraints.tilt)return 0;let a=Math.min(t.relativeElevation*V,t.distance),o=e.state.constraints.tilt(a,H);return F(e,n,o),r.interactionType===2&&b(r.selection,2)&&I(e,r.interactionStartCamera,o),n.tiltMode===1||r.tiltMode===1?T(e,t,o,i):w(e,t,o)}function w(e,t,n){let r=v(e.renderCoordsHelper,t.center,t.eye),i=r-p(r,n.min,n.max);return A(i)?i:0}function T(e,t,n,r){return r&&(r.requiresTwoSteps=!1),e.state.isGlobal?D(e,t,n,r):E(e,t,n,r)}function E(e,t,n,r){let i=v(e.renderCoordsHelper,t.center,t.eye),a=p(i,n.min,n.max),o=i-a;if(!A(o))return 0;if(r){let n=Math.abs(e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude),i=e.renderCoordsHelper.getAltitude(t.eye)-n,o=Math.max(Math.cos(a),1e-4);r.eyeCenterDistance=Math.abs(o)>1e-4?i/o:t.distance}return o}function D(e,t,n,r){let i=O(e,t,U),a=p(i.tiltAtCenter,n.min,n.max);if(!A(i.tiltAtCenter-a))return 0;let o,s;return i.centerIsOnSurface?(o=j(i),s=N(i,o)):(o=i.constraints.clampTilt(i.distance,i.tiltAtCenter),r&&o<Math.PI/2&&(r.requiresTwoSteps=!0,o=Math.PI/2-1e-5),s=P(i,o)),r&&(r.eyeCenterDistance=M(i,o)),s}function O(e,t,n){let r=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,i=r+g(e.spatialReference).radius,a=e.renderCoordsHelper.intersectManifold(t.ray,r,z);return n.distance=Math.min(t.relativeElevation*V,t.distance),n.centerIsOnSurface=!1,a==null?e.state.isLocal?n.tiltAtCenter=v(e.renderCoordsHelper,t.center,t.eye):(k.radius=i,k.closestPointOnSilhouette(t.ray,z),n.distance=Math.min(t.relativeElevation*V,s(t.eye,z)),n.tiltAtCenter=f(-c(t.viewForward,l(z,z)))):(n.distance=Math.min(t.relativeElevation*V,s(t.eye,a)),n.tiltAtCenter=v(e.renderCoordsHelper,a,t.eye),n.centerIsOnSurface=!0),n.radius=i,n.eyeRadius=u(t.eye),n.constraints=e.state.constraints,n}const k=new _;function A(e){return Math.abs(e)>1e-9}function j(e){let{constraints:t,distance:n,tiltAtCenter:r}=e,i=r,a=t.clampTilt(n,r),o=M(e,a);if(t.clampTilt(o,r)===a)return a;let s=0;for(;s<10&&A(a-i);){let n=(i+a)/2,r=M(e,n);A(t.clampTilt(r,n)-n)?i=n:a=n,s++}return a}function M(e,t){if(!e.centerIsOnSurface)return e.distance;let n=Math.PI-p(t,0,Math.PI),r=m(e.radius/e.eyeRadius*Math.sin(n)),i=Math.PI-n-r,a=Math.sin(i)/Math.sin(n);if(e.eyeRadius<e.radius&&a>1){let t=Math.PI-r,i=Math.PI-n-t;return Math.sin(i)/Math.sin(n)*e.eyeRadius}return a*e.eyeRadius}function N(e,t){let n=m(e.radius/e.eyeRadius*Math.sin(e.tiltAtCenter)),r=m(e.radius/e.eyeRadius*Math.sin(t));return e.eyeRadius>e.radius?n-r:r-n}function P(e,t){return e.tiltAtCenter-Math.PI/2-(t-Math.PI/2)}function F(e,t,n){if(t.interactionType===0)return;let{interactionStartCamera:r,interactionFactor:i}=t;if(!r)return;let{min:a,max:o}=n,s=C(e,r,y,t),c=s===0?0:v(e.renderCoordsHelper,r.center,r.eye);n.min=a,n.max=o,t.interactionType===2?(b(t.selection,2)&&I(e,r,n),x(s,c,!0,i,B,n)):x(s,c,!1,i,B,n)}function I(e,t,n){let r=e.state.constraints;if(e.state.isLocal||!r.altitude||!t)return;let i=o(t.center),a=Math.sqrt(i),s=t.distance,c=g(e.spatialReference).radius,l=r.altitude.min+c,u=r.altitude.max+c,d=(l*l-s*s-i)/(-2*a*s),p=(u*u-s*s-i)/(-2*a*s);n.min=Math.max(n.min,Math.min(Math.PI-f(p),n.max)),n.max=Math.min(n.max,Math.PI-f(d))}const L=d(),R=t(),z=d(),B=h(5),V=30,H={min:0,max:0},U={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,distance:0,tiltAtCenter:0},W={eyeCenterDistance:0,requiresTwoSteps:!1};export{S as applyTiltConstraint,C as getTiltConstraintError};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{copy as e,squaredDistance as t,scale as n,subtract as r,add as i,length as a,dot as o,distance as s}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as u}from"../../../geometry/support/aaBoundingRect.js";import{scaleToDistanceAt as d}from"../support/cameraScaleUtils.js";import{Intersector as f}from"../webgl-engine/lib/Intersector.js";function p(e,t,n,r){return e.renderCoordsHelper.fromRenderCoords(t.eye,S,r)!=null&&u(n,S)}function m(e,t){return e.elevationProvider?e.elevationProvider.getElevation(t[0],t[1],t[2],e.renderCoordsHelper.spatialReference,`ground`)??0:0}function h(a,o,s,c,l){let u=a.state.camera.clone();if(o&&s&&c&&(u.eye=o,u.center=s,u.up=c),l){let e=d(a,u,l);i(C,u.eye,n(C,u.viewForward,e))}else v(a,u.ray,C)||e(C,u.center);let f=a.state.constraints,p=f.minimumPoiDistance;if(t(u.eye,C)<p){let t=f.collision.enabled;e(w,u.viewForward),n(w,w,p),t?u.eye=r(S,C,w):i(C,u.eye,w);let o=a.renderCoordsHelper,s=o.getAltitude(u.eye),c=f.collision.elevationMargin;t&&s<c&&(r(w,C,u.eye),u.eye=o.setAltitude(S,c,u.eye),i(C,u.eye,w))}return u.center=C,u}function g(e,t,n){let{origin:r,direction:i}=t;if(a(r)<e)return!0;let c=-o(i,r)/a(i);return c<0||c>=s(n,r)}function _(e,n,r){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;let i=m(e,n),a=e.stateManager.constraintsManager.nearFarHeuristic.computeFarDistance(n,i,e.stage.renderer.sceneDepthRange.value.far),o=a*a;return t(n,r)>o}function v(e,t,n){let r=b[e.
|
|
2
|
+
import{copy as e,squaredDistance as t,scale as n,subtract as r,add as i,length as a,dot as o,distance as s}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as u}from"../../../geometry/support/aaBoundingRect.js";import{scaleToDistanceAt as d}from"../support/cameraScaleUtils.js";import{Intersector as f}from"../webgl-engine/lib/Intersector.js";function p(e,t,n,r){return e.renderCoordsHelper.fromRenderCoords(t.eye,S,r)!=null&&u(n,S)}function m(e,t){return e.elevationProvider?e.elevationProvider.getElevation(t[0],t[1],t[2],e.renderCoordsHelper.spatialReference,`ground`)??0:0}function h(a,o,s,c,l){let u=a.state.camera.clone();if(o&&s&&c&&(u.eye=o,u.center=s,u.up=c),l){let e=d(a,u,l);i(C,u.eye,n(C,u.viewForward,e))}else v(a,u.ray,C)||e(C,u.center);let f=a.state.constraints,p=f.minimumPoiDistance;if(t(u.eye,C)<p){let t=f.collision.enabled;e(w,u.viewForward),n(w,w,p),t?u.eye=r(S,C,w):i(C,u.eye,w);let o=a.renderCoordsHelper,s=o.getAltitude(u.eye),c=f.collision.elevationMargin;t&&s<c&&(r(w,C,u.eye),u.eye=o.setAltitude(S,c,u.eye),i(C,u.eye,w))}return u.center=C,u}function g(e,t,n){let{origin:r,direction:i}=t;if(a(r)<e)return!0;let c=-o(i,r)/a(i);return c<0||c>=s(n,r)}function _(e,n,r){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;let i=m(e,n),a=e.stateManager.constraintsManager.nearFarHeuristic.computeFarDistance(n,i,e.stage.renderer.sceneDepthRange.value.far),o=a*a;return t(n,r)>o}function v(e,t,n){let r=b[+e.state.isGlobal];r||(r=new f(e.state.isGlobal),r.options.backfacesTerrain=!e.state.isGlobal,r.options.invisibleTerrain=!0,b[+e.state.isGlobal]=r);let{isGlobal:i}=e.state,a=i?l(e.spatialReference).radius:0;return e.sceneIntersectionHelper.intersectRay(t,r,n)&&!_(e,t.origin,n)&&(!i||g(a,r.ray,n))?!0:!e.renderCoordsHelper.intersectManifold(t,0,n)||_(e,t.origin,n)||i&&!g(a,r.ray,n)?i?y(t,n,a):!1:!0}function y(e,t,r){let s=o(e.origin,e.origin)-r*r,c=s>0?Math.sqrt(s)/3:1;return n(t,e.direction,c/a(e.direction)),i(t,t,e.origin),!0}const b=[];function x(){b.length=0}const S=c(),C=c(),w=c();export{h as cameraOnContentAlongViewDirection,x as cleanupIntersectionUtils,p as eyeWithinExtent,m as surfaceElevationBelowRenderLocation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../../core/Evented.js";import{length as i,equals as a,copy as o,scale as s,lerp as c}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as l,create as u,fromValues as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{watch as f,sync as p,syncAndInitial as m,when as h}from"../../../core/reactiveUtils.js";import{isEarth as g,getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{projectPointToVector as v}from"../../../geometry/projection/projectPointToVector.js";import{isLoadedOrLoadFor as y}from"../../../geometry/projectionUtils.js";import b from"../../../geometry/SpatialReference.js";import{getGCSForPlanet as x}from"../../../geometry/support/planetGCSUtils.js";import{positionToTimezoneInfo as S}from"../support/earthUtils.js";import{ColorAndIntensity as C,areShadowsEnabled as w,computeColorAndIntensity as T,computeVirtualLightDirection as E}from"../support/sunUtils.js";import{MainLight as D,AmbientLight as O,FillLight as k}from"../webgl-engine/lighting/Lightsources.js";import{heightLimit as A}from"./weather.js";let j=class extends r{constructor(){super(),this._view=null,this._tmpLightParameters=new C,this._defaultLightParameters=new C,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey=`viewHandles`,this._trackingEnabled=!1,this._mainLight=new D,this._ambientLight=new O,this._moonLight=new k,this.shadowsAvailable=!1,this._resetReferencePosition()}destroy(){this.disconnectView()}get updating(){return!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.stage?.renderer?.weatherFader!=null&&this._view.environment.atmosphereEnabled&&this._view.state.isGlobal&&g(this._view.spatialReference)}get _weatherAvailable(){let e=this._view;return e!=null&&this.weatherEnabled&&i(e.state.camera.eye)-_(e.spatialReference).radius<=A}get weather(){return this._weatherAvailable?this._view?.environment.weather:null}_modifyShadowsAvailable(){if(this._view==null)return;let e=this.referencePositionGeographic,t=e==null||w(e[2],this._view.state.isGlobal);this.shadowsAvailable=this._view.environment.lighting.directShadowsEnabled&&t}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){let e=this._view?.stateManager?.camera?.position?.spatialReference??b.WGS84,t=x(e);return y(e,t)}connectView(e){this._view=e,this.addHandles([f(()=>e.environment.lighting,e=>this._updateLightingHandler(e),p),f(()=>e.environment.lighting.type===`virtual`?null:e.environment.lighting.date,e=>this._lightingDateHandler(e),p),f(()=>e.environment.lighting.directShadowsEnabled,()=>this._modifyShadowsAvailable(),p),f(()=>e.spatialReference,()=>this._resetReferencePosition(!0),p),f(()=>[e.environment.weather.type,this.weatherEnabled],()=>this._updateLighting(null,1),p),f(()=>this._weatherAvailable,t=>e.environment.setWeatherAvailable(t),m),f(()=>e.
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../../core/Evented.js";import{length as i,equals as a,copy as o,scale as s,lerp as c}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as l,create as u,fromValues as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{watch as f,sync as p,syncAndInitial as m,when as h}from"../../../core/reactiveUtils.js";import{isEarth as g,getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{projectPointToVector as v}from"../../../geometry/projection/projectPointToVector.js";import{isLoadedOrLoadFor as y}from"../../../geometry/projectionUtils.js";import b from"../../../geometry/SpatialReference.js";import{getGCSForPlanet as x}from"../../../geometry/support/planetGCSUtils.js";import{positionToTimezoneInfo as S}from"../support/earthUtils.js";import{ColorAndIntensity as C,areShadowsEnabled as w,computeColorAndIntensity as T,computeVirtualLightDirection as E}from"../support/sunUtils.js";import{MainLight as D,AmbientLight as O,FillLight as k}from"../webgl-engine/lighting/Lightsources.js";import{heightLimit as A}from"./weather.js";let j=class extends r{constructor(){super(),this._view=null,this._tmpLightParameters=new C,this._defaultLightParameters=new C,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey=`viewHandles`,this._trackingEnabled=!1,this._mainLight=new D,this._ambientLight=new O,this._moonLight=new k,this.shadowsAvailable=!1,this._resetReferencePosition()}destroy(){this.disconnectView()}get updating(){return!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.stage?.renderer?.weatherFader!=null&&this._view.environment.atmosphereEnabled&&this._view.state.isGlobal&&g(this._view.spatialReference)}get _weatherAvailable(){let e=this._view;return e!=null&&this.weatherEnabled&&i(e.state.camera.eye)-_(e.spatialReference).radius<=A}get weather(){return this._weatherAvailable?this._view?.environment.weather:null}_modifyShadowsAvailable(){if(this._view==null)return;let e=this.referencePositionGeographic,t=e==null||w(e[2],this._view.state.isGlobal);this.shadowsAvailable=this._view.environment.lighting.directShadowsEnabled&&t}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){let e=this._view?.stateManager?.camera?.position?.spatialReference??b.WGS84,t=x(e);return y(e,t)}connectView(e){this._view=e,this.addHandles([f(()=>e.environment.lighting,e=>this._updateLightingHandler(e),p),f(()=>e.environment.lighting.type===`virtual`?null:e.environment.lighting.date,e=>this._lightingDateHandler(e),p),f(()=>e.environment.lighting.directShadowsEnabled,()=>this._modifyShadowsAvailable(),p),f(()=>e.spatialReference,()=>this._resetReferencePosition(!0),p),f(()=>[e.environment.weather.type,this.weatherEnabled],()=>this._updateLighting(null,1),p),f(()=>this._weatherAvailable,t=>e.environment.setWeatherAvailable(t),m),f(()=>e.state.isGlobal,()=>this._resetReferencePosition(!0),m),f(()=>e.environment.lighting.type!==`virtual`&&e.environment.lighting.cameraTrackingEnabled,e=>this._updateCameraTracking(e),m),f(()=>e.state.camera,()=>this._cameraHandler(),m),h(()=>this._canProjectCameraPosition,()=>this._resetReferencePosition(!0),p)],this._viewHandlesKey),this._modifyShadowsAvailable(),this._updateLighting(),this._cameraHandler(),this.notifyChange(`updating`)}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition()}_updateLightingHandler(e){this._updateCameraTracking(e.type!==`virtual`&&e.cameraTrackingEnabled),this._lightingDateHandler(e.type===`virtual`?null:e.date),this._modifyShadowsAvailable()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{if(!this._view)return;let e=this._view.environment.lighting;e?.type!==`virtual`&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){if(!this._view)return;let t=this._view.environment.lighting;if(t?.type===`virtual`)this._updateLighting();else if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),this._referencePositionGeographic!=null)){let e=S(this._referencePositionGeographic,this._tmpTz);e!=null&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}_preupdateTracking(e){this._view&&!this._trackingEnabled&&this._view.environment.lighting.type!==`virtual`&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){let t=this._view;if(!t||!t.ready)return;let n=t.stateManager.camera;if(!n)return;let r=n.position,i=r.spatialReference??b.WGS84,s=x(i);if(v(r,P,s,F))this._referencePositionGeographic?a(this._referencePositionGeographic,P)||(o(this._referencePositionGeographic,P),this.notifyChange(`referencePositionGeographic`)):this._referencePositionGeographic=l(P),this._autoUpdateTimezone(this._referencePositionGeographic,e)||this._updateLighting(e);else{if(this._referencePositionGeographic==null)return;this._referencePositionGeographic=null,this._updateLighting()}}_updateLighting(e,t=0){let n=this._view;if(!n)return;let{lighting:r}=n.environment,i=r.type===`virtual`,a=this._referencePositionGeographic,l=a==null?this._defaultLightParameters:this._tmpLightParameters;if(a){e??=i?null:r.date;let t=this.weather?.type??`disabled`;T(e,a,n.state.isGlobal,t,n.state.camera,l)}else i&&E(n.state.camera,n.state.isGlobal,l.direct.directionToLightSource);let u=this._mainLight,d=l.direct;s(u.intensity,d.color,d.intensity*Math.PI),o(u.direction,d.directionToLightSource),u.specularStrength=l.specularStrength,u.environmentStrength=l.environmentStrength;let f=this._ambientLight;s(f.intensity,l.ambient.color,l.ambient.intensity);let p=this._moonLight;c(p.intensity,M,N,l.globalFactor);let m=(1-.5*l.globalFactor)*(1-.4*l.noonFactor*(1-l.globalFactor));s(p.intensity,p.intensity,m),o(p.direction,d.directionToLightSource),n.stage.renderer.updateLighting([u,f,p],l.noonFactor,l.globalFactor,this.weather?t:0),this._modifyShadowsAvailable()}_autoUpdateTimezone(e,t=null){if(!this._view||this._view.environment.lighting.type===`virtual`||!this._view.environment.lighting.cameraTrackingEnabled||e==null)return!1;let n=this._tmpDate;n.setTime((t||this._view.environment.lighting.date).getTime());let r=S(e,this._tmpTz);if(r==null)return!1;let i=this._view.environment.lighting.positionTimezoneInfo;if(!i.autoUpdated)i=r;else if(i.hours===r.hours&&i.minutes===r.minutes&&i.seconds===r.seconds)return!1;let a=n.getUTCHours()-(r.hours-i.hours),o=n.getUTCMinutes()-(r.minutes-i.minutes),s=n.getUTCSeconds()-(r.seconds-i.seconds);return n.setUTCHours(a),n.setUTCMinutes(o),n.setUTCSeconds(s),!t&&this._view.environment.lighting.autoUpdate(n,r)}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}};e([t()],j.prototype,`_view`,void 0),e([t({type:Boolean,readOnly:!0})],j.prototype,`updating`,null),e([t()],j.prototype,`weatherEnabled`,null),e([t()],j.prototype,`_weatherAvailable`,null),e([t()],j.prototype,`shadowsAvailable`,void 0),e([t()],j.prototype,`referencePositionGeographic`,null),e([t()],j.prototype,`_referencePositionGeographic`,void 0),e([t()],j.prototype,`_canProjectCameraPosition`,null),j=e([n(`esri.views.3d.environment.EnvironmentView`)],j);const M=d(.22,.22,.33),N=d(.22,.22,.22),P=u(),F={zConversionDisabled:!0};export{j as EnvironmentView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/has.js";import{eventMatchesPointerActions as e}from"../../../../input/handlers/support.js";import{InputHandler as t}from"../../../../input/InputHandler.js";import{GroundNavigationController as n}from"../../../state/controllers/GroundNavigationController.js";import{PinchAndPanControllerGlobal as r}from"../../../state/controllers/PinchAndPanControllerGlobal.js";import{groundNavigationConstants as i}from"../../../state/utils/groundNavigationUtils.js";class a extends t{constructor(e,t,n){super(!0),this._view=e,this.pointerActions=t,this._modifiers=n,this._lastEndTimestamp=0,this._lastTimestamp=0,this.registerIncoming(`drag`,n,e=>this._handleDrag(e))}_handleDrag(t){if(t.data.pointers.size===1&&!e(t.data,this.pointerActions))return;let n=t.timestamp-this._lastEndTimestamp,r=this._momentum&&this._momentum.running&&n<40;switch(t.data.action){case`start`:case`update`:if(r)break;!this._controller||!this._controller.running?this._startController(t):t.data.timestamp-this._lastTimestamp>2&&(this._controller.update(t.data),this._lastTimestamp=t.timestamp);break;case`end`:case`removed`:this._endController(t,!0);break;case`added`:this._endController(t,!1),this._startController(t)}t.stopPropagation()}_endController(e,t){if(this._controller?.running){this._lastEndTimestamp=e.timestamp;let n=this._controller.end(e.data);t&&n&&(this._momentum=n,this._view.state.switchCameraController(this._momentum))}this._controller=null}_startController(e){this._controller=this._createController(),this._view.state.switchCameraController(this._controller),this._controller.begin(e.data),this._lastTimestamp=e.timestamp}_createController(){return this._view.
|
|
2
|
+
import"../../../../../core/has.js";import{eventMatchesPointerActions as e}from"../../../../input/handlers/support.js";import{InputHandler as t}from"../../../../input/InputHandler.js";import{GroundNavigationController as n}from"../../../state/controllers/GroundNavigationController.js";import{PinchAndPanControllerGlobal as r}from"../../../state/controllers/PinchAndPanControllerGlobal.js";import{groundNavigationConstants as i}from"../../../state/utils/groundNavigationUtils.js";class a extends t{constructor(e,t,n){super(!0),this._view=e,this.pointerActions=t,this._modifiers=n,this._lastEndTimestamp=0,this._lastTimestamp=0,this.registerIncoming(`drag`,n,e=>this._handleDrag(e))}_handleDrag(t){if(t.data.pointers.size===1&&!e(t.data,this.pointerActions))return;let n=t.timestamp-this._lastEndTimestamp,r=this._momentum&&this._momentum.running&&n<40;switch(t.data.action){case`start`:case`update`:if(r)break;!this._controller||!this._controller.running?this._startController(t):t.data.timestamp-this._lastTimestamp>2&&(this._controller.update(t.data),this._lastTimestamp=t.timestamp);break;case`end`:case`removed`:this._endController(t,!0);break;case`added`:this._endController(t,!1),this._startController(t)}t.stopPropagation()}_endController(e,t){if(this._controller?.running){this._lastEndTimestamp=e.timestamp;let n=this._controller.end(e.data);t&&n&&(this._momentum=n,this._view.state.switchCameraController(this._momentum))}this._controller=null}_startController(e){this._controller=this._createController(),this._view.state.switchCameraController(this._controller),this._controller.begin(e.data),this._lastTimestamp=e.timestamp}_createController(){return this._view.state.isGlobal&&this._view.state.camera.relativeElevation>i.maxElevation?new r({view:this._view}):new n({view:this._view})}get test(){}}export{a as GroundNavigation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{exactEquals as e,getTranslation as t}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{exactEquals as n}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Object3D as i}from"../webgl-engine/lib/Object3D.js";import{Manipulator3DBase as a,createPreciseManipulatorOrigin as o}from"./Manipulator3DBase.js";class s extends a{constructor(e){super(e.view),this.type=0,Object.assign(this,e)}createEngineObject(e){return new i({
|
|
2
|
+
import{exactEquals as e,getTranslation as t}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{exactEquals as n}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Object3D as i}from"../webgl-engine/lib/Object3D.js";import{Manipulator3DBase as a,createPreciseManipulatorOrigin as o}from"./Manipulator3DBase.js";class s extends a{constructor(e){super(e.view),this.type=0,Object.assign(this,e)}createEngineObject(e){return new i({castShadows:!1,geometries:[e.geometry]})}updateEngineObjectTransform(t,n){this.usePreciseLocalOrigin?this._updateObjectTransformAndLocalOrigin(t,n):e(t.transformation,n)||(t.transformation=n)}_updateObjectTransformAndLocalOrigin(r,i){let a=t(c,i);if(r.geometries.every(({localOrigin:e})=>e!=null&&n(e.vec3,a))&&e(r.transformation,i))return;let s=o(a);for(let e of r.geometries)e.localOrigin=s;r.transformation=i}}const c=r();export{s as Manipulator3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{EventEmitter as e}from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import"../../../core/has.js";import{create as n,ZEROS as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromMat4 as i}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as o,set as s,multiply as c,identity as l}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as d}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{add as f,transformMat3 as p,transformMat4 as m,scale as h,copy as g,squaredDistance as _,set as v,subtract as y}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{deg2rad as b}from"../../../core/mathUtils.js";import{destroyMaybe as ee}from"../../../core/maybe.js";import{createRenderScreenPointArray3 as te,createScreenPointArray as x,screenPointObjectToArray as S,castRenderScreenPointArray as C}from"../../../core/screenUtils.js";import{generateUID as ne}from"../../../core/uid.js";import{getReferenceEllipsoid as re}from"../../../geometry/ellipsoidUtils.js";import w from"../../../geometry/Point.js";import{computeENUToPCPFLocalRotation as T}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as E}from"../../../geometry/projection/projectors.js";import{canProjectWithoutEngine as ie,projectPoint as ae}from"../../../geometry/projectionUtils.js";import{distance2 as oe,fromPoints as D,closestRayDistance2 as O,create as se}from"../../../geometry/support/lineSegment.js";import{fromPositionAndNormal as k,intersectRay as A,create as ce}from"../../../geometry/support/plane.js";import{create as le}from"../../../geometry/support/ray.js";import{sv3d as j}from"../../../geometry/support/vectorStacks.js";import{clonePoint as M}from"../../../layers/graphics/hydratedFeatures.js";import{hydratedSpatialReference as ue}from"../../../layers/graphics/hydratedSpatialReference.js";import{getElevationOffset as N}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as P}from"../support/ElevationProvider.js";import{containsElevationUpdatePoint as F}from"../support/elevationUpdateExtentUtils.js";import{fromScreen as I}from"../support/geometryUtils/ray.js";import{fromValues as L}from"../webgl-engine/lib/LocalOriginFactory.js";import{WebGLLayer as R}from"../webgl-engine/lib/WebGLLayer.js";class z{constructor(t){this.view=t,this.metadata=void 0,this._elevation={offset:0,override:null},this.collisionType={type:`point`},this.collisionPriority=0,this._renderObjects=[],this.autoScaleRenderObjects=!0,this.usePreciseLocalOrigin=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=u(),this._worldFrame=null,this._renderLocation=n(),this._renderLocationDirty=!0,this._location=new w({x:0,y:0,z:0}),this._elevationAlignedLocation=new w,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=0,this._focused=!1,this.events=new e,this._screenLocation={screenPointArray:x(),renderScreenPointArray:te(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=t.spatialReference}destroy(){this._applyObjectTransform=me,this._removeResourcesFromStage(),this._engineResources=null,this.view=null}get _stage(){return this.view?.stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,this._noDisplayCount===1&&this._updateEngineObject(),t(()=>{this._noDisplayCount--,this._noDisplayCount===0&&this._updateEngineObject()})}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){B(e)&&(this._screenLocationDirty=!0),o(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||=u(),V(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&=null),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){M(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit(`location-update`,{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty&&(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation()),this._elevationAlignedLocation}set elevationAlignedLocation(e){M(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit(`location-update`,{location:this._location})}_updateElevationAlignedLocation(){let e=this._elevation.override==null?this.location.z||0:this._elevation.override;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=ue(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit(`select-changed`,{action:e?`select`:`deselect`}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit(`focus-changed`,{action:e===!0?`focus`:`unfocus`}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;let e=this.view.state.camera;this._screenLocation.pixelSize=e.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let t=B(this._modelTransform),n;if(t){let e=this._calculateModelTransformOffset(pe);n=f(e,e,this.renderLocation)}else n=this.renderLocation;e.projectToRenderScreen(n,this._screenLocation.renderScreenPointArray),e.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(e,t){if(!this.available)return null;let n=this.view.state.camera,a=S(e,de),o=this._getCollisionRadius(t),s=this.collisionPriority*-1;switch(this.collisionType.type){case`point`:if(d(this.screenLocation.screenPointArray,a)<o*o)return this.screenLocation.renderScreenPointArray[2]+s;break;case`line`:{let e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(t,K),i=o*this.screenLocation.pixelSize,c=I(n,a,W);if(c==null)return null;for(let t of e){if(t.length===0)continue;let e=m(J,t[0],r);for(let a=1;a<t.length;a++){let o=m(Y,t[a],r),l=O(D(e,o,U),c);if(l!=null&&l<i*i){let t=f(j.get(),e,o);h(t,t,.5);let r=C(j.get());if(n.projectToRenderScreen(t,r))return r[2]+s}g(e,o)}}break}case`disc`:{let e=this.collisionType.direction,t=this.collisionType.offset??r,c=this._getWorldToScreenObjectScale(),l=this._calculateObjectTransform(c,K),u=o*this.screenLocation.pixelSize,d=I(n,a,W);if(d==null)return null;let f=i(G,l),h=p(Z,e,f),g=m(Q,t,l);k(g,h,q);let v=X;if(A(q,d,v)&&_(v,g)<u*u)return this.screenLocation.renderScreenPointArray[2]+s;break}case`ribbon`:{let{paths:e,direction:t}=this.collisionType,r=this._getWorldToScreenObjectScale(),c=this._calculateObjectTransform(r,K),l=o*n.computeScreenPixelSizeAt(this.renderLocation),u=I(n,a,W);if(u==null)return null;let d=i(G,c),_=p(Z,t,d),v=this._calculateModelTransformPosition(Q);k(v,_,q);let y=X;if(!A(q,u,y))break;for(let t of e){if(t.length===0)continue;let e=m(J,t[0],c);for(let r=1;r<t.length;r++){let i=m(Y,t[r],c),a=oe(D(e,i,U),y);if(a!=null&&a<l*l){let t=f(j.get(),e,i);h(t,t,.5);let r=C(j.get());if(n.projectToRenderScreen(t,r))return r[2]+s}g(e,i)}}break}default:this.collisionType}return null}attach(e={manipulator3D:{}}){let t=this._stage;if(!t)return;let n=e.manipulator3D;n.engineLayerId==null?(this._engineLayer=new R(t,{pickable:!1,updatePolicy:1}),n.engineLayerId=this._engineLayer.id):t?.getLayer&&(this._engineLayer=t.getLayer(n.engineLayerId)),n.engineLayerReferences=(n.engineLayerReferences||0)+1,this._attached=!0,this._updateEngineObject(),ie(this._location.spatialReference,this.view.spatialReference)||(this.location=new w({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){let t=e.manipulator3D;t.engineLayerReferences--;let n=t.engineLayerReferences===0;this._removeResourcesFromStage(),n&&(t.engineLayerId=null,ee(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._attached=!1}onViewChange(){this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){ae(this.location,$,e.spatialReference)&&F(e.extent,$.x,$.y,e.spatialReference)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(this.elevationInfo==null)return;let e=null,t=0,n=N(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case`on-the-ground`:e=P(this.view.elevationProvider,this.location,`ground`)??0;break;case`relative-to-ground`:t=(P(this.view.elevationProvider,this.location,`ground`)??0)+n;break;case`relative-to-scene`:t=(P(this.view.elevationProvider,this.location,`scene`)??0)+n;break;case`absolute-height`:t=n}(t!==this._elevation.offset||e!==this._elevation.override)&&(this._elevation.offset=t,this._elevation.override=e)}_updateEngineObject(){if(!this._attached)return;if(!this.available){this._removeResourcesFromStage();return}let e=this._getWorldToScreenObjectScale(),t=K,n=this.autoScaleRenderObjects===!0?this._getFocusedSize(this._radius,this.focused):1;this._calculateObjectTransform(n*e,t);let{objectsByState:r}=this._ensureEngineResources(),i=(this.focused?2:1)|(this.selected?8:4),a=this._noDisplayCount>0;for(let{stateMask:e,resources:n}of r){if(a){for(let{object:e}of n)e.visible=!1;continue}let r=!!(e&15),o=!!(e&65520),s=!r||(i&e)===(e&15),c=!o||(this.state&e)===(e&65520);if(s&&c)for(let{object:e,renderObject:r}of n)e.visible=!0,this.updateEngineObjectTransform(e,t,r);else for(let{object:e}of n)e.visible=!1}}_ensureEngineResources(){if(this._engineResources==null){let e=this._engineLayer,t=new Map;this._renderObjects.forEach(e=>{let n=this.createEngineObject(e),r=t.get(e.stateMask)??[];r.push({object:n,renderObject:e}),t.set(e.stateMask,r)});let n=Array.from(t,([e,t])=>({stateMask:e,resources:t}));this._engineResources={objectsByState:n,layer:e}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){let e=this._stage;if(this._engineResourcesAddedToStage||this._engineResources==null||!e)return;let{objectsByState:t,layer:n}=this._engineResources;t.forEach(({resources:e})=>n.addMany(e.map(({object:e})=>e))),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){let e=this._stage;if(!this._engineResourcesAddedToStage||this._engineResources==null||!e)return;let{objectsByState:t,layer:n}=this._engineResources;t.forEach(({resources:e})=>n.removeMany(e.map(({object:e})=>e))),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*(e===`touch`?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){let t=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(t,fe);return v(e,n[12],n[13],n[14])}_calculateModelTransformOffset(e){let t=this._calculateModelTransformPosition(e);return y(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return s(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&c(t,t,this._worldFrame),c(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,this._applyObjectTransform?.(t),t}get test(){}}function B(e){return e[12]!==0||e[13]!==0||e[14]!==0}function V(e,t,n){switch(e.viewingMode){case`local`:return l(n),!0;case`global`:{let r=re(e.renderCoordsHelper.spatialReference);return E(t,0,J,0,r.radius),T(b(J[0]),b(J[1]),n),!0}}}function H(e){return L(e[0],e[1],e[2],`manipulator-${ne()}`)}const de=x(),U=se(),W=le(),G=a(),fe=u(),K=u(),q=ce(),J=n(),Y=n(),X=n(),Z=n(),Q=n(),pe=n(),$=new w({x:0,y:0,z:0,spatialReference:null}),me=()=>{};export{z as Manipulator3DBase,H as createPreciseManipulatorOrigin};
|
|
2
|
+
import{EventEmitter as e}from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import"../../../core/has.js";import{create as n,ZEROS as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromMat4 as i}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as o,set as s,multiply as c,identity as l}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as d}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{add as f,transformMat3 as p,transformMat4 as m,scale as h,copy as g,squaredDistance as _,set as v,subtract as y}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{deg2rad as b}from"../../../core/mathUtils.js";import{destroyMaybe as ee}from"../../../core/maybe.js";import{createRenderScreenPointArray3 as te,createScreenPointArray as x,screenPointObjectToArray as S,castRenderScreenPointArray as C}from"../../../core/screenUtils.js";import{generateUID as ne}from"../../../core/uid.js";import{getReferenceEllipsoid as re}from"../../../geometry/ellipsoidUtils.js";import w from"../../../geometry/Point.js";import{computeENUToPCPFLocalRotation as T}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as E}from"../../../geometry/projection/projectors.js";import{canProjectWithoutEngine as ie,projectPoint as ae}from"../../../geometry/projectionUtils.js";import{distance2 as oe,fromPoints as D,closestRayDistance2 as O,create as se}from"../../../geometry/support/lineSegment.js";import{fromPositionAndNormal as k,intersectRay as A,create as ce}from"../../../geometry/support/plane.js";import{create as le}from"../../../geometry/support/ray.js";import{sv3d as j}from"../../../geometry/support/vectorStacks.js";import{clonePoint as M}from"../../../layers/graphics/hydratedFeatures.js";import{hydratedSpatialReference as ue}from"../../../layers/graphics/hydratedSpatialReference.js";import{getElevationOffset as N}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as P}from"../support/ElevationProvider.js";import{containsElevationUpdatePoint as F}from"../support/elevationUpdateExtentUtils.js";import{fromScreen as I}from"../support/geometryUtils/ray.js";import{fromValues as L}from"../webgl-engine/lib/LocalOriginFactory.js";import{WebGLLayer as R}from"../webgl-engine/lib/WebGLLayer.js";class z{constructor(t){this.view=t,this.metadata=void 0,this._elevation={offset:0,override:null},this.collisionType={type:`point`},this.collisionPriority=0,this._renderObjects=[],this.autoScaleRenderObjects=!0,this.usePreciseLocalOrigin=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=u(),this._worldFrame=null,this._renderLocation=n(),this._renderLocationDirty=!0,this._location=new w({x:0,y:0,z:0}),this._elevationAlignedLocation=new w,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=0,this._focused=!1,this.events=new e,this._screenLocation={screenPointArray:x(),renderScreenPointArray:te(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=t.spatialReference}destroy(){this._applyObjectTransform=me,this._removeResourcesFromStage(),this._engineResources=null,this.view=null}get _stage(){return this.view?.stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,this._noDisplayCount===1&&this._updateEngineObject(),t(()=>{this._noDisplayCount--,this._noDisplayCount===0&&this._updateEngineObject()})}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){B(e)&&(this._screenLocationDirty=!0),o(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||=u(),V(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&=null),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){M(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit(`location-update`,{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty&&(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation()),this._elevationAlignedLocation}set elevationAlignedLocation(e){M(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit(`location-update`,{location:this._location})}_updateElevationAlignedLocation(){let e=this._elevation.override==null?this.location.z||0:this._elevation.override;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=ue(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit(`select-changed`,{action:e?`select`:`deselect`}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit(`focus-changed`,{action:e===!0?`focus`:`unfocus`}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;let e=this.view.state.camera;this._screenLocation.pixelSize=e.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let t=B(this._modelTransform),n;if(t){let e=this._calculateModelTransformOffset(pe);n=f(e,e,this.renderLocation)}else n=this.renderLocation;e.projectToRenderScreen(n,this._screenLocation.renderScreenPointArray),e.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(e,t){if(!this.available)return null;let n=this.view.state.camera,a=S(e,de),o=this._getCollisionRadius(t),s=this.collisionPriority*-1;switch(this.collisionType.type){case`point`:if(d(this.screenLocation.screenPointArray,a)<o*o)return this.screenLocation.renderScreenPointArray[2]+s;break;case`line`:{let e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(t,K),i=o*this.screenLocation.pixelSize,c=I(n,a,W);if(c==null)return null;for(let t of e){if(t.length===0)continue;let e=m(J,t[0],r);for(let a=1;a<t.length;a++){let o=m(Y,t[a],r),l=O(D(e,o,U),c);if(l!=null&&l<i*i){let t=f(j.get(),e,o);h(t,t,.5);let r=C(j.get());if(n.projectToRenderScreen(t,r))return r[2]+s}g(e,o)}}break}case`disc`:{let e=this.collisionType.direction,t=this.collisionType.offset??r,c=this._getWorldToScreenObjectScale(),l=this._calculateObjectTransform(c,K),u=o*this.screenLocation.pixelSize,d=I(n,a,W);if(d==null)return null;let f=i(G,l),h=p(Z,e,f),g=m(Q,t,l);k(g,h,q);let v=X;if(A(q,d,v)&&_(v,g)<u*u)return this.screenLocation.renderScreenPointArray[2]+s;break}case`ribbon`:{let{paths:e,direction:t}=this.collisionType,r=this._getWorldToScreenObjectScale(),c=this._calculateObjectTransform(r,K),l=o*n.computeScreenPixelSizeAt(this.renderLocation),u=I(n,a,W);if(u==null)return null;let d=i(G,c),_=p(Z,t,d),v=this._calculateModelTransformPosition(Q);k(v,_,q);let y=X;if(!A(q,u,y))break;for(let t of e){if(t.length===0)continue;let e=m(J,t[0],c);for(let r=1;r<t.length;r++){let i=m(Y,t[r],c),a=oe(D(e,i,U),y);if(a!=null&&a<l*l){let t=f(j.get(),e,i);h(t,t,.5);let r=C(j.get());if(n.projectToRenderScreen(t,r))return r[2]+s}g(e,i)}}break}default:this.collisionType}return null}attach(e={manipulator3D:{}}){let t=this._stage;if(!t)return;let n=e.manipulator3D;n.engineLayerId==null?(this._engineLayer=new R(t,{pickable:!1,updatePolicy:1}),n.engineLayerId=this._engineLayer.id):t?.getLayer&&(this._engineLayer=t.getLayer(n.engineLayerId)),n.engineLayerReferences=(n.engineLayerReferences||0)+1,this._attached=!0,this._updateEngineObject(),ie(this._location.spatialReference,this.view.spatialReference)||(this.location=new w({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){let t=e.manipulator3D;t.engineLayerReferences--;let n=t.engineLayerReferences===0;this._removeResourcesFromStage(),n&&(t.engineLayerId=null,ee(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._attached=!1}onViewChange(){this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){ae(this.location,$,e.spatialReference)&&F(e.extent,$.x,$.y,e.spatialReference)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(this.elevationInfo==null)return;let e=null,t=0,n=N(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case`on-the-ground`:e=P(this.view.elevationProvider,this.location,`ground`)??0;break;case`relative-to-ground`:t=(P(this.view.elevationProvider,this.location,`ground`)??0)+n;break;case`relative-to-scene`:t=(P(this.view.elevationProvider,this.location,`scene`)??0)+n;break;case`absolute-height`:t=n}(t!==this._elevation.offset||e!==this._elevation.override)&&(this._elevation.offset=t,this._elevation.override=e)}_updateEngineObject(){if(!this._attached)return;if(!this.available){this._removeResourcesFromStage();return}let e=this._getWorldToScreenObjectScale(),t=K,n=this.autoScaleRenderObjects===!0?this._getFocusedSize(this._radius,this.focused):1;this._calculateObjectTransform(n*e,t);let{objectsByState:r}=this._ensureEngineResources(),i=(this.focused?2:1)|(this.selected?8:4),a=this._noDisplayCount>0;for(let{stateMask:e,resources:n}of r){if(a){for(let{object:e}of n)e.visible=!1;continue}let r=!!(e&15),o=!!(e&65520),s=!r||(i&e)===(e&15),c=!o||(this.state&e)===(e&65520);if(s&&c)for(let{object:e,renderObject:r}of n)e.visible=!0,this.updateEngineObjectTransform(e,t,r);else for(let{object:e}of n)e.visible=!1}}_ensureEngineResources(){if(this._engineResources==null){let e=this._engineLayer,t=new Map;this._renderObjects.forEach(e=>{let n=this.createEngineObject(e),r=t.get(e.stateMask)??[];r.push({object:n,renderObject:e}),t.set(e.stateMask,r)});let n=Array.from(t,([e,t])=>({stateMask:e,resources:t}));this._engineResources={objectsByState:n,layer:e}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){let e=this._stage;if(this._engineResourcesAddedToStage||this._engineResources==null||!e)return;let{objectsByState:t,layer:n}=this._engineResources;t.forEach(({resources:e})=>n.addMany(e.map(({object:e})=>e))),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){let e=this._stage;if(!this._engineResourcesAddedToStage||this._engineResources==null||!e)return;let{objectsByState:t,layer:n}=this._engineResources;t.forEach(({resources:e})=>n.removeMany(e.map(({object:e})=>e))),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*(e===`touch`?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){let t=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(t,fe);return v(e,n[12],n[13],n[14])}_calculateModelTransformOffset(e){let t=this._calculateModelTransformPosition(e);return y(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return s(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&c(t,t,this._worldFrame),c(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,this._applyObjectTransform?.(t),t}get test(){}}function B(e){return e[12]!==0||e[13]!==0||e[14]!==0}function V(e,t,n){if(e.state.isGlobal){let r=re(e.renderCoordsHelper.spatialReference);E(t,0,J,0,r.radius),T(b(J[0]),b(J[1]),n)}else l(n)}function H(e){return L(e[0],e[1],e[2],`manipulator-${ne()}`)}const de=x(),U=se(),W=le(),G=a(),fe=u(),K=u(),q=ce(),J=n(),Y=n(),X=n(),Z=n(),Q=n(),pe=n(),$=new w({x:0,y:0,z:0,spatialReference:null}),me=()=>{};export{z as Manipulator3DBase,H as createPreciseManipulatorOrigin};
|