vis-core 0.30.0-beta.41 → 0.30.0-beta.42
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 +6 -2
- package/dist/version.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 Qn=Object.defineProperty,$n=Object.defineProperties;var qn=Object.getOwnPropertyDescriptors;var Bn=Object.getOwnPropertySymbols,e1=Object.getPrototypeOf,t1=Object.prototype.hasOwnProperty,i1=Object.prototype.propertyIsEnumerable,n1=Reflect.get;var In=(le,e)=>(e=Symbol[le])?e:Symbol.for("Symbol."+le),s1=le=>{throw TypeError(le)},Cn=Math.pow,Un=(le,e,n)=>e in le?Qn(le,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):le[e]=n,xi=(le,e)=>{for(var n in e||(e={}))t1.call(e,n)&&Un(le,n,e[n]);if(Bn)for(var n of Bn(e))i1.call(e,n)&&Un(le,n,e[n]);return le},nn=(le,e)=>$n(le,qn(e));var T0=(le,e,n)=>Un(le,typeof e!="symbol"?e+"":e,n);var Zn=(le,e,n)=>n1(e1(le),n,e);var B0=(le,e,n)=>new Promise((r,fe)=>{var Ce=Ne=>{try{Pe(n.next(Ne))}catch(ze){fe(ze)}},Re=Ne=>{try{Pe(n.throw(Ne))}catch(ze){fe(ze)}},Pe=Ne=>Ne.done?r(Ne.value):Promise.resolve(Ne.value).then(Ce,Re);Pe((n=n.apply(le,e)).next())}),r1=function(le,e){this[0]=le,this[1]=e};var On=le=>{var e=le[In("asyncIterator")],n=!1,r,fe={};return e==null?(e=le[In("iterator")](),r=Ce=>fe[Ce]=Re=>e[Ce](Re)):(e=e.call(le),r=Ce=>fe[Ce]=Re=>{if(n){if(n=!1,Ce==="throw")throw Re;return Re}return n=!0,{done:!1,value:new r1(new Promise(Pe=>{var Ne=e[Ce](Re);Ne instanceof Object||s1("Object expected"),Pe(Ne)}),1)}}),fe[In("iterator")]=()=>fe,r("next"),"throw"in e?r("throw"):fe.throw=Ce=>{throw Ce},"return"in e&&r("return"),fe},Dn=(le,e,n)=>(e=le[In("asyncIterator")])?e.call(le):(le=le[In("iterator")](),e={},n=(r,fe)=>(fe=le[r])&&(e[r]=Ce=>new Promise((Re,Pe,Ne)=>(Ce=fe.call(le,Ce),Ne=Ce.done,Promise.resolve(Ce.value).then(ze=>Re({value:ze,done:Ne}),Pe)))),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=require("geojson-cn/json-lite/all.json"),turf=require("@turf/turf"),geojsonCn=require("geojson-cn");Array.prototype.at||(Array.prototype.at=function(le){return le<0&&(le=this.length+le),this[le]});const version="0.30.0-beta.41",publicKeyPEM="LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t",accessToken={token:void 0,getInfo(){if(!this.token)return"";const[le,e,n]=this.token.split(":::"),r=jsrsasign.KEYUTIL.getKey(atob(publicKeyPEM)),fe=CryptoJS.enc.Base64.parse(e),Ce=CryptoJS.enc.Base64.parse(n),Re=CryptoJS.lib.WordArray.create(fe.words.slice(0,4)),Pe=CryptoJS.lib.WordArray.create(fe.words.slice(4)),Ne=jsrsasign.KJUR.crypto.Util.hashHex(fe.toString(),"sha256"),ze=r.verifyWithMessageHashPSS(Ne,jsrsasign.b64tohex(le),"sha256",32);if(!ze)return this.token=void 0,"";const Fe=CryptoJS.AES.decrypt({ciphertext:Pe},Ce,{iv:Re,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8),ke=JSON.parse(Fe),xt=Date.now();return!ke.s||ke.s>xt?(this.token=void 0,""):ke.e&&ke.e<xt?(this.token=void 0,""):(ke.isValid=ze,ke)}};var Easing=Object.freeze({Linear:Object.freeze({None:function(le){return le},In:function(le){return le},Out:function(le){return le},InOut:function(le){return le}}),Quadratic:Object.freeze({In:function(le){return le*le},Out:function(le){return le*(2-le)},InOut:function(le){return(le*=2)<1?.5*le*le:-.5*(--le*(le-2)-1)}}),Cubic:Object.freeze({In:function(le){return le*le*le},Out:function(le){return--le*le*le+1},InOut:function(le){return(le*=2)<1?.5*le*le*le:.5*((le-=2)*le*le+2)}}),Quartic:Object.freeze({In:function(le){return le*le*le*le},Out:function(le){return 1- --le*le*le*le},InOut:function(le){return(le*=2)<1?.5*le*le*le*le:-.5*((le-=2)*le*le*le-2)}}),Quintic:Object.freeze({In:function(le){return le*le*le*le*le},Out:function(le){return--le*le*le*le*le+1},InOut:function(le){return(le*=2)<1?.5*le*le*le*le*le:.5*((le-=2)*le*le*le*le+2)}}),Sinusoidal:Object.freeze({In:function(le){return 1-Math.sin((1-le)*Math.PI/2)},Out:function(le){return Math.sin(le*Math.PI/2)},InOut:function(le){return .5*(1-Math.sin(Math.PI*(.5-le)))}}),Exponential:Object.freeze({In:function(le){return le===0?0:Math.pow(1024,le-1)},Out:function(le){return le===1?1:1-Math.pow(2,-10*le)},InOut:function(le){return le===0?0:le===1?1:(le*=2)<1?.5*Math.pow(1024,le-1):.5*(-Math.pow(2,-10*(le-1))+2)}}),Circular:Object.freeze({In:function(le){return 1-Math.sqrt(1-le*le)},Out:function(le){return Math.sqrt(1- --le*le)},InOut:function(le){return(le*=2)<1?-.5*(Math.sqrt(1-le*le)-1):.5*(Math.sqrt(1-(le-=2)*le)+1)}}),Elastic:Object.freeze({In:function(le){return le===0?0:le===1?1:-Math.pow(2,10*(le-1))*Math.sin((le-1.1)*5*Math.PI)},Out:function(le){return le===0?0:le===1?1:Math.pow(2,-10*le)*Math.sin((le-.1)*5*Math.PI)+1},InOut:function(le){return le===0?0:le===1?1:(le*=2,le<1?-.5*Math.pow(2,10*(le-1))*Math.sin((le-1.1)*5*Math.PI):.5*Math.pow(2,-10*(le-1))*Math.sin((le-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(le){var e=1.70158;return le===1?1:le*le*((e+1)*le-e)},Out:function(le){var e=1.70158;return le===0?0:--le*le*((e+1)*le+e)+1},InOut:function(le){var e=2.5949095;return(le*=2)<1?.5*(le*le*((e+1)*le-e)):.5*((le-=2)*le*((e+1)*le+e)+2)}}),Bounce:Object.freeze({In:function(le){return 1-Easing.Bounce.Out(1-le)},Out:function(le){return le<1/2.75?7.5625*le*le:le<2/2.75?7.5625*(le-=1.5/2.75)*le+.75:le<2.5/2.75?7.5625*(le-=2.25/2.75)*le+.9375:7.5625*(le-=2.625/2.75)*le+.984375},InOut:function(le){return le<.5?Easing.Bounce.In(le*2)*.5:Easing.Bounce.Out(le*2-1)*.5+.5}}),generatePow:function(le){return le===void 0&&(le=4),le=le<Number.EPSILON?Number.EPSILON:le,le=le>1e4?1e4:le,{In:function(e){return Math.pow(e,le)},Out:function(e){return 1-Math.pow(1-e,le)},InOut:function(e){return e<.5?Math.pow(e*2,le)/2:(1-Math.pow(2-e*2,le))/2+.5}}}}),now=function(){return performance.now()},Group$1=function(){function le(){this._tweens={},this._tweensAddedDuringUpdate={}}return le.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(n){return e._tweens[n]})},le.prototype.removeAll=function(){this._tweens={}},le.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},le.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},le.prototype.update=function(e,n){e===void 0&&(e=now()),n===void 0&&(n=!1);var r=Object.keys(this._tweens);if(r.length===0)return!1;for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var fe=0;fe<r.length;fe++){var Ce=this._tweens[r[fe]],Re=!n;Ce&&Ce.update(e,Re)===!1&&!n&&delete this._tweens[r[fe]]}r=Object.keys(this._tweensAddedDuringUpdate)}return!0},le}(),Interpolation={Linear:function(le,e){var n=le.length-1,r=n*e,fe=Math.floor(r),Ce=Interpolation.Utils.Linear;return e<0?Ce(le[0],le[1],r):e>1?Ce(le[n],le[n-1],n-r):Ce(le[fe],le[fe+1>n?n:fe+1],r-fe)},Bezier:function(le,e){for(var n=0,r=le.length-1,fe=Math.pow,Ce=Interpolation.Utils.Bernstein,Re=0;Re<=r;Re++)n+=fe(1-e,r-Re)*fe(e,Re)*le[Re]*Ce(r,Re);return n},CatmullRom:function(le,e){var n=le.length-1,r=n*e,fe=Math.floor(r),Ce=Interpolation.Utils.CatmullRom;return le[0]===le[n]?(e<0&&(fe=Math.floor(r=n*(1+e))),Ce(le[(fe-1+n)%n],le[fe],le[(fe+1)%n],le[(fe+2)%n],r-fe)):e<0?le[0]-(Ce(le[0],le[0],le[1],le[1],-r)-le[0]):e>1?le[n]-(Ce(le[n],le[n],le[n-1],le[n-1],r-n)-le[n]):Ce(le[fe?fe-1:0],le[fe],le[n<fe+1?n:fe+1],le[n<fe+2?n:fe+2],r-fe)},Utils:{Linear:function(le,e,n){return(e-le)*n+le},Bernstein:function(le,e){var n=Interpolation.Utils.Factorial;return n(le)/n(e)/n(le-e)},Factorial:function(){var le=[1];return function(e){var n=1;if(le[e])return le[e];for(var r=e;r>1;r--)n*=r;return le[e]=n,n}}(),CatmullRom:function(le,e,n,r,fe){var Ce=(n-le)*.5,Re=(r-e)*.5,Pe=fe*fe,Ne=fe*Pe;return(2*e-2*n+Ce+Re)*Ne+(-3*e+3*n-2*Ce-Re)*Pe+Ce*fe+e}}},Sequence=function(){function le(){}return le.nextId=function(){return le._nextId++},le._nextId=0,le}(),mainGroup=new Group$1,Tween=function(){function le(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 le.prototype.getId=function(){return this._id},le.prototype.isPlaying=function(){return this._isPlaying},le.prototype.isPaused=function(){return this._isPaused},le.prototype.getDuration=function(){return this._duration},le.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},le.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},le.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},le.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 r in this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r]}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 fe={};for(var Ce in this._valuesEnd)fe[Ce]=this._valuesEnd[Ce];this._valuesEnd=fe}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},le.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},le.prototype._setupProperties=function(e,n,r,fe,Ce){for(var Re in r){var Pe=e[Re],Ne=Array.isArray(Pe),ze=Ne?"array":typeof Pe,Ae=!Ne&&Array.isArray(r[Re]);if(!(ze==="undefined"||ze==="function")){if(Ae){var Fe=r[Re];if(Fe.length===0)continue;for(var ke=[Pe],xt=0,Xt=Fe.length;xt<Xt;xt+=1){var Wt=this._handleRelativeValue(Pe,Fe[xt]);if(isNaN(Wt)){Ae=!1,console.warn("Found invalid interpolation list. Skipping.");break}ke.push(Wt)}Ae&&(r[Re]=ke)}if((ze==="object"||Ne)&&Pe&&!Ae){n[Re]=Ne?[]:{};var Zt=Pe;for(var Gt in Zt)n[Re][Gt]=Zt[Gt];fe[Re]=Ne?[]:{};var Fe=r[Re];if(!this._isDynamic){var wt={};for(var Gt in Fe)wt[Gt]=Fe[Gt];r[Re]=Fe=wt}this._setupProperties(Zt,n[Re],Fe,fe[Re],Ce)}else(typeof n[Re]=="undefined"||Ce)&&(n[Re]=Pe),Ne||(n[Re]*=1),Ae?fe[Re]=r[Re].slice().reverse():fe[Re]=n[Re]||0}}},le.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},le.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},le.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)},le.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)},le.prototype.stopChainedTweens=function(){for(var e=0,n=this._chainedTweens.length;e<n;e++)this._chainedTweens[e].stop();return this},le.prototype.group=function(e){return e===void 0&&(e=mainGroup),this._group=e,this},le.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},le.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},le.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},le.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},le.prototype.easing=function(e){return e===void 0&&(e=Easing.Linear.None),this._easingFunction=e,this},le.prototype.interpolation=function(e){return e===void 0&&(e=Interpolation.Linear),this._interpolationFunction=e,this},le.prototype.chain=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._chainedTweens=e,this},le.prototype.onStart=function(e){return this._onStartCallback=e,this},le.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},le.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},le.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},le.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},le.prototype.onStop=function(e){return this._onStopCallback=e,this},le.prototype.update=function(e,n){var r;if(e===void 0&&(e=now()),n===void 0&&(n=!0),this._isPaused)return!0;var fe=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>fe)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 Ce=e-this._startTime,Re=this._duration+((r=this._repeatDelayTime)!==null&&r!==void 0?r:this._delayTime),Pe=this._duration+this._repeat*Re,Ne=this._calculateElapsedPortion(Ce,Re,Pe),ze=this._easingFunction(Ne),Ae=this._calculateCompletionStatus(Ce,Re);if(Ae==="repeat"&&this._processRepetition(Ce,Re),this._updateProperties(this._object,this._valuesStart,this._valuesEnd,ze),Ae==="about-to-repeat"&&this._processRepetition(Ce,Re),this._onUpdateCallback&&this._onUpdateCallback(this._object,Ne),Ae==="repeat"||Ae==="about-to-repeat")this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1;else if(Ae==="completed"){this._isPlaying=!1,this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var Fe=0,ke=this._chainedTweens.length;Fe<ke;Fe++)this._chainedTweens[Fe].start(this._startTime+this._duration,!1)}return Ae!=="completed"},le.prototype._calculateElapsedPortion=function(e,n,r){if(this._duration===0||e>r)return 1;var fe=e%n,Ce=Math.min(fe/this._duration,1);return Ce===0&&e!==0&&e%this._duration===0?1:Ce},le.prototype._calculateCompletionStatus=function(e,n){return this._duration!==0&&e<this._duration?"playing":this._repeat<=0?"completed":e===this._duration?"about-to-repeat":"repeat"},le.prototype._processRepetition=function(e,n){var r=Math.min(Math.trunc((e-this._duration)/n)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=r);for(var fe in this._valuesStartRepeat){var Ce=this._valuesEnd[fe];!this._yoyo&&typeof Ce=="string"&&(this._valuesStartRepeat[fe]=this._valuesStartRepeat[fe]+parseFloat(Ce)),this._yoyo&&this._swapEndStartRepeatValues(fe),this._valuesStart[fe]=this._valuesStartRepeat[fe]}this._yoyo&&(this._reversed=!this._reversed),this._startTime+=n*r},le.prototype._updateProperties=function(e,n,r,fe){for(var Ce in r)if(n[Ce]!==void 0){var Re=n[Ce]||0,Pe=r[Ce],Ne=Array.isArray(e[Ce]),ze=Array.isArray(Pe),Ae=!Ne&&ze;Ae?e[Ce]=this._interpolationFunction(Pe,fe):typeof Pe=="object"&&Pe?this._updateProperties(e[Ce],Re,Pe,fe):(Pe=this._handleRelativeValue(Re,Pe),typeof Pe=="number"&&(e[Ce]=Re+(Pe-Re)*fe))}},le.prototype._handleRelativeValue=function(e,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?e+parseFloat(n):parseFloat(n)},le.prototype._swapEndStartRepeatValues=function(e){var n=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=n},le}(),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 Qn=Object.defineProperty,$n=Object.defineProperties;var qn=Object.getOwnPropertyDescriptors;var Bn=Object.getOwnPropertySymbols,e1=Object.getPrototypeOf,t1=Object.prototype.hasOwnProperty,i1=Object.prototype.propertyIsEnumerable,n1=Reflect.get;var In=(le,e)=>(e=Symbol[le])?e:Symbol.for("Symbol."+le),s1=le=>{throw TypeError(le)},Cn=Math.pow,Un=(le,e,n)=>e in le?Qn(le,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):le[e]=n,xi=(le,e)=>{for(var n in e||(e={}))t1.call(e,n)&&Un(le,n,e[n]);if(Bn)for(var n of Bn(e))i1.call(e,n)&&Un(le,n,e[n]);return le},nn=(le,e)=>$n(le,qn(e));var T0=(le,e,n)=>Un(le,typeof e!="symbol"?e+"":e,n);var Zn=(le,e,n)=>n1(e1(le),n,e);var B0=(le,e,n)=>new Promise((r,fe)=>{var Ce=Ne=>{try{Pe(n.next(Ne))}catch(ze){fe(ze)}},Re=Ne=>{try{Pe(n.throw(Ne))}catch(ze){fe(ze)}},Pe=Ne=>Ne.done?r(Ne.value):Promise.resolve(Ne.value).then(Ce,Re);Pe((n=n.apply(le,e)).next())}),r1=function(le,e){this[0]=le,this[1]=e};var On=le=>{var e=le[In("asyncIterator")],n=!1,r,fe={};return e==null?(e=le[In("iterator")](),r=Ce=>fe[Ce]=Re=>e[Ce](Re)):(e=e.call(le),r=Ce=>fe[Ce]=Re=>{if(n){if(n=!1,Ce==="throw")throw Re;return Re}return n=!0,{done:!1,value:new r1(new Promise(Pe=>{var Ne=e[Ce](Re);Ne instanceof Object||s1("Object expected"),Pe(Ne)}),1)}}),fe[In("iterator")]=()=>fe,r("next"),"throw"in e?r("throw"):fe.throw=Ce=>{throw Ce},"return"in e&&r("return"),fe},Dn=(le,e,n)=>(e=le[In("asyncIterator")])?e.call(le):(le=le[In("iterator")](),e={},n=(r,fe)=>(fe=le[r])&&(e[r]=Ce=>new Promise((Re,Pe,Ne)=>(Ce=fe.call(le,Ce),Ne=Ce.done,Promise.resolve(Ce.value).then(ze=>Re({value:ze,done:Ne}),Pe)))),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=require("geojson-cn/json-lite/all.json"),turf=require("@turf/turf"),geojsonCn=require("geojson-cn");Array.prototype.at||(Array.prototype.at=function(le){return le<0&&(le=this.length+le),this[le]});const version="0.30.0-beta.42",publicKeyPEM="LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t",accessToken={token:void 0,getInfo(){if(!this.token)return"";const[le,e,n]=this.token.split(":::"),r=jsrsasign.KEYUTIL.getKey(atob(publicKeyPEM)),fe=CryptoJS.enc.Base64.parse(e),Ce=CryptoJS.enc.Base64.parse(n),Re=CryptoJS.lib.WordArray.create(fe.words.slice(0,4)),Pe=CryptoJS.lib.WordArray.create(fe.words.slice(4)),Ne=jsrsasign.KJUR.crypto.Util.hashHex(fe.toString(),"sha256"),ze=r.verifyWithMessageHashPSS(Ne,jsrsasign.b64tohex(le),"sha256",32);if(!ze)return this.token=void 0,"";const Fe=CryptoJS.AES.decrypt({ciphertext:Pe},Ce,{iv:Re,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8),ke=JSON.parse(Fe),xt=Date.now();return!ke.s||ke.s>xt?(this.token=void 0,""):ke.e&&ke.e<xt?(this.token=void 0,""):(ke.isValid=ze,ke)}};var Easing=Object.freeze({Linear:Object.freeze({None:function(le){return le},In:function(le){return le},Out:function(le){return le},InOut:function(le){return le}}),Quadratic:Object.freeze({In:function(le){return le*le},Out:function(le){return le*(2-le)},InOut:function(le){return(le*=2)<1?.5*le*le:-.5*(--le*(le-2)-1)}}),Cubic:Object.freeze({In:function(le){return le*le*le},Out:function(le){return--le*le*le+1},InOut:function(le){return(le*=2)<1?.5*le*le*le:.5*((le-=2)*le*le+2)}}),Quartic:Object.freeze({In:function(le){return le*le*le*le},Out:function(le){return 1- --le*le*le*le},InOut:function(le){return(le*=2)<1?.5*le*le*le*le:-.5*((le-=2)*le*le*le-2)}}),Quintic:Object.freeze({In:function(le){return le*le*le*le*le},Out:function(le){return--le*le*le*le*le+1},InOut:function(le){return(le*=2)<1?.5*le*le*le*le*le:.5*((le-=2)*le*le*le*le+2)}}),Sinusoidal:Object.freeze({In:function(le){return 1-Math.sin((1-le)*Math.PI/2)},Out:function(le){return Math.sin(le*Math.PI/2)},InOut:function(le){return .5*(1-Math.sin(Math.PI*(.5-le)))}}),Exponential:Object.freeze({In:function(le){return le===0?0:Math.pow(1024,le-1)},Out:function(le){return le===1?1:1-Math.pow(2,-10*le)},InOut:function(le){return le===0?0:le===1?1:(le*=2)<1?.5*Math.pow(1024,le-1):.5*(-Math.pow(2,-10*(le-1))+2)}}),Circular:Object.freeze({In:function(le){return 1-Math.sqrt(1-le*le)},Out:function(le){return Math.sqrt(1- --le*le)},InOut:function(le){return(le*=2)<1?-.5*(Math.sqrt(1-le*le)-1):.5*(Math.sqrt(1-(le-=2)*le)+1)}}),Elastic:Object.freeze({In:function(le){return le===0?0:le===1?1:-Math.pow(2,10*(le-1))*Math.sin((le-1.1)*5*Math.PI)},Out:function(le){return le===0?0:le===1?1:Math.pow(2,-10*le)*Math.sin((le-.1)*5*Math.PI)+1},InOut:function(le){return le===0?0:le===1?1:(le*=2,le<1?-.5*Math.pow(2,10*(le-1))*Math.sin((le-1.1)*5*Math.PI):.5*Math.pow(2,-10*(le-1))*Math.sin((le-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(le){var e=1.70158;return le===1?1:le*le*((e+1)*le-e)},Out:function(le){var e=1.70158;return le===0?0:--le*le*((e+1)*le+e)+1},InOut:function(le){var e=2.5949095;return(le*=2)<1?.5*(le*le*((e+1)*le-e)):.5*((le-=2)*le*((e+1)*le+e)+2)}}),Bounce:Object.freeze({In:function(le){return 1-Easing.Bounce.Out(1-le)},Out:function(le){return le<1/2.75?7.5625*le*le:le<2/2.75?7.5625*(le-=1.5/2.75)*le+.75:le<2.5/2.75?7.5625*(le-=2.25/2.75)*le+.9375:7.5625*(le-=2.625/2.75)*le+.984375},InOut:function(le){return le<.5?Easing.Bounce.In(le*2)*.5:Easing.Bounce.Out(le*2-1)*.5+.5}}),generatePow:function(le){return le===void 0&&(le=4),le=le<Number.EPSILON?Number.EPSILON:le,le=le>1e4?1e4:le,{In:function(e){return Math.pow(e,le)},Out:function(e){return 1-Math.pow(1-e,le)},InOut:function(e){return e<.5?Math.pow(e*2,le)/2:(1-Math.pow(2-e*2,le))/2+.5}}}}),now=function(){return performance.now()},Group$1=function(){function le(){this._tweens={},this._tweensAddedDuringUpdate={}}return le.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(n){return e._tweens[n]})},le.prototype.removeAll=function(){this._tweens={}},le.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},le.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},le.prototype.update=function(e,n){e===void 0&&(e=now()),n===void 0&&(n=!1);var r=Object.keys(this._tweens);if(r.length===0)return!1;for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var fe=0;fe<r.length;fe++){var Ce=this._tweens[r[fe]],Re=!n;Ce&&Ce.update(e,Re)===!1&&!n&&delete this._tweens[r[fe]]}r=Object.keys(this._tweensAddedDuringUpdate)}return!0},le}(),Interpolation={Linear:function(le,e){var n=le.length-1,r=n*e,fe=Math.floor(r),Ce=Interpolation.Utils.Linear;return e<0?Ce(le[0],le[1],r):e>1?Ce(le[n],le[n-1],n-r):Ce(le[fe],le[fe+1>n?n:fe+1],r-fe)},Bezier:function(le,e){for(var n=0,r=le.length-1,fe=Math.pow,Ce=Interpolation.Utils.Bernstein,Re=0;Re<=r;Re++)n+=fe(1-e,r-Re)*fe(e,Re)*le[Re]*Ce(r,Re);return n},CatmullRom:function(le,e){var n=le.length-1,r=n*e,fe=Math.floor(r),Ce=Interpolation.Utils.CatmullRom;return le[0]===le[n]?(e<0&&(fe=Math.floor(r=n*(1+e))),Ce(le[(fe-1+n)%n],le[fe],le[(fe+1)%n],le[(fe+2)%n],r-fe)):e<0?le[0]-(Ce(le[0],le[0],le[1],le[1],-r)-le[0]):e>1?le[n]-(Ce(le[n],le[n],le[n-1],le[n-1],r-n)-le[n]):Ce(le[fe?fe-1:0],le[fe],le[n<fe+1?n:fe+1],le[n<fe+2?n:fe+2],r-fe)},Utils:{Linear:function(le,e,n){return(e-le)*n+le},Bernstein:function(le,e){var n=Interpolation.Utils.Factorial;return n(le)/n(e)/n(le-e)},Factorial:function(){var le=[1];return function(e){var n=1;if(le[e])return le[e];for(var r=e;r>1;r--)n*=r;return le[e]=n,n}}(),CatmullRom:function(le,e,n,r,fe){var Ce=(n-le)*.5,Re=(r-e)*.5,Pe=fe*fe,Ne=fe*Pe;return(2*e-2*n+Ce+Re)*Ne+(-3*e+3*n-2*Ce-Re)*Pe+Ce*fe+e}}},Sequence=function(){function le(){}return le.nextId=function(){return le._nextId++},le._nextId=0,le}(),mainGroup=new Group$1,Tween=function(){function le(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 le.prototype.getId=function(){return this._id},le.prototype.isPlaying=function(){return this._isPlaying},le.prototype.isPaused=function(){return this._isPaused},le.prototype.getDuration=function(){return this._duration},le.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},le.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},le.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},le.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 r in this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r]}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 fe={};for(var Ce in this._valuesEnd)fe[Ce]=this._valuesEnd[Ce];this._valuesEnd=fe}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},le.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},le.prototype._setupProperties=function(e,n,r,fe,Ce){for(var Re in r){var Pe=e[Re],Ne=Array.isArray(Pe),ze=Ne?"array":typeof Pe,Ae=!Ne&&Array.isArray(r[Re]);if(!(ze==="undefined"||ze==="function")){if(Ae){var Fe=r[Re];if(Fe.length===0)continue;for(var ke=[Pe],xt=0,Xt=Fe.length;xt<Xt;xt+=1){var Wt=this._handleRelativeValue(Pe,Fe[xt]);if(isNaN(Wt)){Ae=!1,console.warn("Found invalid interpolation list. Skipping.");break}ke.push(Wt)}Ae&&(r[Re]=ke)}if((ze==="object"||Ne)&&Pe&&!Ae){n[Re]=Ne?[]:{};var Zt=Pe;for(var Gt in Zt)n[Re][Gt]=Zt[Gt];fe[Re]=Ne?[]:{};var Fe=r[Re];if(!this._isDynamic){var wt={};for(var Gt in Fe)wt[Gt]=Fe[Gt];r[Re]=Fe=wt}this._setupProperties(Zt,n[Re],Fe,fe[Re],Ce)}else(typeof n[Re]=="undefined"||Ce)&&(n[Re]=Pe),Ne||(n[Re]*=1),Ae?fe[Re]=r[Re].slice().reverse():fe[Re]=n[Re]||0}}},le.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},le.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},le.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)},le.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)},le.prototype.stopChainedTweens=function(){for(var e=0,n=this._chainedTweens.length;e<n;e++)this._chainedTweens[e].stop();return this},le.prototype.group=function(e){return e===void 0&&(e=mainGroup),this._group=e,this},le.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},le.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},le.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},le.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},le.prototype.easing=function(e){return e===void 0&&(e=Easing.Linear.None),this._easingFunction=e,this},le.prototype.interpolation=function(e){return e===void 0&&(e=Interpolation.Linear),this._interpolationFunction=e,this},le.prototype.chain=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._chainedTweens=e,this},le.prototype.onStart=function(e){return this._onStartCallback=e,this},le.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},le.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},le.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},le.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},le.prototype.onStop=function(e){return this._onStopCallback=e,this},le.prototype.update=function(e,n){var r;if(e===void 0&&(e=now()),n===void 0&&(n=!0),this._isPaused)return!0;var fe=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>fe)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 Ce=e-this._startTime,Re=this._duration+((r=this._repeatDelayTime)!==null&&r!==void 0?r:this._delayTime),Pe=this._duration+this._repeat*Re,Ne=this._calculateElapsedPortion(Ce,Re,Pe),ze=this._easingFunction(Ne),Ae=this._calculateCompletionStatus(Ce,Re);if(Ae==="repeat"&&this._processRepetition(Ce,Re),this._updateProperties(this._object,this._valuesStart,this._valuesEnd,ze),Ae==="about-to-repeat"&&this._processRepetition(Ce,Re),this._onUpdateCallback&&this._onUpdateCallback(this._object,Ne),Ae==="repeat"||Ae==="about-to-repeat")this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1;else if(Ae==="completed"){this._isPlaying=!1,this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var Fe=0,ke=this._chainedTweens.length;Fe<ke;Fe++)this._chainedTweens[Fe].start(this._startTime+this._duration,!1)}return Ae!=="completed"},le.prototype._calculateElapsedPortion=function(e,n,r){if(this._duration===0||e>r)return 1;var fe=e%n,Ce=Math.min(fe/this._duration,1);return Ce===0&&e!==0&&e%this._duration===0?1:Ce},le.prototype._calculateCompletionStatus=function(e,n){return this._duration!==0&&e<this._duration?"playing":this._repeat<=0?"completed":e===this._duration?"about-to-repeat":"repeat"},le.prototype._processRepetition=function(e,n){var r=Math.min(Math.trunc((e-this._duration)/n)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=r);for(var fe in this._valuesStartRepeat){var Ce=this._valuesEnd[fe];!this._yoyo&&typeof Ce=="string"&&(this._valuesStartRepeat[fe]=this._valuesStartRepeat[fe]+parseFloat(Ce)),this._yoyo&&this._swapEndStartRepeatValues(fe),this._valuesStart[fe]=this._valuesStartRepeat[fe]}this._yoyo&&(this._reversed=!this._reversed),this._startTime+=n*r},le.prototype._updateProperties=function(e,n,r,fe){for(var Ce in r)if(n[Ce]!==void 0){var Re=n[Ce]||0,Pe=r[Ce],Ne=Array.isArray(e[Ce]),ze=Array.isArray(Pe),Ae=!Ne&&ze;Ae?e[Ce]=this._interpolationFunction(Pe,fe):typeof Pe=="object"&&Pe?this._updateProperties(e[Ce],Re,Pe,fe):(Pe=this._handleRelativeValue(Re,Pe),typeof Pe=="number"&&(e[Ce]=Re+(Pe-Re)*fe))}},le.prototype._handleRelativeValue=function(e,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?e+parseFloat(n):parseFloat(n)},le.prototype._swapEndStartRepeatValues=function(e){var n=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=n},le}(),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
|
${le}
|
|
5365
5365
|
</div>
|
|
5366
|
-
`,e},worldPacificCentre=le=>{le.loaderAdd=function(){const e=this.loader;e.add(["/image/map/jianbian.webp"]),e.add(["/image/map/hp2.webp","/image/map/fx2.webp"])},le.initMaterial=function(){return B0(this,null,function*(){const e=this.loader,n=this.mList,r=(()=>{const fe=e.getAsset("/image/map/hp2.webp");fe.center.set(.5,.5),fe.repeat.set(.97,1.01);const Ce=new MeshStandardMaterial({name:"顶面",map:e.getAsset("/image/map/hp2.webp"),normalMap:e.getAsset("/image/map/fx2.webp"),normalScale:new Vector2(2,1)}),Re=new MeshBasicMaterial({name:"侧面",map:e.getAsset("/image/map/jianbian.webp")}),Pe=new zt({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),Ne=new zt({name:"板块边线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:Ce,sideMat:Re,lineMat:Pe,extrudeLineMat:le.options.extrudeLine?Ne:null}})();n.addMultiple("plane",r)})}},world=le=>{if(le.options.lineOffset=.02,delete le.extendsOptions.handleBackKeepCamvasState,le.extendsOptions.extrudeLine=()=>le.options.extrudeLine,le.extendsOptions.worldPacificCentre=()=>le.options.worldPacificCentre,le.options.worldPacificCentre){worldPacificCentre(le);return}le.initMaterial=function(){return B0(this,null,function*(){const e=this.mList,n=(()=>{const r=new MeshBasicMaterial({name:"顶面",color:"#0d2425"}),fe=new MeshBasicMaterial({name:"侧面",color:"#0d2425"}),Ce=new zt({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),Re=new zt({name:"板块边线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:r,sideMat:fe,lineMat:Ce,extrudeLineMat:le.options.extrudeLine?Re:null}})();e.addMultiple("plane",n)})}},china=le=>{le.options.lineOffset=.005,le.loaderAdd=function(){return B0(this,null,function*(){this.loader.add(["/image/map/jianbian.webp","/image/map/hp.webp","/image/map/shuchu2.webp"]),this.loaderAddBg()})},le.initMaterial=function(){return B0(this,null,function*(){const e=this.loader,n=(()=>{const r=new MeshStandardMaterial({name:"顶面",map:e.getAsset("/image/map/hp.webp"),normalMap:e.getAsset("/image/map/shuchu2.webp")}),fe=new MeshBasicMaterial({name:"侧面",map:e.getAsset("/image/map/jianbian.webp")}),Ce=new zt({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),Re=new zt({name:"板块边线",color:new Color$1("#00FFED"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:r,sideMat:fe,lineMat:Ce,extrudeLineMat:Re}})();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=le=>{le.loaderAdd=function(){return B0(this,null,function*(){this.loader.add(["/image/map/jianbian.webp"]),this.loaderAddBg()})},le.initMaterial=function(){return B0(this,null,function*(){const e=this.loader,n=(()=>{const r=new MeshBasicMaterial({name:"顶面",color:new Color$1("#0d2425")}),fe=new MeshBasicMaterial({name:"侧面",map:e.getAsset("/image/map/jianbian.webp")}),Ce=new zt({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),Re=new zt({name:"板块边线",color:new Color$1("#00FFED"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:r,sideMat:fe,lineMat:Ce,extrudeLineMat:Re}})();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=le=>{le.extendsOptions={mapDepth:le.options.mapDepth,parentBg:le.options.parentBg,continentsBg:le.options.continentsBg,continentsBgDepth:le.options.continentsBgDepth,mergeSide:le.options.mergeSide,handleBackKeepCamvasState:le.options.handleBackKeepCamvasState,mapBoundary:le.options.mapBoundary,showBuilding:le.options.showBuilding,showRoad:le.options.showRoad,showGrassland:le.options.showGrassland,showRiver:le.options.showRiver,buildingSideGradient:le.options.buildingSideGradient,buildingHasSide:le.options.buildingHasSide,setWaterMaterial:le.options.setWaterMaterial,showCityOnMapInnerLine:le.options.showCityOnMapInnerLine},le.options.parentBg&&(le.extendsOptions.parentBgDepth=()=>le.options.parentBgDepth),le.loaderAdd=function(){this.loader.add(["/image/map2/side.png"])},le.initMaterial=function(){return B0(this,null,function*(){const n=this.loader,r=(()=>{const fe=new MeshBasicMaterial({name:"板块顶面",color:"#094253"}),Ce=new MeshBasicMaterial({name:"板块侧面",map:n.getAsset("/image/map2/side.png"),side:DoubleSide}),Re=new zt({name:"板块边框",color:new Color$1("#02f7eb"),lineWidth:1.8,sizeAttenuation:!1,depthTest:!1}),Pe=new zt({name:"板块内线",color:new Color$1("#02f7eb"),lineWidth:1.8,sizeAttenuation:!1,depthTest:!1});return{topMat:fe,sideMat:Ce,lineMat:Pe,extrudeLineMat:Re}})();this.mList.addMultiple("plane",r),this.initMaterialBg()})};const e=le.init.bind(le);le.init=function(){return B0(this,null,function*(){yield e(),yield this.initCityOnMap(this.mapInfo.adcode)})}},base=le=>{if(le.initMaterialBg=function(){return B0(this,null,function*(){const e=this.getRoomEnvMap();if(this.options.parentBg){if(this.options.adcode!==1e5){const r=(()=>{const fe=new MeshStandardMaterial({name:"父级顶面",color:"#031529",emissive:"#010f1f",envMap:e}),Ce=new MeshBasicMaterial({name:"父级侧面",color:"#064d73",side:DoubleSide}),Re=new zt({name:"父级板块线",color:new Color$1("#3f648c"),lineWidth:1.2,sizeAttenuation:!1});return{topMat:fe,sideMat:Ce,lineMat:Re}})();this.mList.addMultiple("parentPlane",r)}const n=(()=>{const r=new MeshStandardMaterial({name:"世界顶面",color:"#031529",emissive:"#010f1f",envMap:e}),fe=new MeshBasicMaterial({name:"世界侧面",color:"#064d73",side:DoubleSide}),Ce=new zt({name:"世界板块线",color:new Color$1("#3f648c"),lineWidth:1.2,sizeAttenuation:!1});return{topMat:r,sideMat:fe,lineMat:Ce}})();this.mList.addMultiple("worldPlane",n)}if(this.options.continentsBg){const n=(()=>{const r=new MeshStandardMaterial({name:"大洲板块顶面",emissive:"#235278"}),fe=new MeshBasicMaterial({name:"大洲板块侧面",color:"#0c1528"}),Ce=new zt({name:"大洲板块线",color:new Color$1("#1488e0"),sizeAttenuation:!1,lineWidth:this.options.lineWidth});return{topMat:r,sideMat:fe,lineMat:Ce}})();this.mList.addMultiple("continents",n)}})},le.options.style==="map2CityOnMap"){cityOnMap(le);return}le.loaderAdd=function(){return B0(this,null,function*(){this.loaderAddBg()})},le.initMaterial=function(){return B0(this,null,function*(){const e=(()=>{const n=new MeshBasicMaterial({name:"板块顶面",color:new Color$1("#064773")}),r=new MeshBasicMaterial({name:"板块侧面",color:new Color$1("#064d73"),side:DoubleSide}),fe=new zt({name:"板块线",color:new Color$1("#02BAF7"),lineWidth:1,sizeAttenuation:!1}),Ce=new zt({name:"板块边框线",color:new Color$1("#02BAF7"),lineWidth:1,sizeAttenuation:!1});return{topMat:n,sideMat:r,lineMat:fe,extrudeLineMat:Ce}})();this.mList.addMultiple("plane",e),this.options.drillDownFirstLevelUseBgMats&&this.mList.copyMultiple("plane","bgPlane"),this.initMaterialBg()})}},getAdcodeShowLevel=(le,e=!0)=>{if(le===0)return"world";if(le===1e5)return"country";if(/^\d{6}$/.test(`${le}`)){const{level:n,parent:r}=findAdcodeInfo(le),fe=r&&findAdcodeInfo(r).level;return n==="district"&&fe==="province"&&e?"city":n}else if(continentsType.find(n=>n.adcode===le))return"continent"},Tn=class Tn extends Base{constructor(){super(...arguments);T0(this,"leadObjs",objs);T0(this,"mapHistory",[]);T0(this,"activePlaneMap",null);T0(this,"isAnimating",!1);T0(this,"parentBg",[]);T0(this,"continentsBg");T0(this,"group");T0(this,"projection");T0(this,"pcenter",[104,37.5]);T0(this,"pscale",5e4/1e3);T0(this,"meters");T0(this,"cityVis",[]);T0(this,"extendsOptions",{mapDepth:()=>this.getOptionsDepth(this.options.adcode),equirectangular:()=>this.options.projectionType==="equirectangular",mapBoundary:()=>this.options.mapBoundary,mergeSide:()=>this.options.mergeSide});T0(this,"initSettingsObj",{label:!1,labelLite:!1,shadowMap:!1});T0(this,"caId");T0(this,"shadowMapLight");T0(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 r=xi(xi({0:worldExclATAJson,1e5:chinaJson},continentsJson),n==null?void 0:n.geojsonMap);let fe=xi({0:worldExclATALiteJson,1e5:chinaLiteJson},continentsLiteJson);Object.keys(r).forEach(Ce=>{Ce!=="100000"&&/^\d{6}$/.test(Ce)&&r[+Ce].features.forEach(Pe=>{const Ne=Pe.properties.adcode;fe[Ne]={type:"FeatureCollection",features:[Pe]}})}),fe=xi(xi({},fe),n==null?void 0:n.extrudeLineGeojsonMap),super.setOptions(nn(xi({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:r,extrudeLineGeojsonMap:fe})),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,r){return B0(this,null,function*(){return yield Zn(Tn.prototype,this,"handleSetting").call(this,n,r),n==="label"?r===!1?(this.eraseLabels(),this.options.showLabel=!1):(this.settings.labelLite=!1,yield this.settings.labelLite,this.options.showLabel=!0,yield this.drawLabels()):n==="labelLite"?r===!1?(this.eraseLabels(),this.options.showLabel=!1):(this.settings.label=!1,yield this.settings.label,this.options.showLabel="lite",yield this.drawLabels()):n==="shadowMap"&&(r===!1?this.shadowMapDisabled():yield this.shadowMapEnabled()),r})}init(){return B0(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(()=>this.mapArea||[],"down",({baseObject:r,mouseEvent:fe})=>{(this.playing||fe.metaKey||fe.ctrlKey)&&this.handleClick(r)}),this.options.clickOusideBack&&this.lead.handlePick(()=>this.map?[this.map]:[],"downOutside",({mouseEvent:r})=>{(this.playing||r.metaKey||r.ctrlKey)&&this.handleClick()})),yield Promise.all(this.lead.objectsPromise)})}initCityVis(n,r=!1){return B0(this,null,function*(){var Pe;if((Pe=this.options.fixCity)!=null&&Pe[n]&&(n=this.options.fixCity[n]),n===71e4)return this.settings.mouseLeft=Xi.SCREEN_PAN,yield this.settings.mouseLeft,this.pencil.camera.userData.up="0,0,1",null;const fe=new City({container:this.container,editor:!1}),Ce=getCityConfig(n);fe.setOptions({container:this.container,center:Ce.center,grey:r,adcode:n,cacheKey:this.options.cacheCity?`${n}`:void 0,jsonName:Ce.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}),yield fe.init();const Re=this.projection(Ce.center);return Re&&fe.group.position.set(Re[0],-Re[1],0),this.cityVis.push(fe),this.settings.mouseLeft=Xi.SCREEN_PAN,yield this.settings.mouseLeft,this.emit("initCityVis",n),fe})}initCityOnMap(n){return B0(this,null,function*(){const r=this.getAdcodeShowLevel(n);if(r==="province"){const fe=yield this.initCityVis(n);yield fe==null?void 0:fe.drawCityPlane(n,this.lead.group)}else if(r==="city"){const fe=findAdcodeInfo(n).c;let Ce=null;if(fe.length>0)for(const Re of fe)Ce=yield this.initCityVis(Re);else Ce=yield this.initCityVis(n);yield Ce==null?void 0:Ce.drawCityPlane(n,this.lead.group),this.pencil.camera.near=.001,this.pencil.camera.far=7,this.pencil.camera.updateProjectionMatrix()}else if(r==="district"){const fe=yield this.initCityVis(n);if(yield fe==null?void 0:fe.drawCityPlane(n,this.lead.group),this.pencil.camera.near=.001,this.pencil.camera.far=7,this.pencil.camera.updateProjectionMatrix(),this.options.nearbyCities){const Ce=findAdcodeInfo(n).parent,Re=findAdcodeInfo(Ce).c;for(const Pe of Re)(this.options.nearbyCities==="full"||Pe!==n)&&(yield this.initCityVis(Pe,!0))}}this.cityVis.forEach(fe=>{if(!fe.options.grey){const Ce=this.mapObj.depth+1e-5;fe.group.position.z=this.mapObj.z+Ce}})})}initVisBg(){return B0(this,null,function*(){let n=1e3,r=1e3;const fe=new Vector3(0,0,0);if(this.options.parentBg){const Ce={projection:{center:this.pcenter,scale:this.pscale,rotate:[0,0],projectionType:this.options.projectionType},areaGroup:!1,depth:this.options.parentBgDepth},Re=this.options.adcode!==1e5;if(Re){const xt=this.mList.getMultiple("parentPlane"),Xt=findAdcodeInfo(this.options.adcode).parent,Wt=findAdcodeInfo(Xt),Zt=Wt.b,{res:Gt}=yield this.getGeojson(Xt),wt=yield this.lead.draw("PlaneMap",xi({key:"bg-100000",geojson:Gt,bbox:Zt,materialOptions:xi({},xt)},Ce),this.group);wt.object3d.name=Wt.name,wt.lineArr.forEach(Vt=>{Vt.object3d.name="线",this.lead.updateBaseObjectKey(Vt,{type:"100000line"}),this.initBaseObjectUserData(Vt)}),wt.areaArr.forEach(Vt=>{Vt.object3d.name="板块",this.lead.updateBaseObjectKey(Vt,{type:"100000area"})}),wt.position.z=-this.options.parentBgDepth,this.parentBg.push(wt)}const Pe=this.mList.getMultiple("worldPlane"),Ne=this.options.geojsonMap[0],ze=findAdcodeInfo(0).b,Ae=yield this.lead.draw("PlaneMap",nn(xi({key:"bg-0",geojson:nn(xi({},Ne),{features:[...Ne.features.filter(xt=>Re?xt.properties.iso_a3!=="CHN":!0)]}),bbox:ze,materialOptions:xi({},Pe)},Ce),{projection:nn(xi({},Ce.projection),{rotate:this.options.worldPacificCentre?[-160,0]:void 0})}),this.group);Ae.object3d.name="世界",Ae.lineArr.forEach(xt=>{xt.object3d.name="线",this.lead.updateBaseObjectKey(xt,{type:"worldline"}),this.initBaseObjectUserData(xt)}),Ae.areaArr.forEach(xt=>{xt.object3d.name="板块",this.lead.updateBaseObjectKey(xt,{type:"worldarea"})}),Ae.position.z=-this.options.parentBgDepth,this.parentBg.push(Ae);const{center:Fe,size:ke}=Ae.getSize();n=ke.x,r=ke.y,fe.set(Fe.x,Fe.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 Ce=this.getLocationPosition([104,37.5]);this.continentsBg.position.set(...Ce)}this.continentsBg.position.z=.1}if(this.options.bottomPlane){const Ce=yield this.lead.draw("CityPlane",{width:n,height:r,color:"#0f1e57"},this.group);Ce.object3d.name="地图底面",this.lead.updateBaseObjectKey(Ce,{type:"map-plane"}),this.options.bottomPlaneWater&&Ce.addWater(),Ce.position.copy(fe),Ce.position.z-=.1}})}initVis(n){return B0(this,null,function*(){var r;if(yield this.setAdcode({adcodes:[n],duration:0}),this.options.style!=="map2Base"&&this.options.style!=="map2CityOnMap"){const fe=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}),Ce=this.pencil.cameraPositon,Re=this.pencil.cameraTarget;fe==null||fe.spotLight.position.copy(Ce),fe==null||fe.spotLight.target.position.copy(Re)}if(this.options.mapBoundary){const fe=new Box3().setFromObject((r=this.map)==null?void 0:r.object3d);this.pencil.controls.setBoundary(fe)}yield this.initVisBg()})}loaderAddBg(){this.options.bottomPlaneWater&&this.loader.add(["/image/water/normalMap0.jpg","/image/water/normalMap1.jpg"],{})}initMaterialBg(){return B0(this,null,function*(){if(this.options.parentBg){const n=(()=>{const r=new MeshStandardMaterial({name:"世界顶面",emissive:"#081417",color:"#000000"}),fe=new MeshBasicMaterial({name:"世界侧面",color:"#051714",side:DoubleSide}),Ce=new zt({name:"世界线",color:new Color$1("#50766E"),sizeAttenuation:!1,lineWidth:this.options.lineWidth});return{topMat:r,sideMat:fe,lineMat:Ce}})();this.mList.addMultiple("worldPlane",n),this.options.adcode!==1e5&&(this.mList.copyMultiple("worldPlane","parentPlane"),Object.values(this.mList.getMultiple("parentPlane")).forEach(r=>{r.name=r.name.replace("世界","父级")}))}if(this.options.continentsBg){const n=(()=>{const r=new MeshStandardMaterial({name:"大洲板块顶面",emissive:"#154532"}),fe=new MeshBasicMaterial({name:"大洲板块侧面",color:"#0c1528"}),Ce=new zt({name:"大洲板块线",color:new Color$1("#09e6c1"),sizeAttenuation:!1,lineWidth:this.options.lineWidth});return{topMat:r,sideMat:fe,lineMat:Ce}})();this.mList.addMultiple("continents",n)}})}consoleMousePostion(){this.addListener(this.container,"click",n=>{var Ce,Re;const r=this.unproject(n,this.mapObj.z+this.mapObj.depth),fe=(Re=(Ce=this.projection).invert)==null?void 0:Re.call(Ce,[r.x,-r.y]);console.log("consoleMousePostion.postion",r),console.log("consoleMousePostion.lnglat",fe)})}setAreaMaterialByProperty(n,r,fe){if(!this.map)return;const Ce=this.map.areaArr.find(Re=>Re.userData[n]===r);if(Ce){const Re=Ce.object3d;let Pe=this.mList.get("plane#topMat");fe!=="origin"&&(Pe=Re.material[0].clone(),fe.color&&Pe.color.set(fe.color),fe.emissive&&(Pe.emissive.set(fe.emissive),Pe.emissiveIntensity=fe.emissiveIntensity||1)),Re.material[0]=Pe}}setLineMaterialByProperty(n,r,fe){if(!this.map)return;const Ce=this.map.lineArr.find(Re=>Re.userData[n]===r);if(Ce){const Re=Ce.object3d;let Pe=this.mList.get("plane#lineMat");fe!=="origin"&&(Pe=Re.material.clone(),fe.color&&Pe.color.set(fe.color),fe.width&&(Pe.lineWidth=fe.width)),Re.material=Pe}}addAreaPlaneByProperty(n,r,fe){return B0(this,null,function*(){if(!this.map)return;const Re=this.map.options.geojson.features.find(Pe=>Pe.properties&&Pe.properties[n]===r);if(Re){let Pe=fe.material,Ne=fe.sideMaterial;if(y(fe.sideMaterial)&&(Ne=new MeshBasicMaterial(xi({},fe.sideMaterial))),y(fe.material)&&(Pe=new MeshBasicMaterial(xi({},fe.material))),fe.area){const Fe=this.objectByUuid(fe.area);Fe&&([Pe,Ne]=Fe.material)}let ze=fe.lineMaterial;if(y(fe.lineMaterial)&&(ze=new zt(xi({},fe.lineMaterial))),fe.line){const Fe=this.objectByUuid(fe.line);Fe&&(ze=Fe.material)}const Ae=yield this.lead.draw("PlaneMap",{geojson:{type:"FeatureCollection",features:[Re]},depth:fe.depth||0,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:{topMat:Pe,lineMat:ze,sideMat:Ne},areaGroup:!1},this.group);if(Ae.position.z=this.mapObj.z+this.mapObj.depth+.01,fe.lineBloom&&Ae.lineArr.forEach(Fe=>{Fe.enableBloom()}),fe.area){Ae.position.z=0;const Fe=this.baseObjectByUuid(fe.area);Ae.areaArr.forEach(ke=>{Fe!=null&&Fe.isBloom&&ke.enableBloom(),ke.scale.z=Fe.scale.z,ke.position.z=Fe.position.z})}if(fe.line){const Fe=this.baseObjectByUuid(fe.line);Ae.lineArr.forEach(ke=>{Fe!=null&&Fe.isBloom&&ke.enableBloom(),ke.position.z=Fe.position.z})}return Ae}})}showAction(){return B0(this,null,function*(){Zn(Tn.prototype,this,"showAction").call(this),this.useSaveCamera(`map-${this.options.adcode}`);const n=this.lead.group;if(this.mapHistory[0]){const{stop:r,start:fe}=sinusoidalInOut({onUpdate:Ce=>{if(!this.mapHistory[0]){r();return}n.position.z=-this.mapHistory[0].depth*(1-Ce)}});yield fe(),this.saveCamvasState("controls",0)}})}hide(){return B0(this,null,function*(){if(!this.showState)return;const n=this.lead.group;yield sinusoidalInOut({onUpdate:r=>{n.position.z=-this.mapHistory[0].depth*r}}).start(),setTimeout(()=>{Zn(Tn.prototype,this,"hide").call(this)})})}shadowMapEnabled(){return B0(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 r=yield this.lead.draw("PlaneShadow");this.planeShadow=r})}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 r=this.getAdcodeShowLevel(n);let fe=this.options.mapDepth;Array.isArray(fe)||(fe=new Array(3).fill(fe));let Ce;return r==="country"?Ce=fe[0]:r==="province"?Ce=fe[1]:Ce=fe[2],Ce}getDepth(n,r){let fe=this.getOptionsDepth(n);if(this.options.depthReference){const Ce=this.options.depthReference,Re=findAdcodeInfo(n).b;fe=fe*this.getReferenceScale(Ce,Re)}else if(this.mapHistory.length){const Ce=findAdcodeInfo(this.mapHistory[0].mapInfo.adcode).b,Re=this.getReferenceScale(Ce,r);fe=fe*Re}return fe}getReferenceScale(n,r){const fe=Math.abs(r[3]-r[1])/Math.abs(n[3]-n[1]),Ce=Math.abs(r[2]-r[0])/Math.abs(n[2]-n[0]);return Math.max(fe,Ce)}getAdcodeShowLevel(n,r=!0){var fe;return(fe=this.options.fixCity)!=null&&fe[n]&&(n=this.options.fixCity[n]),getAdcodeShowLevel(n,r)}handleClick(n){const{drillDownRestrictions:r}=this.options;this.isAnimating||(n&&n.userData.adcode?this.getAdcodeShowLevel(n.userData.adcode,!1)!==r?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 Ce;const r=[];let fe=n;for(;fe&&(r.unshift(fe),fe!==this.options.adcode);)fe=(Ce=findAdcodeInfo(fe))==null?void 0:Ce.parent;return r}showMap(Ce){return B0(this,arguments,function*({adcode:n,adcodes:r,duration:fe=1e3}){const Re=r||this.getAdcodes(n);(yield this.beforeShowMap(Re))!==!1&&(this.emit("beforeDrillDown",[...Re]),yield this.setAdcode({adcodes:Re,duration:fe}),this.emit("afterDrillDown",[...Re]))})}drawLabels(){return B0(this,null,function*(){var fe;const n=this.options.showLabel;if(!((fe=this.mapArea)!=null&&fe.length)||!n)return;let r=this.lead.getObject("Group",{key:"mapLabel"});r||(r=yield this.lead.draw("Group",{key:"mapLabel"},this.group),r.object3d.name="地图标签组",yield Promise.all(this.mapArea.map(Ce=>B0(this,null,function*(){let{name:Re,adcode:Pe,centroid:Ne}=Ce.userData;const{DistrictID:ze,DistName:Ae,iso_a2:Fe,center:ke}=Ce.userData;if(Pe=Pe||Fe||ze,Ne=Ne||ke,Re=Re||Ae,!Ne)return;const xt=this.getLocationPosition(Ne);if(this.lead.getObject("Node",{key:`mapLabel-${Pe}`})||!xt)return;const[Xt,Wt,Zt]=xt;let Gt=Re;n==="lite"&&Gt&&(Gt=Re.replace(/自治州|地区|自治区|省|市|壮族|特别行政区|回族|维吾尔/g,""));const wt=Gt&&getLabelElement(Gt),Vt=Gt!=null&&Gt.startsWith("澳门")?-1:0;yield this.lead.draw("Node",{position:new Vector3(Xt,Wt+Vt,Zt),children:wt,key:`$p:-${this.options.adcode===0?Re:Pe}`},r)}))))})}eraseLabels(){const n=this.lead.getObject("Group",{key:"mapLabel"});n==null||n.erase()}geAdcodePosition(n){var fe;const r=(fe=this.mapArea)==null?void 0:fe.find(Ce=>Ce.userData.adcode===n);if(r){const{centroid:Ce,center:Re}=r.userData;return this.getLocationPosition(Ce||Re)}}getLocationPosition(n){const[r,fe]=n,[Ce,Re]=this.projection([r,fe]);return[Ce,-Re,this.mapObj?this.mapObj.z+this.mapObj.depth:0]}setObjectOnMap(n,r,fe=0){const Ce=this.getLocationPosition(r);n.position.set(Ce[0],Ce[1],Ce[2]+fe)}setObjectOnMapAreaByProperty(n,r,fe,Ce=0){var Pe;const Re=(Pe=this.mapArea)==null?void 0:Pe.find(Ne=>Ne.userData[r]===fe);if(Re){const{centroid:Ne,center:ze}=Re.userData,Ae=this.getLocationPosition(Ne||ze);n.position.set(Ae[0],Ae[1],Ae[2]+Ce)}}getAdcodeScreenPosition(n){const r=this.geAdcodePosition(n);if(r){const[fe,Ce,Re]=r,Pe=new Vector3(fe,Ce,Re);Pe.project(this.pencil.camera);const{width:Ne,height:ze}=this.pencil.getSize(),Ae=(Pe.x*.5+.5)*Ne,Fe=(Pe.y*-.5+.5)*ze;return{x:Ae,y:Fe}}}booleanPointInCn(n){return chinaLiteJson.features[0].geometry.coordinates.some(r=>turf.booleanPointInPolygon(turf.point(n),turf.polygon(r)))}booleanPointInMap(n,r){var Pe,Ne;const fe=r!=null?r:(Pe=this.mapInfo)==null?void 0:Pe.adcode;if(!fe)return!1;const Ce=findAdcodeInfo(fe);if(Ce!=null&&Ce.b){const[ze,Ae,Fe,ke]=Ce.b,[xt,Xt]=n;if(xt<ze||xt>Fe||Xt<Ae||Xt>ke)return!1}const Re=(Ne=this.options.extrudeLineGeojsonMap)==null?void 0:Ne[fe];return Re?Re.features.some(ze=>{const Ae=ze.geometry.coordinates;return ze.geometry.type==="Polygon"?Ae.some(Fe=>turf.booleanPointInPolygon(turf.point(n),turf.polygon([Fe]))):ze.geometry.type==="MultiPolygon"?Ae.some(Fe=>Fe.some(ke=>turf.booleanPointInPolygon(turf.point(n),turf.polygon([ke])))):!1}):!1}getGeojson(n,r=!1){return B0(this,null,function*(){var fe,Ce,Re,Pe;return r?this.options.extrudeLine?(Re=this.options.extrudeLineGeojsonMap)!=null&&Re[n]?{res:(Pe=this.options.extrudeLineGeojsonMap)==null?void 0:Pe[n]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json-lite/${n}.json`):{res:void 0}:(fe=this.options.geojsonMap)!=null&&fe[n]?{res:(Ce=this.options.geojsonMap)==null?void 0:Ce[n]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json/${n}.json`)})}handleDrillDown(Pe){return B0(this,arguments,function*({adcode:n,duration:r,handleLook:fe,saveBackCamvasState:Ce,extrudelineBloom:Re}){var Ne,ze,Ae,Fe,ke;if(typeof n!="undefined"&&!this.isAnimating){const xt=(Ne=this.map)==null?void 0:Ne.findGroup(n,!0),Xt=findAdcodeInfo(+n);if(this.isAnimating||!Xt)return;this.isAnimating=!0;const{name:Wt}=Xt;let{res:Zt}=yield this.getGeojson(n),{res:Gt}=yield this.getGeojson(n,!0);if(!this.options.showDistrict&&this.getAdcodeShowLevel(n)==="city"&&(Zt=Gt,Gt=void 0),[Zt,Gt].filter(Boolean).forEach(Vt=>{if(!Vt.features[0].properties.adcode&&/^\d{6}$/.test(`${n}`)){const It=findAdcodeInfo(n);Vt.features[0].properties=nn(xi(xi({},Vt.features[0].properties),It),{center:[It.lng,It.lat]})}}),Zt){const Vt=this.options.plateInCenter&&(this.mapHistory.length<1||this.options.drillDownPlateInCenter);if((ze=this.options.fixGeojson)!=null&&ze[n]){const t0=(Ae=this.options.fixGeojson)==null?void 0:Ae[n];if(t0.startsWith("-")){const l0=+t0.slice(1);Zt.features=Zt.features.filter(g0=>g0.properties.adcode!==l0)}}let It=findAdcodeInfo(n).b;const Nt=[...It];this.mapHistory.length===1&&!this.options.drillDownSecondLevelMats?It=findAdcodeInfo(this.mapInfo.adcode).b:this.mapHistory.length===2&&!this.options.drillDownThirdLevelMats&&(this.options.drillDownSecondLevelMats?It=findAdcodeInfo(this.mapInfo.adcode).b:It=findAdcodeInfo(this.mapHistory[0].mapInfo.adcode).b),this.eraseLabels(),this.map&&(this.options.drillDownHideParent&&this.parentBg.forEach(t0=>{t0.hide()}),this.options.showOneLevel?this.map.hide():this.map.deactive(),Ce&&this.saveCamvasState("userControls",-1));const Kt=this.mapHistory.length,Ft=Kt-1,Yt=this.getDepth(n,Nt),Ht=(Fe=this.mapHistory[Ft])==null?void 0:Fe.depth,jt=Kt===0||this.options.showOneLevel?0:this.mapHistory[Ft].z+Ht,$t=Kt===0||this.options.showOneLevel?0:jt-Yt,s0=turf.center(Zt).geometry.coordinates,[o0,c0]=this.projection(s0),r0=yield this.drawPlaneMap({geojson:Zt,extrudeLineGeojson:Gt,depth:Yt,bbox:It,adcode:n,extrudelineBloom:Re});xt==null||xt.hide(),r0.position.setZ($t);const qt=r0.position.z,e0=()=>B0(this,null,function*(){yield sinusoidalInOut({onUpdate:t0=>{jt!==qt&&(r0.position.z=qt+(jt-qt)*t0)}}).start({duration:r})});if(Vt)if(this.fixNear(n),r0.position.z=jt,fe){const t0=(ke=this.mapHistory.at(-1))==null?void 0:ke.controls;yield this.fitTo(r0,{z:jt+Yt,adcode:n,enableTransition:r!==0,polarAngle:t0==null?void 0:t0.polarAngle,azimuthAngle:t0==null?void 0:t0.azimuthAngle,handleStart:()=>B0(this,null,function*(){r0.position.z=qt,yield e0()})})}else this.options.showOneLevel&&r0.hide();else yield e0();this.mapHistory.push({map:r0,mapInfo:Xt,z:jt,depth:Yt,cX:o0,cY:-c0}),fe&&this.drawLabels(),this.saveCamvasState("controls",-1)}else console.log(`${Wt}的地图数据不存在`);this.event.emit("handleDrillDown",{adcode:n,z:this.mapObj.z+this.mapObj.depth})}this.isAnimating=!1})}saveCamvasState(n,r){const fe=this.mapHistory.at(r);fe&&(fe[n]={lookAt:[...this.pencil.cameraPositon.toArray(),...this.pencil.cameraTarget.toArray()],polarAngle:this.pencil.controls.polarAngle,azimuthAngle:this.pencil.controls.azimuthAngle})}fixNear(n){const r=this.getAdcodeShowLevel(n),fe=this.pencil.options;n===0?(this.pencil.camera.near=1,this.pencil.camera.far=1e3,this.pencil.camera.updateProjectionMatrix()):(r==="country"||r==="province")&&this.pencil.camera.near!==fe.camera.near*10?(this.pencil.camera.near=fe.camera.near*10,this.pencil.camera.updateProjectionMatrix()):(r==="city"||r==="district")&&this.pencil.camera.near!==fe.camera.near&&(this.pencil.camera.near=fe.camera.near,this.pencil.camera.updateProjectionMatrix())}fitTo(ze){return B0(this,arguments,function*(n,{polarAngle:r,azimuthAngle:fe,z:Ce,handleStart:Re,adcode:Pe,enableTransition:Ne=!0}={}){if(!(n!=null&&n.object3d))return;if(Pe&&(yield this.useSaveCamera(`map-${Pe}`,Ne))){Re&&(yield Re());return}const Ae=this.options.mapPadding,{height:Fe,width:ke}=this.pencil.getSize();Fe<Ae[0]+Ae[2]+50&&(Ae[0]=0,Ae[2]=0),ke<Ae[1]+Ae[3]+50&&(Ae[1]=0,Ae[3]=0);const xt=r!=null?r:this.options.polarAngle,Xt=fe!=null?fe:this.options.azimuthAngle,Wt=this.pencil.cameraPositon.toArray(),Zt=this.pencil.cameraTarget.toArray();yield this.paddingInCssPixel(n,Ae[0],Ae[1],Ae[2],Ae[3],!1);let Gt;Ce&&(Gt=this.pencil.cameraTarget.toArray(),yield this.pencil.controls.setTarget(Gt[0],Gt[1],Ce,!1)),yield this.pencil.controls.rotateTo(Xt,xt,!1),Gt=this.pencil.cameraTarget.toArray();const wt=this.pencil.cameraPositon.toArray();yield this.lookAt(...Wt,...Zt),yield Promise.all([this.lookAt(...wt,...Gt,Ne),Re==null?void 0:Re()].filter(Boolean))})}drawPlaneMap(Ne){return B0(this,arguments,function*({geojson:n,extrudeLineGeojson:r,bbox:fe,depth:Ce,extrudelineBloom:Re,adcode:Pe}){var Wt;const ze=[this.mList.getMultiple("plane"),this.mList.getMultiple("secondPlane"),this.mList.getMultiple("thirdPlane")];let Ae=this.mapHistory.length,Fe=null;for(;Fe===null;)Fe=ze[Ae],Ae--;const ke=this.mList.getMultiple("bgPlane"),xt=xi(xi({},Fe),ke?{bgTopMat:ke.topMat,bgSideMat:ke.sideMat,bgLineMat:ke.lineMat,bgExtrudeLineMat:ke.extrudeLineMat}:{}),Xt=yield this.lead.draw("PlaneMap",{key:`${Pe}`,geojson:n,extrudeLineGeojson:r,depth:Ce,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:xt,bbox:fe,topSegments:this.options.topSegments,lineOffset:this.options.lineOffset,mergeSide:this.options.mergeSide},this.group);return Xt.object3d.name=((Wt=findAdcodeInfo(Pe))==null?void 0:Wt.name)||`${Pe}`,this.options.style==="map2CityOnMap"&&!this.options.showCityOnMapInnerLine&&(Fe.lineMat.colorWrite=!1,Xt.lineArr.forEach(Zt=>{Zt.userData.selectHide=!0})),Xt.extrudelineArr&&Xt.extrudelineArr.forEach(Zt=>{Zt.object3d.name="板块边线",this.lead.updateBaseObjectKey(Zt,{type:"extrudeLine",key:this.mapHistory.length?"$p:":void 0}),this.initBaseObjectUserData(Zt),Re&&(Zt.object3d.userData.bloom=!0)}),Xt.lineArr&&Xt.lineArr.forEach(Zt=>{this.initBaseObjectUserData(Zt)}),Xt})}handleBack(){return B0(this,arguments,function*({duration:n=1e3,handleLookBack:r=!0,keepOne:fe=!0}={}){if(this.isAnimating||(fe?this.mapHistory.length<=1:this.mapHistory.length===0))return;this.isAnimating=!0;const Ce=this.mapHistory.pop();if(!this.options.drillDownPlateInCenter){const Re=Ce.map.position.z,Pe=this.mapObj?this.mapObj.z+(this.mapObj.depth-Ce.depth):0;yield sinusoidalInOut({onUpdate:Ne=>{Ce.map.position.z=Re+(Pe-Re)*Ne}}).start({duration:n})}if(this.lead.eraseWithoutMaterial(Ce.map),this.eraseLabels(),this.mapObj){const{map:Re}=this.mapObj,Pe=Re==null?void 0:Re.findGroup(Ce.mapInfo.adcode,!0);Pe&&Pe.show(),Re&&r&&(this.options.showOneLevel?Re.show():Re.active(),this.options.drillDownHideParent&&this.parentBg.forEach(Ne=>{Ne.show()}),yield this.handleLookBack(n),this.drawLabels())}this.emit("handleBack",{adcodes:this.adcodes}),this.isAnimating=!1})}handleLookBack(n){return B0(this,null,function*(){const{userControls:r,controls:fe}=this.mapObj;yield this.pencil.controls.setLookAt(...r?r.lookAt:fe.lookAt,n!==0)})}compareLocations(n,r){const fe=n.filter(Ne=>Ne),Ce=r.filter(Ne=>Ne),Re=[];let Pe=0;for(let Ne=0;Ne<Math.min(fe.length,Ce.length)&&fe[Ne]===Ce[Ne];Ne++)Pe++;for(let Ne=Pe;Ne<fe.length;Ne++)Re.push(-1);for(let Ne=Pe;Ne<Ce.length;Ne++)Re.push(Ce[Ne]);return Re}setAdcode(fe){return B0(this,arguments,function*({adcodes:n,duration:r}){var Re,Pe,Ne;const{adcodes:Ce}=this;if(!(JSON.stringify(n)===JSON.stringify(Ce)||this.isAnimating))if(JSON.stringify(n)===JSON.stringify([0]))try{yield this.handleDrillDown({adcode:0,duration:r,handleLook:!0})}catch(xt){console.error(xt)}else{const{continent:xt,country:Xt,province:Wt,city:Zt,district:Gt}=n.reduce((jt,$t)=>{const s0=this.getAdcodeShowLevel($t);return jt[s0]=$t,jt},{}),{continent:wt,country:Vt,province:It,city:Nt,district:Kt}=Ce.reduce((jt,$t)=>{const s0=this.getAdcodeShowLevel($t);return jt[s0]=$t,jt},{}),Ft=xt||wt,Yt=(Ne=(Pe=(Re=this.map)==null?void 0:Re.extrudelineArr)==null?void 0:Pe[0])==null?void 0:Ne.object3d.userData.bloom,Ht=this.compareLocations([wt,Vt,It,Nt,Kt],[xt,Xt,Wt,Zt,Gt]);try{for(var ze=Dn(Ht.entries()),Ae,Fe,ke;Ae=!(Fe=yield ze.next()).done;Ae=!1){const[jt,$t]=Fe.value;const s0=jt===Ht.length-1?r:0,o0=jt===Ht.length-1;$t===-1?yield this.handleBack({duration:s0,handleLookBack:o0,keepOne:!Ft}):yield this.handleDrillDown({adcode:$t,duration:s0,handleLook:o0,saveBackCamvasState:Ht.includes(-1)?!1:this.options.handleBackKeepCamvasState,extrudelineBloom:Yt})}}catch(Fe){ke=[Fe]}finally{try{Ae&&(Fe=ze.return)&&(yield Fe.call(ze))}finally{if(ke)throw ke[0]}}}})}setPadding(n,r=!1,fe=!1){this.options.mapPadding=[...n],r&&this.fitTo(this.map,{enableTransition:fe})}findAdcodeInfo(n){return findAdcodeInfo(n)}dispose(){var n,r,fe;(n=this.editor)==null||n.events.removeAllListeners(),this.cityVis.forEach(Ce=>{Ce.dispose()}),this.cityVis.length=0,(r=this.map)==null||r.dispose(),this.parentBg.forEach(Ce=>{Ce.dispose()}),this.parentBg.length=0,(fe=this.continentsBg)==null||fe.dispose(),this.continentsBg=void 0,this.mapHistory.length=0,super.dispose()}};T0(Tn,"VisName","map"),T0(Tn,"getAdcodeShowLevel",getAdcodeShowLevel),T0(Tn,"findAdcodeInfo",findAdcodeInfo),T0(Tn,"findNameInfo",findNameInfo);let Map$1=Tn;class MapManager{constructor(e){T0(this,"container");T0(this,"controlsContainer");T0(this,"assetsPrefix");T0(this,"fixConfig");T0(this,"raycasterPointsThreshold");T0(this,"MAX_ZOOM_FACTOR",.3);T0(this,"MIN_ZOOM_FACTOR",4);T0(this,"mapInstances",{});T0(this,"mapDistances",{});T0(this,"mapConfigs",{});T0(this,"currentMap",null);T0(this,"currentZoom",1);T0(this,"mapPadding");T0(this,"groups",{});T0(this,"eventHandlers",{});T0(this,"areaCloseTimer",null);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]}setEventHandlers(e){this.eventHandlers=xi(xi({},this.eventHandlers),e)}emit(e,...n){const r=this.eventHandlers[e];r&&typeof r=="function"&&r(...n)}getCurrentMap(){return this.currentMap}getCurrentZoom(){return this.currentZoom}initMap(e,n=!1){return B0(this,null,function*(){const r=e.at(-1)||e.at(-2);return r?this.createMapInstance(r,n):null})}createMapInstance(e,n=!1){return B0(this,null,function*(){var Ae,Fe;const r=Object.values(this.mapInstances)[0],fe=(Ae=Map$1.getAdcodeShowLevel(e))!=null?Ae:"country",Ce=Map$1.findAdcodeInfo(e),Re=r==null?void 0:r.pencil;this.container.style.cursor="default";const Pe=this.mapInstances[fe];if(Pe)if(Pe.pencil.controls.maxDistance=1/0,Pe.pencil.controls.minDistance=0,Pe.options.adcode===e&&!n&&!Pe.options.fixedAdcode){Pe.setSceneActive(),this.currentMap=Pe,Pe.pencil.controls.maxDistance=this.mapDistances[fe]/this.MAX_ZOOM_FACTOR,Pe.pencil.controls.minDistance=this.mapDistances[fe]/this.MIN_ZOOM_FACTOR;const ke=Pe.pencil.controls.distance,xt=Math.round(this.mapDistances[fe]/ke*10)/10;return this.currentZoom!==xt&&(this.currentZoom=xt,this.emit("zoomChange",xt)),Pe}else Pe.options.pencil=Re,Pe.dispose(),delete this.mapInstances[fe];const Ne=new Map$1({container:this.container,controlsContainer:this.controlsContainer,assetsPrefix:this.assetsPrefix,pencil:Re});let ze=0;return yield Ne.fromJSON((Fe=this.mapConfigs[fe])!=null?Fe:`/${fe}.gz`,{preprocessor:ke=>B0(this,null,function*(){if(ze=ke.h.u[0].visOptions.adcode,fe==="province"||fe==="city"||fe==="district"){const xt=yield getMapConfig(e,this.assetsPrefix,ke.h.u[0].visOptions,ke.h.i);ke.h.u[0].visOptions=xt,Ce!=null&&Ce.c.length&&(ke.h.u[0].visOptions.showBuilding=!1)}return ke}),useCache:!0}),Ne.pencil.camera.near=.01,Ne.pencil.camera.updateProjectionMatrix(),Ne.pencil.raycaster.params.Points.threshold=this.raycasterPointsThreshold,Ne.pencil.controls.addEventListener("update",()=>{const ke=Ne.pencil.controls.distance,xt=Math.round(this.mapDistances[fe]/ke*10)/10;this.currentZoom!==xt&&(this.currentZoom=xt,this.emit("zoomChange",xt))}),fe!=="country"&&(Ne.options.mapPadding=this.mapPadding,Ne.options.polarAngle=-Math.PI,yield Ne.fitTo(Ne.map,{enableTransition:!1}),yield Ne.fitTo(Ne.map,{enableTransition:!1})),this.applyFixConfig(Ne,fe,ze,e),Ce!=null&&Ce.c.length&&!n&&this.bindAreaEvents(Ne),this.mapInstances[fe]=Ne,Ne.setSceneActive(),this.currentMap=Ne,this.currentZoom=1,this.emit("zoomChange",1),this.mapDistances[fe]=Ne.pencil.controls.distance,Ne.pencil.controls.maxDistance=Ne.pencil.controls.distance/this.MAX_ZOOM_FACTOR,Ne.pencil.controls.minDistance=Ne.pencil.controls.distance/this.MIN_ZOOM_FACTOR,Ne.options.fixedAdcode=n,Ne})}applyFixConfig(e,n,r,fe){if(!this.fixConfig)return;const Ce=this.fixConfig[`level:${n}`];if(!Ce)return;const Re=e.findAdcodeInfo(r),Pe=e.findAdcodeInfo(fe),Ne=e.getReferenceScale(Re.b,Pe.b);[...Ce.s].forEach(ze=>{const Ae=e.baseObjectByUuid(ze);if(Ae){Ae.scale.multiplyScalar(Ne);const{center:Fe}=e.map.getSize();Ae.position.x=Fe.x,Ae.position.y=Fe.y}}),[...Ce.z].forEach(ze=>{const Ae=e.baseObjectByUuid(ze);Ae&&(Ae.position.z*=Ne)})}bindAreaEvents(e){const n={};e.mapArea.forEach(r=>{var Re;r.lead.enableCursor(r);const fe=r.userData.adcode,Ce=e.cityVis.length===1?e.cityVis[0]:e.cityVis.find(Pe=>Pe.options.adcode===fe);if(Ce){const Pe=(Re=n[Ce.options.adcode])!=null?Re:Ce.group.getSize().max.z;n[Ce.options.adcode]=Pe}r.onPointerEnter(()=>{if(this.areaCloseTimer&&(clearTimeout(this.areaCloseTimer),this.areaCloseTimer=null),r.useMListByName("顶面高亮",0),Ce&&(r.position.z=n[Ce.options.adcode]-e.mapObj.depth),!(r.userData.centroid||r.userData.center))return;const{max:Ne,center:ze}=r.getSize(),Ae=e.getScreenPosition(Ne.x,ze.y,Ne.z);this.emit("areaHover",r.userData.name,{x:Ae.x,y:Ae.y})}),r.onPointerLeave(()=>{r.useMListByName("顶面",0),Ce&&(r.position.z=0),this.areaCloseTimer=setTimeout(()=>{this.emit("areaLeave")},200)}),r.onClick(()=>{r.useMListByName("顶面",0),Ce&&(r.position.z=0),this.emit("areaClick",r.userData.name,r.userData.adcode)})})}setZoom(e){var Ce;if(!this.currentMap||this.currentZoom===e)return;const n=(Ce=Map$1.getAdcodeShowLevel(this.currentMap.options.adcode))!=null?Ce:"country",r=this.mapDistances[n];if(!r)return;const fe=r/e;this.currentZoom=e,this.currentMap.pencil.controls.distance=fe}createGroup(e){return B0(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)}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()}}T0(MapManager,"findNameInfo",Map$1.findNameInfo),T0(MapManager,"getAdcodeShowLevel",Map$1.getAdcodeShowLevel),T0(MapManager,"findAdcodeInfo",Map$1.findAdcodeInfo);const _inverseMatrix=new Matrix4,_ray=new Ray,_sphere=new Sphere$1,_position$2=new Vector3;function proposedRaycast(le,e){const n=this.geometry,r=this.matrixWorld,fe=le.params.Points.threshold,Ce=n.drawRange;n.boundingSphere===null&&n.computeBoundingSphere(),_sphere.copy(n.boundingSphere),_sphere.applyMatrix4(r),_sphere.radius+=fe,_inverseMatrix.copy(r).invert(),_ray.copy(le.ray).applyMatrix4(_inverseMatrix);const Re=fe/((this.scale.x+this.scale.y+this.scale.z)/3),Pe=n.index,ze=n.attributes.position;if(Pe!==null){const Ae=Math.max(0,Ce.start),Fe=Math.min(Pe.count,Ce.start+Ce.count);for(let ke=Ae,xt=Fe;ke<xt;ke++){const Xt=Pe.getX(ke);_position$2.fromBufferAttribute(ze,Xt),testPoint(_position$2,Xt,Re,r,le,e,this)}}else{const Ae=Math.max(0,Ce.start),Fe=Math.min(ze.count,Ce.start+Ce.count);for(let ke=Ae,xt=Fe;ke<xt;ke++)_position$2.fromBufferAttribute(ze,ke),testPoint(_position$2,ke,Re,r,le,e,this)}}function testPoint(le,e,n,r,fe,Ce,Re){const Pe=new Vector3;_ray.closestPointToPoint(le,Pe),Pe.applyMatrix4(r);const Ne=fe.ray.origin.distanceTo(le),ze=Pe.distanceTo(le),Ae=Math.asin(ze/Ne);if(Ae<n){if(Ne<fe.near||Ne>fe.far)return;Ce.push({distance:Ne,distanceToRay:ze,angleToRay:Ae,point:Pe,index:e,face:null,object:Re})}}const access={set token(le){accessToken.token=le}},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.proposedRaycast=proposedRaycast;exports.removeCameraHistory=removeCameraHistory;
|
|
5366
|
+
`,e},worldPacificCentre=le=>{le.loaderAdd=function(){const e=this.loader;e.add(["/image/map/jianbian.webp"]),e.add(["/image/map/hp2.webp","/image/map/fx2.webp"])},le.initMaterial=function(){return B0(this,null,function*(){const e=this.loader,n=this.mList,r=(()=>{const fe=e.getAsset("/image/map/hp2.webp");fe.center.set(.5,.5),fe.repeat.set(.97,1.01);const Ce=new MeshStandardMaterial({name:"顶面",map:e.getAsset("/image/map/hp2.webp"),normalMap:e.getAsset("/image/map/fx2.webp"),normalScale:new Vector2(2,1)}),Re=new MeshBasicMaterial({name:"侧面",map:e.getAsset("/image/map/jianbian.webp")}),Pe=new zt({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),Ne=new zt({name:"板块边线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:Ce,sideMat:Re,lineMat:Pe,extrudeLineMat:le.options.extrudeLine?Ne:null}})();n.addMultiple("plane",r)})}},world=le=>{if(le.options.lineOffset=.02,delete le.extendsOptions.handleBackKeepCamvasState,le.extendsOptions.extrudeLine=()=>le.options.extrudeLine,le.extendsOptions.worldPacificCentre=()=>le.options.worldPacificCentre,le.options.worldPacificCentre){worldPacificCentre(le);return}le.initMaterial=function(){return B0(this,null,function*(){const e=this.mList,n=(()=>{const r=new MeshBasicMaterial({name:"顶面",color:"#0d2425"}),fe=new MeshBasicMaterial({name:"侧面",color:"#0d2425"}),Ce=new zt({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),Re=new zt({name:"板块边线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:r,sideMat:fe,lineMat:Ce,extrudeLineMat:le.options.extrudeLine?Re:null}})();e.addMultiple("plane",n)})}},china=le=>{le.options.lineOffset=.005,le.loaderAdd=function(){return B0(this,null,function*(){this.loader.add(["/image/map/jianbian.webp","/image/map/hp.webp","/image/map/shuchu2.webp"]),this.loaderAddBg()})},le.initMaterial=function(){return B0(this,null,function*(){const e=this.loader,n=(()=>{const r=new MeshStandardMaterial({name:"顶面",map:e.getAsset("/image/map/hp.webp"),normalMap:e.getAsset("/image/map/shuchu2.webp")}),fe=new MeshBasicMaterial({name:"侧面",map:e.getAsset("/image/map/jianbian.webp")}),Ce=new zt({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),Re=new zt({name:"板块边线",color:new Color$1("#00FFED"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:r,sideMat:fe,lineMat:Ce,extrudeLineMat:Re}})();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=le=>{le.loaderAdd=function(){return B0(this,null,function*(){this.loader.add(["/image/map/jianbian.webp"]),this.loaderAddBg()})},le.initMaterial=function(){return B0(this,null,function*(){const e=this.loader,n=(()=>{const r=new MeshBasicMaterial({name:"顶面",color:new Color$1("#0d2425")}),fe=new MeshBasicMaterial({name:"侧面",map:e.getAsset("/image/map/jianbian.webp")}),Ce=new zt({name:"板块线",color:new Color$1("#73FEDD"),sizeAttenuation:!1,lineWidth:this.options.lineWidth,depthWrite:!1}),Re=new zt({name:"板块边线",color:new Color$1("#00FFED"),sizeAttenuation:!1,lineWidth:this.options.extrudeLineWidth,depthWrite:!1});return{topMat:r,sideMat:fe,lineMat:Ce,extrudeLineMat:Re}})();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=le=>{le.extendsOptions={mapDepth:le.options.mapDepth,parentBg:le.options.parentBg,continentsBg:le.options.continentsBg,continentsBgDepth:le.options.continentsBgDepth,mergeSide:le.options.mergeSide,handleBackKeepCamvasState:le.options.handleBackKeepCamvasState,mapBoundary:le.options.mapBoundary,showBuilding:le.options.showBuilding,showRoad:le.options.showRoad,showGrassland:le.options.showGrassland,showRiver:le.options.showRiver,buildingSideGradient:le.options.buildingSideGradient,buildingHasSide:le.options.buildingHasSide,setWaterMaterial:le.options.setWaterMaterial,showCityOnMapInnerLine:le.options.showCityOnMapInnerLine},le.options.parentBg&&(le.extendsOptions.parentBgDepth=()=>le.options.parentBgDepth),le.loaderAdd=function(){this.loader.add(["/image/map2/side.png"])},le.initMaterial=function(){return B0(this,null,function*(){const n=this.loader,r=(()=>{const fe=new MeshBasicMaterial({name:"板块顶面",color:"#094253"}),Ce=new MeshBasicMaterial({name:"板块侧面",map:n.getAsset("/image/map2/side.png"),side:DoubleSide}),Re=new zt({name:"板块边框",color:new Color$1("#02f7eb"),lineWidth:1.8,sizeAttenuation:!1,depthTest:!1}),Pe=new zt({name:"板块内线",color:new Color$1("#02f7eb"),lineWidth:1.8,sizeAttenuation:!1,depthTest:!1});return{topMat:fe,sideMat:Ce,lineMat:Pe,extrudeLineMat:Re}})();this.mList.addMultiple("plane",r),this.initMaterialBg()})};const e=le.init.bind(le);le.init=function(){return B0(this,null,function*(){yield e(),yield this.initCityOnMap(this.mapInfo.adcode)})}},base=le=>{if(le.initMaterialBg=function(){return B0(this,null,function*(){const e=this.getRoomEnvMap();if(this.options.parentBg){if(this.options.adcode!==1e5){const r=(()=>{const fe=new MeshStandardMaterial({name:"父级顶面",color:"#031529",emissive:"#010f1f",envMap:e}),Ce=new MeshBasicMaterial({name:"父级侧面",color:"#064d73",side:DoubleSide}),Re=new zt({name:"父级板块线",color:new Color$1("#3f648c"),lineWidth:1.2,sizeAttenuation:!1});return{topMat:fe,sideMat:Ce,lineMat:Re}})();this.mList.addMultiple("parentPlane",r)}const n=(()=>{const r=new MeshStandardMaterial({name:"世界顶面",color:"#031529",emissive:"#010f1f",envMap:e}),fe=new MeshBasicMaterial({name:"世界侧面",color:"#064d73",side:DoubleSide}),Ce=new zt({name:"世界板块线",color:new Color$1("#3f648c"),lineWidth:1.2,sizeAttenuation:!1});return{topMat:r,sideMat:fe,lineMat:Ce}})();this.mList.addMultiple("worldPlane",n)}if(this.options.continentsBg){const n=(()=>{const r=new MeshStandardMaterial({name:"大洲板块顶面",emissive:"#235278"}),fe=new MeshBasicMaterial({name:"大洲板块侧面",color:"#0c1528"}),Ce=new zt({name:"大洲板块线",color:new Color$1("#1488e0"),sizeAttenuation:!1,lineWidth:this.options.lineWidth});return{topMat:r,sideMat:fe,lineMat:Ce}})();this.mList.addMultiple("continents",n)}})},le.options.style==="map2CityOnMap"){cityOnMap(le);return}le.loaderAdd=function(){return B0(this,null,function*(){this.loaderAddBg()})},le.initMaterial=function(){return B0(this,null,function*(){const e=(()=>{const n=new MeshBasicMaterial({name:"板块顶面",color:new Color$1("#064773")}),r=new MeshBasicMaterial({name:"板块侧面",color:new Color$1("#064d73"),side:DoubleSide}),fe=new zt({name:"板块线",color:new Color$1("#02BAF7"),lineWidth:1,sizeAttenuation:!1}),Ce=new zt({name:"板块边框线",color:new Color$1("#02BAF7"),lineWidth:1,sizeAttenuation:!1});return{topMat:n,sideMat:r,lineMat:fe,extrudeLineMat:Ce}})();this.mList.addMultiple("plane",e),this.options.drillDownFirstLevelUseBgMats&&this.mList.copyMultiple("plane","bgPlane"),this.initMaterialBg()})}},getAdcodeShowLevel=(le,e=!0)=>{if(le===0)return"world";if(le===1e5)return"country";if(/^\d{6}$/.test(`${le}`)){const{level:n,parent:r}=findAdcodeInfo(le),fe=r&&findAdcodeInfo(r).level;return n==="district"&&fe==="province"&&e?"city":n}else if(continentsType.find(n=>n.adcode===le))return"continent"},Tn=class Tn extends Base{constructor(){super(...arguments);T0(this,"leadObjs",objs);T0(this,"mapHistory",[]);T0(this,"activePlaneMap",null);T0(this,"isAnimating",!1);T0(this,"parentBg",[]);T0(this,"continentsBg");T0(this,"group");T0(this,"projection");T0(this,"pcenter",[104,37.5]);T0(this,"pscale",5e4/1e3);T0(this,"meters");T0(this,"cityVis",[]);T0(this,"extendsOptions",{mapDepth:()=>this.getOptionsDepth(this.options.adcode),equirectangular:()=>this.options.projectionType==="equirectangular",mapBoundary:()=>this.options.mapBoundary,mergeSide:()=>this.options.mergeSide});T0(this,"initSettingsObj",{label:!1,labelLite:!1,shadowMap:!1});T0(this,"caId");T0(this,"shadowMapLight");T0(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 r=xi(xi({0:worldExclATAJson,1e5:chinaJson},continentsJson),n==null?void 0:n.geojsonMap);let fe=xi({0:worldExclATALiteJson,1e5:chinaLiteJson},continentsLiteJson);Object.keys(r).forEach(Ce=>{Ce!=="100000"&&/^\d{6}$/.test(Ce)&&r[+Ce].features.forEach(Pe=>{const Ne=Pe.properties.adcode;fe[Ne]={type:"FeatureCollection",features:[Pe]}})}),fe=xi(xi({},fe),n==null?void 0:n.extrudeLineGeojsonMap),super.setOptions(nn(xi({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:r,extrudeLineGeojsonMap:fe})),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,r){return B0(this,null,function*(){return yield Zn(Tn.prototype,this,"handleSetting").call(this,n,r),n==="label"?r===!1?(this.eraseLabels(),this.options.showLabel=!1):(this.settings.labelLite=!1,yield this.settings.labelLite,this.options.showLabel=!0,yield this.drawLabels()):n==="labelLite"?r===!1?(this.eraseLabels(),this.options.showLabel=!1):(this.settings.label=!1,yield this.settings.label,this.options.showLabel="lite",yield this.drawLabels()):n==="shadowMap"&&(r===!1?this.shadowMapDisabled():yield this.shadowMapEnabled()),r})}init(){return B0(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(()=>this.mapArea||[],"down",({baseObject:r,mouseEvent:fe})=>{(this.playing||fe.metaKey||fe.ctrlKey)&&this.handleClick(r)}),this.options.clickOusideBack&&this.lead.handlePick(()=>this.map?[this.map]:[],"downOutside",({mouseEvent:r})=>{(this.playing||r.metaKey||r.ctrlKey)&&this.handleClick()})),yield Promise.all(this.lead.objectsPromise)})}initCityVis(n,r=!1){return B0(this,null,function*(){var Pe;if((Pe=this.options.fixCity)!=null&&Pe[n]&&(n=this.options.fixCity[n]),n===71e4)return this.settings.mouseLeft=Xi.SCREEN_PAN,yield this.settings.mouseLeft,this.pencil.camera.userData.up="0,0,1",null;const fe=new City({container:this.container,editor:!1}),Ce=getCityConfig(n);fe.setOptions({container:this.container,center:Ce.center,grey:r,adcode:n,cacheKey:this.options.cacheCity?`${n}`:void 0,jsonName:Ce.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}),yield fe.init();const Re=this.projection(Ce.center);return Re&&fe.group.position.set(Re[0],-Re[1],0),this.cityVis.push(fe),this.settings.mouseLeft=Xi.SCREEN_PAN,yield this.settings.mouseLeft,this.emit("initCityVis",n),fe})}initCityOnMap(n){return B0(this,null,function*(){const r=this.getAdcodeShowLevel(n);if(r==="province"){const fe=yield this.initCityVis(n);yield fe==null?void 0:fe.drawCityPlane(n,this.lead.group)}else if(r==="city"){const fe=findAdcodeInfo(n).c;let Ce=null;if(fe.length>0)for(const Re of fe)Ce=yield this.initCityVis(Re);else Ce=yield this.initCityVis(n);yield Ce==null?void 0:Ce.drawCityPlane(n,this.lead.group),this.pencil.camera.near=.001,this.pencil.camera.far=7,this.pencil.camera.updateProjectionMatrix()}else if(r==="district"){const fe=yield this.initCityVis(n);if(yield fe==null?void 0:fe.drawCityPlane(n,this.lead.group),this.pencil.camera.near=.001,this.pencil.camera.far=7,this.pencil.camera.updateProjectionMatrix(),this.options.nearbyCities){const Ce=findAdcodeInfo(n).parent,Re=findAdcodeInfo(Ce).c;for(const Pe of Re)(this.options.nearbyCities==="full"||Pe!==n)&&(yield this.initCityVis(Pe,!0))}}this.cityVis.forEach(fe=>{if(!fe.options.grey){const Ce=this.mapObj.depth+1e-5;fe.group.position.z=this.mapObj.z+Ce}})})}initVisBg(){return B0(this,null,function*(){let n=1e3,r=1e3;const fe=new Vector3(0,0,0);if(this.options.parentBg){const Ce={projection:{center:this.pcenter,scale:this.pscale,rotate:[0,0],projectionType:this.options.projectionType},areaGroup:!1,depth:this.options.parentBgDepth},Re=this.options.adcode!==1e5;if(Re){const xt=this.mList.getMultiple("parentPlane"),Xt=findAdcodeInfo(this.options.adcode).parent,Wt=findAdcodeInfo(Xt),Zt=Wt.b,{res:Gt}=yield this.getGeojson(Xt),wt=yield this.lead.draw("PlaneMap",xi({key:"bg-100000",geojson:Gt,bbox:Zt,materialOptions:xi({},xt)},Ce),this.group);wt.object3d.name=Wt.name,wt.lineArr.forEach(Vt=>{Vt.object3d.name="线",this.lead.updateBaseObjectKey(Vt,{type:"100000line"}),this.initBaseObjectUserData(Vt)}),wt.areaArr.forEach(Vt=>{Vt.object3d.name="板块",this.lead.updateBaseObjectKey(Vt,{type:"100000area"})}),wt.position.z=-this.options.parentBgDepth,this.parentBg.push(wt)}const Pe=this.mList.getMultiple("worldPlane"),Ne=this.options.geojsonMap[0],ze=findAdcodeInfo(0).b,Ae=yield this.lead.draw("PlaneMap",nn(xi({key:"bg-0",geojson:nn(xi({},Ne),{features:[...Ne.features.filter(xt=>Re?xt.properties.iso_a3!=="CHN":!0)]}),bbox:ze,materialOptions:xi({},Pe)},Ce),{projection:nn(xi({},Ce.projection),{rotate:this.options.worldPacificCentre?[-160,0]:void 0})}),this.group);Ae.object3d.name="世界",Ae.lineArr.forEach(xt=>{xt.object3d.name="线",this.lead.updateBaseObjectKey(xt,{type:"worldline"}),this.initBaseObjectUserData(xt)}),Ae.areaArr.forEach(xt=>{xt.object3d.name="板块",this.lead.updateBaseObjectKey(xt,{type:"worldarea"})}),Ae.position.z=-this.options.parentBgDepth,this.parentBg.push(Ae);const{center:Fe,size:ke}=Ae.getSize();n=ke.x,r=ke.y,fe.set(Fe.x,Fe.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 Ce=this.getLocationPosition([104,37.5]);this.continentsBg.position.set(...Ce)}this.continentsBg.position.z=.1}if(this.options.bottomPlane){const Ce=yield this.lead.draw("CityPlane",{width:n,height:r,color:"#0f1e57"},this.group);Ce.object3d.name="地图底面",this.lead.updateBaseObjectKey(Ce,{type:"map-plane"}),this.options.bottomPlaneWater&&Ce.addWater(),Ce.position.copy(fe),Ce.position.z-=.1}})}initVis(n){return B0(this,null,function*(){var r;if(yield this.setAdcode({adcodes:[n],duration:0}),this.options.style!=="map2Base"&&this.options.style!=="map2CityOnMap"){const fe=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}),Ce=this.pencil.cameraPositon,Re=this.pencil.cameraTarget;fe==null||fe.spotLight.position.copy(Ce),fe==null||fe.spotLight.target.position.copy(Re)}if(this.options.mapBoundary){const fe=new Box3().setFromObject((r=this.map)==null?void 0:r.object3d);this.pencil.controls.setBoundary(fe)}yield this.initVisBg()})}loaderAddBg(){this.options.bottomPlaneWater&&this.loader.add(["/image/water/normalMap0.jpg","/image/water/normalMap1.jpg"],{})}initMaterialBg(){return B0(this,null,function*(){if(this.options.parentBg){const n=(()=>{const r=new MeshStandardMaterial({name:"世界顶面",emissive:"#081417",color:"#000000"}),fe=new MeshBasicMaterial({name:"世界侧面",color:"#051714",side:DoubleSide}),Ce=new zt({name:"世界线",color:new Color$1("#50766E"),sizeAttenuation:!1,lineWidth:this.options.lineWidth});return{topMat:r,sideMat:fe,lineMat:Ce}})();this.mList.addMultiple("worldPlane",n),this.options.adcode!==1e5&&(this.mList.copyMultiple("worldPlane","parentPlane"),Object.values(this.mList.getMultiple("parentPlane")).forEach(r=>{r.name=r.name.replace("世界","父级")}))}if(this.options.continentsBg){const n=(()=>{const r=new MeshStandardMaterial({name:"大洲板块顶面",emissive:"#154532"}),fe=new MeshBasicMaterial({name:"大洲板块侧面",color:"#0c1528"}),Ce=new zt({name:"大洲板块线",color:new Color$1("#09e6c1"),sizeAttenuation:!1,lineWidth:this.options.lineWidth});return{topMat:r,sideMat:fe,lineMat:Ce}})();this.mList.addMultiple("continents",n)}})}consoleMousePostion(){this.addListener(this.container,"click",n=>{var Ce,Re;const r=this.unproject(n,this.mapObj.z+this.mapObj.depth),fe=(Re=(Ce=this.projection).invert)==null?void 0:Re.call(Ce,[r.x,-r.y]);console.log("consoleMousePostion.postion",r),console.log("consoleMousePostion.lnglat",fe)})}setAreaMaterialByProperty(n,r,fe){if(!this.map)return;const Ce=this.map.areaArr.find(Re=>Re.userData[n]===r);if(Ce){const Re=Ce.object3d;let Pe=this.mList.get("plane#topMat");fe!=="origin"&&(Pe=Re.material[0].clone(),fe.color&&Pe.color.set(fe.color),fe.emissive&&(Pe.emissive.set(fe.emissive),Pe.emissiveIntensity=fe.emissiveIntensity||1)),Re.material[0]=Pe}}setLineMaterialByProperty(n,r,fe){if(!this.map)return;const Ce=this.map.lineArr.find(Re=>Re.userData[n]===r);if(Ce){const Re=Ce.object3d;let Pe=this.mList.get("plane#lineMat");fe!=="origin"&&(Pe=Re.material.clone(),fe.color&&Pe.color.set(fe.color),fe.width&&(Pe.lineWidth=fe.width)),Re.material=Pe}}addAreaPlaneByProperty(n,r,fe){return B0(this,null,function*(){if(!this.map)return;const Re=this.map.options.geojson.features.find(Pe=>Pe.properties&&Pe.properties[n]===r);if(Re){let Pe=fe.material,Ne=fe.sideMaterial;if(y(fe.sideMaterial)&&(Ne=new MeshBasicMaterial(xi({},fe.sideMaterial))),y(fe.material)&&(Pe=new MeshBasicMaterial(xi({},fe.material))),fe.area){const Fe=this.objectByUuid(fe.area);Fe&&([Pe,Ne]=Fe.material)}let ze=fe.lineMaterial;if(y(fe.lineMaterial)&&(ze=new zt(xi({},fe.lineMaterial))),fe.line){const Fe=this.objectByUuid(fe.line);Fe&&(ze=Fe.material)}const Ae=yield this.lead.draw("PlaneMap",{geojson:{type:"FeatureCollection",features:[Re]},depth:fe.depth||0,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:{topMat:Pe,lineMat:ze,sideMat:Ne},areaGroup:!1},this.group);if(Ae.position.z=this.mapObj.z+this.mapObj.depth+.01,fe.lineBloom&&Ae.lineArr.forEach(Fe=>{Fe.enableBloom()}),fe.area){Ae.position.z=0;const Fe=this.baseObjectByUuid(fe.area);Ae.areaArr.forEach(ke=>{Fe!=null&&Fe.isBloom&&ke.enableBloom(),ke.scale.z=Fe.scale.z,ke.position.z=Fe.position.z})}if(fe.line){const Fe=this.baseObjectByUuid(fe.line);Ae.lineArr.forEach(ke=>{Fe!=null&&Fe.isBloom&&ke.enableBloom(),ke.position.z=Fe.position.z})}return Ae}})}showAction(){return B0(this,null,function*(){Zn(Tn.prototype,this,"showAction").call(this),this.useSaveCamera(`map-${this.options.adcode}`);const n=this.lead.group;if(this.mapHistory[0]){const{stop:r,start:fe}=sinusoidalInOut({onUpdate:Ce=>{if(!this.mapHistory[0]){r();return}n.position.z=-this.mapHistory[0].depth*(1-Ce)}});yield fe(),this.saveCamvasState("controls",0)}})}hide(){return B0(this,null,function*(){if(!this.showState)return;const n=this.lead.group;yield sinusoidalInOut({onUpdate:r=>{n.position.z=-this.mapHistory[0].depth*r}}).start(),setTimeout(()=>{Zn(Tn.prototype,this,"hide").call(this)})})}shadowMapEnabled(){return B0(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 r=yield this.lead.draw("PlaneShadow");this.planeShadow=r})}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 r=this.getAdcodeShowLevel(n);let fe=this.options.mapDepth;Array.isArray(fe)||(fe=new Array(3).fill(fe));let Ce;return r==="country"?Ce=fe[0]:r==="province"?Ce=fe[1]:Ce=fe[2],Ce}getDepth(n,r){let fe=this.getOptionsDepth(n);if(this.options.depthReference){const Ce=this.options.depthReference,Re=findAdcodeInfo(n).b;fe=fe*this.getReferenceScale(Ce,Re)}else if(this.mapHistory.length){const Ce=findAdcodeInfo(this.mapHistory[0].mapInfo.adcode).b,Re=this.getReferenceScale(Ce,r);fe=fe*Re}return fe}getReferenceScale(n,r){const fe=Math.abs(r[3]-r[1])/Math.abs(n[3]-n[1]),Ce=Math.abs(r[2]-r[0])/Math.abs(n[2]-n[0]);return Math.max(fe,Ce)}getAdcodeShowLevel(n,r=!0){var fe;return(fe=this.options.fixCity)!=null&&fe[n]&&(n=this.options.fixCity[n]),getAdcodeShowLevel(n,r)}handleClick(n){const{drillDownRestrictions:r}=this.options;this.isAnimating||(n&&n.userData.adcode?this.getAdcodeShowLevel(n.userData.adcode,!1)!==r?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 Ce;const r=[];let fe=n;for(;fe&&(r.unshift(fe),fe!==this.options.adcode);)fe=(Ce=findAdcodeInfo(fe))==null?void 0:Ce.parent;return r}showMap(Ce){return B0(this,arguments,function*({adcode:n,adcodes:r,duration:fe=1e3}){const Re=r||this.getAdcodes(n);(yield this.beforeShowMap(Re))!==!1&&(this.emit("beforeDrillDown",[...Re]),yield this.setAdcode({adcodes:Re,duration:fe}),this.emit("afterDrillDown",[...Re]))})}drawLabels(){return B0(this,null,function*(){var fe;const n=this.options.showLabel;if(!((fe=this.mapArea)!=null&&fe.length)||!n)return;let r=this.lead.getObject("Group",{key:"mapLabel"});r||(r=yield this.lead.draw("Group",{key:"mapLabel"},this.group),r.object3d.name="地图标签组",yield Promise.all(this.mapArea.map(Ce=>B0(this,null,function*(){let{name:Re,adcode:Pe,centroid:Ne}=Ce.userData;const{DistrictID:ze,DistName:Ae,iso_a2:Fe,center:ke}=Ce.userData;if(Pe=Pe||Fe||ze,Ne=Ne||ke,Re=Re||Ae,!Ne)return;const xt=this.getLocationPosition(Ne);if(this.lead.getObject("Node",{key:`mapLabel-${Pe}`})||!xt)return;const[Xt,Wt,Zt]=xt;let Gt=Re;n==="lite"&&Gt&&(Gt=Re.replace(/自治州|地区|自治区|省|市|壮族|特别行政区|回族|维吾尔/g,""));const wt=Gt&&getLabelElement(Gt),Vt=Gt!=null&&Gt.startsWith("澳门")?-1:0;yield this.lead.draw("Node",{position:new Vector3(Xt,Wt+Vt,Zt),children:wt,key:`$p:-${this.options.adcode===0?Re:Pe}`},r)}))))})}eraseLabels(){const n=this.lead.getObject("Group",{key:"mapLabel"});n==null||n.erase()}geAdcodePosition(n){var fe;const r=(fe=this.mapArea)==null?void 0:fe.find(Ce=>Ce.userData.adcode===n);if(r){const{centroid:Ce,center:Re}=r.userData;return this.getLocationPosition(Ce||Re)}}getLocationPosition(n){const[r,fe]=n,[Ce,Re]=this.projection([r,fe]);return[Ce,-Re,this.mapObj?this.mapObj.z+this.mapObj.depth:0]}setObjectOnMap(n,r,fe=0){const Ce=this.getLocationPosition(r);n.position.set(Ce[0],Ce[1],Ce[2]+fe)}setObjectOnMapAreaByProperty(n,r,fe,Ce=0){var Pe;const Re=(Pe=this.mapArea)==null?void 0:Pe.find(Ne=>Ne.userData[r]===fe);if(Re){const{centroid:Ne,center:ze}=Re.userData,Ae=this.getLocationPosition(Ne||ze);n.position.set(Ae[0],Ae[1],Ae[2]+Ce)}}getAdcodeScreenPosition(n){const r=this.geAdcodePosition(n);if(r){const[fe,Ce,Re]=r,Pe=new Vector3(fe,Ce,Re);Pe.project(this.pencil.camera);const{width:Ne,height:ze}=this.pencil.getSize(),Ae=(Pe.x*.5+.5)*Ne,Fe=(Pe.y*-.5+.5)*ze;return{x:Ae,y:Fe}}}booleanPointInCn(n){return chinaLiteJson.features[0].geometry.coordinates.some(r=>turf.booleanPointInPolygon(turf.point(n),turf.polygon(r)))}booleanPointInMap(n,r){var Pe,Ne;const fe=r!=null?r:(Pe=this.mapInfo)==null?void 0:Pe.adcode;if(!fe)return!1;const Ce=findAdcodeInfo(fe);if(Ce!=null&&Ce.b){const[ze,Ae,Fe,ke]=Ce.b,[xt,Xt]=n;if(xt<ze||xt>Fe||Xt<Ae||Xt>ke)return!1}const Re=(Ne=this.options.extrudeLineGeojsonMap)==null?void 0:Ne[fe];return Re?Re.features.some(ze=>{const Ae=ze.geometry.coordinates;return ze.geometry.type==="Polygon"?Ae.some(Fe=>turf.booleanPointInPolygon(turf.point(n),turf.polygon([Fe]))):ze.geometry.type==="MultiPolygon"?Ae.some(Fe=>Fe.some(ke=>turf.booleanPointInPolygon(turf.point(n),turf.polygon([ke])))):!1}):!1}getGeojson(n,r=!1){return B0(this,null,function*(){var fe,Ce,Re,Pe;return r?this.options.extrudeLine?(Re=this.options.extrudeLineGeojsonMap)!=null&&Re[n]?{res:(Pe=this.options.extrudeLineGeojsonMap)==null?void 0:Pe[n]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json-lite/${n}.json`):{res:void 0}:(fe=this.options.geojsonMap)!=null&&fe[n]?{res:(Ce=this.options.geojsonMap)==null?void 0:Ce[n]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json/${n}.json`)})}handleDrillDown(Pe){return B0(this,arguments,function*({adcode:n,duration:r,handleLook:fe,saveBackCamvasState:Ce,extrudelineBloom:Re}){var Ne,ze,Ae,Fe,ke;if(typeof n!="undefined"&&!this.isAnimating){const xt=(Ne=this.map)==null?void 0:Ne.findGroup(n,!0),Xt=findAdcodeInfo(+n);if(this.isAnimating||!Xt)return;this.isAnimating=!0;const{name:Wt}=Xt;let{res:Zt}=yield this.getGeojson(n),{res:Gt}=yield this.getGeojson(n,!0);if(!this.options.showDistrict&&this.getAdcodeShowLevel(n)==="city"&&(Zt=Gt,Gt=void 0),[Zt,Gt].filter(Boolean).forEach(Vt=>{if(!Vt.features[0].properties.adcode&&/^\d{6}$/.test(`${n}`)){const It=findAdcodeInfo(n);Vt.features[0].properties=nn(xi(xi({},Vt.features[0].properties),It),{center:[It.lng,It.lat]})}}),Zt){const Vt=this.options.plateInCenter&&(this.mapHistory.length<1||this.options.drillDownPlateInCenter);if((ze=this.options.fixGeojson)!=null&&ze[n]){const t0=(Ae=this.options.fixGeojson)==null?void 0:Ae[n];if(t0.startsWith("-")){const l0=+t0.slice(1);Zt.features=Zt.features.filter(g0=>g0.properties.adcode!==l0)}}let It=findAdcodeInfo(n).b;const Nt=[...It];this.mapHistory.length===1&&!this.options.drillDownSecondLevelMats?It=findAdcodeInfo(this.mapInfo.adcode).b:this.mapHistory.length===2&&!this.options.drillDownThirdLevelMats&&(this.options.drillDownSecondLevelMats?It=findAdcodeInfo(this.mapInfo.adcode).b:It=findAdcodeInfo(this.mapHistory[0].mapInfo.adcode).b),this.eraseLabels(),this.map&&(this.options.drillDownHideParent&&this.parentBg.forEach(t0=>{t0.hide()}),this.options.showOneLevel?this.map.hide():this.map.deactive(),Ce&&this.saveCamvasState("userControls",-1));const Kt=this.mapHistory.length,Ft=Kt-1,Yt=this.getDepth(n,Nt),Ht=(Fe=this.mapHistory[Ft])==null?void 0:Fe.depth,jt=Kt===0||this.options.showOneLevel?0:this.mapHistory[Ft].z+Ht,$t=Kt===0||this.options.showOneLevel?0:jt-Yt,s0=turf.center(Zt).geometry.coordinates,[o0,c0]=this.projection(s0),r0=yield this.drawPlaneMap({geojson:Zt,extrudeLineGeojson:Gt,depth:Yt,bbox:It,adcode:n,extrudelineBloom:Re});xt==null||xt.hide(),r0.position.setZ($t);const qt=r0.position.z,e0=()=>B0(this,null,function*(){yield sinusoidalInOut({onUpdate:t0=>{jt!==qt&&(r0.position.z=qt+(jt-qt)*t0)}}).start({duration:r})});if(Vt)if(this.fixNear(n),r0.position.z=jt,fe){const t0=(ke=this.mapHistory.at(-1))==null?void 0:ke.controls;yield this.fitTo(r0,{z:jt+Yt,adcode:n,enableTransition:r!==0,polarAngle:t0==null?void 0:t0.polarAngle,azimuthAngle:t0==null?void 0:t0.azimuthAngle,handleStart:()=>B0(this,null,function*(){r0.position.z=qt,yield e0()})})}else this.options.showOneLevel&&r0.hide();else yield e0();this.mapHistory.push({map:r0,mapInfo:Xt,z:jt,depth:Yt,cX:o0,cY:-c0}),fe&&this.drawLabels(),this.saveCamvasState("controls",-1)}else console.log(`${Wt}的地图数据不存在`);this.event.emit("handleDrillDown",{adcode:n,z:this.mapObj.z+this.mapObj.depth})}this.isAnimating=!1})}saveCamvasState(n,r){const fe=this.mapHistory.at(r);fe&&(fe[n]={lookAt:[...this.pencil.cameraPositon.toArray(),...this.pencil.cameraTarget.toArray()],polarAngle:this.pencil.controls.polarAngle,azimuthAngle:this.pencil.controls.azimuthAngle})}fixNear(n){const r=this.getAdcodeShowLevel(n),fe=this.pencil.options;n===0?(this.pencil.camera.near=1,this.pencil.camera.far=1e3,this.pencil.camera.updateProjectionMatrix()):(r==="country"||r==="province")&&this.pencil.camera.near!==fe.camera.near*10?(this.pencil.camera.near=fe.camera.near*10,this.pencil.camera.updateProjectionMatrix()):(r==="city"||r==="district")&&this.pencil.camera.near!==fe.camera.near&&(this.pencil.camera.near=fe.camera.near,this.pencil.camera.updateProjectionMatrix())}fitTo(ze){return B0(this,arguments,function*(n,{polarAngle:r,azimuthAngle:fe,z:Ce,handleStart:Re,adcode:Pe,enableTransition:Ne=!0}={}){if(!(n!=null&&n.object3d))return;if(Pe&&(yield this.useSaveCamera(`map-${Pe}`,Ne))){Re&&(yield Re());return}const Ae=this.options.mapPadding,{height:Fe,width:ke}=this.pencil.getSize();Fe<Ae[0]+Ae[2]+50&&(Ae[0]=0,Ae[2]=0),ke<Ae[1]+Ae[3]+50&&(Ae[1]=0,Ae[3]=0);const xt=r!=null?r:this.options.polarAngle,Xt=fe!=null?fe:this.options.azimuthAngle,Wt=this.pencil.cameraPositon.toArray(),Zt=this.pencil.cameraTarget.toArray();yield this.paddingInCssPixel(n,Ae[0],Ae[1],Ae[2],Ae[3],!1);let Gt;Ce&&(Gt=this.pencil.cameraTarget.toArray(),yield this.pencil.controls.setTarget(Gt[0],Gt[1],Ce,!1)),yield this.pencil.controls.rotateTo(Xt,xt,!1),Gt=this.pencil.cameraTarget.toArray();const wt=this.pencil.cameraPositon.toArray();yield this.lookAt(...Wt,...Zt),yield Promise.all([this.lookAt(...wt,...Gt,Ne),Re==null?void 0:Re()].filter(Boolean))})}drawPlaneMap(Ne){return B0(this,arguments,function*({geojson:n,extrudeLineGeojson:r,bbox:fe,depth:Ce,extrudelineBloom:Re,adcode:Pe}){var Wt;const ze=[this.mList.getMultiple("plane"),this.mList.getMultiple("secondPlane"),this.mList.getMultiple("thirdPlane")];let Ae=this.mapHistory.length,Fe=null;for(;Fe===null;)Fe=ze[Ae],Ae--;const ke=this.mList.getMultiple("bgPlane"),xt=xi(xi({},Fe),ke?{bgTopMat:ke.topMat,bgSideMat:ke.sideMat,bgLineMat:ke.lineMat,bgExtrudeLineMat:ke.extrudeLineMat}:{}),Xt=yield this.lead.draw("PlaneMap",{key:`${Pe}`,geojson:n,extrudeLineGeojson:r,depth:Ce,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:xt,bbox:fe,topSegments:this.options.topSegments,lineOffset:this.options.lineOffset,mergeSide:this.options.mergeSide},this.group);return Xt.object3d.name=((Wt=findAdcodeInfo(Pe))==null?void 0:Wt.name)||`${Pe}`,this.options.style==="map2CityOnMap"&&!this.options.showCityOnMapInnerLine&&(Fe.lineMat.colorWrite=!1,Xt.lineArr.forEach(Zt=>{Zt.userData.selectHide=!0})),Xt.extrudelineArr&&Xt.extrudelineArr.forEach(Zt=>{Zt.object3d.name="板块边线",this.lead.updateBaseObjectKey(Zt,{type:"extrudeLine",key:this.mapHistory.length?"$p:":void 0}),this.initBaseObjectUserData(Zt),Re&&(Zt.object3d.userData.bloom=!0)}),Xt.lineArr&&Xt.lineArr.forEach(Zt=>{this.initBaseObjectUserData(Zt)}),Xt})}handleBack(){return B0(this,arguments,function*({duration:n=1e3,handleLookBack:r=!0,keepOne:fe=!0}={}){if(this.isAnimating||(fe?this.mapHistory.length<=1:this.mapHistory.length===0))return;this.isAnimating=!0;const Ce=this.mapHistory.pop();if(!this.options.drillDownPlateInCenter){const Re=Ce.map.position.z,Pe=this.mapObj?this.mapObj.z+(this.mapObj.depth-Ce.depth):0;yield sinusoidalInOut({onUpdate:Ne=>{Ce.map.position.z=Re+(Pe-Re)*Ne}}).start({duration:n})}if(this.lead.eraseWithoutMaterial(Ce.map),this.eraseLabels(),this.mapObj){const{map:Re}=this.mapObj,Pe=Re==null?void 0:Re.findGroup(Ce.mapInfo.adcode,!0);Pe&&Pe.show(),Re&&r&&(this.options.showOneLevel?Re.show():Re.active(),this.options.drillDownHideParent&&this.parentBg.forEach(Ne=>{Ne.show()}),yield this.handleLookBack(n),this.drawLabels())}this.emit("handleBack",{adcodes:this.adcodes}),this.isAnimating=!1})}handleLookBack(n){return B0(this,null,function*(){const{userControls:r,controls:fe}=this.mapObj;yield this.pencil.controls.setLookAt(...r?r.lookAt:fe.lookAt,n!==0)})}compareLocations(n,r){const fe=n.filter(Ne=>Ne),Ce=r.filter(Ne=>Ne),Re=[];let Pe=0;for(let Ne=0;Ne<Math.min(fe.length,Ce.length)&&fe[Ne]===Ce[Ne];Ne++)Pe++;for(let Ne=Pe;Ne<fe.length;Ne++)Re.push(-1);for(let Ne=Pe;Ne<Ce.length;Ne++)Re.push(Ce[Ne]);return Re}setAdcode(fe){return B0(this,arguments,function*({adcodes:n,duration:r}){var Re,Pe,Ne;const{adcodes:Ce}=this;if(!(JSON.stringify(n)===JSON.stringify(Ce)||this.isAnimating))if(JSON.stringify(n)===JSON.stringify([0]))try{yield this.handleDrillDown({adcode:0,duration:r,handleLook:!0})}catch(xt){console.error(xt)}else{const{continent:xt,country:Xt,province:Wt,city:Zt,district:Gt}=n.reduce((jt,$t)=>{const s0=this.getAdcodeShowLevel($t);return jt[s0]=$t,jt},{}),{continent:wt,country:Vt,province:It,city:Nt,district:Kt}=Ce.reduce((jt,$t)=>{const s0=this.getAdcodeShowLevel($t);return jt[s0]=$t,jt},{}),Ft=xt||wt,Yt=(Ne=(Pe=(Re=this.map)==null?void 0:Re.extrudelineArr)==null?void 0:Pe[0])==null?void 0:Ne.object3d.userData.bloom,Ht=this.compareLocations([wt,Vt,It,Nt,Kt],[xt,Xt,Wt,Zt,Gt]);try{for(var ze=Dn(Ht.entries()),Ae,Fe,ke;Ae=!(Fe=yield ze.next()).done;Ae=!1){const[jt,$t]=Fe.value;const s0=jt===Ht.length-1?r:0,o0=jt===Ht.length-1;$t===-1?yield this.handleBack({duration:s0,handleLookBack:o0,keepOne:!Ft}):yield this.handleDrillDown({adcode:$t,duration:s0,handleLook:o0,saveBackCamvasState:Ht.includes(-1)?!1:this.options.handleBackKeepCamvasState,extrudelineBloom:Yt})}}catch(Fe){ke=[Fe]}finally{try{Ae&&(Fe=ze.return)&&(yield Fe.call(ze))}finally{if(ke)throw ke[0]}}}})}setPadding(n,r=!1,fe=!1){this.options.mapPadding=[...n],r&&this.fitTo(this.map,{enableTransition:fe})}findAdcodeInfo(n){return findAdcodeInfo(n)}dispose(){var n,r,fe;(n=this.editor)==null||n.events.removeAllListeners(),this.cityVis.forEach(Ce=>{Ce.dispose()}),this.cityVis.length=0,(r=this.map)==null||r.dispose(),this.parentBg.forEach(Ce=>{Ce.dispose()}),this.parentBg.length=0,(fe=this.continentsBg)==null||fe.dispose(),this.continentsBg=void 0,this.mapHistory.length=0,super.dispose()}};T0(Tn,"VisName","map"),T0(Tn,"getAdcodeShowLevel",getAdcodeShowLevel),T0(Tn,"findAdcodeInfo",findAdcodeInfo),T0(Tn,"findNameInfo",findNameInfo);let Map$1=Tn;class MapManager{constructor(e){T0(this,"container");T0(this,"controlsContainer");T0(this,"assetsPrefix");T0(this,"fixConfig");T0(this,"raycasterPointsThreshold");T0(this,"MAX_ZOOM_FACTOR",.3);T0(this,"MIN_ZOOM_FACTOR",4);T0(this,"mapInstances",{});T0(this,"mapDistances",{});T0(this,"mapConfigs",{});T0(this,"currentMap",null);T0(this,"currentZoom",1);T0(this,"mapPadding");T0(this,"groups",{});T0(this,"eventHandlers",{});T0(this,"areaCloseTimer",null);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]}setEventHandlers(e){this.eventHandlers=xi(xi({},this.eventHandlers),e)}emit(e,...n){const r=this.eventHandlers[e];r&&typeof r=="function"&&r(...n)}getCurrentMap(){return this.currentMap}getCurrentZoom(){return this.currentZoom}initMap(e,n=!1){return B0(this,null,function*(){const r=e.at(-1)||e.at(-2);return r?this.createMapInstance(r,n):null})}createMapInstance(e,n=!1){return B0(this,null,function*(){var Ae,Fe;const r=Object.values(this.mapInstances)[0],fe=(Ae=Map$1.getAdcodeShowLevel(e))!=null?Ae:"country",Ce=Map$1.findAdcodeInfo(e),Re=r==null?void 0:r.pencil;this.container.style.cursor="default";const Pe=this.mapInstances[fe];if(Pe)if(Pe.pencil.controls.maxDistance=1/0,Pe.pencil.controls.minDistance=0,Pe.options.adcode===e&&!n&&!Pe.options.fixedAdcode){Pe.setSceneActive(),this.currentMap=Pe,Pe.pencil.controls.maxDistance=this.mapDistances[fe]/this.MAX_ZOOM_FACTOR,Pe.pencil.controls.minDistance=this.mapDistances[fe]/this.MIN_ZOOM_FACTOR;const ke=Pe.pencil.controls.distance,xt=Math.round(this.mapDistances[fe]/ke*10)/10;return this.currentZoom!==xt&&(this.currentZoom=xt,this.emit("zoomChange",xt)),Pe}else Pe.options.pencil=Re,Pe.dispose(),delete this.mapInstances[fe];const Ne=new Map$1({container:this.container,controlsContainer:this.controlsContainer,assetsPrefix:this.assetsPrefix,pencil:Re});let ze=0;return yield Ne.fromJSON((Fe=this.mapConfigs[fe])!=null?Fe:`/${fe}.gz`,{preprocessor:ke=>B0(this,null,function*(){if(ze=ke.h.u[0].visOptions.adcode,fe==="province"||fe==="city"||fe==="district"){const xt=yield getMapConfig(e,this.assetsPrefix,ke.h.u[0].visOptions,ke.h.i);ke.h.u[0].visOptions=xt,Ce!=null&&Ce.c.length&&(ke.h.u[0].visOptions.showBuilding=!1)}return ke}),useCache:!0}),Ne.pencil.camera.near=.01,Ne.pencil.camera.updateProjectionMatrix(),Ne.pencil.raycaster.params.Points.threshold=this.raycasterPointsThreshold,Ne.pencil.controls.addEventListener("update",()=>{const ke=Ne.pencil.controls.distance,xt=Math.round(this.mapDistances[fe]/ke*10)/10;this.currentZoom!==xt&&(this.currentZoom=xt,this.emit("zoomChange",xt))}),fe!=="country"&&(Ne.options.mapPadding=this.mapPadding,Ne.options.polarAngle=-Math.PI,yield Ne.fitTo(Ne.map,{enableTransition:!1}),yield Ne.fitTo(Ne.map,{enableTransition:!1})),this.applyFixConfig(Ne,fe,ze,e),Ce!=null&&Ce.c.length&&!n&&this.bindAreaEvents(Ne),this.mapInstances[fe]=Ne,Ne.setSceneActive(),this.currentMap=Ne,this.currentZoom=1,this.emit("zoomChange",1),this.mapDistances[fe]=Ne.pencil.controls.distance,Ne.pencil.controls.maxDistance=Ne.pencil.controls.distance/this.MAX_ZOOM_FACTOR,Ne.pencil.controls.minDistance=Ne.pencil.controls.distance/this.MIN_ZOOM_FACTOR,Ne.options.fixedAdcode=n,Ne})}applyFixConfig(e,n,r,fe){if(!this.fixConfig)return;const Ce=this.fixConfig[`level:${n}`];if(!Ce)return;const Re=e.findAdcodeInfo(r),Pe=e.findAdcodeInfo(fe),Ne=e.getReferenceScale(Re.b,Pe.b);[...Ce.s].forEach(ze=>{const Ae=e.baseObjectByUuid(ze);if(Ae){Ae.scale.multiplyScalar(Ne);const{center:Fe}=e.map.getSize();Ae.position.x=Fe.x,Ae.position.y=Fe.y}}),[...Ce.z].forEach(ze=>{const Ae=e.baseObjectByUuid(ze);Ae&&(Ae.position.z*=Ne)})}bindAreaEvents(e){const n={};e.mapArea.forEach(r=>{var Re;r.lead.enableCursor(r);const fe=r.userData.adcode,Ce=e.cityVis.length===1?e.cityVis[0]:e.cityVis.find(Pe=>Pe.options.adcode===fe);if(Ce){const Pe=(Re=n[Ce.options.adcode])!=null?Re:Ce.group.getSize().max.z;n[Ce.options.adcode]=Pe}r.onPointerEnter(()=>{if(this.areaCloseTimer&&(clearTimeout(this.areaCloseTimer),this.areaCloseTimer=null),r.useMListByName("顶面高亮",0),Ce&&(r.position.z=n[Ce.options.adcode]-e.mapObj.depth),!(r.userData.centroid||r.userData.center))return;const{max:Ne,center:ze}=r.getSize(),Ae=e.getScreenPosition(ze.x,ze.y,Ne.z);this.emit("areaHover",r.userData.name,{x:Ae.x,y:Ae.y})}),r.onPointerLeave(()=>{r.useMListByName("顶面",0),Ce&&(r.position.z=0),this.areaCloseTimer=setTimeout(()=>{this.emit("areaLeave")},200)}),r.onClick(()=>{r.useMListByName("顶面",0),Ce&&(r.position.z=0),this.emit("areaClick",r.userData.name,r.userData.adcode)})})}setZoom(e){var Ce;if(!this.currentMap||this.currentZoom===e)return;const n=(Ce=Map$1.getAdcodeShowLevel(this.currentMap.options.adcode))!=null?Ce:"country",r=this.mapDistances[n];if(!r)return;const fe=r/e;this.currentZoom=e,this.currentMap.pencil.controls.distance=fe}createGroup(e){return B0(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)}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()}}T0(MapManager,"findNameInfo",Map$1.findNameInfo),T0(MapManager,"getAdcodeShowLevel",Map$1.getAdcodeShowLevel),T0(MapManager,"findAdcodeInfo",Map$1.findAdcodeInfo);const _inverseMatrix=new Matrix4,_ray=new Ray,_sphere=new Sphere$1,_position$2=new Vector3;function proposedRaycast(le,e){const n=this.geometry,r=this.matrixWorld,fe=le.params.Points.threshold,Ce=n.drawRange;n.boundingSphere===null&&n.computeBoundingSphere(),_sphere.copy(n.boundingSphere),_sphere.applyMatrix4(r),_sphere.radius+=fe,_inverseMatrix.copy(r).invert(),_ray.copy(le.ray).applyMatrix4(_inverseMatrix);const Re=fe/((this.scale.x+this.scale.y+this.scale.z)/3),Pe=n.index,ze=n.attributes.position;if(Pe!==null){const Ae=Math.max(0,Ce.start),Fe=Math.min(Pe.count,Ce.start+Ce.count);for(let ke=Ae,xt=Fe;ke<xt;ke++){const Xt=Pe.getX(ke);_position$2.fromBufferAttribute(ze,Xt),testPoint(_position$2,Xt,Re,r,le,e,this)}}else{const Ae=Math.max(0,Ce.start),Fe=Math.min(ze.count,Ce.start+Ce.count);for(let ke=Ae,xt=Fe;ke<xt;ke++)_position$2.fromBufferAttribute(ze,ke),testPoint(_position$2,ke,Re,r,le,e,this)}}function testPoint(le,e,n,r,fe,Ce,Re){const Pe=new Vector3;_ray.closestPointToPoint(le,Pe),Pe.applyMatrix4(r);const Ne=fe.ray.origin.distanceTo(le),ze=Pe.distanceTo(le),Ae=Math.asin(ze/Ne);if(Ae<n){if(Ne<fe.near||Ne>fe.far)return;Ce.push({distance:Ne,distanceToRay:ze,angleToRay:Ae,point:Pe,index:e,face:null,object:Re})}}const access={set token(le){accessToken.token=le}},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.proposedRaycast=proposedRaycast;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(le) {
|
|
64
64
|
return le < 0 && (le = this.length + le), this[le];
|
|
65
65
|
});
|
|
66
|
-
const version = "0.30.0-beta.
|
|
66
|
+
const version = "0.30.0-beta.42", publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t", accessToken = {
|
|
67
67
|
token: void 0,
|
|
68
68
|
getInfo() {
|
|
69
69
|
if (!this.token)
|
|
@@ -145397,7 +145397,11 @@ class MapManager {
|
|
|
145397
145397
|
}
|
|
145398
145398
|
r.onPointerEnter(() => {
|
|
145399
145399
|
if (this.areaCloseTimer && (clearTimeout(this.areaCloseTimer), this.areaCloseTimer = null), r.useMListByName("顶面高亮", 0), Ce && (r.position.z = n[Ce.options.adcode] - e.mapObj.depth), !(r.userData.centroid || r.userData.center)) return;
|
|
145400
|
-
const { max: Ne, center: ze } = r.getSize(), Ae = e.getScreenPosition(
|
|
145400
|
+
const { max: Ne, center: ze } = r.getSize(), Ae = e.getScreenPosition(
|
|
145401
|
+
ze.x,
|
|
145402
|
+
ze.y,
|
|
145403
|
+
Ne.z
|
|
145404
|
+
);
|
|
145401
145405
|
this.emit("areaHover", r.userData.name, {
|
|
145402
145406
|
x: Ae.x,
|
|
145403
145407
|
y: Ae.y
|
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.42";
|
|
2
2
|
export default _default;
|