@arcgis/core 4.27.0-rc.0 → 4.27.0-rc.1
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/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/OrderBy.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0407bf97ad621c89a734.js +1 -0
- package/assets/esri/core/workers/chunks/0610691a0c0d9fbbd6d2.js +1 -0
- package/assets/esri/core/workers/chunks/{7ec6be2bc0f354011e46.js → 07651ef8348f702d59ac.js} +1 -1
- package/assets/esri/core/workers/chunks/0a02ac5628d1739372c6.js +1 -0
- package/assets/esri/core/workers/chunks/0a86c458916e83d6c523.js +1 -0
- package/assets/esri/core/workers/chunks/14145959a3dab1437818.js +1 -0
- package/assets/esri/core/workers/chunks/16db0bc87d87a7313dc4.js +1 -0
- package/assets/esri/core/workers/chunks/183e2e0cb86c1c640d94.js +1 -0
- package/assets/esri/core/workers/chunks/19d329b9d4ec2eff1d13.js +1 -0
- package/assets/esri/core/workers/chunks/1b8074269800b384ecf6.js +1 -0
- package/assets/esri/core/workers/chunks/2154d395f405be3cd3ba.js +1 -0
- package/assets/esri/core/workers/chunks/{33dbba3b7fc648437e50.js → 21e1f3b11e7d363b727a.js} +1 -1
- package/assets/esri/core/workers/chunks/{31a158c73994603c169d.js → 2446e336b1f7256d4fde.js} +1 -1
- package/assets/esri/core/workers/chunks/29290a44fd3b183c24e3.js +1 -0
- package/assets/esri/core/workers/chunks/{f498c4d4831141125781.js → 2f5639886f577baedbca.js} +1 -1
- package/assets/esri/core/workers/chunks/33901eb1574e46abd9af.js +1 -0
- package/assets/esri/core/workers/chunks/{9c78ad5ab57e0d47ac43.js → 3ba2fcb9110230f8790c.js} +1 -1
- package/assets/esri/core/workers/chunks/3e239bfad611985e50fb.js +1 -0
- package/assets/esri/core/workers/chunks/42f3421740a5479559dc.js +1 -0
- package/assets/esri/core/workers/chunks/474d9b334812533bab36.js +1 -0
- package/assets/esri/core/workers/chunks/53ad34bf32f5f3d4fe18.js +1 -0
- package/assets/esri/core/workers/chunks/{97cdbec7532cfcdf9ad2.js → 595a2baa04d92de59558.js} +1 -1
- package/assets/esri/core/workers/chunks/624521961fe1f2c4f2c5.js +1 -0
- package/assets/esri/core/workers/chunks/{212d59764c275c763941.js → 659b7bad7281c0e2aed3.js} +1 -1
- package/assets/esri/core/workers/chunks/6a3d611e8842afbb50ab.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/6e562fa57c0347091154.js +1 -0
- package/assets/esri/core/workers/chunks/7479dc0c790337af7597.js +1 -0
- package/assets/esri/core/workers/chunks/{e88cff2537be52da6531.js → 74fd2059ddda9083cbcc.js} +1 -1
- package/assets/esri/core/workers/chunks/7dc6774c77c822b68c99.js +1 -0
- package/assets/esri/core/workers/chunks/82a103a8b5382300889d.js +1 -0
- package/assets/esri/core/workers/chunks/{3fe357df92afa1bee70a.js → 90da1ed112b82712d0ef.js} +1 -1
- package/assets/esri/core/workers/chunks/{9849f64793f2ad39366b.js → 9290b0d330f02233d803.js} +1 -1
- package/assets/esri/core/workers/chunks/92e7f224a80195e606d6.js +1 -0
- package/assets/esri/core/workers/chunks/{36df72362b38759b895b.js → 9648a8f2b24f1ca3d637.js} +1 -1
- package/assets/esri/core/workers/chunks/{ad18fb7bb54a0c4bdb38.js → a20361b4d3bdd7d196ca.js} +1 -1
- package/assets/esri/core/workers/chunks/a7fd2a95fde197c06828.js +1 -0
- package/assets/esri/core/workers/chunks/b0cda39b53ecd6c44cd0.js +1 -0
- package/assets/esri/core/workers/chunks/b2a423d9ce8bb784267c.js +1 -0
- package/assets/esri/core/workers/chunks/b5fc6f2044ed047c5afd.js +1 -0
- package/assets/esri/core/workers/chunks/{df0453cdfe685d6436cc.js → b6dc41fce601b9d3480e.js} +1 -1
- package/assets/esri/core/workers/chunks/b8e6c64792a512df4c4d.js +1 -0
- package/assets/esri/core/workers/chunks/c6617a937440701c0180.js +1 -0
- package/assets/esri/core/workers/chunks/c6efe2e04ea6a55bb6e3.js +1 -0
- package/assets/esri/core/workers/chunks/d8607326a199dd994844.js +1 -0
- package/assets/esri/core/workers/chunks/d8bd3f498b3fa8153404.js +1 -0
- package/assets/esri/core/workers/chunks/{39e473586579d11d6732.js → e2432871f1329f47465d.js} +1 -1
- package/assets/esri/core/workers/chunks/ee5ee03dd2c7dc940272.js +1 -0
- package/assets/esri/core/workers/chunks/{c83669cf08391a62fb72.js → f1da7b29eecad0e9efae.js} +1 -1
- package/assets/esri/core/workers/chunks/{2e627c94e57c924e5917.js → f339db2b599fa9585283.js} +1 -1
- package/assets/esri/core/workers/chunks/f505ebd4bd3bfb6c790d.js +1 -0
- package/assets/esri/core/workers/chunks/{3c6c082157c916f8ddba.js → ffe61d5a6a9b34bee9d4.js} +1 -1
- package/assets/esri/themes/base/widgets/_Bookmarks.scss +5 -0
- package/assets/esri/themes/base/widgets/_Features.scss +5 -7
- package/assets/esri/themes/base/widgets/_Popup.scss +3 -3
- package/assets/esri/themes/base/widgets/_Swipe.scss +11 -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/chunks/SSAO.glsl.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/support/DoubleArray.js +1 -1
- package/geometry/support/meshUtils/bounds.js +5 -0
- package/geometry/support/meshUtils/georeference.js +1 -1
- package/interfaces.d.ts +2 -2
- package/kernel.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/attributeSupport.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/support/FeatureReductionBinning.js +1 -1
- package/layers/support/FeatureReductionCluster.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/rasterFunctions/colormaps.js +1 -1
- package/package.json +2 -2
- package/renderers/support/utils.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/effects/EffectBuffer.js +1 -1
- package/symbols/cim/effects/EffectDonut.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/views/2d/layers/features/Store2D.js +1 -1
- package/views/2d/layers/features/sources/StreamSource.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/webStyleUtils.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/materials/pbrUtils.js +5 -0
- package/webdoc/support/writeUtils.js +1 -1
- package/widgets/Bookmarks/css.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/Features.js +1 -1
- package/assets/esri/core/workers/chunks/0b03165dbf289797cefa.js +0 -1
- package/assets/esri/core/workers/chunks/0c1c0024879f944f44c4.js +0 -1
- package/assets/esri/core/workers/chunks/13a48796905613bc1679.js +0 -1
- package/assets/esri/core/workers/chunks/1ea1104651ab15f9a13c.js +0 -1
- package/assets/esri/core/workers/chunks/2108cfc7921430f0b805.js +0 -1
- package/assets/esri/core/workers/chunks/2eacca322737aafd8f0c.js +0 -1
- package/assets/esri/core/workers/chunks/39577683e334eb4d904c.js +0 -1
- package/assets/esri/core/workers/chunks/4d3deeb0ebd0ce8c1215.js +0 -1
- package/assets/esri/core/workers/chunks/576bddc3fa7d91a7e5bd.js +0 -1
- package/assets/esri/core/workers/chunks/623d6710a4f800c622ce.js +0 -1
- package/assets/esri/core/workers/chunks/6782cc3feb713676d544.js +0 -1
- package/assets/esri/core/workers/chunks/6e7178de0b2c3d2f7e6b.js +0 -1
- package/assets/esri/core/workers/chunks/78ce0b1af62435d8ebf4.js +0 -1
- package/assets/esri/core/workers/chunks/79d2baf392589588ef9b.js +0 -1
- package/assets/esri/core/workers/chunks/7bbdba52157da13a01fc.js +0 -1
- package/assets/esri/core/workers/chunks/84860b535a70ec448cfe.js +0 -1
- package/assets/esri/core/workers/chunks/9035d9e09a4e7cb94d37.js +0 -1
- package/assets/esri/core/workers/chunks/956b0fef7bc849415354.js +0 -1
- package/assets/esri/core/workers/chunks/9ab98321a4a7eaeeb018.js +0 -1
- package/assets/esri/core/workers/chunks/9cb7a68ff46e5c43e1d2.js +0 -1
- package/assets/esri/core/workers/chunks/a0f7f7f578521970c714.js +0 -1
- package/assets/esri/core/workers/chunks/a60eac45d3c65bd0216f.js +0 -1
- package/assets/esri/core/workers/chunks/aca5260f6984952a6e3d.js +0 -1
- package/assets/esri/core/workers/chunks/b05be356743fa5d24573.js +0 -1
- package/assets/esri/core/workers/chunks/ba6024465308c248170b.js +0 -1
- package/assets/esri/core/workers/chunks/d0983f808008920514f2.js +0 -1
- package/assets/esri/core/workers/chunks/dab832799bc06b0fec34.js +0 -1
- package/assets/esri/core/workers/chunks/e45d36aef2bc69ee9132.js +0 -1
- package/assets/esri/core/workers/chunks/e5bbd4cc5edbf7ab3624.js +0 -1
- package/assets/esri/core/workers/chunks/e700cf4d1f99291a4396.js +0 -1
- package/assets/esri/core/workers/chunks/f398a5cf33c3fd2522a5.js +0 -1
- package/assets/esri/core/workers/chunks/f4ee94a6cde4ea8837f1.js +0 -1
package/chunks/SSAO.glsl.js
CHANGED
|
@@ -86,4 +86,4 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
86
86
|
A = (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2;
|
|
87
87
|
fragColor = vec4(A);
|
|
88
88
|
}
|
|
89
|
-
`),r}function m(e){return Math.max(10,20*e.
|
|
89
|
+
`),r}function m(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const p=r(),v=Object.freeze(Object.defineProperty({__proto__:null,build:d,getRadius:m},Symbol.toStringTag,{value:"Module"}));export{v as S,d as b,m as g};
|
package/chunks/languageUtils.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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ArcadeFunction as e}from"../arcade/FunctionWrapper.js";import n from"../arcade/ImmutableArray.js";import t from"../arcade/ImmutablePathArray.js";import r from"../arcade/ImmutablePointArray.js";import{ArcadeDate as a,createDateTimeZone as i}from"../arcade/ArcadeDate.js";import o from"../geometry/Extent.js";import l from"../geometry/Geometry.js";import u from"../geometry/Multipoint.js";import s from"../geometry/Point.js";import f from"../geometry/Polygon.js";import c from"../geometry/Polyline.js";import{DateTime as d}from"luxon";import{format as m,parse as y}from"../core/number.js";import{isClockwise as p}from"../geometry/support/coordsUtils.js";import{getLocale as g}from"../intl/locale.js";import h from"../config.js";import{version as b}from"../kernel.js";import{esriFieldToJson as S,layerGeometryEsriRestConstants as x}from"../arcade/featureset/support/shared.js";import{ArcadeModule as N}from"../arcade/ArcadeModule.js";import{ArcadeExecutionError as M,ExecutionErrorCodes as k}from"../arcade/executionError.js";class j{constructor(e){this.value=e}}class A{constructor(e){this.value=e}}const T=A,D=j,F={type:"VOID"},C={type:"BREAK"},R={type:"CONTINUE"};function I(e,n,t){return""===n||null==n||n===t||n===t?e:e=e.split(n).join(t)}function O(n){return n instanceof e}function Z(e){return e instanceof N}function w(e){return!!L(e)||(!!J(e)||(!!B(e)||(!!Y(e)||(null===e||(e===F||"number"==typeof e)))))}function v(e,n){return void 0===e?n:e}function _(e){return null==e?"":z(e)||q(e)?"Array":B(e)?"Date":L(e)?"String":Y(e)?"Boolean":J(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":e instanceof N?"Module":E(e)?"Feature":e instanceof s?"Point":e instanceof f?"Polygon":e instanceof c?"Polyline":e instanceof u?"Multipoint":e instanceof o?"Extent":O(e)?"Function":V(e)?"FeatureSet":U(e)?"FeatureSetCollection":e===F?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognised Type"}function L(e){return"string"==typeof e||e instanceof String}function Y(e){return"boolean"==typeof e}function J(e){return"number"==typeof e}function P(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function G(e){return e instanceof l}function z(e){return e instanceof Array}function E(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function V(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function H(e){return"esri.arcade.Dictionary"===e?.declaredClass}function U(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function q(e){return e instanceof n}function B(e){return e instanceof a}function W(e){return null!=e&&"object"==typeof e}function $(e){return e instanceof Date}function Q(e,n,t,r,a){if(e.length<n||e.length>t)throw new M(r,k.WrongNumberOfParameters,a)}function X(e){return e<0?-Math.round(-e):Math.round(e)}function K(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,(n=>{const t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===n?t:3&t|8).toString(16)}))}function ee(e,n){return isNaN(e)||null==n||""===n?e.toString():(n=I(n,"‰",""),n=I(n,"¤",""),m(e,{pattern:n}))}function ne(e,n){return null==n||""===n?e.toISOString(!0):e.toFormat(te(n),{locale:g(),numberingSystem:"latn"})}function te(e){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let n="";const t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of e.match(t)||[])switch(r){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"Z":n+="ZZ";break;case"ZZ":n+="ZZZ";break;case"S":n+="'S'";break;case"SS":n+="'SS'";break;case"SSS":n+="u";break;case"A":case"a":n+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":n+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?n+=`'${r.slice(1,-1)}'`:n+=`'${r}'`}return n}function re(e,n,t){switch(t){case">":return e>n;case"<":return e<n;case">=":return e>=n;case"<=":return e<=n}return!1}function ae(e,n,t){if(null===e){if(null===n||n===F)return re(null,null,t);if(J(n))return re(0,n,t);if(L(n))return re(0,fe(n),t);if(Y(n))return re(0,fe(n),t);if(B(n))return re(0,n.toNumber(),t)}if(e===F){if(null===n||n===F)return re(null,null,t);if(J(n))return re(0,n,t);if(L(n))return re(0,fe(n),t);if(Y(n))return re(0,fe(n),t);if(B(n))return re(0,n.toNumber(),t)}else if(J(e)){if(J(n))return re(e,n,t);if(Y(n))return re(e,fe(n),t);if(null===n||n===F)return re(e,0,t);if(L(n))return re(e,fe(n),t);if(B(n))return re(e,n.toNumber(),t)}else if(L(e)){if(L(n))return re(oe(e),oe(n),t);if(B(n))return re(fe(e),n.toNumber(),t);if(J(n))return re(fe(e),n,t);if(null===n||n===F)return re(fe(e),0,t);if(Y(n))return re(fe(e),fe(n),t)}else if(B(e)){if(B(n))return re(e.toNumber(),n.toNumber(),t);if(null===n||n===F)return re(e.toNumber(),0,t);if(J(n))return re(e.toNumber(),n,t);if(Y(n))return re(e.toNumber(),fe(n),t);if(L(n))return re(e.toNumber(),fe(n),t)}else if(Y(e)){if(Y(n))return re(e,n,t);if(J(n))return re(fe(e),fe(n),t);if(B(n))return re(fe(e),n.toNumber(),t);if(null===n||n===F)return re(fe(e),0,t);if(L(n))return re(fe(e),fe(n),t)}return!!ie(e,n)&&("<="===t||">="===t)}function ie(e,n){if(e===n)return!0;if(null===e&&n===F||null===n&&e===F)return!0;if(B(e)&&B(n))return e.equals(n);if(e instanceof t)return e.equalityTest(n);if(e instanceof r)return e.equalityTest(n);if(e instanceof s&&n instanceof s){const t=e.cache._arcadeCacheId,r=n.cache._arcadeCacheId;if(null!=t)return t===r}if(W(e)&&W(n)){if(e._arcadeCacheId===n._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===n._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function oe(e,t){if(L(e))return e;if(null===e)return"";if(J(e))return ee(e,t);if(Y(e))return e.toString();if(B(e))return ne(e,t);if(e instanceof l)return JSON.stringify(e.toJSON());if(z(e)){const n=[];for(let t=0;t<e.length;t++)n[t]=se(e[t]);return"["+n.join(",")+"]"}if(e instanceof n){const n=[];for(let t=0;t<e.length();t++)n[t]=se(e.get(t));return"["+n.join(",")+"]"}return null!==e&&"object"==typeof e&&void 0!==e.castToText?e.castToText():O(e)?"object, Function":e===F?"":Z(e)?"object, Module":""}function le(e){const t=[];if(!z(e))return null;if(e instanceof n){for(let n=0;n<e.length();n++)t[n]=fe(e.get(n));return t}for(let n=0;n<e.length;n++)t[n]=fe(e[n]);return t}function ue(e,t,r=!1){if(L(e))return e;if(null===e)return"";if(J(e))return ee(e,t);if(Y(e))return e.toString();if(B(e))return ne(e,t);if(e instanceof l)return e instanceof o?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+xe(e.spatialReference)+"}":xe(e.toJSON(),((e,n)=>e.key===n.key?0:"spatialReference"===e.key?1:"spatialReference"===n.key||e.key<n.key?-1:e.key>n.key?1:0));if(z(e)){const n=[];for(let t=0;t<e.length;t++)n[t]=se(e[t],r);return"["+n.join(",")+"]"}if(e instanceof n){const n=[];for(let t=0;t<e.length();t++)n[t]=se(e.get(t),r);return"["+n.join(",")+"]"}return null!==e&&"object"==typeof e&&void 0!==e.castToText?e.castToText(r):O(e)?"object, Function":e===F?"":Z(e)?"object, Module":""}function se(e,t=!1){if(null===e)return"null";if(Y(e)||J(e)||L(e))return JSON.stringify(e);if(e instanceof l)return ue(e,null,t);if(e instanceof n)return ue(e,null,t);if(e instanceof Array)return ue(e,null,t);if(B(e))return t?JSON.stringify(e.getTime()):JSON.stringify(ne(e,""));if(null!==e&&"object"==typeof e){if(void 0!==e.castToText)return e.castToText(t)}else if(e===F)return"null";return"null"}function fe(e,n){return J(e)?e:null===e||""===e?0:B(e)?NaN:Y(e)?e?1:0:z(e)||""===e||void 0===e?NaN:void 0!==n&&L(e)?(n=I(n,"‰",""),n=I(n,"¤",""),y(e,{pattern:n})):e===F?0:Number(e)}function ce(e,n){if(B(e))return e;if(L(e)){const t=de(e,n);if(t)return a.dateTimeToArcadeDate(t)}return null}function de(e,n){const t=/ (\d\d)/,r=i(n);let a=d.fromISO(e,{zone:r});return a.isValid||t.test(e)&&(e=e.replace(t,"T$1"),a=d.fromISO(e,{zone:n}),a.isValid)?a:null}function me(e){return Y(e)?e:L(e)?"true"===(e=e.toLowerCase()):!!J(e)&&(0!==e&&!isNaN(e))}function ye(e,n){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=n),e)}function pe(e){if(null===e)return null;if(e instanceof s)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof f){if(0===e.rings.length)return null;for(const n of e.rings)if(n.length>0)return e;return null}if(e instanceof c){if(0===e.paths.length)return null;for(const n of e.paths)if(n.length>0)return e;return null}return e instanceof u?0===e.points.length?null:e:e instanceof o?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function ge(e,n){if(!e)return n;if(!e.domain)return n;let t=null,r=null;if("string"===e.field.type||"esriFieldTypeString"===e.field.type)t=oe(n);else{if(null==n)return null;if(""===n)return n;t=fe(n)}for(let a=0;a<e.domain.codedValues.length;a++){const n=e.domain.codedValues[a];n.code===t&&(r=n)}return null===r?oe(n):r.name}function he(e,n){if(!e)return n;if(!e.domain)return n;let t=null;const r=oe(n);for(let a=0;a<e.domain.codedValues.length;a++){const n=e.domain.codedValues[a];n.name===r&&(t=n)}return null===t?n:t.code}function be(e,n,t=null,r=null){if(!n)return null;if(!n.fields)return null;let a,i,o=null;for(let l=0;l<n.fields.length;l++){const t=n.fields[l];t.name.toLowerCase()===e.toString().toLowerCase()&&(o=t)}if(null===o)throw new M(null,k.FieldNotFound,null,{key:e});if(null===r&&t&&n.typeIdField)r=t.hasField(n.typeIdField)?t.field(n.typeIdField):null;else if(n.typeIdField&&null!==r){let e=!1;for(const t of n.types||[])if(r===t.id){e=!0;break}if(!e)for(const t of n.types||[])if(r===t.name){r=t.id,e=!0;break}e||(r=null,t&&n.typeIdField&&(r=t.hasField(n.typeIdField)?t.field(n.typeIdField):null))}return null!=r&&n.types.some((e=>e.id===r&&(a=e.domains&&e.domains[o.name],a&&"inherited"===a.type&&(a=Se(o.name,n),i=!0),!0))),i||a||(a=Se(e,n)),{field:o,domain:a}}function Se(e,n){let t;return n.fields.some((n=>(n.name.toLowerCase()===e.toLowerCase()&&(t=n.domain),!!t))),t}function xe(e,n){n||(n={}),"function"==typeof n&&(n={cmp:n});const t="boolean"==typeof n.cycles&&n.cycles,r=n.cmp&&(a=n.cmp,function(e){return function(n,t){const r={key:n,value:e[n]},i={key:t,value:e[t]};return a(r,i)}});var a;const i=[];return function e(n){if(n&&n.toJSON&&"function"==typeof n.toJSON&&(n=n.toJSON()),void 0===n)return;if("number"==typeof n)return isFinite(n)?""+n:"null";if("object"!=typeof n)return JSON.stringify(n);let a,o;if(Array.isArray(n)){for(o="[",a=0;a<n.length;a++)a&&(o+=","),o+=e(n[a])||"null";return o+"]"}if(null===n)return"null";if(i.includes(n)){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const l=i.push(n)-1,u=Object.keys(n).sort(r&&r(n));for(o="",a=0;a<u.length;a++){const t=u[a],r=e(n[t]);r&&(o&&(o+=","),o+=JSON.stringify(t)+":"+r)}return i.splice(l,1),"{"+o+"}"}(e)}function Ne(e){if(null===e)return null;const n=[];for(const t of e)t&&t.arcadeDeclaredClass&&"esri.arcade.Feature"===t.arcadeDeclaredClass?n.push(t.geometry()):n.push(t);return n}function Me(e,n){if(!(n instanceof s))throw new M(null,k.InvalidParameter,null);e.push(n.hasZ?n.hasM?[n.x,n.y,n.z,n.m]:[n.x,n.y,n.z]:[n.x,n.y])}function ke(e,n){if(z(e)||q(e)){let t=!1,a=!1,i=[],o=n;if(z(e)){for(const n of e)Me(i,n);i.length>0&&(o=e[0].spatialReference,t=e[0].hasZ,a=e[0].hasM)}else if(e instanceof r)i=e._elements,i.length>0&&(t=e._hasZ,a=e._hasM,o=e.get(0).spatialReference);else{if(!q(e))throw new M(null,k.InvalidParameter,null);for(const n of e.toArray())Me(i,n);i.length>0&&(o=e.get(0).spatialReference,t=!0===e.get(0).hasZ,a=!0===e.get(0).hasM)}if(0===i.length)return null;return p(i,a,t)||(i=i.slice(0).reverse()),new f({rings:[i],spatialReference:o,hasZ:t,hasM:a})}return e}function je(e,n){if(z(e)||q(e)){let t=!1,a=!1,i=[],o=n;if(z(e)){for(const n of e)Me(i,n);i.length>0&&(o=e[0].spatialReference,t=!0===e[0].hasZ,a=!0===e[0].hasM)}else if(e instanceof r)i=e._elements,i.length>0&&(t=e._hasZ,a=e._hasM,o=e.get(0).spatialReference);else if(q(e)){for(const n of e.toArray())Me(i,n);i.length>0&&(o=e.get(0).spatialReference,t=!0===e.get(0).hasZ,a=!0===e.get(0).hasM)}return 0===i.length?null:new c({paths:[i],spatialReference:o,hasZ:t,hasM:a})}return e}function Ae(e,n){if(z(e)||q(e)){let t=!1,a=!1,i=[],o=n;if(z(e)){for(const n of e)Me(i,n);i.length>0&&(o=e[0].spatialReference,t=!0===e[0].hasZ,a=!0===e[0].hasM)}else if(e instanceof r)i=e._elements,i.length>0&&(t=e._hasZ,a=e._hasM,o=e.get(0).spatialReference);else if(q(e)){for(const n of e.toArray())Me(i,n);i.length>0&&(o=e.get(0).spatialReference,t=!0===e.get(0).hasZ,a=!0===e.get(0).hasM)}return 0===i.length?null:new u({points:i,spatialReference:o,hasZ:t,hasM:a})}return e}function Te(e,t=!1){const r=[];if(null===e)return r;if(!0===z(e)){for(let n=0;n<e.length;n++){const a=oe(e[n]);""===a&&!0!==t||r.push(a)}return r}if(e instanceof n){for(let n=0;n<e.length();n++){const a=oe(e.get(n));""===a&&!0!==t||r.push(a)}return r}if(w(e)){const n=oe(e);return""===n&&!0!==t||r.push(n),r}return[]}let De=0;function Fe(e){return De++,De%100==0?(De=0,new Promise((n=>{setTimeout((()=>{n(e)}),0)}))):e}function Ce(e,n,t){switch(t){case"&":return e&n;case"|":return e|n;case"^":return e^n;case"<<":return e<<n;case">>":return e>>n;case">>>":return e>>>n}}function Re(e,t=null){return null==e?null:Y(e)||J(e)||L(e)?e:e instanceof l?!0===t?.keepGeometryType?e:e.toJSON():e instanceof n?e.toArray().map((e=>Re(e,t))):e instanceof Array?e.map((e=>Re(e,t))):$(e)?e:B(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(t):null}async function Ie(e,n,t,r,a){const i=await Oe(e,n,t);a[r]=i}async function Oe(e,t=null,r=null){if(e instanceof n&&(e=e.toArray()),null==e)return null;if(w(e)||e instanceof l||$(e)||B(e))return Re(e,r);if(e instanceof Array){const n=[],a=[];for(const i of e)null===i||w(i)||i instanceof l||$(i)||B(i)?a.push(Re(i,r)):(a.push(null),n.push(Ie(i,t,r,a.length-1,a)));return n.length>0&&await Promise.all(n),a}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(t,r):null}function Ze(e){return we(e)?e.parent:e}function we(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function ve(e,n,t){const r=Ze(e.fullSchema());if(null===r)return null;if(!r.fields)return null;return be(n,r,e,t)}function _e(e){const n=Ze(e.fullSchema());return null===n?null:n.fields&&n.typeIdField?{subtypeField:n.typeIdField,subtypes:n.types?n.types.map((e=>({name:e.name,code:e.id}))):[]}:null}function Le(e,n,t,r){const a=Ze(e.fullSchema());if(null===a)return null;if(!a.fields)return null;const i=be(n,a,e,r);if(void 0===t)try{t=e.field(n)}catch(o){return null}return ge(i,t)}function Ye(e,n,t,r){const a=Ze(e.fullSchema());if(null===a)return null;if(!a.fields)return null;if(void 0===t){try{t=e.field(n)}catch(i){return null}return t}return he(be(n,a,e,r),t)}function Je(e){return e?.timeReference?.timeZone??"system"}function Pe(e){const n=Ze(e.fullSchema());if(null===n)return null;if(!n.fields)return null;const t=[];for(const r of n.fields)t.push(S(r));return{objectIdField:n.objectIdField,globalIdField:n.globalIdField??"",geometryType:void 0===x[n.geometryType]?"":x[n.geometryType],fields:t}}function Ge(e,n){return"system"===e&&(e=a.systemTimeZoneCanonicalName),{version:ze,engineVersion:b,timeZone:e,spatialReference:n.toJSON(),application:h.applicationName??"",engine:"web",locale:g()}}const ze="1.23",Ee=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:T,ImplicitResultE:A,ReturnResult:D,ReturnResultE:j,absRound:X,arcadeVersion:ze,autoCastArrayOfPointsToMultiPoint:Ae,autoCastArrayOfPointsToPolygon:ke,autoCastArrayOfPointsToPolyline:je,autoCastFeatureToGeometry:Ne,binaryOperator:Ce,breakResult:C,castAsJson:Re,castAsJsonAsync:Oe,continueResult:R,defaultExecutingContext:Ge,defaultTimeZone:Je,defaultUndefined:v,equalityTest:ie,featureDomainCodeLookup:Ye,featureDomainValueLookup:Le,featureFullDomain:ve,featureSchema:Pe,featureSubtypes:_e,fixNullGeometry:pe,fixSpatialReference:ye,formatDate:ne,formatNumber:ee,generateUUID:K,getDomain:be,getDomainCode:he,getDomainValue:ge,getType:_,greaterThanLessThan:ae,isArray:z,isBoolean:Y,isDate:B,isDictionary:H,isFeature:E,isFeatureSet:V,isFeatureSetCollection:U,isFunctionParameter:O,isGeometry:G,isImmutableArray:q,isInteger:P,isJsDate:$,isModule:Z,isNumber:J,isObject:W,isSimpleType:w,isString:L,multiReplace:I,pcCheck:Q,stableStringify:xe,standardiseDateFormat:te,tick:Fe,toBoolean:me,toDate:ce,toNumber:fe,toNumberArray:le,toString:oe,toStringArray:Te,toStringExplicit:ue,voidOperation:F},Symbol.toStringTag,{value:"Module"}));export{be as $,ie as A,Ce as B,Q as C,v as D,P as E,_ as F,Je as G,te as H,T as I,X as J,pe as K,Ne as L,je as M,ke as N,Ae as O,I as P,K as Q,D as R,Pe as S,_e as T,ve as U,Le as V,Ye as W,Ge as X,le as Y,Fe as Z,Te as _,Y as a,ge as a0,he as a1,j as a2,A as a3,Z as a4,W as a5,$ as a6,ee as a7,ne as a8,xe as a9,ze as aa,J as b,L as c,Re as d,Oe as e,w as f,fe as g,me as h,O as i,oe as j,B as k,ce as l,z as m,G as n,q as o,E as p,U as q,V as r,H as s,ue as t,Ee as u,F as v,C as w,R as x,ye as y,ae as z};
|
|
5
|
+
import{ArcadeFunction as e}from"../arcade/FunctionWrapper.js";import n from"../arcade/ImmutableArray.js";import t from"../arcade/ImmutablePathArray.js";import r from"../arcade/ImmutablePointArray.js";import{ArcadeDate as a,createDateTimeZone as i}from"../arcade/ArcadeDate.js";import o from"../geometry/Extent.js";import l from"../geometry/Geometry.js";import s from"../geometry/Multipoint.js";import u from"../geometry/Point.js";import f from"../geometry/Polygon.js";import c from"../geometry/Polyline.js";import{DateTime as d}from"luxon";import{format as m,parse as y}from"../core/number.js";import{isClockwise as p}from"../geometry/support/coordsUtils.js";import{getLocale as g}from"../intl/locale.js";import h from"../config.js";import{version as b}from"../kernel.js";import{esriFieldToJson as S,layerGeometryEsriRestConstants as x}from"../arcade/featureset/support/shared.js";import{ArcadeModule as N}from"../arcade/ArcadeModule.js";import{ArcadeExecutionError as M,ExecutionErrorCodes as k}from"../arcade/executionError.js";class j{constructor(e){this.value=e}}class A{constructor(e){this.value=e}}const T=A,D=j,F={type:"VOID"},C={type:"BREAK"},R={type:"CONTINUE"};function I(e,n,t){return""===n||null==n||n===t||n===t?e:e=e.split(n).join(t)}function O(n){return n instanceof e}function Z(e){return e instanceof N}function w(e){return!!L(e)||(!!J(e)||(!!B(e)||(!!Y(e)||(null===e||(e===F||"number"==typeof e)))))}function v(e,n){return void 0===e?n:e}function _(e){return null==e?"":z(e)||q(e)?"Array":B(e)?"Date":L(e)?"String":Y(e)?"Boolean":J(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":e instanceof N?"Module":E(e)?"Feature":e instanceof u?"Point":e instanceof f?"Polygon":e instanceof c?"Polyline":e instanceof s?"Multipoint":e instanceof o?"Extent":O(e)?"Function":V(e)?"FeatureSet":U(e)?"FeatureSetCollection":e===F?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognised Type"}function L(e){return"string"==typeof e||e instanceof String}function Y(e){return"boolean"==typeof e}function J(e){return"number"==typeof e}function P(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function G(e){return e instanceof l}function z(e){return e instanceof Array}function E(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function V(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function H(e){return"esri.arcade.Dictionary"===e?.declaredClass}function U(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function q(e){return e instanceof n}function B(e){return e instanceof a}function W(e){return null!=e&&"object"==typeof e}function $(e){return e instanceof Date}function Q(e,n,t,r,a){if(e.length<n||e.length>t)throw new M(r,k.WrongNumberOfParameters,a)}function X(e){return e<0?-Math.round(-e):Math.round(e)}function K(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,(n=>{const t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===n?t:3&t|8).toString(16)}))}function ee(e,n){return isNaN(e)||null==n||""===n?e.toString():(n=I(n,"‰",""),n=I(n,"¤",""),m(e,{pattern:n}))}function ne(e,n){return null==n||""===n?e.toISOString(!0):e.toFormat(te(n),{locale:g(),numberingSystem:"latn"})}function te(e){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let n="";const t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of e.match(t)||[])switch(r){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"Z":n+="ZZ";break;case"ZZ":n+="ZZZ";break;case"S":n+="'S'";break;case"SS":n+="'SS'";break;case"SSS":n+="u";break;case"A":case"a":n+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":n+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?n+=`'${r.slice(1,-1)}'`:n+=`'${r}'`}return n}function re(e,n,t){switch(t){case">":return e>n;case"<":return e<n;case">=":return e>=n;case"<=":return e<=n}return!1}function ae(e,n,t){if(null===e){if(null===n||n===F)return re(null,null,t);if(J(n))return re(0,n,t);if(L(n))return re(0,fe(n),t);if(Y(n))return re(0,fe(n),t);if(B(n))return re(0,n.toNumber(),t)}if(e===F){if(null===n||n===F)return re(null,null,t);if(J(n))return re(0,n,t);if(L(n))return re(0,fe(n),t);if(Y(n))return re(0,fe(n),t);if(B(n))return re(0,n.toNumber(),t)}else if(J(e)){if(J(n))return re(e,n,t);if(Y(n))return re(e,fe(n),t);if(null===n||n===F)return re(e,0,t);if(L(n))return re(e,fe(n),t);if(B(n))return re(e,n.toNumber(),t)}else if(L(e)){if(L(n))return re(oe(e),oe(n),t);if(B(n))return re(fe(e),n.toNumber(),t);if(J(n))return re(fe(e),n,t);if(null===n||n===F)return re(fe(e),0,t);if(Y(n))return re(fe(e),fe(n),t)}else if(B(e)){if(B(n))return re(e.toNumber(),n.toNumber(),t);if(null===n||n===F)return re(e.toNumber(),0,t);if(J(n))return re(e.toNumber(),n,t);if(Y(n))return re(e.toNumber(),fe(n),t);if(L(n))return re(e.toNumber(),fe(n),t)}else if(Y(e)){if(Y(n))return re(e,n,t);if(J(n))return re(fe(e),fe(n),t);if(B(n))return re(fe(e),n.toNumber(),t);if(null===n||n===F)return re(fe(e),0,t);if(L(n))return re(fe(e),fe(n),t)}return!!ie(e,n)&&("<="===t||">="===t)}function ie(e,n){if(e===n)return!0;if(null===e&&n===F||null===n&&e===F)return!0;if(B(e)&&B(n))return e.equals(n);if(e instanceof t)return e.equalityTest(n);if(e instanceof r)return e.equalityTest(n);if(e instanceof u&&n instanceof u){const t=e.cache._arcadeCacheId,r=n.cache._arcadeCacheId;if(null!=t)return t===r}if(W(e)&&W(n)){if(e._arcadeCacheId===n._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===n._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function oe(e,t){if(L(e))return e;if(null===e)return"";if(J(e))return ee(e,t);if(Y(e))return e.toString();if(B(e))return ne(e,t);if(e instanceof l)return JSON.stringify(e.toJSON());if(z(e)){const n=[];for(let t=0;t<e.length;t++)n[t]=ue(e[t]);return"["+n.join(",")+"]"}if(e instanceof n){const n=[];for(let t=0;t<e.length();t++)n[t]=ue(e.get(t));return"["+n.join(",")+"]"}return null!==e&&"object"==typeof e&&void 0!==e.castToText?e.castToText():O(e)?"object, Function":e===F?"":Z(e)?"object, Module":""}function le(e){const t=[];if(!z(e))return null;if(e instanceof n){for(let n=0;n<e.length();n++)t[n]=fe(e.get(n));return t}for(let n=0;n<e.length;n++)t[n]=fe(e[n]);return t}function se(e,t,r=!1){if(L(e))return e;if(null===e)return"";if(J(e))return ee(e,t);if(Y(e))return e.toString();if(B(e))return ne(e,t);if(e instanceof l)return e instanceof o?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+xe(e.spatialReference)+"}":xe(e.toJSON(),((e,n)=>e.key===n.key?0:"spatialReference"===e.key?1:"spatialReference"===n.key||e.key<n.key?-1:e.key>n.key?1:0));if(z(e)){const n=[];for(let t=0;t<e.length;t++)n[t]=ue(e[t],r);return"["+n.join(",")+"]"}if(e instanceof n){const n=[];for(let t=0;t<e.length();t++)n[t]=ue(e.get(t),r);return"["+n.join(",")+"]"}return null!==e&&"object"==typeof e&&void 0!==e.castToText?e.castToText(r):O(e)?"object, Function":e===F?"":Z(e)?"object, Module":""}function ue(e,t=!1){if(null===e)return"null";if(Y(e)||J(e)||L(e))return JSON.stringify(e);if(e instanceof l)return se(e,null,t);if(e instanceof n)return se(e,null,t);if(e instanceof Array)return se(e,null,t);if(B(e))return t?JSON.stringify(e.getTime()):JSON.stringify(ne(e,""));if(null!==e&&"object"==typeof e){if(void 0!==e.castToText)return e.castToText(t)}else if(e===F)return"null";return"null"}function fe(e,n){return J(e)?e:null===e||""===e?0:B(e)?NaN:Y(e)?e?1:0:z(e)||""===e||void 0===e?NaN:void 0!==n&&L(e)?(n=I(n,"‰",""),n=I(n,"¤",""),y(e,{pattern:n})):e===F?0:Number(e)}function ce(e,n){if(B(e))return e;if(L(e)){const t=de(e,n);if(t)return a.dateTimeToArcadeDate(t)}return null}function de(e,n){const t=/ (\d\d)/,r=i(n);let a=d.fromISO(e,{zone:r});return a.isValid||t.test(e)&&(e=e.replace(t,"T$1"),a=d.fromISO(e,{zone:n}),a.isValid)?a:null}function me(e){return Y(e)?e:L(e)?"true"===(e=e.toLowerCase()):!!J(e)&&(0!==e&&!isNaN(e))}function ye(e,n){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=n),e)}function pe(e){if(null===e)return null;if(e instanceof u)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof f){if(0===e.rings.length)return null;for(const n of e.rings)if(n.length>0)return e;return null}if(e instanceof c){if(0===e.paths.length)return null;for(const n of e.paths)if(n.length>0)return e;return null}return e instanceof s?0===e.points.length?null:e:e instanceof o?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function ge(e,n){if(!e)return n;if(!e.domain)return n;let t=null,r=null;if("string"===e.field.type||"esriFieldTypeString"===e.field.type)t=oe(n);else{if(null==n)return null;if(""===n)return n;t=fe(n)}for(let a=0;a<e.domain.codedValues.length;a++){const n=e.domain.codedValues[a];n.code===t&&(r=n)}return null===r?oe(n):r.name}function he(e,n){if(!e)return n;if(!e.domain)return n;let t=null;const r=oe(n);for(let a=0;a<e.domain.codedValues.length;a++){const n=e.domain.codedValues[a];n.name===r&&(t=n)}return null===t?n:t.code}function be(e,n,t=null,r=null){if(!n)return null;if(!n.fields)return null;let a,i,o=null;for(let l=0;l<n.fields.length;l++){const t=n.fields[l];t.name.toLowerCase()===e.toString().toLowerCase()&&(o=t)}if(null===o)throw new M(null,k.FieldNotFound,null,{key:e});if(null===r&&t&&n.typeIdField)r=t.hasField(n.typeIdField)?t.field(n.typeIdField):null;else if(n.typeIdField&&null!==r){let e=!1;for(const t of n.types||[])if(r===t.id){e=!0;break}if(!e)for(const t of n.types||[])if(r===t.name){r=t.id,e=!0;break}e||(r=null,t&&n.typeIdField&&(r=t.hasField(n.typeIdField)?t.field(n.typeIdField):null))}return null!=r&&n.types.some((e=>e.id===r&&(a=e.domains&&e.domains[o.name],a&&"inherited"===a.type&&(a=Se(o.name,n),i=!0),!0))),i||a||(a=Se(e,n)),{field:o,domain:a}}function Se(e,n){let t;return n.fields.some((n=>(n.name.toLowerCase()===e.toLowerCase()&&(t=n.domain),!!t))),t}function xe(e,n){n||(n={}),"function"==typeof n&&(n={cmp:n});const t="boolean"==typeof n.cycles&&n.cycles,r=n.cmp&&(a=n.cmp,function(e){return function(n,t){const r={key:n,value:e[n]},i={key:t,value:e[t]};return a(r,i)}});var a;const i=[];return function e(n){if(n&&n.toJSON&&"function"==typeof n.toJSON&&(n=n.toJSON()),void 0===n)return;if("number"==typeof n)return isFinite(n)?""+n:"null";if("object"!=typeof n)return JSON.stringify(n);let a,o;if(Array.isArray(n)){for(o="[",a=0;a<n.length;a++)a&&(o+=","),o+=e(n[a])||"null";return o+"]"}if(null===n)return"null";if(i.includes(n)){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const l=i.push(n)-1,s=Object.keys(n).sort(r&&r(n));for(o="",a=0;a<s.length;a++){const t=s[a],r=e(n[t]);r&&(o&&(o+=","),o+=JSON.stringify(t)+":"+r)}return i.splice(l,1),"{"+o+"}"}(e)}function Ne(e){if(null===e)return null;const n=[];for(const t of e)t&&t.arcadeDeclaredClass&&"esri.arcade.Feature"===t.arcadeDeclaredClass?n.push(t.geometry()):n.push(t);return n}function Me(e,n){if(!(n instanceof u))throw new M(null,k.InvalidParameter,null);e.push(n.hasZ?n.hasM?[n.x,n.y,n.z,n.m]:[n.x,n.y,n.z]:[n.x,n.y])}function ke(e,n){if(z(e)||q(e)){let t=!1,a=!1,i=[],o=n;if(z(e)){for(const n of e)Me(i,n);i.length>0&&(o=e[0].spatialReference,t=e[0].hasZ,a=e[0].hasM)}else if(e instanceof r)i=e._elements,i.length>0&&(t=e._hasZ,a=e._hasM,o=e.get(0).spatialReference);else{if(!q(e))throw new M(null,k.InvalidParameter,null);for(const n of e.toArray())Me(i,n);i.length>0&&(o=e.get(0).spatialReference,t=!0===e.get(0).hasZ,a=!0===e.get(0).hasM)}if(0===i.length)return null;return p(i,a,t)||(i=i.slice(0).reverse()),new f({rings:[i],spatialReference:o,hasZ:t,hasM:a})}return e}function je(e,n){if(z(e)||q(e)){let t=!1,a=!1,i=[],o=n;if(z(e)){for(const n of e)Me(i,n);i.length>0&&(o=e[0].spatialReference,t=!0===e[0].hasZ,a=!0===e[0].hasM)}else if(e instanceof r)i=e._elements,i.length>0&&(t=e._hasZ,a=e._hasM,o=e.get(0).spatialReference);else if(q(e)){for(const n of e.toArray())Me(i,n);i.length>0&&(o=e.get(0).spatialReference,t=!0===e.get(0).hasZ,a=!0===e.get(0).hasM)}return 0===i.length?null:new c({paths:[i],spatialReference:o,hasZ:t,hasM:a})}return e}function Ae(e,n){if(z(e)||q(e)){let t=!1,a=!1,i=[],o=n;if(z(e)){for(const n of e)Me(i,n);i.length>0&&(o=e[0].spatialReference,t=!0===e[0].hasZ,a=!0===e[0].hasM)}else if(e instanceof r)i=e._elements,i.length>0&&(t=e._hasZ,a=e._hasM,o=e.get(0).spatialReference);else if(q(e)){for(const n of e.toArray())Me(i,n);i.length>0&&(o=e.get(0).spatialReference,t=!0===e.get(0).hasZ,a=!0===e.get(0).hasM)}return 0===i.length?null:new s({points:i,spatialReference:o,hasZ:t,hasM:a})}return e}function Te(e,t=!1){const r=[];if(null===e)return r;if(!0===z(e)){for(let n=0;n<e.length;n++){const a=oe(e[n]);""===a&&!0!==t||r.push(a)}return r}if(e instanceof n){for(let n=0;n<e.length();n++){const a=oe(e.get(n));""===a&&!0!==t||r.push(a)}return r}if(w(e)){const n=oe(e);return""===n&&!0!==t||r.push(n),r}return[]}let De=0;function Fe(e){return De++,De%100==0?(De=0,new Promise((n=>{setTimeout((()=>{n(e)}),0)}))):e}function Ce(e,n,t){switch(t){case"&":return e&n;case"|":return e|n;case"^":return e^n;case"<<":return e<<n;case">>":return e>>n;case">>>":return e>>>n}}function Re(e,t=null){return null==e?null:Y(e)||J(e)||L(e)?e:e instanceof l?!0===t?.keepGeometryType?e:e.toJSON():e instanceof n?e.toArray().map((e=>Re(e,t))):e instanceof Array?e.map((e=>Re(e,t))):$(e)?e:B(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(t):null}async function Ie(e,n,t,r,a){const i=await Oe(e,n,t);a[r]=i}async function Oe(e,t=null,r=null){if(e instanceof n&&(e=e.toArray()),null==e)return null;if(w(e)||e instanceof l||$(e)||B(e))return Re(e,r);if(e instanceof Array){const n=[],a=[];for(const i of e)null===i||w(i)||i instanceof l||$(i)||B(i)?a.push(Re(i,r)):(a.push(null),n.push(Ie(i,t,r,a.length-1,a)));return n.length>0&&await Promise.all(n),a}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(t,r):null}function Ze(e){return we(e)?e.parent:e}function we(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function ve(e){return e&&"declaredClass"in e&&"esri.layers.SubtypeGroupLayer"===e.declaredClass}function _e(e,n,t){const r=Ze(e.fullSchema());if(null===r)return null;if(!r.fields)return null;return be(n,r,e,t)}function Le(e){const n=Ze(e.fullSchema());return null===n?null:n.fields&&n.typeIdField?{subtypeField:n.typeIdField,subtypes:n.types?n.types.map((e=>({name:e.name,code:e.id}))):[]}:null}function Ye(e,n,t,r){const a=Ze(e.fullSchema());if(null===a)return null;if(!a.fields)return null;const i=be(n,a,e,r);if(void 0===t)try{t=e.field(n)}catch(o){return null}return ge(i,t)}function Je(e,n,t,r){const a=Ze(e.fullSchema());if(null===a)return null;if(!a.fields)return null;if(void 0===t){try{t=e.field(n)}catch(i){return null}return t}return he(be(n,a,e,r),t)}function Pe(e){return e?.timeReference?.timeZone??"system"}function Ge(e){const n=Ze(e.fullSchema());if(null===n)return null;if(!n.fields)return null;const t=[];for(const r of n.fields)t.push(S(r));return{objectIdField:n.objectIdField,globalIdField:n.globalIdField??"",geometryType:void 0===x[n.geometryType]?"":x[n.geometryType],fields:t}}function ze(e,n){return"system"===e&&(e=a.systemTimeZoneCanonicalName),{version:Ee,engineVersion:b,timeZone:e,spatialReference:n.toJSON(),application:h.applicationName??"",engine:"web",locale:g()}}const Ee="1.23",Ve=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:T,ImplicitResultE:A,ReturnResult:D,ReturnResultE:j,absRound:X,arcadeVersion:Ee,autoCastArrayOfPointsToMultiPoint:Ae,autoCastArrayOfPointsToPolygon:ke,autoCastArrayOfPointsToPolyline:je,autoCastFeatureToGeometry:Ne,binaryOperator:Ce,breakResult:C,castAsJson:Re,castAsJsonAsync:Oe,continueResult:R,defaultExecutingContext:ze,defaultTimeZone:Pe,defaultUndefined:v,equalityTest:ie,featureDomainCodeLookup:Je,featureDomainValueLookup:Ye,featureFullDomain:_e,featureSchema:Ge,featureSubtypes:Le,fixNullGeometry:pe,fixSpatialReference:ye,formatDate:ne,formatNumber:ee,generateUUID:K,getDomain:be,getDomainCode:he,getDomainValue:ge,getType:_,greaterThanLessThan:ae,isArray:z,isBoolean:Y,isDate:B,isDictionary:H,isFeature:E,isFeatureSet:V,isFeatureSetCollection:U,isFunctionParameter:O,isGeometry:G,isImmutableArray:q,isInteger:P,isJsDate:$,isModule:Z,isNumber:J,isObject:W,isSimpleType:w,isString:L,isSubtypeGrouplayer:ve,isSubtypeSublayer:we,multiReplace:I,pcCheck:Q,stableStringify:xe,standardiseDateFormat:te,tick:Fe,toBoolean:me,toDate:ce,toNumber:fe,toNumberArray:le,toString:oe,toStringArray:Te,toStringExplicit:se,voidOperation:F},Symbol.toStringTag,{value:"Module"}));export{Fe as $,ie as A,Ce as B,Q as C,v as D,P as E,_ as F,Pe as G,te as H,T as I,X as J,pe as K,Ne as L,je as M,ke as N,Ae as O,I as P,K as Q,D as R,Ge as S,Le as T,_e as U,Ye as V,Je as W,ze as X,le as Y,ve as Z,we as _,Y as a,Te as a0,be as a1,ge as a2,he as a3,j as a4,A as a5,Z as a6,W as a7,$ as a8,ee as a9,ne as aa,xe as ab,Ee as ac,J as b,L as c,Re as d,Oe as e,w as f,fe as g,me as h,O as i,oe as j,B as k,ce as l,z as m,G as n,q as o,E as p,U as q,V as r,H as s,se as t,Ve as u,F as v,C as w,R as x,ye as y,ae as z};
|
package/geometry/Mesh.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import{HandleOwnerMixin as r}from"../core/HandleOwner.js";import o from"../core/Loadable.js";import s from"../core/Logger.js";import{EsriPromiseMixin as n}from"../core/Promise.js";import{whenOrAbort as i}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{c as l}from"../chunks/vec3f64.js";import m from"./Extent.js";import h from"./Geometry.js";import u from"./Point.js";import
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import{HandleOwnerMixin as r}from"../core/HandleOwner.js";import o from"../core/Loadable.js";import s from"../core/Logger.js";import{EsriPromiseMixin as n}from"../core/Promise.js";import{whenOrAbort as i}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{c as l}from"../chunks/vec3f64.js";import m from"./Extent.js";import h from"./Geometry.js";import u from"./Point.js";import f from"./Polygon.js";import{composeAxes as d,create as g}from"./support/axisAngleDegrees.js";import x from"./support/MeshComponent.js";import y from"./support/MeshGeoreferencedRelativeVertexSpace.js";import v from"./support/MeshGeoreferencedVertexSpace.js";import j from"./support/MeshLocalVertexSpace.js";import w from"./support/MeshTransform.js";import{MeshVertexAttributes as b}from"./support/MeshVertexAttributes.js";import{triangulate as S}from"./support/triangulationUtils.js";import{getProjectedExtent as L,getExtentFromPositions as A}from"./support/meshUtils/bounds.js";import{centerAt as M}from"./support/meshUtils/centerAt.js";import{project as P}from"./support/meshUtils/georeference.js";import{loadExternal as R}from"./support/meshUtils/loadExternal.js";import{Metadata as F}from"./support/meshUtils/Metadata.js";import{offset as E}from"./support/meshUtils/offset.js";import{convertUnitGeometry as U,createUnitSizeBox as C,extractSingleFaceOfBox as _,createUnitSizeSphere as z,createUnitSizeCylinder as G,convertPlaneSizeParameter as O,createUnitSizePlane as T}from"./support/meshUtils/primitives.js";import{rotate as V}from"./support/meshUtils/rotate.js";import{scale as B}from"./support/meshUtils/scale.js";var k;const D="esri.geometry.Mesh",W={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:v,"georeferenced-relative":y,local:j}};let N=k=class extends(r(o.LoadableMixin(n(h)))){constructor(e){super(e),this.components=null,this.vertexSpace=new v,this.transform=null,this.metadata=new F,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new b,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.handles.add(a((()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map((e=>e.clone()))})),(()=>this._clearSources()),{once:!0,sync:!0}))}))}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{components:e,spatialReference:t,vertexAttributes:r,vertexSpace:o}=this,s=r.position;if(0===s.length||e&&0===e.length)return new m({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t});if("local"===o.type){const{_untransformedExtent:e,transform:r}=this;return L(e,r,o,t)}if("georeferenced-relative"===o.type){const{transform:e}=this,r=P(t,e,o,s,t);return A(r,t)}return A(s,t)}get _untransformedExtent(){return A(this.vertexAttributes.position,this.spatialReference)}get anchor(){const{vertexSpace:e}=this;if(e.isRelative)return e.getOriginPoint(this.spatialReference);const{center:t,zmin:r}=this._transformedExtent;return new u({x:t.x,y:t.y,z:r,spatialReference:this.spatialReference})}get origin(){const{vertexSpace:e}=this;return e.isRelative?e.getOriginPoint(this.spatialReference):this._transformedExtent.center}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this.loaded?(this.components||(this.components=[]),this.components.push(x.from(e)),this.notifyChange("components")):s.getLogger(this).error("addComponent()","Mesh must be loaded before applying operations")}removeComponent(e){if(this.loaded){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}s.getLogger(this).error("removeComponent()","Provided component is not part of the list of components")}else s.getLogger(this).error("removeComponent()","Mesh must be loaded before applying operations")}rotate(e,t,r,o){return d(e,t,r,H),V(this,H,o),this}offset(e,t,r,o){return this.loaded?(Z[0]=e,Z[1]=t,Z[2]=r,E(this,Z,o),this):(s.getLogger(this).error("offset()","Mesh must be loaded before applying operations"),this)}scale(e,t){return this.loaded?(B(this,e,t),this):(s.getLogger(this).error("scale()","Mesh must be loaded before applying operations"),this)}centerAt(e,t){return this.loaded?(M(this,e,t),this):(s.getLogger(this).error("centerAt()","Mesh must be loaded before applying operations"),this)}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(R(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(){let e=null;if(this.components){const t=new Map,r=new Map;e=this.components.map((e=>e.cloneWithDeduplication(t,r)))}const t={components:e,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),vertexSpace:this.vertexSpace.clone(),transform:this.transform?.clone()??null,metadata:this.metadata.clone()};return new k(t)}cloneShallow(){return new k({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const t=import("./support/meshUtils/exporters/gltf/gltfexport.js"),r=this.load(),o=await Promise.all([t,r]),{toBinaryGLTF:s}=o[0];return s(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,null!=this.components)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}static createBox(e,t){if(!(e instanceof u))return s.getLogger(D).error(".createBox()","expected location to be a Point instance"),null;const r=new k(U(C(),e,t));return t&&t.imageFace&&"all"!==t.imageFace?_(r,t.imageFace):r}static createSphere(e,t){return e instanceof u?new k(U(z(t&&t.densificationFactor||0),e,t)):(s.getLogger(D).error(".createSphere()","expected location to be a Point instance"),null)}static createCylinder(e,t){return e instanceof u?new k(U(G(t&&t.densificationFactor||0),e,t)):(s.getLogger(D).error(".createCylinder()","expected location to be a Point instance"),null)}static createPlane(e,t){if(!(e instanceof u))return s.getLogger(D).error(".createPlane()","expected location to be a Point instance"),null;const r=t?.facing??"up",o=O(r,t?.size);return new k(U(T(r),e,{...t,size:o}))}static createFromPolygon(e,t){if(!(e instanceof f))return s.getLogger(D).error(".createFromPolygon()","expected polygon to be a Polygon instance"),null;const r=S(e);return new k({vertexAttributes:new b({position:r.position}),components:[new x({faces:r.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new v})}static async createFromGLTF(e,r,o){if(!(e instanceof u))throw s.getLogger(D).error(".createfromGLTF()","expected location to be a Point instance"),new t("invalid-input","Expected location to be a Point instance");const{loadGLTFMesh:n}=await i(import("./support/meshUtils/loadGLTFMesh.js"),o);return new k(await n(e,r,o))}static async createFromFiles(e,r,o){if(!(e instanceof u)){const e="Expected location to be a Point instance";throw s.getLogger(D).error(".createFromFiles()",e),new t("invalid-input",e)}const n=k.createWithExternalSource(e,r),i=o?.layer;if(!i){const e="A layer is needed to convert the files";throw s.getLogger(D).error(".createFromFiles()",e),new t("invalid-input",e)}const[a]=await i.uploadAssets([n],o);return a}static createWithExternalSource(e,t,r){const o=r?.extent??null,{x:s,y:n,z:i,spatialReference:a}=e,c=r?.transform?.clone()??new w,p=r?.vertexSpace??new j({origin:[s,n,i??0]}),l={source:t,extent:o},m=new F;return m.externalSources.push(l),new k({metadata:m,transform:c,vertexSpace:p,spatialReference:a})}static createIncomplete(e,r){const{x:o,y:s,z:n,spatialReference:i}=e,a=r?.transform?.clone()??new w,c=r?.vertexSpace??new j({origin:[o,s,n??0]}),p=new k({transform:a,vertexSpace:c,spatialReference:i});return p.addResolvingPromise(Promise.reject(new t("mesh-incomplete","Mesh resources are not complete"))),p}};e([c({type:[x],json:{write:!0}})],N.prototype,"components",void 0),e([c({nonNullable:!0,types:W,constructOnly:!0,json:{write:!0}})],N.prototype,"vertexSpace",void 0),e([c({type:w,json:{write:!0}})],N.prototype,"transform",void 0),e([c({constructOnly:!0})],N.prototype,"metadata",void 0),e([c()],N.prototype,"hasExtent",null),e([c()],N.prototype,"_transformedExtent",null),e([c()],N.prototype,"_untransformedExtent",null),e([c()],N.prototype,"anchor",null),e([c()],N.prototype,"origin",null),e([c({readOnly:!0,json:{read:!1}})],N.prototype,"extent",null),e([c({readOnly:!0,json:{read:!1,write:!0,default:!0}})],N.prototype,"hasZ",void 0),e([c({readOnly:!0,json:{read:!1,write:!0,default:!1}})],N.prototype,"hasM",void 0),e([c({type:b,nonNullable:!0,json:{write:!0}})],N.prototype,"vertexAttributes",void 0),N=k=e([p(D)],N);const Z=l(),H=g(),I=N;export{I 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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{NATIVE_ARRAY_MAX_SIZE as r,isArray as n}from"../../core/typedArrayUtil.js";function t(n,t=!1){return n<=r?t?new Array(n).fill(0):new Array(n):new Float64Array(n)}function e(t){return(n(t)?t.length:t.byteLength/8)<=r?Array.from(t):new Float64Array(t)}function a(r,n,t){return Array.isArray(r)?r.slice(n,n+t):r.subarray(n,n+t)}export{e as doubleArrayFrom,a as doubleSubArray,t as newDoubleArray};
|
|
5
|
+
import{NATIVE_ARRAY_MAX_SIZE as r,isArray as n}from"../../core/typedArrayUtil.js";function t(n,t=!1){return n<=r?t?new Array(n).fill(0):new Array(n):new Float64Array(n)}function e(t){return(n(t)?t.length:t.byteLength/8)<=r?Array.from(t):new Float64Array(t)}function a(r,n,t){return Array.isArray(r)?r.slice(n,n+t):r.subarray(n,n+t)}function o(r,n){for(let t=0;t<n.length;++t)r[t]=n[t];return r}export{o as copyInto,e as doubleArrayFrom,a as doubleSubArray,t as newDoubleArray};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import n from"../../Extent.js";import{project as t}from"./georeference.js";function m({xmin:n,xmax:m,ymin:r,ymax:x,zmin:i,zmax:o},l,c,f){i??=0,o??=0,a??=new Float64Array(24);const h=a;return h[0]=n,h[1]=r,h[2]=i,h[3]=n,h[4]=x,h[5]=i,h[6]=m,h[7]=x,h[8]=i,h[9]=m,h[10]=r,h[11]=i,h[12]=n,h[13]=r,h[14]=o,h[15]=n,h[16]=x,h[17]=o,h[18]=m,h[19]=x,h[20]=o,h[21]=m,h[22]=r,h[23]=o,t(f,l,c,h,f,h),e(h,f)}let a=null;function e(t,m){let a=1/0,e=1/0,r=1/0,x=-1/0,i=-1/0,o=-1/0;const l=t.length;let c=0;for(;c<l;){const n=t[c++],m=t[c++],l=t[c++];a=Math.min(a,n),e=Math.min(e,m),r=Math.min(r,l),x=Math.max(x,n),i=Math.max(i,m),o=Math.max(o,l)}return new n({xmin:a,ymin:e,zmin:r,xmax:x,ymax:i,zmax:o,spatialReference:m})}export{e as getExtentFromPositions,m as getProjectedExtent};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getMetersPerCartesianUnitForSR as n,convertUnit as t}from"../../../core/unitUtils.js";import{c as e}from"../../../chunks/mat3f64.js";import{j as r,m as o,a as i,k as a}from"../../../chunks/mat4.js";import{I as l,c as s}from"../../../chunks/mat4f64.js";import{k as c}from"../../../chunks/vec3.js";import{Z as u,f}from"../../../chunks/vec3f64.js";import{b as p}from"../../../chunks/mat3.js";import{projectBuffer as m,canProjectWithoutEngine as g,computeTranslationToOriginAndRotation as h}from"../../projection.js";import{getSphericalPCPF as j}from"../../spatialReferenceEllipsoidUtils.js";import{
|
|
5
|
+
import{getMetersPerCartesianUnitForSR as n,convertUnit as t}from"../../../core/unitUtils.js";import{c as e}from"../../../chunks/mat3f64.js";import{j as r,m as o,a as i,k as a}from"../../../chunks/mat4.js";import{I as l,c as s}from"../../../chunks/mat4f64.js";import{k as c}from"../../../chunks/vec3.js";import{Z as u,f}from"../../../chunks/vec3f64.js";import{b as p}from"../../../chunks/mat3.js";import{projectBuffer as m,canProjectWithoutEngine as g,computeTranslationToOriginAndRotation as h}from"../../projection.js";import{getSphericalPCPF as j}from"../../spatialReferenceEllipsoidUtils.js";import{newDoubleArray as y,copyInto as w}from"../DoubleArray.js";import A from"../MeshGeoreferencedRelativeVertexSpace.js";import R from"../MeshGeoreferencedVertexSpace.js";import x from"../MeshLocalVertexSpace.js";import F from"../MeshTransform.js";import{t as v,a as k}from"../../../chunks/vec32.js";import{isGeographicMesh as M}from"./geographicUtils.js";import{transformNormal as d,transformTangent as S,projectFromPCPF as b,projectNormalFromPCPF as z,projectTangentFromPCPF as G,projectToPCPF as U,projectNormalToPCPF as V,projectTangentToPCPF as O}from"./projection.js";function P(n,t,e){return M(t.spatialReference,e)?Z(n,t,e):L(n,t,e)}function T(n,t,e,r){const{position:o,normal:i,tangent:a}=n;if(!t.isRelative)return{position:o,normal:i,tangent:a};const s=e?.localMatrix??l;return P({position:v(new Float64Array(o.length),o,s),normal:null!=i?d(i,new Float32Array(i.length),s):null,tangent:null!=a?S(a,new Float32Array(a.length),s):null},t.getOriginPoint(r),{geographic:!t.isGeoreferenced})}function q(n,t,e){if(e?.useTransform){const{position:r,normal:o,tangent:i}=n,{x:a,y:l,z:s}=t,c=f(a,l,s??0);return{vertexAttributes:{position:r,normal:o,tangent:i},vertexSpace:e.geographic??1?new x({origin:c}):new A({origin:c}),transform:new F}}return{vertexAttributes:P(n,t,e),vertexSpace:new R,transform:null}}function D(n,t,e){return M(t.spatialReference,e)?K(n,t,e):J(n,t,e)}function E(n,t,e,r,o){if(!t.isRelative)return D(n,r,o);const{spatialReference:i}=r,a=T(n,t,e,i);return r.equals(t.getOriginPoint(i))?J(a,r,o):D(a,r,o)}function I(n,t,e,i,a,s){const f=e.isRelative?e.origin:u,p=e.isRelative?t?.localMatrix??l:l;if(e.isGeoreferenced){const t=s??y(i.length);if(r(p,l)?w(t,i):v(t,i,p),!c(f,u)){const[n,e,r]=f;for(let o=0;o<t.length;o+=3)t[o]+=n,t[o+1]+=e,t[o+2]+=r}return m(t,n,0,t,a,0,t.length/3),t}const A=j(n),R=g(n,A)?A:n;h(n,f,$,R),o($,$,p);const x=s??y(i.length);return v(x,i,$),m(x,R,0,x,a,0,x.length/3),x}function L(n,t,e){const r=new Float64Array(n.position.length),o=n.position,i=t.x,a=t.y,l=t.z??0,s=Y(e?e.unit:null,t.spatialReference);for(let c=0;c<o.length;c+=3)r[c]=o[c]*s+i,r[c+1]=o[c+1]*s+a,r[c+2]=o[c+2]*s+l;return{position:r,normal:n.normal,tangent:n.tangent}}function Z(n,t,e){const r=t.spatialReference,o=N(t,e,$),i=new Float64Array(n.position.length),a=B(n.position,o,r,i),l=p(nn,o);return{position:a,normal:C(a,i,n.normal,l,r),tangent:H(a,i,n.tangent,l,r)}}function B(n,t,e,r){v(r,n,t);const o=new Float64Array(n.length);return b(r,o,e)}function C(n,t,e,r,o){if(null==e)return null;const i=new Float32Array(e.length);return k(i,e,r),z(i,n,t,o,i),i}function H(n,t,e,r,o){if(null==e)return null;const i=new Float32Array(e.length);k(i,e,r,4);for(let a=3;a<i.length;a+=4)i[a]=e[a];return G(i,n,t,o,i),i}function J(n,t,e){const r=new Float64Array(n.position.length),o=n.position,i=t.x,a=t.y,l=t.z??0,s=Y(e?e.unit:null,t.spatialReference);for(let c=0;c<o.length;c+=3)r[c]=(o[c]-i)/s,r[c+1]=(o[c+1]-a)/s,r[c+2]=(o[c+2]-l)/s;return{position:r,normal:n.normal,tangent:n.tangent}}function K(n,t,e){const r=t.spatialReference;N(t,e,$);const o=i(_,$),a=new Float64Array(n.position.length),l=Q(n.position,r,o,a),s=p(nn,o);return{position:l,normal:W(n.normal,n.position,a,r,s),tangent:X(n.tangent,n.position,a,r,s)}}function N(n,t,e){h(n.spatialReference,[n.x,n.y,n.z??0],e,j(n.spatialReference));const r=Y(t?t.unit:null,n.spatialReference);return a(e,e,[r,r,r]),e}function Q(n,t,e,r){const o=U(n,t,r),i=new Float64Array(o.length);return v(i,o,e),i}function W(n,t,e,r,o){if(null==n)return null;const i=V(n,t,e,r,new Float32Array(n.length));return k(i,i,o),i}function X(n,t,e,r,o){if(null==n)return null;const i=O(n,t,e,r,new Float32Array(n.length));return k(i,i,o,4),i}function Y(e,r){if(null==e)return 1;const o=n(r);return 1/t(o,"meters",e)}const $=s(),_=s(),nn=e();export{P as georeference,T as georeferenceApplyTransform,q as georeferenceByTransform,I as project,D as ungeoreference,E as ungeoreferenceByTransform};
|
package/interfaces.d.ts
CHANGED
|
@@ -89877,11 +89877,11 @@ declare namespace __esri {
|
|
|
89877
89877
|
*/
|
|
89878
89878
|
export interface LayerInfo {
|
|
89879
89879
|
/**
|
|
89880
|
-
* The
|
|
89880
|
+
* The feature layer or scene layer containing the editable fields.
|
|
89881
89881
|
*
|
|
89882
89882
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#LayerInfo)
|
|
89883
89883
|
*/
|
|
89884
|
-
layer: FeatureLayer;
|
|
89884
|
+
layer: FeatureLayer | SceneLayer;
|
|
89885
89885
|
/**
|
|
89886
89886
|
* Indicates whether to enable editing on the layer.
|
|
89887
89887
|
*
|
package/kernel.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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"./core/has.js";import{getInterceptor as t,addQueryParameter as e}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";const a="4.27";let s=a;s="4.27.0-rc.
|
|
5
|
+
import has from"./core/has.js";import{getInterceptor as t,addQueryParameter as e}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";const a="4.27";let s=a;s="4.27.0-rc.1";const r={async request(e,a){const{default:s}=await import("./request.js"),r=e.options,n=r.responseType;r.signal=a?.signal,r.responseType="native"===n||"native-request-init"===n?"native-request-init":n&&["blob","json","text"].includes(n)&&t(e.url)?.after?n:"array-buffer";const o=await s(e.url,r),i={data:o.data,httpStatus:o.httpStatus,ssl:o.ssl};switch(o.requestOptions?.responseType){case"native-request-init":return delete i.data.signal,i;case"blob":i.data=await i.data.arrayBuffer();break;case"json":i.data=(new TextEncoder).encode(JSON.stringify(i.data)).buffer;break;case"text":i.data=(new TextEncoder).encode(i.data).buffer}return{result:i,transferList:[i.data]}}};let n;function o(t){n=t}function i(t){const a=n?.findCredential(t);return a?.token?e(t,"token",a.token):t}has("host-webworker");export{i as addTokenParameter,s as fullVersion,n as id,o as setId,a as version,r as workerMessages};
|
package/layers/FeatureLayer.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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/PieChartRenderer.js";import"../renderers/Renderer.js";import r from"../renderers/SimpleRenderer.js";import i from"../renderers/UniqueValueRenderer.js";import{read as o}from"../renderers/support/jsonUtils.js";import{rendererTypes as s,webSceneRendererTypes as a}from"../renderers/support/types.js";import n from"../request.js";import{symbolTypes as l,symbolTypesRenderer as p}from"../symbols.js";import{ClonableMixin as u}from"../core/Clonable.js";import d from"../core/Collection.js";import y from"../core/Error.js";import c from"../core/Handles.js";import{clone as m}from"../core/lang.js";import f from"../core/Logger.js";import{destroyMaybe as h}from"../core/maybe.js";import{MultiOriginJSONMixin as b}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as g}from"../core/object.js";import{throwIfAbortError as w,whenOrAbort as j}from"../core/promiseUtils.js";import{sqlAnd as v}from"../core/sql.js";import{urlToObject as S,join as F}from"../core/urlUtils.js";import{property as I}from"../core/accessorSupport/decorators/property.js";import{cast as T}from"../core/accessorSupport/decorators/cast.js";import{reader as D}from"../core/accessorSupport/decorators/reader.js";import{subclass as E}from"../core/accessorSupport/decorators/subclass.js";import{writer as L}from"../core/accessorSupport/decorators/writer.js";import{createTypeReader as _}from"../core/accessorSupport/extensions/serializableProperty/reader.js";import x from"../form/FormTemplate.js";import P from"../geometry/SpatialReference.js";import M from"./Layer.js";import{MemorySource as q}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as C}from"./mixins/APIKeyMixin.js";import{ArcGISService as O}from"./mixins/ArcGISService.js";import{BlendLayer as R}from"./mixins/BlendLayer.js";import{CustomParametersMixin as U}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as A}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as V}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as Q}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as N}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as G}from"./mixins/OperationalLayer.js";import{OrderedLayer as J}from"./mixins/OrderedLayer.js";import{PortalLayer as $}from"./mixins/PortalLayer.js";import{PublishableLayer as W}from"./mixins/PublishableLayer.js";import{RefreshableLayer as B}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as z}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as Z}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as k,parse as H,cleanTitle as K}from"./support/arcgisLayerUrl.js";import{id as X,labelsVisible as Y,opacityDrawingInfo as ee,legendEnabled as te,listMode as re,popupEnabled as ie,screenSizePerspectiveEnabled as oe}from"./support/commonProperties.js";import{ensureLayerCredential as se,computeEffectiveEditingEnabled as ae,readGlobalIdField as ne,readObjectIdField as le,addAttachment as pe,updateAttachment as ue,applyEdits as de,uploadAssets as ye,createQuery as ce,deleteAttachments as me,fetchRecomputedExtents as fe,queryAttachments as he,queryObjectIds as be,queryFeatureCount as ge,queryExtent as we,queryRelatedFeatures as je,queryRelatedFeaturesCount as ve,hasDataChanged as Se,geometryTypeKebabDict as Fe}from"./support/featureLayerUtils.js";import Ie from"./support/FeatureTemplate.js";import Te from"./support/FeatureType.js";import{defineFieldProperties as De}from"./support/fieldProperties.js";import{fixRendererFields as Ee,fixTimeInfoFields as Le}from"./support/fieldUtils.js";import _e from"./support/LabelClass.js";import{reader as xe}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Pe}from"./support/serviceCapabilitiesUtils.js";import Me from"./support/TimeInfo.js";import{serviceSupportsSpatialReference as qe}from"./support/versionUtils.js";import{DataLayerSource as Ce}from"./support/source/DataLayerSource.js";import{loadStyleRenderer as Oe}from"../renderers/support/styleUtils.js";import Re from"../rest/support/FeatureSet.js";import Ue from"../rest/support/Query.js";import Ae from"../rest/support/TopFeaturesQuery.js";import{createPopupTemplate as Ve}from"../support/popupUtils.js";import{opacityToTransparency as Qe}from"../webdoc/support/opacityUtils.js";const Ne="FeatureLayer",Ge="esri.layers.FeatureLayer",Je=f.getLogger(Ge);function $e(e,t){return new y("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function We(e){return e&&e instanceof d}const Be=De();function ze(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let Ze=class extends(Q(N(V(W(A(R(J(Z(z(B(O(G($(b(U(C(u(M)))))))))))))))))){constructor(...e){super(...e),this._handles=new c,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=P.WGS84,this.subtypeCode=null,this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0}destroy(){this.source?.destroy(),this._handles=h(this._handles)}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then((e=>this.initLayerProperties(e)))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection"]},e).catch(w).then((async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new y("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))})).then((()=>this._setUserPrivileges(this.serviceItemId,e))).then((()=>se(this,e)));return this.addResolvingPromise(r),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,Pe(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return ae(this)}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&g(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return ne(t.layerDefinition||t)}readObjectIdField(e,t){return le(t.layerDefinition||t)}get parsedUrl(){const e=S(this.url);return null!=e&&(null!=this.dynamicDataSource?e.path=F(e.path,"dynamicLayer"):null!=this.layerId&&(e.path=F(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){Ee(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,s){t=t.layerDefinition||t;const a=t.drawingInfo?.renderer;if(a){const e=o(a,t,s)??void 0;return e||Je.error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:s}),e}if(t.defaultSymbol)return t.types&&t.types.length?new i({defaultSymbol:ke(t.defaultSymbol,t,s),field:t.typeIdField,uniqueValueInfos:t.types.map((e=>({id:e.id,symbol:ke(e.symbol,e,s)})))}):new r({symbol:ke(t.defaultSymbol,t,s)})}set source(e){const t=this._get("source");t!==e&&(We(t)&&this._resetMemorySource(t),We(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof d?new q({layer:this,items:e}):e:null}readSource(e,t){const r=Re.fromJSON(t.featureSet);return new q({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r&&r.creatorField,o=r&&r.editorField;return e=e&&e.map((e=>Ie.fromJSON(e))),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition&&t.layerDefinition.title;if(r){const e=this.portalItem&&this.portalItem.title;if("item-title"===this.sublayerTitleMode)return this.url?k(this.url,r):r;let t=r;if(!t&&this.url){const e=H(this.url);null!=e&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),K(t)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition&&t.layerDefinition.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r&&r.creatorField,o=r&&r.editorField;return e&&e.map((e=>(e=Te.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e)))}readVisible(e,t){return t.layerDefinition&&null!=t.layerDefinition.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){return pe(this,e,t,Ne)}async updateAttachment(e,t,r){return ue(this,e,t,r,Ne)}async applyEdits(e,t){return de(this,e,t)}async uploadAssets(e,t){return ye(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Ve(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await j(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=ce(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=v(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){return me(this,e,t,Ne)}async fetchRecomputedExtents(e){return fe(this,e,Ne)}getFeatureType(e){const{typeIdField:t,types:r}=this;if(!t||!e)return null;const i=e.attributes?e.attributes[t]:void 0;if(null==i)return null;let o=null;return r?.some((e=>{const{id:t}=e;return null!=t&&(t.toString()===i.toString()&&(o=e),!!o)})),o}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return he(this,e,t,Ne)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(Ue.from(e)??r.createQuery(),t);if(i?.features)for(const o of i.features)o.layer=o.sourceLayer=r;return i}async queryObjectIds(e,t){return be(this,e,t,Ne)}async queryFeatureCount(e,t){return ge(this,e,t,Ne)}async queryExtent(e,t){return we(this,e,t,Ne)}async queryRelatedFeatures(e,t){return je(this,e,t,Ne)}async queryRelatedFeaturesCount(e,t){return ve(this,e,t,Ne)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new y(Ne,"Layer source does not support queryTopFeatures capability");const o=await r.queryTopFeatures(Ae.from(e),t);if(o?.features)for(const s of o.features)s.layer=s.sourceLayer=this;return o}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new y(Ne,"Layer source does not support queryTopObjectIds capability");return r.queryTopObjectIds(Ae.from(e),t)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new y(Ne,"Layer source does not support queryTopExtents capability");return r.queryTopExtents(Ae.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new y(Ne,"Layer source does not support queryFeatureCount capability");return r.queryTopCount(Ae.from(e),t)}read(e,t){const r=e.featureCollection;if(r){const e=r.layers;e&&1===e.length&&(super.read(e[0],t),null!=r.showLegend&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&"service"===t.origin&&(this.revert(["objectIdField","fields","timeInfo"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:o}=t;if(this.dynamicDataSource)return o?.push($e(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==i)return o?.push($e(this,"using a table source cannot be written to web scenes and web maps")),null;if(this._hasMemorySource())return o?.push($e(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===r&&"tables"===i)return o?.push($e(this,"using a non-table source cannot be written to tables in web maps")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new y(Ne,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||qe(this,e))}async save(e){const{save:t}=await import("./save/featureLayerUtils.js");return t(this,e)}async saveAs(e,t){const{saveAs:r}=await import("./save/featureLayerUtils.js");return r(this,e,t)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map((e=>e.trim())).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";g("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstLayerId(e){return n(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then((e=>{const t=e.data;if(t)return Array.isArray(t.layers)&&t.layers.length>0?t.layers[0].id:Array.isArray(t.tables)&&t.tables.length>0?t.tables[0].id:void 0}))}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),Ee(this.renderer,this.fieldsIndex),Le(this.timeInfo,this.fieldsIndex),Oe(this,{origin:"service"})}async hasDataChanged(){return Se(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach((e=>{const r=e.prototype&&e.prototype.attributes;r&&t&&delete r[t]}))}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new y("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new y("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach((e=>{e.layer=this,e.sourceLayer=this})),this._handles.add([e.on("after-add",(e=>{e.item.layer=this,e.item.sourceLayer=this})),e.on("after-remove",(e=>{e.item.layer=null,e.item.sourceLayer=null}))],"fl-source")}_resetMemorySource(e){e.forEach((e=>{e.layer=null,e.sourceLayer=null})),this._handles.remove("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}};e([D("service","capabilities")],Ze.prototype,"readCapabilities",null),e([I({json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Ze.prototype,"charts",void 0),e([I({readOnly:!0})],Ze.prototype,"createQueryVersion",null),e([I({json:{read:{source:"layerDefinition.copyrightText"}}})],Ze.prototype,"copyright",void 0),e([I({json:{read:{source:"layerDefinition.displayField"}}})],Ze.prototype,"displayField",void 0),e([I({types:l,readOnly:!0})],Ze.prototype,"defaultSymbol",void 0),e([I({type:Ce})],Ze.prototype,"dynamicDataSource",void 0),e([I({type:Boolean})],Ze.prototype,"editingEnabled",null),e([D(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],Ze.prototype,"readEditingEnabled",null),e([D("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],Ze.prototype,"readEditingEnabledFromWebMap",null),e([L(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],Ze.prototype,"writeEditingEnabled",null),e([L("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],Ze.prototype,"writeEditingEnabledToWebMap",null),e([I({readOnly:!0})],Ze.prototype,"effectiveEditingEnabled",null),e([I({...Be.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:ze}}}}})],Ze.prototype,"fields",void 0),e([I(Be.fieldsIndex)],Ze.prototype,"fieldsIndex",void 0),e([I({type:x,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],Ze.prototype,"formTemplate",void 0),e([I({json:{read:{source:"layerDefinition.extent"}}})],Ze.prototype,"fullExtent",void 0),e([I({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:ze,writer(e,t,r){const i=e?Fe.toJSON(e):null;i&&g(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Fe.read}}})],Ze.prototype,"geometryType",void 0),e([I({json:{read:{source:"layerDefinition.hasM"}}})],Ze.prototype,"hasM",void 0),e([I({json:{read:{source:"layerDefinition.hasZ"}}})],Ze.prototype,"hasZ",void 0),e([I(X)],Ze.prototype,"id",void 0),e([I({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],Ze.prototype,"infoFor3D",void 0),e([I({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],Ze.prototype,"isTable",void 0),e([D("service","isTable",["type","geometryType"]),D("isTable",["layerDefinition.type","layerDefinition.geometryType"])],Ze.prototype,"readIsTable",null),e([L("web-map","isTable")],Ze.prototype,"writeIsTable",null),e([I(Y)],Ze.prototype,"labelsVisible",void 0),e([I({type:[_e],json:{origins:{service:{read:{source:"drawingInfo.labelingInfo",reader:xe},write:{target:"drawingInfo.labelingInfo",enabled:!1}}},read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:xe},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],Ze.prototype,"labelingInfo",void 0),e([I((()=>{const e=m(ee);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){g(r,Qe(e),t)}}},e})())],Ze.prototype,"opacity",void 0),e([I(te)],Ze.prototype,"legendEnabled",void 0),e([I({type:["show","hide"],json:(()=>{const e=m(re.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],Ze.prototype,"listMode",void 0),e([D("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],Ze.prototype,"readGlobalIdField",null),e([I({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:ze}}}}})],Ze.prototype,"objectIdField",void 0),e([D("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],Ze.prototype,"readObjectIdField",null),e([I({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],Ze.prototype,"operationalLayerType",void 0),e([I(Be.outFields)],Ze.prototype,"outFields",void 0),e([I({readOnly:!0})],Ze.prototype,"parsedUrl",null),e([I({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Ze.prototype,"path",void 0),e([I(ie)],Ze.prototype,"popupEnabled",void 0),e([I({type:t,json:{name:"popupInfo",write:!0}})],Ze.prototype,"popupTemplate",void 0),e([I({readOnly:!0})],Ze.prototype,"defaultPopupTemplate",null),e([I({types:s,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:a,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}})],Ze.prototype,"renderer",null),e([D("service","renderer",["drawingInfo.renderer","defaultSymbol"]),D("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],Ze.prototype,"readRenderer",null),e([I((()=>{const e=m(oe);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],Ze.prototype,"screenSizePerspectiveEnabled",void 0),e([I({clonable:!1})],Ze.prototype,"source",null),e([T("source")],Ze.prototype,"castSource",null),e([D("portal-item","source",["featureSet"]),D("web-map","source",["featureSet"])],Ze.prototype,"readSource",null),e([I({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],Ze.prototype,"spatialReference",void 0),e([I({type:Number})],Ze.prototype,"subtypeCode",void 0),e([I({type:[Ie]})],Ze.prototype,"templates",void 0),e([D("templates",["editFieldsInfo","creatorField","editorField","templates"])],Ze.prototype,"readTemplates",null),e([I({type:Me})],Ze.prototype,"timeInfo",void 0),e([I()],Ze.prototype,"title",void 0),e([D("service","title",["name"]),D("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],Ze.prototype,"readTitle",null),e([D("web-map","title",["layerDefinition.name","title"])],Ze.prototype,"readTitleFromWebMap",null),e([I({type:String})],Ze.prototype,"sublayerTitleMode",void 0),e([I({json:{read:!1}})],Ze.prototype,"type",void 0),e([I({type:String})],Ze.prototype,"typeIdField",void 0),e([D("service","typeIdField"),D("typeIdField",["layerDefinition.typeIdField"])],Ze.prototype,"readTypeIdField",null),e([I({type:[Te]})],Ze.prototype,"types",void 0),e([D("service","types",["types"]),D("types",["layerDefinition.types"])],Ze.prototype,"readTypes",null),e([I({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],Ze.prototype,"visible",void 0),e([D("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],Ze.prototype,"readVisible",null),Ze=e([E(Ge)],Ze);const ke=_({types:p}),He=Ze;export{He as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/PieChartRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import{read as r}from"../renderers/support/jsonUtils.js";import{rendererTypes as i,webSceneRendererTypes as o}from"../renderers/support/types.js";import s from"../request.js";import{symbolTypes as a}from"../symbols.js";import{ClonableMixin as n}from"../core/Clonable.js";import l from"../core/Collection.js";import p from"../core/Error.js";import u from"../core/Handles.js";import{clone as d}from"../core/lang.js";import y from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONMixin as m}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as h}from"../core/object.js";import{throwIfAbortError as f,whenOrAbort as b}from"../core/promiseUtils.js";import{sqlAnd as g}from"../core/sql.js";import{urlToObject as w,join as j}from"../core/urlUtils.js";import{property as v}from"../core/accessorSupport/decorators/property.js";import{cast as F}from"../core/accessorSupport/decorators/cast.js";import{reader as S}from"../core/accessorSupport/decorators/reader.js";import{subclass as I}from"../core/accessorSupport/decorators/subclass.js";import{writer as T}from"../core/accessorSupport/decorators/writer.js";import D from"../form/FormTemplate.js";import E from"../geometry/SpatialReference.js";import L from"./Layer.js";import{MemorySource as _}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as x}from"./mixins/APIKeyMixin.js";import{ArcGISService as P}from"./mixins/ArcGISService.js";import{BlendLayer as M}from"./mixins/BlendLayer.js";import{CustomParametersMixin as q}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as C}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as O}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as R}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as U}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as A}from"./mixins/OperationalLayer.js";import{OrderedLayer as Q}from"./mixins/OrderedLayer.js";import{PortalLayer as V}from"./mixins/PortalLayer.js";import{PublishableLayer as N}from"./mixins/PublishableLayer.js";import{RefreshableLayer as G}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as J}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as $}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as W,parse as B,cleanTitle as Z}from"./support/arcgisLayerUrl.js";import{id as k,labelsVisible as z,opacityDrawingInfo as H,legendEnabled as K,listMode as X,popupEnabled as Y,screenSizePerspectiveEnabled as ee}from"./support/commonProperties.js";import{ensureLayerCredential as te,computeEffectiveEditingEnabled as re,readGlobalIdField as ie,readObjectIdField as oe,createDefaultRenderer as se,addAttachment as ae,updateAttachment as ne,applyEdits as le,uploadAssets as pe,createQuery as ue,deleteAttachments as de,fetchRecomputedExtents as ye,queryAttachments as ce,queryObjectIds as me,queryFeatureCount as he,queryExtent as fe,queryRelatedFeatures as be,queryRelatedFeaturesCount as ge,hasDataChanged as we,geometryTypeKebabDict as je}from"./support/featureLayerUtils.js";import ve from"./support/FeatureTemplate.js";import Fe from"./support/FeatureType.js";import{defineFieldProperties as Se}from"./support/fieldProperties.js";import{fixRendererFields as Ie,fixTimeInfoFields as Te}from"./support/fieldUtils.js";import De from"./support/LabelClass.js";import{reader as Ee}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Le}from"./support/serviceCapabilitiesUtils.js";import _e from"./support/TimeInfo.js";import{serviceSupportsSpatialReference as xe}from"./support/versionUtils.js";import{DataLayerSource as Pe}from"./support/source/DataLayerSource.js";import{loadStyleRenderer as Me}from"../renderers/support/styleUtils.js";import qe from"../rest/support/FeatureSet.js";import Ce from"../rest/support/Query.js";import Oe from"../rest/support/TopFeaturesQuery.js";import{createPopupTemplate as Re}from"../support/popupUtils.js";import{opacityToTransparency as Ue}from"../webdoc/support/opacityUtils.js";const Ae="FeatureLayer",Qe="esri.layers.FeatureLayer",Ve=y.getLogger(Qe);function Ne(e,t){return new p("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function Ge(e){return e&&e instanceof l}const Je=Se();function $e(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let We=class extends(R(U(O(N(C(M(Q($(J(G(P(A(V(m(q(x(n(L)))))))))))))))))){constructor(...e){super(...e),this._handles=new u,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=E.WGS84,this.subtypeCode=null,this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0}destroy(){this.source?.destroy(),this._handles=c(this._handles)}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then((e=>this.initLayerProperties(e)))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection"]},e).catch(f).then((async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new p("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))})).then((()=>this._setUserPrivileges(this.serviceItemId,e))).then((()=>te(this,e)));return this.addResolvingPromise(r),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,Le(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return re(this)}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&h(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return ie(t.layerDefinition||t)}readObjectIdField(e,t){return oe(t.layerDefinition||t)}get parsedUrl(){const e=w(this.url);return null!=e&&(null!=this.dynamicDataSource?e.path=j(e.path,"dynamicLayer"):null!=this.layerId&&(e.path=j(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){Ie(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,i){t=t.layerDefinition||t;const o=t.drawingInfo?.renderer;if(o){const e=r(o,t,i)??void 0;return e||Ve.error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:i}),e}return se(t,i)}set source(e){const t=this._get("source");t!==e&&(Ge(t)&&this._resetMemorySource(t),Ge(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof l?new _({layer:this,items:e}):e:null}readSource(e,t){const r=qe.fromJSON(t.featureSet);return new _({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r&&r.creatorField,o=r&&r.editorField;return e=e&&e.map((e=>ve.fromJSON(e))),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition&&t.layerDefinition.title;if(r){const e=this.portalItem&&this.portalItem.title;if("item-title"===this.sublayerTitleMode)return this.url?W(this.url,r):r;let t=r;if(!t&&this.url){const e=B(this.url);null!=e&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),Z(t)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition&&t.layerDefinition.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r&&r.creatorField,o=r&&r.editorField;return e&&e.map((e=>(e=Fe.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e)))}readVisible(e,t){return t.layerDefinition&&null!=t.layerDefinition.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){return ae(this,e,t,Ae)}async updateAttachment(e,t,r){return ne(this,e,t,r,Ae)}async applyEdits(e,t){return le(this,e,t)}async uploadAssets(e,t){return pe(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Re(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await b(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=ue(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=g(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){return de(this,e,t,Ae)}async fetchRecomputedExtents(e){return ye(this,e,Ae)}getFeatureType(e){const{typeIdField:t,types:r}=this;if(!t||!e)return null;const i=e.attributes?e.attributes[t]:void 0;if(null==i)return null;let o=null;return r?.some((e=>{const{id:t}=e;return null!=t&&(t.toString()===i.toString()&&(o=e),!!o)})),o}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return ce(this,e,t,Ae)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(Ce.from(e)??r.createQuery(),t);if(i?.features)for(const o of i.features)o.layer=o.sourceLayer=r;return i}async queryObjectIds(e,t){return me(this,e,t,Ae)}async queryFeatureCount(e,t){return he(this,e,t,Ae)}async queryExtent(e,t){return fe(this,e,t,Ae)}async queryRelatedFeatures(e,t){return be(this,e,t,Ae)}async queryRelatedFeaturesCount(e,t){return ge(this,e,t,Ae)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new p(Ae,"Layer source does not support queryTopFeatures capability");const o=await r.queryTopFeatures(Oe.from(e),t);if(o?.features)for(const s of o.features)s.layer=s.sourceLayer=this;return o}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new p(Ae,"Layer source does not support queryTopObjectIds capability");return r.queryTopObjectIds(Oe.from(e),t)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new p(Ae,"Layer source does not support queryTopExtents capability");return r.queryTopExtents(Oe.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new p(Ae,"Layer source does not support queryFeatureCount capability");return r.queryTopCount(Oe.from(e),t)}read(e,t){const r=e.featureCollection;if(r){const e=r.layers;e&&1===e.length&&(super.read(e[0],t),null!=r.showLegend&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&"service"===t.origin&&(this.revert(["objectIdField","fields","timeInfo"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:o}=t;if(this.dynamicDataSource)return o?.push(Ne(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==i)return o?.push(Ne(this,"using a table source cannot be written to web scenes and web maps")),null;if(this._hasMemorySource())return o?.push(Ne(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===r&&"tables"===i)return o?.push(Ne(this,"using a non-table source cannot be written to tables in web maps")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new p(Ae,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||xe(this,e))}async save(e){const{save:t}=await import("./save/featureLayerUtils.js");return t(this,e)}async saveAs(e,t){const{saveAs:r}=await import("./save/featureLayerUtils.js");return r(this,e,t)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map((e=>e.trim())).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";h("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstLayerId(e){return s(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then((e=>{const t=e.data;if(t)return Array.isArray(t.layers)&&t.layers.length>0?t.layers[0].id:Array.isArray(t.tables)&&t.tables.length>0?t.tables[0].id:void 0}))}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),Ie(this.renderer,this.fieldsIndex),Te(this.timeInfo,this.fieldsIndex),Me(this,{origin:"service"})}async hasDataChanged(){return we(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach((e=>{const r=e.prototype&&e.prototype.attributes;r&&t&&delete r[t]}))}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new p("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new p("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach((e=>{e.layer=this,e.sourceLayer=this})),this._handles.add([e.on("after-add",(e=>{e.item.layer=this,e.item.sourceLayer=this})),e.on("after-remove",(e=>{e.item.layer=null,e.item.sourceLayer=null}))],"fl-source")}_resetMemorySource(e){e.forEach((e=>{e.layer=null,e.sourceLayer=null})),this._handles.remove("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}};e([S("service","capabilities")],We.prototype,"readCapabilities",null),e([v({json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],We.prototype,"charts",void 0),e([v({readOnly:!0})],We.prototype,"createQueryVersion",null),e([v({json:{read:{source:"layerDefinition.copyrightText"}}})],We.prototype,"copyright",void 0),e([v({json:{read:{source:"layerDefinition.displayField"}}})],We.prototype,"displayField",void 0),e([v({types:a,readOnly:!0})],We.prototype,"defaultSymbol",void 0),e([v({type:Pe})],We.prototype,"dynamicDataSource",void 0),e([v({type:Boolean})],We.prototype,"editingEnabled",null),e([S(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],We.prototype,"readEditingEnabled",null),e([S("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],We.prototype,"readEditingEnabledFromWebMap",null),e([T(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],We.prototype,"writeEditingEnabled",null),e([T("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],We.prototype,"writeEditingEnabledToWebMap",null),e([v({readOnly:!0})],We.prototype,"effectiveEditingEnabled",null),e([v({...Je.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:$e}}}}})],We.prototype,"fields",void 0),e([v(Je.fieldsIndex)],We.prototype,"fieldsIndex",void 0),e([v({type:D,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],We.prototype,"formTemplate",void 0),e([v({json:{read:{source:"layerDefinition.extent"}}})],We.prototype,"fullExtent",void 0),e([v({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:$e,writer(e,t,r){const i=e?je.toJSON(e):null;i&&h(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:je.read}}})],We.prototype,"geometryType",void 0),e([v({json:{read:{source:"layerDefinition.hasM"}}})],We.prototype,"hasM",void 0),e([v({json:{read:{source:"layerDefinition.hasZ"}}})],We.prototype,"hasZ",void 0),e([v(k)],We.prototype,"id",void 0),e([v({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],We.prototype,"infoFor3D",void 0),e([v({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],We.prototype,"isTable",void 0),e([S("service","isTable",["type","geometryType"]),S("isTable",["layerDefinition.type","layerDefinition.geometryType"])],We.prototype,"readIsTable",null),e([T("web-map","isTable")],We.prototype,"writeIsTable",null),e([v(z)],We.prototype,"labelsVisible",void 0),e([v({type:[De],json:{origins:{service:{read:{source:"drawingInfo.labelingInfo",reader:Ee},write:{target:"drawingInfo.labelingInfo",enabled:!1}}},read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:Ee},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],We.prototype,"labelingInfo",void 0),e([v((()=>{const e=d(H);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){h(r,Ue(e),t)}}},e})())],We.prototype,"opacity",void 0),e([v(K)],We.prototype,"legendEnabled",void 0),e([v({type:["show","hide"],json:(()=>{const e=d(X.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],We.prototype,"listMode",void 0),e([S("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],We.prototype,"readGlobalIdField",null),e([v({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:$e}}}}})],We.prototype,"objectIdField",void 0),e([S("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],We.prototype,"readObjectIdField",null),e([v({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],We.prototype,"operationalLayerType",void 0),e([v(Je.outFields)],We.prototype,"outFields",void 0),e([v({readOnly:!0})],We.prototype,"parsedUrl",null),e([v({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],We.prototype,"path",void 0),e([v(Y)],We.prototype,"popupEnabled",void 0),e([v({type:t,json:{name:"popupInfo",write:!0}})],We.prototype,"popupTemplate",void 0),e([v({readOnly:!0})],We.prototype,"defaultPopupTemplate",null),e([v({types:i,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:o,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}})],We.prototype,"renderer",null),e([S("service","renderer",["drawingInfo.renderer","defaultSymbol"]),S("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],We.prototype,"readRenderer",null),e([v((()=>{const e=d(ee);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],We.prototype,"screenSizePerspectiveEnabled",void 0),e([v({clonable:!1})],We.prototype,"source",null),e([F("source")],We.prototype,"castSource",null),e([S("portal-item","source",["featureSet"]),S("web-map","source",["featureSet"])],We.prototype,"readSource",null),e([v({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],We.prototype,"spatialReference",void 0),e([v({type:Number})],We.prototype,"subtypeCode",void 0),e([v({type:[ve]})],We.prototype,"templates",void 0),e([S("templates",["editFieldsInfo","creatorField","editorField","templates"])],We.prototype,"readTemplates",null),e([v({type:_e})],We.prototype,"timeInfo",void 0),e([v()],We.prototype,"title",void 0),e([S("service","title",["name"]),S("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],We.prototype,"readTitle",null),e([S("web-map","title",["layerDefinition.name","title"])],We.prototype,"readTitleFromWebMap",null),e([v({type:String})],We.prototype,"sublayerTitleMode",void 0),e([v({json:{read:!1}})],We.prototype,"type",void 0),e([v({type:String})],We.prototype,"typeIdField",void 0),e([S("service","typeIdField"),S("typeIdField",["layerDefinition.typeIdField"])],We.prototype,"readTypeIdField",null),e([v({type:[Fe]})],We.prototype,"types",void 0),e([S("service","types",["types"]),S("types",["layerDefinition.types"])],We.prototype,"readTypes",null),e([v({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],We.prototype,"visible",void 0),e([S("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],We.prototype,"readVisible",null),We=e([I(Qe)],We);const Be=We;export{Be as default};
|
package/layers/StreamLayer.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.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/PieChartRenderer.js";import"../renderers/Renderer.js";import r from"../renderers/SimpleRenderer.js";import o from"../renderers/UniqueValueRenderer.js";import{read as i}from"../renderers/support/jsonUtils.js";import{rendererTypes as s,webSceneRendererTypes as n}from"../renderers/support/types.js";import p from"../request.js";import{symbolTypesRenderer as a}from"../symbols.js";import l from"../core/Error.js";import{handlesGroup as m}from"../core/handleUtils.js";import d from"../core/Logger.js";import{MultiOriginJSONMixin as c}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as y}from"../core/promiseUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import{Integer as f}from"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{reader as h}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{createTypeReader as j}from"../core/accessorSupport/extensions/serializableProperty/reader.js";import{featureGeometryTypeKebabDictionary as b}from"../geometry/support/typeUtils.js";import v from"./Layer.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as w}from"./mixins/BlendLayer.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as x}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as R}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as T}from"./mixins/OperationalLayer.js";import{PortalLayer as P}from"./mixins/PortalLayer.js";import{RefreshableLayer as F}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as U}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as L}from"./mixins/TemporalLayer.js";import{labelsVisible as k,legendEnabled as D,maxScale as E,minScale as O,popupEnabled as C,screenSizePerspectiveEnabled as A,url as _}from"./support/commonProperties.js";import N from"./support/Field.js";import{defineFieldProperties as J}from"./support/fieldProperties.js";import{fixRendererFields as M,fixTimeInfoFields as G}from"./support/fieldUtils.js";import q from"./support/LabelClass.js";import{reader as V}from"./support/labelingInfo.js";import z from"./support/PurgeOptions.js";import{loadStyleRenderer as $}from"../renderers/support/styleUtils.js";import W from"../rest/support/Query.js";import{createPopupTemplate as B}from"../support/popupUtils.js";import Q from"../symbols/support/ElevationInfo.js";import H from"../geometry/SpatialReference.js";import K from"../geometry/Extent.js";const X=J();function Y(e,t){return new l("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}let Z=class extends(R(x(w(L(U(F(S(T(P(c(I(v)))))))))))){constructor(...e){super(...e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType="ArcGISStreamLayer",this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new z,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=H.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.webSocketUrl=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new l("stream-layer:websocket-unsupported","WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))),Promise.resolve(this);const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},e).catch(y).then((()=>this._fetchService(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){M(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,s){const n=(t=t.layerDefinition||t).drawingInfo&&t.drawingInfo.renderer||void 0;if(n){const e=i(n,t,s)||void 0;return e||d.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:s}),e}if(t.defaultSymbol)return t.types&&t.types.length?new o({defaultSymbol:ee(t.defaultSymbol,t,s),field:t.typeIdField,uniqueValueInfos:t.types.map((e=>({id:e.id,symbol:ee(e.symbol,e,s)})))}):new r({symbol:ee(t.defaultSymbol,t,s)})}async connect(e){const[{createConnection:t}]=await Promise.all([import("./graphics/sources/connections/createConnection.js"),this.load()]),r=this.geometryType?b.toJSON(this.geometryType):null,{customParameters:o=null,definitionExpression:i=null,geometryDefinition:s=null,maxReconnectionAttempts:n=0,maxReconnectionInterval:p=20,spatialReference:a=this.spatialReference}=e||this.createConnectionParameters(),l=t(this.parsedUrl,this.spatialReference,a,r,{geometry:s,where:i},n,p,o??void 0),d=m([this.on("send-message-to-socket",(e=>l.sendMessageToSocket(e))),this.on("send-message-to-client",(e=>l.sendMessageToClient(e)))]);return l.once("destroy",d.remove),l}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(e){return B(this,e)}createQuery(){const e=new W;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,t){if(!this.fields)return null;let r=null;return this.fields.some((t=>(t.name===e&&(r=t.domain),!!r))),r}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}sendMessageToSocket(e){this.emit("send-message-to-socket",e)}sendMessageToClient(e){this.emit("send-message-to-client",e)}write(e,t){const r=t?.messages;return this.webSocketUrl?(r?.push(Y(this,"using a custom websocket connection cannot be written to web scenes and web maps")),null):this.parsedUrl?super.write(e,t):(r?.push(Y(this,"using a client-side only connection without a url cannot be written to web scenes and web maps")),null)}async _fetchService(e){if(!!!this.webSocketUrl&&this.parsedUrl){if(!this.sourceJSON){const{data:t}=await p(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:e});this.sourceJSON=t}}else{if(!this.timeInfo?.trackIdField)throw new l("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField){const e=this.fields.find((e=>"oid"===e.type))?.name;if(!e)throw new l("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");this.objectIdField=e}if(!this.fields)throw new l("stream-layer:missing-metadata","The stream layer fields must be specified.");if(this.fields.some((e=>e.name===this.objectIdField))||this.fields.push(new N({name:this.objectIdField,alias:this.objectIdField,type:"oid"})),!this.geometryType)throw new l("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.webSocketUrl&&(this.url=this.webSocketUrl)}return this.read(this.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}),M(this.renderer,this.fieldsIndex),G(this.timeInfo,this.fieldsIndex),this.objectIdField||(this.objectIdField="__esri_stream_id__"),$(this,{origin:"service"})}};e([u({type:String})],Z.prototype,"copyright",void 0),e([u({readOnly:!0})],Z.prototype,"defaultPopupTemplate",null),e([u({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Z.prototype,"definitionExpression",void 0),e([u({type:String})],Z.prototype,"displayField",void 0),e([u({type:Q})],Z.prototype,"elevationInfo",void 0),e([u(X.fields)],Z.prototype,"fields",void 0),e([u(X.fieldsIndex)],Z.prototype,"fieldsIndex",void 0),e([u({type:K})],Z.prototype,"geometryDefinition",void 0),e([u({type:b.apiValues,json:{read:{reader:b.read}}})],Z.prototype,"geometryType",void 0),e([u(k)],Z.prototype,"labelsVisible",void 0),e([u({type:[q],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:V},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],Z.prototype,"labelingInfo",void 0),e([u(D)],Z.prototype,"legendEnabled",void 0),e([u({type:["show","hide"]})],Z.prototype,"listMode",void 0),e([u({type:f})],Z.prototype,"maxReconnectionAttempts",void 0),e([u({type:f})],Z.prototype,"maxReconnectionInterval",void 0),e([u(E)],Z.prototype,"maxScale",void 0),e([u(O)],Z.prototype,"minScale",void 0),e([u({type:String})],Z.prototype,"objectIdField",void 0),e([u({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],Z.prototype,"operationalLayerType",void 0),e([u(C)],Z.prototype,"popupEnabled",void 0),e([u({type:t,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],Z.prototype,"popupTemplate",void 0),e([u({type:z})],Z.prototype,"purgeOptions",void 0),e([u({types:s,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:n,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],Z.prototype,"renderer",null),e([h("service","renderer",["drawingInfo.renderer","defaultSymbol"]),h("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],Z.prototype,"readRenderer",null),e([u(A)],Z.prototype,"screenSizePerspectiveEnabled",void 0),e([u()],Z.prototype,"sourceJSON",void 0),e([u({type:H,json:{origins:{service:{read:{source:"spatialReference"}}}}})],Z.prototype,"spatialReference",void 0),e([u({json:{read:!1}})],Z.prototype,"type",void 0),e([u(_)],Z.prototype,"url",void 0),e([u({type:Number})],Z.prototype,"updateInterval",void 0),e([u({type:String})],Z.prototype,"webSocketUrl",void 0),Z=e([g("esri.layers.StreamLayer")],Z);const ee=j({types:a}),te=Z;export{te as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/PieChartRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import{read as r}from"../renderers/support/jsonUtils.js";import{rendererTypes as i,webSceneRendererTypes as o}from"../renderers/support/types.js";import s from"../request.js";import n from"../core/Error.js";import{handlesGroup as a}from"../core/handleUtils.js";import p from"../core/Logger.js";import{MultiOriginJSONMixin as l}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as m}from"../core/promiseUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{Integer as c}from"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import{featureGeometryTypeKebabDictionary as f}from"../geometry/support/typeUtils.js";import h from"./Layer.js";import{ArcGISService as g}from"./mixins/ArcGISService.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as v}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as b}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as I}from"./mixins/OperationalLayer.js";import{PortalLayer as S}from"./mixins/PortalLayer.js";import{RefreshableLayer as x}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as R}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as T}from"./mixins/TemporalLayer.js";import{labelsVisible as P,legendEnabled as F,maxScale as U,minScale as L,popupEnabled as D,screenSizePerspectiveEnabled as k,url as E}from"./support/commonProperties.js";import{createDefaultRenderer as O}from"./support/featureLayerUtils.js";import C from"./support/Field.js";import{defineFieldProperties as _}from"./support/fieldProperties.js";import{fixRendererFields as A,fixTimeInfoFields as N}from"./support/fieldUtils.js";import G from"./support/LabelClass.js";import{reader as J}from"./support/labelingInfo.js";import M from"./support/PurgeOptions.js";import{loadStyleRenderer as V}from"../renderers/support/styleUtils.js";import q from"../rest/support/Query.js";import{createPopupTemplate as z}from"../support/popupUtils.js";import $ from"../symbols/support/ElevationInfo.js";import W from"../geometry/SpatialReference.js";import B from"../geometry/Extent.js";const Q=_();function H(e,t){return new n("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}let K=class extends(b(v(j(T(R(x(g(I(S(l(w(h)))))))))))){constructor(...e){super(...e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType="ArcGISStreamLayer",this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new M,this.refreshInterval=0,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=W.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.useViewTime=!0,this.webSocketUrl=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new n("stream-layer:websocket-unsupported","WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))),Promise.resolve(this);const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},e).catch(m).then((()=>this._fetchService(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}set renderer(e){A(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,i){t=t.layerDefinition||t;const o=t.drawingInfo?.renderer;if(o){const e=r(o,t,i)||void 0;return e||p.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:i}),e}return O(t,i)}async connect(e){const[{createConnection:t}]=await Promise.all([import("./graphics/sources/connections/createConnection.js"),this.load()]),r=this.geometryType?f.toJSON(this.geometryType):null,{customParameters:i=null,definitionExpression:o=null,geometryDefinition:s=null,maxReconnectionAttempts:n=0,maxReconnectionInterval:p=20,spatialReference:l=this.spatialReference}=e||this.createConnectionParameters(),m=t(this.parsedUrl,this.spatialReference,l,r,{geometry:s,where:o},n,p,i??void 0),d=a([this.on("send-message-to-socket",(e=>m.sendMessageToSocket(e))),this.on("send-message-to-client",(e=>m.sendMessageToClient(e)))]);return m.once("destroy",d.remove),m}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(e){return z(this,e)}createQuery(){const e=new q;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,t){if(!this.fields)return null;let r=null;return this.fields.some((t=>(t.name===e&&(r=t.domain),!!r))),r}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}sendMessageToSocket(e){this.emit("send-message-to-socket",e)}sendMessageToClient(e){this.emit("send-message-to-client",e)}write(e,t){const r=t?.messages;return this.webSocketUrl?(r?.push(H(this,"using a custom websocket connection cannot be written to web scenes and web maps")),null):this.parsedUrl?super.write(e,t):(r?.push(H(this,"using a client-side only connection without a url cannot be written to web scenes and web maps")),null)}async _fetchService(e){if(!!!this.webSocketUrl&&this.parsedUrl){if(!this.sourceJSON){const{data:t}=await s(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:e});this.sourceJSON=t}}else{if(!this.timeInfo?.trackIdField)throw new n("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField){const e=this.fields.find((e=>"oid"===e.type))?.name;if(!e)throw new n("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");this.objectIdField=e}if(!this.fields)throw new n("stream-layer:missing-metadata","The stream layer fields must be specified.");if(this.fields.some((e=>e.name===this.objectIdField))||this.fields.push(new C({name:this.objectIdField,alias:this.objectIdField,type:"oid"})),!this.geometryType)throw new n("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.webSocketUrl&&(this.url=this.webSocketUrl)}return this.read(this.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}),A(this.renderer,this.fieldsIndex),N(this.timeInfo,this.fieldsIndex),this.objectIdField||(this.objectIdField="__esri_stream_id__"),V(this,{origin:"service"})}};e([d({type:String})],K.prototype,"copyright",void 0),e([d({readOnly:!0})],K.prototype,"defaultPopupTemplate",null),e([d({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],K.prototype,"definitionExpression",void 0),e([d({type:String})],K.prototype,"displayField",void 0),e([d({type:$})],K.prototype,"elevationInfo",void 0),e([d({json:{origins:{"web-map":{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],K.prototype,"featureReduction",null),e([d(Q.fields)],K.prototype,"fields",void 0),e([d(Q.fieldsIndex)],K.prototype,"fieldsIndex",void 0),e([d({type:B,json:{name:"layerDefinition.definitionGeometry",write:!0}})],K.prototype,"geometryDefinition",void 0),e([d({type:f.apiValues,json:{read:{reader:f.read}}})],K.prototype,"geometryType",void 0),e([d(P)],K.prototype,"labelsVisible",void 0),e([d({type:[G],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:J},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],K.prototype,"labelingInfo",void 0),e([d(F)],K.prototype,"legendEnabled",void 0),e([d({type:["show","hide"]})],K.prototype,"listMode",void 0),e([d({type:c})],K.prototype,"maxReconnectionAttempts",void 0),e([d({type:c})],K.prototype,"maxReconnectionInterval",void 0),e([d(U)],K.prototype,"maxScale",void 0),e([d(L)],K.prototype,"minScale",void 0),e([d({type:String})],K.prototype,"objectIdField",void 0),e([d({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],K.prototype,"operationalLayerType",void 0),e([d(D)],K.prototype,"popupEnabled",void 0),e([d({type:t,json:{name:"popupInfo",write:!0}})],K.prototype,"popupTemplate",void 0),e([d({type:M})],K.prototype,"purgeOptions",void 0),e([d({json:{read:!1,write:!1}})],K.prototype,"refreshInterval",void 0),e([d({types:i,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:o,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],K.prototype,"renderer",null),e([u("service","renderer",["drawingInfo.renderer","defaultSymbol"]),u("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],K.prototype,"readRenderer",null),e([d(k)],K.prototype,"screenSizePerspectiveEnabled",void 0),e([d()],K.prototype,"sourceJSON",void 0),e([d({type:W,json:{origins:{service:{read:{source:"spatialReference"}}}}})],K.prototype,"spatialReference",void 0),e([d({json:{read:!1}})],K.prototype,"type",void 0),e([d(E)],K.prototype,"url",void 0),e([d({type:Number})],K.prototype,"updateInterval",void 0),e([d({json:{read:!1,write:!1}})],K.prototype,"useViewTime",void 0),e([d({type:String})],K.prototype,"webSocketUrl",void 0),K=e([y("esri.layers.StreamLayer")],K);const X=K;export{X as default};
|