@nsc-earth-2/layer 1.1.2 → 1.1.3

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/dist/index.d.ts CHANGED
@@ -80,6 +80,10 @@ interface LayerOption {
80
80
  * @desc WMTS服务选填项,默认'image/jpeg'
81
81
  */
82
82
  format?: string;
83
+ /**
84
+ * @desc WMTS服务选填项,请求的最大层级,不设置时为不限制
85
+ */
86
+ maximumLevel?: number;
83
87
  /**
84
88
  * @desc URLTEMPLATE WMS WMTS服务选填项,
85
89
  * 其中URLTEMPLATE默认WebMercatorTilingScheme,根据json数据设置,不需要用户设置
package/dist/index.js CHANGED
@@ -1 +1 @@
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 f,GeographicTilingScheme as p,Ellipsoid as d,UrlTemplateImageryProvider as y,defaultValue as w,WebMapServiceImageryProvider as m,WebMapTileServiceImageryProvider as I,KmlDataSource as v,WebMercatorTilingScheme as g}from"cesium";import{GeoJsonPrimitiveLayer as _}from"@nsc-earth-2/primitive-geojson";const E=M;!function(){const e=M,t=T();for(;;)try{if(824363===parseInt(e(343))/1*(parseInt(e(356))/2)+-parseInt(e(337))/3*(parseInt(e(360))/4)+-parseInt(e(355))/5*(-parseInt(e(335))/6)+parseInt(e(340))/7*(-parseInt(e(368))/8)+-parseInt(e(342))/9*(parseInt(e(358))/10)+parseInt(e(336))/11*(parseInt(e(371))/12)+-parseInt(e(357))/13)break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class S{constructor(e){this[M(361)]=e}[E(347)](n){const s=E;if((n=n??{})[s(364)]!==s(348))throw new Error(s(365));const r=n[s(345)],i=new e(t[s(352)](r));return this[s(361)][s(349)][s(350)](i),this[s(361)].scene[s(359)](),Promise[s(338)](i)}[E(367)](e){const t=E,s=new n;this[t(361)][t(362)]=s,this[t(361)].scene.requestRender()}[E(353)](e,t){const n=E,r=(e=e??{})[n(345)];fetch(r+n(370))[n(351)]((e=>e[n(363)]())).then((e=>{const t=n;e[t(346)]&&Array.isArray(e[t(346)])&&4===e[t(346)][t(369)]?this[t(361)][t(339)][t(341)]({destination:s[t(354)](e.valid_bounds[0],e[t(346)][1],e[t(346)][2],e.valid_bounds[3])}):e[t(344)]&&Array[t(366)](e.bounds)&&4==e.bounds.length&&this[t(361)][t(339)][t(341)]({destination:s[t(354)](e[t(344)][0],e[t(344)][1],e[t(344)][2],e[t(344)][3])})}))}show(t,s){const r=E;if(t instanceof e){if(s)this._viewer.scene[r(350)](t);else{const e=new n;this._viewer[r(362)]=e}this._viewer[r(349)].requestRender()}}}function T(){const e=["1408lOdukE","15TILfNL","resolve","camera","4613QvKHpa","flyTo","64953OPhvtt","26juileJ","bounds","url","valid_bounds","load","TERRAIN","scene","setTerrain","then","fromUrl","locate","fromDegrees","4748060lnYiaM","57902gDgzZf","841776rXugrg","120ZjxKIC","requestRender","656836IJOMSp","_viewer","terrainProvider","json","type","the layer type is not 'TERRAIN'","isArray","remove","2064xZzXXi","length","/layer.json","24792JWmlWE","6CIQgbV"];return(T=function(){return e})()}function M(e,t){const n=T();return(M=function(e,t){return n[e-=335]})(e,t)}const R=b;function b(e,t){const n=x();return(b=function(e,t){return n[e-=176]})(e,t)}function x(){const e=["multiply","2298376xHbMdF","primitives","transform","36bQLwrg","331509daaAVq","the layer type is not '3DTILES'","the url is needed","245362DAErvI","remove","fromUrl","altitude","load","scene","1560kfrfzJ","_viewer","longitude","fromDegrees","flyTo","multiplyByMatrix3","13128hGBAVx","9wsgeOM","73254CzOADX","getHeight","show","azimuth","transferTileSet","root","fromCartesian","type","toDegrees","requestRender","3DTILES","toRadians","fromRotationZ","url","add","eastNorthUpToFixedFrame","globe","4037075CHvhZO","latitude","55550AOryJh","95lRRSYz","locate"];return(x=function(){return e})()}!function(){const e=b,t=x();for(;;)try{if(679636===parseInt(e(179))/1+parseInt(e(182))/2*(parseInt(e(195))/3)+-parseInt(e(194))/4+-parseInt(e(216))/5*(parseInt(e(196))/6)+parseInt(e(213))/7+parseInt(e(219))/8*(-parseInt(e(178))/9)+parseInt(e(188))/10*(parseInt(e(215))/11))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class L{constructor(e){this[b(189)]=e}async[R(186)](e){const t=R;if((e=e??{})[t(203)]!==t(206))throw new Error(t(180));const n=e[t(209)];if(!n)throw new Error(t(181));const s={longitude:e[t(190)]??0,latitude:e[t(214)]??0,altitude:e[t(185)]??0,azimuth:e[t(199)]??0},i=await r[t(184)](n,{dynamicScreenSpaceError:!0,dynamicScreenSpaceErrorDensity:.00278,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceErrorHeightFalloff:.25});return this[t(200)](i,s),this[t(189)][t(187)][t(176)][t(210)](i),this[t(189)].scene[t(205)](),i}transferTileSet(e,t){const n=R,{longitude:s,latitude:r,altitude:u,azimuth:f}=t;let p=new i;if(s&&r){let e=u;0==u&&(e=this[n(189)].scene[n(212)][n(197)](o[n(191)](s,r))||0);const t=a[n(191)](s,r,e),d=c[n(211)](t),y=new h(1,0,0,0,1,0,0,0,1),w=h[n(208)](l.toRadians(f));h[n(218)](y,w,y),p=i.multiplyByMatrix3(d,y,new i)}else if(u){const t=new a;i.getTranslation(e[n(201)][n(177)],t);const s=o[n(202)](t);if(s){const e=l[n(204)](s[n(214)]),t=l[n(204)](s.longitude),r=a[n(191)](t,e,u),o=c[n(211)](r),d=new h(1,0,0,0,1,0,0,0,1),y=h[n(208)](l[n(207)](f));h.multiply(d,y,d),p=i[n(193)](o,d,new i)}}else if(f){const t=new h(1,0,0,0,1,0,0,0,1),s=h[n(208)](l[n(207)](f));h[n(218)](t,s,t),p=i[n(193)](e[n(201)][n(177)],t,new i)}else p=e.root[n(177)];e[n(201)][n(177)]=p}[R(183)](e){const t=R;e instanceof r&&(this[t(189)][t(187)][t(176)].remove(e),this[t(189)][t(187)][t(205)]())}[R(217)](e,t){const n=R;t instanceof r&&this[n(189)][n(192)](t)}[R(198)](e,t){const n=R;e instanceof r&&(e[n(198)]=t,this[n(189)][n(187)][n(205)]())}}const C=k;function k(e,t){const n=q();return(k=function(e,t){return n[e-=263]})(e,t)}function q(){const e=["fromUrl","alpha","isArray","type","18inCKbN","getImageryRectangle","extent","remove","1255624SLlHkY","7PRQbcf","token","ready","/info/iteminfo?f=pjson&token=","_viewer","camera","fromProviderAsync","795WSvScM","ARCGIS","rectangle","requestRender","300sFVuJS","load","json","then","2904054lzfxIv","flyTo","448195wvKqaR","imageryLayers","scene","366908PjvXkZ","the url is needed","show","addEventListener","1549415MApdtS","12390180vXzysu","add","locate"];return(q=function(){return e})()}!function(){const e=k,t=q();for(;;)try{if(354768===-parseInt(e(270))/1+parseInt(e(264))/2*(-parseInt(e(297))/3)+parseInt(e(273))/4+parseInt(e(277))/5+parseInt(e(268))/6*(-parseInt(e(290))/7)+parseInt(e(289))/8*(-parseInt(e(285))/9)+parseInt(e(278))/10)break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class A{constructor(e){this[k(294)]=e}async[C(265)](e){const t=C;if((e=e??{})[t(284)]!==t(298))throw new Error("the layer type is not 'ARCGIS'");const{url:n,alpha:r,token:i}=e;if(!n)throw new Error(t(274));let o=n;o=i?n+t(293)+i:n+"/info/iteminfo?f=pjson";const a=await fetch(o,{method:"GET"}).then((e=>e[t(266)]()))[t(267)]((e=>{const n=t,r={};return i&&(r[n(291)]=i),e&&e[n(287)]&&Array[n(283)](e[n(287)])&&(r[n(299)]=s.fromDegrees(e.extent[0][0],e[n(287)][0][1],e.extent[1][0],e[n(287)][1][1])),r})),c=u[t(281)](n,a),h=f[t(296)](c,{});return r&&(h[t(282)]=r),this[t(294)][t(271)][t(279)](h),this[t(294)][t(272)][t(263)](),h}async[C(288)](e){const t=C;e instanceof f&&(this[t(294)][t(271)][t(288)](e,!0),this[t(294)].scene[t(263)]())}[C(280)](e,t){const n=C;if(t instanceof f)if(t[n(292)]){const e=t[n(286)]();this[n(294)].scene[n(295)][n(269)]({destination:e})}else t.readyEvent[n(276)]((e=>{const s=n,r=t.getImageryRectangle();this._viewer[s(272)][s(295)].flyTo({destination:r})}))}[C(275)](e,t){const n=C;e instanceof f&&(e[n(275)]=t,this[n(294)][n(272)][n(263)]())}}function W(e,t){const n=P();return(W=function(e,t){return n[e-=302]})(e,t)}const j=W;function P(){const e=["367396UmYedK","bounds","camera","alpha","west","URLTemplate","meta.json fetch failed:","rectangle","json","scene","imageryLayers","locate","tilingScheme","tileHeight","minzoom","WGS84","getImageryRectangle","maxzoom","east","addEventListener","requestRender","fromDegrees","ready","type","show","{z}/{x}/{y}.png","add","north","5696551rgPzRo","2798874SkqZYD","proj","the layer type is not 'URLTemplate'","maximumLevel","south","106941epIFFb","flyTo","110146DDuxUT","remove","load","_viewer","1506790BVKLGP","1358255eYjtvZ","includes","the url is needed"];return(P=function(){return e})()}!function(){const e=W,t=P();for(;;)try{if(492868===parseInt(e(324))/1+-parseInt(e(328))/2+parseInt(e(322))/3+parseInt(e(332))/4+-parseInt(e(329))/5+parseInt(e(317))/6+parseInt(e(316))/7)break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class z{constructor(e){this[W(327)]=e}async[j(326)](e){const t=j;if((e=e??{})[t(311)]!==t(337))throw new Error(t(319));const{url:n,alpha:r}=e;if(!n)throw new Error(t(331));const i=t(313),o=n[t(330)](i)?n.substring(0,n.indexOf(i))+"meta.json":null,a=o?await async function(e){const t=W;try{const n=await fetch(e,{method:"GET"});return n.ok?await n[t(340)]():null}catch(n){return console.warn(t(338),e),null}}(o):null,c={url:n};(null==a?void 0:a.bounds)&&(c[t(339)]=s[t(309)](a[t(333)][t(336)],a.bounds[t(321)],a[t(333)][t(306)],a[t(333)][t(315)])),4326===(null==a?void 0:a[t(318)])&&(c[t(344)]=new p({ellipsoid:d[t(303)]})),null!=(null==a?void 0:a.maxzoom)&&(c[t(320)]=a[t(305)]),null!=(null==a?void 0:a[t(302)])&&(c.minimumLevel=a[t(302)]),(null==a?void 0:a.tilesize)&&(c.tileWidth=c[t(345)]=a.tilesize);const h=new y(c),l=new f(h,{});return r&&(l[t(335)]=r),this[t(327)][t(342)][t(314)](l),this[t(327)][t(341)].requestRender(),l}async[j(325)](e){const t=j;e instanceof f&&(this._viewer.imageryLayers.remove(e,!0),this._viewer[t(341)][t(308)]())}[j(343)](e,t){const n=j;if(t instanceof f)if(t[n(310)]){const e=t[n(304)]();this[n(327)].scene[n(334)][n(323)]({destination:e})}else t.readyEvent[n(307)]((e=>{const s=n,r=t[s(304)]();this._viewer[s(341)].camera.flyTo({destination:r})}))}[j(312)](e,t){const n=j;e instanceof f&&(e[n(312)]=t,this[n(327)][n(341)][n(308)]())}}const D=G;function G(e,t){const n=U();return(G=function(e,t){return n[e-=256]})(e,t)}function U(){const e=["flyTo","alpha","maximumLevel","minimumLevel","scene","1031675FGajqe","tilingScheme","tilesize","1754184ccqNOs","camera","7559419RqJSZp",".json","maxzoom","then","410430lhjBPm","2247384HDCsST","proj","readyEvent","show","type","getImageryRectangle","_viewer","ready","/{z}/{x}/{y}.png","the layer type is not 'Mbtiles'","tileHeight","bounds","json","628gHeUxK","the url is needed","load","add","5523WuvwwQ","imageryLayers","minzoom","22036130daQldT","requestRender","locate","remove","9wwuVul","70sHKWIk","rectangle","substr","addEventListener"];return(U=function(){return e})()}!function(){const e=G,t=U();for(;;)try{if(582311===parseInt(e(261))/1+parseInt(e(271))/2+parseInt(e(288))/3*(parseInt(e(284))/4)+parseInt(e(296))/5*(-parseInt(e(270))/6)+parseInt(e(266))/7+parseInt(e(264))/8+parseInt(e(295))/9*(-parseInt(e(291))/10))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class N{constructor(e){this._viewer=e}async[D(286)](e){const t=D;e=w(e,{});if("Mbtiles"!==w(e[t(275)],void 0))throw new Error(t(280));const{url:n,alpha:r}=e;if(!n)throw new Error(t(285));let i=t(279),o=n[t(298)](0,n.indexOf(i))+t(267);const a=await fetch(o,{method:"GET"})[t(269)]((e=>e[t(283)]())).then((e=>{const r=t,i={url:n};return e&&e[r(282)]&&(i[r(297)]=s.fromDegrees(e[r(282)][0],e[r(282)][1],e[r(282)][2],e[r(282)][2])),e&&4326==e[r(272)]&&(i[r(262)]=new p({ellipsoid:d.WGS84})),e&&e[r(268)]&&(i[r(258)]=e.maxzoom),e&&e[r(290)]&&(i[r(259)]=e[r(290)]),e&&e[r(263)]&&(i.tileWidth=i[r(281)]=e[r(263)]),i})),c=new y(a),h=new f(c,{});return r&&(h[t(257)]=r),this[t(277)][t(289)][t(287)](h),this[t(277)][t(260)][t(292)](),h}async[D(294)](e){const t=D;e instanceof f&&(this._viewer[t(289)][t(294)](e,!0),this._viewer.scene[t(292)]())}[D(293)](e,t){const n=D;if(t instanceof f)if(t[n(278)]){const e=t[n(276)]();this._viewer[n(260)][n(265)][n(256)]({destination:e})}else t[n(273)][n(299)]((e=>{const s=n,r=t[s(276)]();this[s(277)].scene.camera[s(256)]({destination:r})}))}[D(274)](e,t){const n=D;e instanceof f&&(e.show=t,this._viewer.scene[n(292)]())}}const O=B;function B(e,t){const n=K();return(B=function(e,t){return n[e-=302]})(e,t)}!function(){const e=B,t=K();for(;;)try{if(825688===parseInt(e(307))/1+-parseInt(e(316))/2*(-parseInt(e(314))/3)+parseInt(e(306))/4+-parseInt(e(311))/5+parseInt(e(319))/6+parseInt(e(322))/7+-parseInt(e(308))/8*(parseInt(e(302))/9))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class Z{constructor(e){this._viewer=e}async load(e){const t=B;if("GEOJSON"!==(e=e??{})[t(309)])throw new Error(t(321));const{url:n,clampToGround:s}=e;if(!n)throw new Error(t(313));const r=new _({options:{useGroundGeometry:s??!1,clampToGround:s??!1,scene:this[t(312)][t(320)]}});return await r.load(n),this[t(312)][t(320)][t(303)][t(310)](r[t(305)]),this[t(312)][t(320)][t(317)](),r}async remove(e){const t=B;e instanceof _&&(this[t(312)][t(320)].primitives.remove(e.primitiveCollection),this[t(312)][t(320)][t(317)]())}[O(304)](e,t){const n=O;t instanceof _&&t[n(318)](this[n(312)],{tolerance:.015})}show(e,t){const n=O;e instanceof _&&(e[n(305)][n(315)]=t,this[n(312)][n(320)][n(317)]())}}function K(){const e=["9BkLtwa","primitives","locate","primitiveCollection","5112652bwqcFE","1239233oEQlJr","29711752pBaWHq","type","add","1229090YHkvgm","_viewer","the url is needed","6234PTZrAi","show","430UToZzR","requestRender","flyTo","2743464zCfQtn","scene","the layer type is not 'GEOJSON'","9548455ZAKqQc"];return(K=function(){return e})()}const H=F;function F(e,t){const n=J();return(F=function(e,t){return n[e-=178]})(e,t)}!function(){const e=F,t=J();for(;;)try{if(394976===-parseInt(e(189))/1*(-parseInt(e(190))/2)+parseInt(e(193))/3+parseInt(e(178))/4+parseInt(e(186))/5*(-parseInt(e(181))/6)+-parseInt(e(205))/7+-parseInt(e(191))/8*(parseInt(e(184))/9)+-parseInt(e(199))/10*(-parseInt(e(200))/11))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class Q{constructor(e){this._viewer=e}async[H(185)](e){const t=H;if((e=e??{})[t(188)]!==t(195))throw new Error(t(187));const{url:n,layers:s}=e;if(!n)throw new Error(t(197));if(!s)throw new Error(t(192));const r=new m(e),i=new f(r,{});return this._viewer.imageryLayers.add(i),this._viewer[t(198)].requestRender(),i}async[H(203)](e){const t=H;e instanceof f&&(this[t(180)][t(179)][t(203)](e,!0),this[t(180)][t(198)].requestRender())}[H(182)](e,t){const n=H;if(t instanceof f)if(t[n(183)]){const e=t[n(206)]();this[n(180)].scene.camera.flyTo({destination:e})}else t[n(194)][n(204)]((e=>{const s=n,r=t[s(206)]();this[s(180)][s(198)][s(196)][s(201)]({destination:r})}))}[H(202)](e,t){const n=H;e instanceof f&&(e[n(202)]=t,this[n(180)].scene.requestRender())}}function J(){const e=["1106842CcaxGW","flyTo","show","remove","addEventListener","1186556AoSVhW","getImageryRectangle","2601528qUIJxK","imageryLayers","_viewer","1548930ZgQPdj","locate","ready","126jtTqyn","load","15jPJFfl","the layer type is not 'WMS'","type","1AOBlDY","676394QUWazg","176744xREAvT","the layers is needed","167820nAbfwu","readyEvent","WMS","camera","the url is needed","scene","60WNtBjW"];return(J=function(){return e})()}function V(){const e=["format","the layer type is not 'WMTS'","3013846Wtjwjl","3USyFFM","getImageryRectangle","addEventListener","flyTo","24URMgOx","898PCkrsL","requestRender","show","readyEvent","add","1276372Tdikja","the style is needed","tileMatrixLabels","677eMjvse","scene","2197296fKWUOM","_viewer","83040hZhXbw","761082knKyZH","2007yfKYAv","the layer is needed","the url is needed","camera","subdomains","2600uBVEuo","80JQNzwd","ready","the tileMatrixSetID is needed"];return(V=function(){return e})()}function Y(e,t){const n=V();return(Y=function(e,t){return n[e-=141]})(e,t)}!function(){const e=Y,t=V();for(;;)try{if(163624===-parseInt(e(143))/1*(parseInt(e(166))/2)+-parseInt(e(161))/3*(-parseInt(e(171))/4)+-parseInt(e(155))/5*(-parseInt(e(147))/6)+parseInt(e(148))/7*(parseInt(e(165))/8)+-parseInt(e(149))/9*(-parseInt(e(154))/10)+-parseInt(e(160))/11+-parseInt(e(145))/12)break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class X{constructor(e){this._viewer=e}async load(e){const t=Y;if("WMTS"!==(e=e??{}).type)throw new Error(t(159));const{url:n,layer:s,style:r,tileMatrixSetID:i,subdomains:o,format:a,tilingScheme:c,tileMatrixLabels:h}=e;if(!n)throw new Error(t(151));if(!s)throw new Error(t(150));if(!r)throw new Error(t(141));if(!i)throw new Error(t(157));const l={url:n,layer:s,style:r,tileMatrixSetID:i};o&&(l[t(153)]=o),a&&(l[t(158)]=a),c&&(l.tilingScheme=c),h&&(l[t(142)]=h);const u=new I(l),p=new f(u,{});return this[t(146)].imageryLayers[t(170)](p),this._viewer[t(144)].requestRender(),p}async remove(e){e instanceof f&&(this._viewer.imageryLayers.remove(e,!0),this._viewer.scene.requestRender())}locate(e,t){const n=Y;if(t instanceof f)if(t[n(156)]){const e=t[n(162)]();this[n(146)][n(144)][n(152)][n(164)]({destination:e})}else t[n(169)][n(163)]((e=>{const s=n,r=t[s(162)]();this[s(146)][s(144)][s(152)][s(164)]({destination:r})}))}show(e,t){const n=Y;e instanceof f&&(e[n(168)]=t,this._viewer[n(144)][n(167)]())}}function $(e,t){const n=te();return($=function(e,t){return n[e-=286]})(e,t)}const ee=$;function te(){const e=["camera","flyTo","scene","the url is needed","4NKBBgH","then","show","739560xGBKcN","dataSources","KMZ","5888780nnUzFZ","load","requestRender","2XaiUYk","2416527MpEFrV","type","16492lrfHqm","9vUvrGQ","720503PXAJlf","4552EvYgZj","add","4113465lXwnzw","19581496CXStcc","canvas","_viewer","locate","remove"];return(te=function(){return e})()}!function(){const e=$,t=te();for(;;)try{if(711641===-parseInt(e(292))/1*(-parseInt(e(287))/2)+parseInt(e(288))/3*(-parseInt(e(305))/4)+parseInt(e(295))/5+parseInt(e(308))/6+parseInt(e(290))/7*(-parseInt(e(293))/8)+parseInt(e(291))/9*(-parseInt(e(311))/10)+parseInt(e(296))/11)break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class ne{constructor(e){this._viewer=e}async[ee(312)](e){const t=ee,n=(e=e??{})[t(289)];if("KML"!==n&&n!==t(310))throw new Error("the layer type is not 'KML' or 'KMZ");const{url:s,clampToGround:r}=e;if(!s)throw new Error(t(304));return this[t(298)].dataSources[t(294)](v.load(s,{camera:this[t(298)][t(303)][t(301)],canvas:this[t(298)][t(303)][t(297)],clampToGround:r??!1}))}async remove(e){const t=ee;(null==e?void 0:e[t(306)])&&e.then((e=>{const n=t;this[n(298)][n(309)][n(300)](e),this[n(298)].scene[n(286)]()})),e instanceof v&&(this._viewer[t(309)][t(300)](e),this[t(298)].scene[t(286)]())}[ee(299)](e,t){const n=ee;(null==t?void 0:t[n(306)])&&t.then((e=>{const t=n;this[t(298)][t(302)](e)})),t instanceof v&&this[n(298)][n(302)](t)}[ee(307)](e,t){const n=ee;(null==e?void 0:e.then)&&e.then((e=>{const n=$;e[n(307)]=t,this[n(298)][n(303)][n(286)]()})),e instanceof v&&(e.show=t,this[n(298)].scene[n(286)]())}}const se=re;function re(e,t){const n=ie();return(re=function(e,t){return n[e-=422]})(e,t)}function ie(){const e=["638323qEBCCp","3690615epsdbj","text/xml","default","options","ows:LowerCorner","?SERVICE=WMTS&REQUEST=GetCapabilities","_extentCache","4326","8WwZgZU","has","__layerType","layer","180drNeQM","split","_getLayerRectangle","ows:Identifier","210067MGDhjv","_extentPromiseCache","fromDegrees","readyEvent","requestRender","from","flyTo","ows:UpperCorner","?token=","_imageryProvider","2ZwOnOt","locate","ows:WGS84BoundingBox","show","_createProvider","parseFromString","defineProperty","364113WsNFLf","set","7xPmIqm","image/png","4056525IoHOWb","get","token","the layer type is not 'SUPERMAP_WMTS'","_viewer","includes","_getCapabilitiesUrl","text","textContent","?SERVICE=WMTS&REQUEST=GetCapabilities&token=","imageryLayers","ows:Title","remove","url / layer / tileMatrixSetID is required","3373764TLQIoR","112192EHaubC","getElementsByTagName","scene","_options","SUPERMAP_WMTS","camera"];return(ie=function(){return e})()}!function(){const e=re,t=ie();for(;;)try{if(405696===-parseInt(e(477))/1*(parseInt(e(445))/2)+-parseInt(e(452))/3+-parseInt(e(471))/4+parseInt(e(478))/5+parseInt(e(470))/6*(parseInt(e(454))/7)+-parseInt(e(427))/8*(parseInt(e(456))/9)+parseInt(e(431))/10*(parseInt(e(435))/11))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();const oe=class{constructor(e){this[re(460)]=e}async load(e){const t=re,{type:n,url:s,layer:r,tileMatrixSetID:i,style:o="default",format:a=t(455)}=e;if(n!==t(475))throw new Error(t(459));if(!s||!r||!i)throw new Error(t(469));this[t(474)]={...e};const c=new f(this[t(449)](e));return Object[t(451)](c,t(429),{value:t(475),enumerable:!1}),this._imageryLayer=c,this[t(460)][t(466)].add(c),this._viewer[t(473)][t(439)](),c}refreshToken(e,t){const n=re;if(!(e[n(430)]instanceof f))return;e[n(422)][n(458)]=t;const s=this[n(449)](e[n(422)]);e[n(430)][n(444)]=s,this[n(460)][n(473)][n(439)]()}[se(449)](e){const t=se,{url:n,layer:s,tileMatrixSetID:r,style:i=t(480),format:o="image/png",token:a}=e;if(!n||!s||!r)throw new Error("url / layer / tileMatrixSetID is required");const c=a?n+t(443)+a:n,h=r[t(461)](t(426))?new p:new g,l=Array[t(440)]({length:22},((e,t)=>t.toString()));return new I({url:c,layer:s,style:i,format:o,tileMatrixSetID:r,tileMatrixLabels:l,tilingScheme:h})}async[se(446)](e,t){const n=se;if(!(t instanceof f))return;const s=async()=>{const n=re,s=await this._getLayerRectangle(e);if(s)return void this[n(460)][n(473)].camera.flyTo({destination:s});const r=t.getImageryRectangle();r&&this[n(460)].scene[n(476)][n(441)]({destination:r})};t.ready?s():t[n(438)].addEventListener((()=>s()))}[se(462)](e){const t=se,{url:n,token:s}=e;return s?n+t(465)+s:n+t(424)}async[se(433)](e){const t=se,{layer:n}=e;if(!n)return;const r=this[t(462)](e)+"#"+n;if(oe._extentCache[t(428)](r))return oe[t(425)].get(r);if(oe[t(436)][t(428)](r))return oe[t(436)][t(457)](r);const i=(async()=>{const i=t,o=this[i(462)](e),a=await fetch(o).then((e=>e[i(463)]())),c=(new DOMParser)[i(450)](a,i(479)),h=Array[i(440)](c.getElementsByTagName("Layer")).find((e=>{const t=i;var s,r;return((null==(s=e[t(472)](t(434))[0])?void 0:s[t(464)])||(null==(r=e[t(472)](t(467))[0])?void 0:r.textContent))===n}));if(!h)return;const l=h.getElementsByTagName(i(447))[0];if(!l)return;const u=l[i(472)](i(423))[0][i(464)][i(432)](" "),f=l[i(472)](i(442))[0][i(464)][i(432)](" "),p=s[i(437)](Number(u[0]),Number(u[1]),Number(f[0]),Number(f[1]));return oe._extentCache[i(453)](r,p),oe[i(436)].delete(r),p})();return oe[t(436)].set(r,i),i}[se(468)](e){const t=se;e instanceof f&&(this._viewer[t(466)][t(468)](e,!0),this._viewer[t(473)][t(439)]())}[se(448)](e,t){const n=se;e instanceof f&&(e[n(448)]=t,this[n(460)].scene[n(439)]())}};let ae=oe;ae[se(425)]=new Map,ae[se(436)]=new Map;const ce=he;function he(e,t){const n=le();return(he=function(e,t){return n[e-=162]})(e,t)}function le(){const e=["url","2493480xWCGHe","the type '","URLTemplate","GEOJSON","请输入Viewer对象!","3DTILES","3660hefPOC","TERRAIN","9iBgemQ","8732680ijsykT","KML","' is not support","Mbtiles","_load","locate","_typeClassMap","includes","_initLoader","type","SUPERMAP_WMTS","destroy","set","_remove","_type","_url","2708SFVGNc","_typeClass","loadAsync","_id","604215kLvvqs","_show","ARCGIS","7212462YsTquz","getById","bind","the layer with id '","has","_locate","showById","the url is needed","_layersMap","load","WMTS","_refreshToken","9079736ZvmEMg","' is already loaded","refreshToken","1461000MyxcoL","_viewer","delete","locateById","WMS","get","7jdJPrv"];return(le=function(){return e})()}!function(){const e=he,t=le();for(;;)try{if(646851===-parseInt(e(172))/1+parseInt(e(190))/2+parseInt(e(198))/3+-parseInt(e(168))/4*(-parseInt(e(204))/5)+-parseInt(e(175))/6*(-parseInt(e(196))/7)+-parseInt(e(187))/8*(parseInt(e(206))/9)+-parseInt(e(207))/10)break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class ue{constructor(e){const t=he;if(!e)throw new Error(t(202));this[t(191)]=e,this._layersMap=new Map,this[t(213)]=new Map}[ce(215)](){const e=ce,t=this._typeClassMap[e(195)](this[e(166)]);t?this[e(169)]=t:this[e(166)]===e(205)?this[e(169)]=new S(this[e(191)]):this[e(166)]===e(203)?this[e(169)]=new L(this[e(191)]):this._type===e(174)?this[e(169)]=new A(this[e(191)]):"URLTemplate"===this[e(166)]?this[e(169)]=new z(this[e(191)]):this[e(166)]===e(210)?this[e(169)]=new N(this[e(191)]):this[e(166)]===e(194)?this[e(169)]=new Q(this[e(191)]):this[e(166)]===e(185)?this[e(169)]=new X(this[e(191)]):this[e(166)]===e(208)?this[e(169)]=new ne(this._viewer):this._type===e(201)?this._typeClass=new Z(this[e(191)]):this[e(166)]===e(162)&&(this[e(169)]=new ae(this[e(191)]),this._refreshToken=this[e(169)].refreshToken.bind(this._typeClass)),this[e(211)]=this[e(169)][e(184)][e(177)](this[e(169)]),this[e(165)]=this[e(169)].remove[e(177)](this[e(169)]),this[e(180)]=this[e(169)][e(212)][e(177)](this._typeClass),this[e(173)]=this[e(169)].show[e(177)](this[e(169)])}async[ce(170)](e){const t=ce;if(e=e??{},this[t(171)]=e.id,this[t(183)][t(179)](this[t(171)]))throw new Error(t(178)+this._id+t(188));if(this[t(167)]=e[t(197)],!this[t(167)])throw new Error(t(182));if(this._type=e.type,!this._isSupport(e.type))throw new Error(t(199)+e.type+t(209));if(this[t(215)](),e[t(216)]===t(208)){const n=this[t(211)](e);n instanceof Promise&&this._layersMap[t(164)](e.id,{options:e,layer:n})}else{const n=await this[t(211)](e);this[t(183)][t(164)](e.id,{options:e,layer:n})}}_isSupport(e){const t=ce;return["TERRAIN",t(203),t(174),t(200),"Mbtiles",t(194),"WMTS","KML",t(201),"SUPERMAP_WMTS"][t(214)](e)}[ce(176)](e){const t=ce;return this[t(183)][t(195)](e)}removeById(e){const t=ce,n=this._layersMap[t(195)](e);if(this[t(183)][t(192)](e),!n)return;const{options:s,layer:r}=n;r&&(this._type=s.type,this[t(215)](),this[t(165)](r))}[ce(193)](e){const t=ce,n=this[t(183)][t(195)](e);if(!n)return;const{options:s,layer:r}=n;r&&(this[t(166)]=s[t(216)],this[t(215)](),this[t(180)](s,r))}[ce(181)](e,t){const n=ce,s=this._layersMap[n(195)](e);if(!s)return;const{options:r,layer:i}=s;i&&(this[n(166)]=r.type,this[n(215)](),this[n(173)](i,t))}[ce(189)](e,t){const n=ce;var s;const r=this[n(183)][n(195)](e);r&&r.options[n(216)]===n(162)&&(null==(s=this[n(186)])||s.call(this,r,t))}[ce(163)](){}}export{ue as default};
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nsc-earth-2/layer",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",