@arcgis/core 4.32.0-next.20250205 → 4.32.0-next.20250206
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/assets/components/assets/icon/dualImageArea16.json +1 -0
- package/assets/components/assets/icon/dualImageArea24.json +1 -0
- package/assets/components/assets/icon/dualImageArea32.json +1 -0
- package/assets/components/assets/icon/dualImageDistance16.json +1 -0
- package/assets/components/assets/icon/dualImageDistance24.json +1 -0
- package/assets/components/assets/icon/dualImageDistance32.json +1 -0
- package/assets/components/assets/icon/dualImageLocation16.json +1 -0
- package/assets/components/assets/icon/dualImageLocation24.json +1 -0
- package/assets/components/assets/icon/dualImageLocation32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{24a86c52c8bdd0b5eb4d.js → 09a99c556089c166d1f8.js} +1 -1
- package/assets/esri/core/workers/chunks/0a8e388e96af44deeabb.js +1 -0
- package/assets/esri/core/workers/chunks/15f850c9a1154fc57e5a.js +1 -0
- package/assets/esri/core/workers/chunks/{9b4f471fcd8a3b5e089f.js → 192569dfa7c0ea8dd864.js} +1 -1
- package/assets/esri/core/workers/chunks/24e47f748f0e4f815c6e.js +1 -0
- package/assets/esri/core/workers/chunks/28374a64790342e1b5ae.js +1 -0
- package/assets/esri/core/workers/chunks/{ad215219e5eef8598745.js → 28dbbfc44cc2bdcd221d.js} +1 -1
- package/assets/esri/core/workers/chunks/{6d5bfcc7856cafe7b043.js → 2d62b44385b2b7882b72.js} +2 -2
- package/assets/esri/core/workers/chunks/{6d5bfcc7856cafe7b043.js.LICENSE.txt → 2d62b44385b2b7882b72.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/308ec51ff4a66f7fcb0d.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{72cf9192292e5c85c6df.js → 32d3657dcae89b740f8b.js} +2 -2
- package/assets/esri/core/workers/chunks/{72cf9192292e5c85c6df.js.LICENSE.txt → 32d3657dcae89b740f8b.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/333091ab2e267652ed56.js +1 -0
- package/assets/esri/core/workers/chunks/354531dc2f0dea2ad96f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/35e4af82a08b4eadbfab.js +1 -0
- package/assets/esri/core/workers/chunks/38cd7745b8ef1b8b6196.js +1 -0
- package/assets/esri/core/workers/chunks/{8a1e4f65fc81aba7a704.js → 4122d10bc910e888eee1.js} +1 -1
- package/assets/esri/core/workers/chunks/433576983754f690bcc7.js +1 -0
- package/assets/esri/core/workers/chunks/459af0c3d62c3ed11c19.js +1 -0
- package/assets/esri/core/workers/chunks/53810519ff5922b42cd2.js +1 -0
- package/assets/esri/core/workers/chunks/594d923400fd74881833.js +1 -0
- package/assets/esri/core/workers/chunks/{7a0415db78c68d31733f.js → 6039da57a2adedd3b83f.js} +1 -1
- package/assets/esri/core/workers/chunks/6fa4e80da3a7499a952c.js +1 -0
- package/assets/esri/core/workers/chunks/77764ca90bdd13ee2167.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{723a9fba144e2fa6d017.js → 7cb09e58bcc537ec1f7a.js} +1 -1
- package/assets/esri/core/workers/chunks/842db06ce62758fab1e7.js +1 -0
- package/assets/esri/core/workers/chunks/8c32cee395da0a7b9a8e.js +1 -0
- package/assets/esri/core/workers/chunks/94490937dca566fe2640.js +1 -0
- package/assets/esri/core/workers/chunks/{610b33b7291cffcc4e5d.js → a42ae5d5e5f66d120b4d.js} +1 -1
- package/assets/esri/core/workers/chunks/a5e9ea13e844a62b2a7f.js +1 -0
- package/assets/esri/core/workers/chunks/b21b152fa15896577242.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/b43d88b6e7dc4ab13599.js +1 -0
- package/assets/esri/core/workers/chunks/d29c3bf29fcd7fa31f1a.js +1 -0
- package/assets/esri/core/workers/chunks/d339dee99c4820b63f39.js +1 -0
- package/assets/esri/core/workers/chunks/{9c5c6ecaf5be24279fa5.js → ddc30044f61a2c2df3fe.js} +1 -1
- package/assets/esri/core/workers/chunks/de1f3c4b8000c2d73013.js +1 -0
- package/assets/esri/core/workers/chunks/e4b3f2d5c43518b0cde7.js +1 -0
- package/assets/esri/core/workers/chunks/e5e3b6d00d27b5bb354f.js +1 -0
- package/assets/esri/core/workers/chunks/ef6279f5c63ab1e88c71.js +1 -0
- package/assets/esri/core/workers/chunks/{0711d3ad4d403bcfdcad.js → f117a89d1f4001a1f9f0.js} +1 -1
- package/assets/esri/core/workers/chunks/f60e301de6517553672f.js +2 -0
- package/assets/esri/core/workers/chunks/{1a2e1a414e651e988435.js.LICENSE.txt → f60e301de6517553672f.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/f9e48205178a5a804d38.js +1 -0
- package/chunks/WaterSurface.glsl.js +2 -2
- package/geometry/support/meshUtils/elevation.js +1 -1
- package/interfaces.d.ts +84 -49
- package/layers/Layer.js +1 -1
- package/layers/graphics/data/FeatureStore.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
- package/layers/graphics/sources/support/sourceUtils.js +1 -1
- package/layers/support/rasterFunctionUtils.d.ts +2 -1
- package/layers/support/rasterFunctionUtils.js +1 -1
- package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +1 -1
- package/package.json +2 -2
- package/rest/support/ImageSampleParameters.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/LayerViewManager.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileCache.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/assets/esri/core/workers/chunks/1a2e1a414e651e988435.js +0 -2
- package/assets/esri/core/workers/chunks/287362f9af132fafe4de.js +0 -1
- package/assets/esri/core/workers/chunks/2ea5e5e6c4660a06b516.js +0 -1
- package/assets/esri/core/workers/chunks/380d37ceb8cf52bad190.js +0 -1
- package/assets/esri/core/workers/chunks/3984bf01f055fc42bfbf.js +0 -1
- package/assets/esri/core/workers/chunks/39e38aab86dcee3f79be.js +0 -1
- package/assets/esri/core/workers/chunks/41cd1a5c99ab3bbd1fb4.js +0 -1
- package/assets/esri/core/workers/chunks/5e7f16b312077ca8c18d.js +0 -1
- package/assets/esri/core/workers/chunks/6ef2514a6b7bbfb8e37d.js +0 -1
- package/assets/esri/core/workers/chunks/7e4d72279cc599b7029c.js +0 -1
- package/assets/esri/core/workers/chunks/82d26884127ed772cc4b.js +0 -1
- package/assets/esri/core/workers/chunks/8438fba57e82e4cc7c11.js +0 -1
- package/assets/esri/core/workers/chunks/858b191c078d04232342.js +0 -1
- package/assets/esri/core/workers/chunks/91d2bdfa6e34c10b7f50.js +0 -1
- package/assets/esri/core/workers/chunks/92155d112ebb6a4c6c6e.js +0 -1
- package/assets/esri/core/workers/chunks/991e0f619f1f81f94d56.js +0 -1
- package/assets/esri/core/workers/chunks/9a27824d94df702e6e28.js +0 -1
- package/assets/esri/core/workers/chunks/b33122adfd1fb68f7c0f.js +0 -1
- package/assets/esri/core/workers/chunks/bbbe5d6cb8b737811c84.js +0 -1
- package/assets/esri/core/workers/chunks/bf26f58210755875748c.js +0 -1
- package/assets/esri/core/workers/chunks/d175953337fa655dc6b0.js +0 -1
- package/assets/esri/core/workers/chunks/d8c762ca94e3a11b125d.js +0 -1
- package/assets/esri/core/workers/chunks/dbc447413ab40a79ba87.js +0 -1
- package/assets/esri/core/workers/chunks/e26dc0c1654316bb1558.js +0 -1
- package/assets/esri/core/workers/chunks/e410a09650530d7aad10.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Error.js";import{getJsonType as t,isPoint as i}from"../../../../geometry/support/jsonUtils.js";import{wgs84 as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatures as r,convertToFeature as n,convertFromFeature as a}from"../../featureConversionUtils.js";import{initialObjectId as o,findLastObjectIdFromFeatures as l}from"../../objectIdUtils.js";import{executeQueryForSnapping as u}from"../../data/executeQueryForSnapping.js";import d from"../../data/FeatureStore.js";import{checkProjectionSupport as p,project as f}from"../../data/projectionSupport.js";import{QueryEngine as c}from"../../data/QueryEngine.js";import{createDefaultAttributesFunction as y,createDrawingInfo as m,createDefaultTemplate as h}from"./clientSideDefaults.js";import{loadGeometryEngineForSimplify as g,createFeatureEditErrorResult as I,mixAttributes as
|
|
5
|
+
import e from"../../../../core/Error.js";import{getJsonType as t,isPoint as i}from"../../../../geometry/support/jsonUtils.js";import{wgs84 as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatures as r,convertToFeature as n,convertFromFeature as a}from"../../featureConversionUtils.js";import{initialObjectId as o,findLastObjectIdFromFeatures as l}from"../../objectIdUtils.js";import{executeQueryForSnapping as u}from"../../data/executeQueryForSnapping.js";import d from"../../data/FeatureStore.js";import{checkProjectionSupport as p,project as f}from"../../data/projectionSupport.js";import{QueryEngine as c}from"../../data/QueryEngine.js";import{createDefaultAttributesFunction as y,createDrawingInfo as m,createDefaultTemplate as h}from"./clientSideDefaults.js";import{loadGeometryEngineForSimplify as g,createFeatureEditErrorResult as I,mixAttributes as b,createFeatureEditSuccessResult as F,simplify as j,queryBinsCapabilities as E}from"./sourceUtils.js";import _ from"../../../support/FieldsIndex.js";import{kebabDict as T}from"../../../support/fieldType.js";import{getFieldDefaultLength as x,getFieldDefaultValue as R}from"../../../support/fieldUtils.js";import{utc as q}from"../../../../time/timeZoneUtils.js";const O=s,D={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:s},w={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryBins:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0},queryBinsCapabilities:E};function Q(e){return i(e)?null!=e.z:!!e.hasZ}function S(e){return i(e)?null!=e.m:!!e.hasM}class v{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(t){const i=[],{features:s}=t,r=this._inferLayerProperties(s,t.fields),n=t.fields||[],a=null!=t.hasM?t.hasM:!!r.hasM,u=null!=t.hasZ?t.hasZ:!!r.hasZ,f=!t.spatialReference&&!r.spatialReference,g=f?O:t.spatialReference||r.spatialReference,I=f?D:null,b=t.geometryType||r.geometryType,F=!b;let j=t.objectIdField||r.objectIdField,E=t.timeInfo;const Q=new _(n);if(!F&&(f&&i.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!b))throw new e("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!j)throw new e("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(r.objectIdField&&j!==r.objectIdField&&(i.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${j}" doesn't match the field name "${r.objectIdField}", found in the provided fields`}),j=r.objectIdField),j&&!r.objectIdField){const e=Q.get(j);e?(j=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):n.unshift({alias:j,name:j,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const o of n){if(null==o.name&&(o.name=o.alias),null==o.alias&&(o.alias=o.name),!o.name)throw new e("feature-layer:invalid-field-name","field name is missing",{field:o});if(o.name===j&&(o.type="esriFieldTypeOID"),!T.jsonValues.includes(o.type))throw new e("feature-layer:invalid-field-type",`invalid type for field "${o.name}"`,{field:o});null==o.length&&(o.length=x(o))}const S={};for(const e of n)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=R(e);void 0!==t&&(S[e.name]=t)}if(E){if(E.startTimeField){const e=Q.get(E.startTimeField);e?(E.startTimeField=e.name,e.type="esriFieldTypeDate"):E.startTimeField=null}if(E.endTimeField){const e=Q.get(E.endTimeField);e?(E.endTimeField=e.name,e.type="esriFieldTypeDate"):E.endTimeField=null}if(E.trackIdField){const e=Q.get(E.trackIdField);e?E.trackIdField=e.name:(E.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:E}}))}E.startTimeField||E.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:E}}),E=null)}const v=Q.dateFields.length?{timeZoneIANA:t.dateFieldsTimeZone??q}:null;this._createDefaultAttributes=y(S,j);const M={warnings:i,featureErrors:[],layerDefinition:{...w,drawingInfo:m(b),templates:h(S),extent:I,geometryType:b,objectIdField:j,fields:n,hasZ:u,hasM:a,timeInfo:E,dateFieldsTimeReference:v},assignedObjectIds:{}};if(this._queryEngine=new c({fieldsIndex:_.fromLayerJSON({fields:n,timeInfo:E,dateFieldsTimeReference:v}),geometryType:b,hasM:a,hasZ:u,objectIdField:j,spatialReference:g,featureStore:new d({geometryType:b,hasM:a,hasZ:u}),timeInfo:E}),!s?.length)return this._nextObjectId=o,M;const Z=l(j,s);return this._nextObjectId=Z+1,await p(s,g),this._loadInitialFeatures(M,s)}async applyEdits(e){const{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([g(t,i),p(e.adds,t),p(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return u(this._queryEngine,e,t.signal)}queryAttributeBins(e,t={}){return this._queryEngine.executeAttributeBinsQuery(e,t.signal)}_inferLayerProperties(e,i){let s,r,n=null,a=null,o=null;for(const l of e){const e=l.geometry;if(null!=e&&(n||(n=t(e)),a||(a=e.spatialReference),null==s&&(s=Q(e)),null==r&&(r=S(e)),n&&a&&null!=s&&null!=r))break}if(i&&i.length){let e=null;i.some((t=>{const i="esriFieldTypeOID"===t.type,s=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,i||s}))&&(o=e.name)}return{geometryType:n,spatialReference:a,objectIdField:o,hasM:r,hasZ:s}}async _loadInitialFeatures(e,i){const{geometryType:s,hasM:n,hasZ:a,objectIdField:o,spatialReference:l,featureStore:u,fieldsIndex:d}=this._queryEngine,p=[];for(const r of i){if(null!=r.uid&&(e.assignedObjectIds[r.uid]=-1),r.geometry&&s!==t(r.geometry)){e.featureErrors.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),n=b(d,i,r.attributes,!0);n?e.featureErrors.push(n):(this._assignObjectId(i,r.attributes,!0),r.attributes=i,null!=r.uid&&(e.assignedObjectIds[r.uid]=r.attributes[o]),null!=r.geometry&&(r.geometry=f(r.geometry,r.geometry.spatialReference,l)),p.push(r))}u.addMany(r([],p,s,a,n,o));const{fullExtent:c,timeExtent:y}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=c,y){const{start:t,end:i}=y;e.layerDefinition.timeInfo.timeExtent=[t,i]}return e}async _applyEdits(e){const{adds:t,updates:i,deletes:s}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),i?.length&&this._applyUpdateEdits(r,i),s?.length){for(const e of s)r.deleteResults.push(F(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a,featureEditResults:r}}_applyAddEdits(e,i){const{addResults:s}=e,{geometryType:n,hasM:a,hasZ:o,objectIdField:l,spatialReference:u,featureStore:d,fieldsIndex:p}=this._queryEngine,c=[];for(const r of i){if(r.geometry&&n!==t(r.geometry)){s.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),a=b(p,i,r.attributes);if(a)s.push(a);else{if(this._assignObjectId(i,r.attributes),r.attributes=i,null!=r.uid){const t=r.attributes[l];e.uidToObjectId[r.uid]=t}if(null!=r.geometry){const e=r.geometry.spatialReference??u;r.geometry=f(j(r.geometry,e),e,u)}c.push(r),s.push(F(r.attributes[l]))}}d.addMany(r([],c,n,o,a,l))}_applyUpdateEdits({updateResults:e},i){const{geometryType:s,hasM:r,hasZ:o,objectIdField:l,spatialReference:u,featureStore:d,fieldsIndex:p}=this._queryEngine;for(const c of i){const{attributes:i,geometry:y}=c,m=i?.[l];if(null==m){e.push(I(`Identifier field ${l} missing`));continue}if(!d.has(m)){e.push(I(`Feature with object id ${m} missing`));continue}const h=n(d.getFeature(m),s,o,r);if(null!=y){if(s!==t(y)){e.push(I("Incorrect geometry type."));continue}const i=y.spatialReference??u;h.geometry=f(j(y,i),i,u)}if(i){const t=b(p,h.attributes,i);if(t){e.push(t);continue}}d.add(a(h,s,o,r,l)),e.push(F(m))}}_assignObjectId(e,t,i=!1){const s=this._queryEngine.objectIdField;i&&t&&isFinite(t[s])?e[s]=t[s]:e[s]=this._nextObjectId++}}export{v as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{clone as t}from"../../../../core/lang.js";import{queryCapabilities as s
|
|
5
|
+
import has from"../../../../core/has.js";import{clone as t}from"../../../../core/lang.js";import{queryCapabilities as s,queryBinsCapabilities as r}from"../../data/QueryEngineCapabilities.js";import{defaultPointSymbolJSON as e,defaultPolylineSymbolJSON as p,defaultPolygonSymbolJSON as o}from"../../../../symbols/support/defaultsJSON.js";function u(t){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===t||"esriGeometryMultipoint"===t?e:"esriGeometryPolyline"===t?p:o}}}const n=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let i=1;function a(t,s){if(has("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let r=`this${c(s)} = null;`;for(const s in t){r+=`this${c(s)} = ${JSON.stringify(t[s])};`}const e=new Function(`\n return class AttributesClass$${i++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new e}catch(r){return()=>({[s]:null,...t})}}function c(t){return n.test(t)?`.${t}`:`["${t}"]`}function l(s={}){return[{name:"New Feature",description:"",prototype:{attributes:t(s)}}]}function y(t,e){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:e,supportsDelete:e,supportsEditing:e,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:e,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:s,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:r,editing:{supportsGeometryUpdate:e,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}export{y as createCapabilities,a as createDefaultAttributesFunction,l as createDefaultTemplate,u as createDrawingInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{parseDate as t}from"../../../../core/date.js";import{isValid as
|
|
5
|
+
import{parseDate as t}from"../../../../core/date.js";import{isValid as e}from"../../../../geometry/support/spatialReferenceUtils.js";import{validateFieldValue as n,validationErrorToString as r,isNumericField as o,isStringField as i,isDateField as s,sanitizeNullFieldValue as l}from"../../../support/fieldUtils.js";class u{constructor(){this.code=null,this.description=null}}class a{constructor(t){this.error=new u,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=t}}function p(t){return new a(t)}class c{constructor(t){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=t}}function f(t){return new c(t)}const d=new Set;function g(t,e,o,i=!1){d.clear();for(const s in o){const l=t.get(s);if(!l)continue;const u=m(l,o[s]);if(d.add(l.name),l&&(i||l.editable)){const t=n(l,u);if(t)return p(r(t,l,u));e[l.name]=u}}for(const n of t.requiredFields??[])if(!d.has(n.name))return p(`missing required field "${n.name}"`);return null}function m(e,n){let r=n;return o(e)&&"string"==typeof n?r=parseFloat(n):i(e)&&null!=n&&"string"!=typeof n?r=String(n):s(e)&&"string"==typeof n&&(r=t(n)),l(r)}let y;function h(t,n){if(!t||!e(n))return t;if("rings"in t||"paths"in t){if(null==y)throw new TypeError("geometry engine not loaded");return y.simplify(n,t)}return t}async function I(){return null==y&&(y=await import("../../../../geometry/geometryEngineJSON.js")),y}async function E(t,n){!e(t)||"esriGeometryPolygon"!==n&&"esriGeometryPolyline"!==n||await I()}const S={supportsAutoIntervalBin:!0,supportsFixedIntervalBin:!0,supportsFixedBoundariesBin:!0,supportsDateBin:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsNormalization:!0,supportedStatisticTypes:["COUNT","SUM","AVG","VAR","STDDEV","MIN","MAX","PERCENTILE_CONT","PERCENTILE_DISC","CentroidAggregate","EnvelopeAggregate","ConvexHullAggregate"],supportedNormalizationTypes:["field","log","naturalLog","percentOfTotal","squareRoot"]};export{p as createFeatureEditErrorResult,f as createFeatureEditSuccessResult,E as loadGeometryEngineForSimplify,g as mixAttributes,S as queryBinsCapabilities,h as simplify};
|
|
@@ -54,7 +54,7 @@ export const cellStatistics: __esri.rasterFunctionUtils["cellStatistics"];
|
|
|
54
54
|
export const clip: __esri.rasterFunctionUtils["clip"];
|
|
55
55
|
export const colormap: __esri.rasterFunctionUtils["colormap"];
|
|
56
56
|
export const colormapToRGB: __esri.rasterFunctionUtils["colormapToRGB"];
|
|
57
|
-
export const
|
|
57
|
+
export const compositeBand: __esri.rasterFunctionUtils["compositeBand"];
|
|
58
58
|
export const conditional: __esri.rasterFunctionUtils["conditional"];
|
|
59
59
|
export const contrastBrightness: __esri.rasterFunctionUtils["contrastBrightness"];
|
|
60
60
|
export const convolution: __esri.rasterFunctionUtils["convolution"];
|
|
@@ -99,6 +99,7 @@ export const square: __esri.rasterFunctionUtils["square"];
|
|
|
99
99
|
export const statistics: __esri.rasterFunctionUtils["statistics"];
|
|
100
100
|
export const statisticsHistogram: __esri.rasterFunctionUtils["statisticsHistogram"];
|
|
101
101
|
export const stretchMinMax: __esri.rasterFunctionUtils["stretchMinMax"];
|
|
102
|
+
export const stretchNone: __esri.rasterFunctionUtils["stretchNone"];
|
|
102
103
|
export const stretchPercentClip: __esri.rasterFunctionUtils["stretchPercentClip"];
|
|
103
104
|
export const stretchStandardDeviation: __esri.rasterFunctionUtils["stretchStandardDeviation"];
|
|
104
105
|
export const table: __esri.rasterFunctionUtils["table"];
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
export{contrastBrightness,convolution,stretchHistogramEqualization,stretchMinMax,stretchNone,stretchPercentClip,stretchStandardDeviation}from"./rasterFunctions/creators/createAppearenceFunctions.js";export{bandArithmeticBAI,bandArithmeticCIg,bandArithmeticCIre,bandArithmeticClayMinerals,bandArithmeticCustom,bandArithmeticEVI,bandArithmeticFerrousMinerals,bandArithmeticGEMI,bandArithmeticGNDVI,bandArithmeticGVITM,bandArithmeticIronOxide,bandArithmeticMNDWI,bandArithmeticMSAVI,bandArithmeticMTVI2,bandArithmeticNBR,bandArithmeticNDBI,bandArithmeticNDMI,bandArithmeticNDSI,bandArithmeticNDVI,bandArithmeticNDVIre,bandArithmeticNDWI,bandArithmeticPVI,bandArithmeticRTVICore,bandArithmeticSAVI,bandArithmeticSR,bandArithmeticSRre,bandArithmeticSultan,bandArithmeticTSAVI,bandArithmeticVARI,bandArithmeticWNDWI}from"./rasterFunctions/creators/createBandIndexFunctions.js";export{computeChange,threshold}from"./rasterFunctions/creators/createChangeFunctions.js";export{colorspaceConversion,grayscale,spectralConversion,tasseledCap}from"./rasterFunctions/creators/createConversionFunctions.js";export{clip,colormap,colormapToRGB,
|
|
5
|
+
export{contrastBrightness,convolution,stretchHistogramEqualization,stretchMinMax,stretchNone,stretchPercentClip,stretchStandardDeviation}from"./rasterFunctions/creators/createAppearenceFunctions.js";export{bandArithmeticBAI,bandArithmeticCIg,bandArithmeticCIre,bandArithmeticClayMinerals,bandArithmeticCustom,bandArithmeticEVI,bandArithmeticFerrousMinerals,bandArithmeticGEMI,bandArithmeticGNDVI,bandArithmeticGVITM,bandArithmeticIronOxide,bandArithmeticMNDWI,bandArithmeticMSAVI,bandArithmeticMTVI2,bandArithmeticNBR,bandArithmeticNDBI,bandArithmeticNDMI,bandArithmeticNDSI,bandArithmeticNDVI,bandArithmeticNDVIre,bandArithmeticNDWI,bandArithmeticPVI,bandArithmeticRTVICore,bandArithmeticSAVI,bandArithmeticSR,bandArithmeticSRre,bandArithmeticSultan,bandArithmeticTSAVI,bandArithmeticVARI,bandArithmeticWNDWI}from"./rasterFunctions/creators/createBandIndexFunctions.js";export{computeChange,threshold}from"./rasterFunctions/creators/createChangeFunctions.js";export{colorspaceConversion,grayscale,spectralConversion,tasseledCap}from"./rasterFunctions/creators/createConversionFunctions.js";export{clip,colormap,colormapToRGB,compositeBand,createColorComposite,extractBand,mask,remap,statisticsHistogram,table,transposeBits}from"./rasterFunctions/creators/createDataManagementFunctions.js";export{abs,acos,acosh,asin,asinh,atan,atan2,atanh,bitwiseAnd,bitwiseLeftShift,bitwiseNot,bitwiseOr,bitwiseRightShift,bitwiseXor,booleanAnd,booleanNot,booleanOr,booleanXor,calculate,cellStatistics,conditional,cos,cosh,divide,equalTo,exp,exp10,exp2,float,greaterThan,greaterThanEqual,int,isNull,lessThan,lessThanEqual,log,log10,log2,minus,mod,negate,notEqual,plus,power,roundDown,roundUp,setNull,sin,sinh,sqrt,square,tan,tanh,times}from"./rasterFunctions/creators/createLocalFunctions.js";export{weightedOverlay,weightedSum}from"./rasterFunctions/creators/createMultiRasterAnalysisFunctions.js";export{aspect,curvature,hillshade,shadedRelief,slope}from"./rasterFunctions/creators/createSurfaceFunctions.js";export{argStatistics,statistics}from"./rasterFunctions/creators/createStatisticsFunctions.js";const t="$$";export{t as defaultRaster};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getNamedColor as t,hex2rgba as n}from"../../../../colorUtils.js";import{colormapName as e}from"../../rasterFunctionConstants.js";import{createRasterFunction as o}from"./utils.js";import{colorRampDict as r}from"../../../../renderers/support/colorRampUtils.js";function a(t){return"colormap"in t?s(t):"colorRamp"in t?i(t):u(t)}function s(e){const r=e.colormap.map((e=>{if("value"in e){const o="string"==typeof e.color?t(e.color)??n(e.color):e.color;(e=[e.value,...o])[4]&&e[4]<=1&&(e[4]=Math.round(255*e[4]))}return e})),{raster:a,outputPixelType:s}=e;return o("Colormap",{colormap:r,raster:a},s)}function i(t){const{raster:n,colorRamp:e,outputPixelType:r}=t,a={colorRamp:"toJSON"in e?e.toJSON():e,raster:n};return o("Colormap",a,r)}function u(t){const{colorRampName:n}=t,a=Object.values(e).find((t=>t.toLowerCase()===n?.toLowerCase())),s=r.toJSON(n),{raster:i,outputPixelType:u="unknown"}=t;return o("Colormap",a?{colormapName:a,raster:i}:{colorRampName:s,raster:i},u)}function l(t){const{raster:n,outputPixelType:e="u8"}=t;return o("ColormapToRGB",{raster:n},e)}function p(t){const{raster:n,histograms:e,outputPixelType:r}=t,a=t.statistics?.map((t=>({min:t.min,max:t.max,mean:t.avg,standardDeviation:t.stddev})));return o("StatisticsHistograms",{raster:n,statistics:a,histograms:e},r)}function c(t){const{raster:n,attributeTable:e,outputPixelType:r="unknown"}=t,a="toJSON"in e?e.toJSON():e;return o("Table",{raster:n,attributeTableAsRecordSet:a},r)}function m(t){const{raster:n,outputPixelType:e="unknown"}=t,r={raster:n,missingBandAction:"fail"===t.missingBandAction?1:0};return"bandIds"in t?r.bandIds=t.bandIds:"bandNames"in t?r.bandNames=t.bandNames:"bandWavelengths"in t&&(r.bandWavelengths=t.bandWavelengths),o("ExtractBand",r,e)}function d(t){const{redBand:n,greenBand:e,blueBand:r,raster:a,outputPixelType:s}=t,i="name"===t.method?0:2;return o("CreateColorComposite",{raster:a,method:i,bandIndexesR:n,bandIndexesG:e,bandIndexesB:r},s)}function f(t){const{rasters:n,outputPixelType:e}=t;return o("CompositeBand",{rasters:n},e)}function g(t){const{allowUnmatched:n,raster:e,rangeMaps:r,outputPixelType:a}=t,s=r?.filter((({output:t})=>null!=t)),i=s?.flatMap((({range:t})=>t)),u=s?.map((({output:t})=>t)),l=r?.filter((t=>null==t.output))?.flatMap((({range:t})=>t));return o("Remap",{allowUnmatched:n,raster:e,inputRanges:i,outputValues:u,noDataRanges:l},a)}function b(t){const{inputBitPositions:n,raster:e,fillRaster:r,outputBitPositions:a,outputPixelType:s}=t,i={inputBitPositions:n,outputBitPositions:a,raster:e};return null!=r&&("number"==typeof r?(i.constantFillCheck=!0,i.constantFillValue=r):i.fillRaster=r),o("TransposeBits",i,s)}function x(t){const{raster:n,outputPixelType:e="unknown"}=t,r=t.includedRanges?.flatMap((t=>t)),a=t.noDataValues?.map((t=>t.join(" "))),s="match-all"===t.noDataInterpretation?1:0;return o("Mask",{raster:n,includedRanges:r,noDataInterpretation:s,noDataValues:a},e)}function T(t){const{geometry:n,keepOutside:e,outputPixelType:r="unknown",raster:a}=t,s="declaredClass"in n?n.toJSON():n;return o("Clip",{clippingGeometry:s,clippingType:e?2:1,raster:a},r)}export{T as clip,a as colormap,l as colormapToRGB,f as
|
|
5
|
+
import{getNamedColor as t,hex2rgba as n}from"../../../../colorUtils.js";import{colormapName as e}from"../../rasterFunctionConstants.js";import{createRasterFunction as o}from"./utils.js";import{colorRampDict as r}from"../../../../renderers/support/colorRampUtils.js";function a(t){return"colormap"in t?s(t):"colorRamp"in t?i(t):u(t)}function s(e){const r=e.colormap.map((e=>{if("value"in e){const o="string"==typeof e.color?t(e.color)??n(e.color):e.color;(e=[e.value,...o])[4]&&e[4]<=1&&(e[4]=Math.round(255*e[4]))}return e})),{raster:a,outputPixelType:s}=e;return o("Colormap",{colormap:r,raster:a},s)}function i(t){const{raster:n,colorRamp:e,outputPixelType:r}=t,a={colorRamp:"toJSON"in e?e.toJSON():e,raster:n};return o("Colormap",a,r)}function u(t){const{colorRampName:n}=t,a=Object.values(e).find((t=>t.toLowerCase()===n?.toLowerCase())),s=r.toJSON(n),{raster:i,outputPixelType:u="unknown"}=t;return o("Colormap",a?{colormapName:a,raster:i}:{colorRampName:s,raster:i},u)}function l(t){const{raster:n,outputPixelType:e="u8"}=t;return o("ColormapToRGB",{raster:n},e)}function p(t){const{raster:n,histograms:e,outputPixelType:r}=t,a=t.statistics?.map((t=>({min:t.min,max:t.max,mean:t.avg,standardDeviation:t.stddev})));return o("StatisticsHistograms",{raster:n,statistics:a,histograms:e},r)}function c(t){const{raster:n,attributeTable:e,outputPixelType:r="unknown"}=t,a="toJSON"in e?e.toJSON():e;return o("Table",{raster:n,attributeTableAsRecordSet:a},r)}function m(t){const{raster:n,outputPixelType:e="unknown"}=t,r={raster:n,missingBandAction:"fail"===t.missingBandAction?1:0};return"bandIds"in t?r.bandIds=t.bandIds:"bandNames"in t?r.bandNames=t.bandNames:"bandWavelengths"in t&&(r.bandWavelengths=t.bandWavelengths),o("ExtractBand",r,e)}function d(t){const{redBand:n,greenBand:e,blueBand:r,raster:a,outputPixelType:s}=t,i="name"===t.method?0:2;return o("CreateColorComposite",{raster:a,method:i,bandIndexesR:n,bandIndexesG:e,bandIndexesB:r},s)}function f(t){const{rasters:n,outputPixelType:e}=t;return o("CompositeBand",{rasters:n},e)}function g(t){const{allowUnmatched:n,raster:e,rangeMaps:r,outputPixelType:a}=t,s=r?.filter((({output:t})=>null!=t)),i=s?.flatMap((({range:t})=>t)),u=s?.map((({output:t})=>t)),l=r?.filter((t=>null==t.output))?.flatMap((({range:t})=>t));return o("Remap",{allowUnmatched:n,raster:e,inputRanges:i,outputValues:u,noDataRanges:l},a)}function b(t){const{inputBitPositions:n,raster:e,fillRaster:r,outputBitPositions:a,outputPixelType:s}=t,i={inputBitPositions:n,outputBitPositions:a,raster:e};return null!=r&&("number"==typeof r?(i.constantFillCheck=!0,i.constantFillValue=r):i.fillRaster=r),o("TransposeBits",i,s)}function x(t){const{raster:n,outputPixelType:e="unknown"}=t,r=t.includedRanges?.flatMap((t=>t)),a=t.noDataValues?.map((t=>t.join(" "))),s="match-all"===t.noDataInterpretation?1:0;return o("Mask",{raster:n,includedRanges:r,noDataInterpretation:s,noDataValues:a},e)}function T(t){const{geometry:n,keepOutside:e,outputPixelType:r="unknown",raster:a}=t,s="declaredClass"in n?n.toJSON():n;return o("Clip",{clippingGeometry:s,clippingType:e?2:1,raster:a},r)}export{T as clip,a as colormap,l as colormapToRGB,f as compositeBand,d as createColorComposite,m as extractBand,x as mask,g as remap,p as statisticsHistogram,c as table,b as transposeBits};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "4.32.0-next.
|
|
3
|
+
"version": "4.32.0-next.20250206",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
29
|
-
"@esri/calcite-components": "~3.0.0-next.
|
|
29
|
+
"@esri/calcite-components": "~3.0.0-next.129",
|
|
30
30
|
"@vaadin/grid": "~24.6.3",
|
|
31
31
|
"@zip.js/zip.js": "~2.7.57",
|
|
32
32
|
"luxon": "~3.5.0",
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/JSONSupport.js";import{clone as o}from"../../core/lang.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as i}from"../../core/accessorSupport/decorators/writer.js";import p from"../../geometry/Multipoint.js";import l from"../../geometry/Point.js";import{getJsonType as n,fromJSON as m}from"../../geometry/support/jsonUtils.js";import{geometryTypes as a}from"../../geometry/support/typeUtils.js";import u from"../../layers/support/MosaicRule.js";import{interpolationKebab as y}from"../../layers/support/rasterEnums.js";import c from"../../time/TimeExtent.js";var d;let
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/JSONSupport.js";import{clone as o}from"../../core/lang.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as i}from"../../core/accessorSupport/decorators/writer.js";import p from"../../geometry/Multipoint.js";import l from"../../geometry/Point.js";import{getJsonType as n,fromJSON as m}from"../../geometry/support/jsonUtils.js";import{geometryTypes as a}from"../../geometry/support/typeUtils.js";import u from"../../layers/support/MosaicRule.js";import{interpolationKebab as y}from"../../layers/support/rasterEnums.js";import c from"../../time/TimeExtent.js";var d;let h=d=class extends e{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.raster=void 0,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(t,e,o){null!=t&&(e.geometryType=n(t),e[o]=t.toJSON())}set locations(t){if(t?.length){const e=new p({spatialReference:t[0].spatialReference,points:t.map((({x:t,y:e})=>[t,e]))});this._set("locations",t),this.geometry=e}}clone(){return new d(o({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};t([r({types:a,json:{read:m}})],h.prototype,"geometry",void 0),t([i("geometry")],h.prototype,"writeGeometry",null),t([r({type:[l]})],h.prototype,"locations",null),t([r({type:String,json:{type:y.jsonValues,read:y.read,write:y.write}})],h.prototype,"interpolation",void 0),t([r({type:u,json:{write:!0}})],h.prototype,"mosaicRule",void 0),t([r({type:[String],json:{write:!0}})],h.prototype,"outFields",void 0),t([r({type:l,json:{write:!0}})],h.prototype,"pixelSize",void 0),t([r({type:String,json:{write:!0}})],h.prototype,"raster",void 0),t([r({type:Boolean,json:{write:!0}})],h.prototype,"returnFirstValueOnly",void 0),t([r({type:Number,json:{write:!0}})],h.prototype,"sampleDistance",void 0),t([r({type:Number,json:{write:!0}})],h.prototype,"sampleCount",void 0),t([r({type:Number,json:{write:!0}})],h.prototype,"sliceId",void 0),t([r({type:c,json:{read:{source:"time"},write:{target:"time"}}})],h.prototype,"timeExtent",void 0),h=d=t([s("esri.rest.support.ImageSampleParameters")],h);const j=h;export{j as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{pickRandom as t}from"../../../core/arrayUtils.js";import r from"../../../core/Error.js";import a from"../../../core/Logger.js";import{assertIsSome as i}from"../../../core/maybe.js";import{timeout as s,throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{toQuantizationTransform as m}from"../../../geometry/support/quantizationUtils.js";import{kebabDict as p}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as y}from"../../../layers/support/fieldUtils.js";import c from"../../../rest/support/QuantizationParameters.js";import{getArcadeForPredominantCategory as f}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as d,uniqueValues as h,histogram as w,classBreaks as g,heatmapStatistics as F}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as S}from"../../statistics/support/utils.js";import{WorkerClient as v}from"../../statistics/support/WorkerClient.js";import{getFieldsList as q,isAnyDateField as V,fieldDelimiter as x}from"../utils.js";import z from"./LayerAdapter.js";import{getAttributeBinsQuery as _,processQueryAttributeBinsResult as T}from"./support/histogramUtils.js";import{ensureFeaturesJSON as N,getSummaryStatsQuery as M,getSummaryStatisticsFromFeatureSet as E,getViewInfoParams as L,getMissingFields as C,updateQueryWithFeatureFilter as j,getUVQuery as I,getUniqueValuesFromFeatureSet as b,getBins as O,getDomainsForFields as k,getPredominantCategoriesFromUVInfos as Q}from"./support/utils.js";import{processSummaryStatisticsResult as B,createUVResult as J,resolveCBResult as P}from"../../../statistics/utils.js";import{loadArcade as U}from"../../../support/arcadeOnDemand.js";const A=5;let $=null,G=class extends z{constructor(){super(...arguments),this._hasLocalSource=!1,this.adapterName="in-memory-layer-adapter"}destroy(){this.workerClient?.destroy()}async _waitForLayerViewUpdate(e){if(!e)throw new r(`${this.adapterName}:insufficient-data", "layerView is required to fetch the features`);const t=new AbortController,i=n((()=>!e.updating),t.signal);await s(i,5e3,t).catch((e=>{throw a.getLogger(this).warn("LayerView is taking too long to update. Aborting fetch from layerView."),e}))}async _fetchFeatureSetFromMemory(e,t,a){const i=this.layer;if(this._hasLocalSource&&"queryFeatures"in i)return i.queryFeatures(e);if(!t)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=await t.whenLayerView(this.layer);return await this._waitForLayerViewUpdate(s),s.queryFeatures(e,{signal:a})}async _fetchFeaturesFromMemory(e,t,a,i){const s=this.layer,o="json"===i;if(this._hasLocalSource&&"queryFeatures"in s){const e=await s.queryFeatures(t);return o?N(e.features):e.features}if(await this._waitForLayerViewUpdate(e),o&&"queryFeaturesJSON"in e&&e.queryFeaturesJSON){const{features:r}=await e.queryFeaturesJSON(t,{signal:a});return r}if(!("queryFeatures"in e))throw new r(`${this.adapterName}:not-supported`,"'queryFeatures' is not supported on the layerView");const n=await e.queryFeatures(t,{signal:a});return o?N(n.features):n.features}_fetchFeaturesForStats(e,t){return q({field:e.field,field2:e.field2,field3:e.field3,normalizationField:e.normalizationField,valueExpression:e.valueExpression}).then((r=>this.getSampleFeatures({sampleSize:-1,view:e.view,returnGeometry:e.returnGeometry,filter:e.filter,requiredFields:r,signal:e.signal},t)))}async _summaryStatsFromClientQuery(e,t){const{view:r,signal:a}=e,i=M(this,e,t),s=await this._fetchFeatureSetFromMemory(i,r,a),o=E(s,V(t)||y(t));return B(o,e.outStatisticTypes)}async _getNormalizationTotalFromMemory(e,t,a){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"querySummaryStatistics"in o?await o.querySummaryStatistics(n,{field:e},{signal:a}):i?await this.workerClient.summaryStatistics({field:e,outStatisticTypes:l},i):await d({attribute:{field:e,outStatisticTypes:l},features:s??[]})).sum;if(null==u)throw new r(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _summaryStatsFromMemory(e,t){const{view:r,field:a,valueExpression:i,normalizationType:s,signal:o}=e,n={field:a,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:l,graphics:u,layerView:m,query:y,fieldInfos:c}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"querySummaryStatistics"});return i&&r&&(l||u)&&(n.fieldType=t?.type?p.toJSON(t.type):null,n.viewInfoParams=L(r),n.timeZone=r.timeZone,n.fieldInfos=c),"percent-of-total"===s&&null==e.normalizationTotal&&(n.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:l,graphics:u,layerView:m,query:y},o)),!l&&!u&&m&&"querySummaryStatistics"in m?m.querySummaryStatistics(y,n,{signal:o}):l?this.workerClient.summaryStatistics(n,l):d({attribute:n,features:u})}async _getFilteredFeatures(e,t){let r=[];if("intersects"===t?.spatialRelationship){const{intersect:a}=await import("../../../geometry/geometryEngineAsync.js"),i=null!=t.geometry?t.geometry:null;for(const t of e){const e=null!=t.geometry?t.geometry:null;if(e&&i){await a(e,i)&&r.push(t)}}}else r=e;return e.length&&"declaredClass"in e[0]&&"esri.Graphic"===e[0].declaredClass?{graphics:r}:{featuresJSON:r}}async _processStatsFromMemoryParams(e){const{features:t,filter:r}=e;if(t?.length)return this._getFilteredFeatures(t,r);const{view:a,field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,layerViewFunc:u,signal:m}=e;let p=e.returnGeometry;if(null==p&&l){if(!$){const{arcadeUtils:e}=await U();$=e}const e=$.hasGeometryOperations(l);e&&await $.enableGeometryOperations(),p=e}let y=null,c=null,f=null,d=null,h=null;if(a)try{const e="subtype-sublayer"===this.layer.type?this.layer.parent:this.layer;y=await a.whenLayerView(e),c=null!=u&&u in y&&"function"==typeof y[u]}catch{c=!1}if(c)try{await this._waitForLayerViewUpdate(y);const e=await q({field:i,field2:s,field3:o,normalizationField:n,valueExpression:l});C(this,e,y).length?c=!1:(f=this.layer.createQuery(),f.outFields=e,f.returnGeometry=!1,j(f,r)),y.suspended&&(c=!1)}catch{c=!1}return c||(d=await this._fetchFeaturesForStats({field:i,field2:s,field3:o,valueExpression:l,normalizationField:n,returnGeometry:p,filter:r,view:a,signal:m},"json"),h=(await q({valueExpression:l})).map((e=>this.getField(e)?.toJSON())).filter(Boolean)),{layerView:y,query:f,featuresJSON:d,fieldInfos:h}}async _uvFromClientQuery(e,t){const{view:r,signal:a}=e,i=I(this,e),s=await this._fetchFeatureSetFromMemory(i,r,a),o=await b(s,{layer:this,field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:x,view:e.view,signal:e.signal});return J(o,t,e.returnAllCodedValues,x)}async _uvFromMemory(e,t){const{view:r,field:a,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:p}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryUniqueValues"}),y={field:a,field2:e.field2,field3:e.field3,fieldDelimiter:x,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&r&&(n||l)&&(y.viewInfoParams=L(r),y.timeZone=r.timeZone,y.fieldInfos=p),!n&&!l&&u&&"queryUniqueValues"in u?u.queryUniqueValues(m,y,{signal:o}):n?this.workerClient.uniqueValues(y,n):h({attribute:y,features:l})}_histogramForField(e){let t=null;return t=null!=e.minValue&&null!=e.maxValue?Promise.resolve({min:e.minValue,max:e.maxValue}):this.summaryStatistics({...e,outStatisticTypes:{include:["min","max","count"]}}).then((e=>{if(!e.count)throw new r(`${this.adapterName}:insufficient-data`,"Either the layer has no features or none of the features have data for the field");return{min:e.min,max:e.max}})),t.then((t=>O(this,{min:t.min,max:t.max},e.field,e.numBins??void 0,e.view,e.filter,e.signal)))}async _histogramFromQueryAttributeBinsFromMemory(e){const{field:t,normalizationType:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAttributeBins"});if(!n||!("queryAttributeBins"in n)||s)throw new r(`${this.adapterName}:not-supported`,"'queryAttributeBins' is not supported on the layerView");const u="percent-of-total"===a?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,{featuresJSON:s,graphics:o,layerView:n,query:l},i):null,{query:m,min:p,max:y}=await _(e,this,u,l?.where);if(!m)return{bins:[],minValue:p,maxValue:y,normalizationTotal:u};const c=await n.queryAttributeBins(m,{signal:i});return T(c,t?this.getField(t):null,{minValue:p,maxValue:y,normalizationTotal:u})}async _histogramFromMemory(e){const{view:t,field:r,valueExpression:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryHistogram"}),m={field:r,valueExpression:a,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numBins:e.numBins};return a&&t&&(s||o)&&(m.viewInfoParams=L(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryHistogram"in n?n.queryHistogram(l,m,{signal:i}):s?this.workerClient.histogram(m,s):w({attribute:m,features:o})}_classBreaksFromInterpolation(e){const{minValue:t,maxValue:r}=e,a=e.numClasses||A,i=[],s=(r-t)/a;for(let l=0;l<a;l++){const e=t+l*s;i.push({minValue:e,maxValue:e+s})}i[a-1].maxValue=r;const o={classBreaks:i,normalizationTotal:e.normalizationTotal},n=P(o,e.classificationMethod);return Promise.resolve(n)}async _classBreaksFromMemory(e){const{view:t,field:r,valueExpression:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryClassBreaks"}),m={field:r,valueExpression:a,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return a&&t&&(s||o)&&(m.viewInfoParams=L(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryClassBreaks"in n?n.queryClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):g({attribute:m,features:o})}async _heatmapStatsFromMemory(e){const{view:t,field:r,radius:a,signal:s}=e;i(t,"InMemoryLayerAdapter: must have a view");try{const r=await t.whenLayerView(this.layer);if("queryHeatmapStatistics"in r&&!r.updating&&!e.filter)return await r.queryHeatmapStatistics({field:e.field,radius:e.radius})}catch{o(s)}const{featuresJSON:n,graphics:l}=await this._processStatsFromMemoryParams({...e,returnGeometry:!0}),u=new c({extent:t.extent,tolerance:"2d"===t.type?t.state.resolution:t.pixelSizeAt?.(t.center)}),p={field:r,radius:a,transform:m(u),spatialReference:t.spatialReference?.toJSON(),size:t.size};return n?.length||l?.length?n?this.workerClient.heatmapStatistics(p,n):F({attribute:p,features:l}):{min:null,max:null}}getField(e=""){return this.layer.getField(e)}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!0,supportsStatistics:!0}:null}getFieldDomain(e,t){return this.layer.getFieldDomain(e,t)}createQuery(){return this.layer.createQuery()}async summaryStatistics(e){const{field:t,valueExpression:a,sqlExpression:i,features:s,view:o}=e,n=t?this.getField(t):null,l=!!a,u="3d"===o?.type;if(!a&&i&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return l||s||u?this._summaryStatsFromMemory(e,n):this._summaryStatsFromClientQuery(e,n)}async uniqueValues(e){const{valueExpression:t,sqlExpression:a,features:i,view:s}=e,o=await k(e,this),n=!!t,l="3d"===s?.type;if(!t&&a&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return n||i||l?this._uvFromMemory(e,o):this._uvFromClientQuery(e,o)}async histogram(e){const{features:t,valueExpression:a,normalizationType:i,sqlExpression:s}=e,o=t||!!a;if(!a&&s&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return o||i?this._histogramFromMemory(e):this._histogramForField(e)}async classBreaks(e){return!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)}async queryFeatureCount(e){const{whereClause:t,view:a,signal:i}=e;if(!a)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=this.layer.createQuery();s.where=S(s.where,t);const o=await a.whenLayerView(this.layer);return await n((()=>!o.updating),i),o.queryFeatureCount(s,{signal:i})}async generateRenderer(e,t){throw new r(`${this.adapterName}:not-supported`,"Layer does not support generateRenderer operation")}async predominantCategories(e){const{fields:t,view:r,signal:a,filter:i}=e,s=f(t),o=await this._uvFromMemory({valueExpression:s,view:r,signal:a,filter:i});return Q(o.uniqueValueInfos,t)}async heatmapStatistics(e){return this._heatmapStatsFromMemory(e)}async getSampleFeatures(e,a){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,filter:l,signal:u}=e,m=this.layer.createQuery(),p=1;if(m.outSpatialReference=i?.spatialReference,m.returnGeometry=!!n,m.outFields=o,j(m,l),!i)throw new r(`${this.adapterName}:not-supported`,"view is required to get sample features for Layer");const y=await i.whenLayerView(this.layer);if(C(this,o,y).length)throw new r(`${this.adapterName}:not-supported`,"Required fields need to be passed in the outFields for Layer");const c=await this._fetchFeaturesFromMemory(y,m,u,a),f=null!=s&&s>0&&s<=c.length?s:c.length;return t(c,f,p)}load(e){const t=this.layer.load(e).then((async t=>{this.geometryType=t.geometryType,this.objectIdField=t.objectIdField,this.supportsSQLExpression="stream"===t.type||!!t.capabilities?.query?.supportsSqlExpression,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent="fullExtent"in t?t.fullExtent:t.parent?.fullExtent,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.workerClient=v.getInstance(),await this.workerClient.open(e.signal)}));return this.addResolvingPromise(t),Promise.resolve(this)}};e([l({readOnly:!0})],G.prototype,"adapterName",void 0),e([l({constructOnly:!0})],G.prototype,"layer",void 0),G=e([u("esri.smartMapping.support.adapters.InMemoryLayerAdapter")],G);const D=G;export{D as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{pickRandom as t}from"../../../core/arrayUtils.js";import r from"../../../core/Error.js";import a from"../../../core/Logger.js";import{assertIsSome as i}from"../../../core/maybe.js";import{timeout as s,throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{toQuantizationTransform as m}from"../../../geometry/support/quantizationUtils.js";import{kebabDict as p}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as y}from"../../../layers/support/fieldUtils.js";import c from"../../../rest/support/QuantizationParameters.js";import{getArcadeForPredominantCategory as f}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as d,uniqueValues as h,histogram as w,classBreaks as g,heatmapStatistics as F}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as S}from"../../statistics/support/utils.js";import{WorkerClient as v}from"../../statistics/support/WorkerClient.js";import{getFieldsList as q,isAnyDateField as V,fieldDelimiter as x}from"../utils.js";import _ from"./LayerAdapter.js";import{getHistogramAttributeDefinition as z,getAttributeBinsQuery as T,processQueryAttributeBinsResult as N}from"./support/histogramUtils.js";import{ensureFeaturesJSON as M,getSummaryStatsQuery as L,getSummaryStatisticsFromFeatureSet as E,getViewInfoParams as C,getMissingFields as j,updateQueryWithFeatureFilter as b,getUVQuery as k,getUniqueValuesFromFeatureSet as I,getBins as O,getDomainsForFields as Q,getPredominantCategoriesFromUVInfos as J}from"./support/utils.js";import{processSummaryStatisticsResult as B,createUVResult as P,resolveCBResult as U}from"../../../statistics/utils.js";import{loadArcade as A}from"../../../support/arcadeOnDemand.js";const $=5;let G=null,R=class extends _{constructor(){super(...arguments),this._hasLocalSource=!1,this.adapterName="in-memory-layer-adapter"}destroy(){this.workerClient?.destroy()}async _waitForLayerViewUpdate(e){if(!e)throw new r(`${this.adapterName}:insufficient-data", "layerView is required to fetch the features`);const t=new AbortController,i=n((()=>!e.updating),t.signal);await s(i,5e3,t).catch((e=>{throw a.getLogger(this).warn("LayerView is taking too long to update. Aborting fetch from layerView."),e}))}async _fetchFeatureSetFromMemory(e,t,a){const i=this.layer;if(this._hasLocalSource&&"queryFeatures"in i)return i.queryFeatures(e);if(!t)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=await t.whenLayerView(this.layer);return await this._waitForLayerViewUpdate(s),s.queryFeatures(e,{signal:a})}async _fetchFeaturesFromMemory(e,t,a,i){const s=this.layer,o="json"===i;if(this._hasLocalSource&&"queryFeatures"in s){const e=await s.queryFeatures(t);return o?M(e.features):e.features}if(await this._waitForLayerViewUpdate(e),o&&"queryFeaturesJSON"in e&&e.queryFeaturesJSON){const{features:r}=await e.queryFeaturesJSON(t,{signal:a});return r}if(!("queryFeatures"in e))throw new r(`${this.adapterName}:not-supported`,"'queryFeatures' is not supported on the layerView");const n=await e.queryFeatures(t,{signal:a});return o?M(n.features):n.features}_fetchFeaturesForStats(e,t){return q({field:e.field,field2:e.field2,field3:e.field3,normalizationField:e.normalizationField,valueExpression:e.valueExpression}).then((r=>this.getSampleFeatures({sampleSize:-1,view:e.view,returnGeometry:e.returnGeometry,filter:e.filter,requiredFields:r,signal:e.signal},t)))}async _summaryStatsFromClientQuery(e,t){const{view:r,signal:a}=e,i=L(this,e,t),s=await this._fetchFeatureSetFromMemory(i,r,a),o=E(s,V(t)||y(t));return B(o,e.outStatisticTypes)}async _getNormalizationTotalFromMemory(e,t,a){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"querySummaryStatistics"in o?await o.querySummaryStatistics(n,{field:e},{signal:a}):i?await this.workerClient.summaryStatistics({field:e,outStatisticTypes:l},i):await d({attribute:{field:e,outStatisticTypes:l},features:s??[]})).sum;if(null==u)throw new r(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _summaryStatsFromMemory(e,t){const{view:r,field:a,valueExpression:i,normalizationType:s,signal:o}=e,n={field:a,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:l,graphics:u,layerView:m,query:y,fieldInfos:c}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"querySummaryStatistics"});return i&&r&&(l||u)&&(n.fieldType=t?.type?p.toJSON(t.type):null,n.viewInfoParams=C(r),n.timeZone=r.timeZone,n.fieldInfos=c),"percent-of-total"===s&&null==e.normalizationTotal&&(n.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:l,graphics:u,layerView:m,query:y},o)),!l&&!u&&m&&"querySummaryStatistics"in m?m.querySummaryStatistics(y,n,{signal:o}):l?this.workerClient.summaryStatistics(n,l):d({attribute:n,features:u})}async _getFilteredFeatures(e,t){let r=[];if("intersects"===t?.spatialRelationship){const{intersect:a}=await import("../../../geometry/geometryEngineAsync.js"),i=null!=t.geometry?t.geometry:null;for(const t of e){const e=null!=t.geometry?t.geometry:null;if(e&&i){await a(e,i)&&r.push(t)}}}else r=e;return e.length&&"declaredClass"in e[0]&&"esri.Graphic"===e[0].declaredClass?{graphics:r}:{featuresJSON:r}}async _processStatsFromMemoryParams(e){const{features:t,filter:r}=e;if(t?.length)return this._getFilteredFeatures(t,r);const{view:a,field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,layerViewFunc:u,signal:m}=e;let p=e.returnGeometry;if(null==p&&l){if(!G){const{arcadeUtils:e}=await A();G=e}const e=G.hasGeometryOperations(l);e&&await G.enableGeometryOperations(),p=e}let y=null,c=null,f=null,d=null,h=null;if(a)try{const e="subtype-sublayer"===this.layer.type?this.layer.parent:this.layer;y=await a.whenLayerView(e),c=null!=u&&u in y&&"function"==typeof y[u]}catch{c=!1}if(c)try{await this._waitForLayerViewUpdate(y);const e=await q({field:i,field2:s,field3:o,normalizationField:n,valueExpression:l});j(this,e,y).length?c=!1:(f=this.layer.createQuery(),f.outFields=e,f.returnGeometry=!1,b(f,r)),y.suspended&&(c=!1)}catch{c=!1}return c||(d=await this._fetchFeaturesForStats({field:i,field2:s,field3:o,valueExpression:l,normalizationField:n,returnGeometry:p,filter:r,view:a,signal:m},"json"),h=(await q({valueExpression:l})).map((e=>this.getField(e)?.toJSON())).filter(Boolean)),{layerView:y,query:f,featuresJSON:d,fieldInfos:h}}async _uvFromClientQuery(e,t){const{view:r,signal:a}=e,i=k(this,e),s=await this._fetchFeatureSetFromMemory(i,r,a),o=await I(s,{layer:this,field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:x,view:e.view,signal:e.signal});return P(o,t,e.returnAllCodedValues,x)}async _uvFromMemory(e,t){const{view:r,field:a,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:p}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryUniqueValues"}),y={field:a,field2:e.field2,field3:e.field3,fieldDelimiter:x,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&r&&(n||l)&&(y.viewInfoParams=C(r),y.timeZone=r.timeZone,y.fieldInfos=p),!n&&!l&&u&&"queryUniqueValues"in u?u.queryUniqueValues(m,y,{signal:o}):n?this.workerClient.uniqueValues(y,n):h({attribute:y,features:l})}_histogramForField(e){let t=null;return t=null!=e.minValue&&null!=e.maxValue?Promise.resolve({min:e.minValue,max:e.maxValue}):this.summaryStatistics({...e,outStatisticTypes:{include:["min","max","count"]}}).then((e=>{if(!e.count)throw new r(`${this.adapterName}:insufficient-data`,"Either the layer has no features or none of the features have data for the field");return{min:e.min,max:e.max}})),t.then((t=>O(this,{min:t.min,max:t.max},e.field,e.numBins??void 0,e.view,e.filter,e.signal)))}async _histogramFromQueryAttributeBinsFromMemory(e){const{field:t,normalizationType:r,signal:a}=e,i=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAttributeBins"}),{featuresJSON:s,graphics:o,layerView:n,query:l}=i,u="percent-of-total"===r?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,i,a):void 0;if(!n||!("queryAttributeBins"in n)||s||o){const t=z(e,i,u);return s?this.workerClient.histogram(t,s):w({attribute:t,features:o})}const{query:m,min:p,max:y}=await T(e,this,u,l?.where);if(!m)return{bins:[],minValue:p,maxValue:y,normalizationTotal:u};const c=await n.queryAttributeBins(m,{signal:a});return N(c,t?this.getField(t):null,{minValue:p,maxValue:y,normalizationTotal:u})}async _histogramFromMemory(e){const{field:t,signal:r}=e,a=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryHistogram"}),{featuresJSON:i,graphics:s,layerView:o,query:n}=a,l="percent-of-total"===e.normalizationType?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,a,r):void 0,u=z(e,a,l);return!i&&!s&&o&&"queryHistogram"in o?o.queryHistogram(n,u,{signal:r}):i?this.workerClient.histogram(u,i):w({attribute:u,features:s})}_classBreaksFromInterpolation(e){const{minValue:t,maxValue:r}=e,a=e.numClasses||$,i=[],s=(r-t)/a;for(let l=0;l<a;l++){const e=t+l*s;i.push({minValue:e,maxValue:e+s})}i[a-1].maxValue=r;const o={classBreaks:i,normalizationTotal:e.normalizationTotal},n=U(o,e.classificationMethod);return Promise.resolve(n)}async _classBreaksFromMemory(e){const{view:t,field:r,valueExpression:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryClassBreaks"}),m={field:r,valueExpression:a,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return a&&t&&(s||o)&&(m.viewInfoParams=C(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryClassBreaks"in n?n.queryClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):g({attribute:m,features:o})}async _heatmapStatsFromMemory(e){const{view:t,field:r,radius:a,signal:s}=e;i(t,"InMemoryLayerAdapter: must have a view");try{const r=await t.whenLayerView(this.layer);if("queryHeatmapStatistics"in r&&!r.updating&&!e.filter)return await r.queryHeatmapStatistics({field:e.field,radius:e.radius})}catch{o(s)}const{featuresJSON:n,graphics:l}=await this._processStatsFromMemoryParams({...e,returnGeometry:!0}),u=new c({extent:t.extent,tolerance:"2d"===t.type?t.state.resolution:t.pixelSizeAt?.(t.center)}),p={field:r,radius:a,transform:m(u),spatialReference:t.spatialReference?.toJSON(),size:t.size};return n?.length||l?.length?n?this.workerClient.heatmapStatistics(p,n):F({attribute:p,features:l}):{min:null,max:null}}getField(e=""){return this.layer.getField(e)}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!0,supportsStatistics:!0}:null}getFieldDomain(e,t){return this.layer.getFieldDomain(e,t)}createQuery(){return this.layer.createQuery()}async summaryStatistics(e){const{field:t,valueExpression:a,sqlExpression:i,features:s,view:o}=e,n=t?this.getField(t):null,l=!!a,u="3d"===o?.type;if(!a&&i&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return l||s||u?this._summaryStatsFromMemory(e,n):this._summaryStatsFromClientQuery(e,n)}async uniqueValues(e){const{valueExpression:t,sqlExpression:a,features:i,view:s}=e,o=await Q(e,this),n=!!t,l="3d"===s?.type;if(!t&&a&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return n||i||l?this._uvFromMemory(e,o):this._uvFromClientQuery(e,o)}async histogram(e){const{features:t,valueExpression:a,normalizationType:i,sqlExpression:s}=e,o=t||!!a;if(!a&&s&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return o||i?this._histogramFromMemory(e):this._histogramForField(e)}async classBreaks(e){return!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)}async queryFeatureCount(e){const{whereClause:t,view:a,signal:i}=e;if(!a)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=this.layer.createQuery();s.where=S(s.where,t);const o=await a.whenLayerView(this.layer);return await n((()=>!o.updating),i),o.queryFeatureCount(s,{signal:i})}async generateRenderer(e,t){throw new r(`${this.adapterName}:not-supported`,"Layer does not support generateRenderer operation")}async predominantCategories(e){const{fields:t,view:r,signal:a,filter:i}=e,s=f(t),o=await this._uvFromMemory({valueExpression:s,view:r,signal:a,filter:i});return J(o.uniqueValueInfos,t)}async heatmapStatistics(e){return this._heatmapStatsFromMemory(e)}async getSampleFeatures(e,a){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,filter:l,signal:u}=e,m=this.layer.createQuery(),p=1;if(m.outSpatialReference=i?.spatialReference,m.returnGeometry=!!n,m.outFields=o,b(m,l),!i)throw new r(`${this.adapterName}:not-supported`,"view is required to get sample features for Layer");const y=await i.whenLayerView(this.layer);if(j(this,o,y).length)throw new r(`${this.adapterName}:not-supported`,"Required fields need to be passed in the outFields for Layer");const c=await this._fetchFeaturesFromMemory(y,m,u,a),f=null!=s&&s>0&&s<=c.length?s:c.length;return t(c,f,p)}load(e){const t=this.layer.load(e).then((async t=>{this.geometryType=t.geometryType,this.objectIdField=t.objectIdField,this.supportsSQLExpression="stream"===t.type||!!t.capabilities?.query?.supportsSqlExpression,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent="fullExtent"in t?t.fullExtent:t.parent?.fullExtent,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.workerClient=v.getInstance(),await this.workerClient.open(e.signal)}));return this.addResolvingPromise(t),Promise.resolve(this)}};e([l({readOnly:!0})],R.prototype,"adapterName",void 0),e([l({constructOnly:!0})],R.prototype,"layer",void 0),R=e([u("esri.smartMapping.support.adapters.InMemoryLayerAdapter")],R);const D=R;export{D as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import i from"../../../../core/Error.js";import{resolveTimeZone as e}from"../../../../intl/date.js";import{isTimeOnlyField as n,isDateField as t,isTimestampOffsetField as a,isDateOnlyField as r}from"../../../../layers/support/fieldUtils.js";import o from"../../../../rest/support/AttributeBinsQuery.js";import l from"../../../../rest/support/AutoIntervalBinParameters.js";import s from"../../../../rest/support/DateBinParameters.js";import u from"../../../../rest/support/FixedBoundariesBinParameters.js";import m from"../../../../rest/support/FixedIntervalBinParameters.js";import d from"../../../../rest/support/GenerateRendererParameters.js";import p from"../../../../rest/support/StatisticDefinition.js";import{getSQLFilterForNormalization as f,mergeWhereClauses as c,getRangeExpr as y}from"../../../statistics/support/utils.js";import{isAnyDateField as z}from"../../utils.js";import{getSQLExpressionForDateOrTimeField as v,getFieldExpr as x,defaultNumBins as w,generateBinParams as T,updateQueryWithFeatureFilter as h,getViewInfoParams as F}from"./utils.js";import{createClassBreaksDefinition as B}from"../../../../statistics/utils.js";const V="countOFExpr",j="lowerBoundary",q="upperBoundary";function I(i,e,t){const a=i.valueExpression||i.sqlExpression,r=i.signal;if(!a){const{field:a,normalizationType:o,normalizationField:l}=i,s=a?e.getField(a):null,u=z(s)||n(s),m={field:a,normalizationType:o,normalizationField:l,normalizationTotal:t,layer:e};return{sqlExpression:u?v(e,s):x(m),sqlWhere:u?null:i.sqlWhere||f({field:a,normalizationType:o,normalizationField:l}),filter:i.filter,signal:r}}return{valueExpression:i.valueExpression,sqlExpression:i.sqlExpression,sqlWhere:i.sqlWhere,filter:i.filter,signal:r}}async function M(i,e,n){const{field:t,normalizationType:a,normalizationField:r,signal:o}=i,l=f({field:t,normalizationType:a,normalizationField:r}),s=new d({classificationDefinition:B({field:t,normalizationType:a,normalizationField:r,classificationMethod:i.classificationMethod,standardDeviationInterval:i.standardDeviationInterval,definedInterval:i.definedInterval,breakCount:i.numBins||w}),where:c(l,n)});return e.generateRenderer(s,o).then((i=>{const{normalizationTotal:n,classBreaks:o}=i;return T({field:t,normalizationType:a,normalizationField:r,normalizationTotal:n,classBreaks:o,where:l,layer:e})}))}async function g(e,t,a,o,d){const{field:p,sqlExpression:f,normalizationField:c,classificationMethod:z,normalizationType:v}=e,T=p?t.getField(p):null,h=n(T),F=r(T)||h,B=e.numBins||w;if(F){if(v||z)throw new i(`${t.adapterName}:not-supported`,"NormalizationType and classificationMethod are not supported for date-only and time-only fields");const e=(o-a)/B/1e3,n=e/86400;return new s({field:p,expression:f,interval:{unit:h?"seconds":"days",value:Math.ceil(h?e:n)},start:a,end:o})}if("defined-interval"===z)return new m({field:p,expression:f,normalizationField:c,normalizationTotal:d,normalizationType:v,interval:e.definedInterval??Math.ceil((o-a)/B),start:v?null:a,end:v?null:o,normalizationMinValue:v?a:null,normalizationMaxValue:v?o:null});if("manual"===z)throw new i(`${t.adapterName}:not-supported`,"Layer does not support manual classificationMethod");if("natural-breaks"===z||"quantile"===z||"standard-deviation"===z){const n=x({field:p,normalizationField:c,normalizationTotal:d,normalizationType:v,layer:t}),r=null!==e.minValue&&null!==e.maxValue?y(n,e.minValue,e.maxValue):void 0,o=await M(e,t,r);if(!o.intervals)throw new i(`${t.adapterName}:invalid`,"Invalid intervals returned from generate renderer");const l=[a,...o.intervals.map((i=>i[1]))];return new u({field:v?null:p,expression:v?n:f,boundaries:l})}return new l({field:p,normalizationField:c,normalizationTotal:d,normalizationType:v,expression:f,numBins:B,start:v?null:a,end:v?null:o,normalizationMinValue:v?a:null,normalizationMaxValue:v?o:null})}function E(i,e,n,t){return null!=n&&null!=t?Promise.resolve({min:n,max:t}):e.summaryStatistics({...i,outStatisticTypes:{include:["min","max"]}}).then((i=>({min:i.min,max:i.max})))}async function b(i,n,r,l){const{field:s,minValue:u,maxValue:m,filter:d,view:f}=i,y=s?n.getField(s):null,z=t(y)||a(y),v=I(i,n,r),{min:x,max:w}=await E(v,n,u,m);if(null==x||null==w)return{query:null,min:x,max:w};const T=new p({statisticType:"count",outStatisticFieldName:V,onStatisticField:"1"}),F=c(l,v.sqlWhere),B="lowerBoundary",j="upperBoundary",q=new o({binParameters:await g(i,n,x,w,r),outStatistics:[T],binOrder:i.sortOrder,where:F,lowerBoundaryAlias:B,upperBoundaryAlias:j,outTimeZone:f?.timeZone&&z?e(f.timeZone):null});return h(q,d),{query:q,min:x,max:w}}function D(i,e=!1){if("string"!=typeof i)return i;return(e?new Date(`1970-01-01T${i}Z`):new Date(i)).getTime()}function P(i,e,t){const a=n(e);return{...t,bins:i.features.map((i=>({minValue:D(i.attributes[j],a),maxValue:D(i.attributes[q],a),count:i.attributes[V]})))}}function S(i,e,n){const{valueExpression:t,view:a}=i,{featuresJSON:r,graphics:o,fieldInfos:l}=e,s={field:i.field,valueExpression:t,normalizationType:i.normalizationType,normalizationField:i.normalizationField,normalizationTotal:n,minValue:i.minValue,maxValue:i.maxValue,standardDeviationInterval:i.standardDeviationInterval,classificationMethod:i.classificationMethod,numBins:i.numBins};return t&&a&&(r||o)&&(s.viewInfoParams=F(a),s.timeZone=a.timeZone,s.fieldInfos=l),s}export{M as binParamsFromGenRend,D as formatHistogramBinValue,b as getAttributeBinsQuery,E as getDataRange,S as getHistogramAttributeDefinition,I as getQueryParamsForExpr,P as processQueryAttributeBinsResult};
|
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const c="
|
|
5
|
+
const c="20250206",a="c3c4c90f3496a87ccc25181fb1bc4315a7708dda";export{c as buildDate,a as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"./CIMResourceManager.js";import{Transformation as t,CanvasDrawHelper as i}from"./CIMSymbolDrawHelper.js";import{CIMSymbolHelper as r}from"./CIMSymbolHelper.js";import{OverrideHelper as a}from"./OverrideHelper.js";import{mapCIMSymbolToGeometryType as s}from"./utils.js";const n=96/72;class h{constructor(t){this._spatialReference=t,this._imageDataCanvas=null,this._cimResourceManager=new e}get _canvas(){return this._imageDataCanvas||(this._imageDataCanvas=document.createElement("canvas")),this._imageDataCanvas}get resourceManager(){return this._cimResourceManager}async rasterizeCIMSymbolAsync(e,t,i,n,h,l,c,m,g){if(!e)return null;const{data:y}=e;if(!y||"CIMSymbolReference"!==y.type||!y.symbol)return null;const{symbol:d}=y;l||(l=s(d));const u=await a.resolveSymbolOverrides(y,t,this._spatialReference,h,l,c,m),w=this._cimResourceManager,p=[];r.fetchResources(u,w,p),r.fetchFonts(u,w,p),p.length>0&&await Promise.all(p);const{width:b,height:f}=i,M=o(l,b,f,n),C=r.getEnvelope(u,M,w);if(!C)return null;C.x===1/0&&(C.x=b+2),C.y===1/0&&(C.y=-f/2),C.width===-1/0&&(C.width=b),C.height===-1/0&&(C.height=f);let R=1,v=0,x=0;switch(d.type){case"CIMPointSymbol":case"CIMTextSymbol":{let e=1;C.width>b&&(e=b/C.width);let t=1;C.height>f&&(t=f/C.height),"preview"===n&&(C.width<b&&(e=b/C.width),C.height<f&&(t=f/C.height)),R=Math.min(e,t),v=C.x+C.width/2,x=C.y+C.height/2}break;case"CIMLineSymbol":{(g||C.height>f)&&(R=f/C.height),x=C.y+C.height/2;const e=C.x*R+b/2,t=(C.x+C.width)*R+b/2,{paths:i}=M;i[0][0][0]-=e/R,i[0][2][0]-=(t-b)/R}break;case"CIMPolygonSymbol":{v=C.x+C.width/2,x=C.y+C.height/2;const e=C.x*R+b/2,t=(C.x+C.width)*R+b/2,i=C.y*R+f/2,r=(C.y+C.height)*R+f/2,{rings:a}=M;e<0&&(a[0][0][0]-=e,a[0][3][0]-=e,a[0][4][0]-=e),i<0&&(a[0][0][1]+=i,a[0][1][1]+=i,a[0][4][1]+=i),t>b&&(a[0][1][0]-=t-b,a[0][2][0]-=t-b),r>f&&(a[0][2][1]+=r-f,a[0][3][1]+=r-f)}}const I={type:"cim",data:{type:"CIMSymbolReference",symbol:u}};return this.rasterize(I,b,f,v,x,R,l,1,M)}rasterize(e,r,a,h,l,c,m,g=0,y=null){const{data:
|
|
5
|
+
import e from"./CIMResourceManager.js";import{Transformation as t,CanvasDrawHelper as i}from"./CIMSymbolDrawHelper.js";import{CIMSymbolHelper as r}from"./CIMSymbolHelper.js";import{OverrideHelper as a}from"./OverrideHelper.js";import{mapCIMSymbolToGeometryType as s}from"./utils.js";const n=96/72;class h{constructor(t){this._spatialReference=t,this._imageDataCanvas=null,this._cimResourceManager=new e}get _canvas(){return this._imageDataCanvas||(this._imageDataCanvas=document.createElement("canvas")),this._imageDataCanvas}get resourceManager(){return this._cimResourceManager}async rasterizeCIMSymbolAsync(e,t,i,n,h,l,c,m,g){if(!e)return null;const{data:y}=e;if(!y||"CIMSymbolReference"!==y.type||!y.symbol)return null;const{symbol:d}=y;l||(l=s(d));const u=await a.resolveSymbolOverrides(y,t,this._spatialReference,h,l,c,m),w=this._cimResourceManager,p=[];r.fetchResources(u,w,p),r.fetchFonts(u,w,p),p.length>0&&await Promise.all(p);const{width:b,height:f}=i,M=o(l,b,f,n),C=r.getEnvelope(u,M,w);if(!C)return null;C.x===1/0&&(C.x=b+2),C.y===1/0&&(C.y=-f/2),C.width===-1/0&&(C.width=b),C.height===-1/0&&(C.height=f);let R=1,v=0,x=0;switch(d.type){case"CIMPointSymbol":case"CIMTextSymbol":{let e=1;C.width>b&&(e=b/C.width);let t=1;C.height>f&&(t=f/C.height),"preview"===n&&(C.width<b&&(e=b/C.width),C.height<f&&(t=f/C.height)),R=Math.min(e,t),v=C.x+C.width/2,x=C.y+C.height/2}break;case"CIMLineSymbol":{(g||C.height>f)&&(R=f/C.height),x=C.y+C.height/2;const e=C.x*R+b/2,t=(C.x+C.width)*R+b/2,{paths:i}=M;i[0][0][0]-=e/R,i[0][2][0]-=(t-b)/R}break;case"CIMPolygonSymbol":{v=C.x+C.width/2,x=C.y+C.height/2;const e=C.x*R+b/2,t=(C.x+C.width)*R+b/2,i=C.y*R+f/2,r=(C.y+C.height)*R+f/2,{rings:a}=M;e<0&&(a[0][0][0]-=e,a[0][3][0]-=e,a[0][4][0]-=e),i<0&&(a[0][0][1]+=i,a[0][1][1]+=i,a[0][4][1]+=i),t>b&&(a[0][1][0]-=t-b,a[0][2][0]-=t-b),r>f&&(a[0][2][1]+=r-f,a[0][3][1]+=r-f)}}const I={type:"cim",data:{type:"CIMSymbolReference",symbol:u}};return this.rasterize(I,b,f,v,x,R,l,1,M)}rasterize(e,r,a,h,l,c,m,g=0,y=null,d=window.devicePixelRatio||1){const{data:u}=e;if(!u||"CIMSymbolReference"!==u.type||!u.symbol)return null;const{symbol:w}=u,p=this._canvas,b=d*n;p.width=r*b,p.height=a*b,m||(m=s(w)),y||(y=o(m,r,a,"legend")),p.width+=2*g,p.height+=2*g;const f=p.getContext("2d",{willReadFrequently:!0}),M=t.createIdentity();M.translate(-h,-l),M.scale(c*b,-c*b),M.translate(r*b/2+g,a*b/2+g),f.clearRect(0,0,p.width,p.height);return new i(f,this._cimResourceManager,M,!0).drawSymbol(w,y),f.getImageData(0,0,p.width,p.height)}}function o(e,t,i,r){const a=1,s=-t/2+a,n=t/2-a,h=i/2-a,o=-i/2+a;switch(e){case"esriGeometryPoint":return{x:0,y:0};case"esriGeometryPolyline":return{paths:[[[s,0],[0,0],[n,0]]]};default:return"legend"===r?{rings:[[[s,h],[n,0],[n,o],[s,o],[s,h]]]}:{rings:[[[s,h],[n,h],[n,o],[s,o],[s,h]]]}}}export{h as CIMSymbolRasterizer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../../../core/Logger.js";import{disposeMaybe as r}from"../../../../../../../core/maybe.js";import{PixelType as t,TextureWrapMode as a,RenderbufferFormat as i}from"../../../../../../webgl/enums.js";import{FramebufferObject as s}from"../../../../../../webgl/FramebufferObject.js";import{loadHeatmapTextureConfiguration as u}from"../../../../../../webgl/heatmapTextureUtils.js";import{RenderbufferDescriptor as l}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as o}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as n}from"../../../../../../webgl/TextureDescriptor.js";const m=()=>e.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");class f{destroy(){this._accumulateFramebuffer=r(this._accumulateFramebuffer),this._resolveGradientTexture=r(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return null!=this._accumulateFramebuffer&&null!=this._resolveGradientTexture}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(null==this._qualityProfile){const r=u(e,m());this._qualityProfile={...r,defines:{usesHalfFloatPrecision:r.dataType!==t.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,r,t){if(null==this._accumulateFramebuffer){const{dataType:u,samplingMode:o,pixelFormat:m,internalFormat:f}=this.loadQualityProfile(e),h=new n(r,t);h.pixelFormat=m,h.internalFormat=f,h.dataType=u,h.samplingMode=o,h.wrapMode=a.CLAMP_TO_EDGE;const c=new l(i.DEPTH_STENCIL,r,t);this._accumulateFramebuffer=new s(e,h,c)}else{const{width:e,height:a}=this._accumulateFramebuffer;e===r&&a===t||this._accumulateFramebuffer.resize(r,t)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,r,t){if(null==this._resolveGradientTexture){const r=new n;r.wrapMode=a.CLAMP_TO_EDGE,this._resolveGradientTexture=new o(e,r)}
|
|
5
|
+
import e from"../../../../../../../core/Logger.js";import{disposeMaybe as r}from"../../../../../../../core/maybe.js";import{PixelType as t,TextureWrapMode as a,RenderbufferFormat as i}from"../../../../../../webgl/enums.js";import{FramebufferObject as s}from"../../../../../../webgl/FramebufferObject.js";import{loadHeatmapTextureConfiguration as u}from"../../../../../../webgl/heatmapTextureUtils.js";import{RenderbufferDescriptor as l}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as o}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as n}from"../../../../../../webgl/TextureDescriptor.js";const m=()=>e.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");class f{destroy(){this._accumulateFramebuffer=r(this._accumulateFramebuffer),this._resolveGradientTexture=r(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return null!=this._accumulateFramebuffer&&null!=this._resolveGradientTexture}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(null==this._qualityProfile){const r=u(e,m());this._qualityProfile={...r,defines:{usesHalfFloatPrecision:r.dataType!==t.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,r,t){if(null==this._accumulateFramebuffer){const{dataType:u,samplingMode:o,pixelFormat:m,internalFormat:f}=this.loadQualityProfile(e),h=new n(r,t);h.pixelFormat=m,h.internalFormat=f,h.dataType=u,h.samplingMode=o,h.wrapMode=a.CLAMP_TO_EDGE;const c=new l(i.DEPTH_STENCIL,r,t);this._accumulateFramebuffer=new s(e,h,c)}else{const{width:e,height:a}=this._accumulateFramebuffer;e===r&&a===t||this._accumulateFramebuffer.resize(r,t)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,r,t){if(null==this._resolveGradientTexture){const r=new n;r.wrapMode=a.CLAMP_TO_EDGE,this._resolveGradientTexture=new o(e,r),this._prevGradientHash=null}return this._prevGradientHash!==r&&(this._resolveGradientTexture.resize(t.length/4,1),this._resolveGradientTexture.setData(t),this._prevGradientHash=r),this._resolveGradientTexture}}export{f as HeatmapResources};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{unitRGBAFromColor as t}from"../../../core/colorUtils.js";import{clamp as r,lerp as s}from"../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../core/maybe.js";import{watch as o,syncAndInitial as a}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{i as h,l as c,k as p}from"../../../chunks/vec32.js";import{s as u}from"../../../chunks/vec42.js";import{ZEROS as d}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as f}from"../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as l}from"../webgl.js";import{innerAtmosphereDepth as g,computeInnerAltitudeFade as b}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as _,ChapmanAtmosphereTechnique as P}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as j}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{ColorFormat as w}from"../webgl/formats.js";import{OpaqueEnvironment as T}from"../webgl-engine/effects/OpaqueEnvironment.js";import{RenderRequestType as v}from"../webgl-engine/lib/basicInterfaces.js";import{createQuadVAO as A,Layout as q}from"../webgl-engine/lib/glUtil3D.js";import{applyTextureResizeModulo as E}from"../webgl-engine/lib/textureUtils.js";import{A as C}from"../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as x}from"../webgl-engine/shaders/AtmosphereCompositingTechnique.js";import{PrimitiveType as D}from"../../webgl/enums.js";import R from"../../../webscene/background/ColorBackground.js";let M=class extends T{constructor(){super(...arguments),this.requireGeometryDepth=!0,this._compositingPassParameters=new C,this._vao=null,this._passParameters=new _,this._configuration=new j}initialize(){this.techniques.precompile(P,this._configuration),this.techniques.precompile(x),this._configuration.reduced=!0,this.techniques.precompile(P,this._configuration),this._configuration.reduced=!1,this.addHandles([o((()=>this.view.environment.background),(e=>{const r=e instanceof R?t(e.color):d;h(this._passParameters.backgroundColor,r[0]*r[3],r[1]*r[3],r[2]*r[3])}),a),o((()=>this.view._stage?.renderer?.fullResolutionAtmosphere),(e=>this._configuration.reduced=!e),a),o((()=>this.view.environment.atmosphereEnabled),(e=>e?this._enable():this._disable()),a)])}destroy(){this._vao=i(this._vao)}render(e){const t=e.find((({name:e})=>e===l.OPAQUE_ENVIRONMENT));if(!this.bindParameters.mainDepth)return t;const r=this.renderingContext;this._vao??=A(r,q.Pos2Tex);const i=t.getAttachment(r.gl.DEPTH_STENCIL_ATTACHMENT);this._update();const o=this.techniques.get(P,this._configuration);if(!o.compiled)return this.requestRender(v.UPDATE),t;if(!this._configuration.reduced)return t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(o,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(D.TRIANGLE_STRIP,0,4),t.attachDepth(i),t;const a=this.techniques.get(x);if(!a.compiled)return this.requestRender(v.UPDATE),t;const n=r.getViewport(),m=this.bindParameters.camera,h=c(m.eye)-f.radius;let p;const u=f.atmosphereHeight;if(h<u){const e=Math.min(1,Math.max(0,h/u));p=s(.2,.3,e)}else{const e=Math.min(1,Math.max(0,(h-u)/(15*u)));p=s(.3,.6,e)}const d=E(Math.round(p*m.fullViewport[2])),g=E(Math.round(p*m.fullViewport[3]));r.setViewport(0,0,d,g);const b=this.fboCache.acquire(d,g,"chapman",w.RGBA);return r.bindFramebuffer(b.fbo),r.clearFramebuffer([0,0,0,1],!0,!0),r.bindTechnique(o,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(D.TRIANGLE_STRIP,0,4),r.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=b.getTexture(),t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(a,this.bindParameters,this._compositingPassParameters),r.screen.draw(),t.attachDepth(i),b.release(),t}_update(){const e=this.bindParameters.camera,t=p(e.eye),s=Math.sqrt(t),i=t-this._passParameters.radii[1]**2,o=r((s-this._passParameters.radii[0])/f.atmosphereHeight,0,1);u(this._passParameters.heightParameters,s,t,i,o);const a=this.view.basemapTerrain
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{unitRGBAFromColor as t}from"../../../core/colorUtils.js";import{clamp as r,lerp as s}from"../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../core/maybe.js";import{watch as o,syncAndInitial as a}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{i as h,l as c,k as p}from"../../../chunks/vec32.js";import{s as u}from"../../../chunks/vec42.js";import{ZEROS as d}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as f}from"../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as l}from"../webgl.js";import{innerAtmosphereDepth as g,computeInnerAltitudeFade as b}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as _,ChapmanAtmosphereTechnique as P}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as j}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{ColorFormat as w}from"../webgl/formats.js";import{OpaqueEnvironment as T}from"../webgl-engine/effects/OpaqueEnvironment.js";import{RenderRequestType as v}from"../webgl-engine/lib/basicInterfaces.js";import{createQuadVAO as A,Layout as q}from"../webgl-engine/lib/glUtil3D.js";import{applyTextureResizeModulo as E}from"../webgl-engine/lib/textureUtils.js";import{A as C}from"../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as x}from"../webgl-engine/shaders/AtmosphereCompositingTechnique.js";import{PrimitiveType as D}from"../../webgl/enums.js";import R from"../../../webscene/background/ColorBackground.js";let M=class extends T{constructor(){super(...arguments),this.requireGeometryDepth=!0,this._compositingPassParameters=new C,this._vao=null,this._passParameters=new _,this._configuration=new j}initialize(){this.techniques.precompile(P,this._configuration),this.techniques.precompile(x),this._configuration.reduced=!0,this.techniques.precompile(P,this._configuration),this._configuration.reduced=!1,this.addHandles([o((()=>this.view.environment.background),(e=>{const r=e instanceof R?t(e.color):d;h(this._passParameters.backgroundColor,r[0]*r[3],r[1]*r[3],r[2]*r[3])}),a),o((()=>this.view._stage?.renderer?.fullResolutionAtmosphere),(e=>this._configuration.reduced=!e),a),o((()=>this.view.environment.atmosphereEnabled),(e=>e?this._enable():this._disable()),a)])}destroy(){this._vao=i(this._vao)}render(e){const t=e.find((({name:e})=>e===l.OPAQUE_ENVIRONMENT));if(!this.bindParameters.mainDepth)return t;const r=this.renderingContext;this._vao??=A(r,q.Pos2Tex);const i=t.getAttachment(r.gl.DEPTH_STENCIL_ATTACHMENT);this._update();const o=this.techniques.get(P,this._configuration);if(!o.compiled)return this.requestRender(v.UPDATE),t;if(!this._configuration.reduced)return t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(o,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(D.TRIANGLE_STRIP,0,4),t.attachDepth(i),t;const a=this.techniques.get(x);if(!a.compiled)return this.requestRender(v.UPDATE),t;const n=r.getViewport(),m=this.bindParameters.camera,h=c(m.eye)-f.radius;let p;const u=f.atmosphereHeight;if(h<u){const e=Math.min(1,Math.max(0,h/u));p=s(.2,.3,e)}else{const e=Math.min(1,Math.max(0,(h-u)/(15*u)));p=s(.3,.6,e)}const d=E(Math.round(p*m.fullViewport[2])),g=E(Math.round(p*m.fullViewport[3]));r.setViewport(0,0,d,g);const b=this.fboCache.acquire(d,g,"chapman",w.RGBA);return r.bindFramebuffer(b.fbo),r.clearFramebuffer([0,0,0,1],!0,!0),r.bindTechnique(o,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(D.TRIANGLE_STRIP,0,4),r.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=b.getTexture(),t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(a,this.bindParameters,this._compositingPassParameters),r.screen.draw(),t.attachDepth(i),b.release(),t}_update(){const e=this.bindParameters.camera,t=p(e.eye),s=Math.sqrt(t),i=t-this._passParameters.radii[1]**2,o=r((s-this._passParameters.radii[0])/f.atmosphereHeight,0,1);u(this._passParameters.heightParameters,s,t,i,o);const a=this.view.basemapTerrain?.getLowerBoundRadius()??0;m(this._passParameters.radii,a,a+f.atmosphereHeight),this._passParameters.innerFadeDistance=2*Math.sqrt((2*a-g)*g),this._passParameters.altitudeFade=b(s-a)}};M=e([n("esri.views.3d.environment.ChapmanAtmosphere")],M);export{M as ChapmanAtmosphere};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{makeHandle as r,handlesGroup as i,destroyHandle as n}from"../../../core/handleUtils.js";import"../../../core/has.js";import{isIterable as s}from"../../../core/iteratorUtils.js";import{getProjectiveTransform as a}from"../../../core/perspectiveUtils.js";import{debounce as o,isPromiseLike as d}from"../../../core/promiseUtils.js";import{watch as l,on as m,syncAndInitial as h}from"../../../core/reactiveUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{toExtent as u}from"../../../geometry/support/aaBoundingRect.js";import{MediaElementView as y}from"../../../layers/support/MediaElementView.js";import{DrapeSourceType as _}from"./interfaces.js";import{LayerView3D as f}from"./LayerView3D.js";import{MediaLayerInteraction as E}from"./support/MediaLayerInteraction.js";import{drapedZ as D}from"../terrain/OverlayRenderer.js";import{Attribute as w}from"../webgl-engine/lib/Attribute.js";import{Geometry as v}from"../webgl-engine/lib/Geometry.js";import{DirtyState as b,DirtyOperation as j}from"../webgl-engine/lib/ModelDirtyTypes.js";import{Object3DHighlightStateID as R}from"../webgl-engine/lib/Object3DStateID.js";import{RenderGeometry as I}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as H}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as G}from"../webgl-engine/lib/UpdatePolicy.js";import{VertexAttribute as A}from"../webgl-engine/lib/VertexAttribute.js";import{ImageMaterial as T}from"../webgl-engine/materials/ImageMaterial.js";import
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{makeHandle as r,handlesGroup as i,destroyHandle as n}from"../../../core/handleUtils.js";import"../../../core/has.js";import{isIterable as s}from"../../../core/iteratorUtils.js";import{getProjectiveTransform as a}from"../../../core/perspectiveUtils.js";import{debounce as o,isPromiseLike as d}from"../../../core/promiseUtils.js";import{watch as l,on as m,syncAndInitial as h}from"../../../core/reactiveUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{toExtent as u}from"../../../geometry/support/aaBoundingRect.js";import{MediaElementView as y}from"../../../layers/support/MediaElementView.js";import{DrapeSourceType as _}from"./interfaces.js";import{LayerView3D as f}from"./LayerView3D.js";import{MediaLayerInteraction as E}from"./support/MediaLayerInteraction.js";import{drapedZ as D}from"../terrain/OverlayRenderer.js";import{Attribute as w}from"../webgl-engine/lib/Attribute.js";import{Geometry as v}from"../webgl-engine/lib/Geometry.js";import{DirtyState as b,DirtyOperation as j}from"../webgl-engine/lib/ModelDirtyTypes.js";import{Object3DHighlightStateID as R}from"../webgl-engine/lib/Object3DStateID.js";import{RenderGeometry as I}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as H}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as G}from"../webgl-engine/lib/UpdatePolicy.js";import{VertexAttribute as A}from"../webgl-engine/lib/VertexAttribute.js";import{ImageMaterial as T}from"../webgl-engine/materials/ImageMaterial.js";import M from"../../layers/LayerView.js";import x from"../../layers/MediaLayerView.js";import{defaultHighlightName as P}from"../../support/HighlightDefaults.js";import{isInEffectiveScaleRange as S}from"../../support/layerViewUtils.js";import{TextureWrapMode as L}from"../../webgl/enums.js";let V=class extends(f(x(M))){get interactive(){return this._interaction.enabled}set interactive(e){this._interaction&&(this._interaction.enabled=e)}get selectedElement(){return this._interaction.selectedElement}set selectedElement(e){this._interaction&&(this._interaction.selectedElement=e)}get visibleAtCurrentScale(){return S(this.layer.effectiveScaleRange,this.view.scale)}constructor(e){super(e),this.type="media-3d",this.drapeSourceType=_.Features,this.updatePolicy=G.ASYNC,this._uidToElement=new Map,this._highlightedElements=new Map,this._elementsInHighlightedId=new Map,this._renderedElements=new Map,this._lastDrapingExtent=null,this._update=o((async(e,t,r)=>{const i=await this._collectMediaElements(e,t,r);this._synchronizeRenderElements(i)}),0);const{view:t,layer:r}=e;this._interaction=new E({view:t,layer:r}),this.addHandles(l((()=>this.interactionOptions),(e=>this._interaction.options=e),h))}initialize(){const{view:e,layer:t}=this;this._renderer=e.basemapTerrain.overlayManager.registerGeometryDrapeSource(this);const i=()=>this._updateWithLastDrapingExtent();this.addHandles([r((()=>e.basemapTerrain.overlayManager.unregisterDrapeSource(this))),m((()=>t.effectiveSource),"change",i),m((()=>t.effectiveSource),"refresh",i)]),this._updatingHandles.add((()=>this.suspended),i)}setDrapingExtent(e,t){this._lastDrapingExtent={overlays:e,spatialReference:t},this._updateWithLastDrapingExtent()}getHit(e){const t=this._uidToElement.get(e);return t?{type:"media",element:t,layer:this.layer}:null}highlight(e,t){const i=new R(t?.name??P),n=s(e)?Array.from(e):[e];this._elementsInHighlightedId.set(i,n);for(const r of n){const e=this._highlightedElements.get(r);e?e.add(i):this._highlightedElements.set(r,new Set([i]));const t=this._renderedElements.get(r);t?.renderData&&(t.renderData.renderGeometry.geometry.addHighlight(i),this._renderer.modifyGeometries([t.renderData.renderGeometry],b.HIGHLIGHT))}return r((()=>{const e=this._elementsInHighlightedId.get(i);if(e){for(const t of e){const e=this._highlightedElements.get(t);if(!e)continue;e.delete(i);const r=this._renderedElements.get(t);r?.renderData&&(r.renderData.renderGeometry.geometry.removeHighlight(i),this._renderer.modifyGeometries([r.renderData.renderGeometry],b.HIGHLIGHT)),0===e.size&&this._highlightedElements.delete(t)}this._elementsInHighlightedId.delete(i)}}))}isUpdating(){return super.isUpdating()||this._interaction.updating}_updateWithLastDrapingExtent(){if(null==this._lastDrapingExtent||this.suspended)return void(this._renderer&&this._synchronizeRenderElements(new Set));const{overlays:e,spatialReference:t}=this._lastDrapingExtent;this._updatingHandles.addPromise(this._update(e,t).catch((()=>{})))}async _collectMediaElements(e,t,r){const i=this.layer.effectiveSource;return null==i?new Set:new Set((await Promise.all(e.map((e=>i.queryElements(u(e.extent,t),{signal:r}))))).flat())}_synchronizeRenderElements(e){this._synchronizeRenderElementsRemove(e),this._synchronizeRenderElementsAdd(e)}_synchronizeRenderElementsRemove(e){this._renderedElements.forEach(((t,r)=>{e.has(r)||(this._removeElement(r,t),this.emit("element-render-changed",{element:r}))}))}_synchronizeRenderElementsAdd(e){for(const t of e)this._renderedElements.has(t)||this._createRenderElement(t)}_removeElement(e,{renderData:t,handle:r}){this._destroyRenderData(e,t),this._renderedElements.delete(e),this._uidToElement.delete(e.uid),r.remove()}async _createRenderElement(e){const t=new y({spatialReference:this.view.spatialReference,element:e}),r={renderData:null,handle:i([this._updatingHandles.add((()=>e.opacity),(e=>{null!=r.renderData&&r.renderData.material.setParameters({opacity:e})})),this._updatingHandles.add((()=>t.coords),(()=>{null!=r.renderData?this._updateGeometry(t,r,r.renderData):this._initializeRenderData(t,r)})),this._updatingHandles.add((()=>e.content),(()=>this._initializeRenderData(t,r))),n(t)])};this._renderedElements.set(e,r),this._uidToElement.set(e.uid,e),this._updatingHandles.addPromise(e.load().catch((()=>{}))),this._initializeRenderData(t,r)}_initializeRenderData(e,t){const{coords:r,element:i}=e,{contentWidth:n,contentHeight:s}=i;if(null==r||null==i.content)return void(t.renderData=this._destroyRenderData(i,t.renderData));if(null!=t.renderData)return;const a=this._createTexture(i.content),o=a.load(this.view._stage.renderView.renderingContext);this.view._stage.add(a),d(o)&&this._updatingHandles.addPromise(o);const l=new T({initTextureTransparent:!0,textureId:a.id,opacity:i.opacity,perspectiveInterpolation:!0}),m=this._getPositionAttributeArray(r),h=[0,0,1,0,1,1,0,1],c=this._getPerspectiveDivideAttributeArray(m,n,s),p=[0,1,2,0,2,3],g=new v(l,[[A.POSITION,new w(m,p,3,!0)],[A.UV0,new w(h,p,2,!0)],[A.PERSPECTIVEDIVIDE,new w(c,p,1,!0)]]),u=new I(g,{layerUid:this.layer.uid,graphicUid:i.uid}),y=this._highlightedElements.get(i);y?.forEach((e=>{u.geometry.addHighlight(e)})),this._renderer.addGeometries([u],j.ADD),t.renderData={renderGeometry:u,texture:a,material:l},this.emit("element-render-changed",{element:i})}_updateGeometry(e,t,r){const{coords:i,element:n}=e;if(null==i||null==n.content)return void(t.renderData=this._destroyRenderData(n,t.renderData));const s=this._getPositionAttributeArray(i);r.renderGeometry.geometry.setAttributeData(A.POSITION,s);const a=this._getPerspectiveDivideAttributeArray(s,n.contentWidth,n.contentHeight);r.renderGeometry.geometry.setAttributeData(A.PERSPECTIVEDIVIDE,a),r.renderGeometry.geometry.invalidateBoundingInfo(),this._renderer.modifyGeometries([r.renderGeometry],b.GEOMETRY),this.emit("element-render-changed",{element:n})}_getPositionAttributeArray(e){const[t,r,i,n]=e.rings[0];return[t[0],t[1],D,n[0],n[1],D,i[0],i[1],D,r[0],r[1],D]}_getPerspectiveDivideAttributeArray(e,t,r){a(z,[0,0,t,0,t,r,0,r],[e[0],e[1],e[3],e[4],e[6],e[7],e[9],e[10]]);const i=z[6]/z[8]*t,n=z[7]/z[8]*r;return[1,1+i,1+i+n,1+n]}_destroyRenderData(e,t){if(null==t)return null;const r=t.texture;return r.unload(),this.view._stage.remove(r),this._renderer.removeGeometries([t.renderGeometry],j.REMOVE),this.emit("element-render-changed",{element:e}),null}_createTexture(e){const r=e instanceof HTMLImageElement?e.naturalWidth:e.width,i=e instanceof HTMLImageElement?e.naturalHeight:e.height;if("getFrame"in e)throw new t("media-layer-view-3d","animation is not supported");return new H(e,{wrap:{s:L.CLAMP_TO_EDGE,t:L.CLAMP_TO_EDGE},preMultiplyAlpha:!0,width:r,height:i,mipmap:!0,updateCallback:()=>this.view.basemapTerrain.overlayManager.requestRender()})}get test(){}};e([c({readOnly:!0})],V.prototype,"type",void 0),e([c()],V.prototype,"layer",void 0),e([c()],V.prototype,"interactive",null),e([c()],V.prototype,"selectedElement",null),e([c({readOnly:!0})],V.prototype,"visibleAtCurrentScale",null),V=e([p("esri.views.3d.layers.MediaLayerView3D")],V);const z=g(),O=V;export{O as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../Color.js";import{result as t,createTask as r}from"../../../../core/asyncUtils.js";import i from"../../../../core/Error.js";import has from"../../../../core/has.js";import{clone as s}from"../../../../core/lang.js";import{abortMaybe as o,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAbortError as n,throwIfAborted as l}from"../../../../core/promiseUtils.js";import{pt2px as c,px2pt as h}from"../../../../core/screenUtils.js";import{numericHash as u}from"../../../../core/string.js";import{dataComponents as m}from"../../../../core/urlUtils.js";import{fromValues as d,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as _,fromValues as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPointToVector as g}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as x}from"../../../../geometry/support/aaBoundingBox.js";import{createRendererExpression as b}from"../../../../support/arcadeOnDemand.js";import{CIMSymbolHelper as v}from"../../../../symbols/cim/CIMSymbolHelper.js";import{evaluateValueOrFunction as S}from"../../../../symbols/cim/utils.js";import{scaleCIMSymbol as P}from"../../../../symbols/support/cimSymbolUtils.js";import{defaultPrimitive as R}from"../../../../symbols/support/IconSymbol3DLayerResource.js";import{Symbol3DAnchorPosition2D as w}from"../../../../symbols/support/Symbol3DAnchorPosition2D.js";import{getIconHref as C}from"../../../../symbols/support/utils.js";import{focusAreaHUDColor as z}from"../../../FocusAreas.js";import{transparentUnit as O}from"./constants.js";import{perObjectElevationAligner as j}from"./ElevationAligners.js";import{SymbolUpdateType as M,elevationModeChangeUpdateType as I,needsElevationUpdates2D as T}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as E}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as D}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as F}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as A}from"./graphicUtils.js";import{ApplyRendererDiffResult as U}from"./interfaces.js";import{namedAnchorToHUDMaterialAnchorPos as L}from"./placementUtils.js";import{placePointOnGeometry as G,updateStageObjectGeometry as V,getLocalOriginForPoint as H,extendPointGraphicElevationContext as k,createStageObject as B}from"./pointUtils.js";import{initFastSymbolUpdatesState as N,updateFastSymbolUpdatesState as $,evaluateModelTransformScale as W,ConvertOptions as q}from"../support/FastSymbolUpdates.js";import{createTexture as J,requiresHalfTexelOffset as Z,defaultBoundingBox as K,defaultSymbolSizeRatio as Q,defaultTexSize as X}from"../../support/engineContent/sdfPrimitives.js";import{drapedZ as Y}from"../../terrain/OverlayRenderer.js";import{createPointGeometry as ee}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as te}from"../../webgl-engine/lib/RenderGeometry.js";import{Texture as re}from"../../webgl-engine/lib/Texture.js";import{HUDMaterial as ie}from"../../webgl-engine/materials/HUDMaterial.js";const se=f(0,0,1),oe=16,ae=1.5,ne=[X*Q,X*Q];class le extends F{getCachedSize(){return{size:this._getIconSize()}}constructor(e,t,r,i){super(e,t,r,i),this._cimData=null,this._overrideHelperClass=null,this._arcadeInfo=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimScaleFactorOrFunction=null,this._size=null,this._symbolTextureRatio=1,this._outlineSize=0,this._textureHandle=null,this._patchTask=null,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0}}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(null!=r)this._prepareResourcesPrimitive(t,r);else{const r=C(this.symbolLayer),i=ue(r);null!=i?await this._prepareResourcesCIM(t,JSON.parse(i),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=A(this._getIconSize());if(e)throw new i("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?c(e.size):oe);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e){const t=this._overrideHelperClass;let r=this._cimData;if(t&&r&&r.symbol||this.logger.error("Can't create texture, CIM data is undefined"),r.primitiveOverrides){r=s(r);const i=r.primitiveOverrides;t.evaluateOverrides(i,e,this._arcadeInfo.geometryType,null,null),t.applyOverrides(r.symbol,i)}const i=u(JSON.stringify(r));let o=this._cimSymbolTextures.get(i);if(o)return o;const a=this._context.sharedResources.cimSymbolRasterizer,n=this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null;n&&t.applyDictionaryTextOverrides(r.symbol,e,n,null);const l=null!=this._cimScaleFactorOrFunction?S(this._cimScaleFactorOrFunction,e):1;1!==l&&r.symbol&&P(r.symbol,l,!0);const c=v.getEnvelope(r,null,a.resourceManager);if(c?.width&&c.height){const e=c.x+c.width/2,t=c.y+c.height/2,i=a.rasterize({type:"cim",data:r},c.width,c.height,e,t,1,"esriGeometryPoint"),s=new w({x:-c.x/c.width-.5,y:(c.height+c.y)/c.height-.5});this._cimMaterialParametersInfo.anchorPosition=me("relative",s),o=new re(i,{width:i?.width??1,height:i?.height??1,reloadable:!0})}else o=new re(new ImageData(1,1),{width:1,height:1,reloadable:!0});return this._cimSymbolTextures.set(i,o),this._context.stage.add(o),o}_prepareMaterialParameters(){const e={anchorPosition:me(this.symbolLayer.anchor,this.symbolLayer.anchorPosition),rotation:this.symbolLayer.angle},t=this.symbol;if(ce(t)){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=t.verticalOffset;e.verticalOffset={screenLength:c(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),(0!==e.rotation||this._drivenProperties.rotation)&&(e.hasRotation=!0);const r=!!has("enable-feature:non-occluded-hud");return e.occlusionTest=!r,e.occludedFragmentFade=r,e.horizonCullingEnabled=r&&this._context.spherical,e.hasSlicePlane=this._context.slicePlaneEnabled,e}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(he(t)&&0===r)throw new Error("Nothing to render");if(this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,null!=this._context.sharedResources.textures){const r=this._context.sharedResources.textures.fromData(`${t}-icon`,(()=>J(t)));this._textureHandle=r,e.textureId=r.texture.id}e.textureIsSignedDistanceField=!0,e.sampleSignedDistanceFieldTexelCenter=Z(t),e.distanceFieldBoundingBox=K;const i=this._getIconSize();this._size=[i,i],this._symbolTextureRatio=1/Q,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,r,s){this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const o=this._getIconSize(),a=o*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(null!=this._context.sharedResources.textures){const l=await t(this._context.sharedResources.textures.fromUrl(r,a,{signal:s}));if(!1===l.ok){n(l.error);throw new i("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${r})`)}this._textureHandle=l.value;const c=l.value.texture;this._size=de(c,o),e.textureId=c.id}this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,t,r){const{OverrideHelper:i}=await import("../../../../symbols/cim/OverrideHelper.js");if(this._overrideHelperClass=i,this._cimData=t,!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;l(r),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new e(this._context.renderCoordsHelper.spatialReference))}const s=this._context.sharedResources.cimSymbolRasterizer,o=[],a=t,n=a?.symbol;v.fetchResources(n,s.resourceManager,o,r),v.fetchFonts(n,s.resourceManager,o);const c=this._context.layer.fields?this._context.layer.fields.map((e=>e.toJSON())):[],h=this._context.renderCoordsHelper.spatialReference;if(this._arcadeInfo={spatialReference:h,fields:c,geometryType:"esriGeometryPoint"},a?.primitiveOverrides&&o.push(i.createRenderExpressions(a.primitiveOverrides,this._arcadeInfo)),o.length>0&&(await Promise.all(o),l(r)),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(e.scaleExpression){const t=e.scaleExpression,r=await b(t,this._context.layer.spatialReference,c),{default:i}=await import("../../../2d/arcade/callExpressionWithFeature.js");this._cimScaleFactorOrFunction=(e,t,s)=>{const o=i(r,e,{$view:s},"esriGeometryPoint",t);return null!==o?o:1}}}l(r),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource?.href?null:this.symbolLayer.resource?.primitive??R}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(null!=t.outline?.size)return Math.max(c(t.outline.size),0);return e=he(this._getPrimitive())?ae:0,Math.max(e,0)}_getOutlineColor(){const t=this._getLayerOpacity(),r=this.symbolLayer,i=r?.outline?.color;if(null!=i){const r=e.toUnitRGB(i),s=i.a*t;return[r[0],r[1],r[2],s]}return[0,0,0,0]}_getFillColor(){if(he(this._getPrimitive()))return O;const e=null==this._getPrimitive(),t=this.symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_createMaterialAndAddToStage(e,t){const r=this._context.spherical;if(this._cimData){this._fastUpdates=null;let i=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return i||(i=new ie(e,r),this._cimSymbolMaterials.set(e.textureId??0,i),t.add(i)),i}if(this._fastUpdates=N(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),this._materials[0]=new ie(e,r),t.add(this._materials[0]),this._context.graphicsCoreOwner.view.focusAreas.activePolygons.length>0){e.isFocused=!1;const i=this._context.stage.view.focusAreas.style;e.color=z(e.color,i),e.outlineColor=z(e.outlineColor,i),this._materials[1]=new ie(e,r),t.add(this._materials[1])}return this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial((e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})})),this.layerOpacityChanged())}destroy(){super.destroy(),this._patchTask=o(this._patchTask),this._forEachMaterial((e=>this._context.stage.remove(e))),this._materials.length=0,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach((e=>this._context.stage.remove(e))),this._cimSymbolTextures.clear(),this._textureHandle=a(this._textureHandle)}_getScaleFactor(e,t){if(this._drivenProperties.size&&e.size){const r=Array.from(e.size);for(let e=0;e<3;e++){const t=r[e];t&&"symbol-value"!==t&&"proportional"!==t&&(r[e]=c(t))}if("symbol-value"===r[0])return 1;if(isFinite(+r[0]))return+r[0]/t;if(isFinite(+r[2]))return+r[2]/t}return 1}_getDrivenRotation(e){return this._drivenProperties.rotation?e.heading??0:0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let r,i=[0,0];const s=G(t.geometry);if(null==s)return this.logger.warn(`unsupported geometry type for text symbol: ${t.geometry.type}`),null;const o=this._context.stage.view.focusAreas.containsGeometry(s);if(this._cimData){if(!this._cimData.symbol)return null;const e=this._generateTextureCIM(t),s={textureId:e.id,isFocused:o,...this._cimMaterialParametersInfo};r=this._createMaterialAndAddToStage(s,this._context.stage);const a=window.devicePixelRatio||1;i=[e.parameters.width/a,e.parameters.height/a]}else i=this._size,r=o||1===this._materials.length?this._materials[0]:this._materials[1];if(null==s)return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=e.renderingInfo,n=this._getVertexOpacityAndColor(a),l=this._getDrivenRotation(a);let c=1;if(!this._fastUpdates?.visualVariables.size){const e=i[0]>i[1]?i[0]:i[1];c=this._getScaleFactor(a,e)}c*=this._symbolTextureRatio;const h=d(i[0]*c,i[1]*c),u=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===u.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(t,s,r,n,l,h,e.layer.uid):this._createAs3DShape(t,s,r,n,l,h,u,t.uid)}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();this._forEachMaterial((r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})}))}updateGeometry(e,t){if(this.draped||!this._validateGeometry(t))return!1;const{elevationContext:r,stageObject:i}=e;if(r.mode!==this.getGeometryElevationMode(t))return!1;const s=G(t);if(!s)return!1;const o=V(i,this._context,s,r);if(null==o)return!1;const a=H(this._context,s);return i.geometries[0].localOrigin===a&&(e.alignedSampledElevation=o,k(e,s,this._context.elevationProvider),!0)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=I(le.elevationModeChangeTypes,r,i);if(s!==M.UPDATE)return s;const o=T(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial((e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return U.RecreateSymbol;if(!$(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return U.RecreateSymbol;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return U.FastUpdate}updateFocus(e,t){t.forEach((t=>{const r=this._context.stage.view.focusAreas.containsGeometry(t.graphic.geometry);t.layers.forEach((i=>{if(i?.graphics3DSymbolLayer===this){i.stageObject.geometries.some((e=>e.material.parameters.isFocused!==r))&&e(t)}}))}))}prepareSymbolLayerPatch(e){if(this._patchTask?.abort(),"partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchResource(e,t),this._preparePatchRotation(e,t)}_preparePatchResource(e,s){if(!s.resource||"partial"!==s.resource.type)return;const c=s.resource.diff;if("complete"!==c?.href?.type)return;const h=c.href.newValue,{textures:u}=this._context.sharedResources;if(null==h||null==u||null!=ue(h))return;const m=this._getIconSize(),d=m*this._context.graphicsCoreOwner.view.state.pixelRatio;e.symbolLayerStatePatches.push((()=>{this._patchTask=o(this._patchTask),this._patchTask=r((e=>this._context.schedule((async(e,r)=>{const s=await t(u.fromUrl(h,d,{signal:r}));l(r);const o=!s.ok;if(o&&n(s.error),this._textureHandle=a(this._textureHandle),this._patchTask=null,o){this._forEachMaterial((e=>{e.visible=!1,e.setParameters({textureId:null})}));const e=`Failed to load (Request for icon resource failed: ${h})`;return void this.logger.error(new i("graphics3diconsymbollayer:request-failed",e))}this._textureHandle=s.value;const c=s.value.texture;this._size=de(c,m),this._forEachMaterial((e=>{e.setParameters({textureId:c.id}),e.visible=!0}))}),e)))})),delete c.href}_preparePatchRotation(e,t){if(!t.angle||"complete"!==t.angle.type)return;const r=t.angle.newValue??0,i=0!==r||this._drivenProperties.rotation;e.symbolLayerStatePatches.push((()=>{this._forEachMaterial((e=>e.setParameters({rotation:r,hasRotation:i})))})),delete t.angle}_defaultElevationInfoNoZ(){return pe}_createAs3DShape(e,t,r,i,s,o,a,n){const l=this.getFastUpdateAttrValues(e),c=this._context.layer.uid,h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerUid:c}),u=ee(r,{normal:se,color:i,rotation:s,size:o,centerOffsetAndDistance:_e,featureAttribute:l,objectAndLayerIdColor:h}),m=B(this._context,t,u,a,n);if(null==m)return null;const d=new D(this,m.object,[u],null,null,j,a);return d.alignedSampledElevation=m.sampledElevation,d.needsElevationUpdates=T(a.mode)||"absolute-height"===a.mode,d.getScreenSize=this._createScreenSizeGetter(o,l),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),k(d,t,this._context.elevationProvider),d}_createAsOverlay(e,t,r,i,s,o,a){r.renderPriority=this._renderPriority;const n=_();g(t,n,this._context.overlaySR),n[2]=Y;const l=this._context.clippingExtent;if(null!=l&&!x(l,n))return null;const c=this.getFastUpdateAttrValues(e),h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:e.uid,layerUid:this._context.layer.uid}),u=ee(r,{normal:se,position:n,color:i,rotation:s,size:o,featureAttribute:c,objectAndLayerIdColor:h}),m=new te(u,{layerUid:a,graphicUid:e.uid}),d=new E(this,[m],null,this._context.drapeSourceRenderer);return d.getScreenSize=this._createScreenSizeGetter(o,c),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),d}_createScreenSizeGetter(e,t){const r=this._outlineSize+2;if(this._fastUpdates&&t){const i=e[0]/this._symbolTextureRatio,s=e[1]/this._symbolTextureRatio;return(e=p())=>{const[o,a]=W(fe,this._fastUpdates.materialParameters,t);return e[0]=o*i+r,e[1]=a*s+r,e}}const i=e[0]/this._symbolTextureRatio+r,s=e[1]/this._symbolTextureRatio+r;return(e=p())=>(e[0]=i,e[1]=s,e)}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),t=f(e,e,e),r=h(1),i=e*r,s=f(i,i,i);return new q({size:!0,color:!0,rotation:!0,opacity:!1},t,s,r)}_forEachMaterial(e){this._materials.forEach(e),this._cimSymbolMaterials.forEach(e)}test(){return{...super.test(),material:this._materials[0]}}}function ce(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function he(e){return null!=e&&("cross"===e||"x"===e)}function ue(e){const t=m(e);return"application/json"===t?.mediaType?t.data:void 0}function me(e,t){return"relative"===e?d((t.x||0)+.5,.5-(t.y||0)):e in L?L[e]:L.center}function de({parameters:e},t){const r=(e.width??1)/(e.height??1);return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}le.PRIMITIVE_SIZE=ne,le.elevationModeChangeTypes={definedChanged:M.UPDATE,staysOnTheGround:M.NONE,onTheGroundChanged:M.RECREATE};const pe={mode:"relative-to-ground",offset:0},_e=y(0,0,0,1),fe=_();export{le as Graphics3DIconSymbolLayer};
|
|
5
|
+
import e from"../../../../Color.js";import{result as t,createTask as r}from"../../../../core/asyncUtils.js";import i from"../../../../core/Error.js";import has from"../../../../core/has.js";import{clone as s}from"../../../../core/lang.js";import{abortMaybe as o,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAbortError as n,throwIfAborted as l}from"../../../../core/promiseUtils.js";import{pt2px as c,px2pt as h}from"../../../../core/screenUtils.js";import{numericHash as u}from"../../../../core/string.js";import{dataComponents as m}from"../../../../core/urlUtils.js";import{fromValues as d,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as _,fromValues as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPointToVector as g}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as x}from"../../../../geometry/support/aaBoundingBox.js";import{createRendererExpression as b}from"../../../../support/arcadeOnDemand.js";import{CIMSymbolHelper as v}from"../../../../symbols/cim/CIMSymbolHelper.js";import{evaluateValueOrFunction as S}from"../../../../symbols/cim/utils.js";import{scaleCIMSymbol as P}from"../../../../symbols/support/cimSymbolUtils.js";import{defaultPrimitive as R}from"../../../../symbols/support/IconSymbol3DLayerResource.js";import{Symbol3DAnchorPosition2D as w}from"../../../../symbols/support/Symbol3DAnchorPosition2D.js";import{getIconHref as C}from"../../../../symbols/support/utils.js";import{focusAreaHUDColor as z}from"../../../FocusAreas.js";import{transparentUnit as O}from"./constants.js";import{perObjectElevationAligner as j}from"./ElevationAligners.js";import{SymbolUpdateType as M,elevationModeChangeUpdateType as I,needsElevationUpdates2D as T}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as E}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as D}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as F}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as A}from"./graphicUtils.js";import{ApplyRendererDiffResult as U}from"./interfaces.js";import{namedAnchorToHUDMaterialAnchorPos as L}from"./placementUtils.js";import{placePointOnGeometry as G,updateStageObjectGeometry as V,getLocalOriginForPoint as H,extendPointGraphicElevationContext as k,createStageObject as B}from"./pointUtils.js";import{initFastSymbolUpdatesState as N,updateFastSymbolUpdatesState as $,evaluateModelTransformScale as W,ConvertOptions as q}from"../support/FastSymbolUpdates.js";import{createTexture as J,requiresHalfTexelOffset as Z,defaultBoundingBox as K,defaultSymbolSizeRatio as Q,defaultTexSize as X}from"../../support/engineContent/sdfPrimitives.js";import{drapedZ as Y}from"../../terrain/OverlayRenderer.js";import{createPointGeometry as ee}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as te}from"../../webgl-engine/lib/RenderGeometry.js";import{Texture as re}from"../../webgl-engine/lib/Texture.js";import{HUDMaterial as ie}from"../../webgl-engine/materials/HUDMaterial.js";const se=f(0,0,1),oe=16,ae=1.5,ne=[X*Q,X*Q];class le extends F{getCachedSize(){return{size:this._getIconSize()}}constructor(e,t,r,i){super(e,t,r,i),this._cimData=null,this._overrideHelperClass=null,this._arcadeInfo=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimScaleFactorOrFunction=null,this._size=null,this._symbolTextureRatio=1,this._outlineSize=0,this._textureHandle=null,this._patchTask=null,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0}}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(null!=r)this._prepareResourcesPrimitive(t,r);else{const r=C(this.symbolLayer),i=ue(r);null!=i?await this._prepareResourcesCIM(t,JSON.parse(i),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=A(this._getIconSize());if(e)throw new i("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?c(e.size):oe);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e){const t=this._overrideHelperClass;let r=this._cimData;if(t&&r&&r.symbol||this.logger.error("Can't create texture, CIM data is undefined"),r.primitiveOverrides){r=s(r);const i=r.primitiveOverrides;t.evaluateOverrides(i,e,this._arcadeInfo.geometryType,null,null),t.applyOverrides(r.symbol,i)}const i=u(JSON.stringify(r));let o=this._cimSymbolTextures.get(i);if(o)return o;const a=this._context.sharedResources.cimSymbolRasterizer,n=this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null;n&&t.applyDictionaryTextOverrides(r.symbol,e,n,null);const l=null!=this._cimScaleFactorOrFunction?S(this._cimScaleFactorOrFunction,e):1;1!==l&&r.symbol&&P(r.symbol,l,!0);const c=v.getEnvelope(r,null,a.resourceManager);if(c?.width&&c.height){const e=c.x+c.width/2,t=c.y+c.height/2,i=a.rasterize({type:"cim",data:r},c.width,c.height,e,t,1,"esriGeometryPoint",0,null,this._context.graphicsCoreOwner.view.state.rasterPixelRatio),s=new w({x:-c.x/c.width-.5,y:(c.height+c.y)/c.height-.5});this._cimMaterialParametersInfo.anchorPosition=me("relative",s),o=new re(i,{width:i?.width??1,height:i?.height??1,reloadable:!0})}else o=new re(new ImageData(1,1),{width:1,height:1,reloadable:!0});return this._cimSymbolTextures.set(i,o),this._context.stage.add(o),o}_prepareMaterialParameters(){const e={anchorPosition:me(this.symbolLayer.anchor,this.symbolLayer.anchorPosition),rotation:this.symbolLayer.angle},t=this.symbol;if(ce(t)){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=t.verticalOffset;e.verticalOffset={screenLength:c(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),(0!==e.rotation||this._drivenProperties.rotation)&&(e.hasRotation=!0);const r=!!has("enable-feature:non-occluded-hud");return e.occlusionTest=!r,e.occludedFragmentFade=r,e.horizonCullingEnabled=r&&this._context.spherical,e.hasSlicePlane=this._context.slicePlaneEnabled,e}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(he(t)&&0===r)throw new Error("Nothing to render");if(this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,null!=this._context.sharedResources.textures){const r=this._context.sharedResources.textures.fromData(`${t}-icon`,(()=>J(t)));this._textureHandle=r,e.textureId=r.texture.id}e.textureIsSignedDistanceField=!0,e.sampleSignedDistanceFieldTexelCenter=Z(t),e.distanceFieldBoundingBox=K;const i=this._getIconSize();this._size=[i,i],this._symbolTextureRatio=1/Q,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,r,s){this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const o=this._getIconSize(),a=o*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(null!=this._context.sharedResources.textures){const l=await t(this._context.sharedResources.textures.fromUrl(r,a,{signal:s}));if(!1===l.ok){n(l.error);throw new i("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${r})`)}this._textureHandle=l.value;const c=l.value.texture;this._size=de(c,o),e.textureId=c.id}this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,t,r){const{OverrideHelper:i}=await import("../../../../symbols/cim/OverrideHelper.js");if(this._overrideHelperClass=i,this._cimData=t,!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;l(r),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new e(this._context.renderCoordsHelper.spatialReference))}const s=this._context.sharedResources.cimSymbolRasterizer,o=[],a=t,n=a?.symbol;v.fetchResources(n,s.resourceManager,o,r),v.fetchFonts(n,s.resourceManager,o);const c=this._context.layer.fields?this._context.layer.fields.map((e=>e.toJSON())):[],h=this._context.renderCoordsHelper.spatialReference;if(this._arcadeInfo={spatialReference:h,fields:c,geometryType:"esriGeometryPoint"},a?.primitiveOverrides&&o.push(i.createRenderExpressions(a.primitiveOverrides,this._arcadeInfo)),o.length>0&&(await Promise.all(o),l(r)),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(e.scaleExpression){const t=e.scaleExpression,r=await b(t,this._context.layer.spatialReference,c),{default:i}=await import("../../../2d/arcade/callExpressionWithFeature.js");this._cimScaleFactorOrFunction=(e,t,s)=>{const o=i(r,e,{$view:s},"esriGeometryPoint",t);return null!==o?o:1}}}l(r),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource?.href?null:this.symbolLayer.resource?.primitive??R}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(null!=t.outline?.size)return Math.max(c(t.outline.size),0);return e=he(this._getPrimitive())?ae:0,Math.max(e,0)}_getOutlineColor(){const t=this._getLayerOpacity(),r=this.symbolLayer,i=r?.outline?.color;if(null!=i){const r=e.toUnitRGB(i),s=i.a*t;return[r[0],r[1],r[2],s]}return[0,0,0,0]}_getFillColor(){if(he(this._getPrimitive()))return O;const e=null==this._getPrimitive(),t=this.symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_createMaterialAndAddToStage(e,t){const r=this._context.spherical;if(this._cimData){this._fastUpdates=null;let i=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return i||(i=new ie(e,r),this._cimSymbolMaterials.set(e.textureId??0,i),t.add(i)),i}if(this._fastUpdates=N(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),this._materials[0]=new ie(e,r),t.add(this._materials[0]),this._context.graphicsCoreOwner.view.focusAreas.activePolygons.length>0){e.isFocused=!1;const i=this._context.stage.view.focusAreas.style;e.color=z(e.color,i),e.outlineColor=z(e.outlineColor,i),this._materials[1]=new ie(e,r),t.add(this._materials[1])}return this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial((e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})})),this.layerOpacityChanged())}destroy(){super.destroy(),this._patchTask=o(this._patchTask),this._forEachMaterial((e=>this._context.stage.remove(e))),this._materials.length=0,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach((e=>this._context.stage.remove(e))),this._cimSymbolTextures.clear(),this._textureHandle=a(this._textureHandle)}_getScaleFactor(e,t){if(this._drivenProperties.size&&e.size){const r=Array.from(e.size);for(let e=0;e<3;e++){const t=r[e];t&&"symbol-value"!==t&&"proportional"!==t&&(r[e]=c(t))}if("symbol-value"===r[0])return 1;if(isFinite(+r[0]))return+r[0]/t;if(isFinite(+r[2]))return+r[2]/t}return 1}_getDrivenRotation(e){return this._drivenProperties.rotation?e.heading??0:0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let r,i=[0,0];const s=G(t.geometry);if(null==s)return this.logger.warn(`unsupported geometry type for text symbol: ${t.geometry.type}`),null;const o=this._context.stage.view.focusAreas.containsGeometry(s);if(this._cimData){if(!this._cimData.symbol)return null;const e=this._generateTextureCIM(t),s={textureId:e.id,isFocused:o,...this._cimMaterialParametersInfo};r=this._createMaterialAndAddToStage(s,this._context.stage);const a=this._context.graphicsCoreOwner.view.state.rasterPixelRatio;i=[e.parameters.width/a,e.parameters.height/a]}else i=this._size,r=o||1===this._materials.length?this._materials[0]:this._materials[1];if(null==s)return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=e.renderingInfo,n=this._getVertexOpacityAndColor(a),l=this._getDrivenRotation(a);let c=1;if(!this._fastUpdates?.visualVariables.size){const e=i[0]>i[1]?i[0]:i[1];c=this._getScaleFactor(a,e)}c*=this._symbolTextureRatio;const h=d(i[0]*c,i[1]*c),u=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===u.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(t,s,r,n,l,h,e.layer.uid):this._createAs3DShape(t,s,r,n,l,h,u,t.uid)}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();this._forEachMaterial((r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})}))}updateGeometry(e,t){if(this.draped||!this._validateGeometry(t))return!1;const{elevationContext:r,stageObject:i}=e;if(r.mode!==this.getGeometryElevationMode(t))return!1;const s=G(t);if(!s)return!1;const o=V(i,this._context,s,r);if(null==o)return!1;const a=H(this._context,s);return i.geometries[0].localOrigin===a&&(e.alignedSampledElevation=o,k(e,s,this._context.elevationProvider),!0)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=I(le.elevationModeChangeTypes,r,i);if(s!==M.UPDATE)return s;const o=T(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial((e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return U.RecreateSymbol;if(!$(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return U.RecreateSymbol;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return U.FastUpdate}updateFocus(e,t){t.forEach((t=>{const r=this._context.stage.view.focusAreas.containsGeometry(t.graphic.geometry);t.layers.forEach((i=>{if(i?.graphics3DSymbolLayer===this){i.stageObject.geometries.some((e=>e.material.parameters.isFocused!==r))&&e(t)}}))}))}prepareSymbolLayerPatch(e){if(this._patchTask?.abort(),"partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchResource(e,t),this._preparePatchRotation(e,t)}_preparePatchResource(e,s){if(!s.resource||"partial"!==s.resource.type)return;const c=s.resource.diff;if("complete"!==c?.href?.type)return;const h=c.href.newValue,{textures:u}=this._context.sharedResources;if(null==h||null==u||null!=ue(h))return;const m=this._getIconSize(),d=m*this._context.graphicsCoreOwner.view.state.pixelRatio;e.symbolLayerStatePatches.push((()=>{this._patchTask=o(this._patchTask),this._patchTask=r((e=>this._context.schedule((async(e,r)=>{const s=await t(u.fromUrl(h,d,{signal:r}));l(r);const o=!s.ok;if(o&&n(s.error),this._textureHandle=a(this._textureHandle),this._patchTask=null,o){this._forEachMaterial((e=>{e.visible=!1,e.setParameters({textureId:null})}));const e=`Failed to load (Request for icon resource failed: ${h})`;return void this.logger.error(new i("graphics3diconsymbollayer:request-failed",e))}this._textureHandle=s.value;const c=s.value.texture;this._size=de(c,m),this._forEachMaterial((e=>{e.setParameters({textureId:c.id}),e.visible=!0}))}),e)))})),delete c.href}_preparePatchRotation(e,t){if(!t.angle||"complete"!==t.angle.type)return;const r=t.angle.newValue??0,i=0!==r||this._drivenProperties.rotation;e.symbolLayerStatePatches.push((()=>{this._forEachMaterial((e=>e.setParameters({rotation:r,hasRotation:i})))})),delete t.angle}_defaultElevationInfoNoZ(){return pe}_createAs3DShape(e,t,r,i,s,o,a,n){const l=this.getFastUpdateAttrValues(e),c=this._context.layer.uid,h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerUid:c}),u=ee(r,{normal:se,color:i,rotation:s,size:o,centerOffsetAndDistance:_e,featureAttribute:l,objectAndLayerIdColor:h}),m=B(this._context,t,u,a,n);if(null==m)return null;const d=new D(this,m.object,[u],null,null,j,a);return d.alignedSampledElevation=m.sampledElevation,d.needsElevationUpdates=T(a.mode)||"absolute-height"===a.mode,d.getScreenSize=this._createScreenSizeGetter(o,l),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),k(d,t,this._context.elevationProvider),d}_createAsOverlay(e,t,r,i,s,o,a){r.renderPriority=this._renderPriority;const n=_();g(t,n,this._context.overlaySR),n[2]=Y;const l=this._context.clippingExtent;if(null!=l&&!x(l,n))return null;const c=this.getFastUpdateAttrValues(e),h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:e.uid,layerUid:this._context.layer.uid}),u=ee(r,{normal:se,position:n,color:i,rotation:s,size:o,featureAttribute:c,objectAndLayerIdColor:h}),m=new te(u,{layerUid:a,graphicUid:e.uid}),d=new E(this,[m],null,this._context.drapeSourceRenderer);return d.getScreenSize=this._createScreenSizeGetter(o,c),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),d}_createScreenSizeGetter(e,t){const r=this._outlineSize+2;if(this._fastUpdates&&t){const i=e[0]/this._symbolTextureRatio,s=e[1]/this._symbolTextureRatio;return(e=p())=>{const[o,a]=W(fe,this._fastUpdates.materialParameters,t);return e[0]=o*i+r,e[1]=a*s+r,e}}const i=e[0]/this._symbolTextureRatio+r,s=e[1]/this._symbolTextureRatio+r;return(e=p())=>(e[0]=i,e[1]=s,e)}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),t=f(e,e,e),r=h(1),i=e*r,s=f(i,i,i);return new q({size:!0,color:!0,rotation:!0,opacity:!1},t,s,r)}_forEachMaterial(e){this._materials.forEach(e),this._cimSymbolMaterials.forEach(e)}test(){return{...super.test(),material:this._materials[0]}}}function ce(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function he(e){return null!=e&&("cross"===e||"x"===e)}function ue(e){const t=m(e);return"application/json"===t?.mediaType?t.data:void 0}function me(e,t){return"relative"===e?d((t.x||0)+.5,.5-(t.y||0)):e in L?L[e]:L.center}function de({parameters:e},t){const r=(e.width??1)/(e.height??1);return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}le.PRIMITIVE_SIZE=ne,le.elevationModeChangeTypes={definedChanged:M.UPDATE,staysOnTheGround:M.NONE,onTheGroundChanged:M.RECREATE};const pe={mode:"relative-to-ground",offset:0},_e=y(0,0,0,1),fe=_();export{le as Graphics3DIconSymbolLayer};
|