@nsc-earth-2/layer 1.1.3 → 1.1.4

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{Terrain as t,CesiumTerrainProvider as e,EllipsoidTerrainProvider as n,Rectangle as s,Cesium3DTileset as r,Matrix4 as i,Cartographic as o,Cartesian3 as a,Transforms as c,Matrix3 as h,Math as l,ArcGisMapServerImageryProvider as u,ImageryLayer as p,GeographicTilingScheme as f,Ellipsoid as d,UrlTemplateImageryProvider as y,WebMapServiceImageryProvider as m,WebMapTileServiceImageryProvider as w,KmlDataSource as I,WebMercatorTilingScheme as v}from"cesium";import{GeoJsonPrimitiveLayer as g}from"@nsc-earth-2/primitive-geojson";const _=T;function E(){const t=["7131608rOyRgn","requestRender","terrainProvider","3940614JSxDEE","valid_bounds","12mSmFzx","158912Cihndh","45706LFrKeK","flyTo","18933nYAMHG","scene","the layer type is not 'TERRAIN'","camera","14pUDUHg","url","setTerrain","2520UXQKZT","236260eBqNfW","resolve","_viewer","locate","10ajiddv","length","fromUrl","bounds","isArray","/layer.json","fromDegrees","TERRAIN","5682pPgRYO","show","remove","then"];return(E=function(){return t})()}function T(t,e){const n=E();return(T=function(t,e){return n[t-=231]})(t,e)}!function(){const t=T,e=E();for(;;)try{if(255309===parseInt(t(249))/1+-parseInt(t(247))/2*(parseInt(t(251))/3)+-parseInt(t(259))/4+parseInt(t(258))/5*(parseInt(t(238))/6)+parseInt(t(255))/7*(parseInt(t(248))/8)+parseInt(t(245))/9+parseInt(t(263))/10*(-parseInt(t(242))/11))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class S{constructor(t){this._viewer=t}load(n){const s=T;if((n=n??{}).type!==s(237))throw new Error(s(253));const r=n[s(256)],i=new t(e[s(232)](r));return this[s(261)].scene.setTerrain(i),this[s(261)].scene[s(243)](),Promise[s(260)](i)}[_(240)](t){const e=_,s=new n;this[e(261)][e(244)]=s,this[e(261)][e(252)][e(243)]()}[_(262)](t,e){const n=_,r=(t=t??{}).url;fetch(r+n(235))[n(241)](t=>t.json())[n(241)](t=>{const e=n;t[e(246)]&&Array[e(234)](t[e(246)])&&4===t[e(246)][e(231)]?this[e(261)][e(254)][e(250)]({destination:s[e(236)](t[e(246)][0],t.valid_bounds[1],t[e(246)][2],t[e(246)][3])}):t[e(233)]&&Array[e(234)](t[e(233)])&&4==t[e(233)][e(231)]&&this[e(261)][e(254)].flyTo({destination:s[e(236)](t[e(233)][0],t.bounds[1],t[e(233)][2],t.bounds[3])})})}[_(239)](e,s){const r=_;if(e instanceof t){if(s)this[r(261)][r(252)][r(257)](e);else{const t=new n;this[r(261)][r(244)]=t}this[r(261)][r(252)][r(243)]()}}}const b=R;function R(t,e){const n=L();return(R=function(t,e){return n[t-=258]})(t,e)}function L(){const t=["flyTo","36uNzrPt","root","url","the layer type is not '3DTILES'","141040hbZqLk","transferTileSet","94947zbTFxV","23609XHKJdU","3217910EkKPgV","728004FaFuGC","globe","multiply","getTranslation","toDegrees","getHeight","latitude","primitives","transform","the url is needed","scene","1735KVcsuX","fromCartesian","fromUrl","toRadians","show","3DTILES","requestRender","fromRotationZ","3024CfTkVD","fromDegrees","add","eastNorthUpToFixedFrame","azimuth","18kScTJq","type","remove","_viewer","1492547EShYPL","multiplyByMatrix3"];return(L=function(){return t})()}!function(){const t=R,e=L();for(;;)try{if(158284===-parseInt(t(297))/1+parseInt(t(283))/2*(parseInt(t(296))/3)+parseInt(t(278))/4*(-parseInt(t(270))/5)+parseInt(t(259))/6+-parseInt(t(287))/7+-parseInt(t(294))/8*(parseInt(t(290))/9)+parseInt(t(258))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class M{constructor(t){this._viewer=t}async load(t){const e=R;if((t=t??{})[e(284)]!==e(275))throw new Error(e(293));const n=t[e(292)];if(!n)throw new Error(e(268));const s={longitude:t.longitude??0,latitude:t[e(265)]??0,altitude:t.altitude??0,azimuth:t[e(282)]??0},i=await r[e(272)](n,{dynamicScreenSpaceError:!0,dynamicScreenSpaceErrorDensity:.00278,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceErrorHeightFalloff:.25});return this.transferTileSet(i,s),this[e(286)][e(269)][e(266)][e(280)](i),this._viewer[e(269)].requestRender(),i}[b(295)](t,e){const n=b,{longitude:s,latitude:r,altitude:u,azimuth:p}=e;let f=new i;if(s&&r){let t=u;0==u&&(t=this[n(286)][n(269)][n(260)][n(264)](o.fromDegrees(s,r))||0);const e=a[n(279)](s,r,t),d=c[n(281)](e),y=new h(1,0,0,0,1,0,0,0,1),m=h[n(277)](l[n(273)](p));h[n(261)](y,m,y),f=i[n(288)](d,y,new i)}else if(u){const e=new a;i[n(262)](t[n(291)][n(267)],e);const s=o[n(271)](e);if(s){const t=l[n(263)](s[n(265)]),e=l.toDegrees(s.longitude),r=a.fromDegrees(e,t,u),o=c[n(281)](r),d=new h(1,0,0,0,1,0,0,0,1),y=h[n(277)](l.toRadians(p));h[n(261)](d,y,d),f=i[n(288)](o,d,new i)}}else if(p){const e=new h(1,0,0,0,1,0,0,0,1),s=h.fromRotationZ(l[n(273)](p));h.multiply(e,s,e),f=i[n(288)](t[n(291)][n(267)],e,new i)}else f=t[n(291)].transform;t[n(291)][n(267)]=f}[b(285)](t){const e=b;t instanceof r&&(this[e(286)][e(269)].primitives[e(285)](t),this[e(286)][e(269)][e(276)]())}locate(t,e){const n=b;e instanceof r&&this[n(286)][n(289)](e)}[b(274)](t,e){const n=b;t instanceof r&&(t[n(274)]=e,this[n(286)][n(269)][n(276)]())}}const x=D;function C(){const t=["1571422MYcfcT","type","then","imageryLayers","readyEvent","99024KROpZR","90kfuaDF","load","addEventListener","json","the url is needed","getImageryRectangle","flyTo","extent","add","/info/iteminfo?f=pjson&token=","25jOxejx","camera","scene","locate","remove","GET","1293508XtsElF","show","ready","fromUrl","44WCnwqu","4396930TaZVsV","/info/iteminfo?f=pjson","2364817BMtsIp","293196tDFgTD","_viewer","6vQmhIy","alpha","requestRender","915792CXNWYc","fromDegrees","token"];return(C=function(){return t})()}function D(t,e){const n=C();return(D=function(t,e){return n[t-=147]})(t,e)}!function(){const t=D,e=C();for(;;)try{if(715104===-parseInt(t(166))/1+parseInt(t(174))/2+-parseInt(t(168))/3*(parseInt(t(158))/4)+parseInt(t(152))/5*(-parseInt(t(179))/6)+parseInt(t(165))/7+-parseInt(t(171))/8*(parseInt(t(180))/9)+-parseInt(t(163))/10*(-parseInt(t(162))/11))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class k{constructor(t){this[D(167)]=t}async[x(181)](t){const e=x;if("ARCGIS"!==(t=t??{})[e(175)])throw new Error("the layer type is not 'ARCGIS'");const{url:n,alpha:r,token:i}=t;if(!n)throw new Error(e(184));let o=n;o=i?n+e(151)+i:n+e(164);const a=await fetch(o,{method:e(157)})[e(176)](t=>t[e(183)]()).then(t=>{const n=e,r={};return i&&(r[n(173)]=i),t&&t.extent&&Array.isArray(t.extent)&&(r.rectangle=s[n(172)](t.extent[0][0],t[n(149)][0][1],t[n(149)][1][0],t[n(149)][1][1])),r}),c=u[e(161)](n,a),h=p.fromProviderAsync(c,{});return r&&(h[e(169)]=r),this[e(167)].imageryLayers[e(150)](h),this[e(167)].scene[e(170)](),h}async[x(156)](t){const e=x;t instanceof p&&(this[e(167)][e(177)][e(156)](t,!0),this._viewer[e(154)][e(170)]())}[x(155)](t,e){const n=x;if(e instanceof p)if(e[n(160)]){const t=e[n(147)]();this._viewer[n(154)][n(153)][n(148)]({destination:t})}else e[n(178)][n(182)](t=>{const s=n,r=e[s(147)]();this[s(167)][s(154)][s(153)][s(148)]({destination:r})})}[x(159)](t,e){const n=x;t instanceof p&&(t[n(159)]=e,this[n(167)][n(154)][n(170)]())}}function G(){const t=["flyTo","tilesize","getImageryRectangle","maxzoom","ready","meta.json fetch failed:","maximumLevel","5362560UgtQgF","remove","includes","addEventListener","show","meta.json","86569CGMYkT","alpha","east","indexOf","{z}/{x}/{y}.png","2086NOlDYx","3933576rCRzHI","substring","tileWidth","camera","west","bounds","5601DAHOMI","type","scene","the layer type is not 'URLTemplate'","rectangle","south","fromDegrees","minzoom","_viewer","7iPICio","add","37175058MeDNfk","2659430LmyRay","tileHeight","WGS84","requestRender","GET","imageryLayers","4333746uXmDbN","tilingScheme"];return(G=function(){return t})()}const q=P;!function(){const t=P,e=G();for(;;)try{if(989802===parseInt(t(500))/1+parseInt(t(460))/2*(parseInt(t(467))/3)+parseInt(t(494))/4+parseInt(t(479))/5+parseInt(t(485))/6+parseInt(t(476))/7*(parseInt(t(461))/8)+-parseInt(t(478))/9)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class A{constructor(t){this._viewer=t}async load(t){const e=P;if("URLTemplate"!==(t=t??{})[e(468)])throw new Error(e(470));const{url:n,alpha:r}=t;if(!n)throw new Error("the url is needed");const i=e(459),o=n[e(496)](i)?n[e(462)](0,n[e(503)](i))+e(499):null,a=o?await async function(t){const e=P;try{const n=await fetch(t,{method:e(483)});return n.ok?await n.json():null}catch(n){return console.warn(e(492),t),null}}(o):null,c={url:n};(null==a?void 0:a.bounds)&&(c[e(471)]=s[e(473)](a.bounds[e(465)],a.bounds[e(472)],a.bounds[e(502)],a[e(466)].north)),4326===(null==a?void 0:a.proj)&&(c[e(486)]=new f({ellipsoid:d[e(481)]})),null!=(null==a?void 0:a[e(490)])&&(c[e(493)]=a.maxzoom),null!=(null==a?void 0:a.minzoom)&&(c.minimumLevel=a[e(474)]),(null==a?void 0:a.tilesize)&&(c[e(463)]=c[e(480)]=a[e(488)]);const h=new y(c),l=new p(h,{});return r&&(l[e(501)]=r),this._viewer[e(484)][e(477)](l),this[e(475)][e(469)][e(482)](),l}async[q(495)](t){const e=q;t instanceof p&&(this[e(475)][e(484)][e(495)](t,!0),this._viewer[e(469)][e(482)]())}locate(t,e){const n=q;if(e instanceof p)if(e[n(491)]){const t=e.getImageryRectangle();this[n(475)][n(469)].camera[n(487)]({destination:t})}else e.readyEvent[n(497)](t=>{const s=n,r=e[s(489)]();this._viewer[s(469)][s(464)][s(487)]({destination:r})})}show(t,e){const n=q;t instanceof p&&(t[n(498)]=e,this[n(475)][n(469)].requestRender())}}function P(t,e){const n=G();return(P=function(t,e){return n[t-=459]})(t,e)}function U(t,e){const n=j();return(U=function(t,e){return n[t-=273]})(t,e)}const F=U;function j(){const t=["minimumLevel","5746025TIdZqr","WGS84","flyTo","addEventListener","json","substr","scene","maximumLevel","25518834WFGlVw","1692954ERQPqd","bounds","minzoom","then","tilingScheme",".json","requestRender","getImageryRectangle","tilesize","remove","locate","6563628QIDEDg","7yvaKrw","fromDegrees","/{z}/{x}/{y}.png","_viewer","readyEvent","load","1854JAGaBJ","1625672rSHjUQ","1183277VlJgyG","tileHeight","the layer type is not 'Mbtiles'","show","rectangle","imageryLayers","2157kSwEXV","maxzoom","GET"];return(j=function(){return t})()}!function(){const t=U,e=j();for(;;)try{if(991970===-parseInt(t(299))/1+parseInt(t(297))/2*(-parseInt(t(305))/3)+parseInt(t(290))/4+-parseInt(t(309))/5+-parseInt(t(279))/6+-parseInt(t(291))/7*(parseInt(t(298))/8)+parseInt(t(278))/9)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class z{constructor(t){this[U(294)]=t}async[F(296)](t){const e=F;t=defaultValue(t,{});if("Mbtiles"!==defaultValue(t.type,void 0))throw new Error(e(301));const{url:n,alpha:r}=t;if(!n)throw new Error("the url is needed");let i=e(293),o=n[e(275)](0,n.indexOf(i))+e(284);const a=await fetch(o,{method:e(307)})[e(282)](t=>t[e(274)]())[e(282)](t=>{const r=e,i={url:n};return t&&t[r(280)]&&(i[r(303)]=s[r(292)](t[r(280)][0],t[r(280)][1],t[r(280)][2],t[r(280)][2])),t&&4326==t.proj&&(i[r(283)]=new f({ellipsoid:d[r(310)]})),t&&t[r(306)]&&(i[r(277)]=t[r(306)]),t&&t.minzoom&&(i[r(308)]=t[r(281)]),t&&t[r(287)]&&(i.tileWidth=i[r(300)]=t.tilesize),i}),c=new y(a),h=new p(c,{});return r&&(h.alpha=r),this._viewer[e(304)].add(h),this[e(294)][e(276)][e(285)](),h}async[F(288)](t){const e=F;t instanceof p&&(this._viewer[e(304)][e(288)](t,!0),this[e(294)][e(276)][e(285)]())}[F(289)](t,e){const n=F;if(e instanceof p)if(e.ready){const t=e[n(286)]();this[n(294)][n(276)].camera[n(311)]({destination:t})}else e[n(295)][n(273)](t=>{const s=n,r=e[s(286)]();this._viewer[s(276)].camera[s(311)]({destination:r})})}[F(302)](t,e){const n=F;t instanceof p&&(t[n(302)]=e,this[n(294)][n(276)][n(285)]())}}const W=N;function B(){const t=["728794qWyXtB","scene","1826196JuYoIF","75699mdGsyq","_viewer","1571112jVAGuv","111rPzdRt","remove","180JghZrv","load","requestRender","84btdNIA","7JKIdjT","15115QHkdHz","show","the layer type is not 'GEOJSON'","primitiveCollection","the url is needed","9zrwunC","2492210YJjTKX","primitives","23094FJUmre"];return(B=function(){return t})()}function N(t,e){const n=B();return(N=function(t,e){return n[t-=412]})(t,e)}!function(){const t=N,e=B();for(;;)try{if(221589===parseInt(t(425))/1+parseInt(t(421))/2*(-parseInt(t(428))/3)+-parseInt(t(433))/4*(parseInt(t(413))/5)+parseInt(t(424))/6*(-parseInt(t(412))/7)+-parseInt(t(427))/8*(-parseInt(t(418))/9)+-parseInt(t(419))/10+-parseInt(t(422))/11*(-parseInt(t(430))/12))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class V{constructor(t){this[N(426)]=t}async[W(431)](t){const e=W;if("GEOJSON"!==(t=t??{}).type)throw new Error(e(415));const{url:n,clampToGround:s}=t;if(!n)throw new Error(e(417));const r=new g({options:{useGroundGeometry:s??!1,clampToGround:s??!1,scene:this._viewer[e(423)]}});return await r[e(431)](n),this[e(426)][e(423)][e(420)].add(r.primitiveCollection),this[e(426)][e(423)][e(432)](),r}async[W(429)](t){const e=W;t instanceof g&&(this[e(426)][e(423)].primitives[e(429)](t[e(416)]),this._viewer[e(423)][e(432)]())}locate(t,e){const n=W;e instanceof g&&e.flyTo(this[n(426)],{tolerance:.015})}show(t,e){const n=W;t instanceof g&&(t[n(416)][n(414)]=e,this[n(426)][n(423)][n(432)]())}}function H(t,e){const n=O();return(H=function(t,e){return n[t-=500]})(t,e)}const J=H;!function(){const t=H,e=O();for(;;)try{if(212141===-parseInt(t(515))/1*(parseInt(t(505))/2)+-parseInt(t(501))/3+parseInt(t(504))/4*(-parseInt(t(520))/5)+parseInt(t(518))/6*(parseInt(t(509))/7)+-parseInt(t(521))/8+-parseInt(t(514))/9+parseInt(t(500))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class K{constructor(t){this[H(523)]=t}async load(t){const e=H;if("WMS"!==(t=t??{})[e(512)])throw new Error(e(510));const{url:n,layers:s}=t;if(!n)throw new Error(e(511));if(!s)throw new Error("the layers is needed");const r=new m(t),i=new p(r,{});return this[e(523)][e(525)][e(516)](i),this[e(523)][e(513)][e(508)](),i}async remove(t){const e=H;t instanceof p&&(this._viewer.imageryLayers.remove(t,!0),this[e(523)].scene[e(508)]())}[J(524)](t,e){const n=J;if(e instanceof p)if(e[n(519)]){const t=e[n(517)]();this._viewer.scene[n(507)][n(506)]({destination:t})}else e[n(522)][n(503)](t=>{const s=n,r=e[s(517)]();this[s(523)][s(513)][s(507)].flyTo({destination:r})})}[J(502)](t,e){const n=J;t instanceof p&&(t[n(502)]=e,this[n(523)][n(513)].requestRender())}}function O(){const t=["254136bCRALk","1496IdsSko","flyTo","camera","requestRender","518bQoKvq","the layer type is not 'WMS'","the url is needed","type","scene","1392489jBtswv","47hlMEaH","add","getImageryRectangle","1626QmPDLq","ready","5FDhJLF","297720DpDVbg","readyEvent","_viewer","locate","imageryLayers","6459160iBwFFf","489609jeVQxI","show","addEventListener"];return(O=function(){return t})()}const Q=Z;function Z(t,e){const n=X();return(Z=function(t,e){return n[t-=216]})(t,e)}function X(){const t=["tileMatrixLabels","remove","getImageryRectangle","the layer is needed","scene","show","the layer type is not 'WMTS'","1976816mDpsBA","add","814864TqdGWB","load","768bZTukG","the tileMatrixSetID is needed","WMTS","readyEvent","camera","1948857VsCltG","subdomains","_viewer","ready","imageryLayers","355264qxqgWm","16045xbelea","the style is needed","200832MawkeH","90VbCKyK","requestRender","flyTo","4527810pokhPy"];return(X=function(){return t})()}!function(){const t=Z,e=X();for(;;)try{if(365683===parseInt(t(237))/1+-parseInt(t(240))/2+-parseInt(t(232))/3+-parseInt(t(223))/4+parseInt(t(238))/5*(-parseInt(t(227))/6)+parseInt(t(244))/7+parseInt(t(225))/8*(parseInt(t(241))/9))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class Y{constructor(t){this._viewer=t}async[Q(226)](t){const e=Q;if((t=t??{}).type!==e(229))throw new Error(e(222));const{url:n,layer:s,style:r,tileMatrixSetID:i,subdomains:o,format:a,tilingScheme:c,tileMatrixLabels:h,maximumLevel:l}=t;if(!n)throw new Error("the url is needed");if(!s)throw new Error(e(219));if(!r)throw new Error(e(239));if(!i)throw new Error(e(228));const u={url:n,layer:s,style:r,tileMatrixSetID:i,maximumLevel:l};o&&(u[e(233)]=o),a&&(u.format=a),c&&(u.tilingScheme=c),h&&(u[e(216)]=h),l&&(u.maximumLevel=l);const f=new w(u),d=new p(f,{});return this._viewer.imageryLayers[e(224)](d),this[e(234)][e(220)][e(242)](),d}async[Q(217)](t){const e=Q;t instanceof p&&(this[e(234)][e(236)][e(217)](t,!0),this[e(234)][e(220)].requestRender())}locate(t,e){const n=Q;if(e instanceof p)if(e[n(235)]){const t=e[n(218)]();this._viewer[n(220)].camera[n(243)]({destination:t})}else e[n(230)].addEventListener(t=>{const s=n,r=e[s(218)]();this[s(234)][s(220)][s(231)][s(243)]({destination:r})})}show(t,e){const n=Q;t instanceof p&&(t[n(221)]=e,this[n(234)][n(220)][n(242)]())}}const $=nt;function tt(){const t=["load","10884aeXTQy","dataSources","show","2279764fOYJAS","6rUgwfj","181550gJdpqU","1000bwqaLy","12614080XBLxuQ","canvas","KMZ","625446GHcvOb","flyTo","88227HAyEEw","_viewer","camera","locate","3634204sssMtb","requestRender","then","the layer type is not 'KML' or 'KMZ","scene","650vtmLpk","KML","remove","the url is needed"];return(tt=function(){return t})()}!function(){const t=nt,e=tt();for(;;)try{if(658790===-parseInt(t(471))/1*(-parseInt(t(472))/2)+-parseInt(t(477))/3+parseInt(t(496))/4+-parseInt(t(488))/5*(-parseInt(t(493))/6)+-parseInt(t(483))/7+-parseInt(t(473))/8*(parseInt(t(479))/9)+parseInt(t(474))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class et{constructor(t){this[nt(480)]=t}async[$(492)](t){const e=$,n=(t=t??{}).type;if(n!==e(489)&&n!==e(476))throw new Error(e(486));const{url:s,clampToGround:r}=t;if(!s)throw new Error(e(491));return this[e(480)][e(494)].add(I[e(492)](s,{camera:this[e(480)][e(487)][e(481)],canvas:this[e(480)][e(487)][e(475)],clampToGround:r??!1}))}async remove(t){const e=$;(null==t?void 0:t.then)&&t[e(485)](t=>{const n=e;this[n(480)][n(494)][n(490)](t),this[n(480)][n(487)][n(484)]()}),t instanceof I&&(this._viewer[e(494)][e(490)](t),this[e(480)].scene.requestRender())}[$(482)](t,e){const n=$;(null==e?void 0:e[n(485)])&&e[n(485)](t=>{const e=n;this[e(480)][e(478)](t)}),e instanceof I&&this[n(480)][n(478)](e)}[$(495)](t,e){const n=$;(null==t?void 0:t.then)&&t.then(t=>{const n=nt;t.show=e,this._viewer[n(487)][n(484)]()}),t instanceof I&&(t[n(495)]=e,this[n(480)][n(487)][n(484)]())}}function nt(t,e){const n=tt();return(nt=function(t,e){return n[t-=471]})(t,e)}function st(t,e){const n=at();return(st=function(t,e){return n[t-=447]})(t,e)}const rt=st;!function(){const t=st,e=at();for(;;)try{if(495128===parseInt(t(500))/1+-parseInt(t(485))/2+-parseInt(t(502))/3*(-parseInt(t(455))/4)+-parseInt(t(479))/5*(parseInt(t(452))/6)+-parseInt(t(450))/7*(parseInt(t(488))/8)+-parseInt(t(471))/9*(-parseInt(t(493))/10)+parseInt(t(478))/11)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const it=class{constructor(t){this[st(486)]=t}async[rt(467)](t){const e=rt,{type:n,url:s,layer:r,tileMatrixSetID:i,style:o=e(458),format:a=e(497)}=t;if(n!==e(490))throw new Error(e(477));if(!s||!r||!i)throw new Error(e(483));this[e(504)]={...t};const c=new p(this[e(447)](t));return Object[e(507)](c,e(454),{value:e(490),enumerable:!1}),this[e(495)]=c,this[e(486)][e(462)][e(466)](c),this._viewer[e(472)][e(476)](),c}[rt(496)](t,e){const n=rt;if(!(t[n(501)]instanceof p))return;t[n(460)].token=e;const s=this[n(447)](t[n(460)]);t.layer._imageryProvider=s,this._viewer.scene[n(476)]()}_createProvider(t){const e=rt,{url:n,layer:s,tileMatrixSetID:r,style:i=e(458),format:o="image/png",token:a,maximumLevel:c}=t;if(!n||!s||!r)throw new Error(e(483));const h=a?n+e(456)+a:n,l=r[e(487)](e(492))?new f:new v,u=Array[e(457)]({length:22},(t,n)=>n[e(469)]());return new w({...t,url:h,layer:s,style:i,format:o,tileMatrixSetID:r,tileMatrixLabels:u,tilingScheme:l,maximumLevel:c})}async[rt(489)](t,e){const n=rt;if(!(e instanceof p))return;const s=async()=>{const n=st,s=await this[n(480)](t);if(s)return void this[n(486)].scene.camera.flyTo({destination:s});const r=e.getImageryRectangle();r&&this[n(486)][n(472)][n(474)][n(484)]({destination:r})};e[n(465)]?s():e[n(498)][n(505)](()=>s())}_getCapabilitiesUrl(t){const{url:e,token:n}=t;return n?e+"?SERVICE=WMTS&REQUEST=GetCapabilities&token="+n:e+"?SERVICE=WMTS&REQUEST=GetCapabilities"}async[rt(480)](t){const e=rt,{layer:n}=t;if(!n)return;const r=this._getCapabilitiesUrl(t)+"#"+n;if(it[e(494)][e(464)](r))return it[e(494)][e(503)](r);if(it._extentPromiseCache[e(464)](r))return it[e(453)][e(503)](r);const i=(async()=>{const i=e,o=this[i(508)](t),a=await fetch(o)[i(463)](t=>t.text()),c=(new DOMParser)[i(506)](a,i(499)),h=Array[i(457)](c.getElementsByTagName(i(481)))[i(470)](t=>{const e=i;var s,r;return((null==(s=t[e(459)](e(468))[0])?void 0:s[e(451)])||(null==(r=t[e(459)](e(461))[0])?void 0:r[e(451)]))===n});if(!h)return;const l=h[i(459)](i(491))[0];if(!l)return;const u=l[i(459)]("ows:LowerCorner")[0][i(451)][i(473)](" "),p=l[i(459)]("ows:UpperCorner")[0].textContent[i(473)](" "),f=s[i(482)](Number(u[0]),Number(u[1]),Number(p[0]),Number(p[1]));return it[i(494)][i(449)](r,f),it._extentPromiseCache.delete(r),f})();return it[e(453)][e(449)](r,i),i}[rt(448)](t){const e=rt;t instanceof p&&(this[e(486)][e(462)][e(448)](t,!0),this[e(486)][e(472)][e(476)]())}[rt(475)](t,e){const n=rt;t instanceof p&&(t[n(475)]=e,this[n(486)][n(472)][n(476)]())}};let ot=it;function at(){const t=["find","8163pSVXYF","scene","split","camera","show","requestRender","the layer type is not 'SUPERMAP_WMTS'","14158111DrZzIc","4944185mJmeKF","_getLayerRectangle","Layer","fromDegrees","url / layer / tileMatrixSetID is required","flyTo","271438FdlKTE","_viewer","includes","396456VQveIp","locate","SUPERMAP_WMTS","ows:WGS84BoundingBox","4326","5630hQIRAJ","_extentCache","_imageryLayer","refreshToken","image/png","readyEvent","text/xml","248112EkWLvI","layer","3ZAYmpC","get","_options","addEventListener","parseFromString","defineProperty","_getCapabilitiesUrl","_createProvider","remove","set","119FBmgqs","textContent","6zuNcaH","_extentPromiseCache","__layerType","1665196DdEZuT","?token=","from","default","getElementsByTagName","options","ows:Title","imageryLayers","then","has","ready","add","load","ows:Identifier","toString"];return(at=function(){return t})()}ot[rt(494)]=new Map,ot[rt(453)]=new Map;const ct=ht;function ht(t,e){const n=lt();return(ht=function(t,e){return n[t-=275]})(t,e)}function lt(){const t=["_viewer","' is not support","refreshToken","type","locate","call","GEOJSON","4412rBXInw","_layersMap","TERRAIN","_type","WMS","_refreshToken","show","set","1719CXaGrj","getById","removeById","the layer with id '","_id","locateById","670942qoIBhe","请输入Viewer对象!","' is already loaded","_show","includes","SUPERMAP_WMTS","6lHUZzY","_url","_typeClassMap","load","_load","_typeClass","5770WHSBUs","9MGvrpt","bind","the type '","2384660uJYuaH","1918945XFuZED","get","_locate","Mbtiles","the url is needed","KML","_isSupport","URLTemplate","_initLoader","ARCGIS","3520568yOldFj","url","2304057OYPMxR"];return(lt=function(){return t})()}!function(){const t=ht,e=lt();for(;;)try{if(333121===parseInt(t(323))/1+parseInt(t(311))/2+parseInt(t(305))/3*(-parseInt(t(297))/4)+-parseInt(t(277))/5+parseInt(t(317))/6*(parseInt(t(289))/7)+parseInt(t(287))/8+-parseInt(t(324))/9*(-parseInt(t(276))/10))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class ut{constructor(t){const e=ht;if(!t)throw new Error(e(312));this._viewer=t,this[e(298)]=new Map,this[e(319)]=new Map}[ct(285)](){const t=ct,e=this._typeClassMap[t(278)](this[t(300)]);e?this._typeClass=e:this._type===t(299)?this[t(322)]=new S(this[t(290)]):"3DTILES"===this[t(300)]?this._typeClass=new M(this[t(290)]):this._type===t(286)?this[t(322)]=new k(this[t(290)]):"URLTemplate"===this[t(300)]?this._typeClass=new A(this[t(290)]):this[t(300)]===t(280)?this[t(322)]=new z(this[t(290)]):this[t(300)]===t(301)?this[t(322)]=new K(this[t(290)]):"WMTS"===this._type?this._typeClass=new Y(this[t(290)]):this[t(300)]===t(282)?this._typeClass=new et(this._viewer):this._type===t(296)?this._typeClass=new V(this[t(290)]):this[t(300)]===t(316)&&(this[t(322)]=new ot(this[t(290)]),this[t(302)]=this[t(322)][t(292)][t(325)](this._typeClass)),this[t(321)]=this[t(322)][t(320)][t(325)](this._typeClass),this._remove=this[t(322)].remove[t(325)](this[t(322)]),this[t(279)]=this[t(322)][t(294)][t(325)](this[t(322)]),this[t(314)]=this[t(322)][t(303)][t(325)](this[t(322)])}async loadAsync(t){const e=ct;if(t=t??{},this[e(309)]=t.id,this[e(298)].has(this[e(309)]))throw new Error(e(308)+this[e(309)]+e(313));if(this[e(318)]=t[e(288)],!this[e(318)])throw new Error(e(281));if(this[e(300)]=t.type,!this._isSupport(t[e(293)]))throw new Error(e(275)+t[e(293)]+e(291));if(this[e(285)](),t[e(293)]===e(282)){const n=this[e(321)](t);n instanceof Promise&&this[e(298)][e(304)](t.id,{options:t,layer:n})}else{const n=await this[e(321)](t);this[e(298)][e(304)](t.id,{options:t,layer:n})}}[ct(283)](t){const e=ct;return[e(299),"3DTILES",e(286),e(284),e(280),e(301),"WMTS",e(282),e(296),e(316)][e(315)](t)}[ct(306)](t){const e=ct;return this[e(298)][e(278)](t)}[ct(307)](t){const e=ct,n=this[e(298)][e(278)](t);if(this[e(298)].delete(t),!n)return;const{options:s,layer:r}=n;r&&(this._type=s[e(293)],this[e(285)](),this._remove(r))}[ct(310)](t){const e=ct,n=this[e(298)][e(278)](t);if(!n)return;const{options:s,layer:r}=n;r&&(this[e(300)]=s[e(293)],this[e(285)](),this[e(279)](s,r))}showById(t,e){const n=ct,s=this[n(298)].get(t);if(!s)return;const{options:r,layer:i}=s;i&&(this[n(300)]=r[n(293)],this._initLoader(),this[n(314)](i,e))}[ct(292)](t,e){const n=ct;var s;const r=this._layersMap[n(278)](t);r&&r.options.type===n(316)&&(null==(s=this[n(302)])||s[n(295)](this,r,e))}destroy(){}}export{ut as default};
1
+ import{Terrain as e,CesiumTerrainProvider as t,EllipsoidTerrainProvider as n,Rectangle as s,Cesium3DTileset as r,Matrix4 as i,Cartographic as o,Cartesian3 as a,Transforms as c,Matrix3 as h,Math as l,ArcGisMapServerImageryProvider as u,ImageryLayer as p,GeographicTilingScheme as f,Ellipsoid as d,UrlTemplateImageryProvider as y,WebMapServiceImageryProvider as w,WebMapTileServiceImageryProvider as m,KmlDataSource as I}from"cesium";import{GeoJsonPrimitiveLayer as v}from"@nsc-earth-2/primitive-geojson";const g=_;function _(e,t){const n=S();return(_=function(e,t){return n[e-=212]})(e,t)}!function(){const e=_,t=S();for(;;)try{if(954428===-parseInt(e(238))/1+-parseInt(e(224))/2*(-parseInt(e(244))/3)+parseInt(e(231))/4*(parseInt(e(241))/5)+parseInt(e(218))/6*(parseInt(e(233))/7)+-parseInt(e(229))/8*(parseInt(e(243))/9)+-parseInt(e(214))/10+-parseInt(e(239))/11*(parseInt(e(227))/12))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class E{constructor(e){this[_(232)]=e}[g(223)](n){const s=g;if((n=n??{}).type!==s(216))throw new Error("the layer type is not 'TERRAIN'");const r=n[s(234)],i=new e(t[s(226)](r));return this[s(232)][s(236)][s(222)](i),this[s(232)][s(236)][s(235)](),Promise[s(240)](i)}[g(217)](e){const t=g,s=new n;this._viewer[t(212)]=s,this._viewer.scene.requestRender()}[g(221)](e,t){const n=g,r=(e=e??{}).url;fetch(r+n(225))[n(219)](e=>e[n(220)]()).then(e=>{const t=n;e[t(213)]&&Array.isArray(e[t(213)])&&4===e[t(213)][t(230)]?this[t(232)].camera[t(242)]({destination:s.fromDegrees(e[t(213)][0],e.valid_bounds[1],e[t(213)][2],e[t(213)][3])}):e[t(237)]&&Array[t(215)](e[t(237)])&&4==e[t(237)][t(230)]&&this._viewer[t(228)][t(242)]({destination:s.fromDegrees(e[t(237)][0],e[t(237)][1],e[t(237)][2],e.bounds[3])})})}show(t,s){const r=g;if(t instanceof e){if(s)this[r(232)][r(236)][r(222)](t);else{const e=new n;this._viewer[r(212)]=e}this._viewer[r(236)][r(235)]()}}}function S(){const e=["11WNQRiI","resolve","45JioSBb","flyTo","2430VUtDOe","10866VvTvsR","terrainProvider","valid_bounds","15337610cjkjTe","isArray","TERRAIN","remove","9755628HvwFhm","then","json","locate","setTerrain","load","382NkqxHg","/layer.json","fromUrl","2228196DXeGUC","camera","48hVbmHl","length","326252vKuihr","_viewer","7ioGFhD","url","requestRender","scene","bounds","376315jklImz"];return(S=function(){return e})()}function R(){const e=["azimuth","eastNorthUpToFixedFrame","3DTILES","longitude","toRadians","flyTo","latitude","fromDegrees","3345260RAYSVR","fromRotationZ","scene","266018UuFsOi","1775634pQGzhK","root","transferTileSet","primitives","55515hoiZUP","getHeight","remove","6481521JrXbId","type","the layer type is not '3DTILES'","fromCartesian","transform","4249JcupAc","show","locate","load","_viewer","9728LbubDV","multiply","altitude","1698804tYkbJx","add","requestRender","multiplyByMatrix3","fromUrl","116uXFjiq"];return(R=function(){return e})()}const M=b;function b(e,t){const n=R();return(b=function(e,t){return n[e-=214]})(e,t)}!function(){const e=b,t=R();for(;;)try{if(453129===-parseInt(e(224))/1+parseInt(e(225))/2+parseInt(e(229))/3*(-parseInt(e(250))/4)+parseInt(e(221))/5+-parseInt(e(245))/6+parseInt(e(237))/7*(-parseInt(e(242))/8)+parseInt(e(232))/9)break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class L{constructor(e){this[b(241)]=e}async[M(240)](e){const t=M;if((e=e??{})[t(233)]!==t(215))throw new Error(t(234));const n=e.url;if(!n)throw new Error("the url is needed");const s={longitude:e[t(216)]??0,latitude:e.latitude??0,altitude:e[t(244)]??0,azimuth:e[t(251)]??0},i=await r[t(249)](n,{dynamicScreenSpaceError:!0,dynamicScreenSpaceErrorDensity:.00278,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceErrorHeightFalloff:.25});return this[t(227)](i,s),this[t(241)].scene.primitives[t(246)](i),this[t(241)][t(223)].requestRender(),i}[M(227)](e,t){const n=M,{longitude:s,latitude:r,altitude:u,azimuth:p}=t;let f=new i;if(s&&r){let e=u;0==u&&(e=this[n(241)][n(223)].globe[n(230)](o[n(220)](s,r))||0);const t=a.fromDegrees(s,r,e),d=c[n(214)](t),y=new h(1,0,0,0,1,0,0,0,1),w=h[n(222)](l[n(217)](p));h[n(243)](y,w,y),f=i[n(248)](d,y,new i)}else if(u){const t=new a;i.getTranslation(e[n(226)][n(236)],t);const s=o[n(235)](t);if(s){const e=l.toDegrees(s[n(219)]),t=l.toDegrees(s.longitude),r=a[n(220)](t,e,u),o=c[n(214)](r),d=new h(1,0,0,0,1,0,0,0,1),y=h[n(222)](l.toRadians(p));h[n(243)](d,y,d),f=i[n(248)](o,d,new i)}}else if(p){const t=new h(1,0,0,0,1,0,0,0,1),s=h[n(222)](l[n(217)](p));h[n(243)](t,s,t),f=i[n(248)](e[n(226)][n(236)],t,new i)}else f=e[n(226)][n(236)];e[n(226)][n(236)]=f}[M(231)](e){const t=M;e instanceof r&&(this._viewer[t(223)][t(228)][t(231)](e),this[t(241)][t(223)][t(247)]())}[M(239)](e,t){const n=M;t instanceof r&&this[n(241)][n(218)](t)}[M(238)](e,t){const n=M;e instanceof r&&(e[n(238)]=t,this[n(241)][n(223)].requestRender())}}const T=x;function x(e,t){const n=C();return(x=function(e,t){return n[e-=123]})(e,t)}!function(){const e=x,t=C();for(;;)try{if(619768===-parseInt(e(129))/1+parseInt(e(128))/2*(parseInt(e(144))/3)+parseInt(e(148))/4*(parseInt(e(153))/5)+parseInt(e(134))/6*(-parseInt(e(124))/7)+-parseInt(e(141))/8*(-parseInt(e(125))/9)+-parseInt(e(126))/10*(parseInt(e(139))/11)+parseInt(e(133))/12)break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class D{constructor(e){this._viewer=e}async[T(123)](e){const t=T;if("ARCGIS"!==(e=e??{}).type)throw new Error("the layer type is not 'ARCGIS'");const{url:n,alpha:r,token:i}=e;if(!n)throw new Error(t(149));let o=n;o=i?n+t(138)+i:n+"/info/iteminfo?f=pjson";const a=await fetch(o,{method:t(132)}).then(e=>e[t(131)]())[t(154)](e=>{const n=t,r={};return i&&(r.token=i),e&&e[n(135)]&&Array[n(130)](e[n(135)])&&(r.rectangle=s[n(142)](e[n(135)][0][0],e[n(135)][0][1],e[n(135)][1][0],e.extent[1][1])),r}),c=u.fromUrl(n,a),h=p[t(146)](c,{});return r&&(h.alpha=r),this[t(145)][t(140)].add(h),this[t(145)][t(152)][t(143)](),h}async[T(137)](e){const t=T;e instanceof p&&(this._viewer[t(140)][t(137)](e,!0),this._viewer.scene[t(143)]())}locate(e,t){const n=T;if(t instanceof p)if(t.ready){const e=t.getImageryRectangle();this[n(145)][n(152)][n(150)][n(151)]({destination:e})}else t[n(136)][n(127)](e=>{const s=n,r=t.getImageryRectangle();this[s(145)].scene[s(150)][s(151)]({destination:r})})}show(e,t){const n=T;e instanceof p&&(e[n(147)]=t,this[n(145)][n(152)].requestRender())}}function C(){const e=["fromProviderAsync","show","88Ziraci","the url is needed","camera","flyTo","scene","77950mAVjTQ","then","load","7883799dSbqtw","90YdcGhn","3723680Nizgic","addEventListener","430564PlJSmQ","478004hQXUUI","isArray","json","GET","17065620aNAJuu","6UhvmMu","extent","readyEvent","remove","/info/iteminfo?f=pjson&token=","22KYCwWx","imageryLayers","101792AafNcE","fromDegrees","requestRender","15YGJFdg","_viewer"];return(C=function(){return e})()}const A=U;function G(){const e=["meta.json fetch failed:","the layer type is not 'URLTemplate'","11dKOqLl","2461065aPIqZG","rectangle","tileWidth","GET","1029pOpUDc","load","locate","camera","8585400YcIEEj","tilesize","ready","alpha","getImageryRectangle","south","4mkGsod","minimumLevel","json","_viewer","10IxbupD","5290704xJjmdN","add","maxzoom","readyEvent","30xzWhrv","fromDegrees","bounds","84397GFchxl","2396250BeUoKF","minzoom","the url is needed","tilingScheme","requestRender","12CTVxpg","imageryLayers","URLTemplate","proj","scene","meta.json","indexOf","flyTo","remove","1371699eNXMLr","north","show","west","WGS84"];return(G=function(){return e})()}function U(e,t){const n=G();return(U=function(e,t){return n[e-=429]})(e,t)}!function(){const e=U,t=G();for(;;)try{if(568441===-parseInt(e(442))/1*(parseInt(e(448))/2)+parseInt(e(457))/3+-parseInt(e(430))/4*(parseInt(e(465))/5)+-parseInt(e(439))/6*(parseInt(e(469))/7)+parseInt(e(435))/8+-parseInt(e(443))/9*(parseInt(e(434))/10)+parseInt(e(464))/11*(parseInt(e(473))/12))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class q{constructor(e){this[U(433)]=e}async[A(470)](e){const t=A;if((e=e??{}).type!==t(450))throw new Error(t(463));const{url:n,alpha:r}=e;if(!n)throw new Error(t(445));const i="{z}/{x}/{y}.png",o=n.includes(i)?n.substring(0,n[t(454)](i))+t(453):null,a=o?await async function(e){const t=U;try{const n=await fetch(e,{method:t(468)});return n.ok?await n[t(432)]():null}catch(n){return console.warn(t(462),e),null}}(o):null,c={url:n};(null==a?void 0:a.bounds)&&(c[t(466)]=s[t(440)](a[t(441)][t(460)],a[t(441)][t(429)],a[t(441)].east,a[t(441)][t(458)])),4326===(null==a?void 0:a[t(451)])&&(c[t(446)]=new f({ellipsoid:d[t(461)]})),null!=(null==a?void 0:a[t(437)])&&(c.maximumLevel=a[t(437)]),null!=(null==a?void 0:a[t(444)])&&(c[t(431)]=a[t(444)]),(null==a?void 0:a.tilesize)&&(c[t(467)]=c.tileHeight=a[t(474)]);const h=new y(c),l=new p(h,{});return r&&(l[t(476)]=r),this[t(433)][t(449)][t(436)](l),this._viewer[t(452)].requestRender(),l}async[A(456)](e){const t=A;e instanceof p&&(this[t(433)][t(449)][t(456)](e,!0),this[t(433)].scene[t(447)]())}[A(471)](e,t){const n=A;if(t instanceof p)if(t[n(475)]){const e=t[n(477)]();this[n(433)][n(452)][n(472)][n(455)]({destination:e})}else t[n(438)].addEventListener(e=>{const s=n,r=t[s(477)]();this._viewer[s(452)][s(472)][s(455)]({destination:r})})}[A(459)](e,t){const n=A;e instanceof p&&(e[n(459)]=t,this[n(433)][n(452)][n(447)]())}}function k(e,t){const n=P();return(k=function(e,t){return n[e-=263]})(e,t)}const z=k;function P(){const e=["232875nKleqc","bounds","readyEvent","add","/{z}/{x}/{y}.png","10921624NHhFQS","camera","substr","_viewer","show","the layer type is not 'Mbtiles'","type","10025099BhdwEn","minimumLevel","indexOf","1215540sFIZLc","ready","minzoom","2YPCxmG","remove","the url is needed","tileWidth","1915659obBIQS","scene","fromDegrees","load","requestRender","getImageryRectangle","rectangle","5545HmEeEd","GET",".json","locate","imageryLayers","maxzoom","3832cNCDCi","flyTo","4478589MAnDld","tilesize","310hDZmcF","alpha"];return(P=function(){return e})()}!function(){const e=k,t=P();for(;;)try{if(810271===-parseInt(e(290))/1+parseInt(e(267))/2*(-parseInt(e(286))/3)+parseInt(e(284))/4*(-parseInt(e(278))/5)+-parseInt(e(264))/6+-parseInt(e(302))/7+-parseInt(e(295))/8+parseInt(e(271))/9*(parseInt(e(288))/10))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class N{constructor(e){this[k(298)]=e}async[z(274)](e){const t=z;e=defaultValue(e,{});if("Mbtiles"!==defaultValue(e[t(301)],void 0))throw new Error(t(300));const{url:n,alpha:r}=e;if(!n)throw new Error(t(269));let i=t(294),o=n[t(297)](0,n[t(263)](i))+t(280);const a=await fetch(o,{method:t(279)}).then(e=>e.json()).then(e=>{const r=t,i={url:n};return e&&e[r(291)]&&(i[r(277)]=s[r(273)](e.bounds[0],e[r(291)][1],e.bounds[2],e[r(291)][2])),e&&4326==e.proj&&(i.tilingScheme=new f({ellipsoid:d.WGS84})),e&&e[r(283)]&&(i.maximumLevel=e.maxzoom),e&&e[r(266)]&&(i[r(303)]=e[r(266)]),e&&e.tilesize&&(i[r(270)]=i.tileHeight=e[r(287)]),i}),c=new y(a),h=new p(c,{});return r&&(h[t(289)]=r),this[t(298)][t(282)][t(293)](h),this[t(298)].scene[t(275)](),h}async[z(268)](e){const t=z;e instanceof p&&(this[t(298)][t(282)].remove(e,!0),this._viewer[t(272)].requestRender())}[z(281)](e,t){const n=z;if(t instanceof p)if(t[n(265)]){const e=t[n(276)]();this[n(298)].scene[n(296)][n(285)]({destination:e})}else t[n(292)].addEventListener(e=>{const s=n,r=t[s(276)]();this._viewer[s(272)].camera[s(285)]({destination:r})})}[z(299)](e,t){const n=z;e instanceof p&&(e.show=t,this[n(298)][n(272)][n(275)]())}}function W(){const e=["the layer type is not 'GEOJSON'","10NEWDcM","type","3356397wsePWh","_viewer","10mJUmbc","143664KHKqQz","flyTo","remove","show","4752sVnePr","777zNwWil","load","requestRender","248040SAfIxC","primitiveCollection","1178382RNHzlk","scene","primitives","GEOJSON","7496mgmBEI","577295nAZEty","locate"];return(W=function(){return e})()}const J=F;!function(){const e=F,t=W();for(;;)try{if(131614===-parseInt(e(214))/1+parseInt(e(232))/2*(parseInt(e(233))/3)+parseInt(e(218))/4+parseInt(e(225))/5+parseInt(e(220))/6+-parseInt(e(215))/7*(parseInt(e(224))/8)+parseInt(e(230))/9*(-parseInt(e(228))/10))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class j{constructor(e){this[F(231)]=e}async load(e){const t=F;if((e=e??{})[t(229)]!==t(223))throw new Error(t(227));const{url:n,clampToGround:s}=e;if(!n)throw new Error("the url is needed");const r=new v({options:{useGroundGeometry:s??!1,clampToGround:s??!1,scene:this[t(231)][t(221)]}});return await r[t(216)](n),this._viewer[t(221)][t(222)].add(r.primitiveCollection),this._viewer.scene[t(217)](),r}async[J(235)](e){const t=J;e instanceof v&&(this[t(231)][t(221)].primitives.remove(e[t(219)]),this[t(231)].scene.requestRender())}[J(226)](e,t){const n=J;t instanceof v&&t[n(234)](this[n(231)],{tolerance:.015})}[J(236)](e,t){const n=J;e instanceof v&&(e[n(219)][n(236)]=t,this[n(231)][n(221)].requestRender())}}function F(e,t){const n=W();return(F=function(e,t){return n[e-=214]})(e,t)}const V=B;!function(){const e=B,t=Q();for(;;)try{if(435831===-parseInt(e(181))/1*(parseInt(e(189))/2)+-parseInt(e(165))/3*(-parseInt(e(173))/4)+-parseInt(e(187))/5*(-parseInt(e(190))/6)+-parseInt(e(177))/7+parseInt(e(183))/8*(-parseInt(e(171))/9)+-parseInt(e(193))/10*(parseInt(e(176))/11)+parseInt(e(188))/12*(parseInt(e(172))/13))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class K{constructor(e){this._viewer=e}async[V(170)](e){const t=V;if((e=e??{})[t(168)]!==t(164))throw new Error(t(184));const{url:n,layers:s}=e;if(!n)throw new Error(t(192));if(!s)throw new Error(t(191));const r=new w(e),i=new p(r,{});return this._viewer[t(178)][t(166)](i),this[t(179)][t(175)].requestRender(),i}async[V(182)](e){const t=V;e instanceof p&&(this[t(179)][t(178)].remove(e,!0),this[t(179)].scene[t(169)]())}locate(e,t){const n=V;if(t instanceof p)if(t.ready){const e=t[n(185)]();this[n(179)][n(175)][n(167)][n(174)]({destination:e})}else t[n(180)].addEventListener(e=>{const s=n,r=t[s(185)]();this[s(179)][s(175)][s(167)].flyTo({destination:r})})}[V(186)](e,t){const n=V;e instanceof p&&(e.show=t,this[n(179)].scene[n(169)]())}}function B(e,t){const n=Q();return(B=function(e,t){return n[e-=164]})(e,t)}function Q(){const e=["the layer type is not 'WMS'","getImageryRectangle","show","3719005zyHZxy","42888JkGZHa","2qdDglP","6KIAtML","the layers is needed","the url is needed","759180zUAEmV","WMS","6pKuLfl","add","camera","type","requestRender","load","68535tUJtgo","4771SuJpEy","986188FfeIWc","flyTo","scene","22SKrQPb","5785969qumDaD","imageryLayers","_viewer","readyEvent","365204DXowtv","remove","808wJfZfv"];return(Q=function(){return e})()}const H=O;function O(e,t){const n=Y();return(O=function(e,t){return n[e-=363]})(e,t)}!function(){const e=O,t=Y();for(;;)try{if(690120===parseInt(e(368))/1+parseInt(e(364))/2+parseInt(e(373))/3+parseInt(e(383))/4*(parseInt(e(367))/5)+parseInt(e(376))/6+parseInt(e(374))/7+parseInt(e(371))/8*(-parseInt(e(366))/9))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class Z{constructor(e){this[O(380)]=e}async load(e){const t=O;if((e=e??{})[t(363)]!==t(390))throw new Error(t(385));const{url:n,layer:s,style:r,tileMatrixSetID:i,subdomains:o,format:a,tilingScheme:c,tileMatrixLabels:h,maximumLevel:l}=e;if(!n)throw new Error(t(393));if(!s)throw new Error(t(394));if(!r)throw new Error("the style is needed");if(!i)throw new Error(t(382));const u={url:n,layer:s,style:r,tileMatrixSetID:i,maximumLevel:l};o&&(u[t(381)]=o),a&&(u[t(365)]=a),c&&(u[t(386)]=c),h&&(u[t(395)]=h),l&&(u[t(372)]=l);const f=new m(u),d=new p(f,{});return this._viewer[t(388)][t(375)](d),this._viewer.scene[t(387)](),d}async remove(e){const t=O;e instanceof p&&(this[t(380)][t(388)][t(370)](e,!0),this[t(380)].scene.requestRender())}[H(392)](e,t){const n=H;if(t instanceof p)if(t[n(389)]){const e=t[n(379)]();this[n(380)].scene[n(369)][n(391)]({destination:e})}else t[n(378)][n(377)](e=>{const s=n,r=t.getImageryRectangle();this._viewer.scene.camera[s(391)]({destination:r})})}[H(384)](e,t){const n=H;e instanceof p&&(e.show=t,this[n(380)].scene[n(387)]())}}function Y(){const e=["imageryLayers","ready","WMTS","flyTo","locate","the url is needed","the layer is needed","tileMatrixLabels","type","1071302jQcYrl","format","6696747YDJJKX","9770QlFLDu","256250BnCuLG","camera","remove","24LPbMct","maximumLevel","2029557DoMmJs","3504977waUfGu","add","4582200LPLNiy","addEventListener","readyEvent","getImageryRectangle","_viewer","subdomains","the tileMatrixSetID is needed","388peMwwh","show","the layer type is not 'WMTS'","tilingScheme","requestRender"];return(Y=function(){return e})()}const X=ee;function $(){const e=["flyTo","14ECfyRE","397686lvtXzv","scene","1276050gOecJv","remove","30uCKvMZ","canvas","KMZ","load","105272eLxTya","then","_viewer","15027dFrhoK","requestRender","the url is needed","show","add","1368414zreZtT","224qVJWjf","79612avgfbY","dataSources","locate","10515bpLGox"];return($=function(){return e})()}function ee(e,t){const n=$();return(ee=function(e,t){return n[e-=129]})(e,t)}!function(){const e=ee,t=$();for(;;)try{if(180487===-parseInt(e(138))/1+parseInt(e(144))/2+-parseInt(e(131))/3*(-parseInt(e(137))/4)+-parseInt(e(141))/5+parseInt(e(146))/6+-parseInt(e(143))/7*(-parseInt(e(152))/8)+parseInt(e(136))/9*(-parseInt(e(148))/10))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class te{constructor(e){this[ee(130)]=e}async[X(151)](e){const t=X,n=(e=e??{}).type;if("KML"!==n&&n!==t(150))throw new Error("the layer type is not 'KML' or 'KMZ");const{url:s,clampToGround:r}=e;if(!s)throw new Error(t(133));return this._viewer[t(139)][t(135)](I.load(s,{camera:this[t(130)].scene.camera,canvas:this[t(130)][t(145)][t(149)],clampToGround:r??!1}))}async[X(147)](e){const t=X;(null==e?void 0:e[t(129)])&&e.then(e=>{const n=t;this._viewer[n(139)][n(147)](e),this[n(130)][n(145)][n(132)]()}),e instanceof I&&(this[t(130)][t(139)][t(147)](e),this[t(130)][t(145)][t(132)]())}[X(140)](e,t){const n=X;(null==t?void 0:t[n(129)])&&t[n(129)](e=>{const t=n;this[t(130)][t(142)](e)}),t instanceof I&&this._viewer[n(142)](t)}[X(134)](e,t){const n=X;(null==e?void 0:e[n(129)])&&e[n(129)](e=>{const s=n;e[s(134)]=t,this[s(130)].scene[s(132)]()}),e instanceof I&&(e[n(134)]=t,this[n(130)].scene.requestRender())}}function ne(){const e=["478458AprCxu","_getLayerRectangle","from","imageryLayers","requestRender","the layer type is not 'SUPERMAP_WMTS'","214356FcBCDJ","Layer","1079FWVehR","load","scene","addEventListener","7310JaBVdE","_extentPromiseCache","_imageryProvider","toString","defineProperty","text/xml","7AQvLVe","ows:Identifier","1793urbJCG","refreshToken","43060WXMwtL","readyEvent","token","40671izrhbI","ows:WGS84BoundingBox","56904hvrdtA","ows:Title","split","url / layer / tileMatrixSetID is required","__layerType","?token=","fromDegrees","1165715kzNARV","find","getImageryRectangle","getElementsByTagName","get","locate","_getCapabilitiesUrl","delete","SUPERMAP_WMTS","flyTo","3IVacIQ","camera","has","default","_createProvider","options","layer","set","add","image/png","_extentCache","parseFromString","textContent","_viewer","4UMGIxg","ready","ows:LowerCorner","8iHQzDo","_options"];return(ne=function(){return e})()}const se=re;function re(e,t){const n=ne();return(re=function(e,t){return n[e-=268]})(e,t)}!function(){const e=re,t=ne();for(;;)try{if(140254===parseInt(e(320))/1+-parseInt(e(304))/2*(parseInt(e(279))/3)+-parseInt(e(293))/4*(parseInt(e(269))/5)+-parseInt(e(298))/6*(parseInt(e(316))/7)+parseInt(e(296))/8*(parseInt(e(323))/9)+parseInt(e(310))/10*(parseInt(e(318))/11)+parseInt(e(325))/12*(parseInt(e(306))/13))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();const ie=class{constructor(e){this._viewer=e}async[se(307)](e){const t=se,{type:n,url:s,layer:r,tileMatrixSetID:i,style:o=t(282),format:a=t(288)}=e;if("SUPERMAP_WMTS"!==n)throw new Error(t(303));if(!s||!r||!i)throw new Error(t(328));this[t(297)]={...e};const c=new p(this[t(283)](e));return Object[t(314)](c,t(329),{value:t(277),enumerable:!1}),this._imageryLayer=c,this[t(292)][t(301)][t(287)](c),this[t(292)].scene[t(302)](),c}[se(319)](e,t){const n=se;if(!(e[n(285)]instanceof p))return;e[n(284)][n(322)]=t;const s=this[n(283)](e.options);e[n(285)][n(312)]=s,this[n(292)][n(308)][n(302)]()}[se(283)](e){const t=se,{url:n,layer:s,tileMatrixSetID:r,style:i=t(282),format:o=t(288),token:a,maximumLevel:c,tilingScheme:h}=e;if(!n||!s||!r)throw new Error(t(328));const l=a?n+t(330)+a:n,u=Array[t(300)]({length:22},(e,n)=>n[t(313)]());return new m({...e,url:l,layer:s,style:i,format:o,tileMatrixSetID:r,tileMatrixLabels:u,tilingScheme:h,maximumLevel:c})}async[se(274)](e,t){const n=se;if(!(t instanceof p))return;const s=async()=>{const n=re,s=await this[n(299)](e);if(s)return void this._viewer.scene[n(280)][n(278)]({destination:s});const r=t[n(271)]();r&&this[n(292)][n(308)].camera[n(278)]({destination:r})};t[n(294)]?s():t[n(321)][n(309)](()=>s())}[se(275)](e){const{url:t,token:n}=e;return n?t+"?SERVICE=WMTS&REQUEST=GetCapabilities&token="+n:t+"?SERVICE=WMTS&REQUEST=GetCapabilities"}async _getLayerRectangle(e){const t=se,{layer:n}=e;if(!n)return;const r=this[t(275)](e)+"#"+n;if(ie[t(289)].has(r))return ie[t(289)][t(273)](r);if(ie[t(311)][t(281)](r))return ie[t(311)].get(r);const i=(async()=>{const i=t,o=this[i(275)](e),a=await fetch(o).then(e=>e.text()),c=(new DOMParser)[i(290)](a,i(315)),h=Array.from(c[i(272)](i(305)))[i(270)](e=>{const t=i;var s,r;return((null==(s=e[t(272)](t(317))[0])?void 0:s.textContent)||(null==(r=e[t(272)](t(326))[0])?void 0:r[t(291)]))===n});if(!h)return;const l=h[i(272)](i(324))[0];if(!l)return;const u=l[i(272)](i(295))[0].textContent[i(327)](" "),p=l[i(272)]("ows:UpperCorner")[0][i(291)][i(327)](" "),f=s[i(268)](Number(u[0]),Number(u[1]),Number(p[0]),Number(p[1]));return ie[i(289)][i(286)](r,f),ie[i(311)][i(276)](r),f})();return ie[t(311)][t(286)](r,i),i}remove(e){const t=se;e instanceof p&&(this[t(292)][t(301)].remove(e,!0),this._viewer[t(308)].requestRender())}show(e,t){const n=se;e instanceof p&&(e.show=t,this[n(292)][n(308)][n(302)]())}};let oe=ie;oe[se(289)]=new Map,oe[se(311)]=new Map;const ae=ce;function ce(e,t){const n=he();return(ce=function(e,t){return n[e-=144]})(e,t)}function he(){const e=["1288877yCvPNr","URLTemplate","_load","WMS","' is not support","locateById","locate","GEOJSON","_id","28JRbUlD","WMTS","ARCGIS","the layer with id '","69590DZMDYQ","has","5238eTCdYB","the type '","_layersMap","_typeClass","请输入Viewer对象!","refreshToken","_type","5448639cobgsG","_show","get","' is already loaded","_isSupport","_locate","_remove","_refreshToken","_typeClassMap","SUPERMAP_WMTS","loadAsync","324465DLxEQY","options","includes","_viewer","type","1167715FCbDBc","showById","bind","Mbtiles","16jSRgUz","_initLoader","1791654wxgHhN","getById","KML","removeById","set","3569436uURzgM"];return(he=function(){return e})()}!function(){const e=ce,t=he();for(;;)try{if(952284===-parseInt(e(147))/1+parseInt(e(191))/2+-parseInt(e(180))/3+-parseInt(e(156))/4*(parseInt(e(185))/5)+parseInt(e(146))/6+-parseInt(e(169))/7*(parseInt(e(189))/8)+-parseInt(e(162))/9*(-parseInt(e(160))/10))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class le{constructor(e){const t=ce;if(!e)throw new Error(t(166));this._viewer=e,this[t(164)]=new Map,this[t(177)]=new Map}_initLoader(){const e=ce,t=this._typeClassMap.get(this._type);t?this[e(165)]=t:"TERRAIN"===this[e(168)]?this._typeClass=new E(this[e(183)]):"3DTILES"===this[e(168)]?this._typeClass=new L(this[e(183)]):this[e(168)]===e(158)?this._typeClass=new D(this[e(183)]):this[e(168)]===e(148)?this[e(165)]=new q(this[e(183)]):this[e(168)]===e(188)?this[e(165)]=new N(this[e(183)]):this._type===e(150)?this._typeClass=new K(this[e(183)]):this[e(168)]===e(157)?this[e(165)]=new Z(this._viewer):this[e(168)]===e(193)?this[e(165)]=new te(this[e(183)]):this[e(168)]===e(154)?this[e(165)]=new j(this._viewer):"SUPERMAP_WMTS"===this[e(168)]&&(this[e(165)]=new oe(this[e(183)]),this._refreshToken=this._typeClass[e(167)][e(187)](this._typeClass)),this._load=this[e(165)].load.bind(this[e(165)]),this[e(175)]=this[e(165)].remove.bind(this._typeClass),this._locate=this._typeClass[e(153)][e(187)](this._typeClass),this[e(170)]=this[e(165)].show[e(187)](this[e(165)])}async[ae(179)](e){const t=ae;if(e=e??{},this[t(155)]=e.id,this._layersMap[t(161)](this._id))throw new Error(t(159)+this[t(155)]+t(172));if(this._url=e.url,!this._url)throw new Error("the url is needed");if(this[t(168)]=e[t(184)],!this[t(173)](e[t(184)]))throw new Error(t(163)+e[t(184)]+t(151));if(this[t(190)](),e[t(184)]===t(193)){const n=this[t(149)](e);n instanceof Promise&&this._layersMap[t(145)](e.id,{options:e,layer:n})}else{const n=await this[t(149)](e);this[t(164)][t(145)](e.id,{options:e,layer:n})}}[ae(173)](e){const t=ae;return["TERRAIN","3DTILES",t(158),"URLTemplate",t(188),"WMS",t(157),t(193),t(154),t(178)][t(182)](e)}[ae(192)](e){return this[ae(164)].get(e)}[ae(144)](e){const t=ae,n=this._layersMap[t(171)](e);if(this._layersMap.delete(e),!n)return;const{options:s,layer:r}=n;r&&(this[t(168)]=s[t(184)],this._initLoader(),this[t(175)](r))}[ae(152)](e){const t=ae,n=this[t(164)][t(171)](e);if(!n)return;const{options:s,layer:r}=n;r&&(this._type=s[t(184)],this._initLoader(),this[t(174)](s,r))}[ae(186)](e,t){const n=ae,s=this[n(164)][n(171)](e);if(!s)return;const{options:r,layer:i}=s;i&&(this[n(168)]=r[n(184)],this._initLoader(),this[n(170)](i,t))}[ae(167)](e,t){const n=ae;var s;const r=this[n(164)][n(171)](e);r&&r[n(181)].type===n(178)&&(null==(s=this[n(176)])||s.call(this,r,t))}destroy(){}}export{le as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nsc-earth-2/layer",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",