@arcgis/core 4.33.0-next.20250404 → 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/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/{baab3f0bdf78b6165fd6.js → 27b7ef3442700f6d6123.js} +3 -3
- 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/{0669220e7acacd9c652a.js → 43b19c58b2d16ae8e7cc.js} +1 -1
- 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/{3db517369c5dd891a75f.js → 72f4cea853ce9fcf2cb6.js} +1 -1
- package/assets/esri/core/workers/chunks/{c20ec58c7bc7d5893049.js → 7ccc02a4ec6d3552ecca.js} +1 -1
- 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/{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/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/float16.js +1 -1
- package/interfaces.d.ts +62 -21
- package/layers/WMSLayer.js +1 -1
- package/layers/support/VideoElement.js +1 -1
- package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
- package/package.json +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/webgl/Mesh2D.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/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.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/FocusAreas.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/ViewAnimation.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/textureUtils.js +1 -1
- package/widgets/Feature/support/relatedFeatureUtils.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/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0cd5f15b8558b23e5fcd.js +0 -1
- package/assets/esri/core/workers/chunks/222446da9cb58c3c3b7e.js +0 -1
- package/assets/esri/core/workers/chunks/7b8f0b63b968ff40d00d.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"collapseAll":"Collapse all","deselectFeature":"Deselect feature","deselectGroup":"Deselect group","deselectLayer":"Deselect layer","filter":"Filter","onlySelectFeature":"Only select this feature","onlySelectThis":"Only select this","selection":"Selection","selectionCount":"Selection ({count})","tooManyFeatures":"There are too many features to show in this list. Deselect features to use the Selection pane.","untitledLayer":"Untitled layer","untitledFeature":"Untitled feature","widgetLabel":"Selection list","zoomTo":"Zoom to"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"collapseAll":"Collapse all","deselectFeature":"Deselect feature","deselectGroup":"Deselect group","deselectLayer":"Deselect layer","filter":"Filter","onlySelectFeature":"Only select this feature","onlySelectThis":"Only select this","selection":"Selection","selectionCount":"Selection ({count})","tooManyFeatures":"There are too many features to show in this list. Deselect features to use the Selection pane.","untitledLayer":"Untitled layer","untitledFeature":"Untitled feature","widgetLabel":"Selection list","zoomTo":"Zoom to"}
|
|
@@ -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 r}from"../chunks/tslib.es6.js";import t from"./Accessor.js";import{ReadOnlyMultiOriginJSONMixin as s}from"./ReadOnlyMultiOriginJSONSupport.js";import{get as
|
|
5
|
+
import{_ as r}from"../chunks/tslib.es6.js";import t from"./Accessor.js";import{ReadOnlyMultiOriginJSONMixin as s}from"./ReadOnlyMultiOriginJSONSupport.js";import{get as o}from"./accessorSupport/get.js";import{nameToId as e,OriginId as i,originIdNum as p}from"./accessorSupport/PropertyOrigin.js";import{getProperties as c}from"./accessorSupport/utils.js";import{write as n}from"./accessorSupport/write.js";import{subclass as u}from"./accessorSupport/decorators/subclass.js";const l=t=>{let s=class extends t{constructor(...r){super(...r)}clear(r,t="user"){c(this).clearOrigin(r,e(t))}write(r,t){return n(this,r=r||{},t),r}setAtOrigin(r,t,s){c(this).setAtOrigin(r,t,e(s))}removeOrigin(r){const t=O(this),s=e(r),o=t.keys(s);for(const e of o)t.originOf(e)===s&&t.set(e,t.get(e,s),i.USER)}updateOrigin(r,t){const s=O(this),i=e(t),c=o(this,r);for(let o=i+1;o<p;++o)s.delete(r,o);s.set(r,c,i)}toJSON(r){return this.write({},r)}};return s=r([u("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],s),s.prototype.toJSON.isDefaultToJSON=!0,s};function O(r){return c(r).store}const S=t=>{let o=class extends(l(s(t))){constructor(...r){super(...r)}};return o=r([u("esri.core.MultiOriginJSONSupport")],o),o};let a=class extends(S(t)){};a=r([u("esri.core.MultiOriginJSONSupport")],a);export{S as MultiOriginJSONMixin,a as MultiOriginJSONSupport};
|
|
@@ -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{clone as i}from"../lang.js";import{OriginId as
|
|
5
|
+
import{clone as i}from"../lang.js";import{OriginId as r}from"./PropertyOrigin.js";class s{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(r){const t=new s;return this._values.forEach(((s,e)=>{r&&r.has(e)||t.set(e,i(s.value),s.origin)})),t}get(i,r){r=this._normalizeOrigin(r);const s=this._values.get(i);return null==r||s?.origin===r?s?.value:void 0}originOf(i){return this._values.get(i)?.origin??r.USER}keys(i){i=this._normalizeOrigin(i);const r=[...this._values.keys()];return null==i?r:r.filter((r=>this._values.get(r)?.origin===i))}set(i,s,e){if((e=this._normalizeOrigin(e))===r.DEFAULTS){const r=this._values.get(i);if(null!=r?.origin&&r.origin>e)return}this._values.set(i,new t(s,e))}delete(i,r){null!=(r=this._normalizeOrigin(r))&&this._values.get(i)?.origin!==r||this._values.delete(i)}has(i,r){return null!=(r=this._normalizeOrigin(r))?this._values.get(i)?.origin===r:this._values.has(i)}isAtOrigin(i,r){return r=this._normalizeOrigin(r),this.has(i,r)&&this.originOf(i)===r}isBelowOrigin(i,r){return r=this._normalizeOrigin(r),!this.has(i)||this.originOf(i)<r}forEach(i){this._values.forEach((({value:r},s)=>i(r,s)))}_normalizeOrigin(i){if(null!=i)return i===r.DEFAULTS?i:r.USER}}class t{constructor(i,r){this.value=i,this.origin=r}}export{s as DefaultsStore};
|
|
@@ -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{clone as t}from"../lang.js";import{originIdNum as s,OriginId as
|
|
5
|
+
import{clone as t}from"../lang.js";import{originIdNum as s,OriginId as i}from"./PropertyOrigin.js";class r{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(s),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const o=new r,n=this._originStores[i.DEFAULTS];n&&n.forEach(((s,r)=>{o.set(r,t(s),i.DEFAULTS)}));for(let r=i.SERVICE;r<s;r++){const s=this._originStores[r];s&&s.forEach(((s,i)=>{e&&e.has(i)||o.set(i,t(s),r)}))}return o}get(t,s){const i=void 0===s?this._values:this._originStores[s];return i?i.get(t):void 0}keys(t){const s=null==t?this._values:this._originStores[t];return s?[...s.keys()]:[]}set(t,s,r=i.USER){let e=this._originStores[r];if(e||(e=new Map,this._originStores[r]=e),e.set(t,s),!this._values.has(t)||this._propertyOriginMap.get(t)<=r){const i=this._values.get(t);return this._values.set(t,s),this._propertyOriginMap.set(t,r),i!==s}return!1}delete(t,s=i.USER){const r=this._originStores[s];if(!r)return;const e=r.get(t);if(r.delete(t),this._values.has(t)&&this._propertyOriginMap.get(t)===s){this._values.delete(t);for(let i=s-1;i>=0;i--){const s=this._originStores[i];if(s&&s.has(t)){this._values.set(t,s.get(t)),this._propertyOriginMap.set(t,i);break}}}return e}has(t,s){const i=void 0===s?this._values:this._originStores[s];return!!i&&i.has(t)}revert(t,s){for(;s>0&&!this.has(t,s);)--s;const i=this._originStores[s],r=i?.get(t),e=this._values.get(t);return this._values.set(t,r),this._propertyOriginMap.set(t,s),e!==r}originOf(t){return this._propertyOriginMap.get(t)||i.DEFAULTS}isAtOrigin(t,s){return this.has(t,s)&&this.originOf(t)===s}isBelowOrigin(t,s){return!this.has(t)||this.originOf(t)<s}forEach(t){this._values.forEach(t)}}export{r 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"../has.js";import{equals as t}from"../lang.js";import"../Logger.js";import e from"../ObjectPool.js";import{Lifecycle as i}from"./interfaces.js";import{Property as s}from"./Property.js";import{OriginId as r,idToName as
|
|
5
|
+
import"../has.js";import{equals as t}from"../lang.js";import"../Logger.js";import e from"../ObjectPool.js";import{Lifecycle as i}from"./interfaces.js";import{Property as s}from"./Property.js";import{OriginId as r,idToName as n,nameToId as o}from"./PropertyOrigin.js";import{Store as a}from"./Store.js";import{trackAccess as c,runTracked as l,initializeDependencyTracking as h}from"./tracking.js";import{Flags as g}from"./tracking/Flags.js";import{TrackingTarget as f}from"./tracking/TrackingTarget.js";function p(t,e,i){return void 0!==t}function m(t,e,s,r){return void 0!==t&&(!(null==s&&t.flags&g.NonNullable)||(r.lifecycle,i.INITIALIZING,!1))}class u{constructor(t){this.host=t,this.propertiesByName=new Map,this.ctorArgs=null,this.lifecycle=i.INITIALIZING,this.store=new a,this.mutable=!0,this._origin=r.USER;const e=this.host.constructor.__accessorMetadata__;for(const i in e){const t=new s(i,e[i]);this.propertiesByName.set(i,t)}this.metadata=e}initialize(){this.lifecycle=i.CONSTRUCTING}constructed(){this.lifecycle=i.CONSTRUCTED}destroy(){this.lifecycle=i.DESTROYED,this.propertiesByName.forEach((t=>t.destroy()))}get initialized(){return this.lifecycle!==i.INITIALIZING}get(t){const e=this.propertiesByName.get(t);if(!p(e))return;if(e.metadata.get)return e.getComputed(this);this.mutable&&c(e);const i=this.store;return i.has(t)?i.get(t):e.metadata.value}originOf(t){const e=this.store.originOf(t);if(void 0===e){const e=this.propertiesByName.get(t);if(void 0!==e&&e.flags&g.HasDefaultValue)return"defaults"}return n(e)}has(t){return this.propertiesByName.has(t)&&this.store.has(t)}keys(){return[...this.propertiesByName.keys()]}internalGet(t){const e=this.propertiesByName.get(t);if(p(e))return this.store.has(t)?this.store.get(t):e.metadata.value}internalSet(t,e){const i=this.propertiesByName.get(t);p(i)&&this._internalSet(i,e)}getDependsInfo(t,e,i){const r=this.propertiesByName.get(e);if(!p(r))return"";const n=new f,o=l(n,(()=>r.metadata.get?.call(t)));let a=`${i}${t.declaredClass.split(".").pop()}.${e}: ${o}\n`;const c=n.accessed??new Set;if(0===c.size)return a;i+=" ";for(const l of c){if(!(l instanceof s))continue;a+=`${i}${l.propertyName}: undefined\n`}return a}setAtOrigin(t,e,i){const s=this.propertiesByName.get(t);if(p(s))return this._setAtOrigin(s,e,i)}isOverridden(t){const e=this.propertiesByName.get(t);return void 0!==e&&!!(e.flags&g.Overridden)}clearOrigin(t,e){const i=this.store,s=this.propertiesByName.get(t);if(!p(s))return;const r=i.isAtOrigin(t,e)&&!(s.flags&g.Overridden);i.delete(t,e),r&&s.notifyChange()}clearOverride(t){const e=this.propertiesByName.get(t);e&&e.flags&g.Overridden&&(e.flags&=~g.Overridden,e.notifyChange())}override(t,e){const i=this.propertiesByName.get(t);if(!m(i,t,e,this))return;const s=i.metadata.cast;if(s){const t=this._cast(s,e),{valid:i,value:r}=t;if(y.release(t),!i)return;e=r}i.flags|=g.Overridden,this._internalSet(i,e)}set(t,e){const i=this.propertiesByName.get(t);if(!m(i,t,e,this))return;const s=i.metadata.cast;if(s){const t=this._cast(s,e),{valid:i,value:r}=t;if(y.release(t),!i)return;e=r}const r=i.metadata.set;r?r.call(this.host,e):this._internalSet(i,e)}setDefaultOrigin(t){this._origin=o(t)}getDefaultOrigin(){return n(this._origin)}notifyChange(t){const e=this.propertiesByName.get(t);void 0!==e&&e.notifyChange()}invalidate(t){const e=this.propertiesByName.get(t);void 0!==e&&e.invalidate()}commit(t){const e=this.propertiesByName.get(t);void 0!==e&&e.commit()}_internalSet(t,e){const s=this.lifecycle!==i.INITIALIZING?this._origin:r.DEFAULTS;this._setAtOrigin(t,e,s)}_setAtOrigin(e,i,s){const r=this.store,n=e.propertyName;if(r.isAtOrigin(n,s)&&t(i,r.get(n))&&~e.flags&g.Overridden)return;const o=r.isBelowOrigin(n,s)||r.isAtOrigin(n,s);o&&e.invalidate(),r.set(n,i,s),o&&e.commit(),h(this.host,e)}_cast(t,e){const i=y.acquire();return i.valid=!0,i.value=e,t&&(i.value=t.call(this.host,e,i)),i}}class d{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}}const y=new e(d);export{u 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{clone as
|
|
5
|
+
import{clone as s}from"../lang.js";import{OriginId as e}from"./PropertyOrigin.js";class t{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const r=new t;return this._values.forEach(((t,i)=>{e&&e.has(i)||r.set(i,s(t))})),r}get(s){return this._values.get(s)}originOf(){return e.USER}keys(){return[...this._values.keys()]}set(s,e){this._values.set(s,e)}delete(s){this._values.delete(s)}has(s){return this._values.has(s)}isAtOrigin(s,e){return this.has(s)}isBelowOrigin(s,e){return!this.has(s)}forEach(s){this._values.forEach(s)}}export{t as Store};
|
package/core/unitUtils.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"./has.js";import{strict as e}from"./jsonMap.js";import{getReferenceEllipsoid as s}from"../geometry/ellipsoidUtils.js";import{earth as i,mars as n,moon as t}from"../geometry/support/Ellipsoid.js";import{isGeographic as a,isEarth as r,isWKIDFromMars as c,isWKIDFromMoon as u}from"../geometry/support/spatialReferenceUtils.js";import o from"../geometry/support/WKIDUnitConversion.js";const l=39.37,m=i.radius*Math.PI/200,f=/(?:LENGTH)?UNIT\[([^\]]+)]]$/i,d=o,U=/UNIT\[([^\]]+)]/i,B=new Set([4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104025,104026,104139,104140]),_=e()({millimeter:"millimeters",centimeter:"centimeters",meter:"meters",meter_german:"german-meters",kilometer:"kilometers",decimeter:"decimeters",micrometer:"micrometers",nanometer:"nanometers","50_kilometers":"50-kilometers","150_kilometers":"150-kilometers",foot:"feet",foot_us:"us-feet",foot_clarke:"clarke-feet",fathom:"fathoms",nautical_mile:"nautical-miles",chain_us:"us-chains",link_us:"us-links",mile_us:"us-miles",yard_clarke:"clarke-yards",chain_clarke:"clarke-chains",link_clarke:"clarke-links",yard_sears:"sears-yards",foot_sears:"sears-feet",chain_sears:"sears-chains",link_sears:"sears-links",yard_benoit_1895_a:"benoit-1895-a-yards",foot_benoit_1895_a:"benoit-1895-a-feet",chain_benoit_1895_a:"benoit-1895-a-chains",link_benoit_1895_a:"benoit-1895-a-links",yard_benoit_1895_b:"benoit-1895-b-yards",foot_benoit_1895_b:"benoit-1895-b-feet",chain_benoit_1895_b:"benoit-1895-b-chains",link_benoit_1895_b:"benoit-1895-b-links",foot_1865:"1865-feet",foot_indian:"indian-feet",foot_indian_1937:"indian-1937-feet",foot_indian_1962:"indian-1962-feet",foot_indian_1975:"indian-1975-feet",yard_indian:"indian-yards",yard_indian_1937:"indian-1937-yards",yard_indian_1962:"indian-1962-yards",yard_indian_1975:"indian-1975-yards",statute_mile:"statute-miles",foot_gold_coast:"gold-coast-feet",foot_british_1936:"british-1936-feet",yard:"yards",chain:"chains",link:"links",yard_sears_1922_truncated:"sears-1922-truncated-yards",foot_sears_1922_truncated:"sears-1922-truncated-feet",chain_sears_1922_truncated:"sears-1922-truncated-chains",link_sears_1922_truncated:"sears-1922-truncated-links",yard_us:"us-yards",inch:"inches",inch_us:"us-inches",rod:"rods",rod_us:"us-rods",nautical_mile_us:"us-nautical-miles",nautical_mile_uk:"uk-nautical-miles",smoot:"smoots",vara_tx:"tx-vara",point:"points"}),h=e=>e*e,b=e=>e*e*e,k={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},meters:{inBaseUnits:1},feet:{inBaseUnits:.3048},"us-feet":{inBaseUnits:.3048006096012192},"clarke-feet":{inBaseUnits:.3047972654},fathoms:{inBaseUnits:1.8288},"nautical-miles":{inBaseUnits:1852},"german-meters":{inBaseUnits:1.0000135965},"us-chains":{inBaseUnits:20.11684023368047},"us-links":{inBaseUnits:.2011684023368047},"us-miles":{inBaseUnits:1609.347218694438},kilometers:{inBaseUnits:1e3},"clarke-yards":{inBaseUnits:.9143917962},"clarke-chains":{inBaseUnits:20.1166195164},"clarke-links":{inBaseUnits:.201166195164},"sears-yards":{inBaseUnits:.9143984146160287},"sears-feet":{inBaseUnits:.3047994715386762},"sears-chains":{inBaseUnits:20.11676512155263},"sears-links":{inBaseUnits:.2011676512155263},"benoit-1895-a-yards":{inBaseUnits:.9143992},"benoit-1895-a-feet":{inBaseUnits:.3047997333333333},"benoit-1895-a-chains":{inBaseUnits:20.1167824},"benoit-1895-a-links":{inBaseUnits:.201167824},"benoit-1895-b-yards":{inBaseUnits:.9143992042898124},"benoit-1895-b-feet":{inBaseUnits:.3047997347632708},"benoit-1895-b-chains":{inBaseUnits:20.11678249437587},"benoit-1895-b-links":{inBaseUnits:.2011678249437587},"1865-feet":{inBaseUnits:.3048008333333334},"indian-feet":{inBaseUnits:.3047995102481469},"indian-1937-feet":{inBaseUnits:.30479841},"indian-1962-feet":{inBaseUnits:.3047996},"indian-1975-feet":{inBaseUnits:.3047995},"indian-yards":{inBaseUnits:.9143985307444408},"indian-1937-yards":{inBaseUnits:.91439523},"indian-1962-yards":{inBaseUnits:.9143988},"indian-1975-yards":{inBaseUnits:.9143985},miles:{inBaseUnits:1609.344},"statute-miles":{inBaseUnits:1609.344},"gold-coast-feet":{inBaseUnits:.3047997101815088},"british-1936-feet":{inBaseUnits:.3048007491},yards:{inBaseUnits:.9144},chains:{inBaseUnits:20.1168},links:{inBaseUnits:.201168},"sears-1922-truncated-yards":{inBaseUnits:.914398},"sears-1922-truncated-feet":{inBaseUnits:.3047993333333334},"sears-1922-truncated-chains":{inBaseUnits:20.116756},"sears-1922-truncated-links":{inBaseUnits:.20116756},"us-yards":{inBaseUnits:.9144018288036576},decimeters:{inBaseUnits:.1},inches:{inBaseUnits:.0254},"us-inches":{inBaseUnits:.0254000508001016},rods:{inBaseUnits:5.0292},"us-rods":{inBaseUnits:5.029210058420118},"us-nautical-miles":{inBaseUnits:1853.248},"uk-nautical-miles":{inBaseUnits:1853.184},smoots:{inBaseUnits:1.7018},"tx-vara":{inBaseUnits:.8466683600033867},points:{inBaseUnits:.0003527777777777778},micrometers:{inBaseUnits:1e-6},nanometers:{inBaseUnits:1e-9},"50-kilometers":{inBaseUnits:5e4},"150-kilometers":{inBaseUnits:15e4}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:h(.001)},"square-centimeters":{inBaseUnits:h(.01)},"square-decimeters":{inBaseUnits:h(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:h(1e3)},"square-inches":{inBaseUnits:h(.0254)},"square-feet":{inBaseUnits:h(.3048)},"square-yards":{inBaseUnits:h(.9144)},"square-miles":{inBaseUnits:h(1609.344)},"square-nautical-miles":{inBaseUnits:h(1852)},"square-us-feet":{inBaseUnits:h(1200/3937)},acres:{inBaseUnits:.0015625*h(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*b(.001)},"cubic-centimeters":{inBaseUnits:1e3*b(.01)},"cubic-decimeters":{inBaseUnits:1e3*b(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*b(1e3)},"cubic-inches":{inBaseUnits:1e3*b(.0254)},"cubic-feet":{inBaseUnits:1e3*b(.3048)},"cubic-yards":{inBaseUnits:1e3*b(.9144)},"cubic-miles":{inBaseUnits:1e3*b(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},y=(()=>{const e={};for(const s in k)for(const i in k[s].units)e[i]=s;return e})();function q(e,s,i){return e*k[i].units[s].inBaseUnits}function p(e,s,i){return e/k[i].units[s].inBaseUnits}const g=["metric","imperial","square-inches","square-feet","square-yards","square-miles","square-nautical-miles","square-us-feet","square-meters","square-kilometers","acres","ares","hectares"],w=["metric","imperial","inches","feet","yards","miles","nautical-miles","us-feet","meters","kilometers"],M=new Map([["meters","square-meters"],["feet","square-feet"],["us-feet","square-us-feet"]]);function S(e){return"imperial"===e||"metric"===e}function D(e){const s=y[e];if(!s)throw new Error("unknown type");return s}function v(e){return k[e].baseUnit}function C(e){return v(D(e))}function P(e,s=null){return s=s||D(e),k[s].baseUnit===e}function x(e,s,i){if(s===i)return e;const n=D(s);if(n!==D(i))throw new Error("incompatible units");const t=P(s,n)?e:q(e,s,n);return P(i,n)?t:p(t,i,n)}function E(e,s,i,n=!1){if(!n&&a(s))throw new Error("Unable to convert from an angular unit to a linear unit.");const t=se(s);return t!==i&&(e=t?x(e,t,i):x(e*=Q(s),"meters",i)),e}function I(e,s,i,n=!1){if(!n&&a(i))throw new Error("Unable to convert from a linear unit to an angular unit.");const t=se(i);return s!==t&&(e=t?x(e,s,t):x(e,s,"meters")/Q(i)),e}function j(e){switch(e){case"metric":return"meters";case"imperial":return"feet";default:return e}}function R(e){return j(e)}function N(e){switch(e){case"metric":return"square-meters";case"imperial":return"square-feet";default:return e}}function O(e,s,i){switch(i){case"metric":return J(e,s);case"imperial":return K(e,s);default:return i}}function F(e,s,i){switch(i){case"metric":return T(e,s);case"imperial":return A(e,s);default:return i}}function J(e,s){const i=x(e,s,"meters");return Math.abs(i)<3e3?"meters":"kilometers"}function T(e,s){const i=x(e,s,"meters");return Math.abs(i)<1e5?"meters":"kilometers"}function K(e,s){const i=x(e,s,"feet");return Math.abs(i)<1e3?"feet":"miles"}function A(e,s){const i=x(e,s,"feet");return Math.abs(i)<1e5?"feet":"miles"}function G(e,s){const i=x(e,s,"square-meters");return Math.abs(i)<3e6?"square-meters":"square-kilometers"}function H(e,s){const i=x(e,s,"square-feet");return Math.abs(i)<1e6?"square-feet":"square-miles"}function L(e,s,i){switch(i){case"metric":return G(e,s);case"imperial":return H(e,s);default:return i}}function Y(e,s,i){return x(e,s,"meters")/(i*Math.PI/180)}function W(e){return _.fromJSON(e.toLowerCase())||null}function $(e){if(null!=e&&!r(e))return 1;const s=Q(e);return s>1e5?1:s}function z(e){return Q(e)>=s(e).metersPerDegree?"meters":se(e)}function Q(e,s=i.metersPerDegree){return V(e,!0)??s}function V(e,s=!1){const i=e?.wkid??null,a=e?.wkt2??e?.wkt??null;let r=null;if(i){if(c(i))return n.metersPerDegree;if(u(i))return t.metersPerDegree;r=d.values[d[i]],!r&&s&&B.has(i)&&(r=m)}else a&&(re(a)?r=Z(f.exec(a),r):ae(a)&&(r=Z(U.exec(a),r)));return r}function X(e){return a(e)?1:Q(e)}function Z(e,s){return e?.[1]?ee(e[1]):s}function ee(e){return parseFloat(e.split(",")[1])}function se(e){const s=e?.wkid??null,i=e?.wkt2??e?.wkt??null;let n=null;if(s)n=d.units[d[s]];else if(i){const e=re(i)?f:ae(i)?U:null;if(e){const s=e.exec(i);s?.[1]&&(n=ue(s[1]))}}return null!=n?W(n):null}function ie(e){const s=se(e);return null!=s&&w.includes(s)?s:null}function ne(e){const s=z(e);return null!=s&&w.includes(s)?s:null}function te(e){const s=se(e);return null==s?null:M.get(s)}function ae(e){return/^GEOCCS/i.test(e)}function re(e){return/^\s*(?:PROJCS|PROJCRS|PROJECTEDCRS)/i.test(e)}const ce=1e-7;function ue(e){const s=/[\\"']{1}([^\\"']+)/.exec(e);let i=s?.[1];if(!i||!W(i)){const s=ee(e);i=null;const n=d.values;for(let e=0;e<n.length;++e)if(Math.abs(s-n[e])<ce){i=d.units[e];break}}return i}function oe(e){const s=se(e);if(null==s)return null;switch(s){case"feet":case"us-feet":case"clarke-feet":case"fathoms":case"nautical-miles":case"us-chains":case"us-links":case"us-miles":case"clarke-yards":case"clarke-chains":case"clarke-links":case"sears-yards":case"sears-feet":case"sears-chains":case"sears-links":case"benoit-1895-a-yards":case"benoit-1895-a-feet":case"benoit-1895-a-chains":case"benoit-1895-a-links":case"benoit-1895-b-yards":case"benoit-1895-b-feet":case"benoit-1895-b-chains":case"benoit-1895-b-links":case"1865-feet":case"indian-feet":case"indian-1937-feet":case"indian-1962-feet":case"indian-1975-feet":case"indian-yards":case"indian-1937-yards":case"indian-1962-yards":case"indian-1975-yards":case"statute-miles":case"gold-coast-feet":case"british-1936-feet":case"yards":case"chains":case"links":case"sears-1922-truncated-yards":case"sears-1922-truncated-feet":case"sears-1922-truncated-chains":case"sears-1922-truncated-links":case"us-yards":case"inches":case"us-inches":case"rods":case"us-rods":case"us-nautical-miles":case"uk-nautical-miles":case"smoots":case"tx-vara":case"points":return"imperial";case"millimeters":case"centimeters":case"meters":case"german-meters":case"kilometers":case"decimeters":case"micrometers":case"nanometers":case"50-kilometers":case"150-kilometers":return"metric"}return null}const le={esriAcres:"acres",esriAres:"ares",esriHectares:"hectares",esriSquareCentimeters:"square-centimeters",esriSquareDecimeters:"square-decimeters",esriSquareFeet:"square-feet",esriSquareInches:"square-inches",esriSquareKilometers:"square-kilometers",esriSquareMeters:"square-meters",esriSquareMiles:"square-miles",esriSquareMillimeters:"square-millimeters",esriSquareUsFeet:"square-us-feet",esriSquareYards:"square-yards"},me={esriCentimeters:"centimeters",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriYards:"yards"},fe={esriDUDecimalDegrees:"degrees",esriDURadians:"radians"},de=e()(le),Ue=e()(me),Be=e()(fe);export{L as adaptiveAreaUnit,H as adaptiveImperialAreaUnit,K as adaptiveImperialLengthUnit,A as adaptiveImperialVerticalLengthUnit,O as adaptiveLengthUnit,G as adaptiveMetricAreaUnit,J as adaptiveMetricLengthUnit,T as adaptiveMetricVerticalLengthUnit,F as adaptiveVerticalLengthUnit,Be as angleUnitsJSONMap,te as areaUnitFromSpatialReference,de as areaUnitsJSONMap,C as baseUnitForUnit,v as baseUnitForUnitType,E as convertFromSpatialReferenceUnit,I as convertToSpatialReferenceUnit,x as convertUnit,N as defaultAreaUnit,j as defaultLengthUnit,R as defaultVerticalLengthUnit,oe as getDefaultUnitSystem,X as getMetersPerCartesianUnitForSR,V as getMetersPerUnit,Q as getMetersPerUnitForSR,$ as getMetersPerVerticalUnitForSR,se as getUnitString,z as getVerticalUnitStringForSR,B as gradGcsIds,l as inchesPerMeter,P as isBaseUnit,S as isMeasurementSystem,re as isProjectedWKT,Y as lengthToDegrees,ie as lengthUnitFromSpatialReference,Ue as lengthUnitsJSONMap,g as measurementAreaUnits,w as measurementLengthUnits,W as unitFromRESTJSON,D as unitType,ne as verticalLengthUnitFromSpatialReference};
|
|
5
|
+
import"./has.js";import{strict as e}from"./jsonMap.js";import{getReferenceEllipsoid as s}from"../geometry/ellipsoidUtils.js";import{earth as i,mars as n,moon as t}from"../geometry/support/Ellipsoid.js";import{isGeographic as a,isEarth as r,isWKIDFromMars as c,isWKIDFromMoon as u}from"../geometry/support/spatialReferenceUtils.js";import o from"../geometry/support/WKIDUnitConversion.js";const l=39.37,m=i.radius*Math.PI/200,f=/(?:LENGTH)?UNIT\[([^\]]+)]]$/i,d=o,U=/UNIT\[([^\]]+)]/i,B=new Set([4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104025,104026,104139,104140]),_=e()({millimeter:"millimeters",centimeter:"centimeters",meter:"meters",meter_german:"german-meters",kilometer:"kilometers",decimeter:"decimeters",micrometer:"micrometers",nanometer:"nanometers","50_kilometers":"50-kilometers","150_kilometers":"150-kilometers",foot:"feet",foot_us:"us-feet",foot_clarke:"clarke-feet",fathom:"fathoms",nautical_mile:"nautical-miles",chain_us:"us-chains",link_us:"us-links",mile_us:"us-miles",yard_clarke:"clarke-yards",chain_clarke:"clarke-chains",link_clarke:"clarke-links",yard_sears:"sears-yards",foot_sears:"sears-feet",chain_sears:"sears-chains",link_sears:"sears-links",yard_benoit_1895_a:"benoit-1895-a-yards",foot_benoit_1895_a:"benoit-1895-a-feet",chain_benoit_1895_a:"benoit-1895-a-chains",link_benoit_1895_a:"benoit-1895-a-links",yard_benoit_1895_b:"benoit-1895-b-yards",foot_benoit_1895_b:"benoit-1895-b-feet",chain_benoit_1895_b:"benoit-1895-b-chains",link_benoit_1895_b:"benoit-1895-b-links",foot_1865:"1865-feet",foot_indian:"indian-feet",foot_indian_1937:"indian-1937-feet",foot_indian_1962:"indian-1962-feet",foot_indian_1975:"indian-1975-feet",yard_indian:"indian-yards",yard_indian_1937:"indian-1937-yards",yard_indian_1962:"indian-1962-yards",yard_indian_1975:"indian-1975-yards",statute_mile:"statute-miles",foot_gold_coast:"gold-coast-feet",foot_british_1936:"british-1936-feet",yard:"yards",chain:"chains",link:"links",yard_sears_1922_truncated:"sears-1922-truncated-yards",foot_sears_1922_truncated:"sears-1922-truncated-feet",chain_sears_1922_truncated:"sears-1922-truncated-chains",link_sears_1922_truncated:"sears-1922-truncated-links",yard_us:"us-yards",inch:"inches",inch_us:"us-inches",rod:"rods",rod_us:"us-rods",nautical_mile_us:"us-nautical-miles",nautical_mile_uk:"uk-nautical-miles",smoot:"smoots",vara_tx:"tx-vara",point:"points"}),h=e=>e*e,b=e=>e*e*e,k={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},meters:{inBaseUnits:1},feet:{inBaseUnits:.3048},"us-feet":{inBaseUnits:.3048006096012192},"clarke-feet":{inBaseUnits:.3047972654},fathoms:{inBaseUnits:1.8288},"nautical-miles":{inBaseUnits:1852},"german-meters":{inBaseUnits:1.0000135965},"us-chains":{inBaseUnits:20.11684023368047},"us-links":{inBaseUnits:.2011684023368047},"us-miles":{inBaseUnits:1609.347218694438},kilometers:{inBaseUnits:1e3},"clarke-yards":{inBaseUnits:.9143917962},"clarke-chains":{inBaseUnits:20.1166195164},"clarke-links":{inBaseUnits:.201166195164},"sears-yards":{inBaseUnits:.9143984146160287},"sears-feet":{inBaseUnits:.3047994715386762},"sears-chains":{inBaseUnits:20.11676512155263},"sears-links":{inBaseUnits:.2011676512155263},"benoit-1895-a-yards":{inBaseUnits:.9143992},"benoit-1895-a-feet":{inBaseUnits:.3047997333333333},"benoit-1895-a-chains":{inBaseUnits:20.1167824},"benoit-1895-a-links":{inBaseUnits:.201167824},"benoit-1895-b-yards":{inBaseUnits:.9143992042898124},"benoit-1895-b-feet":{inBaseUnits:.3047997347632708},"benoit-1895-b-chains":{inBaseUnits:20.11678249437587},"benoit-1895-b-links":{inBaseUnits:.2011678249437587},"1865-feet":{inBaseUnits:.3048008333333334},"indian-feet":{inBaseUnits:.3047995102481469},"indian-1937-feet":{inBaseUnits:.30479841},"indian-1962-feet":{inBaseUnits:.3047996},"indian-1975-feet":{inBaseUnits:.3047995},"indian-yards":{inBaseUnits:.9143985307444408},"indian-1937-yards":{inBaseUnits:.91439523},"indian-1962-yards":{inBaseUnits:.9143988},"indian-1975-yards":{inBaseUnits:.9143985},miles:{inBaseUnits:1609.344},"statute-miles":{inBaseUnits:1609.344},"gold-coast-feet":{inBaseUnits:.3047997101815088},"british-1936-feet":{inBaseUnits:.3048007491},yards:{inBaseUnits:.9144},chains:{inBaseUnits:20.1168},links:{inBaseUnits:.201168},"sears-1922-truncated-yards":{inBaseUnits:.914398},"sears-1922-truncated-feet":{inBaseUnits:.3047993333333334},"sears-1922-truncated-chains":{inBaseUnits:20.116756},"sears-1922-truncated-links":{inBaseUnits:.20116756},"us-yards":{inBaseUnits:.9144018288036576},decimeters:{inBaseUnits:.1},inches:{inBaseUnits:.0254},"us-inches":{inBaseUnits:.0254000508001016},rods:{inBaseUnits:5.0292},"us-rods":{inBaseUnits:5.029210058420118},"us-nautical-miles":{inBaseUnits:1853.248},"uk-nautical-miles":{inBaseUnits:1853.184},smoots:{inBaseUnits:1.7018},"tx-vara":{inBaseUnits:.8466683600033867},points:{inBaseUnits:.0003527777777777778},micrometers:{inBaseUnits:1e-6},nanometers:{inBaseUnits:1e-9},"50-kilometers":{inBaseUnits:5e4},"150-kilometers":{inBaseUnits:15e4}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:h(.001)},"square-centimeters":{inBaseUnits:h(.01)},"square-decimeters":{inBaseUnits:h(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:h(1e3)},"square-inches":{inBaseUnits:h(.0254)},"square-feet":{inBaseUnits:h(.3048)},"square-yards":{inBaseUnits:h(.9144)},"square-miles":{inBaseUnits:h(1609.344)},"square-nautical-miles":{inBaseUnits:h(1852)},"square-us-feet":{inBaseUnits:h(1200/3937)},acres:{inBaseUnits:.0015625*h(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*b(.001)},"cubic-centimeters":{inBaseUnits:1e3*b(.01)},"cubic-decimeters":{inBaseUnits:1e3*b(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*b(1e3)},"cubic-inches":{inBaseUnits:1e3*b(.0254)},"cubic-feet":{inBaseUnits:1e3*b(.3048)},"cubic-yards":{inBaseUnits:1e3*b(.9144)},"cubic-miles":{inBaseUnits:1e3*b(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},y=(()=>{const e={};for(const s in k)for(const i in k[s].units)e[i]=s;return e})();function q(e,s,i){return e*k[i].units[s].inBaseUnits}function p(e,s,i){return e/k[i].units[s].inBaseUnits}const g=["inches","feet","yards","miles","nautical-miles","us-feet","millimeters","centimeters","decimeters","meters","kilometers"],w=["square-inches","square-feet","square-yards","square-miles","square-nautical-miles","square-us-feet","square-millimeters","square-centimeters","square-decimeters","square-meters","square-kilometers","acres","ares","hectares"],M=["metric","imperial"],S=[...M,...w],D=[...M,...g],v=new Map([["meters","square-meters"],["feet","square-feet"],["us-feet","square-us-feet"]]);function C(e){return"imperial"===e||"metric"===e}function P(e){const s=y[e];if(!s)throw new Error("unknown type");return s}function x(e){return k[e].baseUnit}function E(e){return x(P(e))}function I(e,s=null){return s=s||P(e),k[s].baseUnit===e}function j(e,s,i){if(s===i)return e;const n=P(s);if(n!==P(i))throw new Error("incompatible units");const t=I(s,n)?e:q(e,s,n);return I(i,n)?t:p(t,i,n)}function R(e,s,i,n=!1){if(!n&&a(s))throw new Error("Unable to convert from an angular unit to a linear unit.");const t=te(s);return t!==i&&(e=t?j(e,t,i):j(e*=Z(s),"meters",i)),e}function N(e,s,i,n=!1){if(!n&&a(i))throw new Error("Unable to convert from a linear unit to an angular unit.");const t=te(i);return s!==t&&(e=t?j(e,s,t):j(e,s,"meters")/Z(i)),e}function O(e){switch(e){case"metric":return"meters";case"imperial":return"feet";default:return e}}function F(e){return O(e)}function J(e){switch(e){case"metric":return"square-meters";case"imperial":return"square-feet";default:return e}}function T(e,s,i){switch(i){case"metric":return A(e,s);case"imperial":return H(e,s);default:return i}}function K(e,s,i){switch(i){case"metric":return G(e,s);case"imperial":return L(e,s);default:return i}}function A(e,s){const i=j(e,s,"meters");return Math.abs(i)<3e3?"meters":"kilometers"}function G(e,s){const i=j(e,s,"meters");return Math.abs(i)<1e5?"meters":"kilometers"}function H(e,s){const i=j(e,s,"feet");return Math.abs(i)<1e3?"feet":"miles"}function L(e,s){const i=j(e,s,"feet");return Math.abs(i)<1e5?"feet":"miles"}function Y(e,s){const i=j(e,s,"square-meters");return Math.abs(i)<3e6?"square-meters":"square-kilometers"}function W(e,s){const i=j(e,s,"square-feet");return Math.abs(i)<1e6?"square-feet":"square-miles"}function $(e,s,i){switch(i){case"metric":return Y(e,s);case"imperial":return W(e,s);default:return i}}function z(e,s,i){return j(e,s,"meters")/(i*Math.PI/180)}function Q(e){return _.fromJSON(e.toLowerCase())||null}function V(e){if(null!=e&&!r(e))return 1;const s=Z(e);return s>1e5?1:s}function X(e){return Z(e)>=s(e).metersPerDegree?"meters":te(e)}function Z(e,s=i.metersPerDegree){return ee(e,!0)??s}function ee(e,s=!1){const i=e?.wkid??null,a=e?.wkt2??e?.wkt??null;let r=null;if(i){if(c(i))return n.metersPerDegree;if(u(i))return t.metersPerDegree;r=d.values[d[i]],!r&&s&&B.has(i)&&(r=m)}else a&&(oe(a)?r=ie(f.exec(a),r):ue(a)&&(r=ie(U.exec(a),r)));return r}function se(e){return a(e)?1:Z(e)}function ie(e,s){return e?.[1]?ne(e[1]):s}function ne(e){return parseFloat(e.split(",")[1])}function te(e){const s=e?.wkid??null,i=e?.wkt2??e?.wkt??null;let n=null;if(s)n=d.units[d[s]];else if(i){const e=oe(i)?f:ue(i)?U:null;if(e){const s=e.exec(i);s?.[1]&&(n=me(s[1]))}}return null!=n?Q(n):null}function ae(e){const s=te(e);return null!=s&&D.includes(s)?s:null}function re(e){const s=X(e);return null!=s&&D.includes(s)?s:null}function ce(e){const s=te(e);return null==s?null:v.get(s)}function ue(e){return/^GEOCCS/i.test(e)}function oe(e){return/^\s*(?:PROJCS|PROJCRS|PROJECTEDCRS)/i.test(e)}const le=1e-7;function me(e){const s=/[\\"']{1}([^\\"']+)/.exec(e);let i=s?.[1];if(!i||!Q(i)){const s=ne(e);i=null;const n=d.values;for(let e=0;e<n.length;++e)if(Math.abs(s-n[e])<le){i=d.units[e];break}}return i}function fe(e){const s=te(e);if(null==s)return null;switch(s){case"feet":case"us-feet":case"clarke-feet":case"fathoms":case"nautical-miles":case"us-chains":case"us-links":case"us-miles":case"clarke-yards":case"clarke-chains":case"clarke-links":case"sears-yards":case"sears-feet":case"sears-chains":case"sears-links":case"benoit-1895-a-yards":case"benoit-1895-a-feet":case"benoit-1895-a-chains":case"benoit-1895-a-links":case"benoit-1895-b-yards":case"benoit-1895-b-feet":case"benoit-1895-b-chains":case"benoit-1895-b-links":case"1865-feet":case"indian-feet":case"indian-1937-feet":case"indian-1962-feet":case"indian-1975-feet":case"indian-yards":case"indian-1937-yards":case"indian-1962-yards":case"indian-1975-yards":case"statute-miles":case"gold-coast-feet":case"british-1936-feet":case"yards":case"chains":case"links":case"sears-1922-truncated-yards":case"sears-1922-truncated-feet":case"sears-1922-truncated-chains":case"sears-1922-truncated-links":case"us-yards":case"inches":case"us-inches":case"rods":case"us-rods":case"us-nautical-miles":case"uk-nautical-miles":case"smoots":case"tx-vara":case"points":return"imperial";case"millimeters":case"centimeters":case"meters":case"german-meters":case"kilometers":case"decimeters":case"micrometers":case"nanometers":case"50-kilometers":case"150-kilometers":return"metric"}return null}const de={esriAcres:"acres",esriAres:"ares",esriHectares:"hectares",esriSquareCentimeters:"square-centimeters",esriSquareDecimeters:"square-decimeters",esriSquareFeet:"square-feet",esriSquareInches:"square-inches",esriSquareKilometers:"square-kilometers",esriSquareMeters:"square-meters",esriSquareMiles:"square-miles",esriSquareMillimeters:"square-millimeters",esriSquareUsFeet:"square-us-feet",esriSquareYards:"square-yards"},Ue={esriCentimeters:"centimeters",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriYards:"yards"},Be={esriDUDecimalDegrees:"degrees",esriDURadians:"radians"},_e=e()(de),he=e()(Ue),be=e()(Be);export{$ as adaptiveAreaUnit,W as adaptiveImperialAreaUnit,H as adaptiveImperialLengthUnit,L as adaptiveImperialVerticalLengthUnit,T as adaptiveLengthUnit,Y as adaptiveMetricAreaUnit,A as adaptiveMetricLengthUnit,G as adaptiveMetricVerticalLengthUnit,K as adaptiveVerticalLengthUnit,be as angleUnitsJSONMap,ce as areaUnitFromSpatialReference,_e as areaUnitsJSONMap,E as baseUnitForUnit,x as baseUnitForUnitType,R as convertFromSpatialReferenceUnit,N as convertToSpatialReferenceUnit,j as convertUnit,J as defaultAreaUnit,O as defaultLengthUnit,F as defaultVerticalLengthUnit,fe as getDefaultUnitSystem,se as getMetersPerCartesianUnitForSR,ee as getMetersPerUnit,Z as getMetersPerUnitForSR,V as getMetersPerVerticalUnitForSR,te as getUnitString,X as getVerticalUnitStringForSR,B as gradGcsIds,l as inchesPerMeter,I as isBaseUnit,C as isMeasurementSystem,oe as isProjectedWKT,z as lengthToDegrees,ae as lengthUnitFromSpatialReference,he as lengthUnitsJSONMap,S as measurementAreaUnits,D as measurementLengthUnits,Q as unitFromRESTJSON,P as unitType,re as verticalLengthUnitFromSpatialReference};
|
|
@@ -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{nativeArrayMaxSize as r}from"../../core/typedArrayUtil.js";import{makeFloat16Array as
|
|
5
|
+
import{nativeArrayMaxSize as r}from"../../core/typedArrayUtil.js";import{hasNativeFloat16Array as t,makeFloat16Array as a}from"./float16.js";function n(n,e=!1){return n<=r?e?new Array(n).fill(0):new Array(n):t?a(n):new Float32Array(n)}function e(n){return Array.isArray(n)?n.length<r?n:t?a(n):new Float32Array(n):n.length<r?Array.from(n):n}function o(r,t,a){return Array.isArray(r)?r.slice(t,t+a):r.subarray(t,t+a)}export{e as compactHalfFloatArray,o as halfFloatSubArray,n as newHalfFloatArray};
|
|
@@ -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
|
-
let r;function t(...t){if(!r)throw
|
|
5
|
+
let r;function t(...t){if(!r)throw i();return new r(...t)}function o(){if(!r)throw i();return r}const a=!!globalThis.Float16Array;async function n(){r=globalThis.Float16Array??(await import("@petamoriken/float16")).Float16Array}const i=()=>new Error("Float16Array is not available.");export{o as getFloat16ArrayConstructor,a as hasNativeFloat16Array,n as loadFloat16ArrayConstructor,t as makeFloat16Array};
|
package/interfaces.d.ts
CHANGED
|
@@ -83228,18 +83228,6 @@ declare namespace __esri {
|
|
|
83228
83228
|
signal?: AbortSignal | nullish;
|
|
83229
83229
|
}
|
|
83230
83230
|
|
|
83231
|
-
/**
|
|
83232
|
-
* The result returned from the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-statistics-histogram.html#histogram histogram()} method.
|
|
83233
|
-
*
|
|
83234
|
-
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-statistics-histogram.html#HistogramResult Read more...}
|
|
83235
|
-
*/
|
|
83236
|
-
export interface HistogramResult {
|
|
83237
|
-
bins: Bin[];
|
|
83238
|
-
minValue?: number | nullish;
|
|
83239
|
-
maxValue?: number | nullish;
|
|
83240
|
-
normalizationTotal?: number | nullish;
|
|
83241
|
-
}
|
|
83242
|
-
|
|
83243
83231
|
/**
|
|
83244
83232
|
* Function for generating category statistics for a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-renderers-predominance.html predominance}
|
|
83245
83233
|
* renderer.
|
|
@@ -83602,6 +83590,59 @@ declare namespace __esri {
|
|
|
83602
83590
|
valueExpression: string;
|
|
83603
83591
|
}
|
|
83604
83592
|
|
|
83593
|
+
/**
|
|
83594
|
+
* A module for importing types used in smart mapping statistics modules.
|
|
83595
|
+
*
|
|
83596
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-statistics-types.html Read more...}
|
|
83597
|
+
*/
|
|
83598
|
+
namespace types {
|
|
83599
|
+
/**
|
|
83600
|
+
* Represents the bin of a histogram.
|
|
83601
|
+
*
|
|
83602
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-statistics-types.html#HistogramBin Read more...}
|
|
83603
|
+
*/
|
|
83604
|
+
export interface HistogramBin {
|
|
83605
|
+
count: number;
|
|
83606
|
+
minValue: number;
|
|
83607
|
+
maxValue: number;
|
|
83608
|
+
}
|
|
83609
|
+
|
|
83610
|
+
/**
|
|
83611
|
+
* The result returned from the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-statistics-types.html#histogram histogram()} method.
|
|
83612
|
+
*
|
|
83613
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-statistics-types.html#HistogramResult Read more...}
|
|
83614
|
+
*/
|
|
83615
|
+
export interface HistogramResult {
|
|
83616
|
+
bins: HistogramBin[];
|
|
83617
|
+
minValue?: number | nullish;
|
|
83618
|
+
maxValue?: number | nullish;
|
|
83619
|
+
normalizationTotal?: number | nullish;
|
|
83620
|
+
}
|
|
83621
|
+
}
|
|
83622
|
+
|
|
83623
|
+
/**
|
|
83624
|
+
* Represents the bin of a histogram.
|
|
83625
|
+
*
|
|
83626
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-statistics-types.html#HistogramBin Read more...}
|
|
83627
|
+
*/
|
|
83628
|
+
export interface HistogramBin {
|
|
83629
|
+
count: number;
|
|
83630
|
+
minValue: number;
|
|
83631
|
+
maxValue: number;
|
|
83632
|
+
}
|
|
83633
|
+
|
|
83634
|
+
/**
|
|
83635
|
+
* The result returned from the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-statistics-types.html#histogram histogram()} method.
|
|
83636
|
+
*
|
|
83637
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-statistics-types.html#HistogramResult Read more...}
|
|
83638
|
+
*/
|
|
83639
|
+
export interface HistogramResult {
|
|
83640
|
+
bins: HistogramBin[];
|
|
83641
|
+
minValue?: number | nullish;
|
|
83642
|
+
maxValue?: number | nullish;
|
|
83643
|
+
normalizationTotal?: number | nullish;
|
|
83644
|
+
}
|
|
83645
|
+
|
|
83605
83646
|
/**
|
|
83606
83647
|
* A function that queries for unique values from a field in a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html Layer}.
|
|
83607
83648
|
*
|
|
@@ -119427,7 +119468,7 @@ declare namespace __esri {
|
|
|
119427
119468
|
*
|
|
119428
119469
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Histogram.html#bins Read more...}
|
|
119429
119470
|
*/
|
|
119430
|
-
bins:
|
|
119471
|
+
bins: HistogramBin[] | nullish;
|
|
119431
119472
|
/**
|
|
119432
119473
|
* Function that fires each time a data line is created.
|
|
119433
119474
|
*
|
|
@@ -119531,7 +119572,7 @@ declare namespace __esri {
|
|
|
119531
119572
|
*
|
|
119532
119573
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Histogram.html#bins Read more...}
|
|
119533
119574
|
*/
|
|
119534
|
-
bins?:
|
|
119575
|
+
bins?: HistogramBin[] | nullish;
|
|
119535
119576
|
/**
|
|
119536
119577
|
* Function that fires each time a data line is created.
|
|
119537
119578
|
*
|
|
@@ -119607,7 +119648,7 @@ declare namespace __esri {
|
|
|
119607
119648
|
*
|
|
119608
119649
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Histogram-HistogramViewModel.html#bins Read more...}
|
|
119609
119650
|
*/
|
|
119610
|
-
bins:
|
|
119651
|
+
bins: HistogramBin[] | nullish;
|
|
119611
119652
|
/**
|
|
119612
119653
|
* A function used to format labels.
|
|
119613
119654
|
*
|
|
@@ -119658,7 +119699,7 @@ declare namespace __esri {
|
|
|
119658
119699
|
*
|
|
119659
119700
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Histogram-HistogramViewModel.html#bins Read more...}
|
|
119660
119701
|
*/
|
|
119661
|
-
bins?:
|
|
119702
|
+
bins?: HistogramBin[] | nullish;
|
|
119662
119703
|
/**
|
|
119663
119704
|
* A function used to format labels.
|
|
119664
119705
|
*
|
|
@@ -119719,7 +119760,7 @@ declare namespace __esri {
|
|
|
119719
119760
|
*
|
|
119720
119761
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-HistogramRangeSlider.html#bins Read more...}
|
|
119721
119762
|
*/
|
|
119722
|
-
bins:
|
|
119763
|
+
bins: HistogramBin[] | nullish;
|
|
119723
119764
|
/**
|
|
119724
119765
|
* Function that fires each time a data line is created.
|
|
119725
119766
|
*
|
|
@@ -119875,7 +119916,7 @@ declare namespace __esri {
|
|
|
119875
119916
|
*
|
|
119876
119917
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-HistogramRangeSlider.html#bins Read more...}
|
|
119877
119918
|
*/
|
|
119878
|
-
bins?:
|
|
119919
|
+
bins?: HistogramBin[] | nullish;
|
|
119879
119920
|
/**
|
|
119880
119921
|
* Function that fires each time a data line is created.
|
|
119881
119922
|
*
|
|
@@ -119991,7 +120032,7 @@ declare namespace __esri {
|
|
|
119991
120032
|
*
|
|
119992
120033
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-HistogramRangeSlider-HistogramRangeSliderViewModel.html#bins Read more...}
|
|
119993
120034
|
*/
|
|
119994
|
-
bins:
|
|
120035
|
+
bins: HistogramBin[] | nullish;
|
|
119995
120036
|
/**
|
|
119996
120037
|
* A modified version of
|
|
119997
120038
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slider-SliderViewModel.html#labelFormatFunction SliderViewModel.labelFormatFunction},
|
|
@@ -120052,7 +120093,7 @@ declare namespace __esri {
|
|
|
120052
120093
|
*
|
|
120053
120094
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-HistogramRangeSlider-HistogramRangeSliderViewModel.html#bins Read more...}
|
|
120054
120095
|
*/
|
|
120055
|
-
bins?:
|
|
120096
|
+
bins?: HistogramBin[] | nullish;
|
|
120056
120097
|
/**
|
|
120057
120098
|
* A modified version of
|
|
120058
120099
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slider-SliderViewModel.html#labelFormatFunction SliderViewModel.labelFormatFunction},
|
|
@@ -131314,7 +131355,7 @@ declare namespace __esri {
|
|
|
131314
131355
|
export interface HistogramConfig {
|
|
131315
131356
|
average?: number;
|
|
131316
131357
|
barCreatedFunction?: BarCreatedFunction;
|
|
131317
|
-
bins?:
|
|
131358
|
+
bins?: HistogramBin[];
|
|
131318
131359
|
dataLines?: HistogramConfigDataLines[];
|
|
131319
131360
|
dataLineCreatedFunction?: DataLineCreatedFunction;
|
|
131320
131361
|
standardDeviation?: number;
|
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
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const b="20250405",f="4d15bbe6b49fa5448fb1c7656fd720ef3894c14d";export{b as buildDate,f as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import r from"../core/Error.js";import s from"../core/JSONSupport.js";import i from"../core/Loadable.js";import n from"../core/Logger.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";let c=class extends(s.JSONSupportMixin(i)){constructor(e){super(e),this.versionManagementService=null,this.featureServiceUrl=null,this.url=null,this.currentVersion=null,this.currentVersionInfo=null,this.versionInfos=[],this.versionableItems=new t,this.usePersistentReadSessions=!1,this.state="lock-none"}initialize(){this.url=this.versionManagementService.url,this.featureServiceUrl=this.url.replace(/\/VersionManagementServer/i,"/FeatureServer"),this.addHandles([this.versionableItems.on("before-add",(e=>{if(e.item.featureServiceUrl.toLowerCase()!==this.featureServiceUrl.toLowerCase())return e.preventDefault(),void n.getLogger(this).error("#add()","Cannot add versionAdapter, feature service urls do not match.")})),this.versionableItems.on("before-remove",(e=>{if(0===this.versionableItems.items.length&&this.currentVersion&&"name"in this.currentVersion&&"none"!==this.versionManagementService.getLockType(this.currentVersion))return e.preventDefault(),void n.getLogger(this).error("#remove()","Cannot remove last versionAdapter.")}))])}load(e){return this.addResolvingPromise(this._setUpState(e)),Promise.resolve(this)}get defaultVersionIdentifier(){return this.versionManagementService.defaultVersionIdentifier}get isDefault(){return!this.currentVersion||!!this.currentVersion&&"name"in this.currentVersion&&this.currentVersion.name===this.defaultVersionIdentifier.name}async getVersionInfos(e=!1){return e&&(this.versionInfos=await this.versionManagementService.getVersionInfos()),this.versionInfos}async alterVersion(e,t){if(this.currentVersion&&"guid"in this.currentVersion&&e.guid===this.currentVersion.guid)return!1;const r=await this.versionManagementService.alterVersion(e,t);return r&&await this.getVersionInfos(!0),r}async deleteVersion(e){if(this.currentVersion&&"guid"in this.currentVersion&&e.guid===this.currentVersion.guid)return!1;const t=await this.versionManagementService.deleteVersion(e);return t&&await this.getVersionInfos(!0),t}async getVersionInfoExtended(){return this.currentVersion&&"name"in this.currentVersion?this.versionManagementService.getVersionInfoExtended(this.currentVersion):this.versionManagementService.getVersionInfoExtended(this.defaultVersionIdentifier)}async startEditing(){if(this._isDefaultOrHistoricVersion())return{success:!1};if(!this.usePersistentReadSessions){const e=await this.versionManagementService.startReadingWithResult(this.currentVersion);if(!e.success)return e;this.state="lock-read"}const e=await this.versionManagementService.startEditingWithResult(this.currentVersion);return e.success&&(this.state="lock-write"),e}async stopEditing(e){if(this._isDefaultOrHistoricVersion())return{success:!1};const t=await this.versionManagementService.stopEditingWithResult(this.currentVersion,e);if(!t.success)return t;if(this.state="lock-read",!this.usePersistentReadSessions){const e=await this.versionManagementService.stopReadingWithResult(this.currentVersion);return e.success&&(this.state="lock-none"),e}return t}async changeVersion(e){let t=null;if(this.usePersistentReadSessions){if(this._isDefaultOrHistoricVersion(e))e&&"name"in e?(t=await this.versionManagementService.getVersionInfoExtended(e),this.state="public"===t?.access?"lock-none":"lock-read"):this.state="lock-read";else if(!await this.versionManagementService.startReading(e))throw new r("
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import r from"../core/Error.js";import s from"../core/JSONSupport.js";import i from"../core/Loadable.js";import n from"../core/Logger.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";let c=class extends(s.JSONSupportMixin(i)){constructor(e){super(e),this.versionManagementService=null,this.featureServiceUrl=null,this.url=null,this.currentVersion=null,this.currentVersionInfo=null,this.versionInfos=[],this.versionableItems=new t,this.usePersistentReadSessions=!1,this.state="lock-none"}initialize(){this.url=this.versionManagementService.url,this.featureServiceUrl=this.url.replace(/\/VersionManagementServer/i,"/FeatureServer"),this.addHandles([this.versionableItems.on("before-add",(e=>{if(e.item.featureServiceUrl.toLowerCase()!==this.featureServiceUrl.toLowerCase())return e.preventDefault(),void n.getLogger(this).error("#add()","Cannot add versionAdapter, feature service urls do not match.")})),this.versionableItems.on("before-remove",(e=>{if(0===this.versionableItems.items.length&&this.currentVersion&&"name"in this.currentVersion&&"none"!==this.versionManagementService.getLockType(this.currentVersion))return e.preventDefault(),void n.getLogger(this).error("#remove()","Cannot remove last versionAdapter.")}))])}load(e){return this.addResolvingPromise(this._setUpState(e)),Promise.resolve(this)}get defaultVersionIdentifier(){return this.versionManagementService.defaultVersionIdentifier}get isDefault(){return!this.currentVersion||!!this.currentVersion&&"name"in this.currentVersion&&this.currentVersion.name===this.defaultVersionIdentifier.name}async getVersionInfos(e=!1){return e&&(this.versionInfos=await this.versionManagementService.getVersionInfos()),this.versionInfos}async alterVersion(e,t){if(this.currentVersion&&"guid"in this.currentVersion&&e.guid===this.currentVersion.guid)return!1;const r=await this.versionManagementService.alterVersion(e,t);return r&&await this.getVersionInfos(!0),r}async deleteVersion(e){if(this.currentVersion&&"guid"in this.currentVersion&&e.guid===this.currentVersion.guid)return!1;const t=await this.versionManagementService.deleteVersion(e);return t&&await this.getVersionInfos(!0),t}async getVersionInfoExtended(){return this.currentVersion&&"name"in this.currentVersion?this.versionManagementService.getVersionInfoExtended(this.currentVersion):this.versionManagementService.getVersionInfoExtended(this.defaultVersionIdentifier)}async startEditing(){if(this._isDefaultOrHistoricVersion())return{success:!1};if(!this.usePersistentReadSessions){const e=await this.versionManagementService.startReadingWithResult(this.currentVersion);if(!e.success)return e;this.state="lock-read"}const e=await this.versionManagementService.startEditingWithResult(this.currentVersion);return e.success&&(this.state="lock-write"),e}async stopEditing(e){if(this._isDefaultOrHistoricVersion())return{success:!1};const t=await this.versionManagementService.stopEditingWithResult(this.currentVersion,e);if(!t.success)return t;if(this.state="lock-read",!this.usePersistentReadSessions){const e=await this.versionManagementService.stopReadingWithResult(this.currentVersion);return e.success&&(this.state="lock-none"),e}return t}async changeVersion(e){let t=null;if(this.usePersistentReadSessions){if(this._isDefaultOrHistoricVersion(e))e&&"name"in e?(t=await this.versionManagementService.getVersionInfoExtended(e),this.state="public"===t?.access?"lock-none":"lock-read"):this.state="lock-read";else if(!await this.versionManagementService.startReading(e))throw new r("versioning:failed-lock","Failed to acquire read lock for version: "+e);this._isDefaultOrHistoricVersion(this.currentVersion)||await this.versionManagementService.stopReading(this.currentVersion)}const s=await this.versionManagementService.changeVersionWithResult(this.versionableItems,this.currentVersion,e);let i=!1;return s.forEach(((e,t)=>{i=i||e.success})),i&&(this.currentVersion=e,this.currentVersionInfo=t||await this.getVersionInfoExtended(),this._isDefaultOrHistoricVersion()?this.currentVersion&&"name"in this.currentVersion?this.state="public"===this.currentVersionInfo?.access?"lock-none":"lock-read":this.state="lock-read":this.state="read"!==this.versionManagementService.getLockType(this.currentVersion)?"lock-none":"lock-read"),s}async undo(){return this._isDefaultOrHistoricVersion()?{success:!1}:(this.versionManagementService.undo(this.currentVersion),{success:!0})}async redo(){return this._isDefaultOrHistoricVersion()?{success:!1}:(this.versionManagementService.redo(this.currentVersion),{success:!0})}async _setUpState(e){await this.versionManagementService.load(e),this.state="lock-none",this.currentVersionInfo=await this.getVersionInfoExtended(),this.versionableItems.forEach((e=>{this.currentVersion?"name"in this.currentVersion?(e.gdbVersion=this.currentVersion.name,e.historicMoment=null):(e.historicMoment=this.currentVersion,e.gdbVersion=null):(e.gdbVersion=null,e.historicMoment=null)})),this.usePersistentReadSessions&&(this._isDefaultOrHistoricVersion()?this.currentVersion&&"name"in this.currentVersion?this.state="public"===this.currentVersionInfo?.access?"lock-none":"lock-read":this.state="lock-read":await this.versionManagementService.startReading(this.currentVersion)&&(this.state="lock-read"))}_isDefaultOrHistoricVersion(e=this.currentVersion){return!(e&&"name"in e)||e.name===this.versionManagementService.defaultVersionIdentifier.name}};e([o()],c.prototype,"versionManagementService",void 0),e([o()],c.prototype,"featureServiceUrl",void 0),e([o()],c.prototype,"url",void 0),e([o()],c.prototype,"currentVersion",void 0),e([o()],c.prototype,"currentVersionInfo",void 0),e([o()],c.prototype,"versionInfos",void 0),e([o()],c.prototype,"versionableItems",void 0),e([o()],c.prototype,"usePersistentReadSessions",void 0),e([o()],c.prototype,"state",void 0),e([o({readOnly:!0})],c.prototype,"defaultVersionIdentifier",null),e([o({readOnly:!0})],c.prototype,"isDefault",null),c=e([a("esri.versionManagement.VersioningState")],c);const u=c;export{u 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 e from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{e as t}from"../../../../chunks/earcut.js";import{set as
|
|
5
|
+
import e from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{e as t}from"../../../../chunks/earcut.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{convertFromNestedArray as s,convertFromPolygon as i}from"../../../../layers/graphics/featureConversionUtils.js";import c from"../../../../layers/graphics/OptimizedGeometry.js";import{i1616to32 as a}from"./number.js";import{BufferObject as f}from"../../../webgl/BufferObject.js";import{PrimitiveType as m,Usage as h}from"../../../webgl/enums.js";const l=(e,r,t,o)=>{let n=0;for(let s=1;s<t;s++){const t=e[2*(r+s-1)],o=e[2*(r+s-1)+1];n+=(e[2*(r+s)]-t)*(e[2*(r+s)+1]+o)}return o?n>0:n<0},u=({coords:e,lengths:r},o)=>{const n=[];for(let s=0,i=0;s<r.length;i+=r[s],s+=1){const c=i,a=[];for(;s<r.length-1&&l(e,i+r[s],r[s+1],o);s+=1,i+=r[s])a.push(i+r[s]-c);const f=e.slice(2*c,2*(i+r[s])),m=t(f,a,2);for(const e of m)n.push(e+c)}return n};class y{constructor(e,r,t,o=!1){this._cache={},this.vertices=e,this.indices=r,this.primitiveType=t,this.isMapSpace=o}static fromPath(e){const r=s(new c,e.path,!1,!1),t=r.coords,o=new Uint32Array(u(r,!0)),n=new Uint32Array(t.length/2);for(let s=0;s<n.length;s++)n[s]=a(Math.floor(t[2*s]),Math.floor(t[2*s+1]));return new y({geometry:n},o,m.TRIANGLES)}static fromGeometry(t,o){const n=o.geometry?.type;switch(n){case"polygon":return y.fromPolygon(t,o.geometry);case"extent":return y.fromMapExtent(t,o.geometry);default:return r.getLogger("esri.views.2d.engine.webgl.Mesh2D").error(new e("mapview-bad-type",`Unable to create a mesh from type ${n}`,o)),y.fromScreenExtent({xmin:0,ymin:0,xmax:1,ymax:1})}}static fromPolygon(e,r){const t=i(new c,r,!1,!1),s=t.coords,f=new Uint32Array(u(t,!1)),h=new Uint32Array(s.length/2),l=n(),x=n();for(let n=0;n<h.length;n++)o(l,s[2*n],s[2*n+1]),e.toScreen(x,l),h[n]=a(Math.floor(x[0]),Math.floor(x[1]));return new y({geometry:h},f,m.TRIANGLES,!0)}static fromScreenExtent({xmin:e,xmax:r,ymin:t,ymax:o}){const n={geometry:new Uint32Array([a(e,t),a(r,t),a(e,o),a(e,o),a(r,t),a(r,o)])},s=new Uint32Array([0,1,2,3,4,5]);return new y(n,s,m.TRIANGLES)}static fromMapExtent(e,r){const[t,o]=e.toScreen([0,0],[r.xmin,r.ymin]),[n,s]=e.toScreen([0,0],[r.xmax,r.ymax]),i={geometry:new Uint32Array([a(t,o),a(n,o),a(t,s),a(t,s),a(n,o),a(n,s)])},c=new Uint32Array([0,1,2,3,4,5]);return new y(i,c,m.TRIANGLES)}destroy(){null!=this._cache.indexBuffer&&this._cache.indexBuffer.dispose(),this._cache.vertexBuffers?.forEach((e=>e?.dispose())),this._cache.indexBuffer=this._cache.vertexBuffers=null}getIndexBuffer(e,r=h.STATIC_DRAW){return this._cache.indexBuffer??=f.createIndex(e,r,this.indices),this._cache.indexBuffer}getVertexBuffers(e,r=h.STATIC_DRAW){return this._cache.vertexBuffers??=new Map(Object.keys(this.vertices).reduce(((t,o)=>(t.push([o,f.createVertex(e,r,this.vertices[o])]),t)),new Array)),this._cache.vertexBuffers}}export{y as default};
|