vis-core 0.21.58 → 0.21.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -8,4 +8,4 @@ export * from './getVisConfig';
8
8
  export declare const access: {
9
9
  token: string;
10
10
  };
11
- export declare const VERSION = "0.21.58";
11
+ export declare const VERSION = "0.21.59";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document!="undefined"){var t=document.createElement("style");t.appendChild(document.createTextNode(".-translate-x-1\\/2,.-translate-y-1\\/2{--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1 }.shadow{--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000 }.ring{--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000 }.invert,.filter{--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.absolute{position:absolute}.left-1\\/2{left:50%}.top-1\\/2{top:50%}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.whitespace-nowrap{white-space:nowrap}.text-center{text-align:center}.text-xs{font-size:12px;line-height:16px}.leading-\\[1\\]{line-height:1}.text-\\[\\#809083\\]{--tw-text-opacity: 1;color:rgb(128 144 131 / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.invert{--tw-invert: invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}")),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- "use strict";var Tn=Object.defineProperty,Mn=Object.defineProperties;var Nn=Object.getOwnPropertyDescriptors;var Ln=Object.getOwnPropertySymbols,Fn=Object.getPrototypeOf,Hn=Object.prototype.hasOwnProperty,kn=Object.prototype.propertyIsEnumerable,Jn=Reflect.get;var Gn=(c,e)=>(e=Symbol[c])?e:Symbol.for("Symbol."+c),wn=c=>{throw TypeError(c)},on=Math.pow,Sn=(c,e,s)=>e in c?Tn(c,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):c[e]=s,hi=(c,e)=>{for(var s in e||(e={}))Hn.call(e,s)&&Sn(c,s,e[s]);if(Ln)for(var s of Ln(e))kn.call(e,s)&&Sn(c,s,e[s]);return c},Ui=(c,e)=>Mn(c,Nn(e));var H0=(c,e,s)=>Sn(c,typeof e!="symbol"?e+"":e,s);var rn=(c,e,s)=>Jn(Fn(c),s,e);var ti=(c,e,s)=>new Promise((r,f)=>{var st=Wt=>{try{Zt(s.next(Wt))}catch(Yt){f(Yt)}},ct=Wt=>{try{Zt(s.throw(Wt))}catch(Yt){f(Yt)}},Zt=Wt=>Wt.done?r(Wt.value):Promise.resolve(Wt.value).then(st,ct);Zt((s=s.apply(c,e)).next())}),Kn=function(c,e){this[0]=c,this[1]=e};var Yn=c=>{var e=c[Gn("asyncIterator")],s=!1,r,f={};return e==null?(e=c[Gn("iterator")](),r=st=>f[st]=ct=>e[st](ct)):(e=e.call(c),r=st=>f[st]=ct=>{if(s){if(s=!1,st==="throw")throw ct;return ct}return s=!0,{done:!1,value:new Kn(new Promise(Zt=>{var Wt=e[st](ct);Wt instanceof Object||wn("Object expected"),Zt(Wt)}),1)}}),f[Gn("iterator")]=()=>f,r("next"),"throw"in e?r("throw"):f.throw=st=>{throw st},"return"in e&&r("return"),f},Cn=(c,e,s)=>(e=c[Gn("asyncIterator")])?e.call(c):(c=c[Gn("iterator")](),e={},s=(r,f)=>(f=c[r])&&(e[r]=st=>new Promise((ct,Zt,Wt)=>(st=f.call(c,st),Wt=st.done,Promise.resolve(st.value).then(Yt=>ct({value:Yt,done:Wt}),Zt)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsrsasign=require("jsrsasign"),CryptoJS=require("crypto-js"),esusLite=require("esus-lite"),events=require("events"),lodashEs=require("lodash-es"),json100000=require("geojson-cn/extra/100000-lite-next.json"),countries=require("geojson-cn/extra/countries-next.json"),turf=require("@turf/turf"),continents=require("geojson-cn/extra/continents.json"),geojsonCn=require("geojson-cn"),chinaJson=require("geojson-cn/extra/100000-next.json");Array.prototype.at||(Array.prototype.at=function(c){return c<0&&(c=this.length+c),this[c]});const publicKeyPEM="LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t",accessToken={token:void 0,getInfo(){if(!this.token)return"";const[c,e,s]=this.token.split(":::"),r=jsrsasign.KEYUTIL.getKey(atob(publicKeyPEM)),f=CryptoJS.enc.Base64.parse(e),st=CryptoJS.enc.Base64.parse(s),ct=CryptoJS.lib.WordArray.create(f.words.slice(0,4)),Zt=CryptoJS.lib.WordArray.create(f.words.slice(4)),Wt=jsrsasign.KJUR.crypto.Util.hashHex(f.toString(),"sha256"),Yt=r.verifyWithMessageHashPSS(Wt,jsrsasign.b64tohex(c),"sha256",32);if(!Yt)return this.token=void 0,"";const Tt=CryptoJS.AES.decrypt({ciphertext:Zt},st,{iv:ct,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8),Jt=JSON.parse(Tt),$t=Date.now();return!Jt.s||Jt.s>$t?(this.token=void 0,""):Jt.e&&Jt.e<$t?(this.token=void 0,""):(Jt.isValid=Yt,Jt)}},version="0.21.58";/**
2
+ "use strict";var Tn=Object.defineProperty,Mn=Object.defineProperties;var Nn=Object.getOwnPropertyDescriptors;var Ln=Object.getOwnPropertySymbols,Fn=Object.getPrototypeOf,Hn=Object.prototype.hasOwnProperty,kn=Object.prototype.propertyIsEnumerable,Jn=Reflect.get;var Gn=(c,e)=>(e=Symbol[c])?e:Symbol.for("Symbol."+c),wn=c=>{throw TypeError(c)},on=Math.pow,Sn=(c,e,s)=>e in c?Tn(c,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):c[e]=s,hi=(c,e)=>{for(var s in e||(e={}))Hn.call(e,s)&&Sn(c,s,e[s]);if(Ln)for(var s of Ln(e))kn.call(e,s)&&Sn(c,s,e[s]);return c},Ui=(c,e)=>Mn(c,Nn(e));var H0=(c,e,s)=>Sn(c,typeof e!="symbol"?e+"":e,s);var rn=(c,e,s)=>Jn(Fn(c),s,e);var ti=(c,e,s)=>new Promise((r,f)=>{var st=Wt=>{try{Zt(s.next(Wt))}catch(Yt){f(Yt)}},ct=Wt=>{try{Zt(s.throw(Wt))}catch(Yt){f(Yt)}},Zt=Wt=>Wt.done?r(Wt.value):Promise.resolve(Wt.value).then(st,ct);Zt((s=s.apply(c,e)).next())}),Kn=function(c,e){this[0]=c,this[1]=e};var Yn=c=>{var e=c[Gn("asyncIterator")],s=!1,r,f={};return e==null?(e=c[Gn("iterator")](),r=st=>f[st]=ct=>e[st](ct)):(e=e.call(c),r=st=>f[st]=ct=>{if(s){if(s=!1,st==="throw")throw ct;return ct}return s=!0,{done:!1,value:new Kn(new Promise(Zt=>{var Wt=e[st](ct);Wt instanceof Object||wn("Object expected"),Zt(Wt)}),1)}}),f[Gn("iterator")]=()=>f,r("next"),"throw"in e?r("throw"):f.throw=st=>{throw st},"return"in e&&r("return"),f},Cn=(c,e,s)=>(e=c[Gn("asyncIterator")])?e.call(c):(c=c[Gn("iterator")](),e={},s=(r,f)=>(f=c[r])&&(e[r]=st=>new Promise((ct,Zt,Wt)=>(st=f.call(c,st),Wt=st.done,Promise.resolve(st.value).then(Yt=>ct({value:Yt,done:Wt}),Zt)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsrsasign=require("jsrsasign"),CryptoJS=require("crypto-js"),esusLite=require("esus-lite"),events=require("events"),lodashEs=require("lodash-es"),turf=require("@turf/turf"),json100000=require("geojson-cn/extra/100000-lite-next.json"),countries=require("geojson-cn/extra/countries-next.json"),continents=require("geojson-cn/extra/continents.json"),geojsonCn=require("geojson-cn"),chinaJson=require("geojson-cn/extra/100000-next.json");Array.prototype.at||(Array.prototype.at=function(c){return c<0&&(c=this.length+c),this[c]});const publicKeyPEM="LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t",accessToken={token:void 0,getInfo(){if(!this.token)return"";const[c,e,s]=this.token.split(":::"),r=jsrsasign.KEYUTIL.getKey(atob(publicKeyPEM)),f=CryptoJS.enc.Base64.parse(e),st=CryptoJS.enc.Base64.parse(s),ct=CryptoJS.lib.WordArray.create(f.words.slice(0,4)),Zt=CryptoJS.lib.WordArray.create(f.words.slice(4)),Wt=jsrsasign.KJUR.crypto.Util.hashHex(f.toString(),"sha256"),Yt=r.verifyWithMessageHashPSS(Wt,jsrsasign.b64tohex(c),"sha256",32);if(!Yt)return this.token=void 0,"";const Tt=CryptoJS.AES.decrypt({ciphertext:Zt},st,{iv:ct,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8),Jt=JSON.parse(Tt),$t=Date.now();return!Jt.s||Jt.s>$t?(this.token=void 0,""):Jt.e&&Jt.e<$t?(this.token=void 0,""):(Jt.isValid=Yt,Jt)}},version="0.21.59";/**
3
3
  * @license
4
4
  * Copyright 2010-2024 Three.js Authors
5
5
  * SPDX-License-Identifier: MIT
@@ -5328,7 +5328,7 @@ version 0.8.2
5328
5328
  gl_FragColor = vec4(ccccc, alpha * 0.65);
5329
5329
 
5330
5330
 
5331
- `)},Zt.needsUpdate=!0)}}setAreaEmissiveByProperty(s,r,f,st=1){if(!this.map)return;const ct=this.map.areaArr.find(Zt=>Zt.userData[s]===r);ct&&this.map.setAreaEmissive(ct,f,st)}setLineColorByProperty(s,r,f){if(!this.map)return;const st=this.map.lineArr.find(ct=>ct.userData[s]===r);st&&this.map.setLineColor(st,f)}setLineWidthByProperty(s,r,f){if(!this.map)return;const st=this.map.lineArr.find(ct=>ct.userData[s]===r);st&&this.map.setLineWidth(st,f)}addAreaPlaneByProperty(st,ct){return ti(this,arguments,function*(s,r,f={}){var Yt,vt,Tt,Jt;if(!this.map)return;const Wt=this.map.options.geojson.features.find($t=>$t.properties&&$t.properties[s]===r);if(Wt){const $t=(Yt=f.uid)!=null?Yt:"";let Xe=!1;if(this.mList.objectList.forEach((Je,de)=>{if(Je.key==="planeCopyExtrudePolygon"+$t){console.warn("已经存在复制面"),Xe=!0;return}}),Xe)return;const Qe=yield this.map.addPlane(Wt,{material:(vt=f.material)!=null?vt:new MeshBasicMaterial({color:"red"}),lineMaterial:(Tt=f.lineMaterial)!=null?Tt:new it$1({color:new Color$1("blue"),sizeAttenuation:0,lineWidth:this.options.lineWidth}),topSegments:(Jt=f.topSegments)!=null?Jt:0});return Qe.children.forEach(Je=>{Je instanceof je?(Je.object3d.name="复制面"+$t,this.mList.setObject3d(Je.object3d,"planeCopyExtrudePolygon"+$t,{baseObject:Je})):Je instanceof Ge&&(Je.object3d.name="复制线"+$t,this.mList.setObject3d(Je.object3d,"planeCopyLine"+$t,{baseObject:Je}))}),Qe}})}show(){return ti(this,null,function*(){if(this.showState||this.options.disableInitShow)return;rn(un.prototype,this,"show").call(this);const s=this.drawController.group;this.mapHistory[0]&&(yield sinusoidalInOut({onUpdate:r=>{s.position.z=-this.mapHistory[0].depth*(1-r)}}).start()),this.handlePickTest()})}handlePickTest(){return ti(this,null,function*(){var s;this.playing||(s=this.mapArea)==null||s.forEach(r=>{r.onPointerEvent("down",f=>ti(this,null,function*(){var Wt,Yt,vt;(Yt=(Wt=this.pencil)==null?void 0:Wt.helperController)==null||Yt.removeAllExcludeScene(),(vt=this.pencil.helperController)==null||vt.add(f.object3d),this.caId=f.userData.ISO_A2||f.userData.adcode;const st=this.mapLine.find(Tt=>Tt.userData.ISO_A2===this.caId||Tt.userData.adcode===this.caId),Zt=f.object3d.material[0].color.getHexString();this.settings["测试板块颜色.color:::caId"]="#"+Zt,yield this.settings["测试板块颜色.color:::caId"],this.settings["测试边框颜色.color:::caId"]="#"+(st==null?void 0:st.material.color.getHexString()),yield this.settings["测试边框颜色.color:::caId"],this.settings["测试边框宽度:::caId"]=st==null?void 0:st.material.lineWidth,yield this.settings["测试边框宽度:::caId"],this.emit("settingsChanged")}))})})}hide(){return ti(this,null,function*(){if(!this.showState)return;const s=this.drawController.group;yield sinusoidalInOut({onUpdate:r=>{s.position.z=-this.mapHistory[0].depth*r}}).start(),setTimeout(()=>{rn(un.prototype,this,"hide").call(this)})})}shadowMapEnabled(){return ti(this,null,function*(){if(this.pencil.scene.userData.shadowMapEnabled)return;this.pencil.scene.userData.shadowMapEnabled=!0;const s=yield this.drawController.draw("Light",{type:"SpotLight",color:"#c1e6dd",intensity:1,distance:0,angle:.5,penumbra:1,decay:0}),r=s.object3d;this.mList.changeObject3dKey(r,"Shadow$1"),this.mList.changeObject3dKey(r.target,"Shadow$1"),this.shadowMapLight=s,s.object3d.position.set(.281,32.487,43.077),s.object3d.castShadow=!0;const f=yield this.drawController.draw("PlaneShadow");this.mList.setObject3d(f.object3d,"PlaneShadow",{baseObject:f}),this.planeShadow=f})}shadowMapDisabled(){this.pencil.scene.userData.shadowMapEnabled&&(this.pencil.scene.userData.shadowMapEnabled=!1,this.shadowMapLight&&(this.shadowMapLight.erase(),this.mList.delObject3d(this.shadowMapLight.object3d),this.shadowMapLight=void 0),this.planeShadow&&(this.mList.delObject3d(this.planeShadow.object3d),this.planeShadow.erase(),this.planeShadow=void 0))}getDepth(s){const r=this.getAdcodeShowLevel(s);let f=this.options.mapDepth;Array.isArray(f)||(f=new Array(3).fill(f));let st;if(r==="country"?st=f[0]:r==="province"?st=f[1]:st=f[2],this.options.depthReference&&this.options.bboxMap[s]){const ct=this.options.depthReference,Zt=this.options.bboxMap[s],Wt=Math.abs(Zt[3]-Zt[1])/Math.abs(ct[3]-ct[1]),Yt=Math.abs(Zt[2]-Zt[0])/Math.abs(ct[2]-ct[0]);st=st*Math.max(Wt,Yt)}return st}getAdcodeShowLevel(s){var r;if((r=this.options.fixCity)!=null&&r[s]&&(s=this.options.fixCity[s]),s===0)return"world";if(s===1e5)return"country";{const{level:f,parent:st}=geojsonCn.adcodeMap[s],ct=st&&geojsonCn.adcodeMap[st].level;return f==="district"&&ct==="province"?"city":f}}handleClick(s){var st;const{drillDownRestrictions:r}=this.options;if(this.isAnimating)return;const f=(st=this.map)==null?void 0:st.pickArea(s);if(f&&f.userData.adcode&&this.getAdcodeShowLevel(f.userData.adcode)!==r)this.clickArea({adcodes:[...this.adcodes,f.userData.adcode]});else if(this.options.clickOusideBack&&!f&&this.mapHistory.length>1){const ct=[...this.adcodes];ct.pop(),this.clickArea({adcodes:ct})}}beforeClickArea(s){return!0}clickArea(f){return ti(this,arguments,function*({adcodes:s,duration:r=1e3}){(yield this.beforeClickArea(s))!==!1&&(this.emit("beforeDrillDown",s),yield this.setAdcode({adcodes:s,duration:r}),this.emit("afterDrillDown",s))})}drawLabels(){return ti(this,null,function*(){var f;const s=this.options.showLabel;!((f=this.mapArea)!=null&&f.length)||!s||this.drawController.getAllObject("Node",{key:"mapLabel"}).length||(yield Promise.all(this.mapArea.map(st=>ti(this,null,function*(){let{name:ct,adcode:Zt}=st.userData;const{DistrictID:Wt,DistName:Yt,NAME_CN:vt,CENTROID:Tt}=st.userData;Zt=Zt||Wt,ct=this.options.adcode===0?vt:ct||Yt;const Jt=this.options.adcode===0?this.getLocationPosition([...Tt]):this.geAdcodePosition(Zt);if(this.drawController.getObject("Node",{key:`mapLabel-${Zt}`})||!Jt)return;const[$t,Xe,Qe]=Jt;let Je=ct;s==="lite"&&Je&&(Je=ct.replace("自治州","").replace("地区","").replace("自治区","").replace("省","").replace("市","").replace("壮族","").replace("特别行政区","").replace("回族","").replace("维吾尔",""));const de=Je&&getLabelElement(Je),Ke=Je!=null&&Je.startsWith("澳门")?-1:0;yield this.drawController.draw("Node",{position:new Vector3($t,Xe+Ke,Qe),children:de,key:`mapLabel#${this.options.adcode===0?ct:Zt}`})}))))})}eraseLabels(){const s=this.drawController.getAllObject("Node",{key:"mapLabel"});this.drawController.erase(...s)}geAdcodePosition(s){const r=this.centroidObj[s];if(r){const[f,st]=r;return this.getLocationPosition([f,st])}}getLocationPosition(s){const[r,f]=s,[st,ct]=this.projection([r,f]);return[st,-ct,this.mapObj?this.mapObj.z+this.mapObj.depth:0]}getAdcodeScreenPosition(s){const r=this.geAdcodePosition(s);if(r){const[f,st,ct]=r,Zt=new Vector3(f,st,ct);Zt.project(this.pencil.camera);const{width:Wt,height:Yt}=this.pencil.getSize(),vt=(Zt.x*.5+.5)*Wt,Tt=(Zt.y*-.5+.5)*Yt;return{x:vt,y:Tt}}}booleanPointInCn(s){return json100000.features[0].geometry.coordinates.some(r=>turf.booleanPointInPolygon(turf.point(s),turf.polygon(r)))}handleDrillDown(f){return ti(this,arguments,function*({adcode:s,duration:r}){var st,ct,Zt,Wt,Yt,vt,Tt,Jt;if(typeof s!="undefined"&&!this.isAnimating){const $t=(st=this.map)==null?void 0:st.findGroup(s),Xe=geojsonCn.findLevelJsonItem(+s)||s===0;if(this.isAnimating||!Xe)return;this.isAnimating=!0;const{name:Qe}=Xe;let{res:Je}=(ct=this.options.geojsonMap)!=null&&ct[s]?{res:(Zt=this.options.geojsonMap)==null?void 0:Zt[s]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json/${s}.json`),{res:de}=this.options.extrudeLine?(Wt=this.options.extrudeLineGeojsonMap)!=null&&Wt[s]?{res:(Yt=this.options.extrudeLineGeojsonMap)==null?void 0:Yt[s]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json-lite/${s}.json`):{res:void 0};if(!this.options.showDistrict&&this.getAdcodeShowLevel(s)==="city"&&(Je=de,de=void 0),[Je,de].filter(Boolean).forEach(_e=>{if(!_e.features[0].properties.adcode&&s!==0){const $e=geojsonCn.adcodeMap[s];_e.features[0].properties=Ui(hi(hi({},_e.features[0].properties),$e),{center:[$e.lng,$e.lat]})}}),Je){const _e=this.options.plateInCenter&&(this.mapHistory.length<1||this.options.drillDownPlateInCenter);if(_e&&this.fixNear(s),(vt=this.options.fixGeojson)!=null&&vt[s]){const r0=(Tt=this.options.fixGeojson)==null?void 0:Tt[s];if(r0.startsWith("-")){const d0=+r0.slice(1);Je.features=Je.features.filter(o0=>o0.properties.adcode!==d0)}}const $e=this.options.bboxMap[s]||Object.values(this.options.bboxMap).pop();Je.features.forEach(r0=>{r0.properties.adcode&&(this.centroidObj[r0.properties.adcode]=r0.properties.centroid||r0.properties.center)}),this.eraseLabels(),this.map&&(this.options.drillDownHideParent&&this.parentBg.forEach(r0=>{r0.hide()}),this.options.showOneLevel?this.map.hide():this.map.deactive(),this.options.handleBackKeepCamvasState&&this.saveBackCamvasState(-1));const qe=this.mapHistory.length,t0=qe-1,e0=this.getDepth(s),i0=(Jt=this.mapHistory[t0])==null?void 0:Jt.depth,n0=qe===0?0:this.mapHistory[t0].z+(this.options.showOneLevel?0:i0),s0=qe===0?0:n0-e0,a0=turf.center(Je).geometry.coordinates,[h0,m0]=this.projection(a0),V0=yield this.drawPlaneMap({geojson:Je,extrudeLineGeojson:de,depth:e0,bbox:$e,adcode:s});V0.position.setZ(s0),this.mapHistory.push({map:V0,mapInfo:Xe,z:n0,depth:e0,cX:h0,cY:-m0});const u0=V0.position.z;_e&&(V0.position.z=n0,this.fitTo(V0,{enableTransition:r!==0}),V0.position.z=u0),$t==null||$t.hide(),this.map&&qe!==0&&(r?yield sinusoidalInOut({onUpdate:r0=>{this.map.position.z=u0+(n0-u0)*r0}}).start({duration:r}):this.map.position.z=n0),this.drawLabels()}else console.log(`${Qe}的地图数据不存在`);this.event.emit("handleDrillDown",{adcode:s,z:this.mapObj.z+this.mapObj.depth})}this.isAnimating=!1})}saveBackCamvasState(s){const r=this.mapHistory.at(s);r&&(r.cameraPositon=this.pencil.cameraPositon.clone(),r.cameraTarget=this.pencil.cameraTarget.clone())}fixNear(s){const r=this.getAdcodeShowLevel(s);s===0?(this.pencil.camera.near=1,this.pencil.camera.far=1e3,this.pencil.camera.updateProjectionMatrix()):(r==="country"||r==="province")&&this.pencil.camera.near!==this.pencilConfig.camera.near*10?(this.pencil.camera.near=this.pencilConfig.camera.near*10,this.pencil.camera.updateProjectionMatrix()):(r==="city"||r==="district")&&this.pencil.camera.near!==this.pencilConfig.camera.near&&(this.pencil.camera.near=this.pencilConfig.camera.near,this.pencil.camera.updateProjectionMatrix())}absoluteAngle(s,r){const f=Math.PI*2,st=s-r;return MathUtils.euclideanModulo(st+Math.PI,f)-Math.PI}fitTo(ct){return ti(this,arguments,function*(s,{polarAngle:r,azimuthAngle:f,enableTransition:st=!0}={}){var Je,de,Ke;if(!(s!=null&&s.object3d))return;const Zt=(de=this.options.lookAtMap)==null?void 0:de[(Je=this.mapInfo)==null?void 0:Je.adcode];if(Zt){const[_e,$e,qe,t0,e0,i0]=Zt;yield(Ke=this.pencil.controls)==null?void 0:Ke.setLookAt(_e,$e,qe,t0,e0,i0,st);return}const Wt=this.options.mapPadding,{height:Yt,width:vt}=this.pencil.getSize();Yt<Wt[0]+Wt[2]+100&&(Wt[0]=0,Wt[2]=0),vt<Wt[1]+Wt[3]+100&&(Wt[1]=0,Wt[3]=0);const Tt=r||this.options.polarAngle,Jt=f||this.options.azimuthAngle,$t=this.pencil.controls.azimuthAngle,Xe=this.pencil.controls.polarAngle,Qe=$t!==Jt||Xe!==Tt;yield Promise.all([this.paddingInCssPixel(s,Wt[0],Wt[1],Wt[2],Wt[3],st),Qe&&this.pencil.controls.rotateTo($t+this.absoluteAngle(Jt,$t),Xe+this.absoluteAngle(Tt,Xe),st)].filter(Boolean))})}paddingInCssPixel(s,r,f,st,ct,Zt){const{camera:Wt,controls:Yt}=this.pencil,vt=Wt.fov*MathUtils.DEG2RAD,Tt=this.pencil.getSize().height,{size:Jt}=s.getSize(),$t=Jt.x,Xe=Jt.y,Qe=Jt.z;let Je=Yt.getDistanceToFitBox($t,Xe,Qe),de=0,Ke=0,_e=0,$e=0;for(let qe=0;qe<10;qe++){const t0=Je-Qe*.5,e0=2*Math.tan(vt*.5)*Math.abs(t0)/Tt;de=r*e0,Ke=st*e0,_e=ct*e0,$e=f*e0,Je=Yt.getDistanceToFitBox($t+_e+$e,Xe+de+Ke,Qe)}return Yt.fitToBox(s.object3d,Zt,{paddingLeft:_e,paddingRight:$e,paddingBottom:Ke,paddingTop:de})}drawPlaneMap(Zt){return ti(this,arguments,function*({geojson:s,extrudeLineGeojson:r,bbox:f,depth:st,adcode:ct}){const Wt=this.mList.getMaterialObj("plane"),Yt=hi({},Wt),vt=yield this.drawController.draw("PlaneMap",{geojson:s,extrudeLineGeojson:r,depth:st,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:Yt,bbox:f,topSegments:this.options.topSegments,lineOffset:this.options.lineOffset,mergeSide:this.options.mergeSide},this.group);return vt.extrudelineArr&&vt.extrudelineArr.forEach(Tt=>{Tt.object3d.name="板块边线",this.mList.setObject3d(Tt.object3d,"extrudeLine",{baseObject:Tt}),this.initBaseObjectUserData(Tt)}),this.mList.setObject3d(vt.object3d,ct===1e5?"chinaGroup":"planeMapGroup",{baseObject:vt}),vt})}handleBack(s){return ti(this,null,function*(){if(this.mapHistory.length>1&&!this.isAnimating){this.isAnimating=!0;const r=this.mapHistory.pop();if(r!=null&&r.map){if(!this.options.drillDownPlateInCenter){const ct=r.map.position.z,Zt=this.mapObj.z+(this.mapObj.depth-r.depth);yield sinusoidalInOut({onUpdate:Wt=>{r.map.position.z=ct+(Zt-ct)*Wt}}).start({duration:s})}this.drawController.eraseWithoutMaterial(r.map)}const{map:f}=this.mapObj,st=f==null?void 0:f.findGroup(r==null?void 0:r.mapInfo.adcode);st&&st.show(),f&&(this.eraseLabels(),this.options.showOneLevel?f.show():f.active(),this.options.drillDownHideParent&&this.parentBg.forEach(ct=>{ct.show()}),yield this.handleLookBack(s)),this.drawLabels(),this.emit("handleBack",{adcodes:this.adcodes}),this.isAnimating=!1}})}handleLookBack(s){return ti(this,null,function*(){var ct;const{map:r,cameraPositon:f,cameraTarget:st}=this.mapObj;f&&st?yield(ct=this.pencil.controls)==null?void 0:ct.setLookAt(f.x,f.y,f.z,st.x,st.y,st.z,s!==0):yield this.fitTo(r,{enableTransition:s!==0})})}setAdcode(f){return ti(this,arguments,function*({adcodes:s,duration:r}){const{adcodes:st}=this;if(!(JSON.stringify(s)===JSON.stringify(st)||this.isAnimating))if(JSON.stringify(s)===JSON.stringify([0]))try{yield this.handleDrillDown({adcode:0,duration:r})}catch(Xe){console.error(Xe)}else{if(st.length){const{province:Xe,city:Qe}=s.reduce((_e,$e)=>{const qe=this.getAdcodeShowLevel($e);return _e[qe]=$e,_e},{}),{country:Je,province:de,city:Ke}=st.reduce((_e,$e)=>{const qe=this.getAdcodeShowLevel($e);return _e[qe]=$e,_e},{});if(Xe!==de)try{for(var ct=Cn([...st]),Zt,Wt,Yt;Zt=!(Wt=yield ct.next()).done;Zt=!1){const _e=Wt.value;_e!==Je&&(yield this.handleBack(r))}}catch(Wt){Yt=[Wt]}finally{try{Zt&&(Wt=ct.return)&&(yield Wt.call(ct))}finally{if(Yt)throw Yt[0]}}else Ke&&Qe!==Ke&&(yield this.handleBack(r))}if(s.length)try{for(var vt=Cn(s),Tt,Jt,$t;Tt=!(Jt=yield vt.next()).done;Tt=!1){const Xe=Jt.value;if(!st.includes(Xe))try{yield this.handleDrillDown({adcode:Xe,duration:r})}catch(Qe){console.error(Qe)}}}catch(Jt){$t=[Jt]}finally{try{Tt&&(Jt=vt.return)&&(yield Jt.call(vt))}finally{if($t)throw $t[0]}}}})}setPadding(s,r=!1){this.options.mapPadding=s,r&&this.fitTo(this.map)}dispose(){var s,r;(s=this.map)==null||s.dispose(),this.parentBg.forEach(f=>{f.dispose()}),this.parentBg.length=0,(r=this.continentsBg)==null||r.dispose(),this.continentsBg=void 0,this.mapHistory.length=0,this.centroidObj={},super.dispose()}};H0(un,"VisName","map");let Map$2=un;const PENCIL_CONFIG$3={camera:{near:.01,far:100,fov:45,up:new Vector3(0,0,1)}};class Reflector extends Mesh{constructor(e,s={}){super(e),this.isReflector=!0,this.type="Reflector",this.camera=new PerspectiveCamera;const r=this,f=s.color!==void 0?new Color$1(s.color):new Color$1(8355711),st=s.textureWidth||512,ct=s.textureHeight||512,Zt=s.clipBias||0,Wt=s.shader||Reflector.ReflectorShader,Yt=s.multisample!==void 0?s.multisample:4,vt=new Plane$1,Tt=new Vector3,Jt=new Vector3,$t=new Vector3,Xe=new Matrix4,Qe=new Vector3(0,0,-1),Je=new Vector4,de=new Vector3,Ke=new Vector3,_e=new Vector4,$e=new Matrix4,qe=this.camera,t0=new WebGLRenderTarget(st,ct,{samples:Yt,type:HalfFloatType}),e0=new ShaderMaterial({name:Wt.name!==void 0?Wt.name:"unspecified",uniforms:UniformsUtils.clone(Wt.uniforms),fragmentShader:Wt.fragmentShader,vertexShader:Wt.vertexShader});e0.uniforms.tDiffuse.value=t0.texture,e0.uniforms.color.value=f,e0.uniforms.textureMatrix.value=$e,this.material=e0,this.onBeforeRender=function(i0,n0,s0){if(Jt.setFromMatrixPosition(r.matrixWorld),$t.setFromMatrixPosition(s0.matrixWorld),Xe.extractRotation(r.matrixWorld),Tt.set(0,0,1),Tt.applyMatrix4(Xe),de.subVectors(Jt,$t),de.dot(Tt)>0)return;de.reflect(Tt).negate(),de.add(Jt),Xe.extractRotation(s0.matrixWorld),Qe.set(0,0,-1),Qe.applyMatrix4(Xe),Qe.add($t),Ke.subVectors(Jt,Qe),Ke.reflect(Tt).negate(),Ke.add(Jt),qe.position.copy(de),qe.up.set(0,1,0),qe.up.applyMatrix4(Xe),qe.up.reflect(Tt),qe.lookAt(Ke),qe.far=s0.far,qe.updateMatrixWorld(),qe.projectionMatrix.copy(s0.projectionMatrix),$e.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),$e.multiply(qe.projectionMatrix),$e.multiply(qe.matrixWorldInverse),$e.multiply(r.matrixWorld),vt.setFromNormalAndCoplanarPoint(Tt,Jt),vt.applyMatrix4(qe.matrixWorldInverse),Je.set(vt.normal.x,vt.normal.y,vt.normal.z,vt.constant);const a0=qe.projectionMatrix;_e.x=(Math.sign(Je.x)+a0.elements[8])/a0.elements[0],_e.y=(Math.sign(Je.y)+a0.elements[9])/a0.elements[5],_e.z=-1,_e.w=(1+a0.elements[10])/a0.elements[14],Je.multiplyScalar(2/Je.dot(_e)),a0.elements[2]=Je.x,a0.elements[6]=Je.y,a0.elements[10]=Je.z+1-Zt,a0.elements[14]=Je.w,r.visible=!1;const h0=i0.getRenderTarget(),m0=i0.xr.enabled,V0=i0.shadowMap.autoUpdate;i0.xr.enabled=!1,i0.shadowMap.autoUpdate=!1,i0.setRenderTarget(t0),i0.state.buffers.depth.setMask(!0),i0.autoClear===!1&&i0.clear(),i0.render(n0,qe),i0.xr.enabled=m0,i0.shadowMap.autoUpdate=V0,i0.setRenderTarget(h0);const u0=s0.viewport;u0!==void 0&&i0.state.viewport(u0),r.visible=!0},this.getRenderTarget=function(){return t0},this.dispose=function(){t0.dispose(),r.material.dispose()}}}Reflector.ReflectorShader={name:"ReflectorShader",uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:`
5331
+ `)},Zt.needsUpdate=!0)}}setAreaEmissiveByProperty(s,r,f,st=1){if(!this.map)return;const ct=this.map.areaArr.find(Zt=>Zt.userData[s]===r);ct&&this.map.setAreaEmissive(ct,f,st)}setLineColorByProperty(s,r,f){if(!this.map)return;const st=this.map.lineArr.find(ct=>ct.userData[s]===r);st&&this.map.setLineColor(st,f)}setLineWidthByProperty(s,r,f){if(!this.map)return;const st=this.map.lineArr.find(ct=>ct.userData[s]===r);st&&this.map.setLineWidth(st,f)}addAreaPlaneByProperty(st,ct){return ti(this,arguments,function*(s,r,f={}){var Yt,vt,Tt,Jt;if(!this.map)return;const Wt=this.map.options.geojson.features.find($t=>$t.properties&&$t.properties[s]===r);if(Wt){const $t=(Yt=f.uid)!=null?Yt:"";let Xe=!1;if(this.mList.objectList.forEach((Je,de)=>{if(Je.key==="planeCopyExtrudePolygon"+$t){console.warn("已经存在复制面"),Xe=!0;return}}),Xe)return;const Qe=yield this.map.addPlane(Wt,{material:(vt=f.material)!=null?vt:new MeshBasicMaterial({color:"red"}),lineMaterial:(Tt=f.lineMaterial)!=null?Tt:new it$1({color:new Color$1("blue"),sizeAttenuation:0,lineWidth:this.options.lineWidth}),topSegments:(Jt=f.topSegments)!=null?Jt:0});return Qe.children.forEach(Je=>{Je instanceof je?(Je.object3d.name="复制面"+$t,this.mList.setObject3d(Je.object3d,"planeCopyExtrudePolygon"+$t,{baseObject:Je})):Je instanceof Ge&&(Je.object3d.name="复制线"+$t,this.mList.setObject3d(Je.object3d,"planeCopyLine"+$t,{baseObject:Je}))}),Qe}})}show(){return ti(this,null,function*(){if(this.showState||this.options.disableInitShow)return;rn(un.prototype,this,"show").call(this);const s=this.drawController.group;this.mapHistory[0]&&(yield sinusoidalInOut({onUpdate:r=>{s.position.z=-this.mapHistory[0].depth*(1-r)}}).start()),this.handlePickTest()})}handlePickTest(){return ti(this,null,function*(){var s;this.playing||(s=this.mapArea)==null||s.forEach(r=>{r.onPointerEvent("down",f=>ti(this,null,function*(){var Wt,Yt,vt;(Yt=(Wt=this.pencil)==null?void 0:Wt.helperController)==null||Yt.removeAllExcludeScene(),(vt=this.pencil.helperController)==null||vt.add(f.object3d),this.caId=f.userData.ISO_A2||f.userData.adcode;const st=this.mapLine.find(Tt=>Tt.userData.ISO_A2===this.caId||Tt.userData.adcode===this.caId),Zt=f.object3d.material[0].color.getHexString();this.settings["测试板块颜色.color:::caId"]="#"+Zt,yield this.settings["测试板块颜色.color:::caId"],this.settings["测试边框颜色.color:::caId"]="#"+(st==null?void 0:st.material.color.getHexString()),yield this.settings["测试边框颜色.color:::caId"],this.settings["测试边框宽度:::caId"]=st==null?void 0:st.material.lineWidth,yield this.settings["测试边框宽度:::caId"],this.emit("settingsChanged")}))})})}hide(){return ti(this,null,function*(){if(!this.showState)return;const s=this.drawController.group;yield sinusoidalInOut({onUpdate:r=>{s.position.z=-this.mapHistory[0].depth*r}}).start(),setTimeout(()=>{rn(un.prototype,this,"hide").call(this)})})}shadowMapEnabled(){return ti(this,null,function*(){if(this.pencil.scene.userData.shadowMapEnabled)return;this.pencil.scene.userData.shadowMapEnabled=!0;const s=yield this.drawController.draw("Light",{type:"SpotLight",color:"#c1e6dd",intensity:1,distance:0,angle:.5,penumbra:1,decay:0}),r=s.object3d;this.mList.changeObject3dKey(r,"Shadow$1"),this.mList.changeObject3dKey(r.target,"Shadow$1"),this.shadowMapLight=s,s.object3d.position.set(.281,32.487,43.077),s.object3d.castShadow=!0;const f=yield this.drawController.draw("PlaneShadow");this.mList.setObject3d(f.object3d,"PlaneShadow",{baseObject:f}),this.planeShadow=f})}shadowMapDisabled(){this.pencil.scene.userData.shadowMapEnabled&&(this.pencil.scene.userData.shadowMapEnabled=!1,this.shadowMapLight&&(this.shadowMapLight.erase(),this.mList.delObject3d(this.shadowMapLight.object3d),this.shadowMapLight=void 0),this.planeShadow&&(this.mList.delObject3d(this.planeShadow.object3d),this.planeShadow.erase(),this.planeShadow=void 0))}getDepth(s,r){const f=this.getAdcodeShowLevel(s);let st=this.options.mapDepth;Array.isArray(st)||(st=new Array(3).fill(st));let ct;if(f==="country"?ct=st[0]:f==="province"?ct=st[1]:ct=st[2],this.options.depthReference&&this.options.bboxMap[s]){const Zt=this.options.depthReference,Wt=this.options.bboxMap[s];ct=ct*this.getReferenceScale(Zt,Wt)}else if(this.mapHistory.length&&this.options.bboxMap[this.mapHistory[0].mapInfo.adcode]){const Zt=this.options.bboxMap[this.mapHistory[0].mapInfo.adcode],Wt=turf.bbox(r),Yt=this.getReferenceScale(Zt,Wt);ct=ct*Yt}return ct}getReferenceScale(s,r){const f=Math.abs(r[3]-r[1])/Math.abs(s[3]-s[1]),st=Math.abs(r[2]-r[0])/Math.abs(s[2]-s[0]);return Math.max(f,st)}getAdcodeShowLevel(s){var r;if((r=this.options.fixCity)!=null&&r[s]&&(s=this.options.fixCity[s]),s===0)return"world";if(s===1e5)return"country";{const{level:f,parent:st}=geojsonCn.adcodeMap[s],ct=st&&geojsonCn.adcodeMap[st].level;return f==="district"&&ct==="province"?"city":f}}handleClick(s){var st;const{drillDownRestrictions:r}=this.options;if(this.isAnimating)return;const f=(st=this.map)==null?void 0:st.pickArea(s);if(f&&f.userData.adcode&&this.getAdcodeShowLevel(f.userData.adcode)!==r)this.clickArea({adcodes:[...this.adcodes,f.userData.adcode]});else if(this.options.clickOusideBack&&!f&&this.mapHistory.length>1){const ct=[...this.adcodes];ct.pop(),this.clickArea({adcodes:ct})}}beforeClickArea(s){return!0}clickArea(f){return ti(this,arguments,function*({adcodes:s,duration:r=1e3}){(yield this.beforeClickArea(s))!==!1&&(this.emit("beforeDrillDown",s),yield this.setAdcode({adcodes:s,duration:r}),this.emit("afterDrillDown",s))})}drawLabels(){return ti(this,null,function*(){var f;const s=this.options.showLabel;!((f=this.mapArea)!=null&&f.length)||!s||this.drawController.getAllObject("Node",{key:"mapLabel"}).length||(yield Promise.all(this.mapArea.map(st=>ti(this,null,function*(){let{name:ct,adcode:Zt}=st.userData;const{DistrictID:Wt,DistName:Yt,NAME_CN:vt,CENTROID:Tt}=st.userData;Zt=Zt||Wt,ct=this.options.adcode===0?vt:ct||Yt;const Jt=this.options.adcode===0?this.getLocationPosition([...Tt]):this.geAdcodePosition(Zt);if(this.drawController.getObject("Node",{key:`mapLabel-${Zt}`})||!Jt)return;const[$t,Xe,Qe]=Jt;let Je=ct;s==="lite"&&Je&&(Je=ct.replace("自治州","").replace("地区","").replace("自治区","").replace("省","").replace("市","").replace("壮族","").replace("特别行政区","").replace("回族","").replace("维吾尔",""));const de=Je&&getLabelElement(Je),Ke=Je!=null&&Je.startsWith("澳门")?-1:0;yield this.drawController.draw("Node",{position:new Vector3($t,Xe+Ke,Qe),children:de,key:`mapLabel#${this.options.adcode===0?ct:Zt}`})}))))})}eraseLabels(){const s=this.drawController.getAllObject("Node",{key:"mapLabel"});this.drawController.erase(...s)}geAdcodePosition(s){const r=this.centroidObj[s];if(r){const[f,st]=r;return this.getLocationPosition([f,st])}}getLocationPosition(s){const[r,f]=s,[st,ct]=this.projection([r,f]);return[st,-ct,this.mapObj?this.mapObj.z+this.mapObj.depth:0]}getAdcodeScreenPosition(s){const r=this.geAdcodePosition(s);if(r){const[f,st,ct]=r,Zt=new Vector3(f,st,ct);Zt.project(this.pencil.camera);const{width:Wt,height:Yt}=this.pencil.getSize(),vt=(Zt.x*.5+.5)*Wt,Tt=(Zt.y*-.5+.5)*Yt;return{x:vt,y:Tt}}}booleanPointInCn(s){return json100000.features[0].geometry.coordinates.some(r=>turf.booleanPointInPolygon(turf.point(s),turf.polygon(r)))}handleDrillDown(f){return ti(this,arguments,function*({adcode:s,duration:r}){var st,ct,Zt,Wt,Yt,vt,Tt,Jt;if(typeof s!="undefined"&&!this.isAnimating){const $t=(st=this.map)==null?void 0:st.findGroup(s),Xe=geojsonCn.findLevelJsonItem(+s)||s===0;if(this.isAnimating||!Xe)return;this.isAnimating=!0;const{name:Qe}=Xe;let{res:Je}=(ct=this.options.geojsonMap)!=null&&ct[s]?{res:(Zt=this.options.geojsonMap)==null?void 0:Zt[s]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json/${s}.json`),{res:de}=this.options.extrudeLine?(Wt=this.options.extrudeLineGeojsonMap)!=null&&Wt[s]?{res:(Yt=this.options.extrudeLineGeojsonMap)==null?void 0:Yt[s]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json-lite/${s}.json`):{res:void 0};if(!this.options.showDistrict&&this.getAdcodeShowLevel(s)==="city"&&(Je=de,de=void 0),[Je,de].filter(Boolean).forEach(_e=>{if(!_e.features[0].properties.adcode&&s!==0){const $e=geojsonCn.adcodeMap[s];_e.features[0].properties=Ui(hi(hi({},_e.features[0].properties),$e),{center:[$e.lng,$e.lat]})}}),Je){const _e=this.options.plateInCenter&&(this.mapHistory.length<1||this.options.drillDownPlateInCenter);if(_e&&this.fixNear(s),(vt=this.options.fixGeojson)!=null&&vt[s]){const r0=(Tt=this.options.fixGeojson)==null?void 0:Tt[s];if(r0.startsWith("-")){const d0=+r0.slice(1);Je.features=Je.features.filter(o0=>o0.properties.adcode!==d0)}}const $e=this.options.bboxMap[s]||Object.values(this.options.bboxMap).pop();Je.features.forEach(r0=>{r0.properties.adcode&&(this.centroidObj[r0.properties.adcode]=r0.properties.centroid||r0.properties.center)}),this.eraseLabels(),this.map&&(this.options.drillDownHideParent&&this.parentBg.forEach(r0=>{r0.hide()}),this.options.showOneLevel?this.map.hide():this.map.deactive(),this.options.handleBackKeepCamvasState&&this.saveBackCamvasState(-1));const qe=this.mapHistory.length,t0=qe-1,e0=this.getDepth(s,de||Je),i0=(Jt=this.mapHistory[t0])==null?void 0:Jt.depth,n0=qe===0?0:this.mapHistory[t0].z+(this.options.showOneLevel?0:i0),s0=qe===0?0:n0-e0,a0=turf.center(Je).geometry.coordinates,[h0,m0]=this.projection(a0),V0=yield this.drawPlaneMap({geojson:Je,extrudeLineGeojson:de,depth:e0,bbox:$e,adcode:s});V0.position.setZ(s0),this.mapHistory.push({map:V0,mapInfo:Xe,z:n0,depth:e0,cX:h0,cY:-m0});const u0=V0.position.z;_e&&(V0.position.z=n0,this.fitTo(V0,{enableTransition:r!==0}),V0.position.z=u0),$t==null||$t.hide(),this.map&&qe!==0&&(r?yield sinusoidalInOut({onUpdate:r0=>{this.map.position.z=u0+(n0-u0)*r0}}).start({duration:r}):this.map.position.z=n0),this.drawLabels()}else console.log(`${Qe}的地图数据不存在`);this.event.emit("handleDrillDown",{adcode:s,z:this.mapObj.z+this.mapObj.depth})}this.isAnimating=!1})}saveBackCamvasState(s){const r=this.mapHistory.at(s);r&&(r.cameraPositon=this.pencil.cameraPositon.clone(),r.cameraTarget=this.pencil.cameraTarget.clone())}fixNear(s){const r=this.getAdcodeShowLevel(s);s===0?(this.pencil.camera.near=1,this.pencil.camera.far=1e3,this.pencil.camera.updateProjectionMatrix()):(r==="country"||r==="province")&&this.pencil.camera.near!==this.pencilConfig.camera.near*10?(this.pencil.camera.near=this.pencilConfig.camera.near*10,this.pencil.camera.updateProjectionMatrix()):(r==="city"||r==="district")&&this.pencil.camera.near!==this.pencilConfig.camera.near&&(this.pencil.camera.near=this.pencilConfig.camera.near,this.pencil.camera.updateProjectionMatrix())}absoluteAngle(s,r){const f=Math.PI*2,st=s-r;return MathUtils.euclideanModulo(st+Math.PI,f)-Math.PI}fitTo(ct){return ti(this,arguments,function*(s,{polarAngle:r,azimuthAngle:f,enableTransition:st=!0}={}){var Qe,Je,de;if(!(s!=null&&s.object3d))return;const Zt=(Je=this.options.lookAtMap)==null?void 0:Je[(Qe=this.mapInfo)==null?void 0:Qe.adcode];if(Zt){const[Ke,_e,$e,qe,t0,e0]=Zt;yield(de=this.pencil.controls)==null?void 0:de.setLookAt(Ke,_e,$e,qe,t0,e0,st);return}const Wt=this.options.mapPadding,{height:Yt,width:vt}=this.pencil.getSize();Yt<Wt[0]+Wt[2]+100&&(Wt[0]=0,Wt[2]=0),vt<Wt[1]+Wt[3]+100&&(Wt[1]=0,Wt[3]=0);const Tt=r||this.options.polarAngle,Jt=f||this.options.azimuthAngle,$t=this.pencil.controls.azimuthAngle,Xe=this.pencil.controls.polarAngle;yield Promise.all([this.paddingInCssPixel(s,Wt[0],Wt[1],Wt[2],Wt[3],st),this.pencil.controls.rotateTo($t+this.absoluteAngle(Jt,$t),Xe+this.absoluteAngle(Tt,Xe),st)])})}paddingInCssPixel(s,r,f,st,ct,Zt){const{camera:Wt,controls:Yt}=this.pencil,vt=Wt.fov*MathUtils.DEG2RAD,Tt=this.pencil.getSize().height,{size:Jt}=s.getSize(),$t=Jt.x,Xe=Jt.y,Qe=Jt.z;let Je=Yt.getDistanceToFitBox($t,Xe,Qe),de=0,Ke=0,_e=0,$e=0;for(let qe=0;qe<10;qe++){const t0=Je-Qe*.5,e0=2*Math.tan(vt*.5)*Math.abs(t0)/Tt;de=r*e0,Ke=st*e0,_e=ct*e0,$e=f*e0,Je=Yt.getDistanceToFitBox($t+_e+$e,Xe+de+Ke,Qe)}return Yt.fitToBox(s.object3d,Zt,{paddingLeft:_e,paddingRight:$e,paddingBottom:Ke,paddingTop:de})}drawPlaneMap(Zt){return ti(this,arguments,function*({geojson:s,extrudeLineGeojson:r,bbox:f,depth:st,adcode:ct}){const Wt=this.mList.getMaterialObj("plane"),Yt=hi({},Wt),vt=yield this.drawController.draw("PlaneMap",{geojson:s,extrudeLineGeojson:r,depth:st,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:Yt,bbox:f,topSegments:this.options.topSegments,lineOffset:this.options.lineOffset,mergeSide:this.options.mergeSide},this.group);return vt.extrudelineArr&&vt.extrudelineArr.forEach(Tt=>{Tt.object3d.name="板块边线",this.mList.setObject3d(Tt.object3d,"extrudeLine",{baseObject:Tt}),this.initBaseObjectUserData(Tt)}),this.mList.setObject3d(vt.object3d,ct===1e5?"chinaGroup":"planeMapGroup",{baseObject:vt}),vt})}handleBack(s){return ti(this,null,function*(){if(this.mapHistory.length>1&&!this.isAnimating){this.isAnimating=!0;const r=this.mapHistory.pop();if(r!=null&&r.map){if(!this.options.drillDownPlateInCenter){const ct=r.map.position.z,Zt=this.mapObj.z+(this.mapObj.depth-r.depth);yield sinusoidalInOut({onUpdate:Wt=>{r.map.position.z=ct+(Zt-ct)*Wt}}).start({duration:s})}this.drawController.eraseWithoutMaterial(r.map)}const{map:f}=this.mapObj,st=f==null?void 0:f.findGroup(r==null?void 0:r.mapInfo.adcode);st&&st.show(),f&&(this.eraseLabels(),this.options.showOneLevel?f.show():f.active(),this.options.drillDownHideParent&&this.parentBg.forEach(ct=>{ct.show()}),yield this.handleLookBack(s)),this.drawLabels(),this.emit("handleBack",{adcodes:this.adcodes}),this.isAnimating=!1}})}handleLookBack(s){return ti(this,null,function*(){var ct;const{map:r,cameraPositon:f,cameraTarget:st}=this.mapObj;f&&st?yield(ct=this.pencil.controls)==null?void 0:ct.setLookAt(f.x,f.y,f.z,st.x,st.y,st.z,s!==0):yield this.fitTo(r,{enableTransition:s!==0})})}setAdcode(f){return ti(this,arguments,function*({adcodes:s,duration:r}){const{adcodes:st}=this;if(!(JSON.stringify(s)===JSON.stringify(st)||this.isAnimating))if(JSON.stringify(s)===JSON.stringify([0]))try{yield this.handleDrillDown({adcode:0,duration:r})}catch(Xe){console.error(Xe)}else{if(st.length){const{province:Xe,city:Qe}=s.reduce((_e,$e)=>{const qe=this.getAdcodeShowLevel($e);return _e[qe]=$e,_e},{}),{country:Je,province:de,city:Ke}=st.reduce((_e,$e)=>{const qe=this.getAdcodeShowLevel($e);return _e[qe]=$e,_e},{});if(Xe!==de)try{for(var ct=Cn([...st]),Zt,Wt,Yt;Zt=!(Wt=yield ct.next()).done;Zt=!1){const _e=Wt.value;_e!==Je&&(yield this.handleBack(r))}}catch(Wt){Yt=[Wt]}finally{try{Zt&&(Wt=ct.return)&&(yield Wt.call(ct))}finally{if(Yt)throw Yt[0]}}else Ke&&Qe!==Ke&&(yield this.handleBack(r))}if(s.length)try{for(var vt=Cn(s),Tt,Jt,$t;Tt=!(Jt=yield vt.next()).done;Tt=!1){const Xe=Jt.value;if(!st.includes(Xe))try{yield this.handleDrillDown({adcode:Xe,duration:r})}catch(Qe){console.error(Qe)}}}catch(Jt){$t=[Jt]}finally{try{Tt&&(Jt=vt.return)&&(yield Jt.call(vt))}finally{if($t)throw $t[0]}}}})}setPadding(s,r=!1){this.options.mapPadding=s,r&&this.fitTo(this.map)}dispose(){var s,r;(s=this.map)==null||s.dispose(),this.parentBg.forEach(f=>{f.dispose()}),this.parentBg.length=0,(r=this.continentsBg)==null||r.dispose(),this.continentsBg=void 0,this.mapHistory.length=0,this.centroidObj={},super.dispose()}};H0(un,"VisName","map");let Map$2=un;const PENCIL_CONFIG$3={camera:{near:.01,far:100,fov:45,up:new Vector3(0,0,1)}};class Reflector extends Mesh{constructor(e,s={}){super(e),this.isReflector=!0,this.type="Reflector",this.camera=new PerspectiveCamera;const r=this,f=s.color!==void 0?new Color$1(s.color):new Color$1(8355711),st=s.textureWidth||512,ct=s.textureHeight||512,Zt=s.clipBias||0,Wt=s.shader||Reflector.ReflectorShader,Yt=s.multisample!==void 0?s.multisample:4,vt=new Plane$1,Tt=new Vector3,Jt=new Vector3,$t=new Vector3,Xe=new Matrix4,Qe=new Vector3(0,0,-1),Je=new Vector4,de=new Vector3,Ke=new Vector3,_e=new Vector4,$e=new Matrix4,qe=this.camera,t0=new WebGLRenderTarget(st,ct,{samples:Yt,type:HalfFloatType}),e0=new ShaderMaterial({name:Wt.name!==void 0?Wt.name:"unspecified",uniforms:UniformsUtils.clone(Wt.uniforms),fragmentShader:Wt.fragmentShader,vertexShader:Wt.vertexShader});e0.uniforms.tDiffuse.value=t0.texture,e0.uniforms.color.value=f,e0.uniforms.textureMatrix.value=$e,this.material=e0,this.onBeforeRender=function(i0,n0,s0){if(Jt.setFromMatrixPosition(r.matrixWorld),$t.setFromMatrixPosition(s0.matrixWorld),Xe.extractRotation(r.matrixWorld),Tt.set(0,0,1),Tt.applyMatrix4(Xe),de.subVectors(Jt,$t),de.dot(Tt)>0)return;de.reflect(Tt).negate(),de.add(Jt),Xe.extractRotation(s0.matrixWorld),Qe.set(0,0,-1),Qe.applyMatrix4(Xe),Qe.add($t),Ke.subVectors(Jt,Qe),Ke.reflect(Tt).negate(),Ke.add(Jt),qe.position.copy(de),qe.up.set(0,1,0),qe.up.applyMatrix4(Xe),qe.up.reflect(Tt),qe.lookAt(Ke),qe.far=s0.far,qe.updateMatrixWorld(),qe.projectionMatrix.copy(s0.projectionMatrix),$e.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),$e.multiply(qe.projectionMatrix),$e.multiply(qe.matrixWorldInverse),$e.multiply(r.matrixWorld),vt.setFromNormalAndCoplanarPoint(Tt,Jt),vt.applyMatrix4(qe.matrixWorldInverse),Je.set(vt.normal.x,vt.normal.y,vt.normal.z,vt.constant);const a0=qe.projectionMatrix;_e.x=(Math.sign(Je.x)+a0.elements[8])/a0.elements[0],_e.y=(Math.sign(Je.y)+a0.elements[9])/a0.elements[5],_e.z=-1,_e.w=(1+a0.elements[10])/a0.elements[14],Je.multiplyScalar(2/Je.dot(_e)),a0.elements[2]=Je.x,a0.elements[6]=Je.y,a0.elements[10]=Je.z+1-Zt,a0.elements[14]=Je.w,r.visible=!1;const h0=i0.getRenderTarget(),m0=i0.xr.enabled,V0=i0.shadowMap.autoUpdate;i0.xr.enabled=!1,i0.shadowMap.autoUpdate=!1,i0.setRenderTarget(t0),i0.state.buffers.depth.setMask(!0),i0.autoClear===!1&&i0.clear(),i0.render(n0,qe),i0.xr.enabled=m0,i0.shadowMap.autoUpdate=V0,i0.setRenderTarget(h0);const u0=s0.viewport;u0!==void 0&&i0.state.viewport(u0),r.visible=!0},this.getRenderTarget=function(){return t0},this.dispose=function(){t0.dispose(),r.material.dispose()}}}Reflector.ReflectorShader={name:"ReflectorShader",uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:`
5332
5332
  uniform mat4 textureMatrix;
5333
5333
  varying vec4 vUv;
5334
5334
 
@@ -55,9 +55,9 @@ import CryptoJS from "crypto-js";
55
55
  import { makePromiseCreator, WorkerPool, generateUUID as generateUUID$1 } from "esus-lite";
56
56
  import { EventEmitter } from "events";
57
57
  import { throttle } from "lodash-es";
58
+ import { union, centroid, booleanPointInPolygon as booleanPointInPolygon$1, point, polygon, bbox, center, flatten as flatten$3, explode, inside, intersect as intersect$1, booleanContains, lineString, booleanCrosses } from "@turf/turf";
58
59
  import json100000 from "geojson-cn/extra/100000-lite-next.json";
59
60
  import countries from "geojson-cn/extra/countries-next.json";
60
- import { union, centroid, booleanPointInPolygon as booleanPointInPolygon$1, point, polygon, center, flatten as flatten$3, explode, inside, intersect as intersect$1, booleanContains, lineString, booleanCrosses, bbox } from "@turf/turf";
61
61
  import continents from "geojson-cn/extra/continents.json";
62
62
  import { adcodeMap, findLevelJsonItem, allArr } from "geojson-cn";
63
63
  import chinaJson from "geojson-cn/extra/100000-next.json";
@@ -89,7 +89,7 @@ const publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRz
89
89
  ).toString(CryptoJS.enc.Utf8), Jt = JSON.parse(Tt), $t = Date.now();
90
90
  return !Jt.s || Jt.s > $t ? (this.token = void 0, "") : Jt.e && Jt.e < $t ? (this.token = void 0, "") : (Jt.isValid = Yt, Jt);
91
91
  }
92
- }, version = "0.21.58";
92
+ }, version = "0.21.59";
93
93
  /**
94
94
  * @license
95
95
  * Copyright 2010-2024 Three.js Authors
@@ -51836,16 +51836,23 @@ const objs$4 = Ui(hi({}, objs$5), {
51836
51836
  shadowMapDisabled() {
51837
51837
  this.pencil.scene.userData.shadowMapEnabled && (this.pencil.scene.userData.shadowMapEnabled = !1, this.shadowMapLight && (this.shadowMapLight.erase(), this.mList.delObject3d(this.shadowMapLight.object3d), this.shadowMapLight = void 0), this.planeShadow && (this.mList.delObject3d(this.planeShadow.object3d), this.planeShadow.erase(), this.planeShadow = void 0));
51838
51838
  }
51839
- getDepth(s) {
51840
- const r = this.getAdcodeShowLevel(s);
51841
- let f = this.options.mapDepth;
51842
- Array.isArray(f) || (f = new Array(3).fill(f));
51843
- let st;
51844
- if (r === "country" ? st = f[0] : r === "province" ? st = f[1] : st = f[2], this.options.depthReference && this.options.bboxMap[s]) {
51845
- const ct = this.options.depthReference, Zt = this.options.bboxMap[s], Wt = Math.abs(Zt[3] - Zt[1]) / Math.abs(ct[3] - ct[1]), Yt = Math.abs(Zt[2] - Zt[0]) / Math.abs(ct[2] - ct[0]);
51846
- st = st * Math.max(Wt, Yt);
51839
+ getDepth(s, r) {
51840
+ const f = this.getAdcodeShowLevel(s);
51841
+ let st = this.options.mapDepth;
51842
+ Array.isArray(st) || (st = new Array(3).fill(st));
51843
+ let ct;
51844
+ if (f === "country" ? ct = st[0] : f === "province" ? ct = st[1] : ct = st[2], this.options.depthReference && this.options.bboxMap[s]) {
51845
+ const Zt = this.options.depthReference, Wt = this.options.bboxMap[s];
51846
+ ct = ct * this.getReferenceScale(Zt, Wt);
51847
+ } else if (this.mapHistory.length && this.options.bboxMap[this.mapHistory[0].mapInfo.adcode]) {
51848
+ const Zt = this.options.bboxMap[this.mapHistory[0].mapInfo.adcode], Wt = bbox(r), Yt = this.getReferenceScale(Zt, Wt);
51849
+ ct = ct * Yt;
51847
51850
  }
51848
- return st;
51851
+ return ct;
51852
+ }
51853
+ getReferenceScale(s, r) {
51854
+ const f = Math.abs(r[3] - r[1]) / Math.abs(s[3] - s[1]), st = Math.abs(r[2] - r[0]) / Math.abs(s[2] - s[0]);
51855
+ return Math.max(f, st);
51849
51856
  }
51850
51857
  getAdcodeShowLevel(s) {
51851
51858
  var r;
@@ -51986,7 +51993,7 @@ const objs$4 = Ui(hi({}, objs$5), {
51986
51993
  }), this.eraseLabels(), this.map && (this.options.drillDownHideParent && this.parentBg.forEach((r0) => {
51987
51994
  r0.hide();
51988
51995
  }), this.options.showOneLevel ? this.map.hide() : this.map.deactive(), this.options.handleBackKeepCamvasState && this.saveBackCamvasState(-1));
51989
- const qe = this.mapHistory.length, t0 = qe - 1, e0 = this.getDepth(s), i0 = (Jt = this.mapHistory[t0]) == null ? void 0 : Jt.depth, n0 = qe === 0 ? 0 : this.mapHistory[t0].z + (this.options.showOneLevel ? 0 : i0), s0 = qe === 0 ? 0 : n0 - e0, a0 = center(Je).geometry.coordinates, [h0, m0] = this.projection(a0), V0 = yield this.drawPlaneMap({
51996
+ const qe = this.mapHistory.length, t0 = qe - 1, e0 = this.getDepth(s, de || Je), i0 = (Jt = this.mapHistory[t0]) == null ? void 0 : Jt.depth, n0 = qe === 0 ? 0 : this.mapHistory[t0].z + (this.options.showOneLevel ? 0 : i0), s0 = qe === 0 ? 0 : n0 - e0, a0 = center(Je).geometry.coordinates, [h0, m0] = this.projection(a0), V0 = yield this.drawPlaneMap({
51990
51997
  geojson: Je,
51991
51998
  extrudeLineGeojson: de,
51992
51999
  depth: e0,
@@ -52039,42 +52046,40 @@ const objs$4 = Ui(hi({}, objs$5), {
52039
52046
  azimuthAngle: f,
52040
52047
  enableTransition: st = !0
52041
52048
  } = {}) {
52042
- var Je, de, Ke;
52049
+ var Qe, Je, de;
52043
52050
  if (!(s != null && s.object3d)) return;
52044
- const Zt = (de = this.options.lookAtMap) == null ? void 0 : de[(Je = this.mapInfo) == null ? void 0 : Je.adcode];
52051
+ const Zt = (Je = this.options.lookAtMap) == null ? void 0 : Je[(Qe = this.mapInfo) == null ? void 0 : Qe.adcode];
52045
52052
  if (Zt) {
52046
- const [_e, $e, qe, t0, e0, i0] = Zt;
52047
- yield (Ke = this.pencil.controls) == null ? void 0 : Ke.setLookAt(
52053
+ const [Ke, _e, $e, qe, t0, e0] = Zt;
52054
+ yield (de = this.pencil.controls) == null ? void 0 : de.setLookAt(
52055
+ Ke,
52048
52056
  _e,
52049
52057
  $e,
52050
52058
  qe,
52051
52059
  t0,
52052
52060
  e0,
52053
- i0,
52054
52061
  st
52055
52062
  );
52056
52063
  return;
52057
52064
  }
52058
52065
  const Wt = this.options.mapPadding, { height: Yt, width: vt } = this.pencil.getSize();
52059
52066
  Yt < Wt[0] + Wt[2] + 100 && (Wt[0] = 0, Wt[2] = 0), vt < Wt[1] + Wt[3] + 100 && (Wt[1] = 0, Wt[3] = 0);
52060
- const Tt = r || this.options.polarAngle, Jt = f || this.options.azimuthAngle, $t = this.pencil.controls.azimuthAngle, Xe = this.pencil.controls.polarAngle, Qe = $t !== Jt || Xe !== Tt;
52061
- yield Promise.all(
52062
- [
52063
- this.paddingInCssPixel(
52064
- s,
52065
- Wt[0],
52066
- Wt[1],
52067
- Wt[2],
52068
- Wt[3],
52069
- st
52070
- ),
52071
- Qe && this.pencil.controls.rotateTo(
52072
- $t + this.absoluteAngle(Jt, $t),
52073
- Xe + this.absoluteAngle(Tt, Xe),
52074
- st
52075
- )
52076
- ].filter(Boolean)
52077
- );
52067
+ const Tt = r || this.options.polarAngle, Jt = f || this.options.azimuthAngle, $t = this.pencil.controls.azimuthAngle, Xe = this.pencil.controls.polarAngle;
52068
+ yield Promise.all([
52069
+ this.paddingInCssPixel(
52070
+ s,
52071
+ Wt[0],
52072
+ Wt[1],
52073
+ Wt[2],
52074
+ Wt[3],
52075
+ st
52076
+ ),
52077
+ this.pencil.controls.rotateTo(
52078
+ $t + this.absoluteAngle(Jt, $t),
52079
+ Xe + this.absoluteAngle(Tt, Xe),
52080
+ st
52081
+ )
52082
+ ]);
52078
52083
  });
52079
52084
  }
52080
52085
  paddingInCssPixel(s, r, f, st, ct, Zt) {
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.21.58";
1
+ declare const _default: "0.21.59";
2
2
  export default _default;
@@ -148,7 +148,8 @@ export default class extends Base {
148
148
  planeShadow?: BaseObject;
149
149
  shadowMapEnabled(): Promise<void>;
150
150
  shadowMapDisabled(): void;
151
- getDepth(adcode: number): number;
151
+ getDepth(adcode: number, geojson: GeoJSON): number;
152
+ getReferenceScale(bboxa: number[], bboxb: number[]): number;
152
153
  getAdcodeShowLevel(adcode: number): string;
153
154
  handleClick(e: MouseEvent): void;
154
155
  beforeClickArea(adcodes: number[]): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.21.58",
3
+ "version": "0.21.59",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version &&PUBLIC_EXCLUDE=public/city bundler",