@arcgis/core 5.0.0-next.124 → 5.0.0-next.126
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/applications/Components/applySetUtils.d.ts +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{a327f36561f093dc0fab.js → 19fcc74d34cbbaa56a41.js} +1 -1
- package/assets/esri/core/workers/chunks/1ce46085095679386580.js +1 -0
- package/assets/esri/core/workers/chunks/{a2f38e86acf45272dbc2.js → 214323c62d6d3b603a00.js} +1 -1
- package/assets/esri/core/workers/chunks/215c54520d0da638fe57.js +1 -0
- package/assets/esri/core/workers/chunks/249630af2fb01257eb75.js +1 -0
- package/assets/esri/core/workers/chunks/3214763f268622f09986.js +1 -0
- package/assets/esri/core/workers/chunks/{18c05353d6d8950d1491.js → 36215b2c0b1020743458.js} +1 -1
- package/assets/esri/core/workers/chunks/{2badadf8032e166b34ec.js → 3f3c63420644f9522ab1.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f70a41258b2a0157aa5.js → 3fa59195286af30932d9.js} +1 -1
- package/assets/esri/core/workers/chunks/41108f58f0f439ebba3f.js +1 -0
- package/assets/esri/core/workers/chunks/4fe210314813ea1f7a26.js +1 -0
- package/assets/esri/core/workers/chunks/52705ccbb452a3edb064.js +1 -0
- package/assets/esri/core/workers/chunks/54c545f44b7ce21fb604.js +1 -0
- package/assets/esri/core/workers/chunks/{cfdb17522112c52f81ad.js → 558e9fed2e58cbbf9947.js} +1 -1
- package/assets/esri/core/workers/chunks/56e3c34ebdee61ff4b33.js +1 -0
- package/assets/esri/core/workers/chunks/{b50d2d3379654de1f2f3.js → 58134617fb7530836b81.js} +1 -1
- package/assets/esri/core/workers/chunks/58c4be467a922fe37f01.js +1 -0
- package/assets/esri/core/workers/chunks/{f0582d8111ec825e1f9a.js → 651b46aeabf22ff53a38.js} +1 -1
- package/assets/esri/core/workers/chunks/{90316fb569389d48920f.js → 666f201d222c50ab8428.js} +1 -1
- package/assets/esri/core/workers/chunks/6988517cb09928fed0f8.js +1 -0
- package/assets/esri/core/workers/chunks/6bf7d8de86b9eb76f920.js +1 -0
- package/assets/esri/core/workers/chunks/6c0b7890c8eec7febe28.js +1 -0
- package/assets/esri/core/workers/chunks/{25267253ba578eba38cf.js → 754e4d0b8c1ad392bd83.js} +1 -1
- package/assets/esri/core/workers/chunks/7ec83fc059325e207825.js +1 -0
- package/assets/esri/core/workers/chunks/7f385e9c88df3395e678.js +1 -0
- package/assets/esri/core/workers/chunks/{66ed527cd8ad11d008be.js → 80d51d58db09b9f96cb5.js} +1 -1
- package/assets/esri/core/workers/chunks/81c758bdc07ed9d9a132.js +1 -0
- package/assets/esri/core/workers/chunks/{8670d9d11950f3c61b79.js → 83711695e16912e9b9c5.js} +1 -1
- package/assets/esri/core/workers/chunks/a143a6f8e2f21548b244.js +1 -0
- package/assets/esri/core/workers/chunks/a4947d5d2fa6b7bd399b.js +1 -0
- package/assets/esri/core/workers/chunks/{1f30558e3ad6ac68bdb8.js → b4203e488bb928ff8032.js} +1 -1
- package/assets/esri/core/workers/chunks/b4b16914950792c46bd3.js +1 -0
- package/assets/esri/core/workers/chunks/{360b3499e2a671c309ce.js → b6969a42602517a6ef1c.js} +1 -1
- package/assets/esri/core/workers/chunks/{1aa2187597f7c4adb67f.js → bcb254cb7297fec88679.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d1a772abd730b61854f.js → bd2125e0a68378533641.js} +1 -1
- package/assets/esri/core/workers/chunks/{d76dfac06299cbd4f00e.js → c0b6706f86665cec85f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{f114da7ef2b891184e77.js → c3c6d337ff53e5d921e8.js} +1 -1
- package/assets/esri/core/workers/chunks/{b5f68e1fdbaca3cd9c8d.js → c941b716ea3c13cabc80.js} +1 -1
- package/assets/esri/core/workers/chunks/c99f36159b5ed6f9267e.js +1 -0
- package/assets/esri/core/workers/chunks/cf4202ad468501ef24cf.js +1 -0
- package/assets/esri/core/workers/chunks/{e2dc7e6b84e9b38ef9fe.js → d2017b0b27b9e4ada922.js} +1 -1
- package/assets/esri/core/workers/chunks/{4742a8c19b86a5f859f0.js → d47ca631e109144b6ba9.js} +1 -1
- package/assets/esri/core/workers/chunks/{38124ee5119e614645c9.js → d78b2f85ec9212a973e8.js} +1 -1
- package/assets/esri/core/workers/chunks/{7cd4280d24b24045bd7e.js → d8adab2d55b39241b232.js} +1 -1
- package/assets/esri/core/workers/chunks/e0519f24430fecead87b.js +1 -0
- package/assets/esri/core/workers/chunks/e33f5780fb45ac7ca889.js +1 -0
- package/assets/esri/core/workers/chunks/{eb9e913fe0dfcc71cf92.js → e4611ebd7dba7692a914.js} +1 -1
- package/assets/esri/core/workers/chunks/{86f2ec2692363abc97d1.js → e52793690dff1a199647.js} +1 -1
- package/assets/esri/core/workers/chunks/{c13efb74aa4602f6a1ee.js → e56a10a475ce128b5fce.js} +1 -1
- package/assets/esri/core/workers/chunks/ea633a6a3b9ea8ce965d.js +1 -0
- package/assets/esri/core/workers/chunks/eae1c098c16e2faaf90d.js +1 -0
- package/assets/esri/core/workers/chunks/{8650fbe1db55b7280c00.js → ef4237dc7b67c9039826.js} +1 -1
- package/assets/esri/core/workers/chunks/f5f513997cde0ce0f2a2.js +1 -0
- package/assets/esri/core/workers/chunks/fcc8d0b60f7c2397e550.js +1 -0
- package/assets/esri/themes/base/widgets/_BasemapGallery.scss +1 -0
- 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/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/SpatialReference.js +1 -1
- package/chunks/containsOperator.js +1 -1
- package/chunks/disjointOperator.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/editing/sharedTemplates/SharedTemplateMetadata.d.ts +0 -31
- package/{layers/graphics/editingSupport.d.ts → editing/types.d.ts} +8 -8
- package/editing/types.js +2 -0
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/json/containsOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/support/zscale.js +1 -1
- package/graphic/KnowledgeGraphGraphicOrigin.d.ts +0 -1
- package/graphic/LinkChartGraphicOrigin.js +1 -1
- package/interfaces.d.ts +60 -60
- package/kernel.js +1 -1
- package/layers/CSVLayer.d.ts +317 -540
- package/layers/CSVLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +13 -13
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoJSONLayer.d.ts +4 -4
- package/layers/OrientedImageryLayer.d.ts +6 -6
- package/layers/SceneLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.d.ts +5 -5
- package/layers/graphics/applyEditsUtils.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/OGCFeatureSource.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/EditBusLayer.d.ts +1 -1
- package/layers/raster/functions/ExtractBandFunction.js +1 -1
- package/layers/support/SubtypeSublayer.d.ts +5 -5
- package/layers/support/capabilities.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/networks/support/Circuit.d.ts +11 -2
- package/networks/support/CircuitSection.d.ts +3 -2
- package/package.json +1 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/rest/featureService/types.d.ts +7 -1
- package/rest/query/operations/editsZScale.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMCursor.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
- package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
- package/symbols/cim/placements/PlacementAtMeasuredUnits.js +1 -1
- package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
- package/symbols/cim/placements/PlacementOnLine.js +1 -1
- package/symbols/cim/placements/PlacementOnVertices.js +1 -1
- package/symbols/cim/types.d.ts +7 -0
- package/versionManagement/VersionManagementService.d.ts +3 -2
- package/views/2d/analysis/DistanceMeasurement/utils.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/plugins/BezierSegmentPlugin.js +1 -1
- package/views/draw/plugins/CircularArcSegmentPlugin.js +1 -1
- package/views/draw/plugins/FreehandSegmentPlugin.js +1 -1
- package/views/draw/plugins/MultipointPlugin.js +1 -1
- package/views/draw/plugins/PointPlugin.js +1 -1
- package/views/draw/plugins/PolygonPlugin.js +1 -1
- package/views/draw/plugins/PolylinePlugin.js +1 -1
- package/views/draw/plugins/ShapePlugin.js +1 -1
- package/views/draw/support/managers/TooltipManager.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDynamic.js +1 -1
- package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
- package/webscene/Glow.d.ts +10 -2
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Home/HomeViewModel.d.ts +2 -1
- package/widgets/Home/HomeViewModel.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/constants.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/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/assets/esri/core/workers/chunks/0184b4c0c92c76c60ab2.js +0 -1
- package/assets/esri/core/workers/chunks/0bf742d48f434c4c575f.js +0 -1
- package/assets/esri/core/workers/chunks/15ba0296403dd4152b88.js +0 -1
- package/assets/esri/core/workers/chunks/1701d9c50610f0b2dd38.js +0 -1
- package/assets/esri/core/workers/chunks/231602adad900fc024f0.js +0 -1
- package/assets/esri/core/workers/chunks/27aa21da934ecaca381a.js +0 -1
- package/assets/esri/core/workers/chunks/2907e9a7216b5a29729b.js +0 -1
- package/assets/esri/core/workers/chunks/2b0891ba57ba66b913ce.js +0 -1
- package/assets/esri/core/workers/chunks/2cd56b7ab70f908bbbd4.js +0 -1
- package/assets/esri/core/workers/chunks/2e1fe0dd357eb7a6f47f.js +0 -1
- package/assets/esri/core/workers/chunks/2e9d280f51ab43e6f102.js +0 -1
- package/assets/esri/core/workers/chunks/2eb7df99170b7bb2a914.js +0 -1
- package/assets/esri/core/workers/chunks/36b8dd092697ef544f40.js +0 -1
- package/assets/esri/core/workers/chunks/394aa478c29599b08bf5.js +0 -1
- package/assets/esri/core/workers/chunks/4ba4aa6c75e3f8950e65.js +0 -1
- package/assets/esri/core/workers/chunks/4d45c51ff32dd75299ac.js +0 -1
- package/assets/esri/core/workers/chunks/4fdc838f4c3efab6cd61.js +0 -1
- package/assets/esri/core/workers/chunks/6321680c8070dffa3b6c.js +0 -1
- package/assets/esri/core/workers/chunks/6b02919373bd4da7ff73.js +0 -1
- package/assets/esri/core/workers/chunks/a03196e6579d738251fc.js +0 -1
- package/assets/esri/core/workers/chunks/a0b715cf03895082b773.js +0 -1
- package/assets/esri/core/workers/chunks/aec827b50df6edc54808.js +0 -1
- package/assets/esri/core/workers/chunks/c80c82acec04ee0ade04.js +0 -1
- package/assets/esri/core/workers/chunks/d27a542a406ac3fe2ad9.js +0 -1
- package/assets/esri/core/workers/chunks/d9c1e1ec5c56f09fb82f.js +0 -1
- package/assets/esri/core/workers/chunks/ec2dfd89e4ce6fda4971.js +0 -1
- package/assets/esri/core/workers/chunks/ffb73b4e8f2f7ffd2db4.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{property as n,subclass as e}from"../../../core/accessorSupport/decorators.js";import{getBandMatrix3 as s}from"./bandIndexUtils.js";import r from"./BaseRasterFunction.js";import i from"./ExtractBandFunctionArguments.js";let a=class extends r{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:n}=this,e=n[0],{method:s,bandNames:r,bandWavelengths:i,bandIds:a,missingBandAction:o}=t,h=r?.length&&("name"===s||"id"!==s&&!a?.length),c=i?.length&&("wavelength"===s||"id"!==s&&!a?.length),m=1===o,g=h?l(e,r):c?d(e,i,this.functionArguments,m):u(e,a,m);if(null==g){return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${h?"band names":c?"band wavelengths":"band ids"} for the imagery data source`}}this.functionArguments.bandIds=g,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType(
|
|
2
|
+
import{__decorate as t}from"tslib";import{property as n,subclass as e}from"../../../core/accessorSupport/decorators.js";import{getBandMatrix3 as s}from"./bandIndexUtils.js";import r from"./BaseRasterFunction.js";import i from"./ExtractBandFunctionArguments.js";let a=class extends r{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:n}=this,e=n[0],{method:s,bandNames:r,bandWavelengths:i,bandIds:a,missingBandAction:o}=t,h=r?.length&&("name"===s||"id"!==s&&!a?.length),c=i?.length&&("wavelength"===s||"id"!==s&&!a?.length),m=1===o,g=h?l(e,r):c?d(e,i,this.functionArguments,m):u(e,a,m);if(null==g){return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${h?"band names":c?"band wavelengths":"band ids"} for the imagery data source`}}this.functionArguments.bandIds=g,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType(e.pixelType);const p=e.clone();p.pixelType=this.outputPixelType,p.bandCount=g.length;const{statistics:f,histograms:I}=p;null!=f&&f.length&&(p.statistics=g.map(t=>f[t]||f[f.length-1])),null!=I&&I.length&&(p.histograms=g.map(t=>I[t]||I[I.length-1])),p.multidimensionalInfo&&p.multidimensionalInfo.variables.forEach(t=>{const{statistics:n,histograms:e}=t;null!=n&&n.length&&(t.statistics=g.map(t=>n[t]||n[n.length-1])),null!=e&&e.length&&(t.histograms=g.map(t=>e[t]||e[e.length-1]))});let x=p.keyProperties?.BandProperties;x?.length&&(x=g.map(t=>t>=x.length?x[x.length-1]:x[t]),p.keyProperties={...p.keyProperties,BandProperties:x}),this.rasterInfo=p;return{success:!0,supportsGPU:p.bandCount<=3}}_processPixels(t){const n=t.pixelBlocks?.[0];if(null==n)return null;let{bandIds:e}=this.functionArguments;if(this.rasterInfo.storageInfo.isBsqTile){const{rawInputBandIds:t}=this;e=e.map(n=>t.indexOf(n))}else{const t=n.pixels.length;e=e.map(n=>n>=t?t-1:n)}return n.extractBands(e)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],0===t.length?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let n=0;n<3;n++)t[n]=Math.min(t[n],2)}return{bandIndexMat3:s(t)}}_getInputBandIds(t){const n=t.length;return this.functionArguments.bandIds.map(t=>t>=n?n-1:t).map(n=>t[n])}_swizzleBandIds(t){const n=this.functionArguments.bandIds.map(n=>t.indexOf(n));return this.isInputBandIdsSwizzled=!0,n[1]??=n[0],n[2]??=n[1],this.swizzledBandSelection=n,!1}};t([n({json:{write:!0,name:"rasterFunction"}})],a.prototype,"functionName",void 0),t([n({type:i,json:{write:!0,name:"rasterFunctionArguments"}})],a.prototype,"functionArguments",void 0),t([n()],a.prototype,"rasterArgumentNames",void 0),a=t([e("esri.layers.raster.functions.ExtractBandFunction")],a);const o=a;function l(t,n){const e=t.bandInfos.map(({name:t})=>t.toLowerCase()),s=[];for(let r=0;r<n.length;r++){const t=n[r].toLowerCase();let i=e.indexOf(t);if(-1===i&&"nearinfrared"===t&&(i=e.findIndex(t=>t.startsWith("nearinfrared_1")),-1===i&&(i=e.findIndex(t=>t.startsWith("nearinfrared")))),-1===i)return null;s.push(i)}return s}function u(t,n,e){const{bandCount:s}=t;return!n?.length||e&&n.some(t=>t<0||t>=s)?null:n}function d(t,n,{wavelengthMatchTolerance:e},s){const{bandInfos:r}=t,i=[];for(let o=0;o<r.length;o++){const{minWavelength:t,maxWavelength:n}=r[o];if(!t||!n)return null;i.push({minWavelength:t,maxWavelength:n})}const a=[];for(let o=0;o<n.length;o++){const t=n[o];let r=!1,l=-1,u=Number.MAX_VALUE;for(let n=0;n<i.length;n++){const e=i[n],s=t>=e.minWavelength&&t<=e.maxWavelength,a=Math.abs(t-(e.minWavelength+e.maxWavelength)/2);s?a<u&&(r=!0,l=n,u=a):!r&&a<u&&(l=n,u=a)}if(!r&&e&&u<e&&(r=!0),!r&&s)return null;a.push(l)}return a}export{o as default};
|
|
@@ -20,8 +20,8 @@ import type { ClonableMixin } from "../../core/Clonable.js";
|
|
|
20
20
|
import type { IdentifiableMixin, IdentifiableMixinProperties } from "../../core/Identifiable.js";
|
|
21
21
|
import type { Loadable, LoadableMixinProperties } from "../../core/Loadable.js";
|
|
22
22
|
import type { MultiOriginJSONSupportMixin } from "../../core/MultiOriginJSONSupport.js";
|
|
23
|
+
import type { EditOptions, Edits, EditsResult, FeatureEditResult } from "../../editing/types.js";
|
|
23
24
|
import type { FeatureLayerCapabilities, FeatureTitleOptions } from "../types.js";
|
|
24
|
-
import type { EditOptions, Edits, EditsResult, FeatureEditResult } from "../graphics/editingSupport.js";
|
|
25
25
|
import type { DomainUnion } from "./types.js";
|
|
26
26
|
import type { RequestOptions } from "../../request/types.js";
|
|
27
27
|
import type { AttachmentQueryProperties } from "../../rest/support/AttachmentQuery.js";
|
|
@@ -551,7 +551,7 @@ export default class SubtypeSublayer extends SubtypeSublayerSuperclass {
|
|
|
551
551
|
*
|
|
552
552
|
* @param feature - Feature to associate with the added attachment.
|
|
553
553
|
* @param attachment - HTML form that contains a file upload field specifying the file to be added as an attachment.
|
|
554
|
-
* @returns When resolved, a [FeatureEditResult](https://developers.arcgis.com/javascript/latest/references/core/
|
|
554
|
+
* @returns When resolved, a [FeatureEditResult](https://developers.arcgis.com/javascript/latest/references/core/editing/types/#FeatureEditResult)
|
|
555
555
|
* object is returned.
|
|
556
556
|
* @see [capabilities.data.supportsAttachment](https://developers.arcgis.com/javascript/latest/references/core/layers/support/SubtypeSublayer/#capabilities)
|
|
557
557
|
* @example
|
|
@@ -603,7 +603,7 @@ export default class SubtypeSublayer extends SubtypeSublayerSuperclass {
|
|
|
603
603
|
*
|
|
604
604
|
* @param edits - Object containing features and attachments to be added, updated or deleted.
|
|
605
605
|
* @param options - Additional edit options to specify when editing features or attachments.
|
|
606
|
-
* @returns When resolved, an [EditsResult](https://developers.arcgis.com/javascript/latest/references/core/
|
|
606
|
+
* @returns When resolved, an [EditsResult](https://developers.arcgis.com/javascript/latest/references/core/editing/types/#EditsResult)
|
|
607
607
|
* object is returned.
|
|
608
608
|
* @see [Sample - Edit features](https://developers.arcgis.com/javascript/latest/sample-code/editing-applyedits/)
|
|
609
609
|
* @example
|
|
@@ -681,7 +681,7 @@ export default class SubtypeSublayer extends SubtypeSublayerSuperclass {
|
|
|
681
681
|
*
|
|
682
682
|
* @param feature - Feature containing attachments to be deleted.
|
|
683
683
|
* @param attachmentIds - Ids of the attachments to be deleted.
|
|
684
|
-
* @returns When resolved, a [FeatureEditResult](https://developers.arcgis.com/javascript/latest/references/core/
|
|
684
|
+
* @returns When resolved, a [FeatureEditResult](https://developers.arcgis.com/javascript/latest/references/core/editing/types/#FeatureEditResult)
|
|
685
685
|
* object is returned. FeatureEditResult indicates whether or not the edit was successful. If successful, the `objectId` of the result is the Id of
|
|
686
686
|
* the new attachment. If unsuccessful, it also includes an error `name` and error `message`.
|
|
687
687
|
* @since 4.26
|
|
@@ -937,7 +937,7 @@ export default class SubtypeSublayer extends SubtypeSublayerSuperclass {
|
|
|
937
937
|
* @param feature - The feature containing the attachment to be updated.
|
|
938
938
|
* @param attachmentId - Id of the attachment to be updated.
|
|
939
939
|
* @param attachment - HTML form that contains a file upload field pointing to the file to be added as an attachment.
|
|
940
|
-
* @returns When resolved, a [FeatureEditResult](https://developers.arcgis.com/javascript/latest/references/core/
|
|
940
|
+
* @returns When resolved, a [FeatureEditResult](https://developers.arcgis.com/javascript/latest/references/core/editing/types/#FeatureEditResult)
|
|
941
941
|
* object is returned. FeatureEditResult indicates whether or not the edit was successful. If successful, the `objectId` of the result is the Id of
|
|
942
942
|
* the new attachment. If unsuccessful, it also includes an error `name` and error `message`.
|
|
943
943
|
* @since 4.26
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
const s={supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1,supportedStatistics:void 0,supportedNormalizationTypes:void 0},t={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsOrderByFields:!1,supportsResize:!1,supportsTypeWildcard:!1},data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s,query:{maxRecordCount:0,maxRecordCountFactor:0,maxUniqueIDCount:0,relativeTimeBinWindow:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCompactGeometry:!1,supportsCurrentUser:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsTrueCurve:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}};export{t as zeroCapabilities,s as zeroQueryBins};
|
|
2
|
+
const s={supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1,supportedStatistics:void 0,supportedNormalizationTypes:void 0},t={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsOrderByFields:!1,supportsResize:!1,supportsTypeWildcard:!1},data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s,query:{maxRecordCount:0,maxRecordCountFactor:0,maxUniqueIDCount:0,relativeTimeBinWindow:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCompactGeometry:!1,supportsCurrentUser:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsTrueCurve:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}};export{t as zeroCapabilities,s as zeroQueryBins};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{isSome as t}from"../../core/arrayUtils.js";import has from"../../core/has.js";import{curveTypeDict as s}from"../../geometry/support/typeUtils.js";import{isHostedAgolService as e,parse as r}from"./arcgisLayerUrl.js";import{getGltfQueryFormat as p}from"./infoFor3D.js";import{getRelativeTimeQueryBinWindowSize as o}from"./relativeTimeQueryUtils.js";import{readNumber as u,readBoolean as i}from"../../rest/support/jsonUtils.js";const a={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"},n=["cubic-bezier","circular-arc","elliptic-arc"];function c(t){const s=t?.supportedSpatialAggregationStatistics?.map(t=>t.toLowerCase());return{envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function l(t,s){const e=t?.supportedOperationsWithCacheHint?.map(t=>t.toLowerCase());return!!e?.includes(s.toLowerCase())}function d(t){const s=t?.supportedStatisticTypes?.map(t=>t.toLowerCase());return{count:!!s?.includes("count"),sum:!!s?.includes("sum"),min:!!s?.includes("min"),max:!!s?.includes("max"),avg:!!s?.includes("avg"),var:!!s?.includes("var"),stddev:!!s?.includes("stddev"),percentileContinuous:!!s?.includes("percentile_cont"),percentileDiscrete:!!s?.includes("percentile_disc"),envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function y(t){const s=t?.supportedNormalizationTypes?.map(t=>t.toLowerCase());return{field:!!s?.includes("field"),log:!!s?.includes("log"),naturalLog:!!s?.includes("naturallog"),percentOfTotal:!!s?.includes("percentoftotal"),squareRoot:!!s?.includes("squareroot")}}function m(t,s){return{analytics:
|
|
2
|
+
import{isSome as t}from"../../core/arrayUtils.js";import has from"../../core/has.js";import{curveTypeDict as s}from"../../geometry/support/typeUtils.js";import{isHostedAgolService as e,parse as r}from"./arcgisLayerUrl.js";import{getGltfQueryFormat as p}from"./infoFor3D.js";import{getRelativeTimeQueryBinWindowSize as o}from"./relativeTimeQueryUtils.js";import{readNumber as u,readBoolean as i}from"../../rest/support/jsonUtils.js";const a={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"},n=["cubic-bezier","circular-arc","elliptic-arc"];function c(t){const s=t?.supportedSpatialAggregationStatistics?.map(t=>t.toLowerCase());return{envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function l(t,s){const e=t?.supportedOperationsWithCacheHint?.map(t=>t.toLowerCase());return!!e?.includes(s.toLowerCase())}function d(t){const s=t?.supportedStatisticTypes?.map(t=>t.toLowerCase());return{count:!!s?.includes("count"),sum:!!s?.includes("sum"),min:!!s?.includes("min"),max:!!s?.includes("max"),avg:!!s?.includes("avg"),var:!!s?.includes("var"),stddev:!!s?.includes("stddev"),percentileContinuous:!!s?.includes("percentile_cont"),percentileDiscrete:!!s?.includes("percentile_disc"),envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function y(t){const s=t?.supportedNormalizationTypes?.map(t=>t.toLowerCase());return{field:!!s?.includes("field"),log:!!s?.includes("log"),naturalLog:!!s?.includes("naturallog"),percentOfTotal:!!s?.includes("percentoftotal"),squareRoot:!!s?.includes("squareroot")}}function m(t){if(!has("featurelayer-pbf-true-curves"))return!1;return(t.supportedTrueCurvePbfFeatureEncodings??[]).includes("esriDefault")}function C(t,s){return{analytics:v(t),attachment:g(t),data:f(t),metadata:h(t),operations:Q(t.capabilities,t,s),query:A(t,s),queryAttributeBins:F(t),queryRelated:S(t),queryTopFeatures:T(t),editing:x(t)}}function v(t){return{supportsCacheHint:l(t.advancedQueryCapabilities,"queryAnalytics")}}function g(t){const s=t.attachmentProperties,e={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:l(t.advancedQueryCapabilities,"queryAttachments"),supportsOrderByFields:i(t.advancedQueryCapabilities,"supportsQueryAttachmentOrderByFields",!1),supportsResize:i(t,"supportsAttachmentsResizing",!1),supportsTypeWildcard:i(t.advancedQueryCapabilities,"supportsQueryAttachmentWithTypeWildcard",!1)};return s&&Array.isArray(s)&&s.forEach(t=>{const s=a[t.name];s&&(e[s]=!!t.isEnabled)}),e}function f(t){const s=i(t.advancedQueryCapabilities,"supportsTrueCurve",!1);return{isVersioned:i(t,"isDataVersioned",!1),isBranchVersioned:i(t,"isDataBranchVersioned",!1),supportsAttachment:i(t,"hasAttachments",!1),supportsM:i(t,"hasM",!1),supportsTrueCurve:s,supportedCurveTypes:B(t,s),supportsZ:i(t,"hasZ",!1)}}function h(t){return{supportsAdvancedFieldProperties:i(t,"supportsFieldDescriptionProperty",!1)}}function Q(t,s,p){const o=e(p),u=t?.toLowerCase().split(",").map(t=>t.trim())??[],a=p?r(p):null,n=u.includes("MapServer"===a?.serverType?"data":"query"),c=u.includes("editing")&&!s.datesInUnknownTimezone&&!(!0===s.uniqueIdInfo?.OIDFieldContainsHashValue);let l=c&&u.includes("create"),d=c&&u.includes("delete"),y=c&&u.includes("update");const m=u.includes("changetracking"),C=s.advancedQueryCapabilities;let v=i(s,"supportsExceedsLimitStatistics",!1);if(!o){i(C,"supportsUseEstimateForExceedsLimit",!1)||(v=!1)}return c&&!(l||d||y)&&(l=d=y=!0),{supportsCalculate:i(s,"supportsCalculate",!1),supportsTruncate:i(s,"supportsTruncate",!1),supportsValidateSql:i(s,"supportsValidateSql",!1),supportsAdd:l,supportsDelete:d,supportsEditing:c,supportsChangeTracking:m,supportsQuery:n,supportsQueryAnalytics:i(C,"supportsQueryAnalytic",!1),supportsQueryAttachments:i(C,"supportsQueryAttachments",!1),supportsQueryBins:i(C,"supportsQueryBins",!1)||!!s.queryBinsCapabilities,supportsQueryPivot:i(C,"supportsQueryPivot",!1),supportsQueryTopFeatures:i(C,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:i(s,"supportsAttachmentsResizing",!1),supportsSync:u.includes("sync"),supportsUpdate:y,supportsExceedsLimitStatistics:v,supportsAsyncConvert3D:i(s,"supportsAsyncConvert3D",!1)}}function A(t,s){const r=t.advancedQueryCapabilities,a=t.ownershipBasedAccessControlForFeatures,n=t.archivingInfo,d=t.currentVersion,y=o(s,t.cacheMaxAge),C=s?.includes("MapServer"),v=!C||d>=has("mapserver-pbf-version-support"),g=e(s),f=new Set((t.supportedQueryFormats??"").split(",").map(t=>t.toLowerCase().trim())),h=v&&m(t);return{maxRecordCount:u(t,"maxRecordCount",void 0),maxRecordCountFactor:u(t,"maxRecordCountFactor",void 0),maxUniqueIDCount:u(t,"maxUniqueIDCount",void 0),relativeTimeBinWindow:y,standardMaxRecordCount:u(t,"standardMaxRecordCount",void 0),supportedSpatialAggregationStatistics:c(r),supportsCacheHint:i(r,"supportsQueryWithCacheHint",!1)||l(r,"query"),supportsCentroid:i(r,"supportsReturningGeometryCentroid",!1),supportsCentroidOnDegeneratedQuantizedGeometry:g||null==s,supportsCompactGeometry:g,supportsCurrentUser:i(r,"supportsCurrentUserQueries",!1),supportsDefaultSpatialReference:i(r,"supportsDefaultSR",!1),supportsDegeneratedQuantizedGeometry:i(r,"supportsDegeneratedQuantizedGeometry",!1),supportsDisjointSpatialRelationship:i(r,"supportsDisjointSpatialRel",!1),supportsDistance:i(r,"supportsQueryWithDistance",!1),supportsDistinct:i(r,"supportsDistinct",t.supportsAdvancedQueries),supportsExtent:i(r,"supportsReturningQueryExtent",!1),supportsFormatPBF:v&&f.has("pbf"),supportsFormatPBFWithCurves:h,supportsFullTextSearch:i(r,"supportsFullTextSearch",!1),supportsGeometryProperties:i(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:i(r,"supportsHavingClause",!1),supportsHistoricMoment:i(n,"supportsQueryWithHistoricMoment",!1),supportsMaxRecordCountFactor:i(r,"supportsMaxRecordCountFactor",!1),supportsOrderBy:i(r,"supportsOrderBy",t.supportsAdvancedQueries),supportsPagination:i(r,"supportsPagination",!1),supportsPaginationOnAggregatedQueries:i(r,"supportsPaginationOnAggregatedQueries",!1),supportsPercentileStatistics:i(r,"supportsPercentileStatistics",!1),supportsQuantization:i(t,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:i(t,"supportsQuantizationEditMode",!1),supportsQueryByAnonymous:i(a,"allowAnonymousToQuery",!0),supportsQueryByOthers:i(a,"allowOthersToQuery",!0),supportsQueryGeometry:i(t,"supportsReturningQueryGeometry",!1),supportsResultType:i(r,"supportsQueryWithResultType",!1),supportsReturnMesh:!!p(t.infoFor3D),supportsSpatialAggregationStatistics:i(r,"supportsSpatialAggregationStatistics",!1),supportsSqlExpression:i(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:i(t,"useStandardizedQueries",!1),supportsStatistics:i(r,"supportsStatistics",t.supportsStatistics),supportsTopFeaturesQuery:i(r,"supportsTopFeaturesQuery",!1),supportsTrueCurve:i(r,"supportsTrueCurve",!1),tileMaxRecordCount:u(t,"tileMaxRecordCount",void 0)}}function S(t){const s=t.advancedQueryCapabilities,e=i(s,"supportsAdvancedQueryRelated",!1);return{supportsPagination:i(s,"supportsQueryRelatedPagination",!1),supportsCount:e,supportsOrderBy:e,supportsCacheHint:l(s,"queryRelated")}}function T(t){return{supportsCacheHint:l(t.advancedQueryCapabilities,"queryTopFilter")}}function F(t){const s=t?t.queryBinsCapabilities:void 0;return{supportsDate:i(s,"supportsDateBin",!1),supportsFixedInterval:i(s,"supportsFixedIntervalBin",!1),supportsAutoInterval:i(s,"supportsAutoIntervalBin",!1),supportsFixedBoundaries:i(s,"supportsFixedBoundariesBin",!1),supportsStackBy:i(s,"supportsStackBy",!1),supportsSplitBy:i(s,"supportsSplitBy",!1),supportsSnapToData:i(s,"supportsSnapToData",!1),supportsReturnFullIntervalBin:i(s,"supportsReturnFullIntervalBin",!1),supportsFirstDayOfWeek:i(s,"supportsFirstDayOfWeek",!1),supportsNormalization:i(s,"supportsNormalization",!1),supportedStatistics:d(s),supportedNormalizationTypes:y(s)}}function x(t){const s=t.ownershipBasedAccessControlForFeatures,e=t?t.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:i(t,"allowGeometryUpdates",!0),supportsGlobalId:i(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:i(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:i(t,"supportsRollbackOnFailureParameter",!1),supportsTrueCurveUpdate:i(t,"allowTrueCurvesUpdates",!0),supportsTrueCurveUpdateByTrueCurveClientsOnly:i(t,"onlyAllowTrueCurveUpdatesByTrueCurveClients",!0),supportsUpdateWithoutM:i(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:i(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:i(s,"allowAnonymousToDelete",!0),supportsDeleteByOthers:i(s,"allowOthersToDelete",!0),supportsUpdateByAnonymous:i(s,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:i(s,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:i(e,"supportsAsyncApplyEdits",!1),zDefault:u(t,"zDefault",void 0)}}function B(e,r){const p=e.supportedCurveTypes??e.advancedQueryCapabilities?.supportedCurveTypes;return Array.isArray(p)?p.map(t=>s.fromJSON(t)).filter(t):r?n:[]}function R(t){return{operations:{supportsAppend:i(t,"supportsAppend",!1),supportsCoverageQuery:t?.playbackInfo?.klv["0601"]??!1,supportsExportClip:i(t,"supportsExportClip",!1),supportsExportFrameset:i(t,"supportsExportFrameset",!1),supportsMensuration:i(t,"supportsMensuration",!1),supportsPreviews:i(t,"supportsPreviews",!1),supportsUpdate:i(t,"supportsUpdate",!1)}}}export{n as allCurveTypes,C as getFeatureLayerCapabilities,R as getVideoLayerCapabilities};
|
|
@@ -41,7 +41,7 @@ export interface CircuitEvents {}
|
|
|
41
41
|
*
|
|
42
42
|
* Keep in mind that [name](https://developers.arcgis.com/javascript/latest/references/core/networks/support/Circuit/#name) must always be specified when instantiating a Circuit, and the following may be
|
|
43
43
|
* optionally specified: [attributes](https://developers.arcgis.com/javascript/latest/references/core/networks/support/Circuit/#attributes), [circuitManager](https://developers.arcgis.com/javascript/latest/references/core/networks/support/Circuit/#circuitManager), [circuitType](https://developers.arcgis.com/javascript/latest/references/core/networks/support/Circuit/#circuitType),
|
|
44
|
-
* and [subcircuits](https://developers.arcgis.com/javascript/latest/references/core/networks/support/Circuit/#subcircuits).
|
|
44
|
+
* [globalId](https://developers.arcgis.com/javascript/latest/references/core/networks/support/Circuit/#globalId), and [subcircuits](https://developers.arcgis.com/javascript/latest/references/core/networks/support/Circuit/#subcircuits).
|
|
45
45
|
*
|
|
46
46
|
* <details>
|
|
47
47
|
* <summary>Read More</summary>
|
|
@@ -113,13 +113,22 @@ export interface CircuitEvents {}
|
|
|
113
113
|
*
|
|
114
114
|
* ### As an empty circuit
|
|
115
115
|
*
|
|
116
|
-
* It is possible to create an empty
|
|
116
|
+
* It is possible to create an empty Circuit, without start locations, stop locations, or sections. In this scenario,
|
|
117
117
|
* [isSectioned](https://developers.arcgis.com/javascript/latest/references/core/networks/support/Circuit/#isSectioned) will be false until locations or sections are added to the Circuit.
|
|
118
118
|
*
|
|
119
119
|
* ```ts
|
|
120
120
|
* const circuit = new Circuit({ name: "TESTCIRCUIT" });
|
|
121
121
|
* ```
|
|
122
122
|
*
|
|
123
|
+
* To create an empty *sectioned* Circuit, specify an empty Map for the `sections` property.
|
|
124
|
+
*
|
|
125
|
+
* ```ts
|
|
126
|
+
* const circuit = new Circuit({
|
|
127
|
+
* name: "TESTCIRCUIT",
|
|
128
|
+
* sections: new Map(),
|
|
129
|
+
* });
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
123
132
|
* </details>
|
|
124
133
|
*
|
|
125
134
|
* @beta
|
|
@@ -38,8 +38,9 @@ export interface CircuitSectionEvents {}
|
|
|
38
38
|
* CircuitSections may be created in one of three ways: with [start location](https://developers.arcgis.com/javascript/latest/references/core/networks/support/CircuitSection/#startLocation) and [stop location](https://developers.arcgis.com/javascript/latest/references/core/networks/support/CircuitSection/#stopLocation),
|
|
39
39
|
* with a [subcircuit](https://developers.arcgis.com/javascript/latest/references/core/networks/support/CircuitSection/#subcircuit), or with neither.
|
|
40
40
|
*
|
|
41
|
-
* Keep in mind that [sectionId](https://developers.arcgis.com/javascript/latest/references/core/networks/support/CircuitSection/#sectionId) must always be specified when instantiating a
|
|
42
|
-
* [
|
|
41
|
+
* Keep in mind that [sectionId](https://developers.arcgis.com/javascript/latest/references/core/networks/support/CircuitSection/#sectionId) must always be specified when instantiating a CircuitSection,
|
|
42
|
+
* and the following may be optionally specified: [attributes](https://developers.arcgis.com/javascript/latest/references/core/networks/support/CircuitSection/#attributes), [globalId](https://developers.arcgis.com/javascript/latest/references/core/networks/support/CircuitSection/#globalId),
|
|
43
|
+
* and [sectionType](https://developers.arcgis.com/javascript/latest/references/core/networks/support/CircuitSection/#sectionType) (defaults to `physical`).
|
|
43
44
|
*
|
|
44
45
|
* <details>
|
|
45
46
|
* <summary>Read More</summary>
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../config.js";import{id as s}from"../../kernel.js";import r from"../../request.js";import{isSome as i}from"../../core/arrayUtils.js";import a from"../../core/Error.js";import{IdentifiableMixin as o}from"../../core/Identifiable.js";import{JSONSupportMixin as n}from"../../core/JSONSupport.js";import{clone as l}from"../../core/lang.js";import{Loadable as u}from"../../core/Loadable.js";import{throwIfAborted as d,throwIfAbortError as p}from"../../core/promiseUtils.js";import{property as c,subclass as m}from"../../core/accessorSupport/decorators.js";import y from"../../geometry/SpatialReference.js";import{curveTypeDict as h}from"../../geometry/support/typeUtils.js";import{getFeatureJSON as f,getFeatureIds as b,getAttachmentEditsJSON as v,isProtectedOrPrivateVersionError as g,unpackEditResultData as j,createEditedFeatures as S}from"../../layers/graphics/applyEditsUtils.js";import{checkEditingCapabilities as A,normalizeEdits as C,processGeometries as T}from"../../layers/graphics/editingSupport.js";import{emitApplyEditsEvent as O}from"../../layers/mixins/EditBusLayer.js";import{isHostedAgolService as E}from"../../layers/support/arcgisLayerUrl.js";import{ensureCredentialIfSignedIn as I}from"../../layers/support/featureLayerUtils.js";import{getOwningPortalUrl as w}from"../../layers/support/layerUtils.js";import{getFeatureLayerCapabilities as F,allCurveTypes as R}from"../../layers/support/serviceCapabilitiesUtils.js";import U from"../../portal/PortalItem.js";import{getUserPrivileges as D}from"../../portal/support/portalItemUtils.js";import{isSecureProxyService as P}from"../../portal/support/urlUtils.js";import{parseUrl as V,asValidOptions as G,encode as _}from"../utils.js";import{unapplyEditsZUnitScaling as k}from"../query/operations/editsZScale.js";import{readBoolean as x,readNumber as M}from"../support/jsonUtils.js";import{isSafeToEditVersion as N,isVersionInEditSession as L,currentSessionId as J}from"../../versionManagement/support/versionManagementUtils.js";import{reader as Q}from"../../core/accessorSupport/decorators/reader.js";function q(e,t){const s=t.id;return{id:s,name:t.name,url:`${e}/${s}`,type:t.type||"Table"}}function H(e){return{data:W(e),sync:Z(e),operations:B(e.capabilities,e),query:$(e),editing:z(e)}}function W(e){const t=x(e,"supportsTrueCurve",!1);return{isDataVersioned:x(e,"hasVersionedData",!1),isDataBranchVersioned:x(e,"hasBranchVersionedData",!1),supportsTrueCurve:t,supportedCurveTypes:K(e,t)}}function B(e,t){const s=e?e.toLowerCase().split(",").map(e=>e.trim()):[],r=s.includes("query"),i=s.includes("editing")&&!t.datesInUnknownTimezone;let a=i&&s.includes("create"),o=i&&s.includes("delete"),n=i&&s.includes("update");return i&&!(a||o||n)&&(a=o=n=!0),{supportsAdd:a,supportsDelete:o,supportsEditing:i,supportsChangeTracking:s.includes("changetracking"),supportsQuery:r,supportsQueryDataElements:x(t,"supportsQueryDataElements",!1),supportsQueryDomains:x(t,"supportsQueryDomains",!1),supportsQueryContingentValues:x(t,"supportsQueryContingentValues",!1),supportsSync:s.includes("sync"),supportsUpdate:n}}function $(e){return{maxRecordCountFactor:M(e,"maxRecordCountFactor",void 0),maxRecordCount:M(e,"maxRecordCount",void 0)}}function z(e){const t=e?.advancedEditingCapabilities;return{supportsAsyncApplyEdits:x(t,"supportsAsyncApplyEdits",!1),supportsGlobalId:x(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:x(t,"supportsReturnServiceEditsInSourceSR",!1),supportsSharedTemplates:x(e,"supportsSharedTemplates",!1)||x(e,"hasSharedTemplates",!1),supportsSplit:x(t,"supportsSplit",!1),supportsTrueCurveUpdate:x(e,"allowTrueCurvesUpdates",!1),supportsTrueCurveUpdateByTrueCurveClientsOnly:x(e,"onlyAllowTrueCurveUpdatesByTrueCurveClients",!0)}}function Z(e){const t=e?.syncCapabilities,s=t?.supportedSyncDataOptions;return{supportsAsync:x(t,"supportsAsync",!1),supportedSyncDataOptions:{annotations:!(1&~s),dimensions:!(2&~s),contingentValues:!(4&~s),attributeRules:!(8&~s),utilityNetworkSystem:!(16&~s),annotationFullModel:!(32&~s),include3DObjects:!(64&~s),utilityNetworkMissingLayers:!(128&~s),preserveTrueCurves:!(256&~s)}}}function K(e,t){return Array.isArray(e.supportedCurveTypes)?e.supportedCurveTypes.map(e=>h.fromJSON(e)).filter(i):t?R:[]}let X=class extends(n(o(u))){constructor(e){super(e),this.url=null,this.sourceJSON=null,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.userTypeExtensions=[],this.layerInfos=null,this.tableInfos=null,this.capabilities=null,this._layerTableIndex=new Map,this._xyToleranceCache=new Map}read(e,t){this.sourceJSON=e,super.read(e,t)}get utilityNetworkUrl(){if(this.sourceJSON)for(const e of this.sourceJSON.layers)if("Utility Network Layer"===e.type)return`${this.url}/${e.id}`;return null}get versionManagementServiceUrl(){return this.sourceJSON?.hasBranchVersionedData&&!P(this.url)?this.url.replace(/\/FeatureServer/i,"/VersionManagementServer"):null}readLayerInfos(e,t){return(t.layers||[]).map(e=>{const{type:t,geometryType:s}=e;return{...q(this.url,e),type:t||"Feature Layer",geometryType:s}})}readTableInfos(e,t){return(t.tables||[]).map(e=>q(this.url,e))}readCapabilities(e,t){return H(t)}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=l(e),{operations:s}=t;return this.userHasUpdateItemPrivileges?(s.supportsAdd=s.supportsDelete=s.supportsEditing=s.supportsQuery=s.supportsUpdate=!0,t):(this.userHasFullEditingPrivileges&&s.supportsEditing&&(s.supportsAdd=s.supportsDelete=s.supportsUpdate=!0),t)}get loaded(){return super.loaded}get _isHostedAgolService(){return E(this.url)}load(e){return this.addResolvingPromise(this._fetchService(this.url,e).then(()=>this._setUserPrivileges(e))),Promise.resolve(this)}async fetchAllLayersAndTables(e){return await this.load(e),this._fetchLayersAndTablesPromise||=this._fetchLayersAndTables(this.url),d(e),this._fetchLayersAndTablesPromise}async applyEdits(e,t){let s=null;try{const{results:r,edits:i,editedFeatures:a}=await this._internalApplyEdits(e,t),o=e=>e.filter(e=>!e.error).map(l);let n=0;return r.map(e=>{s=O(this.url,e.id,t?.gdbVersion,!0);const r={edits:i[n],addedFeatures:o(e.addFeatureResults),updatedFeatures:o(e.updateFeatureResults),deletedFeatures:o(e.deleteFeatureResults),addedAttachments:o(e.addAttachmentResults),updatedAttachments:o(e.updateAttachmentResults),deletedAttachments:o(e.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:e.editMoment?new Date(e.editMoment):null};n+=1,a.length>0&&(r.editedFeatures=a),s.resolve(r),s=null}),r}catch(r){throw s&&s.reject(r),r}}async _setUserPrivileges(e){if(t.userPrivilegesApplied)try{const{features:{fullEdit:t},content:{updateItem:s}}=await this._fetchUserPrivileges(this.sourceJSON.serviceItemId,e);this._set("userHasFullEditingPrivileges",t),this._set("userHasUpdateItemPrivileges",s)}catch(s){p(s)}}async _fetchUserPrivileges(e,t){const r=!0,i=!1,a=!1;if(!e)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};let o,n,l;try{o=await w(this.url,t)}catch(u){p(u)}try{const e=null!=t?t.signal:null;n=await(s?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(u){p(u)}if(!n)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};try{if(l=new U({id:e,portal:{url:o}}),await l.load(t),l.portal.user)return D(l)}catch(u){p(u)}return{features:{edit:r,fullEdit:i},content:{updateItem:a}}}async _internalApplyEdits(e,t){await I(this.url);const s=t?.globalIdUsed??!1,a=y.fromJSON(this.sourceJSON.spatialReference),{edits:o,options:n}=await this._processApplyEditsParams(e,t),l=await Promise.all(o.map(async e=>{const t=e.addFeatures?.map(e=>f({spatialReference:a},e,null))??[],r=(await Promise.all(t)).filter(i),o=r.length>0?r:null,n=e.updateFeatures?.map(e=>f({spatialReference:a},e,null))??[],l=(await Promise.all(n)).filter(i),u=l.length>0?l:null,d=b(e.identifierFields,e.deleteFeatures,s),p=d.length>0?d:null;k(o,u,a);const c=await v(e.identifierFields,e);let m=null;if(c){m={adds:c.adds.length>0?c.adds:void 0,updates:c.updates.length>0?c.updates:void 0,deletes:c.deletes.length>0?c.deletes:void 0}}const y={};return e.deleteAssociations&&(y.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(y.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(y.divideGroupedObjects=e.divideGroupedObjects),{id:e.id,adds:o,updates:u,deletes:p,attachments:m,...y}})),u={gdbVersion:n?.gdbVersion,rollbackOnFailure:!0,useGlobalIds:s,returnEditMoment:!0,honorSequenceOfEdits:n?.honorSequenceOfEdits,trueCurveClient:n?.editsRespectTrueCurves,usePreviousEditMoment:n?.usePreviousEditMoment,returnServiceEditsInSourceSR:!1,returnServiceEditsOption:"originalAndCurrentFeatures",async:!1};await N(this.url,t?.gdbVersion,!0);const d=L(this.url,t?.gdbVersion||null);u.edits=JSON.stringify(l);const p=V(this.url),c=G(p.query,{query:_({...u,f:"json"}),method:"post"});let m;d&&(c.authMode="immediate",c.query.sessionId=J);try{m=await r(this.url+"/applyEdits",c)}catch(h){if(!g(h))throw h;c.authMode="immediate",m=await r(this.url+"/applyEdits",c)}return{...Y(m),edits:o}}async _processApplyEditsParams(e,t){const s={...t,usingFeatureServiceEndpoint:!0,usingTelecomOperations:e.some(e=>e.deleteAssociations||e.combineGroupedObjects||e.divideGroupedObjects)};return{edits:await Promise.all(e.map(async e=>{const t=this.effectiveCapabilities,r=e&&(e.addFeatures||e.updateFeatures||e.deleteFeatures),i=e&&(e.addAttachments||e.updateAttachments||e.deleteAttachments);if(A(e,t,s,!!r,!!i,"feature-service"),!t.data.isDataVersioned&&s?.gdbVersion)throw new a("feature-service:invalid-parameter","'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isDataVersioned'");const o=C(e,t,"feature-service"),n={};if(e.deleteAssociations&&(n.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(n.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(n.divideGroupedObjects=e.divideGroupedObjects),!e.identifierFields){await this.fetchAllLayersAndTables();const t=this._layerTableIndex.get(e.id);t&&(e.identifierFields={globalIdField:t.globalIdField,objectIdField:t.objectIdField})}const l=await T(o,t.data.supportedCurveTypes,this._isHostedAgolService,this._xyToleranceCache);return{id:e.id,...l,...n,identifierFields:e.identifierFields}})),options:s}}async _fetchService(e,t){if(this.sourceJSON)return void this.read(this.sourceJSON,{url:V(e)});const s=await r(e,{responseType:"json",query:{f:"json"},...t});this.read(s.data,{url:V(e)})}async _fetchLayersAndTables(e){const t=`${e}/layers`,s=await r(t,{responseType:"json",query:{f:"json"}});return{layers:s.data.layers.map(e=>{const{type:t,geometryType:s}=e,r=q(this.url,e),i=F(e,r.url);return this._layerTableIndex.set(e.id,e),{...r,type:t||"Feature Layer",geometryType:s,capabilities:i}}),tables:s.data.tables.map(e=>{const t=q(this.url,e),s=F(e,t.url);return this._layerTableIndex.set(e.id,e),{...t,capabilities:s}})}}};function Y(e){const t=e.data,s=[];return{results:t.map(e=>{const t={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment},r=j(t),i=e.editedFeatures,a=i?.spatialReference?new y({wkid:i?.spatialReference.wkid,wkt:i?.spatialReference.wkt,latestWkid:i?.spatialReference.latestWkid,latestVcsWkid:i?.spatialReference.latestVcsWkid,vcsWkid:i?.spatialReference.vcsWkid}):null,o=i?S(i,a):null;o&&s.push({layerId:e.id,editedFeatures:o});const n={};return e.divideGroupedObjectResults&&(n.divideGroupedObjectResults=e.divideGroupedObjectResults),e.combineGroupedObjectResults&&(n.combineGroupedObjectResults=e.combineGroupedObjectResults),{id:e.id,editedFeatures:o,...r,...n}}),editedFeatures:s}}e([c()],X.prototype,"url",void 0),e([c()],X.prototype,"sourceJSON",void 0),e([c()],X.prototype,"userHasFullEditingPrivileges",void 0),e([c()],X.prototype,"userHasUpdateItemPrivileges",void 0),e([c({readOnly:!0})],X.prototype,"utilityNetworkUrl",null),e([c({readOnly:!0})],X.prototype,"versionManagementServiceUrl",null),e([c()],X.prototype,"userTypeExtensions",void 0),e([c({json:{read:{source:["layers"]}}})],X.prototype,"layerInfos",void 0),e([Q("layerInfos",["layers"])],X.prototype,"readLayerInfos",null),e([c({json:{read:{source:["tables"]}}})],X.prototype,"tableInfos",void 0),e([Q("tableInfos",["tables"])],X.prototype,"readTableInfos",null),e([c({readOnly:!0,json:{read:{source:["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"]}}})],X.prototype,"capabilities",void 0),e([Q("capabilities",["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"])],X.prototype,"readCapabilities",null),e([c({readOnly:!0})],X.prototype,"effectiveCapabilities",null),e([c()],X.prototype,"_isHostedAgolService",null),X=e([m("esri.rest.featureService.FeatureService")],X);const ee=X;export{ee as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../config.js";import{id as s}from"../../kernel.js";import r from"../../request.js";import{isSome as i}from"../../core/arrayUtils.js";import a from"../../core/Error.js";import{IdentifiableMixin as o}from"../../core/Identifiable.js";import{JSONSupportMixin as n}from"../../core/JSONSupport.js";import{clone as l}from"../../core/lang.js";import{Loadable as u}from"../../core/Loadable.js";import{throwIfAborted as d,throwIfAbortError as p}from"../../core/promiseUtils.js";import{property as c,subclass as m}from"../../core/accessorSupport/decorators.js";import y from"../../geometry/SpatialReference.js";import{curveTypeDict as h}from"../../geometry/support/typeUtils.js";import{getFeatureJSON as f,getFeatureIds as b,getAttachmentEditsJSON as v,isProtectedOrPrivateVersionError as g,unpackEditResultData as j,createEditedFeatures as S}from"../../layers/graphics/applyEditsUtils.js";import{checkEditingCapabilities as C,normalizeEdits as T,processGeometries as A}from"../../layers/graphics/editingSupport.js";import{emitApplyEditsEvent as E}from"../../layers/mixins/EditBusLayer.js";import{isHostedAgolService as F}from"../../layers/support/arcgisLayerUrl.js";import{ensureCredentialIfSignedIn as O}from"../../layers/support/featureLayerUtils.js";import{getOwningPortalUrl as I}from"../../layers/support/layerUtils.js";import{getFeatureLayerCapabilities as w,allCurveTypes as R}from"../../layers/support/serviceCapabilitiesUtils.js";import U from"../../portal/PortalItem.js";import{getUserPrivileges as P}from"../../portal/support/portalItemUtils.js";import{isSecureProxyService as D}from"../../portal/support/urlUtils.js";import{parseUrl as V,asValidOptions as G,encode as _}from"../utils.js";import{unapplyEditsZUnitScaling as k}from"../query/operations/editsZScale.js";import{readBoolean as x,readNumber as M}from"../support/jsonUtils.js";import{isSafeToEditVersion as N,isVersionInEditSession as L,currentSessionId as J}from"../../versionManagement/support/versionManagementUtils.js";import{reader as Q}from"../../core/accessorSupport/decorators/reader.js";function q(e,t){const s=t.id;return{id:s,name:t.name,url:`${e}/${s}`,type:t.type||"Table"}}function H(e){return{data:W(e),sync:K(e),operations:B(e.capabilities,e),query:$(e),editing:Z(e)}}function W(e){const t=x(e,"supportsTrueCurve",!1);return{isDataVersioned:x(e,"hasVersionedData",!1),isDataBranchVersioned:x(e,"hasBranchVersionedData",!1),supportsTrueCurve:t,supportedCurveTypes:X(e,t)}}function B(e,t){const s=e?e.toLowerCase().split(",").map(e=>e.trim()):[],r=s.includes("query"),i=s.includes("editing")&&!t.datesInUnknownTimezone;let a=i&&s.includes("create"),o=i&&s.includes("delete"),n=i&&s.includes("update");return i&&!(a||o||n)&&(a=o=n=!0),{supportsAdd:a,supportsDelete:o,supportsEditing:i,supportsChangeTracking:s.includes("changetracking"),supportsQuery:r,supportsQueryDataElements:x(t,"supportsQueryDataElements",!1),supportsQueryDomains:x(t,"supportsQueryDomains",!1),supportsQueryContingentValues:x(t,"supportsQueryContingentValues",!1),supportsSync:s.includes("sync"),supportsUpdate:n}}function $(e){return{maxRecordCountFactor:M(e,"maxRecordCountFactor",void 0),maxRecordCount:M(e,"maxRecordCount",void 0),supportsTrueCurveWithPBF:z(e)}}function z(e){return!!Array.isArray(e.supportedTrueCurvePbfFeatureEncodings)&&e.supportedTrueCurvePbfFeatureEncodings.includes("esriDefault")}function Z(e){const t=e?.advancedEditingCapabilities;return{supportsAsyncApplyEdits:x(t,"supportsAsyncApplyEdits",!1),supportsGlobalId:x(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:x(t,"supportsReturnServiceEditsInSourceSR",!1),supportsSharedTemplates:x(e,"supportsSharedTemplates",!1)||x(e,"hasSharedTemplates",!1),supportsSplit:x(t,"supportsSplit",!1),supportsTrueCurveUpdate:x(e,"allowTrueCurvesUpdates",!1),supportsTrueCurveUpdateByTrueCurveClientsOnly:x(e,"onlyAllowTrueCurveUpdatesByTrueCurveClients",!0)}}function K(e){const t=e?.syncCapabilities,s=t?.supportedSyncDataOptions;return{supportsAsync:x(t,"supportsAsync",!1),supportedSyncDataOptions:{annotations:!(1&~s),dimensions:!(2&~s),contingentValues:!(4&~s),attributeRules:!(8&~s),utilityNetworkSystem:!(16&~s),annotationFullModel:!(32&~s),include3DObjects:!(64&~s),utilityNetworkMissingLayers:!(128&~s),preserveTrueCurves:!(256&~s)}}}function X(e,t){return Array.isArray(e.supportedCurveTypes)?e.supportedCurveTypes.map(e=>h.fromJSON(e)).filter(i):t?R:[]}let Y=class extends(n(o(u))){constructor(e){super(e),this.url=null,this.sourceJSON=null,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.userTypeExtensions=[],this.layerInfos=null,this.tableInfos=null,this.capabilities=null,this._layerTableIndex=new Map,this._xyToleranceCache=new Map}read(e,t){this.sourceJSON=e,super.read(e,t)}get utilityNetworkUrl(){if(this.sourceJSON)for(const e of this.sourceJSON.layers)if("Utility Network Layer"===e.type)return`${this.url}/${e.id}`;return null}get versionManagementServiceUrl(){return this.sourceJSON?.hasBranchVersionedData&&!D(this.url)?this.url.replace(/\/FeatureServer/i,"/VersionManagementServer"):null}readLayerInfos(e,t){return(t.layers||[]).map(e=>{const{type:t,geometryType:s}=e;return{...q(this.url,e),type:t||"Feature Layer",geometryType:s}})}readTableInfos(e,t){return(t.tables||[]).map(e=>q(this.url,e))}readCapabilities(e,t){return H(t)}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=l(e),{operations:s}=t;return this.userHasUpdateItemPrivileges?(s.supportsAdd=s.supportsDelete=s.supportsEditing=s.supportsQuery=s.supportsUpdate=!0,t):(this.userHasFullEditingPrivileges&&s.supportsEditing&&(s.supportsAdd=s.supportsDelete=s.supportsUpdate=!0),t)}get loaded(){return super.loaded}get _isHostedAgolService(){return F(this.url)}load(e){return this.addResolvingPromise(this._fetchService(this.url,e).then(()=>this._setUserPrivileges(e))),Promise.resolve(this)}async fetchAllLayersAndTables(e){return await this.load(e),this._fetchLayersAndTablesPromise||=this._fetchLayersAndTables(this.url),d(e),this._fetchLayersAndTablesPromise}async applyEdits(e,t){let s=null;try{const{results:r,edits:i,editedFeatures:a}=await this._internalApplyEdits(e,t),o=e=>e.filter(e=>!e.error).map(l);let n=0;return r.map(e=>{s=E(this.url,e.id,t?.gdbVersion,!0);const r={edits:i[n],addedFeatures:o(e.addFeatureResults),updatedFeatures:o(e.updateFeatureResults),deletedFeatures:o(e.deleteFeatureResults),addedAttachments:o(e.addAttachmentResults),updatedAttachments:o(e.updateAttachmentResults),deletedAttachments:o(e.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:e.editMoment?new Date(e.editMoment):null};n+=1,a.length>0&&(r.editedFeatures=a),s.resolve(r),s=null}),r}catch(r){throw s&&s.reject(r),r}}async _setUserPrivileges(e){if(t.userPrivilegesApplied)try{const{features:{fullEdit:t},content:{updateItem:s}}=await this._fetchUserPrivileges(this.sourceJSON.serviceItemId,e);this._set("userHasFullEditingPrivileges",t),this._set("userHasUpdateItemPrivileges",s)}catch(s){p(s)}}async _fetchUserPrivileges(e,t){const r=!0,i=!1,a=!1;if(!e)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};let o,n,l;try{o=await I(this.url,t)}catch(u){p(u)}try{const e=null!=t?t.signal:null;n=await(s?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(u){p(u)}if(!n)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};try{if(l=new U({id:e,portal:{url:o}}),await l.load(t),l.portal.user)return P(l)}catch(u){p(u)}return{features:{edit:r,fullEdit:i},content:{updateItem:a}}}async _internalApplyEdits(e,t){await O(this.url);const s=t?.globalIdUsed??!1,a=y.fromJSON(this.sourceJSON.spatialReference),{edits:o,options:n}=await this._processApplyEditsParams(e,t),l=await Promise.all(o.map(async e=>{const t=e.addFeatures?.map(e=>f({spatialReference:a},e,null))??[],r=(await Promise.all(t)).filter(i),o=r.length>0?r:null,n=e.updateFeatures?.map(e=>f({spatialReference:a},e,null))??[],l=(await Promise.all(n)).filter(i),u=l.length>0?l:null,d=b(e.identifierFields,e.deleteFeatures,s),p=d.length>0?d:null;k(o,u,a);const c=await v(e.identifierFields,e);let m=null;if(c){m={adds:c.adds.length>0?c.adds:void 0,updates:c.updates.length>0?c.updates:void 0,deletes:c.deletes.length>0?c.deletes:void 0}}const y={};return e.deleteAssociations&&(y.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(y.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(y.divideGroupedObjects=e.divideGroupedObjects),{id:e.id,adds:o,updates:u,deletes:p,attachments:m,...y}})),u={gdbVersion:n?.gdbVersion,rollbackOnFailure:!0,useGlobalIds:s,returnEditMoment:!0,honorSequenceOfEdits:n?.honorSequenceOfEdits,trueCurveClient:n?.editsRespectTrueCurves,usePreviousEditMoment:n?.usePreviousEditMoment,returnServiceEditsInSourceSR:!1,returnServiceEditsOption:"originalAndCurrentFeatures",async:!1};await N(this.url,t?.gdbVersion,!0);const d=L(this.url,t?.gdbVersion||null);u.edits=JSON.stringify(l);const p=V(this.url),c=G(p.query,{query:_({...u,f:"json"}),method:"post"});let m;d&&(c.authMode="immediate",c.query.sessionId=J);try{m=await r(this.url+"/applyEdits",c)}catch(h){if(!g(h))throw h;c.authMode="immediate",m=await r(this.url+"/applyEdits",c)}return{...ee(m),edits:o}}async _processApplyEditsParams(e,t){const s={...t,usingFeatureServiceEndpoint:!0,usingTelecomOperations:e.some(e=>e.deleteAssociations||e.combineGroupedObjects||e.divideGroupedObjects)};return{edits:await Promise.all(e.map(async e=>{const t=this.effectiveCapabilities,r=e&&(e.addFeatures||e.updateFeatures||e.deleteFeatures),i=e&&(e.addAttachments||e.updateAttachments||e.deleteAttachments);if(C(e,t,s,!!r,!!i,"feature-service"),!t.data.isDataVersioned&&s?.gdbVersion)throw new a("feature-service:invalid-parameter","'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isDataVersioned'");const o=T(e,t,"feature-service"),n={};if(e.deleteAssociations&&(n.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(n.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(n.divideGroupedObjects=e.divideGroupedObjects),!e.identifierFields){await this.fetchAllLayersAndTables();const t=this._layerTableIndex.get(e.id);t&&(e.identifierFields={globalIdField:t.globalIdField,objectIdField:t.objectIdField})}const l=await A(o,t.data.supportedCurveTypes,this._isHostedAgolService,this._xyToleranceCache);return{id:e.id,...l,...n,identifierFields:e.identifierFields}})),options:s}}async _fetchService(e,t){if(this.sourceJSON)return void this.read(this.sourceJSON,{url:V(e)});const s=await r(e,{responseType:"json",query:{f:"json"},...t});this.read(s.data,{url:V(e)})}async _fetchLayersAndTables(e){const t=`${e}/layers`,s=await r(t,{responseType:"json",query:{f:"json"}});return{layers:s.data.layers.map(e=>{const{type:t,geometryType:s}=e,r=q(this.url,e),i=w(e,r.url);return this._layerTableIndex.set(e.id,e),{...r,type:t||"Feature Layer",geometryType:s,capabilities:i}}),tables:s.data.tables.map(e=>{const t=q(this.url,e),s=w(e,t.url);return this._layerTableIndex.set(e.id,e),{...t,capabilities:s}})}}};function ee(e){const t=e.data,s=[];return{results:t.map(e=>{const t={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment},r=j(t),i=e.editedFeatures,a=i?.spatialReference?new y({wkid:i?.spatialReference.wkid,wkt:i?.spatialReference.wkt,latestWkid:i?.spatialReference.latestWkid,latestVcsWkid:i?.spatialReference.latestVcsWkid,vcsWkid:i?.spatialReference.vcsWkid}):null,o=i?S(i,a):null;o&&s.push({layerId:e.id,editedFeatures:o});const n={};return e.divideGroupedObjectResults&&(n.divideGroupedObjectResults=e.divideGroupedObjectResults),e.combineGroupedObjectResults&&(n.combineGroupedObjectResults=e.combineGroupedObjectResults),{id:e.id,editedFeatures:o,...r,...n}}),editedFeatures:s}}e([c()],Y.prototype,"url",void 0),e([c()],Y.prototype,"sourceJSON",void 0),e([c()],Y.prototype,"userHasFullEditingPrivileges",void 0),e([c()],Y.prototype,"userHasUpdateItemPrivileges",void 0),e([c({readOnly:!0})],Y.prototype,"utilityNetworkUrl",null),e([c({readOnly:!0})],Y.prototype,"versionManagementServiceUrl",null),e([c()],Y.prototype,"userTypeExtensions",void 0),e([c({json:{read:{source:["layers"]}}})],Y.prototype,"layerInfos",void 0),e([Q("layerInfos",["layers"])],Y.prototype,"readLayerInfos",null),e([c({json:{read:{source:["tables"]}}})],Y.prototype,"tableInfos",void 0),e([Q("tableInfos",["tables"])],Y.prototype,"readTableInfos",null),e([c({readOnly:!0,json:{read:{source:["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"]}}})],Y.prototype,"capabilities",void 0),e([Q("capabilities",["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"])],Y.prototype,"readCapabilities",null),e([c({readOnly:!0})],Y.prototype,"effectiveCapabilities",null),e([c()],Y.prototype,"_isHostedAgolService",null),Y=e([m("esri.rest.featureService.FeatureService")],Y);const te=Y;export{te as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type FeatureLayer from "../../layers/FeatureLayer.js";
|
|
2
2
|
import type SubtypeGroupLayer from "../../layers/SubtypeGroupLayer.js";
|
|
3
3
|
import type FeatureService from "./FeatureService.js";
|
|
4
|
+
import type { EditedFeatures, Edits, FeatureEditResult } from "../../editing/types.js";
|
|
4
5
|
import type { CurveType } from "../../geometry/types.js";
|
|
5
6
|
import type { FeatureLayerCapabilities } from "../../layers/types.js";
|
|
6
|
-
import type { EditedFeatures, Edits, FeatureEditResult } from "../../layers/graphics/editingSupport.js";
|
|
7
7
|
import type { AssociationJsonType } from "../../networks/support/typeUtils.js";
|
|
8
8
|
import type { GeometryType } from "../support/types.js";
|
|
9
9
|
|
|
@@ -188,6 +188,12 @@ export interface QueryCapabilities {
|
|
|
188
188
|
* @since 5.0
|
|
189
189
|
*/
|
|
190
190
|
maxRecordCountFactor?: number | null;
|
|
191
|
+
/**
|
|
192
|
+
* Whether PBF-encoded true curves are supported.
|
|
193
|
+
*
|
|
194
|
+
* @since 5.0
|
|
195
|
+
*/
|
|
196
|
+
supportsTrueCurveWithPBF: boolean;
|
|
191
197
|
}
|
|
192
198
|
|
|
193
199
|
/** @since 5.0 */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{getMetersPerVerticalUnitForSR as
|
|
2
|
+
import{getMetersPerVerticalUnitForSR as e}from"../../../core/units.js";import{equals as n}from"../../../geometry/support/spatialReferenceUtils.js";import{getEndpoint as s}from"../../../geometry/support/curves/curveUtils.js";function o(e,n,s){if(null==e.hasM||e.hasZ)for(const o of n)for(const e of o)e.length>2&&(e[2]*=s)}function t(e,n,o){if(null==e.hasM||e.hasZ)for(const t of n)for(const e of t){const n=s(e);n.length>2&&(n[2]*=o)}}function i(n,s,o){if(!n&&!s||!o)return;const t=e(o);f(n,o,t),f(s,o,t)}function f(e,n,s){if(e)for(const o of e)r(o.geometry,n,s)}function r(s,i,f){if(!s?.spatialReference||n(s.spatialReference,i))return;const r=e(s.spatialReference)/f;if(1!==r)if("x"in s)null!=s.z&&(s.z*=r);else if("curveRings"in s)t(s,s.curveRings,r);else if("curvePaths"in s)t(s,s.curvePaths,r);else if("rings"in s)o(s,s.rings,r);else if("paths"in s)o(s,s.paths,r);else if("points"in s&&(null==s.hasM||s.hasZ))for(const e of s.points)e.length>2&&(e[2]*=r)}export{i as unapplyEditsZUnitScaling};
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const d="20260215",a="d53c849a78bfcd17d546e965a21b3d740f2d4ae8";export{d as buildDate,a as commitHash};
|
package/symbols/cim/CIMCursor.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{Placement as t}from"./CIMPlacements.js";function e(t,e){t[4]=e}class i{constructor(e,i=!0,
|
|
2
|
+
import{Placement as t}from"./CIMPlacements.js";function e(t,e){t[4]=e}class i{constructor(e,i=!0,s=!0,r=0){this._angleToLine=!0,this._keepUpright=!1,this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!i&&"esriGeometryPolygon"===e.geometryType||!s&&"esriGeometryPolyline"===e.geometryType?null:e,this.geomUnitsPerPoint=r,this.iterateMultiPath=!1,this.iteratePath=!1,this.internalPlacement=new t}next(){if(!this.geometryCursor)return null;const t=this.processMultiPath(this.geometryCursor);if(this.iterateMultiPath&&t||(this.geometryCursor=null),!t)return null;const e=t.getAngle();if(this._angleToLine&&this._keepUpright&&Math.abs(e)>.5*Math.PI){const i=e+Math.PI,s=Math.atan2(Math.sin(i),Math.cos(i));Number.isNaN(s)||t.setRotate(s)}return t}processMultiPath(t){for(;this.iteratePath||t.pathIndex<t.totalSize-1;){this.iteratePath||t.nextPath(),this.iterateMultiPath=!0;const e=this.processPath(t);if(e)return e}return this.iterateMultiPath=!1,null}}class s{constructor(t,e,i,s=0){this.isClosed=!1,this.inputGeometries=t,this.acceptPolygon=e,this.acceptPolyline=i,this.geomUnitsPerPoint=s,this.iteratePath=!1,this.multiPathCursor=null}next(){for(;;){if(!this.multiPathCursor){let t=this.inputGeometries.next();for(;t&&(this.isClosed=this.acceptPolygon&&"esriGeometryPolygon"===t.geometryType||"esriGeometryEnvelope"===t.geometryType,this.multiPathCursor=t,!this.multiPathCursor);)t=this.inputGeometries.next();if(!this.multiPathCursor)return null}for(;this.iteratePath||this.multiPathCursor.nextPath();){this.multiPathCursor.seekPathStart();const t=this.processPath(this.multiPathCursor);if(t)return t}this.multiPathCursor=null}}}export{s as PathEffectCursor,i as PathTransformationCursor,e as setId};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{bidiText as e}from"../../core/BidiText.js";import{clone as t}from"../../core/lang.js";import r from"../../core/Logger.js";import o from"../../core/RandomLCG.js";import{px2pt as a}from"../../core/screenUtils.js";import{create as s,expandPointInPlace as i}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as n}from"../../geometry/support/boundsUtils.js";import l from"../Font.js";import{loadGeometryOperatorsForEffect as c,loadGeometryOperatorsForPlacement as m}from"./CIMEffects.js";import{Placement as f}from"./CIMPlacements.js";import{EnvDrawHelper as y,CanvasDrawHelper as h,lineGapType2LineHeight as u,Transformation as M}from"./CIMSymbolDrawHelper.js";import{defaultCIMValues as p}from"./defaultCIMValues.js";import{isGeometricLinearEffect as S,getNumericValue as d,fromCIMFontStyle as b,fromCIMFontDecoration as g}from"./utils.js";import{defaultPolylineSymbol2D as C}from"../support/defaults.js";import{cInfinity as x}from"../../views/2d/engine/vectorTiles/GeometryUtils.js";import{magicLabelLineHeight as I,glyphSize as k,randomInsidePolygonTextureSize as w}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as P}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as L,getLineWidth as F}from"../../views/2d/layers/graphics/graphicsUtils.js";const z=Math.PI,D=z/2,G=Math.PI/180,T=96/72,E=1.4142135623730951,v=2,A=4,R=()=>r.getLogger("esri.symbols.cim.CIMSymbolHelper");function j(e){let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":{const r=_.fromSimpleMarker(e);if(!r)throw new Error("InternalError: Cannot convert symbol to CIM");t=r;break}case"picture-marker":t=_.fromPictureMarker(e);break;case"simple-line":t=_.fromSimpleLineSymbol(e);break;case"simple-fill":t=_.fromSimpleFillSymbol(e);break;case"picture-fill":t=_.fromPictureFillSymbol(e);break;case"text":t=_.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function B(e,t,r){switch(t.type){case"CIMSymbolReference":return B(e,t.symbol,r);case"CIMPointSymbol":null==r&&(r={x:0,y:0}),e.drawSymbol(t,r);break;case"CIMLineSymbol":null==r&&(r={paths:[[[0,0],[10,0]]]}),e.drawSymbol(t,r);break;case"CIMPolygonSymbol":null==r&&(r={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),e.drawSymbol(t,r);break;case"CIMTextSymbol":{const r={x:0,y:0};e.drawSymbol(t,r);break}case"CIMVectorMarker":{const r=new f;e.drawMarker(t,r);break}}return e.envelope()}function X(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset);default:return 0}}function V(e){if(!e)return 0;let t=0;for(const r of e)t+=Y(r);return t}function Y(e){if(!e)return 0;if(S(e))return e.inflateSize??256;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(d(e.offsetX)),Math.abs(d(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}class N{static getSymbolInflateSize(e,t,r,o,a){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,r,o,a):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),r=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+r*r)}static _vectorMarkerBounds(e,t,r,o){let a=!0;const i=s();if(t?.markerGraphics)for(const s of t.markerGraphics){const t=[0,0,0,0];s.geometry&&(n(i,s.geometry),t[0]=0,t[1]=0,t[2]=0,t[3]=0,this.getSymbolInflateSize(t,s.symbol,r,0,o),i[0]+=t[0],i[1]+=t[1],i[2]+=t[2],i[3]+=t[3],a?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],a=!1):(e[0]=Math.min(e[0],i[0]),e[1]=Math.min(e[1],i[1]),e[2]=Math.max(e[2],i[2]),e[3]=Math.max(e[3],i[3])))}return e}static _getInflateSize(e,t,r,o,a){if(ee(t)){const s=this._getLayersInflateSize(e,t.symbolLayers,r,o,a),i=V(t.effects);return i>0&&(s[0]-=i,s[1]-=i,s[2]+=i,s[3]+=i),s}return this._getTextInflatedSize(e,t,a)}static _getLayersInflateSize(e,t,r,o,a){let n=!0;if(!t)return e;for(const l of t){if(!l)continue;let t=[0,0,0,0];switch(l.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=l;let r=e.width;null!=r&&("Square"===e.capStyle||"Miter"===e.joinStyle?r/=E:r/=2,t[0]=-r,t[1]=-r,t[2]=r,t[3]=r);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const e=l;if("CIMVectorMarker"===l.type){const e=l;if(t=this._vectorMarkerBounds(t,e,r,a),e.frame){const r=(e.frame.xmin+e.frame.xmax)/2,o=(e.frame.ymin+e.frame.ymax)/2;if(t[0]-=r,t[1]-=o,t[2]-=r,t[3]-=o,null!=e.size){const r=e.size/(e.frame.ymax-e.frame.ymin);t[0]*=r,t[1]*=r,t[2]*=r,t[3]*=r}}}else if("CIMPictureMarker"===l.type){const o=l,a=r.getResource(o.url);let s=1;if(null!=a&&a.height&&(s=a.width/a.height),null!=e.size){const r=e.size/2,a=e.size*s*o.scaleX/2;t=[-a,-r,a,r]}}else if(null!=e.size){const r=e.size/2;t=[-r,-r,r,r]}if(e.anchorPoint){let r,o;"Absolute"===e.anchorPointUnits?(r=e.anchorPoint.x,o=e.anchorPoint.y):(r=e.anchorPoint.x*(t[2]-t[0]),o=e.anchorPoint.y*(t[3]-t[1]));const a=1.25*Math.sqrt(r*r+o*o);t[0]-=a,t[1]-=a,t[2]+=a,t[3]+=a}let n=d(e.rotation);if(e.rotateClockwise&&(n=-n),o&&(n-=o),n){const e=G*n,r=Math.cos(e),o=Math.sin(e),a=s([x,x,-x,-x]);i(a,[t[0]*r-t[1]*o,t[0]*o+t[1]*r]),i(a,[t[0]*r-t[3]*o,t[0]*o+t[3]*r]),i(a,[t[2]*r-t[1]*o,t[2]*o+t[1]*r]),i(a,[t[2]*r-t[3]*o,t[2]*o+t[3]*r]),t=a}let c=d(e.offsetX),m=d(e.offsetY);if(o){const e=G*o,t=Math.cos(e),r=Math.sin(e),a=c*r+m*t;c=c*t-m*r,m=a}t[0]+=c,t[1]+=m,t[2]+=c,t[3]+=m;const f=X(e.markerPlacement);f>0&&(t[0]-=f,t[1]-=f,t[2]+=f,t[3]+=f);break}}const c=V(l.effects);c>0&&(t[0]-=c,t[1]-=c,t[2]+=c,t[3]+=c),n?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],n=!1):(e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3]))}return e}static _getTextInflatedSize(e,t,r){const o=L(t.height??p.CIMTextSymbol.height);if(e[0]=-o/2,e[1]=-o/2,e[2]=o/2,e[3]=o/2,!r)return e;const a=r.get(t);if(!a)return e;if(!a.glyphMosaicItems.glyphs.length)return e;const{lineGapType:s,lineGap:i}=t,n=s?u(s,i??0,o):0,l="CIMBackgroundCallout"===t.callout?.type,c=P(a.glyphMosaicItems,{scale:o/k,angle:d(t.angle),xOffset:d(t.offsetX),yOffset:d(t.offsetY),horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:F(t.lineWidth),lineHeight:I*Math.max(.25,Math.min(n||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}).boundsT,m=Math.sqrt(c.width*c.width+c.height*c.height);return e[0]-=c.x+m,e[1]-=c.y-m,e[2]+=c.x+m,e[3]+=-c.y+m,e}}class _{static getEnvelope(e,t,r){if(!e)return null;const o=new y(r);if(Array.isArray(e)){let r;for(const a of e)r?r.union(B(o,a,t)):r=B(o,a,t);return r}return B(o,e,t)}static getTextureInfo(e,t,r,o,a){const s=o??this.getEnvelope(e,null,t);if(!s)return[0,0,0,0,1];const i=Math.max(s.width,s.height)*T;let n=null!=a?Math.max(a/i,1):1;n*=T,s.x*=n,s.y*=n,s.width*=n,s.height*=n,s.width=Math.max(Math.ceil(s.x+s.width)-Math.floor(s.x),1)-1,s.height=Math.max(Math.ceil(s.y+s.height)-Math.floor(s.y),1)-1;let l=s.x+.5*s.width,c=s.y+.5*s.height;return l+=s.x-Math.floor(s.x),c+=s.y-Math.floor(s.y),o||(s.width+=r,s.height+=r,l+=r/2,c+=r/2),[s.width,s.height,l,c,n]}static getTextureAnchor(e,t,r){const[o,a,s,i,n]=this.getTextureInfo(e,t,v,null,r);return[-s/o,-i/a,a/n*T]}static rasterize(e,t,r,o,a=!0,s){const[i,n,l,c,m]=this.getTextureInfo(t,o,v,r,s);e.width=i,e.height=n;const y=e.getContext("2d",{willReadFrequently:!0}),u=M.createScale(m,-m);u.translate(.5*i-l,.5*n+c);const p=new h(y,o,u);switch(t.type){case"CIMPointSymbol":{const e={type:"point",x:0,y:0};p.drawSymbol(t,e);break}case"CIMVectorMarker":{const e=new f;p.drawMarker(t,e);break}}const S=y.getImageData(0,0,e.width,e.height),d=new Uint8Array(S.data);if(a){let e;for(let t=0;t<d.length;t+=4)e=d[t+3]/255,d[t]=d[t]*e,d[t+1]=d[t+1]*e,d[t+2]=d[t+2]*e}return[d,e.width,e.height,-l/i,-c/n]}static fromTextSymbol(e){const{text:t}=e;return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:_.createCIMTextSymbolfromTextSymbol(e),textString:t}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(e){const{height:t,outline:r,width:o,xoffset:a,xscale:s,yoffset:i,yscale:n}=e,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(r){const e=oe(r);e&&l.push(e)}let m=e.url;"esriPFS"===e.type&&e.imageData&&(m=e.imageData);const f="angle"in e?e.angle??0:0,y=(o??0)*(s||1),h=(t??0)*(n||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:m,height:h,width:y,offsetX:d(a),offsetY:d(i),rotation:d(-f),colorSubstitutions:null}),c}static fromSimpleFillSymbol(e){const{color:r,style:o,outline:s}=e,i=[],n={type:"CIMPolygonSymbol",symbolLayers:i};if(s){const e=oe(s);e&&i.push(e)}if(o&&"solid"!==o&&"none"!==o&&"esriSFSSolid"!==o&&"esriSFSNull"!==o){const e={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:$(r),capStyle:"Butt",joinStyle:"Miter",width:.75}]};let s=0;const n=a(re(o)?8:10);switch(o){case"vertical":case"esriSFSVertical":s=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":s=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":s=45;break;case"cross":case"esriSFSCross":s=0}i.push({type:"CIMHatchFill",lineSymbol:e,offsetX:0,offsetY:0,rotation:s,separation:n}),"cross"===o||"esriSFSCross"===o?i.push({type:"CIMHatchFill",lineSymbol:t(e),offsetX:0,offsetY:0,rotation:90,separation:n}):"diagonal-cross"!==o&&"esriSFSDiagonalCross"!==o||i.push({type:"CIMHatchFill",lineSymbol:t(e),offsetX:0,offsetY:0,rotation:45,separation:n})}else!o||"solid"!==o&&"esriSFSSolid"!==o||i.push({type:"CIMSolidFill",enable:!0,color:$(r)});return n}static fromSimpleLineSymbol(e){const{cap:t,color:r,join:o,marker:a,miterLimit:s,style:i,width:n}=e;let l=null;"solid"!==i&&"none"!==i&&"esriSLSSolid"!==i&&"esriSLSNull"!==i&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:Z(i,t),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const c=[];if(a){let e;switch(a.placement){case"begin-end":e="Both";break;case"begin":e="JustBegin";break;case"end":e="JustEnd";break;default:e="None"}const t=_.fromSimpleMarker(a,n,r).symbolLayers[0];t.markerPlacement={type:"CIMMarkerPlacementAtExtremities",placePerPart:!1,angleToLine:!0,offset:0,extremityPlacement:e,offsetAlongLine:0},c.push(t)}return c.push({type:"CIMSolidStroke",color:"none"!==i&&"esriSLSNull"!==i?$(r):[0,0,0,0],capStyle:H(t),joinStyle:O(o),miterLimit:s,width:n,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:s}=e;let i=e.url;return"esriPMS"===e.type&&e.imageData&&(i=e.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:i,size:r,width:o,offsetX:d(a),offsetY:d(s),rotation:d(-t)}]}}static createCIMTextSymbolfromTextSymbol(t){const{angle:r,color:o,font:a,haloColor:s,haloSize:i,horizontalAlignment:n,kerning:l,lineWidth:c,text:m,verticalAlignment:f,xoffset:y,yoffset:h,backgroundColor:u,borderLineColor:M,borderLineSize:p}=t;let S,b,g,C,x,I;a&&(S=a.family,b=a.style,g=a.weight,C=a.size,x=a.decoration);let k=!1;if(m){k=e(m)[1]}return(u||p)&&(I={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",color:$(u)},{type:"CIMSolidStroke",color:$(M),width:p??0}]},accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null}),{type:"CIMTextSymbol",angle:r,blockProgression:2,depth3D:1,extrapolateBaselines:!0,fontEffects:0,fontEncoding:1,fontFamilyName:S||"Arial",fontStyleName:J(b,g),fontType:0,haloSize:i,height:C,hinting:1,horizontalAlignment:U(n??"center"),kerning:l,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:c,offsetX:d(y),offsetY:d(h),strikethrough:"line-through"===x,underline:"underline"===x,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:$(o)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:$(s)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:k?1:0,verticalAlignment:W(f??"baseline"),verticalGlyphOrientation:0,wordSpacing:100,billboardMode3D:2,callout:I}}static createPictureMarkerRasterizationParam(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:s}=e,i=e.url??e.source?.url??e.source?.imageData;return i?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:i,size:r,width:o,offsetX:d(a),offsetY:d(s),rotation:d(-t)}}:null}static createPictureFillRasterizationParam(e){const{width:t,height:r,xoffset:o,yoffset:a,url:s}=e;return s?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureFill",scaleX:1,textureFilter:"Picture",tintColor:null,url:s,width:t,height:r,offsetX:d(o),offsetY:d(a),rotation:0}}:null}static fromSimpleMarker(e,t,r){const{style:o}=e,a=e.color??r;if("path"===o||"esriSMSPath"===o){const t=[];if("outline"in e&&e.outline){const r=e.outline;t.push({type:"CIMSolidStroke",enable:!0,width:r.width,color:$(r.color),path:e.path})}t.push({type:"CIMSolidFill",enable:!0,color:$(a),path:e.path});const[r,o]=te("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:-d(e.angle),size:d(e.size||6),offsetX:d(e.xoffset),offsetY:d(e.yoffset),scaleSymbolsProportionally:!1,frame:r,markerGraphics:[{type:"CIMMarkerGraphic",geometry:o,symbol:{type:"CIMPolygonSymbol",symbolLayers:t}}]}]}}const s=[];let i,n,l=e.size;if("outline"in e&&e.outline&&"none"!==e.outline.style&&"esriSLSNull"!==e.outline.style){const t=e.outline,r="solid"!==t.style&&"esriSLSSolid"!==t.style;[i,n]=r?te(o,e.size):te(o);const a=t.width??C.width;if(r){const t=a/e.size,r=(i.xmax-i.xmin)*t/2,o=(i.ymax-i.ymin)*t/2;i.xmin-=r,i.xmax+=r,i.ymin-=o,i.ymax+=o,l&&(l+=a)}const c="cross"!==e.style&&"x"!==e.style||"dot"===e?.outline.style||"short-dot"===e?.outline.style?"HalfGap":"FullPattern",m=r?[{type:"CIMGeometricEffectAddControlPoints"},{type:"CIMGeometricEffectDashes",dashTemplate:Z(t.style,null).map(e=>t.width&&t.width>0?e*t.width:e),lineDashEnding:c,controlPointEnding:"FullPattern"}]:void 0;s.push({type:"CIMSolidStroke",capStyle:r?"Round":"Butt",enable:!0,width:a,color:$(t.color),effects:m})}else!t||"line-marker"!==e.type||"cross"!==e.style&&"x"!==e.style?[i,n]=te(o):([i,n]=te(o),s.push({type:"CIMSolidStroke",enable:!0,width:t,color:$(a)}));s.push({type:"CIMSolidFill",enable:!0,color:$(a)});const c={type:"CIMPolygonSymbol",symbolLayers:s};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:d(-e.angle),size:d(l||6*t),offsetX:d(e.xoffset),offsetY:d(e.yoffset),scaleSymbolsProportionally:!1,frame:i,markerGraphics:[{type:"CIMMarkerGraphic",geometry:n,symbol:c}]}]}}static fromCIMHatchFill(e,r){const o=r*(e.separation??p.CIMHatchFill.separation),a=o/2,s=t(e.lineSymbol);s.symbolLayers?.forEach(e=>{switch(e.type){case"CIMSolidStroke":null!=e.width&&(e.width*=r),e.effects?.forEach(e=>{if("CIMGeometricEffectDashes"===e.type){const t=e.dashTemplate;e.dashTemplate=t?.map(e=>e*r)}});break;case"CIMVectorMarker":{null!=e.size&&(e.size*=r);const t=e.markerPlacement;null!=t&&"placementTemplate"in t&&(t.placementTemplate=t.placementTemplate.map(e=>e*r));break}}});let i=this._getLineSymbolPeriod(s)||A;for(;i<A;)i*=2;const n=i/2;return{type:"CIMVectorMarker",frame:{xmin:-n,xmax:n,ymin:-a,ymax:a},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-n,0],[n,0]]]},symbol:s}],size:o}}static fetchResources(e,t,r,o=null){if(!e||!t)return r;switch(e.type){case"CIMMeshSymbol":case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":for(const t of e.effects||[])r.push(c(t))}return q(e,e=>{for(const t of e.effects||[])r.push(c(t));"CIMVectorMarker"===e.type&&e.markerPlacement&&r.push(m(e.markerPlacement)),"url"in e&&e.url&&r.push(t.fetchResource(e.url,{signal:o}))}),r}static fetchFonts(e,t,r){if(e&&t)if("symbolLayers"in e&&e.symbolLayers){for(const o of e.symbolLayers)if("CIMVectorMarker"===o.type&&o.markerGraphics)for(const e of o.markerGraphics)e?.symbol&&_.fetchFonts(e.symbol,t,r)}else if("CIMTextSymbol"===e.type){const{fontFamilyName:o,fontStyleName:a}=e;if(!o||"calcitewebcoreicons"===o.toLowerCase())return;const{style:s,weight:i}=b(a),n=g(e),c=new l({family:o,style:s,weight:i,decoration:n});r.push(t.loadFont(c).catch(()=>{R().error(`Unsupported font ${o} in CIM symbol`)}))}}static _getLineSymbolPeriod(e){if(e){const t=this._getEffectsRepeat(e.effects);if(t)return t;if(e.symbolLayers)for(const r of e.symbolLayers)if(r){const e=this._getEffectsRepeat(r.effects);if(e)return e;switch(r.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const e=this._getPlacementRepeat(r.markerPlacement);if(e)return e}}}}return 0}static _getEffectsRepeat(e){if(e)for(const t of e)if(t)switch(t.type){case"CIMGeometricEffectDashes":{const e=t.dashTemplate;if(e&&e.length){let t=0;for(const r of e)t+=r;return 1&e.length&&(t*=2),t}break}case"CIMGeometricEffectWave":return t.period;default:R().error(`unsupported geometric effect type ${t.type}`)}return 0}static _getPlacementRepeat(e){if(e)switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const t=e.placementTemplate;if(t&&t.length){let e=0;for(const r of t)e+=+r;return 1&t.length&&(e*=2),e}break}}return 0}static fromCIMInsidePolygon(e){const t=e.markerPlacement,r={...e};r.markerPlacement=null,r.anchorPoint=null;const s=Math.abs(t.stepX),i=Math.abs(t.stepY),n=(t.randomness??100)/100;let l,c,m,f;if("Random"===t.gridType){const e=a(w),r=Math.max(Math.floor(e/s),1),y=Math.max(Math.floor(e/i),1);l=r*s/2,c=y*i/2,m=2*c;const h=new o(t.seed),u=n*s/1.5,M=n*i/1.5;f=[];for(let t=0;t<r;t++)for(let e=0;e<y;e++){const r=t*s-l+u*(.5-h.getFloat()),o=e*i-c+M*(.5-h.getFloat());f.push({x:r,y:o}),0===t&&f.push({x:r+2*l,y:o}),0===e&&f.push({x:r,y:o+2*c})}}else!0===t.shiftOddRows?(l=s/2,c=i,m=2*i,f=[{x:-l,y:0},{x:l,y:0},{x:0,y:c},{x:0,y:-c}]):(l=s/2,c=i/2,m=i,f=[{x:-s,y:0},{x:0,y:-i},{x:-s,y:-i},{x:0,y:0},{x:s,y:0},{x:0,y:i},{x:s,y:i},{x:-s,y:i},{x:s,y:-i}]);return{type:"CIMVectorMarker",frame:{xmin:-l,xmax:l,ymin:-c,ymax:c},markerGraphics:f.map(e=>({type:"CIMMarkerGraphic",geometry:e,symbol:{type:"CIMPointSymbol",symbolLayers:[r]}})),size:m}}}function q(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const r=e.symbolLayers;if(!r)return;for(const e of r)if(t(e),"CIMVectorMarker"===e.type){const r=e.markerGraphics;if(!r)continue;for(const e of r)if(e){const r=e.symbol;r&&q(r,t)}}break}}}const H=e=>{if(!e)return"Butt";switch(e){case"butt":return"Butt";case"square":return"Square";case"round":return"Round"}},O=e=>{if(!e)return"Miter";switch(e){case"miter":return"Miter";case"round":return"Round";case"bevel":return"Bevel"}},U=e=>{if(null==e)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},W=e=>{if(null==e)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},$=e=>{if(!e)return[0,0,0,0];const{r:t,g:r,b:o,a}=e;return[t,r,o,255*a]},J=(e,t)=>{const r=K(t),o=Q(e);return r&&o?`${r}-${o}`:`${r}${o}`},K=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},Q=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Z=(e,t)=>{const r=.001,o="butt"===t;switch(e){case"dash":case"esriSLSDash":return o?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return o?[4,3,1,3]:[3,4,r,4];case"dot":case"esriSLSDot":return o?[1,3]:[r,4];case"long-dash":case"esriSLSLongDash":return o?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return o?[8,3,1,3]:[7,4,r,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return o?[8,3,1,3,1,3]:[7,4,r,4,r,4];case"short-dash":case"esriSLSShortDash":return o?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return o?[4,1,1,1]:[3,2,r,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return o?[4,1,1,1,1,1]:[3,2,r,2,r,2];case"short-dot":case"esriSLSShortDot":return o?[1,1]:[r,2];case"solid":case"esriSLSSolid":case"none":return R().error("Unexpected: style does not require rasterization"),[0,0];default:return R().error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function ee(e){return void 0!==e.symbolLayers}const te=(e,t=100)=>{const r=t/2;let o,a;const s=e;if("circle"===s||"esriSMSCircle"===s){const e=.25;let t=Math.acos(1-e/r),s=Math.ceil(z/t/4);0===s&&(s=1),t=D/s,s*=4;const i=[];i.push([r,0]);for(let o=1;o<s;o++)i.push([r*Math.cos(o*t),-r*Math.sin(o*t)]);i.push([r,0]),o={rings:[i]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("cross"===s||"esriSMSCross"===s){const e=0;o={paths:[[[e,r],[e,-r]],[[r,e],[-r,e]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("diamond"===s||"esriSMSDiamond"===s)o={rings:[[[-r,0],[0,r],[r,0],[0,-r],[-r,0]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("square"===s||"esriSMSSquare"===s)o={rings:[[[-r,-r],[-r,r],[r,r],[r,-r],[-r,-r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("x"===s||"esriSMSX"===s)o={paths:[[[r,r],[-r,-r]],[[r,-r],[-r,r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("triangle"===s||"esriSMSTriangle"===s){const e=t*.5773502691896257,r=-e,s=2/3*t,i=s-t;o={rings:[[[r,i],[0,s],[e,i],[r,i]]]},a={xmin:r,ymin:i,xmax:e,ymax:s}}else"arrow"===s&&(o={rings:[[[-50,50],[50,0],[-50,-50],[-33,-20],[-33,20],[-50,50]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r});return[a,o]},re=e=>"vertical"===e||"horizontal"===e||"cross"===e||"esriSFSCross"===e||"esriSFSVertical"===e||"esriSFSHorizontal"===e;function oe(e){if(!e)return null;let t=null;const{cap:r,color:o,join:a,miterLimit:s,style:i,width:n}=e;return"solid"!==i&&"none"!==i&&"esriSLSSolid"!==i&&"esriSLSNull"!==i&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Z(i,r),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:"esriSLSNull"!==i&&"none"!==i?$(o):[0,0,0,0],capStyle:H(r),joinStyle:O(a),miterLimit:s,width:n,effects:t}}export{_ as CIMSymbolHelper,N as CIMSymbolInflatedSizeHelper,H as capTypeToEnum,q as forEachSymbolLayer,V as getEffectsInflateSize,Z as slsDashToTemplateArray,j as symbolToCIM};
|
|
2
|
+
import{bidiText as e}from"../../core/BidiText.js";import{clone as t}from"../../core/lang.js";import r from"../../core/Logger.js";import o from"../../core/RandomLCG.js";import{px2pt as a}from"../../core/screenUtils.js";import{create as s,expandPointInPlace as i}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as n}from"../../geometry/support/boundsUtils.js";import l from"../Font.js";import{loadGeometryOperatorsForEffect as c,loadGeometryOperatorsForPlacement as m}from"./CIMEffects.js";import{Placement as f}from"./CIMPlacements.js";import{EnvDrawHelper as y,CanvasDrawHelper as h,lineGapType2LineHeight as u,Transformation as M}from"./CIMSymbolDrawHelper.js";import{defaultCIMValues as p}from"./defaultCIMValues.js";import{isGeometricLinearEffect as S,getNumericValue as d,fromCIMFontStyle as b,fromCIMFontDecoration as g}from"./utils.js";import{defaultPolylineSymbol2D as C}from"../support/defaults.js";import{cInfinity as x}from"../../views/2d/engine/vectorTiles/GeometryUtils.js";import{magicLabelLineHeight as I,glyphSize as k,randomInsidePolygonTextureSize as w}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as P}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as L,getLineWidth as F}from"../../views/2d/layers/graphics/graphicsUtils.js";const z=Math.PI,D=z/2,G=Math.PI/180,T=96/72,E=1.4142135623730951,v=2,A=4,R=()=>r.getLogger("esri.symbols.cim.CIMSymbolHelper");function j(e){let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":{const r=_.fromSimpleMarker(e);if(!r)throw new Error("InternalError: Cannot convert symbol to CIM");t=r;break}case"picture-marker":t=_.fromPictureMarker(e);break;case"simple-line":t=_.fromSimpleLineSymbol(e);break;case"simple-fill":t=_.fromSimpleFillSymbol(e);break;case"picture-fill":t=_.fromPictureFillSymbol(e);break;case"text":t=_.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function B(e,t,r){switch(t.type){case"CIMSymbolReference":return B(e,t.symbol,r);case"CIMPointSymbol":null==r&&(r={x:0,y:0}),e.drawSymbol(t,r);break;case"CIMLineSymbol":null==r&&(r={paths:[[[0,0],[10,0]]]}),e.drawSymbol(t,r);break;case"CIMPolygonSymbol":null==r&&(r={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),e.drawSymbol(t,r);break;case"CIMTextSymbol":{const r={x:0,y:0};e.drawSymbol(t,r);break}case"CIMVectorMarker":{const r=new f;e.drawMarker(t,r);break}}return e.envelope()}function X(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset);default:return 0}}function V(e){if(!e)return 0;let t=0;for(const r of e)t+=Y(r);return t}function Y(e){if(!e)return 0;if(S(e))return e.inflateSize??256;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(d(e.offsetX)),Math.abs(d(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}class N{static getSymbolInflateSize(e,t,r,o,a){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,r,o,a):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),r=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+r*r)}static _vectorMarkerBounds(e,t,r,o){let a=!0;const i=s();if(t?.markerGraphics)for(const s of t.markerGraphics){const t=[0,0,0,0];s.geometry&&(n(i,s.geometry),t[0]=0,t[1]=0,t[2]=0,t[3]=0,this.getSymbolInflateSize(t,s.symbol,r,0,o),i[0]+=t[0],i[1]+=t[1],i[2]+=t[2],i[3]+=t[3],a?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],a=!1):(e[0]=Math.min(e[0],i[0]),e[1]=Math.min(e[1],i[1]),e[2]=Math.max(e[2],i[2]),e[3]=Math.max(e[3],i[3])))}return e}static _getInflateSize(e,t,r,o,a){if(ee(t)){const s=this._getLayersInflateSize(e,t.symbolLayers,r,o,a),i=V(t.effects);return i>0&&(s[0]-=i,s[1]-=i,s[2]+=i,s[3]+=i),s}return this._getTextInflatedSize(e,t,a)}static _getLayersInflateSize(e,t,r,o,a){let n=!0;if(!t)return e;for(const l of t){if(!l)continue;let t=[0,0,0,0];switch(l.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=l;let r=e.width;null!=r&&("Square"===e.capStyle||"Miter"===e.joinStyle?r/=E:r/=2,t[0]=-r,t[1]=-r,t[2]=r,t[3]=r);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const e=l;if("CIMVectorMarker"===l.type){const e=l;if(t=this._vectorMarkerBounds(t,e,r,a),e.frame){const r=(e.frame.xmin+e.frame.xmax)/2,o=(e.frame.ymin+e.frame.ymax)/2;if(t[0]-=r,t[1]-=o,t[2]-=r,t[3]-=o,null!=e.size){const r=e.size/(e.frame.ymax-e.frame.ymin);t[0]*=r,t[1]*=r,t[2]*=r,t[3]*=r}}}else if("CIMPictureMarker"===l.type){const o=l,a=r.getResource(o.url);let s=1;if(null!=a&&a.height&&(s=a.width/a.height),null!=e.size){const r=e.size/2,a=e.size*s*o.scaleX/2;t=[-a,-r,a,r]}}else if(null!=e.size){const r=e.size/2;t=[-r,-r,r,r]}if(e.anchorPoint){let r,o;"Absolute"===e.anchorPointUnits?(r=e.anchorPoint.x,o=e.anchorPoint.y):(r=e.anchorPoint.x*(t[2]-t[0]),o=e.anchorPoint.y*(t[3]-t[1]));const a=1.25*Math.sqrt(r*r+o*o);t[0]-=a,t[1]-=a,t[2]+=a,t[3]+=a}let n=d(e.rotation);if(e.rotateClockwise&&(n=-n),o&&(n-=o),n){const e=G*n,r=Math.cos(e),o=Math.sin(e),a=s([x,x,-x,-x]);i(a,[t[0]*r-t[1]*o,t[0]*o+t[1]*r]),i(a,[t[0]*r-t[3]*o,t[0]*o+t[3]*r]),i(a,[t[2]*r-t[1]*o,t[2]*o+t[1]*r]),i(a,[t[2]*r-t[3]*o,t[2]*o+t[3]*r]),t=a}let c=d(e.offsetX),m=d(e.offsetY);if(o){const e=G*o,t=Math.cos(e),r=Math.sin(e),a=c*r+m*t;c=c*t-m*r,m=a}t[0]+=c,t[1]+=m,t[2]+=c,t[3]+=m;const f=X(e.markerPlacement);f>0&&(t[0]-=f,t[1]-=f,t[2]+=f,t[3]+=f);break}}const c=V(l.effects);c>0&&(t[0]-=c,t[1]-=c,t[2]+=c,t[3]+=c),n?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],n=!1):(e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3]))}return e}static _getTextInflatedSize(e,t,r){const o=L(t.height??p.CIMTextSymbol.height);if(e[0]=-o/2,e[1]=-o/2,e[2]=o/2,e[3]=o/2,!r)return e;const a=r.get(t);if(!a)return e;if(!a.glyphMosaicItems.glyphs.length)return e;const{lineGapType:s,lineGap:i}=t,n=s?u(s,i??0,o):0,l="CIMBackgroundCallout"===t.callout?.type,c=P(a.glyphMosaicItems,{scale:o/k,angle:d(t.angle),xOffset:d(t.offsetX),yOffset:d(t.offsetY),horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:F(t.lineWidth),lineHeight:I*Math.max(.25,Math.min(n||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}).boundsT,m=Math.sqrt(c.width*c.width+c.height*c.height);return e[0]-=c.x+m,e[1]-=c.y-m,e[2]+=c.x+m,e[3]+=-c.y+m,e}}class _{static getEnvelope(e,t,r){if(!e)return null;const o=new y(r);if(Array.isArray(e)){let r;for(const a of e)r?r.union(B(o,a,t)):r=B(o,a,t);return r}return B(o,e,t)}static getTextureInfo(e,t,r,o,a){const s=o??this.getEnvelope(e,null,t);if(!s)return[0,0,0,0,1];const i=Math.max(s.width,s.height)*T;let n=null!=a?Math.max(a/i,1):1;n*=T,s.x*=n,s.y*=n,s.width*=n,s.height*=n,s.width=Math.max(Math.ceil(s.x+s.width)-Math.floor(s.x),1)-1,s.height=Math.max(Math.ceil(s.y+s.height)-Math.floor(s.y),1)-1;let l=s.x+.5*s.width,c=s.y+.5*s.height;return l+=s.x-Math.floor(s.x),c+=s.y-Math.floor(s.y),o||(s.width+=r,s.height+=r,l+=r/2,c+=r/2),[s.width,s.height,l,c,n]}static getTextureAnchor(e,t,r){const[o,a,s,i,n]=this.getTextureInfo(e,t,v,null,r);return[-s/o,-i/a,a/n*T]}static rasterize(e,t,r,o,a=!0,s){const[i,n,l,c,m]=this.getTextureInfo(t,o,v,r,s);e.width=i,e.height=n;const y=e.getContext("2d",{willReadFrequently:!0}),u=M.createScale(m,-m);u.translate(.5*i-l,.5*n+c);const p=new h(y,o,u);switch(t.type){case"CIMPointSymbol":{const e={type:"point",x:0,y:0};p.drawSymbol(t,e);break}case"CIMVectorMarker":{const e=new f;p.drawMarker(t,e);break}}const S=y.getImageData(0,0,e.width,e.height),d=new Uint8Array(S.data);if(a){let e;for(let t=0;t<d.length;t+=4)e=d[t+3]/255,d[t]=d[t]*e,d[t+1]=d[t+1]*e,d[t+2]=d[t+2]*e}return[d,e.width,e.height,-l/i,-c/n]}static fromTextSymbol(e){const{text:t}=e;return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:_.createCIMTextSymbolfromTextSymbol(e),textString:t}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(e){const{height:t,outline:r,width:o,xoffset:a,xscale:s,yoffset:i,yscale:n}=e,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(r){const e=oe(r);e&&l.push(e)}let m=e.url;"esriPFS"===e.type&&e.imageData&&(m=e.imageData);const f="angle"in e?e.angle??0:0,y=(o??0)*(s||1),h=(t??0)*(n||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:m,height:h,width:y,offsetX:d(a),offsetY:d(i),rotation:d(-f),colorSubstitutions:null}),c}static fromSimpleFillSymbol(e){const{color:r,style:o,outline:s}=e,i=[],n={type:"CIMPolygonSymbol",symbolLayers:i};if(s){const e=oe(s);e&&i.push(e)}if(o&&"solid"!==o&&"none"!==o&&"esriSFSSolid"!==o&&"esriSFSNull"!==o){const e={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:$(r),capStyle:"Butt",joinStyle:"Miter",width:.75}]};let s=0;const n=a(re(o)?8:10);switch(o){case"vertical":case"esriSFSVertical":s=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":s=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":s=45;break;case"cross":case"esriSFSCross":s=0}i.push({type:"CIMHatchFill",lineSymbol:e,offsetX:0,offsetY:0,rotation:s,separation:n}),"cross"===o||"esriSFSCross"===o?i.push({type:"CIMHatchFill",lineSymbol:t(e),offsetX:0,offsetY:0,rotation:90,separation:n}):"diagonal-cross"!==o&&"esriSFSDiagonalCross"!==o||i.push({type:"CIMHatchFill",lineSymbol:t(e),offsetX:0,offsetY:0,rotation:45,separation:n})}else!o||"solid"!==o&&"esriSFSSolid"!==o||i.push({type:"CIMSolidFill",enable:!0,color:$(r)});return n}static fromSimpleLineSymbol(e){const{cap:t,color:r,join:o,marker:a,miterLimit:s,style:i,width:n}=e;let l=null;"solid"!==i&&"none"!==i&&"esriSLSSolid"!==i&&"esriSLSNull"!==i&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:Z(i,t),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const c=[];if(a){let e;switch(a.placement){case"begin-end":e="Both";break;case"begin":e="JustBegin";break;case"end":e="JustEnd";break;default:e="None"}const t=_.fromSimpleMarker(a,n,r).symbolLayers[0];t.markerPlacement={type:"CIMMarkerPlacementAtExtremities",placePerPart:!1,angleToLine:!0,keepUpright:!1,offset:0,extremityPlacement:e,offsetAlongLine:0},c.push(t)}return c.push({type:"CIMSolidStroke",color:"none"!==i&&"esriSLSNull"!==i?$(r):[0,0,0,0],capStyle:U(t),joinStyle:H(o),miterLimit:s,width:n,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:s}=e;let i=e.url;return"esriPMS"===e.type&&e.imageData&&(i=e.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:i,size:r,width:o,offsetX:d(a),offsetY:d(s),rotation:d(-t)}]}}static createCIMTextSymbolfromTextSymbol(t){const{angle:r,color:o,font:a,haloColor:s,haloSize:i,horizontalAlignment:n,kerning:l,lineWidth:c,text:m,verticalAlignment:f,xoffset:y,yoffset:h,backgroundColor:u,borderLineColor:M,borderLineSize:p}=t;let S,b,g,C,x,I;a&&(S=a.family,b=a.style,g=a.weight,C=a.size,x=a.decoration);let k=!1;if(m){k=e(m)[1]}return(u||p)&&(I={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",color:$(u)},{type:"CIMSolidStroke",color:$(M),width:p??0}]},accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null}),{type:"CIMTextSymbol",angle:r,blockProgression:2,depth3D:1,extrapolateBaselines:!0,fontEffects:0,fontEncoding:1,fontFamilyName:S||"Arial",fontStyleName:J(b,g),fontType:0,haloSize:i,height:C,hinting:1,horizontalAlignment:O(n??"center"),kerning:l,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:c,offsetX:d(y),offsetY:d(h),strikethrough:"line-through"===x,underline:"underline"===x,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:$(o)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:$(s)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:k?1:0,verticalAlignment:W(f??"baseline"),verticalGlyphOrientation:0,wordSpacing:100,billboardMode3D:2,callout:I}}static createPictureMarkerRasterizationParam(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:s}=e,i=e.url??e.source?.url??e.source?.imageData;return i?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:i,size:r,width:o,offsetX:d(a),offsetY:d(s),rotation:d(-t)}}:null}static createPictureFillRasterizationParam(e){const{width:t,height:r,xoffset:o,yoffset:a,url:s}=e;return s?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureFill",scaleX:1,textureFilter:"Picture",tintColor:null,url:s,width:t,height:r,offsetX:d(o),offsetY:d(a),rotation:0}}:null}static fromSimpleMarker(e,t,r){const{style:o}=e,a=e.color??r;if("path"===o||"esriSMSPath"===o){const t=[];if("outline"in e&&e.outline){const r=e.outline;t.push({type:"CIMSolidStroke",enable:!0,width:r.width,color:$(r.color),path:e.path})}t.push({type:"CIMSolidFill",enable:!0,color:$(a),path:e.path});const[r,o]=te("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:-d(e.angle),size:d(e.size||6),offsetX:d(e.xoffset),offsetY:d(e.yoffset),scaleSymbolsProportionally:!1,frame:r,markerGraphics:[{type:"CIMMarkerGraphic",geometry:o,symbol:{type:"CIMPolygonSymbol",symbolLayers:t}}]}]}}const s=[];let i,n,l=e.size;if("outline"in e&&e.outline&&"none"!==e.outline.style&&"esriSLSNull"!==e.outline.style){const t=e.outline,r="solid"!==t.style&&"esriSLSSolid"!==t.style;[i,n]=r?te(o,e.size):te(o);const a=t.width??C.width;if(r){const t=a/e.size,r=(i.xmax-i.xmin)*t/2,o=(i.ymax-i.ymin)*t/2;i.xmin-=r,i.xmax+=r,i.ymin-=o,i.ymax+=o,l&&(l+=a)}const c="cross"!==e.style&&"x"!==e.style||"dot"===e?.outline.style||"short-dot"===e?.outline.style?"HalfGap":"FullPattern",m=r?[{type:"CIMGeometricEffectAddControlPoints"},{type:"CIMGeometricEffectDashes",dashTemplate:Z(t.style,null).map(e=>t.width&&t.width>0?e*t.width:e),lineDashEnding:c,controlPointEnding:"FullPattern"}]:void 0;s.push({type:"CIMSolidStroke",capStyle:r?"Round":"Butt",enable:!0,width:a,color:$(t.color),effects:m})}else!t||"line-marker"!==e.type||"cross"!==e.style&&"x"!==e.style?[i,n]=te(o):([i,n]=te(o),s.push({type:"CIMSolidStroke",enable:!0,width:t,color:$(a)}));s.push({type:"CIMSolidFill",enable:!0,color:$(a)});const c={type:"CIMPolygonSymbol",symbolLayers:s};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:d(-e.angle),size:d(l||6*t),offsetX:d(e.xoffset),offsetY:d(e.yoffset),scaleSymbolsProportionally:!1,frame:i,markerGraphics:[{type:"CIMMarkerGraphic",geometry:n,symbol:c}]}]}}static fromCIMHatchFill(e,r){const o=r*(e.separation??p.CIMHatchFill.separation),a=o/2,s=t(e.lineSymbol);s.symbolLayers?.forEach(e=>{switch(e.type){case"CIMSolidStroke":null!=e.width&&(e.width*=r),e.effects?.forEach(e=>{if("CIMGeometricEffectDashes"===e.type){const t=e.dashTemplate;e.dashTemplate=t?.map(e=>e*r)}});break;case"CIMVectorMarker":{null!=e.size&&(e.size*=r);const t=e.markerPlacement;null!=t&&"placementTemplate"in t&&(t.placementTemplate=t.placementTemplate.map(e=>e*r));break}}});let i=this._getLineSymbolPeriod(s)||A;for(;i<A;)i*=2;const n=i/2;return{type:"CIMVectorMarker",frame:{xmin:-n,xmax:n,ymin:-a,ymax:a},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-n,0],[n,0]]]},symbol:s}],size:o}}static fetchResources(e,t,r,o=null){if(!e||!t)return r;switch(e.type){case"CIMMeshSymbol":case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":for(const t of e.effects||[])r.push(c(t))}return q(e,e=>{for(const t of e.effects||[])r.push(c(t));"CIMVectorMarker"===e.type&&e.markerPlacement&&r.push(m(e.markerPlacement)),"url"in e&&e.url&&r.push(t.fetchResource(e.url,{signal:o}))}),r}static fetchFonts(e,t,r){if(e&&t)if("symbolLayers"in e&&e.symbolLayers){for(const o of e.symbolLayers)if("CIMVectorMarker"===o.type&&o.markerGraphics)for(const e of o.markerGraphics)e?.symbol&&_.fetchFonts(e.symbol,t,r)}else if("CIMTextSymbol"===e.type){const{fontFamilyName:o,fontStyleName:a}=e;if(!o||"calcitewebcoreicons"===o.toLowerCase())return;const{style:s,weight:i}=b(a),n=g(e),c=new l({family:o,style:s,weight:i,decoration:n});r.push(t.loadFont(c).catch(()=>{R().error(`Unsupported font ${o} in CIM symbol`)}))}}static _getLineSymbolPeriod(e){if(e){const t=this._getEffectsRepeat(e.effects);if(t)return t;if(e.symbolLayers)for(const r of e.symbolLayers)if(r){const e=this._getEffectsRepeat(r.effects);if(e)return e;switch(r.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const e=this._getPlacementRepeat(r.markerPlacement);if(e)return e}}}}return 0}static _getEffectsRepeat(e){if(e)for(const t of e)if(t)switch(t.type){case"CIMGeometricEffectDashes":{const e=t.dashTemplate;if(e&&e.length){let t=0;for(const r of e)t+=r;return 1&e.length&&(t*=2),t}break}case"CIMGeometricEffectWave":return t.period;default:R().error(`unsupported geometric effect type ${t.type}`)}return 0}static _getPlacementRepeat(e){if(e)switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const t=e.placementTemplate;if(t&&t.length){let e=0;for(const r of t)e+=+r;return 1&t.length&&(e*=2),e}break}}return 0}static fromCIMInsidePolygon(e){const t=e.markerPlacement,r={...e};r.markerPlacement=null,r.anchorPoint=null;const s=Math.abs(t.stepX),i=Math.abs(t.stepY),n=(t.randomness??100)/100;let l,c,m,f;if("Random"===t.gridType){const e=a(w),r=Math.max(Math.floor(e/s),1),y=Math.max(Math.floor(e/i),1);l=r*s/2,c=y*i/2,m=2*c;const h=new o(t.seed),u=n*s/1.5,M=n*i/1.5;f=[];for(let t=0;t<r;t++)for(let e=0;e<y;e++){const r=t*s-l+u*(.5-h.getFloat()),o=e*i-c+M*(.5-h.getFloat());f.push({x:r,y:o}),0===t&&f.push({x:r+2*l,y:o}),0===e&&f.push({x:r,y:o+2*c})}}else!0===t.shiftOddRows?(l=s/2,c=i,m=2*i,f=[{x:-l,y:0},{x:l,y:0},{x:0,y:c},{x:0,y:-c}]):(l=s/2,c=i/2,m=i,f=[{x:-s,y:0},{x:0,y:-i},{x:-s,y:-i},{x:0,y:0},{x:s,y:0},{x:0,y:i},{x:s,y:i},{x:-s,y:i},{x:s,y:-i}]);return{type:"CIMVectorMarker",frame:{xmin:-l,xmax:l,ymin:-c,ymax:c},markerGraphics:f.map(e=>({type:"CIMMarkerGraphic",geometry:e,symbol:{type:"CIMPointSymbol",symbolLayers:[r]}})),size:m}}}function q(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const r=e.symbolLayers;if(!r)return;for(const e of r)if(t(e),"CIMVectorMarker"===e.type){const r=e.markerGraphics;if(!r)continue;for(const e of r)if(e){const r=e.symbol;r&&q(r,t)}}break}}}const U=e=>{if(!e)return"Butt";switch(e){case"butt":return"Butt";case"square":return"Square";case"round":return"Round"}},H=e=>{if(!e)return"Miter";switch(e){case"miter":return"Miter";case"round":return"Round";case"bevel":return"Bevel"}},O=e=>{if(null==e)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},W=e=>{if(null==e)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},$=e=>{if(!e)return[0,0,0,0];const{r:t,g:r,b:o,a}=e;return[t,r,o,255*a]},J=(e,t)=>{const r=K(t),o=Q(e);return r&&o?`${r}-${o}`:`${r}${o}`},K=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},Q=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Z=(e,t)=>{const r=.001,o="butt"===t;switch(e){case"dash":case"esriSLSDash":return o?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return o?[4,3,1,3]:[3,4,r,4];case"dot":case"esriSLSDot":return o?[1,3]:[r,4];case"long-dash":case"esriSLSLongDash":return o?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return o?[8,3,1,3]:[7,4,r,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return o?[8,3,1,3,1,3]:[7,4,r,4,r,4];case"short-dash":case"esriSLSShortDash":return o?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return o?[4,1,1,1]:[3,2,r,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return o?[4,1,1,1,1,1]:[3,2,r,2,r,2];case"short-dot":case"esriSLSShortDot":return o?[1,1]:[r,2];case"solid":case"esriSLSSolid":case"none":return R().error("Unexpected: style does not require rasterization"),[0,0];default:return R().error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function ee(e){return void 0!==e.symbolLayers}const te=(e,t=100)=>{const r=t/2;let o,a;const s=e;if("circle"===s||"esriSMSCircle"===s){const e=.25;let t=Math.acos(1-e/r),s=Math.ceil(z/t/4);0===s&&(s=1),t=D/s,s*=4;const i=[];i.push([r,0]);for(let o=1;o<s;o++)i.push([r*Math.cos(o*t),-r*Math.sin(o*t)]);i.push([r,0]),o={rings:[i]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("cross"===s||"esriSMSCross"===s){const e=0;o={paths:[[[e,r],[e,-r]],[[r,e],[-r,e]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("diamond"===s||"esriSMSDiamond"===s)o={rings:[[[-r,0],[0,r],[r,0],[0,-r],[-r,0]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("square"===s||"esriSMSSquare"===s)o={rings:[[[-r,-r],[-r,r],[r,r],[r,-r],[-r,-r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("x"===s||"esriSMSX"===s)o={paths:[[[r,r],[-r,-r]],[[r,-r],[-r,r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("triangle"===s||"esriSMSTriangle"===s){const e=t*.5773502691896257,r=-e,s=2/3*t,i=s-t;o={rings:[[[r,i],[0,s],[e,i],[r,i]]]},a={xmin:r,ymin:i,xmax:e,ymax:s}}else"arrow"===s&&(o={rings:[[[-50,50],[50,0],[-50,-50],[-33,-20],[-33,20],[-50,50]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r});return[a,o]},re=e=>"vertical"===e||"horizontal"===e||"cross"===e||"esriSFSCross"===e||"esriSFSVertical"===e||"esriSFSHorizontal"===e;function oe(e){if(!e)return null;let t=null;const{cap:r,color:o,join:a,miterLimit:s,style:i,width:n}=e;return"solid"!==i&&"none"!==i&&"esriSLSSolid"!==i&&"esriSLSNull"!==i&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Z(i,r),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:"esriSLSNull"!==i&&"none"!==i?$(o):[0,0,0,0],capStyle:U(r),joinStyle:H(a),miterLimit:s,width:n,effects:t}}export{_ as CIMSymbolHelper,N as CIMSymbolInflatedSizeHelper,U as capTypeToEnum,q as forEachSymbolLayer,V as getEffectsInflateSize,Z as slsDashToTemplateArray,j as symbolToCIM};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as e,DashPattern as s,Pos as i}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s){return new a(t,e,s)}}class a extends t{constructor(t,i,n){super(t),this._geometryWalker=new e,this._geometryWalker.updateTolerance(n),this._angleToLine=i.angleToLine??!0,this._offset=(i.offset?i.offset:0)*n,this._originalEndings=i.endings,this._offsetAtEnd=(i.customEndingOffset?i.customEndingOffset:0)*n,this._position=-(i.offsetAlongLine?i.offsetAlongLine:0)*n,this._pattern=new s,this._pattern.init(i.placementTemplate,!1),this._pattern.scale(n),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{"WithFullGap"===this._originalEndings&&this.isClosed?this._endings="WithMarkers":this._endings=this._originalEndings,this._pattern.extPtGap=0;let s,i=!0;switch(this._endings){case"NoConstraint":s=-this._position,s=this._adjustPosition(s),i=!1;break;case"WithHalfGap":default:s=-this._pattern.lastValue()/2;break;case"WithFullGap":s=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case"WithMarkers":s=0;break;case"Custom":s=-this._position,s=this._adjustPosition(s),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,i))return null;this._pattern.reset();let n=0;for(;s>n;)s-=n,n=this._pattern.nextValue();n-=s,e=n,this.iteratePath=!0}const s=new i;return this._geometryWalker.nextPointAndAngle(e,s)?"WithFullGap"===this._endings&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):"WithMarkers"===this._endings&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}}export{n as PlacementAlongLineSameSize};
|
|
2
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as e,DashPattern as s,Pos as i}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s){return new a(t,e,s)}}class a extends t{constructor(t,i,n){super(t),this._geometryWalker=new e,this._geometryWalker.updateTolerance(n),this._angleToLine=i.angleToLine??!0,this._keepUpright=i.keepUpright??!1,this._offset=(i.offset?i.offset:0)*n,this._originalEndings=i.endings,this._offsetAtEnd=(i.customEndingOffset?i.customEndingOffset:0)*n,this._position=-(i.offsetAlongLine?i.offsetAlongLine:0)*n,this._pattern=new s,this._pattern.init(i.placementTemplate,!1),this._pattern.scale(n),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{"WithFullGap"===this._originalEndings&&this.isClosed?this._endings="WithMarkers":this._endings=this._originalEndings,this._pattern.extPtGap=0;let s,i=!0;switch(this._endings){case"NoConstraint":s=-this._position,s=this._adjustPosition(s),i=!1;break;case"WithHalfGap":default:s=-this._pattern.lastValue()/2;break;case"WithFullGap":s=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case"WithMarkers":s=0;break;case"Custom":s=-this._position,s=this._adjustPosition(s),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,i))return null;this._pattern.reset();let n=0;for(;s>n;)s-=n,n=this._pattern.nextValue();n-=s,e=n,this.iteratePath=!0}const s=new i;return this._geometryWalker.nextPointAndAngle(e,s)?"WithFullGap"===this._endings&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):"WithMarkers"===this._endings&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}}export{n as PlacementAlongLineSameSize};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,e,s){return new i(t,e,s)}}class i extends t{constructor(t,s,i){super(t,!1,!0),this._curveHelper=new e,this._placePerPart=s.placePerPart??!1,this._angleToLine=void 0===s.angleToLine||s.angleToLine,this._offset=void 0!==s.offset?s.offset*i:0,this._type=s.extremityPlacement,this._position=void 0!==s.offsetAlongLine?s.offsetAlongLine*i:0,this._beginProcessed=!1}processMultiPath(t){return this._placePerPart?super.processMultiPath(t):this.processPath(t)}processPath(t){let e;switch(this._type){case"Both":default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case"JustBegin":e=this._atExtremities(t,this._position,!0);break;case"JustEnd":e=this._atExtremities(t,this._position,!1);case"None":}return e}_atExtremities(t,e,s){if(this._placePerPart||(s?t.seekPath(0):t.seekPath(t.totalSize-1)),s||t.seekPathEnd(),s?t.nextPoint():t.prevPoint()){let i=0,[n
|
|
2
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,e,s){return new i(t,e,s)}}class i extends t{constructor(t,s,i){super(t,!1,!0),this._curveHelper=new e,this._placePerPart=s.placePerPart??!1,this._angleToLine=void 0===s.angleToLine||s.angleToLine,this._keepUpright=s.keepUpright??!1,this._offset=void 0!==s.offset?s.offset*i:0,this._type=s.extremityPlacement,this._position=void 0!==s.offsetAlongLine?s.offsetAlongLine*i:0,this._beginProcessed=!1}processMultiPath(t){return this._placePerPart?super.processMultiPath(t):this.processPath(t)}processPath(t){let e;switch(this._type){case"Both":default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case"JustBegin":e=this._atExtremities(t,this._position,!0);break;case"JustEnd":e=this._atExtremities(t,this._position,!1);case"None":}return e}_atExtremities(t,e,s){if(this._placePerPart||(s?t.seekPath(0):t.seekPath(t.totalSize-1)),s||t.seekPathEnd(),s?t.nextPoint():t.prevPoint()){let i=0,[r,n]=[0,0],[a,o]=[t.x,t.y];const h=[0,0];for(;s?t.nextPoint():t.prevPoint();){r=a,n=o,a=t.x,o=t.y;const s=this._curveHelper.getLength(r,n,a,o);if(i+s>e){const t=(e-i)/s,[l,c]=this._curveHelper.getAngleCS(h,r,n,a,o,t),p=this._curveHelper.getCoord2D(r,n,a,o,t);return this.internalPlacement.setTranslate(p[0]-this._offset*c,p[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(-l,-c),this.internalPlacement}i+=s}}return null}}export{s as PlacementAtExtremities};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{lazyJsonConversion as s}from"../CIMEffects.js";import{GeometryWalker as i}from"../GeometryWalker.js";const e=2,h=.001;class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,s,i){return new a(t,s,i)}}class a extends t{constructor(t,s,e){super(t),this._segmentIterator=null,this._segCount=0,this._firstSeg=!0,this._seg=null,this._ms=[],this._from=0,this._to=0,this._pt=null,this._walker=new i,this._walker.updateTolerance(e),this._placePerPart=s.placePerPart??!1,this._angleToLine=s.angleToLine??!1,this._offset=(s.offset??0)*e,this._interval=(s.interval??0)*e,this._interval<=0&&(this._interval=10*h),this._skipRate=s.skipMarkerRate??0,this._skipRate<=1&&(this._skipRate=0),this._placeAtExtremities=s.placeAtExtremities??!1}processPath(t){if(!this.iteratePath){const{fromGeometry:i}=s.module,e=i(t.getCurrentPath().asJSON()).getGeometry(),h=e.getPathStart(0);this._segmentIterator=e.querySegmentIteratorAtVertex(h),this._segCount=e.getSegmentCountPath(0),this._firstSeg=!0,this.iteratePath=!0,this._pt=e.getXY(0).clone()}for(;0===this._ms.length&&this._segmentIterator?.hasNextSegment();){--this._segCount,this._seg=this._segmentIterator.nextSegment(),this._from=this._seg.getStartAttributeAsDbl(e,0),this._to=this._seg.getEndAttributeAsDbl(e,0);const s=!isNaN(this._from),i=!isNaN(this._to);s&&(this._from=Math.round(this._from/h)*h,Math.abs(this._from)<h&&(this._from=0)),i&&(this._to=Math.round(this._to/h)*h,Math.abs(this._to)<h&&(this._to=0));let r=s?Math.floor(this._from/this._interval):0,a=i?Math.floor(this._to/this._interval):0;if(s&&(this._placeAtExtremities||!this._firstSeg||!this._placePerPart&&t.pathIndex>0)&&Math.abs(r*this._interval-this._from)<h&&(!this._skipRate||r%this._skipRate)&&this._ms.push(this._from),this._firstSeg=!1,s&&i&&!(Math.abs(this._from-this._to)<h))if(this._from<=this._to){r*this._interval<this._from+h&&++r,a*this._interval>this._to-h&&--a;for(let t=r;t<=a;++t)(!this._skipRate||t%this._skipRate)&&this._ms.push(t*this._interval)}else{r*this._interval>this._from-h&&--r,a*this._interval<this._to+h&&++a;for(let t=a;t<=r;++t)(!this._skipRate||t%this._skipRate)&&this._ms.push(t*this._interval)}}let i=0;if(0===this._ms.length){if(this.iteratePath=!1,!this._segCount&&this._placeAtExtremities&&!isNaN(this._to)&&(this._placePerPart||t.pathIndex===t.totalSize-1)){const t=Math.floor(this._to/this._interval);Math.abs(t*this._interval-this._to)<h&&(!this._skipRate||t%this._skipRate)&&(this._ms.push(this._to),i=1)}if(0===this._ms.length)return null}const r=this._ms.pop(),a=isNaN(this._from)||isNaN(this._to)||Math.abs(this._from-this._to)<h?i:(r-this._from)/(this._to-this._from);this._seg.queryCoord2D(a,this._pt);const _=this._seg.getTangent(a),{x:o,y:n}=_.normalize();return this.internalPlacement.setTranslate(this._pt.x-this._offset*n,this._pt.y+this._offset*o),this._angleToLine&&this.internalPlacement.setRotateCS(o,n),this.internalPlacement.setMeasure(r),this.internalPlacement}}export{r as PlacementAtMeasuredUnits};
|
|
2
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{lazyJsonConversion as s}from"../CIMEffects.js";import{GeometryWalker as i}from"../GeometryWalker.js";const e=2,h=.001;class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,s,i){return new a(t,s,i)}}class a extends t{constructor(t,s,e){super(t),this._segmentIterator=null,this._segCount=0,this._firstSeg=!0,this._seg=null,this._ms=[],this._from=0,this._to=0,this._pt=null,this._walker=new i,this._walker.updateTolerance(e),this._placePerPart=s.placePerPart??!1,this._angleToLine=s.angleToLine??!1,this._keepUpright=s.keepUpright??!1,this._offset=(s.offset??0)*e,this._interval=(s.interval??0)*e,this._interval<=0&&(this._interval=10*h),this._skipRate=s.skipMarkerRate??0,this._skipRate<=1&&(this._skipRate=0),this._placeAtExtremities=s.placeAtExtremities??!1}processPath(t){if(!this.iteratePath){const{fromGeometry:i}=s.module,e=i(t.getCurrentPath().asJSON()).getGeometry(),h=e.getPathStart(0);this._segmentIterator=e.querySegmentIteratorAtVertex(h),this._segCount=e.getSegmentCountPath(0),this._firstSeg=!0,this.iteratePath=!0,this._pt=e.getXY(0).clone()}for(;0===this._ms.length&&this._segmentIterator?.hasNextSegment();){--this._segCount,this._seg=this._segmentIterator.nextSegment(),this._from=this._seg.getStartAttributeAsDbl(e,0),this._to=this._seg.getEndAttributeAsDbl(e,0);const s=!isNaN(this._from),i=!isNaN(this._to);s&&(this._from=Math.round(this._from/h)*h,Math.abs(this._from)<h&&(this._from=0)),i&&(this._to=Math.round(this._to/h)*h,Math.abs(this._to)<h&&(this._to=0));let r=s?Math.floor(this._from/this._interval):0,a=i?Math.floor(this._to/this._interval):0;if(s&&(this._placeAtExtremities||!this._firstSeg||!this._placePerPart&&t.pathIndex>0)&&Math.abs(r*this._interval-this._from)<h&&(!this._skipRate||r%this._skipRate)&&this._ms.push(this._from),this._firstSeg=!1,s&&i&&!(Math.abs(this._from-this._to)<h))if(this._from<=this._to){r*this._interval<this._from+h&&++r,a*this._interval>this._to-h&&--a;for(let t=r;t<=a;++t)(!this._skipRate||t%this._skipRate)&&this._ms.push(t*this._interval)}else{r*this._interval>this._from-h&&--r,a*this._interval<this._to+h&&++a;for(let t=a;t<=r;++t)(!this._skipRate||t%this._skipRate)&&this._ms.push(t*this._interval)}}let i=0;if(0===this._ms.length){if(this.iteratePath=!1,!this._segCount&&this._placeAtExtremities&&!isNaN(this._to)&&(this._placePerPart||t.pathIndex===t.totalSize-1)){const t=Math.floor(this._to/this._interval);Math.abs(t*this._interval-this._to)<h&&(!this._skipRate||t%this._skipRate)&&(this._ms.push(this._to),i=1)}if(0===this._ms.length)return null}const r=this._ms.pop(),a=isNaN(this._from)||isNaN(this._to)||Math.abs(this._from-this._to)<h?i:(r-this._from)/(this._to-this._from);this._seg.queryCoord2D(a,this._pt);const _=this._seg.getTangent(a),{x:o,y:n}=_.normalize();return this.internalPlacement.setTranslate(this._pt.x-this._offset*n,this._pt.y+this._offset*o),this._angleToLine&&this.internalPlacement.setRotateCS(o,n),this.internalPlacement.setMeasure(r),this.internalPlacement}}export{r as PlacementAtMeasuredUnits};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as s,Pos as e}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,i,s){return new
|
|
2
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as s,Pos as e}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,i,s){return new h(t,i,s)}}class h extends t{constructor(t,e,n){super(t),this._walker=new i,this._walker.updateTolerance(n),this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._keepUpright=e.keepUpright??!1,this._offset=void 0!==e.offset?e.offset*n:0,this._beginGap=void 0!==e.beginPosition?e.beginPosition*n:0,this._endGap=void 0!==e.endPosition?e.endPosition*n:0,this._flipFirst=void 0===e.flipFirst||e.flipFirst,this._pattern=new s,this._pattern.init(e.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let i;if(this.iteratePath){const t=this._pattern.nextValue()*this._subPathLen,s=this._beginGap+t;i=s-this._prevPos,this._prevPos=s}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=t.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const s=this._pattern.nextValue()*this._subPathLen,e=this._beginGap+s;i=e-this._prevPos,this._prevPos=e,this.iteratePath=!0}const s=new e;if(!this._walker.nextPointAndAngle(i,s,1))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const n=this._isFirst&&this._flipFirst;let h,r;return this._angleToLine?(h=s.ca,r=s.sa):(h=1,r=0),n&&(h=-h,r=-r),this.internalPlacement.setRotateCS(h,r),this._isFirst=!1,this._posCount--,0===this._posCount&&(this.iteratePath=!1),this.internalPlacement}}export{n as PlacementAtRatioPositions};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const n=.001;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,n){return new s(t,e,n)}}class s extends t{constructor(t,i,s){super(t),this._curveHelper=new e,this._angleToLine=void 0===i.angleToLine||i.angleToLine,this._offset=void 0!==i.offset?i.offset*s:0,this._relativeTo=i.relativeTo,this._position=void 0!==i.startPointOffset?i.startPointOffset*s:0,this._epsilon=n*s}processPath(t){const e=this._position;if("SegmentMidpoint"===this._relativeTo){if(this.iteratePath||(this.iteratePath=!0),t.nextPoint()){let[e,n]=[t.x,t.y],[i,s]=[0,0];const r=[0,0];for(;t.nextPoint();){i=t.x,s=t.y;const o=this._curveHelper.getLength(e,n,i,s);if(o<this._epsilon){e=i,n=s;continue}const a=.5+this._position/o,[l,h]=this._curveHelper.getAngleCS(r,e,n,i,s,a),c=this._curveHelper.getCoord2D(e,n,i,s,a);return this.internalPlacement.setTranslate(c[0]-this._offset*h,c[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(l,h),this.internalPlacement}}return this.iteratePath=!1,null}const n="LineEnd"===this._relativeTo;return this.onLine(t,e,n)}onLine(t,e,n){let i,s=!1;switch(this._relativeTo){case"LineMiddle":default:t.seekPathStart(),i=t.pathLength()/2+e;break;case"LineBeginning":i=e;break;case"LineEnd":i=e,s=!0}n?t.seekPathEnd():t.seekPathStart();let r=0;if(n?t.prevPoint():t.nextPoint()){let[e,o]=[t.x,t.y],[a,l]=[0,0];const h=[0,0];for(;n?t.prevPoint():t.nextPoint();){a=t.x,l=t.y;const n=this._curveHelper.getLength(e,o,a,l);if(r+n>i){const t=(i-r)/n,[c,f]=this._curveHelper.getAngleCS(h,e,o,a,l,t),
|
|
2
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const n=.001;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,n){return new s(t,e,n)}}class s extends t{constructor(t,i,s){super(t),this._curveHelper=new e,this._angleToLine=void 0===i.angleToLine||i.angleToLine,this._keepUpright=i.keepUpright??!1,this._offset=void 0!==i.offset?i.offset*s:0,this._relativeTo=i.relativeTo,this._position=void 0!==i.startPointOffset?i.startPointOffset*s:0,this._epsilon=n*s}processPath(t){const e=this._position;if("SegmentMidpoint"===this._relativeTo){if(this.iteratePath||(this.iteratePath=!0),t.nextPoint()){let[e,n]=[t.x,t.y],[i,s]=[0,0];const r=[0,0];for(;t.nextPoint();){i=t.x,s=t.y;const o=this._curveHelper.getLength(e,n,i,s);if(o<this._epsilon){e=i,n=s;continue}const a=.5+this._position/o,[l,h]=this._curveHelper.getAngleCS(r,e,n,i,s,a),c=this._curveHelper.getCoord2D(e,n,i,s,a);return this.internalPlacement.setTranslate(c[0]-this._offset*h,c[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(l,h),this.internalPlacement}}return this.iteratePath=!1,null}const n="LineEnd"===this._relativeTo;return this.onLine(t,e,n)}onLine(t,e,n){let i,s=!1;switch(this._relativeTo){case"LineMiddle":default:t.seekPathStart(),i=t.pathLength()/2+e;break;case"LineBeginning":i=e;break;case"LineEnd":i=e,s=!0}n?t.seekPathEnd():t.seekPathStart();let r=0;if(n?t.prevPoint():t.nextPoint()){let[e,o]=[t.x,t.y],[a,l]=[0,0];const h=[0,0];for(;n?t.prevPoint():t.nextPoint();){a=t.x,l=t.y;const n=this._curveHelper.getLength(e,o,a,l);if(r+n>i){const t=(i-r)/n,[c,f]=this._curveHelper.getAngleCS(h,e,o,a,l,t),p=this._curveHelper.getCoord2D(e,o,a,l,t),u=s?-this._offset:this._offset;return this.internalPlacement.setTranslate(p[0]-u*f,p[1]+u*c),this._angleToLine&&(s?this.internalPlacement.setRotateCS(-c,-f):this.internalPlacement.setRotateCS(c,f)),this.internalPlacement}e=a,o=l,r+=n}}return null}}export{i as PlacementOnLine};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const s=1e-15;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,s){return new n(t,e,s)}}class n extends t{constructor(t,s,i){super(t),this._curveHelper=new e,this._angleToLine=void 0===s.angleToLine||s.angleToLine,this._offset=void 0!==s.offset?s.offset*i:0,this._endPoints=void 0===s.placeOnEndPoints||s.placeOnEndPoints,this._controlPoints=void 0===s.placeOnControlPoints||s.placeOnControlPoints,this._regularVertices=void 0===s.placeOnRegularVertices||s.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(t){if(this.iteratePath||(this._preparePath(t),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const e=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(e[2]);let s=e[0],i=e[1];if(0!==this._offset){const t=Math.cos(e[2]),n=Math.sin(e[2]);s-=this._offset*n,i+=this._offset*t}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(t){this._tags.length=0,this._tagIterator=0,t.seekPathStart();const e=t.isClosed();let s=0,i=!1,n=0,
|
|
2
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const s=1e-15;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,s){return new n(t,e,s)}}class n extends t{constructor(t,s,i){super(t),this._curveHelper=new e,this._angleToLine=void 0===s.angleToLine||s.angleToLine,this._keepUpright=s.keepUpright??!1,this._offset=void 0!==s.offset?s.offset*i:0,this._endPoints=void 0===s.placeOnEndPoints||s.placeOnEndPoints,this._controlPoints=void 0===s.placeOnControlPoints||s.placeOnControlPoints,this._regularVertices=void 0===s.placeOnRegularVertices||s.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(t){if(this.iteratePath||(this._preparePath(t),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const e=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(e[2]);let s=e[0],i=e[1];if(0!==this._offset){const t=Math.cos(e[2]),n=Math.sin(e[2]);s-=this._offset*n,i+=this._offset*t}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(t){this._tags.length=0,this._tagIterator=0,t.seekPathStart();const e=t.isClosed();let s=0,i=!1,n=0,r=0;if(t.seekPathStart(),t.nextPoint()){let a=t.x,h=t.y,l=t.getControlPoint(),_=!0,c=t.nextPoint();for(;c;){const g=t.x,p=t.y,P=t.getControlPoint();(this._angleToLine||0!==this._offset)&&(n=this._curveHelper.getAngle(a,h,g,p,0)),_?(_=!1,e?(s=n,i=l):(this._endPoints||this._controlPoints&&l)&&this._tags.push([a,h,n])):l?this._controlPoints&&this._tags.push([a,h,o(r,n)]):this._regularVertices&&this._tags.push([a,h,o(r,n)]),(this._angleToLine||0!==this._offset)&&(r=this._curveHelper.getAngle(a,h,g,p,1)),c=t.nextPoint(),c||(e?P||i?this._controlPoints&&this._tags.push([g,p,o(r,s)]):this._regularVertices&&this._tags.push([g,p,o(r,s)]):(this._endPoints||this._controlPoints&&P)&&this._tags.push([g,p,r])),a=g,h=p,l=P}}this._tagIterator=0}}function o(t,e){const i=Math.PI;for(;Math.abs(e-t)>i+2*s;)e-t>i?e-=2*i:e+=2*i;return(t+e)/2}export{i as PlacementOnVertices};
|
package/symbols/cim/types.d.ts
CHANGED
|
@@ -1471,6 +1471,13 @@ export interface CIMMarkerStrokePlacement extends CIMMarkerPlacementBase {
|
|
|
1471
1471
|
* @since 5.0
|
|
1472
1472
|
*/
|
|
1473
1473
|
angleToLine: boolean;
|
|
1474
|
+
/**
|
|
1475
|
+
* A value indicating whether to keep the marker upright. This is only considered if `angleToLine` is true.
|
|
1476
|
+
*
|
|
1477
|
+
* @default false
|
|
1478
|
+
* @since 5.0
|
|
1479
|
+
*/
|
|
1480
|
+
keepUpright: boolean;
|
|
1474
1481
|
/**
|
|
1475
1482
|
* The offset in points.
|
|
1476
1483
|
*
|