UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

1 lines • 12.1 kB
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[132],{13069:(t,e,n)=>{n.d(e,{AG:()=>s,lk:()=>r,vD:()=>a,yS:()=>o});const i="randomUUID"in crypto;function r(){if(i)return crypto.randomUUID();const t=crypto.getRandomValues(new Uint16Array(8));t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;const e=e=>t[e].toString(16).padStart(4,"0");return e(0)+e(1)+"-"+e(2)+"-"+e(3)+"-"+e(4)+"-"+e(5)+e(6)+e(7)}function o(){return`{${r().toUpperCase()}}`}function a(){return`{${r()}}`}function s(t){const e=t.toUpperCase();return"{"!==t[0]?`{${e}}`:e}},38954:(t,e,n)=>{n.d(e,{A:()=>m,B:()=>d,C:()=>f,D:()=>l,E:()=>z,F:()=>Z,H:()=>P,a:()=>U,b:()=>y,c:()=>a,d:()=>u,e:()=>S,f:()=>c,g:()=>M,h:()=>w,i:()=>s,j:()=>A,k:()=>x,l:()=>o,m:()=>E,n:()=>_,o:()=>L,q:()=>D,r:()=>b,s:()=>v,t:()=>I,u:()=>g,v:()=>R,w:()=>h,x:()=>j,y:()=>k,z:()=>p});var i=n(51850),r=n(34304);function o(t){const e=t[0],n=t[1],i=t[2];return Math.sqrt(e*e+n*n+i*i)}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function s(t,e,n,i){return t[0]=e,t[1]=n,t[2]=i,t}function c(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function u(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function f(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function l(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function h(t,e){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t}function d(t,e){return t[0]=Math.sign(e[0]),t[1]=Math.sign(e[1]),t[2]=Math.sign(e[2]),t}function m(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function p(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function M(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function y(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t}function A(t,e){const n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return Math.sqrt(n*n+i*i+r*r)}function v(t,e){const n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r}function x(t){const e=t[0],n=t[1],i=t[2];return e*e+n*n+i*i}function g(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function b(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function _(t,e){const n=e[0],i=e[1],r=e[2];let o=n*n+i*i+r*r;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function S(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function w(t,e,n){const i=e[0],r=e[1],o=e[2],a=n[0],s=n[1],c=n[2];return t[0]=r*c-o*s,t[1]=o*a-i*c,t[2]=i*s-r*a,t}function E(t,e,n,i){const r=e[0],o=e[1],a=e[2];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t[2]=a+i*(n[2]-a),t}function I(t,e,n){const i=e[0],r=e[1],o=e[2];return t[0]=n[0]*i+n[4]*r+n[8]*o+n[12],t[1]=n[1]*i+n[5]*r+n[9]*o+n[13],t[2]=n[2]*i+n[6]*r+n[10]*o+n[14],t}function L(t,e,n){const i=e[0],r=e[1],o=e[2];return t[0]=i*n[0]+r*n[3]+o*n[6],t[1]=i*n[1]+r*n[4]+o*n[7],t[2]=i*n[2]+r*n[5]+o*n[8],t}function R(t,e,n){const i=n[0],r=n[1],o=n[2],a=n[3],s=e[0],c=e[1],u=e[2],f=r*u-o*c,l=o*s-i*u,h=i*c-r*s,d=r*h-o*l,m=o*f-i*h,p=i*l-r*f,M=2*a;return t[0]=s+f*M+2*d,t[1]=c+l*M+2*m,t[2]=u+h*M+2*p,t}const q=(0,i.vt)(),T=(0,i.vt)();function D(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function z(t,e,n){const i=n[0]-e[0],r=n[1]-e[1],o=n[2]-e[2];let a=i*i+r*r+o*o;return a>0?(a=1/Math.sqrt(a),t[0]=i*a,t[1]=r*a,t[2]=o*a,t):(t[0]=0,t[1]=0,t[2]=0,t)}const U=u,N=f,O=l,Z=A,j=v,P=o,k=x;Object.freeze(Object.defineProperty({__proto__:null,abs:h,add:c,angle:function(t,e){_(q,t),_(T,e);const n=S(q,T);return n>1?0:n<-1?Math.PI:Math.acos(n)},bezier:function(t,e,n,i,r,o){const a=1-o,s=a*a,c=o*o,u=s*a,f=3*o*s,l=3*c*a,h=c*o;return t[0]=e[0]*u+n[0]*f+i[0]*l+r[0]*h,t[1]=e[1]*u+n[1]*f+i[1]*l+r[1]*h,t[2]=e[2]*u+n[2]*f+i[2]*l+r[2]*h,t},ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},clamp:function(t,e=0,n=1){return t[0]=Math.min(Math.max(t[0],e),n),t[1]=Math.min(Math.max(t[1],e),n),t[2]=Math.min(Math.max(t[2],e),n),t},copy:a,cross:w,crossAndNormalize:function(t,e,n){const i=e[0],r=e[1],o=e[2],a=n[0],s=n[1],c=n[2],u=r*c-o*s,f=o*a-i*c,l=i*s-r*a,h=Math.sqrt(u*u+f*f+l*l);return t[0]=u/h,t[1]=f/h,t[2]=l/h,t},direction:z,dist:Z,distance:A,div:O,divide:l,dot:S,equals:function(t,e){if(t===e)return!0;const n=t[0],i=t[1],o=t[2],a=e[0],s=e[1],c=e[2],u=(0,r.FD)();return Math.abs(n-a)<=u*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=u*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-c)<=u*Math.max(1,Math.abs(o),Math.abs(c))},exactEquals:D,floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},hermite:function(t,e,n,i,r,o){const a=o*o,s=a*(2*o-3)+1,c=a*(o-2)+o,u=a*(o-1),f=a*(3-2*o);return t[0]=e[0]*s+n[0]*c+i[0]*u+r[0]*f,t[1]=e[1]*s+n[1]*c+i[1]*u+r[1]*f,t[2]=e[2]*s+n[2]*c+i[2]*u+r[2]*f,t},inverse:b,len:P,length:o,lerp:E,max:p,min:m,mul:N,multiply:f,negate:g,normalize:_,random:function(t,e=1){const n=r.Ov,i=2*n()*Math.PI,o=2*n()-1,a=Math.sqrt(1-o*o)*e;return t[0]=Math.cos(i)*a,t[1]=Math.sin(i)*a,t[2]=o*e,t},rotateX:function(t,e,n,i){const r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[0],o[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),o[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},rotateY:function(t,e,n,i){const r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),o[1]=r[1],o[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},rotateZ:function(t,e,n,i){const r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),o[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),o[2]=r[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},scale:M,scaleAndAdd:y,set:s,sign:d,sqrDist:j,sqrLen:k,squaredDistance:v,squaredLength:x,str:function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},sub:U,subtract:u,transformMat3:L,transformMat4:I,transformQuat:R},Symbol.toStringTag,{value:"Module"}))},61528:(t,e,n)=>{n.r(e),n.d(e,{default:()=>z});var i=n(90237),r=n(78888),o=n(49186),a=n(53966),s=n(34727),c=n(92071),u=n(74887),f=n(36708),l=n(10107),h=(n(44208),n(87811),n(36005)),d=n(40608),m=n(87024),p=n(38954),M=n(51850),y=n(73941),A=n(5443),v=n(16930),x=n(9762),g=n(4146),b=n(52136),_=n(18768),S=n(69208),w=n(16131),E=n(8303),I=n(25036),L=n(10873),R=n(58325),q=n(24212),T=n(97159);let D=class extends((0,_.b)((0,w.q)((0,E.A)((0,I.j)((0,c.P)((0,S.d)((0,b.p)(g.A)))))))){readModifications(t,e,n){this._modificationsSource={url:(0,T.f)(t,n),context:n}}initialize(){this.addHandles((0,f.on)((()=>this.modifications),"after-changes",(()=>this.modifications=this.modifications),f.OH))}constructor(t){super(t),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new v.A({wkid:4326,vcsWkid:115700}),this.fullExtent=new A.A(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this.rootTilesetJSON=null}set elevationInfo(t){null!=t&&"absolute-height"!==t.mode||this._set("elevationInfo",t),this._validateElevationInfo(t)}_verifyArray(t,e){if(!Array.isArray(t)||t.length<e)return!1;for(const e of t)if("number"!=typeof e)return!1;return!0}_initFullExtent(){const t=this.rootTilesetJSON?.root?.boundingVolume;if(!t)return;if(t.box){const e=t?.box;if(e[3]>7645211&&e[7]>7645211&&e[11]>7645211)return}const e=this.rootTilesetJSON?.root?.transform,n=(0,M.vt)();if(t.region&&this._verifyArray(t.region,6)){const e=t.region,n=(0,s.KJ)(e[0]),i=(0,s.KJ)(e[1]),r=e[4],o=(0,s.KJ)(e[2]),a=(0,s.KJ)(e[3]),c=e[5];this.fullExtent=new A.A({xmin:n,ymin:i,zmin:r,xmax:o,ymax:a,zmax:c,spatialReference:this.spatialReference})}else if(t.sphere&&this._verifyArray(t.sphere,4)){const i=t.sphere,r=(0,M.fA)(i[0],i[1],i[2]),o=i[3]/Math.sqrt(3),a=(0,M.vt)();(0,p.d)(a,r,(0,M.fA)(o,o,o));const s=(0,M.vt)();if((0,p.f)(s,r,(0,M.fA)(o,o,o)),e&&this._verifyArray(e,16)){const t=e;(0,p.t)(n,a,t),(0,p.c)(a,n),(0,p.t)(n,s,t),(0,p.c)(s,n)}(0,x.projectBuffer)(a,y.Ro,0,a,v.A.WGS84,0),(0,x.projectBuffer)(s,y.Ro,0,s,v.A.WGS84,0);const c=(0,M.vt)(),u=(0,M.vt)();(0,p.A)(c,a,s),(0,p.z)(u,a,s),this.fullExtent=new A.A({xmin:c[0],ymin:c[1],zmin:c[2],xmax:u[0],ymax:u[1],zmax:u[2],spatialReference:this.spatialReference})}else if(t.box&&this._verifyArray(t.box,12)){const n=t.box,i=(0,M.fA)(n[0],n[1],n[2]),r=(0,M.fA)(n[3],n[4],n[5]),o=(0,M.fA)(n[6],n[7],n[8]),a=(0,M.fA)(n[9],n[10],n[11]),s=[];for(let t=0;t<8;++t)s.push((0,M.vt)());if((0,p.f)(s[0],i,r),(0,p.f)(s[0],s[0],o),(0,p.f)(s[0],s[0],a),(0,p.a)(s[1],i,r),(0,p.f)(s[1],s[1],o),(0,p.f)(s[1],s[1],a),(0,p.f)(s[2],i,r),(0,p.a)(s[2],s[2],o),(0,p.f)(s[2],s[2],a),(0,p.a)(s[3],i,r),(0,p.a)(s[3],s[3],o),(0,p.f)(s[3],s[3],a),(0,p.f)(s[4],i,r),(0,p.f)(s[4],s[4],o),(0,p.a)(s[4],s[4],a),(0,p.a)(s[5],i,r),(0,p.f)(s[5],s[5],o),(0,p.a)(s[5],s[5],a),(0,p.f)(s[6],i,r),(0,p.a)(s[6],s[6],o),(0,p.a)(s[6],s[6],a),(0,p.a)(s[7],i,r),(0,p.a)(s[7],s[7],o),(0,p.a)(s[7],s[7],a),e&&this._verifyArray(e,16)){const t=e;for(let e=0;e<8;++e)(0,p.t)(s[e],s[e],t)}const c=(0,M.fA)(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),u=(0,M.fA)(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let t=0;t<8;++t)(0,x.projectBuffer)(s[t],y.Ro,0,s[t],v.A.WGS84,0),(0,p.A)(u,u,s[t]),(0,p.z)(c,c,s[t]);this.fullExtent=new A.A({xmin:u[0],ymin:u[1],zmin:u[2],xmax:c[0],ymax:c[1],zmax:c[2],spatialReference:this.spatialReference})}}async load(t){return this.addResolvingPromise(this._doLoad(t)),this}async _doLoad(t){const e=null!=t?t.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:t=>{if(t.typeKeywords?.includes("IntegratedMesh"))return!0;throw new o.A("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},t)}catch(t){(0,u.QP)(t)}if(null!=this._modificationsSource){const e=await R.A.fromUrl(this._modificationsSource.url,this.spatialReference,t);this.setAtOrigin("modifications",e,this._modificationsSource.context.origin),this._modificationsSource=null}if(this.url){const t=(0,r.A)(this.url,{query:{...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then((t=>{this.rootTilesetJSON=t.data,this._initFullExtent()}),(t=>{(0,u.QP)(t)}));await t}}beforeSave(){if(null!=this._modificationsSource)return this.load().then((()=>{}),(()=>{}))}async fetchAttributionData(){return this.load().then((()=>({})))}_validateElevationInfo(t){const e="Integrated mesh 3d tiles layers";(0,q.XF)(a.A.getLogger(this),(0,q.B)(e,"absolute-height",t)),(0,q.XF)(a.A.getLogger(this),(0,q.tW)(e,t))}};(0,i._)([(0,l.MZ)({type:["IntegratedMesh3DTilesLayer"]})],D.prototype,"operationalLayerType",void 0),(0,i._)([(0,l.MZ)({type:R.A,clonable:t=>t.clone()}),(0,m.P)({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],D.prototype,"modifications",void 0),(0,i._)([(0,h.w)(["web-scene","portal-item"],"modifications")],D.prototype,"readModifications",null),(0,i._)([(0,l.MZ)({type:v.A})],D.prototype,"spatialReference",void 0),(0,i._)([(0,l.MZ)({type:A.A})],D.prototype,"fullExtent",void 0),(0,i._)([(0,l.MZ)(L.Yj)],D.prototype,"elevationInfo",null),(0,i._)([(0,l.MZ)({type:["show","hide"]})],D.prototype,"listMode",void 0),(0,i._)([(0,l.MZ)(L.OZ)],D.prototype,"url",void 0),(0,i._)([(0,l.MZ)({readOnly:!0})],D.prototype,"type",void 0),(0,i._)([(0,l.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],D.prototype,"path",void 0),(0,i._)([(0,l.MZ)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],D.prototype,"minScale",void 0),(0,i._)([(0,l.MZ)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],D.prototype,"maxScale",void 0),D=(0,i._)([(0,d.$)("esri.layers.IntegratedMesh3DTilesLayer")],D);const z=D},76553:(t,e,n)=>{function i(t){return t&&"getAtOrigin"in t&&"originOf"in t}n.d(e,{H:()=>i})}}]);