@nsc-earth-2/layer 1.1.1 → 1.1.2
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.js +1 -1
- package/package.json +1 -1
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 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};
|