@arcgis/core 4.30.0-next.20240212 → 4.30.0-next.20240213
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/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/05ebb9cec0e1826b283f.js +1 -0
- package/assets/esri/core/workers/chunks/0d54451c740f54a59f49.js +1 -0
- package/assets/esri/core/workers/chunks/18551a7eb5a9b88aa0dc.js +1 -0
- package/assets/esri/core/workers/chunks/24d19abc680b341d13bb.js +1 -0
- package/assets/esri/core/workers/chunks/{3f4d63436c3de04a6ebb.js → 254b4ee3621bbe345bb1.js} +1 -1
- package/assets/esri/core/workers/chunks/2d682ee6e5d66f2ea5cd.js +1 -0
- package/assets/esri/core/workers/chunks/{d5484d470121de2b403b.js → 36d091be859bbb1a149b.js} +1 -1
- package/assets/esri/core/workers/chunks/50b41f91be903a0977f9.js +1 -0
- package/assets/esri/core/workers/chunks/50bb67f2eeace5d50673.js +1 -0
- package/assets/esri/core/workers/chunks/784b6a8216b97440b180.js +1 -0
- package/assets/esri/core/workers/chunks/{7f7a4de2cd4ab71b9aee.js → 8d119dc0a92ad3612daa.js} +1 -1
- package/assets/esri/core/workers/chunks/{0014635097a32ad38895.js → a854611d1a86b838c6ad.js} +1 -1
- package/assets/esri/core/workers/chunks/{50a5abd75fa7dbb571a5.js → ccd53b81c2688dd11584.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2b8e6a0b3f70ada2799.js → e4da908079417cc2f495.js} +1 -1
- package/assets/esri/core/workers/chunks/{af0314c2b5b7dc4f5bbd.js → e6dbf0a7b7b1cf64f23f.js} +1 -1
- package/assets/esri/core/workers/chunks/{eba72ff1726ff6998204.js → f03d62ab7806b68d0b62.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/geometry/Mesh.js +1 -1
- package/geometry/support/meshVertexSpaceUtils.js +1 -1
- package/interfaces.d.ts +172 -14
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/package.json +2 -2
- package/portal/support/resourceUtils.js +1 -1
- package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
- package/rest/support/meshFeatureSet.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/constants.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/versionManagement/support/versionManagementUtils.js +1 -1
- package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
- package/views/2d/engine/webgl/collisions/CollisionGrid.js +1 -1
- package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentScale.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/extentUtils.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/support/automaticLengthMeasurementUtils.js +1 -1
- package/views/support/extentUtils.js +5 -0
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/TableList.js +1 -1
- package/assets/esri/core/workers/chunks/062629a9b4695dea8bf8.js +0 -1
- package/assets/esri/core/workers/chunks/37803888bd9a537481a7.js +0 -1
- package/assets/esri/core/workers/chunks/5bfc5ffad705aaaafcd4.js +0 -1
- package/assets/esri/core/workers/chunks/655f4560fb36a0d9ff0b.js +0 -1
- package/assets/esri/core/workers/chunks/b927b655e955abe00d48.js +0 -1
- package/assets/esri/core/workers/chunks/bd2d64a5cd8e7a39c235.js +0 -1
- package/assets/esri/core/workers/chunks/d2417d179d015f1193a1.js +0 -1
- package/assets/esri/core/workers/chunks/f75ec599f53c66cab194.js +0 -1
package/geometry/Mesh.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.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{deprecatedFunction as t}from"../core/deprecate.js";import r from"../core/Error.js";import o from"../core/Loadable.js";import s from"../core/Logger.js";import{EsriPromiseMixin as n}from"../core/Promise.js";import{whenOrAbort as i}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{fromValues as l}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"./Extent.js";import h from"./Geometry.js";import u from"./Point.js";import f from"./Polygon.js";import{composeAxes as d,create as x}from"./support/axisAngleDegrees.js";import y from"./support/MeshComponent.js";import{componentNotFoundMessage as v,meshNotLoadedMessage as g,invalidLocationMessage as S,invalidPolygonMessage as j,InvalidLocationError as w}from"./support/meshErrors.js";import b from"./support/MeshGeoreferencedVertexSpace.js";import A from"./support/MeshLocalVertexSpace.js";import R from"./support/MeshTransform.js";import{MeshVertexAttributes as L}from"./support/MeshVertexAttributes.js";import{isRelativeVertexSpace as M,vertexSpaceOriginToPoint as F}from"./support/meshVertexSpaceUtils.js";import{triangulate as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{deprecatedFunction as t}from"../core/deprecate.js";import r from"../core/Error.js";import o from"../core/Loadable.js";import s from"../core/Logger.js";import{EsriPromiseMixin as n}from"../core/Promise.js";import{whenOrAbort as i}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{fromValues as l}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"./Extent.js";import h from"./Geometry.js";import u from"./Point.js";import f from"./Polygon.js";import{composeAxes as d,create as x}from"./support/axisAngleDegrees.js";import y from"./support/MeshComponent.js";import{componentNotFoundMessage as v,meshNotLoadedMessage as g,invalidLocationMessage as S,invalidPolygonMessage as j,InvalidLocationError as w}from"./support/meshErrors.js";import b from"./support/MeshGeoreferencedVertexSpace.js";import A from"./support/MeshLocalVertexSpace.js";import R from"./support/MeshTransform.js";import{MeshVertexAttributes as L}from"./support/MeshVertexAttributes.js";import{isRelativeVertexSpace as M,vertexSpaceOriginToPoint as F,createVertexSpace as U,preferredVertexSpaceTypeForSR as _}from"./support/meshVertexSpaceUtils.js";import{triangulate as E}from"./support/triangulationUtils.js";import{getProjectedExtent as C,getExtentFromPositions as P}from"./support/meshUtils/bounds.js";import{centerAt as z}from"./support/meshUtils/centerAt.js";import{project as G}from"./support/meshUtils/georeference.js";import{loadExternal as k}from"./support/meshUtils/loadExternal.js";import{Metadata as I}from"./support/meshUtils/Metadata.js";import{convertUnitGeometry as T,createUnitSizeBox as V,extractSingleFaceOfBox as O,createUnitSizeSphere as B,createUnitSizeCylinder as W,convertPlaneSizeParameter as D,createUnitSizePlane as N}from"./support/meshUtils/primitives.js";import{rotate as Z}from"./support/meshUtils/rotate.js";import{scale as q}from"./support/meshUtils/scale.js";var H;const K="esri.geometry.Mesh";function J(){return s.getLogger(K)}const Q={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:b,local:A}};let X=H=class extends(o.LoadableMixin(n(h))){constructor(e){super(e),this.components=null,this.vertexSpace=new b,this.transform=null,this.metadata=new I,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new L,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.addHandles(a((()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map((e=>e.clone()))})),(()=>this._clearSources()),{once:!0,sync:!0}))}))}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{components:e,spatialReference:t,vertexAttributes:r,vertexSpace:o}=this,s=r.position;if(0===s.length||e&&0===e.length)return new m({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t});if("local"===o.type){const{_untransformedExtent:e,transform:r}=this;return C(e,r,o,t)}if("georeferenced"===o.type&&M(o)){const{transform:e}=this,r=G({positions:s,transform:e,vertexSpace:o,inSpatialReference:t,outSpatialReference:t});return P(r,t)}return P(s,t)}get _untransformedExtent(){return P(this.vertexAttributes.position,this.spatialReference)}get anchor(){const e=F(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:r}=this._transformedExtent;return new u({x:t.x,y:t.y,z:r,spatialReference:this.spatialReference})}get origin(){const e=F(this.vertexSpace,this.spatialReference);return null!=e?e:this._transformedExtent.center}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(y.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}J().error("removeComponent()",v)}}rotate(e,t,r,o){return d(e,t,r,Y),Z(this,Y,o),this}offset(e,t,r){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:o,vertexAttributes:s}=this,n=s?.position;if(!n)return this;if(M(o)){const[s,n,i]=o.origin;o.origin=l(s+e,n+t,i+r)}else{for(let o=0;o<n.length;o+=3)n[o]+=e,n[o+1]+=t,n[o+2]+=r;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(q(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(z(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(k(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(){return this.cloneWithVertexSpace(this.vertexSpace.clone())}cloneWithVertexSpace(e){let t=null;if(this.components){const e=new Map,r=new Map;t=this.components.map((t=>t.cloneWithDeduplication(e,r)))}const r={components:t,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),vertexSpace:e,transform:this.transform?.clone()??null,metadata:this.metadata.clone()};return new H(r)}cloneShallow(){return new H({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const t=import("./support/meshUtils/exporters/gltf/gltfexport.js"),r=this.load(),o=await Promise.all([t,r]),{toBinaryGLTF:s}=o[0];return s(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,null!=this.components)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(J().error(e,g),!1)}static createBox(e,t){if(!(e instanceof u))return J().error(".createBox()",S),null;const r=new H(T(V(),e,t));return t?.imageFace&&"all"!==t.imageFace?O(r,t.imageFace):r}static createSphere(e,t){return e instanceof u?new H(T(B(t?.densificationFactor||0),e,t)):(J().error(".createSphere()",S),null)}static createCylinder(e,t){return e instanceof u?new H(T(W(t?.densificationFactor||0),e,t)):(J().error(".createCylinder()",S),null)}static createPlane(e,t){if(!(e instanceof u))return J().error(".createPlane()",S),null;const r=t?.facing??"up",o=D(r,t?.size);return new H(T(N(r),e,{...t,size:o}))}static createFromPolygon(e,t){if(!(e instanceof f))return J().error(".createFromPolygon()",j),null;const r=E(e);return new H({vertexAttributes:new L({position:r.position}),components:[new y({faces:r.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new b})}static async createFromGLTF(e,t,r){if(!(e instanceof u)){const e=new w;throw J().error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:o}=await i(import("./support/meshUtils/loadGLTFMesh.js"),r);return new H(await o(e,t,r))}static async createFromFiles(e,o,s){t(J(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});const n=e=>J().error(".createFromFiles()",e.message);if(!(e instanceof u)){const e=new w;throw n(e),e}if(!s?.layer)throw new r("invalid:no-layer","SceneLayer required for file to mesh conversion.");return s.layer.convertMesh(o,{location:e,...s})}static createWithExternalSource(e,t,r){const o=r?.extent??null,{x:s,y:n,z:i,spatialReference:a}=e,c=r?.transform?.clone()??new R,p=l(s,n,i??0),m=U(r?.vertexSpace??_(a),p),h={source:t,extent:o},u=new I;return u.externalSources.push(h),new H({metadata:u,transform:c,vertexSpace:m,spatialReference:a})}static createIncomplete(e,t){const{x:o,y:s,z:n,spatialReference:i}=e,a=t?.transform?.clone()??new R,c=l(o,s,n??0),p=U(t?.vertexSpace??_(i),c),m=new H({transform:a,vertexSpace:p,spatialReference:i});return m.addResolvingPromise(Promise.reject(new r("mesh-incomplete","Mesh resources are not complete"))),m}};e([c({type:[y],json:{write:!0}})],X.prototype,"components",void 0),e([c({nonNullable:!0,types:Q,constructOnly:!0,json:{write:!0}})],X.prototype,"vertexSpace",void 0),e([c({type:R,json:{write:!0}})],X.prototype,"transform",void 0),e([c({constructOnly:!0})],X.prototype,"metadata",void 0),e([c()],X.prototype,"hasExtent",null),e([c()],X.prototype,"_transformedExtent",null),e([c()],X.prototype,"_untransformedExtent",null),e([c()],X.prototype,"anchor",null),e([c()],X.prototype,"origin",null),e([c({readOnly:!0,json:{read:!1}})],X.prototype,"extent",null),e([c({readOnly:!0,json:{read:!1,write:!0,default:!0}})],X.prototype,"hasZ",void 0),e([c({readOnly:!0,json:{read:!1,write:!0,default:!1}})],X.prototype,"hasM",void 0),e([c({type:L,nonNullable:!0,json:{write:!0}})],X.prototype,"vertexAttributes",void 0),X=H=e([p(K)],X);const Y=x(),$=X;export{$ 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.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{deprecated as e}from"../../core/deprecate.js";import r from"../../core/Logger.js";import n from"../Point.js";import o from"./MeshGeoreferencedVertexSpace.js";import
|
|
5
|
+
import{deprecated as e}from"../../core/deprecate.js";import r from"../../core/Logger.js";import n from"../Point.js";import o from"./MeshGeoreferencedVertexSpace.js";import i from"./MeshLocalVertexSpace.js";import{t}from"../../chunks/vec3.js";function c(){return r.getLogger("esri.geometry.Mesh")}function a(e){const{vertexSpace:r}=e;if(null!=r.origin)return e.clone();const{anchor:n}=e,i=n.clone(),c=new o({origin:[i.x,i.y,i.z]}),a=e.cloneWithVertexSpace(c),{position:s}=a.vertexAttributes;return a.vertexAttributes.position=t(new Float64Array(s.length),s,[-i.x,-i.y,-(i.z??0)]),a.vertexAttributesChanged(),a}function s(e,r){switch(e.type){case"georeferenced":return g(e)&&!r.isGeographic&&!r.isWebMercator;case"local":return r.isGeographic||r.isWebMercator}}function g(e){return null!=e.origin}function p(e,r){if(!g(e))return null;const[o,i,t]=e.origin;return new n({x:o,y:i,z:t,spatialReference:r})}function u(r,n){const{x:t,y:a,z:s,spatialReference:g}=r,p=[t,a,s??0];if(void 0!==n?.geographic){if(e(c(),"option: geographic",{replacement:"use vertexSpace option instead",version:"4.29",warnOnce:!0}),!n?.vertexSpace)return n?.geographic?new i({origin:p}):new o({origin:p});c().warn("Deprecated geographic flag ignored since vertexSpace option is provided.")}if(!n?.vertexSpace)return g.isGeographic||g.isWebMercator?new i({origin:p}):new o({origin:p});switch(n.vertexSpace){case"local":return new i({origin:p});case"georeferenced":return new o({origin:p});case"georeferenced-absolute":return new o}}function f(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}function l(e,r){return"local"===e?new i({origin:r}):new o({origin:r})}export{l as createVertexSpace,c as getMeshLogger,g as isRelativeVertexSpace,f as preferredVertexSpaceTypeForSR,u as selectVertexSpace,s as shouldUpdateFast,a as toRelativeVertexSpace,p as vertexSpaceOriginToPoint};
|
package/interfaces.d.ts
CHANGED
|
@@ -19346,6 +19346,12 @@ declare namespace __esri {
|
|
|
19346
19346
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#cameraRoll)
|
|
19347
19347
|
*/
|
|
19348
19348
|
cameraRoll: number;
|
|
19349
|
+
/**
|
|
19350
|
+
* Copyright information for the layer.
|
|
19351
|
+
*
|
|
19352
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#copyright)
|
|
19353
|
+
*/
|
|
19354
|
+
copyright: string;
|
|
19349
19355
|
/**
|
|
19350
19356
|
* Modifies the extent of the image's ground footprint.
|
|
19351
19357
|
*
|
|
@@ -19382,6 +19388,12 @@ declare namespace __esri {
|
|
|
19382
19388
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#depthImagePathSuffix)
|
|
19383
19389
|
*/
|
|
19384
19390
|
depthImagePathSuffix: string;
|
|
19391
|
+
/**
|
|
19392
|
+
* The name of the layer's primary display field.
|
|
19393
|
+
*
|
|
19394
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#displayField)
|
|
19395
|
+
*/
|
|
19396
|
+
displayField: string;
|
|
19385
19397
|
/**
|
|
19386
19398
|
* The source of elevation, that will be used to compute ground to image transformations.
|
|
19387
19399
|
*
|
|
@@ -19450,6 +19462,12 @@ declare namespace __esri {
|
|
|
19450
19462
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#labelsVisible)
|
|
19451
19463
|
*/
|
|
19452
19464
|
labelsVisible: boolean;
|
|
19465
|
+
/**
|
|
19466
|
+
* A unique id that identifies an operational layer in a map.
|
|
19467
|
+
*
|
|
19468
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#layerId)
|
|
19469
|
+
*/
|
|
19470
|
+
readonly layerId: string;
|
|
19453
19471
|
/**
|
|
19454
19472
|
* Maximum search distance to be used while querying the feature service specified in the Oriented Imagery Layer.
|
|
19455
19473
|
*
|
|
@@ -19480,18 +19498,46 @@ declare namespace __esri {
|
|
|
19480
19498
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#orientedImageryType)
|
|
19481
19499
|
*/
|
|
19482
19500
|
orientedImageryType: "horizontal" | "nadir" | "oblique" | "360" | "inspection";
|
|
19501
|
+
/**
|
|
19502
|
+
* An array of field names to include in the OrientedImageryLayer.
|
|
19503
|
+
*
|
|
19504
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#outFields)
|
|
19505
|
+
*/
|
|
19506
|
+
outFields: string[];
|
|
19507
|
+
/**
|
|
19508
|
+
* Indicates whether to display popups when features in the layer are clicked.
|
|
19509
|
+
*
|
|
19510
|
+
* @default true
|
|
19511
|
+
*
|
|
19512
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#popupEnabled)
|
|
19513
|
+
*/
|
|
19514
|
+
popupEnabled: boolean;
|
|
19483
19515
|
/**
|
|
19484
19516
|
* The popup template for the layer.
|
|
19485
19517
|
*
|
|
19486
19518
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#popupTemplate)
|
|
19487
19519
|
*/
|
|
19488
19520
|
popupTemplate: PopupTemplate;
|
|
19521
|
+
/**
|
|
19522
|
+
* The portal item referencing the Oriented Imagery layer item from which the OrientedImageryLayer is loaded.
|
|
19523
|
+
*
|
|
19524
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#portalItem)
|
|
19525
|
+
*/
|
|
19526
|
+
portalItem: PortalItem;
|
|
19489
19527
|
/**
|
|
19490
19528
|
* The renderer assigned to the layer.
|
|
19491
19529
|
*
|
|
19492
19530
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#renderer)
|
|
19493
19531
|
*/
|
|
19494
19532
|
renderer: Renderer;
|
|
19533
|
+
/**
|
|
19534
|
+
* The spatial reference of the layer.
|
|
19535
|
+
*
|
|
19536
|
+
* @default SpatialReference.WGS84
|
|
19537
|
+
*
|
|
19538
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#spatialReference)
|
|
19539
|
+
*/
|
|
19540
|
+
spatialReference: SpatialReference;
|
|
19495
19541
|
/**
|
|
19496
19542
|
* Defines the unit of time used in the viewer's time selector tool.
|
|
19497
19543
|
*
|
|
@@ -19580,6 +19626,12 @@ declare namespace __esri {
|
|
|
19580
19626
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#cameraRoll)
|
|
19581
19627
|
*/
|
|
19582
19628
|
cameraRoll?: number;
|
|
19629
|
+
/**
|
|
19630
|
+
* Copyright information for the layer.
|
|
19631
|
+
*
|
|
19632
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#copyright)
|
|
19633
|
+
*/
|
|
19634
|
+
copyright?: string;
|
|
19583
19635
|
/**
|
|
19584
19636
|
* Modifies the extent of the image's ground footprint.
|
|
19585
19637
|
*
|
|
@@ -19616,6 +19668,12 @@ declare namespace __esri {
|
|
|
19616
19668
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#depthImagePathSuffix)
|
|
19617
19669
|
*/
|
|
19618
19670
|
depthImagePathSuffix?: string;
|
|
19671
|
+
/**
|
|
19672
|
+
* The name of the layer's primary display field.
|
|
19673
|
+
*
|
|
19674
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#displayField)
|
|
19675
|
+
*/
|
|
19676
|
+
displayField?: string;
|
|
19619
19677
|
/**
|
|
19620
19678
|
* The source of elevation, that will be used to compute ground to image transformations.
|
|
19621
19679
|
*
|
|
@@ -19714,18 +19772,46 @@ declare namespace __esri {
|
|
|
19714
19772
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#orientedImageryType)
|
|
19715
19773
|
*/
|
|
19716
19774
|
orientedImageryType?: "horizontal" | "nadir" | "oblique" | "360" | "inspection";
|
|
19775
|
+
/**
|
|
19776
|
+
* An array of field names to include in the OrientedImageryLayer.
|
|
19777
|
+
*
|
|
19778
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#outFields)
|
|
19779
|
+
*/
|
|
19780
|
+
outFields?: string[];
|
|
19781
|
+
/**
|
|
19782
|
+
* Indicates whether to display popups when features in the layer are clicked.
|
|
19783
|
+
*
|
|
19784
|
+
* @default true
|
|
19785
|
+
*
|
|
19786
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#popupEnabled)
|
|
19787
|
+
*/
|
|
19788
|
+
popupEnabled?: boolean;
|
|
19717
19789
|
/**
|
|
19718
19790
|
* The popup template for the layer.
|
|
19719
19791
|
*
|
|
19720
19792
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#popupTemplate)
|
|
19721
19793
|
*/
|
|
19722
19794
|
popupTemplate?: PopupTemplateProperties;
|
|
19795
|
+
/**
|
|
19796
|
+
* The portal item referencing the Oriented Imagery layer item from which the OrientedImageryLayer is loaded.
|
|
19797
|
+
*
|
|
19798
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#portalItem)
|
|
19799
|
+
*/
|
|
19800
|
+
portalItem?: PortalItemProperties;
|
|
19723
19801
|
/**
|
|
19724
19802
|
* The renderer assigned to the layer.
|
|
19725
19803
|
*
|
|
19726
19804
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#renderer)
|
|
19727
19805
|
*/
|
|
19728
19806
|
renderer?: RendererProperties;
|
|
19807
|
+
/**
|
|
19808
|
+
* The spatial reference of the layer.
|
|
19809
|
+
*
|
|
19810
|
+
* @default SpatialReference.WGS84
|
|
19811
|
+
*
|
|
19812
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OrientedImageryLayer.html#spatialReference)
|
|
19813
|
+
*/
|
|
19814
|
+
spatialReference?: SpatialReferenceProperties;
|
|
19729
19815
|
/**
|
|
19730
19816
|
* Defines the unit of time used in the viewer's time selector tool.
|
|
19731
19817
|
*
|
|
@@ -20487,6 +20573,12 @@ declare namespace __esri {
|
|
|
20487
20573
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#applyEdits)
|
|
20488
20574
|
*/
|
|
20489
20575
|
applyEdits(edits: SceneLayerApplyEditsEdits, options?: SceneLayerApplyEditsOptions): Promise<SceneLayerEditsResult>;
|
|
20576
|
+
/**
|
|
20577
|
+
* Converts a file or list of files to mesh geometry.
|
|
20578
|
+
*
|
|
20579
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#convertMesh)
|
|
20580
|
+
*/
|
|
20581
|
+
convertMesh(files: any[], options?: ConvertMeshOptions): Promise<Mesh>;
|
|
20490
20582
|
/**
|
|
20491
20583
|
* Creates a default popup template for the layer, populated with all the fields of the layer.
|
|
20492
20584
|
*
|
|
@@ -20569,12 +20661,6 @@ declare namespace __esri {
|
|
|
20569
20661
|
on(name: "layerview-create", eventHandler: SceneLayerLayerviewCreateEventHandler): IHandle;
|
|
20570
20662
|
on(name: "layerview-create-error", eventHandler: SceneLayerLayerviewCreateErrorEventHandler): IHandle;
|
|
20571
20663
|
on(name: "layerview-destroy", eventHandler: SceneLayerLayerviewDestroyEventHandler): IHandle;
|
|
20572
|
-
/**
|
|
20573
|
-
* Converts a file or list of files to mesh geometry.
|
|
20574
|
-
*
|
|
20575
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#convertMesh)
|
|
20576
|
-
*/
|
|
20577
|
-
static convertMesh(files: any[], options?: ConvertMeshOptions): Promise<Mesh>;
|
|
20578
20664
|
static fromJSON(json: any): SceneLayer;
|
|
20579
20665
|
}
|
|
20580
20666
|
|
|
@@ -20737,6 +20823,12 @@ declare namespace __esri {
|
|
|
20737
20823
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#ConvertMeshOptions)
|
|
20738
20824
|
*/
|
|
20739
20825
|
location?: Point;
|
|
20826
|
+
/**
|
|
20827
|
+
* Specifies the vertex space of the created mesh.
|
|
20828
|
+
*
|
|
20829
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#ConvertMeshOptions)
|
|
20830
|
+
*/
|
|
20831
|
+
vertexSpace?: "local" | "georeferenced";
|
|
20740
20832
|
/**
|
|
20741
20833
|
* An [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) to abort the loading process.
|
|
20742
20834
|
*
|
|
@@ -27121,6 +27213,12 @@ declare namespace __esri {
|
|
|
27121
27213
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-rasterFunctionUtils.html#bandArithmeticClayMinerals)
|
|
27122
27214
|
*/
|
|
27123
27215
|
bandArithmeticClayMinerals(parameters: rasterFunctionUtilsBandArithmeticClayMineralsParameters): RasterFunction;
|
|
27216
|
+
/**
|
|
27217
|
+
* Creates a custom Band Arithmetic function.
|
|
27218
|
+
*
|
|
27219
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-rasterFunctionUtils.html#bandArithmeticCustom)
|
|
27220
|
+
*/
|
|
27221
|
+
bandArithmeticCustom(parameters: rasterFunctionUtilsBandArithmeticCustomParameters): RasterFunction;
|
|
27124
27222
|
/**
|
|
27125
27223
|
* Creates a Band Arithmetic function to calculate EVI.
|
|
27126
27224
|
*
|
|
@@ -27223,6 +27321,12 @@ declare namespace __esri {
|
|
|
27223
27321
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-rasterFunctionUtils.html#bandArithmeticPVI)
|
|
27224
27322
|
*/
|
|
27225
27323
|
bandArithmeticPVI(parameters: rasterFunctionUtilsBandArithmeticPVIParameters): RasterFunction;
|
|
27324
|
+
/**
|
|
27325
|
+
* Creates a Band Arithmetic function to calculate RTVICore.
|
|
27326
|
+
*
|
|
27327
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-rasterFunctionUtils.html#bandArithmeticRTVICore)
|
|
27328
|
+
*/
|
|
27329
|
+
bandArithmeticRTVICore(parameters: rasterFunctionUtilsBandArithmeticRTVICoreParameters): RasterFunction;
|
|
27226
27330
|
/**
|
|
27227
27331
|
* Creates a Band Arithmetic function to calculate SAVI.
|
|
27228
27332
|
*
|
|
@@ -28109,6 +28213,27 @@ declare namespace __esri {
|
|
|
28109
28213
|
outputPixelType?: "unknown" | "s8" | "s16" | "s32" | "u8" | "u16" | "u32" | "f32" | "f64";
|
|
28110
28214
|
}
|
|
28111
28215
|
|
|
28216
|
+
export interface rasterFunctionUtilsBandArithmeticCustomParameters {
|
|
28217
|
+
/**
|
|
28218
|
+
* The custom band index, e.g.
|
|
28219
|
+
*
|
|
28220
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-rasterFunctionUtils.html#bandArithmeticCustom)
|
|
28221
|
+
*/
|
|
28222
|
+
bandIndexes: string;
|
|
28223
|
+
/**
|
|
28224
|
+
* The input raster.
|
|
28225
|
+
*
|
|
28226
|
+
* [Read more...](global.html#raster)
|
|
28227
|
+
*/
|
|
28228
|
+
raster?: RasterArgument;
|
|
28229
|
+
/**
|
|
28230
|
+
* The output pixel type, default is unknown.
|
|
28231
|
+
*
|
|
28232
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-rasterFunctionUtils.html#bandArithmeticCustom)
|
|
28233
|
+
*/
|
|
28234
|
+
outputPixelType?: "unknown" | "s8" | "s16" | "s32" | "u8" | "u16" | "u32" | "f32" | "f64";
|
|
28235
|
+
}
|
|
28236
|
+
|
|
28112
28237
|
export interface rasterFunctionUtilsBandArithmeticEVIParameters {
|
|
28113
28238
|
/**
|
|
28114
28239
|
* The 0-based near infrared band id.
|
|
@@ -28592,6 +28717,39 @@ declare namespace __esri {
|
|
|
28592
28717
|
outputPixelType?: "unknown" | "s8" | "s16" | "s32" | "u8" | "u16" | "u32" | "f32" | "f64";
|
|
28593
28718
|
}
|
|
28594
28719
|
|
|
28720
|
+
export interface rasterFunctionUtilsBandArithmeticRTVICoreParameters {
|
|
28721
|
+
/**
|
|
28722
|
+
* The 0-based near infrared band id.
|
|
28723
|
+
*
|
|
28724
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-rasterFunctionUtils.html#bandArithmeticRTVICore)
|
|
28725
|
+
*/
|
|
28726
|
+
nirBandId: number;
|
|
28727
|
+
/**
|
|
28728
|
+
* The 0-based red edge band id.
|
|
28729
|
+
*
|
|
28730
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-rasterFunctionUtils.html#bandArithmeticRTVICore)
|
|
28731
|
+
*/
|
|
28732
|
+
reBandId: number;
|
|
28733
|
+
/**
|
|
28734
|
+
* The 0-based green band id.
|
|
28735
|
+
*
|
|
28736
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-rasterFunctionUtils.html#bandArithmeticRTVICore)
|
|
28737
|
+
*/
|
|
28738
|
+
greenBandId: number;
|
|
28739
|
+
/**
|
|
28740
|
+
* The input raster.
|
|
28741
|
+
*
|
|
28742
|
+
* [Read more...](global.html#raster)
|
|
28743
|
+
*/
|
|
28744
|
+
raster?: RasterArgument;
|
|
28745
|
+
/**
|
|
28746
|
+
* The output pixel type, default is unknown.
|
|
28747
|
+
*
|
|
28748
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-rasterFunctionUtils.html#bandArithmeticRTVICore)
|
|
28749
|
+
*/
|
|
28750
|
+
outputPixelType?: "unknown" | "s8" | "s16" | "s32" | "u8" | "u16" | "u32" | "f32" | "f64";
|
|
28751
|
+
}
|
|
28752
|
+
|
|
28595
28753
|
export interface rasterFunctionUtilsBandArithmeticSAVIParameters {
|
|
28596
28754
|
/**
|
|
28597
28755
|
* The 0-based near infrared band id.
|
|
@@ -41574,7 +41732,7 @@ declare namespace __esri {
|
|
|
41574
41732
|
*/
|
|
41575
41733
|
export interface FetchResource {
|
|
41576
41734
|
/**
|
|
41577
|
-
*
|
|
41735
|
+
* Relative path of the resource.
|
|
41578
41736
|
*
|
|
41579
41737
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#FetchResource)
|
|
41580
41738
|
*/
|
|
@@ -41622,7 +41780,7 @@ declare namespace __esri {
|
|
|
41622
41780
|
*
|
|
41623
41781
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#FetchResourcesParams)
|
|
41624
41782
|
*/
|
|
41625
|
-
sortField?: "created" | "size" | "
|
|
41783
|
+
sortField?: "created" | "size" | "resource";
|
|
41626
41784
|
}
|
|
41627
41785
|
|
|
41628
41786
|
/**
|
|
@@ -91815,7 +91973,7 @@ declare namespace __esri {
|
|
|
91815
91973
|
*/
|
|
91816
91974
|
iconClass: string;
|
|
91817
91975
|
/**
|
|
91818
|
-
* The minimum number of list items required to
|
|
91976
|
+
* The minimum number of list items required to display the visibleElements.filter input box.
|
|
91819
91977
|
*
|
|
91820
91978
|
* @default 10
|
|
91821
91979
|
*
|
|
@@ -91985,7 +92143,7 @@ declare namespace __esri {
|
|
|
91985
92143
|
*/
|
|
91986
92144
|
iconClass?: string;
|
|
91987
92145
|
/**
|
|
91988
|
-
* The minimum number of list items required to
|
|
92146
|
+
* The minimum number of list items required to display the visibleElements.filter input box.
|
|
91989
92147
|
*
|
|
91990
92148
|
* @default 10
|
|
91991
92149
|
*
|
|
@@ -103324,7 +103482,7 @@ declare namespace __esri {
|
|
|
103324
103482
|
*/
|
|
103325
103483
|
minDragEnabledItems: number;
|
|
103326
103484
|
/**
|
|
103327
|
-
* The minimum number of list items required to
|
|
103485
|
+
* The minimum number of list items required to display the visibleElements.filter input box.
|
|
103328
103486
|
*
|
|
103329
103487
|
* @default 10
|
|
103330
103488
|
*
|
|
@@ -103474,7 +103632,7 @@ declare namespace __esri {
|
|
|
103474
103632
|
*/
|
|
103475
103633
|
minDragEnabledItems?: number;
|
|
103476
103634
|
/**
|
|
103477
|
-
* The minimum number of list items required to
|
|
103635
|
+
* The minimum number of list items required to display the visibleElements.filter input box.
|
|
103478
103636
|
*
|
|
103479
103637
|
* @default 10
|
|
103480
103638
|
*
|
|
@@ -115470,7 +115628,7 @@ declare namespace __esri {
|
|
|
115470
115628
|
*/
|
|
115471
115629
|
minDragEnabledItems: number;
|
|
115472
115630
|
/**
|
|
115473
|
-
* The minimum number of list items required to
|
|
115631
|
+
* The minimum number of list items required to display the visibleElements.filter input box.
|
|
115474
115632
|
*
|
|
115475
115633
|
* @default 10
|
|
115476
115634
|
*
|
|
@@ -115612,7 +115770,7 @@ declare namespace __esri {
|
|
|
115612
115770
|
*/
|
|
115613
115771
|
minDragEnabledItems?: number;
|
|
115614
115772
|
/**
|
|
115615
|
-
* The minimum number of list items required to
|
|
115773
|
+
* The minimum number of list items required to display the visibleElements.filter input box.
|
|
115616
115774
|
*
|
|
115617
115775
|
* @default 10
|
|
115618
115776
|
*
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import i from"../core/Accessor.js";import r from"../core/Logger.js";import{isAbortError as s}from"../core/promiseUtils.js";import{watch as n}from"../core/reactiveUtils.js";import{addFrameTask as a}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{wasmFailedToInit as d,Lyr3DWasmWorkerOutputStatus as h,invalidLayerView as u}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as _}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as y}from"../libs/lyr3d/Lyr3DModule.js";import{getMetersPerUnit as c}from"../symbols/support/unitConversionUtils.js";import{makeScheduleFunction as g}from"../views/3d/layers/I3SMeshView3D.js";var m,b;!function(e){e[e.Lifetime=0]="Lifetime",e[e.Jobs=1]="Jobs",e[e.Renderables=2]="Renderables"}(m||(m={})),function(e){e[e.Critical=0]="Critical",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info"}(b||(b={}));let f=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._debugFlags=new Set,this._debugLevel=b.Warning,this._pulseTaskHandle=null,this._session=null,this._debugFlags.add(m.Lifetime),this._debugFlags.add(m.Jobs),this._debugFlags.add(m.Renderables)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;t===b.Critical||t===b.Error?r.getLogger(this).error(e):t===b.Warning&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}initialize(){this._debugLevel>b.Warning&&(r.getLogger(this).level="info"),this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([n((()=>this.view.state?.contentCamera),(()=>this._updateWasmCamera()))]),this._pulseTaskHandle=a({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach((e=>{e.abortController.abort()})),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._worker;e&&e.destroyWasm().then((()=>{this._worker?.destroy(),this._worker=null})),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}add3DTilesLayerView(e){return this._lyr3DMain?this._add3DTilesLayerView(e):(this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),d)}remove3DTilesLayerView(e){if(!this._lyr3DMain)return this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() called when WASM wasn't loaded!"),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.setEnabled() called when WASM wasn't loaded!");const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0)}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.setLayerOffset() called when WASM wasn't loaded!");this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.getAttributionText() called when WASM wasn't loaded!"),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.onRenderableEvicted() called when WASM wasn't loaded!");this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0)}initializeWasm(){return this._lyr3DMain?Promise.resolve():(this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=y().then((e=>{this._lyr3DMain=e,this._lyr3DMainPromise=null;const t=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),i=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),r=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),s=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),n=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),a="global"===this.view.viewingMode,o=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1,l=this.view.heightModelInfo?.heightModel,d=!l||"gravity-related-height"===l;return this._lyr3DMain.initialize_lyr3d_wasm(n,t,i,r,s,a,d,o,this._debugLevel)?(this._worker=new _(g(this.view.resourceController)),this._worker.promise?this._worker.promise:void 0):(this._lyr3DMain=null,void this._debugLog(m.Lifetime,b.Critical,"Lyr3d Main WASM failed to initialize",!1))})).catch((e=>{this._debugLog(m.Lifetime,b.Critical,`Lyr3d WASM failed to download error = ${e}`,!1)}))),this._lyr3DMainPromise)}_pulseTask(){if(this._lyr3DMain){let e=0;this._layers.forEach((t=>{e+=t.layerView.usedMemory})),e/=1048576;const t=this.view.resourceController.memoryController,i=t.usedMemory*t.maxMemory-e,r=t.maxMemory-i+t.additionalCacheMemory;this._lyr3DMain.frame_pulse(r,e,i,t.maxMemory)}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(m.Jobs,b.Error,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,r=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,r,e),this._lyr3DMain._free(r)}this._decrementJobCount(e)}_getRequestPromises(e,i){const r=[];for(const s of e){const e=new URL(s),n=e.searchParams.get("session");n?this._session=n:this._session&&e.searchParams.append("session",this._session),r.push(t(e.toString(),i).then((e=>e.data)))}return r}_onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,r={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey}},n={inputs:[],jobDescJson:e.desc,isMissingResourceCase:!1},a=this._getRequestPromises(e.urls,r);Promise.all(a).then((e=>(n.inputs=e,this._worker.invoke(n,i)))).then((e=>e)).catch((t=>(s(t)?this._debugLog(m.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(m.Jobs,b.Error,`job ${e.jobId} failed with error ${t}.`),{status:h.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}))).then((a=>{if(a.status===h.Failed)this._onJobFailed(t,a,e);else if(a.status===h.Succeeded)this._onJobSucceeded(t,a,e);else if(a.status===h.MissingInputs){const o=this._getRequestPromises(a.missingInputUrls,r);Promise.all(o).then((e=>{n.jobDescJson=a.jobDescJson,a.originalInputs?n.inputs=a.originalInputs:n.inputs=[],n.isMissingResourceCase=!0;for(const t of e)n.inputs.push(t);return this._worker.invoke(n,i)})).then((i=>{i.status===h.Failed?this._onJobFailed(t,i,e):i.status===h.Succeeded&&this._onJobSucceeded(t,i,e)})).catch((i=>{this._decrementJobCount(t),s(i)?this._debugLog(m.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(m.Jobs,b.Error,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)}))}}))}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then((t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)})).catch((t=>{s(t)||this._debugLog(m.Renderables,b.Error,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)})))}_freeRenderables(e,t,i){if(i<1)return;const r=this._layers.get(e);if(!r)return;const s=r.layerView,n=[],a=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)n.push(a[o]);for(let o=0;o<i;++o)s.freeRenderable(n[o])}_setRenderableVisibility(e,t,i,r){if(r<1)return;const s=this._layers.get(e);if(!s)return;const n=s.layerView,a=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,r),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,r);for(let h=0;h<r;++h)a.push(l[h]),o.push(1===d[h]);for(let h=0;h<r;++h)n.setRenderableVisibility(a[h],o[h])}_onWasmError(e,t,i,r){this._lyr3DMain&&this._debugLog(i,r,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_add3DTilesLayerView(e){const t=e.layer;if(!t.url)return u;const i=this._lyr3DMain.get_next_layer_id(),r=new AbortController;this._layers.set(i,{layerView:e,abortController:r,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey});const s=t.elevationInfo?.offset??0,n=t.elevationInfo?.unit?c(t.elevationInfo?.unit):1;return this._lyr3DMain.add_layer(t.url,i,s*n)?(this._updateWasmCamera(),i):(this._layers.delete(i),u)}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:r,near:s,far:n,fovY:a}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:r,near:s,far:n,fov:a,aspectRatio:l,viewport:o})}};e([o({constructOnly:!0})],f.prototype,"view",void 0),f=e([l("esri.layers.Lyr3DWasmPerSceneView")],f);const w=f;export{w as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import i from"../core/Accessor.js";import r from"../core/Logger.js";import{isAbortError as s}from"../core/promiseUtils.js";import{watch as n}from"../core/reactiveUtils.js";import{addFrameTask as a}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{wasmFailedToInit as d,Lyr3DWasmWorkerOutputStatus as h,invalidLayerView as u}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as _}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as y}from"../libs/lyr3d/Lyr3DModule.js";import{getMetersPerUnit as c}from"../symbols/support/unitConversionUtils.js";import{makeScheduleFunction as g}from"../views/3d/layers/I3SMeshView3D.js";var m,b;!function(e){e[e.Lifetime=0]="Lifetime",e[e.Jobs=1]="Jobs",e[e.Renderables=2]="Renderables"}(m||(m={})),function(e){e[e.Critical=0]="Critical",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info"}(b||(b={}));let f=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._debugFlags=new Set,this._debugLevel=b.Critical,this._pulseTaskHandle=null,this._session=null,this._debugFlags.add(m.Lifetime),this._debugFlags.add(m.Jobs),this._debugFlags.add(m.Renderables)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;t===b.Critical||t===b.Error?r.getLogger(this).error(e):t===b.Warning&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}initialize(){this._debugLevel>b.Warning&&(r.getLogger(this).level="info"),this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([n((()=>this.view.state?.contentCamera),(()=>this._updateWasmCamera()))]),this._pulseTaskHandle=a({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach((e=>{e.abortController.abort()})),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._worker;e&&e.destroyWasm().then((()=>{this._worker?.destroy(),this._worker=null})),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}add3DTilesLayerView(e){return this._lyr3DMain?this._add3DTilesLayerView(e):(this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),d)}remove3DTilesLayerView(e){if(!this._lyr3DMain)return this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() called when WASM wasn't loaded!"),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.setEnabled() called when WASM wasn't loaded!");const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0)}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.setLayerOffset() called when WASM wasn't loaded!");this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.getAttributionText() called when WASM wasn't loaded!"),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(m.Lifetime,b.Error,"Lyr3DWasmPerSceneView.onRenderableEvicted() called when WASM wasn't loaded!");this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0)}initializeWasm(){return this._lyr3DMain?Promise.resolve():(this._debugLog(m.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=y().then((e=>{this._lyr3DMain=e,this._lyr3DMainPromise=null;const t=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),i=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),r=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),s=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),n=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),a="global"===this.view.viewingMode,o=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1,l=this.view.heightModelInfo?.heightModel,d=!l||"gravity-related-height"===l;return this._lyr3DMain.initialize_lyr3d_wasm(n,t,i,r,s,a,d,o,this._debugLevel)?(this._worker=new _(g(this.view.resourceController)),this._worker.promise?this._worker.promise:void 0):(this._lyr3DMain=null,void this._debugLog(m.Lifetime,b.Critical,"Lyr3d Main WASM failed to initialize",!1))})).catch((e=>{this._debugLog(m.Lifetime,b.Critical,`Lyr3d WASM failed to download error = ${e}`,!1)}))),this._lyr3DMainPromise)}_pulseTask(){if(this._lyr3DMain){let e=0;this._layers.forEach((t=>{e+=t.layerView.usedMemory})),e/=1048576;const t=this.view.resourceController.memoryController,i=t.usedMemory*t.maxMemory-e,r=t.maxMemory-i+t.additionalCacheMemory;this._lyr3DMain.frame_pulse(r,e,i,t.maxMemory)}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(m.Jobs,b.Error,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,r=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,r,e),this._lyr3DMain._free(r)}this._decrementJobCount(e)}_getRequestPromises(e,i){const r=[];for(const s of e){const e=new URL(s),n=e.searchParams.get("session");n?this._session=n:this._session&&e.searchParams.append("session",this._session),r.push(t(e.toString(),i).then((e=>e.data)))}return r}_onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,r={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey}},n={inputs:[],jobDescJson:e.desc,isMissingResourceCase:!1},a=this._getRequestPromises(e.urls,r);Promise.all(a).then((e=>(n.inputs=e,this._worker.invoke(n,i)))).then((e=>e)).catch((t=>(s(t)?this._debugLog(m.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(m.Jobs,b.Error,`job ${e.jobId} failed with error ${t}.`),{status:h.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}))).then((a=>{if(a.status===h.Failed)this._onJobFailed(t,a,e);else if(a.status===h.Succeeded)this._onJobSucceeded(t,a,e);else if(a.status===h.MissingInputs){const o=this._getRequestPromises(a.missingInputUrls,r);Promise.all(o).then((e=>{n.jobDescJson=a.jobDescJson,a.originalInputs?n.inputs=a.originalInputs:n.inputs=[],n.isMissingResourceCase=!0;for(const t of e)n.inputs.push(t);return this._worker.invoke(n,i)})).then((i=>{i.status===h.Failed?this._onJobFailed(t,i,e):i.status===h.Succeeded&&this._onJobSucceeded(t,i,e)})).catch((i=>{this._decrementJobCount(t),s(i)?this._debugLog(m.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(m.Jobs,b.Error,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)}))}}))}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then((t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)})).catch((t=>{s(t)||this._debugLog(m.Renderables,b.Error,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)})))}_freeRenderables(e,t,i){if(i<1)return;const r=this._layers.get(e);if(!r)return;const s=r.layerView,n=[],a=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)n.push(a[o]);for(let o=0;o<i;++o)s.freeRenderable(n[o])}_setRenderableVisibility(e,t,i,r){if(r<1)return;const s=this._layers.get(e);if(!s)return;const n=s.layerView,a=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,r),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,r);for(let h=0;h<r;++h)a.push(l[h]),o.push(1===d[h]);n.setRenderableVisibility(a,o,r)}_onWasmError(e,t,i,r){this._lyr3DMain&&this._debugLog(i,r,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_add3DTilesLayerView(e){const t=e.layer;if(!t.url)return u;const i=this._lyr3DMain.get_next_layer_id(),r=new AbortController;this._layers.set(i,{layerView:e,abortController:r,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey});const s=t.elevationInfo?.offset??0,n=t.elevationInfo?.unit?c(t.elevationInfo?.unit):1;return this._lyr3DMain.add_layer(t.url,i,s*n)?(this._updateWasmCamera(),i):(this._layers.delete(i),u)}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:r,near:s,far:n,fovY:a}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:r,near:s,far:n,fov:a,aspectRatio:l,viewport:o})}};e([o({constructOnly:!0})],f.prototype,"view",void 0),f=e([l("esri.layers.Lyr3DWasmPerSceneView")],f);const w=f;export{w as default};
|
package/layers/SceneLayer.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.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import r from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/PieChartRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import"../renderers/support/jsonUtils.js";import{webSceneRendererTypes as i}from"../renderers/support/types.js";import s from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import l from"../core/Logger.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,isAbortError as y}from"../core/promiseUtils.js";import{whenOnce as u}from"../core/reactiveUtils.js";import{join as c}from"../core/urlUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as f}from"../core/accessorSupport/utils.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as v}from"../core/accessorSupport/PropertyOrigin.js";import b from"../geometry/Mesh.js";import w from"../geometry/Point.js";import I from"./Layer.js";import{NoModelError as L,MultipleModelsError as j}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as F}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{CustomParametersMixin as _}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as E}from"./mixins/EditBusLayer.js";import{OperationalLayer as P}from"./mixins/OperationalLayer.js";import{PortalLayer as A}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{SceneService as x,SaveOperationType as D}from"./mixins/SceneService.js";import{TemporalSceneLayer as T}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as U}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as R}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as q}from"./support/capabilities.js";import{elevationInfo as C,labelsVisible as G,legendEnabled as Q,popupEnabled as N,screenSizePerspectiveEnabled as k}from"./support/commonProperties.js";import{computeEffectiveEditingEnabled as V,getGlobalIdToObjectIdMap as M}from"./support/featureLayerUtils.js";import{FeatureReduction as K}from"./support/FeatureReduction.js";import $ from"./support/FeatureReductionSelection.js";import{defineFieldProperties as H}from"./support/fieldProperties.js";import z from"./support/FieldsIndex.js";import{fixRendererFields as W,unpackFieldNames as B}from"./support/fieldUtils.js";import{I3SNodePageDefinition as Z,I3SMaterialDefinition as J,I3STextureSetDefinition as X,I3SGeometryDefinition as Y}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as ee,isFileSupported as te}from"./support/infoFor3D.js";import re from"./support/LabelClass.js";import{reader as ie}from"./support/labelingInfo.js";import se from"./support/LayerFloorInfo.js";import{layerLookupMap as oe}from"./support/lazyLayerLoader.js";import{RangeInfo as ae}from"./support/RangeInfo.js";import ne from"./support/SceneFilter.js";import{loadStyleRenderer as le}from"../renderers/support/styleUtils.js";import pe from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as de,elevationModeUnsupportedMessage as ye,featureExpressionUnsupportedMessage as ue}from"../support/elevationInfoUtils.js";import{sceneLayerEditingEnabled as ce}from"../support/featureFlags.js";import{createPopupTemplate as he}from"../support/popupUtils.js";import{extractZipFiles as fe}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as me}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as ge,getFetchPopupTemplate as ve}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as be}from"../webdoc/support/opacityUtils.js";const we=new Set(["3DObject","Point"]),Ie=H();let Le=class extends(T(E(x(S(P(A(O(p(_(F(o(I)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new a,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:Z.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&V(this.associatedLayer)}get geometryType(){return Fe[this.profile]||"mesh"}set renderer(e){W(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:q;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D&&ce();return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:w&&c&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&je[r]?je[r]:(l.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await le(this,{origin:"service"},t),W(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){l.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new pe;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new n("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new n("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=B(this.fieldsIndex,await ge(this,ve(this)));return me(this.parsedUrl.path,this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new n("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(l.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return he(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new n("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new n("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new n("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new n("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const i of this.statisticsInfo)if(i.name===r.name){const e=c(this.parsedUrl.path,i.href);return s(e,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then((e=>e.data))}throw new n("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(D.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(D.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new n(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:o}=s,a=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(a&&null==o)throw new n(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(a&&!l)throw new n(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return U(s.url)&&a&&null!=e.deleteFeatures&&null!=o&&(i={...i,globalIdToObjectId:await M(s,e.deleteFeatures,o)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new n(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){const r=e=>{throw l.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new n("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce(((e,t)=>ee(this.infoFor3D,t)?e+1:e),0);0===s&&r(new L),s>1&&r(new j);const o=t?.location??new w({x:0,y:0,z:0,spatialReference:this.spatialReference}),a=b.createWithExternalSource(o,i),[p]=await this.uploadAssets([a],t);return p}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await fe(e)).filter((e=>te(t,e)))}validateLayer(e){if(e.layerType&&!we.has(e.layerType))throw new n("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new n("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new n("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new n("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new n("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new n("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some((t=>t.name===e.name))),r=!!this.associatedLayer?.fields?.some((t=>t&&e.name===t.name)),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=f(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(o===v.SERVICE||o===v.PORTAL_ITEM)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.editingInfo?.lastEditDate,t=this.associatedLayer?.serverGens,r=this.associatedLayer?.getAtOrigin("fullExtent","service");if(!ce()||null==this.associatedLayer?.infoFor3D||!r||!U(this.associatedLayer?.url)||!e||this.serviceUpdateTimeStamp?.lastUpdate===e.getTime()||!this.serviceUpdateTimeStamp&&t?.minServerGen===t?.serverGen)return;f(this).setAtOrigin("fullExtent",r.clone(),v.SERVICE)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await R(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await oe.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){y(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await u((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?l.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):l.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&de(l.getLogger(this),ye("Mesh scene layers","relative-to-scene",e)),de(l.getLogger(this),ue("Scene layers",e))}};e([h({types:{key:"type",base:K,typeMap:{selection:$}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],Le.prototype,"featureReduction",void 0),e([h({type:[ae],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],Le.prototype,"rangeInfos",void 0),e([h({json:{read:!1}})],Le.prototype,"associatedLayer",void 0),e([h({type:["show","hide"]})],Le.prototype,"listMode",void 0),e([h({type:["ArcGISSceneServiceLayer"]})],Le.prototype,"operationalLayerType",void 0),e([h({json:{read:!1},readOnly:!0})],Le.prototype,"type",void 0),e([h({...Ie.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"fields",void 0),e([h()],Le.prototype,"types",null),e([h()],Le.prototype,"typeIdField",null),e([h()],Le.prototype,"templates",null),e([h()],Le.prototype,"formTemplate",null),e([h({readOnly:!0,clonable:!1})],Le.prototype,"fieldsIndex",null),e([h({type:se,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Le.prototype,"floorInfo",void 0),e([h(Ie.outFields)],Le.prototype,"outFields",void 0),e([h({type:Z,readOnly:!0,json:{read:!1}})],Le.prototype,"nodePages",void 0),e([m("service","nodePages",["nodePages","pointNodePages"])],Le.prototype,"readNodePages",null),e([h({type:[J],readOnly:!0})],Le.prototype,"materialDefinitions",void 0),e([h({type:[X],readOnly:!0})],Le.prototype,"textureSetDefinitions",void 0),e([h({type:[Y],readOnly:!0})],Le.prototype,"geometryDefinitions",void 0),e([h({readOnly:!0})],Le.prototype,"serviceUpdateTimeStamp",void 0),e([h({readOnly:!0})],Le.prototype,"attributeStorageInfo",void 0),e([h({readOnly:!0})],Le.prototype,"statisticsInfo",void 0),e([h({type:a.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Le.prototype,"excludeObjectIds",void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Le.prototype,"definitionExpression",void 0),e([h({type:ne,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Le.prototype,"filter",void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Le.prototype,"path",void 0),e([h(C)],Le.prototype,"elevationInfo",null),e([h({readOnly:!0,json:{read:!1}})],Le.prototype,"effectiveCapabilities",null),e([h({readOnly:!0})],Le.prototype,"effectiveEditingEnabled",null),e([h({type:String})],Le.prototype,"geometryType",null),e([h(G)],Le.prototype,"labelsVisible",void 0),e([h({type:[re],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:ie},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ie},write:!0}})],Le.prototype,"labelingInfo",void 0),e([h(Q)],Le.prototype,"legendEnabled",void 0),e([h({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?be(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Le.prototype,"opacity",void 0),e([h({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"priority",void 0),e([h({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"semantic",void 0),e([h({types:i,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Le.prototype,"renderer",null),e([h({json:{read:!1}})],Le.prototype,"cachedDrawingInfo",void 0),e([m("service","cachedDrawingInfo")],Le.prototype,"readCachedDrawingInfo",null),e([h({readOnly:!0,json:{read:!1}})],Le.prototype,"capabilities",null),e([h({type:Boolean,json:{read:!1}})],Le.prototype,"editingEnabled",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Le.prototype,"infoFor3D",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Le.prototype,"relationships",null),e([h(N)],Le.prototype,"popupEnabled",void 0),e([h({type:r,json:{name:"popupInfo",write:!0}})],Le.prototype,"popupTemplate",void 0),e([h({readOnly:!0,json:{read:!1}})],Le.prototype,"defaultPopupTemplate",null),e([h({type:String,json:{read:!1}})],Le.prototype,"objectIdField",void 0),e([m("service","objectIdField",["objectIdField","fields"])],Le.prototype,"readObjectIdField",null),e([h({type:String,json:{read:!1}})],Le.prototype,"globalIdField",void 0),e([m("service","globalIdField",["globalIdField","fields"])],Le.prototype,"readGlobalIdField",null),e([h({readOnly:!0,type:String,json:{read:!1}})],Le.prototype,"displayField",null),e([h({type:String,json:{read:!1}})],Le.prototype,"profile",void 0),e([m("service","profile",["store.profile"])],Le.prototype,"readProfile",null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Le.prototype,"normalReferenceFrame",void 0),e([h(k)],Le.prototype,"screenSizePerspectiveEnabled",void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"serviceItemId",void 0),Le=e([g("esri.layers.SceneLayer")],Le);const je={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Fe={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},Se=Le;export{Se as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import r from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/PieChartRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import"../renderers/support/jsonUtils.js";import{webSceneRendererTypes as i}from"../renderers/support/types.js";import s from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import l from"../core/Logger.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,isAbortError as y}from"../core/promiseUtils.js";import{whenOnce as u}from"../core/reactiveUtils.js";import{join as c}from"../core/urlUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as f}from"../core/accessorSupport/utils.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as v}from"../core/accessorSupport/PropertyOrigin.js";import b from"../geometry/Mesh.js";import w from"../geometry/Point.js";import I from"./Layer.js";import{NoModelError as L,MultipleModelsError as j}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as F}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{CustomParametersMixin as _}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as E}from"./mixins/EditBusLayer.js";import{OperationalLayer as P}from"./mixins/OperationalLayer.js";import{PortalLayer as A}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{SceneService as x,SaveOperationType as D}from"./mixins/SceneService.js";import{TemporalSceneLayer as T}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as U}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as R}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as q}from"./support/capabilities.js";import{elevationInfo as C,labelsVisible as G,legendEnabled as Q,popupEnabled as N,screenSizePerspectiveEnabled as k}from"./support/commonProperties.js";import{computeEffectiveEditingEnabled as V,getGlobalIdToObjectIdMap as M}from"./support/featureLayerUtils.js";import{FeatureReduction as K}from"./support/FeatureReduction.js";import $ from"./support/FeatureReductionSelection.js";import{defineFieldProperties as H}from"./support/fieldProperties.js";import z from"./support/FieldsIndex.js";import{fixRendererFields as W,unpackFieldNames as B}from"./support/fieldUtils.js";import{I3SNodePageDefinition as Z,I3SMaterialDefinition as J,I3STextureSetDefinition as X,I3SGeometryDefinition as Y}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as ee,isFileSupported as te}from"./support/infoFor3D.js";import re from"./support/LabelClass.js";import{reader as ie}from"./support/labelingInfo.js";import se from"./support/LayerFloorInfo.js";import{layerLookupMap as oe}from"./support/lazyLayerLoader.js";import{RangeInfo as ae}from"./support/RangeInfo.js";import ne from"./support/SceneFilter.js";import{loadStyleRenderer as le}from"../renderers/support/styleUtils.js";import pe from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as de,elevationModeUnsupportedMessage as ye,featureExpressionUnsupportedMessage as ue}from"../support/elevationInfoUtils.js";import{sceneLayerEditingEnabled as ce}from"../support/featureFlags.js";import{createPopupTemplate as he}from"../support/popupUtils.js";import{extractZipFiles as fe}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as me}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as ge,getFetchPopupTemplate as ve}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as be}from"../webdoc/support/opacityUtils.js";const we=new Set(["3DObject","Point"]),Ie=H();let Le=class extends(T(E(x(S(P(A(O(p(_(F(o(I)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new a,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:Z.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&V(this.associatedLayer)}get geometryType(){return Fe[this.profile]||"mesh"}set renderer(e){W(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:q;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D&&ce();return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:w&&c&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&je[r]?je[r]:(l.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await le(this,{origin:"service"},t),W(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){l.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new pe;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new n("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new n("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=B(this.fieldsIndex,await ge(this,ve(this)));return me(this.parsedUrl.path,this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new n("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(l.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return he(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new n("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new n("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new n("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new n("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const i of this.statisticsInfo)if(i.name===r.name){const e=c(this.parsedUrl.path,i.href);return s(e,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then((e=>e.data))}throw new n("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(D.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(D.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new n(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:o}=s,a=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(a&&null==o)throw new n(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(a&&!l)throw new n(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return U(s.url)&&a&&null!=e.deleteFeatures&&null!=o&&(i={...i,globalIdToObjectId:await M(s,e.deleteFeatures,o)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new n(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){const r=e=>{throw l.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new n("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce(((e,t)=>ee(this.infoFor3D,t)?e+1:e),0);0===s&&r(new L),s>1&&r(new j);const o=this.spatialReference,a=t?.location??new w({x:0,y:0,z:0,spatialReference:o}),p=t?.vertexSpace,d=b.createWithExternalSource(a,i,{vertexSpace:p}),[y]=await this.uploadAssets([d],t);return y}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await fe(e)).filter((e=>te(t,e)))}validateLayer(e){if(e.layerType&&!we.has(e.layerType))throw new n("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new n("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new n("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new n("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new n("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new n("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some((t=>t.name===e.name))),r=!!this.associatedLayer?.fields?.some((t=>t&&e.name===t.name)),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=f(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(o===v.SERVICE||o===v.PORTAL_ITEM)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.editingInfo?.lastEditDate,t=this.associatedLayer?.serverGens,r=this.associatedLayer?.getAtOrigin("fullExtent","service");if(!ce()||null==this.associatedLayer?.infoFor3D||!r||!U(this.associatedLayer?.url)||!e||this.serviceUpdateTimeStamp?.lastUpdate===e.getTime()||!this.serviceUpdateTimeStamp&&t?.minServerGen===t?.serverGen)return;f(this).setAtOrigin("fullExtent",r.clone(),v.SERVICE)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await R(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await oe.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){y(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await u((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?l.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):l.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&de(l.getLogger(this),ye("Mesh scene layers","relative-to-scene",e)),de(l.getLogger(this),ue("Scene layers",e))}};e([h({types:{key:"type",base:K,typeMap:{selection:$}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],Le.prototype,"featureReduction",void 0),e([h({type:[ae],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],Le.prototype,"rangeInfos",void 0),e([h({json:{read:!1}})],Le.prototype,"associatedLayer",void 0),e([h({type:["show","hide"]})],Le.prototype,"listMode",void 0),e([h({type:["ArcGISSceneServiceLayer"]})],Le.prototype,"operationalLayerType",void 0),e([h({json:{read:!1},readOnly:!0})],Le.prototype,"type",void 0),e([h({...Ie.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"fields",void 0),e([h()],Le.prototype,"types",null),e([h()],Le.prototype,"typeIdField",null),e([h()],Le.prototype,"templates",null),e([h()],Le.prototype,"formTemplate",null),e([h({readOnly:!0,clonable:!1})],Le.prototype,"fieldsIndex",null),e([h({type:se,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Le.prototype,"floorInfo",void 0),e([h(Ie.outFields)],Le.prototype,"outFields",void 0),e([h({type:Z,readOnly:!0,json:{read:!1}})],Le.prototype,"nodePages",void 0),e([m("service","nodePages",["nodePages","pointNodePages"])],Le.prototype,"readNodePages",null),e([h({type:[J],readOnly:!0})],Le.prototype,"materialDefinitions",void 0),e([h({type:[X],readOnly:!0})],Le.prototype,"textureSetDefinitions",void 0),e([h({type:[Y],readOnly:!0})],Le.prototype,"geometryDefinitions",void 0),e([h({readOnly:!0})],Le.prototype,"serviceUpdateTimeStamp",void 0),e([h({readOnly:!0})],Le.prototype,"attributeStorageInfo",void 0),e([h({readOnly:!0})],Le.prototype,"statisticsInfo",void 0),e([h({type:a.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Le.prototype,"excludeObjectIds",void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Le.prototype,"definitionExpression",void 0),e([h({type:ne,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Le.prototype,"filter",void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Le.prototype,"path",void 0),e([h(C)],Le.prototype,"elevationInfo",null),e([h({readOnly:!0,json:{read:!1}})],Le.prototype,"effectiveCapabilities",null),e([h({readOnly:!0})],Le.prototype,"effectiveEditingEnabled",null),e([h({type:String})],Le.prototype,"geometryType",null),e([h(G)],Le.prototype,"labelsVisible",void 0),e([h({type:[re],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:ie},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ie},write:!0}})],Le.prototype,"labelingInfo",void 0),e([h(Q)],Le.prototype,"legendEnabled",void 0),e([h({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?be(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Le.prototype,"opacity",void 0),e([h({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"priority",void 0),e([h({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"semantic",void 0),e([h({types:i,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Le.prototype,"renderer",null),e([h({json:{read:!1}})],Le.prototype,"cachedDrawingInfo",void 0),e([m("service","cachedDrawingInfo")],Le.prototype,"readCachedDrawingInfo",null),e([h({readOnly:!0,json:{read:!1}})],Le.prototype,"capabilities",null),e([h({type:Boolean,json:{read:!1}})],Le.prototype,"editingEnabled",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Le.prototype,"infoFor3D",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Le.prototype,"relationships",null),e([h(N)],Le.prototype,"popupEnabled",void 0),e([h({type:r,json:{name:"popupInfo",write:!0}})],Le.prototype,"popupTemplate",void 0),e([h({readOnly:!0,json:{read:!1}})],Le.prototype,"defaultPopupTemplate",null),e([h({type:String,json:{read:!1}})],Le.prototype,"objectIdField",void 0),e([m("service","objectIdField",["objectIdField","fields"])],Le.prototype,"readObjectIdField",null),e([h({type:String,json:{read:!1}})],Le.prototype,"globalIdField",void 0),e([m("service","globalIdField",["globalIdField","fields"])],Le.prototype,"readGlobalIdField",null),e([h({readOnly:!0,type:String,json:{read:!1}})],Le.prototype,"displayField",null),e([h({type:String,json:{read:!1}})],Le.prototype,"profile",void 0),e([m("service","profile",["store.profile"])],Le.prototype,"readProfile",null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Le.prototype,"normalReferenceFrame",void 0),e([h(k)],Le.prototype,"screenSizePerspectiveEnabled",void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"serviceItemId",void 0),Le=e([g("esri.layers.SceneLayer")],Le);const je={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Fe={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},Se=Le;export{Se as default};
|