@arcgis/core 4.28.0-next.20230621 → 4.28.0-next.20230622
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/05c0fdbfc82538f2f68d.js +1 -0
- package/assets/esri/core/workers/chunks/0bd95f46a0a9005a19f9.js +1 -0
- package/assets/esri/core/workers/chunks/19b4f02fb2392d964582.js +1 -0
- package/assets/esri/core/workers/chunks/26212a08ea383547335b.js +1 -0
- package/assets/esri/core/workers/chunks/{2420ec029236ab31d908.js → 2882a55a971af1f7858b.js} +1 -1
- package/assets/esri/core/workers/chunks/303238fc2fcdbb277981.js +1 -0
- package/assets/esri/core/workers/chunks/42dfebbe964f2b44ffab.js +1 -0
- package/assets/esri/core/workers/chunks/{4b235d1b6a72773cd4f4.js → 57bb8516fa998a0fba78.js} +1 -1
- package/assets/esri/core/workers/chunks/6208f2dfa9dfd3bca000.js +1 -0
- package/assets/esri/core/workers/chunks/64008bde5d3ffd9f2499.js +1 -0
- package/assets/esri/core/workers/chunks/{c1dfbda75abc748a6ca4.js → 6aa42f510969014db3f4.js} +1 -1
- package/assets/esri/core/workers/chunks/{cfe379a78a983373b3ac.js → 7304f45f5622a68253e4.js} +1 -1
- package/assets/esri/core/workers/chunks/733b70d6e5c466a67e9c.js +1 -0
- package/assets/esri/core/workers/chunks/7694521b44681d52b713.js +1 -0
- package/assets/esri/core/workers/chunks/80aa79040c0a7d039c3d.js +1 -0
- package/assets/esri/core/workers/chunks/91f957cd49a95a8a95f5.js +1 -0
- package/assets/esri/core/workers/chunks/{42b6315e21c4c1345ba5.js → 9f5337a80963e0b3c009.js} +1 -1
- package/assets/esri/core/workers/chunks/a16458b4653b284b4b80.js +1 -0
- package/assets/esri/core/workers/chunks/a54f361506012be46fdb.js +1 -0
- package/assets/esri/core/workers/chunks/{cfc3dcca2b69d20d5375.js → c0b9cc091efd5db827de.js} +1 -1
- package/assets/esri/core/workers/chunks/ce7f575a6c2053c7ca17.js +1 -0
- package/assets/esri/core/workers/chunks/d24f7ef6eca8c91b90b4.js +1 -0
- package/assets/esri/core/workers/chunks/dbd86e4b7983873cbe7c.js +1 -0
- package/assets/esri/core/workers/chunks/{3c3f65913006b84b2289.js → de20572d334abd4a7d82.js} +1 -1
- package/assets/esri/core/workers/chunks/{c8702e53a8ad6cf6ab85.js → dede2b4948f1f07a9859.js} +1 -1
- package/assets/esri/core/workers/chunks/e3f7d464f6d74523fc13.js +1 -0
- package/assets/esri/core/workers/chunks/f6040205c50e2795a1a0.js +1 -0
- package/assets/esri/core/workers/chunks/{915734255a79bff3ef0f.js → fcd54e9e64c2864f183c.js} +1 -1
- package/assets/esri/t9n/common.json +1 -1
- package/assets/esri/t9n/common_en.json +1 -1
- package/assets/esri/themes/base/_core.scss +6 -2
- package/assets/esri/themes/base/_mixins.scss +0 -147
- package/assets/esri/themes/base/widgets/_AreaMeasurement2D.scss +0 -8
- package/assets/esri/themes/base/widgets/_AreaMeasurement3D.scss +0 -8
- package/assets/esri/themes/base/widgets/_DirectLineMeasurement3D.scss +0 -1
- package/assets/esri/themes/base/widgets/_DistanceMeasurement2D.scss +0 -1
- package/assets/esri/themes/base/widgets/_MeasurementWidgetContent.scss +58 -0
- package/assets/esri/themes/base/widgets/_UnitSelect.scss +14 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/AreaMeasurement2D/t9n/AreaMeasurement2D.json +1 -1
- package/assets/esri/widgets/AreaMeasurement2D/t9n/AreaMeasurement2D_en.json +1 -1
- package/assets/esri/widgets/AreaMeasurement3D/t9n/AreaMeasurement3D.json +1 -1
- package/assets/esri/widgets/AreaMeasurement3D/t9n/AreaMeasurement3D_en.json +1 -1
- package/assets/esri/widgets/DirectLineMeasurement3D/t9n/DirectLineMeasurement3D.json +1 -1
- package/assets/esri/widgets/DirectLineMeasurement3D/t9n/DirectLineMeasurement3D_en.json +1 -1
- package/assets/esri/widgets/DistanceMeasurement2D/t9n/DistanceMeasurement2D.json +1 -1
- package/assets/esri/widgets/DistanceMeasurement2D/t9n/DistanceMeasurement2D_en.json +1 -1
- package/core/promiseUtils.js +1 -1
- package/geometry/projection.js +1 -1
- package/interfaces.d.ts +270 -5
- package/layers/LinkChartLayer.d.ts +4 -0
- package/layers/LinkChartLayer.js +1 -1
- package/layers/support/TileInfoTilemapCache.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/labelPlacement.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/DisplayQualityProfile.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/support/SceneViewPerformanceInfo.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +0 -1
- package/views/3d/webgl-engine/lib/Highlight.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +5 -0
- package/widgets/support/UnitSelect.js +5 -0
- package/assets/esri/core/workers/chunks/07f16ea775b39a1a4a7b.js +0 -1
- package/assets/esri/core/workers/chunks/1bbc868d2430103951eb.js +0 -1
- package/assets/esri/core/workers/chunks/1d2ef88a8d028adef102.js +0 -1
- package/assets/esri/core/workers/chunks/39ae4b9b766f674bc6f2.js +0 -1
- package/assets/esri/core/workers/chunks/3b3d676b609c47a77164.js +0 -1
- package/assets/esri/core/workers/chunks/3d9a8cb638cf9b8ca4b3.js +0 -1
- package/assets/esri/core/workers/chunks/45629ff775e77234b227.js +0 -1
- package/assets/esri/core/workers/chunks/642510b0371311ff8e16.js +0 -1
- package/assets/esri/core/workers/chunks/7e4013f8c31c9a9438c6.js +0 -1
- package/assets/esri/core/workers/chunks/82939ead43848a13f765.js +0 -1
- package/assets/esri/core/workers/chunks/8b6b963230df56850580.js +0 -1
- package/assets/esri/core/workers/chunks/a9e9297267614c4c4f3b.js +0 -1
- package/assets/esri/core/workers/chunks/b31974524932e638df8c.js +0 -1
- package/assets/esri/core/workers/chunks/b75b4b132dbd9cb9d372.js +0 -1
- package/assets/esri/core/workers/chunks/cad7a2092ea7f51dbd8b.js +0 -1
- package/assets/esri/core/workers/chunks/d2a127f7bb0e2ba14a13.js +0 -1
- package/assets/esri/core/workers/chunks/e097f41bbfac00250477.js +0 -1
- package/assets/esri/core/workers/chunks/e55f80b774e090a0aa04.js +0 -1
- package/assets/esri/core/workers/chunks/e668c7e2e61aae6ca6e0.js +0 -1
- package/assets/esri/core/workers/chunks/f0299d93a95f40ea7cf7.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"hint":"Start to measure by clicking in the map to place your first point","mode":"Mode","modes":{"auto":"Auto","planar":"Planar","geodesic":"Geodesic"},"newMeasurement":"New measurement","perimeter":"Perimeter","unit":"Unit","unsupported":"2D area measurement is only supported in MapView.","widgetLabel":"Area Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"hint":"Start to measure by clicking in the map to place your first point","mode":"Mode","modes":{"auto":"Auto","planar":"Planar","geodesic":"Geodesic"},"newMeasurement":"New measurement","perimeter":"Perimeter","unit":"Unit","unsupported":"2D area measurement is only supported in MapView.","widgetLabel":"Area Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"area":"Area","hint":"Start to measure by clicking in the scene to place your first point.","newMeasurement":"New measurement","perimeterLength":"Perimeter","snappingDisablePrompt":"Press and hold the Ctrl key to temporarily disable snapping.","snappingDisablePromptAlternate":"Hold the Ctrl key to temporarily disable snapping.","unit":"Unit","unsupported":"3D area measurement is only supported in SceneView.","widgetLabel":"Area Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"area":"Area","hint":"Start to measure by clicking in the scene to place your first point.","newMeasurement":"New measurement","perimeterLength":"Perimeter","snappingDisablePrompt":"Press and hold the Ctrl key to temporarily disable snapping.","snappingDisablePromptAlternate":"Hold the Ctrl key to temporarily disable snapping.","unit":"Unit","unsupported":"3D area measurement is only supported in SceneView.","widgetLabel":"Area Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"direct":"Direct","distance":"Distance","hint":"Start to measure by clicking in the scene to place your first point.","horizontal":"Horizontal","newMeasurement":"New measurement","snappingDisablePrompt":"Press and hold the Ctrl key to temporarily disable snapping.","snappingDisablePromptAlternate":"Hold the Ctrl key to temporarily disable snapping.","unit":"Unit","unsupported":"3D direct line measurement is only supported in SceneView.","vertical":"Vertical","widgetLabel":"Direct Line Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"direct":"Direct","distance":"Distance","hint":"Start to measure by clicking in the scene to place your first point.","horizontal":"Horizontal","newMeasurement":"New measurement","snappingDisablePrompt":"Press and hold the Ctrl key to temporarily disable snapping.","snappingDisablePromptAlternate":"Hold the Ctrl key to temporarily disable snapping.","unit":"Unit","unsupported":"3D direct line measurement is only supported in SceneView.","vertical":"Vertical","widgetLabel":"Direct Line Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"distance":"Distance","hint":"Start to measure by clicking in the map to place your first point","mode":"Mode","modes":{"auto":"Auto","planar":"Planar","geodesic":"Geodesic"},"newMeasurement":"New measurement","unit":"Unit","unsupported":"2D distance measurement is only supported in MapView.","widgetLabel":"Distance Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"distance":"Distance","hint":"Start to measure by clicking in the map to place your first point","mode":"Mode","modes":{"auto":"Auto","planar":"Planar","geodesic":"Geodesic"},"newMeasurement":"New measurement","unit":"Unit","unsupported":"2D distance measurement is only supported in MapView.","widgetLabel":"Distance Measurement"}
|
package/core/promiseUtils.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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clock as t}from"./clock.js";import
|
|
5
|
+
import{clock as t}from"./clock.js";import n from"./Error.js";import{once as r}from"./events.js";import e from"./Logger.js";import{removeMaybe as o}from"./maybe.js";async function i(t,n){const r=t.slice(),e=await Promise.all(t.map(((t,r)=>n(t,r))));return r.filter(((t,n)=>e[n]))}function u(t="Aborted"){return new n("AbortError",t)}function c(t,n="Aborted"){if(l(t))throw u(n)}function s(t){return null!=t?"aborted"in t?t:t.signal:t}function l(t){const n=s(t);return null!=n&&n.aborted}function a(t){if(b(t))throw t}function f(t){if(!b(t))throw t}function m(t,n){const e=s(t);if(null!=e){if(!e.aborted)return r(e,"abort",(()=>n()));n()}}function h(t,n){const e=s(t);if(null!=e)return c(e),r(e,"abort",(()=>n(u())))}function w(t,n){return null==s(n)?t:new Promise(((r,e)=>{let i=m(n,(()=>e(u())));const c=()=>i=o(i);t.then(c,c),t.then(r,e)}))}function p(t,r,e){return Promise.race([t,P(r).then((()=>{throw new n("timeout",`Did not resolve within ${r} milliseconds (${e??"timeout"})`)}))])}function b(t){return"AbortError"===t?.name}async function d(t){try{return await t}catch(n){if(!b(n))throw n;return}}async function v(t,n=e.getLogger("esri")){try{return await t}catch(r){b(r)||n.error(r)}}async function y(t){if(!t)return;if("function"!=typeof t.forEach){const n=Object.keys(t),r=n.map((n=>t[n])),e=await y(r),o={};return n.map(((t,n)=>o[t]=e[n])),o}const n=t;return Promise.allSettled(n).then((t=>Array.from(n,((n,r)=>{const e=t[r];return"fulfilled"===e.status?{promise:n,value:e.value}:{promise:n,error:e.reason}}))))}async function j(t){return(await y(t)).filter((t=>!!t.value)).map((t=>t.value))}function P(t,n=void 0,r){const e=new AbortController;return m(r,(()=>e.abort())),new Promise(((r,o)=>{let i=setTimeout((()=>{i=0,r(n)}),t);m(e,(()=>{i&&(clearTimeout(i),o(u()))}))}))}function g(t,r,e,o){const i=e&&"abort"in e?e:null;null!=o||i||(o=e);let u=setTimeout((()=>{u=0,i&&i.abort()}),r);const c=()=>o||new n("promiseUtils:timeout","The wrapped promise did not resolve within "+r+" ms");return t.then((t=>{if(0===u)throw c();return clearTimeout(u),t}),(t=>{throw clearTimeout(u),0===u?c():t}))}function A(t){return t&&"function"==typeof t.then}function T(t){return A(t)?t:Promise.resolve(t)}function E(t,n=-1){let r,e,o,i,c=null;const s=(...l)=>{if(r){e=l,i&&i.reject(u()),i=k();const t=i.promise;if(c){const t=c;c=null,t.abort()}return t}if(o=i||k(),i=null,n>0){const e=new AbortController;r=T(t(...l,e.signal));const o=r;P(n).then((()=>{r===o&&(i?e.abort():c=e)}))}else r=1,r=T(t(...l));const a=()=>{const t=e;e=o=r=c=null,null!=t&&s(...t)},f=r,m=o;return f.then(a,a),f.then(m.resolve,m.reject),m.promise};return s}function k(){let n,r;const e=new Promise(((t,e)=>{n=t,r=e})),o=t=>{n(t)};return o.resolve=t=>n(t),o.reject=t=>r(t),o.timeout=(n,r)=>t.setTimeout((()=>o.reject(r)),n),o.promise=e,o}function C(t,n){return t.then(n,n)}function L(t,n){n.then(t.resolve,t.reject)}async function $(t){await Promise.resolve(),c(t)}export{P as after,C as always,u as createAbortError,k as createResolver,E as debounce,y as eachAlways,j as eachAlwaysValues,i as filter,d as ignoreAbortErrors,b as isAbortError,l as isAborted,A as isPromiseLike,v as logOnError,m as onAbort,h as onAbortOrThrow,L as settleWithPromise,a as throwIfAbortError,c as throwIfAborted,f as throwIfNotAbortError,g as timeout,$ as waitTick,T as when,w as whenOrAbort,p as whenOrTimeout};
|
package/geometry/projection.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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import n from"../core/Error.js";import{clamp as e,deg2rad as t,rad2deg as l,asinClamped as r}from"../core/mathUtils.js";import{throwIfAborted as u,waitTick as o}from"../core/promiseUtils.js";import{getMetersPerUnitForSR as s}from"../core/unitUtils.js";import{trackAccess as i}from"../core/accessorSupport/tracking.js";import{SimpleObservable as a}from"../core/accessorSupport/tracking/SimpleObservable.js";import{f as c,i as E,t as C}from"../chunks/mat4.js";import{c as R,a as f,b as A,n as _,l as S,s as P}from"../chunks/vec3.js";import{c as p}from"../chunks/vec3f64.js";import{SphericalECEFSpatialReferenceLike as L,WGS84ECEFSpatialReferenceLike as O,SphericalPCPFMarsLike as M,SphericalPCPFMoonLike as N}from"./ellipsoidUtils.js";import G from"./Extent.js";import h from"./Multipoint.js";import{l as W,p as m,i as T}from"../chunks/pe.js";import F from"./Point.js";import I from"./Polygon.js";import d from"./Polyline.js";import{copy as H}from"./support/aaBoundingRect.js";import{earth as g,moon as B,mars as j}from"./support/Ellipsoid.js";import{earthEllipsoidConstants as y}from"./support/geodesicConstants.js";import U from"./support/GeographicTransformation.js";import{equals as w,isValid as x,isWGS84 as K,isWebMercator as k,isPlateCarree as b,isMars as z,isMoon as v}from"./support/spatialReferenceUtils.js";import{SupportedGCSWkids as q}from"./support/SupportedGCSWkids.js";import{getGeometryZScaler as Z}from"./support/zscale.js";let V=null,X=null,D=null,J={};const Q=new a;function Y(){return!!V&&T()}function $(n){return null==D&&(D=Promise.all([W(),import("../chunks/geometryEngineBase.js").then((n=>n.g)),import("./geometryAdapters/hydrated.js")])),D.then((([,e,{hydratedAdapter:t}])=>{u(n),X=t,V=e.default,V._enableProjection(m),Q.notify()}))}function nn(n,e,t=null,l=null){return Array.isArray(n)?0===n.length?[]:en(X,n,n[0].spatialReference,e,t,l):en(X,[n],n.spatialReference,e,t,l)[0]}function en(n,e,t,l,r=null,u=null){if(null==t||null==l)return e;if(Cn(t,l,r))return e.map((n=>An(n,t,l)));if(null==r){const n=U.cacheKey(t,l);void 0!==J[n]?r=J[n]:(null==(r=rn(t,l,void 0))&&(r=new U),J[n]=r)}if(null==V||null==n)throw new on;return null!=u?V._project(n,e,t,l,r,u):V._project(n,e,t,l,r)}function tn(n,e){const t=ln([n],e);return null!=t.pending?{pending:t.pending,geometry:null}:null!=t.geometries?{pending:null,geometry:t.geometries[0]}:{pending:null,geometry:null}}function ln(n,e){if(!Y())for(const t of n)if(null!=t&&!w(t.spatialReference,e)&&x(t.spatialReference)&&x(e)&&!Cn(t.spatialReference,e))return i(Q),{pending:$(),geometries:null};return{pending:null,geometries:n.map((n=>null==n?null:w(n.spatialReference,e)?n:x(n.spatialReference)&&x(e)?En(n,e):null))}}function rn(n,e,t=null){if(null==n||null==e)return null;if(null==V||null==X)throw new on;const l=V._getTransformation(X,n,e,t,t?.spatialReference);return null!==l?U.fromGE(l):null}function un(n,e,t=null){if(null==V||null==X)throw new on;const l=V._getTransformationBySuitability(X,n,e,t,t?.spatialReference);if(null!==l){const n=[];for(const e of l)n.push(U.fromGE(e));return n}return[]}class on extends n{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}var sn;function an(){V=null,X=null,D=null,J={}}!function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",n[n.WGS84=2]="WGS84",n[n.WEB_MERCATOR=3]="WEB_MERCATOR",n[n.WGS84_ECEF=4]="WGS84_ECEF",n[n.CGCS2000=5]="CGCS2000",n[n.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",n[n.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",n[n.GCSMARS2000=8]="GCSMARS2000",n[n.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",n[n.GCSMOON2000=10]="GCSMOON2000",n[n.LON_LAT=11]="LON_LAT",n[n.PLATE_CARREE=12]="PLATE_CARREE"}(sn||(sn={}));const cn={get loadPromise(){return D}};function En(n,e){try{const t=nn(n,e);if(null==t)return null;"xmin"in n&&"xmin"in t&&(t.zmin=n.zmin,t.zmax=n.zmax);const l=Z(t.type,n.spatialReference,e);return null!=l&&l(t),t}catch(t){if(!(t instanceof on))throw t;return null}}function Cn(n,e,t){return!t&&(!!w(n,e)||x(n)&&x(e)&&!!Te(n,e,ge))}async function Rn(n,e,t,l){if(Y())return o(l);if(Array.isArray(n)){for(const{source:r,dest:u,geographicTransformation:o}of n)if(!Cn(r,u,o))return $(l)}else if(!Cn(n,e,t))return $(l);return o(l)}function fn(n,e){switch(Te(n,e,ge)){case Xn:return"copy3";case Ae:return"wgs84ToSphericalECEF";case $n:return"wgs84ToWebMercator";case te:return"wgs84ToPlateCarree";case Ne:return"wgs84ToWGS84ECEF";case Dn:return"webMercatorToWGS84";case Jn:return"webMercatorToSphericalECEF";case Qn:return"webMercatorToWGS84ECEF";case re:return"webMercatorToPlateCarree";case Ge:return"wgs84ECEFToWGS84";case he:return"wgs84ECEFToSphericalECEF";case We:return"wgs84ECEFToWebMercator";case pe:return"sphericalECEFToWGS84";case Le:return"sphericalECEFToWebMercator";case Pe:return"sphericalMarsPCPFToMars2000";case Se:return"sphericalMoonPCPFToMoon2000";case Oe:return"sphericalECEFToWGS84ECEF";case fe:return"mars2000ToSphericalPCPF";case Re:return"moon2000ToSphericalPCPF";default:return null}}function An(n,e,t){return n?"x"in n?Sn(n,e,new F,t,0):"xmin"in n?mn(n,e,new G,t,0):"rings"in n?hn(n,e,new I,t,0):"paths"in n?On(n,e,new d,t,0):"points"in n?pn(n,e,new h,t,0):null:null}function _n(n,e,t=e.spatialReference,l=0){return null!=t&&null!=n.spatialReference&&null!=Sn(n,n.spatialReference,e,t,l)}function Sn(n,e,t,l,r){Ke[0]=n.x,Ke[1]=n.y;const u=n.z;return Ke[2]=void 0!==u?u:r,yn(Ke,e,0,Ke,l,0,1)?(t.x=Ke[0],t.y=Ke[1],t.spatialReference=l,void 0===u?(t.z=void 0,t.hasZ=!1):(t.z=Ke[2],t.hasZ=!0),void 0===n.m?(t.m=void 0,t.hasM=!1):(t.m=n.m,t.hasM=!0),t):null}function Pn(n,e,t=e.spatialReference,l=0){return null!=n.spatialReference&&null!=t&&null!=pn(n,n.spatialReference,e,t,l)}function pn(n,e,t,l,r){const{points:u,hasZ:o,hasM:s}=n,i=[],a=u.length,c=[];for(const E of u)c.push(E[0],E[1],o?E[2]:r);if(!yn(c,e,0,c,l,0,a))return null;for(let E=0;E<a;++E){const n=3*E,e=c[n],t=c[n+1];o&&s?i.push([e,t,c[n+2],u[E][3]]):o?i.push([e,t,c[n+2]]):s?i.push([e,t,u[E][2]]):i.push([e,t])}return t.points=i,t.spatialReference=l,t.hasZ=o,t.hasM=s,t}function Ln(n,e,t=e.spatialReference,l=0){return null!=n.spatialReference&&null!=t&&null!=On(n,n.spatialReference,e,t,l)}function On(n,e,t,l,r){const{paths:u,hasZ:o,hasM:s}=n,i=[];return wn(u,o??!1,s??!1,e,i,l,r)?(t.paths=i,t.spatialReference=l,t.hasZ=o,t.hasM=s,t):null}function Mn({hasZ:n,spatialReference:e,paths:t},l,r=0){const u=Vn(e,de),o=me[u][sn.WGS84_COMPARABLE_LON_LAT];if(null==o)return!1;const s=n?n=>n:n=>P(Ke,n[0],n[1],r);for(const i of t){const n=[];for(const e of i){const t=[0,0,r];o(s(e),0,t,0),n.push(t)}l.push(n)}return!0}function Nn({hasZ:n,spatialReference:e,rings:t},l,r=0){const u=Vn(e,de),o=me[u][sn.WGS84_COMPARABLE_LON_LAT];if(null==o)return!1;const s=n?n=>n:n=>P(Ke,n[0],n[1],r);for(const i of t){const n=[];for(const e of i){const t=[0,0,r];o(s(e),0,t,0),n.push(t)}l.push(n)}return!0}function Gn(n,e,t=e.spatialReference,l=0){return null!=n.spatialReference&&null!=t&&null!=hn(n,n.spatialReference,e,t,l)}function hn(n,e,t,l,r){const{rings:u,hasZ:o,hasM:s}=n,i=[];return wn(u,o??!1,s??!1,e,i,l,r)?(t.rings=i,t.spatialReference=l,t.hasZ=o,t.hasM=s,t):null}function Wn(n,e,t=e.spatialReference,l=0){return null!=n.spatialReference&&null!=t&&null!=mn(n,n.spatialReference,e,t,l)}function mn(n,e,t,l,r){const{xmin:u,ymin:o,xmax:s,ymax:i,hasZ:a,hasM:c}=n;if(!dn(u,o,a?n.zmin:r,e,Ke,l))return null;t.xmin=Ke[0],t.ymin=Ke[1],a&&(t.zmin=Ke[2]);return dn(s,i,a?n.zmax:r,e,Ke,l)?(t.xmax=Ke[0],t.ymax=Ke[1],a&&(t.zmax=Ke[2]),c&&(t.mmin=n.mmin,t.mmax=n.mmax),t.spatialReference=l,t):null}function Tn(n,e,t){if(null==e||null==t)return null;const l=new F({spatialReference:t});return yn(n,e,0,Ke,t,0,1)?(l.x=Ke[0],l.y=Ke[1],l.z=Ke[2],l):null}function Fn(n,e,t){return yn(n,e,0,Ke,t.spatialReference,0,1)?(t.x=Ke[0],t.y=Ke[1],t.z=Ke[2],t):null}function In(n,e,t,l=0){Ke[0]=n.x,Ke[1]=n.y;const r=n.z;return Ke[2]=void 0!==r?r:l,yn(Ke,n.spatialReference,0,e,t,0,1)}function dn(n,e,t,l,r,u){return Ue[0]=n,Ue[1]=e,Ue[2]=t,yn(Ue,l,0,r,u,0,1)}function Hn(n,e,t,l){return!(null==e||null==l||n.length<2)&&(2===n.length&&(Ue[0]=n[0],Ue[1]=n[1],Ue[2]=0,n=Ue),yn(n,e,0,t,l,0,1))}function gn(n,e){Ke[0]=n.x,Ke[1]=n.y;const t=n.z;return Ke[2]=void 0!==t?t:0,Bn(Ke,n.spatialReference,e)}function Bn(n,e,t){return jn(n,e,t)}function jn(n,e,t){if(null==e)return!1;const l=Vn(e,de),r=me[l][sn.WGS84_COMPARABLE_LON_LAT];return null!=r&&(r(n,0,Ue,0),t!==Ue&&(t[0]=Ue[0],t[1]=Ue[1],t.length>2&&(t[2]=Ue[2])),!0)}function yn(n,e,t,l,r,u,o=1){const s=Te(e,r,ge);if(null==s)return!1;if(s===Xn){if(n===l&&t===u)return!0;const e=t+3*o;for(let r=t,o=u;r<e;r++,o++)l[o]=n[r];return!0}const i=t+3*o;for(let a=t,c=u;a<i;a+=3,c+=3)s(n,a,l,c);return!0}function Un(n,e,t,l,r){R(Ke,n),f(ke,n,e),Hn(Ke,t,Ke,r),Hn(ke,t,ke,r),A(l,ke,Ke),_(l,l)}function wn(n,e,t,l,r,u,o=0){const s=new Array;for(const a of n)for(const n of a)s.push(n[0],n[1],e?n[2]:o);if(!yn(s,l,0,s,u,0,s.length/3))return!1;let i=0;r.length=0;for(const a of n){const n=new Array;for(const l of a)e&&t?n.push([s[i++],s[i++],s[i++],l[3]]):e?n.push([s[i++],s[i++],s[i++]]):t?(n.push([s[i++],s[i++],l[2]]),i++):(n.push([s[i++],s[i++]]),i++);r.push(n)}return!0}function xn(n,e,t,l){if(null==e||null==l)return!1;const r=Fe(e,l,Be);if(r.projector===Xn)return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],!0;if(null==r.projector)return!1;const{source:u,dest:o}=r;if(o.spatialReferenceId===sn.WEB_MERCATOR){const e=me[u.spatialReferenceId][sn.WGS84];return null!=e&&(e(n,0,we,0),$n(we,0,t,0),t[3]=Kn(we[1],n[2],n[3],g.radius),!0)}if(u.spatialReferenceId!==sn.WGS84&&u.spatialReferenceId!==sn.CGCS2000||o.spatialReferenceId!==sn.PLATE_CARREE){r.projector(n,0,t,0);const e=u.metersPerUnit??1,l=o.metersPerUnit??1;t[3]=n[3]*e/l}else{const e=me[u.spatialReferenceId][sn.SPHERICAL_ECEF],l=me[sn.SPHERICAL_ECEF][sn.PLATE_CARREE];let o=n[3];null!=e&&null!=l&&(o=Kn(n[1],n[2],n[3],g.radius)),r.projector(n,0,t,0),t[3]=o}return!0}function Kn(n,e,t,l){const r=l+e;if(r<l/2||t>r)return Number.MAX_VALUE;const u=Math.abs(je*n)+Math.asin(t/r);return u>=Math.PI/2?Number.MAX_VALUE:t/Math.cos(u)}function kn(n,e,t,l){return null!=n&&(w(e,l)?(H(t,n),!0):(Ue[0]=n[0],Ue[1]=n[1],Ue[2]=0,!!yn(Ue,e,0,Ue,l,0,1)&&(t[0]=Ue[0],t[1]=Ue[1],Ue[0]=n[2],Ue[1]=n[3],Ue[2]=0,!!yn(Ue,e,0,Ue,l,0,1)&&(t[2]=Ue[0],t[3]=Ue[1],!0))))}function bn(n,e,t,l){if(null==e||null==l)return!1;const r=Vn(e,de),u=Vn(l,He);if(r===u&&r!==sn.UNKNOWN||w(e,l))return t[0]=1,t[1]=1,t[2]=1,!0;if(r===sn.SPHERICAL_ECEF){const e=S(n),l=e/Math.sqrt(n[0]*n[0]+n[1]*n[1]),r=e/g.radius;if(u===sn.WEB_MERCATOR)return t[0]=l*r,t[1]=l*r,t[2]=1,!0;if(u===sn.WGS84||u===sn.CGCS2000){const n=ee;return t[0]=n*l*r,t[1]=n*r,t[2]=1,!0}}else if(r===sn.PLATE_CARREE){if(u===sn.WGS84||u===sn.CGCS2000)return t[0]=ee,t[1]=ee,t[2]=1,!0;if(u===sn.WEB_MERCATOR){const e=n[1]/g.radius;return t[0]=1,t[1]=1/Math.cos(e),t[2]=1,!0}}return!1}function zn(n,e,t,l){if(null==n||null==l)return!1;const r=Vn(n,de),u=Vn(l,He);if(r===u&&!vn(u)&&(r!==sn.UNKNOWN||w(n,l)))return c(t,e),!0;if(vn(u)){const n=me[r][sn.LON_LAT],l=me[sn.LON_LAT][u];return null!=n&&null!=l&&(n(e,0,we,0),l(we,0,xe,0),qn(je*we[0],je*we[1],t),t[12]=xe[0],t[13]=xe[1],t[14]=xe[2],!0)}if((u===sn.WEB_MERCATOR||u===sn.PLATE_CARREE)&&(r===sn.WGS84||r===sn.CGCS2000&&u===sn.PLATE_CARREE||r===sn.SPHERICAL_ECEF||r===sn.WEB_MERCATOR)){const n=me[r][sn.LON_LAT],l=me[sn.LON_LAT][u];return null!=n&&null!=l&&(n(e,0,we,0),l(we,0,xe,0),r===sn.SPHERICAL_ECEF?Zn(je*we[0],je*we[1],t):E(t),t[12]=xe[0],t[13]=xe[1],t[14]=xe[2],!0)}return!1}function vn(n){return n===sn.SPHERICAL_ECEF||n===sn.SPHERICAL_MARS_PCPF||n===sn.SPHERICAL_MOON_PCPF}function qn(n,e,t){const l=Math.sin(n),r=Math.cos(n),u=Math.sin(e),o=Math.cos(e),s=t;return s[0]=-l,s[4]=-u*r,s[8]=o*r,s[12]=0,s[1]=r,s[5]=-u*l,s[9]=o*l,s[13]=0,s[2]=0,s[6]=o,s[10]=u,s[14]=0,s[3]=0,s[7]=0,s[11]=0,s[15]=1,s}function Zn(n,e,t){return qn(n,e,t),C(t,t),t}function Vn(n,e){return n?e.spatialReference===n?e.spatialReferenceId:(e.spatialReference=n,"metersPerUnit"in e&&(e.metersPerUnit=s(n,1)),n.wkt===L.wkt?e.spatialReferenceId=sn.SPHERICAL_ECEF:K(n)?e.spatialReferenceId=sn.WGS84:k(n)?e.spatialReferenceId=sn.WEB_MERCATOR:b(n)?e.spatialReferenceId=sn.PLATE_CARREE:n.wkt===O.wkt?e.spatialReferenceId=sn.WGS84_ECEF:n.wkid===q.CGCS2000?e.spatialReferenceId=sn.CGCS2000:n.wkt===M.wkt?e.spatialReferenceId=sn.SPHERICAL_MARS_PCPF:n.wkt===N.wkt?e.spatialReferenceId=sn.SPHERICAL_MOON_PCPF:z(n)?e.spatialReferenceId=sn.GCSMARS2000:v(n)?e.spatialReferenceId=sn.GCSMOON2000:e.spatialReferenceId=sn.UNKNOWN):sn.UNKNOWN}function Xn(n,e,t,l){n!==t&&(t[l++]=n[e++],t[l++]=n[e++],t[l]=n[e])}function Dn(n,e,t,l){t[l++]=ye*(n[e++]/g.radius),t[l++]=ye*(Math.PI/2-2*Math.atan(Math.exp(-n[e++]/g.radius))),t[l]=n[e]}function Jn(n,e,t,l){Dn(n,e,t,l),Ae(t,l,t,l)}function Qn(n,e,t,l){Dn(n,e,t,l),Ne(t,l,t,l)}function Yn(n,t,l,r,u){const o=.4999999*Math.PI,s=e(je*n[t+1],-o,o),i=Math.sin(s);l[r++]=je*n[t]*u.radius,l[r++]=u.halfSemiMajorAxis*Math.log((1+i)/(1-i)),l[r]=n[t+2]}function $n(n,e,t,l){Yn(n,e,t,l,g)}const ne=g.radius*Math.PI/180,ee=180/(g.radius*Math.PI);function te(n,e,t,l){t[l]=n[e]*ne,t[l+1]=n[e+1]*ne,t[l+2]=n[e+2]}function le(n,e,t,l){t[l]=n[e]*ee,t[l+1]=n[e+1]*ee,t[l+2]=n[e+2]}function re(n,e,t,l){Dn(n,e,t,l),te(t,l,t,l)}function ue(n,e,t,l){Ge(n,e,t,l),te(t,l,t,l)}function oe(n,e,t,l){pe(n,e,t,l),te(t,l,t,l)}function se(n,e,t,l){le(n,e,t,l),Ae(t,l,t,l)}function ie(n,e,t,l){le(n,e,t,l),$n(t,l,t,l)}function ae(n,e,t,l){le(n,e,t,l),Ne(t,l,t,l)}function ce(n){if(null==n)return!1;const e=Vn(n,de);return!!me[e][sn.WGS84_COMPARABLE_LON_LAT]}function Ee(n,e,t,l){const r=Math.cos(t);n[0]=Math.cos(e)*r*l,n[1]=Math.sin(e)*r*l,n[2]=Math.sin(t)*l}function Ce(n,e,t,l,r){const u=r+n[e+2],o=je*n[e+1],s=je*n[e],i=Math.cos(o);t[l++]=Math.cos(s)*i*u,t[l++]=Math.sin(s)*i*u,t[l]=Math.sin(o)*u}function Re(n,e,t,l){Ce(n,e,t,l,B.radius)}function fe(n,e,t,l){Ce(n,e,t,l,j.radius)}function Ae(n,e,t,l){Ce(n,e,t,l,g.radius)}function _e(n,e,t,l,u){const o=n[e],s=n[e+1],i=n[e+2],a=Math.sqrt(o*o+s*s+i*i),c=r(i/(0===a?1:a)),E=Math.atan2(s,o);t[l++]=ye*E,t[l++]=ye*c,t[l]=a-u}function Se(n,e,t,l){_e(n,e,t,l,B.radius)}function Pe(n,e,t,l){_e(n,e,t,l,j.radius)}function pe(n,e,t,l){_e(n,e,t,l,g.radius)}function Le(n,e,t,l){pe(n,e,t,l),$n(t,l,t,l)}function Oe(n,e,t,l){pe(n,e,t,l),Ne(t,l,t,l)}function Me(n,e,t,l,r){const u=je*n[e],o=je*n[e+1],s=n[e+2],i=Math.sin(o),a=Math.cos(o),c=r.radius/Math.sqrt(1-r.eccentricitySquared*i*i);t[l++]=(c+s)*a*Math.cos(u),t[l++]=(c+s)*a*Math.sin(u),t[l++]=(c*(1-r.eccentricitySquared)+s)*i}function Ne(n,e,t,l){Me(n,e,t,l,g)}function Ge(n,e,t,l){const r=y,u=n[e],o=n[e+1],s=n[e+2];let i,a,c,E,C,R,f,A,_,S,P,p,L,O,M,N,G,h,W,m,T;i=Math.abs(s),a=u*u+o*o,c=Math.sqrt(a),E=a+s*s,C=Math.sqrt(E),m=Math.atan2(o,u),R=s*s/E,f=a/E,O=r.a2/C,M=r.a3-r.a4/C,f>.3?(A=i/C*(1+f*(r.a1+O+R*M)/C),W=Math.asin(A),S=A*A,_=Math.sqrt(1-S)):(_=c/C*(1-R*(r.a5-O-f*M)/C),W=Math.acos(_),S=1-_*_,A=Math.sqrt(S)),P=1-g.eccentricitySquared*S,p=g.radius/Math.sqrt(P),L=r.a6*p,O=c-p*_,M=i-L*A,G=_*O+A*M,N=_*M-A*O,h=N/(L/P+G),W+=h,T=G+N*h/2,s<0&&(W=-W),t[l++]=ye*m,t[l++]=ye*W,t[l]=T}function he(n,e,t,l){Ge(n,e,t,l),Ae(t,l,t,l)}function We(n,e,t,l){Ge(n,e,t,l),$n(t,l,t,l)}const me={[sn.WGS84]:{[sn.CGCS2000]:null,[sn.GCSMARS2000]:null,[sn.GCSMOON2000]:null,[sn.LON_LAT]:Xn,[sn.WGS84_COMPARABLE_LON_LAT]:Xn,[sn.SPHERICAL_ECEF]:Ae,[sn.SPHERICAL_MARS_PCPF]:null,[sn.SPHERICAL_MOON_PCPF]:null,[sn.UNKNOWN]:null,[sn.WEB_MERCATOR]:$n,[sn.PLATE_CARREE]:te,[sn.WGS84]:Xn,[sn.WGS84_ECEF]:Ne},[sn.CGCS2000]:{[sn.CGCS2000]:Xn,[sn.GCSMARS2000]:null,[sn.GCSMOON2000]:null,[sn.LON_LAT]:Xn,[sn.WGS84_COMPARABLE_LON_LAT]:Xn,[sn.SPHERICAL_ECEF]:Ae,[sn.SPHERICAL_MARS_PCPF]:null,[sn.SPHERICAL_MOON_PCPF]:null,[sn.UNKNOWN]:null,[sn.WEB_MERCATOR]:null,[sn.PLATE_CARREE]:te,[sn.WGS84]:null,[sn.WGS84_ECEF]:Ne},[sn.GCSMARS2000]:{[sn.CGCS2000]:null,[sn.GCSMARS2000]:Xn,[sn.GCSMOON2000]:null,[sn.LON_LAT]:Xn,[sn.WGS84_COMPARABLE_LON_LAT]:null,[sn.SPHERICAL_ECEF]:null,[sn.SPHERICAL_MARS_PCPF]:fe,[sn.SPHERICAL_MOON_PCPF]:null,[sn.UNKNOWN]:null,[sn.WEB_MERCATOR]:null,[sn.PLATE_CARREE]:null,[sn.WGS84]:null,[sn.WGS84_ECEF]:null},[sn.GCSMOON2000]:{[sn.CGCS2000]:null,[sn.GCSMARS2000]:null,[sn.GCSMOON2000]:Xn,[sn.LON_LAT]:Xn,[sn.WGS84_COMPARABLE_LON_LAT]:null,[sn.SPHERICAL_ECEF]:null,[sn.SPHERICAL_MARS_PCPF]:null,[sn.SPHERICAL_MOON_PCPF]:Re,[sn.UNKNOWN]:null,[sn.WEB_MERCATOR]:null,[sn.PLATE_CARREE]:null,[sn.WGS84]:null,[sn.WGS84_ECEF]:null},[sn.WEB_MERCATOR]:{[sn.CGCS2000]:null,[sn.GCSMARS2000]:null,[sn.GCSMOON2000]:null,[sn.LON_LAT]:Dn,[sn.WGS84_COMPARABLE_LON_LAT]:Dn,[sn.SPHERICAL_ECEF]:Jn,[sn.SPHERICAL_MARS_PCPF]:null,[sn.SPHERICAL_MOON_PCPF]:null,[sn.UNKNOWN]:null,[sn.WEB_MERCATOR]:Xn,[sn.PLATE_CARREE]:re,[sn.WGS84]:Dn,[sn.WGS84_ECEF]:Qn},[sn.WGS84_ECEF]:{[sn.CGCS2000]:Ge,[sn.GCSMARS2000]:null,[sn.GCSMOON2000]:null,[sn.LON_LAT]:Ge,[sn.WGS84_COMPARABLE_LON_LAT]:Ge,[sn.SPHERICAL_ECEF]:he,[sn.SPHERICAL_MARS_PCPF]:null,[sn.SPHERICAL_MOON_PCPF]:null,[sn.UNKNOWN]:null,[sn.WEB_MERCATOR]:We,[sn.PLATE_CARREE]:ue,[sn.WGS84]:Ge,[sn.WGS84_ECEF]:Xn},[sn.SPHERICAL_ECEF]:{[sn.CGCS2000]:pe,[sn.GCSMARS2000]:null,[sn.GCSMOON2000]:null,[sn.LON_LAT]:pe,[sn.WGS84_COMPARABLE_LON_LAT]:pe,[sn.SPHERICAL_ECEF]:Xn,[sn.SPHERICAL_MARS_PCPF]:null,[sn.SPHERICAL_MOON_PCPF]:null,[sn.UNKNOWN]:null,[sn.WEB_MERCATOR]:Le,[sn.PLATE_CARREE]:oe,[sn.WGS84]:pe,[sn.WGS84_ECEF]:Oe},[sn.SPHERICAL_MARS_PCPF]:{[sn.CGCS2000]:null,[sn.GCSMARS2000]:Pe,[sn.GCSMOON2000]:null,[sn.LON_LAT]:Pe,[sn.WGS84_COMPARABLE_LON_LAT]:null,[sn.SPHERICAL_ECEF]:null,[sn.SPHERICAL_MARS_PCPF]:Xn,[sn.SPHERICAL_MOON_PCPF]:null,[sn.UNKNOWN]:null,[sn.WEB_MERCATOR]:null,[sn.PLATE_CARREE]:null,[sn.WGS84]:null,[sn.WGS84_ECEF]:null},[sn.SPHERICAL_MOON_PCPF]:{[sn.CGCS2000]:null,[sn.GCSMARS2000]:null,[sn.GCSMOON2000]:Se,[sn.LON_LAT]:Se,[sn.WGS84_COMPARABLE_LON_LAT]:null,[sn.SPHERICAL_ECEF]:null,[sn.SPHERICAL_MARS_PCPF]:null,[sn.SPHERICAL_MOON_PCPF]:Xn,[sn.UNKNOWN]:null,[sn.WEB_MERCATOR]:null,[sn.PLATE_CARREE]:null,[sn.WGS84]:null,[sn.WGS84_ECEF]:null},[sn.UNKNOWN]:{[sn.CGCS2000]:null,[sn.GCSMARS2000]:null,[sn.GCSMOON2000]:null,[sn.LON_LAT]:null,[sn.WGS84_COMPARABLE_LON_LAT]:null,[sn.SPHERICAL_ECEF]:null,[sn.SPHERICAL_MARS_PCPF]:null,[sn.SPHERICAL_MOON_PCPF]:null,[sn.UNKNOWN]:Xn,[sn.WEB_MERCATOR]:null,[sn.PLATE_CARREE]:null,[sn.WGS84]:null,[sn.WGS84_ECEF]:null},[sn.LON_LAT]:{[sn.CGCS2000]:Xn,[sn.GCSMARS2000]:Xn,[sn.GCSMOON2000]:Xn,[sn.LON_LAT]:Xn,[sn.WGS84_COMPARABLE_LON_LAT]:Xn,[sn.SPHERICAL_ECEF]:Ae,[sn.SPHERICAL_MARS_PCPF]:fe,[sn.SPHERICAL_MOON_PCPF]:Re,[sn.UNKNOWN]:null,[sn.WEB_MERCATOR]:$n,[sn.PLATE_CARREE]:te,[sn.WGS84]:Xn,[sn.WGS84_ECEF]:Ne},[sn.WGS84_COMPARABLE_LON_LAT]:{[sn.CGCS2000]:null,[sn.GCSMARS2000]:null,[sn.GCSMOON2000]:null,[sn.LON_LAT]:Xn,[sn.WGS84_COMPARABLE_LON_LAT]:Xn,[sn.SPHERICAL_ECEF]:Ae,[sn.SPHERICAL_MARS_PCPF]:null,[sn.SPHERICAL_MOON_PCPF]:null,[sn.UNKNOWN]:null,[sn.WEB_MERCATOR]:null,[sn.PLATE_CARREE]:te,[sn.WGS84]:Xn,[sn.WGS84_ECEF]:Ne},[sn.PLATE_CARREE]:{[sn.CGCS2000]:le,[sn.GCSMARS2000]:null,[sn.GCSMOON2000]:null,[sn.LON_LAT]:le,[sn.WGS84_COMPARABLE_LON_LAT]:le,[sn.SPHERICAL_ECEF]:se,[sn.SPHERICAL_MARS_PCPF]:null,[sn.SPHERICAL_MOON_PCPF]:null,[sn.UNKNOWN]:null,[sn.WEB_MERCATOR]:ie,[sn.PLATE_CARREE]:Xn,[sn.WGS84]:le,[sn.WGS84_ECEF]:ae}};function Te(n,e,t=Ie()){return null==n||null==e?null:Fe(n,e,t).projector}function Fe(n,e,t){if(null==n||null==e||t.source.spatialReference===n&&t.dest.spatialReference===e)return t;const l=Vn(n,t.source),r=Vn(e,t.dest);return l===sn.UNKNOWN&&r===sn.UNKNOWN?w(n,e)?t.projector=Xn:t.projector=null:t.projector=me[l][r],t}function Ie(){return{source:{spatialReference:null,spatialReferenceId:sn.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:sn.UNKNOWN,metersPerUnit:1},projector:Xn}}const de={spatialReference:null,spatialReferenceId:sn.UNKNOWN},He={spatialReference:null,spatialReferenceId:sn.UNKNOWN},ge=Ie(),Be=Ie(),je=t(1),ye=l(1),Ue=p(),we=p(),xe=p(),Ke=p(),ke=p();export{ce as canProjectToWGS84ComparableLonLat,Cn as canProjectWithoutEngine,qn as computeENUToSphericalPCPFLocalRotation,Zn as computeSphericalPCPFToENULocalRotation,zn as computeTranslationToOriginAndRotation,fn as getProjectorName,rn as getTransformation,un as getTransformations,Rn as initializeProjection,Y as isLoaded,$ as load,bn as localLinearScaleFactors,Ee as lonLatToSphericalPCPF,Yn as lonLatToWebMercatorComparable,nn as project,kn as projectBoundingRect,xn as projectBoundingSphere,yn as projectBuffer,Un as projectDirection,Wn as projectExtent,en as projectMany,Pn as projectMultipoint,tn as projectOrLoad,ln as projectOrLoadMany,_n as projectPoint,In as projectPointToVector,gn as projectPointToWGS84ComparableLonLat,Gn as projectPolygon,Nn as projectPolygonToWGS84ComparableLonLat,Ln as projectPolyline,Mn as projectPolylineToWGS84ComparableLonLat,Fn as projectVectorToDehydratedPoint,Tn as projectVectorToPoint,Hn as projectVectorToVector,Bn as projectVectorToWGS84ComparableLonLat,An as projectWithoutEngine,dn as projectXYZToVector,_e as sphericalPCPFtoLonLatElevation,cn as test,En as tryProjectWithZConversion,an as unload};
|
|
5
|
+
import n from"../core/Error.js";import{clamp as e,deg2rad as t,rad2deg as l,asinClamped as r}from"../core/mathUtils.js";import{throwIfAborted as u,waitTick as s}from"../core/promiseUtils.js";import{getMetersPerUnitForSR as o}from"../core/unitUtils.js";import{trackAccess as i}from"../core/accessorSupport/tracking.js";import{SimpleObservable as a}from"../core/accessorSupport/tracking/SimpleObservable.js";import{f as c,i as E,t as C}from"../chunks/mat4.js";import{c as R,a as f,b as A,n as _,l as S,s as P}from"../chunks/vec3.js";import{c as p}from"../chunks/vec3f64.js";import{SphericalECEFSpatialReferenceLike as L,WGS84ECEFSpatialReferenceLike as O,SphericalPCPFMarsLike as M,SphericalPCPFMoonLike as N}from"./ellipsoidUtils.js";import G from"./Extent.js";import h from"./Multipoint.js";import{l as W,p as m,i as T}from"../chunks/pe.js";import F from"./Point.js";import d from"./Polygon.js";import I from"./Polyline.js";import{copy as H}from"./support/aaBoundingRect.js";import{earth as g,moon as y,mars as B}from"./support/Ellipsoid.js";import{earthEllipsoidConstants as j}from"./support/geodesicConstants.js";import w from"./support/GeographicTransformation.js";import{equals as U,isValid as x,isWGS84 as K,isWebMercator as z,isPlateCarree as k,isMars as b,isMoon as v}from"./support/spatialReferenceUtils.js";import{SupportedGCSWkids as q}from"./support/SupportedGCSWkids.js";import{getGeometryZScaler as Z}from"./support/zscale.js";import{makeDehydratedPoint as V}from"../layers/graphics/dehydratedFeatures.js";let X=null,D=null,J=null,Q={};const Y=new a;function $(){return!!X&&T()}function nn(n){return null==J&&(J=Promise.all([W(),import("../chunks/geometryEngineBase.js").then((n=>n.g)),import("./geometryAdapters/hydrated.js")])),J.then((([,e,{hydratedAdapter:t}])=>{u(n),D=t,X=e.default,X._enableProjection(m),Y.notify()}))}function en(n,e,t=null,l=null){return Array.isArray(n)?0===n.length?[]:tn(D,n,n[0].spatialReference,e,t,l):tn(D,[n],n.spatialReference,e,t,l)[0]}function tn(n,e,t,l,r=null,u=null){if(null==t||null==l)return e;if(fn(t,l,r))return e.map((n=>Sn(n,t,l)));if(null==r){const n=w.cacheKey(t,l);void 0!==Q[n]?r=Q[n]:(null==(r=un(t,l,void 0))&&(r=new w),Q[n]=r)}if(null==X||null==n)throw new on;return null!=u?X._project(n,e,t,l,r,u):X._project(n,e,t,l,r)}function ln(n,e){const t=rn([n],e);return null!=t.pending?{pending:t.pending,geometry:null}:null!=t.geometries?{pending:null,geometry:t.geometries[0]}:{pending:null,geometry:null}}function rn(n,e){if(!$())for(const t of n)if(null!=t&&!U(t.spatialReference,e)&&x(t.spatialReference)&&x(e)&&!fn(t.spatialReference,e))return i(Y),{pending:nn(),geometries:null};return{pending:null,geometries:n.map((n=>null==n?null:U(n.spatialReference,e)?n:x(n.spatialReference)&&x(e)?Cn(n,e):null))}}function un(n,e,t=null){if(null==n||null==e)return null;if(null==X||null==D)throw new on;const l=X._getTransformation(D,n,e,t,t?.spatialReference);return null!==l?w.fromGE(l):null}function sn(n,e,t=null){if(null==X||null==D)throw new on;const l=X._getTransformationBySuitability(D,n,e,t,t?.spatialReference);if(null!==l){const n=[];for(const e of l)n.push(w.fromGE(e));return n}return[]}class on extends n{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}var an;function cn(){X=null,D=null,J=null,Q={}}!function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",n[n.WGS84=2]="WGS84",n[n.WEB_MERCATOR=3]="WEB_MERCATOR",n[n.WGS84_ECEF=4]="WGS84_ECEF",n[n.CGCS2000=5]="CGCS2000",n[n.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",n[n.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",n[n.GCSMARS2000=8]="GCSMARS2000",n[n.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",n[n.GCSMOON2000=10]="GCSMOON2000",n[n.LON_LAT=11]="LON_LAT",n[n.PLATE_CARREE=12]="PLATE_CARREE"}(an||(an={}));const En={get loadPromise(){return J}};function Cn(n,e){try{const t=en(n,e);if(null==t)return null;"xmin"in n&&"xmin"in t&&(t.zmin=n.zmin,t.zmax=n.zmax);const l=Z(t.type,n.spatialReference,e);return null!=l&&l(t),t}catch(t){if(!(t instanceof on))throw t;return null}}async function Rn(n,e,t){const l=n.spatialReference;return null!=l&&null!=e&&await An(l,e,null,t),Cn(n,e)}function fn(n,e,t){return!t&&(!!U(n,e)||x(n)&&x(e)&&!!Ie(n,e,je))}async function An(n,e,t,l){if($())return s(l);if(Array.isArray(n)){for(const{source:r,dest:u,geographicTransformation:s}of n)if(!fn(r,u,s))return nn(l)}else if(!fn(n,e,t))return nn(l);return s(l)}function _n(n,e){switch(Ie(n,e,je)){case Qn:return"copy3";case Pe:return"wgs84ToSphericalECEF";case te:return"wgs84ToWebMercator";case ue:return"wgs84ToPlateCarree";case We:return"wgs84ToWGS84ECEF";case Yn:return"webMercatorToWGS84";case $n:return"webMercatorToSphericalECEF";case ne:return"webMercatorToWGS84ECEF";case oe:return"webMercatorToPlateCarree";case me:return"wgs84ECEFToWGS84";case Te:return"wgs84ECEFToSphericalECEF";case Fe:return"wgs84ECEFToWebMercator";case Me:return"sphericalECEFToWGS84";case Ne:return"sphericalECEFToWebMercator";case Oe:return"sphericalMarsPCPFToMars2000";case Le:return"sphericalMoonPCPFToMoon2000";case Ge:return"sphericalECEFToWGS84ECEF";case Se:return"mars2000ToSphericalPCPF";case _e:return"moon2000ToSphericalPCPF";default:return null}}function Sn(n,e,t){return n?"x"in n?pn(n,e,new F,t,0):"xmin"in n?Fn(n,e,new G,t,0):"rings"in n?mn(n,e,new d,t,0):"paths"in n?Nn(n,e,new I,t,0):"points"in n?On(n,e,new h,t,0):null:null}function Pn(n,e,t=e.spatialReference,l=0){return null!=t&&null!=n.spatialReference&&null!=pn(n,n.spatialReference,e,t,l)}function pn(n,e,t,l,r){be[0]=n.x,be[1]=n.y;const u=n.z;return be[2]=void 0!==u?u:r,xn(be,e,0,be,l,0,1)?(t.x=be[0],t.y=be[1],t.spatialReference=l,void 0===u?(t.z=void 0,t.hasZ=!1):(t.z=be[2],t.hasZ=!0),void 0===n.m?(t.m=void 0,t.hasM=!1):(t.m=n.m,t.hasM=!0),t):null}function Ln(n,e,t=e.spatialReference,l=0){return null!=n.spatialReference&&null!=t&&null!=On(n,n.spatialReference,e,t,l)}function On(n,e,t,l,r){const{points:u,hasZ:s,hasM:o}=n,i=[],a=u.length,c=[];for(const E of u)c.push(E[0],E[1],s?E[2]:r);if(!xn(c,e,0,c,l,0,a))return null;for(let E=0;E<a;++E){const n=3*E,e=c[n],t=c[n+1];s&&o?i.push([e,t,c[n+2],u[E][3]]):s?i.push([e,t,c[n+2]]):o?i.push([e,t,u[E][2]]):i.push([e,t])}return t.points=i,t.spatialReference=l,t.hasZ=s,t.hasM=o,t}function Mn(n,e,t=e.spatialReference,l=0){return null!=n.spatialReference&&null!=t&&null!=Nn(n,n.spatialReference,e,t,l)}function Nn(n,e,t,l,r){const{paths:u,hasZ:s,hasM:o}=n,i=[];return zn(u,s??!1,o??!1,e,i,l,r)?(t.paths=i,t.spatialReference=l,t.hasZ=s,t.hasM=o,t):null}function Gn({hasZ:n,spatialReference:e,paths:t},l,r=0){const u=Jn(e,ye),s=de[u][an.WGS84_COMPARABLE_LON_LAT];if(null==s)return!1;const o=n?n=>n:n=>P(be,n[0],n[1],r);for(const i of t){const n=[];for(const e of i){const t=[0,0,r];s(o(e),0,t,0),n.push(t)}l.push(n)}return!0}function hn({hasZ:n,spatialReference:e,rings:t},l,r=0){const u=Jn(e,ye),s=de[u][an.WGS84_COMPARABLE_LON_LAT];if(null==s)return!1;const o=n?n=>n:n=>P(be,n[0],n[1],r);for(const i of t){const n=[];for(const e of i){const t=[0,0,r];s(o(e),0,t,0),n.push(t)}l.push(n)}return!0}function Wn(n,e,t=e.spatialReference,l=0){return null!=n.spatialReference&&null!=t&&null!=mn(n,n.spatialReference,e,t,l)}function mn(n,e,t,l,r){const{rings:u,hasZ:s,hasM:o}=n,i=[];return zn(u,s??!1,o??!1,e,i,l,r)?(t.rings=i,t.spatialReference=l,t.hasZ=s,t.hasM=o,t):null}function Tn(n,e,t=e.spatialReference,l=0){return null!=n.spatialReference&&null!=t&&null!=Fn(n,n.spatialReference,e,t,l)}function Fn(n,e,t,l,r){const{xmin:u,ymin:s,xmax:o,ymax:i,hasZ:a,hasM:c}=n;if(!yn(u,s,a?n.zmin:r,e,be,l))return null;t.xmin=be[0],t.ymin=be[1],a&&(t.zmin=be[2]);return yn(o,i,a?n.zmax:r,e,be,l)?(t.xmax=be[0],t.ymax=be[1],a&&(t.zmax=be[2]),c&&(t.mmin=n.mmin,t.mmax=n.mmax),t.spatialReference=l,t):null}function dn(n,e,t){if(null==e||null==t)return null;const l=new F({spatialReference:t});return xn(n,e,0,be,t,0,1)?(l.x=be[0],l.y=be[1],l.z=be[2],l):null}function In(n,e,t){return xn(n,e,0,be,t.spatialReference,0,1)?(t.x=be[0],t.y=be[1],t.z=be[2],t):null}function Hn(n,e,t,l=0){be[0]=n.x,be[1]=n.y;const r=n.z;return be[2]=void 0!==r?r:l,xn(be,n.spatialReference,0,e,t,0,1)}async function gn(n,e,t,l,r){l??=0;const u=n.spatialReference;if(fn(u,t)||null==u||null==t||U(u,t))return be[0]=n.x,be[1]=n.y,be[2]=n.z??l,void xn(be,n.spatialReference,0,e,t,0,1);const s=V(n.x,n.y,n.z??l,u),o=await Rn(s,t,r);e[0]=o.x,e[1]=o.y,e[2]=o.z??0}function yn(n,e,t,l,r,u){return Ke[0]=n,Ke[1]=e,Ke[2]=t,xn(Ke,l,0,r,u,0,1)}function Bn(n,e,t,l){return!(null==e||null==l||n.length<2)&&(2===n.length&&(Ke[0]=n[0],Ke[1]=n[1],Ke[2]=0,n=Ke),xn(n,e,0,t,l,0,1))}function jn(n,e){be[0]=n.x,be[1]=n.y;const t=n.z;return be[2]=void 0!==t?t:0,wn(be,n.spatialReference,e)}function wn(n,e,t){return Un(n,e,t)}function Un(n,e,t){if(null==e)return!1;const l=Jn(e,ye),r=de[l][an.WGS84_COMPARABLE_LON_LAT];return null!=r&&(r(n,0,Ke,0),t!==Ke&&(t[0]=Ke[0],t[1]=Ke[1],t.length>2&&(t[2]=Ke[2])),!0)}function xn(n,e,t,l,r,u,s=1){const o=Ie(e,r,je);if(null==o)return!1;if(o===Qn){if(n===l&&t===u)return!0;const e=t+3*s;for(let r=t,s=u;r<e;r++,s++)l[s]=n[r];return!0}const i=t+3*s;for(let a=t,c=u;a<i;a+=3,c+=3)o(n,a,l,c);return!0}function Kn(n,e,t,l,r){R(be,n),f(ve,n,e),Bn(be,t,be,r),Bn(ve,t,ve,r),A(l,ve,be),_(l,l)}function zn(n,e,t,l,r,u,s=0){const o=new Array;for(const a of n)for(const n of a)o.push(n[0],n[1],e?n[2]:s);if(!xn(o,l,0,o,u,0,o.length/3))return!1;let i=0;r.length=0;for(const a of n){const n=new Array;for(const l of a)e&&t?n.push([o[i++],o[i++],o[i++],l[3]]):e?n.push([o[i++],o[i++],o[i++]]):t?(n.push([o[i++],o[i++],l[2]]),i++):(n.push([o[i++],o[i++]]),i++);r.push(n)}return!0}function kn(n,e,t,l){if(null==e||null==l)return!1;const r=He(e,l,we);if(r.projector===Qn)return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],!0;if(null==r.projector)return!1;const{source:u,dest:s}=r;if(s.spatialReferenceId===an.WEB_MERCATOR){const e=de[u.spatialReferenceId][an.WGS84];return null!=e&&(e(n,0,ze,0),te(ze,0,t,0),t[3]=bn(ze[1],n[2],n[3],g.radius),!0)}if(u.spatialReferenceId!==an.WGS84&&u.spatialReferenceId!==an.CGCS2000||s.spatialReferenceId!==an.PLATE_CARREE){r.projector(n,0,t,0);const e=u.metersPerUnit??1,l=s.metersPerUnit??1;t[3]=n[3]*e/l}else{const e=de[u.spatialReferenceId][an.SPHERICAL_ECEF],l=de[an.SPHERICAL_ECEF][an.PLATE_CARREE];let s=n[3];null!=e&&null!=l&&(s=bn(n[1],n[2],n[3],g.radius)),r.projector(n,0,t,0),t[3]=s}return!0}function bn(n,e,t,l){const r=l+e;if(r<l/2||t>r)return Number.MAX_VALUE;const u=Math.abs(Ue*n)+Math.asin(t/r);return u>=Math.PI/2?Number.MAX_VALUE:t/Math.cos(u)}function vn(n,e,t,l){return null!=n&&(U(e,l)?(H(t,n),!0):(Ke[0]=n[0],Ke[1]=n[1],Ke[2]=0,!!xn(Ke,e,0,Ke,l,0,1)&&(t[0]=Ke[0],t[1]=Ke[1],Ke[0]=n[2],Ke[1]=n[3],Ke[2]=0,!!xn(Ke,e,0,Ke,l,0,1)&&(t[2]=Ke[0],t[3]=Ke[1],!0))))}function qn(n,e,t,l){if(null==e||null==l)return!1;const r=Jn(e,ye),u=Jn(l,Be);if(r===u&&r!==an.UNKNOWN||U(e,l))return t[0]=1,t[1]=1,t[2]=1,!0;if(r===an.SPHERICAL_ECEF){const e=S(n),l=e/Math.sqrt(n[0]*n[0]+n[1]*n[1]),r=e/g.radius;if(u===an.WEB_MERCATOR)return t[0]=l*r,t[1]=l*r,t[2]=1,!0;if(u===an.WGS84||u===an.CGCS2000){const n=re;return t[0]=n*l*r,t[1]=n*r,t[2]=1,!0}}else if(r===an.PLATE_CARREE){if(u===an.WGS84||u===an.CGCS2000)return t[0]=re,t[1]=re,t[2]=1,!0;if(u===an.WEB_MERCATOR){const e=n[1]/g.radius;return t[0]=1,t[1]=1/Math.cos(e),t[2]=1,!0}}return!1}function Zn(n,e,t,l){if(null==n||null==l)return!1;const r=Jn(n,ye),u=Jn(l,Be);if(r===u&&!Vn(u)&&(r!==an.UNKNOWN||U(n,l)))return c(t,e),!0;if(Vn(u)){const n=de[r][an.LON_LAT],l=de[an.LON_LAT][u];return null!=n&&null!=l&&(n(e,0,ze,0),l(ze,0,ke,0),Xn(Ue*ze[0],Ue*ze[1],t),t[12]=ke[0],t[13]=ke[1],t[14]=ke[2],!0)}if((u===an.WEB_MERCATOR||u===an.PLATE_CARREE)&&(r===an.WGS84||r===an.CGCS2000&&u===an.PLATE_CARREE||r===an.SPHERICAL_ECEF||r===an.WEB_MERCATOR)){const n=de[r][an.LON_LAT],l=de[an.LON_LAT][u];return null!=n&&null!=l&&(n(e,0,ze,0),l(ze,0,ke,0),r===an.SPHERICAL_ECEF?Dn(Ue*ze[0],Ue*ze[1],t):E(t),t[12]=ke[0],t[13]=ke[1],t[14]=ke[2],!0)}return!1}function Vn(n){return n===an.SPHERICAL_ECEF||n===an.SPHERICAL_MARS_PCPF||n===an.SPHERICAL_MOON_PCPF}function Xn(n,e,t){const l=Math.sin(n),r=Math.cos(n),u=Math.sin(e),s=Math.cos(e),o=t;return o[0]=-l,o[4]=-u*r,o[8]=s*r,o[12]=0,o[1]=r,o[5]=-u*l,o[9]=s*l,o[13]=0,o[2]=0,o[6]=s,o[10]=u,o[14]=0,o[3]=0,o[7]=0,o[11]=0,o[15]=1,o}function Dn(n,e,t){return Xn(n,e,t),C(t,t),t}function Jn(n,e){return n?e.spatialReference===n?e.spatialReferenceId:(e.spatialReference=n,"metersPerUnit"in e&&(e.metersPerUnit=o(n,1)),n.wkt===L.wkt?e.spatialReferenceId=an.SPHERICAL_ECEF:K(n)?e.spatialReferenceId=an.WGS84:z(n)?e.spatialReferenceId=an.WEB_MERCATOR:k(n)?e.spatialReferenceId=an.PLATE_CARREE:n.wkt===O.wkt?e.spatialReferenceId=an.WGS84_ECEF:n.wkid===q.CGCS2000?e.spatialReferenceId=an.CGCS2000:n.wkt===M.wkt?e.spatialReferenceId=an.SPHERICAL_MARS_PCPF:n.wkt===N.wkt?e.spatialReferenceId=an.SPHERICAL_MOON_PCPF:b(n)?e.spatialReferenceId=an.GCSMARS2000:v(n)?e.spatialReferenceId=an.GCSMOON2000:e.spatialReferenceId=an.UNKNOWN):an.UNKNOWN}function Qn(n,e,t,l){n!==t&&(t[l++]=n[e++],t[l++]=n[e++],t[l]=n[e])}function Yn(n,e,t,l){t[l++]=xe*(n[e++]/g.radius),t[l++]=xe*(Math.PI/2-2*Math.atan(Math.exp(-n[e++]/g.radius))),t[l]=n[e]}function $n(n,e,t,l){Yn(n,e,t,l),Pe(t,l,t,l)}function ne(n,e,t,l){Yn(n,e,t,l),We(t,l,t,l)}function ee(n,t,l,r,u){const s=.4999999*Math.PI,o=e(Ue*n[t+1],-s,s),i=Math.sin(o);l[r++]=Ue*n[t]*u.radius,l[r++]=u.halfSemiMajorAxis*Math.log((1+i)/(1-i)),l[r]=n[t+2]}function te(n,e,t,l){ee(n,e,t,l,g)}const le=g.radius*Math.PI/180,re=180/(g.radius*Math.PI);function ue(n,e,t,l){t[l]=n[e]*le,t[l+1]=n[e+1]*le,t[l+2]=n[e+2]}function se(n,e,t,l){t[l]=n[e]*re,t[l+1]=n[e+1]*re,t[l+2]=n[e+2]}function oe(n,e,t,l){Yn(n,e,t,l),ue(t,l,t,l)}function ie(n,e,t,l){me(n,e,t,l),ue(t,l,t,l)}function ae(n,e,t,l){Me(n,e,t,l),ue(t,l,t,l)}function ce(n,e,t,l){se(n,e,t,l),Pe(t,l,t,l)}function Ee(n,e,t,l){se(n,e,t,l),te(t,l,t,l)}function Ce(n,e,t,l){se(n,e,t,l),We(t,l,t,l)}function Re(n){if(null==n)return!1;const e=Jn(n,ye);return!!de[e][an.WGS84_COMPARABLE_LON_LAT]}function fe(n,e,t,l){const r=Math.cos(t);n[0]=Math.cos(e)*r*l,n[1]=Math.sin(e)*r*l,n[2]=Math.sin(t)*l}function Ae(n,e,t,l,r){const u=r+n[e+2],s=Ue*n[e+1],o=Ue*n[e],i=Math.cos(s);t[l++]=Math.cos(o)*i*u,t[l++]=Math.sin(o)*i*u,t[l]=Math.sin(s)*u}function _e(n,e,t,l){Ae(n,e,t,l,y.radius)}function Se(n,e,t,l){Ae(n,e,t,l,B.radius)}function Pe(n,e,t,l){Ae(n,e,t,l,g.radius)}function pe(n,e,t,l,u){const s=n[e],o=n[e+1],i=n[e+2],a=Math.sqrt(s*s+o*o+i*i),c=r(i/(0===a?1:a)),E=Math.atan2(o,s);t[l++]=xe*E,t[l++]=xe*c,t[l]=a-u}function Le(n,e,t,l){pe(n,e,t,l,y.radius)}function Oe(n,e,t,l){pe(n,e,t,l,B.radius)}function Me(n,e,t,l){pe(n,e,t,l,g.radius)}function Ne(n,e,t,l){Me(n,e,t,l),te(t,l,t,l)}function Ge(n,e,t,l){Me(n,e,t,l),We(t,l,t,l)}function he(n,e,t,l,r){const u=Ue*n[e],s=Ue*n[e+1],o=n[e+2],i=Math.sin(s),a=Math.cos(s),c=r.radius/Math.sqrt(1-r.eccentricitySquared*i*i);t[l++]=(c+o)*a*Math.cos(u),t[l++]=(c+o)*a*Math.sin(u),t[l++]=(c*(1-r.eccentricitySquared)+o)*i}function We(n,e,t,l){he(n,e,t,l,g)}function me(n,e,t,l){const r=j,u=n[e],s=n[e+1],o=n[e+2];let i,a,c,E,C,R,f,A,_,S,P,p,L,O,M,N,G,h,W,m,T;i=Math.abs(o),a=u*u+s*s,c=Math.sqrt(a),E=a+o*o,C=Math.sqrt(E),m=Math.atan2(s,u),R=o*o/E,f=a/E,O=r.a2/C,M=r.a3-r.a4/C,f>.3?(A=i/C*(1+f*(r.a1+O+R*M)/C),W=Math.asin(A),S=A*A,_=Math.sqrt(1-S)):(_=c/C*(1-R*(r.a5-O-f*M)/C),W=Math.acos(_),S=1-_*_,A=Math.sqrt(S)),P=1-g.eccentricitySquared*S,p=g.radius/Math.sqrt(P),L=r.a6*p,O=c-p*_,M=i-L*A,G=_*O+A*M,N=_*M-A*O,h=N/(L/P+G),W+=h,T=G+N*h/2,o<0&&(W=-W),t[l++]=xe*m,t[l++]=xe*W,t[l]=T}function Te(n,e,t,l){me(n,e,t,l),Pe(t,l,t,l)}function Fe(n,e,t,l){me(n,e,t,l),te(t,l,t,l)}const de={[an.WGS84]:{[an.CGCS2000]:null,[an.GCSMARS2000]:null,[an.GCSMOON2000]:null,[an.LON_LAT]:Qn,[an.WGS84_COMPARABLE_LON_LAT]:Qn,[an.SPHERICAL_ECEF]:Pe,[an.SPHERICAL_MARS_PCPF]:null,[an.SPHERICAL_MOON_PCPF]:null,[an.UNKNOWN]:null,[an.WEB_MERCATOR]:te,[an.PLATE_CARREE]:ue,[an.WGS84]:Qn,[an.WGS84_ECEF]:We},[an.CGCS2000]:{[an.CGCS2000]:Qn,[an.GCSMARS2000]:null,[an.GCSMOON2000]:null,[an.LON_LAT]:Qn,[an.WGS84_COMPARABLE_LON_LAT]:Qn,[an.SPHERICAL_ECEF]:Pe,[an.SPHERICAL_MARS_PCPF]:null,[an.SPHERICAL_MOON_PCPF]:null,[an.UNKNOWN]:null,[an.WEB_MERCATOR]:null,[an.PLATE_CARREE]:ue,[an.WGS84]:null,[an.WGS84_ECEF]:We},[an.GCSMARS2000]:{[an.CGCS2000]:null,[an.GCSMARS2000]:Qn,[an.GCSMOON2000]:null,[an.LON_LAT]:Qn,[an.WGS84_COMPARABLE_LON_LAT]:null,[an.SPHERICAL_ECEF]:null,[an.SPHERICAL_MARS_PCPF]:Se,[an.SPHERICAL_MOON_PCPF]:null,[an.UNKNOWN]:null,[an.WEB_MERCATOR]:null,[an.PLATE_CARREE]:null,[an.WGS84]:null,[an.WGS84_ECEF]:null},[an.GCSMOON2000]:{[an.CGCS2000]:null,[an.GCSMARS2000]:null,[an.GCSMOON2000]:Qn,[an.LON_LAT]:Qn,[an.WGS84_COMPARABLE_LON_LAT]:null,[an.SPHERICAL_ECEF]:null,[an.SPHERICAL_MARS_PCPF]:null,[an.SPHERICAL_MOON_PCPF]:_e,[an.UNKNOWN]:null,[an.WEB_MERCATOR]:null,[an.PLATE_CARREE]:null,[an.WGS84]:null,[an.WGS84_ECEF]:null},[an.WEB_MERCATOR]:{[an.CGCS2000]:null,[an.GCSMARS2000]:null,[an.GCSMOON2000]:null,[an.LON_LAT]:Yn,[an.WGS84_COMPARABLE_LON_LAT]:Yn,[an.SPHERICAL_ECEF]:$n,[an.SPHERICAL_MARS_PCPF]:null,[an.SPHERICAL_MOON_PCPF]:null,[an.UNKNOWN]:null,[an.WEB_MERCATOR]:Qn,[an.PLATE_CARREE]:oe,[an.WGS84]:Yn,[an.WGS84_ECEF]:ne},[an.WGS84_ECEF]:{[an.CGCS2000]:me,[an.GCSMARS2000]:null,[an.GCSMOON2000]:null,[an.LON_LAT]:me,[an.WGS84_COMPARABLE_LON_LAT]:me,[an.SPHERICAL_ECEF]:Te,[an.SPHERICAL_MARS_PCPF]:null,[an.SPHERICAL_MOON_PCPF]:null,[an.UNKNOWN]:null,[an.WEB_MERCATOR]:Fe,[an.PLATE_CARREE]:ie,[an.WGS84]:me,[an.WGS84_ECEF]:Qn},[an.SPHERICAL_ECEF]:{[an.CGCS2000]:Me,[an.GCSMARS2000]:null,[an.GCSMOON2000]:null,[an.LON_LAT]:Me,[an.WGS84_COMPARABLE_LON_LAT]:Me,[an.SPHERICAL_ECEF]:Qn,[an.SPHERICAL_MARS_PCPF]:null,[an.SPHERICAL_MOON_PCPF]:null,[an.UNKNOWN]:null,[an.WEB_MERCATOR]:Ne,[an.PLATE_CARREE]:ae,[an.WGS84]:Me,[an.WGS84_ECEF]:Ge},[an.SPHERICAL_MARS_PCPF]:{[an.CGCS2000]:null,[an.GCSMARS2000]:Oe,[an.GCSMOON2000]:null,[an.LON_LAT]:Oe,[an.WGS84_COMPARABLE_LON_LAT]:null,[an.SPHERICAL_ECEF]:null,[an.SPHERICAL_MARS_PCPF]:Qn,[an.SPHERICAL_MOON_PCPF]:null,[an.UNKNOWN]:null,[an.WEB_MERCATOR]:null,[an.PLATE_CARREE]:null,[an.WGS84]:null,[an.WGS84_ECEF]:null},[an.SPHERICAL_MOON_PCPF]:{[an.CGCS2000]:null,[an.GCSMARS2000]:null,[an.GCSMOON2000]:Le,[an.LON_LAT]:Le,[an.WGS84_COMPARABLE_LON_LAT]:null,[an.SPHERICAL_ECEF]:null,[an.SPHERICAL_MARS_PCPF]:null,[an.SPHERICAL_MOON_PCPF]:Qn,[an.UNKNOWN]:null,[an.WEB_MERCATOR]:null,[an.PLATE_CARREE]:null,[an.WGS84]:null,[an.WGS84_ECEF]:null},[an.UNKNOWN]:{[an.CGCS2000]:null,[an.GCSMARS2000]:null,[an.GCSMOON2000]:null,[an.LON_LAT]:null,[an.WGS84_COMPARABLE_LON_LAT]:null,[an.SPHERICAL_ECEF]:null,[an.SPHERICAL_MARS_PCPF]:null,[an.SPHERICAL_MOON_PCPF]:null,[an.UNKNOWN]:Qn,[an.WEB_MERCATOR]:null,[an.PLATE_CARREE]:null,[an.WGS84]:null,[an.WGS84_ECEF]:null},[an.LON_LAT]:{[an.CGCS2000]:Qn,[an.GCSMARS2000]:Qn,[an.GCSMOON2000]:Qn,[an.LON_LAT]:Qn,[an.WGS84_COMPARABLE_LON_LAT]:Qn,[an.SPHERICAL_ECEF]:Pe,[an.SPHERICAL_MARS_PCPF]:Se,[an.SPHERICAL_MOON_PCPF]:_e,[an.UNKNOWN]:null,[an.WEB_MERCATOR]:te,[an.PLATE_CARREE]:ue,[an.WGS84]:Qn,[an.WGS84_ECEF]:We},[an.WGS84_COMPARABLE_LON_LAT]:{[an.CGCS2000]:null,[an.GCSMARS2000]:null,[an.GCSMOON2000]:null,[an.LON_LAT]:Qn,[an.WGS84_COMPARABLE_LON_LAT]:Qn,[an.SPHERICAL_ECEF]:Pe,[an.SPHERICAL_MARS_PCPF]:null,[an.SPHERICAL_MOON_PCPF]:null,[an.UNKNOWN]:null,[an.WEB_MERCATOR]:null,[an.PLATE_CARREE]:ue,[an.WGS84]:Qn,[an.WGS84_ECEF]:We},[an.PLATE_CARREE]:{[an.CGCS2000]:se,[an.GCSMARS2000]:null,[an.GCSMOON2000]:null,[an.LON_LAT]:se,[an.WGS84_COMPARABLE_LON_LAT]:se,[an.SPHERICAL_ECEF]:ce,[an.SPHERICAL_MARS_PCPF]:null,[an.SPHERICAL_MOON_PCPF]:null,[an.UNKNOWN]:null,[an.WEB_MERCATOR]:Ee,[an.PLATE_CARREE]:Qn,[an.WGS84]:se,[an.WGS84_ECEF]:Ce}};function Ie(n,e,t=ge()){return null==n||null==e?null:He(n,e,t).projector}function He(n,e,t){if(null==n||null==e||t.source.spatialReference===n&&t.dest.spatialReference===e)return t;const l=Jn(n,t.source),r=Jn(e,t.dest);return l===an.UNKNOWN&&r===an.UNKNOWN?U(n,e)?t.projector=Qn:t.projector=null:t.projector=de[l][r],t}function ge(){return{source:{spatialReference:null,spatialReferenceId:an.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:an.UNKNOWN,metersPerUnit:1},projector:Qn}}const ye={spatialReference:null,spatialReferenceId:an.UNKNOWN},Be={spatialReference:null,spatialReferenceId:an.UNKNOWN},je=ge(),we=ge(),Ue=t(1),xe=l(1),Ke=p(),ze=p(),ke=p(),be=p(),ve=p();export{Re as canProjectToWGS84ComparableLonLat,fn as canProjectWithoutEngine,Xn as computeENUToSphericalPCPFLocalRotation,Dn as computeSphericalPCPFToENULocalRotation,Zn as computeTranslationToOriginAndRotation,_n as getProjectorName,un as getTransformation,sn as getTransformations,An as initializeProjection,$ as isLoaded,nn as load,qn as localLinearScaleFactors,fe as lonLatToSphericalPCPF,ee as lonLatToWebMercatorComparable,en as project,vn as projectBoundingRect,kn as projectBoundingSphere,xn as projectBuffer,Kn as projectDirection,Tn as projectExtent,tn as projectMany,Ln as projectMultipoint,ln as projectOrLoad,rn as projectOrLoadMany,Pn as projectPoint,Hn as projectPointToVector,gn as projectPointToVectorWithEngine,jn as projectPointToWGS84ComparableLonLat,Wn as projectPolygon,hn as projectPolygonToWGS84ComparableLonLat,Mn as projectPolyline,Gn as projectPolylineToWGS84ComparableLonLat,In as projectVectorToDehydratedPoint,dn as projectVectorToPoint,Bn as projectVectorToVector,wn as projectVectorToWGS84ComparableLonLat,Rn as projectWithZConversion,Sn as projectWithoutEngine,yn as projectXYZToVector,pe as sphericalPCPFtoLonLatElevation,En as test,Cn as tryProjectWithZConversion,cn as unload};
|
package/interfaces.d.ts
CHANGED
|
@@ -14468,11 +14468,11 @@ declare namespace __esri {
|
|
|
14468
14468
|
*/
|
|
14469
14469
|
objectType: GraphObjectType;
|
|
14470
14470
|
/**
|
|
14471
|
-
* The [KnowledgeGraphLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html) of which this is a sublayer for a specific entity or relationship type.
|
|
14471
|
+
* The [KnowledgeGraphLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html) or [LinkChartLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html) of which this is a sublayer for a specific entity or relationship type.
|
|
14472
14472
|
*
|
|
14473
14473
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-knowledgeGraph-KnowledgeGraphSublayer.html#parentCompositeLayer)
|
|
14474
14474
|
*/
|
|
14475
|
-
parentCompositeLayer: KnowledgeGraphLayer;
|
|
14475
|
+
parentCompositeLayer: KnowledgeGraphLayer | LinkChartLayer;
|
|
14476
14476
|
/**
|
|
14477
14477
|
* The popup template for the sublayer.
|
|
14478
14478
|
*
|
|
@@ -14487,7 +14487,7 @@ declare namespace __esri {
|
|
|
14487
14487
|
renderer: Renderer;
|
|
14488
14488
|
readonly type: "knowledge-graph-sublayer";
|
|
14489
14489
|
/**
|
|
14490
|
-
* A KnowledgeGraphSublayer is a sublayer of a [KnowledgeGraphLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html#layers) that contains all instances of a named type.
|
|
14490
|
+
* A KnowledgeGraphSublayer is a sublayer of a [KnowledgeGraphLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html#layers) or a [LinkChartLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#layers) that contains all instances of a named type.
|
|
14491
14491
|
*
|
|
14492
14492
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-knowledgeGraph-KnowledgeGraphSublayer.html)
|
|
14493
14493
|
*/
|
|
@@ -14619,11 +14619,12 @@ declare namespace __esri {
|
|
|
14619
14619
|
*/
|
|
14620
14620
|
objectType?: GraphObjectTypeProperties;
|
|
14621
14621
|
/**
|
|
14622
|
-
* The [KnowledgeGraphLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html) of which this is a sublayer for a specific entity or relationship type.
|
|
14622
|
+
* The [KnowledgeGraphLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html) or [LinkChartLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html) of which this is a sublayer for a specific entity or relationship type.
|
|
14623
14623
|
*
|
|
14624
14624
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-knowledgeGraph-KnowledgeGraphSublayer.html#parentCompositeLayer)
|
|
14625
14625
|
*/
|
|
14626
|
-
parentCompositeLayer?: KnowledgeGraphLayerProperties
|
|
14626
|
+
parentCompositeLayer?: | (KnowledgeGraphLayerProperties & { type: "knowledge-graph" })
|
|
14627
|
+
| (LinkChartLayerProperties & { type: "link-chart" });
|
|
14627
14628
|
/**
|
|
14628
14629
|
* The popup template for the sublayer.
|
|
14629
14630
|
*
|
|
@@ -15625,6 +15626,270 @@ declare namespace __esri {
|
|
|
15625
15626
|
targets?: CollectionProperties<LineOfSightAnalysisTargetProperties>;
|
|
15626
15627
|
}
|
|
15627
15628
|
|
|
15629
|
+
export class LinkChartLayer extends Layer {
|
|
15630
|
+
/**
|
|
15631
|
+
* Sets a default layout configuration for the link chart.
|
|
15632
|
+
*
|
|
15633
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#defaultLinkChartConfig)
|
|
15634
|
+
*/
|
|
15635
|
+
defaultLinkChartConfig: LinkChartLayerDefaultLinkChartConfig;
|
|
15636
|
+
/**
|
|
15637
|
+
* Defines a set of [named types](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphNamedObject.html) and/or [entities](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-Entity.html) and [relationships](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-Relationship.html) to be included in the layer.
|
|
15638
|
+
*
|
|
15639
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#inclusionModeDefinition)
|
|
15640
|
+
*/
|
|
15641
|
+
inclusionModeDefinition: LinkChartLayerInclusionModeDefinition;
|
|
15642
|
+
/**
|
|
15643
|
+
* The [data model](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-DataModel.html), [service definition](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-ServiceDefinition.html) and [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#url) of the [knowledge graph service](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraphService.html) that contains the data for the KnowledgeGraphLayer.
|
|
15644
|
+
*
|
|
15645
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#knowledgeGraph)
|
|
15646
|
+
*/
|
|
15647
|
+
readonly knowledgeGraph: KnowledgeGraph;
|
|
15648
|
+
/**
|
|
15649
|
+
* A collection of operational [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-knowledgeGraph-KnowledgeGraphSublayer.html).
|
|
15650
|
+
*
|
|
15651
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#layers)
|
|
15652
|
+
*/
|
|
15653
|
+
readonly layers: Collection<KnowledgeGraphSublayer>;
|
|
15654
|
+
/**
|
|
15655
|
+
* A collection of the id's of each instance in the link chart and the information for drawing the link chart diagram, such as the exact coordinates.
|
|
15656
|
+
*
|
|
15657
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#linkChartDiagramLookup)
|
|
15658
|
+
*/
|
|
15659
|
+
readonly linkChartDiagramLookup: any;
|
|
15660
|
+
/**
|
|
15661
|
+
* The extent of the link chart.
|
|
15662
|
+
*
|
|
15663
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#linkChartExtent)
|
|
15664
|
+
*/
|
|
15665
|
+
linkChartExtent: Extent;
|
|
15666
|
+
/**
|
|
15667
|
+
* The [entity types](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-EntityType.html) included in the LinkChartLayer.
|
|
15668
|
+
*
|
|
15669
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#memberEntityTypes)
|
|
15670
|
+
*/
|
|
15671
|
+
readonly memberEntityTypes: EntityType[];
|
|
15672
|
+
/**
|
|
15673
|
+
* The [relationship types](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-RelationshipType.html) included in the LinkChartLayer.
|
|
15674
|
+
*
|
|
15675
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#memberRelationshipTypes)
|
|
15676
|
+
*/
|
|
15677
|
+
readonly memberRelationshipTypes: RelationshipType[];
|
|
15678
|
+
/**
|
|
15679
|
+
* The layer type.
|
|
15680
|
+
*
|
|
15681
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#type)
|
|
15682
|
+
*/
|
|
15683
|
+
readonly type: "link-chart";
|
|
15684
|
+
/**
|
|
15685
|
+
* The url of the [knowledge graph service](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraphService.html).
|
|
15686
|
+
*
|
|
15687
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#url)
|
|
15688
|
+
*/
|
|
15689
|
+
url: string;
|
|
15690
|
+
/**
|
|
15691
|
+
* A LinkChartLayer is a composite layer that can be created from a [knowledge graph service](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraphService.html).
|
|
15692
|
+
*
|
|
15693
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html)
|
|
15694
|
+
*/
|
|
15695
|
+
constructor(properties?: LinkChartLayerProperties);
|
|
15696
|
+
/**
|
|
15697
|
+
* [Calculates](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#calculateLinkChartLayout) the layout for the link chart and refreshes the canvas with the new layout.
|
|
15698
|
+
*
|
|
15699
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#applyNewLinkChartLayout)
|
|
15700
|
+
*/
|
|
15701
|
+
applyNewLinkChartLayout(layoutMode: | "RADIAL_TREE"
|
|
15702
|
+
| "GEOGRAPHIC"
|
|
15703
|
+
| "FORCE_DIRECTED"
|
|
15704
|
+
| "COMMUNITY"
|
|
15705
|
+
| "SIMPLE"
|
|
15706
|
+
| "HIERARCHICAL"
|
|
15707
|
+
| "SMART_TREE", options?: LinkChartLayerApplyNewLinkChartLayoutOptions): void;
|
|
15708
|
+
/**
|
|
15709
|
+
* Calculates the layout for the entire link chart and then caches the layout positions so that the [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-knowledgeGraph-KnowledgeGraphSublayer.html) can look it up after a diagram query.
|
|
15710
|
+
*
|
|
15711
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#calculateLinkChartLayout)
|
|
15712
|
+
*/
|
|
15713
|
+
calculateLinkChartLayout(layoutMode: | "RADIAL_TREE"
|
|
15714
|
+
| "GEOGRAPHIC"
|
|
15715
|
+
| "FORCE_DIRECTED"
|
|
15716
|
+
| "COMMUNITY"
|
|
15717
|
+
| "SIMPLE"
|
|
15718
|
+
| "HIERARCHICAL"
|
|
15719
|
+
| "SMART_TREE", options?: LinkChartLayerCalculateLinkChartLayoutOptions): Promise<any>;
|
|
15720
|
+
/**
|
|
15721
|
+
* Synchronizes the layer inclusion list with the cache.
|
|
15722
|
+
*
|
|
15723
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#synchronizeInclusionList)
|
|
15724
|
+
*/
|
|
15725
|
+
synchronizeInclusionList(): void;
|
|
15726
|
+
}
|
|
15727
|
+
|
|
15728
|
+
/** @deprecated Import the LinkChartLayer class instead. */
|
|
15729
|
+
export type LinkChartLayerConstructor = typeof LinkChartLayer;
|
|
15730
|
+
|
|
15731
|
+
interface LinkChartLayerProperties extends LayerProperties {
|
|
15732
|
+
/**
|
|
15733
|
+
* Sets a default layout configuration for the link chart.
|
|
15734
|
+
*
|
|
15735
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#defaultLinkChartConfig)
|
|
15736
|
+
*/
|
|
15737
|
+
defaultLinkChartConfig?: LinkChartLayerDefaultLinkChartConfig;
|
|
15738
|
+
/**
|
|
15739
|
+
* Defines a set of [named types](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphNamedObject.html) and/or [entities](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-Entity.html) and [relationships](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-Relationship.html) to be included in the layer.
|
|
15740
|
+
*
|
|
15741
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#inclusionModeDefinition)
|
|
15742
|
+
*/
|
|
15743
|
+
inclusionModeDefinition?: LinkChartLayerInclusionModeDefinition;
|
|
15744
|
+
/**
|
|
15745
|
+
* The extent of the link chart.
|
|
15746
|
+
*
|
|
15747
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#linkChartExtent)
|
|
15748
|
+
*/
|
|
15749
|
+
linkChartExtent?: ExtentProperties;
|
|
15750
|
+
/**
|
|
15751
|
+
* The url of the [knowledge graph service](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraphService.html).
|
|
15752
|
+
*
|
|
15753
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#url)
|
|
15754
|
+
*/
|
|
15755
|
+
url?: string;
|
|
15756
|
+
}
|
|
15757
|
+
|
|
15758
|
+
/**
|
|
15759
|
+
* Defines the sublayer structure and the named types that will be in the LinkChartLayer.
|
|
15760
|
+
*
|
|
15761
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#InclusionModeDefinition)
|
|
15762
|
+
*/
|
|
15763
|
+
export interface LinkChartLayerInclusionModeDefinition {
|
|
15764
|
+
/**
|
|
15765
|
+
* Specifies whether to create sublayers for each [named type](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphNamedObject.html) regardless of whether or not they are included in the `namedTypeDefinition`.
|
|
15766
|
+
*
|
|
15767
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#InclusionModeDefinition)
|
|
15768
|
+
*/
|
|
15769
|
+
generateAllSublayers: boolean;
|
|
15770
|
+
/**
|
|
15771
|
+
* A map of named types and the specific instances of those types to include in the layer.
|
|
15772
|
+
*
|
|
15773
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#InclusionModeDefinition)
|
|
15774
|
+
*/
|
|
15775
|
+
namedTypeDefinitions: any;
|
|
15776
|
+
}
|
|
15777
|
+
|
|
15778
|
+
/**
|
|
15779
|
+
* Defines the contents of each specified named type in the [`inclusionModeDefinition`](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#inclusionModeDefinition) and whether all instance of the named type will be used for a specified subset.
|
|
15780
|
+
*
|
|
15781
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#LayerInclusionDefinition)
|
|
15782
|
+
*/
|
|
15783
|
+
export interface LinkChartLayerLayerInclusionDefinition {
|
|
15784
|
+
/**
|
|
15785
|
+
* If `true`, all of the instances of the named type will be included regardless of if there is a defined list of members.
|
|
15786
|
+
*
|
|
15787
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#LayerInclusionDefinition)
|
|
15788
|
+
*/
|
|
15789
|
+
useAllData: boolean;
|
|
15790
|
+
/**
|
|
15791
|
+
* A map of the specific members of the named type to be included.
|
|
15792
|
+
*
|
|
15793
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#LayerInclusionDefinition)
|
|
15794
|
+
*/
|
|
15795
|
+
members: any;
|
|
15796
|
+
}
|
|
15797
|
+
|
|
15798
|
+
/**
|
|
15799
|
+
* Defines the list of `members` for a named type in the [`inclusionModeDefinition`](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#inclusionModeDefinition).
|
|
15800
|
+
*
|
|
15801
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#LayerInclusionMemberDefinition)
|
|
15802
|
+
*/
|
|
15803
|
+
export interface LinkChartLayerLayerInclusionMemberDefinition {
|
|
15804
|
+
/**
|
|
15805
|
+
* The unique identifier of the specific instance of the named type to be included in the layer.
|
|
15806
|
+
*
|
|
15807
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#LayerInclusionMemberDefinition)
|
|
15808
|
+
*/
|
|
15809
|
+
id: string;
|
|
15810
|
+
/**
|
|
15811
|
+
* The exact point location of the entity on the LinkChart.
|
|
15812
|
+
*
|
|
15813
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#LayerInclusionMemberDefinition)
|
|
15814
|
+
*/
|
|
15815
|
+
linkChartLocation: Geometry;
|
|
15816
|
+
}
|
|
15817
|
+
|
|
15818
|
+
export interface LinkChartLayerApplyNewLinkChartLayoutOptions {
|
|
15819
|
+
/**
|
|
15820
|
+
* The factor to scale the x-axis of the canvas.
|
|
15821
|
+
*
|
|
15822
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#applyNewLinkChartLayout)
|
|
15823
|
+
*/
|
|
15824
|
+
xScaleFactor?: number;
|
|
15825
|
+
/**
|
|
15826
|
+
* The factor to scale the y-axis of the canvas.
|
|
15827
|
+
*
|
|
15828
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#applyNewLinkChartLayout)
|
|
15829
|
+
*/
|
|
15830
|
+
yScaleFactor?: number;
|
|
15831
|
+
/**
|
|
15832
|
+
* A set of unique identifiers and exact canvas point location of any entities or relationships that should be drawn at the same location in every layout.
|
|
15833
|
+
*
|
|
15834
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#applyNewLinkChartLayout)
|
|
15835
|
+
*/
|
|
15836
|
+
lockedNodeLocations?: any;
|
|
15837
|
+
}
|
|
15838
|
+
|
|
15839
|
+
export interface LinkChartLayerCalculateLinkChartLayoutOptions {
|
|
15840
|
+
/**
|
|
15841
|
+
* The factor to scale the x-axis of the canvas.
|
|
15842
|
+
*
|
|
15843
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#calculateLinkChartLayout)
|
|
15844
|
+
*/
|
|
15845
|
+
xScaleFactor?: number;
|
|
15846
|
+
/**
|
|
15847
|
+
* The factor to scale the y-axis of the canvas.
|
|
15848
|
+
*
|
|
15849
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#calculateLinkChartLayout)
|
|
15850
|
+
*/
|
|
15851
|
+
yScaleFactor?: number;
|
|
15852
|
+
/**
|
|
15853
|
+
* A set of unique identifiers and exact canvas point location of any entities or relationships that should be drawn at the same location in every layout.
|
|
15854
|
+
*
|
|
15855
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#calculateLinkChartLayout)
|
|
15856
|
+
*/
|
|
15857
|
+
lockedNodeLocations?: any;
|
|
15858
|
+
}
|
|
15859
|
+
|
|
15860
|
+
export interface LinkChartLayerDefaultLinkChartConfig {
|
|
15861
|
+
/**
|
|
15862
|
+
* The layout mode to be applied by default.
|
|
15863
|
+
*
|
|
15864
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#defaultLinkChartConfig)
|
|
15865
|
+
*/
|
|
15866
|
+
layoutMode: | "RADIAL_TREE"
|
|
15867
|
+
| "GEOGRAPHIC"
|
|
15868
|
+
| "FORCE_DIRECTED"
|
|
15869
|
+
| "COMMUNITY"
|
|
15870
|
+
| "SIMPLE"
|
|
15871
|
+
| "HIERARCHICAL"
|
|
15872
|
+
| "SMART_TREE";
|
|
15873
|
+
/**
|
|
15874
|
+
* Scales the x-axis of the link chart canvas by the specified amount.
|
|
15875
|
+
*
|
|
15876
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#defaultLinkChartConfig)
|
|
15877
|
+
*/
|
|
15878
|
+
xScaleFactor: number;
|
|
15879
|
+
/**
|
|
15880
|
+
* Scales the y-axis of the link chart canvas by the specified amount.
|
|
15881
|
+
*
|
|
15882
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#defaultLinkChartConfig)
|
|
15883
|
+
*/
|
|
15884
|
+
yScaleFactor: number;
|
|
15885
|
+
/**
|
|
15886
|
+
* By default, the layout algorithm is always run on link charts when they are first created.
|
|
15887
|
+
*
|
|
15888
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#defaultLinkChartConfig)
|
|
15889
|
+
*/
|
|
15890
|
+
doNotRecalculateLayout: boolean;
|
|
15891
|
+
}
|
|
15892
|
+
|
|
15628
15893
|
export interface MapImageLayer extends Layer, SublayersOwner, ArcGISMapService, ScaleRangeLayer, RefreshableLayer, TemporalLayer, BlendLayer, CustomParametersMixin {
|
|
15629
15894
|
}
|
|
15630
15895
|
|
package/layers/LinkChartLayer.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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../core/Collection.js";import a from"../core/Error.js";import i from"../core/Logger.js";import{throwIfAborted as o}from"../core/promiseUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import{encodeGeohash as s}from"../geohash/geohashUtils.js";import h from"./Layer.js";import{convertFromGeometry as l}from"./graphics/featureConversionUtils.js";import c from"./graphics/OptimizedGeometry.js";import{KnowledgeGraphLayerDataManager as p,MOCK_OID_FIELD_NAME as d,MOCK_ORIGIN_ID_FIELD_NAME as u,MOCK_DESTINATION_ID_FIELD_NAME as y,MOCK_LAYOUT_GEOMETRY_FIELD_NAME as m,GEOHASH_ENCODING_PRECISION as f}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import g from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{BlendLayer as k}from"./mixins/BlendLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{LCSimpleLayout as L,LCSmartTreeLayout as b,LCRadialTreeLayout as M,LCHierarchicalLayout as w,LCCommunityLayout as x,LCForceDirectedLayout as E,NodeFlag as D,load as T}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as G}from"../rest/knowledgeGraphService.js";import I from"../rest/knowledgeGraph/EntityType.js";import A from"../rest/knowledgeGraph/RelationshipType.js";import N from"../geometry/Extent.js";import R from"../geometry/Point.js";import _ from"../geometry/Polyline.js";const v=(e,t,a)=>(e.has(t)||e.set(t,a()),e.get(t));let j=class extends(k(C(h))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE",xScaleFactor:1,yScaleFactor:1},this._graphTypeLookup=new Map,this.layers=new t,this.linkChartDiagramLookup=new Map,this.linkChartExtent=new N({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.linkChartGeohashLookup=new Map,this.sublayerIdsCache=new Map,this.tables=new t,this.type="link-chart",this._originalInclusionList=e.inclusionModeDefinition,e.dataPreloadedInLocalCache&&!e.inclusionModeDefinition)throw new a("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it")}normalizeCtorArgs(e){return{url:e.url,title:e.title,dataPreloadedInLocalCache:e.dataPreloadedInLocalCache,defaultLinkChartConfig:e.defaultLinkChartConfig}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let o=[],n=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new a("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.inclusionModeDefinition?.generateAllSublayers?(o=e.knowledgeGraph.dataModel.entityTypes??[],n=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((a,r)=>{if(!this._graphTypeLookup.get(r))return i.getLogger(this).warn(`A named type, ${r}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(r);this._graphTypeLookup.get(r)instanceof A||"strictOrigin"in this._graphTypeLookup.get(r)?t.has(r)||(t.add(r),n.push(this._graphTypeLookup.get(r))):this._graphTypeLookup.get(r)instanceof I||"properties"in this._graphTypeLookup.get(r)?t.has(r)||(t.add(r),o.push(this._graphTypeLookup.get(r))):(i.getLogger(this).warn(`A named type, ${r}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(r))})):(o=e.knowledgeGraph.dataModel.entityTypes??[],n=e.knowledgeGraph.dataModel.relationshipTypes??[]);const r=new p({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=o,this.memberRelationshipTypes=n,this.dataManager=r}load(e){return this.addResolvingPromise(new Promise((t=>{G(this.url).then((a=>{if(this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}))),this.dataPreloadedInLocalCache)this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((e=>{e.useAllData=!1,e.members?.forEach((e=>{let t;t=e.linkChartLocation instanceof c?e.linkChartLocation:e.linkChartLocation?l(e.linkChartLocation):null,this.linkChartDiagramLookup.set(e.id,t),t&&2===t.coords.length&&0===t.lengths.length?this.linkChartGeohashLookup.set(e.id,s(t.coords[1],t.coords[0],f)):this.linkChartGeohashLookup.set(e.id,"")})),this.addResolvingPromise(this._initializeDiagram().then((async()=>{this.layers.forEach((async e=>{await e.refreshCachedQueryEngine()})),this.tables.forEach((async e=>{await e.refreshCachedQueryEngine()}))})))}));else{const t="GEOGRAPHIC"===this.defaultLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then((async()=>{o(e);const t=[],a=[];this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1,this.dataManager.inclusionModeDefinition.namedTypeDefinitions.forEach((e=>{e.useAllData=!1}))),await this._initializeDiagram(),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine()),t.push(new Promise((t=>{e.on("layerview-create",(()=>{t(null)}))})))})),this.tables.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a)})))}t(null)}))}))),Promise.resolve(this)}async addRecords(e){await this._handleNewRecords(e)}async expand(e){const t=await this.dataManager.getConnectedRecordIds(e),a=t.filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));return await this._handleNewRecords(t),{records:a}}loadLayerAssumingLocalCache(){this.memberRelationshipTypes.forEach((e=>{const t=new g({objectType:e,parentCompositeLayer:this,graphType:"relationship",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.memberEntityTypes.forEach((e=>{const t=new g({objectType:e,parentCompositeLayer:this,graphType:"entity",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{const a=v(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((e=>{if(a.add(e.id),e.linkChartLocation)if(e.linkChartLocation instanceof c)this.linkChartDiagramLookup.set(e.id,e.linkChartLocation),2===e.linkChartLocation.coords.length&&0===e.linkChartLocation.lengths.length?this.linkChartGeohashLookup.set(e.id,s(e.linkChartLocation.coords[1],e.linkChartLocation.coords[0],f)):this.linkChartGeohashLookup.set(e.id,"");else{const t=l(e.linkChartLocation);this.linkChartDiagramLookup.set(e.id,e.linkChartLocation?t:null),"x"in e.linkChartLocation&&"y"in e.linkChartLocation?this.linkChartGeohashLookup.set(e.id,s(e.linkChartLocation.x,e.linkChartLocation.y,f)):this.linkChartGeohashLookup.set(e.id,"")}}))}))}async calculateLinkChartLayout(e="RADIAL_TREE",t){const o=[],n=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{o.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{n.push({typeName:t,feature:e})}))})),this.linkChartDiagramLookup=new Map;const r=new Map,h=new Map,c=new Map,p=new Map,g=new Uint8Array(o.length),k=new Float64Array(o.length),C=new Float64Array(o.length),G=new Uint32Array(n.length),I=new Uint32Array(n.length),A=[],v="FORCE_DIRECTED",j=t?.xScaleFactor??1,S=t?.yScaleFactor??1,P=new N({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let F,z="FORCE_DIRECTED",O=0,U=0;switch(z="GEOGRAPHIC"===e?v:e,z){case"FORCE_DIRECTED":F=E.apply;break;case"COMMUNITY":F=x.apply;break;case"HIERARCHICAL":F=w.apply;break;case"RADIAL_TREE":F=M.apply;break;case"SMART_TREE":F=b.apply;break;default:F=L.apply}o.forEach((({typeName:a,feature:i})=>{if(t?.lockedNodeLocations?.has(i.attributes[d])){"GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)?g[O]=D.IsGeographic:g[O]=D.None;const o=t.lockedNodeLocations.get(i.attributes[d]);k[O]=o.x,C[O]=o.y}else if("GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)){g[O]=D.IsGeographic;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],o=this.dataManager.geographicLookup.get(a)?.geometryType;switch(o){case"esriGeometryPoint":k[O]=t?.x,C[O]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(k[O]=e.x,C[O]=e.y):g[O]=D.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(k[O]=e.x,C[O]=e.y):g[O]=D.IsMovable;break;default:g[O]=D.IsMovable}(null==k[O]||null==C[O]||Number.isNaN(k[O])||Number.isNaN(C[O]))&&(g[O]=D.IsMovable,k[O]=0,C[O]=0)}else g[O]=D.IsMovable,k[O]=0,C[O]=0;p.set(i.attributes[d],O),A[O]={feature:i,typeName:a},O++}));let H=!1;n.forEach((e=>{const t=p.get(e.feature.attributes[u]),a=p.get(e.feature.attributes[y]);void 0!==t&&void 0!==a?(G[U]=t,I[U]=a,U++):(H=!0,this.linkChartDiagramLookup.set(e.feature.attributes[u],null),this.linkChartGeohashLookup.set(e.feature.attributes[u],null))})),H&&i.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null"),await T();if(!F(g,k,C,G,I))throw new a("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let a=0;a<A.length;a++){if(g[a]===D.IsMovable&&(k[a]=k[a]*j,C[a]=C[a]*S),C[a]>84.9999&&(C[a]=84.9999),C[a]<-84.9999&&(C[a]=-84.9999),k[a]>179.9999&&(k[a]=179.9999),k[a]<-179.9999&&(k[a]=-179.9999),A[a].feature.attributes[m]=new R(k[a],C[a]),r.has(A[a].typeName)){const e=r.get(A[a].typeName);e?.set(A[a].feature.attributes[d],A[a].feature)}else{const e=new Map;e.set(A[a].feature.attributes[d],A[a].feature),r.set(A[a].typeName,e)}c.set(A[a].feature.attributes[d],A[a].feature);const e=l(A[a].feature.attributes[m]);this.linkChartDiagramLookup.set(A[a].feature.attributes[d],A[a].feature.attributes[m]?e:null),this.linkChartGeohashLookup.set(A[a].feature.attributes[d],s(A[a].feature.attributes[m].y,A[a].feature.attributes[m].x,f)),A[a].feature.attributes[m].x<P.xmin&&(P.xmin=A[a].feature.attributes[m].x),A[a].feature.attributes[m].x>P.xmax&&(P.xmax=A[a].feature.attributes[m].x),A[a].feature.attributes[m].y<P.ymin&&(P.ymin=A[a].feature.attributes[m].y),A[a].feature.attributes[m].y>P.ymax&&(P.ymax=A[a].feature.attributes[m].y)}return this.linkChartExtent.xmin=P.xmin,this.linkChartExtent.xmax=P.xmax,this.linkChartExtent.ymin=P.ymin,this.linkChartExtent.ymax=P.ymax,n.forEach((e=>{const t=A[p.get(e.feature.attributes[u])]?.feature.attributes[m],a=A[p.get(e.feature.attributes[y])]?.feature.attributes[m];if(!t||!a)return;const i=new _({paths:[[t.x,t.y],[a.x,a.y]]});if(e.feature.attributes[m]=i,h.has(e.typeName)){const t=h.get(e.typeName);t?.set(e.feature.attributes[d],e.feature)}else{const t=new Map;t.set(e.feature.attributes[d],e.feature),h.set(e.typeName,t)}c.set(e.feature.attributes[d],e.feature);const o=l(e.feature.attributes[m]);this.linkChartDiagramLookup.set(e.feature.attributes[d],e.feature.attributes[m]?o:null),this.linkChartGeohashLookup.set(e.feature.attributes[d],"")})),this._currentLinkChartConfig={layoutMode:e,xScaleFactor:j,yScaleFactor:S},{nodes:r,links:h,idMap:c}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const a=[];await this.calculateLinkChartLayout(e,t),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a),this.layers.forEach((e=>{e.emit("refresh",{dataChanged:!0})}))}getCurrentNodeLocations(){const e=new Map;return this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t=>{t?.members?.forEach((t=>{const a=t.linkChartLocation;let i;const o=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(o,new R({x:i.x,y:i.y})))}))})),e}async synchronizeInclusionListWithCache(){return new Promise((e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{if(e.useAllData=!1,e.members&&e.members.size>0){if(!this.dataManager.sublayerCaches.get(t))return;const a=Array.from(this.dataManager.sublayerCaches.get(t).keys());Array.from(e.members.keys()).filter((e=>!a.includes(e))).forEach((t=>{e.members?.delete(t)}))}})),e()}))}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t),this.layers.forEach((e=>{e.emit("refresh",{dataChanged:!0})}))}async _handleNewRecords(e){const t=[];this.dataManager.addToLayerInclusionSet(e);for(const a of e)this.sublayerIdsCache.has(a.typeName)||(this.sublayerIdsCache.set(a.typeName,new Set),t.push(a.typeName)),this.sublayerIdsCache.get(a.typeName).add(a.id);for(const a of t)if(this._graphTypeLookup.has(a)){const e=this._graphTypeLookup.get(a),t="endPoints"in e?"relationship":"entity",i=new g({objectType:e,parentCompositeLayer:this,graphType:t,title:a});"entity"===t?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a),i.geometryType?this.layers.push(i):this.tables.push(i),this.dataManager.sublayerCaches.set(a,new Map)}await this.dataManager.refreshCacheContent(e.map((e=>e.id))),await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,{xScaleFactor:this._currentLinkChartConfig.xScaleFactor,yScaleFactor:this._currentLinkChartConfig.xScaleFactor})}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e=>{e?.members?.forEach((e=>{const t=e.linkChartLocation;let a;const i=e.id;if(!t)return;a="x"in t?{x:t.x,y:t.y}:{x:t.coords[0],y:t.coords[1]};const o=l(a);this.linkChartDiagramLookup.set(i,o),this.linkChartGeohashLookup.set(i,s(a.x,a.y,f)),this.linkChartExtent.xmin>a.x&&(this.linkChartExtent.xmin=a.x),this.linkChartExtent.xmax<a.x&&(this.linkChartExtent.xmax=a.x),this.linkChartExtent.ymin>a.y&&(this.linkChartExtent.ymin=a.y),this.linkChartExtent.ymax<a.y&&(this.linkChartExtent.ymax=a.y)}))})),this.memberRelationshipTypes.forEach((e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach((e=>{const t=this.linkChartDiagramLookup.get(e.attributes[u]),a=this.linkChartDiagramLookup.get(e.attributes[y]);if(t&&a){const i=l(new _({paths:[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]}));this.linkChartDiagramLookup.set(e.attributes[d],i)}else this.linkChartDiagramLookup.set(e.attributes[d],null);this.linkChartGeohashLookup.set(e.attributes[d],"")}))}))):await this.calculateLinkChartLayout(this.defaultLinkChartConfig.layoutMode,{xScaleFactor:this.defaultLinkChartConfig.xScaleFactor,yScaleFactor:this.defaultLinkChartConfig.yScaleFactor,lockedNodeLocations:this.getCurrentNodeLocations()}):await this.calculateLinkChartLayout("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}};e([n()],j.prototype,"dataPreloadedInLocalCache",void 0),e([n()],j.prototype,"defaultLinkChartConfig",void 0),e([n()],j.prototype,"dataManager",void 0),e([n()],j.prototype,"knowledgeGraph",void 0),e([n()],j.prototype,"layers",void 0),e([n()],j.prototype,"linkChartDiagramLookup",void 0),e([n()],j.prototype,"linkChartExtent",void 0),e([n()],j.prototype,"linkChartGeohashLookup",void 0),e([n()],j.prototype,"memberEntityTypes",void 0),e([n()],j.prototype,"memberRelationshipTypes",void 0),e([n()],j.prototype,"sublayerIdsCache",void 0),e([n()],j.prototype,"tables",void 0),e([n({json:{read:!1}})],j.prototype,"type",void 0),j=e([r("esri.layers.LinkChartLayer")],j);const S=j;export{S as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../core/Collection.js";import a from"../core/Error.js";import i from"../core/Logger.js";import{throwIfAborted as o}from"../core/promiseUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import{encodeGeohash as s}from"../geohash/geohashUtils.js";import h from"./Layer.js";import{convertFromGeometry as l}from"./graphics/featureConversionUtils.js";import c from"./graphics/OptimizedGeometry.js";import{KnowledgeGraphLayerDataManager as p,MOCK_OID_FIELD_NAME as d,MOCK_ORIGIN_ID_FIELD_NAME as u,MOCK_DESTINATION_ID_FIELD_NAME as y,MOCK_LAYOUT_GEOMETRY_FIELD_NAME as m,GEOHASH_ENCODING_PRECISION as f}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import g from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{BlendLayer as k}from"./mixins/BlendLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{LCSimpleLayout as L,LCSmartTreeLayout as b,LCRadialTreeLayout as M,LCHierarchicalLayout as w,LCCommunityLayout as x,LCForceDirectedLayout as E,NodeFlag as D,load as T}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as G}from"../rest/knowledgeGraphService.js";import I from"../rest/knowledgeGraph/EntityType.js";import A from"../rest/knowledgeGraph/RelationshipType.js";import N from"../geometry/Extent.js";import R from"../geometry/Point.js";import _ from"../geometry/Polyline.js";const v=(e,t,a)=>(e.has(t)||e.set(t,a()),e.get(t));let j=class extends(k(C(h))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE",xScaleFactor:1,yScaleFactor:1},this._graphTypeLookup=new Map,this.knowledgeGraph=null,this.layers=new t,this.linkChartDiagramLookup=new Map,this.linkChartExtent=new N({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.linkChartGeohashLookup=new Map,this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.sublayerIdsCache=new Map,this.tables=new t,this.type="link-chart",this._originalInclusionList=e.inclusionModeDefinition,e.dataPreloadedInLocalCache&&!e.inclusionModeDefinition)throw new a("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it")}normalizeCtorArgs(e){return{url:e.url,title:e.title,dataPreloadedInLocalCache:e.dataPreloadedInLocalCache,defaultLinkChartConfig:e.defaultLinkChartConfig}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let o=[],n=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new a("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.inclusionModeDefinition?.generateAllSublayers?(o=e.knowledgeGraph.dataModel.entityTypes??[],n=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((a,r)=>{if(!this._graphTypeLookup.get(r))return i.getLogger(this).warn(`A named type, ${r}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(r);this._graphTypeLookup.get(r)instanceof A||"strictOrigin"in this._graphTypeLookup.get(r)?t.has(r)||(t.add(r),n.push(this._graphTypeLookup.get(r))):this._graphTypeLookup.get(r)instanceof I||"properties"in this._graphTypeLookup.get(r)?t.has(r)||(t.add(r),o.push(this._graphTypeLookup.get(r))):(i.getLogger(this).warn(`A named type, ${r}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(r))})):(o=e.knowledgeGraph.dataModel.entityTypes??[],n=e.knowledgeGraph.dataModel.relationshipTypes??[]);const r=new p({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=o,this.memberRelationshipTypes=n,this.dataManager=r}load(e){return this.addResolvingPromise(new Promise((t=>{G(this.url).then((a=>{if(this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}))),this.dataPreloadedInLocalCache)this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((e=>{e.useAllData=!1,e.members?.forEach((e=>{let t;t=e.linkChartLocation instanceof c?e.linkChartLocation:e.linkChartLocation?l(e.linkChartLocation):null,this.linkChartDiagramLookup.set(e.id,t),t&&2===t.coords.length&&0===t.lengths.length?this.linkChartGeohashLookup.set(e.id,s(t.coords[1],t.coords[0],f)):this.linkChartGeohashLookup.set(e.id,"")})),this.addResolvingPromise(this._initializeDiagram().then((async()=>{this.layers.forEach((async e=>{await e.refreshCachedQueryEngine()})),this.tables.forEach((async e=>{await e.refreshCachedQueryEngine()}))})))}));else{const t="GEOGRAPHIC"===this.defaultLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then((async()=>{o(e);const t=[],a=[];this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1,this.dataManager.inclusionModeDefinition.namedTypeDefinitions.forEach((e=>{e.useAllData=!1}))),await this._initializeDiagram(),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine()),t.push(new Promise((t=>{e.on("layerview-create",(()=>{t(null)}))})))})),this.tables.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a)})))}t(null)}))}))),Promise.resolve(this)}async addRecords(e){await this._handleNewRecords(e)}async expand(e){const t=await this.dataManager.getConnectedRecordIds(e),a=t.filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));return await this._handleNewRecords(t),{records:a}}loadLayerAssumingLocalCache(){this.memberRelationshipTypes.forEach((e=>{const t=new g({objectType:e,parentCompositeLayer:this,graphType:"relationship",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.memberEntityTypes.forEach((e=>{const t=new g({objectType:e,parentCompositeLayer:this,graphType:"entity",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{const a=v(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((e=>{if(a.add(e.id),e.linkChartLocation)if(e.linkChartLocation instanceof c)this.linkChartDiagramLookup.set(e.id,e.linkChartLocation),2===e.linkChartLocation.coords.length&&0===e.linkChartLocation.lengths.length?this.linkChartGeohashLookup.set(e.id,s(e.linkChartLocation.coords[1],e.linkChartLocation.coords[0],f)):this.linkChartGeohashLookup.set(e.id,"");else{const t=l(e.linkChartLocation);this.linkChartDiagramLookup.set(e.id,e.linkChartLocation?t:null),"x"in e.linkChartLocation&&"y"in e.linkChartLocation?this.linkChartGeohashLookup.set(e.id,s(e.linkChartLocation.x,e.linkChartLocation.y,f)):this.linkChartGeohashLookup.set(e.id,"")}}))}))}async calculateLinkChartLayout(e="RADIAL_TREE",t){const o=[],n=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{o.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{n.push({typeName:t,feature:e})}))})),this.linkChartDiagramLookup=new Map;const r=new Map,h=new Map,c=new Map,p=new Map,g=new Uint8Array(o.length),k=new Float64Array(o.length),C=new Float64Array(o.length),G=new Uint32Array(n.length),I=new Uint32Array(n.length),A=[],v="FORCE_DIRECTED",j=t?.xScaleFactor??1,S=t?.yScaleFactor??1,P=new N({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let F,z="FORCE_DIRECTED",O=0,U=0;switch(z="GEOGRAPHIC"===e?v:e,z){case"FORCE_DIRECTED":F=E.apply;break;case"COMMUNITY":F=x.apply;break;case"HIERARCHICAL":F=w.apply;break;case"RADIAL_TREE":F=M.apply;break;case"SMART_TREE":F=b.apply;break;default:F=L.apply}o.forEach((({typeName:a,feature:i})=>{if(t?.lockedNodeLocations?.has(i.attributes[d])){"GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)?g[O]=D.IsGeographic:g[O]=D.None;const o=t.lockedNodeLocations.get(i.attributes[d]);k[O]=o.x,C[O]=o.y}else if("GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)){g[O]=D.IsGeographic;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],o=this.dataManager.geographicLookup.get(a)?.geometryType;switch(o){case"esriGeometryPoint":k[O]=t?.x,C[O]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(k[O]=e.x,C[O]=e.y):g[O]=D.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(k[O]=e.x,C[O]=e.y):g[O]=D.IsMovable;break;default:g[O]=D.IsMovable}(null==k[O]||null==C[O]||Number.isNaN(k[O])||Number.isNaN(C[O]))&&(g[O]=D.IsMovable,k[O]=0,C[O]=0)}else g[O]=D.IsMovable,k[O]=0,C[O]=0;p.set(i.attributes[d],O),A[O]={feature:i,typeName:a},O++}));let H=!1;n.forEach((e=>{const t=p.get(e.feature.attributes[u]),a=p.get(e.feature.attributes[y]);void 0!==t&&void 0!==a?(G[U]=t,I[U]=a,U++):(H=!0,this.linkChartDiagramLookup.set(e.feature.attributes[u],null),this.linkChartGeohashLookup.set(e.feature.attributes[u],null))})),H&&i.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null"),await T();if(!F(g,k,C,G,I))throw new a("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let a=0;a<A.length;a++){if(g[a]===D.IsMovable&&(k[a]=k[a]*j,C[a]=C[a]*S),C[a]>84.9999&&(C[a]=84.9999),C[a]<-84.9999&&(C[a]=-84.9999),k[a]>179.9999&&(k[a]=179.9999),k[a]<-179.9999&&(k[a]=-179.9999),A[a].feature.attributes[m]=new R(k[a],C[a]),r.has(A[a].typeName)){const e=r.get(A[a].typeName);e?.set(A[a].feature.attributes[d],A[a].feature)}else{const e=new Map;e.set(A[a].feature.attributes[d],A[a].feature),r.set(A[a].typeName,e)}c.set(A[a].feature.attributes[d],A[a].feature);const e=l(A[a].feature.attributes[m]);this.linkChartDiagramLookup.set(A[a].feature.attributes[d],A[a].feature.attributes[m]?e:null),this.linkChartGeohashLookup.set(A[a].feature.attributes[d],s(A[a].feature.attributes[m].y,A[a].feature.attributes[m].x,f)),A[a].feature.attributes[m].x<P.xmin&&(P.xmin=A[a].feature.attributes[m].x),A[a].feature.attributes[m].x>P.xmax&&(P.xmax=A[a].feature.attributes[m].x),A[a].feature.attributes[m].y<P.ymin&&(P.ymin=A[a].feature.attributes[m].y),A[a].feature.attributes[m].y>P.ymax&&(P.ymax=A[a].feature.attributes[m].y)}return this.linkChartExtent.xmin=P.xmin,this.linkChartExtent.xmax=P.xmax,this.linkChartExtent.ymin=P.ymin,this.linkChartExtent.ymax=P.ymax,n.forEach((e=>{const t=A[p.get(e.feature.attributes[u])]?.feature.attributes[m],a=A[p.get(e.feature.attributes[y])]?.feature.attributes[m];if(!t||!a)return;const i=new _({paths:[[t.x,t.y],[a.x,a.y]]});if(e.feature.attributes[m]=i,h.has(e.typeName)){const t=h.get(e.typeName);t?.set(e.feature.attributes[d],e.feature)}else{const t=new Map;t.set(e.feature.attributes[d],e.feature),h.set(e.typeName,t)}c.set(e.feature.attributes[d],e.feature);const o=l(e.feature.attributes[m]);this.linkChartDiagramLookup.set(e.feature.attributes[d],e.feature.attributes[m]?o:null),this.linkChartGeohashLookup.set(e.feature.attributes[d],"")})),this._currentLinkChartConfig={layoutMode:e,xScaleFactor:j,yScaleFactor:S},{nodes:r,links:h,idMap:c}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const a=[];await this.calculateLinkChartLayout(e,t),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a),this.layers.forEach((e=>{e.emit("refresh",{dataChanged:!0})}))}getCurrentNodeLocations(){const e=new Map;return this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t=>{t?.members?.forEach((t=>{const a=t.linkChartLocation;let i;const o=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(o,new R({x:i.x,y:i.y})))}))})),e}async synchronizeInclusionListWithCache(){return new Promise((e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{if(e.useAllData=!1,e.members&&e.members.size>0){if(!this.dataManager.sublayerCaches.get(t))return;const a=Array.from(this.dataManager.sublayerCaches.get(t).keys());Array.from(e.members.keys()).filter((e=>!a.includes(e))).forEach((t=>{e.members?.delete(t)}))}})),e()}))}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t),this.layers.forEach((e=>{e.emit("refresh",{dataChanged:!0})}))}async _handleNewRecords(e){const t=[];this.dataManager.addToLayerInclusionSet(e);for(const a of e)this.sublayerIdsCache.has(a.typeName)||(this.sublayerIdsCache.set(a.typeName,new Set),t.push(a.typeName)),this.sublayerIdsCache.get(a.typeName).add(a.id);for(const a of t)if(this._graphTypeLookup.has(a)){const e=this._graphTypeLookup.get(a),t="endPoints"in e?"relationship":"entity",i=new g({objectType:e,parentCompositeLayer:this,graphType:t,title:a});"entity"===t?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a),i.geometryType?this.layers.push(i):this.tables.push(i),this.dataManager.sublayerCaches.set(a,new Map)}await this.dataManager.refreshCacheContent(e.map((e=>e.id))),await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,{xScaleFactor:this._currentLinkChartConfig.xScaleFactor,yScaleFactor:this._currentLinkChartConfig.xScaleFactor})}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e=>{e?.members?.forEach((e=>{const t=e.linkChartLocation;let a;const i=e.id;if(!t)return;a="x"in t?{x:t.x,y:t.y}:{x:t.coords[0],y:t.coords[1]};const o=l(a);this.linkChartDiagramLookup.set(i,o),this.linkChartGeohashLookup.set(i,s(a.x,a.y,f)),this.linkChartExtent.xmin>a.x&&(this.linkChartExtent.xmin=a.x),this.linkChartExtent.xmax<a.x&&(this.linkChartExtent.xmax=a.x),this.linkChartExtent.ymin>a.y&&(this.linkChartExtent.ymin=a.y),this.linkChartExtent.ymax<a.y&&(this.linkChartExtent.ymax=a.y)}))})),this.memberRelationshipTypes.forEach((e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach((e=>{const t=this.linkChartDiagramLookup.get(e.attributes[u]),a=this.linkChartDiagramLookup.get(e.attributes[y]);if(t&&a){const i=l(new _({paths:[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]}));this.linkChartDiagramLookup.set(e.attributes[d],i)}else this.linkChartDiagramLookup.set(e.attributes[d],null);this.linkChartGeohashLookup.set(e.attributes[d],"")}))}))):await this.calculateLinkChartLayout(this.defaultLinkChartConfig.layoutMode,{xScaleFactor:this.defaultLinkChartConfig.xScaleFactor,yScaleFactor:this.defaultLinkChartConfig.yScaleFactor,lockedNodeLocations:this.getCurrentNodeLocations()}):await this.calculateLinkChartLayout("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}};e([n()],j.prototype,"dataPreloadedInLocalCache",void 0),e([n()],j.prototype,"defaultLinkChartConfig",void 0),e([n()],j.prototype,"dataManager",void 0),e([n()],j.prototype,"knowledgeGraph",void 0),e([n()],j.prototype,"layers",void 0),e([n()],j.prototype,"linkChartDiagramLookup",void 0),e([n()],j.prototype,"linkChartExtent",void 0),e([n()],j.prototype,"linkChartGeohashLookup",void 0),e([n()],j.prototype,"memberEntityTypes",void 0),e([n()],j.prototype,"memberRelationshipTypes",void 0),e([n()],j.prototype,"sublayerIdsCache",void 0),e([n()],j.prototype,"tables",void 0),e([n({json:{read:!1}})],j.prototype,"type",void 0),j=e([r("esri.layers.LinkChartLayer")],j);const S=j;export{S 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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import l from"../../core/Error.js";import{waitTick as t,isAbortError as i}from"../../core/promiseUtils.js";class e{constructor(l,t=0,i=l.lods[l.lods.length-1].level){this.tileInfo=l,this.minLOD=t,this.maxLOD=i,l.lodAt(t)||(this.minLOD=l.lods[0].level),l.lodAt(i)||(this.maxLOD=l.lods[l.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(l,t,i){const e=this.tileInfo?.lodAt(l);return!e||l<this.minLOD||l>this.maxLOD?"unavailable":e.cols&&e.rows?i>=e.cols[0]&&i<=e.cols[1]&&t>=e.rows[0]&&t<=e.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(i,e,o,s){await t(s);const a=this.getAvailability(i,e,o);if("unavailable"===a)throw new l("tile-map:tile-unavailable","Tile is not available",{level:i,row:e,col:o});return a}async fetchAvailabilityUpsample(l,e,o,s,a){await t(a),s.level=l,s.row=e,s.col=o;const n=this.tileInfo;return n.updateTileInfo(s),this.fetchAvailability(l,e,o,a).catch((l=>{if(i(l))throw l;if(n.upsampleTile(s))return this.fetchAvailabilityUpsample(s.level,s.row,s.col,s,a);throw l}))}}export{e as default};
|