@nsc-earth-2/layer 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
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 e,CesiumTerrainProvider as t,EllipsoidTerrainProvider as n,Rectangle as s,Cesium3DTileset as r,Matrix4 as i,Cartographic as o,Cartesian3 as a,Transforms as c,Matrix3 as h,Math as l,ArcGisMapServerImageryProvider as u,ImageryLayer as p,GeographicTilingScheme as f,Ellipsoid as d,UrlTemplateImageryProvider as y,WebMapServiceImageryProvider as w,WebMapTileServiceImageryProvider as m,KmlDataSource as I}from"cesium";import{GeoJsonPrimitiveLayer as v}from"@nsc-earth-2/primitive-geojson";const g=_;function _(e,t){const n=S();return(_=function(e,t){return n[e-=212]})(e,t)}!function(){const e=_,t=S();for(;;)try{if(954428===-parseInt(e(238))/1+-parseInt(e(224))/2*(-parseInt(e(244))/3)+parseInt(e(231))/4*(parseInt(e(241))/5)+parseInt(e(218))/6*(parseInt(e(233))/7)+-parseInt(e(229))/8*(parseInt(e(243))/9)+-parseInt(e(214))/10+-parseInt(e(239))/11*(parseInt(e(227))/12))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class E{constructor(e){this[_(232)]=e}[g(223)](n){const s=g;if((n=n??{}).type!==s(216))throw new Error("the layer type is not 'TERRAIN'");const r=n[s(234)],i=new e(t[s(226)](r));return this[s(232)][s(236)][s(222)](i),this[s(232)][s(236)][s(235)](),Promise[s(240)](i)}[g(217)](e){const t=g,s=new n;this._viewer[t(212)]=s,this._viewer.scene.requestRender()}[g(221)](e,t){const n=g,r=(e=e??{}).url;fetch(r+n(225))[n(219)](e=>e[n(220)]()).then(e=>{const t=n;e[t(213)]&&Array.isArray(e[t(213)])&&4===e[t(213)][t(230)]?this[t(232)].camera[t(242)]({destination:s.fromDegrees(e[t(213)][0],e.valid_bounds[1],e[t(213)][2],e[t(213)][3])}):e[t(237)]&&Array[t(215)](e[t(237)])&&4==e[t(237)][t(230)]&&this._viewer[t(228)][t(242)]({destination:s.fromDegrees(e[t(237)][0],e[t(237)][1],e[t(237)][2],e.bounds[3])})})}show(t,s){const r=g;if(t instanceof e){if(s)this[r(232)][r(236)][r(222)](t);else{const e=new n;this._viewer[r(212)]=e}this._viewer[r(236)][r(235)]()}}}function S(){const e=["11WNQRiI","resolve","45JioSBb","flyTo","2430VUtDOe","10866VvTvsR","terrainProvider","valid_bounds","15337610cjkjTe","isArray","TERRAIN","remove","9755628HvwFhm","then","json","locate","setTerrain","load","382NkqxHg","/layer.json","fromUrl","2228196DXeGUC","camera","48hVbmHl","length","326252vKuihr","_viewer","7ioGFhD","url","requestRender","scene","bounds","376315jklImz"];return(S=function(){return e})()}function R(){const e=["azimuth","eastNorthUpToFixedFrame","3DTILES","longitude","toRadians","flyTo","latitude","fromDegrees","3345260RAYSVR","fromRotationZ","scene","266018UuFsOi","1775634pQGzhK","root","transferTileSet","primitives","55515hoiZUP","getHeight","remove","6481521JrXbId","type","the layer type is not '3DTILES'","fromCartesian","transform","4249JcupAc","show","locate","load","_viewer","9728LbubDV","multiply","altitude","1698804tYkbJx","add","requestRender","multiplyByMatrix3","fromUrl","116uXFjiq"];return(R=function(){return e})()}const M=b;function b(e,t){const n=R();return(b=function(e,t){return n[e-=214]})(e,t)}!function(){const e=b,t=R();for(;;)try{if(453129===-parseInt(e(224))/1+parseInt(e(225))/2+parseInt(e(229))/3*(-parseInt(e(250))/4)+parseInt(e(221))/5+-parseInt(e(245))/6+parseInt(e(237))/7*(-parseInt(e(242))/8)+parseInt(e(232))/9)break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class L{constructor(e){this[b(241)]=e}async[M(240)](e){const t=M;if((e=e??{})[t(233)]!==t(215))throw new Error(t(234));const n=e.url;if(!n)throw new Error("the url is needed");const s={longitude:e[t(216)]??0,latitude:e.latitude??0,altitude:e[t(244)]??0,azimuth:e[t(251)]??0},i=await r[t(249)](n,{dynamicScreenSpaceError:!0,dynamicScreenSpaceErrorDensity:.00278,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceErrorHeightFalloff:.25});return this[t(227)](i,s),this[t(241)].scene.primitives[t(246)](i),this[t(241)][t(223)].requestRender(),i}[M(227)](e,t){const n=M,{longitude:s,latitude:r,altitude:u,azimuth:p}=t;let f=new i;if(s&&r){let e=u;0==u&&(e=this[n(241)][n(223)].globe[n(230)](o[n(220)](s,r))||0);const t=a.fromDegrees(s,r,e),d=c[n(214)](t),y=new h(1,0,0,0,1,0,0,0,1),w=h[n(222)](l[n(217)](p));h[n(243)](y,w,y),f=i[n(248)](d,y,new i)}else if(u){const t=new a;i.getTranslation(e[n(226)][n(236)],t);const s=o[n(235)](t);if(s){const e=l.toDegrees(s[n(219)]),t=l.toDegrees(s.longitude),r=a[n(220)](t,e,u),o=c[n(214)](r),d=new h(1,0,0,0,1,0,0,0,1),y=h[n(222)](l.toRadians(p));h[n(243)](d,y,d),f=i[n(248)](o,d,new i)}}else if(p){const t=new h(1,0,0,0,1,0,0,0,1),s=h[n(222)](l[n(217)](p));h[n(243)](t,s,t),f=i[n(248)](e[n(226)][n(236)],t,new i)}else f=e[n(226)][n(236)];e[n(226)][n(236)]=f}[M(231)](e){const t=M;e instanceof r&&(this._viewer[t(223)][t(228)][t(231)](e),this[t(241)][t(223)][t(247)]())}[M(239)](e,t){const n=M;t instanceof r&&this[n(241)][n(218)](t)}[M(238)](e,t){const n=M;e instanceof r&&(e[n(238)]=t,this[n(241)][n(223)].requestRender())}}const T=x;function x(e,t){const n=C();return(x=function(e,t){return n[e-=123]})(e,t)}!function(){const e=x,t=C();for(;;)try{if(619768===-parseInt(e(129))/1+parseInt(e(128))/2*(parseInt(e(144))/3)+parseInt(e(148))/4*(parseInt(e(153))/5)+parseInt(e(134))/6*(-parseInt(e(124))/7)+-parseInt(e(141))/8*(-parseInt(e(125))/9)+-parseInt(e(126))/10*(parseInt(e(139))/11)+parseInt(e(133))/12)break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class D{constructor(e){this._viewer=e}async[T(123)](e){const t=T;if("ARCGIS"!==(e=e??{}).type)throw new Error("the layer type is not 'ARCGIS'");const{url:n,alpha:r,token:i}=e;if(!n)throw new Error(t(149));let o=n;o=i?n+t(138)+i:n+"/info/iteminfo?f=pjson";const a=await fetch(o,{method:t(132)}).then(e=>e[t(131)]())[t(154)](e=>{const n=t,r={};return i&&(r.token=i),e&&e[n(135)]&&Array[n(130)](e[n(135)])&&(r.rectangle=s[n(142)](e[n(135)][0][0],e[n(135)][0][1],e[n(135)][1][0],e.extent[1][1])),r}),c=u.fromUrl(n,a),h=p[t(146)](c,{});return r&&(h.alpha=r),this[t(145)][t(140)].add(h),this[t(145)][t(152)][t(143)](),h}async[T(137)](e){const t=T;e instanceof p&&(this._viewer[t(140)][t(137)](e,!0),this._viewer.scene[t(143)]())}locate(e,t){const n=T;if(t instanceof p)if(t.ready){const e=t.getImageryRectangle();this[n(145)][n(152)][n(150)][n(151)]({destination:e})}else t[n(136)][n(127)](e=>{const s=n,r=t.getImageryRectangle();this[s(145)].scene[s(150)][s(151)]({destination:r})})}show(e,t){const n=T;e instanceof p&&(e[n(147)]=t,this[n(145)][n(152)].requestRender())}}function C(){const e=["fromProviderAsync","show","88Ziraci","the url is needed","camera","flyTo","scene","77950mAVjTQ","then","load","7883799dSbqtw","90YdcGhn","3723680Nizgic","addEventListener","430564PlJSmQ","478004hQXUUI","isArray","json","GET","17065620aNAJuu","6UhvmMu","extent","readyEvent","remove","/info/iteminfo?f=pjson&token=","22KYCwWx","imageryLayers","101792AafNcE","fromDegrees","requestRender","15YGJFdg","_viewer"];return(C=function(){return e})()}const A=U;function G(){const e=["meta.json fetch failed:","the layer type is not 'URLTemplate'","11dKOqLl","2461065aPIqZG","rectangle","tileWidth","GET","1029pOpUDc","load","locate","camera","8585400YcIEEj","tilesize","ready","alpha","getImageryRectangle","south","4mkGsod","minimumLevel","json","_viewer","10IxbupD","5290704xJjmdN","add","maxzoom","readyEvent","30xzWhrv","fromDegrees","bounds","84397GFchxl","2396250BeUoKF","minzoom","the url is needed","tilingScheme","requestRender","12CTVxpg","imageryLayers","URLTemplate","proj","scene","meta.json","indexOf","flyTo","remove","1371699eNXMLr","north","show","west","WGS84"];return(G=function(){return e})()}function U(e,t){const n=G();return(U=function(e,t){return n[e-=429]})(e,t)}!function(){const e=U,t=G();for(;;)try{if(568441===-parseInt(e(442))/1*(parseInt(e(448))/2)+parseInt(e(457))/3+-parseInt(e(430))/4*(parseInt(e(465))/5)+-parseInt(e(439))/6*(parseInt(e(469))/7)+parseInt(e(435))/8+-parseInt(e(443))/9*(parseInt(e(434))/10)+parseInt(e(464))/11*(parseInt(e(473))/12))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class q{constructor(e){this[U(433)]=e}async[A(470)](e){const t=A;if((e=e??{}).type!==t(450))throw new Error(t(463));const{url:n,alpha:r}=e;if(!n)throw new Error(t(445));const i="{z}/{x}/{y}.png",o=n.includes(i)?n.substring(0,n[t(454)](i))+t(453):null,a=o?await async function(e){const t=U;try{const n=await fetch(e,{method:t(468)});return n.ok?await n[t(432)]():null}catch(n){return console.warn(t(462),e),null}}(o):null,c={url:n};(null==a?void 0:a.bounds)&&(c[t(466)]=s[t(440)](a[t(441)][t(460)],a[t(441)][t(429)],a[t(441)].east,a[t(441)][t(458)])),4326===(null==a?void 0:a[t(451)])&&(c[t(446)]=new f({ellipsoid:d[t(461)]})),null!=(null==a?void 0:a[t(437)])&&(c.maximumLevel=a[t(437)]),null!=(null==a?void 0:a[t(444)])&&(c[t(431)]=a[t(444)]),(null==a?void 0:a.tilesize)&&(c[t(467)]=c.tileHeight=a[t(474)]);const h=new y(c),l=new p(h,{});return r&&(l[t(476)]=r),this[t(433)][t(449)][t(436)](l),this._viewer[t(452)].requestRender(),l}async[A(456)](e){const t=A;e instanceof p&&(this[t(433)][t(449)][t(456)](e,!0),this[t(433)].scene[t(447)]())}[A(471)](e,t){const n=A;if(t instanceof p)if(t[n(475)]){const e=t[n(477)]();this[n(433)][n(452)][n(472)][n(455)]({destination:e})}else t[n(438)].addEventListener(e=>{const s=n,r=t[s(477)]();this._viewer[s(452)][s(472)][s(455)]({destination:r})})}[A(459)](e,t){const n=A;e instanceof p&&(e[n(459)]=t,this[n(433)][n(452)][n(447)]())}}function k(e,t){const n=P();return(k=function(e,t){return n[e-=263]})(e,t)}const z=k;function P(){const e=["232875nKleqc","bounds","readyEvent","add","/{z}/{x}/{y}.png","10921624NHhFQS","camera","substr","_viewer","show","the layer type is not 'Mbtiles'","type","10025099BhdwEn","minimumLevel","indexOf","1215540sFIZLc","ready","minzoom","2YPCxmG","remove","the url is needed","tileWidth","1915659obBIQS","scene","fromDegrees","load","requestRender","getImageryRectangle","rectangle","5545HmEeEd","GET",".json","locate","imageryLayers","maxzoom","3832cNCDCi","flyTo","4478589MAnDld","tilesize","310hDZmcF","alpha"];return(P=function(){return e})()}!function(){const e=k,t=P();for(;;)try{if(810271===-parseInt(e(290))/1+parseInt(e(267))/2*(-parseInt(e(286))/3)+parseInt(e(284))/4*(-parseInt(e(278))/5)+-parseInt(e(264))/6+-parseInt(e(302))/7+-parseInt(e(295))/8+parseInt(e(271))/9*(parseInt(e(288))/10))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class N{constructor(e){this[k(298)]=e}async[z(274)](e){const t=z;e=defaultValue(e,{});if("Mbtiles"!==defaultValue(e[t(301)],void 0))throw new Error(t(300));const{url:n,alpha:r}=e;if(!n)throw new Error(t(269));let i=t(294),o=n[t(297)](0,n[t(263)](i))+t(280);const a=await fetch(o,{method:t(279)}).then(e=>e.json()).then(e=>{const r=t,i={url:n};return e&&e[r(291)]&&(i[r(277)]=s[r(273)](e.bounds[0],e[r(291)][1],e.bounds[2],e[r(291)][2])),e&&4326==e.proj&&(i.tilingScheme=new f({ellipsoid:d.WGS84})),e&&e[r(283)]&&(i.maximumLevel=e.maxzoom),e&&e[r(266)]&&(i[r(303)]=e[r(266)]),e&&e.tilesize&&(i[r(270)]=i.tileHeight=e[r(287)]),i}),c=new y(a),h=new p(c,{});return r&&(h[t(289)]=r),this[t(298)][t(282)][t(293)](h),this[t(298)].scene[t(275)](),h}async[z(268)](e){const t=z;e instanceof p&&(this[t(298)][t(282)].remove(e,!0),this._viewer[t(272)].requestRender())}[z(281)](e,t){const n=z;if(t instanceof p)if(t[n(265)]){const e=t[n(276)]();this[n(298)].scene[n(296)][n(285)]({destination:e})}else t[n(292)].addEventListener(e=>{const s=n,r=t[s(276)]();this._viewer[s(272)].camera[s(285)]({destination:r})})}[z(299)](e,t){const n=z;e instanceof p&&(e.show=t,this[n(298)][n(272)][n(275)]())}}function W(){const e=["the layer type is not 'GEOJSON'","10NEWDcM","type","3356397wsePWh","_viewer","10mJUmbc","143664KHKqQz","flyTo","remove","show","4752sVnePr","777zNwWil","load","requestRender","248040SAfIxC","primitiveCollection","1178382RNHzlk","scene","primitives","GEOJSON","7496mgmBEI","577295nAZEty","locate"];return(W=function(){return e})()}const J=F;!function(){const e=F,t=W();for(;;)try{if(131614===-parseInt(e(214))/1+parseInt(e(232))/2*(parseInt(e(233))/3)+parseInt(e(218))/4+parseInt(e(225))/5+parseInt(e(220))/6+-parseInt(e(215))/7*(parseInt(e(224))/8)+parseInt(e(230))/9*(-parseInt(e(228))/10))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class j{constructor(e){this[F(231)]=e}async load(e){const t=F;if((e=e??{})[t(229)]!==t(223))throw new Error(t(227));const{url:n,clampToGround:s}=e;if(!n)throw new Error("the url is needed");const r=new v({options:{useGroundGeometry:s??!1,clampToGround:s??!1,scene:this[t(231)][t(221)]}});return await r[t(216)](n),this._viewer[t(221)][t(222)].add(r.primitiveCollection),this._viewer.scene[t(217)](),r}async[J(235)](e){const t=J;e instanceof v&&(this[t(231)][t(221)].primitives.remove(e[t(219)]),this[t(231)].scene.requestRender())}[J(226)](e,t){const n=J;t instanceof v&&t[n(234)](this[n(231)],{tolerance:.015})}[J(236)](e,t){const n=J;e instanceof v&&(e[n(219)][n(236)]=t,this[n(231)][n(221)].requestRender())}}function F(e,t){const n=W();return(F=function(e,t){return n[e-=214]})(e,t)}const V=B;!function(){const e=B,t=Q();for(;;)try{if(435831===-parseInt(e(181))/1*(parseInt(e(189))/2)+-parseInt(e(165))/3*(-parseInt(e(173))/4)+-parseInt(e(187))/5*(-parseInt(e(190))/6)+-parseInt(e(177))/7+parseInt(e(183))/8*(-parseInt(e(171))/9)+-parseInt(e(193))/10*(parseInt(e(176))/11)+parseInt(e(188))/12*(parseInt(e(172))/13))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class K{constructor(e){this._viewer=e}async[V(170)](e){const t=V;if((e=e??{})[t(168)]!==t(164))throw new Error(t(184));const{url:n,layers:s}=e;if(!n)throw new Error(t(192));if(!s)throw new Error(t(191));const r=new w(e),i=new p(r,{});return this._viewer[t(178)][t(166)](i),this[t(179)][t(175)].requestRender(),i}async[V(182)](e){const t=V;e instanceof p&&(this[t(179)][t(178)].remove(e,!0),this[t(179)].scene[t(169)]())}locate(e,t){const n=V;if(t instanceof p)if(t.ready){const e=t[n(185)]();this[n(179)][n(175)][n(167)][n(174)]({destination:e})}else t[n(180)].addEventListener(e=>{const s=n,r=t[s(185)]();this[s(179)][s(175)][s(167)].flyTo({destination:r})})}[V(186)](e,t){const n=V;e instanceof p&&(e.show=t,this[n(179)].scene[n(169)]())}}function B(e,t){const n=Q();return(B=function(e,t){return n[e-=164]})(e,t)}function Q(){const e=["the layer type is not 'WMS'","getImageryRectangle","show","3719005zyHZxy","42888JkGZHa","2qdDglP","6KIAtML","the layers is needed","the url is needed","759180zUAEmV","WMS","6pKuLfl","add","camera","type","requestRender","load","68535tUJtgo","4771SuJpEy","986188FfeIWc","flyTo","scene","22SKrQPb","5785969qumDaD","imageryLayers","_viewer","readyEvent","365204DXowtv","remove","808wJfZfv"];return(Q=function(){return e})()}const H=O;function O(e,t){const n=Y();return(O=function(e,t){return n[e-=363]})(e,t)}!function(){const e=O,t=Y();for(;;)try{if(690120===parseInt(e(368))/1+parseInt(e(364))/2+parseInt(e(373))/3+parseInt(e(383))/4*(parseInt(e(367))/5)+parseInt(e(376))/6+parseInt(e(374))/7+parseInt(e(371))/8*(-parseInt(e(366))/9))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class Z{constructor(e){this[O(380)]=e}async load(e){const t=O;if((e=e??{})[t(363)]!==t(390))throw new Error(t(385));const{url:n,layer:s,style:r,tileMatrixSetID:i,subdomains:o,format:a,tilingScheme:c,tileMatrixLabels:h,maximumLevel:l}=e;if(!n)throw new Error(t(393));if(!s)throw new Error(t(394));if(!r)throw new Error("the style is needed");if(!i)throw new Error(t(382));const u={url:n,layer:s,style:r,tileMatrixSetID:i,maximumLevel:l};o&&(u[t(381)]=o),a&&(u[t(365)]=a),c&&(u[t(386)]=c),h&&(u[t(395)]=h),l&&(u[t(372)]=l);const f=new m(u),d=new p(f,{});return this._viewer[t(388)][t(375)](d),this._viewer.scene[t(387)](),d}async remove(e){const t=O;e instanceof p&&(this[t(380)][t(388)][t(370)](e,!0),this[t(380)].scene.requestRender())}[H(392)](e,t){const n=H;if(t instanceof p)if(t[n(389)]){const e=t[n(379)]();this[n(380)].scene[n(369)][n(391)]({destination:e})}else t[n(378)][n(377)](e=>{const s=n,r=t.getImageryRectangle();this._viewer.scene.camera[s(391)]({destination:r})})}[H(384)](e,t){const n=H;e instanceof p&&(e.show=t,this[n(380)].scene[n(387)]())}}function Y(){const e=["imageryLayers","ready","WMTS","flyTo","locate","the url is needed","the layer is needed","tileMatrixLabels","type","1071302jQcYrl","format","6696747YDJJKX","9770QlFLDu","256250BnCuLG","camera","remove","24LPbMct","maximumLevel","2029557DoMmJs","3504977waUfGu","add","4582200LPLNiy","addEventListener","readyEvent","getImageryRectangle","_viewer","subdomains","the tileMatrixSetID is needed","388peMwwh","show","the layer type is not 'WMTS'","tilingScheme","requestRender"];return(Y=function(){return e})()}const X=ee;function $(){const e=["flyTo","14ECfyRE","397686lvtXzv","scene","1276050gOecJv","remove","30uCKvMZ","canvas","KMZ","load","105272eLxTya","then","_viewer","15027dFrhoK","requestRender","the url is needed","show","add","1368414zreZtT","224qVJWjf","79612avgfbY","dataSources","locate","10515bpLGox"];return($=function(){return e})()}function ee(e,t){const n=$();return(ee=function(e,t){return n[e-=129]})(e,t)}!function(){const e=ee,t=$();for(;;)try{if(180487===-parseInt(e(138))/1+parseInt(e(144))/2+-parseInt(e(131))/3*(-parseInt(e(137))/4)+-parseInt(e(141))/5+parseInt(e(146))/6+-parseInt(e(143))/7*(-parseInt(e(152))/8)+parseInt(e(136))/9*(-parseInt(e(148))/10))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class te{constructor(e){this[ee(130)]=e}async[X(151)](e){const t=X,n=(e=e??{}).type;if("KML"!==n&&n!==t(150))throw new Error("the layer type is not 'KML' or 'KMZ");const{url:s,clampToGround:r}=e;if(!s)throw new Error(t(133));return this._viewer[t(139)][t(135)](I.load(s,{camera:this[t(130)].scene.camera,canvas:this[t(130)][t(145)][t(149)],clampToGround:r??!1}))}async[X(147)](e){const t=X;(null==e?void 0:e[t(129)])&&e.then(e=>{const n=t;this._viewer[n(139)][n(147)](e),this[n(130)][n(145)][n(132)]()}),e instanceof I&&(this[t(130)][t(139)][t(147)](e),this[t(130)][t(145)][t(132)]())}[X(140)](e,t){const n=X;(null==t?void 0:t[n(129)])&&t[n(129)](e=>{const t=n;this[t(130)][t(142)](e)}),t instanceof I&&this._viewer[n(142)](t)}[X(134)](e,t){const n=X;(null==e?void 0:e[n(129)])&&e[n(129)](e=>{const s=n;e[s(134)]=t,this[s(130)].scene[s(132)]()}),e instanceof I&&(e[n(134)]=t,this[n(130)].scene.requestRender())}}function ne(){const e=["478458AprCxu","_getLayerRectangle","from","imageryLayers","requestRender","the layer type is not 'SUPERMAP_WMTS'","214356FcBCDJ","Layer","1079FWVehR","load","scene","addEventListener","7310JaBVdE","_extentPromiseCache","_imageryProvider","toString","defineProperty","text/xml","7AQvLVe","ows:Identifier","1793urbJCG","refreshToken","43060WXMwtL","readyEvent","token","40671izrhbI","ows:WGS84BoundingBox","56904hvrdtA","ows:Title","split","url / layer / tileMatrixSetID is required","__layerType","?token=","fromDegrees","1165715kzNARV","find","getImageryRectangle","getElementsByTagName","get","locate","_getCapabilitiesUrl","delete","SUPERMAP_WMTS","flyTo","3IVacIQ","camera","has","default","_createProvider","options","layer","set","add","image/png","_extentCache","parseFromString","textContent","_viewer","4UMGIxg","ready","ows:LowerCorner","8iHQzDo","_options"];return(ne=function(){return e})()}const se=re;function re(e,t){const n=ne();return(re=function(e,t){return n[e-=268]})(e,t)}!function(){const e=re,t=ne();for(;;)try{if(140254===parseInt(e(320))/1+-parseInt(e(304))/2*(parseInt(e(279))/3)+-parseInt(e(293))/4*(parseInt(e(269))/5)+-parseInt(e(298))/6*(parseInt(e(316))/7)+parseInt(e(296))/8*(parseInt(e(323))/9)+parseInt(e(310))/10*(parseInt(e(318))/11)+parseInt(e(325))/12*(parseInt(e(306))/13))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();const ie=class{constructor(e){this._viewer=e}async[se(307)](e){const t=se,{type:n,url:s,layer:r,tileMatrixSetID:i,style:o=t(282),format:a=t(288)}=e;if("SUPERMAP_WMTS"!==n)throw new Error(t(303));if(!s||!r||!i)throw new Error(t(328));this[t(297)]={...e};const c=new p(this[t(283)](e));return Object[t(314)](c,t(329),{value:t(277),enumerable:!1}),this._imageryLayer=c,this[t(292)][t(301)][t(287)](c),this[t(292)].scene[t(302)](),c}[se(319)](e,t){const n=se;if(!(e[n(285)]instanceof p))return;e[n(284)][n(322)]=t;const s=this[n(283)](e.options);e[n(285)][n(312)]=s,this[n(292)][n(308)][n(302)]()}[se(283)](e){const t=se,{url:n,layer:s,tileMatrixSetID:r,style:i=t(282),format:o=t(288),token:a,maximumLevel:c,tilingScheme:h}=e;if(!n||!s||!r)throw new Error(t(328));const l=a?n+t(330)+a:n,u=Array[t(300)]({length:22},(e,n)=>n[t(313)]());return new m({...e,url:l,layer:s,style:i,format:o,tileMatrixSetID:r,tileMatrixLabels:u,tilingScheme:h,maximumLevel:c})}async[se(274)](e,t){const n=se;if(!(t instanceof p))return;const s=async()=>{const n=re,s=await this[n(299)](e);if(s)return void this._viewer.scene[n(280)][n(278)]({destination:s});const r=t[n(271)]();r&&this[n(292)][n(308)].camera[n(278)]({destination:r})};t[n(294)]?s():t[n(321)][n(309)](()=>s())}[se(275)](e){const{url:t,token:n}=e;return n?t+"?SERVICE=WMTS&REQUEST=GetCapabilities&token="+n:t+"?SERVICE=WMTS&REQUEST=GetCapabilities"}async _getLayerRectangle(e){const t=se,{layer:n}=e;if(!n)return;const r=this[t(275)](e)+"#"+n;if(ie[t(289)].has(r))return ie[t(289)][t(273)](r);if(ie[t(311)][t(281)](r))return ie[t(311)].get(r);const i=(async()=>{const i=t,o=this[i(275)](e),a=await fetch(o).then(e=>e.text()),c=(new DOMParser)[i(290)](a,i(315)),h=Array.from(c[i(272)](i(305)))[i(270)](e=>{const t=i;var s,r;return((null==(s=e[t(272)](t(317))[0])?void 0:s.textContent)||(null==(r=e[t(272)](t(326))[0])?void 0:r[t(291)]))===n});if(!h)return;const l=h[i(272)](i(324))[0];if(!l)return;const u=l[i(272)](i(295))[0].textContent[i(327)](" "),p=l[i(272)]("ows:UpperCorner")[0][i(291)][i(327)](" "),f=s[i(268)](Number(u[0]),Number(u[1]),Number(p[0]),Number(p[1]));return ie[i(289)][i(286)](r,f),ie[i(311)][i(276)](r),f})();return ie[t(311)][t(286)](r,i),i}remove(e){const t=se;e instanceof p&&(this[t(292)][t(301)].remove(e,!0),this._viewer[t(308)].requestRender())}show(e,t){const n=se;e instanceof p&&(e.show=t,this[n(292)][n(308)][n(302)]())}};let oe=ie;oe[se(289)]=new Map,oe[se(311)]=new Map;const ae=ce;function ce(e,t){const n=he();return(ce=function(e,t){return n[e-=144]})(e,t)}function he(){const e=["1288877yCvPNr","URLTemplate","_load","WMS","' is not support","locateById","locate","GEOJSON","_id","28JRbUlD","WMTS","ARCGIS","the layer with id '","69590DZMDYQ","has","5238eTCdYB","the type '","_layersMap","_typeClass","请输入Viewer对象!","refreshToken","_type","5448639cobgsG","_show","get","' is already loaded","_isSupport","_locate","_remove","_refreshToken","_typeClassMap","SUPERMAP_WMTS","loadAsync","324465DLxEQY","options","includes","_viewer","type","1167715FCbDBc","showById","bind","Mbtiles","16jSRgUz","_initLoader","1791654wxgHhN","getById","KML","removeById","set","3569436uURzgM"];return(he=function(){return e})()}!function(){const e=ce,t=he();for(;;)try{if(952284===-parseInt(e(147))/1+parseInt(e(191))/2+-parseInt(e(180))/3+-parseInt(e(156))/4*(parseInt(e(185))/5)+parseInt(e(146))/6+-parseInt(e(169))/7*(parseInt(e(189))/8)+-parseInt(e(162))/9*(-parseInt(e(160))/10))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class le{constructor(e){const t=ce;if(!e)throw new Error(t(166));this._viewer=e,this[t(164)]=new Map,this[t(177)]=new Map}_initLoader(){const e=ce,t=this._typeClassMap.get(this._type);t?this[e(165)]=t:"TERRAIN"===this[e(168)]?this._typeClass=new E(this[e(183)]):"3DTILES"===this[e(168)]?this._typeClass=new L(this[e(183)]):this[e(168)]===e(158)?this._typeClass=new D(this[e(183)]):this[e(168)]===e(148)?this[e(165)]=new q(this[e(183)]):this[e(168)]===e(188)?this[e(165)]=new N(this[e(183)]):this._type===e(150)?this._typeClass=new K(this[e(183)]):this[e(168)]===e(157)?this[e(165)]=new Z(this._viewer):this[e(168)]===e(193)?this[e(165)]=new te(this[e(183)]):this[e(168)]===e(154)?this[e(165)]=new j(this._viewer):"SUPERMAP_WMTS"===this[e(168)]&&(this[e(165)]=new oe(this[e(183)]),this._refreshToken=this._typeClass[e(167)][e(187)](this._typeClass)),this._load=this[e(165)].load.bind(this[e(165)]),this[e(175)]=this[e(165)].remove.bind(this._typeClass),this._locate=this._typeClass[e(153)][e(187)](this._typeClass),this[e(170)]=this[e(165)].show[e(187)](this[e(165)])}async[ae(179)](e){const t=ae;if(e=e??{},this[t(155)]=e.id,this._layersMap[t(161)](this._id))throw new Error(t(159)+this[t(155)]+t(172));if(this._url=e.url,!this._url)throw new Error("the url is needed");if(this[t(168)]=e[t(184)],!this[t(173)](e[t(184)]))throw new Error(t(163)+e[t(184)]+t(151));if(this[t(190)](),e[t(184)]===t(193)){const n=this[t(149)](e);n instanceof Promise&&this._layersMap[t(145)](e.id,{options:e,layer:n})}else{const n=await this[t(149)](e);this[t(164)][t(145)](e.id,{options:e,layer:n})}}[ae(173)](e){const t=ae;return["TERRAIN","3DTILES",t(158),"URLTemplate",t(188),"WMS",t(157),t(193),t(154),t(178)][t(182)](e)}[ae(192)](e){return this[ae(164)].get(e)}[ae(144)](e){const t=ae,n=this._layersMap[t(171)](e);if(this._layersMap.delete(e),!n)return;const{options:s,layer:r}=n;r&&(this[t(168)]=s[t(184)],this._initLoader(),this[t(175)](r))}[ae(152)](e){const t=ae,n=this[t(164)][t(171)](e);if(!n)return;const{options:s,layer:r}=n;r&&(this._type=s[t(184)],this._initLoader(),this[t(174)](s,r))}[ae(186)](e,t){const n=ae,s=this[n(164)][n(171)](e);if(!s)return;const{options:r,layer:i}=s;i&&(this[n(168)]=r[n(184)],this._initLoader(),this[n(170)](i,t))}[ae(167)](e,t){const n=ae;var s;const r=this[n(164)][n(171)](e);r&&r[n(181)].type===n(178)&&(null==(s=this[n(176)])||s.call(this,r,t))}destroy(){}}export{le as default};
|