"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("three");require("d3-geo");require("three/examples/jsm/controls/OrbitControls");require("three/examples/jsm/loaders/GLTFLoader");require("three/examples/jsm/loaders/DRACOLoader.js");const i=require("../../../../utils/mini3d/utils/utils.js");require("three/examples/jsm/libs/lil-gui.module.min");require("three/examples/jsm/utils/BufferGeometryUtils");require("three/examples/jsm/renderers/CSS3DRenderer");require("lodash");function p(n,t){const r=n[0]/t[0],o=n[1]/t[1];return Math.min(r,o)}function y(n,t){const r=[129.00074005126953,94.67551803588867],o=i.getBoundBox(t.mapGroup),e=p(r,[o.boxSize.x,o.boxSize.y]);t.mapGroup.scale.set(e,e,1);const a=i.getBoundBox(t.mapGroup);return t.mapGroup.position.x=-a.center.x,t.mapGroup.position.y=-a.center.y,n.scale=e,n.boundBox=a,t}function S(n,t){fetch(n).then(r=>r.text()).then(r=>{try{JSON.parse(r)&&t&&t(r)}catch{t(null)}}).catch(r=>{t(null)})}function B(n,t){const r=`https://lganv-1304359499.cos.ap-beijing.myqcloud.com/lg_cos_static/system/scene/map3d/china/${n}_full.json`;fetch(r).then(o=>o.text()).then(o=>{try{JSON.parse(o)&&t&&t(o)}catch{t(null)}}).catch(o=>{d(n,t),t(null)})}function d(n,t){const r=`https://lganv-1304359499.cos.ap-beijing.myqcloud.com/lg_cos_static/system/scene/map3d/china/${n}.json`;fetch(r).then(o=>o.text()).then(o=>{try{JSON.parse(o)&&t&&t(o)}catch{t(null)}}).catch(o=>{t(null)})}function q(n,t,r,o,e){const a=n.attributes.position,s=n.attributes.uv,l=n.groups[0].count;for(let u=0;u<l;u++){const g=a.getX(u),x=a.getY(u),f=(g-o)/t,h=(x-e)/r;s.setXY(u,f,h)}s.needsUpdate=!0,n.computeVertexNormals()}function m(n,t,r,o){let e=n.assets.instance.getResource3(t);return e.data?e.path?r?(r!==e.path&&(e.data=new c.TextureLoader().load(r),e.path=r),e.data.wrapS=e.data.wrapT=c.RepeatWrapping,{[o]:e.data}):{}:{}:!e.data&&r?(e.data=new c.TextureLoader().load(r),e.path=r,e.data.wrapS=e.data.wrapT=c.RepeatWrapping,{[o]:e.data}):{}}exports.calcUv2=q;exports.calculateScale=p;exports.getMapDataByAdcode=B;exports.getMapDataByAdcode2=d;exports.getMapDataByUrl=S;exports.getTextureResource=m;exports.setScaleArea=y;
