vis-core 0.30.0-beta.57 → 0.30.0-beta.58
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 +1 -1
- package/dist/index.js +2 -2
- package/dist/index.module.js +20 -14
- package/dist/version.d.ts +1 -1
- package/dist/vis/map/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
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,.transform{--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: }.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))}.transform{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))}.resize{resize:both}.whitespace-nowrap{white-space:nowrap}.text-center{text-align:center}.text-sm{font-size:14px;line-height:20px}.leading-\\[1\\]{line-height:1}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-opacity-80{--tw-text-opacity: .8 }.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 $n=Object.defineProperty,qn=Object.defineProperties;var e1=Object.getOwnPropertyDescriptors;var On=Object.getOwnPropertySymbols,t1=Object.getPrototypeOf,i1=Object.prototype.hasOwnProperty,n1=Object.prototype.propertyIsEnumerable,s1=Reflect.get;var Nn=(E,e)=>(e=Symbol[E])?e:Symbol.for("Symbol."+E),r1=E=>{throw TypeError(E)},Tn=Math.pow,Bn=(E,e,n)=>e in E?$n(E,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):E[e]=n,yi=(E,e)=>{for(var n in e||(e={}))i1.call(e,n)&&Bn(E,n,e[n]);if(On)for(var n of On(e))n1.call(e,n)&&Bn(E,n,e[n]);return E},Qi=(E,e)=>qn(E,e1(e));var C0=(E,e,n)=>Bn(E,typeof e!="symbol"?e+"":e,n);var Zn=(E,e,n)=>s1(t1(E),n,e);var U0=(E,e,n)=>new Promise((V,I)=>{var he=ze=>{try{ye(n.next(ze))}catch(Fe){I(Fe)}},fe=ze=>{try{ye(n.throw(ze))}catch(Fe){I(Fe)}},ye=ze=>ze.done?V(ze.value):Promise.resolve(ze.value).then(he,fe);ye((n=n.apply(E,e)).next())}),a1=function(E,e){this[0]=E,this[1]=e};var Dn=E=>{var e=E[Nn("asyncIterator")],n=!1,V,I={};return e==null?(e=E[Nn("iterator")](),V=he=>I[he]=fe=>e[he](fe)):(e=e.call(E),V=he=>I[he]=fe=>{if(n){if(n=!1,he==="throw")throw fe;return fe}return n=!0,{done:!1,value:new a1(new Promise(ye=>{var ze=e[he](fe);ze instanceof Object||r1("Object expected"),ye(ze)}),1)}}),I[Nn("iterator")]=()=>I,V("next"),"throw"in e?V("throw"):I.throw=he=>{throw he},"return"in e&&V("return"),I},Jn=(E,e,n)=>(e=E[Nn("asyncIterator")])?e.call(E):(E=E[Nn("iterator")](),e={},n=(V,I)=>(I=E[V])&&(e[V]=he=>new Promise((fe,ye,ze)=>(he=I.call(E,he),ze=he.done,Promise.resolve(he.value).then(Fe=>fe({value:Fe,done:ze}),ye)))),n("next"),n("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsrsasign=require("jsrsasign"),CryptoJS=require("crypto-js"),esusLite=require("esus-lite"),events=require("events"),world$1=require("geojson-cn/json/0.json"),json100000Lite=require("geojson-cn/json-lite/100000.json"),json100000=require("geojson-cn/json/100000.json"),adcodeAll$1=require("geojson-cn/json-lite/all.json"),turf=require("@turf/turf"),geojsonCn=require("geojson-cn");Array.prototype.at||(Array.prototype.at=function(E){return E<0&&(E=this.length+E),this[E]});const version="0.30.0-beta.57",publicKeyPEM="LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t",accessToken={token:void 0,getInfo(){if(!this.token)return"";const[E,e,n]=this.token.split(":::"),V=jsrsasign.KEYUTIL.getKey(atob(publicKeyPEM)),I=CryptoJS.enc.Base64.parse(e),he=CryptoJS.enc.Base64.parse(n),fe=CryptoJS.lib.WordArray.create(I.words.slice(0,4)),ye=CryptoJS.lib.WordArray.create(I.words.slice(4)),ze=jsrsasign.KJUR.crypto.Util.hashHex(I.toString(),"sha256"),Fe=V.verifyWithMessageHashPSS(ze,jsrsasign.b64tohex(E),"sha256",32);if(!Fe)return this.token=void 0,"";const Ue=CryptoJS.AES.decrypt({ciphertext:ye},he,{iv:fe,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8),Oe=JSON.parse(Ue),nt=Date.now();return!Oe.s||Oe.s>nt?(this.token=void 0,""):Oe.e&&Oe.e<nt?(this.token=void 0,""):(Oe.isValid=Fe,Oe)}};var Easing=Object.freeze({Linear:Object.freeze({None:function(E){return E},In:function(E){return E},Out:function(E){return E},InOut:function(E){return E}}),Quadratic:Object.freeze({In:function(E){return E*E},Out:function(E){return E*(2-E)},InOut:function(E){return(E*=2)<1?.5*E*E:-.5*(--E*(E-2)-1)}}),Cubic:Object.freeze({In:function(E){return E*E*E},Out:function(E){return--E*E*E+1},InOut:function(E){return(E*=2)<1?.5*E*E*E:.5*((E-=2)*E*E+2)}}),Quartic:Object.freeze({In:function(E){return E*E*E*E},Out:function(E){return 1- --E*E*E*E},InOut:function(E){return(E*=2)<1?.5*E*E*E*E:-.5*((E-=2)*E*E*E-2)}}),Quintic:Object.freeze({In:function(E){return E*E*E*E*E},Out:function(E){return--E*E*E*E*E+1},InOut:function(E){return(E*=2)<1?.5*E*E*E*E*E:.5*((E-=2)*E*E*E*E+2)}}),Sinusoidal:Object.freeze({In:function(E){return 1-Math.sin((1-E)*Math.PI/2)},Out:function(E){return Math.sin(E*Math.PI/2)},InOut:function(E){return .5*(1-Math.sin(Math.PI*(.5-E)))}}),Exponential:Object.freeze({In:function(E){return E===0?0:Math.pow(1024,E-1)},Out:function(E){return E===1?1:1-Math.pow(2,-10*E)},InOut:function(E){return E===0?0:E===1?1:(E*=2)<1?.5*Math.pow(1024,E-1):.5*(-Math.pow(2,-10*(E-1))+2)}}),Circular:Object.freeze({In:function(E){return 1-Math.sqrt(1-E*E)},Out:function(E){return Math.sqrt(1- --E*E)},InOut:function(E){return(E*=2)<1?-.5*(Math.sqrt(1-E*E)-1):.5*(Math.sqrt(1-(E-=2)*E)+1)}}),Elastic:Object.freeze({In:function(E){return E===0?0:E===1?1:-Math.pow(2,10*(E-1))*Math.sin((E-1.1)*5*Math.PI)},Out:function(E){return E===0?0:E===1?1:Math.pow(2,-10*E)*Math.sin((E-.1)*5*Math.PI)+1},InOut:function(E){return E===0?0:E===1?1:(E*=2,E<1?-.5*Math.pow(2,10*(E-1))*Math.sin((E-1.1)*5*Math.PI):.5*Math.pow(2,-10*(E-1))*Math.sin((E-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(E){var e=1.70158;return E===1?1:E*E*((e+1)*E-e)},Out:function(E){var e=1.70158;return E===0?0:--E*E*((e+1)*E+e)+1},InOut:function(E){var e=2.5949095;return(E*=2)<1?.5*(E*E*((e+1)*E-e)):.5*((E-=2)*E*((e+1)*E+e)+2)}}),Bounce:Object.freeze({In:function(E){return 1-Easing.Bounce.Out(1-E)},Out:function(E){return E<1/2.75?7.5625*E*E:E<2/2.75?7.5625*(E-=1.5/2.75)*E+.75:E<2.5/2.75?7.5625*(E-=2.25/2.75)*E+.9375:7.5625*(E-=2.625/2.75)*E+.984375},InOut:function(E){return E<.5?Easing.Bounce.In(E*2)*.5:Easing.Bounce.Out(E*2-1)*.5+.5}}),generatePow:function(E){return E===void 0&&(E=4),E=E<Number.EPSILON?Number.EPSILON:E,E=E>1e4?1e4:E,{In:function(e){return Math.pow(e,E)},Out:function(e){return 1-Math.pow(1-e,E)},InOut:function(e){return e<.5?Math.pow(e*2,E)/2:(1-Math.pow(2-e*2,E))/2+.5}}}}),now=function(){return performance.now()},Group$1=function(){function E(){this._tweens={},this._tweensAddedDuringUpdate={}}return E.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(n){return e._tweens[n]})},E.prototype.removeAll=function(){this._tweens={}},E.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},E.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},E.prototype.update=function(e,n){e===void 0&&(e=now()),n===void 0&&(n=!1);var V=Object.keys(this._tweens);if(V.length===0)return!1;for(;V.length>0;){this._tweensAddedDuringUpdate={};for(var I=0;I<V.length;I++){var he=this._tweens[V[I]],fe=!n;he&&he.update(e,fe)===!1&&!n&&delete this._tweens[V[I]]}V=Object.keys(this._tweensAddedDuringUpdate)}return!0},E}(),Interpolation={Linear:function(E,e){var n=E.length-1,V=n*e,I=Math.floor(V),he=Interpolation.Utils.Linear;return e<0?he(E[0],E[1],V):e>1?he(E[n],E[n-1],n-V):he(E[I],E[I+1>n?n:I+1],V-I)},Bezier:function(E,e){for(var n=0,V=E.length-1,I=Math.pow,he=Interpolation.Utils.Bernstein,fe=0;fe<=V;fe++)n+=I(1-e,V-fe)*I(e,fe)*E[fe]*he(V,fe);return n},CatmullRom:function(E,e){var n=E.length-1,V=n*e,I=Math.floor(V),he=Interpolation.Utils.CatmullRom;return E[0]===E[n]?(e<0&&(I=Math.floor(V=n*(1+e))),he(E[(I-1+n)%n],E[I],E[(I+1)%n],E[(I+2)%n],V-I)):e<0?E[0]-(he(E[0],E[0],E[1],E[1],-V)-E[0]):e>1?E[n]-(he(E[n],E[n],E[n-1],E[n-1],V-n)-E[n]):he(E[I?I-1:0],E[I],E[n<I+1?n:I+1],E[n<I+2?n:I+2],V-I)},Utils:{Linear:function(E,e,n){return(e-E)*n+E},Bernstein:function(E,e){var n=Interpolation.Utils.Factorial;return n(E)/n(e)/n(E-e)},Factorial:function(){var E=[1];return function(e){var n=1;if(E[e])return E[e];for(var V=e;V>1;V--)n*=V;return E[e]=n,n}}(),CatmullRom:function(E,e,n,V,I){var he=(n-E)*.5,fe=(V-e)*.5,ye=I*I,ze=I*ye;return(2*e-2*n+he+fe)*ze+(-3*e+3*n-2*he-fe)*ye+he*I+e}}},Sequence=function(){function E(){}return E.nextId=function(){return E._nextId++},E._nextId=0,E}(),mainGroup=new Group$1,Tween=function(){function E(e,n){n===void 0&&(n=mainGroup),this._object=e,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Easing.Linear.None,this._interpolationFunction=Interpolation.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Sequence.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return E.prototype.getId=function(){return this._id},E.prototype.isPlaying=function(){return this._isPlaying},E.prototype.isPaused=function(){return this._isPaused},E.prototype.getDuration=function(){return this._duration},E.prototype.to=function(e,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},E.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},E.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},E.prototype.start=function(e,n){if(e===void 0&&(e=now()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var V in this._valuesStartRepeat)this._swapEndStartRepeatValues(V),this._valuesStart[V]=this._valuesStartRepeat[V]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var I={};for(var he in this._valuesEnd)I[he]=this._valuesEnd[he];this._valuesEnd=I}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},E.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},E.prototype._setupProperties=function(e,n,V,I,he){for(var fe in V){var ye=e[fe],ze=Array.isArray(ye),Fe=ze?"array":typeof ye,ke=!ze&&Array.isArray(V[fe]);if(!(Fe==="undefined"||Fe==="function")){if(ke){var Ue=V[fe];if(Ue.length===0)continue;for(var Oe=[ye],nt=0,ot=Ue.length;nt<ot;nt+=1){var zt=this._handleRelativeValue(ye,Ue[nt]);if(isNaN(zt)){ke=!1,console.warn("Found invalid interpolation list. Skipping.");break}Oe.push(zt)}ke&&(V[fe]=Oe)}if((Fe==="object"||ze)&&ye&&!ke){n[fe]=ze?[]:{};var Zt=ye;for(var at in Zt)n[fe][at]=Zt[at];I[fe]=ze?[]:{};var Ue=V[fe];if(!this._isDynamic){var It={};for(var at in Ue)It[at]=Ue[at];V[fe]=Ue=It}this._setupProperties(Zt,n[fe],Ue,I[fe],he)}else(typeof n[fe]=="undefined"||he)&&(n[fe]=ye),ze||(n[fe]*=1),ke?I[fe]=V[fe].slice().reverse():I[fe]=n[fe]||0}}},E.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},E.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},E.prototype.pause=function(e){return e===void 0&&(e=now()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this),this)},E.prototype.resume=function(e){return e===void 0&&(e=now()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},E.prototype.stopChainedTweens=function(){for(var e=0,n=this._chainedTweens.length;e<n;e++)this._chainedTweens[e].stop();return this},E.prototype.group=function(e){return e===void 0&&(e=mainGroup),this._group=e,this},E.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},E.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},E.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},E.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},E.prototype.easing=function(e){return e===void 0&&(e=Easing.Linear.None),this._easingFunction=e,this},E.prototype.interpolation=function(e){return e===void 0&&(e=Interpolation.Linear),this._interpolationFunction=e,this},E.prototype.chain=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._chainedTweens=e,this},E.prototype.onStart=function(e){return this._onStartCallback=e,this},E.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},E.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},E.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},E.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},E.prototype.onStop=function(e){return this._onStopCallback=e,this},E.prototype.update=function(e,n){var V;if(e===void 0&&(e=now()),n===void 0&&(n=!0),this._isPaused)return!0;var I=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>I)return!1;n&&this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var he=e-this._startTime,fe=this._duration+((V=this._repeatDelayTime)!==null&&V!==void 0?V:this._delayTime),ye=this._duration+this._repeat*fe,ze=this._calculateElapsedPortion(he,fe,ye),Fe=this._easingFunction(ze),ke=this._calculateCompletionStatus(he,fe);if(ke==="repeat"&&this._processRepetition(he,fe),this._updateProperties(this._object,this._valuesStart,this._valuesEnd,Fe),ke==="about-to-repeat"&&this._processRepetition(he,fe),this._onUpdateCallback&&this._onUpdateCallback(this._object,ze),ke==="repeat"||ke==="about-to-repeat")this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1;else if(ke==="completed"){this._isPlaying=!1,this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var Ue=0,Oe=this._chainedTweens.length;Ue<Oe;Ue++)this._chainedTweens[Ue].start(this._startTime+this._duration,!1)}return ke!=="completed"},E.prototype._calculateElapsedPortion=function(e,n,V){if(this._duration===0||e>V)return 1;var I=e%n,he=Math.min(I/this._duration,1);return he===0&&e!==0&&e%this._duration===0?1:he},E.prototype._calculateCompletionStatus=function(e,n){return this._duration!==0&&e<this._duration?"playing":this._repeat<=0?"completed":e===this._duration?"about-to-repeat":"repeat"},E.prototype._processRepetition=function(e,n){var V=Math.min(Math.trunc((e-this._duration)/n)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=V);for(var I in this._valuesStartRepeat){var he=this._valuesEnd[I];!this._yoyo&&typeof he=="string"&&(this._valuesStartRepeat[I]=this._valuesStartRepeat[I]+parseFloat(he)),this._yoyo&&this._swapEndStartRepeatValues(I),this._valuesStart[I]=this._valuesStartRepeat[I]}this._yoyo&&(this._reversed=!this._reversed),this._startTime+=n*V},E.prototype._updateProperties=function(e,n,V,I){for(var he in V)if(n[he]!==void 0){var fe=n[he]||0,ye=V[he],ze=Array.isArray(e[he]),Fe=Array.isArray(ye),ke=!ze&&Fe;ke?e[he]=this._interpolationFunction(ye,I):typeof ye=="object"&&ye?this._updateProperties(e[he],fe,ye,I):(ye=this._handleRelativeValue(fe,ye),typeof ye=="number"&&(e[he]=fe+(ye-fe)*I))}},E.prototype._handleRelativeValue=function(e,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?e+parseFloat(n):parseFloat(n)},E.prototype._swapEndStartRepeatValues=function(e){var n=this._valuesStartRepeat[e],V=this._valuesEnd[e];typeof V=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(V):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=n},E}(),VERSION$1="23.1.2",nextId=Sequence.nextId,TWEEN=mainGroup,getAll=TWEEN.getAll.bind(TWEEN),removeAll=TWEEN.removeAll.bind(TWEEN),add=TWEEN.add.bind(TWEEN),remove=TWEEN.remove.bind(TWEEN),update=TWEEN.update.bind(TWEEN),exports$1={Easing,Group:Group$1,Interpolation,now,Sequence,nextId,Tween,VERSION:VERSION$1,getAll,removeAll,add,remove,update};const tween_esm=Object.freeze(Object.defineProperty({__proto__:null,Easing,Group:Group$1,Interpolation,Sequence,Tween,VERSION:VERSION$1,add,default:exports$1,getAll,nextId,now,remove,removeAll,update},Symbol.toStringTag,{value:"Module"}));/**
|
|
2
|
+
"use strict";var $n=Object.defineProperty,qn=Object.defineProperties;var e1=Object.getOwnPropertyDescriptors;var On=Object.getOwnPropertySymbols,t1=Object.getPrototypeOf,i1=Object.prototype.hasOwnProperty,n1=Object.prototype.propertyIsEnumerable,s1=Reflect.get;var Nn=(E,e)=>(e=Symbol[E])?e:Symbol.for("Symbol."+E),r1=E=>{throw TypeError(E)},Tn=Math.pow,Bn=(E,e,n)=>e in E?$n(E,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):E[e]=n,yi=(E,e)=>{for(var n in e||(e={}))i1.call(e,n)&&Bn(E,n,e[n]);if(On)for(var n of On(e))n1.call(e,n)&&Bn(E,n,e[n]);return E},Qi=(E,e)=>qn(E,e1(e));var C0=(E,e,n)=>Bn(E,typeof e!="symbol"?e+"":e,n);var Zn=(E,e,n)=>s1(t1(E),n,e);var U0=(E,e,n)=>new Promise((V,I)=>{var he=ze=>{try{ye(n.next(ze))}catch(Fe){I(Fe)}},fe=ze=>{try{ye(n.throw(ze))}catch(Fe){I(Fe)}},ye=ze=>ze.done?V(ze.value):Promise.resolve(ze.value).then(he,fe);ye((n=n.apply(E,e)).next())}),a1=function(E,e){this[0]=E,this[1]=e};var Dn=E=>{var e=E[Nn("asyncIterator")],n=!1,V,I={};return e==null?(e=E[Nn("iterator")](),V=he=>I[he]=fe=>e[he](fe)):(e=e.call(E),V=he=>I[he]=fe=>{if(n){if(n=!1,he==="throw")throw fe;return fe}return n=!0,{done:!1,value:new a1(new Promise(ye=>{var ze=e[he](fe);ze instanceof Object||r1("Object expected"),ye(ze)}),1)}}),I[Nn("iterator")]=()=>I,V("next"),"throw"in e?V("throw"):I.throw=he=>{throw he},"return"in e&&V("return"),I},Jn=(E,e,n)=>(e=E[Nn("asyncIterator")])?e.call(E):(E=E[Nn("iterator")](),e={},n=(V,I)=>(I=E[V])&&(e[V]=he=>new Promise((fe,ye,ze)=>(he=I.call(E,he),ze=he.done,Promise.resolve(he.value).then(Fe=>fe({value:Fe,done:ze}),ye)))),n("next"),n("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsrsasign=require("jsrsasign"),CryptoJS=require("crypto-js"),esusLite=require("esus-lite"),events=require("events"),world$1=require("geojson-cn/json/0.json"),json100000Lite=require("geojson-cn/json-lite/100000.json"),json100000=require("geojson-cn/json/100000.json"),adcodeAll$1=require("geojson-cn/json-lite/all.json"),turf=require("@turf/turf"),geojsonCn=require("geojson-cn");Array.prototype.at||(Array.prototype.at=function(E){return E<0&&(E=this.length+E),this[E]});const version="0.30.0-beta.58",publicKeyPEM="LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t",accessToken={token:void 0,getInfo(){if(!this.token)return"";const[E,e,n]=this.token.split(":::"),V=jsrsasign.KEYUTIL.getKey(atob(publicKeyPEM)),I=CryptoJS.enc.Base64.parse(e),he=CryptoJS.enc.Base64.parse(n),fe=CryptoJS.lib.WordArray.create(I.words.slice(0,4)),ye=CryptoJS.lib.WordArray.create(I.words.slice(4)),ze=jsrsasign.KJUR.crypto.Util.hashHex(I.toString(),"sha256"),Fe=V.verifyWithMessageHashPSS(ze,jsrsasign.b64tohex(E),"sha256",32);if(!Fe)return this.token=void 0,"";const Ue=CryptoJS.AES.decrypt({ciphertext:ye},he,{iv:fe,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8),Oe=JSON.parse(Ue),nt=Date.now();return!Oe.s||Oe.s>nt?(this.token=void 0,""):Oe.e&&Oe.e<nt?(this.token=void 0,""):(Oe.isValid=Fe,Oe)}};var Easing=Object.freeze({Linear:Object.freeze({None:function(E){return E},In:function(E){return E},Out:function(E){return E},InOut:function(E){return E}}),Quadratic:Object.freeze({In:function(E){return E*E},Out:function(E){return E*(2-E)},InOut:function(E){return(E*=2)<1?.5*E*E:-.5*(--E*(E-2)-1)}}),Cubic:Object.freeze({In:function(E){return E*E*E},Out:function(E){return--E*E*E+1},InOut:function(E){return(E*=2)<1?.5*E*E*E:.5*((E-=2)*E*E+2)}}),Quartic:Object.freeze({In:function(E){return E*E*E*E},Out:function(E){return 1- --E*E*E*E},InOut:function(E){return(E*=2)<1?.5*E*E*E*E:-.5*((E-=2)*E*E*E-2)}}),Quintic:Object.freeze({In:function(E){return E*E*E*E*E},Out:function(E){return--E*E*E*E*E+1},InOut:function(E){return(E*=2)<1?.5*E*E*E*E*E:.5*((E-=2)*E*E*E*E+2)}}),Sinusoidal:Object.freeze({In:function(E){return 1-Math.sin((1-E)*Math.PI/2)},Out:function(E){return Math.sin(E*Math.PI/2)},InOut:function(E){return .5*(1-Math.sin(Math.PI*(.5-E)))}}),Exponential:Object.freeze({In:function(E){return E===0?0:Math.pow(1024,E-1)},Out:function(E){return E===1?1:1-Math.pow(2,-10*E)},InOut:function(E){return E===0?0:E===1?1:(E*=2)<1?.5*Math.pow(1024,E-1):.5*(-Math.pow(2,-10*(E-1))+2)}}),Circular:Object.freeze({In:function(E){return 1-Math.sqrt(1-E*E)},Out:function(E){return Math.sqrt(1- --E*E)},InOut:function(E){return(E*=2)<1?-.5*(Math.sqrt(1-E*E)-1):.5*(Math.sqrt(1-(E-=2)*E)+1)}}),Elastic:Object.freeze({In:function(E){return E===0?0:E===1?1:-Math.pow(2,10*(E-1))*Math.sin((E-1.1)*5*Math.PI)},Out:function(E){return E===0?0:E===1?1:Math.pow(2,-10*E)*Math.sin((E-.1)*5*Math.PI)+1},InOut:function(E){return E===0?0:E===1?1:(E*=2,E<1?-.5*Math.pow(2,10*(E-1))*Math.sin((E-1.1)*5*Math.PI):.5*Math.pow(2,-10*(E-1))*Math.sin((E-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(E){var e=1.70158;return E===1?1:E*E*((e+1)*E-e)},Out:function(E){var e=1.70158;return E===0?0:--E*E*((e+1)*E+e)+1},InOut:function(E){var e=2.5949095;return(E*=2)<1?.5*(E*E*((e+1)*E-e)):.5*((E-=2)*E*((e+1)*E+e)+2)}}),Bounce:Object.freeze({In:function(E){return 1-Easing.Bounce.Out(1-E)},Out:function(E){return E<1/2.75?7.5625*E*E:E<2/2.75?7.5625*(E-=1.5/2.75)*E+.75:E<2.5/2.75?7.5625*(E-=2.25/2.75)*E+.9375:7.5625*(E-=2.625/2.75)*E+.984375},InOut:function(E){return E<.5?Easing.Bounce.In(E*2)*.5:Easing.Bounce.Out(E*2-1)*.5+.5}}),generatePow:function(E){return E===void 0&&(E=4),E=E<Number.EPSILON?Number.EPSILON:E,E=E>1e4?1e4:E,{In:function(e){return Math.pow(e,E)},Out:function(e){return 1-Math.pow(1-e,E)},InOut:function(e){return e<.5?Math.pow(e*2,E)/2:(1-Math.pow(2-e*2,E))/2+.5}}}}),now=function(){return performance.now()},Group$1=function(){function E(){this._tweens={},this._tweensAddedDuringUpdate={}}return E.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(n){return e._tweens[n]})},E.prototype.removeAll=function(){this._tweens={}},E.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},E.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},E.prototype.update=function(e,n){e===void 0&&(e=now()),n===void 0&&(n=!1);var V=Object.keys(this._tweens);if(V.length===0)return!1;for(;V.length>0;){this._tweensAddedDuringUpdate={};for(var I=0;I<V.length;I++){var he=this._tweens[V[I]],fe=!n;he&&he.update(e,fe)===!1&&!n&&delete this._tweens[V[I]]}V=Object.keys(this._tweensAddedDuringUpdate)}return!0},E}(),Interpolation={Linear:function(E,e){var n=E.length-1,V=n*e,I=Math.floor(V),he=Interpolation.Utils.Linear;return e<0?he(E[0],E[1],V):e>1?he(E[n],E[n-1],n-V):he(E[I],E[I+1>n?n:I+1],V-I)},Bezier:function(E,e){for(var n=0,V=E.length-1,I=Math.pow,he=Interpolation.Utils.Bernstein,fe=0;fe<=V;fe++)n+=I(1-e,V-fe)*I(e,fe)*E[fe]*he(V,fe);return n},CatmullRom:function(E,e){var n=E.length-1,V=n*e,I=Math.floor(V),he=Interpolation.Utils.CatmullRom;return E[0]===E[n]?(e<0&&(I=Math.floor(V=n*(1+e))),he(E[(I-1+n)%n],E[I],E[(I+1)%n],E[(I+2)%n],V-I)):e<0?E[0]-(he(E[0],E[0],E[1],E[1],-V)-E[0]):e>1?E[n]-(he(E[n],E[n],E[n-1],E[n-1],V-n)-E[n]):he(E[I?I-1:0],E[I],E[n<I+1?n:I+1],E[n<I+2?n:I+2],V-I)},Utils:{Linear:function(E,e,n){return(e-E)*n+E},Bernstein:function(E,e){var n=Interpolation.Utils.Factorial;return n(E)/n(e)/n(E-e)},Factorial:function(){var E=[1];return function(e){var n=1;if(E[e])return E[e];for(var V=e;V>1;V--)n*=V;return E[e]=n,n}}(),CatmullRom:function(E,e,n,V,I){var he=(n-E)*.5,fe=(V-e)*.5,ye=I*I,ze=I*ye;return(2*e-2*n+he+fe)*ze+(-3*e+3*n-2*he-fe)*ye+he*I+e}}},Sequence=function(){function E(){}return E.nextId=function(){return E._nextId++},E._nextId=0,E}(),mainGroup=new Group$1,Tween=function(){function E(e,n){n===void 0&&(n=mainGroup),this._object=e,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Easing.Linear.None,this._interpolationFunction=Interpolation.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Sequence.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return E.prototype.getId=function(){return this._id},E.prototype.isPlaying=function(){return this._isPlaying},E.prototype.isPaused=function(){return this._isPaused},E.prototype.getDuration=function(){return this._duration},E.prototype.to=function(e,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},E.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},E.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},E.prototype.start=function(e,n){if(e===void 0&&(e=now()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var V in this._valuesStartRepeat)this._swapEndStartRepeatValues(V),this._valuesStart[V]=this._valuesStartRepeat[V]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var I={};for(var he in this._valuesEnd)I[he]=this._valuesEnd[he];this._valuesEnd=I}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},E.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},E.prototype._setupProperties=function(e,n,V,I,he){for(var fe in V){var ye=e[fe],ze=Array.isArray(ye),Fe=ze?"array":typeof ye,ke=!ze&&Array.isArray(V[fe]);if(!(Fe==="undefined"||Fe==="function")){if(ke){var Ue=V[fe];if(Ue.length===0)continue;for(var Oe=[ye],nt=0,ot=Ue.length;nt<ot;nt+=1){var zt=this._handleRelativeValue(ye,Ue[nt]);if(isNaN(zt)){ke=!1,console.warn("Found invalid interpolation list. Skipping.");break}Oe.push(zt)}ke&&(V[fe]=Oe)}if((Fe==="object"||ze)&&ye&&!ke){n[fe]=ze?[]:{};var Zt=ye;for(var at in Zt)n[fe][at]=Zt[at];I[fe]=ze?[]:{};var Ue=V[fe];if(!this._isDynamic){var It={};for(var at in Ue)It[at]=Ue[at];V[fe]=Ue=It}this._setupProperties(Zt,n[fe],Ue,I[fe],he)}else(typeof n[fe]=="undefined"||he)&&(n[fe]=ye),ze||(n[fe]*=1),ke?I[fe]=V[fe].slice().reverse():I[fe]=n[fe]||0}}},E.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},E.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},E.prototype.pause=function(e){return e===void 0&&(e=now()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this),this)},E.prototype.resume=function(e){return e===void 0&&(e=now()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},E.prototype.stopChainedTweens=function(){for(var e=0,n=this._chainedTweens.length;e<n;e++)this._chainedTweens[e].stop();return this},E.prototype.group=function(e){return e===void 0&&(e=mainGroup),this._group=e,this},E.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},E.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},E.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},E.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},E.prototype.easing=function(e){return e===void 0&&(e=Easing.Linear.None),this._easingFunction=e,this},E.prototype.interpolation=function(e){return e===void 0&&(e=Interpolation.Linear),this._interpolationFunction=e,this},E.prototype.chain=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._chainedTweens=e,this},E.prototype.onStart=function(e){return this._onStartCallback=e,this},E.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},E.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},E.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},E.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},E.prototype.onStop=function(e){return this._onStopCallback=e,this},E.prototype.update=function(e,n){var V;if(e===void 0&&(e=now()),n===void 0&&(n=!0),this._isPaused)return!0;var I=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>I)return!1;n&&this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var he=e-this._startTime,fe=this._duration+((V=this._repeatDelayTime)!==null&&V!==void 0?V:this._delayTime),ye=this._duration+this._repeat*fe,ze=this._calculateElapsedPortion(he,fe,ye),Fe=this._easingFunction(ze),ke=this._calculateCompletionStatus(he,fe);if(ke==="repeat"&&this._processRepetition(he,fe),this._updateProperties(this._object,this._valuesStart,this._valuesEnd,Fe),ke==="about-to-repeat"&&this._processRepetition(he,fe),this._onUpdateCallback&&this._onUpdateCallback(this._object,ze),ke==="repeat"||ke==="about-to-repeat")this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1;else if(ke==="completed"){this._isPlaying=!1,this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var Ue=0,Oe=this._chainedTweens.length;Ue<Oe;Ue++)this._chainedTweens[Ue].start(this._startTime+this._duration,!1)}return ke!=="completed"},E.prototype._calculateElapsedPortion=function(e,n,V){if(this._duration===0||e>V)return 1;var I=e%n,he=Math.min(I/this._duration,1);return he===0&&e!==0&&e%this._duration===0?1:he},E.prototype._calculateCompletionStatus=function(e,n){return this._duration!==0&&e<this._duration?"playing":this._repeat<=0?"completed":e===this._duration?"about-to-repeat":"repeat"},E.prototype._processRepetition=function(e,n){var V=Math.min(Math.trunc((e-this._duration)/n)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=V);for(var I in this._valuesStartRepeat){var he=this._valuesEnd[I];!this._yoyo&&typeof he=="string"&&(this._valuesStartRepeat[I]=this._valuesStartRepeat[I]+parseFloat(he)),this._yoyo&&this._swapEndStartRepeatValues(I),this._valuesStart[I]=this._valuesStartRepeat[I]}this._yoyo&&(this._reversed=!this._reversed),this._startTime+=n*V},E.prototype._updateProperties=function(e,n,V,I){for(var he in V)if(n[he]!==void 0){var fe=n[he]||0,ye=V[he],ze=Array.isArray(e[he]),Fe=Array.isArray(ye),ke=!ze&&Fe;ke?e[he]=this._interpolationFunction(ye,I):typeof ye=="object"&&ye?this._updateProperties(e[he],fe,ye,I):(ye=this._handleRelativeValue(fe,ye),typeof ye=="number"&&(e[he]=fe+(ye-fe)*I))}},E.prototype._handleRelativeValue=function(e,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?e+parseFloat(n):parseFloat(n)},E.prototype._swapEndStartRepeatValues=function(e){var n=this._valuesStartRepeat[e],V=this._valuesEnd[e];typeof V=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(V):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=n},E}(),VERSION$1="23.1.2",nextId=Sequence.nextId,TWEEN=mainGroup,getAll=TWEEN.getAll.bind(TWEEN),removeAll=TWEEN.removeAll.bind(TWEEN),add=TWEEN.add.bind(TWEEN),remove=TWEEN.remove.bind(TWEEN),update=TWEEN.update.bind(TWEEN),exports$1={Easing,Group:Group$1,Interpolation,now,Sequence,nextId,Tween,VERSION:VERSION$1,getAll,removeAll,add,remove,update};const tween_esm=Object.freeze(Object.defineProperty({__proto__:null,Easing,Group:Group$1,Interpolation,Sequence,Tween,VERSION:VERSION$1,add,default:exports$1,getAll,nextId,now,remove,removeAll,update},Symbol.toStringTag,{value:"Module"}));/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2010-2025 Three.js Authors
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
@@ -5363,4 +5363,4 @@ version 0.8.2
|
|
|
5363
5363
|
<div class="text-white text-opacity-80 text-center leading-[1] text-sm whitespace-nowrap">
|
|
5364
5364
|
${E}
|
|
5365
5365
|
</div>
|
|
5366
|
-
`,e},worldPacificCentre=E=>{E.loaderAdd=function(){const e=this.loader;e.add(["/image/map/jianbian.webp"]),e.add(["/image/map/hp2.webp","/image/map/fx2.webp"])},E.initMaterial=function(){return U0(this,null,function*(){const e=this.loader,n=this.mList,V=(()=>{const I=e.getAsset("/image/map/hp2.webp");I.center.set(.5,.5),I.repeat.set(.97,1.01);const he=new MeshStandardMaterial({name:"顶面",map:e.getAsset("/image/map/hp2.webp"),normalMap:e.getAsset("/image/map/fx2.webp"),normalScale:new Vector2(2,1)}),fe=new MeshBasicMaterial({name:"侧面",map:e.getAsset("/image/map/jianbian.webp")}),ye=new Ut$1({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),ze=new Ut$1({name:"板块边线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:he,sideMat:fe,lineMat:ye,extrudeLineMat:E.options.extrudeLine?ze:null}})();n.addMultiple("plane",V)})}},world=E=>{if(E.options.lineOffset=.02,delete E.extendsOptions.handleBackKeepCamvasState,E.extendsOptions.extrudeLine=()=>E.options.extrudeLine,E.extendsOptions.worldPacificCentre=()=>E.options.worldPacificCentre,E.options.worldPacificCentre){worldPacificCentre(E);return}E.initMaterial=function(){return U0(this,null,function*(){const e=this.mList,n=(()=>{const V=new MeshBasicMaterial({name:"顶面",color:"#0d2425"}),I=new MeshBasicMaterial({name:"侧面",color:"#0d2425"}),he=new Ut$1({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),fe=new Ut$1({name:"板块边线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:V,sideMat:I,lineMat:he,extrudeLineMat:E.options.extrudeLine?fe:null}})();e.addMultiple("plane",n)})}},china=E=>{E.options.lineOffset=.005,E.loaderAdd=function(){return U0(this,null,function*(){this.loader.add(["/image/map/jianbian.webp","/image/map/hp.webp","/image/map/shuchu2.webp"]),this.loaderAddBg()})},E.initMaterial=function(){return U0(this,null,function*(){const e=this.loader,n=(()=>{const V=new MeshStandardMaterial({name:"顶面",map:e.getAsset("/image/map/hp.webp"),normalMap:e.getAsset("/image/map/shuchu2.webp")}),I=new MeshBasicMaterial({name:"侧面",map:e.getAsset("/image/map/jianbian.webp")}),he=new Ut$1({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),fe=new Ut$1({name:"板块边线",color:new Color$1("#00FFED"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:V,sideMat:I,lineMat:he,extrudeLineMat:fe}})();this.mList.addMultiple("plane",n),this.options.drillDownFirstLevelUseBgMats&&this.mList.copyMultiple("plane","bgPlane"),this.options.drillDownSecondLevelMats&&this.mList.copyMultiple("plane","secondPlane"),this.options.drillDownThirdLevelMats&&this.mList.copyMultiple("plane","thirdPlane"),this.initMaterialBg()})}},base$1=E=>{E.loaderAdd=function(){return U0(this,null,function*(){this.loader.add(["/image/map/jianbian.webp"]),this.loaderAddBg()})},E.initMaterial=function(){return U0(this,null,function*(){const e=this.loader,n=(()=>{const V=new MeshBasicMaterial({name:"顶面",color:new Color$1("#0d2425")}),I=new MeshBasicMaterial({name:"侧面",map:e.getAsset("/image/map/jianbian.webp")}),he=new Ut$1({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),fe=new Ut$1({name:"板块边线",color:new Color$1("#00FFED"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:V,sideMat:I,lineMat:he,extrudeLineMat:fe}})();this.mList.addMultiple("plane",n),this.options.drillDownFirstLevelUseBgMats&&this.mList.copyMultiple("plane","bgPlane"),this.options.drillDownSecondLevelMats&&this.mList.copyMultiple("plane","secondPlane"),this.options.drillDownThirdLevelMats&&this.mList.copyMultiple("plane","thirdPlane"),this.initMaterialBg()})}},cityOnMap=E=>{E.extendsOptions={mapDepth:E.options.mapDepth,parentBg:E.options.parentBg,continentsBg:E.options.continentsBg,continentsBgDepth:E.options.continentsBgDepth,mergeSide:E.options.mergeSide,handleBackKeepCamvasState:E.options.handleBackKeepCamvasState,mapBoundary:E.options.mapBoundary,showBuilding:E.options.showBuilding,showRoad:E.options.showRoad,showGrassland:E.options.showGrassland,showRiver:E.options.showRiver,buildingSideGradient:E.options.buildingSideGradient,buildingHasSide:E.options.buildingHasSide,setWaterMaterial:E.options.setWaterMaterial,showCityOnMapInnerLine:E.options.showCityOnMapInnerLine},E.options.parentBg&&(E.extendsOptions.parentBgDepth=()=>E.options.parentBgDepth),E.loaderAdd=function(){this.loader.add(["/image/map2/side.png"])},E.initMaterial=function(){return U0(this,null,function*(){const n=this.loader,V=(()=>{const I=new MeshBasicMaterial({name:"板块顶面",color:"#094253"}),he=new MeshBasicMaterial({name:"板块侧面",map:n.getAsset("/image/map2/side.png"),side:DoubleSide}),fe=new Ut$1({name:"板块边框",color:new Color$1("#02f7eb"),lineWidth:1.8,sizeAttenuation:!1,depthTest:!1}),ye=new Ut$1({name:"板块内线",color:new Color$1("#02f7eb"),lineWidth:1.8,sizeAttenuation:!1,depthTest:!1});return{topMat:I,sideMat:he,lineMat:ye,extrudeLineMat:fe}})();this.mList.addMultiple("plane",V),this.initMaterialBg()})};const e=E.init.bind(E);E.init=function(){return U0(this,null,function*(){yield e(),yield this.initCityOnMap(this.mapInfo.adcode)})}},base=E=>{if(E.initMaterialBg=function(){return U0(this,null,function*(){const e=this.getRoomEnvMap();if(this.options.parentBg){if(this.options.adcode!==1e5){const V=(()=>{const I=new MeshStandardMaterial({name:"父级顶面",color:"#031529",emissive:"#010f1f",envMap:e}),he=new MeshBasicMaterial({name:"父级侧面",color:"#064d73",side:DoubleSide}),fe=new Ut$1({name:"父级板块线",color:new Color$1("#3f648c"),lineWidth:1.2,sizeAttenuation:!1});return{topMat:I,sideMat:he,lineMat:fe}})();this.mList.addMultiple("parentPlane",V)}const n=(()=>{const V=new MeshStandardMaterial({name:"世界顶面",color:"#031529",emissive:"#010f1f",envMap:e}),I=new MeshBasicMaterial({name:"世界侧面",color:"#064d73",side:DoubleSide}),he=new Ut$1({name:"世界板块线",color:new Color$1("#3f648c"),lineWidth:1.2,sizeAttenuation:!1});return{topMat:V,sideMat:I,lineMat:he}})();this.mList.addMultiple("worldPlane",n)}if(this.options.continentsBg){const n=(()=>{const V=new MeshStandardMaterial({name:"大洲板块顶面",emissive:"#235278"}),I=new MeshBasicMaterial({name:"大洲板块侧面",color:"#0c1528"}),he=new Ut$1({name:"大洲板块线",color:new Color$1("#1488e0"),sizeAttenuation:!1,lineWidth:this.options.lineWidth});return{topMat:V,sideMat:I,lineMat:he}})();this.mList.addMultiple("continents",n)}})},E.options.style==="map2CityOnMap"){cityOnMap(E);return}E.loaderAdd=function(){return U0(this,null,function*(){this.loaderAddBg()})},E.initMaterial=function(){return U0(this,null,function*(){const e=(()=>{const n=new MeshBasicMaterial({name:"板块顶面",color:new Color$1("#064773")}),V=new MeshBasicMaterial({name:"板块侧面",color:new Color$1("#064d73"),side:DoubleSide}),I=new Ut$1({name:"板块线",color:new Color$1("#02BAF7"),lineWidth:1,sizeAttenuation:!1}),he=new Ut$1({name:"板块边框线",color:new Color$1("#02BAF7"),lineWidth:1,sizeAttenuation:!1});return{topMat:n,sideMat:V,lineMat:I,extrudeLineMat:he}})();this.mList.addMultiple("plane",e),this.options.drillDownFirstLevelUseBgMats&&this.mList.copyMultiple("plane","bgPlane"),this.initMaterialBg()})}},Vn=class Vn extends Base{constructor(){super(...arguments);C0(this,"leadObjs",objs);C0(this,"mapHistory",[]);C0(this,"activePlaneMap",null);C0(this,"isAnimating",!1);C0(this,"parentBg",[]);C0(this,"continentsBg");C0(this,"group");C0(this,"projection");C0(this,"pcenter",[104,37.5]);C0(this,"pscale",5e4/1e3);C0(this,"meters");C0(this,"cityVis",[]);C0(this,"extendsOptions",{mapDepth:()=>this.getOptionsDepth(this.options.adcode),equirectangular:()=>this.options.projectionType==="equirectangular",mapBoundary:()=>this.options.mapBoundary,mergeSide:()=>this.options.mergeSide});C0(this,"initSettingsObj",{label:!1,labelLite:!1,shadowMap:!1});C0(this,"caId");C0(this,"shadowMapLight");C0(this,"planeShadow")}get mapObj(){return this.mapHistory[this.mapHistory.length-1]}get map(){var n;return(n=this.mapObj)==null?void 0:n.map}get mapInfo(){var n;return(n=this.mapObj)==null?void 0:n.mapInfo}get mapArea(){var n;return(n=this.map)==null?void 0:n.areaArr}get mapLine(){var n;return(n=this.map)==null?void 0:n.lineArr}get adcodes(){return this.mapHistory.map(n=>n.mapInfo.adcode)}setOptions(n){n.continentType;const V=yi(yi({0:worldExclATAJson,1e5:chinaJson},continentsJson),n==null?void 0:n.geojsonMap);let I=yi({0:worldExclATALiteJson,1e5:chinaLiteJson},continentsLiteJson);Object.keys(V).forEach(he=>{he!=="100000"&&/^\d{6}$/.test(he)&&V[+he].features.forEach(ye=>{const ze=ye.properties.adcode;I[ze]={type:"FeatureCollection",features:[ye]}})}),I=yi(yi({},I),n==null?void 0:n.extrudeLineGeojsonMap),super.setOptions(Qi(yi({parentBg:!1,continents:"",continentsBg:!1,continentsBgDepth:0,parentBgDepth:0,topSegments:0,clickHandleDrillDown:!1,drillDownSecondLevelMats:!1,drillDownFirstLevelUseBgMats:!1,drillDownThirdLevelMats:!1,clickOusideBack:!0,mapDepth:[1,.4,.2],mapPadding:[100,100,100,100],plateInCenter:!0,drillDownPlateInCenter:!0,drillDownHideParent:!1,showOneLevel:!1,drillDownRestrictions:"district",showDistrict:!0,showLabel:!1,lineWidth:.6,lineOffset:0,extrudeLineWidth:1.8,extrudeLine:!0,equirectangular:!1,winkel3:!1,projectionType:"mercator",polarAngle:n.style==="map2CityOnMap"?Math.PI/180*60:Math.PI/180*120,azimuthAngle:0,handleBackKeepCamvasState:!1,worldPacificCentre:!1,mapBoundary:!0,mergeSide:!1,bottomPlane:!1,bottomPlaneWater:!1,showBuilding:!0,buildingSideGradient:!1,buildingHasSide:!0,showRoad:!0,cacheCity:!0,showGrassland:!0,showRiver:!0,setWaterMaterial:!1,showCityOnMapInnerLine:!1,nearbyCities:!1,citySSAO:!1},n),{geojsonMap:V,extrudeLineGeojsonMap:I,geojsonExtensions:(n==null?void 0:n.geojsonExtensions)||{}})),this.options.equirectangular&&(this.options.projectionType="equirectangular"),this.options.winkel3&&(this.options.projectionType="winkel3"),this.options.adcode===0?this.extendsOptions.winkel3=()=>this.options.winkel3:(this.getAdcodeShowLevel(this.options.adcode)==="province"||this.getAdcodeShowLevel(this.options.adcode)==="country")&&(this.extendsOptions.clickHandleDrillDown=()=>this.options.clickHandleDrillDown,this.options.clickHandleDrillDown&&(this.extendsOptions.mapDepth=()=>Array.isArray(this.options.mapDepth)?this.options.mapDepth:new Array(3).fill(this.options.mapDepth),this.extendsOptions.drillDownFirstLevelUseBgMats=()=>this.options.drillDownFirstLevelUseBgMats,this.extendsOptions.drillDownSecondLevelMats=()=>this.options.drillDownSecondLevelMats,this.extendsOptions.drillDownThirdLevelMats=()=>this.options.drillDownThirdLevelMats,this.extendsOptions.drillDownPlateInCenter=()=>this.options.drillDownPlateInCenter,this.extendsOptions.clickOusideBack=()=>this.options.clickOusideBack,this.extendsOptions.handleBackKeepCamvasState=()=>this.options.handleBackKeepCamvasState,this.extendsOptions.showOneLevel=()=>this.options.showOneLevel,this.extendsOptions.showDistrict=()=>this.options.showDistrict,this.options.parentBg&&(this.extendsOptions.drillDownHideParent=()=>this.options.drillDownHideParent)),this.extendsOptions.parentBg=()=>this.options.parentBg,this.options.parentBg&&(this.extendsOptions.parentBgDepth=()=>this.options.parentBgDepth,this.options.adcode===1e5&&(this.extendsOptions.worldPacificCentre=()=>this.options.worldPacificCentre)),this.extendsOptions.continentsBg=()=>this.options.continentsBg,this.options.continentsBg&&(this.extendsOptions.continentsBgDepth=()=>this.options.continentsBgDepth)),this.options.adcode===0?world(this):this.options.style==="map2Base"||this.options.style==="map2CityOnMap"?base(this):this.options.adcode===1e5?china(this):base$1(this)}handleSetting(n,V){return U0(this,null,function*(){return yield Zn(Vn.prototype,this,"handleSetting").call(this,n,V),n==="label"?V===!1?(this.eraseLabels(),this.options.showLabel=!1):(this.settings.labelLite=!1,yield this.settings.labelLite,this.options.showLabel=!0,yield this.drawLabels()):n==="labelLite"?V===!1?(this.eraseLabels(),this.options.showLabel=!1):(this.settings.label=!1,yield this.settings.label,this.options.showLabel="lite",yield this.drawLabels()):n==="shadowMap"&&(V===!1?this.shadowMapDisabled():yield this.shadowMapEnabled()),V})}init(){return U0(this,null,function*(){const{adcode:n}=this.options;this.options.center&&(this.pcenter=this.options.center),this.options.worldPacificCentre&&n===1e5&&(this.pcenter=[this.pcenter[0]-160,this.pcenter[1]]),this.projection=f({center:this.pcenter,scale:this.pscale,projectionType:this.options.projectionType,rotate:this.options.worldPacificCentre?[-160,0]:void 0}),this.meters=this.projection([1*1141e-8+this.pcenter[0],0])[0],yield this.initPencil(),console.time(`vis-core:time.${this.visName}-loader`),this.loaderAdd(),console.timeEnd(`vis-core:time.${this.visName}-loader`),yield this.loader.loadAll(),this.group=yield this.lead.draw("Group",{key:"map"+n}),this.group.object3d.name="地图",yield this.initMaterial(),yield this.initVis(n),this.options.clickHandleDrillDown&&(this.lead.handlePick(()=>(console.log("handlePick",this.mapArea),this.mapArea||[]),"down",({baseObject:V,mouseEvent:I})=>{(this.playing||I.metaKey||I.ctrlKey)&&this.handleClick(V)}),this.options.clickOusideBack&&this.lead.handlePick(()=>(console.log("handlePick outside",this.map),this.map?[this.map]:[]),"downOutside",({mouseEvent:V})=>{(this.playing||V.metaKey||V.ctrlKey)&&this.handleClick()})),yield Promise.all(this.lead.objectsPromise)})}initCityVis(n,V=!1){return U0(this,null,function*(){const I=new City({container:this.container,editor:!1}),he=getCityConfig(n);I.setOptions({container:this.container,center:he.center,grey:V,adcode:n,cacheKey:this.options.cacheCity?`${n}`:void 0,jsonName:he.jsonName,showBuilding:this.options.showBuilding,buildingSideGradient:this.options.buildingSideGradient,buildingHasSide:this.options.buildingHasSide,showRoad:this.options.showRoad,showGrassland:this.options.showGrassland,showRiver:this.options.showRiver,setWaterMaterial:this.options.setWaterMaterial,ssao:this.options.citySSAO,pencil2:this.pencil});try{yield I.init();const fe=this.projection(he.center);fe&&I.group.position.set(fe[0],-fe[1],0)}catch(fe){console.error("城市可视化初始化失败",fe),this.settings.mouseLeft=Xi.SCREEN_PAN,yield this.settings.mouseLeft,this.pencil.camera.userData.up="0,0,1"}return this.cityVis.push(I),this.emit("initCityVis",n),I})}initCityOnMap(n){return U0(this,null,function*(){const V=this.getAdcodeShowLevel(n);if(V==="province"){const I=yield this.initCityVis(n);yield I==null?void 0:I.drawCityPlane(n,this.lead.group)}else if(V==="city"){const I=findAdcodeInfo(n).c;let he=null;if(I.length>0)for(const fe of I)he=yield this.initCityVis(fe);else he=yield this.initCityVis(n);yield he==null?void 0:he.drawCityPlane(n,this.lead.group),this.pencil.camera.near=.001,this.pencil.camera.far=7,this.pencil.camera.updateProjectionMatrix()}else if(V==="district"){const I=yield this.initCityVis(n);if(yield I==null?void 0:I.drawCityPlane(n,this.lead.group),this.pencil.camera.near=.001,this.pencil.camera.far=7,this.pencil.camera.updateProjectionMatrix(),this.options.nearbyCities){const he=findAdcodeInfo(n).parent,fe=findAdcodeInfo(he).c;for(const ye of fe)(this.options.nearbyCities==="full"||ye!==n)&&(yield this.initCityVis(ye,!0))}}this.cityVis.forEach(I=>{if(!I.options.grey){const he=this.mapObj.depth+1e-5;I.group.position.z=this.mapObj.z+he}})})}initVisBg(){return U0(this,null,function*(){let n=1e3,V=1e3;const I=new Vector3(0,0,0);if(this.options.parentBg){const he={projection:{center:this.pcenter,scale:this.pscale,rotate:[0,0],projectionType:this.options.projectionType},areaGroup:!1,depth:this.options.parentBgDepth},fe=this.options.adcode!==1e5;if(fe){const nt=this.mList.getMultiple("parentPlane"),ot=findAdcodeInfo(this.options.adcode).parent,zt=findAdcodeInfo(ot),Zt=zt.b,{res:at}=yield this.getGeojson(ot),It=yield this.lead.draw("PlaneMap",yi({key:"bg-100000",geojson:at,bbox:Zt,materialOptions:yi({},nt)},he),this.group);It.object3d.name=zt.name,It.lineArr.forEach(Lt=>{Lt.object3d.name="线",this.lead.updateBaseObjectKey(Lt,{type:"100000line"}),this.initBaseObjectUserData(Lt)}),It.areaArr.forEach(Lt=>{Lt.object3d.name="板块",this.lead.updateBaseObjectKey(Lt,{type:"100000area"})}),It.position.z=-this.options.parentBgDepth,this.parentBg.push(It)}const ye=this.mList.getMultiple("worldPlane"),ze=this.options.geojsonMap[0],Fe=findAdcodeInfo(0).b,ke=yield this.lead.draw("PlaneMap",Qi(yi({key:"bg-0",geojson:Qi(yi({},ze),{features:[...ze.features.filter(nt=>fe?nt.properties.iso_a3!=="CHN":!0)]}),bbox:Fe,materialOptions:yi({},ye)},he),{projection:Qi(yi({},he.projection),{rotate:this.options.worldPacificCentre?[-160,0]:void 0})}),this.group);ke.object3d.name="世界",ke.lineArr.forEach(nt=>{nt.object3d.name="线",this.lead.updateBaseObjectKey(nt,{type:"worldline"}),this.initBaseObjectUserData(nt)}),ke.areaArr.forEach(nt=>{nt.object3d.name="板块",this.lead.updateBaseObjectKey(nt,{type:"worldarea"})}),ke.position.z=-this.options.parentBgDepth,this.parentBg.push(ke);const{center:Ue,size:Oe}=ke.getSize();n=Oe.x,V=Oe.y,I.set(Ue.x,Ue.y,0)}if(this.options.continentsBg){if(this.continentsBg=yield this.lead.draw("ContinentsBg",{depth:this.options.continentsBgDepth,scale:this.pscale},this.group),this.options.style!=="map2CityOnMap"&&this.options.style!=="map2Base"){const he=this.getLocationPosition([104,37.5]);this.continentsBg.position.set(...he)}this.continentsBg.position.z=.1}if(this.options.bottomPlane){const he=yield this.lead.draw("CityPlane",{width:n,height:V,color:"#0f1e57"},this.group);he.object3d.name="地图底面",this.lead.updateBaseObjectKey(he,{type:"map-plane"}),this.options.bottomPlaneWater&&he.addWater(),he.position.copy(I),he.position.z-=.1}})}initVis(n){return U0(this,null,function*(){var V;if(yield this.setAdcode({adcodes:[n],duration:0}),this.options.style!=="map2Base"&&this.options.style!=="map2CityOnMap"){const I=yield this.lead.draw("Light",{type:"SpotLight",color:this.options.adcode===0?"#82d9f2":"#c1e6dd",intensity:3,distance:0,angle:this.options.continentsBg?1:.5,penumbra:1,decay:0}),he=this.pencil.cameraPositon,fe=this.pencil.cameraTarget;I==null||I.spotLight.position.copy(he),I==null||I.spotLight.target.position.copy(fe)}if(this.options.mapBoundary){const I=new Box3().setFromObject((V=this.map)==null?void 0:V.object3d);this.pencil.controls.setBoundary(I)}yield this.initVisBg()})}loaderAddBg(){this.options.bottomPlaneWater&&this.loader.add(["/image/water/normalMap0.jpg","/image/water/normalMap1.jpg"],{})}initMaterialBg(){return U0(this,null,function*(){if(this.options.parentBg){const n=(()=>{const V=new MeshStandardMaterial({name:"世界顶面",emissive:"#081417",color:"#000000"}),I=new MeshBasicMaterial({name:"世界侧面",color:"#051714",side:DoubleSide}),he=new Ut$1({name:"世界线",color:new Color$1("#50766E"),sizeAttenuation:!1,lineWidth:this.options.lineWidth});return{topMat:V,sideMat:I,lineMat:he}})();this.mList.addMultiple("worldPlane",n),this.options.adcode!==1e5&&(this.mList.copyMultiple("worldPlane","parentPlane"),Object.values(this.mList.getMultiple("parentPlane")).forEach(V=>{V.name=V.name.replace("世界","父级")}))}if(this.options.continentsBg){const n=(()=>{const V=new MeshStandardMaterial({name:"大洲板块顶面",emissive:"#154532"}),I=new MeshBasicMaterial({name:"大洲板块侧面",color:"#0c1528"}),he=new Ut$1({name:"大洲板块线",color:new Color$1("#09e6c1"),sizeAttenuation:!1,lineWidth:this.options.lineWidth});return{topMat:V,sideMat:I,lineMat:he}})();this.mList.addMultiple("continents",n)}})}consoleMousePostion(){this.addListener(this.container,"click",n=>{var he,fe;const V=this.unproject(n,this.mapObj.z+this.mapObj.depth),I=(fe=(he=this.projection).invert)==null?void 0:fe.call(he,[V.x,-V.y]);console.log("consoleMousePostion.postion",V),console.log("consoleMousePostion.lnglat",I)})}setAreaMaterialByProperty(n,V,I){if(!this.map)return;const he=this.map.areaArr.find(fe=>fe.userData[n]===V);if(he){const fe=he.object3d;let ye=this.mList.get("plane#topMat");I!=="origin"&&(ye=fe.material[0].clone(),I.color&&ye.color.set(I.color),I.emissive&&(ye.emissive.set(I.emissive),ye.emissiveIntensity=I.emissiveIntensity||1)),fe.material[0]=ye}}setLineMaterialByProperty(n,V,I){if(!this.map)return;const he=this.map.lineArr.find(fe=>fe.userData[n]===V);if(he){const fe=he.object3d;let ye=this.mList.get("plane#lineMat");I!=="origin"&&(ye=fe.material.clone(),I.color&&ye.color.set(I.color),I.width&&(ye.lineWidth=I.width)),fe.material=ye}}addAreaPlaneByProperty(n,V,I){return U0(this,null,function*(){if(!this.map)return;const fe=this.map.options.geojson.features.find(ye=>ye.properties&&ye.properties[n]===V);if(fe){let ye=I.material,ze=I.sideMaterial;if(y$1(I.sideMaterial)&&(ze=new MeshBasicMaterial(yi({},I.sideMaterial))),y$1(I.material)&&(ye=new MeshBasicMaterial(yi({},I.material))),I.area){const Ue=this.objectByUuid(I.area);Ue&&([ye,ze]=Ue.material)}let Fe=I.lineMaterial;if(y$1(I.lineMaterial)&&(Fe=new Ut$1(yi({},I.lineMaterial))),I.line){const Ue=this.objectByUuid(I.line);Ue&&(Fe=Ue.material)}const ke=yield this.lead.draw("PlaneMap",{geojson:{type:"FeatureCollection",features:[fe]},depth:I.depth||0,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:{topMat:ye,lineMat:Fe,sideMat:ze},areaGroup:!1},this.group);if(ke.position.z=this.mapObj.z+this.mapObj.depth+.01,I.lineBloom&&ke.lineArr.forEach(Ue=>{Ue.enableBloom()}),I.area){ke.position.z=0;const Ue=this.baseObjectByUuid(I.area);ke.areaArr.forEach(Oe=>{Ue!=null&&Ue.isBloom&&Oe.enableBloom(),Oe.scale.z=Ue.scale.z,Oe.position.z=Ue.position.z})}if(I.line){const Ue=this.baseObjectByUuid(I.line);ke.lineArr.forEach(Oe=>{Ue!=null&&Ue.isBloom&&Oe.enableBloom(),Oe.position.z=Ue.position.z})}return ke}})}showAction(){return U0(this,null,function*(){Zn(Vn.prototype,this,"showAction").call(this),this.useSaveCamera(`map-${this.options.adcode}`);const n=this.lead.group;if(this.mapHistory[0]){const{stop:V,start:I}=sinusoidalInOut({onUpdate:he=>{if(!this.mapHistory[0]){V();return}n.position.z=-this.mapHistory[0].depth*(1-he)}});yield I(),this.saveCamvasState("controls",0)}})}hide(){return U0(this,null,function*(){if(!this.showState)return;const n=this.lead.group;yield sinusoidalInOut({onUpdate:V=>{n.position.z=-this.mapHistory[0].depth*V}}).start(),setTimeout(()=>{Zn(Vn.prototype,this,"hide").call(this)})})}shadowMapEnabled(){return U0(this,null,function*(){if(this.pencil.scene.userData.shadowMapEnabled)return;this.pencil.scene.userData.shadowMapEnabled=!0;const n=yield this.lead.draw("Light",{type:"SpotLight",color:"#c1e6dd",intensity:1,distance:0,angle:.5,penumbra:1,decay:0});this.lead.updateBaseObjectKey(n,{type:"ShadowSpotLight"}),this.shadowMapLight=n,n.object3d.position.set(.281,32.487,43.077),n.object3d.castShadow=!0;const V=yield this.lead.draw("PlaneShadow");this.planeShadow=V})}shadowMapDisabled(){this.pencil.scene.userData.shadowMapEnabled&&(this.pencil.scene.userData.shadowMapEnabled=!1,this.shadowMapLight&&(this.shadowMapLight.erase(),this.shadowMapLight=void 0),this.planeShadow&&(this.planeShadow.erase(),this.planeShadow=void 0))}getOptionsDepth(n){const V=this.getAdcodeShowLevel(n);let I=this.options.mapDepth;Array.isArray(I)||(I=new Array(3).fill(I));let he;return V==="country"?he=I[0]:V==="province"?he=I[1]:he=I[2],he}getDepth(n,V){let I=this.getOptionsDepth(n);if(this.options.depthReference){const he=this.options.depthReference,fe=findAdcodeInfo(n).b;I=I*this.getReferenceScale(he,fe)}else if(this.mapHistory.length){const he=findAdcodeInfo(this.mapHistory[0].mapInfo.adcode).b,fe=this.getReferenceScale(he,V);I=I*fe}return I}getReferenceScale(n,V){const I=Math.abs(V[3]-V[1])/Math.abs(n[3]-n[1]),he=Math.abs(V[2]-V[0])/Math.abs(n[2]-n[0]);return Math.max(I,he)}getAdcodeShowLevel(n,V=!0){return getAdcodeShowLevel(n,V)}handleClick(n){const{drillDownRestrictions:V}=this.options;this.isAnimating||(n&&n.userData.adcode?this.getAdcodeShowLevel(n.userData.adcode,!1)!==V?this.showMap({adcode:n.userData.adcode}):this.emit("drilldownRestrictions",n.userData.adcode):!n&&this.mapHistory.length>1&&this.showMap({adcode:this.adcodes.at(-2)}))}beforeShowMap(n){return!0}getAdcodes(n){var he;const V=[];let I=n;for(;I&&(V.unshift(I),I!==this.options.adcode);)I=(he=findAdcodeInfo(I))==null?void 0:he.parent;return V}showMap(he){return U0(this,arguments,function*({adcode:n,adcodes:V,duration:I=1e3}){const fe=V||this.getAdcodes(n);(yield this.beforeShowMap(fe))!==!1&&(this.emit("beforeDrillDown",[...fe]),yield this.setAdcode({adcodes:fe,duration:I}),this.emit("afterDrillDown",[...fe]))})}drawLabels(){return U0(this,null,function*(){var I;const n=this.options.showLabel;if(!((I=this.mapArea)!=null&&I.length)||!n)return;let V=this.lead.getObject("Group",{key:"mapLabel"});V||(V=yield this.lead.draw("Group",{key:"mapLabel"},this.group),V.object3d.name="地图标签组",yield Promise.all(this.mapArea.map(he=>U0(this,null,function*(){let{name:fe,adcode:ye,centroid:ze}=he.userData;const{DistrictID:Fe,DistName:ke,iso_a2:Ue,center:Oe}=he.userData;if(ye=ye||Ue||Fe,ze=ze||Oe,fe=fe||ke,!ze)return;const nt=this.getLocationPosition(ze);if(this.lead.getObject("Node",{key:`mapLabel-${ye}`})||!nt)return;const[ot,zt,Zt]=nt;let at=fe;n==="lite"&&at&&(at=fe.replace(/自治州|地区|自治区|省|市|壮族|特别行政区|回族|维吾尔/g,""));const It=at&&getLabelElement(at),Lt=at!=null&&at.startsWith("澳门")?-1:0;yield this.lead.draw("Node",{position:new Vector3(ot,zt+Lt,Zt),children:It,key:`$p:-${this.options.adcode===0?fe:ye}`},V)}))))})}eraseLabels(){const n=this.lead.getObject("Group",{key:"mapLabel"});n==null||n.erase()}geAdcodePosition(n){var I;const V=(I=this.mapArea)==null?void 0:I.find(he=>he.userData.adcode===n);if(V){const{centroid:he,center:fe}=V.userData;return this.getLocationPosition(he||fe)}}getLocationPosition(n){const[V,I]=n,[he,fe]=this.projection([V,I]);return[he,-fe,this.mapObj?this.mapObj.z+this.mapObj.depth:0]}setObjectOnMap(n,V,I=0){const he=this.getLocationPosition(V);n.position.set(he[0],he[1],he[2]+I)}setObjectOnMapAreaByProperty(n,V,I,he=0){var ye;const fe=(ye=this.mapArea)==null?void 0:ye.find(ze=>ze.userData[V]===I);if(fe){const{centroid:ze,center:Fe}=fe.userData,ke=this.getLocationPosition(ze||Fe);n.position.set(ke[0],ke[1],ke[2]+he)}}getAdcodeScreenPosition(n){const V=this.geAdcodePosition(n);if(V){const[I,he,fe]=V,ye=new Vector3(I,he,fe);ye.project(this.pencil.camera);const{width:ze,height:Fe}=this.pencil.getSize(),ke=(ye.x*.5+.5)*ze,Ue=(ye.y*-.5+.5)*Fe;return{x:ke,y:Ue}}}booleanPointInCn(n){return chinaLiteJson.features[0].geometry.coordinates.some(V=>turf.booleanPointInPolygon(turf.point(n),turf.polygon(V)))}booleanPointInMap(n,V){var ye,ze;const I=V!=null?V:(ye=this.mapInfo)==null?void 0:ye.adcode;if(!I)return!1;const he=findAdcodeInfo(I);if(he!=null&&he.b){const[Fe,ke,Ue,Oe]=he.b,[nt,ot]=n;if(nt<Fe||nt>Ue||ot<ke||ot>Oe)return!1}const fe=(ze=this.options.extrudeLineGeojsonMap)==null?void 0:ze[I];return fe?fe.features.some(Fe=>{const ke=Fe.geometry.coordinates;return Fe.geometry.type==="Polygon"?ke.some(Ue=>turf.booleanPointInPolygon(turf.point(n),turf.polygon([Ue]))):Fe.geometry.type==="MultiPolygon"?ke.some(Ue=>Ue.some(Oe=>turf.booleanPointInPolygon(turf.point(n),turf.polygon([Oe])))):!1}):!1}getGeojson(n,V=!1){return U0(this,null,function*(){var he,fe,ye,ze,Fe;let I;if(V?I=this.options.extrudeLine?(ye=this.options.extrudeLineGeojsonMap)!=null&&ye[n]?{res:(ze=this.options.extrudeLineGeojsonMap)==null?void 0:ze[n]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json-lite/${n}.json`):{res:void 0}:I=(he=this.options.geojsonMap)!=null&&he[n]?{res:(fe=this.options.geojsonMap)==null?void 0:fe[n]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json/${n}.json`),I.res&&((Fe=this.options.geojsonExtensions)!=null&&Fe[n])){const ke=this.options.geojsonExtensions[n];let Ue;if(typeof ke=="number"){const{res:Oe}=yield jsonFetch(`${this.options.assetsPrefix}/geojson/json/${ke}.json`);Ue=Oe}else if(typeof ke=="string"){const{res:Oe}=yield jsonFetch(ke);Ue=Oe}else Ue=ke;I.res=Qi(yi({},I.res),{features:[...I.res.features,...Ue.features]})}return I})}handleDrillDown(ye){return U0(this,arguments,function*({adcode:n,duration:V,handleLook:I,saveBackCamvasState:he,extrudelineBloom:fe}){var ze,Fe,ke,Ue,Oe;if(typeof n!="undefined"&&!this.isAnimating){const nt=(ze=this.map)==null?void 0:ze.findGroup(n,!0),ot=findAdcodeInfo(+n);if(this.isAnimating||!ot)return;this.isAnimating=!0;const{name:zt}=ot;let{res:Zt}=yield this.getGeojson(n),{res:at}=yield this.getGeojson(n,!0);if(!this.options.showDistrict&&this.getAdcodeShowLevel(n)==="city"&&(Zt=at,at=void 0),[Zt,at].filter(Boolean).forEach(Lt=>{if(!Lt.features[0].properties.adcode&&/^\d{6}$/.test(`${n}`)){const Ft=findAdcodeInfo(n);Lt.features[0].properties=Qi(yi(yi({},Lt.features[0].properties),Ft),{center:[Ft.lng,Ft.lat]})}}),Zt){const Lt=this.options.plateInCenter&&(this.mapHistory.length<1||this.options.drillDownPlateInCenter);if((Fe=this.options.fixGeojson)!=null&&Fe[n]){const e0=(ke=this.options.fixGeojson)==null?void 0:ke[n];if(e0.startsWith("-")){const o0=+e0.slice(1);Zt.features=Zt.features.filter(b0=>b0.properties.adcode!==o0)}}let Ft=findAdcodeInfo(n).b;const kt=[...Ft];this.mapHistory.length===1&&!this.options.drillDownSecondLevelMats?Ft=findAdcodeInfo(this.mapInfo.adcode).b:this.mapHistory.length===2&&!this.options.drillDownThirdLevelMats&&(this.options.drillDownSecondLevelMats?Ft=findAdcodeInfo(this.mapInfo.adcode).b:Ft=findAdcodeInfo(this.mapHistory[0].mapInfo.adcode).b),this.eraseLabels(),this.map&&(this.options.drillDownHideParent&&this.parentBg.forEach(e0=>{e0.hide()}),this.options.showOneLevel?this.map.hide():this.map.deactive(),he&&this.saveCamvasState("userControls",-1));const Kt=this.mapHistory.length,Ht=Kt-1,Bt=this.getDepth(n,kt),Yt=(Ue=this.mapHistory[Ht])==null?void 0:Ue.depth,Jt=Kt===0||this.options.showOneLevel?0:this.mapHistory[Ht].z+Yt,Qt=Kt===0||this.options.showOneLevel?0:Jt-Bt,n0=turf.center(Zt).geometry.coordinates,[a0,l0]=this.projection(n0),s0=yield this.drawPlaneMap({geojson:Zt,extrudeLineGeojson:at,depth:Bt,bbox:Ft,adcode:n,extrudelineBloom:fe});nt==null||nt.hide(),s0.position.setZ(Qt);const $t=s0.position.z,qt=()=>U0(this,null,function*(){yield sinusoidalInOut({onUpdate:e0=>{Jt!==$t&&(s0.position.z=$t+(Jt-$t)*e0)}}).start({duration:V})});if(Lt)if(this.fixNear(n),s0.position.z=Jt,I){const e0=(Oe=this.mapHistory.at(-1))==null?void 0:Oe.controls;yield this.fitTo(s0,{z:Jt+Bt,adcode:n,enableTransition:V!==0,polarAngle:e0==null?void 0:e0.polarAngle,azimuthAngle:e0==null?void 0:e0.azimuthAngle,handleStart:()=>U0(this,null,function*(){s0.position.z=$t,yield qt()})})}else this.options.showOneLevel&&s0.hide();else yield qt();this.mapHistory.push({map:s0,mapInfo:ot,z:Jt,depth:Bt,cX:a0,cY:-l0}),I&&this.drawLabels(),this.saveCamvasState("controls",-1)}else console.log(`${zt}的地图数据不存在`);this.event.emit("handleDrillDown",{adcode:n,z:this.mapObj.z+this.mapObj.depth})}this.isAnimating=!1})}saveCamvasState(n,V){const I=this.mapHistory.at(V);I&&(I[n]={lookAt:[...this.pencil.cameraPositon.toArray(),...this.pencil.cameraTarget.toArray()],polarAngle:this.pencil.controls.polarAngle,azimuthAngle:this.pencil.controls.azimuthAngle})}fixNear(n){const V=this.getAdcodeShowLevel(n),I=this.pencil.options;n===0?(this.pencil.camera.near=1,this.pencil.camera.far=1e3,this.pencil.camera.updateProjectionMatrix()):(V==="country"||V==="province")&&this.pencil.camera.near!==I.camera.near*10?(this.pencil.camera.near=I.camera.near*10,this.pencil.camera.updateProjectionMatrix()):(V==="city"||V==="district")&&this.pencil.camera.near!==I.camera.near&&(this.pencil.camera.near=I.camera.near,this.pencil.camera.updateProjectionMatrix())}fitTo(Fe){return U0(this,arguments,function*(n,{polarAngle:V,azimuthAngle:I,z:he,handleStart:fe,adcode:ye,enableTransition:ze=!0}={}){if(!(n!=null&&n.object3d))return;if(ye&&(yield this.useSaveCamera(`map-${ye}`,ze))){fe&&(yield fe());return}const ke=this.options.mapPadding,{height:Ue,width:Oe}=this.pencil.getSize();Ue<ke[0]+ke[2]+50&&(ke[0]=0,ke[2]=0),Oe<ke[1]+ke[3]+50&&(ke[1]=0,ke[3]=0);const nt=V!=null?V:this.options.polarAngle,ot=I!=null?I:this.options.azimuthAngle,zt=this.pencil.cameraPositon.toArray(),Zt=this.pencil.cameraTarget.toArray();yield this.paddingInCssPixel(n,ke[0],ke[1],ke[2],ke[3],!1);let at;he&&(at=this.pencil.cameraTarget.toArray(),yield this.pencil.controls.setTarget(at[0],at[1],he,!1)),yield this.pencil.controls.rotateTo(ot,nt,!1),at=this.pencil.cameraTarget.toArray();const It=this.pencil.cameraPositon.toArray();yield this.lookAt(...zt,...Zt),yield Promise.all([this.lookAt(...It,...at,ze),fe==null?void 0:fe()].filter(Boolean))})}drawPlaneMap(ze){return U0(this,arguments,function*({geojson:n,extrudeLineGeojson:V,bbox:I,depth:he,extrudelineBloom:fe,adcode:ye}){var zt;const Fe=[this.mList.getMultiple("plane"),this.mList.getMultiple("secondPlane"),this.mList.getMultiple("thirdPlane")];let ke=this.mapHistory.length,Ue=null;for(;Ue===null;)Ue=Fe[ke],ke--;const Oe=this.mList.getMultiple("bgPlane"),nt=yi(yi({},Ue),Oe?{bgTopMat:Oe.topMat,bgSideMat:Oe.sideMat,bgLineMat:Oe.lineMat,bgExtrudeLineMat:Oe.extrudeLineMat}:{}),ot=yield this.lead.draw("PlaneMap",{key:`${ye}`,geojson:n,extrudeLineGeojson:V,depth:he,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:nt,bbox:I,topSegments:this.options.topSegments,lineOffset:this.options.lineOffset,mergeSide:this.options.mergeSide},this.group);return ot.object3d.name=((zt=findAdcodeInfo(ye))==null?void 0:zt.name)||`${ye}`,this.options.style==="map2CityOnMap"&&!this.options.showCityOnMapInnerLine&&(Ue.lineMat.colorWrite=!1,ot.lineArr.forEach(Zt=>{Zt.userData.selectHide=!0})),ot.extrudelineArr&&ot.extrudelineArr.forEach(Zt=>{Zt.object3d.name="板块边线",this.lead.updateBaseObjectKey(Zt,{type:"extrudeLine",key:this.mapHistory.length?"$p:":void 0}),this.initBaseObjectUserData(Zt),fe&&(Zt.object3d.userData.bloom=!0)}),ot.lineArr&&ot.lineArr.forEach(Zt=>{this.initBaseObjectUserData(Zt)}),ot})}handleBack(){return U0(this,arguments,function*({duration:n=1e3,handleLookBack:V=!0,keepOne:I=!0}={}){if(this.isAnimating||(I?this.mapHistory.length<=1:this.mapHistory.length===0))return;this.emit("beforeDrillBack",this.adcodes.slice(0,-1)),this.isAnimating=!0;const he=this.mapHistory.pop();if(!this.options.drillDownPlateInCenter){const fe=he.map.position.z,ye=this.mapObj?this.mapObj.z+(this.mapObj.depth-he.depth):0;yield sinusoidalInOut({onUpdate:ze=>{he.map.position.z=fe+(ye-fe)*ze}}).start({duration:n})}if(this.lead.eraseWithoutMaterial(he.map),this.eraseLabels(),this.mapObj){const{map:fe}=this.mapObj,ye=fe==null?void 0:fe.findGroup(he.mapInfo.adcode,!0);ye&&ye.show(),fe&&V&&(this.options.showOneLevel?fe.show():fe.active(),this.options.drillDownHideParent&&this.parentBg.forEach(ze=>{ze.show()}),yield this.handleLookBack(n),this.drawLabels())}this.emit("handleBack",{adcodes:this.adcodes}),this.emit("afterDrillBack",[...this.adcodes]),this.isAnimating=!1})}handleLookBack(n){return U0(this,null,function*(){const{userControls:V,controls:I}=this.mapObj;yield this.pencil.controls.setLookAt(...V?V.lookAt:I.lookAt,n!==0)})}compareLocations(n,V){const I=n.filter(ze=>ze),he=V.filter(ze=>ze),fe=[];let ye=0;for(let ze=0;ze<Math.min(I.length,he.length)&&I[ze]===he[ze];ze++)ye++;for(let ze=ye;ze<I.length;ze++)fe.push(-1);for(let ze=ye;ze<he.length;ze++)fe.push(he[ze]);return fe}setAdcode(I){return U0(this,arguments,function*({adcodes:n,duration:V}){var fe,ye,ze;const{adcodes:he}=this;if(!(JSON.stringify(n)===JSON.stringify(he)||this.isAnimating))if(JSON.stringify(n)===JSON.stringify([0]))try{yield this.handleDrillDown({adcode:0,duration:V,handleLook:!0})}catch(nt){console.error(nt)}else{const{continent:nt,country:ot,province:zt,city:Zt,district:at}=n.reduce((Jt,Qt)=>{const n0=this.getAdcodeShowLevel(Qt);return Jt[n0]=Qt,Jt},{}),{continent:It,country:Lt,province:Ft,city:kt,district:Kt}=he.reduce((Jt,Qt)=>{const n0=this.getAdcodeShowLevel(Qt);return Jt[n0]=Qt,Jt},{}),Ht=nt||It,Bt=(ze=(ye=(fe=this.map)==null?void 0:fe.extrudelineArr)==null?void 0:ye[0])==null?void 0:ze.object3d.userData.bloom,Yt=this.compareLocations([It,Lt,Ft,kt,Kt],[nt,ot,zt,Zt,at]);try{for(var Fe=Jn(Yt.entries()),ke,Ue,Oe;ke=!(Ue=yield Fe.next()).done;ke=!1){const[Jt,Qt]=Ue.value;const n0=Jt===Yt.length-1?V:0,a0=Jt===Yt.length-1;Qt===-1?yield this.handleBack({duration:n0,handleLookBack:a0,keepOne:!Ht}):yield this.handleDrillDown({adcode:Qt,duration:n0,handleLook:a0,saveBackCamvasState:Yt.includes(-1)?!1:this.options.handleBackKeepCamvasState,extrudelineBloom:Bt})}}catch(Ue){Oe=[Ue]}finally{try{ke&&(Ue=Fe.return)&&(yield Ue.call(Fe))}finally{if(Oe)throw Oe[0]}}}})}setPadding(n,V=!1,I=!1){this.options.mapPadding=[...n],V&&this.fitTo(this.map,{enableTransition:I})}findAdcodeInfo(n){return findAdcodeInfo(n)}dispose(){var n,V,I;(n=this.editor)==null||n.events.removeAllListeners(),this.cityVis.forEach(he=>{he.dispose()}),this.cityVis.length=0,(V=this.map)==null||V.dispose(),this.parentBg.forEach(he=>{he.dispose()}),this.parentBg.length=0,(I=this.continentsBg)==null||I.dispose(),this.continentsBg=void 0,this.mapHistory.length=0,super.dispose()}};C0(Vn,"VisName","map");let Map$1=Vn;class MapManager{constructor(e){C0(this,"container");C0(this,"controlsContainer");C0(this,"assetsPrefix");C0(this,"fixConfig");C0(this,"raycasterPointsThreshold");C0(this,"MAX_ZOOM_FACTOR",.3);C0(this,"MIN_ZOOM_FACTOR",4);C0(this,"mapInstances",{});C0(this,"mapDistances",{});C0(this,"mapConfigs",{});C0(this,"currentMap",null);C0(this,"currentZoom",1);C0(this,"mapPadding");C0(this,"isInitializing",!1);C0(this,"rmTemplateIdentifier");C0(this,"groups",{});C0(this,"eventHandlers",{});C0(this,"areaCloseTimer",null);var n;this.container=e.container,this.controlsContainer=e.controlsContainer||e.container,this.assetsPrefix=e.assetsPrefix,this.fixConfig=e.fixConfig,this.raycasterPointsThreshold=e.raycasterPointsThreshold||.005,this.mapPadding=e.mapPadding||[0,0,0,0],this.rmTemplateIdentifier=(n=e.rmTemplateIdentifier)!=null?n:!1}setEventHandlers(e){this.eventHandlers=yi(yi({},this.eventHandlers),e)}emit(e,...n){const V=this.eventHandlers[e];V&&typeof V=="function"&&V(...n)}getCurrentMap(){return this.currentMap}getCurrentZoom(){return this.currentZoom}initMap(e,n=!1){return U0(this,null,function*(){if(this.isInitializing)return console.warn("地图正在初始化中,请等待完成"),this.currentMap;const V=e.at(-1)||e.at(-2);if(!V)return null;try{return this.isInitializing=!0,yield this.createMapInstance(V,n)}finally{this.isInitializing=!1}})}createMapInstance(e,n=!1){return U0(this,null,function*(){var ke,Ue;const V=Object.values(this.mapInstances)[0],I=(ke=getAdcodeShowLevel(e))!=null?ke:"country",he=findAdcodeInfo(e),fe=V==null?void 0:V.pencil;this.container.style.cursor="default";const ye=this.mapInstances[I];if(ye)if(ye.pencil.controls.maxDistance=1/0,ye.pencil.controls.minDistance=0,ye.options.adcode===e&&!n&&!ye.options.fixedAdcode){ye.setSceneActive(),this.currentMap=ye,ye.pencil.controls.maxDistance=this.mapDistances[I]/this.MAX_ZOOM_FACTOR,ye.pencil.controls.minDistance=this.mapDistances[I]/this.MIN_ZOOM_FACTOR;const Oe=ye.pencil.controls.distance,nt=Math.round(this.mapDistances[I]/Oe*10)/10;return this.currentZoom!==nt&&(this.currentZoom=nt,this.emit("zoomChange",nt)),ye}else ye.options.pencil=fe,ye.dispose(),delete this.mapInstances[I];const ze=new Map$1({container:this.container,controlsContainer:this.controlsContainer,assetsPrefix:this.assetsPrefix,pencil:fe});let Fe=0;return yield ze.fromJSON((Ue=this.mapConfigs[I])!=null?Ue:`/${I}.gz`,{preprocessor:Oe=>U0(this,null,function*(){if(Fe=Oe.h.u[0].visOptions.adcode,this.rmTemplateIdentifier&&delete Oe.h.u[0].visOptions.__template,I==="province"||I==="city"||I==="district"){const nt=yield getMapConfig(e,this.assetsPrefix,Oe.h.u[0].visOptions,Oe.h.i);he!=null&&he.c.length&&(nt.showBuilding=!1),Oe.h.u[0].visOptions=nt}return Oe}),useCache:!0}),ze.pencil.camera.near=.01,ze.pencil.camera.updateProjectionMatrix(),ze.pencil.raycaster.params.Points.threshold=this.raycasterPointsThreshold,ze.pencil.controls.addEventListener("update",()=>{const Oe=ze.pencil.controls.distance,nt=Math.round(this.mapDistances[I]/Oe*10)/10;this.currentZoom!==nt&&(this.currentZoom=nt,this.emit("zoomChange",nt))}),I!=="country"&&(ze.options.mapPadding=this.mapPadding,ze.options.polarAngle=-Math.PI,yield ze.fitTo(ze.map,{enableTransition:!1}),yield ze.fitTo(ze.map,{enableTransition:!1})),this.applyFixConfig(ze,I,Fe,e),he!=null&&he.c.length&&!n&&this.bindAreaEvents(ze),this.mapInstances[I]=ze,ze.setSceneActive(),this.currentMap=ze,this.currentZoom=1,this.emit("zoomChange",1),this.mapDistances[I]=ze.pencil.controls.distance,ze.pencil.controls.maxDistance=ze.pencil.controls.distance/this.MAX_ZOOM_FACTOR,ze.pencil.controls.minDistance=ze.pencil.controls.distance/this.MIN_ZOOM_FACTOR,ze.options.fixedAdcode=n,ze})}applyFixConfig(e,n,V,I){if(!this.fixConfig)return;const he=this.fixConfig[`${n}`];if(!he)return;const fe=e.findAdcodeInfo(V),ye=e.findAdcodeInfo(I),ze=e.getReferenceScale(fe.b,ye.b);[...he.s].forEach(Fe=>{const ke=e.baseObjectByUuid(Fe);if(ke){ke.scale.multiplyScalar(ze);const{center:Ue}=e.map.getSize();ke.position.x=Ue.x,ke.position.y=Ue.y}}),[...he.z].forEach(Fe=>{const ke=e.baseObjectByUuid(Fe);ke&&(ke.position.z*=ze)})}bindAreaEvents(e){const n={};e.mapArea.forEach(V=>{var fe;V.lead.enableCursor(V);const I=V.userData.adcode,he=e.cityVis.length===1?e.cityVis[0]:e.cityVis.find(ye=>ye.options.adcode===I);if(he){const ye=(fe=n[he.options.adcode])!=null?fe:he.group.getSize().max.z;n[he.options.adcode]=ye}V.onPointerEnter(({mouseEvent:ye})=>{if(this.clearAreaCloseTimer(),V.useMListByName("顶面高亮",0),he&&(V.position.z=n[he.options.adcode]-e.mapObj.depth),!(V.userData.centroid||V.userData.center))return;const{max:Fe,center:ke}=V.getSize(),Ue=e.getScreenPosition(ke.x,ke.y,Fe.z);this.emit("areaHover",{areaName:V.userData.name,x:Ue.x,y:Ue.y,mouseLeft:ye.clientX,mouseTop:ye.clientY})}),V.onPointerMove(()=>{this.clearAreaCloseTimer()}),V.onPointerLeave(()=>{V.useMListByName("顶面",0),he&&(V.position.z=0),this.triggerAreaLeave({areaName:V.userData.name})}),V.onClick(()=>{V.useMListByName("顶面",0),he&&(V.position.z=0),this.emit("areaClick",{areaName:V.userData.name,adcode:V.userData.adcode})})})}setZoom(e){var he;if(!this.currentMap||this.currentZoom===e)return;const n=(he=getAdcodeShowLevel(this.currentMap.options.adcode))!=null?he:"country",V=this.mapDistances[n];if(!V)return;const I=V/e;this.currentZoom=e,this.currentMap.pencil.controls.distance=I}createGroup(e){return U0(this,null,function*(){if(!this.currentMap)return null;e in this.groups&&this.clearGroup(e);const n=yield this.currentMap.addGroup();return this.groups[e]=n,n})}getGroup(e){return this.groups[e]}clearGroup(e){const n=this.groups[e];n&&(n.erase(),delete this.groups[e])}clearAllGroups(){Object.values(this.groups).forEach(e=>{e.erase()}),this.groups={}}clearAreaCloseTimer(){this.areaCloseTimer&&(clearTimeout(this.areaCloseTimer),this.areaCloseTimer=null)}triggerAreaLeave({areaName:e}={areaName:""}){this.currentMap&&(this.clearAreaCloseTimer(),this.areaCloseTimer=setTimeout(()=>{this.emit("areaLeave",{areaName:e})},200))}dispose(){this.areaCloseTimer&&(clearTimeout(this.areaCloseTimer),this.areaCloseTimer=null),this.clearAllGroups(),Object.values(this.mapInstances).forEach(e=>{e.dispose()}),this.mapInstances={},this.currentMap=null,Editor.clearUrlCache()}}C0(MapManager,"findAdcodeInfoByName",findAdcodeInfoByName),C0(MapManager,"getAdcodeShowLevel",getAdcodeShowLevel),C0(MapManager,"findAdcodeInfo",findAdcodeInfo),C0(MapManager,"extendsAdcodeAll",extendsAdcodeAll);const access={set token(E){accessToken.token=E}},VERSION=version;exports.Base=Base;exports.City=City$1;exports.Earth=index;exports.Map=Map$1;exports.MapManager=MapManager;exports.THREE=THREE;exports.TWEEN=tween_esm;exports.VERSION=VERSION;exports.access=access;exports.animationUtils=animation;exports.getCityConfig=getCityConfig;exports.getMapConfig=getMapConfig;exports.removeCameraHistory=removeCameraHistory;
|
|
5366
|
+
`,e},worldPacificCentre=E=>{E.loaderAdd=function(){const e=this.loader;e.add(["/image/map/jianbian.webp"]),e.add(["/image/map/hp2.webp","/image/map/fx2.webp"])},E.initMaterial=function(){return U0(this,null,function*(){const e=this.loader,n=this.mList,V=(()=>{const I=e.getAsset("/image/map/hp2.webp");I.center.set(.5,.5),I.repeat.set(.97,1.01);const he=new MeshStandardMaterial({name:"顶面",map:e.getAsset("/image/map/hp2.webp"),normalMap:e.getAsset("/image/map/fx2.webp"),normalScale:new Vector2(2,1)}),fe=new MeshBasicMaterial({name:"侧面",map:e.getAsset("/image/map/jianbian.webp")}),ye=new Ut$1({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),ze=new Ut$1({name:"板块边线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:he,sideMat:fe,lineMat:ye,extrudeLineMat:E.options.extrudeLine?ze:null}})();n.addMultiple("plane",V)})}},world=E=>{if(E.options.lineOffset=.02,delete E.extendsOptions.handleBackKeepCamvasState,E.extendsOptions.extrudeLine=()=>E.options.extrudeLine,E.extendsOptions.worldPacificCentre=()=>E.options.worldPacificCentre,E.options.worldPacificCentre){worldPacificCentre(E);return}E.initMaterial=function(){return U0(this,null,function*(){const e=this.mList,n=(()=>{const V=new MeshBasicMaterial({name:"顶面",color:"#0d2425"}),I=new MeshBasicMaterial({name:"侧面",color:"#0d2425"}),he=new Ut$1({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),fe=new Ut$1({name:"板块边线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:V,sideMat:I,lineMat:he,extrudeLineMat:E.options.extrudeLine?fe:null}})();e.addMultiple("plane",n)})}},china=E=>{E.options.lineOffset=.005,E.loaderAdd=function(){return U0(this,null,function*(){this.loader.add(["/image/map/jianbian.webp","/image/map/hp.webp","/image/map/shuchu2.webp"]),this.loaderAddBg()})},E.initMaterial=function(){return U0(this,null,function*(){const e=this.loader,n=(()=>{const V=new MeshStandardMaterial({name:"顶面",map:e.getAsset("/image/map/hp.webp"),normalMap:e.getAsset("/image/map/shuchu2.webp")}),I=new MeshBasicMaterial({name:"侧面",map:e.getAsset("/image/map/jianbian.webp")}),he=new Ut$1({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),fe=new Ut$1({name:"板块边线",color:new Color$1("#00FFED"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:V,sideMat:I,lineMat:he,extrudeLineMat:fe}})();this.mList.addMultiple("plane",n),this.options.drillDownFirstLevelUseBgMats&&this.mList.copyMultiple("plane","bgPlane"),this.options.drillDownSecondLevelMats&&this.mList.copyMultiple("plane","secondPlane"),this.options.drillDownThirdLevelMats&&this.mList.copyMultiple("plane","thirdPlane"),this.initMaterialBg()})}},base$1=E=>{E.loaderAdd=function(){return U0(this,null,function*(){this.loader.add(["/image/map/jianbian.webp"]),this.loaderAddBg()})},E.initMaterial=function(){return U0(this,null,function*(){const e=this.loader,n=(()=>{const V=new MeshBasicMaterial({name:"顶面",color:new Color$1("#0d2425")}),I=new MeshBasicMaterial({name:"侧面",map:e.getAsset("/image/map/jianbian.webp")}),he=new Ut$1({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),fe=new Ut$1({name:"板块边线",color:new Color$1("#00FFED"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:V,sideMat:I,lineMat:he,extrudeLineMat:fe}})();this.mList.addMultiple("plane",n),this.options.drillDownFirstLevelUseBgMats&&this.mList.copyMultiple("plane","bgPlane"),this.options.drillDownSecondLevelMats&&this.mList.copyMultiple("plane","secondPlane"),this.options.drillDownThirdLevelMats&&this.mList.copyMultiple("plane","thirdPlane"),this.initMaterialBg()})}},cityOnMap=E=>{E.extendsOptions={mapDepth:E.options.mapDepth,parentBg:E.options.parentBg,continentsBg:E.options.continentsBg,continentsBgDepth:E.options.continentsBgDepth,mergeSide:E.options.mergeSide,handleBackKeepCamvasState:E.options.handleBackKeepCamvasState,mapBoundary:E.options.mapBoundary,showBuilding:E.options.showBuilding,showRoad:E.options.showRoad,showGrassland:E.options.showGrassland,showRiver:E.options.showRiver,buildingSideGradient:E.options.buildingSideGradient,buildingHasSide:E.options.buildingHasSide,setWaterMaterial:E.options.setWaterMaterial,showCityOnMapInnerLine:E.options.showCityOnMapInnerLine},E.options.parentBg&&(E.extendsOptions.parentBgDepth=()=>E.options.parentBgDepth),E.loaderAdd=function(){this.loader.add(["/image/map2/side.png"])},E.initMaterial=function(){return U0(this,null,function*(){const n=this.loader,V=(()=>{const I=new MeshBasicMaterial({name:"板块顶面",color:"#094253"}),he=new MeshBasicMaterial({name:"板块侧面",map:n.getAsset("/image/map2/side.png"),side:DoubleSide}),fe=new Ut$1({name:"板块边框",color:new Color$1("#02f7eb"),lineWidth:1.8,sizeAttenuation:!1,depthTest:!1}),ye=new Ut$1({name:"板块内线",color:new Color$1("#02f7eb"),lineWidth:1.8,sizeAttenuation:!1,depthTest:!1});return{topMat:I,sideMat:he,lineMat:ye,extrudeLineMat:fe}})();this.mList.addMultiple("plane",V),this.initMaterialBg()})};const e=E.init.bind(E);E.init=function(){return U0(this,null,function*(){yield e(),yield this.initCityOnMap(this.mapInfo.adcode)})}},base=E=>{if(E.initMaterialBg=function(){return U0(this,null,function*(){const e=this.getRoomEnvMap();if(this.options.parentBg){if(this.options.adcode!==1e5){const V=(()=>{const I=new MeshStandardMaterial({name:"父级顶面",color:"#031529",emissive:"#010f1f",envMap:e}),he=new MeshBasicMaterial({name:"父级侧面",color:"#064d73",side:DoubleSide}),fe=new Ut$1({name:"父级板块线",color:new Color$1("#3f648c"),lineWidth:1.2,sizeAttenuation:!1});return{topMat:I,sideMat:he,lineMat:fe}})();this.mList.addMultiple("parentPlane",V)}const n=(()=>{const V=new MeshStandardMaterial({name:"世界顶面",color:"#031529",emissive:"#010f1f",envMap:e}),I=new MeshBasicMaterial({name:"世界侧面",color:"#064d73",side:DoubleSide}),he=new Ut$1({name:"世界板块线",color:new Color$1("#3f648c"),lineWidth:1.2,sizeAttenuation:!1});return{topMat:V,sideMat:I,lineMat:he}})();this.mList.addMultiple("worldPlane",n)}if(this.options.continentsBg){const n=(()=>{const V=new MeshStandardMaterial({name:"大洲板块顶面",emissive:"#235278"}),I=new MeshBasicMaterial({name:"大洲板块侧面",color:"#0c1528"}),he=new Ut$1({name:"大洲板块线",color:new Color$1("#1488e0"),sizeAttenuation:!1,lineWidth:this.options.lineWidth});return{topMat:V,sideMat:I,lineMat:he}})();this.mList.addMultiple("continents",n)}})},E.options.style==="map2CityOnMap"){cityOnMap(E);return}E.loaderAdd=function(){return U0(this,null,function*(){this.loaderAddBg()})},E.initMaterial=function(){return U0(this,null,function*(){const e=(()=>{const n=new MeshBasicMaterial({name:"板块顶面",color:new Color$1("#064773")}),V=new MeshBasicMaterial({name:"板块侧面",color:new Color$1("#064d73"),side:DoubleSide}),I=new Ut$1({name:"板块线",color:new Color$1("#02BAF7"),lineWidth:1,sizeAttenuation:!1}),he=new Ut$1({name:"板块边框线",color:new Color$1("#02BAF7"),lineWidth:1,sizeAttenuation:!1});return{topMat:n,sideMat:V,lineMat:I,extrudeLineMat:he}})();this.mList.addMultiple("plane",e),this.options.drillDownFirstLevelUseBgMats&&this.mList.copyMultiple("plane","bgPlane"),this.initMaterialBg()})}},Vn=class Vn extends Base{constructor(){super(...arguments);C0(this,"leadObjs",objs);C0(this,"mapHistory",[]);C0(this,"activePlaneMap",null);C0(this,"isAnimating",!1);C0(this,"parentBg",[]);C0(this,"continentsBg");C0(this,"group");C0(this,"projection");C0(this,"pcenter",[104,37.5]);C0(this,"pscale",5e4/1e3);C0(this,"meters");C0(this,"cityVis",[]);C0(this,"extendsOptions",{mapDepth:()=>this.getOptionsDepth(this.options.adcode),equirectangular:()=>this.options.projectionType==="equirectangular",mapBoundary:()=>this.options.mapBoundary,mergeSide:()=>this.options.mergeSide});C0(this,"initSettingsObj",{label:!1,labelLite:!1,shadowMap:!1});C0(this,"caId");C0(this,"shadowMapLight");C0(this,"planeShadow")}get mapObj(){return this.mapHistory[this.mapHistory.length-1]}get map(){var n;return(n=this.mapObj)==null?void 0:n.map}get mapInfo(){var n;return(n=this.mapObj)==null?void 0:n.mapInfo}get mapArea(){var n;return(n=this.map)==null?void 0:n.areaArr}get mapLine(){var n;return(n=this.map)==null?void 0:n.lineArr}get adcodes(){return this.mapHistory.map(n=>n.mapInfo.adcode)}setOptions(n){n.continentType;const V=yi(yi({0:worldExclATAJson,1e5:chinaJson},continentsJson),n==null?void 0:n.geojsonMap);let I=yi({0:worldExclATALiteJson,1e5:chinaLiteJson},continentsLiteJson);Object.keys(V).forEach(he=>{he!=="100000"&&/^\d{6}$/.test(he)&&V[+he].features.forEach(ye=>{const ze=ye.properties.adcode;I[ze]={type:"FeatureCollection",features:[ye]}})}),I=yi(yi({},I),n==null?void 0:n.extrudeLineGeojsonMap),super.setOptions(Qi(yi({parentBg:!1,continents:"",continentsBg:!1,continentsBgDepth:0,parentBgDepth:0,topSegments:0,clickHandleDrillDown:!1,drillDownSecondLevelMats:!1,drillDownFirstLevelUseBgMats:!1,drillDownThirdLevelMats:!1,clickOusideBack:!0,mapDepth:[1,.4,.2],mapPadding:[100,100,100,100],plateInCenter:!0,drillDownPlateInCenter:!0,drillDownHideParent:!1,showOneLevel:!1,drillDownRestrictions:"district",showDistrict:!0,showLabel:!1,lineWidth:.6,lineOffset:0,extrudeLineWidth:1.8,extrudeLine:!0,equirectangular:!1,winkel3:!1,projectionType:"mercator",polarAngle:n.style==="map2CityOnMap"?Math.PI/180*60:Math.PI/180*120,azimuthAngle:0,handleBackKeepCamvasState:!1,worldPacificCentre:!1,mapBoundary:!0,mergeSide:!1,bottomPlane:!1,bottomPlaneWater:!1,showBuilding:!0,buildingSideGradient:!1,buildingHasSide:!0,showRoad:!0,cacheCity:!0,showGrassland:!0,showRiver:!0,setWaterMaterial:!1,showCityOnMapInnerLine:!1,nearbyCities:!1,citySSAO:!1},n),{geojsonMap:V,extrudeLineGeojsonMap:I,geojsonExtensions:(n==null?void 0:n.geojsonExtensions)||{}})),this.options.equirectangular&&(this.options.projectionType="equirectangular"),this.options.winkel3&&(this.options.projectionType="winkel3"),this.options.adcode===0?this.extendsOptions.winkel3=()=>this.options.winkel3:(this.getAdcodeShowLevel(this.options.adcode)==="province"||this.getAdcodeShowLevel(this.options.adcode)==="country")&&(this.extendsOptions.clickHandleDrillDown=()=>this.options.clickHandleDrillDown,this.options.clickHandleDrillDown&&(this.extendsOptions.mapDepth=()=>Array.isArray(this.options.mapDepth)?this.options.mapDepth:new Array(3).fill(this.options.mapDepth),this.extendsOptions.drillDownFirstLevelUseBgMats=()=>this.options.drillDownFirstLevelUseBgMats,this.extendsOptions.drillDownSecondLevelMats=()=>this.options.drillDownSecondLevelMats,this.extendsOptions.drillDownThirdLevelMats=()=>this.options.drillDownThirdLevelMats,this.extendsOptions.drillDownPlateInCenter=()=>this.options.drillDownPlateInCenter,this.extendsOptions.clickOusideBack=()=>this.options.clickOusideBack,this.extendsOptions.handleBackKeepCamvasState=()=>this.options.handleBackKeepCamvasState,this.extendsOptions.showOneLevel=()=>this.options.showOneLevel,this.extendsOptions.showDistrict=()=>this.options.showDistrict,this.options.parentBg&&(this.extendsOptions.drillDownHideParent=()=>this.options.drillDownHideParent)),this.extendsOptions.parentBg=()=>this.options.parentBg,this.options.parentBg&&(this.extendsOptions.parentBgDepth=()=>this.options.parentBgDepth,this.options.adcode===1e5&&(this.extendsOptions.worldPacificCentre=()=>this.options.worldPacificCentre)),this.extendsOptions.continentsBg=()=>this.options.continentsBg,this.options.continentsBg&&(this.extendsOptions.continentsBgDepth=()=>this.options.continentsBgDepth)),this.options.adcode===0?world(this):this.options.style==="map2Base"||this.options.style==="map2CityOnMap"?base(this):this.options.adcode===1e5?china(this):base$1(this)}handleSetting(n,V){return U0(this,null,function*(){return yield Zn(Vn.prototype,this,"handleSetting").call(this,n,V),n==="label"?V===!1?(this.eraseLabels(),this.options.showLabel=!1):(this.settings.labelLite=!1,yield this.settings.labelLite,this.options.showLabel=!0,yield this.drawLabels()):n==="labelLite"?V===!1?(this.eraseLabels(),this.options.showLabel=!1):(this.settings.label=!1,yield this.settings.label,this.options.showLabel="lite",yield this.drawLabels()):n==="shadowMap"&&(V===!1?this.shadowMapDisabled():yield this.shadowMapEnabled()),V})}init(){return U0(this,null,function*(){const{adcode:n}=this.options;this.options.center&&(this.pcenter=this.options.center),this.options.worldPacificCentre&&n===1e5&&(this.pcenter=[this.pcenter[0]-160,this.pcenter[1]]),this.projection=f({center:this.pcenter,scale:this.pscale,projectionType:this.options.projectionType,rotate:this.options.worldPacificCentre?[-160,0]:void 0}),this.meters=this.projection([1*1141e-8+this.pcenter[0],0])[0],yield this.initPencil(),console.time(`vis-core:time.${this.visName}-loader`),this.loaderAdd(),console.timeEnd(`vis-core:time.${this.visName}-loader`),yield this.loader.loadAll(),this.group=yield this.lead.draw("Group",{key:"map"+n}),this.group.object3d.name="地图",yield this.initMaterial(),yield this.initVis(n),this.options.clickHandleDrillDown&&(this.lead.handlePick(()=>(console.log("handlePick",this.mapArea),this.mapArea||[]),"down",({baseObject:V,mouseEvent:I})=>{(this.playing||I.metaKey||I.ctrlKey)&&this.handleClick(V)}),this.options.clickOusideBack&&this.lead.handlePick(()=>(console.log("handlePick outside",this.map),this.map?[this.map]:[]),"downOutside",({mouseEvent:V})=>{(this.playing||V.metaKey||V.ctrlKey)&&this.handleClick()})),yield Promise.all(this.lead.objectsPromise)})}initCityVis(n,V=!1){return U0(this,null,function*(){const I=new City({container:this.container,editor:!1}),he=getCityConfig(n);I.setOptions({container:this.container,center:he.center,grey:V,adcode:n,cacheKey:this.options.cacheCity?`${n}`:void 0,jsonName:he.jsonName,showBuilding:this.options.showBuilding,buildingSideGradient:this.options.buildingSideGradient,buildingHasSide:this.options.buildingHasSide,showRoad:this.options.showRoad,showGrassland:this.options.showGrassland,showRiver:this.options.showRiver,setWaterMaterial:this.options.setWaterMaterial,ssao:this.options.citySSAO,pencil2:this.pencil});try{yield I.init();const fe=this.projection(he.center);fe&&I.group.position.set(fe[0],-fe[1],0)}catch(fe){console.error("城市可视化初始化失败",fe),this.settings.mouseLeft=Xi.SCREEN_PAN,yield this.settings.mouseLeft,this.pencil.camera.userData.up="0,0,1"}return this.cityVis.push(I),this.emit("initCityVis",n),I})}initCityOnMap(n){return U0(this,null,function*(){const V=this.getAdcodeShowLevel(n);if(V==="province"){const I=yield this.initCityVis(n);yield I==null?void 0:I.drawCityPlane(n,this.lead.group)}else if(V==="city"){const I=findAdcodeInfo(n).c;let he=null;if(I.length>0)for(const fe of I)he=yield this.initCityVis(fe);else he=yield this.initCityVis(n);yield he==null?void 0:he.drawCityPlane(n,this.lead.group),this.pencil.camera.near=.001,this.pencil.camera.far=7,this.pencil.camera.updateProjectionMatrix()}else if(V==="district"){const I=yield this.initCityVis(n);if(yield I==null?void 0:I.drawCityPlane(n,this.lead.group),this.pencil.camera.near=.001,this.pencil.camera.far=7,this.pencil.camera.updateProjectionMatrix(),this.options.nearbyCities){const he=findAdcodeInfo(n).parent,fe=findAdcodeInfo(he).c;for(const ye of fe)(this.options.nearbyCities==="full"||ye!==n)&&(yield this.initCityVis(ye,!0))}}this.cityVis.forEach(I=>{if(!I.options.grey){const he=this.mapObj.depth+1e-5;I.group.position.z=this.mapObj.z+he}})})}initVisBg(){return U0(this,null,function*(){let n=1e3,V=1e3;const I=new Vector3(0,0,0);if(this.options.parentBg){const he={projection:{center:this.pcenter,scale:this.pscale,rotate:[0,0],projectionType:this.options.projectionType},areaGroup:!1,depth:this.options.parentBgDepth},fe=this.options.adcode!==1e5;if(fe){const nt=this.mList.getMultiple("parentPlane"),ot=findAdcodeInfo(this.options.adcode).parent,zt=findAdcodeInfo(ot),Zt=zt.b,{res:at}=yield this.getGeojson(ot),It=yield this.lead.draw("PlaneMap",yi({key:"bg-100000",geojson:at,bbox:Zt,materialOptions:yi({},nt)},he),this.group);It.object3d.name=zt.name,It.lineArr.forEach(Lt=>{Lt.object3d.name="线",this.lead.updateBaseObjectKey(Lt,{type:"100000line"}),this.initBaseObjectUserData(Lt)}),It.areaArr.forEach(Lt=>{Lt.object3d.name="板块",this.lead.updateBaseObjectKey(Lt,{type:"100000area"})}),It.position.z=-this.options.parentBgDepth,this.parentBg.push(It)}const ye=this.mList.getMultiple("worldPlane"),ze=this.options.geojsonMap[0],Fe=findAdcodeInfo(0).b,ke=yield this.lead.draw("PlaneMap",Qi(yi({key:"bg-0",geojson:Qi(yi({},ze),{features:[...ze.features.filter(nt=>fe?nt.properties.iso_a3!=="CHN":!0)]}),bbox:Fe,materialOptions:yi({},ye)},he),{projection:Qi(yi({},he.projection),{rotate:this.options.worldPacificCentre?[-160,0]:void 0})}),this.group);ke.object3d.name="世界",ke.lineArr.forEach(nt=>{nt.object3d.name="线",this.lead.updateBaseObjectKey(nt,{type:"worldline"}),this.initBaseObjectUserData(nt)}),ke.areaArr.forEach(nt=>{nt.object3d.name="板块",this.lead.updateBaseObjectKey(nt,{type:"worldarea"})}),ke.position.z=-this.options.parentBgDepth,this.parentBg.push(ke);const{center:Ue,size:Oe}=ke.getSize();n=Oe.x,V=Oe.y,I.set(Ue.x,Ue.y,0)}if(this.options.continentsBg){if(this.continentsBg=yield this.lead.draw("ContinentsBg",{depth:this.options.continentsBgDepth,scale:this.pscale},this.group),this.options.style!=="map2CityOnMap"&&this.options.style!=="map2Base"){const he=this.getLocationPosition([104,37.5]);this.continentsBg.position.set(...he)}this.continentsBg.position.z=.1}if(this.options.bottomPlane){const he=yield this.lead.draw("CityPlane",{width:n,height:V,color:"#0f1e57"},this.group);he.object3d.name="地图底面",this.lead.updateBaseObjectKey(he,{type:"map-plane"}),this.options.bottomPlaneWater&&he.addWater(),he.position.copy(I),he.position.z-=.1}})}initVis(n){return U0(this,null,function*(){var V;if(yield this.setAdcode({adcodes:[n],duration:0}),this.options.style!=="map2Base"&&this.options.style!=="map2CityOnMap"){const I=yield this.lead.draw("Light",{type:"SpotLight",color:this.options.adcode===0?"#82d9f2":"#c1e6dd",intensity:3,distance:0,angle:this.options.continentsBg?1:.5,penumbra:1,decay:0}),he=this.pencil.cameraPositon,fe=this.pencil.cameraTarget;I==null||I.spotLight.position.copy(he),I==null||I.spotLight.target.position.copy(fe)}if(this.options.mapBoundary){const I=new Box3().setFromObject((V=this.map)==null?void 0:V.object3d);this.pencil.controls.setBoundary(I)}yield this.initVisBg()})}loaderAddBg(){this.options.bottomPlaneWater&&this.loader.add(["/image/water/normalMap0.jpg","/image/water/normalMap1.jpg"],{})}initMaterialBg(){return U0(this,null,function*(){if(this.options.parentBg){const n=(()=>{const V=new MeshStandardMaterial({name:"世界顶面",emissive:"#081417",color:"#000000"}),I=new MeshBasicMaterial({name:"世界侧面",color:"#051714",side:DoubleSide}),he=new Ut$1({name:"世界线",color:new Color$1("#50766E"),sizeAttenuation:!1,lineWidth:this.options.lineWidth});return{topMat:V,sideMat:I,lineMat:he}})();this.mList.addMultiple("worldPlane",n),this.options.adcode!==1e5&&(this.mList.copyMultiple("worldPlane","parentPlane"),Object.values(this.mList.getMultiple("parentPlane")).forEach(V=>{V.name=V.name.replace("世界","父级")}))}if(this.options.continentsBg){const n=(()=>{const V=new MeshStandardMaterial({name:"大洲板块顶面",emissive:"#154532"}),I=new MeshBasicMaterial({name:"大洲板块侧面",color:"#0c1528"}),he=new Ut$1({name:"大洲板块线",color:new Color$1("#09e6c1"),sizeAttenuation:!1,lineWidth:this.options.lineWidth});return{topMat:V,sideMat:I,lineMat:he}})();this.mList.addMultiple("continents",n)}})}consoleMousePostion(){this.addListener(this.container,"click",n=>{var he,fe;const V=this.unproject(n,this.mapObj.z+this.mapObj.depth),I=(fe=(he=this.projection).invert)==null?void 0:fe.call(he,[V.x,-V.y]);console.log("consoleMousePostion.postion",V),console.log("consoleMousePostion.lnglat",I)})}setAreaMaterialByProperty(n,V,I){if(!this.map)return;const he=this.map.areaArr.find(fe=>fe.userData[n]===V);if(he){const fe=he.object3d;let ye=this.mList.get("plane#topMat");I!=="origin"&&(ye=fe.material[0].clone(),I.color&&ye.color.set(I.color),I.emissive&&(ye.emissive.set(I.emissive),ye.emissiveIntensity=I.emissiveIntensity||1)),fe.material[0]=ye}}setLineMaterialByProperty(n,V,I){if(!this.map)return;const he=this.map.lineArr.find(fe=>fe.userData[n]===V);if(he){const fe=he.object3d;let ye=this.mList.get("plane#lineMat");I!=="origin"&&(ye=fe.material.clone(),I.color&&ye.color.set(I.color),I.width&&(ye.lineWidth=I.width)),fe.material=ye}}addAreaPlaneByProperty(n,V,I){return U0(this,null,function*(){if(!this.map)return;const fe=this.map.options.geojson.features.find(ye=>ye.properties&&ye.properties[n]===V);if(fe){let ye=I.material,ze=I.sideMaterial;if(y$1(I.sideMaterial)&&(ze=new MeshBasicMaterial(yi({},I.sideMaterial))),y$1(I.material)&&(ye=new MeshBasicMaterial(yi({},I.material))),I.area){const Ue=this.objectByUuid(I.area);Ue&&([ye,ze]=Ue.material)}let Fe=I.lineMaterial;if(y$1(I.lineMaterial)&&(Fe=new Ut$1(yi({},I.lineMaterial))),I.line){const Ue=this.objectByUuid(I.line);Ue&&(Fe=Ue.material)}const ke=yield this.lead.draw("PlaneMap",{geojson:{type:"FeatureCollection",features:[fe]},depth:I.depth||0,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:{topMat:ye,lineMat:Fe,sideMat:ze},areaGroup:!1},this.group);if(ke.position.z=this.mapObj.z+this.mapObj.depth+.01,I.lineBloom&&ke.lineArr.forEach(Ue=>{Ue.enableBloom()}),I.area){ke.position.z=0;const Ue=this.baseObjectByUuid(I.area);ke.areaArr.forEach(Oe=>{Ue!=null&&Ue.isBloom&&Oe.enableBloom(),Oe.scale.z=Ue.scale.z,Oe.position.z=Ue.position.z})}if(I.line){const Ue=this.baseObjectByUuid(I.line);ke.lineArr.forEach(Oe=>{Ue!=null&&Ue.isBloom&&Oe.enableBloom(),Oe.position.z=Ue.position.z})}return ke}})}showAction(){return U0(this,null,function*(){Zn(Vn.prototype,this,"showAction").call(this),this.useSaveCamera(`map-${this.options.adcode}`);const n=this.lead.group;if(this.mapHistory[0]){const{stop:V,start:I}=sinusoidalInOut({onUpdate:he=>{if(!this.mapHistory[0]){V();return}n.position.z=-this.mapHistory[0].depth*(1-he)}});yield I(),this.saveCamvasState("controls",0)}})}hide(){return U0(this,null,function*(){if(!this.showState)return;const n=this.lead.group;yield sinusoidalInOut({onUpdate:V=>{n.position.z=-this.mapHistory[0].depth*V}}).start(),setTimeout(()=>{Zn(Vn.prototype,this,"hide").call(this)})})}shadowMapEnabled(){return U0(this,null,function*(){if(this.pencil.scene.userData.shadowMapEnabled)return;this.pencil.scene.userData.shadowMapEnabled=!0;const n=yield this.lead.draw("Light",{type:"SpotLight",color:"#c1e6dd",intensity:1,distance:0,angle:.5,penumbra:1,decay:0});this.lead.updateBaseObjectKey(n,{type:"ShadowSpotLight"}),this.shadowMapLight=n,n.object3d.position.set(.281,32.487,43.077),n.object3d.castShadow=!0;const V=yield this.lead.draw("PlaneShadow");this.planeShadow=V})}shadowMapDisabled(){this.pencil.scene.userData.shadowMapEnabled&&(this.pencil.scene.userData.shadowMapEnabled=!1,this.shadowMapLight&&(this.shadowMapLight.erase(),this.shadowMapLight=void 0),this.planeShadow&&(this.planeShadow.erase(),this.planeShadow=void 0))}getOptionsDepth(n){const V=this.getAdcodeShowLevel(n);let I=this.options.mapDepth;Array.isArray(I)||(I=new Array(3).fill(I));let he;return V==="country"?he=I[0]:V==="province"?he=I[1]:he=I[2],he}getDepth(n,V){let I=this.getOptionsDepth(n);if(this.options.depthReference){const he=this.options.depthReference,fe=findAdcodeInfo(n).b;I=I*this.getReferenceScale(he,fe)}else if(this.mapHistory.length){const he=findAdcodeInfo(this.mapHistory[0].mapInfo.adcode).b,fe=this.getReferenceScale(he,V);I=I*fe}return I}getReferenceScale(n,V){const I=Math.abs(V[3]-V[1])/Math.abs(n[3]-n[1]),he=Math.abs(V[2]-V[0])/Math.abs(n[2]-n[0]);return Math.max(I,he)}getAdcodeShowLevel(n,V=!0){return getAdcodeShowLevel(n,V)}handleClick(n){const{drillDownRestrictions:V}=this.options;this.isAnimating||(n&&n.userData.adcode?this.getAdcodeShowLevel(n.userData.adcode,!1)!==V?this.showMap({adcode:n.userData.adcode}):this.emit("drilldownRestrictions",n.userData.adcode):!n&&this.mapHistory.length>1&&this.showMap({adcode:this.adcodes.at(-2)}))}beforeShowMap(n){return!0}getAdcodes(n){var he;const V=[];let I=n;for(;I&&(V.unshift(I),I!==this.options.adcode);)I=(he=findAdcodeInfo(I))==null?void 0:he.parent;return V}showMap(he){return U0(this,arguments,function*({adcode:n,adcodes:V,duration:I=1e3}){const fe=V||this.getAdcodes(n);(yield this.beforeShowMap(fe))!==!1&&(this.emit("beforeDrillDown",[...fe]),yield this.setAdcode({adcodes:fe,duration:I}),this.emit("afterDrillDown",[...fe]))})}drawLabels(){return U0(this,null,function*(){var I;const n=this.options.showLabel;if(!((I=this.mapArea)!=null&&I.length)||!n)return;let V=this.lead.getObject("Group",{key:"mapLabel"});V||(V=yield this.lead.draw("Group",{key:"mapLabel"},this.group),V.object3d.name="地图标签组",yield Promise.all(this.mapArea.map(he=>U0(this,null,function*(){let{name:fe,adcode:ye,centroid:ze}=he.userData;const{DistrictID:Fe,DistName:ke,iso_a2:Ue,center:Oe}=he.userData;if(ye=ye||Ue||Fe,ze=ze||Oe,fe=fe||ke,!ze)return;const nt=this.getLocationPosition(ze);if(this.lead.getObject("Node",{key:`mapLabel-${ye}`})||!nt)return;const[ot,zt,Zt]=nt;let at=fe;n==="lite"&&at&&(at=fe.replace(/自治州|地区|自治区|省|市|壮族|特别行政区|回族|维吾尔/g,""));const It=at&&getLabelElement(at),Lt=at!=null&&at.startsWith("澳门")?-1:0;yield this.lead.draw("Node",{position:new Vector3(ot,zt+Lt,Zt),children:It,key:`$p:-${this.options.adcode===0?fe:ye}`},V)}))))})}eraseLabels(){const n=this.lead.getObject("Group",{key:"mapLabel"});n==null||n.erase()}geAdcodePosition(n){var I;const V=(I=this.mapArea)==null?void 0:I.find(he=>he.userData.adcode===n);if(V){const{centroid:he,center:fe}=V.userData;return this.getLocationPosition(he||fe)}}getLocationPosition(n){const[V,I]=n,[he,fe]=this.projection([V,I]);return[he,-fe,this.mapObj?this.mapObj.z+this.mapObj.depth:0]}setObjectOnMap(n,V,I=0){const he=this.getLocationPosition(V);n.position.set(he[0],he[1],he[2]+I)}setObjectOnMapAreaByProperty(n,V,I,he=0){var ye;const fe=(ye=this.mapArea)==null?void 0:ye.find(ze=>ze.userData[V]===I);if(fe){const{centroid:ze,center:Fe}=fe.userData,ke=this.getLocationPosition(ze||Fe);n.position.set(ke[0],ke[1],ke[2]+he)}}getAdcodeScreenPosition(n){const V=this.geAdcodePosition(n);if(V){const[I,he,fe]=V,ye=new Vector3(I,he,fe);ye.project(this.pencil.camera);const{width:ze,height:Fe}=this.pencil.getSize(),ke=(ye.x*.5+.5)*ze,Ue=(ye.y*-.5+.5)*Fe;return{x:ke,y:Ue}}}booleanPointInCn(n){return chinaLiteJson.features[0].geometry.coordinates.some(V=>turf.booleanPointInPolygon(turf.point(n),turf.polygon(V)))}booleanPointInMap(n,V){var ye,ze;const I=V!=null?V:(ye=this.mapInfo)==null?void 0:ye.adcode;if(!I)return!1;const he=findAdcodeInfo(I);if(he!=null&&he.b){const[Fe,ke,Ue,Oe]=he.b,[nt,ot]=n;if(nt<Fe||nt>Ue||ot<ke||ot>Oe)return!1}const fe=(ze=this.options.extrudeLineGeojsonMap)==null?void 0:ze[I];return fe?fe.features.some(Fe=>{const ke=Fe.geometry.coordinates;return Fe.geometry.type==="Polygon"?ke.some(Ue=>turf.booleanPointInPolygon(turf.point(n),turf.polygon([Ue]))):Fe.geometry.type==="MultiPolygon"?ke.some(Ue=>Ue.some(Oe=>turf.booleanPointInPolygon(turf.point(n),turf.polygon([Oe])))):!1}):!1}getGeojson(n,V=!1){return U0(this,null,function*(){var he,fe,ye,ze,Fe;let I;if(V?I=this.options.extrudeLine?(ye=this.options.extrudeLineGeojsonMap)!=null&&ye[n]?{res:(ze=this.options.extrudeLineGeojsonMap)==null?void 0:ze[n]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json-lite/${n}.json`):{res:void 0}:I=(he=this.options.geojsonMap)!=null&&he[n]?{res:(fe=this.options.geojsonMap)==null?void 0:fe[n]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json/${n}.json`),I.res&&((Fe=this.options.geojsonExtensions)!=null&&Fe[n])){const ke=this.options.geojsonExtensions[n],Ue=[],Oe=Array.isArray(ke)?ke:[ke];for(const nt of Oe){let ot;if(typeof nt=="number"){const{res:zt}=yield jsonFetch(`${this.options.assetsPrefix}/geojson/json/${nt}.json`);ot=zt}else if(typeof nt=="string"){const{res:zt}=yield jsonFetch(nt);ot=zt}else ot=nt;Ue.push(ot)}I.res=Qi(yi({},I.res),{features:[...I.res.features,...Ue.flatMap(nt=>nt.features)]})}return I})}handleDrillDown(ye){return U0(this,arguments,function*({adcode:n,duration:V,handleLook:I,saveBackCamvasState:he,extrudelineBloom:fe}){var ze,Fe,ke,Ue,Oe;if(typeof n!="undefined"&&!this.isAnimating){const nt=(ze=this.map)==null?void 0:ze.findGroup(n,!0),ot=findAdcodeInfo(+n);if(this.isAnimating||!ot)return;this.isAnimating=!0;const{name:zt}=ot;let{res:Zt}=yield this.getGeojson(n),{res:at}=yield this.getGeojson(n,!0);if(!this.options.showDistrict&&this.getAdcodeShowLevel(n)==="city"&&(Zt=at,at=void 0),[Zt,at].filter(Boolean).forEach(Lt=>{if(!Lt.features[0].properties.adcode&&/^\d{6}$/.test(`${n}`)){const Ft=findAdcodeInfo(n);Lt.features[0].properties=Qi(yi(yi({},Lt.features[0].properties),Ft),{center:[Ft.lng,Ft.lat]})}}),Zt){const Lt=this.options.plateInCenter&&(this.mapHistory.length<1||this.options.drillDownPlateInCenter);if((Fe=this.options.fixGeojson)!=null&&Fe[n]){const e0=(ke=this.options.fixGeojson)==null?void 0:ke[n];if(e0.startsWith("-")){const o0=+e0.slice(1);Zt.features=Zt.features.filter(b0=>b0.properties.adcode!==o0)}}let Ft=findAdcodeInfo(n).b;const kt=[...Ft];this.mapHistory.length===1&&!this.options.drillDownSecondLevelMats?Ft=findAdcodeInfo(this.mapInfo.adcode).b:this.mapHistory.length===2&&!this.options.drillDownThirdLevelMats&&(this.options.drillDownSecondLevelMats?Ft=findAdcodeInfo(this.mapInfo.adcode).b:Ft=findAdcodeInfo(this.mapHistory[0].mapInfo.adcode).b),this.eraseLabels(),this.map&&(this.options.drillDownHideParent&&this.parentBg.forEach(e0=>{e0.hide()}),this.options.showOneLevel?this.map.hide():this.map.deactive(),he&&this.saveCamvasState("userControls",-1));const Kt=this.mapHistory.length,Ht=Kt-1,Bt=this.getDepth(n,kt),Yt=(Ue=this.mapHistory[Ht])==null?void 0:Ue.depth,Jt=Kt===0||this.options.showOneLevel?0:this.mapHistory[Ht].z+Yt,Qt=Kt===0||this.options.showOneLevel?0:Jt-Bt,n0=turf.center(Zt).geometry.coordinates,[a0,l0]=this.projection(n0),s0=yield this.drawPlaneMap({geojson:Zt,extrudeLineGeojson:at,depth:Bt,bbox:Ft,adcode:n,extrudelineBloom:fe});nt==null||nt.hide(),s0.position.setZ(Qt);const $t=s0.position.z,qt=()=>U0(this,null,function*(){yield sinusoidalInOut({onUpdate:e0=>{Jt!==$t&&(s0.position.z=$t+(Jt-$t)*e0)}}).start({duration:V})});if(Lt)if(this.fixNear(n),s0.position.z=Jt,I){const e0=(Oe=this.mapHistory.at(-1))==null?void 0:Oe.controls;yield this.fitTo(s0,{z:Jt+Bt,adcode:n,enableTransition:V!==0,polarAngle:e0==null?void 0:e0.polarAngle,azimuthAngle:e0==null?void 0:e0.azimuthAngle,handleStart:()=>U0(this,null,function*(){s0.position.z=$t,yield qt()})})}else this.options.showOneLevel&&s0.hide();else yield qt();this.mapHistory.push({map:s0,mapInfo:ot,z:Jt,depth:Bt,cX:a0,cY:-l0}),I&&this.drawLabels(),this.saveCamvasState("controls",-1)}else console.log(`${zt}的地图数据不存在`);this.event.emit("handleDrillDown",{adcode:n,z:this.mapObj.z+this.mapObj.depth})}this.isAnimating=!1})}saveCamvasState(n,V){const I=this.mapHistory.at(V);I&&(I[n]={lookAt:[...this.pencil.cameraPositon.toArray(),...this.pencil.cameraTarget.toArray()],polarAngle:this.pencil.controls.polarAngle,azimuthAngle:this.pencil.controls.azimuthAngle})}fixNear(n){const V=this.getAdcodeShowLevel(n),I=this.pencil.options;n===0?(this.pencil.camera.near=1,this.pencil.camera.far=1e3,this.pencil.camera.updateProjectionMatrix()):(V==="country"||V==="province")&&this.pencil.camera.near!==I.camera.near*10?(this.pencil.camera.near=I.camera.near*10,this.pencil.camera.updateProjectionMatrix()):(V==="city"||V==="district")&&this.pencil.camera.near!==I.camera.near&&(this.pencil.camera.near=I.camera.near,this.pencil.camera.updateProjectionMatrix())}fitTo(Fe){return U0(this,arguments,function*(n,{polarAngle:V,azimuthAngle:I,z:he,handleStart:fe,adcode:ye,enableTransition:ze=!0}={}){if(!(n!=null&&n.object3d))return;if(ye&&(yield this.useSaveCamera(`map-${ye}`,ze))){fe&&(yield fe());return}const ke=this.options.mapPadding,{height:Ue,width:Oe}=this.pencil.getSize();Ue<ke[0]+ke[2]+50&&(ke[0]=0,ke[2]=0),Oe<ke[1]+ke[3]+50&&(ke[1]=0,ke[3]=0);const nt=V!=null?V:this.options.polarAngle,ot=I!=null?I:this.options.azimuthAngle,zt=this.pencil.cameraPositon.toArray(),Zt=this.pencil.cameraTarget.toArray();yield this.paddingInCssPixel(n,ke[0],ke[1],ke[2],ke[3],!1);let at;he&&(at=this.pencil.cameraTarget.toArray(),yield this.pencil.controls.setTarget(at[0],at[1],he,!1)),yield this.pencil.controls.rotateTo(ot,nt,!1),at=this.pencil.cameraTarget.toArray();const It=this.pencil.cameraPositon.toArray();yield this.lookAt(...zt,...Zt),yield Promise.all([this.lookAt(...It,...at,ze),fe==null?void 0:fe()].filter(Boolean))})}drawPlaneMap(ze){return U0(this,arguments,function*({geojson:n,extrudeLineGeojson:V,bbox:I,depth:he,extrudelineBloom:fe,adcode:ye}){var zt;const Fe=[this.mList.getMultiple("plane"),this.mList.getMultiple("secondPlane"),this.mList.getMultiple("thirdPlane")];let ke=this.mapHistory.length,Ue=null;for(;Ue===null;)Ue=Fe[ke],ke--;const Oe=this.mList.getMultiple("bgPlane"),nt=yi(yi({},Ue),Oe?{bgTopMat:Oe.topMat,bgSideMat:Oe.sideMat,bgLineMat:Oe.lineMat,bgExtrudeLineMat:Oe.extrudeLineMat}:{}),ot=yield this.lead.draw("PlaneMap",{key:`${ye}`,geojson:n,extrudeLineGeojson:V,depth:he,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:nt,bbox:I,topSegments:this.options.topSegments,lineOffset:this.options.lineOffset,mergeSide:this.options.mergeSide},this.group);return ot.object3d.name=((zt=findAdcodeInfo(ye))==null?void 0:zt.name)||`${ye}`,this.options.style==="map2CityOnMap"&&!this.options.showCityOnMapInnerLine&&(Ue.lineMat.colorWrite=!1,ot.lineArr.forEach(Zt=>{Zt.userData.selectHide=!0})),ot.extrudelineArr&&ot.extrudelineArr.forEach(Zt=>{Zt.object3d.name="板块边线",this.lead.updateBaseObjectKey(Zt,{type:"extrudeLine",key:this.mapHistory.length?"$p:":void 0}),this.initBaseObjectUserData(Zt),fe&&(Zt.object3d.userData.bloom=!0)}),ot.lineArr&&ot.lineArr.forEach(Zt=>{this.initBaseObjectUserData(Zt)}),ot})}handleBack(){return U0(this,arguments,function*({duration:n=1e3,handleLookBack:V=!0,keepOne:I=!0}={}){if(this.isAnimating||(I?this.mapHistory.length<=1:this.mapHistory.length===0))return;this.emit("beforeDrillBack",this.adcodes.slice(0,-1)),this.isAnimating=!0;const he=this.mapHistory.pop();if(!this.options.drillDownPlateInCenter){const fe=he.map.position.z,ye=this.mapObj?this.mapObj.z+(this.mapObj.depth-he.depth):0;yield sinusoidalInOut({onUpdate:ze=>{he.map.position.z=fe+(ye-fe)*ze}}).start({duration:n})}if(this.lead.eraseWithoutMaterial(he.map),this.eraseLabels(),this.mapObj){const{map:fe}=this.mapObj,ye=fe==null?void 0:fe.findGroup(he.mapInfo.adcode,!0);ye&&ye.show(),fe&&V&&(this.options.showOneLevel?fe.show():fe.active(),this.options.drillDownHideParent&&this.parentBg.forEach(ze=>{ze.show()}),yield this.handleLookBack(n),this.drawLabels())}this.emit("handleBack",{adcodes:this.adcodes}),this.emit("afterDrillBack",[...this.adcodes]),this.isAnimating=!1})}handleLookBack(n){return U0(this,null,function*(){const{userControls:V,controls:I}=this.mapObj;yield this.pencil.controls.setLookAt(...V?V.lookAt:I.lookAt,n!==0)})}compareLocations(n,V){const I=n.filter(ze=>ze),he=V.filter(ze=>ze),fe=[];let ye=0;for(let ze=0;ze<Math.min(I.length,he.length)&&I[ze]===he[ze];ze++)ye++;for(let ze=ye;ze<I.length;ze++)fe.push(-1);for(let ze=ye;ze<he.length;ze++)fe.push(he[ze]);return fe}setAdcode(I){return U0(this,arguments,function*({adcodes:n,duration:V}){var fe,ye,ze;const{adcodes:he}=this;if(!(JSON.stringify(n)===JSON.stringify(he)||this.isAnimating))if(JSON.stringify(n)===JSON.stringify([0]))try{yield this.handleDrillDown({adcode:0,duration:V,handleLook:!0})}catch(nt){console.error(nt)}else{const{continent:nt,country:ot,province:zt,city:Zt,district:at}=n.reduce((Jt,Qt)=>{const n0=this.getAdcodeShowLevel(Qt);return Jt[n0]=Qt,Jt},{}),{continent:It,country:Lt,province:Ft,city:kt,district:Kt}=he.reduce((Jt,Qt)=>{const n0=this.getAdcodeShowLevel(Qt);return Jt[n0]=Qt,Jt},{}),Ht=nt||It,Bt=(ze=(ye=(fe=this.map)==null?void 0:fe.extrudelineArr)==null?void 0:ye[0])==null?void 0:ze.object3d.userData.bloom,Yt=this.compareLocations([It,Lt,Ft,kt,Kt],[nt,ot,zt,Zt,at]);try{for(var Fe=Jn(Yt.entries()),ke,Ue,Oe;ke=!(Ue=yield Fe.next()).done;ke=!1){const[Jt,Qt]=Ue.value;const n0=Jt===Yt.length-1?V:0,a0=Jt===Yt.length-1;Qt===-1?yield this.handleBack({duration:n0,handleLookBack:a0,keepOne:!Ht}):yield this.handleDrillDown({adcode:Qt,duration:n0,handleLook:a0,saveBackCamvasState:Yt.includes(-1)?!1:this.options.handleBackKeepCamvasState,extrudelineBloom:Bt})}}catch(Ue){Oe=[Ue]}finally{try{ke&&(Ue=Fe.return)&&(yield Ue.call(Fe))}finally{if(Oe)throw Oe[0]}}}})}setPadding(n,V=!1,I=!1){this.options.mapPadding=[...n],V&&this.fitTo(this.map,{enableTransition:I})}findAdcodeInfo(n){return findAdcodeInfo(n)}dispose(){var n,V,I;(n=this.editor)==null||n.events.removeAllListeners(),this.cityVis.forEach(he=>{he.dispose()}),this.cityVis.length=0,(V=this.map)==null||V.dispose(),this.parentBg.forEach(he=>{he.dispose()}),this.parentBg.length=0,(I=this.continentsBg)==null||I.dispose(),this.continentsBg=void 0,this.mapHistory.length=0,super.dispose()}};C0(Vn,"VisName","map");let Map$1=Vn;class MapManager{constructor(e){C0(this,"container");C0(this,"controlsContainer");C0(this,"assetsPrefix");C0(this,"fixConfig");C0(this,"raycasterPointsThreshold");C0(this,"MAX_ZOOM_FACTOR",.3);C0(this,"MIN_ZOOM_FACTOR",4);C0(this,"mapInstances",{});C0(this,"mapDistances",{});C0(this,"mapConfigs",{});C0(this,"currentMap",null);C0(this,"currentZoom",1);C0(this,"mapPadding");C0(this,"isInitializing",!1);C0(this,"rmTemplateIdentifier");C0(this,"groups",{});C0(this,"eventHandlers",{});C0(this,"areaCloseTimer",null);var n;this.container=e.container,this.controlsContainer=e.controlsContainer||e.container,this.assetsPrefix=e.assetsPrefix,this.fixConfig=e.fixConfig,this.raycasterPointsThreshold=e.raycasterPointsThreshold||.005,this.mapPadding=e.mapPadding||[0,0,0,0],this.rmTemplateIdentifier=(n=e.rmTemplateIdentifier)!=null?n:!1}setEventHandlers(e){this.eventHandlers=yi(yi({},this.eventHandlers),e)}emit(e,...n){const V=this.eventHandlers[e];V&&typeof V=="function"&&V(...n)}getCurrentMap(){return this.currentMap}getCurrentZoom(){return this.currentZoom}initMap(e,n=!1){return U0(this,null,function*(){if(this.isInitializing)return console.warn("地图正在初始化中,请等待完成"),this.currentMap;const V=e.at(-1)||e.at(-2);if(!V)return null;try{return this.isInitializing=!0,yield this.createMapInstance(V,n)}finally{this.isInitializing=!1}})}createMapInstance(e,n=!1){return U0(this,null,function*(){var ke,Ue;const V=Object.values(this.mapInstances)[0],I=(ke=getAdcodeShowLevel(e))!=null?ke:"country",he=findAdcodeInfo(e),fe=V==null?void 0:V.pencil;this.container.style.cursor="default";const ye=this.mapInstances[I];if(ye)if(ye.pencil.controls.maxDistance=1/0,ye.pencil.controls.minDistance=0,ye.options.adcode===e&&!n&&!ye.options.fixedAdcode){ye.setSceneActive(),this.currentMap=ye,ye.pencil.controls.maxDistance=this.mapDistances[I]/this.MAX_ZOOM_FACTOR,ye.pencil.controls.minDistance=this.mapDistances[I]/this.MIN_ZOOM_FACTOR;const Oe=ye.pencil.controls.distance,nt=Math.round(this.mapDistances[I]/Oe*10)/10;return this.currentZoom!==nt&&(this.currentZoom=nt,this.emit("zoomChange",nt)),ye}else ye.options.pencil=fe,ye.dispose(),delete this.mapInstances[I];const ze=new Map$1({container:this.container,controlsContainer:this.controlsContainer,assetsPrefix:this.assetsPrefix,pencil:fe});let Fe=0;return yield ze.fromJSON((Ue=this.mapConfigs[I])!=null?Ue:`/${I}.gz`,{preprocessor:Oe=>U0(this,null,function*(){if(Fe=Oe.h.u[0].visOptions.adcode,this.rmTemplateIdentifier&&delete Oe.h.u[0].visOptions.__template,I==="province"||I==="city"||I==="district"){const nt=yield getMapConfig(e,this.assetsPrefix,Oe.h.u[0].visOptions,Oe.h.i);he!=null&&he.c.length&&(nt.showBuilding=!1),Oe.h.u[0].visOptions=nt}return Oe}),useCache:!0}),ze.pencil.camera.near=.01,ze.pencil.camera.updateProjectionMatrix(),ze.pencil.raycaster.params.Points.threshold=this.raycasterPointsThreshold,ze.pencil.controls.addEventListener("update",()=>{const Oe=ze.pencil.controls.distance,nt=Math.round(this.mapDistances[I]/Oe*10)/10;this.currentZoom!==nt&&(this.currentZoom=nt,this.emit("zoomChange",nt))}),I!=="country"&&(ze.options.mapPadding=this.mapPadding,ze.options.polarAngle=-Math.PI,yield ze.fitTo(ze.map,{enableTransition:!1}),yield ze.fitTo(ze.map,{enableTransition:!1})),this.applyFixConfig(ze,I,Fe,e),he!=null&&he.c.length&&!n&&this.bindAreaEvents(ze),this.mapInstances[I]=ze,ze.setSceneActive(),this.currentMap=ze,this.currentZoom=1,this.emit("zoomChange",1),this.mapDistances[I]=ze.pencil.controls.distance,ze.pencil.controls.maxDistance=ze.pencil.controls.distance/this.MAX_ZOOM_FACTOR,ze.pencil.controls.minDistance=ze.pencil.controls.distance/this.MIN_ZOOM_FACTOR,ze.options.fixedAdcode=n,ze})}applyFixConfig(e,n,V,I){if(!this.fixConfig)return;const he=this.fixConfig[`${n}`];if(!he)return;const fe=e.findAdcodeInfo(V),ye=e.findAdcodeInfo(I),ze=e.getReferenceScale(fe.b,ye.b);[...he.s].forEach(Fe=>{const ke=e.baseObjectByUuid(Fe);if(ke){ke.scale.multiplyScalar(ze);const{center:Ue}=e.map.getSize();ke.position.x=Ue.x,ke.position.y=Ue.y}}),[...he.z].forEach(Fe=>{const ke=e.baseObjectByUuid(Fe);ke&&(ke.position.z*=ze)})}bindAreaEvents(e){const n={};e.mapArea.forEach(V=>{var fe;V.lead.enableCursor(V);const I=V.userData.adcode,he=e.cityVis.length===1?e.cityVis[0]:e.cityVis.find(ye=>ye.options.adcode===I);if(he){const ye=(fe=n[he.options.adcode])!=null?fe:he.group.getSize().max.z;n[he.options.adcode]=ye}V.onPointerEnter(({mouseEvent:ye})=>{if(this.clearAreaCloseTimer(),V.useMListByName("顶面高亮",0),he&&(V.position.z=n[he.options.adcode]-e.mapObj.depth),!(V.userData.centroid||V.userData.center))return;const{max:Fe,center:ke}=V.getSize(),Ue=e.getScreenPosition(ke.x,ke.y,Fe.z);this.emit("areaHover",{areaName:V.userData.name,x:Ue.x,y:Ue.y,mouseLeft:ye.clientX,mouseTop:ye.clientY})}),V.onPointerMove(()=>{this.clearAreaCloseTimer()}),V.onPointerLeave(()=>{V.useMListByName("顶面",0),he&&(V.position.z=0),this.triggerAreaLeave({areaName:V.userData.name})}),V.onClick(()=>{V.useMListByName("顶面",0),he&&(V.position.z=0),this.emit("areaClick",{areaName:V.userData.name,adcode:V.userData.adcode})})})}setZoom(e){var he;if(!this.currentMap||this.currentZoom===e)return;const n=(he=getAdcodeShowLevel(this.currentMap.options.adcode))!=null?he:"country",V=this.mapDistances[n];if(!V)return;const I=V/e;this.currentZoom=e,this.currentMap.pencil.controls.distance=I}createGroup(e){return U0(this,null,function*(){if(!this.currentMap)return null;e in this.groups&&this.clearGroup(e);const n=yield this.currentMap.addGroup();return this.groups[e]=n,n})}getGroup(e){return this.groups[e]}clearGroup(e){const n=this.groups[e];n&&(n.erase(),delete this.groups[e])}clearAllGroups(){Object.values(this.groups).forEach(e=>{e.erase()}),this.groups={}}clearAreaCloseTimer(){this.areaCloseTimer&&(clearTimeout(this.areaCloseTimer),this.areaCloseTimer=null)}triggerAreaLeave({areaName:e}={areaName:""}){this.currentMap&&(this.clearAreaCloseTimer(),this.areaCloseTimer=setTimeout(()=>{this.emit("areaLeave",{areaName:e})},200))}dispose(){this.areaCloseTimer&&(clearTimeout(this.areaCloseTimer),this.areaCloseTimer=null),this.clearAllGroups(),Object.values(this.mapInstances).forEach(e=>{e.dispose()}),this.mapInstances={},this.currentMap=null,Editor.clearUrlCache()}}C0(MapManager,"findAdcodeInfoByName",findAdcodeInfoByName),C0(MapManager,"getAdcodeShowLevel",getAdcodeShowLevel),C0(MapManager,"findAdcodeInfo",findAdcodeInfo),C0(MapManager,"extendsAdcodeAll",extendsAdcodeAll);const access={set token(E){accessToken.token=E}},VERSION=version;exports.Base=Base;exports.City=City$1;exports.Earth=index;exports.Map=Map$1;exports.MapManager=MapManager;exports.THREE=THREE;exports.TWEEN=tween_esm;exports.VERSION=VERSION;exports.access=access;exports.animationUtils=animation;exports.getCityConfig=getCityConfig;exports.getMapConfig=getMapConfig;exports.removeCameraHistory=removeCameraHistory;
|
package/dist/index.module.js
CHANGED
|
@@ -63,7 +63,7 @@ import { continentsCountriesIso2 } from "geojson-cn";
|
|
|
63
63
|
Array.prototype.at || (Array.prototype.at = function(E) {
|
|
64
64
|
return E < 0 && (E = this.length + E), this[E];
|
|
65
65
|
});
|
|
66
|
-
const version = "0.30.0-beta.
|
|
66
|
+
const version = "0.30.0-beta.58", publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t", accessToken = {
|
|
67
67
|
token: void 0,
|
|
68
68
|
getInfo() {
|
|
69
69
|
if (!this.token)
|
|
@@ -145062,20 +145062,26 @@ const getLabelElement = (E) => {
|
|
|
145062
145062
|
} : I = (he = this.options.geojsonMap) != null && he[n] ? { res: (fe = this.options.geojsonMap) == null ? void 0 : fe[n] } : yield jsonFetch(
|
|
145063
145063
|
`${this.options.assetsPrefix}/geojson/json/${n}.json`
|
|
145064
145064
|
), I.res && ((Fe = this.options.geojsonExtensions) != null && Fe[n])) {
|
|
145065
|
-
const ke = this.options.geojsonExtensions[n];
|
|
145066
|
-
|
|
145067
|
-
|
|
145068
|
-
|
|
145069
|
-
|
|
145070
|
-
|
|
145071
|
-
|
|
145072
|
-
|
|
145073
|
-
|
|
145074
|
-
|
|
145075
|
-
|
|
145076
|
-
|
|
145065
|
+
const ke = this.options.geojsonExtensions[n], Ue = [], Oe = Array.isArray(ke) ? ke : [ke];
|
|
145066
|
+
for (const nt of Oe) {
|
|
145067
|
+
let ot;
|
|
145068
|
+
if (typeof nt == "number") {
|
|
145069
|
+
const { res: zt } = yield jsonFetch(
|
|
145070
|
+
`${this.options.assetsPrefix}/geojson/json/${nt}.json`
|
|
145071
|
+
);
|
|
145072
|
+
ot = zt;
|
|
145073
|
+
} else if (typeof nt == "string") {
|
|
145074
|
+
const { res: zt } = yield jsonFetch(nt);
|
|
145075
|
+
ot = zt;
|
|
145076
|
+
} else
|
|
145077
|
+
ot = nt;
|
|
145078
|
+
Ue.push(ot);
|
|
145079
|
+
}
|
|
145077
145080
|
I.res = Qi(yi({}, I.res), {
|
|
145078
|
-
features: [
|
|
145081
|
+
features: [
|
|
145082
|
+
...I.res.features,
|
|
145083
|
+
...Ue.flatMap((nt) => nt.features)
|
|
145084
|
+
]
|
|
145079
145085
|
});
|
|
145080
145086
|
}
|
|
145081
145087
|
return I;
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.30.0-beta.
|
|
1
|
+
declare const _default: "0.30.0-beta.58";
|
|
2
2
|
export default _default;
|
package/dist/vis/map/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface MapOptions extends BaseOptions {
|
|
|
51
51
|
style?: 'map2Base' | 'map2CityOnMap';
|
|
52
52
|
bottomPlane?: boolean;
|
|
53
53
|
bottomPlaneWater?: boolean;
|
|
54
|
-
geojsonExtensions?: Record<string, GeoJSON | string | number>;
|
|
54
|
+
geojsonExtensions?: Record<string, GeoJSON | string | number | (GeoJSON | string | number)[]>;
|
|
55
55
|
}
|
|
56
56
|
interface MapCityOptions extends MapOptions {
|
|
57
57
|
cacheCity?: boolean;
|