@nsc-earth-2/layer 1.1.1 → 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 y,UrlTemplateImageryProvider as d,defaultValue as w,WebMapServiceImageryProvider as m,WebMapTileServiceImageryProvider as I,KmlDataSource as g,WebMercatorTilingScheme as v}from"cesium";import{GeoJsonPrimitiveLayer as E}from"@nsc-earth-2/primitive-geojson";const _=T;function T(e,t){const n=R();return(T=function(e,t){return n[e-=128]})(e,t)}!function(e,t){const n=T,s=R();for(;;)try{if(498955===parseInt(n(138))/1+-parseInt(n(134))/2*(parseInt(n(133))/3)+parseInt(n(159))/4*(parseInt(n(157))/5)+-parseInt(n(144))/6*(parseInt(n(151))/7)+parseInt(n(135))/8*(parseInt(n(131))/9)+-parseInt(n(153))/10+parseInt(n(149))/11*(parseInt(n(160))/12))break;s.push(s.shift())}catch(e){s.push(s.shift())}}();class S{constructor(e){this[T(145)]=e}load(n){const s=T;if((n=n??{})[s(141)]!==s(155))throw new Error(s(129));const r=n[s(146)],i=new e(t[s(156)](r));return this[s(145)][s(140)].setTerrain(i),this[s(145)][s(140)][s(130)](),Promise[s(161)](i)}[_(148)](e){const t=_,s=new n;this[t(145)][t(136)]=s,this._viewer.scene[t(130)]()}locate(e,t){const n=_,r=(e=e??{})[n(146)];fetch(r+n(142))[n(128)]((e=>e.json()))[n(128)]((e=>{const t=n;e[t(139)]&&Array[t(152)](e[t(139)])&&4===e[t(139)][t(143)]?this[t(145)][t(158)].flyTo({destination:s[t(147)](e.valid_bounds[0],e[t(139)][1],e[t(139)][2],e[t(139)][3])}):e[t(154)]&&Array[t(152)](e[t(154)])&&4==e[t(154)][t(143)]&&this[t(145)][t(158)][t(150)]({destination:s[t(147)](e[t(154)][0],e[t(154)][1],e[t(154)][2],e[t(154)][3])})}))}[_(137)](t,s){const r=_;if(t instanceof e){if(s)this[r(145)].scene[r(132)](t);else{const e=new n;this[r(145)][r(136)]=e}this._viewer.scene[r(130)]()}}}function R(){const e=["fromUrl","610370nOqFhF","camera","28txQFlY","48UvHHpg","resolve","then","the layer type is not 'TERRAIN'","requestRender","9rHddrl","setTerrain","807DNIoKS","5338aibQTn","1924392NrbUCj","terrainProvider","show","829254HeBhkw","valid_bounds","scene","type","/layer.json","length","39036KRSqlS","_viewer","url","fromDegrees","remove","1993354gktCnH","flyTo","658bFxtkJ","isArray","8206970iPiUQJ","bounds","TERRAIN"];return(R=function(){return e})()}const M=b;function b(e,t){const n=x();return(b=function(e,t){return n[e-=243]})(e,t)}!function(e,t){const n=b,s=x();for(;;)try{if(990165===-parseInt(n(247))/1+-parseInt(n(274))/2*(parseInt(n(249))/3)+-parseInt(n(282))/4*(parseInt(n(248))/5)+-parseInt(n(276))/6*(parseInt(n(273))/7)+parseInt(n(260))/8*(-parseInt(n(264))/9)+-parseInt(n(255))/10*(-parseInt(n(278))/11)+parseInt(n(252))/12)break;s.push(s.shift())}catch(e){s.push(s.shift())}}();class C{constructor(e){this[b(257)]=e}async[M(283)](e){const t=M;if((e=e??{})[t(256)]!==t(253))throw new Error("the layer type is not '3DTILES'");const n=e[t(258)];if(!n)throw new Error(t(261));const s={longitude:e[t(284)]??0,latitude:e[t(251)]??0,altitude:e[t(265)]??0,azimuth:e[t(266)]??0},i=await r[t(271)](n,{dynamicScreenSpaceError:!0,dynamicScreenSpaceErrorDensity:.00278,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceErrorHeightFalloff:.25});return this[t(270)](i,s),this[t(257)][t(277)][t(250)][t(280)](i),this[t(257)][t(277)][t(259)](),i}[M(270)](e,t){const n=M,{longitude:s,latitude:r,altitude:u,azimuth:f}=t;let p=new i;if(s&&r){let e=u;0==u&&(e=this[n(257)][n(277)][n(246)].getHeight(o[n(268)](s,r))||0);const t=a[n(268)](s,r,e),y=c[n(279)](t),d=new h(1,0,0,0,1,0,0,0,1),w=h.fromRotationZ(l[n(281)](f));h.multiply(d,w,d),p=i[n(275)](y,d,new i)}else if(u){const t=new a;i.getTranslation(e[n(245)][n(267)],t);const s=o[n(272)](t);if(s){const e=l[n(254)](s[n(251)]),t=l.toDegrees(s.longitude),r=a[n(268)](t,e,u),o=c[n(279)](r),y=new h(1,0,0,0,1,0,0,0,1),d=h[n(269)](l[n(281)](f));h[n(243)](y,d,y),p=i.multiplyByMatrix3(o,y,new i)}}else if(f){const t=new h(1,0,0,0,1,0,0,0,1),s=h.fromRotationZ(l[n(281)](f));h[n(243)](t,s,t),p=i[n(275)](e[n(245)][n(267)],t,new i)}else p=e[n(245)][n(267)];e.root[n(267)]=p}[M(263)](e){const t=M;e instanceof r&&(this[t(257)].scene[t(250)][t(263)](e),this._viewer[t(277)][t(259)]())}locate(e,t){const n=M;t instanceof r&&this[n(257)][n(262)](t)}[M(244)](e,t){const n=M;e instanceof r&&(e[n(244)]=t,this[n(257)][n(277)][n(259)]())}}function x(){const e=["70276356NCdKUJ","3DTILES","toDegrees","7870GCNVMf","type","_viewer","url","requestRender","8gHOVwE","the url is needed","flyTo","remove","7183287ceXPhN","altitude","azimuth","transform","fromDegrees","fromRotationZ","transferTileSet","fromUrl","fromCartesian","1813yQAibM","565118JwhTPn","multiplyByMatrix3","27162baDDXr","scene","495KMRLVA","eastNorthUpToFixedFrame","add","toRadians","673996XNoNex","load","longitude","multiply","show","root","globe","398310hdWSbC","50NjUNWd","9cczWNW","primitives","latitude"];return(x=function(){return e})()}function L(e,t){const n=D();return(L=function(e,t){return n[e-=291]})(e,t)}const W=L;function D(){const e=["getImageryRectangle","368VYpOAj","imageryLayers","the url is needed","1646CYNsEx","flyTo","ready","72UayrFE","948265baMURx","6iwOAIw","102655eQtgav","fromDegrees","json","token","_viewer","/info/iteminfo?f=pjson&token=","load","show","4851431qFMqjA","readyEvent","4LyQUWt","fromProviderAsync","1187lGunFT","2820CytgTI","rectangle","14277120TdQPpo","1483161CHOWwp","then","scene","remove","extent","type","17991eHrFYT","camera","the layer type is not 'ARCGIS'"];return(D=function(){return e})()}!function(e,t){const n=L,s=D();for(;;)try{if(759213===-parseInt(n(301))/1*(parseInt(n(318))/2)+-parseInt(n(305))/3*(-parseInt(n(299))/4)+-parseInt(n(322))/5*(-parseInt(n(323))/6)+-parseInt(n(324))/7*(-parseInt(n(315))/8)+parseInt(n(311))/9*(-parseInt(n(302))/10)+-parseInt(n(304))/11+-parseInt(n(321))/12*(-parseInt(n(297))/13))break;s.push(s.shift())}catch(e){s.push(s.shift())}}();class N{constructor(e){this[L(293)]=e}async[W(295)](e){const t=W;if("ARCGIS"!==(e=e??{})[t(310)])throw new Error(t(313));const{url:n,alpha:r,token:i}=e;if(!n)throw new Error(t(317));let o=n;o=i?n+t(294)+i:n+"/info/iteminfo?f=pjson";const a=await fetch(o,{method:"GET"})[t(306)]((e=>e[t(291)]()))[t(306)]((e=>{const n=t,r={};return i&&(r[n(292)]=i),e&&e[n(309)]&&Array.isArray(e[n(309)])&&(r[n(303)]=s[n(325)](e[n(309)][0][0],e.extent[0][1],e[n(309)][1][0],e[n(309)][1][1])),r})),c=u.fromUrl(n,a),h=f[t(300)](c,{});return r&&(h.alpha=r),this[t(293)][t(316)].add(h),this._viewer[t(307)].requestRender(),h}async remove(e){const t=W;e instanceof f&&(this[t(293)].imageryLayers[t(308)](e,!0),this[t(293)][t(307)].requestRender())}locate(e,t){const n=W;if(t instanceof f)if(t[n(320)]){const e=t[n(314)]();this[n(293)][n(307)][n(312)].flyTo({destination:e})}else t[n(298)].addEventListener((e=>{const s=n,r=t.getImageryRectangle();this[s(293)].scene[s(312)][s(319)]({destination:r})}))}[W(296)](e,t){const n=W;e instanceof f&&(e[n(296)]=t,this._viewer[n(307)].requestRender())}}function P(){const e=["_viewer","6243504zigmfu","proj","remove","rectangle","43541366RTdyPL","addEventListener","fromDegrees","alpha","tilingScheme","flyTo","east","4819304eJIusJ","maximumLevel","835sZJHVU","10hRYKfy","385251XdTvRy","{z}/{x}/{y}.png","readyEvent","the url is needed","camera","URLTemplate","imageryLayers","substr","scene","load","south","then","minimumLevel","meta.json","bounds","requestRender","indexOf","tilesize","6043328DCpwyo","maxzoom","524GFhuiE","5BZiDQB","locate","west","north","GET","28uWOzmS","json","getImageryRectangle","add","15077070dlEHdt","the layer type is not 'URLTemplate'","tileWidth","minzoom","ready"];return(P=function(){return e})()}const U=q;function q(e,t){const n=P();return(q=function(e,t){return n[e-=285]})(e,t)}!function(e,t){const n=q,s=P();for(;;)try{if(916293===-parseInt(n(324))/1*(-parseInt(n(295))/2)+parseInt(n(326))/3*(parseInt(n(301))/4)+-parseInt(n(296))/5*(parseInt(n(311))/6)+-parseInt(n(322))/7+-parseInt(n(293))/8+-parseInt(n(305))/9+parseInt(n(325))/10*(parseInt(n(315))/11))break;s.push(s.shift())}catch(e){s.push(s.shift())}}();class k{constructor(e){this[q(310)]=e}async[U(335)](e){const t=U;if((e=e??{}).type!==t(331))throw new Error(t(306));const{url:n,alpha:r}=e;if(!n)throw new Error(t(329));let i=t(327),o=n[t(333)](0,n[t(291)](i))+t(288);const a=await fetch(o,{method:t(300)})[t(286)]((e=>e[t(302)]()))[t(286)]((e=>{const r=t,i={url:n};return e&&e[r(289)]&&(i[r(314)]=s[r(317)](e[r(289)][r(298)],e[r(289)][r(285)],e[r(289)][r(321)],e.bounds[r(299)])),e&&4326==e[r(312)]&&(i[r(319)]=new p({ellipsoid:y.WGS84})),e&&e[r(294)]&&(i[r(323)]=e[r(294)]),e&&e[r(308)]&&(i[r(287)]=e[r(308)]),e&&e[r(292)]&&(i[r(307)]=i.tileHeight=e[r(292)]),i})),c=new d(a),h=new f(c,{});return r&&(h[t(318)]=r),this[t(310)].imageryLayers[t(304)](h),this._viewer[t(334)].requestRender(),h}async[U(313)](e){const t=U;e instanceof f&&(this[t(310)][t(332)].remove(e,!0),this[t(310)][t(334)][t(290)]())}[U(297)](e,t){const n=U;if(t instanceof f)if(t[n(309)]){const e=t[n(303)]();this[n(310)][n(334)][n(330)][n(320)]({destination:e})}else t[n(328)][n(316)]((e=>{const s=n,r=t.getImageryRectangle();this[s(310)].scene[s(330)].flyTo({destination:r})}))}show(e,t){const n=U;e instanceof f&&(e.show=t,this[n(310)][n(334)][n(290)]())}}function G(e,t){const n=O();return(G=function(e,t){return n[e-=206]})(e,t)}const z=G;function O(){const e=["locate","20667350QdWzqv","7ebLoKV","imageryLayers","/{z}/{x}/{y}.png","json","camera","indexOf","2065128WTskWF","70PFuWwt","substr","fromDegrees","type","then","requestRender","remove","maximumLevel","scene","tileWidth","getImageryRectangle","1178205NCXFKQ","2455464diCNEv","938279fgFVDT","256023HbmBMR","minzoom","25itnrOg","add","flyTo","the layer type is not 'Mbtiles'","tilesize","show","_viewer","tilingScheme","alpha","bounds","1171878CmgSNU","tileHeight","2cFagOD","load","readyEvent","GET"];return(O=function(){return e})()}!function(e,t){const n=G,s=O();for(;;)try{if(642407===-parseInt(n(219))/1+parseInt(n(234))/2*(-parseInt(n(217))/3)+parseInt(n(218))/4+parseInt(n(222))/5*(-parseInt(n(232))/6)+parseInt(n(240))/7*(parseInt(n(246))/8)+-parseInt(n(220))/9*(-parseInt(n(206))/10)+parseInt(n(239))/11)break;s.push(s.shift())}catch(e){s.push(s.shift())}}();class A{constructor(e){this._viewer=e}async[z(235)](e){const t=z;e=w(e,{});if("Mbtiles"!==w(e[t(209)],void 0))throw new Error(t(225));const{url:n,alpha:r}=e;if(!n)throw new Error("the url is needed");let i=t(242),o=n[t(207)](0,n[t(245)](i))+".json";const a=await fetch(o,{method:t(237)})[t(210)]((e=>e[t(243)]())).then((e=>{const r=t,i={url:n};return e&&e[r(231)]&&(i.rectangle=s[r(208)](e.bounds[0],e[r(231)][1],e[r(231)][2],e[r(231)][2])),e&&4326==e.proj&&(i[r(229)]=new p({ellipsoid:y.WGS84})),e&&e.maxzoom&&(i[r(213)]=e.maxzoom),e&&e[r(221)]&&(i.minimumLevel=e[r(221)]),e&&e.tilesize&&(i[r(215)]=i[r(233)]=e[r(226)]),i})),c=new d(a),h=new f(c,{});return r&&(h[t(230)]=r),this[t(228)][t(241)][t(223)](h),this[t(228)].scene.requestRender(),h}async[z(212)](e){const t=z;e instanceof f&&(this[t(228)][t(241)][t(212)](e,!0),this[t(228)].scene[t(211)]())}[z(238)](e,t){const n=z;if(t instanceof f)if(t.ready){const e=t[n(216)]();this._viewer.scene[n(244)][n(224)]({destination:e})}else t[n(236)].addEventListener((e=>{const s=n,r=t[s(216)]();this[s(228)][s(214)][s(244)].flyTo({destination:r})}))}show(e,t){const n=z;e instanceof f&&(e[n(227)]=t,this[n(228)].scene.requestRender())}}const j=K;function F(){const e=["primitiveCollection","48sZYIYg","12313GWBsau","3869118JuNrbJ","the url is needed","remove","load","show","51ymplXb","primitives","scene","the layer type is not 'GEOJSON'","70946JcfznP","flyTo","6mDrIev","1288MgJNZF","1026610KxXKgV","40732rOYhuM","requestRender","13960fphuex","locate","672966OmmWOI","_viewer"];return(F=function(){return e})()}function K(e,t){const n=F();return(K=function(e,t){return n[e-=281]})(e,t)}!function(e,t){const n=K,s=F();for(;;)try{if(162311===-parseInt(n(288))/1*(-parseInt(n(290))/2)+-parseInt(n(284))/3*(-parseInt(n(293))/4)+parseInt(n(295))/5*(parseInt(n(300))/6)+parseInt(n(301))/7*(parseInt(n(291))/8)+-parseInt(n(297))/9+-parseInt(n(292))/10+-parseInt(n(302))/11)break;s.push(s.shift())}catch(e){s.push(s.shift())}}();class B{constructor(e){this[K(298)]=e}async load(e){const t=K;if("GEOJSON"!==(e=e??{}).type)throw new Error(t(287));const{url:n,clampToGround:s}=e;if(!n)throw new Error(t(303));const r=new E({options:{useGroundGeometry:s??!1,clampToGround:s??!1,scene:this[t(298)][t(286)]}});return await r[t(282)](n),this[t(298)][t(286)].primitives.add(r[t(299)]),this[t(298)][t(286)][t(294)](),r}async remove(e){const t=K;e instanceof E&&(this[t(298)][t(286)][t(285)][t(281)](e[t(299)]),this._viewer[t(286)][t(294)]())}[j(296)](e,t){const n=j;t instanceof E&&t[n(289)](this[n(298)],{tolerance:.015})}[j(283)](e,t){const n=j;e instanceof E&&(e.primitiveCollection.show=t,this[n(298)][n(286)][n(294)]())}}const Y=H;function H(e,t){const n=V();return(H=function(e,t){return n[e-=267]})(e,t)}!function(e,t){const n=H,s=V();for(;;)try{if(170990===-parseInt(n(271))/1*(-parseInt(n(269))/2)+-parseInt(n(280))/3+-parseInt(n(285))/4*(parseInt(n(276))/5)+parseInt(n(294))/6+-parseInt(n(270))/7*(parseInt(n(274))/8)+-parseInt(n(279))/9*(-parseInt(n(275))/10)+parseInt(n(281))/11*(parseInt(n(268))/12))break;s.push(s.shift())}catch(e){s.push(s.shift())}}();class Q{constructor(e){this._viewer=e}async load(e){const t=H;if((e=e??{})[t(291)]!==t(293))throw new Error(t(289));const{url:n,layers:s}=e;if(!n)throw new Error(t(283));if(!s)throw new Error(t(290));const r=new m(e),i=new f(r,{});return this[t(295)][t(292)].add(i),this[t(295)][t(272)][t(273)](),i}async[Y(278)](e){const t=Y;e instanceof f&&(this[t(295)][t(292)][t(278)](e,!0),this._viewer.scene[t(273)]())}[Y(267)](e,t){const n=Y;if(t instanceof f)if(t.ready){const e=t[n(286)]();this._viewer.scene[n(287)].flyTo({destination:e})}else t[n(277)][n(284)]((e=>{const s=n,r=t[s(286)]();this[s(295)][s(272)][s(287)][s(288)]({destination:r})}))}[Y(282)](e,t){const n=Y;e instanceof f&&(e.show=t,this[n(295)][n(272)][n(273)]())}}function V(){const e=["type","imageryLayers","WMS","716190ngEgQj","_viewer","locate","1164oUQYmS","6884lNzZXC","1632554kSlMqn","19rZSvDx","scene","requestRender","8jpgrSu","930fmfnzw","10EaxbeI","readyEvent","remove","16434FpGwzj","699642UPlOwK","48345nUhOWJ","show","the url is needed","addEventListener","286940lRCfSf","getImageryRectangle","camera","flyTo","the layer type is not 'WMS'","the layers is needed"];return(V=function(){return e})()}const J=X;!function(e,t){const n=X,s=$();for(;;)try{if(419469===-parseInt(n(463))/1+parseInt(n(481))/2*(-parseInt(n(478))/3)+-parseInt(n(464))/4+parseInt(n(489))/5*(-parseInt(n(488))/6)+parseInt(n(469))/7*(-parseInt(n(466))/8)+-parseInt(n(479))/9+-parseInt(n(484))/10*(-parseInt(n(467))/11))break;s.push(s.shift())}catch(e){s.push(s.shift())}}();class Z{constructor(e){this[X(471)]=e}async[J(465)](e){const t=J;if("WMTS"!==(e=e??{})[t(462)])throw new Error(t(492));const{url:n,layer:s,style:r,tileMatrixSetID:i,subdomains:o,format:a,tilingScheme:c,tileMatrixLabels:h}=e;if(!n)throw new Error("the url is needed");if(!s)throw new Error(t(472));if(!r)throw new Error("the style is needed");if(!i)throw new Error(t(474));const l={url:n,layer:s,style:r,tileMatrixSetID:i};o&&(l.subdomains=o),a&&(l.format=a),c&&(l[t(476)]=c),h&&(l.tileMatrixLabels=h);const u=new I(l),p=new f(u,{});return this._viewer.imageryLayers[t(468)](p),this[t(471)][t(485)].requestRender(),p}async[J(470)](e){const t=J;e instanceof f&&(this[t(471)][t(491)][t(470)](e,!0),this[t(471)][t(485)][t(487)]())}[J(486)](e,t){const n=J;if(t instanceof f)if(t[n(482)]){const e=t[n(475)]();this[n(471)][n(485)][n(490)][n(480)]({destination:e})}else t[n(483)][n(477)]((e=>{const s=n,r=t[s(475)]();this[s(471)].scene[s(490)][s(480)]({destination:r})}))}[J(473)](e,t){const n=J;e instanceof f&&(e.show=t,this[n(471)][n(485)][n(487)]())}}function X(e,t){const n=$();return(X=function(e,t){return n[e-=462]})(e,t)}function $(){const e=["32940YrYVhW","scene","locate","requestRender","6vZyUnV","2477015zPEfVb","camera","imageryLayers","the layer type is not 'WMTS'","type","314737EZyRHO","2572564ndObXT","load","6002600kqtwoO","12210BcCGIM","add","7ykkKWZ","remove","_viewer","the layer is needed","show","the tileMatrixSetID is needed","getImageryRectangle","tilingScheme","addEventListener","30eOWPzs","3739095MIKMKo","flyTo","123562jVcTQe","ready","readyEvent"];return($=function(){return e})()}function ee(e,t){const n=se();return(ee=function(e,t){return n[e-=181]})(e,t)}const te=ee;!function(e,t){const n=ee,s=se();for(;;)try{if(580554===parseInt(n(196))/1+-parseInt(n(185))/2+parseInt(n(187))/3*(parseInt(n(200))/4)+parseInt(n(195))/5+parseInt(n(189))/6+parseInt(n(197))/7+-parseInt(n(203))/8)break;s.push(s.shift())}catch(e){s.push(s.shift())}}();class ne{constructor(e){this[ee(188)]=e}async[te(199)](e){const t=te,n=(e=e??{}).type;if(n!==t(193)&&n!==t(186))throw new Error(t(194));const{url:s,clampToGround:r}=e;if(!s)throw new Error(t(192));return this[t(188)][t(201)][t(183)](g.load(s,{camera:this._viewer[t(184)].camera,canvas:this[t(188)][t(184)][t(191)],clampToGround:r??!1}))}async remove(e){const t=te;(null==e?void 0:e.then)&&e[t(204)]((e=>{const n=t;this._viewer[n(201)].remove(e),this._viewer[n(184)][n(202)]()})),e instanceof g&&(this[t(188)][t(201)][t(190)](e),this[t(188)][t(184)][t(202)]())}[te(181)](e,t){const n=te;(null==t?void 0:t.then)&&t[n(204)]((e=>{this[n(188)].flyTo(e)})),t instanceof g&&this._viewer[n(198)](t)}[te(182)](e,t){const n=te;(null==e?void 0:e[n(204)])&&e[n(204)]((e=>{const s=n;e.show=t,this[s(188)][s(184)][s(202)]()})),e instanceof g&&(e.show=t,this[n(188)][n(184)][n(202)]())}}function se(){const e=["requestRender","20196760lOQOmC","then","locate","show","add","scene","49958Lfxgqn","KMZ","3cdvPpq","_viewer","5245086YvfDcY","remove","canvas","the url is needed","KML","the layer type is not 'KML' or 'KMZ","1374760DsUera","912081YbfzGC","6804749UasFGV","flyTo","load","387228CjIDqc","dataSources"];return(se=function(){return e})()}const re=ae;!function(e,t){const n=ae,s=oe();for(;;)try{if(633425===parseInt(n(451))/1+-parseInt(n(468))/2*(parseInt(n(452))/3)+-parseInt(n(480))/4+-parseInt(n(431))/5+-parseInt(n(446))/6+-parseInt(n(460))/7+-parseInt(n(481))/8*(-parseInt(n(483))/9))break;s.push(s.shift())}catch(e){s.push(s.shift())}}();const ie=class{constructor(e){this[ae(448)]=e}async[re(440)](e){const t=re,{type:n,url:s,layer:r,tileMatrixSetID:i,style:o="default",format:a="image/png"}=e;if("SUPERMAP_WMTS"!==n)throw new Error(t(482));if(!s||!r||!i)throw new Error("url / layer / tileMatrixSetID is required");this[t(462)]={...e};const c=new f(this[t(439)](e));return Object[t(449)](c,t(465),{value:t(447),enumerable:!1}),this[t(445)]=c,this._viewer.imageryLayers.add(c),this[t(448)][t(467)].requestRender(),c}refreshToken(e,t){const n=re;if(!(e.layer instanceof f))return;e[n(450)][n(474)]=t;const s=this._createProvider(e[n(450)]);e[n(429)][n(433)]=s,this[n(448)][n(467)].requestRender()}_createProvider(e){const t=re,{url:n,layer:s,tileMatrixSetID:r,style:i="default",format:o="image/png",token:a}=e;if(!n||!s||!r)throw new Error("url / layer / tileMatrixSetID is required");const c=a?n+t(466)+a:n,h=r[t(436)](t(476))?new p:new v,l=Array.from({length:22},((e,n)=>n[t(478)]()));return new I({url:c,layer:s,style:i,format:o,tileMatrixSetID:r,tileMatrixLabels:l,tilingScheme:h})}async locate(e,t){const n=re;if(!(t instanceof f))return;const s=async()=>{const n=ae,s=await this[n(461)](e);if(s)return void this[n(448)][n(467)][n(437)][n(470)]({destination:s});const r=t.getImageryRectangle();r&&this[n(448)][n(467)][n(437)][n(470)]({destination:r})};t.ready?s():t[n(441)].addEventListener((()=>s()))}[re(444)](e){const t=re,{url:n,token:s}=e;return s?n+t(471)+s:n+t(458)}async[re(461)](e){const t=re,{layer:n}=e;if(!n)return;const r=this[t(444)](e)+"#"+n;if(ie[t(453)].has(r))return ie[t(453)][t(456)](r);if(ie[t(472)].has(r))return ie._extentPromiseCache[t(456)](r);const i=(async()=>{const i=t,o=this[i(444)](e),a=await fetch(o)[i(479)]((e=>e[i(442)]())),c=(new DOMParser)[i(434)](a,"text/xml"),h=Array[i(454)](c[i(464)](i(457)))[i(469)]((e=>{const t=i;var s,r;return((null==(s=e.getElementsByTagName("ows:Identifier")[0])?void 0:s.textContent)||(null==(r=e.getElementsByTagName("ows:Title")[0])?void 0:r[t(473)]))===n}));if(!h)return;const l=h[i(464)](i(430))[0];if(!l)return;const u=l.getElementsByTagName(i(432))[0][i(473)][i(475)](" "),f=l[i(464)](i(477))[0].textContent.split(" "),p=s[i(459)](Number(u[0]),Number(u[1]),Number(f[0]),Number(f[1]));return ie._extentCache[i(463)](r,p),ie[i(472)][i(435)](r),p})();return ie[t(472)][t(463)](r,i),i}remove(e){const t=re;e instanceof f&&(this[t(448)].imageryLayers[t(438)](e,!0),this._viewer.scene[t(443)]())}[re(455)](e,t){const n=re;e instanceof f&&(e[n(455)]=t,this[n(448)][n(467)][n(443)]())}};function oe(){const e=["ows:WGS84BoundingBox","4953790WWXTEl","ows:LowerCorner","_imageryProvider","parseFromString","delete","includes","camera","remove","_createProvider","load","readyEvent","text","requestRender","_getCapabilitiesUrl","_imageryLayer","5789094YozDkN","SUPERMAP_WMTS","_viewer","defineProperty","options","133274zveCNt","3IJPfwG","_extentCache","from","show","get","Layer","?SERVICE=WMTS&REQUEST=GetCapabilities","fromDegrees","1942962nBqgHi","_getLayerRectangle","_options","set","getElementsByTagName","__layerType","?token=","scene","2014756LbsTmE","find","flyTo","?SERVICE=WMTS&REQUEST=GetCapabilities&token=","_extentPromiseCache","textContent","token","split","4326","ows:UpperCorner","toString","then","3970720zHoMdD","12622352mZvyYK","the layer type is not 'SUPERMAP_WMTS'","27UryCRH","layer"];return(oe=function(){return e})()}function ae(e,t){const n=oe();return(ae=function(e,t){return n[e-=429]})(e,t)}let ce=ie;ce[re(453)]=new Map,ce._extentPromiseCache=new Map;const he=ue;function le(){const e=["_url","delete","_remove","1977220UxTpYN","_locate","61agyDpu","_show","remove","the layer with id '","99GLvdQW","WMTS","get","options","type","Mbtiles","_initLoader","url","bind","the type '","_id","_load","573Ylqmdm","17542STjIYm","_typeClass","GEOJSON","TERRAIN","3214400oLbKzW","_typeClassMap","loadAsync","3DTILES","_viewer","545424Dyifkp","WMS","582020qotQVl","' is not support","1606024zQoYzC","set","refreshToken","ARCGIS","_refreshToken","URLTemplate","_layersMap","_isSupport","SUPERMAP_WMTS","call","KML","showById","getById","load","_type","16444WBNecX","the url is needed","destroy"];return(le=function(){return e})()}function ue(e,t){const n=le();return(ue=function(e,t){return n[e-=252]})(e,t)}!function(e,t){const n=ue,s=le();for(;;)try{if(576412===parseInt(n(275))/1*(-parseInt(n(292))/2)+parseInt(n(291))/3*(parseInt(n(267))/4)+-parseInt(n(273))/5+-parseInt(n(301))/6+-parseInt(n(252))/7+parseInt(n(296))/8+parseInt(n(279))/9*(parseInt(n(303))/10))break;s.push(s.shift())}catch(e){s.push(s.shift())}}();class fe{constructor(e){const t=ue;if(!e)throw new Error("请输入Viewer对象!");this[t(300)]=e,this[t(258)]=new Map,this[t(297)]=new Map}[he(285)](){const e=he,t=this[e(297)][e(281)](this._type);t?this._typeClass=t:"TERRAIN"===this[e(266)]?this._typeClass=new S(this[e(300)]):this[e(266)]===e(299)?this[e(293)]=new C(this[e(300)]):this._type===e(255)?this[e(293)]=new N(this._viewer):this[e(266)]===e(257)?this[e(293)]=new k(this._viewer):this[e(266)]===e(284)?this[e(293)]=new A(this[e(300)]):this[e(266)]===e(302)?this[e(293)]=new Q(this._viewer):this[e(266)]===e(280)?this[e(293)]=new Z(this[e(300)]):this._type===e(262)?this[e(293)]=new ne(this[e(300)]):this[e(266)]===e(294)?this._typeClass=new B(this[e(300)]):this[e(266)]===e(260)&&(this._typeClass=new ce(this[e(300)]),this[e(256)]=this._typeClass[e(254)][e(287)](this[e(293)])),this._load=this._typeClass[e(265)][e(287)](this[e(293)]),this[e(272)]=this[e(293)][e(277)][e(287)](this._typeClass),this[e(274)]=this[e(293)].locate.bind(this[e(293)]),this[e(276)]=this[e(293)].show[e(287)](this[e(293)])}async[he(298)](e){const t=he;if(e=e??{},this._id=e.id,this._layersMap.has(this[t(289)]))throw new Error(t(278)+this._id+"' is already loaded");if(this._url=e[t(286)],!this[t(270)])throw new Error(t(268));if(this._type=e[t(283)],!this[t(259)](e[t(283)]))throw new Error(t(288)+e.type+t(304));if(this[t(285)](),"KML"===e[t(283)]){const n=this[t(290)](e);n instanceof Promise&&this[t(258)][t(253)](e.id,{options:e,layer:n})}else{const n=await this[t(290)](e);this[t(258)].set(e.id,{options:e,layer:n})}}[he(259)](e){const t=he;return[t(295),t(299),"ARCGIS",t(257),t(284),t(302),"WMTS","KML",t(294),t(260)].includes(e)}[he(264)](e){const t=he;return this[t(258)][t(281)](e)}removeById(e){const t=he,n=this[t(258)].get(e);if(this[t(258)][t(271)](e),!n)return;const{options:s,layer:r}=n;r&&(this._type=s[t(283)],this[t(285)](),this[t(272)](r))}locateById(e){const t=he,n=this[t(258)][t(281)](e);if(!n)return;const{options:s,layer:r}=n;r&&(this[t(266)]=s[t(283)],this[t(285)](),this[t(274)](s,r))}[he(263)](e,t){const n=he,s=this[n(258)][n(281)](e);if(!s)return;const{options:r,layer:i}=s;i&&(this[n(266)]=r[n(283)],this._initLoader(),this[n(276)](i,t))}[he(254)](e,t){const n=he;var s;const r=this[n(258)].get(e);r&&"SUPERMAP_WMTS"===r[n(282)].type&&(null==(s=this[n(256)])||s[n(261)](this,r,t))}[he(269)](){}}export{fe 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.1",
3
+ "version": "1.1.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",