@arcgis/core 5.2.0-next.143 → 5.2.0-next.145
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/analysis/AreaMeasurementAnalysis.d.ts +11 -1
- package/analysis/DirectLineMeasurementAnalysis.d.ts +11 -1
- package/analysis/DistanceMeasurementAnalysis.d.ts +8 -0
- package/arcgisGlobal.d.ts +5 -5
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{1ede8666d804c553803e.js → 0b6941781e35ce0f7274.js} +1 -1
- package/assets/esri/core/workers/chunks/{a0d459bdb91ee892d4b6.js → 116293b1ee788a89ce1e.js} +1 -1
- package/assets/esri/core/workers/chunks/18f20fd43ec9ce03cef1.js +1 -0
- package/assets/esri/core/workers/chunks/{8959a825f5e1ce6f38ac.js → 1c65ab9ed611c322ce27.js} +1 -1
- package/assets/esri/core/workers/chunks/257910cca66dc5df465e.js +1 -0
- package/assets/esri/core/workers/chunks/2e096537a3a5555a4a93.js +1 -0
- package/assets/esri/core/workers/chunks/505227797bcf2a1d908d.js +1 -0
- package/assets/esri/core/workers/chunks/56a24061589f4a968818.js +1 -0
- package/assets/esri/core/workers/chunks/{5b3cfe95314a75a735c1.js → 588e677f33df86a595bf.js} +1 -1
- package/assets/esri/core/workers/chunks/{1c0975c2dd1d0e2710bb.js → 6883a5c6883eccaddf64.js} +1 -1
- package/assets/esri/core/workers/chunks/{f74e32d2ffe81778826b.js → 6c1d5577a17a5c8ccf39.js} +1 -1
- package/assets/esri/core/workers/chunks/6c83398cf586ecea0eb1.js +1 -0
- package/assets/esri/core/workers/chunks/{e521bb9ee2030245c3ce.js → 6f358116f79021ff9687.js} +1 -1
- package/assets/esri/core/workers/chunks/76196c414e48834f7b92.js +1 -0
- package/assets/esri/core/workers/chunks/77ebacfdf8e57f2e03f1.js +1118 -0
- package/assets/esri/core/workers/chunks/794e5a67a88cb10c1a19.js +1 -0
- package/assets/esri/core/workers/chunks/943a0f140813ee4ab04a.js +1 -0
- package/assets/esri/core/workers/chunks/aba42885c5d6b2b5fe7f.js +1 -0
- package/assets/esri/core/workers/chunks/{402a82c77420254831bc.js → b7d77dd2abb255fd2e5a.js} +1 -1
- package/assets/esri/core/workers/chunks/ba48045a81acc4cda927.js +1 -0
- package/assets/esri/core/workers/chunks/d21257d2e2a37266c0f7.js +1 -0
- package/assets/esri/core/workers/chunks/d4f038e04c42aed588c1.js +1 -0
- package/assets/esri/core/workers/chunks/d90a3bfd45b5ed4092e0.js +1 -0
- package/{basemaps/BasemapCollection.d.ts → basemapGallery/BasemapGalleryModel.d.ts} +8 -8
- package/{basemaps/BasemapCollection.js → basemapGallery/BasemapGalleryModel.js} +1 -1
- package/{basemaps → basemapGallery}/BasemapsSource.d.ts +1 -1
- package/{basemaps → basemapGallery}/BasemapsSource.js +1 -1
- package/{basemaps → basemapGallery}/LocalBasemapsSource.d.ts +2 -2
- package/{basemaps → basemapGallery}/LocalBasemapsSource.js +1 -1
- package/{basemaps → basemapGallery}/PortalBasemapsSource.d.ts +2 -2
- package/{basemaps → basemapGallery}/PortalBasemapsSource.js +1 -1
- package/{basemaps → basemapGallery}/support/BasemapItem.d.ts +2 -2
- package/{basemaps → basemapGallery}/support/BasemapItem.js +1 -1
- package/{basemaps → basemapGallery}/types.d.ts +2 -2
- package/config.js +1 -1
- package/kernel.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/transferFeatures.js +1 -1
- package/package.json +2 -2
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +4 -4
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +4 -4
- package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +3 -0
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +2 -1
- package/views/3d/layers/support/FeatureMemory.js +1 -1
- package/views/3d/layers/support/FeatureTile.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/support/PBFDecoder.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadGlobalIllumination.glsl.js +16 -11
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/SceneView.d.ts +4 -10
- package/views/View.d.ts +4 -12
- package/views/interactive/options/SnappingOptions.d.ts +28 -12
- package/views/interactive/options/TooltipOptions.d.ts +8 -1
- package/views/interactive/options/ValueOptions.d.ts +9 -2
- package/views/interactive/options/ViewOptions.d.ts +81 -6
- package/widgets/BasemapGallery/BasemapGalleryViewModel.d.ts +2 -2
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery/support/BasemapGalleryItem.d.ts +3 -3
- package/widgets/BasemapGallery/support/LocalBasemapsSource.d.ts +2 -2
- package/widgets/BasemapGallery/support/PortalBasemapsSource.d.ts +2 -2
- package/widgets/BasemapGallery/types.d.ts +3 -3
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +13 -8
- package/widgets/Editor.d.ts +9 -9
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +13 -8
- package/widgets/Sketch.d.ts +9 -9
- package/assets/esri/core/workers/chunks/1b551ef3d84d9c1e93f9.js +0 -1
- package/assets/esri/core/workers/chunks/260dcb79dfd0f981949f.js +0 -1
- package/assets/esri/core/workers/chunks/303676d1b10676c9cab4.js +0 -1
- package/assets/esri/core/workers/chunks/37a636f61cfe89c6bfd1.js +0 -1
- package/assets/esri/core/workers/chunks/4097edb2ad522dff50ce.js +0 -1
- package/assets/esri/core/workers/chunks/4a0216ee6382d9276f1c.js +0 -1
- package/assets/esri/core/workers/chunks/55766692b578e60dd70e.js +0 -1742
- package/assets/esri/core/workers/chunks/57970d43cdcc5cf57a30.js +0 -1
- package/assets/esri/core/workers/chunks/5fd099ca1024707387b2.js +0 -1
- package/assets/esri/core/workers/chunks/68e24fa3f564c2a5c9fd.js +0 -1
- package/assets/esri/core/workers/chunks/8e7a33cc1f83063043f2.js +0 -1
- package/assets/esri/core/workers/chunks/a23272a7a47a95f6ddea.js +0 -1
- package/assets/esri/core/workers/chunks/cbdebdfa5f2cded29d0d.js +0 -1
- package/assets/esri/core/workers/chunks/d56780290e0218d3e9de.js +0 -1
- package/assets/esri/core/workers/chunks/de24fc414a3f243d675e.js +0 -1
- package/assets/esri/core/workers/chunks/e22d45aeef293a5ffb78.js +0 -1
- package/assets/esri/core/workers/chunks/ea746d9bbea170719a1c.js +0 -1
- package/assets/esri/core/workers/chunks/f0c0c02730fe0d948fc1.js +0 -1
- /package/{basemaps → basemapGallery}/support/basemapCompatibilityUtils.js +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../config.js";import n from"../../../request.js";import{isSome as r,remove as i}from"../../../core/arrayUtils.js";import a from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as o}from"../../../core/jsonMap.js";import{Loadable as s}from"../../../core/Loadable.js";import c from"../../../core/Logger.js";import{setDeepValue as l}from"../../../core/object.js";import{debounce as u,after as d,throwIfAbortError as f}from"../../../core/promiseUtils.js";import{watch as p}from"../../../core/reactiveUtils.js";import{join as m}from"../../../core/urlUtils.js";import{generateBracedUUID as h}from"../../../core/uuid.js";import{property as g,subclass as _}from"../../../core/accessorSupport/decorators.js";import v from"../../../geometry/Extent.js";import y from"../../../geometry/SpatialReference.js";import b from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as S}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as C,getFeatureJSON as w,getFeatureIds as T,getAttachmentEditsJSON as E,isProtectedOrPrivateVersionError as D,unpackEditResultData as O,createEditedFeatures as k}from"../applyEditsUtils.js";import{createDrawingInfo as A}from"./support/clientSideDefaults.js";import j from"./support/QueryTask.js";import{isHostedAgolService as M}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as N}from"../../support/featureLayerUtils.js";import{getAssetMapTable as P}from"../../support/infoFor3D.js";import{executeQueryJSON as F}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as I}from"../../../rest/query/operations/editsZScale.js";import L from"../../../rest/support/Query.js";import R from"../../../time/TimeExtent.js";import{isSafeToEditVersion as z,isVersionInEditSession as B,isHistoricVersion as V,currentSessionId as H}from"../../../versionManagement/support/versionManagementUtils.js";const U=new o({originalAndCurrentFeatures:`original-and-current-features`,none:`none`}),W=new o({Started:`published`,Publishing:`publishing`,Stopped:`unavailable`});let G=class extends s{constructor(e){super(e),this.type=`feature-layer`,this.supportedSourceTypes=new Set([`Feature Layer`,`Oriented Imagery Layer`,`Table`,`Catalog Layer`,`Annotation Layer`,`Dimension Layer`]),this.refresh=u(async()=>{await this.load();let e=this.sourceJSON.editingInfo?.lastEditDate;if(e==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}let t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){let t=this.layer.sourceJSON,n=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(n),Promise.resolve(this)}async reload(e){let t=this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0;await this._fetchService(null,{...e,cacheBust:t})}initialize(){this.addHandles([p(()=>{let e=this.layer;return e&&`lastEditsEventDate`in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){let{capabilities:e,parsedUrl:t,gdbVersion:n,spatialReference:r,fieldsIndex:i,uniqueIdFields:a}=this.layer,o=`infoFor3D`in this.layer?this.layer.infoFor3D:null,s=`dynamicDataSource`in this.layer?this.layer.dynamicDataSource:null,c=has(`featurelayer-pbf`)&&e?.query.supportsFormatPBF&&o==null,l=c&&e?.query.supportsFormatPBFWithCurves,u=e?.operations?.supportsQueryAttachments??!1,d=e?.query?.relativeTimeBinWindow??0,f=t.path;return new j({dynamicDataSource:s,fieldsIndex:i,gdbVersion:n,infoFor3D:o,pbfSupported:c,pbfSupportedWithCurves:l,queryAttachmentsSupported:u,relativeTimeBinWindow:d,sourceSpatialReference:r,uniqueIdFields:a,url:f})}async addAttachment(e,t,r){await this.load();let{layer:i}=this;await N(i,`editing`);let a=e.attributes[i.objectIdField],o=i.parsedUrl.path+`/`+a+`/addAttachment`,s=this._getLayerRequestOptions({query:r}),c=this._getFormDataForAttachment(t,s.query);try{let e=await n(o,{body:c});return C(e.data.addAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(a,e)}}async updateAttachment(e,t,r,i){await this.load();let{layer:a}=this;await N(a,`editing`);let o=e.attributes[a.objectIdField],s=a.parsedUrl.path+`/`+o+`/updateAttachment`,c=this._getLayerRequestOptions({query:{attachmentId:t,...i}}),l=this._getFormDataForAttachment(r,c.query);try{let e=await n(s,{body:l});return C(e.data.updateAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(o,e)}}async applyEdits(e,t){await this.load();let{layer:i}=this;await N(i,`editing`);let o=`infoFor3D`in i?i.infoFor3D:null,s=o!=null,c=s||(t?.globalIdUsed??!1),l=s?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,u=e.addFeatures?.map(e=>w(this.layer,e,o))??[],d=(await Promise.all(u)).filter(r),f=e.updateFeatures?.map(e=>w(this.layer,e,o))??[],p=(await Promise.all(f)).filter(r),m=T(this.layer,e.deleteFeatures,c);I(d,p,i.spatialReference);let h=await E(this.layer,e),g=i.capabilities.editing.supportsAsyncApplyEdits&&s,_=t?.gdbVersion||i.gdbVersion,v={gdbVersion:_,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:c,returnEditMoment:t?.returnEditMoment,trueCurveClient:t?.editsRespectTrueCurves,usePreviousEditMoment:t?.usePreviousEditMoment,async:g};await z(this.layer.url,_,!0);let y=B(this.layer.url,_||null);if(await V(i.url,_,i.historicMoment))throw new a(`feature-layer-source:historic-version`,`Editing a historic version is not allowed`);t?.returnServiceEditsOption?(v.edits=JSON.stringify([{id:i.layerId,adds:d.length?d:null,updates:p.length?p:null,deletes:m.length?m:null,attachments:h,assetMaps:l}]),v.returnServiceEditsOption=U.toJSON(t?.returnServiceEditsOption),v.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(v.adds=d.length?JSON.stringify(d):null,v.updates=p.length?JSON.stringify(p):null,v.deletes=m.length?c?JSON.stringify(m):m.join(`,`):null,v.attachments=h&&JSON.stringify(h),v.assetMaps=l==null?void 0:JSON.stringify(l));let b=this._getLayerRequestOptions({method:`post`,query:v});y&&(b.authMode=`immediate`,b.query.returnEditMoment=!0,b.query.sessionId=H);let x=t?.returnServiceEditsOption?i.url:i.parsedUrl.path,S;try{S=g?await this._asyncApplyEdits(x+`/applyEdits`,b):await n(x+`/applyEdits`,b)}catch(e){if(D(e))b.authMode=`immediate`,S=g?await this._asyncApplyEdits(x+`/applyEdits`,b):await n(x+`/applyEdits`,b);else throw e}return this._createEditsResult(S)}async deleteAttachments(e,t,r){await this.load();let{layer:i}=this;await N(i,`editing`);let a=e.attributes[i.objectIdField],o=i.parsedUrl.path+`/`+a+`/deleteAttachments`;try{return(await n(o,this._getLayerRequestOptions({query:{attachmentIds:t.join(`,`),...r},method:`post`}))).data.deleteAttachmentResults.map(C)}catch(e){throw this._createAttachmentErrorResult(a,e)}}fetchRecomputedExtents(e={}){let t=e.signal;return this.load({signal:t}).then(async()=>{let t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:r,url:i}=this.layer,{data:a}=await n(`${i}/${r}`,t),{id:o,extent:s,fullExtent:c,timeExtent:l}=a,u=s||c;return{id:o,fullExtent:u&&v.fromJSON(u),timeExtent:l&&R.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();let n=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,n)}async queryFeatures(e,t){await this.load();let n=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&n.features.length){let t=new Map;if(n.features.forEach(n=>{let r=n.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){let n=e.toLowerCase();n&&n in r&&e!==n&&(r[e]=r[n],delete r[n],t.set(n,e))}})}),n.fields!=null)for(let e of n.fields){let n=t.get(e.name.toLowerCase());n!=null&&(e.name=n)}}return n}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryPivot(e,t){return await this.load(),this.queryTask.executePivotQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!M(this.layer.url))return`unavailable`;let e=m(this.layer.url,`status`),t=await n(e,{query:{f:`json`}});return W.fromJSON(t.data.status)}async uploadAssets(e,t){let{uploadAssets:n}=await import(`./support/uploadAssets.js`);return n(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){let t=this.layer;if(e==null||!(`capabilities`in t)||!(`effectiveCapabilities`in t)||t.capabilities?.operations?.supportsEditing||!t.effectiveCapabilities?.operations?.supportsEditing)return;let n=t.url;if(n==null)return;`layerId`in t&&(n=m(n,t.layerId.toString()));let r=this._getOrCreateEditInterceptor(n);r.before=t=>{let n=t.requestOptions.method??`auto`;if(n===`auto`||n===`head`){let n=t.requestOptions.query??{};n._ts=e.getTime(),t.requestOptions.query=n}}}_getOrCreateEditInterceptor(e){return this._editInterceptor??(this._editInterceptor={urls:e},t.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){this._editInterceptor!=null&&(i(t.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){let r=(await n(e,t)).data.statusUrl;for(;;){let e=(await n(r,{query:{f:`json`},responseType:`json`})).data;switch(e.status){case`Completed`:return n(e.resultUrl,{query:{f:`json`},responseType:`json`});case`CompletedWithErrors`:throw new a(`async-applyEdits-failed`,`asynchronous applyEdits call failed.`);case`Failed ImportChanges`:case`InProgress`:case`Pending`:case`ExportAttachments`:case`ExportChanges`:case`ExportingData`:case`ExportingSnapshot`:case`ImportAttachments`:case`ProvisioningReplica`:case`UnRegisteringReplica`:break;default:throw new a(`async-applyEdits-failed`,`asynchronous applyEdits call failed (undefined response status)`)}await d(K)}}_createRequestQueryOptions(e){let t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){let r={};has(`featurelayer-advanced-symbols`)&&(r.returnAdvancedSymbols=!0),t?.cacheBust&&(r._ts=Date.now());let{data:i}=await n(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:t?.signal}));e=i}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);let r=e.type;if(!this.supportedSourceTypes.has(r))throw new a(`feature-layer-source:unsupported-type`,`Source type "${r}" is not supported`)}async _patchServiceJSON(e,t){if(e.type!==`Table`&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){let t=A(e.geometryType).renderer;l(`drawingInfo.renderer`,t,e)}if(e.geometryType===`esriGeometryMultiPatch`&&e.infoFor3D&&(e.geometryType=`mesh`),e.extent==null)try{let{data:r}=await n(this.layer.url,this._getLayerRequestOptions({signal:t}));r.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(e){f(e)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){let{addAssetFeatures:t}=e;if(!t?.length||await this._areAllAssetsAlreadyMapped(t))return null;let n=e.addFeatures.filter(e=>e.geometry);if(t.length!==n.length+e.updateFeatures.length)throw new a(`feature-layer-source:unsupported-mesh-edits`,`Mixing attribute only edits with mesh geometry edits is not currently supported`);let r=[],i=new Map;for(let e of t){let{geometry:t}=e,{vertexSpace:n}=t;if(x(n))r.push(t);else{let n=t.origin,{convertMeshVertexSpace:a}=await import(`../../../geometry/support/meshUtils/convertMeshVertexSpace.js`),o=await a(t,new b({origin:[n.x,n.y,n.z??0]}));i.set(o,t),e.geometry=o,r.push(o)}}await this.uploadAssets(r);for(let[e,t]of i)t.addExternalSources(e.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){let t=[],n=this.layer.globalIdField,r=this.layer.parsedUrl;for(let i of e){let{metadata:e}=i.geometry,a=e.getExternalSourcesOnService(r),o=i.getAttribute(n);if(a.length===0){c.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}let{source:s}=a.find(S)??a[0];for(let e of s.assets){if(e.parts.length!==1){c.getLogger(this).error(`Skipping asset ${e.assetName}. It does not have exactly one part, so we cannot map it to a feature.`);continue}t.push({globalId:h(),parentGlobalId:o,assetName:e.assetName,assetHash:e.parts[0].partHash,flags:[]})}}return t}_createEditsResult(e){let t=e.data,{layerId:n}=this.layer,r=[],i=null;if(Array.isArray(t))for(let e of t)r.push({id:e.id,editedFeatures:e.editedFeatures}),e.id===n&&(i={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment});else i=t;let a=O(i);if(r.length>0){a.editedFeatureResults=[];for(let e of r){let{editedFeatures:t}=e,n=t?.spatialReference?new y(t.spatialReference):null;a.editedFeatureResults.push({layerId:e.id,editedFeatures:k(t,n)})}}return a}_createAttachmentErrorResult(e,t){let n=t.details.messages?.[0]||t.message,r=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new a(`feature-layer-source:attachment-failure`,n,{code:r})}}_getFormDataForAttachment(e,t){let n=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(n)for(let e in t){let r=t[e];r!=null&&(n.set?n.set(e,r):n.append(e,r))}return n}_getLayerRequestOptions(e={}){let{layer:t,layer:{parsedUrl:n,gdbVersion:r}}=this;return{...e,query:{gdbVersion:r,layer:`dynamicDataSource`in t&&t.dynamicDataSource?JSON.stringify({source:t.dynamicDataSource}):void 0,...n.query,f:`json`,...this._createRequestQueryOptions(e)},responseType:`json`}}async _areAllAssetsAlreadyMapped(e){let{layer:t}=this,{globalIdField:n,parsedUrl:i}=t,a=`infoFor3D`in t?t.infoFor3D:null;if(a==null||n==null)return!1;let o=P(a);if(o==null)return!1;let s=m(i.path,`../${o.id}`),c=[];for(let t of e)if(t.geometry.metadata.getExternalSourcesOnService(i).length>0)c.push(t);else return!1;let l=c.map(e=>e.getAttribute(n)).filter(r);if(l.length===0)return!1;let{assetMapFieldRoles:{parentGlobalId:u,assetHash:d}}=a,f=new L({where:`${u} IN (${l.map(e=>`'${e}'`)})`,outFields:[d,u],returnGeometry:!1}),{features:p}=await F(s,f);return p.length!==0&&!c.some(e=>{let t=e.getAttribute(n);if(!t)return!0;let{metadata:r}=e.geometry,a=p.filter(e=>e.getAttribute(u)===t);if(a.length===0)return!0;let o=a.map(e=>e.getAttribute(d));return r.getExternalSourcesOnService(i).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>o.every(t=>e!==t))})}};e([g()],G.prototype,`type`,void 0),e([g({constructOnly:!0})],G.prototype,`layer`,void 0),e([g({constructOnly:!0})],G.prototype,`supportedSourceTypes`,void 0),e([g({readOnly:!0})],G.prototype,`queryTask`,null),G=e([_(`esri.layers.graphics.sources.FeatureLayerSource`)],G);const K=1e3;export{G as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../config.js";import n from"../../../request.js";import{isSome as r,remove as i}from"../../../core/arrayUtils.js";import a from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as o}from"../../../core/jsonMap.js";import{Loadable as s}from"../../../core/Loadable.js";import c from"../../../core/Logger.js";import{setDeepValue as l}from"../../../core/object.js";import{debounce as u,after as d,throwIfAbortError as f}from"../../../core/promiseUtils.js";import{watch as p}from"../../../core/reactiveUtils.js";import{join as m}from"../../../core/urlUtils.js";import{generateBracedUUID as h}from"../../../core/uuid.js";import{property as g,subclass as _}from"../../../core/accessorSupport/decorators.js";import v from"../../../geometry/Extent.js";import y from"../../../geometry/SpatialReference.js";import b from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as S}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as C,getFeatureJSON as w,getFeatureIds as T,getAttachmentEditsJSON as E,isProtectedOrPrivateVersionError as D,unpackEditResultData as O,createEditedFeatures as k}from"../applyEditsUtils.js";import{createDrawingInfo as A}from"./support/clientSideDefaults.js";import j from"./support/QueryTask.js";import{isHostedAgolService as M}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as N}from"../../support/featureLayerUtils.js";import{getAssetMapTable as P}from"../../support/infoFor3D.js";import{executeQueryJSON as F}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as I}from"../../../rest/query/operations/editsZScale.js";import L from"../../../rest/support/Query.js";import R from"../../../time/TimeExtent.js";import{isSafeToEditVersion as z,isVersionInEditSession as B,isHistoricVersion as V,currentSessionId as H}from"../../../versionManagement/support/versionManagementUtils.js";const U=new o({originalAndCurrentFeatures:`original-and-current-features`,none:`none`}),W=new o({Started:`published`,Publishing:`publishing`,Stopped:`unavailable`});let G=class extends s{constructor(e){super(e),this.type=`feature-layer`,this.supportedSourceTypes=new Set([`Feature Layer`,`Oriented Imagery Layer`,`Table`,`Catalog Layer`,`Annotation Layer`,`Dimension Layer`]),this.refresh=u(async()=>{await this.load();let e=this.sourceJSON.editingInfo?.lastEditDate;if(e==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}let t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){let t=this.layer.sourceJSON,n=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(n),Promise.resolve(this)}async reload(e){let t=this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0;await this._fetchService(null,{...e,cacheBust:t})}initialize(){this.addHandles([p(()=>{let e=this.layer;return e&&`lastEditsEventDate`in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){let{capabilities:e,parsedUrl:t,gdbVersion:n,spatialReference:r,fieldsIndex:i,uniqueIdFields:a}=this.layer,o=`infoFor3D`in this.layer?this.layer.infoFor3D:null,s=`dynamicDataSource`in this.layer?this.layer.dynamicDataSource:null,c=has(`featurelayer-pbf`)&&e?.query.supportsFormatPBF&&o==null,l=c&&e?.query.supportsFormatPBFWithCurves,u=e?.operations?.supportsQueryAttachments??!1,d=e?.query?.relativeTimeBinWindow??0,f=t.path;return new j({dynamicDataSource:s,fieldsIndex:i,gdbVersion:n,infoFor3D:o,pbfSupported:c,pbfSupportedWithCurves:l,queryAttachmentsSupported:u,relativeTimeBinWindow:d,sourceSpatialReference:r,uniqueIdFields:a,url:f})}async addAttachment(e,t,r){await this.load();let{layer:i}=this;await N(i,`editing`);let a=e.attributes[i.objectIdField],o=i.parsedUrl.path+`/`+a+`/addAttachment`,s=this._getLayerRequestOptions({query:r}),c=this._getFormDataForAttachment(t,s.query);try{let e=await n(o,{body:c});return C(e.data.addAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(a,e)}}async updateAttachment(e,t,r,i){await this.load();let{layer:a}=this;await N(a,`editing`);let o=e.attributes[a.objectIdField],s=a.parsedUrl.path+`/`+o+`/updateAttachment`,c=this._getLayerRequestOptions({query:{attachmentId:t,...i}}),l=this._getFormDataForAttachment(r,c.query);try{let e=await n(s,{body:l});return C(e.data.updateAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(o,e)}}async applyEdits(e,t){await this.load();let{layer:i}=this;await N(i,`editing`);let o=`infoFor3D`in i?i.infoFor3D:null,s=o!=null,c=s||(t?.globalIdUsed??!1),l=s?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,u=e.addFeatures?.map(e=>w(this.layer,e,o))??[],d=(await Promise.all(u)).filter(r),f=e.updateFeatures?.map(e=>w(this.layer,e,o))??[],p=(await Promise.all(f)).filter(r),m=T(this.layer,e.deleteFeatures,c);I(d,p,i.spatialReference);let h=await E(this.layer,e),g=i.capabilities.editing.supportsAsyncApplyEdits&&s,_=t?.gdbVersion||i.gdbVersion,v={gdbVersion:_,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:c,returnEditMoment:t?.returnEditMoment,trueCurveClient:t?.editsRespectTrueCurves,usePreviousEditMoment:t?.usePreviousEditMoment,async:g};await z(this.layer.url,_,!0);let y=B(this.layer.url,_||null);if(await V(i.url,_,i.historicMoment))throw new a(`feature-layer-source:historic-version`,`Editing a historic version is not allowed`);t?.returnServiceEditsOption?(v.edits=JSON.stringify([{id:i.layerId,adds:d.length?d:null,updates:p.length?p:null,deletes:m.length?m:null,attachments:h,assetMaps:l}]),v.returnServiceEditsOption=U.toJSON(t?.returnServiceEditsOption),v.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(v.adds=d.length?JSON.stringify(d):null,v.updates=p.length?JSON.stringify(p):null,v.deletes=m.length?c?JSON.stringify(m):m.join(`,`):null,v.attachments=h&&JSON.stringify(h),v.assetMaps=l==null?void 0:JSON.stringify(l));let b=this._getLayerRequestOptions({method:`post`,query:v});y&&(b.authMode=`immediate`,b.query.returnEditMoment=!0,b.query.sessionId=H);let x=t?.returnServiceEditsOption?i.url:i.parsedUrl.path,S;try{S=g?await this._asyncApplyEdits(x+`/applyEdits`,b):await n(x+`/applyEdits`,b)}catch(e){if(D(e))b.authMode=`immediate`,S=g?await this._asyncApplyEdits(x+`/applyEdits`,b):await n(x+`/applyEdits`,b);else throw e}return this._createEditsResult(S)}async deleteAttachments(e,t,r){await this.load();let{layer:i}=this;await N(i,`editing`);let a=e.attributes[i.objectIdField],o=i.parsedUrl.path+`/`+a+`/deleteAttachments`;try{return(await n(o,this._getLayerRequestOptions({query:{attachmentIds:t.join(`,`),...r},method:`post`}))).data.deleteAttachmentResults.map(C)}catch(e){throw this._createAttachmentErrorResult(a,e)}}fetchRecomputedExtents(e={}){let t=e.signal;return this.load({signal:t}).then(async()=>{let t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:r,url:i}=this.layer,{data:a}=await n(`${i}/${r}`,t),{id:o,extent:s,fullExtent:c,timeExtent:l}=a,u=s||c;return{id:o,fullExtent:u&&v.fromJSON(u),timeExtent:l&&R.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();let n=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,n)}async queryFeatures(e,t){await this.load();let n=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&n.features.length){let t=new Map;if(n.features.forEach(n=>{let r=n.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){let n=e.toLowerCase();n&&n in r&&e!==n&&(r[e]=r[n],delete r[n],t.set(n,e))}})}),n.fields!=null)for(let e of n.fields){let n=t.get(e.name.toLowerCase());n!=null&&(e.name=n)}}return n}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryPivot(e,t){return await this.load(),this.queryTask.executePivotQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!M(this.layer.url))return`unavailable`;let e=m(this.layer.url,`status`),t=await n(e,{query:{f:`json`}});return W.fromJSON(t.data.status)}async uploadAssets(e,t){let{uploadAssets:n}=await import(`./support/uploadAssets.js`);return n(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){let t=this.layer;if(e==null||!(`capabilities`in t)||!(`effectiveCapabilities`in t)||t.capabilities?.operations?.supportsEditing||!t.effectiveCapabilities?.operations?.supportsEditing)return;let n=t.url;if(n==null)return;`layerId`in t&&(n=m(n,t.layerId.toString()));let r=this._getOrCreateEditInterceptor(n);r.before=t=>{let n=t.requestOptions.method??`auto`;if(n===`auto`||n===`head`){let n=t.requestOptions.query??{};n._ts=e.getTime(),t.requestOptions.query=n}}}_getOrCreateEditInterceptor(e){return this._editInterceptor??(this._editInterceptor={urls:e},t.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){this._editInterceptor!=null&&(i(t.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){let r=(await n(e,t)).data.statusUrl;for(;;){let e=(await n(r,{query:{f:`json`},responseType:`json`})).data;switch(e.status){case`Completed`:return n(e.resultUrl,{query:{f:`json`},responseType:`json`});case`CompletedWithErrors`:throw new a(`async-applyEdits-failed`,`asynchronous applyEdits call failed.`);case`Failed ImportChanges`:case`InProgress`:case`Pending`:case`ExportAttachments`:case`ExportChanges`:case`ExportingData`:case`ExportingSnapshot`:case`ImportAttachments`:case`ProvisioningReplica`:case`UnRegisteringReplica`:break;default:throw new a(`async-applyEdits-failed`,`asynchronous applyEdits call failed (undefined response status)`)}await d(K)}}_createRequestQueryOptions(e){let t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){let r={};has(`featurelayer-advanced-symbols`)&&(r.returnAdvancedSymbols=!0),t?.cacheBust&&(r._ts=Date.now());let{data:i}=await n(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:t?.signal}));e=i}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);let r=e.type;if(!this.supportedSourceTypes.has(r))throw new a(`feature-layer-source:unsupported-type`,`Source type "${r}" is not supported`)}async _patchServiceJSON(e,t){if(e.type!==`Table`&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){let t=A(e.geometryType).renderer;l(`drawingInfo.renderer`,t,e)}if(e.geometryType===`esriGeometryMultiPatch`&&e.infoFor3D&&(e.geometryType=`mesh`),e.extent==null)try{let{data:r}=await n(this.layer.url,this._getLayerRequestOptions({signal:t}));r.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(e){f(e)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){let{addAssetFeatures:t}=e;if(!t?.length||await this._areAllAssetsAlreadyMapped(t))return null;let n=e.addFeatures.filter(e=>e.geometry);if(t.length!==n.length+e.updateFeatures.length)throw new a(`feature-layer-source:unsupported-mesh-edits`,`Mixing attribute only edits with mesh geometry edits is not currently supported`);let r=[],i=new Map;for(let e of t){let{geometry:t}=e,{vertexSpace:n}=t;if(x(n))r.push(t);else{let n=t.origin,{convertMeshVertexSpace:a}=await import(`../../../geometry/support/meshUtils/convertMeshVertexSpace.js`),o=await a(t,new b({origin:[n.x,n.y,n.z??0]}));i.set(o,t),e.geometry=o,r.push(o)}}await this.uploadAssets(r);for(let[e,t]of i)t.addExternalSources(e.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){let t=[],n=this.layer.globalIdField,r=this.layer.parsedUrl;for(let i of e){let{metadata:e}=i.geometry,a=e.getExternalSourcesOnService(r),o=i.getAttribute(n);if(a.length===0){c.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}let{source:s}=a.find(S)??a[0];for(let e of s.assets){if(e.parts.length!==1){c.getLogger(this).error(`Skipping asset ${e.assetName}. It does not have exactly one part, so we cannot map it to a feature.`);continue}t.push({globalId:h(),parentGlobalId:o,assetName:e.assetName,assetHash:e.parts[0].partHash,flags:[]})}}return t}_createEditsResult(e){let t=e.data,{layerId:n}=this.layer,r=[],i=null;if(Array.isArray(t))for(let e of t)e.editedFeatures!=null&&r.push({id:e.id,editedFeatures:e.editedFeatures}),e.id===n&&(i={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment});else i=t;let a=O(i);if(r.length>0){a.editedFeatureResults=[];for(let e of r){let{editedFeatures:t}=e,n=t?.spatialReference?new y(t.spatialReference):null;a.editedFeatureResults.push({layerId:e.id,editedFeatures:k(t,n)})}}return a}_createAttachmentErrorResult(e,t){let n=t.details.messages?.[0]||t.message,r=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new a(`feature-layer-source:attachment-failure`,n,{code:r})}}_getFormDataForAttachment(e,t){let n=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(n)for(let e in t){let r=t[e];r!=null&&(n.set?n.set(e,r):n.append(e,r))}return n}_getLayerRequestOptions(e={}){let{layer:t,layer:{parsedUrl:n,gdbVersion:r}}=this;return{...e,query:{gdbVersion:r,layer:`dynamicDataSource`in t&&t.dynamicDataSource?JSON.stringify({source:t.dynamicDataSource}):void 0,...n.query,f:`json`,...this._createRequestQueryOptions(e)},responseType:`json`}}async _areAllAssetsAlreadyMapped(e){let{layer:t}=this,{globalIdField:n,parsedUrl:i}=t,a=`infoFor3D`in t?t.infoFor3D:null;if(a==null||n==null)return!1;let o=P(a);if(o==null)return!1;let s=m(i.path,`../${o.id}`),c=[];for(let t of e)if(t.geometry.metadata.getExternalSourcesOnService(i).length>0)c.push(t);else return!1;let l=c.map(e=>e.getAttribute(n)).filter(r);if(l.length===0)return!1;let{assetMapFieldRoles:{parentGlobalId:u,assetHash:d}}=a,f=new L({where:`${u} IN (${l.map(e=>`'${e}'`)})`,outFields:[d,u],returnGeometry:!1}),{features:p}=await F(s,f);return p.length!==0&&!c.some(e=>{let t=e.getAttribute(n);if(!t)return!0;let{metadata:r}=e.geometry,a=p.filter(e=>e.getAttribute(u)===t);if(a.length===0)return!0;let o=a.map(e=>e.getAttribute(d));return r.getExternalSourcesOnService(i).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>o.every(t=>e!==t))})}};e([g()],G.prototype,`type`,void 0),e([g({constructOnly:!0})],G.prototype,`layer`,void 0),e([g({constructOnly:!0})],G.prototype,`supportedSourceTypes`,void 0),e([g({readOnly:!0})],G.prototype,`queryTask`,null),G=e([_(`esri.layers.graphics.sources.FeatureLayerSource`)],G);const K=1e3;export{G as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function e(e,t,n){if(
|
|
2
|
+
import{isPlainObject as e}from"../../core/lang.js";function t(e,t){if(c(e))return r(e,a,l(e),t)}function n(e,t,n){if(c(e)&&t)return r(t,e.type===`multipoint`?s:o,l(e),n)}function r(e,t,n,r){let i=t.vertexCount(e,n);if(i<1024)return;let a=t.partCount(e),o=`${r},${i},${a}`,s=Math.min(a,3),c=0,l=0;for(let r=0;r<s;++r){let i=s===1?0:Math.floor(r*(a-1)/(s-1));for(;c<i;)l+=t.partLength(e,c++,n)*n;let u=t.partLength(e,c,n);if(o+=`,${u}`,u>0)for(let r=0;r<3;++r){let i=r===0?0:r===1?Math.floor(u/2):Math.max(0,u-2);for(let r=0;r<n;++r){let a=t.coordinate(e,c,i,r,l,n);o+=`,${a.toFixed(5)}`}}}return o}function i(e,t,n){if(!e||!c(n)||!t)return!1;let{coords:r}=t,i=2+Number(!!e.hasZ)+Number(!!e.hasM),a=e.type===`multipoint`?s:o,l=u(n);if(a.partCount(t)!==l)return!1;let f=0;for(let e=0;e<l;++e){let o=d(n,e);if(a.partLength(t,e,i)!==o.length)return!1;for(let e of o)for(let t=0;t<i;++t)if(r[f++]!==e[t])return!1}return!0}const a={partCount:u,vertexCount(e){let t=0,n=u(e);for(let r=0;r<n;++r)t+=d(e,r).length;return t},partLength:(e,t)=>d(e,t).length,coordinate:(e,t,n,r)=>d(e,t)[n][r]},o={partCount:e=>e.lengths.length,vertexCount:(e,t)=>e.coords.length/t,partLength:(e,t)=>e.lengths[t],coordinate:(e,t,n,r,i,a)=>e.coords[i+n*a+r]},s={...o,partCount:()=>1,partLength:(e,t,n)=>e.coords.length/n};function c(t){return!!t&&e(t)&&(t.type===`polygon`||t.type===`polyline`||t.type===`multipoint`)&&!(t.type===`polygon`&&t.curveRings?.length)&&!(t.type===`polyline`&&t.curvePaths?.length)}function l(e){return 2+Number(!!e.hasZ)+Number(!!e.hasM)}function u(e){return e.type===`multipoint`?1:e.type===`polygon`?e.rings.length:e.paths.length}function d(e,t){return e.type===`multipoint`?e.points:e.type===`polygon`?e.rings[t]:e.paths[t]}function f(e,t,n){p(e.geometry,t,n)}function p(e,t,n){if(!e||(e.spatialReference=n,e.type===`extent`||e.type===`mesh`||e.type===`point`||!t))return;let{coords:r,lengths:i}=t,a=l(e),o=e.type===`multipoint`?[r.length/a]:i,s=[],c=0;if(a===2)for(let e of o){let t=[];for(let n=0;n<e;n++,c+=2)t.push([r[c],r[c+1]]);s.push(t)}else if(a===3)for(let e of o){let t=[];for(let n=0;n<e;n++,c+=3)t.push([r[c],r[c+1],r[c+2]]);s.push(t)}else for(let e of o){let t=[];for(let n=0;n<e;n++,c+=4)t.push([r[c],r[c+1],r[c+2],r[c+3]]);s.push(t)}e.type===`multipoint`?e.points=s[0]:e.type===`polygon`?e.rings=s:e.paths=s}export{f as completeDehydratedFeatureFromTransfer,p as completeDehydratedGeometryFromTransfer,t as geometryKey,i as identicalTransferGeometry,n as transferGeometryKey};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.145",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.20.8",
|
|
23
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
23
|
+
"@arcgis/toolkit": "5.2.0-next.145",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
|
|
25
25
|
"@esri/calcite-components": "^5.2.0-next.89",
|
|
26
26
|
"@vaadin/grid": "~25.3.2",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isRGB as e}from"../../core/colorUtils.js";import{getFontFamily as t}from"../../core/fontUtils.js";import"../../core/has.js";import{clone as n}from"../../core/lang.js";import r from"../../core/Logger.js";import{pt2px as i,px2pt as a}from"../../core/screenUtils.js";import{numericHash as o}from"../../core/string.js";import{isCurvedGeometry as s}from"../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as c}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{checkForAnimations as l,globalRotation as u,getAnimationParams as d,handleAbsoluteAnchor as f,handleMarker as p,handleRelativeAnchor as m,getFrameTranslation as h,translate as g,getStaticParam as _,shouldUseAnimatedPath as v}from"./animationUtils.js";import{CIMSymbolInflatedSizeHelper as y,CIMSymbolHelper as b,forEachSymbolLayer as x}from"./CIMSymbolHelper.js";import{antialiasingOutlineFillSettings as S}from"./constants.js";import{defaultCIMValues as C}from"./defaultCIMValues.js";import{fitVectorMarker as w}from"./fitVectorMarker.js";import{fromCIMFontStyle as T}from"./fromCIMFontStyle.js";import{OverrideHelper as E}from"./OverrideHelper.js";import{hasRichTextFormattingTags as D}from"./richTextUtils.js";import{getSDFInfo as O,getExtent as k,getSDFMetrics as A,getSDFDimensions as j}from"./SDFHelper.js";import{CIMSymbolUnits as M}from"./types.js";import{colorToArray as N,normalizeAlpha as P,getSize as F,isCIMMarkerStrokePlacement as I,hasStrokeLayer as L,getNumericValue as R,getMaxStrokeWidth as z,getTintColor as B,normalizePrimitiveOverrideProps as V,getDefaultCIMValue as H,getEnum as U,getFillColor as W,getStrokeColor as G,fromCIMFontDecoration as K,getStrokeWidth as q,fromCIMVerticalAlignment as ee,fromCIMHorizontalAlignment as te,getTextCasing as J,isValidCIMValue as ne,uncapitalize as re}from"./utils.js";import{isSupportedCallout as ie,getPointSymbolCalloutTransforms as ae,normalizePointSymbolCalloutScale as oe,normalizeLeaderLineStyle as Y,getPointSymbolCalloutFitProperties as se,normalizeBalloonCalloutStyle as ce}from"./callouts/calloutAnalysisUtils.js";import{EffectHelper as le}from"./effects/EffectHelper.js";import{rasterizedVectorMarkerMinSize as ue,randomInsidePolygonTextureSize as de}from"../../views/2d/engine/webgl/definitions.js";const X=()=>r.getLogger(`esri.symbols.cim.cimAnalyzer`);function fe(e){let t=e.markerPlacement;return t&&t.angleToLine?1:0}class pe{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],this._hasTextStringTemplates=!1,e&&(this._resourceManager=e)}analyzeSymbolReference(t,n,r){if(this._cimLayers=r??[],!t)return this._cimLayers;if(this._reset(),this._hasTextStringTemplates=t.hasTextStringTemplates??!1,t.primitiveOverrides){this._primitiveOverrides=t.primitiveOverrides;for(let t of this._primitiveOverrides){let n=t.valueExpressionInfo;if(n)this._setPoMap(t.primitiveName,t.propertyName,n);else if(t.value!=null){let n=t.value;t.propertyName.includes(`Color`)&&(e(n)&&(n=N(n)),n=P(n)),this._setPoMap(t.primitiveName,t.propertyName,n)}}}return this._analyzeSymbol(t.symbol,n),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case`CIMPointSymbol`:case`CIMLineSymbol`:case`CIMPolygonSymbol`:this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){let n=e?.symbolLayers;if(!n)return;for(let e=0;e<n.length;e++){let t=n[e];t.type===`CIMVectorMarker`&&(n[e]=w(t))}let r=e.effects,i=0,a=F(e)??0;e.type===`CIMPointSymbol`&&e.angleAlignment===`Map`&&(i=1);let o={transform:[0,0,0,1],fromColor:[1,1,1,1],toColor:[1,1,1,1],colorMix:[0,0,0,0],toOpacity:[1,1,1,1],opacityMix:[0,0,0,0],shift:[1,1,1,1],hasAnimations:l(e),hasShiftAnimation:!1,hasMotionAnimations:!1};o=u(o),o=d(this._poMap,e,o);let s=null;e.type===`CIMPointSymbol`&&(s=this._analyzePointSymbolHalo(e,i,a,r,o),this._analyzeCallout(e,null,[],o,a,i,t));let c=s?n.filter(e=>e!==s):n;if(Ce(c,r))return this._analyzeCompositeOutlineFill(c,r,a);this._analyzeSymbolLayer(s?{...e,symbolLayers:c}:e,null,[],o,a,i,t)}_analyzeSymbolLayer(e,t,n,r,i,a,o){let s=e?.symbolLayers;if(!s)return;let c=e.type===`CIMPolygonSymbol`,l=e.effects,u=s.length;for(;u--;){let d=s[u];if(!d||d.enable===!1)continue;let f;l?.length&&(f=[...l]);let p=d.effects;p?.length&&(l?f.push(...p):f=[...p]);let m=t?[...t]:null;if(f){m??=[];for(let e of f){let t=E.findEffectOverrides(e,this._primitiveOverrides);t&&m.push(t)}}E.findApplicableOverrides(d,this._primitiveOverrides,[]);let h=this._cimLayers.length;switch(d.type){case`CIMSolidFill`:this._analyzeSolidFill(d,m,r,L(s));break;case`CIMPictureFill`:this._analyzePictureFill(d,m,r);break;case`CIMHatchFill`:this._analyzeHatchFill(d,m,r);break;case`CIMGradientFill`:this._analyzeGradientFill(d,m);break;case`CIMSolidStroke`:this._analyzeSolidStroke(d,m,c,i,r);break;case`CIMPictureStroke`:this._analyzePictureStroke(d,m,c,i,r);break;case`CIMGradientStroke`:this._analyzeGradientStroke(d,m,c,i);break;case`CIMCharacterMarker`:case`CIMPictureMarker`:case`CIMVectorMarker`:{(e.type===`CIMLineSymbol`||e.type===`CIMPolygonSymbol`)&&(a=fe(d));let t=[],s=d.primitiveName;s&&t.push(s);let l=c&&I(d.markerPlacement);this._analyzeMarker(d,m,null,t,a,i,o,n,r,!1,l);break}default:X().error(`Cannot analyze CIM layer`,d.type)}if(m?.some(({effect:e})=>Z(e)))for(let e=h;e<this._cimLayers.length;e++)this._cimLayers[e].effectsChangeGeometryType=!0}}_analyzePointSymbolHalo(e,t,r,i,o){let{haloSymbol:s}=e,c=R(e.haloSize,0);if(c<=0||!s?.symbolLayers)return null;let u=s.symbolLayers.filter(e=>e.enable!==!1),f=u[0];if(!f)return null;let p=u.length===1&&f.type===`CIMSolidFill`;if(e.symbolLayers?.some(e=>l(e))===!0||l(s))return X().warnOnce(`CIM point symbol halos do not support independently animated symbol components`),null;let m=i?.map(e=>E.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>e!=null);if(m?.some(({effect:e})=>Z(e))){if(!p)return X().warnOnce(`Complex CIM point symbol halos are not supported with geometry-changing effects`),null;let t=e.symbolLayers?.filter(e=>e.enable!==!1)??[];if(!xe(t,m))return X().warnOnce(`CIM point symbol halos with geometry-changing effects currently require polygon-producing effects and an unambiguous solid-fill effect chain`),null;let n=t.find(e=>e.type===`CIMSolidFill`);if(!n)return null;let i=[...m,...(n.effects??[]).map(e=>E.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>e!=null)],a=z(t),o=this._getValueOrOverrideExpression(f.type,f.primitiveName,`Color`,P(f.color));return this._cimLayers.push({type:`outlineFill`,name:n.name,colorLocked:!!n.colorLocked,color:this._getValueOrOverrideExpression(n.type,n.primitiveName,`Color`,P(n.color)),effects:i,effectsChangeGeometryType:!0,outlineColorLocked:!0,outlineColor:o,outlineWidth:2*c+a,cap:`Round`,join:`Round`,referenceWidth:r,pixelBufferSize:2*c+a,outlineEffects:i}),n}let h=e.symbolLayers?.filter(e=>e.enable!==!1)??[],g=h.length===1&&h[0].type===`CIMVectorMarker`?h[0]:null,_=n(e);if(_.effects=void 0,_.angle=0,_.scaleX=1,g){let e=_.symbolLayers?.find(e=>e.type===`CIMVectorMarker`&&e.enable!==!1);e&&(e.rotation=0,e.offsetX=0,e.offsetY=0)}let v={..._,haloSize:0,haloSymbol:void 0},x=y.getPointSymbolHaloPadding(e,this._resourceManager),[S,C,w]=b.getTextureAnchor(v,this._resourceManager,ue,x),T=a(w),D=[];E.findApplicableOverrides(_,this._primitiveOverrides,D);let k=g?D.filter(e=>e.primitiveName!==g.primitiveName||![`Rotation`,`OffsetX`,`OffsetY`].includes(e.propertyName)):D,A=g?[{offsetX:this._getValueOrOverrideExpression(g.type,g.primitiveName,`OffsetX`,R(g.offsetX)),offsetY:this._getValueOrOverrideExpression(g.type,g.primitiveName,`OffsetY`,R(g.offsetY)),rotation:this._getValueOrOverrideExpression(g.type,g.primitiveName,`Rotation`,R(g.rotation)),size:T,frameHeight:T,rotateClockWise:!!g.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:!1}]:[],j=$(p?d(this._poMap,f,o):o),M,N;if(j){let e=b.getEnvelope(v,null,this._resourceManager);e&&(M=[e.width,e.height],N=[e.width+2*x,e.height+2*x])}return this._cimLayers.push({type:`marker`,spriteRasterizationParam:{type:`sprite-rasterization-param`,resource:{type:`cim-point-symbol-halo`,symbol:_,sdf:!j&&p&&O(v)!=null},overrides:k},colorLocked:!0,color:p?this._getValueOrOverrideExpression(f.type,f.primitiveName,`Color`,P(f.color)):[255,255,255,1],effects:m??null,effectsChangeGeometryType:m?.some(({effect:e})=>Z(e)),scaleSymbolsProportionally:!1,alignment:t,anchorPoint:{x:S,y:C},isAbsoluteAnchorPoint:!1,size:T,scaleX:R(e.scaleX,1),rotation:g?0:R(e.angle,0),offsetX:0,offsetY:0,outlineColor:[0,0,0,0],outlineWidth:0,transform:{type:`cim-marker-transform-param`,params:A},frameHeight:T,widthRatio:1,rotateClockwise:!1,referenceSize:r||T,sizeRatio:1,markerPlacement:null,isOutline:!1,animationParams:j,baseSize:r||T,pixelDimensions:M,texelDimensions:N}),null}_analyzeSolidFill(e,t,n,r){let{primitiveName:i,type:a}=e,o=P(e.color),s=d(this._poMap,e,n);if(!r&&t?.some(e=>e.effect.type===`CIMGeometricEffectTaperedPolygon`)){let n=this._getValueOrOverrideExpression(a,i,`Color`,o);this._cimLayers.push({type:`outlineFill`,name:e.name,colorLocked:!!e.colorLocked,color:n,effects:t,outlineColor:n,outlineColorLocked:!!e.colorLocked,...S,outlineEffects:t});return}this._cimLayers.push({type:`fill`,name:e.name,spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(a,i,`Color`,o),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1,animationParams:$(s)})}_analyzePictureFill(e,t,n){let{primitiveName:r,type:i}=e,a=B(e),o=R(e.height,C.CIMPictureFill.height),s=R(e.scaleX,1);if(`width`in e&&typeof e.width==`number`){let t=e.width,n=1,r=this._resourceManager.getResource(e.url);r!=null&&(n=r.width/r.height),s/=o/t*n}let c={type:`sprite-rasterization-param`,resource:e,overrides:this._getPrimitiveMaterialOverrides(r,i)},l=d(this._poMap,e,n);this._cimLayers.push({type:`fill`,name:e.name,spriteRasterizationParam:c,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(i,r,`TintColor`,a),height:this._getValueOrOverrideExpression(i,r,`Height`,o),scaleX:this._getValueOrOverrideExpression(i,r,`ScaleX`,s),angle:this._getValueOrOverrideExpression(i,r,`Rotation`,R(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,r,`OffsetX`,R(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,r,`OffsetY`,R(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1,animationParams:$(l)})}_analyzeHatchFill(e,t,n){let{primitiveName:r,type:i}=e,a=d(this._poMap,e,n),o=this._analyzeMaterialOverrides(r,[`Rotation`,`OffsetX`,`OffsetY`]),s=V(o),c=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(let t of e.lineSymbol.symbolLayers){if(t.type!==`CIMSolidStroke`)continue;let e=t.primitiveName??r;!l&&e&&!t.colorLocked&&(this._poMap[e]?.Color!=null||this._poMap[e]?.StrokeColor!=null)&&(c=P(t.color),c=this._maybeGetValueOrOverrideExpression(e,`StrokeColor`)??this._getValueOrOverrideExpression(i,e,`Color`,c),l=!0);let n=this._maybeGetValueOrOverrideExpression(e,`StrokeWidth`);if(n){let t=null,r=null;typeof n==`number`?t=n:r=n.valueExpressionInfo;let a=s.find(e=>e.propertyName===`strokeWidth`);a?a.propertyName=`width`:(a={type:`CIMPrimitiveOverride`,primitiveName:e,propertyName:`width`,valueExpressionInfo:r,value:t,defaultValue:H(i,`width`)},s.push(a))}}let u={type:`sprite-rasterization-param`,resource:e,overrides:s};this._cimLayers.push({type:`fill`,name:e.name,spriteRasterizationParam:u,colorLocked:!!e.colorLocked,effects:t,color:c,height:this._getValueOrOverrideExpression(i,r,`Separation`,R(e.separation,C.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(i,r,`Rotation`,R(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,r,`OffsetX`,R(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,r,`OffsetY`,R(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l,animationParams:$(a)})}_analyzeGradientFill(e,t){let{angle:n,gradientMethod:r,gradientSize:i,gradientSizeUnits:a,gradientType:o,interval:s,primitiveName:c,type:l}=e,u=C.CIMGradientFill,d=e.colorRamp;this._cimLayers.push({type:`gradientFill`,name:e.name,spriteRasterizationParam:{type:`sprite-rasterization-param`,resource:e,overrides:this._getPrimitiveMaterialOverrides(c,l)},colorLocked:!1,effects:t,color:[255,255,255,1],gradientMethod:this._getValueOrOverrideExpression(l,c,`GradientMethod`,r??`Linear`),angle:this._getValueOrOverrideExpression(l,c,`Angle`,R(n,u.angle)),gradientType:this._getValueOrOverrideExpression(l,c,`GradientType`,o??u.gradientType),interval:this._getValueOrOverrideExpression(l,c,`Interval`,R(s,d.type===`CIMFixedColorRamp`?d.colors.length:u.interval)),gradientSize:this._getValueOrOverrideExpression(l,c,`GradientSize`,R(i,u.gradientSize)),gradientSizeUnits:a===`Absolute`?M.Absolute:a===`Relative`?M.Relative:u.gradientSizeUnits})}_analyzeCompositeOutlineFill(e,t,n,r=[]){let i=e.find(e=>e.type===`CIMSolidFill`),a=e.find(e=>e.type===`CIMSolidStroke`);if(i==null||a==null)return;let o=[...r,...[...t??[],...i.effects??[]].map(e=>E.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>e!=null)],s=[...r,...[...t??[],...a.effects??[]].map(e=>E.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>e!=null)],c=R(a.width,C.CIMSolidStroke.width),l=U(a.capStyle,C.CIMSolidStroke.capstyle),u=U(a.joinStyle,C.CIMSolidStroke.joinstyle),d=a.miterLimit;this._cimLayers.push({type:`outlineFill`,name:i.name,colorLocked:!!i.colorLocked,color:this._getValueOrOverrideExpression(i.type,i.primitiveName,`Color`,P(i.color)),effects:o,effectsChangeGeometryType:o.some(({effect:e})=>Z(e))||s.some(({effect:e})=>Z(e)),outlineColorLocked:!!a.colorLocked,outlineColor:this._getValueOrOverrideExpression(a.type,a.primitiveName,`Color`,P(a.color)),outlineWidth:this._getValueOrOverrideExpression(a.type,a.primitiveName,`Width`,c),cap:this._getValueOrOverrideExpression(a.type,a.primitiveName,`CapStyle`,l),join:this._getValueOrOverrideExpression(a.type,a.primitiveName,`JoinStyle`,u),miterLimit:d&&this._getValueOrOverrideExpression(a.type,a.primitiveName,`MiterLimit`,d),referenceWidth:n,outlineEffects:s})}_analyzeSolidStroke(e,t,n,r,i){let{primitiveName:a,type:o}=e,s=P(e.color),c=R(e.width,C.CIMSolidStroke.width),l=U(e.capStyle,C.CIMSolidStroke.capstyle),u=U(e.joinStyle,C.CIMSolidStroke.joinstyle),f=e.miterLimit,p=this._analyzePrimitiveOverrides(a,t,null,null),m=[];p&&(m=this._getPrimitiveMaterialOverrides(a,o));let h,g,_,v;if(t&&Array.isArray(t)&&t.length>0){let e=t[t.length-1].effect;e&&e.type===`CIMGeometricEffectDashes`&&e.lineDashEnding===`NoConstraint`&&(h=e.dashTemplate,g=e.scaleDash,_=e.offsetAlongLine,v=e.primitiveName,t=[...t],t.pop())}v!=null&&m.push(...this._getPrimitiveMaterialOverrides(v,o).filter(e=>e.propertyName===`dashTemplate`));let y=h===void 0?null:{type:`sprite-rasterization-param`,resource:{type:`dash`,dashTemplate:h,primitiveName:v},overrides:m},b=d(this._poMap,e,i);this._cimLayers.push({type:`line`,name:e.name,spriteRasterizationParam:y,isOutline:n,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,a,`Color`,s),width:this._getValueOrOverrideExpression(o,a,`Width`,c),cap:this._getValueOrOverrideExpression(o,a,`CapStyle`,l),join:this._getValueOrOverrideExpression(o,a,`JoinStyle`,u),miterLimit:f&&this._getValueOrOverrideExpression(o,a,`MiterLimit`,f),referenceWidth:r,zOrder:he(e.name),dashTemplate:this._maybeGetValueOrOverrideExpression(v,`DashTemplate`)??h,offsetAlongLine:this._getValueOrOverrideExpression(o,v,`OffsetAlongLine`,_??0),scaleDash:g,sampleAlphaOnly:!0,animationParams:$(b)})}_analyzePictureStroke(e,t,n,r,i){let{primitiveName:a,type:o}=e,s=B(e),c=R(e.width,C.CIMPictureStroke.width),l=U(e.capStyle,C.CIMPictureStroke.capstyle),u=U(e.joinStyle,C.CIMPictureStroke.joinstyle),f=e.miterLimit,p={type:`sprite-rasterization-param`,resource:e,overrides:this._getPrimitiveMaterialOverrides(a,o)},m=d(this._poMap,e,i);this._cimLayers.push({type:`line`,name:e.name,spriteRasterizationParam:p,isOutline:n,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,a,`TintColor`,s),width:this._getValueOrOverrideExpression(o,a,`Width`,c),cap:this._getValueOrOverrideExpression(o,a,`CapStyle`,l),join:this._getValueOrOverrideExpression(o,a,`JoinStyle`,u),miterLimit:f&&this._getValueOrOverrideExpression(o,a,`MiterLimit`,f),referenceWidth:r,zOrder:he(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1,animationParams:$(m)})}_analyzeGradientStroke(e,t,n,r){let{gradientMethod:i,gradientSize:a,gradientSizeUnits:o,gradientType:s,interval:c,primitiveName:l,type:u}=e,d=C.CIMGradientStroke,f=R(e.width,d.width),p=U(e.capStyle,d.capstyle),m=U(e.joinStyle,d.joinstyle),h=e.miterLimit,g=e.colorRamp;this._cimLayers.push({type:`gradientStroke`,name:e.name,spriteRasterizationParam:{type:`sprite-rasterization-param`,resource:e,overrides:this._getPrimitiveMaterialOverrides(l,u)},colorLocked:!!e.colorLocked,effects:t,color:[255,255,255,1],width:this._getValueOrOverrideExpression(u,l,`Width`,f),cap:this._getValueOrOverrideExpression(u,l,`CapStyle`,p),join:this._getValueOrOverrideExpression(u,l,`JoinStyle`,m),miterLimit:h&&this._getValueOrOverrideExpression(u,l,`MiterLimit`,h),referenceWidth:r,isOutline:n,gradientMethod:this._getValueOrOverrideExpression(u,l,`GradientMethod`,i??d.gradientMethod),gradientType:this._getValueOrOverrideExpression(u,l,`GradientType`,s??d.gradientType),interval:this._getValueOrOverrideExpression(u,l,`Interval`,R(c,g.type===`CIMFixedColorRamp`?g.colors.length:d.interval)),gradientSize:this._getValueOrOverrideExpression(u,l,`GradientSize`,R(a,d.gradientSize)),gradientSizeUnits:o===`Absolute`?M.Absolute:o===`Relative`?M.Relative:d.gradientSizeUnits})}_analyzeMarker(e,t,n,r,i,a,o,s,c,l=!1,u=!1){l||=!!e.colorLocked;let h=c;if(h=f(e,h),h=p(this._poMap,e,h),h=m(e,h),h=d(this._poMap,e,h),this._analyzeMarkerInsidePolygon(e,t,l,h))return;let g=R(e.size,C.CIMVectorMarker.size),_=R(e.rotation),v=R(e.offsetX),y=R(e.offsetY),{primitiveName:b,type:x}=e,S=this._getValueOrOverrideExpression(x,b,`Size`,g),w=this._getValueOrOverrideExpression(x,b,`Rotation`,_),T=this._getValueOrOverrideExpression(x,b,`OffsetX`,v),E=this._getValueOrOverrideExpression(x,b,`OffsetY`,y);switch(e.type){case`CIMPictureMarker`:this._analyzePictureMarker(e,t,n,r,i,a,S,w,T,E,s,h,l,u);break;case`CIMVectorMarker`:this._analyzeVectorMarker(e,t,n,r,i,a,S,w,T,E,s,h,o,l,u)}}_analyzeMarkerInsidePolygon(e,t,n,r){let{markerPlacement:i,type:o}=e;if(!i||i.type!==`CIMMarkerPlacementInsidePolygon`||r.hasMotionAnimations)return!1;if(o===`CIMVectorMarker`||o===`CIMPictureMarker`){let n=e.primitiveName;if(n&&this._analyzePrimitiveOverrides([n],t,null,null))return!1;let r=i.primitiveName;if(r&&this._analyzePrimitiveOverrides([r],t,null,null))return!1;if(o===`CIMVectorMarker`){let{markerGraphics:t}=e;if(t)for(let e of t){let{symbol:t}=e;if(t?.type===`CIMPolygonSymbol`&&t.symbolLayers){let{symbolLayers:e}=t;for(let t of e)if(t.type===`CIMSolidStroke`)return!1}}}else{let{animatedSymbolProperties:t}=e;if(t)return!1}}let s=Math.abs(i.stepX),c=Math.abs(i.stepY);if(s===0||c===0)return!0;let l,u;if(i.gridType===`Random`){let e=a(de),t=Math.max(Math.floor(e/s),1);l=c*Math.max(Math.floor(e/c),1),u=t*s/l}else i.shiftOddRows?(l=c*2,u=s/c*.5):(l=c,u=s/c);let d=B(e),f=e.type===`CIMCharacterMarker`?null:{type:`sprite-rasterization-param`,resource:{...e,effects:e.effects?.filter(e=>!ye(e))},overrides:[]};return this._cimLayers.push({type:`fill`,name:e.name,spriteRasterizationParam:f,colorLocked:n,effects:t,color:d,height:l,scaleX:u,angle:i.gridAngle??0,offsetX:R(i.offsetX),offsetY:R(i.offsetY),applyRandomOffset:i.gridType===`Random`,sampleAlphaOnly:e.type!==`CIMPictureMarker`,hasUnresolvedReplacementColor:!0,animationParams:$(r)}),!0}_analyzePictureMarker(e,t,r,i,a,s,c,l,u,d,f,p,m,h){let{animatedSymbolProperties:g,primitiveName:_,type:v}=e,y=R(e.scaleX,1),b=B(e);r||=this._createMarkerPlacementOverrideExpression(e.markerPlacement);let x=this._createGIFAnimatedSymbolPropertiesOverrideExpression(g),S=e.anchorPoint??{x:0,y:0};if(`width`in e&&typeof e.width==`number`){let t=e.width,n=1,r=this._resourceManager.getResource(e.url);r!=null&&(n=r.width/r.height);let i=R(e.size);y/=i/t*n}let C=[...i];e.primitiveName&&C.push(e.primitiveName);let w;g||x?w={type:`animated`,url:e.url,urlHash:`H`+o(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(w=n(e),w.markerPlacement=null);let T={type:`sprite-rasterization-param`,resource:w,overrides:this._getMaterialOverrides(C,v)};x&&T.overrides.push(...x.overrides);let E=c;this._cimLayers.push({type:`marker`,name:e.name,spriteRasterizationParam:T,colorLocked:m,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:c,scaleX:this._getValueOrOverrideExpression(v,_,`ScaleX`,y),rotation:l,offsetX:u,offsetY:d,transform:{type:`cim-marker-transform-param`,params:f},color:this._getValueOrOverrideExpression(v,_,`TintColor`,b),anchorPoint:{x:S.x,y:S.y},isAbsoluteAnchorPoint:e.anchorPointUnits!==`Relative`,outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:s,sizeRatio:1,isOutline:h,markerPlacement:r,animationParams:$(p),baseSize:E})}_analyzeVectorMarker(e,t,n,r,i,a,o,l,u,d,f,p,m,v,y){let b=e.markerGraphics;if(!b)return;let x=e.frame,S=0;S=x?x.ymax-x.ymin:a;let C=!!e.scaleSymbolsProportionally;if(S){let t={offsetX:u,offsetY:d,rotation:l,size:o,frameHeight:S,rotateClockWise:!!e.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:C};f=[...f,t]}n||=this._createMarkerPlacementOverrideExpression(e.markerPlacement);for(let o of b)if(o){let l=o.symbol;if(!l)continue;let u=o.primitiveName;u&&r.push(u);let d=p,b;if((l.type===`CIMPointSymbol`||l.type===`CIMTextSymbol`)&&x){let t=0,n=0,r=o.geometry;`x`in r&&`y`in r&&(t+=r.x-(x.xmin+x.xmax)*.5,n+=r.y-(x.ymin+x.ymax)*.5);let i=e.anchorPoint,a=!1;i&&(e.anchorPointUnits===`Absolute`?(t-=i.x,n-=i.y,a=!0):x&&(t-=(x.xmax-x.xmin)*i.x,n-=(x.ymax-x.ymin)*i.y));let s={offsetX:t,offsetY:n,rotation:0,size:0,frameHeight:0,rotateClockWise:!1,absoluteAnchorPoint:a,scaleSymbolsProportionally:C};b=[...f,s]}(l.type===`CIMPointSymbol`||l.type===`CIMTextSymbol`)&&this._analyzeCallout(l,t,b??f,d,a,i,m);let w=s(o.geometry)?{...o,geometry:c(o.geometry,{maxDeviation:.01})}:o,T=w.geometry,[E,D]=h(T,x);switch((E!==0||D!==0)&&(d=g(d,E,D)),l.type){case`CIMPointSymbol`:case`CIMLineSymbol`:case`CIMPolygonSymbol`:m||ve(l)?(d={...d,transform:{type:`AnimatedTransform`,relativeTranslation:!1,absoluteScale:!0,selectGlobalRotation:!1,translation:_([0,0]),rotation:_(0),scale:_(S),parent:p.transform}},this._analyzeMultiLayerGraphicNonSDF(e,t,n,w,r,i,a,b??f,d,S,v,y)):this._analyzeMultiLayerGraphic(e,t,n,w,r,i,a,b??f,d,S,v,y);break;case`CIMTextSymbol`:this._analyzeTextGraphic(t,n,w,r,i,a,b??f,v)}u&&r.pop()}}_analyzeCallout(e,t,n,r,i,a,o){let s=e.callout;if(!s||!ie(s))return;let c=t??[],{leaderTolerance:l,leaderOffset:u}=s;switch(s.type){case`CIMSimpleLineCallout`:{let{lineSymbol:e,autoSnap:t}=s,d={type:`CIMSimpleLineCallout`,leaderTolerance:l,leaderOffset:u,autoSnap:t,inflateSize:500};this._analyzeSymbolLayer(e,[...c,{type:`cim-effect-param`,effect:d,overrides:[]}],n,r,i,a,o);break}case`CIMBackgroundCallout`:{let{accentBarSymbol:e,gap:t,backgroundSymbol:d,leaderLineSymbol:f,lineStyle:p,margin:m}=s,h=n=>({type:`CIMBackgroundCallout`,leaderTolerance:l,leaderOffset:u,lineStyle:Y(p),gap:t,hasAccentBar:!!e,margin:m,inflateSize:500,part:n}),g=[...c,{type:`cim-effect-param`,effect:h(`background`),overrides:[]}];if(f&&this._analyzeSymbolLayer(f,[...c,{type:`cim-effect-param`,effect:h(`leader`),overrides:[]}],n,r,i,a,o),d){let e=d.symbolLayers??[];Q(e)?this._analyzeCompositeOutlineFill(e,null,i,g):this._analyzeSymbolLayer(d,g,n,r,i,a,o)}e&&this._analyzeSymbolLayer(e,[...c,{type:`cim-effect-param`,effect:h(`accent-bar`),overrides:[]}],n,r,i,a,o);break}case`CIMBalloonCallout`:{let{balloonStyle:e,backgroundSymbol:t,dartSymbol:d,fixedDartWidth:f,margin:p,useDartSymbol:m,useFixedDartWidth:h}=s,g=m===!0&&d!=null,_=t=>({type:`CIMBalloonCallout`,leaderTolerance:l,leaderOffset:u,margin:p,balloonStyle:ce(e),dartWidth:h?f:void 0,inflateSize:500,part:t,separateDart:g}),v=(e,t)=>{let s=[...c,{type:`cim-effect-param`,effect:_(t),overrides:[]}],l=e.symbolLayers??[];Q(l)?this._analyzeCompositeOutlineFill(l,null,i,s):this._analyzeSymbolLayer(e,s,n,r,i,a,o)};g&&v(d,`dart`),v(t,`background`);break}case`CIMPointSymbolCallout`:{let{backgroundScale:e,gap:t,leaderLineSymbol:d,lineStyle:f,pointSymbol:p}=s,m=oe(e),h=ae(p,n),g=e=>({type:`CIMPointSymbolCallout`,leaderTolerance:l,leaderOffset:u,backgroundScale:m,...se(p,e),lineStyle:Y(f),gap:t,inflateSize:500,part:e});d&&this._analyzeSymbolLayer(d,[...c,{type:`cim-effect-param`,effect:g(`leader`),overrides:[]}],n,r,i,a,o),this._analyzeSymbolLayer(p,[...c,{type:`cim-effect-param`,effect:g(`marker`),overrides:[]}],h,r,i,a,o||m!==0);break}case`CIMCompositeCallout`:{let{backgroundSymbol:e,margin:t,shadowSymbol:d}=s,f={type:`CIMBalloonCallout`,leaderTolerance:l,leaderOffset:u,margin:t,balloonStyle:1,inflateSize:500,part:`background`},p=[...c,{type:`cim-effect-param`,effect:f,overrides:[]}],m=e=>{let t=e.symbolLayers??[];Q(t)?this._analyzeCompositeOutlineFill(t,null,i,p):this._analyzeSymbolLayer(e,p,n,r,i,a,o)};d&&m(d),m(e);break}}}_analyzeMultiLayerGraphic(e,t,n,r,i,a,o,s,c,l,u,d){let f=r.symbol,p=f.symbolLayers;if(p){if(_e(p)&&!v(c)){this._analyzeCompositeMarkerGraphic(e,t,n,r,p,a,o,s,l,u,d);return}if(Se(p)){x(f,e=>{e.colorLocked&&(u=!0)}),this._analyzeMultiLayerGraphicNonSDF(e,t,n,r,i,a,o,s,c,l,u,d);return}this._analyzeMarkerGraphicSymbolLayers(e,t,n,r,i,a,o,s,c,l,u,d)}}_analyzeMarkerGraphicSymbolLayers(e,t,n,r,i,a,o,s,c,l,u,f){let p=r.symbol,m=p.symbolLayers;if(!m)return;let h=le.applyEffects(p.effects,r.geometry);if(!h)return;let g=m.length;for(;g--;){let p=m[g];if(!p||p.enable===!1)continue;let _=p.primitiveName;switch(_&&i.push(_),p.type){case`CIMSolidFill`:case`CIMSolidStroke`:{let i=le.applyEffects(p.effects,h),m=k(i);if(!m)continue;let g=e.anchorPointUnits!==`Relative`,v=p.type===`CIMSolidStroke`?p.width:0,{frameSizeRatio:y,anchorX:b,anchorY:x,widthRatio:S,sdfPaddingRatio:w,sdfTextureSize:T}=A(m,e.frame,e.size,e.anchorPoint,g,v,e.scaleSymbolsProportionally),E=p.type===`CIMSolidFill`,D={type:`sdf`,geometry:i,sdfPaddingRatio:w,asFill:E,sdfTextureSize:T},{path:O}=p,M=E?P(W(p)):O==null?P(G(p)):[0,0,0,0],N=E?[0,0,0,0]:P(G(p));if(!E&&!v)break;let F=r.primitiveName,I=null;E&&!p.colorLocked&&(I=this._maybeGetValueOrOverrideExpression(F,`FillColor`));let L=null;!E&&!p.colorLocked&&(L=this._maybeGetValueOrOverrideExpression(F,`StrokeColor`));let z=I??this._getValueOrOverrideExpression(p.type,_,`Color`,M),B=L??this._getValueOrOverrideExpression(p.type,_,`Color`,N),V=this._maybeGetValueOrOverrideExpression(F,`StrokeWidth`)??this._getValueOrOverrideExpression(p.type,_,`Width`,v),H=O?{type:`sprite-rasterization-param`,resource:{type:`path`,path:O,asFill:E},overrides:[]}:{type:`sprite-rasterization-param`,resource:D,overrides:[]},U=d(this._poMap,p,c),K=R(e.size,C.CIMVectorMarker.size),q=this._getValueOrOverrideExpression(e.type,e.primitiveName,`Size`,K);this._cimLayers.push({type:`marker`,name:p.name,groupName:e.name,spriteRasterizationParam:H,colorLocked:!!p.colorLocked||!!u,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:b,y:x},isAbsoluteAnchorPoint:g,size:l,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:`cim-marker-transform-param`,params:s},frameHeight:l,widthRatio:S,rotateClockwise:!1,referenceSize:o,sizeRatio:y,color:z,outlineColor:B,outlineWidth:V,isOutline:f,markerPlacement:n,animationParams:$(U),isStroke:p.type!==`CIMSolidFill`,baseSize:q,...j(i,T,w)});break}case`CIMPictureMarker`:case`CIMVectorMarker`:if(p.markerPlacement){X().error(`Error analyzing CIM, got unexpected marker placement`);break}this._analyzeMarker(p,t,n,i,a,o,!1,s,c,u,f)}_&&i.pop()}}_analyzeTextGraphic(e,n,r,i,a,o,s,c){E.findApplicableOverrides(r,this._primitiveOverrides,[]);let l=r.geometry;if(!(`x`in l)||!(`y`in l))return;let u=r.symbol,d=K(u),f=T(u.fontStyleName),p=t(u.fontFamilyName);u.font={family:p,decoration:d,...f};let m=R(u.height,C.CIMTextSymbol.height),h=R(u.angle),g=R(u.offsetX),_=R(u.offsetY),{haloSymbol:v}=u,y=R(u.haloSize,0),b=[0,0,0,0];if(v?.symbolLayers?.length){let e=v.symbolLayers;for(let t of e)if(t.color){b=this._getValueOrOverrideExpression(u?.haloSymbol?.type??`CIMPolygonSymbol`,t.primitiveName,`Color`,P(t.color));break}}let x=r.primitiveName,S=[0,0,0,1],w=[0,0,0,0],O=0,k=!1;if(u.symbol?.symbolLayers)for(let e of u.symbol.symbolLayers){let t=e.primitiveName;if(e.type===`CIMSolidStroke`)w=this._getValueOrOverrideExpression(`CIMSolidStroke`,t,`Color`,P(e.color)),O=this._getValueOrOverrideExpression(`CIMSolidStroke`,t,`Width`,q(e)??0);else if(e.type===`CIMSolidFill`){let n=P(e.color);k??=!!e.colorLocked,S=this._getValueOrOverrideExpression(`CIMSolidFill`,t??x,`Color`,n)}}let A=null,j=null,M=null,N=null,F=null;x&&(A=this._maybeGetValueOrOverrideExpression(x,`TextSize`),j=this._maybeGetValueOrOverrideExpression(x,`TextAngle`),M=this._maybeGetValueOrOverrideExpression(x,`TextOffsetX`),N=this._maybeGetValueOrOverrideExpression(x,`TextOffsetY`),k||(F=this._maybeGetValueOrOverrideExpression(x,`FillColor`)));let I=F??S,L=null,z=null,B=0,V=u.callout?.type===`CIMBackgroundCallout`;if(u.callout?.type===`CIMBackgroundCallout`){let e=u.callout;if(e.backgroundSymbol){let t=e.backgroundSymbol.symbolLayers;if(t)for(let e of t)e.type===`CIMSolidFill`?L=P(e.color):e.type===`CIMSolidStroke`&&(z=P(e.color),B=R(e.width,C.CIMSolidStroke.width))}}let H=this._getValueOrOverrideExpression(u.type,r.primitiveName,`TextString`,r.textString??``);if(H==null)return;let{fontStyleName:U}=u,W=p+(U?`-`+U.toLowerCase():`-regular`),G=this._getMaterialOverrides(i,u.type);G.push(...this._getPrimitiveMaterialOverrides(r.primitiveName,u.type)),this._collectDictionaryTemplateOverrides(G,r);let J={type:`text-rasterization-param`,resource:{type:`text`,textString:r.textString??``,font:u.font,symbol:u,primitiveName:r.primitiveName,supportsRichText:D(r.textString??``)||G.some(e=>e.propertyName===`textString`)},overrides:G};this._cimLayers.push({type:`text`,lineWidth:u.lineWidth,textRasterizationParam:J,colorLocked:!!c||!!k,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:W,decoration:d,haloSize:y,haloColor:b,weight:f.weight,style:f.style,size:A??m,angle:j??h,offsetX:M??g,offsetY:N??_,transform:{type:`cim-marker-transform-param`,params:s},horizontalAlignment:te(u.horizontalAlignment),verticalAlignment:ee(u.verticalAlignment),text:H,color:I,outlineColor:w,outlineSize:O,backgroundColor:L,borderLineColor:z,borderLineWidth:B,useBackgroundCallout:V,referenceSize:o,sizeRatio:1,markerPlacement:n})}_collectDictionaryTemplateOverrides(e,t){if(t.textString&&this._hasTextStringTemplates){let n=J(t.symbol);e.push({propertyName:`textString`,defaultValue:``,valueExpressionInfo:{type:`dictionary-template`,textCase:n,template:t.textString},primitiveName:t.primitiveName})}}_analyzeMultiLayerGraphicNonSDF(e,t,n,r,a,o,s,c,l,u,d,f){let p=me(e,r),m=e.primitiveName,h=this._analyzeMaterialOverrides(m,[`Rotation`,`OffsetX`,`OffsetY`]),g=V(h),[_,v,y]=b.getTextureAnchor(p,this._resourceManager,ue),x=this._getMaterialOverrides(a,e.type).filter(e=>e.primitiveName!==m||![`rotation`,`offsetX`,`offsetY`].includes(e.propertyName));x.push(...g);let S={type:`sprite-rasterization-param`,resource:{...p,avoidSDFRasterization:!0},overrides:x},w=R(e.size,C.CIMVectorMarker.size),T=this._getValueOrOverrideExpression(e.type,m,`Size`,w);this._cimLayers.push({type:`marker`,name:e.name,spriteRasterizationParam:S,colorLocked:d,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:_,y:v},isAbsoluteAnchorPoint:!1,size:u,rotation:0,offsetX:0,offsetY:0,transform:{type:`cim-marker-transform-param`,params:c},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:u,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:s,sizeRatio:y/i(e.size),isOutline:f,markerPlacement:n,animationParams:$(l),baseSize:T})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;let t=[];return E.findApplicableOverrides(e,this._primitiveOverrides,t),{type:`cim-marker-placement-param`,placement:e,overrides:we(t)}}_createGIFAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;let t=[];return E.findApplicableOverrides(e,this._primitiveOverrides,t),{type:`cim-gif-animation-params`,animation:e,overrides:we(t)}}_analyzeCompositeMarkerGraphic(e,t,n,r,i,a,o,s,c,l,u){let d=r.geometry,f=i[0],p=i[1],m=k(d);if(!m)return;let h=e.anchorPointUnits!==`Relative`,g=R(f.width,C.CIMSolidStroke.width),{frameSizeRatio:_,anchorX:v,anchorY:y,widthRatio:b,sdfPaddingRatio:x,sdfTextureSize:S}=A(m,e.frame,e.size,e.anchorPoint,h,g,e.scaleSymbolsProportionally),{path:w}=p,T=p.primitiveName,E=f.primitiveName,D=r.primitiveName,O=null;!p.colorLocked&&!l&&(O=this._maybeGetValueOrOverrideExpression(D,`FillColor`));let j=O??this._getValueOrOverrideExpression(p.type,T,`Color`,P(p.color)),M=null;!f.colorLocked&&!l&&(M=this._maybeGetValueOrOverrideExpression(D,`StrokeColor`));let N=M??this._getValueOrOverrideExpression(f.type,E,`Color`,P(f.color)),F=this._maybeGetValueOrOverrideExpression(D,`StrokeWidth`)??this._getValueOrOverrideExpression(f.type,E,`Width`,g),I={type:`sprite-rasterization-param`,resource:w?{type:`path`,path:w,asFill:!0}:{type:`sdf`,geometry:d,sdfTextureSize:S,sdfPaddingRatio:x,asFill:!0},overrides:[]};this._cimLayers.push({type:`marker`,name:e.name,spriteRasterizationParam:I,colorLocked:l,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:v,y},isAbsoluteAnchorPoint:h,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:`cim-marker-transform-param`,params:s},frameHeight:c,widthRatio:b,rotateClockwise:!1,referenceSize:o,sizeRatio:_,color:j,outlineColor:N,outlineWidth:F,isOutline:u,markerPlacement:n})}_setPoMap(e,t,n){let r;this._poMap[e]?r=this._poMap[e]:(r={},this._poMap[e]=r),r[t]=n}_maybeGetValueOrOverrideExpression(e,t,n){return this._getValueOrOverrideExpression(``,e,t,n,!1)}_getValueOrOverrideExpression(e,t,n,r,i=!0){if(i&&!ne(r)&&(r=H(e,n.toLowerCase())),t==null)return r;let a=this._poMap[t];if(a==null)return r;let o=a[n];return typeof o==`string`||typeof o==`number`||Array.isArray(o)?o:o?{valueExpressionInfo:o,defaultValue:r}:r}_analyzePrimitiveOverrides(e,t,n,r){if(e==null)return!1;typeof e==`string`&&(e=[e]);for(let t of this._primitiveOverrides)if(e.includes(t.primitiveName)&&t.valueExpressionInfo)return!0;if(t!=null){for(let e of t)if(e?.overrides.length>0)return!0}if(n!=null){for(let e of n)if(e?.overrides.length>0)return!0}if(r!=null){for(let e of r)if(e?.overrides.length>0)return!0}return!1}_getMaterialOverrides(e,t){if(!e)return[];let n=[];for(let r of e)n.push(...this._getPrimitiveMaterialOverrides(r,t));return n}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];let n=V(this._primitiveOverrides.filter(t=>t.primitiveName===e));return n.forEach(e=>e.defaultValue=H(t,e.propertyName.toLowerCase())),n}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(n=>n.primitiveName!==e||!t.includes(n.propertyName))}}function me(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[{...t}],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}function he(e){if(e?.startsWith(`Level_`)){let t=parseInt(e.slice(6),10);if(!isNaN(t))return t}return 0}function ge(e,t){if(!t||t.length===0)return e;let r=n(e);return E.applyOverrides(r,t),r}const _e=e=>e&&e.length===2&&e[0].enable&&e[1].enable&&e[0].type===`CIMSolidStroke`&&e[1].type===`CIMSolidFill`&&e[0].path==null&&e[1].path==null&&!e[0].effects&&!e[1].effects&&!e[0].animations&&!e[1].animations;function ve(e){let t=e.symbolLayers;if(!t)return!1;let n=t.find(e=>e.effects?.find(e=>e.type===`CIMGeometricEffectDashes`&&e.dashTemplate!=null)),r=t.find(e=>e.effects?.find(e=>e.type===`CIMGeometricEffectAddControlPoints`));return!!n||!!r}function ye(e){return Z(e)}function Z(e){return e.type===`CIMGeometricEffectCircularSector`||e.type===`CIMGeometricEffectRadial`||e.type===`CIMGeometricEffectTaperedPolygon`||e.type===`PrivateDimensionEffect`||e.type===`PrivateMatcherGeometryOverrideEffect`}function be(e){return e.type===`CIMGeometricEffectCircularSector`||e.type===`CIMGeometricEffectTaperedPolygon`}function xe(e,t){let n=e.filter(e=>e.type===`CIMSolidFill`),r=e.every(e=>e.type===`CIMSolidFill`||e.type===`CIMSolidStroke`),i=e.filter(e=>e.effects?.length),a=i.length===0||i.length===1&&n.length===1&&i[0]===n[0];return n.length>0&&r&&a&&t.some(({effect:e})=>be(e))}function Se(e){return e.some(e=>e.type!==`CIMSolidFill`&&e.type!==`CIMSolidStroke`&&(e.type!==`CIMVectorMarker`&&e.type!==`CIMPictureMarker`||e.markerPlacement!=null))}function Ce(e,t){return!!(t?.some(e=>e.type===`CIMGeometricEffectRadial`)&&t?.some(e=>e.type===`CIMGeometricEffectTaperedPolygon`)||t?.some(e=>e.type===`CIMGeometricEffectCircularSector`))&&Q(e)}function Q(e){if(e?.length!==2)return!1;let t=e.find(e=>e.type===`CIMSolidFill`),n=e.find(e=>e.type===`CIMSolidStroke`),r=n?.effects?.some(e=>e.type===`CIMGeometricEffectDashes`);return t!=null&&n!=null&&!r}function we(e){return n(e).map(e=>({...e,propertyName:re(e.propertyName)}))}function $(e){return v(e)?{type:`animation-params`,params:e}:null}export{pe as CIMAnalyzer,ge as analyzeCIMResource};
|
|
2
|
+
import{isRGB as e}from"../../core/colorUtils.js";import{getFontFamily as t}from"../../core/fontUtils.js";import"../../core/has.js";import{clone as n}from"../../core/lang.js";import r from"../../core/Logger.js";import{pt2px as i,px2pt as a}from"../../core/screenUtils.js";import{numericHash as o}from"../../core/string.js";import{isCurvedGeometry as s}from"../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as c}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{checkForAnimations as l,globalRotation as u,getAnimationParams as d,handleAbsoluteAnchor as f,handleMarker as p,handleRelativeAnchor as m,getFrameTranslation as h,translate as g,getStaticParam as _,shouldUseAnimatedPath as v}from"./animationUtils.js";import{CIMSymbolInflatedSizeHelper as y,CIMSymbolHelper as b,forEachSymbolLayer as x}from"./CIMSymbolHelper.js";import{antialiasingOutlineFillSettings as S}from"./constants.js";import{defaultCIMValues as C}from"./defaultCIMValues.js";import{fitVectorMarker as w}from"./fitVectorMarker.js";import{fromCIMFontStyle as T}from"./fromCIMFontStyle.js";import{OverrideHelper as E}from"./OverrideHelper.js";import{hasRichTextFormattingTags as D}from"./richTextUtils.js";import{getSDFInfo as O,getExtent as k,getSDFMetrics as A,getSDFDimensions as j}from"./SDFHelper.js";import{CIMSymbolUnits as M}from"./types.js";import{colorToArray as N,normalizeAlpha as P,getSize as F,isCIMMarkerStrokePlacement as I,hasStrokeLayer as L,getNumericValue as R,getMaxStrokeWidth as z,getTintColor as B,normalizePrimitiveOverrideProps as V,getDefaultCIMValue as H,getEnum as U,getFillColor as W,getStrokeColor as G,fromCIMFontDecoration as K,getStrokeWidth as q,fromCIMVerticalAlignment as ee,fromCIMHorizontalAlignment as te,getTextCasing as J,isValidCIMValue as ne,uncapitalize as re}from"./utils.js";import{isSupportedCallout as ie,getPointSymbolCalloutTransforms as ae,normalizePointSymbolCalloutScale as oe,normalizeLeaderLineStyle as Y,getPointSymbolCalloutFitProperties as se,normalizeBalloonCalloutStyle as ce}from"./callouts/calloutAnalysisUtils.js";import{EffectHelper as le}from"./effects/EffectHelper.js";import{rasterizedVectorMarkerMinSize as ue,randomInsidePolygonTextureSize as de}from"../../views/2d/engine/webgl/definitions.js";const X=()=>r.getLogger(`esri.symbols.cim.cimAnalyzer`);function fe(e){let t=e.markerPlacement;return t&&t.angleToLine?1:0}class pe{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],this._hasTextStringTemplates=!1,e&&(this._resourceManager=e)}analyzeSymbolReference(t,n,r){if(this._cimLayers=r??[],!t)return this._cimLayers;if(this._reset(),this._hasTextStringTemplates=t.hasTextStringTemplates??!1,t.primitiveOverrides){this._primitiveOverrides=t.primitiveOverrides;for(let t of this._primitiveOverrides){let n=t.valueExpressionInfo;if(n)this._setPoMap(t.primitiveName,t.propertyName,n);else if(t.value!=null){let n=t.value;t.propertyName.includes(`Color`)&&(e(n)&&(n=N(n)),n=P(n)),this._setPoMap(t.primitiveName,t.propertyName,n)}}}return this._analyzeSymbol(t.symbol,n),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case`CIMPointSymbol`:case`CIMLineSymbol`:case`CIMPolygonSymbol`:this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){let n=e?.symbolLayers;if(!n)return;for(let e=0;e<n.length;e++){let t=n[e];t.type===`CIMVectorMarker`&&(n[e]=w(t))}let r=e.effects,i=0,a=F(e)??0;e.type===`CIMPointSymbol`&&e.angleAlignment===`Map`&&(i=1);let o={transform:[0,0,0,1],fromColor:[1,1,1,1],toColor:[1,1,1,1],colorMix:[0,0,0,0],toOpacity:[1,1,1,1],opacityMix:[0,0,0,0],shift:[1,1,1,1],hasAnimations:l(e),hasShiftAnimation:!1,hasMotionAnimations:!1};o=u(o),o=d(this._poMap,e,o);let s=null;e.type===`CIMPointSymbol`&&(s=this._analyzePointSymbolHalo(e,i,a,r,o),this._analyzeCallout(e,null,[],o,a,i,t));let c=s?n.filter(e=>e!==s):n;if(Ce(c,r))return this._analyzeCompositeOutlineFill(c,r,a);this._analyzeSymbolLayer(s?{...e,symbolLayers:c}:e,null,[],o,a,i,t)}_analyzeSymbolLayer(e,t,n,r,i,a,o){let s=e?.symbolLayers;if(!s)return;let c=e.type===`CIMPolygonSymbol`,l=e.effects,u=s.length;for(;u--;){let d=s[u];if(!d||d.enable===!1)continue;let f;l?.length&&(f=[...l]);let p=d.effects;p?.length&&(l?f.push(...p):f=[...p]);let m=t?[...t]:null;if(f){m??=[];for(let e of f){let t=E.findEffectOverrides(e,this._primitiveOverrides);t&&m.push(t)}}E.findApplicableOverrides(d,this._primitiveOverrides,[]);let h=this._cimLayers.length;switch(d.type){case`CIMSolidFill`:this._analyzeSolidFill(d,m,r,L(s));break;case`CIMPictureFill`:this._analyzePictureFill(d,m,r);break;case`CIMHatchFill`:this._analyzeHatchFill(d,m,r);break;case`CIMGradientFill`:this._analyzeGradientFill(d,m);break;case`CIMSolidStroke`:this._analyzeSolidStroke(d,m,c,i,r);break;case`CIMPictureStroke`:this._analyzePictureStroke(d,m,c,i,r);break;case`CIMGradientStroke`:this._analyzeGradientStroke(d,m,c,i);break;case`CIMCharacterMarker`:case`CIMPictureMarker`:case`CIMVectorMarker`:{(e.type===`CIMLineSymbol`||e.type===`CIMPolygonSymbol`)&&(a=fe(d));let t=[],s=d.primitiveName;s&&t.push(s);let l=c&&I(d.markerPlacement);this._analyzeMarker(d,m,null,t,a,i,o,n,r,!1,l);break}default:X().error(`Cannot analyze CIM layer`,d.type)}if(m?.some(({effect:e})=>Z(e)))for(let e=h;e<this._cimLayers.length;e++)this._cimLayers[e].effectsChangeGeometryType=!0}}_analyzePointSymbolHalo(e,t,r,i,o){let{haloSymbol:s}=e,c=R(e.haloSize,0);if(c<=0||!s?.symbolLayers)return null;let u=s.symbolLayers.filter(e=>e.enable!==!1),f=u[0];if(!f)return null;let p=u.length===1&&f.type===`CIMSolidFill`;if(e.symbolLayers?.some(e=>l(e))===!0||l(s))return X().warnOnce(`CIM point symbol halos do not support independently animated symbol components`),null;let m=i?.map(e=>E.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>e!=null);if(m?.some(({effect:e})=>Z(e))){if(!p)return X().warnOnce(`Complex CIM point symbol halos are not supported with geometry-changing effects`),null;let t=e.symbolLayers?.filter(e=>e.enable!==!1)??[];if(!xe(t,m))return X().warnOnce(`CIM point symbol halos with geometry-changing effects currently require polygon-producing effects and an unambiguous solid-fill effect chain`),null;let n=t.find(e=>e.type===`CIMSolidFill`);if(!n)return null;let i=[...m,...(n.effects??[]).map(e=>E.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>e!=null)],a=z(t),o=this._getValueOrOverrideExpression(f.type,f.primitiveName,`Color`,P(f.color));return this._cimLayers.push({type:`outlineFill`,name:n.name,colorLocked:!!n.colorLocked,color:this._getValueOrOverrideExpression(n.type,n.primitiveName,`Color`,P(n.color)),effects:i,effectsChangeGeometryType:!0,outlineColorLocked:!0,outlineColor:o,outlineWidth:c+a,cap:`Round`,join:`Round`,referenceWidth:r,pixelBufferSize:c+a,outlineEffects:i}),n}let h=e.symbolLayers?.filter(e=>e.enable!==!1)??[],g=h.length===1&&h[0].type===`CIMVectorMarker`?h[0]:null,_=n(e);if(_.effects=void 0,_.angle=0,_.scaleX=1,g){let e=_.symbolLayers?.find(e=>e.type===`CIMVectorMarker`&&e.enable!==!1);e&&(e.rotation=0,e.offsetX=0,e.offsetY=0)}let v={..._,haloSize:0,haloSymbol:void 0},x=y.getPointSymbolHaloPadding(e,this._resourceManager),[S,C,w]=b.getTextureAnchor(v,this._resourceManager,ue,x),T=a(w),D=[];E.findApplicableOverrides(_,this._primitiveOverrides,D);let k=g?D.filter(e=>e.primitiveName!==g.primitiveName||![`Rotation`,`OffsetX`,`OffsetY`].includes(e.propertyName)):D,A=g?[{offsetX:this._getValueOrOverrideExpression(g.type,g.primitiveName,`OffsetX`,R(g.offsetX)),offsetY:this._getValueOrOverrideExpression(g.type,g.primitiveName,`OffsetY`,R(g.offsetY)),rotation:this._getValueOrOverrideExpression(g.type,g.primitiveName,`Rotation`,R(g.rotation)),size:T,frameHeight:T,rotateClockWise:!!g.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:!1}]:[],j=$(p?d(this._poMap,f,o):o),M,N;if(j){let e=b.getEnvelope(v,null,this._resourceManager);e&&(M=[e.width,e.height],N=[e.width+2*x,e.height+2*x])}return this._cimLayers.push({type:`marker`,spriteRasterizationParam:{type:`sprite-rasterization-param`,resource:{type:`cim-point-symbol-halo`,symbol:_,sdf:!j&&p&&O(v)!=null},overrides:k},colorLocked:!0,color:p?this._getValueOrOverrideExpression(f.type,f.primitiveName,`Color`,P(f.color)):[255,255,255,1],effects:m??null,effectsChangeGeometryType:m?.some(({effect:e})=>Z(e)),scaleSymbolsProportionally:!1,alignment:t,anchorPoint:{x:S,y:C},isAbsoluteAnchorPoint:!1,size:T,scaleX:R(e.scaleX,1),rotation:g?0:R(e.angle,0),offsetX:0,offsetY:0,outlineColor:[0,0,0,0],outlineWidth:0,transform:{type:`cim-marker-transform-param`,params:A},frameHeight:T,widthRatio:1,rotateClockwise:!1,referenceSize:r||T,sizeRatio:1,markerPlacement:null,isOutline:!1,animationParams:j,baseSize:r||T,pixelDimensions:M,texelDimensions:N}),null}_analyzeSolidFill(e,t,n,r){let{primitiveName:i,type:a}=e,o=P(e.color),s=d(this._poMap,e,n);if(!r&&t?.some(e=>e.effect.type===`CIMGeometricEffectTaperedPolygon`)){let n=this._getValueOrOverrideExpression(a,i,`Color`,o);this._cimLayers.push({type:`outlineFill`,name:e.name,colorLocked:!!e.colorLocked,color:n,effects:t,outlineColor:n,outlineColorLocked:!!e.colorLocked,...S,outlineEffects:t});return}this._cimLayers.push({type:`fill`,name:e.name,spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(a,i,`Color`,o),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1,animationParams:$(s)})}_analyzePictureFill(e,t,n){let{primitiveName:r,type:i}=e,a=B(e),o=R(e.height,C.CIMPictureFill.height),s=R(e.scaleX,1);if(`width`in e&&typeof e.width==`number`){let t=e.width,n=1,r=this._resourceManager.getResource(e.url);r!=null&&(n=r.width/r.height),s/=o/t*n}let c={type:`sprite-rasterization-param`,resource:e,overrides:this._getPrimitiveMaterialOverrides(r,i)},l=d(this._poMap,e,n);this._cimLayers.push({type:`fill`,name:e.name,spriteRasterizationParam:c,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(i,r,`TintColor`,a),height:this._getValueOrOverrideExpression(i,r,`Height`,o),scaleX:this._getValueOrOverrideExpression(i,r,`ScaleX`,s),angle:this._getValueOrOverrideExpression(i,r,`Rotation`,R(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,r,`OffsetX`,R(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,r,`OffsetY`,R(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1,animationParams:$(l)})}_analyzeHatchFill(e,t,n){let{primitiveName:r,type:i}=e,a=d(this._poMap,e,n),o=this._analyzeMaterialOverrides(r,[`Rotation`,`OffsetX`,`OffsetY`]),s=V(o),c=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(let t of e.lineSymbol.symbolLayers){if(t.type!==`CIMSolidStroke`)continue;let e=t.primitiveName??r;!l&&e&&!t.colorLocked&&(this._poMap[e]?.Color!=null||this._poMap[e]?.StrokeColor!=null)&&(c=P(t.color),c=this._maybeGetValueOrOverrideExpression(e,`StrokeColor`)??this._getValueOrOverrideExpression(i,e,`Color`,c),l=!0);let n=this._maybeGetValueOrOverrideExpression(e,`StrokeWidth`);if(n){let t=null,r=null;typeof n==`number`?t=n:r=n.valueExpressionInfo;let a=s.find(e=>e.propertyName===`strokeWidth`);a?a.propertyName=`width`:(a={type:`CIMPrimitiveOverride`,primitiveName:e,propertyName:`width`,valueExpressionInfo:r,value:t,defaultValue:H(i,`width`)},s.push(a))}}let u={type:`sprite-rasterization-param`,resource:e,overrides:s};this._cimLayers.push({type:`fill`,name:e.name,spriteRasterizationParam:u,colorLocked:!!e.colorLocked,effects:t,color:c,height:this._getValueOrOverrideExpression(i,r,`Separation`,R(e.separation,C.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(i,r,`Rotation`,R(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,r,`OffsetX`,R(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,r,`OffsetY`,R(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l,animationParams:$(a)})}_analyzeGradientFill(e,t){let{angle:n,gradientMethod:r,gradientSize:i,gradientSizeUnits:a,gradientType:o,interval:s,primitiveName:c,type:l}=e,u=C.CIMGradientFill,d=e.colorRamp;this._cimLayers.push({type:`gradientFill`,name:e.name,spriteRasterizationParam:{type:`sprite-rasterization-param`,resource:e,overrides:this._getPrimitiveMaterialOverrides(c,l)},colorLocked:!1,effects:t,color:[255,255,255,1],gradientMethod:this._getValueOrOverrideExpression(l,c,`GradientMethod`,r??`Linear`),angle:this._getValueOrOverrideExpression(l,c,`Angle`,R(n,u.angle)),gradientType:this._getValueOrOverrideExpression(l,c,`GradientType`,o??u.gradientType),interval:this._getValueOrOverrideExpression(l,c,`Interval`,R(s,d.type===`CIMFixedColorRamp`?d.colors.length:u.interval)),gradientSize:this._getValueOrOverrideExpression(l,c,`GradientSize`,R(i,u.gradientSize)),gradientSizeUnits:a===`Absolute`?M.Absolute:a===`Relative`?M.Relative:u.gradientSizeUnits})}_analyzeCompositeOutlineFill(e,t,n,r=[]){let i=e.find(e=>e.type===`CIMSolidFill`),a=e.find(e=>e.type===`CIMSolidStroke`);if(i==null||a==null)return;let o=[...r,...[...t??[],...i.effects??[]].map(e=>E.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>e!=null)],s=[...r,...[...t??[],...a.effects??[]].map(e=>E.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>e!=null)],c=R(a.width,C.CIMSolidStroke.width),l=U(a.capStyle,C.CIMSolidStroke.capstyle),u=U(a.joinStyle,C.CIMSolidStroke.joinstyle),d=a.miterLimit;this._cimLayers.push({type:`outlineFill`,name:i.name,colorLocked:!!i.colorLocked,color:this._getValueOrOverrideExpression(i.type,i.primitiveName,`Color`,P(i.color)),effects:o,effectsChangeGeometryType:o.some(({effect:e})=>Z(e))||s.some(({effect:e})=>Z(e)),outlineColorLocked:!!a.colorLocked,outlineColor:this._getValueOrOverrideExpression(a.type,a.primitiveName,`Color`,P(a.color)),outlineWidth:this._getValueOrOverrideExpression(a.type,a.primitiveName,`Width`,c),cap:this._getValueOrOverrideExpression(a.type,a.primitiveName,`CapStyle`,l),join:this._getValueOrOverrideExpression(a.type,a.primitiveName,`JoinStyle`,u),miterLimit:d&&this._getValueOrOverrideExpression(a.type,a.primitiveName,`MiterLimit`,d),referenceWidth:n,outlineEffects:s})}_analyzeSolidStroke(e,t,n,r,i){let{primitiveName:a,type:o}=e,s=P(e.color),c=R(e.width,C.CIMSolidStroke.width),l=U(e.capStyle,C.CIMSolidStroke.capstyle),u=U(e.joinStyle,C.CIMSolidStroke.joinstyle),f=e.miterLimit,p=this._analyzePrimitiveOverrides(a,t,null,null),m=[];p&&(m=this._getPrimitiveMaterialOverrides(a,o));let h,g,_,v;if(t&&Array.isArray(t)&&t.length>0){let e=t[t.length-1].effect;e&&e.type===`CIMGeometricEffectDashes`&&e.lineDashEnding===`NoConstraint`&&(h=e.dashTemplate,g=e.scaleDash,_=e.offsetAlongLine,v=e.primitiveName,t=[...t],t.pop())}v!=null&&m.push(...this._getPrimitiveMaterialOverrides(v,o).filter(e=>e.propertyName===`dashTemplate`));let y=h===void 0?null:{type:`sprite-rasterization-param`,resource:{type:`dash`,dashTemplate:h,primitiveName:v},overrides:m},b=d(this._poMap,e,i);this._cimLayers.push({type:`line`,name:e.name,spriteRasterizationParam:y,isOutline:n,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,a,`Color`,s),width:this._getValueOrOverrideExpression(o,a,`Width`,c),cap:this._getValueOrOverrideExpression(o,a,`CapStyle`,l),join:this._getValueOrOverrideExpression(o,a,`JoinStyle`,u),miterLimit:f&&this._getValueOrOverrideExpression(o,a,`MiterLimit`,f),referenceWidth:r,zOrder:he(e.name),dashTemplate:this._maybeGetValueOrOverrideExpression(v,`DashTemplate`)??h,offsetAlongLine:this._getValueOrOverrideExpression(o,v,`OffsetAlongLine`,_??0),scaleDash:g,sampleAlphaOnly:!0,animationParams:$(b)})}_analyzePictureStroke(e,t,n,r,i){let{primitiveName:a,type:o}=e,s=B(e),c=R(e.width,C.CIMPictureStroke.width),l=U(e.capStyle,C.CIMPictureStroke.capstyle),u=U(e.joinStyle,C.CIMPictureStroke.joinstyle),f=e.miterLimit,p={type:`sprite-rasterization-param`,resource:e,overrides:this._getPrimitiveMaterialOverrides(a,o)},m=d(this._poMap,e,i);this._cimLayers.push({type:`line`,name:e.name,spriteRasterizationParam:p,isOutline:n,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,a,`TintColor`,s),width:this._getValueOrOverrideExpression(o,a,`Width`,c),cap:this._getValueOrOverrideExpression(o,a,`CapStyle`,l),join:this._getValueOrOverrideExpression(o,a,`JoinStyle`,u),miterLimit:f&&this._getValueOrOverrideExpression(o,a,`MiterLimit`,f),referenceWidth:r,zOrder:he(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1,animationParams:$(m)})}_analyzeGradientStroke(e,t,n,r){let{gradientMethod:i,gradientSize:a,gradientSizeUnits:o,gradientType:s,interval:c,primitiveName:l,type:u}=e,d=C.CIMGradientStroke,f=R(e.width,d.width),p=U(e.capStyle,d.capstyle),m=U(e.joinStyle,d.joinstyle),h=e.miterLimit,g=e.colorRamp;this._cimLayers.push({type:`gradientStroke`,name:e.name,spriteRasterizationParam:{type:`sprite-rasterization-param`,resource:e,overrides:this._getPrimitiveMaterialOverrides(l,u)},colorLocked:!!e.colorLocked,effects:t,color:[255,255,255,1],width:this._getValueOrOverrideExpression(u,l,`Width`,f),cap:this._getValueOrOverrideExpression(u,l,`CapStyle`,p),join:this._getValueOrOverrideExpression(u,l,`JoinStyle`,m),miterLimit:h&&this._getValueOrOverrideExpression(u,l,`MiterLimit`,h),referenceWidth:r,isOutline:n,gradientMethod:this._getValueOrOverrideExpression(u,l,`GradientMethod`,i??d.gradientMethod),gradientType:this._getValueOrOverrideExpression(u,l,`GradientType`,s??d.gradientType),interval:this._getValueOrOverrideExpression(u,l,`Interval`,R(c,g.type===`CIMFixedColorRamp`?g.colors.length:d.interval)),gradientSize:this._getValueOrOverrideExpression(u,l,`GradientSize`,R(a,d.gradientSize)),gradientSizeUnits:o===`Absolute`?M.Absolute:o===`Relative`?M.Relative:d.gradientSizeUnits})}_analyzeMarker(e,t,n,r,i,a,o,s,c,l=!1,u=!1){l||=!!e.colorLocked;let h=c;if(h=f(e,h),h=p(this._poMap,e,h),h=m(e,h),h=d(this._poMap,e,h),this._analyzeMarkerInsidePolygon(e,t,l,h))return;let g=R(e.size,C.CIMVectorMarker.size),_=R(e.rotation),v=R(e.offsetX),y=R(e.offsetY),{primitiveName:b,type:x}=e,S=this._getValueOrOverrideExpression(x,b,`Size`,g),w=this._getValueOrOverrideExpression(x,b,`Rotation`,_),T=this._getValueOrOverrideExpression(x,b,`OffsetX`,v),E=this._getValueOrOverrideExpression(x,b,`OffsetY`,y);switch(e.type){case`CIMPictureMarker`:this._analyzePictureMarker(e,t,n,r,i,a,S,w,T,E,s,h,l,u);break;case`CIMVectorMarker`:this._analyzeVectorMarker(e,t,n,r,i,a,S,w,T,E,s,h,o,l,u)}}_analyzeMarkerInsidePolygon(e,t,n,r){let{markerPlacement:i,type:o}=e;if(!i||i.type!==`CIMMarkerPlacementInsidePolygon`||r.hasMotionAnimations)return!1;if(o===`CIMVectorMarker`||o===`CIMPictureMarker`){let n=e.primitiveName;if(n&&this._analyzePrimitiveOverrides([n],t,null,null))return!1;let r=i.primitiveName;if(r&&this._analyzePrimitiveOverrides([r],t,null,null))return!1;if(o===`CIMVectorMarker`){let{markerGraphics:t}=e;if(t)for(let e of t){let{symbol:t}=e;if(t?.type===`CIMPolygonSymbol`&&t.symbolLayers){let{symbolLayers:e}=t;for(let t of e)if(t.type===`CIMSolidStroke`)return!1}}}else{let{animatedSymbolProperties:t}=e;if(t)return!1}}let s=Math.abs(i.stepX),c=Math.abs(i.stepY);if(s===0||c===0)return!0;let l,u;if(i.gridType===`Random`){let e=a(de),t=Math.max(Math.floor(e/s),1);l=c*Math.max(Math.floor(e/c),1),u=t*s/l}else i.shiftOddRows?(l=c*2,u=s/c*.5):(l=c,u=s/c);let d=B(e),f=e.type===`CIMCharacterMarker`?null:{type:`sprite-rasterization-param`,resource:{...e,effects:e.effects?.filter(e=>!ye(e))},overrides:[]};return this._cimLayers.push({type:`fill`,name:e.name,spriteRasterizationParam:f,colorLocked:n,effects:t,color:d,height:l,scaleX:u,angle:i.gridAngle??0,offsetX:R(i.offsetX),offsetY:R(i.offsetY),applyRandomOffset:i.gridType===`Random`,sampleAlphaOnly:e.type!==`CIMPictureMarker`,hasUnresolvedReplacementColor:!0,animationParams:$(r)}),!0}_analyzePictureMarker(e,t,r,i,a,s,c,l,u,d,f,p,m,h){let{animatedSymbolProperties:g,primitiveName:_,type:v}=e,y=R(e.scaleX,1),b=B(e);r||=this._createMarkerPlacementOverrideExpression(e.markerPlacement);let x=this._createGIFAnimatedSymbolPropertiesOverrideExpression(g),S=e.anchorPoint??{x:0,y:0};if(`width`in e&&typeof e.width==`number`){let t=e.width,n=1,r=this._resourceManager.getResource(e.url);r!=null&&(n=r.width/r.height);let i=R(e.size);y/=i/t*n}let C=[...i];e.primitiveName&&C.push(e.primitiveName);let w;g||x?w={type:`animated`,url:e.url,urlHash:`H`+o(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(w=n(e),w.markerPlacement=null);let T={type:`sprite-rasterization-param`,resource:w,overrides:this._getMaterialOverrides(C,v)};x&&T.overrides.push(...x.overrides);let E=c;this._cimLayers.push({type:`marker`,name:e.name,spriteRasterizationParam:T,colorLocked:m,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:c,scaleX:this._getValueOrOverrideExpression(v,_,`ScaleX`,y),rotation:l,offsetX:u,offsetY:d,transform:{type:`cim-marker-transform-param`,params:f},color:this._getValueOrOverrideExpression(v,_,`TintColor`,b),anchorPoint:{x:S.x,y:S.y},isAbsoluteAnchorPoint:e.anchorPointUnits!==`Relative`,outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:s,sizeRatio:1,isOutline:h,markerPlacement:r,animationParams:$(p),baseSize:E})}_analyzeVectorMarker(e,t,n,r,i,a,o,l,u,d,f,p,m,v,y){let b=e.markerGraphics;if(!b)return;let x=e.frame,S=0;S=x?x.ymax-x.ymin:a;let C=!!e.scaleSymbolsProportionally;if(S){let t={offsetX:u,offsetY:d,rotation:l,size:o,frameHeight:S,rotateClockWise:!!e.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:C};f=[...f,t]}n||=this._createMarkerPlacementOverrideExpression(e.markerPlacement);for(let o of b)if(o){let l=o.symbol;if(!l)continue;let u=o.primitiveName;u&&r.push(u);let d=p,b;if((l.type===`CIMPointSymbol`||l.type===`CIMTextSymbol`)&&x){let t=0,n=0,r=o.geometry;`x`in r&&`y`in r&&(t+=r.x-(x.xmin+x.xmax)*.5,n+=r.y-(x.ymin+x.ymax)*.5);let i=e.anchorPoint,a=!1;i&&(e.anchorPointUnits===`Absolute`?(t-=i.x,n-=i.y,a=!0):x&&(t-=(x.xmax-x.xmin)*i.x,n-=(x.ymax-x.ymin)*i.y));let s={offsetX:t,offsetY:n,rotation:0,size:0,frameHeight:0,rotateClockWise:!1,absoluteAnchorPoint:a,scaleSymbolsProportionally:C};b=[...f,s]}(l.type===`CIMPointSymbol`||l.type===`CIMTextSymbol`)&&this._analyzeCallout(l,t,b??f,d,a,i,m);let w=s(o.geometry)?{...o,geometry:c(o.geometry,{maxDeviation:.01})}:o,T=w.geometry,[E,D]=h(T,x);switch((E!==0||D!==0)&&(d=g(d,E,D)),l.type){case`CIMPointSymbol`:case`CIMLineSymbol`:case`CIMPolygonSymbol`:m||ve(l)?(d={...d,transform:{type:`AnimatedTransform`,relativeTranslation:!1,absoluteScale:!0,selectGlobalRotation:!1,translation:_([0,0]),rotation:_(0),scale:_(S),parent:p.transform}},this._analyzeMultiLayerGraphicNonSDF(e,t,n,w,r,i,a,b??f,d,S,v,y)):this._analyzeMultiLayerGraphic(e,t,n,w,r,i,a,b??f,d,S,v,y);break;case`CIMTextSymbol`:this._analyzeTextGraphic(t,n,w,r,i,a,b??f,v)}u&&r.pop()}}_analyzeCallout(e,t,n,r,i,a,o){let s=e.callout;if(!s||!ie(s))return;let c=t??[],{leaderTolerance:l,leaderOffset:u}=s;switch(s.type){case`CIMSimpleLineCallout`:{let{lineSymbol:e,autoSnap:t}=s,d={type:`CIMSimpleLineCallout`,leaderTolerance:l,leaderOffset:u,autoSnap:t,inflateSize:500};this._analyzeSymbolLayer(e,[...c,{type:`cim-effect-param`,effect:d,overrides:[]}],n,r,i,a,o);break}case`CIMBackgroundCallout`:{let{accentBarSymbol:e,gap:t,backgroundSymbol:d,leaderLineSymbol:f,lineStyle:p,margin:m}=s,h=n=>({type:`CIMBackgroundCallout`,leaderTolerance:l,leaderOffset:u,lineStyle:Y(p),gap:t,hasAccentBar:!!e,margin:m,inflateSize:500,part:n}),g=[...c,{type:`cim-effect-param`,effect:h(`background`),overrides:[]}];if(f&&this._analyzeSymbolLayer(f,[...c,{type:`cim-effect-param`,effect:h(`leader`),overrides:[]}],n,r,i,a,o),d){let e=d.symbolLayers??[];Q(e)?this._analyzeCompositeOutlineFill(e,null,i,g):this._analyzeSymbolLayer(d,g,n,r,i,a,o)}e&&this._analyzeSymbolLayer(e,[...c,{type:`cim-effect-param`,effect:h(`accent-bar`),overrides:[]}],n,r,i,a,o);break}case`CIMBalloonCallout`:{let{balloonStyle:e,backgroundSymbol:t,dartSymbol:d,fixedDartWidth:f,margin:p,useDartSymbol:m,useFixedDartWidth:h}=s,g=m===!0&&d!=null,_=t=>({type:`CIMBalloonCallout`,leaderTolerance:l,leaderOffset:u,margin:p,balloonStyle:ce(e),dartWidth:h?f:void 0,inflateSize:500,part:t,separateDart:g}),v=(e,t)=>{let s=[...c,{type:`cim-effect-param`,effect:_(t),overrides:[]}],l=e.symbolLayers??[];Q(l)?this._analyzeCompositeOutlineFill(l,null,i,s):this._analyzeSymbolLayer(e,s,n,r,i,a,o)};g&&v(d,`dart`),v(t,`background`);break}case`CIMPointSymbolCallout`:{let{backgroundScale:e,gap:t,leaderLineSymbol:d,lineStyle:f,pointSymbol:p}=s,m=oe(e),h=ae(p,n),g=e=>({type:`CIMPointSymbolCallout`,leaderTolerance:l,leaderOffset:u,backgroundScale:m,...se(p,e),lineStyle:Y(f),gap:t,inflateSize:500,part:e});d&&this._analyzeSymbolLayer(d,[...c,{type:`cim-effect-param`,effect:g(`leader`),overrides:[]}],n,r,i,a,o),this._analyzeSymbolLayer(p,[...c,{type:`cim-effect-param`,effect:g(`marker`),overrides:[]}],h,r,i,a,o||m!==0);break}case`CIMCompositeCallout`:{let{backgroundSymbol:e,margin:t,shadowSymbol:d}=s,f={type:`CIMBalloonCallout`,leaderTolerance:l,leaderOffset:u,margin:t,balloonStyle:1,inflateSize:500,part:`background`},p=[...c,{type:`cim-effect-param`,effect:f,overrides:[]}],m=e=>{let t=e.symbolLayers??[];Q(t)?this._analyzeCompositeOutlineFill(t,null,i,p):this._analyzeSymbolLayer(e,p,n,r,i,a,o)};d&&m(d),m(e);break}}}_analyzeMultiLayerGraphic(e,t,n,r,i,a,o,s,c,l,u,d){let f=r.symbol,p=f.symbolLayers;if(p){if(_e(p)&&!v(c)){this._analyzeCompositeMarkerGraphic(e,t,n,r,p,a,o,s,l,u,d);return}if(Se(p)){x(f,e=>{e.colorLocked&&(u=!0)}),this._analyzeMultiLayerGraphicNonSDF(e,t,n,r,i,a,o,s,c,l,u,d);return}this._analyzeMarkerGraphicSymbolLayers(e,t,n,r,i,a,o,s,c,l,u,d)}}_analyzeMarkerGraphicSymbolLayers(e,t,n,r,i,a,o,s,c,l,u,f){let p=r.symbol,m=p.symbolLayers;if(!m)return;let h=le.applyEffects(p.effects,r.geometry);if(!h)return;let g=m.length;for(;g--;){let p=m[g];if(!p||p.enable===!1)continue;let _=p.primitiveName;switch(_&&i.push(_),p.type){case`CIMSolidFill`:case`CIMSolidStroke`:{let i=le.applyEffects(p.effects,h),m=k(i);if(!m)continue;let g=e.anchorPointUnits!==`Relative`,v=p.type===`CIMSolidStroke`?p.width:0,{frameSizeRatio:y,anchorX:b,anchorY:x,widthRatio:S,sdfPaddingRatio:w,sdfTextureSize:T}=A(m,e.frame,e.size,e.anchorPoint,g,v,e.scaleSymbolsProportionally),E=p.type===`CIMSolidFill`,D={type:`sdf`,geometry:i,sdfPaddingRatio:w,asFill:E,sdfTextureSize:T},{path:O}=p,M=E?P(W(p)):O==null?P(G(p)):[0,0,0,0],N=E?[0,0,0,0]:P(G(p));if(!E&&!v)break;let F=r.primitiveName,I=null;E&&!p.colorLocked&&(I=this._maybeGetValueOrOverrideExpression(F,`FillColor`));let L=null;!E&&!p.colorLocked&&(L=this._maybeGetValueOrOverrideExpression(F,`StrokeColor`));let z=I??this._getValueOrOverrideExpression(p.type,_,`Color`,M),B=L??this._getValueOrOverrideExpression(p.type,_,`Color`,N),V=this._maybeGetValueOrOverrideExpression(F,`StrokeWidth`)??this._getValueOrOverrideExpression(p.type,_,`Width`,v),H=O?{type:`sprite-rasterization-param`,resource:{type:`path`,path:O,asFill:E},overrides:[]}:{type:`sprite-rasterization-param`,resource:D,overrides:[]},U=d(this._poMap,p,c),K=R(e.size,C.CIMVectorMarker.size),q=this._getValueOrOverrideExpression(e.type,e.primitiveName,`Size`,K);this._cimLayers.push({type:`marker`,name:p.name,groupName:e.name,spriteRasterizationParam:H,colorLocked:!!p.colorLocked||!!u,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:b,y:x},isAbsoluteAnchorPoint:g,size:l,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:`cim-marker-transform-param`,params:s},frameHeight:l,widthRatio:S,rotateClockwise:!1,referenceSize:o,sizeRatio:y,color:z,outlineColor:B,outlineWidth:V,isOutline:f,markerPlacement:n,animationParams:$(U),isStroke:p.type!==`CIMSolidFill`,baseSize:q,...j(i,T,w)});break}case`CIMPictureMarker`:case`CIMVectorMarker`:if(p.markerPlacement){X().error(`Error analyzing CIM, got unexpected marker placement`);break}this._analyzeMarker(p,t,n,i,a,o,!1,s,c,u,f)}_&&i.pop()}}_analyzeTextGraphic(e,n,r,i,a,o,s,c){E.findApplicableOverrides(r,this._primitiveOverrides,[]);let l=r.geometry;if(!(`x`in l)||!(`y`in l))return;let u=r.symbol,d=K(u),f=T(u.fontStyleName),p=t(u.fontFamilyName);u.font={family:p,decoration:d,...f};let m=R(u.height,C.CIMTextSymbol.height),h=R(u.angle),g=R(u.offsetX),_=R(u.offsetY),{haloSymbol:v}=u,y=R(u.haloSize,0),b=[0,0,0,0];if(v?.symbolLayers?.length){let e=v.symbolLayers;for(let t of e)if(t.color){b=this._getValueOrOverrideExpression(u?.haloSymbol?.type??`CIMPolygonSymbol`,t.primitiveName,`Color`,P(t.color));break}}let x=r.primitiveName,S=[0,0,0,1],w=[0,0,0,0],O=0,k=!1;if(u.symbol?.symbolLayers)for(let e of u.symbol.symbolLayers){let t=e.primitiveName;if(e.type===`CIMSolidStroke`)w=this._getValueOrOverrideExpression(`CIMSolidStroke`,t,`Color`,P(e.color)),O=this._getValueOrOverrideExpression(`CIMSolidStroke`,t,`Width`,q(e)??0);else if(e.type===`CIMSolidFill`){let n=P(e.color);k??=!!e.colorLocked,S=this._getValueOrOverrideExpression(`CIMSolidFill`,t??x,`Color`,n)}}let A=null,j=null,M=null,N=null,F=null;x&&(A=this._maybeGetValueOrOverrideExpression(x,`TextSize`),j=this._maybeGetValueOrOverrideExpression(x,`TextAngle`),M=this._maybeGetValueOrOverrideExpression(x,`TextOffsetX`),N=this._maybeGetValueOrOverrideExpression(x,`TextOffsetY`),k||(F=this._maybeGetValueOrOverrideExpression(x,`FillColor`)));let I=F??S,L=null,z=null,B=0,V=u.callout?.type===`CIMBackgroundCallout`;if(u.callout?.type===`CIMBackgroundCallout`){let e=u.callout;if(e.backgroundSymbol){let t=e.backgroundSymbol.symbolLayers;if(t)for(let e of t)e.type===`CIMSolidFill`?L=P(e.color):e.type===`CIMSolidStroke`&&(z=P(e.color),B=R(e.width,C.CIMSolidStroke.width))}}let H=this._getValueOrOverrideExpression(u.type,r.primitiveName,`TextString`,r.textString??``);if(H==null)return;let{fontStyleName:U}=u,W=p+(U?`-`+U.toLowerCase():`-regular`),G=this._getMaterialOverrides(i,u.type);G.push(...this._getPrimitiveMaterialOverrides(r.primitiveName,u.type)),this._collectDictionaryTemplateOverrides(G,r);let J={type:`text-rasterization-param`,resource:{type:`text`,textString:r.textString??``,font:u.font,symbol:u,primitiveName:r.primitiveName,supportsRichText:D(r.textString??``)||G.some(e=>e.propertyName===`textString`)},overrides:G};this._cimLayers.push({type:`text`,lineWidth:u.lineWidth,textRasterizationParam:J,colorLocked:!!c||!!k,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:W,decoration:d,haloSize:y,haloColor:b,weight:f.weight,style:f.style,size:A??m,angle:j??h,offsetX:M??g,offsetY:N??_,transform:{type:`cim-marker-transform-param`,params:s},horizontalAlignment:te(u.horizontalAlignment),verticalAlignment:ee(u.verticalAlignment),text:H,color:I,outlineColor:w,outlineSize:O,backgroundColor:L,borderLineColor:z,borderLineWidth:B,useBackgroundCallout:V,referenceSize:o,sizeRatio:1,markerPlacement:n})}_collectDictionaryTemplateOverrides(e,t){if(t.textString&&this._hasTextStringTemplates){let n=J(t.symbol);e.push({propertyName:`textString`,defaultValue:``,valueExpressionInfo:{type:`dictionary-template`,textCase:n,template:t.textString},primitiveName:t.primitiveName})}}_analyzeMultiLayerGraphicNonSDF(e,t,n,r,a,o,s,c,l,u,d,f){let p=me(e,r),m=e.primitiveName,h=this._analyzeMaterialOverrides(m,[`Rotation`,`OffsetX`,`OffsetY`]),g=V(h),[_,v,y]=b.getTextureAnchor(p,this._resourceManager,ue),x=this._getMaterialOverrides(a,e.type).filter(e=>e.primitiveName!==m||![`rotation`,`offsetX`,`offsetY`].includes(e.propertyName));x.push(...g);let S={type:`sprite-rasterization-param`,resource:{...p,avoidSDFRasterization:!0},overrides:x},w=R(e.size,C.CIMVectorMarker.size),T=this._getValueOrOverrideExpression(e.type,m,`Size`,w);this._cimLayers.push({type:`marker`,name:e.name,spriteRasterizationParam:S,colorLocked:d,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:_,y:v},isAbsoluteAnchorPoint:!1,size:u,rotation:0,offsetX:0,offsetY:0,transform:{type:`cim-marker-transform-param`,params:c},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:u,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:s,sizeRatio:y/i(e.size),isOutline:f,markerPlacement:n,animationParams:$(l),baseSize:T})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;let t=[];return E.findApplicableOverrides(e,this._primitiveOverrides,t),{type:`cim-marker-placement-param`,placement:e,overrides:we(t)}}_createGIFAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;let t=[];return E.findApplicableOverrides(e,this._primitiveOverrides,t),{type:`cim-gif-animation-params`,animation:e,overrides:we(t)}}_analyzeCompositeMarkerGraphic(e,t,n,r,i,a,o,s,c,l,u){let d=r.geometry,f=i[0],p=i[1],m=k(d);if(!m)return;let h=e.anchorPointUnits!==`Relative`,g=R(f.width,C.CIMSolidStroke.width),{frameSizeRatio:_,anchorX:v,anchorY:y,widthRatio:b,sdfPaddingRatio:x,sdfTextureSize:S}=A(m,e.frame,e.size,e.anchorPoint,h,g,e.scaleSymbolsProportionally),{path:w}=p,T=p.primitiveName,E=f.primitiveName,D=r.primitiveName,O=null;!p.colorLocked&&!l&&(O=this._maybeGetValueOrOverrideExpression(D,`FillColor`));let j=O??this._getValueOrOverrideExpression(p.type,T,`Color`,P(p.color)),M=null;!f.colorLocked&&!l&&(M=this._maybeGetValueOrOverrideExpression(D,`StrokeColor`));let N=M??this._getValueOrOverrideExpression(f.type,E,`Color`,P(f.color)),F=this._maybeGetValueOrOverrideExpression(D,`StrokeWidth`)??this._getValueOrOverrideExpression(f.type,E,`Width`,g),I={type:`sprite-rasterization-param`,resource:w?{type:`path`,path:w,asFill:!0}:{type:`sdf`,geometry:d,sdfTextureSize:S,sdfPaddingRatio:x,asFill:!0},overrides:[]};this._cimLayers.push({type:`marker`,name:e.name,spriteRasterizationParam:I,colorLocked:l,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:v,y},isAbsoluteAnchorPoint:h,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:`cim-marker-transform-param`,params:s},frameHeight:c,widthRatio:b,rotateClockwise:!1,referenceSize:o,sizeRatio:_,color:j,outlineColor:N,outlineWidth:F,isOutline:u,markerPlacement:n})}_setPoMap(e,t,n){let r;this._poMap[e]?r=this._poMap[e]:(r={},this._poMap[e]=r),r[t]=n}_maybeGetValueOrOverrideExpression(e,t,n){return this._getValueOrOverrideExpression(``,e,t,n,!1)}_getValueOrOverrideExpression(e,t,n,r,i=!0){if(i&&!ne(r)&&(r=H(e,n.toLowerCase())),t==null)return r;let a=this._poMap[t];if(a==null)return r;let o=a[n];return typeof o==`string`||typeof o==`number`||Array.isArray(o)?o:o?{valueExpressionInfo:o,defaultValue:r}:r}_analyzePrimitiveOverrides(e,t,n,r){if(e==null)return!1;typeof e==`string`&&(e=[e]);for(let t of this._primitiveOverrides)if(e.includes(t.primitiveName)&&t.valueExpressionInfo)return!0;if(t!=null){for(let e of t)if(e?.overrides.length>0)return!0}if(n!=null){for(let e of n)if(e?.overrides.length>0)return!0}if(r!=null){for(let e of r)if(e?.overrides.length>0)return!0}return!1}_getMaterialOverrides(e,t){if(!e)return[];let n=[];for(let r of e)n.push(...this._getPrimitiveMaterialOverrides(r,t));return n}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];let n=V(this._primitiveOverrides.filter(t=>t.primitiveName===e));return n.forEach(e=>e.defaultValue=H(t,e.propertyName.toLowerCase())),n}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(n=>n.primitiveName!==e||!t.includes(n.propertyName))}}function me(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[{...t}],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}function he(e){if(e?.startsWith(`Level_`)){let t=parseInt(e.slice(6),10);if(!isNaN(t))return t}return 0}function ge(e,t){if(!t||t.length===0)return e;let r=n(e);return E.applyOverrides(r,t),r}const _e=e=>e&&e.length===2&&e[0].enable&&e[1].enable&&e[0].type===`CIMSolidStroke`&&e[1].type===`CIMSolidFill`&&e[0].path==null&&e[1].path==null&&!e[0].effects&&!e[1].effects&&!e[0].animations&&!e[1].animations;function ve(e){let t=e.symbolLayers;if(!t)return!1;let n=t.find(e=>e.effects?.find(e=>e.type===`CIMGeometricEffectDashes`&&e.dashTemplate!=null)),r=t.find(e=>e.effects?.find(e=>e.type===`CIMGeometricEffectAddControlPoints`));return!!n||!!r}function ye(e){return Z(e)}function Z(e){return e.type===`CIMGeometricEffectCircularSector`||e.type===`CIMGeometricEffectRadial`||e.type===`CIMGeometricEffectTaperedPolygon`||e.type===`PrivateDimensionEffect`||e.type===`PrivateMatcherGeometryOverrideEffect`}function be(e){return e.type===`CIMGeometricEffectCircularSector`||e.type===`CIMGeometricEffectTaperedPolygon`}function xe(e,t){let n=e.filter(e=>e.type===`CIMSolidFill`),r=e.every(e=>e.type===`CIMSolidFill`||e.type===`CIMSolidStroke`),i=e.filter(e=>e.effects?.length),a=i.length===0||i.length===1&&n.length===1&&i[0]===n[0];return n.length>0&&r&&a&&t.some(({effect:e})=>be(e))}function Se(e){return e.some(e=>e.type!==`CIMSolidFill`&&e.type!==`CIMSolidStroke`&&(e.type!==`CIMVectorMarker`&&e.type!==`CIMPictureMarker`||e.markerPlacement!=null))}function Ce(e,t){return!!(t?.some(e=>e.type===`CIMGeometricEffectRadial`)&&t?.some(e=>e.type===`CIMGeometricEffectTaperedPolygon`)||t?.some(e=>e.type===`CIMGeometricEffectCircularSector`))&&Q(e)}function Q(e){if(e?.length!==2)return!1;let t=e.find(e=>e.type===`CIMSolidFill`),n=e.find(e=>e.type===`CIMSolidStroke`),r=n?.effects?.some(e=>e.type===`CIMGeometricEffectDashes`);return t!=null&&n!=null&&!r}function we(e){return n(e).map(e=>({...e,propertyName:re(e.propertyName)}))}function $(e){return v(e)?{type:`animation-params`,params:e}:null}export{pe as CIMAnalyzer,ge as analyzeCIMResource};
|
|
@@ -53,17 +53,17 @@ export default abstract class AreaMeasurementAnalysisView2D extends AnalysisView
|
|
|
53
53
|
*/
|
|
54
54
|
get result(): AreaMeasurementResult | null | undefined;
|
|
55
55
|
/**
|
|
56
|
-
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
57
|
-
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
58
|
-
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
56
|
+
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/) for measuring.
|
|
57
|
+
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#selfEnabled) and
|
|
58
|
+
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#featureEnabled) snapping.
|
|
59
59
|
*
|
|
60
60
|
* > [!WARNING]
|
|
61
61
|
* >
|
|
62
62
|
* > **Known Limitations**
|
|
63
63
|
* >
|
|
64
64
|
* > This analysis currently uses its `snappingOptions` rather than [ViewOptions.snapping](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#snapping).
|
|
65
|
-
* > Tooltips and units configured through `view.options` still apply.
|
|
66
65
|
* > Support for `view.options.snapping` in this analysis is planned for a future release.
|
|
66
|
+
* > Tooltips and units configured through `view.options` still apply.
|
|
67
67
|
*
|
|
68
68
|
* @since 5.0
|
|
69
69
|
*/
|
|
@@ -52,17 +52,17 @@ export default abstract class DistanceMeasurementAnalysisView2D extends Analysis
|
|
|
52
52
|
*/
|
|
53
53
|
get result(): DistanceMeasurementResult | null | undefined;
|
|
54
54
|
/**
|
|
55
|
-
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
56
|
-
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
57
|
-
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
55
|
+
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/) for measuring.
|
|
56
|
+
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#selfEnabled) and
|
|
57
|
+
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#featureEnabled) snapping.
|
|
58
58
|
*
|
|
59
59
|
* > [!WARNING]
|
|
60
60
|
* >
|
|
61
61
|
* > **Known Limitations**
|
|
62
62
|
* >
|
|
63
63
|
* > This analysis currently uses its `snappingOptions` rather than [ViewOptions.snapping](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#snapping).
|
|
64
|
-
* > Tooltips and units configured through `view.options` still apply.
|
|
65
64
|
* > Support for `view.options.snapping` in this analysis is planned for a future release.
|
|
65
|
+
* > Tooltips and units configured through `view.options` still apply.
|
|
66
66
|
*
|
|
67
67
|
* @since 5.0
|
|
68
68
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{handlesGroup as e}from"../../../../../../core/handleUtils.js";import has from"../../../../../../core/has.js";import{throwIfAborted as t,onAbort as n}from"../../../../../../core/promiseUtils.js";import{AFeatureTileLoadStrategy as r}from"./AFeatureTileLoadStrategy.js";import{DrillDownTileSourceChunk as i}from"./chunks/DrillDownTileSourceChunk.js";import{FeatureSetReaderJSON as a}from"../../support/FeatureSetReaderJSON.js";const o=has(`featurelayer-query-max-depth`);class s{constructor(t,r){this.subscription=t,this._tileIdToResult=new Map,this._controller=new AbortController,this._handles=e([n(t.signal,()=>this._controller.abort()),n(r,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get(e){return this._tileIdToResult.get(e)}set(e,t){this._tileIdToResult.set(e,t)}get options(){return{signal:this._controller.signal}}}class c extends r{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(let e of this._loadStates.values())e.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){this._loadStates.has(e.key.id)||this._loadStates.set(e.key.id,new s(e,this._options));let n=this._loadStates.get(e.key.id),r;try{for await(let r of this._fetchChunkInfos(n,e.tile,0)){let{queryJSON:e,reader:a,sourceTile:o,sourceTileDepth:s,tile:c}=r,l=new i(a,e,c,o,s,!1);t(n.options),this._addChunk(l)}}catch(e){r=e}t(n.options);let o=new i(a.empty(this.metadata),null,e.tile,null,-1,!0);if(this._addChunk(o),r)throw r}unload(e){super.unload(e),this._loadStates.get(e.key.id)?.destroy(),this._loadStates.delete(e.key.id)}async*_fetchChunkInfos(e,t,n){let r=e.get(t.id),i=!!r;if(r||(r=await this._fetchChunkInfo(e,t,n),e.set(t.id,r)),r.reader.exceededTransferLimit&&n<has(`featurelayer-query-max-depth`)){for(let r of t.createChildTiles())yield*this._fetchChunkInfos(e,r,n+1);return}i||(yield r)}async _fetchChunkInfo(e,t,n){let r=e.subscription.tile.getQuantizationParameters(),i=this._queryInfo.createTileQuery(t,{returnExceededLimitFeatures:n===o,quantizationParameters:r});return i?{reader:await this._fetch(i,e.options,{chunkId:t.id}),queryJSON:i.inner.toJSON(),tile:e.subscription.tile,sourceTile:t,sourceTileDepth:n}:{reader:a.empty(this.metadata),queryJSON:null,tile:e.subscription.tile,sourceTile:t,sourceTileDepth:n}}}export{c as FeatureDrillDownTileLoadStrategy};
|
|
2
|
+
import{handlesGroup as e}from"../../../../../../core/handleUtils.js";import has from"../../../../../../core/has.js";import{throwIfAborted as t,onAbort as n}from"../../../../../../core/promiseUtils.js";import{AFeatureTileLoadStrategy as r}from"./AFeatureTileLoadStrategy.js";import{DrillDownTileSourceChunk as i}from"./chunks/DrillDownTileSourceChunk.js";import{FeatureSetReaderJSON as a}from"../../support/FeatureSetReaderJSON.js";const o=has(`featurelayer-query-max-depth`);class s{constructor(t,r){this.subscription=t,this._tileIdToResult=new Map,this._controller=new AbortController,this._emittedObjectIds=new Set,this._handles=e([n(t.signal,()=>this._controller.abort()),n(r,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get(e){return this._tileIdToResult.get(e)}set(e,t){this._tileIdToResult.set(e,t)}deduplicate(e){let t=e.getCursor();for(;t.next();){let e=t.getObjectId();this._emittedObjectIds.has(e)?t.delete():this._emittedObjectIds.add(e)}}get options(){return{signal:this._controller.signal}}}class c extends r{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(let e of this._loadStates.values())e.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){this._loadStates.has(e.key.id)||this._loadStates.set(e.key.id,new s(e,this._options));let n=this._loadStates.get(e.key.id),r;try{for await(let r of this._fetchChunkInfos(n,e.tile,0)){let{queryJSON:e,reader:a,sourceTile:o,sourceTileDepth:s,tile:c}=r,l=new i(a,e,c,o,s,!1);t(n.options),this._addChunk(l)}}catch(e){r=e}t(n.options);let o=new i(a.empty(this.metadata),null,e.tile,null,-1,!0);if(this._addChunk(o),r)throw r}unload(e){super.unload(e),this._loadStates.get(e.key.id)?.destroy(),this._loadStates.delete(e.key.id)}async*_fetchChunkInfos(e,t,n){let r=e.get(t.id),i=!!r;if(r||(r=await this._fetchChunkInfo(e,t,n),e.set(t.id,r)),r.reader.exceededTransferLimit&&n<has(`featurelayer-query-max-depth`)){for(let r of t.createChildTiles())yield*this._fetchChunkInfos(e,r,n+1);return}i||(e.deduplicate(r.reader),yield r)}async _fetchChunkInfo(e,t,n){let r=e.subscription.tile.getQuantizationParameters(),i=this._queryInfo.createTileQuery(t,{returnExceededLimitFeatures:n===o,quantizationParameters:r});return i?{reader:await this._fetch(i,e.options,{chunkId:t.id}),queryJSON:i.inner.toJSON(),tile:e.subscription.tile,sourceTile:t,sourceTileDepth:n}:{reader:a.empty(this.metadata),queryJSON:null,tile:e.subscription.tile,sourceTile:t,sourceTileDepth:n}}}export{c as FeatureDrillDownTileLoadStrategy};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import{createArcadeGeometryFromOptimizedGeometry as t}from"../../../../../arcade/geometry/adapters/optimized.js";import has from"../../../../../core/has.js";import{estimateNumberArrayMemory as n}from"../../../../../core/memoryEstimations.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as i}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as a}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{getLabelPoint as s}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as c,quantizeY as l}from"../../../../../geometry/support/quantizationUtils.js";import{zScale as u}from"../../../../../geometry/support/zscale.js";import{getCentroidOptimizedGeometry as d}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as f,generalizeOptimizedGeometry as p,quantizeOptimizedGeometry as m,unquantizeOptimizedGeometryInPlace as h}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as g}from"../../../../../layers/graphics/OptimizedFeature.js";import _ from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as v,unknown as y}from"../../../../../time/constants.js";import{FeatureSetCache as b}from"./FeatureSetCache.js";const x=has(`featurelayer-simplify-thresholds`)??[.5,.5,.5,.5],S=x[0],C=x[1],w=x[2],T=x[3],E=has(`featurelayer-simplify-payload-size-factors`)??[1,2,4],D=E[0],O=E[1],k=E[2],A=has(`featurelayer-simplify-mobile-factor`)??2,j=has(`esri-mobile`),M=4294967295;function N(e,t,n){if(!(e.length>t))for(;e.length<=t;)e.push(n)}class P{constructor(e){this.metadata=e,this.type=`FeatureSetReader`,this._overrides=null,this._postQueryFilteredIds=new Set,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._deleted=new Set,this._caches=new Map,this.arcadeDeclaredClass=`esri.arcade.Feature`,this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let n=1,r=j?A:1;t>4e6?n=k*r:t>1e6?n=O*r:t>5e5?n=D*r:t>1e5&&(n=r);let i=0;return e>4e3?i=T*n:e>2e3?i=w*n:e>100?i=C:e>15&&(i=S),i}getBounds(e){N(this._boundsBuffer,this.getIndex()*4+4,0);let t=this.getBoundsXMin();if(t===M||!isFinite(t))return!1;if(this.getBoundsXMin()===0){let t=this.readGeometryWorldSpace();if(t?.isPoint&&t.coords[0]===0&&t.coords[1]===0)return o(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(M),!1;let n=1/0,r=1/0,i=-1/0,a=-1/0;return t.forEachVertex((e,t)=>{n=Math.min(n,e),r=Math.min(r,t),i=Math.max(i,e),a=Math.max(a,t)}),this.setBoundsXMin(n),this.setBoundsYMin(r),this.setBoundsXMax(i),this.setBoundsYMax(a),o(e,n,r,i,a),!0}let n=this.getBoundsXMin(),r=this.getBoundsYMin(),i=this.getBoundsXMax(),a=this.getBoundsYMax();return o(e,n,r,i,a),!0}getBoundsXMin(){return this._boundsBuffer[this.getIndex()*4]}setBoundsXMin(e){this._boundsBuffer[this.getIndex()*4]=e}getBoundsYMin(){return this._boundsBuffer[this.getIndex()*4+1]}setBoundsYMin(e){this._boundsBuffer[this.getIndex()*4+1]=e}getBoundsXMax(){return this._boundsBuffer[this.getIndex()*4+2]}setBoundsXMax(e){this._boundsBuffer[this.getIndex()*4+2]=e}getBoundsYMax(){return this._boundsBuffer[this.getIndex()*4+3]}setBoundsYMax(e){this._boundsBuffer[this.getIndex()*4+3]=e}readAttributeAsTimestamp(e){let t=this.readAttribute(e);return typeof t==`string`?new Date(t).getTime():typeof t==`number`||t==null?t:null}readAttribute(e,t=!1){let n=this._readAttribute(e,t);if(n!==void 0)return n;for(let n of this._joined){n.setIndex(this.getIndex());let r=n._readAttribute(e,t);if(r!==void 0)return r}}readAttributes(){let e=this._readAttributes();for(let t of this._joined){t.setIndex(this.getIndex());let n=t._readAttributes();for(let t of Object.keys(n))e[t]=n[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){let e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){let e=this.readGeometryWorldSpace(),t=this.readAttributes(),n=this.readCentroidWorldSpace();return new g(e,t,n,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){let e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){let e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){let e=this.readGeometryForDisplay();return f(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){let e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){let e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){let e=this._readGeometryDeltaDecoded(!0);if(!e){let e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&this.metadata.geometryType===`esriGeometryPolyline`&&(t=p(t,this.metadata.geometryType,e.scale[0])),t&&=m(t,this.metadata.geometryType,e,t.hasZ,t.hasM,!0),!t){let t=this.readCentroidForDisplay();if(!t)return null;let n=c(e,t.coords[0]),r=l(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(n,r).deltaDecode()}return t}_transformToWorldSpace(e){if(!e)return null;e=e.clone();let t=this.getInTransform();t&&h(e,t);let n=u(this.metadata.spatialReference,this.metadata.outSpatialReference);if(e.hasZ&&n!==1){let{stride:t,coords:r}=e;for(let e=2;e<r.length;e+=t)r[e]*=n}return e}readGeometryWorldSpace(){let e=this._readGeometry();return e||=this._createDeltaQuantizedGeometryFromServerCentroid(),this._transformToWorldSpace(e)}readCentroidForDisplay(){let e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){let e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();return this._transformToWorldSpace(t)}setCache(e){let t=this._caches.get(e);t??(t=new b(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}delete(){this._deleted.add(this.getObjectId())}getByReferenceVertexCount(){return null}get underlyingMemory(){let e=0;e+=n(this._boundsBuffer);for(let t of this._caches.values())e+=t.usedMemory;return e}getDisplayTransform(){return null}_readGeometryDeltaDecoded(e){let t=this._readGeometry(e);if(this.geometryType===`esriGeometryPoint`||!t)return t;let n=this.getInTransform();if(!t||!n)return t;let r=n.scale[2]??1,i=n.translate[2]??0,a=n.scale[3]??1,o=n.translate[3]??0,{hasZ:s,hasM:c,stride:l,size:u,coords:d}=t,f=s&&(r!==1||i!==0),p=c&&(a!==1||o!==0);if(f||p){let e=s?3:2;for(let t=0,n=l*u;t<n;t+=l)f&&(d[t+2]=r*d[t+2]+i),p&&(d[t+e]=a*d[t+e]+o)}return t.deltaDecode()}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){let e=this.readGeometryWorldSpace();if(e==null)return null;let n;switch(this.geometryType){case`esriGeometryPoint`:n=`point`;break;case`esriGeometryMultipoint`:n=`multipoint`;break;case`esriGeometryPolyline`:n=`polyline`;break;case`esriGeometryPolygon`:n=`polygon`;break;default:throw Error(`Unexpected geometry type: ${this.geometryType}`)}return t(n,{lengths:e.lengths,coords:e.coords,hasZ:this.hasZ,hasM:this.hasM},this.metadata.outSpatialReference)}autocastArcadeDate(t,n){return n&&n instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(n):e.dateJSAndZoneToArcadeDate(n,this.contextTimeZone??v):n}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===y}field(t){let n=this.fields.get(t);if(n)switch(n.type){case`date-only`:case`esriFieldTypeDateOnly`:return r.fromReader(this.readAttribute(t,!1));case`time-only`:case`esriFieldTypeTimeOnly`:return i.fromReader(this.readAttribute(t,!1));case`esriFieldTypeTimestampOffset`:case`timestamp-offset`:return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case`date`:case`esriFieldTypeDate`:return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(let a of this._joined)if(a.setIndex(this.getIndex()),n=a.fields.get(t),n)switch(n.type){case`date-only`:case`esriFieldTypeDateOnly`:return r.fromReader(a._readAttribute(t,!1));case`time-only`:case`esriFieldTypeTimeOnly`:return i.fromReader(a._readAttribute(t,!1));case`esriFieldTypeTimestampOffset`:case`timestamp-offset`:return e.fromReaderAsTimeStampOffset(a._readAttribute(t,!1));case`date`:case`esriFieldTypeDate`:return this.autocastArcadeDate(t,a._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw Error(`Field ${t} does not exist`)}setField(e,t){throw Error(`Unable to update feature attribute values, feature is readonly`)}keys(){return this.fields.fields.map(e=>e.name)}isEmpty(){return this.fields.fields.length<=0&&this.geometry()==null}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());let t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);let n={geometry:t.geometry,attributes:{...t.attributes}};for(let e in n.attributes){let t=n.attributes[e];t instanceof Date&&(n.attributes[e]=t.getTime())}return JSON.stringify(n)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(){return{attributes:this._readAttributes(),geometry:this.geometry()?.castAsJson()??null}}castAsJsonAsync(){return Promise.resolve(this.castAsJson())}applyPostQueryFilter(e){if(this._postQueryFilteredIds.clear(),!e)return;let t=this.getCursor();for(;t.next();)e.check(t,{currentUser:null})||this._postQueryFilteredIds.add(t.getObjectId())}_getExists(){if(this._overrides){let e=this.getObjectId();return!this._overrides.hasOverride(e)}let e=this.getObjectId();return this._deleted.has(e)||!this._postQueryFilteredIds.has(e)}_computeDisplayCentroid(e){if(this.getInTransform()==null)return d(e);let t=a.fromOptimized(e,this.geometryType);t.yFactor*=-1;let n=s(t);return n?isNaN(n[0])||isNaN(n[1])?d(e):(n[1]*=-1,new _([],n)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone,e._postQueryFilteredIds=this._postQueryFilteredIds,e._deleted=this._deleted}_readLegacyGeometryWorldSpace(){let e=this.readGeometryWorldSpace();return f(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){let e=this._readServerCentroid();if(!e)return null;let[t,n]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,n)}_createDeltaQuantizedExtrudedGeometry(e,t){return this.geometryType===`esriGeometryPolyline`?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new _([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new _([2],[e-1,t+1,1,-1])}}export{P as FeatureSetReader};
|
|
2
|
+
import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import{createArcadeGeometryFromOptimizedGeometry as t}from"../../../../../arcade/geometry/adapters/optimized.js";import has from"../../../../../core/has.js";import{estimateNumberArrayMemory as n}from"../../../../../core/memoryEstimations.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as i}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as a}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{getLabelPoint as s}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as c,quantizeY as l}from"../../../../../geometry/support/quantizationUtils.js";import{zScale as u}from"../../../../../geometry/support/zscale.js";import{getCentroidOptimizedGeometry as d}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as f,generalizeOptimizedGeometry as p,quantizeOptimizedGeometry as m,unquantizeOptimizedGeometryInPlace as h}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as g}from"../../../../../layers/graphics/OptimizedFeature.js";import _ from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as v,unknown as y}from"../../../../../time/constants.js";import{FeatureSetCache as b}from"./FeatureSetCache.js";const x=has(`featurelayer-simplify-thresholds`)??[.5,.5,.5,.5],S=x[0],C=x[1],w=x[2],T=x[3],E=has(`featurelayer-simplify-payload-size-factors`)??[1,2,4],D=E[0],O=E[1],k=E[2],A=has(`featurelayer-simplify-mobile-factor`)??2,j=has(`esri-mobile`),M=4294967295;function N(e,t,n){if(!(e.length>t))for(;e.length<=t;)e.push(n)}class P{constructor(e){this.metadata=e,this.type=`FeatureSetReader`,this._overrides=null,this._postQueryFilteredIds=new Set,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._deleted=new Set,this._caches=new Map,this.arcadeDeclaredClass=`esri.arcade.Feature`,this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let n=1,r=j?A:1;t>4e6?n=k*r:t>1e6?n=O*r:t>5e5?n=D*r:t>1e5&&(n=r);let i=0;return e>4e3?i=T*n:e>2e3?i=w*n:e>100?i=C:e>15&&(i=S),i}getBounds(e){N(this._boundsBuffer,this.getIndex()*4+4,0);let t=this.getBoundsXMin();if(t===M||!isFinite(t))return!1;if(this.getBoundsXMin()===0){let t=this.readGeometryWorldSpace();if(t?.isPoint&&t.coords[0]===0&&t.coords[1]===0)return o(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(M),!1;let n=1/0,r=1/0,i=-1/0,a=-1/0;return t.forEachVertex((e,t)=>{n=Math.min(n,e),r=Math.min(r,t),i=Math.max(i,e),a=Math.max(a,t)}),this.setBoundsXMin(n),this.setBoundsYMin(r),this.setBoundsXMax(i),this.setBoundsYMax(a),o(e,n,r,i,a),!0}let n=this.getBoundsXMin(),r=this.getBoundsYMin(),i=this.getBoundsXMax(),a=this.getBoundsYMax();return o(e,n,r,i,a),!0}getBoundsXMin(){return this._boundsBuffer[this.getIndex()*4]}setBoundsXMin(e){this._boundsBuffer[this.getIndex()*4]=e}getBoundsYMin(){return this._boundsBuffer[this.getIndex()*4+1]}setBoundsYMin(e){this._boundsBuffer[this.getIndex()*4+1]=e}getBoundsXMax(){return this._boundsBuffer[this.getIndex()*4+2]}setBoundsXMax(e){this._boundsBuffer[this.getIndex()*4+2]=e}getBoundsYMax(){return this._boundsBuffer[this.getIndex()*4+3]}setBoundsYMax(e){this._boundsBuffer[this.getIndex()*4+3]=e}readAttributeAsTimestamp(e){let t=this.readAttribute(e);return typeof t==`string`?new Date(t).getTime():typeof t==`number`||t==null?t:null}readAttribute(e,t=!1){let n=this._readAttribute(e,t);if(n!==void 0)return n;for(let n of this._joined){n.setIndex(this.getIndex());let r=n._readAttribute(e,t);if(r!==void 0)return r}}readAttributes(){let e=this._readAttributes();for(let t of this._joined){t.setIndex(this.getIndex());let n=t._readAttributes();for(let t of Object.keys(n))e[t]=n[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){let e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){let e=this.readGeometryWorldSpace(),t=this.readAttributes(),n=this.readCentroidWorldSpace();return new g(e,t,n,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){let e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){let e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){let e=this.readGeometryForDisplay();return f(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){let e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){let e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){let e=this._readGeometryDeltaDecoded(!0);if(!e){let e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&this.metadata.geometryType===`esriGeometryPolyline`&&(t=p(t,this.metadata.geometryType,e.scale[0])),t&&=m(t,this.metadata.geometryType,e,t.hasZ,t.hasM,!0),!t){let t=this.readCentroidForDisplay();if(!t)return null;let n=c(e,t.coords[0]),r=l(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(n,r).deltaDecode()}return t}_transformToWorldSpace(e){if(!e)return null;e=e.clone();let t=this.getInTransform();t&&h(e,t);let n=u(this.metadata.spatialReference,this.metadata.outSpatialReference);if(e.hasZ&&n!==1){let{stride:t,coords:r}=e;for(let e=2;e<r.length;e+=t)r[e]*=n}return e}readGeometryWorldSpace(){let e=this._readGeometry();return e||=this._createDeltaQuantizedGeometryFromServerCentroid(),this._transformToWorldSpace(e)}readCentroidForDisplay(){let e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){let e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();return this._transformToWorldSpace(t)}setCache(e){let t=this._caches.get(e);t??(t=new b(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}delete(){this._deleted.add(this.getObjectId())}getByReferenceVertexCount(){return null}get underlyingMemory(){let e=0;e+=n(this._boundsBuffer);for(let t of this._caches.values())e+=t.usedMemory;return e}getDisplayTransform(){return null}_readGeometryDeltaDecoded(e){let t=this._readGeometry(e);if(this.geometryType===`esriGeometryPoint`||!t)return t;let n=this.getInTransform();if(!t||!n)return t;let r=n.scale[2]??1,i=n.translate[2]??0,a=n.scale[3]??1,o=n.translate[3]??0,{hasZ:s,hasM:c,stride:l,size:u,coords:d}=t,f=s&&(r!==1||i!==0),p=c&&(a!==1||o!==0);if(f||p){let e=s?3:2;for(let t=0,n=l*u;t<n;t+=l)f&&(d[t+2]=r*d[t+2]+i),p&&(d[t+e]=a*d[t+e]+o)}return t.deltaDecode()}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){let e=this.readGeometryWorldSpace();if(e==null)return null;let n;switch(this.geometryType){case`esriGeometryPoint`:n=`point`;break;case`esriGeometryMultipoint`:n=`multipoint`;break;case`esriGeometryPolyline`:n=`polyline`;break;case`esriGeometryPolygon`:n=`polygon`;break;default:throw Error(`Unexpected geometry type: ${this.geometryType}`)}return t(n,{lengths:e.lengths,coords:e.coords,hasZ:this.hasZ,hasM:this.hasM},this.metadata.outSpatialReference)}autocastArcadeDate(t,n){return n&&n instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(n):e.dateJSAndZoneToArcadeDate(n,this.contextTimeZone??v):n}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===y}field(t){let n=this.fields.get(t);if(n)switch(n.type){case`date-only`:case`esriFieldTypeDateOnly`:return r.fromReader(this.readAttribute(t,!1));case`time-only`:case`esriFieldTypeTimeOnly`:return i.fromReader(this.readAttribute(t,!1));case`esriFieldTypeTimestampOffset`:case`timestamp-offset`:return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case`date`:case`esriFieldTypeDate`:return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(let a of this._joined)if(a.setIndex(this.getIndex()),n=a.fields.get(t),n)switch(n.type){case`date-only`:case`esriFieldTypeDateOnly`:return r.fromReader(a._readAttribute(t,!1));case`time-only`:case`esriFieldTypeTimeOnly`:return i.fromReader(a._readAttribute(t,!1));case`esriFieldTypeTimestampOffset`:case`timestamp-offset`:return e.fromReaderAsTimeStampOffset(a._readAttribute(t,!1));case`date`:case`esriFieldTypeDate`:return this.autocastArcadeDate(t,a._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw Error(`Field ${t} does not exist`)}setField(e,t){throw Error(`Unable to update feature attribute values, feature is readonly`)}keys(){return this.fields.fields.map(e=>e.name)}isEmpty(){return this.fields.fields.length<=0&&this.geometry()==null}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());let t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);let n={geometry:t.geometry,attributes:{...t.attributes}};for(let e in n.attributes){let t=n.attributes[e];t instanceof Date&&(n.attributes[e]=t.getTime())}return JSON.stringify(n)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(){return{attributes:this._readAttributes(),geometry:this.geometry()?.castAsJson()??null}}castAsJsonAsync(){return Promise.resolve(this.castAsJson())}applyPostQueryFilter(e){if(this._postQueryFilteredIds.clear(),!e)return;let t=this.getCursor();for(;t.next();)e.check(t,{currentUser:null})||this._postQueryFilteredIds.add(t.getObjectId())}_getExists(){let e=this.getObjectId();return this._deleted.has(e)?!1:this._overrides?!this._overrides.hasOverride(e):!this._postQueryFilteredIds.has(e)}_computeDisplayCentroid(e){if(this.getInTransform()==null)return d(e);let t=a.fromOptimized(e,this.geometryType);t.yFactor*=-1;let n=s(t);return n?isNaN(n[0])||isNaN(n[1])?d(e):(n[1]*=-1,new _([],n)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone,e._postQueryFilteredIds=this._postQueryFilteredIds,e._deleted=this._deleted}_readLegacyGeometryWorldSpace(){let e=this.readGeometryWorldSpace();return f(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){let e=this._readServerCentroid();if(!e)return null;let[t,n]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,n)}_createDeltaQuantizedExtrudedGeometry(e,t){return this.geometryType===`esriGeometryPolyline`?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new _([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new _([2],[e-1,t+1,1,-1])}}export{P as FeatureSetReader};
|
|
@@ -14,6 +14,9 @@ import type { ViewshedPlacementOptions, ViewshedPlacementResult } from "./Viewsh
|
|
|
14
14
|
* or to make existing viewsheds selectable and editable by enabling the [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#interactive) property.
|
|
15
15
|
* To select a viewshed, hover and click on its field-of-view manipulators.
|
|
16
16
|
*
|
|
17
|
+
* Snapping, tooltips, display units, and input units used during interactive placement and editing are inherited from
|
|
18
|
+
* [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
|
|
19
|
+
*
|
|
17
20
|
* The view for an analysis can be retrieved using [SceneView.whenAnalysisView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenAnalysisView)
|
|
18
21
|
* similar to how layer views are retrieved for layers using [SceneView.whenLayerView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenLayerView).
|
|
19
22
|
*
|
|
@@ -28,7 +28,8 @@ import type { VolumeMeasurementPlacementResult } from "./VolumeMeasurement/types
|
|
|
28
28
|
* > **Things to consider:**
|
|
29
29
|
* >
|
|
30
30
|
* > - When using the "cut-fill" [VolumeMeasurementAnalysis.measureType](https://developers.arcgis.com/javascript/latest/references/core/analysis/VolumeMeasurementAnalysis/#measureType) in [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/VolumeMeasurementAnalysisView3D/#interactive) mode, hover over the shift manipulator, press `Tab` to activate the tooltip input mode, and enter the elevation of the target surface.
|
|
31
|
-
* > - The cut-fill elevation tooltip
|
|
31
|
+
* > - The cut-fill elevation tooltip remains enabled independently of [ViewOptions.tooltips](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#tooltips). Support for this setting is planned for a future release.
|
|
32
|
+
* > Its display and input units can still inherit [ViewOptions.displayUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#displayUnits) and [ViewOptions.inputUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#inputUnits).
|
|
32
33
|
* > - Snapping is enabled by default. This can be temporarily disabled by holding the `CTRL` key.
|
|
33
34
|
* > - Layer types currently supported for snapping are: [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/), [GraphicsLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GraphicsLayer/) (except Mesh geometries),
|
|
34
35
|
* > [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/), [WFSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/), [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import{
|
|
2
|
+
import"../../../../core/has.js";import{getOrCreateMapValue as e}from"../../../../core/MapUtils.js";import{estimateAttributesMemory as t}from"../../../../core/memoryEstimations.js";import{signal as n}from"../../../../core/signal.js";import{estimateGeometryMemory as r}from"../../../../layers/graphics/dehydratedFeatures.js";class i{constructor(e=()=>void 0){this._getGeometryKey=e,this._payloads=new Map,this._geometries=new Map,this._usedMemory=n(0),this._duplicatedMemory=n(0),this._referenceCount=n(0)}findGeometry(e,t){if(e===void 0)return;let n=this._geometries.get(e);if(n){for(let e of n)if(t(e))return e}}get usedMemory(){return this._usedMemory.value}get usedMemoryPerFeature(){return this._referenceCount.value>0?this._duplicatedMemory.value/this._referenceCount.value:0}ref(n,i,a=!0){let o;a&&n.geometry&&!this._payloads.has(n.geometry)&&(o=this._getGeometryKey(n.geometry,i),o!==void 0&&e(this._geometries,o,()=>new Set).add(n.geometry)),this._duplicatedMemory.value+=this._refPayload(n.geometry,r,o)+this._refPayload(n.attributes,t),this._referenceCount.value++}unref(e){let t=e.geometry,n=t&&this._payloads.get(t);if(t&&n?.count===1&&n.geometryKey!==void 0){let e=this._geometries.get(n.geometryKey);e.delete(t),e.size===0&&this._geometries.delete(n.geometryKey)}this._duplicatedMemory.value-=this._unrefPayload(e.geometry)+this._unrefPayload(e.attributes),this._referenceCount.value--}_refPayload(e,t,n){if(e==null)return 0;let r=this._payloads.get(e);if(r)return r.count++,r.size;let i=t(e);return this._payloads.set(e,new a(i,n)),this._usedMemory.value+=i,i}_unrefPayload(e){if(e==null)return 0;let t=this._payloads.get(e);return--t.count===0&&(this._payloads.delete(e),this._usedMemory.value-=t.size),t.size}get test(){}}class a{constructor(e,t){this.size=e,this.geometryKey=t,this.count=1}}export{i as FeatureMemory};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{shuffle as e}from"../../../../core/arrayUtils.js";import{baseObjectMemory as t}from"../../../../core/memoryEstimations.js";import{signal as n}from"../../../../core/signal.js";import{create as r,diameter as i}from"../../../../geometry/support/aaBoundingBox.js";import{create as a,fromExtent as o,intersects as s,copy as c,positiveInfinity as l,intersection as u}from"../../../../geometry/support/aaBoundingRect.js";import{numVertices as d,estimateSize as f,getObjectId as p,computeAABB as m}from"../../../../layers/graphics/dehydratedFeatures.js";import{computeMaxZ as h}from"../graphics/graphicUtils.js";import{SampledGeometryMaxDistanceRatio as g}from"./SampledGeometryMaxDistanceRatio.js";class _{constructor(e,t){this.descriptor=e,this._memory=t,this._numVertices=0,this.exceededTransferLimit=n(!1),this._fetchFailed=n(!1),this._sorted=!1,this._numFeatures=n(v),this._emptyFeatureRatio=n(0),this._estimatedSize=-1,this._sampledDensityEstimate=-1,this._displayingFeatures=null,this.alive=!0,this.filtered=!1,this._features=null,this._featuresLength=n(0),this._featureLimit=n(0),this._fetchStatus=0,this.fetchInformation=n(``),this.fetchingResolution=this.displayingResolution=e.resolution}get featuresMissing(){return this.fetchFailed||(this.hasPreciseFeatureCount?this._featuresLength.value<this.numFeatures:this.exceededTransferLimit.value)}get showsAllFeatures(){return!this.fetchFailed&&this.displayingFeatures!=null&&(this.hasPreciseFeatureCount?this.displayingFeatures.length===this.numFeatures:!this.exceededTransferLimit.value)}get missingAttributes(){return this._missingAttributes}get fetchFailed(){return this._fetchFailed.value}set fetchFailed(e){this._fetchFailed.value=e}get displayingFeatures(){return this._displayingFeatures}set displayingFeatures(e){this._displayingFeatures=e,this.extentIncludingBorrowedFeatures=null}get perTileMaximumNumberOfFeaturesExceeded(){let e=this.isFetched&&this.featuresMissing;return!this.filtered&&(e||this.hasFeatureLimit)}get features(){return this._features}get featureLimit(){return this._featureLimit.value}set featureLimit(e){this._featureLimit.value=e}get hasFeatureLimit(){return this.featureLimit!==this._featuresLength.value}get availableFields(){return this._availableFields}setFeatures(e,t,n,r){this._replaceFeatures(e),this._availableFields=n,this._featuresLength.value=e?.length??0,this._sorted=!1,this._estimatedSize=-1,this._sampledDensityEstimate=-1,this._missingAttributes=r,e&&e.length>0?(this._emptyFeatureRatio.value=t/(e.length+t),this._numVertices=e.reduce((e,t)=>e+d(t.geometry),0)):(this._emptyFeatureRatio.value=0,this._numVertices=0)}computeZQuantizationFactor(){if(this._features&&this._features.length>0){let e=this._features.reduce((e,{geometry:t})=>Math.max(e,h(t)??0),0);return Math.floor(e/this.descriptor.planetRadius)+1}return 1}get emptyFeatureRatio(){return this._emptyFeatureRatio.value}get numFeatures(){return this.hasPreciseFeatureCount?this._numFeatures.value:this._features?this._featuresLength.value:0}set numFeatures(e){this._numFeatures.value=e}get hasPreciseFeatureCount(){return this._numFeatures.value>v}get needsFeatureCount(){return this._numFeatures.value===v}get numVertices(){return this._numVertices}get id(){return this.descriptor.id}get estimatedSize(){return this.updateEstimates(),this._estimatedSize}get sampledDensityEstimate(){return this._sampledDensityEstimate}updateEstimates(){if(this._estimatedSize<0||this._sampledDensityEstimate<0){this._estimatedSize=0,this._sampledDensityEstimate=0;let e=Math.floor(Math.sqrt(S));if(this._features){let t=null,n=new g(S,w*this.fetchingResolution),r=this._features.length;for(let i=0;i<r;++i){let a=this._features[i],o=f(a);if(this._estimatedSize+=o,!n.done){let o=r-i,s=Math.ceil(o/Math.max(1,Math.floor(Math.sqrt(n.numRemainingSamples))));if(i%s===0){let r=Math.max(Math.floor(n.numRemainingSamples/o),e);n.sampleGeometry(a.geometry,t,r)}}t=a.geometry}this._sampledDensityEstimate=n.numSamples>=C?n.ratio:0}return!0}return!1}get fetchStatus(){return this._fetchStatus}requestFetch(){this._fetchStatus=0}requestRefetch(){this._fetchStatus=1}startFetch(){this._fetchStatus=this.needsRefetch?3:2}fetchDone(e){this._fetchStatus=e}get isFetching(){return this._fetchStatus===2||this._fetchStatus===3}get isRefetching(){return this._fetchStatus===3}get needsFetch(){return this._fetchStatus===0||this._fetchStatus===1}get needsRefetch(){return this._fetchStatus===1}get isFetched(){return this._fetchStatus===4||this._fetchStatus===5}isFullyFetched(e){return!!this.features&&(this.features.length>=e||this.fetchStatus===5)}resetFetching(){this._fetchStatus=+!!this.isRefetching}get needsDisplayUpdate(){return!!this._features&&!x(this._features,this.displayingFeatures,this.featureLimit)}intersects(e){return e==null||!this.descriptor.extent||(o(e,T),s(this.descriptor.extent,T))}intersectionIncludingBorrowed(e,t){let n=this.extentIncludingBorrowedFeatures==null?this.descriptor.extent:this.extentIncludingBorrowedFeatures;return!e&&!n?(c(t,l),t):(e==null?c(t,n):(o(e,t),u(t,n,t)),t)}_shuffle(t){this._features?.sort((e,n)=>p(e,t)-p(n,t)),e(this._features,16438)}_sortBySize(e){this._features?.sort((t,n)=>i(m(n.geometry,E))-i(m(t.geometry,E))||p(t,e)-p(n,e))}reduceFeatures(e,t,n,r){if(e<=0)return!1;if(!this._features)return this.featureLimit=0,!1;let i=!1;this.featureLimit=Math.ceil(this.numFeatures*e),this.featureLimit>this._features.length&&this._fetchStatus===4&&this._features.length>0&&(this._fetchStatus=1,i=!0),!this._sorted&&e<1&&(r===1?this._shuffle(n):this._sortBySize(n),this._sorted=!0);let a=Math.max(this.featureLimit,Math.ceil(t*this.numFeatures));if(this._features.length>a){for(let e=a;e<this._features.length;e++)this._memory.unref(this._features[e]);this._features.length=this._featuresLength.value=a,this._estimatedSize=-1,this.exceededTransferLimit.value=!1,this._fetchStatus===5&&(this._fetchStatus=4)}return i}get cache(){return new b(this,this._features,this._numFeatures.value,this._emptyFeatureRatio.value)}set cache(e){this._replaceFeatures(e.features),this.requestController=null,this._availableFields=e.availableFields,this._featuresLength.value=e.features?.length??0,this._numFeatures.value=e.numFeatures,this._emptyFeatureRatio.value=e.emptyFeatureRatio,this._fetchStatus=e.fetchStatus,this.exceededTransferLimit.value=e.exceededTransferLimit,this._estimatedSize=-1,this._sampledDensityEstimate=-1,this.fetchInformation.value=e.fetchInformation}_replaceFeatures(e){for(let
|
|
2
|
+
import{shuffle as e}from"../../../../core/arrayUtils.js";import{baseObjectMemory as t}from"../../../../core/memoryEstimations.js";import{signal as n}from"../../../../core/signal.js";import{create as r,diameter as i}from"../../../../geometry/support/aaBoundingBox.js";import{create as a,fromExtent as o,intersects as s,copy as c,positiveInfinity as l,intersection as u}from"../../../../geometry/support/aaBoundingRect.js";import{numVertices as d,estimateSize as f,getObjectId as p,computeAABB as m}from"../../../../layers/graphics/dehydratedFeatures.js";import{computeMaxZ as h}from"../graphics/graphicUtils.js";import{SampledGeometryMaxDistanceRatio as g}from"./SampledGeometryMaxDistanceRatio.js";class _{constructor(e,t){this.descriptor=e,this._memory=t,this._numVertices=0,this.exceededTransferLimit=n(!1),this._fetchFailed=n(!1),this._sorted=!1,this._numFeatures=n(v),this._emptyFeatureRatio=n(0),this._estimatedSize=-1,this._sampledDensityEstimate=-1,this._displayingFeatures=null,this.alive=!0,this.filtered=!1,this._features=null,this._featuresLength=n(0),this._featureLimit=n(0),this._fetchStatus=0,this.fetchInformation=n(``),this.fetchingResolution=this.displayingResolution=e.resolution}get featuresMissing(){return this.fetchFailed||(this.hasPreciseFeatureCount?this._featuresLength.value<this.numFeatures:this.exceededTransferLimit.value)}get showsAllFeatures(){return!this.fetchFailed&&this.displayingFeatures!=null&&(this.hasPreciseFeatureCount?this.displayingFeatures.length===this.numFeatures:!this.exceededTransferLimit.value)}get missingAttributes(){return this._missingAttributes}get fetchFailed(){return this._fetchFailed.value}set fetchFailed(e){this._fetchFailed.value=e}get displayingFeatures(){return this._displayingFeatures}set displayingFeatures(e){this._displayingFeatures=e,this.extentIncludingBorrowedFeatures=null}get perTileMaximumNumberOfFeaturesExceeded(){let e=this.isFetched&&this.featuresMissing;return!this.filtered&&(e||this.hasFeatureLimit)}get features(){return this._features}get featureLimit(){return this._featureLimit.value}set featureLimit(e){this._featureLimit.value=e}get hasFeatureLimit(){return this.featureLimit!==this._featuresLength.value}get availableFields(){return this._availableFields}setFeatures(e,t,n,r,i=this.fetchingResolution,a=!0){this._replaceFeatures(e,i,a),this._availableFields=n,this._featuresLength.value=e?.length??0,this._sorted=!1,this._estimatedSize=-1,this._sampledDensityEstimate=-1,this._missingAttributes=r,e&&e.length>0?(this._emptyFeatureRatio.value=t/(e.length+t),this._numVertices=e.reduce((e,t)=>e+d(t.geometry),0)):(this._emptyFeatureRatio.value=0,this._numVertices=0)}computeZQuantizationFactor(){if(this._features&&this._features.length>0){let e=this._features.reduce((e,{geometry:t})=>Math.max(e,h(t)??0),0);return Math.floor(e/this.descriptor.planetRadius)+1}return 1}get emptyFeatureRatio(){return this._emptyFeatureRatio.value}get numFeatures(){return this.hasPreciseFeatureCount?this._numFeatures.value:this._features?this._featuresLength.value:0}set numFeatures(e){this._numFeatures.value=e}get hasPreciseFeatureCount(){return this._numFeatures.value>v}get needsFeatureCount(){return this._numFeatures.value===v}get numVertices(){return this._numVertices}get id(){return this.descriptor.id}get estimatedSize(){return this.updateEstimates(),this._estimatedSize}get sampledDensityEstimate(){return this._sampledDensityEstimate}updateEstimates(){if(this._estimatedSize<0||this._sampledDensityEstimate<0){this._estimatedSize=0,this._sampledDensityEstimate=0;let e=Math.floor(Math.sqrt(S));if(this._features){let t=null,n=new g(S,w*this.fetchingResolution),r=this._features.length;for(let i=0;i<r;++i){let a=this._features[i],o=f(a);if(this._estimatedSize+=o,!n.done){let o=r-i,s=Math.ceil(o/Math.max(1,Math.floor(Math.sqrt(n.numRemainingSamples))));if(i%s===0){let r=Math.max(Math.floor(n.numRemainingSamples/o),e);n.sampleGeometry(a.geometry,t,r)}}t=a.geometry}this._sampledDensityEstimate=n.numSamples>=C?n.ratio:0}return!0}return!1}get fetchStatus(){return this._fetchStatus}requestFetch(){this._fetchStatus=0}requestRefetch(){this._fetchStatus=1}startFetch(){this._fetchStatus=this.needsRefetch?3:2}fetchDone(e){this._fetchStatus=e}get isFetching(){return this._fetchStatus===2||this._fetchStatus===3}get isRefetching(){return this._fetchStatus===3}get needsFetch(){return this._fetchStatus===0||this._fetchStatus===1}get needsRefetch(){return this._fetchStatus===1}get isFetched(){return this._fetchStatus===4||this._fetchStatus===5}isFullyFetched(e){return!!this.features&&(this.features.length>=e||this.fetchStatus===5)}resetFetching(){this._fetchStatus=+!!this.isRefetching}get needsDisplayUpdate(){return!!this._features&&!x(this._features,this.displayingFeatures,this.featureLimit)}intersects(e){return e==null||!this.descriptor.extent||(o(e,T),s(this.descriptor.extent,T))}intersectionIncludingBorrowed(e,t){let n=this.extentIncludingBorrowedFeatures==null?this.descriptor.extent:this.extentIncludingBorrowedFeatures;return!e&&!n?(c(t,l),t):(e==null?c(t,n):(o(e,t),u(t,n,t)),t)}_shuffle(t){this._features?.sort((e,n)=>p(e,t)-p(n,t)),e(this._features,16438)}_sortBySize(e){this._features?.sort((t,n)=>i(m(n.geometry,E))-i(m(t.geometry,E))||p(t,e)-p(n,e))}reduceFeatures(e,t,n,r){if(e<=0)return!1;if(!this._features)return this.featureLimit=0,!1;let i=!1;this.featureLimit=Math.ceil(this.numFeatures*e),this.featureLimit>this._features.length&&this._fetchStatus===4&&this._features.length>0&&(this._fetchStatus=1,i=!0),!this._sorted&&e<1&&(r===1?this._shuffle(n):this._sortBySize(n),this._sorted=!0);let a=Math.max(this.featureLimit,Math.ceil(t*this.numFeatures));if(this._features.length>a){for(let e=a;e<this._features.length;e++)this._memory.unref(this._features[e]);this._features.length=this._featuresLength.value=a,this._estimatedSize=-1,this.exceededTransferLimit.value=!1,this._fetchStatus===5&&(this._fetchStatus=4)}return i}get cache(){return new b(this,this._features,this._numFeatures.value,this._emptyFeatureRatio.value)}set cache(e){this._replaceFeatures(e.features,e.resolution),this.requestController=null,this._availableFields=e.availableFields,this._featuresLength.value=e.features?.length??0,this._numFeatures.value=e.numFeatures,this._emptyFeatureRatio.value=e.emptyFeatureRatio,this._fetchStatus=e.fetchStatus,this.exceededTransferLimit.value=e.exceededTransferLimit,this._estimatedSize=-1,this._sampledDensityEstimate=-1,this.fetchInformation.value=e.fetchInformation}_replaceFeatures(e,t,n=!0){for(let r of e??[])this._memory.ref(r,t,n);for(let e of this._features??[])this._memory.unref(e);this._features=e}}const v=-1,y=-2;class b{constructor(e,n,r,i){this.features=n,this.numFeatures=r,this.emptyFeatureRatio=i,this.usedMemory=t+e.estimatedSize,this.resolution=e.displayingResolution,this.availableFields=e.availableFields,this.fetchStatus=e.fetchStatus,this.exceededTransferLimit=e.exceededTransferLimit.value,this.fetchInformation=e.fetchInformation.value}}function x(e,t,n){if(t==null||e==null||n!==t.length||n>e.length)return!1;for(let r=0;r<n;++r)if(e[r]!==t[r])return!1;return!0}const S=150,C=100,w=2,T=a(),E=r();export{_ as FeatureTile,b as FeatureTileCacheItem,y as failedFeatureCount};
|