vis-core 0.27.2 → 0.27.3
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/editor/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.module.js +30 -7
- package/dist/version.d.ts +1 -1
- package/dist/vis/map/index.d.ts +4 -2
- package/package.json +1 -1
package/dist/editor/index.d.ts
CHANGED
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 }.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)}.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 zn=Object.defineProperty,Nn=Object.defineProperties;var Kn=Object.getOwnPropertyDescriptors;var Vn=Object.getOwnPropertySymbols,Fn=Object.getPrototypeOf,An=Object.prototype.hasOwnProperty,kn=Object.prototype.propertyIsEnumerable,Hn=Reflect.get;var Mn=(g,t)=>(t=Symbol[g])?t:Symbol.for("Symbol."+g),Yn=g=>{throw TypeError(g)},pn=Math.pow,wn=(g,t,r)=>t in g?zn(g,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):g[t]=r,fi=(g,t)=>{for(var r in t||(t={}))An.call(t,r)&&wn(g,r,t[r]);if(Vn)for(var r of Vn(t))kn.call(t,r)&&wn(g,r,t[r]);return g},Bi=(g,t)=>Nn(g,Kn(t));var C0=(g,t,r)=>wn(g,typeof t!="symbol"?t+"":t,r);var bn=(g,t,r)=>Hn(Fn(g),r,t);var B0=(g,t,r)=>new Promise((d,v)=>{var C=fe=>{try{w(r.next(fe))}catch(ye){v(ye)}},_=fe=>{try{w(r.throw(fe))}catch(ye){v(ye)}},w=fe=>fe.done?d(fe.value):Promise.resolve(fe.value).then(C,_);w((r=r.apply(g,t)).next())}),Un=function(g,t){this[0]=g,this[1]=t};var Wn=g=>{var t=g[Mn("asyncIterator")],r=!1,d,v={};return t==null?(t=g[Mn("iterator")](),d=C=>v[C]=_=>t[C](_)):(t=t.call(g),d=C=>v[C]=_=>{if(r){if(r=!1,C==="throw")throw _;return _}return r=!0,{done:!1,value:new Un(new Promise(w=>{var fe=t[C](_);fe instanceof Object||Yn("Object expected"),w(fe)}),1)}}),v[Mn("iterator")]=()=>v,d("next"),"throw"in t?d("throw"):v.throw=C=>{throw C},"return"in t&&d("return"),v},Pn=(g,t,r)=>(t=g[Mn("asyncIterator")])?t.call(g):(g=g[Mn("iterator")](),t={},r=(d,v)=>(v=g[d])&&(t[d]=C=>new Promise((_,w,fe)=>(C=v.call(g,C),fe=C.done,Promise.resolve(C.value).then(ye=>_({value:ye,done:fe}),w)))),r("next"),r("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsrsasign=require("jsrsasign"),CryptoJS=require("crypto-js"),esusLite=require("esus-lite"),events=require("events"),turf=require("@turf/turf"),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"),geojsonCn=require("geojson-cn");Array.prototype.at||(Array.prototype.at=function(g){return g<0&&(g=this.length+g),this[g]});const publicKeyPEM="LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t",accessToken={token:void 0,getInfo(){if(!this.token)return"";const[g,t,r]=this.token.split(":::"),d=jsrsasign.KEYUTIL.getKey(atob(publicKeyPEM)),v=CryptoJS.enc.Base64.parse(t),C=CryptoJS.enc.Base64.parse(r),_=CryptoJS.lib.WordArray.create(v.words.slice(0,4)),w=CryptoJS.lib.WordArray.create(v.words.slice(4)),fe=jsrsasign.KJUR.crypto.Util.hashHex(v.toString(),"sha256"),ye=d.verifyWithMessageHashPSS(fe,jsrsasign.b64tohex(g),"sha256",32);if(!ye)return this.token=void 0,"";const Re=CryptoJS.AES.decrypt({ciphertext:w},C,{iv:_,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8),Ne=JSON.parse(Re),ke=Date.now();return!Ne.s||Ne.s>ke?(this.token=void 0,""):Ne.e&&Ne.e<ke?(this.token=void 0,""):(Ne.isValid=ye,Ne)}},version="0.27.
|
|
2
|
+
"use strict";var zn=Object.defineProperty,Nn=Object.defineProperties;var Kn=Object.getOwnPropertyDescriptors;var Vn=Object.getOwnPropertySymbols,Fn=Object.getPrototypeOf,An=Object.prototype.hasOwnProperty,kn=Object.prototype.propertyIsEnumerable,Hn=Reflect.get;var Mn=(g,t)=>(t=Symbol[g])?t:Symbol.for("Symbol."+g),Yn=g=>{throw TypeError(g)},pn=Math.pow,wn=(g,t,r)=>t in g?zn(g,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):g[t]=r,fi=(g,t)=>{for(var r in t||(t={}))An.call(t,r)&&wn(g,r,t[r]);if(Vn)for(var r of Vn(t))kn.call(t,r)&&wn(g,r,t[r]);return g},Bi=(g,t)=>Nn(g,Kn(t));var C0=(g,t,r)=>wn(g,typeof t!="symbol"?t+"":t,r);var bn=(g,t,r)=>Hn(Fn(g),r,t);var B0=(g,t,r)=>new Promise((d,v)=>{var C=fe=>{try{w(r.next(fe))}catch(ye){v(ye)}},_=fe=>{try{w(r.throw(fe))}catch(ye){v(ye)}},w=fe=>fe.done?d(fe.value):Promise.resolve(fe.value).then(C,_);w((r=r.apply(g,t)).next())}),Un=function(g,t){this[0]=g,this[1]=t};var Wn=g=>{var t=g[Mn("asyncIterator")],r=!1,d,v={};return t==null?(t=g[Mn("iterator")](),d=C=>v[C]=_=>t[C](_)):(t=t.call(g),d=C=>v[C]=_=>{if(r){if(r=!1,C==="throw")throw _;return _}return r=!0,{done:!1,value:new Un(new Promise(w=>{var fe=t[C](_);fe instanceof Object||Yn("Object expected"),w(fe)}),1)}}),v[Mn("iterator")]=()=>v,d("next"),"throw"in t?d("throw"):v.throw=C=>{throw C},"return"in t&&d("return"),v},Pn=(g,t,r)=>(t=g[Mn("asyncIterator")])?t.call(g):(g=g[Mn("iterator")](),t={},r=(d,v)=>(v=g[d])&&(t[d]=C=>new Promise((_,w,fe)=>(C=v.call(g,C),fe=C.done,Promise.resolve(C.value).then(ye=>_({value:ye,done:fe}),w)))),r("next"),r("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsrsasign=require("jsrsasign"),CryptoJS=require("crypto-js"),esusLite=require("esus-lite"),events=require("events"),turf=require("@turf/turf"),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"),geojsonCn=require("geojson-cn");Array.prototype.at||(Array.prototype.at=function(g){return g<0&&(g=this.length+g),this[g]});const publicKeyPEM="LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t",accessToken={token:void 0,getInfo(){if(!this.token)return"";const[g,t,r]=this.token.split(":::"),d=jsrsasign.KEYUTIL.getKey(atob(publicKeyPEM)),v=CryptoJS.enc.Base64.parse(t),C=CryptoJS.enc.Base64.parse(r),_=CryptoJS.lib.WordArray.create(v.words.slice(0,4)),w=CryptoJS.lib.WordArray.create(v.words.slice(4)),fe=jsrsasign.KJUR.crypto.Util.hashHex(v.toString(),"sha256"),ye=d.verifyWithMessageHashPSS(fe,jsrsasign.b64tohex(g),"sha256",32);if(!ye)return this.token=void 0,"";const Re=CryptoJS.AES.decrypt({ciphertext:w},C,{iv:_,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8),Ne=JSON.parse(Re),ke=Date.now();return!Ne.s||Ne.s>ke?(this.token=void 0,""):Ne.e&&Ne.e<ke?(this.token=void 0,""):(Ne.isValid=ye,Ne)}},version="0.27.3";/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2010-2025 Three.js Authors
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
@@ -5149,4 +5149,4 @@ version 0.8.2
|
|
|
5149
5149
|
<div class="text-white text-opacity-80 text-center leading-[1] text-sm whitespace-nowrap">
|
|
5150
5150
|
${g}
|
|
5151
5151
|
</div>
|
|
5152
|
-
`,t},gn=class gn extends Base{constructor(){super(...arguments);C0(this,"leadObjs",objs$1);C0(this,"mapHistory",[]);C0(this,"activePlaneMap",null);C0(this,"isAnimating",!1);C0(this,"parentBg",[]);C0(this,"continentsBg");C0(this,"group");C0(this,"projection");C0(this,"pcenter",[104,37.5]);C0(this,"pscale",5e4/1e3);C0(this,"meters");C0(this,"cityVis",null);C0(this,"extendsOptions",{mapDepth:()=>this.getOptionsDepth(this.options.adcode),equirectangular:()=>this.options.projectionType==="equirectangular",mapBoundary:()=>this.options.mapBoundary,mergeSide:()=>this.options.mergeSide});C0(this,"initSettingsObj",{label:!1,labelLite:!1,shadowMap:!1});C0(this,"caId");C0(this,"shadowMapLight");C0(this,"planeShadow")}get mapObj(){return this.mapHistory[this.mapHistory.length-1]}get map(){var r;return(r=this.mapObj)==null?void 0:r.map}get mapInfo(){var r;return(r=this.mapObj)==null?void 0:r.mapInfo}get mapArea(){var r;return(r=this.map)==null?void 0:r.areaArr}get mapLine(){var r;return(r=this.map)==null?void 0:r.lineArr}get adcodes(){return this.mapHistory.map(r=>r.mapInfo.adcode)}setOptions(r){r.continentType;const d=fi(fi({0:worldExclATAJson,1e5:chinaJson},continentsJson),r==null?void 0:r.geojsonMap);let v=fi({0:worldExclATALiteJson,1e5:chinaLiteJson},continentsLiteJson);Object.keys(d).forEach(C=>{C!=="100000"&&/^\d{6}$/.test(C)&&d[+C].features.forEach(w=>{const fe=w.properties.adcode;v[fe]={type:"FeatureCollection",features:[w]}})}),v=fi(fi({},v),r==null?void 0:r.extrudeLineGeojsonMap),super.setOptions(Bi(fi({parentBg:!1,continents:"",continentsBg:!1,continentsBgDepth:0,parentBgDepth:0,parentBgTopSegments: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:2,lineOffset:0,extrudeLineWidth:6,extrudeLine:!0,equirectangular:!1,fahey:!1,projectionType:"mercator",polarAngle:r.style==="map2CityOnMap"?Math.PI/180*60:Math.PI/180*120,azimuthAngle:0,handleBackKeepCamvasState:!1,worldPacificCentre:!1,mapBoundary:!0,mergeSide:!1,bottomPlane:!1,bottomPlaneWater:!1,clipOutShow:!0,showBuilding:!0,buildingSideGradient:!1,showRoad:!0,cacheCity:!0,showGrassland:!0,showRiver:!0,setWaterMaterial:!1,showCityOnMapInnerLine:!1,greyFull:!1},r),{geojsonMap:d,extrudeLineGeojsonMap:v})),this.options.equirectangular&&(this.options.projectionType="equirectangular"),this.options.fahey&&(this.options.projectionType="fahey",this.pscale=100,this.pcenter=[0,0]),this.pencilConfig=PENCIL_CONFIG,(this.getAdcodeShowLevel(this.options.adcode)==="province"||this.getAdcodeShowLevel(this.options.adcode)==="country")&&(this.extendsOptions.clickHandleDrillDown=()=>this.options.clickHandleDrillDown,this.options.clickHandleDrillDown&&(this.workerOnce=!1,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.extendsOptions.parentBgTopSegments=()=>this.options.parentBgTopSegments),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$1(this):this.options.adcode===1e5?china(this):base$2(this)}handleSetting(r,d){return B0(this,null,function*(){return yield bn(gn.prototype,this,"handleSetting").call(this,r,d),r==="label"?d===!1?(this.eraseLabels(),this.options.showLabel=!1):(this.settings.labelLite=!1,yield this.settings.labelLite,this.options.showLabel=!0,yield this.drawLabels()):r==="labelLite"?d===!1?(this.eraseLabels(),this.options.showLabel=!1):(this.settings.label=!1,yield this.settings.label,this.options.showLabel="lite",yield this.drawLabels()):r==="shadowMap"&&(d===!1?this.shadowMapDisabled():yield this.shadowMapEnabled()),d})}init(){return B0(this,null,function*(){const{adcode:r}=this.options;this.options.center&&(this.pcenter=this.options.center),this.projection=m({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"+r}),this.group.object3d.name="地图",yield this.initMaterial(),yield this.initVis(r),this.options.clickHandleDrillDown&&(this.lead.handlePick(()=>this.mapArea||[],"down",({baseObject:d,mouseEvent:v})=>{(this.playing||v.metaKey||v.ctrlKey)&&this.handleClick(d)}),this.options.clickOusideBack&&this.lead.handlePick(()=>this.map?[this.map]:[],"downOutside",({mouseEvent:d})=>{(this.playing||d.metaKey||d.ctrlKey)&&this.handleClick()})),yield Promise.all(this.lead.objectsPromise)})}initCityVis(v){return B0(this,arguments,function*(r,d={clip:!1,grey:!1}){var fe;(fe=this.options.fixCity)!=null&&fe[r]&&(r=this.options.fixCity[r]);const C=this.options.center,_=this.options.jsonNameObj[r],w=new City({container:this.container,editor:!1,workerOnce:this.workerOnce});return w.setOptions({container:this.container,center:C,fitTo:!1,adcode:r,cacheKey:this.options.cacheCity?`${this.options.adcode}-${r}`:void 0,jsonName:_,grey:d.grey,greyFull:this.options.greyFull,clip:d.clip?this.map.options.geojson:void 0,clipOutShow:this.options.clipOutShow,planeOut:this.options.style==="map2CityOnMap",showBuilding:this.options.showBuilding,buildingSideGradient:this.options.buildingSideGradient,showRoad:this.options.showRoad,showGrassland:this.options.showGrassland,showRiver:this.options.showRiver,setWaterMaterial:this.options.setWaterMaterial,pencil2:this.pencil}),yield w.init(),this.cityVis=w,this.settings.mouseLeft=Ki.SCREEN_PAN,yield this.settings.mouseLeft,this.emit("initCityVis",r),w})}initCityOnMap(r){return B0(this,null,function*(){if(this.getAdcodeShowLevel(r)!=="city"){const C=findAdcodeInfo(r).parent;this.getAdcodeShowLevel(C)==="city"&&(yield this.initCityOnMap(C));return}const d=r===this.mapInfo.adcode||findAdcodeInfo(this.mapInfo.adcode).parent===r||findAdcodeInfo(r).parent===this.mapInfo.adcode,v=yield this.initCityVis(r,{clip:d,grey:!d});if(d){const C=this.mapObj.depth+1e-5;v.group.position.z=this.mapObj.z+C,v.outAreaGroup&&(v.outAreaGroup.position.z-=C/v.multiplyScalar)}else v.group.position.z=this.mapObj.z;this.pencil.camera.near=.001,this.pencil.camera.far=7,this.pencil.camera.updateProjectionMatrix()})}initVisBg(){return B0(this,null,function*(){let r=1e3,d=1e3;const v=new Vector3(0,0,0);if(this.options.parentBg){const C={projection:{center:this.pcenter,scale:this.pscale,rotate:[0,0],projectionType:this.options.projectionType},areaGroup:!1,depth:this.options.parentBgDepth},_=this.options.adcode!==1e5;if(_){const ke=this.mList.getMultiple("parentPlane"),ot=findAdcodeInfo(this.options.adcode).parent,xt=findAdcodeInfo(ot),ht=xt.b,{res:Fe}=yield this.getGeojson(ot),at=yield this.lead.draw("PlaneMap",fi({key:"bg-100000",geojson:Fe,bbox:ht,materialOptions:fi({},ke)},C),this.group);at.object3d.name=xt.name,at.lineArr.forEach(ct=>{ct.object3d.name="线",this.lead.updateBaseObjectKey(ct,"100000line"),this.initBaseObjectUserData(ct)}),at.areaArr.forEach(ct=>{ct.object3d.name="板块",this.lead.updateBaseObjectKey(ct,"100000area")}),at.position.z=-this.options.parentBgDepth,this.parentBg.push(at)}const w=this.mList.getMultiple("worldPlane"),fe=this.options.geojsonMap[0],ye=findAdcodeInfo(0).b,Le=yield this.lead.draw("PlaneMap",fi({key:"bg-0",geojson:Bi(fi({},fe),{features:[...fe.features.filter(ke=>_?ke.properties.iso_a3!=="CHN":!0)]}),bbox:ye,materialOptions:fi({},w)},C),this.group);Le.object3d.name="世界",Le.lineArr.forEach(ke=>{ke.object3d.name="线",this.lead.updateBaseObjectKey(ke,"worldline"),this.initBaseObjectUserData(ke)}),Le.areaArr.forEach(ke=>{ke.object3d.name="板块",this.lead.updateBaseObjectKey(ke,"worldarea")}),Le.position.z=-this.options.parentBgDepth,this.parentBg.push(Le);const{center:Re,size:Ne}=Le.getSize();r=Ne.x,d=Ne.y,v.set(Re.x,Re.y,0)}if(this.options.continentsBg){this.continentsBg=yield this.lead.draw("ContinentsBg",{depth:this.options.continentsBgDepth,scale:this.pscale},this.group);const C=this.getLocationPosition([104,37.5]);this.continentsBg.position.set(...C),this.continentsBg.position.z=.1}if(this.options.bottomPlane){const C=yield this.lead.draw("CityPlane",{width:r,height:d,color:"#0f1e57"},this.group);C.object3d.name="地图底面",this.lead.updateBaseObjectKey(C,"map-plane"),this.options.bottomPlaneWater&&C.addWater(),C.position.copy(v),C.position.z-=.1}})}initVis(r){return B0(this,null,function*(){var d;if(yield this.setAdcode({adcodes:[r],duration:0}),this.options.style!=="map2Base"&&this.options.style!=="map2CityOnMap"){const v=yield this.lead.draw("Light",{type:"SpotLight",color:this.options.worldPacificCentre?"#82d9f2":"#c1e6dd",intensity:3,distance:0,angle:this.options.continentsBg?1:.5,penumbra:1,decay:0}),C=this.pencil.cameraPositon,_=this.pencil.cameraTarget;v==null||v.spotLight.position.copy(C),v==null||v.spotLight.target.position.copy(_)}if(this.options.mapBoundary){const v=new Box3().setFromObject((d=this.map)==null?void 0:d.object3d);this.pencil.controls.setBoundary(v)}yield this.initVisBg()})}loaderAddBg(){this.options.bottomPlaneWater&&this.loader.add(["/image/water/normalMap0.jpg","/image/water/normalMap1.jpg"],{colorCorrection:!1})}initMaterialBg(){return B0(this,null,function*(){if(this.options.parentBg){const r=(()=>{const d=new MeshStandardMaterial({name:"世界顶面",emissive:"#081417",color:"#000000"}),v=new MeshBasicMaterial({name:"世界侧面",color:"#051714",side:DoubleSide}),C=new De({name:"世界线",color:new Color$1("#50766E"),sizeAttenuation:0,lineWidth:this.options.lineWidth});return{topMat:d,sideMat:v,lineMat:C}})();this.mList.addMultiple("worldPlane",r),this.options.adcode!==1e5&&(this.mList.copyMultiple("worldPlane","parentPlane"),Object.values(this.mList.getMultiple("parentPlane")).forEach(d=>{d.name=d.name.replace("世界","父级")}))}if(this.options.continentsBg){const r=(()=>{const d=new MeshStandardMaterial({name:"大洲板块顶面",emissive:"#154532"}),v=new MeshBasicMaterial({name:"大洲板块侧面",color:"#0c1528"}),C=new De({name:"大洲板块线",color:new Color$1("#09e6c1"),sizeAttenuation:0,lineWidth:this.options.lineWidth});return{topMat:d,sideMat:v,lineMat:C}})();this.mList.addMultiple("continents",r)}})}consoleMousePostion(){this.addListener(this.container,"click",r=>{var C,_;const d=this.unproject(r,this.mapObj.z+this.mapObj.depth),v=(_=(C=this.projection).invert)==null?void 0:_.call(C,[d.x,-d.y]);console.log("consoleMousePostion.postion",d),console.log("consoleMousePostion.lnglat",v)})}setAreaMaterialByProperty(r,d,v){if(!this.map)return;const C=this.map.areaArr.find(_=>_.userData[r]===d);if(C){if(v==="origin"){C.useMaterial("origin");return}const _=JSON.stringify(v);if(!C.materialList[_]){const w=C.object3d,fe=w.material[0].clone();v.color&&fe.color.set(v.color),v.emissive&&(fe.emissive.set(v.emissive),fe.emissiveIntensity=v.emissiveIntensity||1),C.setMaterialList(_,[fe,w.material[1]])}C.useMaterial(_)}}setLineMaterialByProperty(r,d,v){if(!this.map)return;const C=this.map.lineArr.find(_=>_.userData[r]===d);if(C){if(v==="origin"){C.useMaterial("origin");return}const _=JSON.stringify(v);if(!C.materialList[_]){const fe=C.object3d.material.clone();v.color&&fe.color.set(v.color),v.width&&(fe.lineWidth=v.width),C.setMaterialList(_,fe)}C.useMaterial(_)}}addAreaPlaneByProperty(r,d,v){return B0(this,null,function*(){if(!this.map)return;const _=this.map.options.geojson.features.find(w=>w.properties&&w.properties[r]===d);if(_){const w=f(v.material)?new MeshBasicMaterial(fi({},v.material)):v.material,fe=f(v.lineMaterial)?new De(fi({},v.lineMaterial)):v.lineMaterial,ye=f(v.sideMaterial)?new MeshBasicMaterial(fi({},v.sideMaterial)):v.sideMaterial,Le=yield this.lead.draw("PlaneMap",{geojson:{type:"FeatureCollection",features:[_]},depth:v.depth||0,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:{topMat:w,lineMat:fe,sideMat:ye},areaGroup:!1},this.group);return Le.position.z=this.mapObj.z+this.mapObj.depth+.01,Le.lineArr.forEach(Re=>{v.lineBloom&&Re.enableBloom()}),Le}})}showAction(){return B0(this,null,function*(){bn(gn.prototype,this,"showAction").call(this),this.useSaveCamera(`map-${this.options.adcode}`);const r=this.lead.group;if(this.mapHistory[0]){const{stop:d,start:v}=sinusoidalInOut({onUpdate:C=>{if(!this.mapHistory[0]){d();return}r.position.z=-this.mapHistory[0].depth*(1-C)}});if(yield v(),this.mapHistory[0]){const C=this.pencil.cameraTarget.toArray();this.pencil.controls.setTarget(C[0],C[1],this.mapHistory[0].depth+this.mapHistory[0].z,!1)}this.saveCamvasState("controls",0)}})}hide(){return B0(this,null,function*(){if(!this.showState)return;const r=this.lead.group;yield sinusoidalInOut({onUpdate:d=>{r.position.z=-this.mapHistory[0].depth*d}}).start(),setTimeout(()=>{bn(gn.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 r=yield this.lead.draw("Light",{type:"SpotLight",color:"#c1e6dd",intensity:1,distance:0,angle:.5,penumbra:1,decay:0});this.lead.updateBaseObjectKey(r,"ShadowSpotLight"),this.shadowMapLight=r,r.object3d.position.set(.281,32.487,43.077),r.object3d.castShadow=!0;const d=yield this.lead.draw("PlaneShadow");this.planeShadow=d})}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(r){const d=this.getAdcodeShowLevel(r);let v=this.options.mapDepth;Array.isArray(v)||(v=new Array(3).fill(v));let C;return d==="country"?C=v[0]:d==="province"?C=v[1]:C=v[2],C}getDepth(r,d){let v=this.getOptionsDepth(r);if(this.options.depthReference){const C=this.options.depthReference,_=findAdcodeInfo(r).b;v=v*this.getReferenceScale(C,_)}else if(this.mapHistory.length){const C=findAdcodeInfo(this.mapHistory[0].mapInfo.adcode).b,_=this.getReferenceScale(C,d);v=v*_}return v}getReferenceScale(r,d){const v=Math.abs(d[3]-d[1])/Math.abs(r[3]-r[1]),C=Math.abs(d[2]-d[0])/Math.abs(r[2]-r[0]);return Math.max(v,C)}getAdcodeShowLevel(r,d=!0){var v;if((v=this.options.fixCity)!=null&&v[r]&&(r=this.options.fixCity[r]),r===0)return"world";if(r===1e5)return"country";if(/^\d{6}$/.test(`${r}`)){const{level:C,parent:_}=findAdcodeInfo(r),w=_&&findAdcodeInfo(_).level;return C==="district"&&w==="province"&&d?"city":C}else if(continentsType.find(C=>C.adcode===r))return"continent"}handleClick(r){const{drillDownRestrictions:d}=this.options;this.isAnimating||(r&&r.userData.adcode?this.getAdcodeShowLevel(r.userData.adcode,!1)!==d?this.showMap({adcode:r.userData.adcode}):this.emit("drilldownRestrictions",r.userData.adcode):!r&&this.mapHistory.length>1&&this.showMap({adcode:this.adcodes.at(-2)}))}beforeShowMap(r){return!0}getAdcodes(r){var C;const d=[];let v=r;for(;v&&(d.unshift(v),v!==this.options.adcode);)v=(C=findAdcodeInfo(v))==null?void 0:C.parent;return d}showMap(C){return B0(this,arguments,function*({adcode:r,adcodes:d,duration:v=1e3}){const _=d||this.getAdcodes(r);(yield this.beforeShowMap(_))!==!1&&(this.emit("beforeDrillDown",[..._]),yield this.setAdcode({adcodes:_,duration:v}),this.emit("afterDrillDown",[..._]))})}drawLabels(){return B0(this,null,function*(){var v;const r=this.options.showLabel;if(!((v=this.mapArea)!=null&&v.length)||!r)return;let d=this.lead.getObject("Group",{key:"mapLabel"});d||(d=yield this.lead.draw("Group",{key:"mapLabel"},this.group),d.object3d.name="地图标签组",yield Promise.all(this.mapArea.map(C=>B0(this,null,function*(){let{name:_,adcode:w,centroid:fe}=C.userData;const{DistrictID:ye,DistName:Le,iso_a2:Re,center:Ne}=C.userData;if(w=w||Re||ye,fe=fe||Ne,_=_||Le,!fe)return;const ke=this.getLocationPosition(fe);if(this.lead.getObject("Node",{key:`mapLabel-${w}`})||!ke)return;const[ot,xt,ht]=ke;let Fe=_;r==="lite"&&Fe&&(Fe=_.replace(/自治州|地区|自治区|省|市|壮族|特别行政区|回族|维吾尔/g,""));const at=Fe&&getLabelElement(Fe),ct=Fe!=null&&Fe.startsWith("澳门")?-1:0;yield this.lead.draw("Node",{position:new Vector3(ot,xt+ct,ht),children:at,key:`$p:-${this.options.adcode===0?_:w}`},d)}))))})}eraseLabels(){const r=this.lead.getObject("Group",{key:"mapLabel"});r==null||r.erase()}geAdcodePosition(r){var v;const d=(v=this.mapArea)==null?void 0:v.find(C=>C.userData.adcode===r);if(d){const{centroid:C,center:_}=d.userData;return this.getLocationPosition(C||_)}}getLocationPosition(r){const[d,v]=r,[C,_]=this.projection([d,v]);return[C,-_,this.mapObj?this.mapObj.z+this.mapObj.depth:0]}getAdcodeScreenPosition(r){const d=this.geAdcodePosition(r);if(d){const[v,C,_]=d,w=new Vector3(v,C,_);w.project(this.pencil.camera);const{width:fe,height:ye}=this.pencil.getSize(),Le=(w.x*.5+.5)*fe,Re=(w.y*-.5+.5)*ye;return{x:Le,y:Re}}}booleanPointInCn(r){return chinaLiteJson.features[0].geometry.coordinates.some(d=>turf.booleanPointInPolygon(turf.point(r),turf.polygon(d)))}getGeojson(r,d=!1){return B0(this,null,function*(){var v,C,_,w;return d?this.options.extrudeLine?(_=this.options.extrudeLineGeojsonMap)!=null&&_[r]?{res:(w=this.options.extrudeLineGeojsonMap)==null?void 0:w[r]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json-lite/${r}.json`):{res:void 0}:(v=this.options.geojsonMap)!=null&&v[r]?{res:(C=this.options.geojsonMap)==null?void 0:C[r]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json/${r}.json`)})}handleDrillDown(w){return B0(this,arguments,function*({adcode:r,duration:d,handleLook:v,saveBackCamvasState:C,extrudelineBloom:_}){var fe,ye,Le,Re,Ne;if(typeof r!="undefined"&&!this.isAnimating){const ke=(fe=this.map)==null?void 0:fe.findGroup(r,!0),ot=findAdcodeInfo(+r);if(this.isAnimating||!ot)return;this.isAnimating=!0;const{name:xt}=ot;let{res:ht}=yield this.getGeojson(r),{res:Fe}=yield this.getGeojson(r,!0);if(!this.options.showDistrict&&this.getAdcodeShowLevel(r)==="city"&&(ht=Fe,Fe=void 0),[ht,Fe].filter(Boolean).forEach(ct=>{if(!ct.features[0].properties.adcode&&/^\d{6}$/.test(`${r}`)){const Gt=findAdcodeInfo(r);ct.features[0].properties=Bi(fi(fi({},ct.features[0].properties),Gt),{center:[Gt.lng,Gt.lat]})}}),ht){const ct=this.options.plateInCenter&&(this.mapHistory.length<1||this.options.drillDownPlateInCenter);if((ye=this.options.fixGeojson)!=null&&ye[r]){const Ut=(Le=this.options.fixGeojson)==null?void 0:Le[r];if(Ut.startsWith("-")){const a0=+Ut.slice(1);ht.features=ht.features.filter(g0=>g0.properties.adcode!==a0)}}let Gt=findAdcodeInfo(r).b;const Rt=[...Gt];this.mapHistory.length===1&&!this.options.drillDownSecondLevelMats?Gt=findAdcodeInfo(this.mapInfo.adcode).b:this.mapHistory.length===2&&!this.options.drillDownThirdLevelMats&&(this.options.drillDownSecondLevelMats?Gt=findAdcodeInfo(this.mapInfo.adcode).b:Gt=findAdcodeInfo(this.mapHistory[0].mapInfo.adcode).b),this.eraseLabels(),this.map&&(this.options.drillDownHideParent&&this.parentBg.forEach(Ut=>{Ut.hide()}),this.options.showOneLevel?this.map.hide():this.map.deactive(),C&&this.saveCamvasState("userControls",-1));const Wt=this.mapHistory.length,Pt=Wt-1,Nt=this.getDepth(r,Rt),Kt=(Re=this.mapHistory[Pt])==null?void 0:Re.depth,kt=Wt===0||this.options.showOneLevel?0:this.mapHistory[Pt].z+Kt,Yt=Wt===0||this.options.showOneLevel?0:kt-Nt,n0=turf.center(ht).geometry.coordinates,[o0,c0]=this.projection(n0),s0=yield this.drawPlaneMap({geojson:ht,extrudeLineGeojson:Fe,depth:Nt,bbox:Gt,adcode:r,extrudelineBloom:_});ke==null||ke.hide(),s0.position.setZ(Yt);const qt=s0.position.z,t0=()=>B0(this,null,function*(){yield sinusoidalInOut({onUpdate:Ut=>{kt!==qt&&(s0.position.z=qt+(kt-qt)*Ut)}}).start({duration:d})});if(ct)if(this.fixNear(r),s0.position.z=kt,v){const Ut=(Ne=this.mapHistory.at(-1))==null?void 0:Ne.controls;yield this.fitTo(s0,{z:kt+Nt,adcode:r,enableTransition:d!==0,polarAngle:Ut==null?void 0:Ut.polarAngle,azimuthAngle:Ut==null?void 0:Ut.azimuthAngle,handleStart:()=>B0(this,null,function*(){s0.position.z=qt,yield t0()})})}else this.options.showOneLevel&&s0.hide();else yield t0();this.mapHistory.push({map:s0,mapInfo:ot,z:kt,depth:Nt,cX:o0,cY:-c0}),v&&this.drawLabels(),this.saveCamvasState("controls",-1)}else console.log(`${xt}的地图数据不存在`);this.event.emit("handleDrillDown",{adcode:r,z:this.mapObj.z+this.mapObj.depth})}this.isAnimating=!1})}saveCamvasState(r,d){const v=this.mapHistory.at(d);v&&(v[r]={lookAt:[...this.pencil.cameraPositon.toArray(),...this.pencil.cameraTarget.toArray()],polarAngle:this.pencil.controls.polarAngle,azimuthAngle:this.pencil.controls.azimuthAngle})}fixNear(r){const d=this.getAdcodeShowLevel(r);r===0?(this.pencil.camera.near=1,this.pencil.camera.far=1e3,this.pencil.camera.updateProjectionMatrix()):(d==="country"||d==="province")&&this.pencil.camera.near!==this.pencilConfig.camera.near*10?(this.pencil.camera.near=this.pencilConfig.camera.near*10,this.pencil.camera.updateProjectionMatrix()):(d==="city"||d==="district")&&this.pencil.camera.near!==this.pencilConfig.camera.near&&(this.pencil.camera.near=this.pencilConfig.camera.near,this.pencil.camera.updateProjectionMatrix())}fitTo(ye){return B0(this,arguments,function*(r,{polarAngle:d,azimuthAngle:v,z:C,handleStart:_,adcode:w,enableTransition:fe=!0}={}){if(!(r!=null&&r.object3d))return;if(w&&(yield this.useSaveCamera(`map-${w}`,fe))){_&&(yield _());return}const Le=this.options.mapPadding,{height:Re,width:Ne}=this.pencil.getSize();Re<Le[0]+Le[2]+50&&(Le[0]=0,Le[2]=0),Ne<Le[1]+Le[3]+50&&(Le[1]=0,Le[3]=0);const ke=d!=null?d:this.options.polarAngle,ot=v!=null?v:this.options.azimuthAngle,xt=this.pencil.cameraPositon.toArray(),ht=this.pencil.cameraTarget.toArray();yield this.paddingInCssPixel(r,Le[0],Le[1],Le[2],Le[3],!1);let Fe;C&&(Fe=this.pencil.cameraTarget.toArray(),yield this.pencil.controls.setTarget(Fe[0],Fe[1],C,!1)),yield this.pencil.controls.rotateTo(ot,ke,!1),Fe=this.pencil.cameraTarget.toArray();const at=this.pencil.cameraPositon.toArray();yield this.lookAt(...xt,...ht),yield Promise.all([this.lookAt(...at,...Fe,fe),_==null?void 0:_()].filter(Boolean))})}drawPlaneMap(fe){return B0(this,arguments,function*({geojson:r,extrudeLineGeojson:d,bbox:v,depth:C,extrudelineBloom:_,adcode:w}){var at;const ye=[this.mList.getMultiple("plane"),this.mList.getMultiple("secondPlane"),this.mList.getMultiple("thirdPlane")];let Le=this.mapHistory.length,Re=null;for(;Re===null;)Re=ye[Le],Le--;const Ne=this.mList.getMultiple("bgPlane"),ke=fi(fi({},Re),Ne?{bgTopMat:Ne.topMat,bgSideMat:Ne.sideMat,bgLineMat:Ne.lineMat,bgExtrudeLineMat:Ne.extrudeLineMat}:{});let ot=r,xt=d,ht=!1;this.options.style==="map2CityOnMap"&&d&&(ot=d,this.options.showCityOnMapInnerLine?(xt=r,ht=!0):xt=void 0);const Fe=yield this.lead.draw("PlaneMap",{key:`${w}`,geojson:ot,extrudeLineGeojson:xt,depth:C,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:ke,bbox:v,topSegments:this.options.topSegments,lineOffset:this.options.lineOffset,mergeSide:this.options.mergeSide},this.group);return Fe.object3d.name=((at=findAdcodeInfo(w))==null?void 0:at.name)||`${w}`,this.options.style==="map2CityOnMap"&&(Fe.lineArr.forEach(ct=>{this.initBaseObjectUserData(ct),ct.object3d.name="板块边框",this.mList.setUserData("plane#lineMat",{selectHide:!0}),this.lead.updateBaseObjectKey(ct,"plane#lineMat")}),this.options.showCityOnMapInnerLine||this.mList.setUserData("plane#extrudeLine",{selectHide:!0})),Fe.extrudelineArr&&Fe.extrudelineArr.forEach(ct=>{ct.object3d.name=ht?"板块内线":"板块边线",this.lead.updateBaseObjectKey(ct,"extrudeLine"),this.initBaseObjectUserData(ct),_&&(ct.object3d.userData.bloom=!0)}),Fe})}handleBack(){return B0(this,arguments,function*({duration:r=1e3,handleLookBack:d=!0,keepOne:v=!0}={}){if(this.isAnimating||(v?this.mapHistory.length<=1:this.mapHistory.length===0))return;this.isAnimating=!0;const C=this.mapHistory.pop();if(!this.options.drillDownPlateInCenter){const _=C.map.position.z,w=this.mapObj?this.mapObj.z+(this.mapObj.depth-C.depth):0;yield sinusoidalInOut({onUpdate:fe=>{C.map.position.z=_+(w-_)*fe}}).start({duration:r})}if(this.lead.eraseWithoutMaterial(C.map),this.eraseLabels(),this.mapObj){const{map:_}=this.mapObj,w=_==null?void 0:_.findGroup(C.mapInfo.adcode,!0);w&&w.show(),_&&d&&(this.options.showOneLevel?_.show():_.active(),this.options.drillDownHideParent&&this.parentBg.forEach(fe=>{fe.show()}),yield this.handleLookBack(r),this.drawLabels())}this.emit("handleBack",{adcodes:this.adcodes}),this.isAnimating=!1})}handleLookBack(r){return B0(this,null,function*(){const{userControls:d,controls:v}=this.mapObj;yield this.pencil.controls.setLookAt(...d?d.lookAt:v.lookAt,r!==0)})}compareLocations(r,d){const v=r.filter(fe=>fe),C=d.filter(fe=>fe),_=[];let w=0;for(let fe=0;fe<Math.min(v.length,C.length)&&v[fe]===C[fe];fe++)w++;for(let fe=w;fe<v.length;fe++)_.push(-1);for(let fe=w;fe<C.length;fe++)_.push(C[fe]);return _}setAdcode(v){return B0(this,arguments,function*({adcodes:r,duration:d}){var _,w,fe;const{adcodes:C}=this;if(!(JSON.stringify(r)===JSON.stringify(C)||this.isAnimating))if(JSON.stringify(r)===JSON.stringify([0]))try{yield this.handleDrillDown({adcode:0,duration:d,handleLook:!0})}catch(ke){console.error(ke)}else{const{continent:ke,country:ot,province:xt,city:ht,district:Fe}=r.reduce((kt,Yt)=>{const n0=this.getAdcodeShowLevel(Yt);return kt[n0]=Yt,kt},{}),{continent:at,country:ct,province:Gt,city:Rt,district:Wt}=C.reduce((kt,Yt)=>{const n0=this.getAdcodeShowLevel(Yt);return kt[n0]=Yt,kt},{}),Pt=ke||at,Nt=(fe=(w=(_=this.map)==null?void 0:_.extrudelineArr)==null?void 0:w[0])==null?void 0:fe.object3d.userData.bloom,Kt=this.compareLocations([at,ct,Gt,Rt,Wt],[ke,ot,xt,ht,Fe]);try{for(var ye=Pn(Kt.entries()),Le,Re,Ne;Le=!(Re=yield ye.next()).done;Le=!1){const[kt,Yt]=Re.value;const n0=kt===Kt.length-1?d:0,o0=kt===Kt.length-1;Yt===-1?yield this.handleBack({duration:n0,handleLookBack:o0,keepOne:!Pt}):yield this.handleDrillDown({adcode:Yt,duration:n0,handleLook:o0,saveBackCamvasState:Kt.includes(-1)?!1:this.options.handleBackKeepCamvasState,extrudelineBloom:Nt})}}catch(Re){Ne=[Re]}finally{try{Le&&(Re=ye.return)&&(yield Re.call(ye))}finally{if(Ne)throw Ne[0]}}}})}setPadding(r,d=!1,v=!1){this.options.mapPadding=[...r],d&&this.fitTo(this.map,{enableTransition:v})}dispose(){var r,d,v;(r=this.cityVis)==null||r.dispose(),(d=this.map)==null||d.dispose(),this.parentBg.forEach(C=>{C.dispose()}),this.parentBg.length=0,(v=this.continentsBg)==null||v.dispose(),this.continentsBg=void 0,this.mapHistory.length=0,super.dispose()}};C0(gn,"VisName","map");let index$1=gn;class Earth extends Sphere{constructor(r){super();C0(this,"options");this.options=fi({radius:30,rotationY:0},r)}create(){const d=this.pencil.installPlugins.get("materialList").get("earthMaterial");this.material=d,super.create(),this.rotation.y=this.options.rotationY,this.object3d.name="地球"}}class Countries extends ee$1{constructor(r){super();C0(this,"options");C0(this,"areaArr",[]);C0(this,"lineArr",[]);this.options=fi({start:30,depth:1.4,lineOffset:.01,hasTop:!0,hasSide:!0,hasLine:!0,lineDuration:1e3,areaGroup:!0},r)}create(){return B0(this,null,function*(){const{geojson:r,mats:d,hasSide:v,lineOffset:C,areaGroup:_}=this.options;this.createGroup();const w=this.pencil.getPlugin("worker"),fe=this.pencil.lead,{borderMat:ye,topMat:Le,outLine:Re}=d;let Ne=r.features.map(xt=>{const{type:ht,coordinates:Fe}=xt.geometry;let at=[];return ht==="Polygon"?at=Fe:ht==="MultiPolygon"&&(at=Fe.flat()),{coords:at,properties:xt.properties}});const ke=this.options.hasTop||this.options.hasSide,ot=this.options.hasLine;_||(Ne=[{coords:Ne.map(({coords:xt})=>xt).flat(),properties:{}}]),yield Promise.all(Ne.map(xt=>[ke&&w.geoGeometry("conicPolygon",{mesaage:{start:[this.options.start],depth:[this.options.depth],useGroups:2,hasBottom:!1,topFirst:!0,coordinatesArr:xt.coords,bbox:this.options.bbox,hasSide:v},cb:ht=>B0(this,null,function*(){var at,ct;const Fe=yield fe.draw("ConicPolygon",{geometry:ht,material:v?[Le,ye]:Le,hasSide:v},this);Fe.object3d.name=(at=xt.properties)!=null&&at.name?((ct=xt.properties)==null?void 0:ct.name)+"-板块":"板块",Fe.userData=fi({},xt.properties),this.areaArr.push(Fe)})}),ot&&w.geoGeometry("conicLine",{mesaage:{start:[this.options.start+this.options.depth+C],lineWidth:[1],coordinatesArr:xt.coords},cb:ht=>B0(this,null,function*(){var at;const Fe=yield fe.draw("Line",{geometry:ht,material:Re,onTop:2},this);Fe.object3d.name=(at=xt.properties)!=null&&at.name?xt.properties.name+"-线":"线",Fe.userData=fi({},xt.properties),this.lineArr.push(Fe)})})].filter(Boolean)).flat())})}}class SphereShadow extends ee$1{constructor(r){super();C0(this,"options");this.options=fi({radius:30},r)}create(){return B0(this,null,function*(){const r=new SphereGeometry(this.options.radius,128,90),d=new MeshBasicMaterial;this.createMesh(r,d),this.scale.multiplyScalar(1.001),this.rotation.y=Math.PI/180*-90,this.object3d.name="阴影面",this.hide()})}}const objs=Bi(fi({},objs$3),{Earth,Countries,SphereShadow}),base=g=>{g.loaderAdd=function(){const{loader:t}=this;t.add(["/image/earth2/basic.jpg"]),t.add(["/image/earth2/NormalMap.jpg"],{colorCorrection:!1})},g.initMaterial=function(){return B0(this,null,function*(){const t=this.loader,r=t.getAsset("/image/earth2/basic.jpg"),d=t.getAsset("/image/earth2/NormalMap.jpg"),v=new MeshStandardMaterial({name:"地球材质",map:r,metalness:.1,roughness:.8,normalMap:d,normalScale:new Vector2(.5,.5)});this.mList.add("earthMaterial",v)})},g.initVis=function(){return B0(this,null,function*(){g.pencil.camera.near=1,g.pencil.camera.far=3e3,g.pencil.camera.fov=12,g.pencil.camera.updateProjectionMatrix();const[t,r]=yield Promise.all([this.lead.draw("Light",{type:"PointLight",intensity:4,color:16777215,distance:0,decay:0}),this.lead.draw("Earth",{radius:100,rotationY:Math.PI/180*90})]);yield this.pencil.controls.fitToBox(r.object3d,!1),t.position.copy(this.pencil.cameraPositon)})}},chinaPlate=g=>{g.extendsOptions=Bi(fi({},g.extendsOptions),{copyChinaPlane:g.options.copyChinaPlane}),g.loaderAdd=function(){const{loader:t}=this;t.add(["/image/earth/basic.webp","/image/earth/chinaBorder.png","/image/earth/flyline.png"]),t.add(["/image/earth/chinaNormal.webp"],{colorCorrection:!1})},g.initVis=function(){return B0(this,null,function*(){yield this.initLight();const[,t,r,d]=yield Promise.all([this.lead.draw("Earth",{radius:this.options.radius,rotationY:Math.PI/180*-90}),this.lead.draw("Countries",{geojson:{type:"FeatureCollection",features:worldJson.features.filter(v=>{var C;return((C=v.properties)==null?void 0:C.name)!=="中国"})},depth:0,start:this.options.radius,mats:this.mList.getMultiple("world"),hasSide:!1,hasTop:!1,areaGroup:!1}),this.lead.draw("Countries",{geojson:chinaLiteJson,depth:0,start:this.options.radius+this.options.mapDepth,mats:this.mList.getMultiple("china"),hasSide:!1,hasTop:!1}),this.lead.draw("Countries",{geojson:chinaJson,depth:this.options.mapDepth,start:this.options.radius,mats:this.mList.getMultiple("plane"),bbox:chinaBbox,lineDuration:6e3})]);if(t.object3d.name="世界",r.object3d.name="中国边界",d.object3d.name="中国",this.map=d,this.options.copyChinaPlane){this.options.copyChinaPlane;const v=yield this.lead.draw("Countries",{geojson:chinaJson,depth:this.options.mapDepth,start:this.options.radius,mats:{topMat:new MeshBasicMaterial({color:"#ffffff"})},bbox:chinaBbox,hasSide:!1,hasTop:!0,hasLine:!1,areaGroup:!1});v.object3d.name="复制中国顶面",this.lead.updateBaseObjectKey(v.children[0],"chinaPlaneCopy")}yield this.pencil.controls.rotateTo(1.833542196136704,.9809685394021701,!1),yield this.pencil.controls.dollyTo(99.11560932366835,!1)})},g.initMaterial=function(){return B0(this,null,function*(){const t=this.loader,r=new MeshStandardMaterial({side:DoubleSide,name:"顶面",color:new Color$1("#0d8a8c"),metalness:.75,roughness:.61,normalMap:t.getAsset("/image/earth/chinaNormal.webp")}),d=new MeshStandardMaterial({side:DoubleSide,name:"侧面",color:new Color$1("#999999"),map:t.getAsset("/image/earth/chinaBorder.png")}),v=new De({name:"中国边界",lineWidth:2,sizeAttenuation:0,color:new Color$1("#59C8FF")}),C=new De({name:"世界边界",lineWidth:2,sizeAttenuation:0,color:new Color$1("#80abaf")}),_=t.getAsset("/image/earth/basic.webp"),w=new MeshStandardMaterial({name:"地球材质",map:_,color:new Color$1(2397309),metalness:.84,roughness:.51}),fe=t.getAsset("/image/earth/flyline.png");fe.wrapS=RepeatWrapping,fe.wrapT=RepeatWrapping,fe.repeat.set(.5,.5);const ye=new De({name:"省份边界",map:fe,useMap:1,lineWidth:2,sizeAttenuation:0,transparent:!0,color:new Color$1("#3a898b")});this.mList.addMultiple("plane",{topMat:r,borderMat:d,outLine:ye}),this.mList.addMultiple("world",{outLine:C}),this.mList.addMultiple("china",{outLine:v}),this.mList.add("earthMaterial",w)})}},countryPlate=g=>{g.initVis=function(){return B0(this,null,function*(){yield this.initLight();const[,t]=yield Promise.all([this.lead.draw("Earth",{radius:this.options.radius,rotationY:Math.PI/180*-90}),this.lead.draw("Countries",{geojson:worldJson,depth:this.options.mapDepth,start:this.options.radius,mats:this.mList.getMultiple("plane"),bbox:[-180,-90,180,90],lineOffset:.14}),this.lead.draw("SphereShadow",{radius:this.options.radius})]);this.map=t,yield this.pencil.controls.rotateTo(1.8041576242193995,1.2232045720480524,!1),yield this.pencil.controls.dollyTo(99.11560932366835,!1),this.playing&&(this.pencil.controls.minPolarAngle=this.pencil.controls.polarAngle,this.pencil.controls.maxPolarAngle=this.pencil.controls.polarAngle)})},g.initMaterial=function(){return B0(this,null,function*(){const t=new MeshStandardMaterial({side:DoubleSide,name:"侧面",color:new Color$1("#999999")}),r=new MeshStandardMaterial({name:"顶面",color:new Color$1("#ffffff"),emissive:new Color$1("#523333")}),d=new De({name:"边框线",lineWidth:4,sizeAttenuation:0,color:new Color$1("#006aa3")}),v=new MeshBasicMaterial({name:"地球材质",color:new Color$1("#012b47")});this.mList.addMultiple("plane",{topMat:r,borderMat:t,outLine:d}),this.mList.add("earthMaterial",v)})},g.getLocationPosition=function(t,r=0){const[d,v]=t,C=this.options.mapDepth+this.options.radius+r;return i$1(d,v,C)}},styles=Object.freeze(Object.defineProperty({__proto__:null,base,chinaPlate,countryPlate},Symbol.toStringTag,{value:"Module"})),_n=class _n extends Base{constructor(){super(...arguments);C0(this,"leadObjs",objs);C0(this,"leftTruck",!1);C0(this,"extendsOptions",{mapDepth:()=>this.options.mapDepth});C0(this,"map");C0(this,"autoRotateSpeed",0)}get mapArea(){return this.map.areaArr}setOptions(r){super.setOptions(fi({mapDepth:1.4,radius:30,style:"chinaPlate",copyChinaPlane:!1},r)),this.initSettingsObj={autoRotate:!1},styles[this.options.style](this)}handleSetting(r,d){return B0(this,null,function*(){return yield bn(_n.prototype,this,"handleSetting").call(this,r,d),r==="autoRotate"&&this.playing&&(d?this.autoRotateSpeed=-20:this.autoRotateSpeed=0,this.pencil.autoRotate(this.autoRotateSpeed)),d})}show(){super.show(),this.animationIn()}animationIn(){const r=this.pencil.controls;r.addEventListener("controlstart",()=>{this.pencil.autoRotate(0)}),r.addEventListener("controlend",()=>{this.pencil.autoRotate(this.autoRotateSpeed)})}initLight(){return B0(this,null,function*(){const[r,d]=yield Promise.all([this.lead.draw("Light",{type:"RectAreaLight",color:"#E0FFFD",width:200,height:200}),this.lead.draw("Light",{type:"RectAreaLight",intensity:3,width:200,height:170})]);r.position.set(0,50,-100),d.position.set(0,0,150),r.object3d.lookAt(0,0,0),d.object3d.lookAt(0,0,0),this.lead.updateBaseObjectKey(r,"RectAreaLight_1"),this.lead.updateBaseObjectKey(d,"RectAreaLight_2")})}getLocationPosition(r,d=0){const[v,C]=r,_=this.getRadius()+d;return i$1(v,C,_)}setAreaMaterialByProperty(r,d,v){if(!this.map)return;const C=this.map.areaArr.find(_=>_.userData[r]===d);if(C){if(v==="origin"){C.useMaterial("origin");return}const _=JSON.stringify(v);if(!C.materialList[_]){const w=C.object3d,fe=w.material[0].clone();v.color&&fe.color.set(v.color),v.emissive&&(fe.emissive.set(v.emissive),fe.emissiveIntensity=v.emissiveIntensity||1),C.setMaterialList(_,[fe,w.material[1]])}C.useMaterial(_)}}setLineMaterialByProperty(r,d,v){if(!this.map)return;const C=this.map.lineArr.find(_=>_.userData[r]===d);if(C){if(v==="origin"){C.useMaterial("origin");return}const _=JSON.stringify(v);if(!C.materialList[_]){const fe=C.object3d.material.clone();v.color&&fe.color.set(v.color),v.width&&(fe.lineWidth=v.width),C.setMaterialList(_,fe)}C.useMaterial(_)}}addAreaPlaneByProperty(r,d,v){return B0(this,null,function*(){if(!this.map)return;const _=this.map.options.geojson.features.find(w=>w.properties&&w.properties[r]===d);if(_)return this.lead.draw("Countries",{geojson:{type:"FeatureCollection",features:[_]},depth:this.options.mapDepth+.3,start:this.options.radius,mats:{topMat:new MeshBasicMaterial(v.area),outLine:new De(v.line)}})})}getRadius(){const r=this.baseObjectByUuid("earth");return r?r.object3d.geometry.parameters.radius:0}checkBehindEarth(r,d){const v=new Vector3(0,0,0),C=new Vector3(0,0,0),_=this.getRadius(),w=()=>{const fe=r();if(!fe.length)return;this.pencil.controls.getPosition(C,!1);const ye=v.clone().sub(C),Le=Math.sqrt(Math.pow(ye.length(),2)-Math.pow(_,2)),Re=fe.map(Ne=>Ne.position.clone().sub(C).length()>Le);d(fe,Re)};w(),this.pencil.controls.addEventListener("update",()=>{w()})}};C0(_n,"VisName","earth");let index=_n;const ec=(g,t)=>{const r=stringToUtf8ByteArray(g),d=stringToUtf8ByteArray(t).map(function(v,C){return v^r[Math.floor(C%r.length)]}).join(",");return btoa(d)};function stringToUtf8ByteArray(g){const t=[];let r=0;for(let d=0;d<g.length;d++){let v=g.charCodeAt(d);v<128?t[r++]=v:v<2048?(t[r++]=v>>6|192,t[r++]=v&63|128):(v&64512)==55296&&d+1<g.length&&(g.charCodeAt(d+1)&64512)==56320?(v=65536+((v&1023)<<10)+(g.charCodeAt(++d)&1023),t[r++]=v>>18|240,t[r++]=v>>12&63|128,t[r++]=v>>6&63|128,t[r++]=v&63|128):(t[r++]=v>>12|224,t[r++]=v>>6&63|128,t[r++]=v&63|128)}return t}let b="/";b==="/"&&(b="");const getMapConfig=(d,...v)=>B0(exports,[d,...v],function*(g,t=b,r){if(g===0)return{mapDepth:5,adcode:0,extrudeLine:!1,worldPacificCentre:!0,center:[0,0]};{const C=findAdcodeInfo(g);return extendMapConfig({center:[C.lng,C.lat],adcode:C.adcode},t,r)}}),getMapWithCityConfig=(d,...v)=>B0(exports,[d,...v],function*(g,t=b,r){const C=findAdcodeInfo(g);return extendMapConfig({center:[C.lng,C.lat],adcode:C.adcode,style:"map2CityOnMap",mapDepth:.004},t,r)}),extendMapConfig=(d,...v)=>B0(exports,[d,...v],function*(g,t=b,r){var C,_;if(g.adcode!==0&&g.adcode!==1e5){const w=(C=g.fixGeojson)==null?void 0:C[g.adcode],fe=(_=g.fixGeojson)==null?void 0:_[g.adcode+"-lite"];let{res:ye}=yield jsonFetch(t+`/geojson/${w||"json"}/${g.adcode}.json`);const{res:Le}=yield jsonFetch(t+`/geojson/${fe||"json-lite"}/${g.adcode}.json`),Re=g.adcode,Ne=Bi(fi({},g),{geojsonMap:{[Re]:ye},extrudeLineGeojsonMap:{[Re]:Le},cityBboxMap:{},jsonNameObj:{},depthReference:void 0});if(g.style==="map2CityOnMap"){if(!(findAdcodeInfo(Re).level==="province")){let ot=findAdcodeInfo(Re).parent;for(;findAdcodeInfo(ot).level!=="province";)ot=findAdcodeInfo(ot).parent;const{res:xt}=yield jsonFetch(t+`/geojson/${w||"json"}/${ot}.json`);ye=xt}ye.features.forEach(ot=>{Ne.jsonNameObj[ot.properties.adcode]=ec(ot.properties.name,`${ot.properties.adcode}`)})}if(g.parentBg){const ke=findAdcodeInfo(Re).parent;if(ke!==1e5){const{res:ot}=yield jsonFetch(t+`/geojson/json/${ke}.json`),{res:xt}=yield jsonFetch(t+`/geojson/json-lite/${ke}.json`);Ne.geojsonMap[ke]=ot,Ne.extrudeLineGeojsonMap[ke]=xt}}return r&&(Ne.depthReference=r.depthReference||findAdcodeInfo(r.adcode).b),Ne}return fi({},g)}),getCityConfig=(r,...d)=>B0(exports,[r,...d],function*(g,t=b){const v=findAdcodeInfo(g),{name:C}=v;return{center:[v.lng,v.lat],adcode:v.adcode,jsonName:ec(C,`${g}`)}}),removeCameraHistory=g=>g.filter(t=>!(t.objectUuid==="camera"&&["SetPosition","SetTarget"].includes(t.type))),access={set token(g){accessToken.token=g}},VERSION=version;exports.Base=Base;exports.City=City$1;exports.Earth=index;exports.Map=index$1;exports.THREE=THREE;exports.TWEEN=tween_esm;exports.VERSION=VERSION;exports.access=access;exports.animationUtils=animation;exports.extendMapConfig=extendMapConfig;exports.getCityConfig=getCityConfig;exports.getMapConfig=getMapConfig;exports.getMapWithCityConfig=getMapWithCityConfig;exports.removeCameraHistory=removeCameraHistory;
|
|
5152
|
+
`,t},gn=class gn extends Base{constructor(){super(...arguments);C0(this,"leadObjs",objs$1);C0(this,"mapHistory",[]);C0(this,"activePlaneMap",null);C0(this,"isAnimating",!1);C0(this,"parentBg",[]);C0(this,"continentsBg");C0(this,"group");C0(this,"projection");C0(this,"pcenter",[104,37.5]);C0(this,"pscale",5e4/1e3);C0(this,"meters");C0(this,"cityVis",null);C0(this,"extendsOptions",{mapDepth:()=>this.getOptionsDepth(this.options.adcode),equirectangular:()=>this.options.projectionType==="equirectangular",mapBoundary:()=>this.options.mapBoundary,mergeSide:()=>this.options.mergeSide});C0(this,"initSettingsObj",{label:!1,labelLite:!1,shadowMap:!1});C0(this,"caId");C0(this,"shadowMapLight");C0(this,"planeShadow")}get mapObj(){return this.mapHistory[this.mapHistory.length-1]}get map(){var r;return(r=this.mapObj)==null?void 0:r.map}get mapInfo(){var r;return(r=this.mapObj)==null?void 0:r.mapInfo}get mapArea(){var r;return(r=this.map)==null?void 0:r.areaArr}get mapLine(){var r;return(r=this.map)==null?void 0:r.lineArr}get adcodes(){return this.mapHistory.map(r=>r.mapInfo.adcode)}setOptions(r){r.continentType;const d=fi(fi({0:worldExclATAJson,1e5:chinaJson},continentsJson),r==null?void 0:r.geojsonMap);let v=fi({0:worldExclATALiteJson,1e5:chinaLiteJson},continentsLiteJson);Object.keys(d).forEach(C=>{C!=="100000"&&/^\d{6}$/.test(C)&&d[+C].features.forEach(w=>{const fe=w.properties.adcode;v[fe]={type:"FeatureCollection",features:[w]}})}),v=fi(fi({},v),r==null?void 0:r.extrudeLineGeojsonMap),super.setOptions(Bi(fi({parentBg:!1,continents:"",continentsBg:!1,continentsBgDepth:0,parentBgDepth:0,parentBgTopSegments: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:2,lineOffset:0,extrudeLineWidth:6,extrudeLine:!0,equirectangular:!1,fahey:!1,projectionType:"mercator",polarAngle:r.style==="map2CityOnMap"?Math.PI/180*60:Math.PI/180*120,azimuthAngle:0,handleBackKeepCamvasState:!1,worldPacificCentre:!1,mapBoundary:!0,mergeSide:!1,bottomPlane:!1,bottomPlaneWater:!1,clipOutShow:!0,showBuilding:!0,buildingSideGradient:!1,showRoad:!0,cacheCity:!0,showGrassland:!0,showRiver:!0,setWaterMaterial:!1,showCityOnMapInnerLine:!1,greyFull:!1},r),{geojsonMap:d,extrudeLineGeojsonMap:v})),this.options.equirectangular&&(this.options.projectionType="equirectangular"),this.options.fahey&&(this.options.projectionType="fahey",this.pscale=100,this.pcenter=[0,0]),this.pencilConfig=PENCIL_CONFIG,(this.getAdcodeShowLevel(this.options.adcode)==="province"||this.getAdcodeShowLevel(this.options.adcode)==="country")&&(this.extendsOptions.clickHandleDrillDown=()=>this.options.clickHandleDrillDown,this.options.clickHandleDrillDown&&(this.workerOnce=!1,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.extendsOptions.parentBgTopSegments=()=>this.options.parentBgTopSegments),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$1(this):this.options.adcode===1e5?china(this):base$2(this)}handleSetting(r,d){return B0(this,null,function*(){return yield bn(gn.prototype,this,"handleSetting").call(this,r,d),r==="label"?d===!1?(this.eraseLabels(),this.options.showLabel=!1):(this.settings.labelLite=!1,yield this.settings.labelLite,this.options.showLabel=!0,yield this.drawLabels()):r==="labelLite"?d===!1?(this.eraseLabels(),this.options.showLabel=!1):(this.settings.label=!1,yield this.settings.label,this.options.showLabel="lite",yield this.drawLabels()):r==="shadowMap"&&(d===!1?this.shadowMapDisabled():yield this.shadowMapEnabled()),d})}init(){return B0(this,null,function*(){const{adcode:r}=this.options;this.options.center&&(this.pcenter=this.options.center),this.projection=m({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"+r}),this.group.object3d.name="地图",yield this.initMaterial(),yield this.initVis(r),this.options.clickHandleDrillDown&&(this.lead.handlePick(()=>this.mapArea||[],"down",({baseObject:d,mouseEvent:v})=>{(this.playing||v.metaKey||v.ctrlKey)&&this.handleClick(d)}),this.options.clickOusideBack&&this.lead.handlePick(()=>this.map?[this.map]:[],"downOutside",({mouseEvent:d})=>{(this.playing||d.metaKey||d.ctrlKey)&&this.handleClick()})),yield Promise.all(this.lead.objectsPromise)})}initCityVis(v){return B0(this,arguments,function*(r,d={clip:!1,grey:!1}){var fe;(fe=this.options.fixCity)!=null&&fe[r]&&(r=this.options.fixCity[r]);const C=this.options.center,_=this.options.jsonNameObj[r],w=new City({container:this.container,editor:!1,workerOnce:this.workerOnce});return w.setOptions({container:this.container,center:C,fitTo:!1,adcode:r,cacheKey:this.options.cacheCity?`${this.options.adcode}-${r}`:void 0,jsonName:_,grey:d.grey,greyFull:this.options.greyFull,clip:d.clip?this.map.options.geojson:void 0,clipOutShow:this.options.clipOutShow,planeOut:this.options.style==="map2CityOnMap",showBuilding:this.options.showBuilding,buildingSideGradient:this.options.buildingSideGradient,showRoad:this.options.showRoad,showGrassland:this.options.showGrassland,showRiver:this.options.showRiver,setWaterMaterial:this.options.setWaterMaterial,pencil2:this.pencil}),yield w.init(),this.cityVis=w,this.settings.mouseLeft=Ki.SCREEN_PAN,yield this.settings.mouseLeft,this.emit("initCityVis",r),w})}initCityOnMap(r){return B0(this,null,function*(){if(this.getAdcodeShowLevel(r)!=="city"){const C=findAdcodeInfo(r).parent;this.getAdcodeShowLevel(C)==="city"&&(yield this.initCityOnMap(C));return}const d=r===this.mapInfo.adcode||findAdcodeInfo(this.mapInfo.adcode).parent===r||findAdcodeInfo(r).parent===this.mapInfo.adcode,v=yield this.initCityVis(r,{clip:d,grey:!d});if(d){const C=this.mapObj.depth+1e-5;v.group.position.z=this.mapObj.z+C,v.outAreaGroup&&(v.outAreaGroup.position.z-=C/v.multiplyScalar)}else v.group.position.z=this.mapObj.z;this.pencil.camera.near=.001,this.pencil.camera.far=7,this.pencil.camera.updateProjectionMatrix()})}initVisBg(){return B0(this,null,function*(){let r=1e3,d=1e3;const v=new Vector3(0,0,0);if(this.options.parentBg){const C={projection:{center:this.pcenter,scale:this.pscale,rotate:[0,0],projectionType:this.options.projectionType},areaGroup:!1,depth:this.options.parentBgDepth},_=this.options.adcode!==1e5;if(_){const ke=this.mList.getMultiple("parentPlane"),ot=findAdcodeInfo(this.options.adcode).parent,xt=findAdcodeInfo(ot),ht=xt.b,{res:Fe}=yield this.getGeojson(ot),at=yield this.lead.draw("PlaneMap",fi({key:"bg-100000",geojson:Fe,bbox:ht,materialOptions:fi({},ke)},C),this.group);at.object3d.name=xt.name,at.lineArr.forEach(ct=>{ct.object3d.name="线",this.lead.updateBaseObjectKey(ct,"100000line"),this.initBaseObjectUserData(ct)}),at.areaArr.forEach(ct=>{ct.object3d.name="板块",this.lead.updateBaseObjectKey(ct,"100000area")}),at.position.z=-this.options.parentBgDepth,this.parentBg.push(at)}const w=this.mList.getMultiple("worldPlane"),fe=this.options.geojsonMap[0],ye=findAdcodeInfo(0).b,Le=yield this.lead.draw("PlaneMap",fi({key:"bg-0",geojson:Bi(fi({},fe),{features:[...fe.features.filter(ke=>_?ke.properties.iso_a3!=="CHN":!0)]}),bbox:ye,materialOptions:fi({},w)},C),this.group);Le.object3d.name="世界",Le.lineArr.forEach(ke=>{ke.object3d.name="线",this.lead.updateBaseObjectKey(ke,"worldline"),this.initBaseObjectUserData(ke)}),Le.areaArr.forEach(ke=>{ke.object3d.name="板块",this.lead.updateBaseObjectKey(ke,"worldarea")}),Le.position.z=-this.options.parentBgDepth,this.parentBg.push(Le);const{center:Re,size:Ne}=Le.getSize();r=Ne.x,d=Ne.y,v.set(Re.x,Re.y,0)}if(this.options.continentsBg){this.continentsBg=yield this.lead.draw("ContinentsBg",{depth:this.options.continentsBgDepth,scale:this.pscale},this.group);const C=this.getLocationPosition([104,37.5]);this.continentsBg.position.set(...C),this.continentsBg.position.z=.1}if(this.options.bottomPlane){const C=yield this.lead.draw("CityPlane",{width:r,height:d,color:"#0f1e57"},this.group);C.object3d.name="地图底面",this.lead.updateBaseObjectKey(C,"map-plane"),this.options.bottomPlaneWater&&C.addWater(),C.position.copy(v),C.position.z-=.1}})}initVis(r){return B0(this,null,function*(){var d;if(yield this.setAdcode({adcodes:[r],duration:0}),this.options.style!=="map2Base"&&this.options.style!=="map2CityOnMap"){const v=yield this.lead.draw("Light",{type:"SpotLight",color:this.options.worldPacificCentre?"#82d9f2":"#c1e6dd",intensity:3,distance:0,angle:this.options.continentsBg?1:.5,penumbra:1,decay:0}),C=this.pencil.cameraPositon,_=this.pencil.cameraTarget;v==null||v.spotLight.position.copy(C),v==null||v.spotLight.target.position.copy(_)}if(this.options.mapBoundary){const v=new Box3().setFromObject((d=this.map)==null?void 0:d.object3d);this.pencil.controls.setBoundary(v)}yield this.initVisBg()})}loaderAddBg(){this.options.bottomPlaneWater&&this.loader.add(["/image/water/normalMap0.jpg","/image/water/normalMap1.jpg"],{colorCorrection:!1})}initMaterialBg(){return B0(this,null,function*(){if(this.options.parentBg){const r=(()=>{const d=new MeshStandardMaterial({name:"世界顶面",emissive:"#081417",color:"#000000"}),v=new MeshBasicMaterial({name:"世界侧面",color:"#051714",side:DoubleSide}),C=new De({name:"世界线",color:new Color$1("#50766E"),sizeAttenuation:0,lineWidth:this.options.lineWidth});return{topMat:d,sideMat:v,lineMat:C}})();this.mList.addMultiple("worldPlane",r),this.options.adcode!==1e5&&(this.mList.copyMultiple("worldPlane","parentPlane"),Object.values(this.mList.getMultiple("parentPlane")).forEach(d=>{d.name=d.name.replace("世界","父级")}))}if(this.options.continentsBg){const r=(()=>{const d=new MeshStandardMaterial({name:"大洲板块顶面",emissive:"#154532"}),v=new MeshBasicMaterial({name:"大洲板块侧面",color:"#0c1528"}),C=new De({name:"大洲板块线",color:new Color$1("#09e6c1"),sizeAttenuation:0,lineWidth:this.options.lineWidth});return{topMat:d,sideMat:v,lineMat:C}})();this.mList.addMultiple("continents",r)}})}consoleMousePostion(){this.addListener(this.container,"click",r=>{var C,_;const d=this.unproject(r,this.mapObj.z+this.mapObj.depth),v=(_=(C=this.projection).invert)==null?void 0:_.call(C,[d.x,-d.y]);console.log("consoleMousePostion.postion",d),console.log("consoleMousePostion.lnglat",v)})}setAreaMaterialByProperty(r,d,v){if(!this.map)return;const C=this.map.areaArr.find(_=>_.userData[r]===d);if(C){if(v==="origin"){C.useMaterial("origin");return}const _=JSON.stringify(v);if(!C.materialList[_]){const w=C.object3d,fe=w.material[0].clone();v.color&&fe.color.set(v.color),v.emissive&&(fe.emissive.set(v.emissive),fe.emissiveIntensity=v.emissiveIntensity||1),C.setMaterialList(_,[fe,w.material[1]])}C.useMaterial(_)}}setLineMaterialByProperty(r,d,v){if(!this.map)return;const C=this.map.lineArr.find(_=>_.userData[r]===d);if(C){if(v==="origin"){C.useMaterial("origin");return}const _=JSON.stringify(v);if(!C.materialList[_]){const fe=C.object3d.material.clone();v.color&&fe.color.set(v.color),v.width&&(fe.lineWidth=v.width),C.setMaterialList(_,fe)}C.useMaterial(_)}}addAreaPlaneByProperty(r,d,v){return B0(this,null,function*(){if(!this.map)return;const _=this.map.options.geojson.features.find(w=>w.properties&&w.properties[r]===d);if(_){let w=v.material,fe=v.sideMaterial;if(f(v.sideMaterial)&&(fe=new MeshBasicMaterial(fi({},v.sideMaterial))),f(v.material)&&(w=new MeshBasicMaterial(fi({},v.material))),v.area){const Re=this.objectByUuid(v.area);Re&&([w,fe]=Re.material)}let ye=v.lineMaterial;if(f(v.lineMaterial)&&(ye=new De(fi({},v.lineMaterial))),v.line){const Re=this.objectByUuid(v.line);Re&&(ye=Re.material)}const Le=yield this.lead.draw("PlaneMap",{geojson:{type:"FeatureCollection",features:[_]},depth:v.depth||0,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:{topMat:w,lineMat:ye,sideMat:fe},areaGroup:!1},this.group);if(Le.position.z=this.mapObj.z+this.mapObj.depth+.01,v.lineBloom&&Le.lineArr.forEach(Re=>{Re.enableBloom()}),v.area){Le.position.z=0;const Re=this.baseObjectByUuid(v.area);Le.areaArr.forEach(Ne=>{Re!=null&&Re.isBloom&&Ne.enableBloom(),Ne.scale.z=Re.scale.z,Ne.position.z=Re.position.z})}if(v.line){const Re=this.baseObjectByUuid(v.line);Le.lineArr.forEach(Ne=>{Re!=null&&Re.isBloom&&Ne.enableBloom(),Ne.position.z=Re.position.z})}return Le}})}showAction(){return B0(this,null,function*(){bn(gn.prototype,this,"showAction").call(this),this.useSaveCamera(`map-${this.options.adcode}`);const r=this.lead.group;if(this.mapHistory[0]){const{stop:d,start:v}=sinusoidalInOut({onUpdate:C=>{if(!this.mapHistory[0]){d();return}r.position.z=-this.mapHistory[0].depth*(1-C)}});if(yield v(),this.mapHistory[0]){const C=this.pencil.cameraTarget.toArray();this.pencil.controls.setTarget(C[0],C[1],this.mapHistory[0].depth+this.mapHistory[0].z,!1)}this.saveCamvasState("controls",0)}})}hide(){return B0(this,null,function*(){if(!this.showState)return;const r=this.lead.group;yield sinusoidalInOut({onUpdate:d=>{r.position.z=-this.mapHistory[0].depth*d}}).start(),setTimeout(()=>{bn(gn.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 r=yield this.lead.draw("Light",{type:"SpotLight",color:"#c1e6dd",intensity:1,distance:0,angle:.5,penumbra:1,decay:0});this.lead.updateBaseObjectKey(r,"ShadowSpotLight"),this.shadowMapLight=r,r.object3d.position.set(.281,32.487,43.077),r.object3d.castShadow=!0;const d=yield this.lead.draw("PlaneShadow");this.planeShadow=d})}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(r){const d=this.getAdcodeShowLevel(r);let v=this.options.mapDepth;Array.isArray(v)||(v=new Array(3).fill(v));let C;return d==="country"?C=v[0]:d==="province"?C=v[1]:C=v[2],C}getDepth(r,d){let v=this.getOptionsDepth(r);if(this.options.depthReference){const C=this.options.depthReference,_=findAdcodeInfo(r).b;v=v*this.getReferenceScale(C,_)}else if(this.mapHistory.length){const C=findAdcodeInfo(this.mapHistory[0].mapInfo.adcode).b,_=this.getReferenceScale(C,d);v=v*_}return v}getReferenceScale(r,d){const v=Math.abs(d[3]-d[1])/Math.abs(r[3]-r[1]),C=Math.abs(d[2]-d[0])/Math.abs(r[2]-r[0]);return Math.max(v,C)}getAdcodeShowLevel(r,d=!0){var v;if((v=this.options.fixCity)!=null&&v[r]&&(r=this.options.fixCity[r]),r===0)return"world";if(r===1e5)return"country";if(/^\d{6}$/.test(`${r}`)){const{level:C,parent:_}=findAdcodeInfo(r),w=_&&findAdcodeInfo(_).level;return C==="district"&&w==="province"&&d?"city":C}else if(continentsType.find(C=>C.adcode===r))return"continent"}handleClick(r){const{drillDownRestrictions:d}=this.options;this.isAnimating||(r&&r.userData.adcode?this.getAdcodeShowLevel(r.userData.adcode,!1)!==d?this.showMap({adcode:r.userData.adcode}):this.emit("drilldownRestrictions",r.userData.adcode):!r&&this.mapHistory.length>1&&this.showMap({adcode:this.adcodes.at(-2)}))}beforeShowMap(r){return!0}getAdcodes(r){var C;const d=[];let v=r;for(;v&&(d.unshift(v),v!==this.options.adcode);)v=(C=findAdcodeInfo(v))==null?void 0:C.parent;return d}showMap(C){return B0(this,arguments,function*({adcode:r,adcodes:d,duration:v=1e3}){const _=d||this.getAdcodes(r);(yield this.beforeShowMap(_))!==!1&&(this.emit("beforeDrillDown",[..._]),yield this.setAdcode({adcodes:_,duration:v}),this.emit("afterDrillDown",[..._]))})}drawLabels(){return B0(this,null,function*(){var v;const r=this.options.showLabel;if(!((v=this.mapArea)!=null&&v.length)||!r)return;let d=this.lead.getObject("Group",{key:"mapLabel"});d||(d=yield this.lead.draw("Group",{key:"mapLabel"},this.group),d.object3d.name="地图标签组",yield Promise.all(this.mapArea.map(C=>B0(this,null,function*(){let{name:_,adcode:w,centroid:fe}=C.userData;const{DistrictID:ye,DistName:Le,iso_a2:Re,center:Ne}=C.userData;if(w=w||Re||ye,fe=fe||Ne,_=_||Le,!fe)return;const ke=this.getLocationPosition(fe);if(this.lead.getObject("Node",{key:`mapLabel-${w}`})||!ke)return;const[ot,xt,ht]=ke;let Fe=_;r==="lite"&&Fe&&(Fe=_.replace(/自治州|地区|自治区|省|市|壮族|特别行政区|回族|维吾尔/g,""));const at=Fe&&getLabelElement(Fe),ct=Fe!=null&&Fe.startsWith("澳门")?-1:0;yield this.lead.draw("Node",{position:new Vector3(ot,xt+ct,ht),children:at,key:`$p:-${this.options.adcode===0?_:w}`},d)}))))})}eraseLabels(){const r=this.lead.getObject("Group",{key:"mapLabel"});r==null||r.erase()}geAdcodePosition(r){var v;const d=(v=this.mapArea)==null?void 0:v.find(C=>C.userData.adcode===r);if(d){const{centroid:C,center:_}=d.userData;return this.getLocationPosition(C||_)}}getLocationPosition(r){const[d,v]=r,[C,_]=this.projection([d,v]);return[C,-_,this.mapObj?this.mapObj.z+this.mapObj.depth:0]}getAdcodeScreenPosition(r){const d=this.geAdcodePosition(r);if(d){const[v,C,_]=d,w=new Vector3(v,C,_);w.project(this.pencil.camera);const{width:fe,height:ye}=this.pencil.getSize(),Le=(w.x*.5+.5)*fe,Re=(w.y*-.5+.5)*ye;return{x:Le,y:Re}}}booleanPointInCn(r){return chinaLiteJson.features[0].geometry.coordinates.some(d=>turf.booleanPointInPolygon(turf.point(r),turf.polygon(d)))}getGeojson(r,d=!1){return B0(this,null,function*(){var v,C,_,w;return d?this.options.extrudeLine?(_=this.options.extrudeLineGeojsonMap)!=null&&_[r]?{res:(w=this.options.extrudeLineGeojsonMap)==null?void 0:w[r]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json-lite/${r}.json`):{res:void 0}:(v=this.options.geojsonMap)!=null&&v[r]?{res:(C=this.options.geojsonMap)==null?void 0:C[r]}:yield jsonFetch(`${this.options.assetsPrefix}/geojson/json/${r}.json`)})}handleDrillDown(w){return B0(this,arguments,function*({adcode:r,duration:d,handleLook:v,saveBackCamvasState:C,extrudelineBloom:_}){var fe,ye,Le,Re,Ne;if(typeof r!="undefined"&&!this.isAnimating){const ke=(fe=this.map)==null?void 0:fe.findGroup(r,!0),ot=findAdcodeInfo(+r);if(this.isAnimating||!ot)return;this.isAnimating=!0;const{name:xt}=ot;let{res:ht}=yield this.getGeojson(r),{res:Fe}=yield this.getGeojson(r,!0);if(!this.options.showDistrict&&this.getAdcodeShowLevel(r)==="city"&&(ht=Fe,Fe=void 0),[ht,Fe].filter(Boolean).forEach(ct=>{if(!ct.features[0].properties.adcode&&/^\d{6}$/.test(`${r}`)){const Gt=findAdcodeInfo(r);ct.features[0].properties=Bi(fi(fi({},ct.features[0].properties),Gt),{center:[Gt.lng,Gt.lat]})}}),ht){const ct=this.options.plateInCenter&&(this.mapHistory.length<1||this.options.drillDownPlateInCenter);if((ye=this.options.fixGeojson)!=null&&ye[r]){const Ut=(Le=this.options.fixGeojson)==null?void 0:Le[r];if(Ut.startsWith("-")){const a0=+Ut.slice(1);ht.features=ht.features.filter(g0=>g0.properties.adcode!==a0)}}let Gt=findAdcodeInfo(r).b;const Rt=[...Gt];this.mapHistory.length===1&&!this.options.drillDownSecondLevelMats?Gt=findAdcodeInfo(this.mapInfo.adcode).b:this.mapHistory.length===2&&!this.options.drillDownThirdLevelMats&&(this.options.drillDownSecondLevelMats?Gt=findAdcodeInfo(this.mapInfo.adcode).b:Gt=findAdcodeInfo(this.mapHistory[0].mapInfo.adcode).b),this.eraseLabels(),this.map&&(this.options.drillDownHideParent&&this.parentBg.forEach(Ut=>{Ut.hide()}),this.options.showOneLevel?this.map.hide():this.map.deactive(),C&&this.saveCamvasState("userControls",-1));const Wt=this.mapHistory.length,Pt=Wt-1,Nt=this.getDepth(r,Rt),Kt=(Re=this.mapHistory[Pt])==null?void 0:Re.depth,kt=Wt===0||this.options.showOneLevel?0:this.mapHistory[Pt].z+Kt,Yt=Wt===0||this.options.showOneLevel?0:kt-Nt,n0=turf.center(ht).geometry.coordinates,[o0,c0]=this.projection(n0),s0=yield this.drawPlaneMap({geojson:ht,extrudeLineGeojson:Fe,depth:Nt,bbox:Gt,adcode:r,extrudelineBloom:_});ke==null||ke.hide(),s0.position.setZ(Yt);const qt=s0.position.z,t0=()=>B0(this,null,function*(){yield sinusoidalInOut({onUpdate:Ut=>{kt!==qt&&(s0.position.z=qt+(kt-qt)*Ut)}}).start({duration:d})});if(ct)if(this.fixNear(r),s0.position.z=kt,v){const Ut=(Ne=this.mapHistory.at(-1))==null?void 0:Ne.controls;yield this.fitTo(s0,{z:kt+Nt,adcode:r,enableTransition:d!==0,polarAngle:Ut==null?void 0:Ut.polarAngle,azimuthAngle:Ut==null?void 0:Ut.azimuthAngle,handleStart:()=>B0(this,null,function*(){s0.position.z=qt,yield t0()})})}else this.options.showOneLevel&&s0.hide();else yield t0();this.mapHistory.push({map:s0,mapInfo:ot,z:kt,depth:Nt,cX:o0,cY:-c0}),v&&this.drawLabels(),this.saveCamvasState("controls",-1)}else console.log(`${xt}的地图数据不存在`);this.event.emit("handleDrillDown",{adcode:r,z:this.mapObj.z+this.mapObj.depth})}this.isAnimating=!1})}saveCamvasState(r,d){const v=this.mapHistory.at(d);v&&(v[r]={lookAt:[...this.pencil.cameraPositon.toArray(),...this.pencil.cameraTarget.toArray()],polarAngle:this.pencil.controls.polarAngle,azimuthAngle:this.pencil.controls.azimuthAngle})}fixNear(r){const d=this.getAdcodeShowLevel(r);r===0?(this.pencil.camera.near=1,this.pencil.camera.far=1e3,this.pencil.camera.updateProjectionMatrix()):(d==="country"||d==="province")&&this.pencil.camera.near!==this.pencilConfig.camera.near*10?(this.pencil.camera.near=this.pencilConfig.camera.near*10,this.pencil.camera.updateProjectionMatrix()):(d==="city"||d==="district")&&this.pencil.camera.near!==this.pencilConfig.camera.near&&(this.pencil.camera.near=this.pencilConfig.camera.near,this.pencil.camera.updateProjectionMatrix())}fitTo(ye){return B0(this,arguments,function*(r,{polarAngle:d,azimuthAngle:v,z:C,handleStart:_,adcode:w,enableTransition:fe=!0}={}){if(!(r!=null&&r.object3d))return;if(w&&(yield this.useSaveCamera(`map-${w}`,fe))){_&&(yield _());return}const Le=this.options.mapPadding,{height:Re,width:Ne}=this.pencil.getSize();Re<Le[0]+Le[2]+50&&(Le[0]=0,Le[2]=0),Ne<Le[1]+Le[3]+50&&(Le[1]=0,Le[3]=0);const ke=d!=null?d:this.options.polarAngle,ot=v!=null?v:this.options.azimuthAngle,xt=this.pencil.cameraPositon.toArray(),ht=this.pencil.cameraTarget.toArray();yield this.paddingInCssPixel(r,Le[0],Le[1],Le[2],Le[3],!1);let Fe;C&&(Fe=this.pencil.cameraTarget.toArray(),yield this.pencil.controls.setTarget(Fe[0],Fe[1],C,!1)),yield this.pencil.controls.rotateTo(ot,ke,!1),Fe=this.pencil.cameraTarget.toArray();const at=this.pencil.cameraPositon.toArray();yield this.lookAt(...xt,...ht),yield Promise.all([this.lookAt(...at,...Fe,fe),_==null?void 0:_()].filter(Boolean))})}drawPlaneMap(fe){return B0(this,arguments,function*({geojson:r,extrudeLineGeojson:d,bbox:v,depth:C,extrudelineBloom:_,adcode:w}){var at;const ye=[this.mList.getMultiple("plane"),this.mList.getMultiple("secondPlane"),this.mList.getMultiple("thirdPlane")];let Le=this.mapHistory.length,Re=null;for(;Re===null;)Re=ye[Le],Le--;const Ne=this.mList.getMultiple("bgPlane"),ke=fi(fi({},Re),Ne?{bgTopMat:Ne.topMat,bgSideMat:Ne.sideMat,bgLineMat:Ne.lineMat,bgExtrudeLineMat:Ne.extrudeLineMat}:{});let ot=r,xt=d,ht=!1;this.options.style==="map2CityOnMap"&&d&&(ot=d,this.options.showCityOnMapInnerLine?(xt=r,ht=!0):xt=void 0);const Fe=yield this.lead.draw("PlaneMap",{key:`${w}`,geojson:ot,extrudeLineGeojson:xt,depth:C,projection:{center:this.pcenter,scale:this.pscale,rotate:this.options.worldPacificCentre?[-160,0]:void 0,projectionType:this.options.projectionType},materialOptions:ke,bbox:v,topSegments:this.options.topSegments,lineOffset:this.options.lineOffset,mergeSide:this.options.mergeSide},this.group);return Fe.object3d.name=((at=findAdcodeInfo(w))==null?void 0:at.name)||`${w}`,this.options.style==="map2CityOnMap"&&(Fe.lineArr.forEach(ct=>{this.initBaseObjectUserData(ct),ct.object3d.name="板块边框",this.mList.setUserData("plane#lineMat",{selectHide:!0}),this.lead.updateBaseObjectKey(ct,"plane#lineMat")}),this.options.showCityOnMapInnerLine||this.mList.setUserData("plane#extrudeLine",{selectHide:!0})),Fe.extrudelineArr&&Fe.extrudelineArr.forEach(ct=>{ct.object3d.name=ht?"板块内线":"板块边线",this.lead.updateBaseObjectKey(ct,"extrudeLine"),this.initBaseObjectUserData(ct),_&&(ct.object3d.userData.bloom=!0)}),Fe})}handleBack(){return B0(this,arguments,function*({duration:r=1e3,handleLookBack:d=!0,keepOne:v=!0}={}){if(this.isAnimating||(v?this.mapHistory.length<=1:this.mapHistory.length===0))return;this.isAnimating=!0;const C=this.mapHistory.pop();if(!this.options.drillDownPlateInCenter){const _=C.map.position.z,w=this.mapObj?this.mapObj.z+(this.mapObj.depth-C.depth):0;yield sinusoidalInOut({onUpdate:fe=>{C.map.position.z=_+(w-_)*fe}}).start({duration:r})}if(this.lead.eraseWithoutMaterial(C.map),this.eraseLabels(),this.mapObj){const{map:_}=this.mapObj,w=_==null?void 0:_.findGroup(C.mapInfo.adcode,!0);w&&w.show(),_&&d&&(this.options.showOneLevel?_.show():_.active(),this.options.drillDownHideParent&&this.parentBg.forEach(fe=>{fe.show()}),yield this.handleLookBack(r),this.drawLabels())}this.emit("handleBack",{adcodes:this.adcodes}),this.isAnimating=!1})}handleLookBack(r){return B0(this,null,function*(){const{userControls:d,controls:v}=this.mapObj;yield this.pencil.controls.setLookAt(...d?d.lookAt:v.lookAt,r!==0)})}compareLocations(r,d){const v=r.filter(fe=>fe),C=d.filter(fe=>fe),_=[];let w=0;for(let fe=0;fe<Math.min(v.length,C.length)&&v[fe]===C[fe];fe++)w++;for(let fe=w;fe<v.length;fe++)_.push(-1);for(let fe=w;fe<C.length;fe++)_.push(C[fe]);return _}setAdcode(v){return B0(this,arguments,function*({adcodes:r,duration:d}){var _,w,fe;const{adcodes:C}=this;if(!(JSON.stringify(r)===JSON.stringify(C)||this.isAnimating))if(JSON.stringify(r)===JSON.stringify([0]))try{yield this.handleDrillDown({adcode:0,duration:d,handleLook:!0})}catch(ke){console.error(ke)}else{const{continent:ke,country:ot,province:xt,city:ht,district:Fe}=r.reduce((kt,Yt)=>{const n0=this.getAdcodeShowLevel(Yt);return kt[n0]=Yt,kt},{}),{continent:at,country:ct,province:Gt,city:Rt,district:Wt}=C.reduce((kt,Yt)=>{const n0=this.getAdcodeShowLevel(Yt);return kt[n0]=Yt,kt},{}),Pt=ke||at,Nt=(fe=(w=(_=this.map)==null?void 0:_.extrudelineArr)==null?void 0:w[0])==null?void 0:fe.object3d.userData.bloom,Kt=this.compareLocations([at,ct,Gt,Rt,Wt],[ke,ot,xt,ht,Fe]);try{for(var ye=Pn(Kt.entries()),Le,Re,Ne;Le=!(Re=yield ye.next()).done;Le=!1){const[kt,Yt]=Re.value;const n0=kt===Kt.length-1?d:0,o0=kt===Kt.length-1;Yt===-1?yield this.handleBack({duration:n0,handleLookBack:o0,keepOne:!Pt}):yield this.handleDrillDown({adcode:Yt,duration:n0,handleLook:o0,saveBackCamvasState:Kt.includes(-1)?!1:this.options.handleBackKeepCamvasState,extrudelineBloom:Nt})}}catch(Re){Ne=[Re]}finally{try{Le&&(Re=ye.return)&&(yield Re.call(ye))}finally{if(Ne)throw Ne[0]}}}})}setPadding(r,d=!1,v=!1){this.options.mapPadding=[...r],d&&this.fitTo(this.map,{enableTransition:v})}dispose(){var r,d,v;(r=this.cityVis)==null||r.dispose(),(d=this.map)==null||d.dispose(),this.parentBg.forEach(C=>{C.dispose()}),this.parentBg.length=0,(v=this.continentsBg)==null||v.dispose(),this.continentsBg=void 0,this.mapHistory.length=0,super.dispose()}};C0(gn,"VisName","map");let index$1=gn;class Earth extends Sphere{constructor(r){super();C0(this,"options");this.options=fi({radius:30,rotationY:0},r)}create(){const d=this.pencil.installPlugins.get("materialList").get("earthMaterial");this.material=d,super.create(),this.rotation.y=this.options.rotationY,this.object3d.name="地球"}}class Countries extends ee$1{constructor(r){super();C0(this,"options");C0(this,"areaArr",[]);C0(this,"lineArr",[]);this.options=fi({start:30,depth:1.4,lineOffset:.01,hasTop:!0,hasSide:!0,hasLine:!0,lineDuration:1e3,areaGroup:!0},r)}create(){return B0(this,null,function*(){const{geojson:r,mats:d,hasSide:v,lineOffset:C,areaGroup:_}=this.options;this.createGroup();const w=this.pencil.getPlugin("worker"),fe=this.pencil.lead,{borderMat:ye,topMat:Le,outLine:Re}=d;let Ne=r.features.map(xt=>{const{type:ht,coordinates:Fe}=xt.geometry;let at=[];return ht==="Polygon"?at=Fe:ht==="MultiPolygon"&&(at=Fe.flat()),{coords:at,properties:xt.properties}});const ke=this.options.hasTop||this.options.hasSide,ot=this.options.hasLine;_||(Ne=[{coords:Ne.map(({coords:xt})=>xt).flat(),properties:{}}]),yield Promise.all(Ne.map(xt=>[ke&&w.geoGeometry("conicPolygon",{mesaage:{start:[this.options.start],depth:[this.options.depth],useGroups:2,hasBottom:!1,topFirst:!0,coordinatesArr:xt.coords,bbox:this.options.bbox,hasSide:v},cb:ht=>B0(this,null,function*(){var at,ct;const Fe=yield fe.draw("ConicPolygon",{geometry:ht,material:v?[Le,ye]:Le,hasSide:v},this);Fe.object3d.name=(at=xt.properties)!=null&&at.name?((ct=xt.properties)==null?void 0:ct.name)+"-板块":"板块",Fe.userData=fi({},xt.properties),this.areaArr.push(Fe)})}),ot&&w.geoGeometry("conicLine",{mesaage:{start:[this.options.start+this.options.depth+C],lineWidth:[1],coordinatesArr:xt.coords},cb:ht=>B0(this,null,function*(){var at;const Fe=yield fe.draw("Line",{geometry:ht,material:Re,onTop:2},this);Fe.object3d.name=(at=xt.properties)!=null&&at.name?xt.properties.name+"-线":"线",Fe.userData=fi({},xt.properties),this.lineArr.push(Fe)})})].filter(Boolean)).flat())})}}class SphereShadow extends ee$1{constructor(r){super();C0(this,"options");this.options=fi({radius:30},r)}create(){return B0(this,null,function*(){const r=new SphereGeometry(this.options.radius,128,90),d=new MeshBasicMaterial;this.createMesh(r,d),this.scale.multiplyScalar(1.001),this.rotation.y=Math.PI/180*-90,this.object3d.name="阴影面",this.hide()})}}const objs=Bi(fi({},objs$3),{Earth,Countries,SphereShadow}),base=g=>{g.loaderAdd=function(){const{loader:t}=this;t.add(["/image/earth2/basic.jpg"]),t.add(["/image/earth2/NormalMap.jpg"],{colorCorrection:!1})},g.initMaterial=function(){return B0(this,null,function*(){const t=this.loader,r=t.getAsset("/image/earth2/basic.jpg"),d=t.getAsset("/image/earth2/NormalMap.jpg"),v=new MeshStandardMaterial({name:"地球材质",map:r,metalness:.1,roughness:.8,normalMap:d,normalScale:new Vector2(.5,.5)});this.mList.add("earthMaterial",v)})},g.initVis=function(){return B0(this,null,function*(){g.pencil.camera.near=1,g.pencil.camera.far=3e3,g.pencil.camera.fov=12,g.pencil.camera.updateProjectionMatrix();const[t,r]=yield Promise.all([this.lead.draw("Light",{type:"PointLight",intensity:4,color:16777215,distance:0,decay:0}),this.lead.draw("Earth",{radius:100,rotationY:Math.PI/180*90})]);yield this.pencil.controls.fitToBox(r.object3d,!1),t.position.copy(this.pencil.cameraPositon)})}},chinaPlate=g=>{g.extendsOptions=Bi(fi({},g.extendsOptions),{copyChinaPlane:g.options.copyChinaPlane}),g.loaderAdd=function(){const{loader:t}=this;t.add(["/image/earth/basic.webp","/image/earth/chinaBorder.png","/image/earth/flyline.png"]),t.add(["/image/earth/chinaNormal.webp"],{colorCorrection:!1})},g.initVis=function(){return B0(this,null,function*(){yield this.initLight();const[,t,r,d]=yield Promise.all([this.lead.draw("Earth",{radius:this.options.radius,rotationY:Math.PI/180*-90}),this.lead.draw("Countries",{geojson:{type:"FeatureCollection",features:worldJson.features.filter(v=>{var C;return((C=v.properties)==null?void 0:C.name)!=="中国"})},depth:0,start:this.options.radius,mats:this.mList.getMultiple("world"),hasSide:!1,hasTop:!1,areaGroup:!1}),this.lead.draw("Countries",{geojson:chinaLiteJson,depth:0,start:this.options.radius+this.options.mapDepth,mats:this.mList.getMultiple("china"),hasSide:!1,hasTop:!1}),this.lead.draw("Countries",{geojson:chinaJson,depth:this.options.mapDepth,start:this.options.radius,mats:this.mList.getMultiple("plane"),bbox:chinaBbox,lineDuration:6e3})]);if(t.object3d.name="世界",r.object3d.name="中国边界",d.object3d.name="中国",this.map=d,this.options.copyChinaPlane){this.options.copyChinaPlane;const v=yield this.lead.draw("Countries",{geojson:chinaJson,depth:this.options.mapDepth,start:this.options.radius,mats:{topMat:new MeshBasicMaterial({color:"#ffffff"})},bbox:chinaBbox,hasSide:!1,hasTop:!0,hasLine:!1,areaGroup:!1});v.object3d.name="复制中国顶面",this.lead.updateBaseObjectKey(v.children[0],"chinaPlaneCopy")}yield this.pencil.controls.rotateTo(1.833542196136704,.9809685394021701,!1),yield this.pencil.controls.dollyTo(99.11560932366835,!1)})},g.initMaterial=function(){return B0(this,null,function*(){const t=this.loader,r=new MeshStandardMaterial({side:DoubleSide,name:"顶面",color:new Color$1("#0d8a8c"),metalness:.75,roughness:.61,normalMap:t.getAsset("/image/earth/chinaNormal.webp")}),d=new MeshStandardMaterial({side:DoubleSide,name:"侧面",color:new Color$1("#999999"),map:t.getAsset("/image/earth/chinaBorder.png")}),v=new De({name:"中国边界",lineWidth:2,sizeAttenuation:0,color:new Color$1("#59C8FF")}),C=new De({name:"世界边界",lineWidth:2,sizeAttenuation:0,color:new Color$1("#80abaf")}),_=t.getAsset("/image/earth/basic.webp"),w=new MeshStandardMaterial({name:"地球材质",map:_,color:new Color$1(2397309),metalness:.84,roughness:.51}),fe=t.getAsset("/image/earth/flyline.png");fe.wrapS=RepeatWrapping,fe.wrapT=RepeatWrapping,fe.repeat.set(.5,.5);const ye=new De({name:"省份边界",map:fe,useMap:1,lineWidth:2,sizeAttenuation:0,transparent:!0,color:new Color$1("#3a898b")});this.mList.addMultiple("plane",{topMat:r,borderMat:d,outLine:ye}),this.mList.addMultiple("world",{outLine:C}),this.mList.addMultiple("china",{outLine:v}),this.mList.add("earthMaterial",w)})}},countryPlate=g=>{g.initVis=function(){return B0(this,null,function*(){yield this.initLight();const[,t]=yield Promise.all([this.lead.draw("Earth",{radius:this.options.radius,rotationY:Math.PI/180*-90}),this.lead.draw("Countries",{geojson:worldJson,depth:this.options.mapDepth,start:this.options.radius,mats:this.mList.getMultiple("plane"),bbox:[-180,-90,180,90],lineOffset:.14}),this.lead.draw("SphereShadow",{radius:this.options.radius})]);this.map=t,yield this.pencil.controls.rotateTo(1.8041576242193995,1.2232045720480524,!1),yield this.pencil.controls.dollyTo(99.11560932366835,!1),this.playing&&(this.pencil.controls.minPolarAngle=this.pencil.controls.polarAngle,this.pencil.controls.maxPolarAngle=this.pencil.controls.polarAngle)})},g.initMaterial=function(){return B0(this,null,function*(){const t=new MeshStandardMaterial({side:DoubleSide,name:"侧面",color:new Color$1("#999999")}),r=new MeshStandardMaterial({name:"顶面",color:new Color$1("#ffffff"),emissive:new Color$1("#523333")}),d=new De({name:"边框线",lineWidth:4,sizeAttenuation:0,color:new Color$1("#006aa3")}),v=new MeshBasicMaterial({name:"地球材质",color:new Color$1("#012b47")});this.mList.addMultiple("plane",{topMat:r,borderMat:t,outLine:d}),this.mList.add("earthMaterial",v)})},g.getLocationPosition=function(t,r=0){const[d,v]=t,C=this.options.mapDepth+this.options.radius+r;return i$1(d,v,C)}},styles=Object.freeze(Object.defineProperty({__proto__:null,base,chinaPlate,countryPlate},Symbol.toStringTag,{value:"Module"})),_n=class _n extends Base{constructor(){super(...arguments);C0(this,"leadObjs",objs);C0(this,"leftTruck",!1);C0(this,"extendsOptions",{mapDepth:()=>this.options.mapDepth});C0(this,"map");C0(this,"autoRotateSpeed",0)}get mapArea(){return this.map.areaArr}setOptions(r){super.setOptions(fi({mapDepth:1.4,radius:30,style:"chinaPlate",copyChinaPlane:!1},r)),this.initSettingsObj={autoRotate:!1},styles[this.options.style](this)}handleSetting(r,d){return B0(this,null,function*(){return yield bn(_n.prototype,this,"handleSetting").call(this,r,d),r==="autoRotate"&&this.playing&&(d?this.autoRotateSpeed=-20:this.autoRotateSpeed=0,this.pencil.autoRotate(this.autoRotateSpeed)),d})}show(){super.show(),this.animationIn()}animationIn(){const r=this.pencil.controls;r.addEventListener("controlstart",()=>{this.pencil.autoRotate(0)}),r.addEventListener("controlend",()=>{this.pencil.autoRotate(this.autoRotateSpeed)})}initLight(){return B0(this,null,function*(){const[r,d]=yield Promise.all([this.lead.draw("Light",{type:"RectAreaLight",color:"#E0FFFD",width:200,height:200}),this.lead.draw("Light",{type:"RectAreaLight",intensity:3,width:200,height:170})]);r.position.set(0,50,-100),d.position.set(0,0,150),r.object3d.lookAt(0,0,0),d.object3d.lookAt(0,0,0),this.lead.updateBaseObjectKey(r,"RectAreaLight_1"),this.lead.updateBaseObjectKey(d,"RectAreaLight_2")})}getLocationPosition(r,d=0){const[v,C]=r,_=this.getRadius()+d;return i$1(v,C,_)}setAreaMaterialByProperty(r,d,v){if(!this.map)return;const C=this.map.areaArr.find(_=>_.userData[r]===d);if(C){if(v==="origin"){C.useMaterial("origin");return}const _=JSON.stringify(v);if(!C.materialList[_]){const w=C.object3d,fe=w.material[0].clone();v.color&&fe.color.set(v.color),v.emissive&&(fe.emissive.set(v.emissive),fe.emissiveIntensity=v.emissiveIntensity||1),C.setMaterialList(_,[fe,w.material[1]])}C.useMaterial(_)}}setLineMaterialByProperty(r,d,v){if(!this.map)return;const C=this.map.lineArr.find(_=>_.userData[r]===d);if(C){if(v==="origin"){C.useMaterial("origin");return}const _=JSON.stringify(v);if(!C.materialList[_]){const fe=C.object3d.material.clone();v.color&&fe.color.set(v.color),v.width&&(fe.lineWidth=v.width),C.setMaterialList(_,fe)}C.useMaterial(_)}}addAreaPlaneByProperty(r,d,v){return B0(this,null,function*(){if(!this.map)return;const _=this.map.options.geojson.features.find(w=>w.properties&&w.properties[r]===d);if(_)return this.lead.draw("Countries",{geojson:{type:"FeatureCollection",features:[_]},depth:this.options.mapDepth+.3,start:this.options.radius,mats:{topMat:new MeshBasicMaterial(v.area),outLine:new De(v.line)}})})}getRadius(){const r=this.baseObjectByUuid("earth");return r?r.object3d.geometry.parameters.radius:0}checkBehindEarth(r,d){const v=new Vector3(0,0,0),C=new Vector3(0,0,0),_=this.getRadius(),w=()=>{const fe=r();if(!fe.length)return;this.pencil.controls.getPosition(C,!1);const ye=v.clone().sub(C),Le=Math.sqrt(Math.pow(ye.length(),2)-Math.pow(_,2)),Re=fe.map(Ne=>Ne.position.clone().sub(C).length()>Le);d(fe,Re)};w(),this.pencil.controls.addEventListener("update",()=>{w()})}};C0(_n,"VisName","earth");let index=_n;const ec=(g,t)=>{const r=stringToUtf8ByteArray(g),d=stringToUtf8ByteArray(t).map(function(v,C){return v^r[Math.floor(C%r.length)]}).join(",");return btoa(d)};function stringToUtf8ByteArray(g){const t=[];let r=0;for(let d=0;d<g.length;d++){let v=g.charCodeAt(d);v<128?t[r++]=v:v<2048?(t[r++]=v>>6|192,t[r++]=v&63|128):(v&64512)==55296&&d+1<g.length&&(g.charCodeAt(d+1)&64512)==56320?(v=65536+((v&1023)<<10)+(g.charCodeAt(++d)&1023),t[r++]=v>>18|240,t[r++]=v>>12&63|128,t[r++]=v>>6&63|128,t[r++]=v&63|128):(t[r++]=v>>12|224,t[r++]=v>>6&63|128,t[r++]=v&63|128)}return t}let b="/";b==="/"&&(b="");const getMapConfig=(d,...v)=>B0(exports,[d,...v],function*(g,t=b,r){if(g===0)return{mapDepth:5,adcode:0,extrudeLine:!1,worldPacificCentre:!0,center:[0,0]};{const C=findAdcodeInfo(g);return extendMapConfig({center:[C.lng,C.lat],adcode:C.adcode},t,r)}}),getMapWithCityConfig=(d,...v)=>B0(exports,[d,...v],function*(g,t=b,r){const C=findAdcodeInfo(g);return extendMapConfig({center:[C.lng,C.lat],adcode:C.adcode,style:"map2CityOnMap",mapDepth:.004},t,r)}),extendMapConfig=(d,...v)=>B0(exports,[d,...v],function*(g,t=b,r){var C,_;if(g.adcode!==0&&g.adcode!==1e5){const w=(C=g.fixGeojson)==null?void 0:C[g.adcode],fe=(_=g.fixGeojson)==null?void 0:_[g.adcode+"-lite"];let{res:ye}=yield jsonFetch(t+`/geojson/${w||"json"}/${g.adcode}.json`);const{res:Le}=yield jsonFetch(t+`/geojson/${fe||"json-lite"}/${g.adcode}.json`),Re=g.adcode,Ne=Bi(fi({},g),{geojsonMap:{[Re]:ye},extrudeLineGeojsonMap:{[Re]:Le},cityBboxMap:{},jsonNameObj:{},depthReference:void 0});if(g.style==="map2CityOnMap"){if(!(findAdcodeInfo(Re).level==="province")){let ot=findAdcodeInfo(Re).parent;for(;findAdcodeInfo(ot).level!=="province";)ot=findAdcodeInfo(ot).parent;const{res:xt}=yield jsonFetch(t+`/geojson/${w||"json"}/${ot}.json`);ye=xt}ye.features.forEach(ot=>{Ne.jsonNameObj[ot.properties.adcode]=ec(ot.properties.name,`${ot.properties.adcode}`)})}if(g.parentBg){const ke=findAdcodeInfo(Re).parent;if(ke!==1e5){const{res:ot}=yield jsonFetch(t+`/geojson/json/${ke}.json`),{res:xt}=yield jsonFetch(t+`/geojson/json-lite/${ke}.json`);Ne.geojsonMap[ke]=ot,Ne.extrudeLineGeojsonMap[ke]=xt}}return r&&(Ne.depthReference=r.depthReference||findAdcodeInfo(r.adcode).b),Ne}return fi({},g)}),getCityConfig=(r,...d)=>B0(exports,[r,...d],function*(g,t=b){const v=findAdcodeInfo(g),{name:C}=v;return{center:[v.lng,v.lat],adcode:v.adcode,jsonName:ec(C,`${g}`)}}),removeCameraHistory=g=>g.filter(t=>!(t.objectUuid==="camera"&&["SetPosition","SetTarget"].includes(t.type))),access={set token(g){accessToken.token=g}},VERSION=version;exports.Base=Base;exports.City=City$1;exports.Earth=index;exports.Map=index$1;exports.THREE=THREE;exports.TWEEN=tween_esm;exports.VERSION=VERSION;exports.access=access;exports.animationUtils=animation;exports.extendMapConfig=extendMapConfig;exports.getCityConfig=getCityConfig;exports.getMapConfig=getMapConfig;exports.getMapWithCityConfig=getMapWithCityConfig;exports.removeCameraHistory=removeCameraHistory;
|
package/dist/index.module.js
CHANGED
|
@@ -88,7 +88,7 @@ const publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRz
|
|
|
88
88
|
).toString(CryptoJS.enc.Utf8), Ne = JSON.parse(Re), ke = Date.now();
|
|
89
89
|
return !Ne.s || Ne.s > ke ? (this.token = void 0, "") : Ne.e && Ne.e < ke ? (this.token = void 0, "") : (Ne.isValid = ye, Ne);
|
|
90
90
|
}
|
|
91
|
-
}, version = "0.27.
|
|
91
|
+
}, version = "0.27.3";
|
|
92
92
|
/**
|
|
93
93
|
* @license
|
|
94
94
|
* Copyright 2010-2025 Three.js Authors
|
|
@@ -141426,7 +141426,17 @@ const objs$1 = Bi(fi({}, objs$3), {
|
|
|
141426
141426
|
(w) => w.properties && w.properties[r] === d
|
|
141427
141427
|
);
|
|
141428
141428
|
if (_) {
|
|
141429
|
-
|
|
141429
|
+
let w = v.material, fe = v.sideMaterial;
|
|
141430
|
+
if (f(v.sideMaterial) && (fe = new MeshBasicMaterial(fi({}, v.sideMaterial))), f(v.material) && (w = new MeshBasicMaterial(fi({}, v.material))), v.area) {
|
|
141431
|
+
const Re = this.objectByUuid(v.area);
|
|
141432
|
+
Re && ([w, fe] = Re.material);
|
|
141433
|
+
}
|
|
141434
|
+
let ye = v.lineMaterial;
|
|
141435
|
+
if (f(v.lineMaterial) && (ye = new De(fi({}, v.lineMaterial))), v.line) {
|
|
141436
|
+
const Re = this.objectByUuid(v.line);
|
|
141437
|
+
Re && (ye = Re.material);
|
|
141438
|
+
}
|
|
141439
|
+
const Le = yield this.lead.draw(
|
|
141430
141440
|
"PlaneMap",
|
|
141431
141441
|
{
|
|
141432
141442
|
geojson: {
|
|
@@ -141442,16 +141452,29 @@ const objs$1 = Bi(fi({}, objs$3), {
|
|
|
141442
141452
|
},
|
|
141443
141453
|
materialOptions: {
|
|
141444
141454
|
topMat: w,
|
|
141445
|
-
lineMat:
|
|
141446
|
-
sideMat:
|
|
141455
|
+
lineMat: ye,
|
|
141456
|
+
sideMat: fe
|
|
141447
141457
|
},
|
|
141448
141458
|
areaGroup: !1
|
|
141449
141459
|
},
|
|
141450
141460
|
this.group
|
|
141451
141461
|
);
|
|
141452
|
-
|
|
141453
|
-
|
|
141454
|
-
}),
|
|
141462
|
+
if (Le.position.z = this.mapObj.z + this.mapObj.depth + 0.01, v.lineBloom && Le.lineArr.forEach((Re) => {
|
|
141463
|
+
Re.enableBloom();
|
|
141464
|
+
}), v.area) {
|
|
141465
|
+
Le.position.z = 0;
|
|
141466
|
+
const Re = this.baseObjectByUuid(v.area);
|
|
141467
|
+
Le.areaArr.forEach((Ne) => {
|
|
141468
|
+
Re != null && Re.isBloom && Ne.enableBloom(), Ne.scale.z = Re.scale.z, Ne.position.z = Re.position.z;
|
|
141469
|
+
});
|
|
141470
|
+
}
|
|
141471
|
+
if (v.line) {
|
|
141472
|
+
const Re = this.baseObjectByUuid(v.line);
|
|
141473
|
+
Le.lineArr.forEach((Ne) => {
|
|
141474
|
+
Re != null && Re.isBloom && Ne.enableBloom(), Ne.position.z = Re.position.z;
|
|
141475
|
+
});
|
|
141476
|
+
}
|
|
141477
|
+
return Le;
|
|
141455
141478
|
}
|
|
141456
141479
|
});
|
|
141457
141480
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.27.
|
|
1
|
+
declare const _default: "0.27.3";
|
|
2
2
|
export default _default;
|
package/dist/vis/map/index.d.ts
CHANGED
|
@@ -190,12 +190,14 @@ export default class extends Base {
|
|
|
190
190
|
width?: number;
|
|
191
191
|
} | 'origin'): void;
|
|
192
192
|
addAreaPlaneByProperty(key: string, value: any, options: {
|
|
193
|
-
material
|
|
194
|
-
lineMaterial
|
|
193
|
+
material?: ConstructorParameters<typeof THREE.MeshBasicMaterial>[0];
|
|
194
|
+
lineMaterial?: ConstructorParameters<typeof MeshLineMaterial>[0];
|
|
195
195
|
sideMaterial?: ConstructorParameters<typeof THREE.MeshBasicMaterial>[0];
|
|
196
196
|
depth?: number;
|
|
197
197
|
lineBloom?: boolean;
|
|
198
198
|
topSegments?: number;
|
|
199
|
+
area?: string;
|
|
200
|
+
line?: string;
|
|
199
201
|
}): Promise<PlaneMap | undefined>;
|
|
200
202
|
caId: string | number | undefined;
|
|
201
203
|
showAction(): Promise<void>;
|