@arcgis/core 4.33.0-next.20250403 → 4.33.0-next.20250405
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/WebScene.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{361a3253877acd3b4f07.js → 1014513c0ec85f9414a4.js} +1 -1
- package/assets/esri/core/workers/chunks/{18f8b41bd761e9ab60d0.js → 114599ed0752d9a70eef.js} +1 -1
- package/assets/esri/core/workers/chunks/{30a047bd66f333bb7d2d.js → 1364744b15b327abd5a1.js} +1 -1
- package/assets/esri/core/workers/chunks/{5beb525b4adde1d98532.js → 27b7ef3442700f6d6123.js} +84 -84
- package/assets/esri/core/workers/chunks/{628395830c78b95b46dc.js → 290aed587aa647226b46.js} +1 -1
- package/assets/esri/core/workers/chunks/358a3a9326615d5e6d3b.js +1 -0
- package/assets/esri/core/workers/chunks/35ab75010817f1525e54.js +1 -0
- package/assets/esri/core/workers/chunks/386ea90e87254b0282ec.js +1 -0
- package/assets/esri/core/workers/chunks/{2a654d8de99be40dd0e6.js → 3f6dc811b5d515c2725c.js} +1 -1
- package/assets/esri/core/workers/chunks/{8d421e0a01e2c3f6980c.js → 4275dcec730a11173661.js} +1 -1
- package/assets/esri/core/workers/chunks/43b19c58b2d16ae8e7cc.js +1 -0
- package/assets/esri/core/workers/chunks/{ddfb5a2055a36576ba0d.js → 4523ba4a3c8987abca56.js} +1 -1
- package/assets/esri/core/workers/chunks/{0b6ceb0194a07bbc3433.js → 4baef5262ce401bf81bb.js} +1 -1
- package/assets/esri/core/workers/chunks/{5660f479c005149bce8d.js → 4de3d692557120a4bbf7.js} +1 -1
- package/assets/esri/core/workers/chunks/{5e79642851e888eddfe4.js → 4e3b60156bee3b8b3367.js} +1 -1
- package/assets/esri/core/workers/chunks/{4dc135e0133d58a06d67.js → 519028f42b817d3e9933.js} +1 -1
- package/assets/esri/core/workers/chunks/{1377ddd582518e5fa051.js → 60472225a228e499b1a2.js} +1 -1
- package/assets/esri/core/workers/chunks/61737e442b1f8e86164e.js +1 -0
- package/assets/esri/core/workers/chunks/69e606267dc5842ebf9d.js +1 -0
- package/assets/esri/core/workers/chunks/7099564a8853b81ba181.js +1 -0
- package/assets/esri/core/workers/chunks/{3db517369c5dd891a75f.js → 72f4cea853ce9fcf2cb6.js} +1 -1
- package/assets/esri/core/workers/chunks/7ccc02a4ec6d3552ecca.js +1 -0
- package/assets/esri/core/workers/chunks/8221f2e540abe1e0f048.js +1 -0
- package/assets/esri/core/workers/chunks/8fecd1337d84c26c692b.js +1 -0
- package/assets/esri/core/workers/chunks/{6280e1fe944ea4a71b91.js → 9643a9516783e8c32180.js} +1 -1
- package/assets/esri/core/workers/chunks/b06e3ba73f353592c81d.js +1 -0
- package/assets/esri/core/workers/chunks/c2d0fc13f4b746318a38.js +1 -0
- package/assets/esri/core/workers/chunks/{6ab96eaaad0aaad46db9.js → cc307d34a68e44e3cbc5.js} +1 -1
- package/assets/esri/core/workers/chunks/d46c82a55219b27c301b.js +1 -0
- package/assets/esri/core/workers/chunks/{1df34b7fd68f5ab55bd3.js → d89f105b8a0b13dd8e5f.js} +1 -1
- package/assets/esri/core/workers/chunks/eaead9e927ebadcf2cc3.js +1 -0
- package/assets/esri/core/workers/chunks/ed517687b3728fd2eb64.js +1 -0
- package/assets/esri/core/workers/chunks/f41a9ceb8e49baafe9fa.js +1 -0
- package/assets/esri/core/workers/chunks/{e3b0bb6850d5252d5f24.js → f7d33d18bf1bd4db9df8.js} +1 -1
- package/assets/esri/themes/base/_core.scss +2 -0
- package/assets/esri/themes/base/widgets/_SelectionList.scss +61 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList.json +1 -0
- package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_en.json +1 -0
- package/core/MultiOriginJSONSupport.js +1 -1
- package/core/accessorSupport/DefaultsStore.js +1 -1
- package/core/accessorSupport/MultiOriginStore.js +1 -1
- package/core/accessorSupport/Properties.js +1 -1
- package/core/accessorSupport/Store.js +1 -1
- package/core/unitUtils.js +1 -1
- package/geometry/support/HalfFloatArray.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/float16.js +5 -0
- package/interfaces.d.ts +630 -26
- package/layers/BuildingSceneLayer.js +1 -1
- package/layers/ParquetLayer.d.ts +4 -0
- package/layers/SceneLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/support/VideoElement.js +1 -1
- package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
- package/package.json +2 -2
- package/portal/schemas/definitions.js +1 -1
- package/smartMapping/statistics/types.d.ts +4 -0
- package/smartMapping/statistics/types.js +5 -0
- package/support/revision.js +1 -1
- package/versionManagement/VersioningState.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/webgl/Mesh2D.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/effects/highlight/HighlightSurfaces.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/terrain/support/MultiSizeFramebuffer.js +1 -1
- package/views/3d/webgl/formats.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +15 -15
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
- package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
- package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/textureUtils.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/FocusAreas.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/ViewAnimation.js +1 -1
- package/views/layers/ParquetLayerView.d.ts +4 -0
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/Util.js +1 -1
- package/views/webgl/checkWebGLError.js +1 -1
- package/views/webgl/enums.js +1 -1
- package/views/webgl/textureUtils.js +1 -1
- package/widgets/Feature/support/relatedFeatureUtils.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
- package/widgets/FeatureTable/support/tableUtils.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/support/SelectionList/SelectionListFeatureItem.js +5 -0
- package/widgets/support/SelectionList/SelectionListGroupLayerItem.js +5 -0
- package/widgets/support/SelectionList/SelectionListItemBase.js +5 -0
- package/widgets/support/SelectionList/SelectionListLayerItem.js +5 -0
- package/widgets/support/SelectionList/SelectionListViewModel.js +5 -0
- package/widgets/support/SelectionList/VisibleElements.js +5 -0
- package/widgets/support/SelectionList/selectionListUtils.js +5 -0
- package/widgets/support/SelectionList.js +5 -0
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utils/getFeatureTitle.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0cd5f15b8558b23e5fcd.js +0 -1
- package/assets/esri/core/workers/chunks/1d322685016263f86cf5.js +0 -1
- package/assets/esri/core/workers/chunks/2219d970ece5676ca6ee.js +0 -1
- package/assets/esri/core/workers/chunks/222446da9cb58c3c3b7e.js +0 -1
- package/assets/esri/core/workers/chunks/401ff3c83789c72e9ac9.js +0 -1
- package/assets/esri/core/workers/chunks/555c95b149e3a82a4460.js +0 -1
- package/assets/esri/core/workers/chunks/6828e4936db0121a9638.js +0 -1
- package/assets/esri/core/workers/chunks/6b0a6469673417563616.js +0 -1
- package/assets/esri/core/workers/chunks/6e679703b5d6fc1b91a5.js +0 -1
- package/assets/esri/core/workers/chunks/6f3731f19497cbc6ea74.js +0 -1
- package/assets/esri/core/workers/chunks/7649d59b0b7d53818a29.js +0 -1
- package/assets/esri/core/workers/chunks/7b8f0b63b968ff40d00d.js +0 -1
- package/assets/esri/core/workers/chunks/c977a47cabc419610277.js +0 -1
- package/assets/esri/core/workers/chunks/e8312c999b3f0c9ef09e.js +0 -1
- package/assets/esri/core/workers/chunks/fa9ef9e8eae505371965.js +0 -1
- package/assets/esri/core/workers/chunks/fb5b852d0f72df014377.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import r from"../core/Collection.js";import t from"../core/CollectionFlattener.js";import
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import r from"../core/Collection.js";import t from"../core/CollectionFlattener.js";import i from"../core/Error.js";import{abortHandle as o}from"../core/handleUtils.js";import{clone as s}from"../core/lang.js";import{loadAll as l}from"../core/loadAll.js";import a from"../core/Logger.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as p,ignoreAbortErrors as u}from"../core/promiseUtils.js";import{whenOnce as y}from"../core/reactiveUtils.js";import{join as c}from"../core/urlUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import b from"../geometry/SpatialReference.js";import f from"./Layer.js";import g from"./buildingSublayers/BuildingComponentSublayer.js";import S from"./buildingSublayers/BuildingGroupSublayer.js";import{APIKeyMixin as v}from"./mixins/APIKeyMixin.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as I}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{SceneService as O,SaveOperationType as T}from"./mixins/SceneService.js";import{findAssociatedFeatureService as E}from"./support/associatedFeatureServiceUtils.js";import P from"./support/BuildingFilter.js";import A from"./support/BuildingSummaryStatistics.js";import{sceneLayerFullExtent as x,legendEnabled as F,readOnlyService as B,elevationInfo as C}from"./support/commonProperties.js";import{logInvalidElevationInfoWarning as K,elevationModeRequiredMessage as $,featureExpressionUnsupportedMessage as R}from"../support/elevationInfoUtils.js";const U=r.ofType(P),M=s(S.sublayersProperty),k=M.json?.origins;k&&(k["web-scene"]={type:[g],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},k["portal-item"]={type:[g],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let H=class extends(O(j(_(I(L(n(w(v(f))))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new t({getCollections:()=>[this.sublayers],getChildrenFunction:e=>"building-group"===e.type?e.sublayers:null}),this.sublayers=null,this._allSublayerOverrides=null,this.filters=new U,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type="building-scene"}normalizeCtorArgs(e){return"string"==typeof e?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,t){const i=S.readSublayers(e,r,t);return S.forEachSublayer(i,(e=>e.layer=this)),this._allSublayerOverrides&&(N(i,this._allSublayerOverrides),this._allSublayerOverrides=null),i}write(e,r){return e=super.write(e,r),!r||"web-scene"!==r.origin&&"portal-item"!==r.origin||(this.sublayers?W(this.sublayers,e,r):this._allSublayerOverrides&&z(this._allSublayerOverrides,e,r)),e}read(e,r){if(super.read(e,r),("web-scene"===r?.origin||"portal-item"===r?.origin)&&Array.isArray(e?.sublayers)){const t=V(e.sublayers,r);this.sublayers?G(this.sublayers,t):(this._allSublayerOverrides??=new Map,this._allSublayerOverrides.set(r.origin,t))}}readSummaryStatistics(e,r){if("string"==typeof r.statisticsHRef){const e=c(this.parsedUrl?.path,r.statisticsHRef);return new A({url:e})}return null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}load(e){const r=null!=e?e.signal:null,t=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(p).then((()=>this._fetchService(r))).then((()=>this._fetchAssociatedFeatureService(r)));return this.addResolvingPromise(t),Promise.resolve(this)}loadAll(){return l(this,(e=>{S.forEachSublayer(this.sublayers,(r=>{"building-group"!==r.type&&e(r)})),this.summaryStatistics&&e(this.summaryStatistics)}))}async saveAs(e,r){return this._debouncedSaveOperations(T.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(T.SAVE,e)}validateLayer(e){if(!e.layerType||"Building"!==e.layerType)throw new i("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}async _fetchAssociatedFeatureService(e){try{const{portalItem:r}=await E(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e});this.associatedFeatureServiceItem=r}catch(r){u(this._logWarningOnPopupEnabled())}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles(o(e)),await y((()=>this.allSublayers.filter((e=>"building-component"===e.type)).some((e=>e.popupEnabled&&null!=e.popupTemplate))),e.signal);const r=this.allSublayers.filter((e=>"building-component"===e.type)).filter((e=>e.popupEnabled&&null!=e.popupTemplate)),t=[],i=[];for(const o of r){const e=o.title??`untitled ${o.id}`;o.attributeStorageInfo?t.push(e):i.push(e)}const s="\n ",l=t.length>0?`\nThe following sublayers will fall back to binary attributes for Popups:${s}${t.join(s)}`:"",n=i.length>0?`\nThe following sublayers have no binary attributes and will not work with Popups:${s}${i.join(s)}`:"";a.getLogger(this).warn(`Associated FeatureLayer could not be loaded for this BuildingSceneLayer: ${this.title}.`,l,n)}_validateElevationInfo(e){const r="Building scene layers";K(a.getLogger(this),$(r,"absolute-height",e)),K(a.getLogger(this),R(r,e))}};function N(e,r){r.forEach((r=>G(e,r)))}function G(e,r){const{overrides:t,context:i}=r;S.forEachSublayer(e,(e=>e.read(t.get(e.id),i)))}function V(e,r){const t=new Map;for(const o of e)null!=o&&"object"==typeof o&&"number"==typeof o.id?t.set(o.id,o):r.messages?.push(new i("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:o}));return{overrides:t,context:r}}function W(e,r,t){const i=[];S.forEachSublayer(e,(e=>{const r=e.write({},t);Object.keys(r).length>1&&i.push(r)})),i.length>0&&(r.sublayers=i)}function z(e,r,t){const i=t?.origin&&e.get(t.origin);i&&(r.sublayers=[],i.overrides.forEach((e=>{r.sublayers.push(s(e))})))}e([d({type:["BuildingSceneLayer"]})],H.prototype,"operationalLayerType",void 0),e([d({readOnly:!0})],H.prototype,"allSublayers",void 0),e([d(M)],H.prototype,"sublayers",void 0),e([m("service","sublayers")],H.prototype,"readSublayers",null),e([d({type:U,nonNullable:!0,json:{write:!0}})],H.prototype,"filters",void 0),e([d({type:String,json:{write:!0}})],H.prototype,"activeFilterId",void 0),e([d({readOnly:!0,type:A})],H.prototype,"summaryStatistics",void 0),e([m("summaryStatistics",["statisticsHRef"])],H.prototype,"readSummaryStatistics",null),e([d({type:[String],json:{read:!1}})],H.prototype,"outFields",void 0),e([d(x)],H.prototype,"fullExtent",void 0),e([d(F)],H.prototype,"legendEnabled",void 0),e([d({type:["show","hide","hide-children"]})],H.prototype,"listMode",void 0),e([d(B(b))],H.prototype,"spatialReference",void 0),e([d(C)],H.prototype,"elevationInfo",null),e([d({json:{read:!1},readOnly:!0})],H.prototype,"type",void 0),e([d()],H.prototype,"associatedFeatureServiceItem",void 0),H=e([h("esri.layers.BuildingSceneLayer")],H);const J=H;export{J 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.33/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 i from"../core/Clonable.js";import s from"../core/Collection.js";import o from"../core/Error.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{MultiOriginJSONMixin as l}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as p,isAbortError as d}from"../core/promiseUtils.js";import{whenOnce as y}from"../core/reactiveUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as c}from"../core/accessorSupport/utils.js";import{reader as h}from"../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as m}from"../core/accessorSupport/PropertyOrigin.js";import g from"../geometry/Point.js";import v from"./Layer.js";import{NoModelError as b,MultipleModelsError as w}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as I}from"./mixins/APIKeyMixin.js";import{ArcGISService as L}from"./mixins/ArcGISService.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as F}from"./mixins/EditBusLayer.js";import{OperationalLayer as S}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as A}from"./mixins/ScaleRangeLayer.js";import{SceneService as O,SaveOperationType as P}from"./mixins/SceneService.js";import{useViewTimeProperty as E}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as T}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as x}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as D}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as U}from"./support/capabilities.js";import{elevationInfo as R,labelsVisible as q,legendEnabled as C,popupEnabled as G,attributeTableTemplate as N,screenSizePerspectiveEnabled as Q}from"./support/commonProperties.js";import{getFieldDomain as V,computeEffectiveEditingEnabled as M,getGlobalIdToObjectIdMap as k}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 Z}from"./support/fieldUtils.js";import{I3SNodePageDefinition as B,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{getMeshTransformForMetersToSpatialReference as ae}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as ne}from"./support/RangeInfo.js";import le from"./support/SceneFilter.js";import{cacheIsOutOfSync as pe}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as de}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as ye}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as ue}from"../renderers/support/typeUtils.js";import ce from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as he,elevationModeUnsupportedMessage as fe,featureExpressionUnsupportedMessage as me}from"../support/elevationInfoUtils.js";import{createPopupTemplate as ge}from"../support/popupUtils.js";import{extractZipFiles as ve}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as be}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as we,getFetchPopupTemplate as Ie}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Le}from"../webdoc/support/opacityUtils.js";const je=new Set(["3DObject","Point"]),Fe=H();let Se=class extends(T(F(O(L(S(_(A(l(j(I(i.ClonableMixin(v)))))))))))){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 s,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.attributeTableTemplate=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),this.associatedLayer=n(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?V(this.associatedLayer,e,t,r):r}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:B.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&&M(this.associatedLayer)}get geometryType(){return Ae[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:U;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;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&&_e[r]?_e[r]:(a.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}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(p),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await ye(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){a.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 ce;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(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 o("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 o("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=Z(this.fieldsIndex,await we(this,Ie(this)));return be(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 o("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:(a.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return ge(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 o("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 o("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){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(P.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(P.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 o(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:a}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==a)throw new o(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new o(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return x(s.url)&&n&&null!=e.deleteFeatures&&null!=a&&(i={...i,globalIdToObjectId:await k(s,e.deleteFeatures,a)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new o(`${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){t??={};const r=e=>{throw a.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new o("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 b),s>1&&r(new w);const n=this.spatialReference,l=t.location??new g({x:0,y:0,z:0,spatialReference:n}),p=l.spatialReference.isGeographic?"local":"georeferenced",{default:d}=await import("../geometry/Mesh.js"),y=d.createWithExternalSource(l,i,{vertexSpace:p,transform:ae(l.spatialReference),unitConversionDisabled:!0}),[u]=await this.uploadAssets([y],{...t,useAssetOrigin:!t.location});return u}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await ve(e)).filter((e=>te(t,e)))}validateLayer(e){if(e.layerType&&!je.has(e.layerType))throw new o("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 o("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 o("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 o("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new o("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 o("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?.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._applyAssociatedLayerPropertyOverrides(),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)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=c(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===m.SERVICE||o===m.PORTAL_ITEM)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!x(this.associatedLayer?.url)||!pe(this))return;c(this).setAtOrigin("fullExtent",e.clone(),m.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 D(`${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){d(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await y((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?a.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):a.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&&he(a.getLogger(this),fe("Mesh scene layers","relative-to-scene",e)),he(a.getLogger(this),me("Scene layers",e))}async fetchStatistics(e,t){return await de({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([u({types:{key:"type",base:K,typeMap:{selection:$}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],Se.prototype,"featureReduction",void 0),e([u({type:[ne],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],Se.prototype,"rangeInfos",void 0),e([u({json:{read:!1}})],Se.prototype,"associatedLayer",void 0),e([u({type:["show","hide"]})],Se.prototype,"listMode",void 0),e([u({type:["ArcGISSceneServiceLayer"]})],Se.prototype,"operationalLayerType",void 0),e([u({json:{read:!1},readOnly:!0})],Se.prototype,"type",void 0),e([u({...Fe.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"fields",void 0),e([u()],Se.prototype,"types",null),e([u()],Se.prototype,"typeIdField",null),e([u()],Se.prototype,"templates",null),e([u()],Se.prototype,"formTemplate",null),e([u({readOnly:!0,clonable:!1})],Se.prototype,"fieldsIndex",null),e([u({type:se,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Se.prototype,"floorInfo",void 0),e([u(Fe.outFields)],Se.prototype,"outFields",void 0),e([u({type:B,readOnly:!0,json:{read:!1}})],Se.prototype,"nodePages",void 0),e([h("service","nodePages",["nodePages","pointNodePages"])],Se.prototype,"readNodePages",null),e([u({type:[J],readOnly:!0})],Se.prototype,"materialDefinitions",void 0),e([u({type:[X],readOnly:!0})],Se.prototype,"textureSetDefinitions",void 0),e([u({type:[Y],readOnly:!0})],Se.prototype,"geometryDefinitions",void 0),e([u({readOnly:!0})],Se.prototype,"serviceUpdateTimeStamp",void 0),e([u({readOnly:!0})],Se.prototype,"attributeStorageInfo",void 0),e([u({readOnly:!0})],Se.prototype,"statisticsInfo",void 0),e([u({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Se.prototype,"excludeObjectIds",void 0),e([u({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Se.prototype,"definitionExpression",void 0),e([u({type:le,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Se.prototype,"filter",void 0),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Se.prototype,"path",void 0),e([u(R)],Se.prototype,"elevationInfo",null),e([u({readOnly:!0,json:{read:!1}})],Se.prototype,"effectiveCapabilities",null),e([u({readOnly:!0})],Se.prototype,"effectiveEditingEnabled",null),e([u({type:String})],Se.prototype,"geometryType",null),e([u(q)],Se.prototype,"labelsVisible",void 0),e([u({type:[re],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:ie},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ie},write:!0}})],Se.prototype,"labelingInfo",void 0),e([u(C)],Se.prototype,"legendEnabled",void 0),e([u({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?Le(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Se.prototype,"opacity",void 0),e([u({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"priority",void 0),e([u({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"semantic",void 0),e([u({types:ue,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Se.prototype,"renderer",null),e([u({json:{read:!1}})],Se.prototype,"cachedDrawingInfo",void 0),e([h("service","cachedDrawingInfo")],Se.prototype,"readCachedDrawingInfo",null),e([u({readOnly:!0,json:{read:!1}})],Se.prototype,"capabilities",null),e([u({type:Boolean,json:{read:!1}})],Se.prototype,"editingEnabled",null),e([u({readOnly:!0,json:{write:!1,read:!1}})],Se.prototype,"infoFor3D",null),e([u({readOnly:!0,json:{write:!1,read:!1}})],Se.prototype,"relationships",null),e([u(G)],Se.prototype,"popupEnabled",void 0),e([u({type:r,json:{name:"popupInfo",write:!0}})],Se.prototype,"popupTemplate",void 0),e([u({readOnly:!0,json:{read:!1}})],Se.prototype,"defaultPopupTemplate",null),e([u(N)],Se.prototype,"attributeTableTemplate",void 0),e([u({type:String,json:{read:!1}})],Se.prototype,"objectIdField",void 0),e([h("service","objectIdField",["objectIdField","fields"])],Se.prototype,"readObjectIdField",null),e([u({type:String,json:{read:!1}})],Se.prototype,"globalIdField",void 0),e([h("service","globalIdField",["globalIdField","fields"])],Se.prototype,"readGlobalIdField",null),e([u({readOnly:!0,type:String,json:{read:!1}})],Se.prototype,"displayField",null),e([u({type:String,json:{read:!1}})],Se.prototype,"profile",void 0),e([h("service","profile",["store.profile"])],Se.prototype,"readProfile",null),e([u({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Se.prototype,"normalReferenceFrame",void 0),e([u(Q)],Se.prototype,"screenSizePerspectiveEnabled",void 0),e([u({json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"serviceItemId",void 0),e([u(E)],Se.prototype,"useViewTime",null),Se=e([f("esri.layers.SceneLayer")],Se);const _e={"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"},Ae={"mesh-pyramids":"mesh",points:"point"},Oe=Se;export{Oe as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import r from"../PopupTemplate.js";import i from"../core/Clonable.js";import s from"../core/Collection.js";import o from"../core/Error.js";import{abortHandle as a}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.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{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as h}from"../core/accessorSupport/utils.js";import{reader as f}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as g}from"../core/accessorSupport/PropertyOrigin.js";import v from"../geometry/Point.js";import b from"./Layer.js";import{NoModelError as w,MultipleModelsError as I}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as L}from"./mixins/APIKeyMixin.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{CustomParametersMixin as F}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as S}from"./mixins/EditBusLayer.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as A}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{SceneService as P,SaveOperationType as E}from"./mixins/SceneService.js";import{useViewTimeProperty as T}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as x}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as D}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as U}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as R}from"./support/capabilities.js";import{elevationInfo as q,labelsVisible as C,legendEnabled as G,popupEnabled as N,attributeTableTemplate as Q,screenSizePerspectiveEnabled as V}from"./support/commonProperties.js";import{getFieldDomain as M,computeEffectiveEditingEnabled as k,getGlobalIdToObjectIdMap as K}from"./support/featureLayerUtils.js";import{FeatureReduction as $}from"./support/FeatureReduction.js";import H from"./support/FeatureReductionSelection.js";import{defineFieldProperties as z}from"./support/fieldProperties.js";import W from"./support/FieldsIndex.js";import{fixRendererFields as Z,unpackFieldNames as B}from"./support/fieldUtils.js";import{I3SNodePageDefinition as J,I3SMaterialDefinition as X,I3STextureSetDefinition as Y,I3SGeometryDefinition as ee}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as te,isFileSupported as re}from"./support/infoFor3D.js";import ie from"./support/LabelClass.js";import{reader as se}from"./support/labelingInfo.js";import oe from"./support/LayerFloorInfo.js";import{layerLookupMap as ae}from"./support/lazyLayerLoader.js";import{getMeshTransformForMetersToSpatialReference as ne}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as le}from"./support/RangeInfo.js";import pe from"./support/SceneFilter.js";import{cacheIsOutOfSync as de}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as ye}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as ue}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as ce}from"../renderers/support/typeUtils.js";import he from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as fe,elevationModeUnsupportedMessage as me,featureExpressionUnsupportedMessage as ge}from"../support/elevationInfoUtils.js";import{createPopupTemplate as ve}from"../support/popupUtils.js";import{extractZipFiles as be}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as we}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as Ie,getFetchPopupTemplate as Le}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as je}from"../webdoc/support/opacityUtils.js";const Fe=new Set(["3DObject","Point"]),Se=z();let _e=class extends(x(S(P(j(_(A(O(p(F(L(i.ClonableMixin(b)))))))))))){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 s,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.attributeTableTemplate=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),this.associatedLayer=l(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?M(this.associatedLayer,e,t,r):r}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 W(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:J.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&&k(this.associatedLayer)}get geometryType(){return Oe[this.profile]||"mesh"}set renderer(e){Z(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:R;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;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&&Ae[r]?Ae[r]:(n.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}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 this.loadTimeInfoFromService(e),await ue(this,{origin:"service"},t),Z(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){n.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 he;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(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 o("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 o("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 Ie(this,Le(this)));return we(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 o("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:(n.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return ve(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 o("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 o("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){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(E.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(E.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 o(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:a}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==a)throw new o(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new o(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return D(s.url)&&n&&null!=e.deleteFeatures&&null!=a&&(i={...i,globalIdToObjectId:await K(s,e.deleteFeatures,a)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new o(`${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){t??={};const r=e=>{throw n.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new o("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce(((e,t)=>te(this.infoFor3D,t)?e+1:e),0);0===s&&r(new w),s>1&&r(new I);const a=this.spatialReference,l=t.location??new v({x:0,y:0,z:0,spatialReference:a}),p=l.spatialReference.isGeographic?"local":"georeferenced",{default:d}=await import("../geometry/Mesh.js"),y=d.createWithExternalSource(l,i,{vertexSpace:p,transform:ne(l.spatialReference),unitConversionDisabled:!0}),[u]=await this.uploadAssets([y],{...t,useAssetOrigin:!t.location});return u}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await be(e)).filter((e=>re(t,e)))}validateLayer(e){if(e.layerType&&!Fe.has(e.layerType))throw new o("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 o("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 o("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 o("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new o("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 o("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?.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._applyAssociatedLayerPropertyOverrides(),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)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=h(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===g.SERVICE||o===g.PORTAL_ITEM)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!D(this.associatedLayer?.url)||!de(this))return;h(this).setAtOrigin("fullExtent",e.clone(),g.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 U(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await ae.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(){const e=new AbortController;this.addHandles(a(e)),await u((()=>this.popupEnabled&&null!=this.popupTemplate),e.signal);const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?n.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):n.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&fe(n.getLogger(this),me("Mesh scene layers","relative-to-scene",e)),fe(n.getLogger(this),ge("Scene layers",e))}async fetchStatistics(e,t){return await ye({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([c({types:{key:"type",base:$,typeMap:{selection:H}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],_e.prototype,"featureReduction",void 0),e([c({type:[le],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],_e.prototype,"rangeInfos",void 0),e([c({json:{read:!1}})],_e.prototype,"associatedLayer",void 0),e([c({type:["show","hide"]})],_e.prototype,"listMode",void 0),e([c({type:["ArcGISSceneServiceLayer"]})],_e.prototype,"operationalLayerType",void 0),e([c({json:{read:!1},readOnly:!0})],_e.prototype,"type",void 0),e([c({...Se.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_e.prototype,"fields",void 0),e([c()],_e.prototype,"types",null),e([c()],_e.prototype,"typeIdField",null),e([c()],_e.prototype,"templates",null),e([c()],_e.prototype,"formTemplate",null),e([c({readOnly:!0,clonable:!1})],_e.prototype,"fieldsIndex",null),e([c({type:oe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],_e.prototype,"floorInfo",void 0),e([c(Se.outFields)],_e.prototype,"outFields",void 0),e([c({type:J,readOnly:!0,json:{read:!1}})],_e.prototype,"nodePages",void 0),e([f("service","nodePages",["nodePages","pointNodePages"])],_e.prototype,"readNodePages",null),e([c({type:[X],readOnly:!0})],_e.prototype,"materialDefinitions",void 0),e([c({type:[Y],readOnly:!0})],_e.prototype,"textureSetDefinitions",void 0),e([c({type:[ee],readOnly:!0})],_e.prototype,"geometryDefinitions",void 0),e([c({readOnly:!0})],_e.prototype,"serviceUpdateTimeStamp",void 0),e([c({readOnly:!0})],_e.prototype,"attributeStorageInfo",void 0),e([c({readOnly:!0})],_e.prototype,"statisticsInfo",void 0),e([c({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],_e.prototype,"excludeObjectIds",void 0),e([c({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_e.prototype,"definitionExpression",void 0),e([c({type:pe,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],_e.prototype,"filter",void 0),e([c({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],_e.prototype,"path",void 0),e([c(q)],_e.prototype,"elevationInfo",null),e([c({readOnly:!0,json:{read:!1}})],_e.prototype,"effectiveCapabilities",null),e([c({readOnly:!0})],_e.prototype,"effectiveEditingEnabled",null),e([c({type:String})],_e.prototype,"geometryType",null),e([c(C)],_e.prototype,"labelsVisible",void 0),e([c({type:[ie],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:se},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:se},write:!0}})],_e.prototype,"labelingInfo",void 0),e([c(G)],_e.prototype,"legendEnabled",void 0),e([c({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?je(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],_e.prototype,"opacity",void 0),e([c({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_e.prototype,"priority",void 0),e([c({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_e.prototype,"semantic",void 0),e([c({types:ce,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],_e.prototype,"renderer",null),e([c({json:{read:!1}})],_e.prototype,"cachedDrawingInfo",void 0),e([f("service","cachedDrawingInfo")],_e.prototype,"readCachedDrawingInfo",null),e([c({readOnly:!0,json:{read:!1}})],_e.prototype,"capabilities",null),e([c({type:Boolean,json:{read:!1}})],_e.prototype,"editingEnabled",null),e([c({readOnly:!0,json:{write:!1,read:!1}})],_e.prototype,"infoFor3D",null),e([c({readOnly:!0,json:{write:!1,read:!1}})],_e.prototype,"relationships",null),e([c(N)],_e.prototype,"popupEnabled",void 0),e([c({type:r,json:{name:"popupInfo",write:!0}})],_e.prototype,"popupTemplate",void 0),e([c({readOnly:!0,json:{read:!1}})],_e.prototype,"defaultPopupTemplate",null),e([c(Q)],_e.prototype,"attributeTableTemplate",void 0),e([c({type:String,json:{read:!1}})],_e.prototype,"objectIdField",void 0),e([f("service","objectIdField",["objectIdField","fields"])],_e.prototype,"readObjectIdField",null),e([c({type:String,json:{read:!1}})],_e.prototype,"globalIdField",void 0),e([f("service","globalIdField",["globalIdField","fields"])],_e.prototype,"readGlobalIdField",null),e([c({readOnly:!0,type:String,json:{read:!1}})],_e.prototype,"displayField",null),e([c({type:String,json:{read:!1}})],_e.prototype,"profile",void 0),e([f("service","profile",["store.profile"])],_e.prototype,"readProfile",null),e([c({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],_e.prototype,"normalReferenceFrame",void 0),e([c(V)],_e.prototype,"screenSizePerspectiveEnabled",void 0),e([c({json:{read:!1,origins:{service:{read:!0}}}})],_e.prototype,"serviceItemId",void 0),e([c(T)],_e.prototype,"useViewTime",null),_e=e([m("esri.layers.SceneLayer")],_e);const Ae={"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"},Oe={"mesh-pyramids":"mesh",points:"point"},Pe=_e;export{Pe as default};
|
package/layers/WMSLayer.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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import r from"../Graphic.js";import o from"../PopupTemplate.js";import s from"../request.js";import i from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import n from"../core/Error.js";import{JSONMap as l}from"../core/jsonMap.js";import{clone as p}from"../core/lang.js";import{MultiOriginJSONMixin as m}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as u}from"../core/promiseUtils.js";import{on as c,watch as y,sync as f}from"../core/reactiveUtils.js";import{urlToObject as d,addQueryParameters as h,addProxy as g,Url as b}from"../core/urlUtils.js";import{property as w}from"../core/accessorSupport/decorators/property.js";import{Integer as v}from"../core/accessorSupport/ensureType.js";import{reader as x}from"../core/accessorSupport/decorators/reader.js";import{subclass as j}from"../core/accessorSupport/decorators/subclass.js";import{writer as I}from"../core/accessorSupport/decorators/writer.js";import{willPropertyWrite as S}from"../core/accessorSupport/write.js";import F from"../geometry/Extent.js";import P from"../geometry/SpatialReference.js";import{getScale as R}from"../geometry/support/scaleUtils.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import L from"./Layer.js";import{BlendLayer as O}from"./mixins/BlendLayer.js";import{OperationalLayer as U}from"./mixins/OperationalLayer.js";import{PortalLayer as M}from"./mixins/PortalLayer.js";import{RefreshableLayer as _}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as T}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as C}from"./mixins/TemporalLayer.js";import{isAxesOrderReversedForWkid as W}from"./ogc/crsUtils.js";import{isWmsServer as q}from"./support/arcgisLayerUrl.js";import{legendEnabled as N,url as $}from"./support/commonProperties.js";import{ExportWMSImageParameters as k}from"./support/ExportWMSImageParameters.js";import{createBitmap as B}from"./support/imageBitmapUtils.js";import H from"./support/WMSSublayer.js";import{normalizeWKID as G,toTimeQueryParameter as V,getPopupLayers as A,parseCapabilities as D}from"./support/wmsUtils.js";const J=new l({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function z(e){return"text/html"===e}function Q(e){return"text/plain"===e}let K=class extends(O(C(_(T(U(M(m(L)))))))){constructor(...e){super(...e),this.allSublayers=new a({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.version=null,this.addHandles([c((()=>this.sublayers),"after-add",(({item:e})=>{e.parent=e.layer=this}),f),c((()=>this.sublayers),"after-remove",(({item:e})=>{e.layer=e.parent=null}),f),y((()=>this.sublayers),((e,t)=>{if(t)for(const r of t)r.layer=r.parent=null;if(e)for(const r of e)r.parent=r.layer=this}),f)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(u).then((()=>this._fetchService(t))).then((()=>this._checkLayerValidity()))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new F({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return null==this.featureInfoFormats?null:this.featureInfoFormats.find(z)??this.featureInfoFormats.find(Q)??null}set featureInfoFormat(e){null==e?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(z(e)||Q(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new P(t.spatialReferences[0])}writeSpatialReferences(e,t){const r=this.spatialReference?.wkid;e&&r?(t.spatialReferences=e.filter((e=>e!==r)),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return Y(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return Y(t.layers,r)}writeSublayers(e,t,r,o){t.layers=[];const s=new Map,i=e.flatten((({sublayers:e})=>e??[]));for(const a of i)if("number"==typeof a.parent?.id){const e=s.get(a.parent.id);null!=e?e.push(a.id):s.set(a.parent.id,[a.id])}for(const a of i){const e={sublayer:a,...o},r=a.write({parentLayerId:"number"==typeof a.parent?.id?a.parent.id:-1},e);if(s.has(a.id)&&(r.sublayerIds=s.get(a.id)),!a.sublayers&&a.name){const r=a.write({},e);delete r.id,t.layers.push(r)}}t.visibleLayers=i.filter((({visible:e,sublayers:t})=>e&&!t)).map((({name:e})=>e)).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:t,query:r}=d(e);for(const s in r)/^(request|service)$/i.test(s)&&delete r[s];const o=h(t,r??{});this._set("url",o)}createExportImageParameters(e,t,r,o){const s=o?.pixelRatio??1,i=R({extent:e,width:t})*s,a=new k({layer:this,scale:i}),{xmin:n,ymin:l,xmax:p,ymax:m,spatialReference:u}=e,c=G(u,this.spatialReferences),y="1.3.0"===this.version&&W(c)?`${l},${n},${m},${p}`:`${n},${l},${p},${m}`,f=a.toJSON(),d="1.3.0"===this.version?"crs":"srs";return{bbox:y,[d]:null==c||isNaN(c)?void 0:"EPSG:"+c,...f}}async fetchImage(e,t,r,o){const i=this.mapUrl,a=this.createExportImageParameters(e,t,r,o);if(!a.layers){const e=document.createElement("canvas");return e.width=t,e.height=r,e}const n=V(o?.timeExtent),l={responseType:"image",query:this._mixCustomParameters({width:t,height:r,...a,time:n,...this.refreshParameters}),signal:o?.signal};return s(i??"",l).then((e=>e.data))}async fetchImageBitmap(e,t,r,o){const i=this.mapUrl??"",a=this.createExportImageParameters(e,t,r,o);if(!a.layers){const e=document.createElement("canvas");return e.width=t,e.height=r,e}const n=V(o?.timeExtent),l={responseType:"blob",query:this._mixCustomParameters({width:t,height:r,...a,time:n,...this.refreshParameters}),signal:o?.signal},{data:p}=await s(i,l);return B(p,i,o?.signal)}fetchFeatureInfo(e,t,r,o,s){const i=R({extent:e,width:t}),a=new k({layer:this,scale:i}),n=A(a.visibleSublayers);if(null==this.featureInfoUrl||null==n)return Promise.resolve([]);if(null==this.fetchFeatureInfoFunction&&null==this.featureInfoFormat)return Promise.resolve([]);const l="1.3.0"===this.version?{I:o,J:s}:{x:o,y:s},p={query_layers:n,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...l},m={...this.createExportImageParameters(e,t,r),...p},u=this._mixCustomParameters(m);return null!=this.fetchFeatureInfoFunction?this.fetchFeatureInfoFunction(u):this._defaultFetchFeatureInfoFunction(h(this.featureInfoUrl,u))}findSublayerById(e){return this.allSublayers.find((t=>t.id===e))}findSublayerByName(e){return this.allSublayers.find((t=>t.name===e))}serviceSupportsSpatialReference(e){return q(this.url)||null!=this.spatialReferences&&this.spatialReferences.some((t=>{const r=900913===t?P.WebMercator:new P({wkid:t});return E(r,e)}))}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=g(e),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const s=new o({title:this.title,content:t}),i=new r({sourceLayer:this,popupTemplate:s});return Promise.resolve([i])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){const{path:t,query:r}=this.parsedUrl,{data:o}=await s(t,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...r,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=D(o)}if(this.parsedUrl){const e=new b(this.parsedUrl.path),{httpsDomains:r}=t.request;"https"!==e.scheme||e.port&&"443"!==e.port||!e.host||r.includes(e.host)||r.push(e.host)}this.read(this.resourceInfo,{origin:"service"})}_checkLayerValidity(){if(!this.allSublayers.length)throw new n("wmslayer:empty-layer","The layer doesn't have any sublayer")}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function X(e,t){return e.some((e=>{for(const r in e)if(S(e,r,null,t))return!0;return!1}))}function Y(e,t,r){e=e??[];const o=new Map;e.every((e=>null==e.id))&&(e=p(e)).forEach(((e,t)=>e.id=t));for(const i of e){const e=new H;e.read(i,t),r&&!r.includes(e.name)&&(e.visible=!1),o.set(e.id,e)}const s=[];for(const a of e){const e=null!=a.id?o.get(a.id):null;if(e)if(null!=a.parentLayerId&&a.parentLayerId>=0){const t=o.get(a.parentLayerId);if(!t)continue;t.sublayers||(t.sublayers=new i),t.sublayers.push(e)}else s.push(e)}return s}e([w({readOnly:!0})],K.prototype,"allSublayers",void 0),e([w({json:{type:Object,write:!0}})],K.prototype,"customParameters",void 0),e([w({json:{type:Object,write:!0}})],K.prototype,"customLayerParameters",void 0),e([w({type:String,json:{write:!0}})],K.prototype,"copyright",void 0),e([w()],K.prototype,"description",void 0),e([w({readOnly:!0})],K.prototype,"dimensions",void 0),e([w({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],K.prototype,"fullExtent",void 0),e([x(["web-document","portal-item"],"fullExtent",["extent"])],K.prototype,"readFullExtentFromItemOrMap",null),e([I(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],K.prototype,"writeFullExtent",null),e([w({type:[F]})],K.prototype,"fullExtents",void 0),e([w({type:String,json:{write:{ignoreOrigin:!0}}})],K.prototype,"featureInfoFormat",null),e([w({type:[String],readOnly:!0})],K.prototype,"featureInfoFormats",void 0),e([w({type:String,json:{write:{ignoreOrigin:!0}}})],K.prototype,"featureInfoUrl",void 0),e([w()],K.prototype,"fetchFeatureInfoFunction",void 0),e([w({type:String,json:{origins:{"web-document":{default:"image/png",type:J.jsonValues,read:{reader:J.read,source:"format"},write:{writer:J.write,target:"format"}}}}})],K.prototype,"imageFormat",void 0),e([x("imageFormat",["supportedImageFormatTypes"])],K.prototype,"readImageFormat",null),e([w({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],K.prototype,"imageMaxHeight",void 0),e([w({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],K.prototype,"imageMaxWidth",void 0),e([w()],K.prototype,"imageTransparency",void 0),e([w(N)],K.prototype,"legendEnabled",void 0),e([w({type:["show","hide","hide-children"]})],K.prototype,"listMode",void 0),e([w({type:String,json:{write:{ignoreOrigin:!0}}})],K.prototype,"mapUrl",void 0),e([w({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],K.prototype,"isReference",void 0),e([w({type:["WMS"]})],K.prototype,"operationalLayerType",void 0),e([w()],K.prototype,"resourceInfo",void 0),e([w({type:P,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],K.prototype,"spatialReference",void 0),e([x(["web-document","portal-item"],"spatialReference",["spatialReferences"])],K.prototype,"readSpatialReferenceFromItemOrDocument",null),e([w({type:[v],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],K.prototype,"spatialReferences",void 0),e([I(["web-document","portal-item"],"spatialReferences")],K.prototype,"writeSpatialReferences",null),e([w({type:i.ofType(H),json:{write:{target:"layers",overridePolicy(e,t,r){if(X(this.allSublayers,r))return{ignoreOrigin:!0}}}}})],K.prototype,"sublayers",void 0),e([x(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],K.prototype,"readSublayersFromItemOrMap",null),e([x("service","sublayers",["layers"])],K.prototype,"readSublayers",null),e([I("sublayers",{layers:{type:[H]},visibleLayers:{type:[String]}})],K.prototype,"writeSublayers",null),e([w({json:{read:!1},readOnly:!0,value:"wms"})],K.prototype,"type",void 0),e([w($)],K.prototype,"url",null),e([w({type:String,json:{write:{ignoreOrigin:!0}}})],K.prototype,"version",void 0),K=e([j("esri.layers.WMSLayer")],K);const Z=K;export{Z as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import r from"../Graphic.js";import o from"../PopupTemplate.js";import s from"../request.js";import i from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import n from"../core/Error.js";import{JSONMap as l}from"../core/jsonMap.js";import{clone as p}from"../core/lang.js";import{MultiOriginJSONMixin as m}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as u}from"../core/promiseUtils.js";import{on as c,watch as y,sync as f}from"../core/reactiveUtils.js";import{urlToObject as d,addQueryParameters as h,addProxy as g,Url as b}from"../core/urlUtils.js";import{property as w}from"../core/accessorSupport/decorators/property.js";import{Integer as v}from"../core/accessorSupport/ensureType.js";import{reader as x}from"../core/accessorSupport/decorators/reader.js";import{subclass as j}from"../core/accessorSupport/decorators/subclass.js";import{writer as I}from"../core/accessorSupport/decorators/writer.js";import{willPropertyWrite as S}from"../core/accessorSupport/write.js";import F from"../geometry/Extent.js";import R from"../geometry/SpatialReference.js";import{getScale as P}from"../geometry/support/scaleUtils.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import L from"./Layer.js";import{BlendLayer as O}from"./mixins/BlendLayer.js";import{OperationalLayer as U}from"./mixins/OperationalLayer.js";import{PortalLayer as M}from"./mixins/PortalLayer.js";import{RefreshableLayer as _}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as T}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as C}from"./mixins/TemporalLayer.js";import{isAxesOrderReversedForWkid as W}from"./ogc/crsUtils.js";import{isWmsServer as q}from"./support/arcgisLayerUrl.js";import{legendEnabled as N,url as $}from"./support/commonProperties.js";import{ExportWMSImageParameters as k}from"./support/ExportWMSImageParameters.js";import{createBitmap as B}from"./support/imageBitmapUtils.js";import H from"./support/WMSSublayer.js";import{normalizeWKID as G,toTimeQueryParameter as V,getPopupLayers as A,parseCapabilities as D}from"./support/wmsUtils.js";const J=new l({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function z(e){return"text/html"===e}function Q(e){return"text/plain"===e}let K=class extends(O(C(_(T(U(M(m(L)))))))){constructor(...e){super(...e),this.allSublayers=new a({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.version=null,this.addHandles([c((()=>this.sublayers),"after-add",(({item:e})=>{e.parent=e.layer=this}),f),c((()=>this.sublayers),"after-remove",(({item:e})=>{e.layer=e.parent=null}),f),y((()=>this.sublayers),((e,t)=>{if(t)for(const r of t)r.layer=r.parent=null;if(e)for(const r of e)r.parent=r.layer=this}),f)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(u).then((()=>this._fetchService(t))).then((()=>this._checkLayerValidity()))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new F({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return null==this.featureInfoFormats?null:this.featureInfoFormats.find(z)??this.featureInfoFormats.find(Q)??null}set featureInfoFormat(e){null==e?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(z(e)||Q(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new R(t.spatialReferences[0])}writeSpatialReferences(e,t){const r=this.spatialReference?.wkid;e&&r?(t.spatialReferences=e.filter((e=>e!==r)),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return Y(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return Y(t.layers,r)}writeSublayers(e,t,r,o){t.layers=[];const s=new Map,i=e.flatten((({sublayers:e})=>e??[]));for(const a of i)if("number"==typeof a.parent?.id){const e=s.get(a.parent.id);null!=e?e.push(a.id):s.set(a.parent.id,[a.id])}for(const a of i){const e={sublayer:a,...o},r=a.write({parentLayerId:"number"==typeof a.parent?.id?a.parent.id:-1},e);if(s.has(a.id)&&(r.sublayerIds=s.get(a.id)),!a.sublayers&&a.name){const r=a.write({},e);delete r.id,t.layers.push(r)}}t.visibleLayers=i.filter((({visible:e,sublayers:t})=>e&&!t)).map((({name:e})=>e)).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:t,query:r}=d(e);for(const s in r)/^(request|service)$/i.test(s)&&delete r[s];const o=h(t,r??{});this._set("url",o)}createExportImageParameters(e,t,r,o){const s=o?.pixelRatio??1,i=P({extent:e,width:t})*s,a=new k({layer:this,scale:i}),{xmin:n,ymin:l,xmax:p,ymax:m,spatialReference:u}=e,c=G(u,this.spatialReferences),y="1.3.0"===this.version&&W(c)?`${l},${n},${m},${p}`:`${n},${l},${p},${m}`,f=a.toJSON(),d="1.3.0"===this.version?"crs":"srs";return{bbox:y,[d]:null==c||isNaN(c)?void 0:"EPSG:"+c,...f}}async fetchImage(e,t,r,o){const i=this.mapUrl,a=this.createExportImageParameters(e,t,r,o);if(!a.layers){const e=document.createElement("canvas");return e.width=t,e.height=r,e}const n=V(o?.timeExtent),l={responseType:"image",query:this._mixCustomParameters({width:t,height:r,...a,time:n,...this.refreshParameters}),signal:o?.signal};return s(i??"",l).then((e=>e.data))}async fetchImageBitmap(e,t,r,o){const i=this.mapUrl??"",a=this.createExportImageParameters(e,t,r,o);if(!a.layers){const e=document.createElement("canvas");return e.width=t,e.height=r,e}const n=V(o?.timeExtent),l={responseType:"blob",query:this._mixCustomParameters({width:t,height:r,...a,time:n,...this.refreshParameters}),signal:o?.signal},{data:p}=await s(i,l);return B(p,i,o?.signal)}fetchFeatureInfo(e,t,r,o,s){const i=P({extent:e,width:t}),a=new k({layer:this,scale:i}),n=A(a.visibleSublayers);if(null==this.featureInfoUrl||null==n)return Promise.resolve([]);if(null==this.fetchFeatureInfoFunction&&null==this.featureInfoFormat)return Promise.resolve([]);const l="1.3.0"===this.version?{I:o,J:s}:{x:o,y:s},p={query_layers:n,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...l},m={...this.createExportImageParameters(e,t,r),...p},u=this._mixCustomParameters(m);return null!=this.fetchFeatureInfoFunction?this.fetchFeatureInfoFunction(u):this._defaultFetchFeatureInfoFunction(h(this.featureInfoUrl,u))}findSublayerById(e){return this.allSublayers.find((t=>t.id===e))}findSublayerByName(e){return this.allSublayers.find((t=>t.name===e))}serviceSupportsSpatialReference(e){return q(this.url)||null!=this.spatialReferences&&this.spatialReferences.some((t=>{const r=900913===t?R.WebMercator:new R({wkid:t});return E(r,e)}))}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=encodeURI(g(e)),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const s=new o({title:this.title,content:t}),i=new r({sourceLayer:this,popupTemplate:s});return Promise.resolve([i])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){const{path:t,query:r}=this.parsedUrl,{data:o}=await s(t,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...r,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=D(o)}if(this.parsedUrl){const e=new b(this.parsedUrl.path),{httpsDomains:r}=t.request;"https"!==e.scheme||e.port&&"443"!==e.port||!e.host||r.includes(e.host)||r.push(e.host)}this.read(this.resourceInfo,{origin:"service"})}_checkLayerValidity(){if(!this.allSublayers.length)throw new n("wmslayer:empty-layer","The layer doesn't have any sublayer")}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function X(e,t){return e.some((e=>{for(const r in e)if(S(e,r,null,t))return!0;return!1}))}function Y(e,t,r){e=e??[];const o=new Map;e.every((e=>null==e.id))&&(e=p(e)).forEach(((e,t)=>e.id=t));for(const i of e){const e=new H;e.read(i,t),r&&!r.includes(e.name)&&(e.visible=!1),o.set(e.id,e)}const s=[];for(const a of e){const e=null!=a.id?o.get(a.id):null;if(e)if(null!=a.parentLayerId&&a.parentLayerId>=0){const t=o.get(a.parentLayerId);if(!t)continue;t.sublayers||(t.sublayers=new i),t.sublayers.push(e)}else s.push(e)}return s}e([w({readOnly:!0})],K.prototype,"allSublayers",void 0),e([w({json:{type:Object,write:!0}})],K.prototype,"customParameters",void 0),e([w({json:{type:Object,write:!0}})],K.prototype,"customLayerParameters",void 0),e([w({type:String,json:{write:!0}})],K.prototype,"copyright",void 0),e([w()],K.prototype,"description",void 0),e([w({readOnly:!0})],K.prototype,"dimensions",void 0),e([w({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],K.prototype,"fullExtent",void 0),e([x(["web-document","portal-item"],"fullExtent",["extent"])],K.prototype,"readFullExtentFromItemOrMap",null),e([I(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],K.prototype,"writeFullExtent",null),e([w({type:[F]})],K.prototype,"fullExtents",void 0),e([w({type:String,json:{write:{ignoreOrigin:!0}}})],K.prototype,"featureInfoFormat",null),e([w({type:[String],readOnly:!0})],K.prototype,"featureInfoFormats",void 0),e([w({type:String,json:{write:{ignoreOrigin:!0}}})],K.prototype,"featureInfoUrl",void 0),e([w()],K.prototype,"fetchFeatureInfoFunction",void 0),e([w({type:String,json:{origins:{"web-document":{default:"image/png",type:J.jsonValues,read:{reader:J.read,source:"format"},write:{writer:J.write,target:"format"}}}}})],K.prototype,"imageFormat",void 0),e([x("imageFormat",["supportedImageFormatTypes"])],K.prototype,"readImageFormat",null),e([w({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],K.prototype,"imageMaxHeight",void 0),e([w({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],K.prototype,"imageMaxWidth",void 0),e([w()],K.prototype,"imageTransparency",void 0),e([w(N)],K.prototype,"legendEnabled",void 0),e([w({type:["show","hide","hide-children"]})],K.prototype,"listMode",void 0),e([w({type:String,json:{write:{ignoreOrigin:!0}}})],K.prototype,"mapUrl",void 0),e([w({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],K.prototype,"isReference",void 0),e([w({type:["WMS"]})],K.prototype,"operationalLayerType",void 0),e([w()],K.prototype,"resourceInfo",void 0),e([w({type:R,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],K.prototype,"spatialReference",void 0),e([x(["web-document","portal-item"],"spatialReference",["spatialReferences"])],K.prototype,"readSpatialReferenceFromItemOrDocument",null),e([w({type:[v],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],K.prototype,"spatialReferences",void 0),e([I(["web-document","portal-item"],"spatialReferences")],K.prototype,"writeSpatialReferences",null),e([w({type:i.ofType(H),json:{write:{target:"layers",overridePolicy(e,t,r){if(X(this.allSublayers,r))return{ignoreOrigin:!0}}}}})],K.prototype,"sublayers",void 0),e([x(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],K.prototype,"readSublayersFromItemOrMap",null),e([x("service","sublayers",["layers"])],K.prototype,"readSublayers",null),e([I("sublayers",{layers:{type:[H]},visibleLayers:{type:[String]}})],K.prototype,"writeSublayers",null),e([w({json:{read:!1},readOnly:!0,value:"wms"})],K.prototype,"type",void 0),e([w($)],K.prototype,"url",null),e([w({type:String,json:{write:{ignoreOrigin:!0}}})],K.prototype,"version",void 0),K=e([j("esri.layers.WMSLayer")],K);const Z=K;export{Z 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import o from"../../core/Error.js";import{once as r}from"../../core/events.js";import s from"../../core/Logger.js";import{clamp as i}from"../../core/mathUtils.js";import{isAbsolute as n,makeAbsolute as a,getProxyRule as c,addProxy as d,isBlobProtocol as p,isDataProtocol as l}from"../../core/urlUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../../core/accessorSupport/decorators/writer.js";import y from"./MediaElementBase.js";import{mediaElementUrlProperty as v,mediaTypeProperty as g}from"./mediaUtils.js";import{VideoElementSymbol as f}from"../../support/mediaLayerUtils.js";import{i as j}from"../../chunks/persistableUrlUtils.js";var b;let U=class extends y{static{b=f}constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video",this[b]=!0}load(){const e=this.video;return"string"==typeof e?this.addResolvingPromise(this._preProcessVideoUrl(e).then((async e=>{const t=document.createElement("video");return t.src=e,t.crossOrigin="anonymous",t.autoplay=this.autoplay,t.muted=!0,t.loop=!0,t.playsInline=!0,this._loadVideo(t).then((()=>{this._set("content",t)}))}))):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set("content",e)}))):this.addResolvingPromise(Promise.reject(new o("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}get currentTime(){return this.content?.currentTime}set currentTime(e){if(!this.content)return;const t=i(e,0,this.content.duration);"fastSeek"in this.content?this.content.fastSeek(t):this.content.currentTime=t,this.content.play().then((()=>{this.content?.pause()})).catch((()=>{}))}get duration(){return this.content?.duration}set video(e){"not-loaded"===this.loadStatus?this._set("video",e):s.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,r,s){if(!e)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source is missing")));const i=V(e)?e:null;if(!i)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source must be an absolute url")));!n(i)&&s?.blockedRelativeUrls&&s.blockedRelativeUrls.push(i);const c=a(i);!j(c)?t[r]=c:s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source cannot be an item resource"))}async _preProcessVideoUrl(e){if(c(e))return d(e);try{return await t(e,{method:"head"}),e}catch{try{return d(e,!0)}catch{return e}}}_loadVideo(e){return new Promise(((t,o)=>{const s=r(e,"canplay",(()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,o):t()}));this.addHandles(s,"canplay"),"anonymous"!==e.crossOrigin&&(e.crossOrigin="anonymous",p(e.src)||(e.src=e.src))}))}};e([u()],U.prototype,"autoplay",void 0),e([u({readOnly:!0})],U.prototype,"content",void 0),e([u({readOnly:!0})],U.prototype,"contentWidth",null),e([u({readOnly:!0})],U.prototype,"contentHeight",null),e([u({type:Number})],U.prototype,"currentTime",null),e([u({type:Number})],U.prototype,"duration",null),e([u(v)],U.prototype,"video",null),e([h("video")],U.prototype,"writeVideo",null),e([u(g)],U.prototype,"type",void 0),U=e([m("esri.layers.support.VideoElement")],U);const w=U;function V(e){return"string"==typeof e&&!l(e)&&!p(e)}export{w as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import o from"../../core/Error.js";import{once as r}from"../../core/events.js";import s from"../../core/Logger.js";import{clamp as i}from"../../core/mathUtils.js";import{isAbsolute as n,makeAbsolute as a,getProxyRule as c,addProxy as d,isBlobProtocol as p,isDataProtocol as l}from"../../core/urlUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../../core/accessorSupport/decorators/writer.js";import y from"./MediaElementBase.js";import{mediaElementUrlProperty as v,mediaTypeProperty as g}from"./mediaUtils.js";import{VideoElementSymbol as f}from"../../support/mediaLayerUtils.js";import{i as j}from"../../chunks/persistableUrlUtils.js";var b;let U=class extends y{static{b=f}constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video",this[b]=!0}load(){const e=this.video;return"string"==typeof e?this.addResolvingPromise(this._preProcessVideoUrl(e).then((async e=>{const t=document.createElement("video");return t.src=encodeURI(e),t.crossOrigin="anonymous",t.autoplay=this.autoplay,t.muted=!0,t.loop=!0,t.playsInline=!0,this._loadVideo(t).then((()=>{this._set("content",t)}))}))):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set("content",e)}))):this.addResolvingPromise(Promise.reject(new o("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}get currentTime(){return this.content?.currentTime}set currentTime(e){if(!this.content)return;const t=i(e,0,this.content.duration);"fastSeek"in this.content?this.content.fastSeek(t):this.content.currentTime=t,this.content.play().then((()=>{this.content?.pause()})).catch((()=>{}))}get duration(){return this.content?.duration}set video(e){"not-loaded"===this.loadStatus?this._set("video",e):s.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,r,s){if(!e)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source is missing")));const i=V(e)?e:null;if(!i)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source must be an absolute url")));!n(i)&&s?.blockedRelativeUrls&&s.blockedRelativeUrls.push(i);const c=a(i);!j(c)?t[r]=c:s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source cannot be an item resource"))}async _preProcessVideoUrl(e){if(c(e))return d(e);try{return await t(e,{method:"head"}),e}catch{try{return d(e,!0)}catch{return e}}}_loadVideo(e){return new Promise(((t,o)=>{const s=r(e,"canplay",(()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,o):t()}));this.addHandles(s,"canplay"),"anonymous"!==e.crossOrigin&&(e.crossOrigin="anonymous",p(e.src)||(e.src=e.src))}))}};e([u()],U.prototype,"autoplay",void 0),e([u({readOnly:!0})],U.prototype,"content",void 0),e([u({readOnly:!0})],U.prototype,"contentWidth",null),e([u({readOnly:!0})],U.prototype,"contentHeight",null),e([u({type:Number})],U.prototype,"currentTime",null),e([u({type:Number})],U.prototype,"duration",null),e([u(v)],U.prototype,"video",null),e([h("video")],U.prototype,"writeVideo",null),e([u(g)],U.prototype,"type",void 0),U=e([m("esri.layers.support.VideoElement")],U);const w=U;function V(e){return"string"==typeof e&&!l(e)&&!p(e)}export{w 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{toRGB as t}from"../../../core/colorUtils.js";import e from"../../../core/Error.js";import{clone as r}from"../../../core/lang.js";import n from"./ArithmeticFunction.js";import o from"./AspectFunction.js";import s from"./BandArithmeticFunction.js";import a from"./ClipFunction.js";import i from"./ColormapFunction.js";import c from"./ColormapToRGBFunction.js";import u from"./CompositeBandFunction.js";import m from"./ComputeChangeFunction.js";import l from"./ContrastBrightnessFunction.js";import p from"./ConvolutionFunction.js";import f from"./CurvatureFunction.js";import d from"./ExtractBandFunction.js";import g from"./GrayscaleFunction.js";import F from"./HillshadeFunction.js";import h from"./LocalFunction.js";import A from"./MaskFunction.js";import
|
|
5
|
+
import{toRGB as t}from"../../../core/colorUtils.js";import e from"../../../core/Error.js";import{clone as r}from"../../../core/lang.js";import n from"./ArithmeticFunction.js";import o from"./AspectFunction.js";import s from"./BandArithmeticFunction.js";import a from"./ClipFunction.js";import i from"./ColormapFunction.js";import c from"./ColormapToRGBFunction.js";import u from"./CompositeBandFunction.js";import m from"./ComputeChangeFunction.js";import l from"./ContrastBrightnessFunction.js";import p from"./ConvolutionFunction.js";import f from"./CurvatureFunction.js";import d from"./ExtractBandFunction.js";import g from"./GrayscaleFunction.js";import F from"./HillshadeFunction.js";import h from"./LocalFunction.js";import A from"./MaskFunction.js";import y from"./NDVIFunction.js";import b from"./RemapFunction.js";import j from"./ShadedReliefFunction.js";import C from"./SlopeFunction.js";import _ from"./StatisticsFunction.js";import R from"./StatisticsHistogramFunction.js";import N from"./StretchFunction.js";import S from"./TableFunction.js";const v=new Map;function w(t,e){const{rasterFunctionArguments:r}=t;if(!r)return;(r.rasters||[r.raster,r.raster2]).forEach((t=>{t&&"number"!=typeof t&&("string"==typeof t?t.startsWith("http")&&(e.includes(t)||e.push(t)):"rasterFunctionArguments"in t&&w(t,e))}))}function T(t,n){n=n??{};try{if("function"in(t=r(t))&&"arguments"in t&&t.arguments){const r=$(t,new Map,n);if(L(r),!r.renderingRule)throw new e("raster-function-helper","Unsupported raster function json.");t=r.renderingRule}if("rasterFunction"in t)return k(t=B(t),n)}catch{}throw new e("raster-function-helper","unsupported raster function json.")}function D(t,e){return"rasters"===e[0]&&Array.isArray(t.rasters)?t.rasters:e.map((e=>t[e]))}function V(t){return!!(t&&"object"==typeof t&&t.rasterFunction&&t.rasterFunctionArguments)}function B(t){const{rasterFunction:e,rasterFunctionArguments:r}=t,n={};for(const o in r){let t=r[o];const e=o.toLowerCase();if("rasters"===e&&Array.isArray(t))n.rasters=t.map((t=>V(t)?B(t):t));else switch(V(t)&&(t=B(t)),e){case"dra":n.dra=t;break;case"pspower":n.psPower=t;break;case"pszfactor":n.psZFactor=t;break;case"bandids":n.bandIds=t;break;default:n[o[0].toLowerCase()+o.slice(1)]=t}}return"Local"!==e||n.rasters?.length||(n.rasters=["$$"]),{...t,rasterFunctionArguments:n}}function k(t,r){const{rasterFunction:n,rasterFunctionArguments:o}=t,s=t.outputPixelType?.toLowerCase();if(null==n||!v.has(n))throw new e("raster-function-helper",`unsupported raster function: ${n}`);const a=v.get(n),i=("function"==typeof a.ctor?a.ctor:a.ctor.default).fromJSON({...t,outputPixelType:s}),{rasterArgumentNames:c}=i,u=[],m=D(o,c),l="rasters"===c[0]||c.length>1,p=[];for(let e=0;e<m.length;e++){const t=m[e];let n;null==t||"string"==typeof t&&t.startsWith("$")?u.push(r?.raster):"string"==typeof t?r[t]&&u.push(r[t]):"number"!=typeof t&&"rasterFunction"in t&&(n=k(t,r),l||(i.functionArguments[c[e]]=n),u.push(n)),l&&p.push(n??t)}if(l&&("rasters"===c[0]?i.functionArguments.rasters=p:c.forEach(((t,e)=>{i.functionArguments[t]=p[e]}))),r){i.sourceRasters=u;const t=r.raster?.url;t&&(i.mainPrimaryRasterId=t)}return i}function x(t,e){if(t&&e)for(const r in t){const n=t[r];n&&"object"==typeof n&&"type"in n&&("RasterFunctionTemplate"===n.type?x(n.arguments,e):"RasterFunctionVariable"===n.type&&null!=e[n.name]&&(n.value=e[n.name]))}}function E(t,r){if(!t||"object"!=typeof t)return t;const{value:n}=t;if(!n||"object"!=typeof n)return t.isDataset?"$$":n;if(Array.isArray(n))return 0===n.length?[]:n.map((t=>t&&"object"==typeof t&&"RasterFunctionVariable"===t.type?E(t,r):t));if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&"Scalar"!==n.type)return"$$";if(!("type"in n))return n;let o=n;switch(n.type){case"Scalar":o=n.value;break;case"AlgorithmicColorRamp":o=M(n);break;case"MultiPartColorRamp":o={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(M)};break;case"ArgumentArray":if(n.elements?.length&&"RasterStatistics"!==n.elements[0].type){const t=[];for(let o=0;o<n.elements.length;o++){const s=n.elements[o],{type:a}=s;if(a)if("RasterFunctionTemplate"===a){const{renderingRule:e}=$(s,r);t.push(e),null!=s._object_id&&r.set(s._object_id,e)}else{if("RasterFunctionVariable"!==a)throw new e("raster-function-helper","unsupported raster function json.");{const e=E(s,r);t.push(e),null!=s._object_id&&r.set(s._object_id,e)}}else t.push(s)}o=t}else o=n.elements}return null!=n._object_id&&r.set(n._object_id,o),o}function M(e){const r=e.algorithm??"esriHSVAlgorithm";let{FromColor:n,ToColor:o}=e;if(!Array.isArray(n)){const{r:e,g:r,b:o}=t({h:n.Hue,s:n.Saturation,v:n.Value});n=[e,r,o,n.AlphaValue]}if(!Array.isArray(o)){const{r:e,g:r,b:n}=t({h:o.Hue,s:o.Saturation,v:o.Value});o=[e,r,n,o.AlphaValue]}return{type:"algorithmic",algorithm:r,fromColor:n,toColor:o}}function $(t,e,r){r&&x(t,r);const n={renderingRule:{},templates:e};return H(t,n),n}function H(t,e){if(!t||!e.renderingRule)return;const{renderingRule:r,templates:n}=e,{function:o,arguments:s,_object_id:a}=t;if(!o||!s)return;null!=a&&n.set(a,r),r.rasterFunction=o.type.replace("Function",""),r.outputPixelType=o.pixelType;const i={};r.rasterFunctionArguments=i;for(const c in s){if("type"===c||"object_id"===c||"_object_ref_id"===c)continue;const t=s[c];t&&"object"==typeof t&&"type"in t&&("RasterFunctionTemplate"===t.type||"RasterFunctionVariable"===t.type)?("RasterFunctionVariable"===t.type?i[c]=E(t,n):(r.rasterFunctionArguments[c]={},H(t,{renderingRule:r.rasterFunctionArguments[c],templates:n})),null!=t._object_id&&n.set(t._object_id,i[c])):i[c]=t}switch(i.DEM&&!i.Raster&&(i.Raster=i.DEM,delete i.DEM),r.rasterFunction){case"Stretch":O(i);break;case"Colormap":G(i);break;case"Convolution":P(i);break;case"Mask":I(i)}}function L(t){const{renderingRule:r,templates:n}=t;if("object"!=typeof r||!r?.rasterFunctionArguments||!n.size)return;const{rasterFunctionArguments:o}=r;for(const s in o){const t=o[s],r="_object_ref_id"===s?t:t&&"object"==typeof t&&"_object_ref_id"in t?t._object_ref_id:null;if(null==r)t&&"object"==typeof t&&(t.rasterFunctionArguments&&L({renderingRule:t,templates:n}),Array.isArray(t)&&t.forEach(((o,s)=>{if(o&&"object"==typeof o)if(null!=o._object_ref_id){if(!n.has(o._object_ref_id))throw new e("raster-function-helper",`unsupported raster function json. _object_ref_id: ${t} does not exist`);const a=n.get(r);a&&"object"==typeof a?Object.assign(o,a):t[s]=a}else L({renderingRule:o,templates:n})})));else{if(!n.has(r))throw new e("raster-function-helper",`unsupported raster function json. _object_ref_id: ${r} does not exist`);const t=n.get(r);"_object_ref_id"!==s?o[s]=t:t&&"object"==typeof t&&Object.assign(o,t)}}}function O(t){t.Statistics?.length&&"object"==typeof t.Statistics&&(t.Statistics=t.Statistics.map((t=>[t.min,t.max,t.mean,t.standardDeviation]))),null!=t.NumberOfStandardDeviation&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}function G(t){"randomcolorramp"===t.ColorRamp?.type?.toLowerCase()&&(delete t.ColorRamp,t.ColormapName="Random"),0===t.ColorSchemeType&&delete t.ColorRamp}function P(t){null!=t.ConvolutionType&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function I(t){t.NoDataValues?.length&&"string"==typeof t.NoDataValues[0]&&(t.NoDataValues=t.NoDataValues.filter((t=>""!==t)).map((t=>Number(t))))}v.set("Arithmetic",{desc:"Arithmetic Function",ctor:n,rasterArgumentNames:["rasters"]}),v.set("Aspect",{desc:"Aspect Function",ctor:o,rasterArgumentNames:["raster"]}),v.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:s,rasterArgumentNames:["raster"]}),v.set("Colormap",{desc:"Colormap Function",ctor:i,rasterArgumentNames:["raster"]}),v.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:c,rasterArgumentNames:["raster"]}),v.set("CompositeBand",{desc:"CompositeBand Function",ctor:u,rasterArgumentNames:["rasters"]}),v.set("ComputeChange",{desc:"ComputeChange Function",ctor:m,rasterArgumentNames:["rasters"]}),v.set("Convolution",{desc:"Convolution Function",ctor:p,rasterArgumentNames:["raster"]}),v.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:l,rasterArgumentNames:["raster"]}),v.set("ExtractBand",{desc:"ExtractBand Function",ctor:d,rasterArgumentNames:["raster"]}),v.set("Curvature",{desc:"Curvature Function",ctor:f,rasterArgumentNames:["raster"]}),v.set("Hillshade",{desc:"Hillshade Function",ctor:F,rasterArgumentNames:["raster"]}),v.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:j,rasterArgumentNames:["raster"]}),v.set("Grayscale",{desc:"Grayscale Function",ctor:g,rasterArgumentNames:["raster"]}),v.set("Clip",{desc:"Clip Function",ctor:a,rasterArgumentNames:["raster"]}),v.set("Local",{desc:"Local Function",ctor:h,rasterArgumentNames:["rasters"]}),v.set("Mask",{desc:"Mask Function",ctor:A,rasterArgumentNames:["raster"]}),v.set("NDVI",{desc:"NDVI Function",ctor:y,rasterArgumentNames:["raster"]}),v.set("Remap",{desc:"Remap Function",ctor:b,rasterArgumentNames:["raster"]}),v.set("Slope",{desc:"Slope Function",ctor:C,rasterArgumentNames:["raster"]}),v.set("Statistics",{desc:"Focal Statistics Function",ctor:_,rasterArgumentNames:["raster"]}),v.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:R,rasterArgumentNames:["raster"]}),v.set("Stretch",{desc:"Stretch Function",ctor:N,rasterArgumentNames:["raster"]}),v.set("Table",{desc:"Attribute Table Function",ctor:S,rasterArgumentNames:["raster"]});export{T as create,w as getPrimaryRasterUrls,D as getRasterValues};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "4.33.0-next.
|
|
3
|
+
"version": "4.33.0-next.20250405",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
29
29
|
"@esri/calcite-components": "^3.0.3",
|
|
30
30
|
"@petamoriken/float16": "~3.9.2",
|
|
31
|
-
"@vaadin/grid": "~24.7.
|
|
31
|
+
"@vaadin/grid": "~24.7.2",
|
|
32
32
|
"@zip.js/zip.js": "~2.7.60",
|
|
33
33
|
"luxon": "~3.6.1",
|
|
34
34
|
"marked": "~15.0.7"
|