@arcgis/core 5.1.0-next.100 → 5.1.0-next.102
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 +1449 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0d81409721d29d8bc276.js +1 -0
- package/assets/esri/core/workers/chunks/{9478a0478fb49a88685e.js → 119b84f5349f90d1dd28.js} +1 -1
- package/assets/esri/core/workers/chunks/15167eeb6d7dbe7e392d.js +1 -0
- package/assets/esri/core/workers/chunks/{6881ae969b48bd04f064.js → 1ba37706e5d5eaabcb8e.js} +1 -1
- package/assets/esri/core/workers/chunks/{889a0405e3cdfa59b8e7.js → 1faa8a42d5a437fc40a3.js} +1 -1
- package/assets/esri/core/workers/chunks/{40137b23d8ad4af7ff9c.js → 3996149146dd1eca7cc5.js} +1 -1
- package/assets/esri/core/workers/chunks/{38b1d2ffcc318ac0119d.js → 48fcc10768d93e95a04e.js} +1 -1
- package/assets/esri/core/workers/chunks/{e7637d6a8ce0af46843c.js → 55ccb8ed7325efb62091.js} +2 -2
- package/assets/esri/core/workers/chunks/{2b2e5628d08d0e3108d2.js → 5663df3cd1dfd4b43c73.js} +1 -1
- package/assets/esri/core/workers/chunks/{0253292939b981134663.js → 5bc299f7f89a07a6e6a6.js} +1 -1
- package/assets/esri/core/workers/chunks/5dafd35801dca4229aed.js +1 -0
- package/assets/esri/core/workers/chunks/{d345030a89914348d3c5.js → 6f96ce41c47cae82e687.js} +1 -1
- package/assets/esri/core/workers/chunks/{b6b6f190687813267d77.js → 7db09c5bf024242becfa.js} +1 -1
- package/assets/esri/core/workers/chunks/{df232b8aa77f7e3285e3.js → 86bff154d46f8a562887.js} +1 -1
- package/assets/esri/core/workers/chunks/{07ddf1b1f7602063ceb0.js → 8f9117d589de7caaa02d.js} +1 -1
- package/assets/esri/core/workers/chunks/{2ad7c221ad317706387a.js → 9e7c84a3a2abec4d49df.js} +2 -2
- package/assets/esri/core/workers/chunks/{490e4a648cb2ab3e7956.js → a318cf6bb900e0ee268c.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ba29e7cf9fba3aa5f41.js → b1b8a7c00ec4d998ab84.js} +1 -1
- package/assets/esri/core/workers/chunks/{fff4b9e43464ebb3fb4e.js → bb5512ecb5300d45d46b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d8c4fb66c733ab2f66d3.js → bb81da98546c4d923e0d.js} +1 -1
- package/assets/esri/core/workers/chunks/{765ee0f2bfcec6d5bcc6.js → bc6a809a965355eb425f.js} +1 -1
- package/assets/esri/core/workers/chunks/{53ff47c06ccfc0be885c.js → d30790c69724258dab2b.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a20941913d0115cfe26.js → de25311b6d13bf1c6089.js} +2 -2
- package/assets/esri/core/workers/chunks/{9940b318f38ea9d7a533.js → e86c073f0b6d395c7a38.js} +1 -1
- package/assets/esri/core/workers/chunks/f5bd0a4f82df5e942b70.js +1 -0
- package/assets/esri/core/workers/chunks/{b8d10d8db44c7c6acebe.js → fa38dc5010f8630a80fe.js} +1 -1
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +125 -0
- package/assets/esri/themes/base/widgets/_Directions.scss +5 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer.json +1 -1
- package/chunks/GaussianSplatShadow.glsl.js +39 -0
- package/chunks/GlobalIllumination.glsl.js +1 -1
- package/config.js +1 -1
- package/form/elements/inputs/MultipleChoiceInput.d.ts +5 -5
- package/form/elements/inputs/MultipleChoiceInput.js +1 -1
- package/interfaces.d.ts +17 -0
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +29 -39
- package/layers/KnowledgeGraphLayer.d.ts +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/OrientedImageryLayer.d.ts +233 -0
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/ParquetLayer.d.ts +73 -24
- package/layers/ParquetLayer.js +1 -1
- package/layers/SceneLayer.d.ts +2 -2
- package/layers/VideoLayer.d.ts +35 -9
- package/layers/VideoLayer.js +1 -1
- package/layers/catalog/CatalogFootprintLayer.d.ts +147 -0
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +3 -1
- package/layers/support/FeatureReductionBinning.d.ts +87 -9
- package/layers/support/FeatureReductionCluster.d.ts +87 -9
- package/layers/support/FieldConfiguration.d.ts +1 -1
- package/layers/support/ParquetFilesData.d.ts +46 -0
- package/layers/support/ParquetFilesData.js +2 -0
- package/layers/support/ParquetPortalItemData.d.ts +25 -0
- package/layers/support/ParquetPortalItemData.js +2 -0
- package/layers/support/SubtypeSublayer.d.ts +147 -0
- package/layers/support/TelemetryData.d.ts +5 -0
- package/layers/support/TelemetryData.js +1 -1
- package/layers/support/TelemetryDisplay.d.ts +10 -2
- package/layers/support/TelemetryDisplay.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/types.d.ts +9 -0
- package/layers/video/VideoController.js +1 -1
- package/layers/video/types.d.ts +8 -1
- package/layers/video/videoUtils.js +1 -1
- package/networks/UtilityNetworkTraceAnalysis.d.ts +1 -1
- package/networks/UtilityNetworkTraceAnalysis.js +1 -1
- package/package.json +3 -3
- package/portal/jsonTypes.d.ts +7 -0
- package/renderers/support/ClassBreakInfo.d.ts +3 -3
- package/renderers/support/ClassBreakInfo.js +1 -1
- package/renderers/support/UniqueValueInfo.d.ts +3 -3
- package/renderers/support/UniqueValueInfo.js +1 -1
- package/rest/print.js +1 -1
- package/rest/support/PrintParameters.d.ts +8 -1
- package/rest/support/PrintParameters.js +1 -1
- package/support/revision.js +1 -1
- package/third-party-notices.txt +4 -0
- package/views/2d/engine/webgl/shaderGraph/graph/GlslGraphWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/surface.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +5 -2
- package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatShadowRenderNode.js +2 -0
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +2 -0
- package/views/3d/webgl-engine/shaders/GaussianSplatShadowTechnique.js +2 -0
- package/views/3d/webgl.js +1 -1
- package/views/Viewport2DBaseMixin.js +1 -1
- package/widgets/Attachments/support/attachmentUtils.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +8 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.js +2 -0
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/templates/RelationshipElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/types.d.ts +7 -0
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.d.ts +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
- package/widgets/OrientedImageryViewer/services/TransformationService.js +1 -1
- package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
- package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
- package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
- package/widgets/OrientedImageryViewer/types.js +1 -1
- package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +9 -0
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
- package/widgets/support/forms/formUtils.js +1 -1
- package/assets/esri/core/workers/chunks/26f28406056ddc0e159c.js +0 -1
- package/assets/esri/core/workers/chunks/43cc82373be791b7cb4c.js +0 -1
- package/assets/esri/core/workers/chunks/b06cc59068d32baaaa87.js +0 -1
- package/assets/esri/core/workers/chunks/c9461568e1002ebac534.js +0 -1
- /package/assets/esri/core/workers/chunks/{e7637d6a8ce0af46843c.js.LICENSE.txt → 55ccb8ed7325efb62091.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{7a20941913d0115cfe26.js.LICENSE.txt → de25311b6d13bf1c6089.js.LICENSE.txt} +0 -0
package/layers/video/types.d.ts
CHANGED
|
@@ -106,4 +106,11 @@ export interface LivestreamStatus {
|
|
|
106
106
|
* @since 5.0
|
|
107
107
|
*/
|
|
108
108
|
seekableStart?: number | null;
|
|
109
|
-
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Defines an object that represents the available coverage data of the layer.
|
|
113
|
+
*
|
|
114
|
+
* @since 5.1
|
|
115
|
+
*/
|
|
116
|
+
export interface Coverage {}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../geometry/Point.js";import t from"../../geometry/Polygon.js";import r from"../../geometry/Polyline.js";import n from"../../geometry/SpatialReference.js";import{execute as o}from"../../geometry/operators/projectOperator.js";import i from"../support/TelemetryData.js";import a from"../support/VideoTimeExtent.js";import{applyCIMSymbolColor as u}from"../../symbols/support/cimSymbolUtils.js";import{applyColorToSymbol as s}from"../../symbols/support/utils.js";const l="application/x-mpegURL",f="video/mp4",d="video/webm",g={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,FrameCenterAboveEllipsoid:10078,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function m(e,t=1e4){if(!e||!e.length)return[];let r=[],n=[];for(let i=0;i<e.length;i++){const t=e[i],n=t?.text?JSON.parse(t.text):null;"EsriVideoServer"===n?.source&&(r=[...n.data])}const o=r.find(e=>e.tagId===t);return Array.isArray(o?.value)&&(n=[...o.value]),n}function C(e){const{duration:t,end:r,start:n,timezone:o="UTC"}=e||{};return"number"!=typeof
|
|
2
|
+
import e from"../../geometry/Point.js";import t from"../../geometry/Polygon.js";import r from"../../geometry/Polyline.js";import n from"../../geometry/SpatialReference.js";import{execute as o}from"../../geometry/operators/projectOperator.js";import i from"../support/TelemetryData.js";import a from"../support/VideoTimeExtent.js";import{applyCIMSymbolColor as u}from"../../symbols/support/cimSymbolUtils.js";import{applyColorToSymbol as s}from"../../symbols/support/utils.js";const l="application/x-mpegURL",f="video/mp4",d="video/webm",g={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,FrameCenterAboveEllipsoid:10078,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function m(e,t=1e4){if(!e||!e.length)return[];let r=[],n=[];for(let i=0;i<e.length;i++){const t=e[i],n=t?.text?JSON.parse(t.text):null;"EsriVideoServer"===n?.source&&(r=[...n.data])}const o=r.find(e=>e.tagId===t);return Array.isArray(o?.value)&&(n=[...o.value]),n}function C(e){const{duration:t,end:r,start:n,timezone:o="UTC"}=e||{};return[t,r,n].some(e=>"number"!=typeof e||e<0)?null:new a({duration:t||null,end:new Date(Number(r)),start:new Date(Number(n)),timezone:o})}function c(e,t){const r=[...t],n=r.findIndex(t=>t.equals(e));return n>-1&&r.splice(n),r.push(e),r}function L(e){if(!e?.size)return new i;const t=z(e),r=E(e),n=w(e),o=b(t,r);return new i({frameCenter:r,frameOutline:n,lineOfSight:o,sensorLocation:t})}function y(e){if(!e?.size)return null;return e.get(g.EsriGroundControlPoints)?.value??null??null}function P(e){return e?.size?e.get(g.EsriHorizonPixelPack)?.value??null:null}function E(e){return O(e)??F(e)}function p(e){if(!e)return l;const t=e.match(/\.(\w{3,4})(?:$|\?)/i);if(!t)return l;switch(t[1].toLowerCase()){case"mp4":return f;case"webm":return d;default:return l}}function S(e){const t=e?.layers;return t?.length?t.map(e=>({layerId:e.id,posterUrl:e.poster,sourceType:e.serviceType,title:e.name,type:e.type||"Video Layer"})):[]}function h(e,t,r){if(!e)return null;const n=e.clone();switch(n.type){case"simple-fill":s(n,r),n.outline.color=t;break;case"simple-line":s(n,t);break;case"simple-marker":s(n,t),n?.outline?.color&&(n.outline.color=t);break;case"cim":u(n,t)}return n}function v(e){const{cameraAzimuth:t,platformHeading:r,source:n=null,symbolOffset:o=0}=e||{};let i=0;if(!n)return i;i="platformHeading"===n?r+o:r+t+o;const a=i>360?i-360:i;return Math.round(Math.abs(a))}function x(t,r,i){if(!r||r.length<3)return null;const a=[...r].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y),u=Array.from(new Set(a.map(e=>e.x))).sort((e,t)=>e-t),s=Array.from(new Set(a.map(e=>e.y)));let l=-1;for(let e=u.length-2;e>=0;e--)if(t.x>=u[e]&&t.x<=u[e+1]){l=e;break}let f=-1;for(let e=s.length-2;e>=0;e--)if(t.y>=s[e]&&t.y<=s[e+1]){f=e;break}if(l<0||f<0||l>=u.length-1||f>=s.length-1)return null;const d=u[l],g=u[l+1],m=s[f],C=s[f+1],c=(e,t)=>{const n=r.find(r=>r.x===e&&r.y===t);if(!n)throw new Error(`Control point not found for x: ${e}, y: ${t}`);return n},L=c(d,m),y=c(g,m),P=c(d,C),E=c(g,C),p=t.x,S=t.y;let h,v;if(G(L.x,L.y,y.x,y.y,E.x,E.y,p,S)){const t=new e(L.lon,L.lat,n.WGS84),r=new e(y.lon,y.lat,n.WGS84),a=new e(E.lon,E.lat,n.WGS84);v=[L,y,E],h=[o(t,i),o(r,i),o(a,i)]}else{if(!G(L.x,L.y,E.x,E.y,P.x,P.y,p,S))return null;{const t=new e(L.lon,L.lat,n.WGS84),r=new e(E.lon,E.lat,n.WGS84),a=new e(P.lon,P.lat,n.WGS84);v=[L,E,P],h=[o(t,i),o(r,i),o(a,i)]}}const[x,O,F]=v,[w,T,A]=h,b=(O.y-F.y)*(x.x-F.x)+(F.x-O.x)*(x.y-F.y),z=((O.y-F.y)*(p-F.x)+(F.x-O.x)*(S-F.y))/b,V=((F.y-x.y)*(p-F.x)+(x.x-F.x)*(S-F.y))/b,k=1-z-V;return[z*w.x+V*T.x+k*A.x,z*w.y+V*T.y+k*A.y]}function O(t){return t&&t.has(g.EsriFrameCenterLatitude)&&t.has(g.EsriFrameCenterLongitude)?new e({x:t.get(g.EsriFrameCenterLongitude).value,y:t.get(g.EsriFrameCenterLatitude).value,z:t.get(g.FrameCenterAboveEllipsoid)?.value??t.get(g.FrameCenterElevation)?.value}):null}function F(t){return t&&t.has(g.FrameCenterLatitude)&&t.has(g.FrameCenterLongitude)?new e({x:t.get(g.FrameCenterLongitude)?.value,y:t.get(g.FrameCenterLatitude)?.value,z:t.get(g.FrameCenterElevation)?.value}):null}function w(e){if(!e)return null;const r=e.get(g.EsriFrameOutline)?.value;return r?t.fromJSON(r.geometry):T(e)??A(e)}function T(e){if(!(e.has(g.EsriCornerLatitudePt1)&&e.has(g.EsriCornerLongitudePt1)&&e.has(g.EsriCornerLatitudePt2)&&e.has(g.EsriCornerLongitudePt2)&&e.has(g.EsriCornerLatitudePt3)&&e.has(g.EsriCornerLongitudePt3)&&e.has(g.EsriCornerLatitudePt4)&&e.has(g.EsriCornerLongitudePt4)))return null;const r=[e.get(g.EsriCornerLongitudePt1)?.value,e.get(g.EsriCornerLatitudePt1)?.value],n=[e.get(g.EsriCornerLongitudePt2)?.value,e.get(g.EsriCornerLatitudePt2)?.value],o=[e.get(g.EsriCornerLongitudePt3)?.value,e.get(g.EsriCornerLatitudePt3)?.value],i=[e.get(g.EsriCornerLongitudePt4)?.value,e.get(g.EsriCornerLatitudePt4)?.value];return new t({rings:[[r,n,o,i]]})}function A(e){if(!(e.has(g.OffsetCorner1Latitude)&&e.has(g.OffsetCorner1Longitude)&&e.has(g.OffsetCorner2Latitude)&&e.has(g.OffsetCorner2Longitude)&&e.has(g.OffsetCorner3Latitude)&&e.has(g.OffsetCorner3Longitude)&&e.has(g.OffsetCorner4Latitude)&&e.has(g.OffsetCorner4Longitude)&&e.has(g.FrameCenterLatitude)&&e.has(g.FrameCenterLongitude)))return null;const r=e.get(g.FrameCenterLatitude)?.value,n=e.get(g.FrameCenterLongitude)?.value,o=r+e.get(g.OffsetCorner1Latitude)?.value,i=n+e.get(g.OffsetCorner1Longitude)?.value,a=r+e.get(g.OffsetCorner2Latitude)?.value,u=n+e.get(g.OffsetCorner2Longitude)?.value,s=r+e.get(g.OffsetCorner3Latitude)?.value,l=n+e.get(g.OffsetCorner3Longitude)?.value,f=r+e.get(g.OffsetCorner4Latitude)?.value,d=n+e.get(g.OffsetCorner4Longitude)?.value;return new t({rings:[[[i,o],[u,a],[l,s],[d,f]]]})}function b(e,t){if(!e||!t)return null;const n=[e.x,e.y,e.z??0],o=[t.x,t.y,t.z??0];return new r({hasZ:!0,hasM:!1,paths:[[n,o]]})}function z(t){if(!t?.size)return null;if(t.has(g.EsriSensorPosition)){const r=t.get(g.EsriSensorPosition)?.value;if(r)return e.fromJSON(r.geometry)}return t.has(g.SensorLongitude)&&t.has(g.SensorLatitude)?new e({x:t.get(g.SensorLongitude)?.value,y:t.get(g.SensorLatitude)?.value,z:t.get(g.SensorTrueAltitude)?.value}):null}function G(e,t,r,n,o,i,a,u){return(o-a)*(t-u)-(e-a)*(i-u)>=0&&(e-a)*(n-u)-(r-a)*(t-u)>=0&&(r-a)*(i-u)-(o-a)*(n-u)>=0}export{x as computeVideoToMapBaricentric,E as getFrameCenter,P as getFrameHorizonPoints,y as getGroundControlPoints,b as getLineOfSight,c as getSensorTrailPoints,S as getServiceLayersInfo,h as getStyledTelemetrySymbol,v as getSymbolDisplayAngle,L as getTelemetryData,m as getVideoMetadataFromCueList,p as getVideoMimeType,C as readVideoTimeExtent,g as videoMetadataEntryId};
|
|
@@ -83,7 +83,7 @@ export interface NamedTraceConfigurationParameters {
|
|
|
83
83
|
export type UtilityNetworkTraceAnalysisExecutionError = "trace-error";
|
|
84
84
|
|
|
85
85
|
/** @since 5.0 */
|
|
86
|
-
export type UtilityNetworkTraceAnalysisLoadError = "no-user-type-extension" | "no-utility-network" | "no-view" | "sceneView-not-supported";
|
|
86
|
+
export type UtilityNetworkTraceAnalysisLoadError = "no-user-type-extension" | "no-utility-network" | "no-view" | "sceneView-not-supported" | "utility-network-load-failed";
|
|
87
87
|
|
|
88
88
|
/** @since 5.0 */
|
|
89
89
|
export type UtilityNetworkTraceAnalysisState = "disabled" | "executing" | "loading" | "ready";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import r from"../core/Accessor.js";import e from"../core/Error.js";import o from"../core/Logger.js";import{watch as i}from"../core/reactiveUtils.js";import{property as s,subclass as a}from"../core/accessorSupport/decorators.js";import{UpdatingHandles as n}from"../core/support/UpdatingHandles.js";import l from"../layers/FeatureLayer.js";import{getOwningPortalUrl as u}from"../layers/support/layerUtils.js";import d from"../portal/Portal.js";import{hasUserTypeExtension as c}from"../portal/support/utils.js";let h=class extends r{constructor(t){super(t),this._updatingHandlesLoad=new n,this._updatingHandlesExecute=new n}initialize(){this.addHandles([i(()=>[this.view,this.utilityNetwork],()=>{this._setUp()},{initial:!0})])}destroy(){this._updatingHandlesLoad.destroy(),this._updatingHandlesExecute.destroy()}get executionError(){return this._executionError}get loadError(){return this._loadError}get state(){return this._updatingHandlesLoad.updating?"loading":this.loadError?"disabled":this._updatingHandlesExecute.updating?"executing":"ready"}get utilityNetwork(){return this._get("utilityNetwork")}set utilityNetwork(t){this._get("utilityNetwork")!==t&&this._set("utilityNetwork",t)}get view(){return this._get("view")}set view(t){this._get("view")!==t&&this._set("view",t)}async executeNamedTraceConfiguration(t){return this._updatingHandlesExecute.addPromise(this._executeNamedTraceConfiguration(t))}async executeTraceConfiguration(t){return this._updatingHandlesExecute.addPromise(this._executeTraceConfiguration(t))}async _executeNamedTraceConfiguration(t){if("disabled"===this.state){const t="trace-analysis-view-model:load-error";throw this._logError(t,this.loadError),new e(t,this.loadError??"")}this._executionError=null;return await this.utilityNetwork.trace(t).catch(t=>{throw this._executionError="trace-error",this._logError("trace-analysis-view-model:execution-error",this.executionError),t})}async _executeTraceConfiguration(t){if("disabled"===this.state){const t="trace-analysis-view-model:load-error";throw this._logError(t,this.loadError),new e(t,this.loadError??"")}this._executionError=null;return await this.utilityNetwork.trace(t).catch(t=>{throw this._executionError="trace-error",this._logError("trace-analysis-view-model:execution-error",this.executionError),t})}_logError(t,r){o.getLogger(this).error(new e(t,r??""))}async _setUp(){const{utilityNetwork:t,view:r}=this;this._updatingHandlesLoad.consumePromise((async()=>{if(this._loadError=null,!r)return void(this._loadError="no-view");if("2d"!==r.type)return void(this._loadError="sceneView-not-supported");const e=r.map;await e.load();const o=e.utilityNetworks;o?.length
|
|
2
|
+
import{__decorate as t}from"tslib";import r from"../core/Accessor.js";import e from"../core/Error.js";import o from"../core/Logger.js";import{watch as i}from"../core/reactiveUtils.js";import{property as s,subclass as a}from"../core/accessorSupport/decorators.js";import{UpdatingHandles as n}from"../core/support/UpdatingHandles.js";import l from"../layers/FeatureLayer.js";import{getOwningPortalUrl as u}from"../layers/support/layerUtils.js";import d from"../portal/Portal.js";import{hasUserTypeExtension as c}from"../portal/support/utils.js";let h=class extends r{constructor(t){super(t),this._updatingHandlesLoad=new n,this._updatingHandlesExecute=new n}initialize(){this.addHandles([i(()=>[this.view,this.utilityNetwork],()=>{this._setUp()},{initial:!0})])}destroy(){this._updatingHandlesLoad.destroy(),this._updatingHandlesExecute.destroy()}get executionError(){return this._executionError}get loadError(){return this._loadError}get state(){return this._updatingHandlesLoad.updating?"loading":this.loadError?"disabled":this._updatingHandlesExecute.updating?"executing":"ready"}get utilityNetwork(){return this._get("utilityNetwork")}set utilityNetwork(t){this._get("utilityNetwork")!==t&&this._set("utilityNetwork",t)}get view(){return this._get("view")}set view(t){this._get("view")!==t&&this._set("view",t)}async executeNamedTraceConfiguration(t){return this._updatingHandlesExecute.addPromise(this._executeNamedTraceConfiguration(t))}async executeTraceConfiguration(t){return this._updatingHandlesExecute.addPromise(this._executeTraceConfiguration(t))}async _executeNamedTraceConfiguration(t){if("disabled"===this.state){const t="trace-analysis-view-model:load-error";throw this._logError(t,this.loadError),new e(t,this.loadError??"")}this._executionError=null;return await this.utilityNetwork.trace(t).catch(t=>{throw this._executionError="trace-error",this._logError("trace-analysis-view-model:execution-error",this.executionError),t})}async _executeTraceConfiguration(t){if("disabled"===this.state){const t="trace-analysis-view-model:load-error";throw this._logError(t,this.loadError),new e(t,this.loadError??"")}this._executionError=null;return await this.utilityNetwork.trace(t).catch(t=>{throw this._executionError="trace-error",this._logError("trace-analysis-view-model:execution-error",this.executionError),t})}_logError(t,r){o.getLogger(this).error(new e(t,r??""))}async _setUp(){const{utilityNetwork:t,view:r}=this;this._updatingHandlesLoad.consumePromise((async()=>{if(this._loadError=null,!r)return void(this._loadError="no-view");if("2d"!==r.type)return void(this._loadError="sceneView-not-supported");const e=r.map;await e.load();const o=e.utilityNetworks;if(o?.length)if(t&&o.includes(t)||(this.utilityNetwork=o.getItemAt(0)??null),"utility"===this.utilityNetwork?.type){if(!this.utilityNetwork.loaded)try{await this.utilityNetwork.load()}catch{return void(this._loadError="utility-network-load-failed")}await this._checkUserTypeExtension(this.utilityNetwork)}else this._loadError="utility-network-load-failed";else this._loadError="no-utility-network"})())}async _checkUserTypeExtension(t){const r=new l({url:t.networkSystemLayers.dirtyAreasLayerUrl});await r.load();const e=r.version;if(Number(e)<=11.1){const r=await u(t.layerUrl),e=new d({url:r});await e.load();const o=e.user?.username??"";if(!await c(e,o,"utilityNetwork")){const t="trace-analysis-view-model:load-error";this._loadError="no-user-type-extension",this._logError(t,this.loadError)}}}};t([s()],h.prototype,"_executionError",void 0),t([s()],h.prototype,"_loadError",void 0),t([s()],h.prototype,"executionError",null),t([s()],h.prototype,"loadError",null),t([s({readOnly:!0})],h.prototype,"state",null),t([s()],h.prototype,"utilityNetwork",null),t([s()],h.prototype,"view",null),h=t([a("esri.networks.UtilityNetworkTraceAnalysis")],h);const y=h;export{y as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.1.0-next.
|
|
3
|
+
"version": "5.1.0-next.102",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@amcharts/amcharts5": "~5.17.2",
|
|
22
|
-
"@arcgis/toolkit": "^5.1.0-next.
|
|
22
|
+
"@arcgis/toolkit": "^5.1.0-next.104",
|
|
23
23
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
24
24
|
"@esri/calcite-components": "^5.1.0-next.47",
|
|
25
|
-
"@vaadin/grid": "~25.1.
|
|
25
|
+
"@vaadin/grid": "~25.1.3",
|
|
26
26
|
"@zip.js/zip.js": "~2.8.26",
|
|
27
27
|
"luxon": "~3.7.2",
|
|
28
28
|
"marked": "~18.0.3",
|
package/portal/jsonTypes.d.ts
CHANGED
|
@@ -372,6 +372,13 @@ export interface VideoCameraInfo {
|
|
|
372
372
|
tilt: number;
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
+
/**
|
|
376
|
+
* Represents the telemetry elements available for display customization.
|
|
377
|
+
*
|
|
378
|
+
* @since 5.1
|
|
379
|
+
*/
|
|
380
|
+
export interface TelemetryElementFilter {}
|
|
381
|
+
|
|
375
382
|
/**
|
|
376
383
|
* A JSON Feature object that can be added to a [StreamLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer/) on the client by calling its
|
|
377
384
|
* [sendMessageToClient()](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer/#sendMessageToClient) method.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type CIMSymbol from "../../symbols/CIMSymbol.js";
|
|
2
2
|
import type { JSONSupport } from "../../core/JSONSupport.js";
|
|
3
|
+
import type { CIMSymbolProperties } from "../../symbols/CIMSymbol.js";
|
|
3
4
|
import type { SymbolUnion } from "../../symbols/types.js";
|
|
4
5
|
import type { WebStyleSymbolProperties } from "../../symbols/WebStyleSymbol.js";
|
|
5
6
|
import type { PolygonSymbol3DProperties } from "../../symbols/PolygonSymbol3D.js";
|
|
@@ -7,7 +8,6 @@ import type { PointSymbol3DProperties } from "../../symbols/PointSymbol3D.js";
|
|
|
7
8
|
import type { MeshSymbol3DProperties } from "../../symbols/MeshSymbol3D.js";
|
|
8
9
|
import type { LineSymbol3DProperties } from "../../symbols/LineSymbol3D.js";
|
|
9
10
|
import type { LabelSymbol3DProperties } from "../../symbols/LabelSymbol3D.js";
|
|
10
|
-
import type { CIMSymbolProperties } from "../../symbols/CIMSymbol.js";
|
|
11
11
|
import type { TextSymbolProperties } from "../../symbols/TextSymbol.js";
|
|
12
12
|
import type { SimpleMarkerSymbolProperties } from "../../symbols/SimpleMarkerSymbol.js";
|
|
13
13
|
import type { SimpleLineSymbolProperties } from "../../symbols/SimpleLineSymbol.js";
|
|
@@ -54,7 +54,7 @@ export interface ClassBreakInfoProperties extends Partial<Pick<ClassBreakInfo, "
|
|
|
54
54
|
* ]
|
|
55
55
|
* ```
|
|
56
56
|
*/
|
|
57
|
-
alternateSymbols?: CIMSymbolProperties[] | null;
|
|
57
|
+
alternateSymbols?: (CIMSymbolProperties | CIMSymbolProperties)[] | null;
|
|
58
58
|
/**
|
|
59
59
|
* Defines the symbol used to render features with data values that are within the bounds
|
|
60
60
|
* defined for the class break. This value may be autocast by specifying the symbol `type`.
|
|
@@ -118,7 +118,7 @@ export default class ClassBreakInfo extends JSONSupport {
|
|
|
118
118
|
* ```
|
|
119
119
|
*/
|
|
120
120
|
get alternateSymbols(): CIMSymbol[] | null | undefined;
|
|
121
|
-
set alternateSymbols(value: CIMSymbolProperties[] | null | undefined);
|
|
121
|
+
set alternateSymbols(value: (CIMSymbolProperties | CIMSymbolProperties)[] | null | undefined);
|
|
122
122
|
/**
|
|
123
123
|
* Describes the data represented by the class break. This label will appear in the
|
|
124
124
|
* [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/) next to the symbol representing the break.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as s,subclass as o}from"../../core/accessorSupport/decorators.js";import{requiredRendererSymbolProperty as l}from"./commonProperties.js";import r from"../../symbols/CIMSymbol.js";var a;let i=a=class extends t{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}get alternateSymbols(){return this._get("alternateSymbols")??null}set alternateSymbols(e){e?this._set("alternateSymbols",e.map(e=>e instanceof r?e:(delete e.type,new r(e)))):this._set("alternateSymbols",null)}clone(){return new a({alternateSymbols:this.alternateSymbols?.map(e=>e.clone()),description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?.clone()??null})}};e([s({type:String,json:{write:!0}})],i.prototype,"description",void 0),e([s({type:String,json:{write:!0}})],i.prototype,"label",void 0),e([s({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],i.prototype,"minValue",void 0),e([s({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],i.prototype,"maxValue",void 0),e([s(l)],i.prototype,"symbol",void 0),e([s({type:[r],useTypeForAutocast:!1,json:{write:!0,origins:{"web-scene":{write:!1}}}})],i.prototype,"alternateSymbols",null),i=a=e([o("esri.renderers.support.ClassBreakInfo")],i);export{i as default};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type CIMSymbol from "../../symbols/CIMSymbol.js";
|
|
2
2
|
import type { JSONSupport } from "../../core/JSONSupport.js";
|
|
3
|
+
import type { CIMSymbolProperties } from "../../symbols/CIMSymbol.js";
|
|
3
4
|
import type { SymbolUnion } from "../../symbols/types.js";
|
|
4
5
|
import type { WebStyleSymbolProperties } from "../../symbols/WebStyleSymbol.js";
|
|
5
6
|
import type { PolygonSymbol3DProperties } from "../../symbols/PolygonSymbol3D.js";
|
|
@@ -7,7 +8,6 @@ import type { PointSymbol3DProperties } from "../../symbols/PointSymbol3D.js";
|
|
|
7
8
|
import type { MeshSymbol3DProperties } from "../../symbols/MeshSymbol3D.js";
|
|
8
9
|
import type { LineSymbol3DProperties } from "../../symbols/LineSymbol3D.js";
|
|
9
10
|
import type { LabelSymbol3DProperties } from "../../symbols/LabelSymbol3D.js";
|
|
10
|
-
import type { CIMSymbolProperties } from "../../symbols/CIMSymbol.js";
|
|
11
11
|
import type { TextSymbolProperties } from "../../symbols/TextSymbol.js";
|
|
12
12
|
import type { SimpleMarkerSymbolProperties } from "../../symbols/SimpleMarkerSymbol.js";
|
|
13
13
|
import type { SimpleLineSymbolProperties } from "../../symbols/SimpleLineSymbol.js";
|
|
@@ -52,7 +52,7 @@ export interface UniqueValueInfoProperties extends Partial<Pick<UniqueValueInfo,
|
|
|
52
52
|
* ]
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
|
-
alternateSymbols?: CIMSymbolProperties[] | null;
|
|
55
|
+
alternateSymbols?: (CIMSymbolProperties | CIMSymbolProperties)[] | null;
|
|
56
56
|
/**
|
|
57
57
|
* Defines the symbol used to render features with the provided [value](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#value).
|
|
58
58
|
*
|
|
@@ -116,7 +116,7 @@ export default class UniqueValueInfo extends JSONSupport {
|
|
|
116
116
|
* ```
|
|
117
117
|
*/
|
|
118
118
|
get alternateSymbols(): CIMSymbol[] | null | undefined;
|
|
119
|
-
set alternateSymbols(value: CIMSymbolProperties[] | null | undefined);
|
|
119
|
+
set alternateSymbols(value: (CIMSymbolProperties | CIMSymbolProperties)[] | null | undefined);
|
|
120
120
|
/**
|
|
121
121
|
* Describes the [value](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#value) represented by the [symbol](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#symbol). This label will appear in the
|
|
122
122
|
* [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/) next to the symbol representing the value.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as
|
|
2
|
+
import{__decorate as t}from"tslib";import{JSONSupport as e}from"../../core/JSONSupport.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import{requiredRendererSymbolProperty as l,uniqueValueProperty as r}from"./commonProperties.js";import i from"../../symbols/CIMSymbol.js";var n;let a=n=class extends e{constructor(t){super(t),this.description=null,this.label=null,this.symbol=null,this.value=null}get alternateSymbols(){return this._get("alternateSymbols")??null}set alternateSymbols(t){t?this._set("alternateSymbols",t.map(t=>t instanceof i?t:(delete t.type,new i(t)))):this._set("alternateSymbols",null)}clone(){return new n({alternateSymbols:this.alternateSymbols?.map(t=>t.clone()),value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}};t([o({type:String,json:{write:!0}})],a.prototype,"description",void 0),t([o({type:String,json:{write:!0}})],a.prototype,"label",void 0),t([o(l)],a.prototype,"symbol",void 0),t([o({type:[i],useTypeForAutocast:!1,json:{write:!0,origins:{"web-scene":{write:!1}}}})],a.prototype,"alternateSymbols",null),t([o(r)],a.prototype,"value",void 0),a=n=t([s("esri.renderers.support.UniqueValueInfo")],a);export{a as default};
|
package/rest/print.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{id as e}from"../kernel.js";import t from"../request.js";import{JSONMap as a}from"../core/jsonMap.js";import{createScreenPoint as i,pt2px as r,px2pt as n}from"../core/screenUtils.js";import{dataComponents as o,normalize as s}from"../core/urlUtils.js";import l from"../geometry/Polygon.js";import{collectLabelingFields as u}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as c}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as y}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as f,findToken as p}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as m}from"./geoprocessor/submitJob.js";import{formatJsonMap as g}from"./support/fileFormat.js";import{toJSON as b}from"./support/layoutTemplate.js";import{getVisibleLayerViews as h,isScreenshotRequired as w,isBingMapsLayer as S,isBlendLayer as I,getCopyright as x,getSelectionSymbol as v,createPointLayer as D,getContextBoundingBox as L,createPolygonLayer as T,createPolylineLayer as O,createMultipointLayer as V}from"./support/printTaskUtils.js";import E from"./support/PrintTemplate.js";import{toJSON as P}from"./support/reportTemplate.js";import M from"../symbols/WebStyleSymbol.js";import F from"../views/support/HighlightOptions.js";const k={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},N=new a({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),R=new a({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),j=new Map;async function J(e,t,a){const i=await U(e,a),r=await z(t,i);if("sync"===await A(e,a)){const{results:t}=await d(e,r,void 0,a);return t?.[0]?.value}const n=await m(e,r,void 0,a);await n.waitForJobCompletion({interval:t.updateDelay});const{value:o}=await n.fetchResultData("Output_File",null,a);return o}async function U(e,a){const i=G(e),r=j.get(i)??{gpServerUrl:i,legendLayerNameMap:{},legendLayers:[],screenshotLayers:[]};return r.gpMetadata??=(await t(i,f({f:"json"},a))).data,r.cimVersion=r.gpMetadata.cimVersion,r.webStyleCache??=new Map,j.set(i,r),r}async function A(e,t){return ve(await U(e,t))}async function C(e,a){const i=await U(e,a),r=i.gpMetadata.tasks,n=i.gpServerUrl;if(i.taskInfos)return i.taskInfos;const o=(await t(e,f({f:"json"},a))).data;i.taskInfos={ExportWebMap:o};const s=r?.filter(e=>e!==o.name)??[];return await Promise.all(s.map(async e=>{const r=(await t(`${n}/${e}`,f({f:"json"},a))).data,o=r.name.startsWith("GetLayoutTemplatesInfo")?"GetLayoutTemplatesInfo":null;o&&(i.taskInfos[o]??=r)})),i.taskInfos}async function q(e,t,a){return(await C(e,a))[t]??null}async function _(e,t,a){const i=await q(e,t,a);return i?.executionType?R.fromJSON(i.executionType):"sync"}async function z(t,a){a=a||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const i=t.template||new E;null==i.showLabels&&(i.showLabels=!0);const r=i.exportOptions;let n;const o=b(i.layout);if(r){if(n={dpi:r.dpi},"map_only"===o?.toLowerCase()||""===o){const{width:e,height:t}=r;n.outputSize=null!=e&&null!=t?[e,t]:void 0}}const s=i.layoutOptions;let l;if(s){let e,t;"Miles"===s.scalebarUnit||"Kilometers"===s.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==s.scalebarUnit&&"Feet"!==s.scalebarUnit||(e="Meters",t="Feet"),l={titleText:s.titleText,authorText:s.authorText,copyrightText:s.copyrightText,customTextElements:s.customTextElements,elementOverrides:s.elementOverrides,scaleBarOptions:e||t?{metricUnit:N.toJSON(e)??void 0,metricLabel:e?k[e]:void 0,nonMetricUnit:N.toJSON(t)??void 0,nonMetricLabel:t?k[t]:void 0}:void 0}}const u=await $(t,i,a);if(u.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,a=a=>{const i=a.text,r=a.font,n=r?.family?.toLowerCase();i&&r&&("arial"===n||"arial unicode ms"===n)&&(r.family=e.test(i)?"Arial Unicode MS":"Arial","normal"!==r.style&&t.test(i)&&(r.family="Arial Unicode MS"))};for(const i of u.operationalLayers)if(i.featureCollection?.layers)for(const e of i.featureCollection.layers){if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type&&a(t.symbol)}if(e.featureSet?.features)for(const t of e.featureSet.features)t.symbol&&"esriTS"===t.symbol.type&&a(t.symbol)}}let c=null;s?.legendLayers&&(c=s.legendLayers.filter(e=>!a.screenshotLayers.includes(e.layerId)).map(e=>{const t=e.layerId;a.legendLayerNameMap[t]=e.title;const i={id:t};if(e.subLayerIds){i.subLayerIds=e.subLayerIds;const t=e.dynamicLegend;null!=t&&(i.subLayerDynamicLegends=e.subLayerIds.map(()=>t))}return null!=e.dynamicLegend&&(i.dynamicLegend=e.dynamicLegend),i})),t.outSpatialReference&&(u.mapOptions.spatialReference=t.outSpatialReference.toJSON()),Object.assign(u,{exportOptions:n,layoutOptions:l||{}}),Object.assign(u.layoutOptions,{legendOptions:{operationalLayers:null!=c?c:a.legendLayers.slice()}}),a.legendLayers.length=0,a.screenshotLayers.length=0,j.set(a.gpServerUrl,a);const y={Web_Map_as_JSON:JSON.stringify(u),Format:g.toJSON(i.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:P(i.report),Report_Item_ID:void 0};if(i.layoutItem){delete y.Layout_Template;const t=i.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(a.gpServerUrl),y.Layout_Item_ID=JSON.stringify({id:t.id})}if(i.reportItem){delete y.Report_Template;const t=i.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(a.gpServerUrl),y.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(y,t.extraParameters),y}async function $(e,t,a){const i=e.view;let r=i.spatialReference;const n={operationalLayers:await W(i,t,a)};t.includeTables&&(n.tables=await ue(i));let o=e.extent||a.ssExtent||i.extent;if(r?.isWrappable&&(o=o.clone()._normalize(!0),r=o.spatialReference),n.mapOptions={extent:o&&o.toJSON(),spatialReference:r&&r.toJSON(),showAttribution:t.attributionVisible},a.ssExtent=null,i.background&&(n.background=i.background.toJSON()),i.rotation&&(n.mapOptions.rotation=-i.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||i.scale),null!=i.timeExtent){const e=null!=i.timeExtent.start?i.timeExtent.start.getTime():null,t=null!=i.timeExtent.end?i.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function G(e){let t=e;const a=t.lastIndexOf("/GPServer/");return a>0&&(t=t.slice(0,a+9)),t}async function W(e,t,a){const i=[];let r=0;t.scalePreserved&&(r=t.outScale||e.scale);const n={layerView:null,outScale:r,printTemplate:t,view:e},o=h(e,r);for(const s of o){const e=s.layer;if(!e.loaded||"layers"in e)continue;let t;n.layerView=s,t=w(s)?await oe(e,n,a):S(e)?B(e):"csv"===e?.type?await H(e,n,a):"catalog-footprint"===e?.type?await K(e,n,a):"feature"===e?.type?await X(e,n,a):"geojson"===e?.type?await Y(e,n,a):"graphics"===e?.type?await Z(e,n,a):"imagery"===e?.type?ee(e,a):"imagery-tile"===e?.type?await te(e,n,a):"kml"===e?.type?await ae(e,n,a):"map-image"===e?.type?ie(e,n,a):"map-notes"===e?.type?await re(n,a):"open-street-map"===e?.type?ne():"stream"===e?.type?await se(e,n,a):"subtype-group"===e?.type?await le(e,a):"tile"===e?.type?ce(e,a):"vector-tile"===e?.type?await ye(e,n,a):"web-tile"===e?.type?fe(e):"wfs"===e?.type?await pe(e,n,a):"wms"===e?.type?de(e,a):"wmts"===e?.type?me(e):await oe(e,n,a),t&&(Array.isArray(t)?i.push(...t):(t.id=e.id,t.title=a.legendLayerNameMap[e.id]||e.title,t.opacity=s.fullOpacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,I(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),i.push(t)))}if(r)for(const s of i)s.minScale=0,s.maxScale=0;if(e.graphics?.length){const r=await Q(null,e.graphics,t,a);r&&i.push(r)}return i}function B(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function K(e,{layerView:t,printTemplate:a},i){if(parseFloat(i.cimVersion)<3.1){return Q(e,await Ie(t),a,i)}const r=e.parent,n={id:(o=xe(r,"web-map")).id,url:o.url,layerType:o.layerType,customParameters:o.customParameters,dynamicGroupLayer:{visibility:!1},footprintLayer:o.footprintLayer,layerDefinition:o.layerDefinition};var o;return ge(n,r),n}async function H(e,t,a){e.legendEnabled&&a.legendLayers.push({id:e.id});const i=t.layerView,r=t.printTemplate;if(!(i.filter||e.portalItem&&"public"!==e.portalItem.access)){const t=xe(e,"web-map");return t.type="CSV",delete t.popupInfo,delete t.layerType,t.showLabels=r.showLabels&&e.labelsVisible,t}return Q(e,await Ie(i),r,a)}async function Q(e,t,a,i){let r;const n=T(),o=O(),s=D(),c=V(),y=D();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=o.layerDefinition.name=s.layerDefinition.name=c.layerDefinition.name=i.legendLayerNameMap[e.id]||e.arcgisProps?.title||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),a=n.layerDefinition.drawingInfo;a&&(a.renderer=t);const i=o.layerDefinition.drawingInfo;i&&(i.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const l=c.layerDefinition.drawingInfo;l&&(l.renderer=t)}if(a.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=xe(e),a=t.layerDefinition?.drawingInfo?.labelingInfo;if(a){r=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=a);const t=o.layerDefinition.drawingInfo;t&&(t.labelingInfo=a);const i=s.layerDefinition.drawingInfo;i&&(i.labelingInfo=a);const l=c.layerDefinition.drawingInfo;l&&(l.labelingInfo=a)}}}let f;e?.renderer||r||(delete n.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete c.layerDefinition.drawingInfo);const p=e?.fieldsIndex,d=e?.renderer;if(p){const t=new Set;r&&await u(t,e),d&&"function"==typeof d.collectRequiredFields&&await d.collectRequiredFields(t,p),f=Array.from(t);const a=p.fields.map(e=>e.toJSON());n.layerDefinition.fields=a,o.layerDefinition.fields=a,s.layerDefinition.fields=a,c.layerDefinition.fields=a}const m=t?.length;let g;for(let u=0;u<m;u++){const e=t[u]||t.at(u);if(!1!==e.visible&&e.geometry){if(g=e.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol&&(g.symbol.angle||delete g.symbol.angle,De(g.symbol)?g.symbol=await be(g.symbol,i):g.symbol.text&&delete g.attributes),(!a||!a.forceFeatureAttributes)&&f?.length){const e={};for(const t of f)g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t]);g.attributes=e}"polygon"===e.geometry.type?n.featureSet.features.push(g):"polyline"===e.geometry.type?o.featureSet.features.push(g):"point"===e.geometry.type?g.symbol?.text?y.featureSet.features.push(g):s.featureSet.features.push(g):"multipoint"===e.geometry.type?c.featureSet.features.push(g):"extent"===e.geometry.type&&(g.geometry=l.fromExtent(e.geometry).toJSON(),n.featureSet.features.push(g))}}const b=[n,o,c,s,y].filter(e=>e.featureSet.features.length>0);for(const l of b){const e=l.featureSet.features.every(e=>e.symbol);if(e&&(!a||!a.forceFeatureAttributes))for(const t of l.featureSet.features)delete t.attributes;e&&delete l.layerDefinition.drawingInfo,l.layerDefinition.drawingInfo?.renderer&&(await Se(l.layerDefinition.drawingInfo.renderer,i),await he(l.layerDefinition.drawingInfo.renderer,i))}return b.length?{featureCollection:{layers:b},showLabels:r}:null}async function X(e,t,a){let i;const r=e.renderer,n=parseFloat(a.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&(n<2.9||"pie-chart"===e.featureReduction.renderer?.type)||"pie-chart"===r?.type&&n<3.1||"dot-density"===r?.type&&n<2.6||"polygon"===e.geometryType&&r?.authoringInfo?.visualVariables?.some(e=>"spike"===e.theme))return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});const o=t.layerView,{printTemplate:s,view:l}=t,u="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(o.filter||u||!r||"field"in r&&null!=r.field&&!e.getField(r.field)){const t=await Ie(o);i=await Q(e,t,s,a)}else{if(i={id:(f=xe(e)).id,title:f.title,url:f.url,layerType:f.layerType,customParameters:f.customParameters,layerDefinition:f.layerDefinition,charts:s.includeCharts?f.charts:void 0},s.attributionVisible&&(i.credits=x(e)),i.showLabels=s.showLabels&&e.labelsVisible&&!!e.labelingInfo&&e.labelingInfo.length>0,ge(i,e),delete i.layerDefinition?.featureReduction?.disablePopup,delete i.layerDefinition?.featureReduction?.popupInfo,o.displayFilterEnabled||delete i.layerDefinition?.displayFilterInfo,i.layerDefinition?.drawingInfo?.renderer&&(delete i.layerDefinition.minScale,delete i.layerDefinition.maxScale,await Se(i.layerDefinition.drawingInfo.renderer,a),await he(i.layerDefinition.drawingInfo.renderer,a),"visualVariables"in r&&r.visualVariables?.[0])){const e=r.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=y(e,l.scale);i.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,i.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=c(o);if(t&&(i.layerDefinition??={},i.layerDefinition.definitionExpression=i.layerDefinition.definitionExpression?`(${i.layerDefinition.definitionExpression}) AND (${t})`:t),e.gdbVersion&&(i.layerDefinition??={},i.layerDefinition.gdbVersion=e.gdbVersion),o.hasHighlight&&"highlightIds"in o){const t=o;i.selectionObjectIds=t.highlightIds;const a=t.highlightOptions??l.defaultHighlight??new F;i.selectionSymbol=v(e.geometryType,a)}}var f;return i}async function Y(e,t,a){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});return Q(e,await Ie(t.layerView),t.printTemplate,a)}async function Z(e,{printTemplate:t},a){return Q(e,null,t,a)}function ee(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const a={layerType:(i=xe(e)).layerType,customParameters:i.customParameters};var i;return a.bandIds=e.bandIds,a.compressionQuality=e.compressionQuality,a.format=e.format,a.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(a.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction&&(a.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(a.layerDefinition??={},a.layerDefinition.drawingInfo??={},a.layerDefinition.drawingInfo.renderer=e.renderer.toJSON()),ge(a,e),a}async function te(e,t,a){if("flow"===e.renderer?.type||!e.supportsWrite())return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});const i={bandIds:(r=xe(e)).bandIds,customParameters:r.customParameters,interpolation:r.interpolation,layerDefinition:r.layerDefinition};var r;return i.layerType="ArcGISImageServiceLayer",ge(i,e),i}async function ae(e,t,a){const i=t.printTemplate;if(!e.portalItem||"public"===e.portalItem.access){const t=xe(e,"web-map");return t.type="kml",delete t.layerType,t.url=s(e.url),t}const r=[],n=t.layerView,o="data:image/png;base64,";n.allVisibleMapImages.forEach((t,a)=>{const i={id:`${e.id}_image${a}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:n.fullOpacity,extent:t.extent};t.href.startsWith(o)?i.imageData=t.href.slice(o.length):i.url=t.href,r.push(i)});const l=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],u={id:e.id,...await Q(null,l,i,a)};return r.push(u),r}function ie(e,{outScale:t,printTemplate:a,view:i},r){let n;const o={id:e.id,subLayerIds:[]};let s=[];const l=t||i.scale,u=e=>{const t=0===l,a=0===e.minScale||l<=e.minScale,i=0===e.maxScale||l>=e.maxScale;if(e.visible&&(t||a&&i))if(e.sublayers)e.sublayers.forEach(u);else{const t=e.toExportImageJSON(),a={id:e.id,name:e.title,layerDefinition:{definitionExpression:t.definitionExpression,drawingInfo:t.drawingInfo,orderBy:t.orderBy,source:t.source}};s.unshift(a),o.subLayerIds.push(e.id)}};var c;return e.sublayers?.forEach(u),s.length&&(s=s.map(({id:e,name:t,layerDefinition:a})=>({id:e,name:t,layerDefinition:a})),n={layerType:(c=xe(e)).layerType,customParameters:c.customParameters},n.layers=s,n.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:o.subLayerIds,a.attributionVisible&&(n.credits=x(e)),e.gdbVersion&&(n.gdbVersion=e.gdbVersion),ge(n,e),e.legendEnabled&&r.legendLayers.push(o)),n}async function re({layerView:e,printTemplate:t},a){const i=[],r=e.layer;if(null!=r.featureCollections)for(const n of r.featureCollections){const e=await Q(n,n.source,t,a);e&&i.push(...e.featureCollection.layers)}else if(null!=r.sublayers)for(const n of r.sublayers){const e=await Q(null,n.graphics,t,a);e&&i.push(...e.featureCollection.layers)}return{featureCollection:{layers:i}}}function ne(){return{type:"OpenStreetMap"}}async function oe(e,{printTemplate:t,view:a},r){const n={type:"image"};r.screenshotLayers.push(e.id);const s={format:"png",ignoreBackground:!0,ignorePadding:!0,layers:[e]};0!==a.rotation&&(s.rotation=0);const l=r.ssExtent||a.state.extent.clone();let u=96,c=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(u=e.dpi),null!=e.width&&e.width>0&&(c=e.width%2==a.width%2),null!=e.height&&e.height>0&&(y=e.height%2==a.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===a.scale)&&96===u&&(!c||!y)&&a.state.extent.equals(a.extent)&&(s.area={x:0,y:0,width:a.width,height:a.height},c||(s.area.width-=1),y||(s.area.height-=1),!r.ssExtent)){const e=a.toMap(i(s.area.width,s.area.height));l.ymin=e.y,l.xmax=e.x,r.ssExtent=l}n.extent=l.clone()._normalize(!0).toJSON();const f=await a.takeScreenshot(s);return n.imageData=o(f.dataUrl)?.data,n}async function se(e,{layerView:t,printTemplate:a},i){e.legendEnabled&&i.legendLayers.push({id:e.id});return Q(e,await Ie(t),a,i)}async function le(e,t){if(e.legendEnabled)for(const r of e.sublayers)r.legendEnabled&&t.legendLayers.push({id:r.id});const a={customParameters:(i=xe(e)).customParameters,effect:i.effect,layerDefinition:i.layerDefinition,layerType:i.layerType,layers:i.layers,url:i.url};var i;if(ge(a,e),Array.isArray(a.layers)){for(const e of a.layers)delete e.popupInfo;a.token&&a.layers.length>0&&(a.layers[a.layers.length-1].token=a.token,delete a.token)}return a}async function ue(e){const t=[],a=[];for(const i of e.map.allTables)"feature"!==i.type||i.loaded||a.push(i.load());a.length&&await Promise.allSettled(a);for(const i of e.map.allTables)if("feature"===i.type&&i.loaded&&i.isTable&&"feature-layer"===i.source?.type){const e=(e=>({id:e.id,title:e.title,customParameters:e.customParameters,layerDefinition:{definitionExpression:e.layerDefinition?.definitionExpression},url:e.url}))(xe(i));ge(e,i),t.push(e)}return t.length?t:void 0}function ce(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const a={layerType:(i=xe(e)).layerType,customParameters:i.customParameters};var i;return ge(a,e),a}async function ye(e,t,a){const i=t.layerView;if(e.serviceUrl&&e.styleUrl&&!i.spriteSourceChanged&&!i.styleChanged){const t=p(e.styleUrl,e.apiKey),i=p(e.serviceUrl,e.apiKey);if(!t&&!i||"2.1.0"!==a.cimVersion){const a={type:"VectorTileLayer"};return a.styleUrl=s(e.styleUrl),a.token=t,i!==t&&(a.additionalTokens=[{url:e.serviceUrl,token:i}]),a}}return oe(e,t,a)}function fe(e){const t=e.urlTemplate?.replaceAll("${","{"),a={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(a.subDomains=e.subDomains),a}async function pe(e,t,a){return parseFloat(a.cimVersion)<3.5?oe(e,t,a):(e.legendEnabled&&a.legendLayers.push({id:e.id}),{layerType:(i=xe(e,"web-map")).layerType,layerDefinition:i.layerDefinition,url:i.url,wfsInfo:i.wfsInfo});var i}function de(e,t){let a;const i=[],r=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(r):e.name&&i.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(r),i.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:i}),a={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:i,url:s(e.url),version:e.version}),a}function me(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:s(e.url)}}function ge(e,t){t.url&&(e.url=s(e.url||t.url),e.token=p(e.url,t.apiKey))}async function be(e,a){a.canvas||(a.canvas=document.createElement("canvas"));const i=1024;a.canvas.width=i,a.canvas.height=i;const o=a.canvas.getContext("2d");let s,l;if(e.path){const t=new Path2D(e.path);t.closePath(),o.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",o.fill(t);const a=L(o);if(!a)return null;o.clearRect(0,0,i,i);const n=r(e.size)/Math.max(a.width,a.height);o.scale(n,n);const u=i/n,c=u/2-a.width/2-a.x,y=u/2-a.height/2-a.y;if(o.translate(c,y),Array.isArray(e.color)&&o.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const i=e.outline;o.lineWidth=r(i.width)/n,o.lineJoin="round",o.strokeStyle=`rgba(${i.color[0]},${i.color[1]},${i.color[2]},${i.color[3]/255})`,o.stroke(t),a.width+=o.lineWidth,a.height+=o.lineWidth}a.width*=n,a.height*=n;const f=o.getImageData(i/2-a.width/2,i/2-a.height/2,Math.ceil(a.width),Math.ceil(a.height));s=f.width,l=f.height,o.canvas.width=s,o.canvas.height=l,o.putImageData(f,0,0)}else{const a="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,i=(await t(a,{responseType:"image"})).data;s=r(e.width),l=r(e.height),o.canvas.width=s,o.canvas.height=l,o.drawImage(i,0,0,o.canvas.width,o.canvas.height)}return{type:"esriPMS",imageData:o.canvas.toDataURL("image/png").slice(22),angle:e.angle,contentType:"image/png",height:n(l),width:n(s),xoffset:e.xoffset,yoffset:e.yoffset}}async function he(e,t){const a=e.type;if("simple"===a&&De(e.symbol))e.symbol=await be(e.symbol,t)??{type:"esriSMS",color:[0,0,0,0],size:0,style:"esriSMSSquare"};else if("uniqueValue"===a){if(De(e.defaultSymbol)&&(e.defaultSymbol=await be(e.defaultSymbol,t)),"uniqueValueInfos"in e&&e.uniqueValueInfos)for(const a of e.uniqueValueInfos)De(a.symbol)&&(a.symbol=await be(a.symbol,t));if("uniqueValueGroups"in e&&e.uniqueValueGroups)for(const a of e.uniqueValueGroups)for(const e of a.classes)De(e.symbol)&&(e.symbol=await be(e.symbol,t))}else if("classBreaks"===a){De(e.defaultSymbol)&&(e.defaultSymbol=await be(e.defaultSymbol,t));for(const a of e.classBreakInfos)De(a.symbol)&&(a.symbol=await be(a.symbol,t))}}async function we(e,t){if("styleSymbolReference"!==e?.type)return e;try{const a=await M.fromJSON(e).fetchSymbol({cache:t.webStyleCache});return a?.toJSON()??e}catch{return e}}async function Se(e,t){if("simple"===e.type&&e.symbol)e.symbol=await we(e.symbol,t);else if("uniqueValue"===e.type){if(e.defaultSymbol=await we(e.defaultSymbol,t),"uniqueValueInfos"in e&&e.uniqueValueInfos)for(const a of e.uniqueValueInfos)a.symbol=await we(a.symbol,t);if("uniqueValueGroups"in e&&e.uniqueValueGroups)for(const a of e.uniqueValueGroups)for(const e of a.classes)e.symbol=await we(e.symbol,t)}else if("classBreaks"===e.type){e.defaultSymbol=await we(e.defaultSymbol,t);for(const a of e.classBreakInfos)a.symbol=await we(a.symbol,t)}}async function Ie(e){return e.queryFeatures(e.createQuery()).then(e=>e.features)}function xe(e,t){return e.write({},{ignorePersistenceEnabled:!0,origin:t})??{}}function ve(e){return e.gpMetadata?.executionType?R.fromJSON(e.gpMetadata.executionType):"sync"}function De(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{J as execute,z as getGpPrintParams,G as getGpServerUrl,A as getMode,_ as getTaskExecutionMode,q as getTaskInfo,C as getTaskInfos,j as printCacheMap};
|
|
2
|
+
import{id as e}from"../kernel.js";import t from"../request.js";import{JSONMap as a}from"../core/jsonMap.js";import{createScreenPoint as i,pt2px as r,px2pt as n}from"../core/screenUtils.js";import{dataComponents as o,normalize as s}from"../core/urlUtils.js";import l from"../geometry/Polygon.js";import{collectLabelingFields as u}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as c}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as y}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as f,findToken as p}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as m}from"./geoprocessor/submitJob.js";import{formatJsonMap as g}from"./support/fileFormat.js";import{toJSON as b}from"./support/layoutTemplate.js";import{getVisibleLayerViews as h,isScreenshotRequired as w,isBingMapsLayer as S,isBlendLayer as I,getCopyright as x,getSelectionSymbol as v,createPointLayer as D,getContextBoundingBox as L,createPolygonLayer as T,createPolylineLayer as O,createMultipointLayer as V}from"./support/printTaskUtils.js";import E from"./support/PrintTemplate.js";import{toJSON as P}from"./support/reportTemplate.js";import M from"../symbols/WebStyleSymbol.js";import F from"../views/support/HighlightOptions.js";const k={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},N=new a({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),J=new a({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),R=new Map;async function j(e,t,a){const i=await U(e,a),r=await z(t,i);if("sync"===await A(e,a)){const{results:t}=await d(e,r,void 0,a);return t?.[0]?.value}const n=await m(e,r,void 0,a);await n.waitForJobCompletion({interval:t.updateDelay});const{value:o}=await n.fetchResultData("Output_File",null,a);return o}async function U(e,a){const i=G(e),r=R.get(i)??{gpServerUrl:i,legendLayerNameMap:{},legendLayers:[],screenshotLayers:[]};return r.gpMetadata??=(await t(i,f({f:"json"},a))).data,r.cimVersion=r.gpMetadata.cimVersion,r.webStyleCache??=new Map,R.set(i,r),r}async function A(e,t){return ve(await U(e,t))}async function C(e,a){const i=await U(e,a),r=i.gpMetadata.tasks,n=i.gpServerUrl;if(i.taskInfos)return i.taskInfos;const o=(await t(e,f({f:"json"},a))).data;i.taskInfos={ExportWebMap:o};const s=r?.filter(e=>e!==o.name)??[];return await Promise.all(s.map(async e=>{const r=(await t(`${n}/${e}`,f({f:"json"},a))).data,o=r.name.startsWith("GetLayoutTemplatesInfo")?"GetLayoutTemplatesInfo":null;o&&(i.taskInfos[o]??=r)})),i.taskInfos}async function q(e,t,a){return(await C(e,a))[t]??null}async function _(e,t,a){const i=await q(e,t,a);return i?.executionType?J.fromJSON(i.executionType):"sync"}async function z(t,a){a=a||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const i=t.template||new E;null==i.showLabels&&(i.showLabels=!0);const r=i.exportOptions;let n;const o=b(i.layout);if(r){if(n={dpi:r.dpi},"map_only"===o?.toLowerCase()||""===o){const{width:e,height:t}=r;n.outputSize=null!=e&&null!=t?[e,t]:void 0}}const s=i.layoutOptions;let l;if(s){let e,t;"Miles"===s.scalebarUnit||"Kilometers"===s.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==s.scalebarUnit&&"Feet"!==s.scalebarUnit||(e="Meters",t="Feet"),l={titleText:s.titleText,authorText:s.authorText,copyrightText:s.copyrightText,customTextElements:s.customTextElements,elementOverrides:s.elementOverrides,scaleBarOptions:e||t?{metricUnit:N.toJSON(e)??void 0,metricLabel:e?k[e]:void 0,nonMetricUnit:N.toJSON(t)??void 0,nonMetricLabel:t?k[t]:void 0}:void 0}}const u=await $(t,i,a);if(u.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,a=a=>{const i=a.text,r=a.font,n=r?.family?.toLowerCase();i&&r&&("arial"===n||"arial unicode ms"===n)&&(r.family=e.test(i)?"Arial Unicode MS":"Arial","normal"!==r.style&&t.test(i)&&(r.family="Arial Unicode MS"))};for(const i of u.operationalLayers)if(i.featureCollection?.layers)for(const e of i.featureCollection.layers){if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type&&a(t.symbol)}if(e.featureSet?.features)for(const t of e.featureSet.features)t.symbol&&"esriTS"===t.symbol.type&&a(t.symbol)}}let c=null;s?.legendLayers&&(c=s.legendLayers.filter(e=>!a.screenshotLayers.includes(e.layerId)).map(e=>{const t=e.layerId;a.legendLayerNameMap[t]=e.title;const i={id:t};if(e.subLayerIds){i.subLayerIds=e.subLayerIds;const t=e.dynamicLegend;null!=t&&(i.subLayerDynamicLegends=e.subLayerIds.map(()=>t))}return null!=e.dynamicLegend&&(i.dynamicLegend=e.dynamicLegend),i})),t.outSpatialReference&&(u.mapOptions.spatialReference=t.outSpatialReference.toJSON()),t.datumTransformations?.length&&(u.mapOptions.datumTransformations=t.datumTransformations.map(e=>e.toJSON())),Object.assign(u,{exportOptions:n,layoutOptions:l||{}}),Object.assign(u.layoutOptions,{legendOptions:{operationalLayers:null!=c?c:a.legendLayers.slice()}}),a.legendLayers.length=0,a.screenshotLayers.length=0,R.set(a.gpServerUrl,a);const y={Web_Map_as_JSON:JSON.stringify(u),Format:g.toJSON(i.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:P(i.report),Report_Item_ID:void 0};if(i.layoutItem){delete y.Layout_Template;const t=i.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(a.gpServerUrl),y.Layout_Item_ID=JSON.stringify({id:t.id})}if(i.reportItem){delete y.Report_Template;const t=i.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(a.gpServerUrl),y.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(y,t.extraParameters),y}async function $(e,t,a){const i=e.view;let r=i.spatialReference;const n={operationalLayers:await W(i,t,a)};t.includeTables&&(n.tables=await ue(i));let o=e.extent||a.ssExtent||i.extent;if(r?.isWrappable&&(o=o.clone()._normalize(!0),r=o.spatialReference),n.mapOptions={extent:o&&o.toJSON(),spatialReference:r&&r.toJSON(),showAttribution:t.attributionVisible},a.ssExtent=null,i.background&&(n.background=i.background.toJSON()),i.rotation&&(n.mapOptions.rotation=-i.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||i.scale),null!=i.timeExtent){const e=null!=i.timeExtent.start?i.timeExtent.start.getTime():null,t=null!=i.timeExtent.end?i.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function G(e){let t=e;const a=t.lastIndexOf("/GPServer/");return a>0&&(t=t.slice(0,a+9)),t}async function W(e,t,a){const i=[];let r=0;t.scalePreserved&&(r=t.outScale||e.scale);const n={layerView:null,outScale:r,printTemplate:t,view:e},o=h(e,r);for(const s of o){const e=s.layer;if(!e.loaded||"layers"in e)continue;let t;n.layerView=s,t=w(s)?await oe(e,n,a):S(e)?B(e):"csv"===e?.type?await H(e,n,a):"catalog-footprint"===e?.type?await K(e,n,a):"feature"===e?.type?await X(e,n,a):"geojson"===e?.type?await Y(e,n,a):"graphics"===e?.type?await Z(e,n,a):"imagery"===e?.type?ee(e,a):"imagery-tile"===e?.type?await te(e,n,a):"kml"===e?.type?await ae(e,n,a):"map-image"===e?.type?ie(e,n,a):"map-notes"===e?.type?await re(n,a):"open-street-map"===e?.type?ne():"stream"===e?.type?await se(e,n,a):"subtype-group"===e?.type?await le(e,a):"tile"===e?.type?ce(e,a):"vector-tile"===e?.type?await ye(e,n,a):"web-tile"===e?.type?fe(e):"wfs"===e?.type?await pe(e,n,a):"wms"===e?.type?de(e,a):"wmts"===e?.type?me(e):await oe(e,n,a),t&&(Array.isArray(t)?i.push(...t):(t.id=e.id,t.title=a.legendLayerNameMap[e.id]||e.title,t.opacity=s.fullOpacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,I(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),i.push(t)))}if(r)for(const s of i)s.minScale=0,s.maxScale=0;if(e.graphics?.length){const r=await Q(null,e.graphics,t,a);r&&i.push(r)}return i}function B(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function K(e,{layerView:t,printTemplate:a},i){if(parseFloat(i.cimVersion)<3.1){return Q(e,await Ie(t),a,i)}const r=e.parent,n={id:(o=xe(r,"web-map")).id,url:o.url,layerType:o.layerType,customParameters:o.customParameters,dynamicGroupLayer:{visibility:!1},footprintLayer:o.footprintLayer,layerDefinition:o.layerDefinition};var o;return ge(n,r),n}async function H(e,t,a){e.legendEnabled&&a.legendLayers.push({id:e.id});const i=t.layerView,r=t.printTemplate;if(!(i.filter||e.portalItem&&"public"!==e.portalItem.access)){const t=xe(e,"web-map");return t.type="CSV",delete t.popupInfo,delete t.layerType,t.showLabels=r.showLabels&&e.labelsVisible,t}return Q(e,await Ie(i),r,a)}async function Q(e,t,a,i){let r;const n=T(),o=O(),s=D(),c=V(),y=D();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=o.layerDefinition.name=s.layerDefinition.name=c.layerDefinition.name=i.legendLayerNameMap[e.id]||e.arcgisProps?.title||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),a=n.layerDefinition.drawingInfo;a&&(a.renderer=t);const i=o.layerDefinition.drawingInfo;i&&(i.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const l=c.layerDefinition.drawingInfo;l&&(l.renderer=t)}if(a.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=xe(e),a=t.layerDefinition?.drawingInfo?.labelingInfo;if(a){r=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=a);const t=o.layerDefinition.drawingInfo;t&&(t.labelingInfo=a);const i=s.layerDefinition.drawingInfo;i&&(i.labelingInfo=a);const l=c.layerDefinition.drawingInfo;l&&(l.labelingInfo=a)}}}let f;e?.renderer||r||(delete n.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete c.layerDefinition.drawingInfo);const p=e?.fieldsIndex,d=e?.renderer;if(p){const t=new Set;r&&await u(t,e),d&&"function"==typeof d.collectRequiredFields&&await d.collectRequiredFields(t,p),f=Array.from(t);const a=p.fields.map(e=>e.toJSON());n.layerDefinition.fields=a,o.layerDefinition.fields=a,s.layerDefinition.fields=a,c.layerDefinition.fields=a}const m=t?.length;let g;for(let u=0;u<m;u++){const e=t[u]||t.at(u);if(!1!==e.visible&&e.geometry){if(g=e.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol&&(g.symbol.angle||delete g.symbol.angle,De(g.symbol)?g.symbol=await be(g.symbol,i):g.symbol.text&&delete g.attributes),(!a||!a.forceFeatureAttributes)&&f?.length){const e={};for(const t of f)g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t]);g.attributes=e}"polygon"===e.geometry.type?n.featureSet.features.push(g):"polyline"===e.geometry.type?o.featureSet.features.push(g):"point"===e.geometry.type?g.symbol?.text?y.featureSet.features.push(g):s.featureSet.features.push(g):"multipoint"===e.geometry.type?c.featureSet.features.push(g):"extent"===e.geometry.type&&(g.geometry=l.fromExtent(e.geometry).toJSON(),n.featureSet.features.push(g))}}const b=[n,o,c,s,y].filter(e=>e.featureSet.features.length>0);for(const l of b){const e=l.featureSet.features.every(e=>e.symbol);if(e&&(!a||!a.forceFeatureAttributes))for(const t of l.featureSet.features)delete t.attributes;e&&delete l.layerDefinition.drawingInfo,l.layerDefinition.drawingInfo?.renderer&&(await Se(l.layerDefinition.drawingInfo.renderer,i),await he(l.layerDefinition.drawingInfo.renderer,i))}return b.length?{featureCollection:{layers:b},showLabels:r}:null}async function X(e,t,a){let i;const r=e.renderer,n=parseFloat(a.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&(n<2.9||"pie-chart"===e.featureReduction.renderer?.type)||"pie-chart"===r?.type&&n<3.1||"dot-density"===r?.type&&n<2.6||"polygon"===e.geometryType&&r?.authoringInfo?.visualVariables?.some(e=>"spike"===e.theme))return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});const o=t.layerView,{printTemplate:s,view:l}=t,u="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(o.filter||u||!r||"field"in r&&null!=r.field&&!e.getField(r.field)){const t=await Ie(o);i=await Q(e,t,s,a)}else{if(i={id:(f=xe(e)).id,title:f.title,url:f.url,layerType:f.layerType,customParameters:f.customParameters,layerDefinition:f.layerDefinition,charts:s.includeCharts?f.charts:void 0},s.attributionVisible&&(i.credits=x(e)),i.showLabels=s.showLabels&&e.labelsVisible&&!!e.labelingInfo&&e.labelingInfo.length>0,ge(i,e),delete i.layerDefinition?.featureReduction?.disablePopup,delete i.layerDefinition?.featureReduction?.popupInfo,o.displayFilterEnabled||delete i.layerDefinition?.displayFilterInfo,i.layerDefinition?.drawingInfo?.renderer&&(delete i.layerDefinition.minScale,delete i.layerDefinition.maxScale,await Se(i.layerDefinition.drawingInfo.renderer,a),await he(i.layerDefinition.drawingInfo.renderer,a),"visualVariables"in r&&r.visualVariables?.[0])){const e=r.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=y(e,l.scale);i.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,i.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=c(o);if(t&&(i.layerDefinition??={},i.layerDefinition.definitionExpression=i.layerDefinition.definitionExpression?`(${i.layerDefinition.definitionExpression}) AND (${t})`:t),e.gdbVersion&&(i.layerDefinition??={},i.layerDefinition.gdbVersion=e.gdbVersion),o.hasHighlight&&"highlightIds"in o){const t=o;i.selectionObjectIds=t.highlightIds;const a=t.highlightOptions??l.defaultHighlight??new F;i.selectionSymbol=v(e.geometryType,a)}}var f;return i}async function Y(e,t,a){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});return Q(e,await Ie(t.layerView),t.printTemplate,a)}async function Z(e,{printTemplate:t},a){return Q(e,null,t,a)}function ee(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const a={layerType:(i=xe(e)).layerType,customParameters:i.customParameters};var i;return a.bandIds=e.bandIds,a.compressionQuality=e.compressionQuality,a.format=e.format,a.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(a.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction&&(a.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(a.layerDefinition??={},a.layerDefinition.drawingInfo??={},a.layerDefinition.drawingInfo.renderer=e.renderer.toJSON()),ge(a,e),a}async function te(e,t,a){if("flow"===e.renderer?.type||!e.supportsWrite())return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});const i={bandIds:(r=xe(e)).bandIds,customParameters:r.customParameters,interpolation:r.interpolation,layerDefinition:r.layerDefinition};var r;return i.layerType="ArcGISImageServiceLayer",ge(i,e),i}async function ae(e,t,a){const i=t.printTemplate;if(!e.portalItem||"public"===e.portalItem.access){const t=xe(e,"web-map");return t.type="kml",delete t.layerType,t.url=s(e.url),t}const r=[],n=t.layerView,o="data:image/png;base64,";n.allVisibleMapImages.forEach((t,a)=>{const i={id:`${e.id}_image${a}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:n.fullOpacity,extent:t.extent};t.href.startsWith(o)?i.imageData=t.href.slice(o.length):i.url=t.href,r.push(i)});const l=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],u={id:e.id,...await Q(null,l,i,a)};return r.push(u),r}function ie(e,{outScale:t,printTemplate:a,view:i},r){let n;const o={id:e.id,subLayerIds:[]};let s=[];const l=t||i.scale,u=e=>{const t=0===l,a=0===e.minScale||l<=e.minScale,i=0===e.maxScale||l>=e.maxScale;if(e.visible&&(t||a&&i))if(e.sublayers)e.sublayers.forEach(u);else{const t=e.toExportImageJSON(),a={id:e.id,name:e.title,layerDefinition:{definitionExpression:t.definitionExpression,drawingInfo:t.drawingInfo,orderBy:t.orderBy,source:t.source}};s.unshift(a),o.subLayerIds.push(e.id)}};var c;return e.sublayers?.forEach(u),s.length&&(s=s.map(({id:e,name:t,layerDefinition:a})=>({id:e,name:t,layerDefinition:a})),n={layerType:(c=xe(e)).layerType,customParameters:c.customParameters},n.layers=s,n.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:o.subLayerIds,a.attributionVisible&&(n.credits=x(e)),e.gdbVersion&&(n.gdbVersion=e.gdbVersion),ge(n,e),e.legendEnabled&&r.legendLayers.push(o)),n}async function re({layerView:e,printTemplate:t},a){const i=[],r=e.layer;if(null!=r.featureCollections)for(const n of r.featureCollections){const e=await Q(n,n.source,t,a);e&&i.push(...e.featureCollection.layers)}else if(null!=r.sublayers)for(const n of r.sublayers){const e=await Q(null,n.graphics,t,a);e&&i.push(...e.featureCollection.layers)}return{featureCollection:{layers:i}}}function ne(){return{type:"OpenStreetMap"}}async function oe(e,{printTemplate:t,view:a},r){const n={type:"image"};r.screenshotLayers.push(e.id);const s={format:"png",ignoreBackground:!0,ignorePadding:!0,layers:[e]};0!==a.rotation&&(s.rotation=0);const l=r.ssExtent||a.state.extent.clone();let u=96,c=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(u=e.dpi),null!=e.width&&e.width>0&&(c=e.width%2==a.width%2),null!=e.height&&e.height>0&&(y=e.height%2==a.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===a.scale)&&96===u&&(!c||!y)&&a.state.extent.equals(a.extent)&&(s.area={x:0,y:0,width:a.width,height:a.height},c||(s.area.width-=1),y||(s.area.height-=1),!r.ssExtent)){const e=a.toMap(i(s.area.width,s.area.height));l.ymin=e.y,l.xmax=e.x,r.ssExtent=l}n.extent=l.clone()._normalize(!0).toJSON();const f=await a.takeScreenshot(s);return n.imageData=o(f.dataUrl)?.data,n}async function se(e,{layerView:t,printTemplate:a},i){e.legendEnabled&&i.legendLayers.push({id:e.id});return Q(e,await Ie(t),a,i)}async function le(e,t){if(e.legendEnabled)for(const r of e.sublayers)r.legendEnabled&&t.legendLayers.push({id:r.id});const a={customParameters:(i=xe(e)).customParameters,effect:i.effect,layerDefinition:i.layerDefinition,layerType:i.layerType,layers:i.layers,url:i.url};var i;if(ge(a,e),Array.isArray(a.layers)){for(const e of a.layers)delete e.popupInfo;a.token&&a.layers.length>0&&(a.layers[a.layers.length-1].token=a.token,delete a.token)}return a}async function ue(e){const t=[],a=[];for(const i of e.map.allTables)"feature"!==i.type||i.loaded||a.push(i.load());a.length&&await Promise.allSettled(a);for(const i of e.map.allTables)if("feature"===i.type&&i.loaded&&i.isTable&&"feature-layer"===i.source?.type){const e=(e=>({id:e.id,title:e.title,customParameters:e.customParameters,layerDefinition:{definitionExpression:e.layerDefinition?.definitionExpression},url:e.url}))(xe(i));ge(e,i),t.push(e)}return t.length?t:void 0}function ce(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const a={layerType:(i=xe(e)).layerType,customParameters:i.customParameters};var i;return ge(a,e),a}async function ye(e,t,a){const i=t.layerView;if(e.serviceUrl&&e.styleUrl&&!i.spriteSourceChanged&&!i.styleChanged){const t=p(e.styleUrl,e.apiKey),i=p(e.serviceUrl,e.apiKey);if(!t&&!i||"2.1.0"!==a.cimVersion){const a={type:"VectorTileLayer"};return a.styleUrl=s(e.styleUrl),a.token=t,i!==t&&(a.additionalTokens=[{url:e.serviceUrl,token:i}]),a}}return oe(e,t,a)}function fe(e){const t=e.urlTemplate?.replaceAll("${","{"),a={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(a.subDomains=e.subDomains),a}async function pe(e,t,a){return parseFloat(a.cimVersion)<3.5?oe(e,t,a):(e.legendEnabled&&a.legendLayers.push({id:e.id}),{layerType:(i=xe(e,"web-map")).layerType,layerDefinition:i.layerDefinition,url:i.url,wfsInfo:i.wfsInfo});var i}function de(e,t){let a;const i=[],r=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(r):e.name&&i.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(r),i.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:i}),a={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:i,url:s(e.url),version:e.version}),a}function me(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:s(e.url)}}function ge(e,t){t.url&&(e.url=s(e.url||t.url),e.token=p(e.url,t.apiKey))}async function be(e,a){a.canvas||(a.canvas=document.createElement("canvas"));const i=1024;a.canvas.width=i,a.canvas.height=i;const o=a.canvas.getContext("2d");let s,l;if(e.path){const t=new Path2D(e.path);t.closePath(),o.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",o.fill(t);const a=L(o);if(!a)return null;o.clearRect(0,0,i,i);const n=r(e.size)/Math.max(a.width,a.height);o.scale(n,n);const u=i/n,c=u/2-a.width/2-a.x,y=u/2-a.height/2-a.y;if(o.translate(c,y),Array.isArray(e.color)&&o.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const i=e.outline;o.lineWidth=r(i.width)/n,o.lineJoin="round",o.strokeStyle=`rgba(${i.color[0]},${i.color[1]},${i.color[2]},${i.color[3]/255})`,o.stroke(t),a.width+=o.lineWidth,a.height+=o.lineWidth}a.width*=n,a.height*=n;const f=o.getImageData(i/2-a.width/2,i/2-a.height/2,Math.ceil(a.width),Math.ceil(a.height));s=f.width,l=f.height,o.canvas.width=s,o.canvas.height=l,o.putImageData(f,0,0)}else{const a="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,i=(await t(a,{responseType:"image"})).data;s=r(e.width),l=r(e.height),o.canvas.width=s,o.canvas.height=l,o.drawImage(i,0,0,o.canvas.width,o.canvas.height)}return{type:"esriPMS",imageData:o.canvas.toDataURL("image/png").slice(22),angle:e.angle,contentType:"image/png",height:n(l),width:n(s),xoffset:e.xoffset,yoffset:e.yoffset}}async function he(e,t){const a=e.type;if("simple"===a&&De(e.symbol))e.symbol=await be(e.symbol,t)??{type:"esriSMS",color:[0,0,0,0],size:0,style:"esriSMSSquare"};else if("uniqueValue"===a){if(De(e.defaultSymbol)&&(e.defaultSymbol=await be(e.defaultSymbol,t)),"uniqueValueInfos"in e&&e.uniqueValueInfos)for(const a of e.uniqueValueInfos)De(a.symbol)&&(a.symbol=await be(a.symbol,t));if("uniqueValueGroups"in e&&e.uniqueValueGroups)for(const a of e.uniqueValueGroups)for(const e of a.classes)De(e.symbol)&&(e.symbol=await be(e.symbol,t))}else if("classBreaks"===a){De(e.defaultSymbol)&&(e.defaultSymbol=await be(e.defaultSymbol,t));for(const a of e.classBreakInfos)De(a.symbol)&&(a.symbol=await be(a.symbol,t))}}async function we(e,t){if("styleSymbolReference"!==e?.type)return e;try{const a=await M.fromJSON(e).fetchSymbol({cache:t.webStyleCache});return a?.toJSON()??e}catch{return e}}async function Se(e,t){if("simple"===e.type&&e.symbol)e.symbol=await we(e.symbol,t);else if("uniqueValue"===e.type){if(e.defaultSymbol=await we(e.defaultSymbol,t),"uniqueValueInfos"in e&&e.uniqueValueInfos)for(const a of e.uniqueValueInfos)a.symbol=await we(a.symbol,t);if("uniqueValueGroups"in e&&e.uniqueValueGroups)for(const a of e.uniqueValueGroups)for(const e of a.classes)e.symbol=await we(e.symbol,t)}else if("classBreaks"===e.type){e.defaultSymbol=await we(e.defaultSymbol,t);for(const a of e.classBreakInfos)a.symbol=await we(a.symbol,t)}}async function Ie(e){return e.queryFeatures(e.createQuery()).then(e=>e.features)}function xe(e,t){return e.write({},{ignorePersistenceEnabled:!0,origin:t})??{}}function ve(e){return e.gpMetadata?.executionType?J.fromJSON(e.gpMetadata.executionType):"sync"}function De(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{j as execute,z as getGpPrintParams,G as getGpServerUrl,A as getMode,_ as getTaskExecutionMode,q as getTaskInfo,C as getTaskInfos,R as printCacheMap};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type Accessor from "../../core/Accessor.js";
|
|
2
2
|
import type SpatialReference from "../../geometry/SpatialReference.js";
|
|
3
|
+
import type GeographicTransformation from "../../geometry/operators/support/GeographicTransformation.js";
|
|
3
4
|
import type PrintTemplate from "./PrintTemplate.js";
|
|
4
5
|
import type MapView from "../../views/MapView.js";
|
|
5
6
|
import type { SpatialReferenceProperties } from "../../geometry/SpatialReference.js";
|
|
6
7
|
|
|
7
|
-
export interface PrintParametersProperties extends Partial<Pick<PrintParameters, "extraParameters" | "template" | "view">> {
|
|
8
|
+
export interface PrintParametersProperties extends Partial<Pick<PrintParameters, "datumTransformations" | "extraParameters" | "template" | "view">> {
|
|
8
9
|
/** Specify the output spatial reference for the printout. */
|
|
9
10
|
outSpatialReference?: SpatialReferenceProperties | null;
|
|
10
11
|
}
|
|
@@ -16,6 +17,12 @@ export interface PrintParametersProperties extends Partial<Pick<PrintParameters,
|
|
|
16
17
|
*/
|
|
17
18
|
export default class PrintParameters extends Accessor {
|
|
18
19
|
constructor(properties?: PrintParametersProperties);
|
|
20
|
+
/**
|
|
21
|
+
* todoc
|
|
22
|
+
*
|
|
23
|
+
* @since 5.1
|
|
24
|
+
*/
|
|
25
|
+
accessor datumTransformations: GeographicTransformation[] | null | undefined;
|
|
19
26
|
/**
|
|
20
27
|
* Additional parameters for the print service. When an arcpy script is published as a custom
|
|
21
28
|
* print service there may be additional parameters associated with the print service.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{property as o,subclass as r}from"../../core/accessorSupport/decorators.js";import s from"../../geometry/SpatialReference.js";let p=class extends e{constructor(t){super(t),this.datumTransformations=null,this.extent=null,this.extraParameters=null,this.outSpatialReference=null,this.template=null,this.updateDelay=1e3,this.view=null}};t([o()],p.prototype,"datumTransformations",void 0),t([o()],p.prototype,"extent",void 0),t([o()],p.prototype,"extraParameters",void 0),t([o({type:s})],p.prototype,"outSpatialReference",void 0),t([o()],p.prototype,"template",void 0),t([o()],p.prototype,"updateDelay",void 0),t([o()],p.prototype,"view",void 0),p=t([r("esri.rest.support.PrintParameters")],p);const a=p;export{a as default};
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const f="20260515",a="eb8f51dafff5d4a6751607a68784d15ba60f31cd";export{f as buildDate,a as commitHash};
|
package/third-party-notices.txt
CHANGED
|
@@ -1245,6 +1245,10 @@ vaadin/
|
|
|
1245
1245
|
|
|
1246
1246
|
https://github.com/vaadin/web-components/tree/main/packages/grid
|
|
1247
1247
|
|
|
1248
|
+
Vaadin is a dependency for esri/widgets/FeatureTable/Grid/Grid.js
|
|
1249
|
+
|
|
1250
|
+
In development mode, Vaadin collects usage statistics unless disabled. For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
|
|
1251
|
+
|
|
1248
1252
|
Copyright 2014-2021 Vaadin Ltd.
|
|
1249
1253
|
|
|
1250
1254
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const e=5;function n(e){for(const n of e.rootOutputNodes())e.shouldPruneOutputNode(n)||(n.variableName=r(e,n.node))}function t(e,n){let t="";return"boolean"!=typeof n&&"number"!=typeof n&&n.debugInfo.name&&(t=`${n.debugInfo.name}_`),`${t}v${e.varCount++}`}function r(e,n,t=!1){if("number"==typeof n)return n.toString();if("boolean"==typeof n)return n.toString();let r=e.getEmit(n);if(r)return r;switch(n.shaderType){case"scope-node":r=i(e,n);break;case"primitive-node":r=
|
|
2
|
+
const e=5;function n(e){e.createArrayReadVersions();for(const n of e.rootOutputNodes())e.shouldPruneOutputNode(n)||(n.variableName=r(e,n.node))}function t(e,n){let t="";return"boolean"!=typeof n&&"number"!=typeof n&&n.debugInfo.name&&(t=`${n.debugInfo.name}_`),`${t}v${e.varCount++}`}function r(e,n,t=!1){if("number"==typeof n)return n.toString();if("boolean"==typeof n)return n.toString();let r=e.getEmit(n);if(r)return r;switch(n.shaderType){case"scope-node":r=i(e,n);break;case"primitive-node":r=y(e,n,t);break;case"function-node":r=p(e,n);break;case"property-access-node":r=d(e,n);break;case"property-access-2d-node":r=s(e,n);break;case"array-read-node":r=u(e,n);break;case"array-write-node":throw new Error("Impossible, array-write-nodes are only accessed by _writeArrayNode");case"text-node":r=n.text;break;case"block-node":r=c(e,n);break;case"condition-node":r=a(e,n)}return e.setEmit(n,r),r}function o(e,n,t){const r=n.split("\n");for(const o of r)if(o.trim().length){{let n="";null!=t&&(n+=`/*id:${t??"000"}*/ `),e.body+=n.padEnd(14)}e.body+=" ".repeat(e.indent)+o+"\n"}}function i(e,n){const t=new n.child.constructor;t.setDebugName(n.debugInfo.name);const i=r(e,t,!0);o(e,`{ /*ScopeStart: ${n.uid} ${n.debugInfo.name}*/`),e.indent+=2;return o(e,`${i} = ${r(e,n.child)};`),e.indent-=2,o(e,`} /*ScopeEnd: ${n.uid} ${n.debugInfo.name}*/`),i}function a(e,n){const t=r(e,new n.ifTrue.constructor,!0);o(e,`if (${r(e,n.condition)}) {`),e.indent+=2;const i=e.createSubgraphContext(),a=r(i,n.ifTrue);if(e.body+=i.body,a&&o(e,`${t} = ${a};`),e.indent-=2,o(e,"}"),n.ifFalse){o(e,"else {"),e.indent+=2;const i=e.createSubgraphContext(),a=r(i,n.ifFalse);e.body+=i.body,a&&o(e,`${t} = ${a};`),e.indent-=2,o(e,"}")}return t}function c(e,n){const{captureList:t,generator:i,returnType:a}=n,c={};for(const o in t){if(!t[o])continue;const n=r(e,t[o]);c[o]=n}const d=r(e,new a,!0);if(c.out=d,n.subgraph){const t=e.createSubgraphContext(),o=r(t,n.subgraph.child),i=t.body;c.subgraph={varName:o,body:i}}const s=i(c);return o(e,"{\n"),e.indent+=2,o(e,s),e.indent-=2,o(e,"}\n"),d}function d(e,n){const t=r(e,n.target);if("string"==typeof n.property&&n.property.includes("["))return`${t}${n.property}`;if("string"!=typeof n.property){return`${t}[${r(e,n.property)}]`}return`${t}.${n.property}`}function s(e,n){return`${r(e,n.target)}[${r(e,n.x)}][${r(e,n.y)}]`}function u(n,i){const a=r(n,i.version),c=n.getEmit(i);if(c)return c;const d=r(n,i.index),s=t(n,i);return o(n,`${i.returnType.type.padEnd(e)} ${s} = ${a}[${d}];`,i.uid),s}function p(n,i){const a=i.returnType.type;if(i.isInfix){const[c,d]=i.children.map(e=>r(n,e)),s=t(n,i);return o(n,`${a.padEnd(e)} ${s} = ${c} ${i.token} ${d};`,i.uid),s}const c=i.children.map(e=>r(n,e)).join(", "),d=t(n,i);return o(n,`${a.padEnd(e)} ${d} = ${i.token}(${c});`,i.uid),d}function f(n,i,a){const c=i.writeNode;if(c){const e=n.getInput(c.previousVersion);if(e)throw new Error(`Unable to write array version for shader input ${e.variableName}`);const t=r(n,c.previousVersion),a=r(n,c.index),d=r(n,c.value);o(n,`${t}[${a}] = ${d};`,c.uid),n.setEmit(i,t)}else{const c=i.elementType.type;if("array"===c||"sampler2D"===c)throw new Error(`Unable to emit local array with element type ${c}`);const d=t(n,i);if(a)return o(n,`${c.padEnd(e)} ${d}[${i.size}];`,i.uid),n.setEmit(i,d),d;const s=Array.from({length:i.size},()=>r(n,i.elementType));o(n,`${c.padEnd(e)} ${d}[${i.size}] = ${c}[](${s.join(", ")});`,i.uid),n.setEmit(i,d)}const d=n.getEmit(i);for(const e of n.arrayReadVersions.get(i.uid)??[])r(n,e);return d}function y(n,i,a=!1){const c=n.getInput(i);if(c)return c.isUsed=!0,c.variableName;if("array"===i.type)return f(n,i,a);const d=1===i.children.length&&i.children[0]?.type===i.type;if(!i.isMutable&&(i.isImplicit||d))return r(n,i.children[0]);const s=t(n,i);if(a)return o(n,`${i.type.padEnd(e)} ${s};`,i.uid),s;const u=!i.debugInfo.name&&!i.isMutable;if(u){if("float"===i.type&&"number"==typeof i.children[0])return Number.isInteger(i.children[0])?i.children[0].toFixed(1):i.children[0].toString();if("int"===i.type&&"number"==typeof i.children[0]&&Number.isInteger(i.children[0]))return i.children[0].toString();if("bool"===i.type&&"boolean"==typeof i.children[0])return i.children[0].toString()}const p=i.children.map(e=>r(n,e)).join(", ");return u?`${i.type}(${p})`:(o(n,`${i.type.padEnd(e)} ${s} = ${i.type}(${p});`,i.uid),s)}export{n as generateGLSL};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{cloneShaderNode as e}from"./ShaderGraphNode.js";class t{constructor(e,t,a,o=[]){this.variableName=e,this.variableInputType=t,this.node=a,this.qualifiers=o,this.type="shader-input",this.isUsed=!1}clone(){return new t(this.variableName,this.variableInputType,e(this.node),[...this.qualifiers])}}class a{constructor(e,t,a,o=[]){this.outVariableName=e,this.outVariableType=t,this.node=a,this.qualifiers=o,this.type="shader-output"}clone(){const t=new a(this.outVariableName,this.outVariableType,e(this.node),[...this.qualifiers]);return t.variableName=this.variableName,t}}class o{static createVertex(e,d,
|
|
2
|
+
import{cloneShaderNode as e}from"./ShaderGraphNode.js";class t{constructor(e,t,a,o=[]){this.variableName=e,this.variableInputType=t,this.node=a,this.qualifiers=o,this.type="shader-input",this.isUsed=!1}clone(){return new t(this.variableName,this.variableInputType,e(this.node),[...this.qualifiers])}}class a{constructor(e,t,a,o=[]){this.outVariableName=e,this.outVariableType=t,this.node=a,this.qualifiers=o,this.type="shader-output"}clone(){const t=new a(this.outVariableName,this.outVariableType,e(this.node),[...this.qualifiers]);return t.variableName=this.variableName,t}}class o{static createVertex(e,n,s,d,i,u,p){const c=[];for(const a in e){const o=e[a],r=s.get(a);r?c.push(new t(r,"builtin",o)):c.push(new t("a_"+a,"in",o))}for(const a of d){const e=a.uniformHydrated;c.push(new t(a.uniformName,"uniform",e))}for(const a of i){const e=a.textureHydrated;c.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in n){const e=n[t];if("glPosition"===t)h.push(new a("gl_Position","builtin",e));else if("glPointSize"===t)h.push(new a("gl_PointSize","builtin",e));else{const o=r(e),n=[];o&&n.push(o),h.push(new a("v_"+t,"out",e,n))}}return new o(c,h,u,p)}static createFragment(e,r,n,s,d,i,u){const p=[],c=Array.from(i.rootOutputNodes());for(const a in e){const o=e[a],r=n.get(a);if(r){p.push(new t(r,"builtin",o));continue}const s=c.find(e=>e.node===o);s&&p.push(new t(s.outVariableName,"in",o))}for(const a of s){const e=a.uniformHydrated;p.push(new t(a.uniformName,"uniform",e))}for(const a of d){const e=a.textureHydrated;p.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in r){const e=r[t],o=n.get(t);switch(t){case"discard":h.push(new a(null,"discard",e));break;case"fragData0":h.push(new a("fragData0","fragData0",e));break;case"fragData1":h.push(new a("fragData1","fragData1",e));break;case"fragData2":h.push(new a("fragData2","fragData2",e));break;case"fragData3":h.push(new a("fragData3","fragData3",e));break;default:o?h.push(new a(o,"builtin",e)):h.push(new a(t,"out",e))}}return new o(p,h,u)}constructor(e,t,a,o){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._arrayReadVersions=new Map,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const r of e)this._inputShaderTypesByNodeUid.set(r.node.uid,r);this._outputShaderTypes=t,this._transformFeedbackBindings=a,this._transformFeedbackNames=new Set(a.map(e=>"v_"+e.propertyKey)),this._usedInFragmentShader=o}shouldPruneOutputNode(e){return!!this._usedInFragmentShader&&("builtin"!==e.outVariableType&&(!this._transformFeedbackNames.has(e.outVariableName)&&!this._usedInFragmentShader.has(e.node.uid)))}setEmit(e,t){this._nodeEmitMap.set(e.uid,t)}getEmit(e){return this._nodeEmitMap.get(e.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}get arrayReadVersions(){return this._arrayReadVersions}createArrayReadVersions(){const e=[],t=[],a=new Set;this._arrayReadVersions.clear();for(const o of this.rootOutputNodes())this.shouldPruneOutputNode(o)||(t.push(o.node),a.add(o.node.uid));for(let o=0;o<t.length;o++){const r=t[o];"array-read-node"===r.shaderType&&e.push(r);for(const e of r.children)e&&"number"!=typeof e&&"boolean"!=typeof e&&!a.has(e.uid)&&(a.add(e.uid),t.push(e))}for(const o of e){let e=this._arrayReadVersions.get(o.version.uid);e||(e=[],this._arrayReadVersions.set(o.version.uid,e)),e.push(o)}}getInput(e){return this._inputShaderTypesByNodeUid.get(e.uid)}*rootOutputNodes(){for(const e of this._outputShaderTypes)yield e}*nodes(){const e=[];for(const t of this._outputShaderTypes.values())e.push(t.node);for(;e.length;){const t=e.pop();"number"!=typeof t&&"boolean"!=typeof t&&e.push(...t.children.filter(Boolean)),yield t}}*nodesOfTypeOrFunction(){for(const e of this.nodes())"number"!=typeof e&&"boolean"!=typeof e&&(yield e)}createSubgraphContext(){const e=this.clone();return e.body="",e.indent=this.indent+2,e._nodeEmitMap=new Map(this._nodeEmitMap),e}clone(){const e=new o([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return e._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,e.indent=this.indent,e.body=this.body,e.varCount=this.varCount,e._arrayReadVersions=this._arrayReadVersions,e._nodeEmitMap=this._nodeEmitMap,e}insertVertexShader(e){e.vertex.code.add(""),this._insertInputs(e,"vertex"),e.vertex.code.add(""),e.vertex.code.add("// OUTPUTS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this.rootOutputNodes()){const a="builtin"===t.outVariableType;if(!this.shouldPruneOutputNode(t))if(a)e.vertex.code.add(`// ${t.outVariableType.padEnd(7)} ${t.node.type.padEnd(9)} ${t.outVariableName};`);else if("array"===t.node.type){const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.elementType.type.padEnd(9)} ${t.outVariableName}[${t.node.size}];`)}else{const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.type.padEnd(9)} ${t.outVariableName};`)}}e.vertex.code.add(""),e.vertex.code.add("void main() {"),e.vertex.code.add(" "+this.body.split("\n").join("\n "));for(const t of this.rootOutputNodes())this.shouldPruneOutputNode(t)||e.vertex.code.add(` ${t.outVariableName} = ${t.variableName};`);e.vertex.code.add("}")}insertFragmentShader(e){this._insertInputs(e,"fragment"),e.fragment.code.add(""),e.fragment.code.add("// OUTPUTS: "),e.fragment.code.add("// --------------------------------------------------------- ");let t=0;for(const n of this.rootOutputNodes())"builtin"===n.outVariableType?e.fragment.code.add(`// ${n.outVariableType.padEnd(7)} ${n.node.type.padEnd(9)} ${n.outVariableName};`):"discard"===n.outVariableType||e.outputs.add(n.outVariableName,n.node.type,t++);e.fragment.code.add(""),e.fragment.code.add("void main() {"),e.fragment.code.add(" "+this.body.split("\n").join("\n "));const a=Array.from(this.rootOutputNodes()),o=a.find(e=>"discard"===e.outVariableType),r=a.filter(e=>"discard"!==e.outVariableType);o&&(e.fragment.code.add(` if (${o.variableName}) {`),e.fragment.code.add(" discard;"),e.fragment.code.add(" }"),e.fragment.code.add(" "));for(const n of r)e.fragment.code.add(` ${n.outVariableName} = ${n.variableName};`);e.fragment.code.add("}")}_insertInputs(e,t){e[t].code.add("// INPUTS: "),e[t].code.add("// --------------------------------------------------------- ");for(const a of this.inputs())if(a.isUsed&&"builtin"!==a.variableInputType)if("array"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}];`);else if("array-2d"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}]; // Emulated 2D Array. Not supported by ES3.0`);else{const o=[...a.qualifiers,a.variableInputType].join(" ");e[t].code.add(` ${o.padEnd(10)} ${a.node.type.padEnd(9)} ${a.variableName};`)}}}function r(e){switch(e.type){case"float":case"vec2":case"vec3":case"vec4":case"array":return null;case"int":case"ivec2":case"ivec3":case"ivec4":case"uint":case"uvec2":case"uvec3":case"uvec4":case"bool":case"bvec2":case"bvec3":case"bvec4":return"flat";case"mat2":case"mat3":case"mat4":case"sampler2D":case"array-2d":throw new Error(`InternalError: ${e.type} is not a valid output type`)}}export{o as ShaderGraphContext,t as ShaderInput,a as ShaderOutput};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
function t(t){return t.split(" ").map((t,e)=>e>0?t.charAt(0).toUpperCase()+t.slice(1):t).join("")}function e(t,e){const s=[];for(s.push(e);s.length;){const e=s.pop();if("object"==typeof e&&!t.has(e.uid)){t.add(e.uid);for(const t of e.children)s.push(t)}}}class s{constructor(){this.uid=s.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}static{this.NodeCount=0}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(e){return e=t(e),this._debugName=e,this.isImplicit&&this.children[0]instanceof s&&this.children[0].setDebugName(e),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(t){t._debugName=this._debugName,t._isMutable=this._isMutable,t.isImplicit=this.isImplicit,t.uid=this.uid}}function i(t){return"object"==typeof t?t.clone():t}class r extends s{constructor(){super(...arguments),this.shaderType="primitive-node"}}class n extends s{constructor(t){super(),this.child=t,this.shaderType="scope-node"}get children(){return[this.child]}clone(){const t=new n(i(this.child));return this.cloneInto(t),t}}class h extends s{constructor(t){super(),this.text=t,this.shaderType="text-node"}get children(){return[]}clone(){const t=new h(this.text);return this.cloneInto(t),t}}class
|
|
2
|
+
function t(t){return t.split(" ").map((t,e)=>e>0?t.charAt(0).toUpperCase()+t.slice(1):t).join("")}function e(t,e){const s=[];for(s.push(e);s.length;){const e=s.pop();if("object"==typeof e&&!t.has(e.uid)){t.add(e.uid);for(const t of e.children)s.push(t)}}}class s{constructor(){this.uid=s.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}static{this.NodeCount=0}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(e){return e=t(e),this._debugName=e,this.isImplicit&&this.children[0]instanceof s&&this.children[0].setDebugName(e),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(t){t._debugName=this._debugName,t._isMutable=this._isMutable,t.isImplicit=this.isImplicit,t.uid=this.uid}}function i(t){return"object"==typeof t?t.clone():t}class r extends s{constructor(){super(...arguments),this.shaderType="primitive-node"}}class n extends s{constructor(t){super(),this.child=t,this.shaderType="scope-node"}get children(){return[this.child]}clone(){const t=new n(i(this.child));return this.cloneInto(t),t}}class h extends s{constructor(t){super(),this.text=t,this.shaderType="text-node"}get children(){return[]}clone(){const t=new h(this.text);return this.cloneInto(t),t}}class o extends s{constructor(t,e,s){super(),this.property=t,this.target=e,this.returnType=s,this.shaderType="property-access-node"}get children(){const t=[this.target];return"string"!=typeof this.property&&t.push(this.property),t}clone(){const t=new o(this.property,i(this.target),this.returnType);return this.cloneInto(t),t}}class c extends s{constructor(t,e,s,i){super(),this.x=t,this.y=e,this.target=s,this.returnType=i,this.shaderType="property-access-2d-node"}get children(){return[this.target,this.x,this.y]}clone(){const t=new c(this.x,this.y,i(this.target),this.returnType);return this.cloneInto(t),t}}class u extends s{constructor(t,e,s){super(),this.previousVersion=t,this.index=e,this.value=s,this.shaderType="array-write-node"}get children(){return[this.previousVersion,this.value,this.index]}clone(){const t=new u(i(this.previousVersion),i(this.index),i(this.value));return this.cloneInto(t),t}}class a extends s{constructor(t,e,s){super(),this.version=t,this.index=e,this.returnType=s,this.shaderType="array-read-node"}get children(){return[this.version,this.index]}clone(){const t=new a(i(this.version),i(this.index),this.returnType);return this.cloneInto(t),t}}class p extends s{constructor(t,e,s){super(),this.condition=t,this.ifTrue=e,this.ifFalse=s,this.shaderType="condition-node"}get children(){return this.ifFalse?[this.condition,this.ifTrue,this.ifFalse]:[this.condition,this.ifTrue]}clone(){const t=i(this.ifTrue),e=this.ifFalse?i(this.ifFalse):null,s=new p(this.condition,t,e);return this.cloneInto(s),s}}class d extends s{constructor(t,e,s,i){super(),this.captureList=t,this.returnType=e,this.generator=i,this.shaderType="block-node",s&&(this.subgraph=new n(s))}get children(){return Object.keys(this.captureList).map(t=>this.captureList[t]).concat(this.subgraph??[])}clone(){const t={};for(const s in this.captureList)t[s]=i(this.captureList[s]);const e=new d(t,this.returnType,this.subgraph?i(this.subgraph.child):this.subgraph,this.generator);return this.cloneInto(e),e}}class l extends s{constructor(t,e,s,i,r,n=!1){super(),this.token=t,this._children=e,this.isInfix=s,this.isPropertyAccess=i,this.returnType=r,this.isTernary=n,this.shaderType="function-node"}get children(){return this._children}clone(){const t=new l(this.token,this._children.map(i),this.isInfix,this.isPropertyAccess,this.returnType,this.isTernary);return this.cloneInto(t),t}}export{a as ShaderArrayReadNode,u as ShaderArrayWriteNode,d as ShaderBlockNode,p as ShaderConditionNode,l as ShaderFunctionNode,s as ShaderNode,r as ShaderPrimitiveNode,c as ShaderPropertyAccess2DNode,o as ShaderPropertyAccessNode,n as ShaderScopeNode,h as ShaderTextNode,i as cloneShaderNode,e as setReachableUids};
|