chbim-plugins 0.0.150 → 0.0.151

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/chbim-plugins.js CHANGED
@@ -24451,7 +24451,7 @@ class y1 {
24451
24451
  ["MultiPolygon"]
24452
24452
  ]), this.avoidanceArr = [], this.editDate = {
24453
24453
  id: ""
24454
- }, this.isDynamicMasking = s) : console.error("未引入指定插件");
24454
+ }, this.isDynamicMasking = s, this.disabled = !1) : console.error("未引入指定插件");
24455
24455
  }
24456
24456
  /**
24457
24457
  * 移除矢量数据
@@ -24601,6 +24601,8 @@ class y1 {
24601
24601
  break;
24602
24602
  }
24603
24603
  m ? window.mapClone.mapEx.addLayer(Pe) : window.map.addLayer(Pe), Pe.bindPopup((Wt) => {
24604
+ if (this.disabled == !0)
24605
+ return !1;
24604
24606
  let $e = '<div class="bim-map-popup">';
24605
24607
  return Object.keys(Wt.graphic.attr).forEach((Mi, Oe) => {
24606
24608
  Wt.graphic.attr[Mi] && ($e += `<p><b>${Mi}</b> : ${Wt.graphic.attr[Mi]}</p>`);
@@ -2637,7 +2637,7 @@ __p += '`),Ui&&(de+=`' +
2637
2637
  function print() { __p += __j.call(arguments, '') }
2638
2638
  `:`;
2639
2639
  `)+de+`return __p
2640
- }`;var Mi=Np(function(){return Fi(ut,Je+"return "+de).apply(s,yt)});if(Mi.source=de,cf(Mi))throw Mi;return Mi}function P_(r){return Zi(r).toLowerCase()}function L_(r){return Zi(r).toUpperCase()}function R_(r,h,v){if(r=Zi(r),r&&(v||h===s))return ya(r);if(!r||!(h=Ye(h)))return r;var O=ar(r),Y=ar(h),ut=ts(O,Y),yt=bs(O,Y)+1;return xn(O,ut,yt).join("")}function O_(r,h,v){if(r=Zi(r),r&&(v||h===s))return r.slice(0,_a(r)+1);if(!r||!(h=Ye(h)))return r;var O=ar(r),Y=bs(O,ar(h))+1;return xn(O,0,Y).join("")}function I_(r,h,v){if(r=Zi(r),r&&(v||h===s))return r.replace(lo,"");if(!r||!(h=Ye(h)))return r;var O=ar(r),Y=ts(O,ar(h));return xn(O,Y).join("")}function D_(r,h){var v=ct,O=Rt;if(wn(h)){var Y="separator"in h?h.separator:Y;v="length"in h?wi(h.length):v,O="omission"in h?Ye(h.omission):O}r=Zi(r);var ut=r.length;if(Ir(r)){var yt=ar(r);ut=yt.length}if(v>=ut)return r;var bt=v-$r(O);if(bt<1)return O;var Bt=yt?xn(yt,0,bt).join(""):r.slice(0,bt);if(Y===s)return Bt+O;if(yt&&(bt+=Bt.length-bt),ff(Y)){if(r.slice(bt).search(Y)){var oe,le=Bt;for(Y.global||(Y=Kn(Y.source,Zi(jl.exec(Y))+"g")),Y.lastIndex=0;oe=Y.exec(le);)var de=oe.index;Bt=Bt.slice(0,de===s?bt:de)}}else if(r.indexOf(Ye(Y),bt)!=bt){var ke=Bt.lastIndexOf(Y);ke>-1&&(Bt=Bt.slice(0,ke))}return Bt+O}function z_(r){return r=Zi(r),r&&qo.test(r)?r.replace(Ao,th):r}var k_=ze(function(r,h,v){return r+(v?" ":"")+h.toUpperCase()}),mf=Me("toUpperCase");function Bp(r,h,v){return r=Zi(r),h=v?s:h,h===s?Ls(r)?jc(r):ol(r):r.match(h)||[]}var Np=ae(function(r,h){try{return yr(r,s,h)}catch(v){return cf(v)?v:new ai(v)}}),B_=Vs(function(r,h){return Ji(h,function(v){v=us(v),Bo(r,v,hf(r[v],r))}),r});function N_(r){var h=r==null?0:r.length,v=si();return r=h?Yi(r,function(O){if(typeof O[1]!="function")throw new lr(m);return[v(O[0]),O[1]]}):[],ae(function(O){for(var Y=-1;++Y<h;){var ut=r[Y];if(yr(ut[0],this,O))return yr(ut[1],this,O)}})}function F_(r){return Ra(wr(r,I))}function gf(r){return function(){return r}}function U_(r,h){return r==null||r!==r?h:r}var G_=Oi(),H_=Oi(!0);function Gr(r){return r}function vf(r){return H(typeof r=="function"?r:wr(r,I))}function V_(r){return gt(wr(r,I))}function W_(r,h){return Ct(r,wr(h,I))}var j_=ae(function(r,h){return function(v){return e(v,r,h)}}),X_=ae(function(r,h){return function(v){return e(r,v,h)}});function yf(r,h,v){var O=Jn(h),Y=Us(h,O);v==null&&!(wn(h)&&(Y.length||!O.length))&&(v=h,h=r,r=this,Y=Us(h,Jn(h)));var ut=!(wn(v)&&"chain"in v)||!!v.chain,yt=js(r);return Ji(Y,function(bt){var Bt=h[bt];r[bt]=Bt,yt&&(r.prototype[bt]=function(){var oe=this.__chain__;if(ut||oe){var le=r(this.__wrapped__),de=le.__actions__=er(this.__actions__);return de.push({func:Bt,args:arguments,thisArg:r}),le.__chain__=oe,le}return Bt.apply(r,fo([this.value()],arguments))})}),r}function q_(){return gn._===this&&(gn._=Kr),this}function _f(){}function Y_(r){return r=wi(r),ae(function(h){return J(h,r)})}var Z_=Nn(Yi),J_=Nn(Bh),$_=Nn(Po);function Fp(r){return nf(r)?$o(us(r)):$t(r)}function K_(r){return function(h){return r==null?s:ls(r,h)}}var Q_=eu(),t1=eu(!0);function xf(){return[]}function wf(){return!1}function e1(){return{}}function i1(){return""}function n1(){return!0}function r1(r,h){if(r=wi(r),r<1||r>ce)return[];var v=It,O=Vn(r,It);h=si(h),r-=It;for(var Y=Ro(O,h);++v<r;)h(v);return Y}function o1(r){return vi(r)?Yi(r,us):to(r)?[r]:er(op(Zi(r)))}function s1(r){var h=++ur;return Zi(r)+h}var a1=Tr(function(r,h){return r+h},0),l1=dh("ceil"),h1=Tr(function(r,h){return r/h},1),u1=dh("floor");function c1(r){return r&&r.length?Mo(r,Gr,uh):s}function f1(r,h){return r&&r.length?Mo(r,si(h,2),uh):s}function d1(r){return va(r,Gr)}function p1(r,h){return va(r,si(h,2))}function m1(r){return r&&r.length?Mo(r,Gr,rt):s}function g1(r,h){return r&&r.length?Mo(r,si(h,2),rt):s}var v1=Tr(function(r,h){return r*h},1),y1=dh("round"),_1=Tr(function(r,h){return r-h},0);function x1(r){return r&&r.length?Qo(r,Gr):0}function w1(r,h){return r&&r.length?Qo(r,si(h,2)):0}return it.after=Vv,it.ary=gp,it.assign=Ly,it.assignIn=Lp,it.assignInWith=Qu,it.assignWith=Ry,it.at=Oy,it.before=vp,it.bind=hf,it.bindAll=B_,it.bindKey=yp,it.castArray=ey,it.chain=dp,it.chunk=u0,it.compact=c0,it.concat=f0,it.cond=N_,it.conforms=F_,it.constant=gf,it.countBy=xv,it.create=Iy,it.curry=_p,it.curryRight=xp,it.debounce=wp,it.defaults=Dy,it.defaultsDeep=zy,it.defer=Wv,it.delay=jv,it.difference=d0,it.differenceBy=p0,it.differenceWith=m0,it.drop=g0,it.dropRight=v0,it.dropRightWhile=y0,it.dropWhile=_0,it.fill=x0,it.filter=Tv,it.flatMap=Ev,it.flatMapDeep=bv,it.flatMapDepth=Cv,it.flatten=hp,it.flattenDeep=w0,it.flattenDepth=T0,it.flip=Xv,it.flow=G_,it.flowRight=H_,it.fromPairs=M0,it.functions=Hy,it.functionsIn=Vy,it.groupBy=Av,it.initial=E0,it.intersection=b0,it.intersectionBy=C0,it.intersectionWith=A0,it.invert=jy,it.invertBy=Xy,it.invokeMap=Lv,it.iteratee=vf,it.keyBy=Rv,it.keys=Jn,it.keysIn=Ur,it.map=qu,it.mapKeys=Yy,it.mapValues=Zy,it.matches=V_,it.matchesProperty=W_,it.memoize=Zu,it.merge=Jy,it.mergeWith=Rp,it.method=j_,it.methodOf=X_,it.mixin=yf,it.negate=Ju,it.nthArg=Y_,it.omit=$y,it.omitBy=Ky,it.once=qv,it.orderBy=Ov,it.over=Z_,it.overArgs=Yv,it.overEvery=J_,it.overSome=$_,it.partial=uf,it.partialRight=Tp,it.partition=Iv,it.pick=Qy,it.pickBy=Op,it.property=Fp,it.propertyOf=K_,it.pull=O0,it.pullAll=cp,it.pullAllBy=I0,it.pullAllWith=D0,it.pullAt=z0,it.range=Q_,it.rangeRight=t1,it.rearg=Zv,it.reject=kv,it.remove=k0,it.rest=Jv,it.reverse=af,it.sampleSize=Nv,it.set=e_,it.setWith=i_,it.shuffle=Fv,it.slice=B0,it.sortBy=Hv,it.sortedUniq=W0,it.sortedUniqBy=j0,it.split=E_,it.spread=$v,it.tail=X0,it.take=q0,it.takeRight=Y0,it.takeRightWhile=Z0,it.takeWhile=J0,it.tap=cv,it.throttle=Kv,it.thru=Xu,it.toArray=Cp,it.toPairs=Ip,it.toPairsIn=Dp,it.toPath=o1,it.toPlainObject=Pp,it.transform=n_,it.unary=Qv,it.union=$0,it.unionBy=K0,it.unionWith=Q0,it.uniq=tv,it.uniqBy=ev,it.uniqWith=iv,it.unset=r_,it.unzip=lf,it.unzipWith=fp,it.update=o_,it.updateWith=s_,it.values=gh,it.valuesIn=a_,it.without=nv,it.words=Bp,it.wrap=ty,it.xor=rv,it.xorBy=ov,it.xorWith=sv,it.zip=av,it.zipObject=lv,it.zipObjectDeep=hv,it.zipWith=uv,it.entries=Ip,it.entriesIn=Dp,it.extend=Lp,it.extendWith=Qu,yf(it,it),it.add=a1,it.attempt=Np,it.camelCase=c_,it.capitalize=zp,it.ceil=l1,it.clamp=l_,it.clone=iy,it.cloneDeep=ry,it.cloneDeepWith=oy,it.cloneWith=ny,it.conformsTo=sy,it.deburr=kp,it.defaultTo=U_,it.divide=h1,it.endsWith=f_,it.eq=Uo,it.escape=d_,it.escapeRegExp=p_,it.every=wv,it.find=Mv,it.findIndex=ap,it.findKey=ky,it.findLast=Sv,it.findLastIndex=lp,it.findLastKey=By,it.floor=u1,it.forEach=pp,it.forEachRight=mp,it.forIn=Ny,it.forInRight=Fy,it.forOwn=Uy,it.forOwnRight=Gy,it.get=df,it.gt=ay,it.gte=ly,it.has=Wy,it.hasIn=pf,it.head=up,it.identity=Gr,it.includes=Pv,it.indexOf=S0,it.inRange=h_,it.invoke=qy,it.isArguments=Pl,it.isArray=vi,it.isArrayBuffer=hy,it.isArrayLike=Fr,it.isArrayLikeObject=Dn,it.isBoolean=uy,it.isBuffer=ka,it.isDate=cy,it.isElement=fy,it.isEmpty=dy,it.isEqual=py,it.isEqualWith=my,it.isError=cf,it.isFinite=gy,it.isFunction=js,it.isInteger=Mp,it.isLength=$u,it.isMap=Sp,it.isMatch=vy,it.isMatchWith=yy,it.isNaN=_y,it.isNative=xy,it.isNil=Ty,it.isNull=wy,it.isNumber=Ep,it.isObject=wn,it.isObjectLike=Ln,it.isPlainObject=ou,it.isRegExp=ff,it.isSafeInteger=My,it.isSet=bp,it.isString=Ku,it.isSymbol=to,it.isTypedArray=mh,it.isUndefined=Sy,it.isWeakMap=Ey,it.isWeakSet=by,it.join=P0,it.kebabCase=m_,it.last=bo,it.lastIndexOf=L0,it.lowerCase=g_,it.lowerFirst=v_,it.lt=Cy,it.lte=Ay,it.max=c1,it.maxBy=f1,it.mean=d1,it.meanBy=p1,it.min=m1,it.minBy=g1,it.stubArray=xf,it.stubFalse=wf,it.stubObject=e1,it.stubString=i1,it.stubTrue=n1,it.multiply=v1,it.nth=R0,it.noConflict=q_,it.noop=_f,it.now=Yu,it.pad=y_,it.padEnd=__,it.padStart=x_,it.parseInt=w_,it.random=u_,it.reduce=Dv,it.reduceRight=zv,it.repeat=T_,it.replace=M_,it.result=t_,it.round=y1,it.runInContext=Lt,it.sample=Bv,it.size=Uv,it.snakeCase=S_,it.some=Gv,it.sortedIndex=N0,it.sortedIndexBy=F0,it.sortedIndexOf=U0,it.sortedLastIndex=G0,it.sortedLastIndexBy=H0,it.sortedLastIndexOf=V0,it.startCase=b_,it.startsWith=C_,it.subtract=_1,it.sum=x1,it.sumBy=w1,it.template=A_,it.times=r1,it.toFinite=Xs,it.toInteger=wi,it.toLength=Ap,it.toLower=P_,it.toNumber=Co,it.toSafeInteger=Py,it.toString=Zi,it.toUpper=L_,it.trim=R_,it.trimEnd=O_,it.trimStart=I_,it.truncate=D_,it.unescape=z_,it.uniqueId=s1,it.upperCase=k_,it.upperFirst=mf,it.each=pp,it.eachRight=mp,it.first=up,yf(it,function(){var r={};return Nr(it,function(h,v){Ti.call(it.prototype,v)||(r[v]=h)}),r}(),{chain:!1}),it.VERSION=c,Ji(["bind","bindKey","curry","curryRight","partial","partialRight"],function(r){it[r].placeholder=it}),Ji(["drop","take"],function(r,h){_i.prototype[r]=function(v){v=v===s?1:vn(wi(v),0);var O=this.__filtered__&&!h?new _i(this):this.clone();return O.__filtered__?O.__takeCount__=Vn(v,O.__takeCount__):O.__views__.push({size:Vn(v,It),type:r+(O.__dir__<0?"Right":"")}),O},_i.prototype[r+"Right"]=function(v){return this.reverse()[r](v).reverse()}}),Ji(["filter","map","takeWhile"],function(r,h){var v=h+1,O=v==G||v==Et;_i.prototype[r]=function(Y){var ut=this.clone();return ut.__iteratees__.push({iteratee:si(Y,3),type:v}),ut.__filtered__=ut.__filtered__||O,ut}}),Ji(["head","last"],function(r,h){var v="take"+(h?"Right":"");_i.prototype[r]=function(){return this[v](1).value()[0]}}),Ji(["initial","tail"],function(r,h){var v="drop"+(h?"":"Right");_i.prototype[r]=function(){return this.__filtered__?new _i(this):this[v](1)}}),_i.prototype.compact=function(){return this.filter(Gr)},_i.prototype.find=function(r){return this.filter(r).head()},_i.prototype.findLast=function(r){return this.reverse().find(r)},_i.prototype.invokeMap=ae(function(r,h){return typeof r=="function"?new _i(this):this.map(function(v){return e(v,r,h)})}),_i.prototype.reject=function(r){return this.filter(Ju(si(r)))},_i.prototype.slice=function(r,h){r=wi(r);var v=this;return v.__filtered__&&(r>0||h<0)?new _i(v):(r<0?v=v.takeRight(-r):r&&(v=v.drop(r)),h!==s&&(h=wi(h),v=h<0?v.dropRight(-h):v.take(h-r)),v)},_i.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},_i.prototype.toArray=function(){return this.take(It)},Nr(_i.prototype,function(r,h){var v=/^(?:filter|find|map|reject)|While$/.test(h),O=/^(?:head|last)$/.test(h),Y=it[O?"take"+(h=="last"?"Right":""):h],ut=O||/^find/.test(h);Y&&(it.prototype[h]=function(){var yt=this.__wrapped__,bt=O?[1]:arguments,Bt=yt instanceof _i,oe=bt[0],le=Bt||vi(yt),de=function(Ri){var Ui=Y.apply(it,fo([Ri],bt));return O&&ke?Ui[0]:Ui};le&&v&&typeof oe=="function"&&oe.length!=1&&(Bt=le=!1);var ke=this.__chain__,Je=!!this.__actions__.length,hi=ut&&!ke,Mi=Bt&&!Je;if(!ut&&le){yt=Mi?yt:new _i(this);var ui=r.apply(yt,bt);return ui.__actions__.push({func:Xu,args:[de],thisArg:s}),new qn(ui,ke)}return hi&&Mi?r.apply(this,bt):(ui=this.thru(de),hi?O?ui.value()[0]:ui.value():ui)})}),Ji(["pop","push","shift","sort","splice","unshift"],function(r){var h=On[r],v=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",O=/^(?:pop|shift)$/.test(r);it.prototype[r]=function(){var Y=arguments;if(O&&!this.__chain__){var ut=this.value();return h.apply(vi(ut)?ut:[],Y)}return this[v](function(yt){return h.apply(vi(yt)?yt:[],Y)})}}),Nr(_i.prototype,function(r,h){var v=it[h];if(v){var O=v.name+"";Ti.call(rs,O)||(rs[O]=[]),rs[O].push({name:h,func:v})}}),rs[$i(s,T).name]=[{name:"wrapper",func:s}],_i.prototype.clone=ba,_i.prototype.reverse=Ou,_i.prototype.value=Ca,it.prototype.at=fv,it.prototype.chain=dv,it.prototype.commit=pv,it.prototype.next=mv,it.prototype.plant=vv,it.prototype.reverse=yv,it.prototype.toJSON=it.prototype.valueOf=it.prototype.value=_v,it.prototype.first=it.prototype.head,ns&&(it.prototype[ns]=gv),it},es=Xc();Zr?((Zr.exports=es)._=es,Zo._=es):gn._=es}).call(Er)}(lu,lu.exports);var am=lu.exports;const ec=tc(am);class lm{constructor(a=[],s=!1){Ba(this,"simplifyFunc",a=>{try{a=turf.simplify(a,{tolerance:5e-4,highQuality:!1,mutate:!0})}catch{}return a});mars3d?(this.vectorArr=a,this.geoJsonType=new Map([["Point"],["LineString"],["Polygon"],["MultiPoint"],["MultiLineString"],["MultiPolygon"]]),this.avoidanceArr=[],this.editDate={id:""},this.isDynamicMasking=s):console.error("未引入指定插件")}remove(a,s=null){s&&s.isClone=="true"?window.mapClone.mapEx.removeLayer(window.mapClone.mapEx.getLayer(a,"vectorId")):(window.map.removeLayer(window.map.getLayer(a,"vectorId")),window.dynamicMasking&&window.dynamicMasking.remove(a))}add(a,s){return new Promise((c,f)=>{let u,m=s==null?void 0:s.isClone;if(typeof a!="object"){let g=window.map.getLayer(a,"vectorId");if(g)return c(g);u=this.query(a)}else{let g=window.map.getLayer(a.id,"vectorId");if(g)return c(g);u=a}if(u){let{value:g,url:_,id:S,title:b}=u;new Cesium.Resource({url:_}).fetchJson().then(k=>{let{id:D,title:F,shpInfo:E}=u,{attributes:L,geometryType:T,geometryCount:M,pointCount:R}=E;if(L){let{width:C,materialType:U,materialOptions:N,clampToGround:X,distanceDisplayCondition:K,distanceDisplayCondition_near:Z,distanceDisplayCondition_far:ct,zIndex:Rt,label:tt,fill:_t,diffHeight:G,outline:Pt,outlineStyle:Et,color:At,pixelSize:ce,outlineColor:re,outlineWidth:Ft,classificationType:It,setHeight:Nt}=JSON.parse(L),Pe;switch(tt.height==""&&(tt.height=null),this.isDynamicMasking?(tt.color=Cesium.Color.fromCssColorString(tt.color).withAlpha(0),tt.outlineColor=Cesium.Color.fromCssColorString(tt.outlineColor).withAlpha(.001),tt.backgroundColor=Cesium.Color.fromCssColorString(tt.backgroundColor).withAlpha(.001),tt.background=!1,tt.outline=!1,tt.show=!1):(tt.color=Cesium.Color.fromCssColorString(tt.color),tt.outlineColor=Cesium.Color.fromCssColorString(tt.outlineColor),tt.backgroundColor=Cesium.Color.fromCssColorString(tt.backgroundColor)),T){case"LineString":case"MultiLineString":tt.backgroundPadding=5,Pe=new mars3d.layer.GeoJsonLayer({data:k,vectorId:D,symbol:{type:"polylineC",styleOptions:{width:C,clampToGround:X,distanceDisplayCondition:K,distanceDisplayCondition_far:ct,distanceDisplayCondition_near:Z,materialType:U,materialOptions:N,classificationType:It,setHeight:Nt,label:tt}},hasZIndex:!0,zIndex:Rt});break;case"Polygon":case"MultiPolygon":U=="PolyGrass"&&(N={evenColor:new Cesium.Color(.25,.4,.1,1),oddColor:new Cesium.Color(.1,.1,.1,1),frequency:1.5}),Pe=new mars3d.layer.GeoJsonLayer({data:k,vectorId:D,symbol:{type:"polygon",styleOptions:{fill:_t,diffHeight:G,clampToGround:X,materialType:U,materialOptions:N,distanceDisplayCondition:K,distanceDisplayCondition_far:ct,distanceDisplayCondition_near:Z,outlineStyle:Et,outline:Pt,classificationType:It,setHeight:Nt,label:tt}}});break;case"Point":case"MultiPoint":Pe=new mars3d.layer.GeoJsonLayer({data:k,vectorId:D,symbol:{type:"pointC",styleOptions:{color:At,pixelSize:ce,outline:Pt,outlineColor:re,outlineWidth:Ft,visibleDepth:!1,label:tt}}});break}m?window.mapClone.mapEx.addLayer(Pe):window.map.addLayer(Pe),Pe.bindPopup(Wt=>{let $e='<div class="bim-map-popup">';return Object.keys(Wt.graphic.attr).forEach((Si,Oe)=>{Wt.graphic.attr[Si]&&($e+=`<p><b>${Si}</b> : ${Wt.graphic.attr[Si]}</p>`)}),$e+="</div>",$e});let pe=ec.debounce(Wt=>{window.dynamicMasking.add(Wt,JSON.parse(L))},500);Pe.readyPromise.then(Wt=>{window.dynamicMasking&&pe(Wt),c(Wt)}).catch(Wt=>{console.error("测试shp矢量加载失败",Wt),c({tite:"【矢量】「"+F+"」无法加载",type:"error",id:D,url:_})})}else c({tite:"【矢量】「"+F+"」无法加载",type:"error",id:D,url:_})}).catch(k=>{console.error("数据有误",k),c({tite:"【矢量】「"+b+"」链接地址有误",type:"error",id:S,url:_})})}else c({tite:"【矢量】ID:「"+a+"」已删除",type:"error",id:a})})}updateData(a){this.vectorArr=a}processingKML(a){let s,c=2e3,f=!0,{kmlInfo:u}=a,{fill:m,areaColor:g,areaSideColor:_,transparency:S,isAreaSideColor:b,minDistinct:I,textDistinct:k,textSize:D,textColor:F,fontStyle:E,outLine:L,sideColor:T,backGround:M,backGroundColor:R,clampToGround:C}=u,U={fill:m,color:g,opacity:S||.5,outline:b,outlineColor:_,outlineWidth:2,clampToGround:C,distanceDisplayCondition:!0,distanceDisplayCondition_far:k||1e6,distanceDisplayCondition_near:I||0,classificationType:s,opacity:String(S)},N={text:"{name}",horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffsetY:-10,font_size:26,color:F||"#ffffff",font_family:E||"黑体",outline:L||!0,outlineColor:T||"#000000",outlineWidth:4,scaleByDistance:!0,distanceDisplayCondition:!0,distanceDisplayCondition_far:k||1e6,distanceDisplayCondition_near:I||0,background:M||!1,backgroundColor:R||"",visibleDepth:f,clampToGround:C||!1,disableDepthTestDistance:c};return{...U,label:N}}selected(a){window.map.getLayer(a,"vectorId")&&window.map.getLayer(a,"vectorId").flyTo()}query(a){return this.vectorArr.length==0?!1:this.vectorArr.find(s=>s.id==a)}queryVector(a){return window.map.getLayer(a,"vectorId")}editVector(a,s,c){let f=window.map.getLayer(a,"vectorId"),u=bf(s,c);f&&(f.eachGraphic(m=>{m.label&&m.label.show===!1&&(delete m.label.outline,delete m.label.background,delete m.label.outlineColor,delete m.label.backgroundColor),u.label&&u.label.height==""&&(u.label.height=null),m.setStyle({...u})}),window.dynamicMasking&&dynamicMasking.modify(a,u))}nationalBoundaries(a="/gis/nationalBoundaries.json"){let s=new mars3d.layer.GeoJsonLayer({name:"国界",url:a,vectorId:"border",format:c=>{try{c=turf.simplify(c,{tolerance:1e-5,highQuality:!1,mutate:!0})}catch(f){console.error(f)}return c},symbol:{type:"polylineC",styleOptions:{width:2,materialType:"Color",materialOptions:{color:"#CD9B1D"},distanceDisplayCondition:!0,distanceDisplayCondition_near:1e3,distanceDisplayCondition_far:2e7,clampToGround:!0,classificationType:Cesium.ClassificationType.TERRAIN}}});map.addLayer(s)}switchDynamicMasking(a){this.isDynamicMasking=a}}class hm{constructor(a=[]){mars3d?(this.terrainProviderArr=a,this.terrainProviderId="",this.events={},window.map.on(mars3d.EventType.terrainLoadError,s=>{console.error("地形服务加载失败",s),this.hide()}),window.map.viewer.scene.globe.tileLoadProgressEvent.addEventListener(s=>{window.map.viewer.scene.globe.tilesLoaded&&this.emit("load",s)})):console.error("未引入指定插件")}add(a,s){if(s==null?void 0:s.isClone)mapClone?window.mapClone.mapEx.terrainProvider=window.map.terrainProvider:console.error("副屏幕未初始化");else{let{url:f,id:u}=a;if(this.terrainProviderId==u&&window.map.terrainProvider._layers)return!1;window.map.terrainProvider=mars3d.LayerUtil.createTerrainProvider({imageXyzId:u,type:"xyz",url:f,requestVertexNormals:!0,requestMetadata:!0}),this.terrainProviderId=u}}show(a){(a==null?void 0:a.isClone)?window.mapClone.mapEx.hasTerrain=!0:window.map.hasTerrain=!0}hide(a){(a==null?void 0:a.isClone)?window.mapClone.mapEx.hasTerrain=!1:window.map.hasTerrain=!1}on(a,s){a=="load"?this.events[a]?this.events[a].push(s):this.events[a]=[s]:console.log("未开放自定义")}emit(a,...s){this.events[a]!=null&&this.events[a].forEach(c=>c(...s))}off(a,s){this.events[a]=this.events[a].filter(c=>c!==s)}once(a,s){const c=()=>{s(),this.off(a,c)};this.on(a,c)}addClip(a){return new Promise((s,c)=>{window.bimClip?s(bimClip.clipGisAdd(a)):c("挖洞工具未初始化")})}}class um{constructor(a=[],s){mars3d?(this.elevationImageArr=a,this.elevationImageLayer,s?this.gisTkone={Authorization:`Bearer ${s}`}:this.gisTkone={},this.form={brightnessVal:1.3,msaaSamples:4,surfaceOpacity:1,layerOpacity:1,layerBrightness:2,layerContrast:1,layerHue:0,layerSaturation:1,layerGamma:1},this.tdtLayer=null):console.error("未引入指定插件")}pushVector(a){this.elevationImageArr.push(a)}add(a,s=!0,c){let f;if(typeof a!="object"?f=a:f=a.imageXyzId,window.map.getLayer(f,"imageXyzId"))return!1;const{layerOpacity:u,layerBrightness:m,layerContrast:g,layerHue:_,layerSaturation:S,layerGamma:b,surfaceOpacity:I}=this.exposureEnvironmentSettings();return new Promise((k,D)=>{let F,E,L,T,M,R;if(typeof a!="object"){let C=this.query(a);C||D("缺少树结构");let{gisInfo:U}=C;F=U.id,L=U.order,E=C.url,T=U.minLevel,M=U.maxLevel}else F=a.imageXyzId,E=a.url,L=a.zIndex,T=a.minimumLevel,M=a.maximumLevel,R=a.chinaCRS;this.elevationImageLayer=new mars3d.layer.XyzLayer({imageXyzId:F,type:"xyz",url:E,hasZIndex:!0,zIndex:L.toString(),brightness:m,opacity:u,saturation:S,contrast:g,hue:_,gamma:b,alpha:I,show:!0,minimumLevel:T||0,maximumLevel:M||15,chinaCRS:R,headers:s?this.gisTkone:null}),this.elevationImageLayer.on(mars3d.EventType.load,C=>{k(C)}),window.map.addLayer(this.elevationImageLayer),c&&Object.keys(c).forEach(C=>{this.elevationImageLayer.on(fnType.get(C),U=>{c[C](U)})})})}remove(a){console.log(a),window.map.removeLayer(window.map.getLayer(a,"imageXyzId"))}query(a){return this.elevationImageArr.length==0?!1:this.elevationImageArr.find(s=>s.id==a)}initial(){this.elevationImageArr=[],this.elevationImageLayer=null}exposureEnvironmentSettings(){return localStorage.getItem("environmentSettings")?JSON.parse(localStorage.getItem("environmentSettings")):(localStorage.setItem("environmentSettings",JSON.stringify(this.form)),JSON.parse(JSON.stringify(this.form)))}}class cm{constructor(a,...s){Ba(this,"manualFreed",ec.debounce(()=>{let{lng:a,lat:s,alt:c,pitch:f}=window.map.getCameraView(),u;this.modelArray.forEach(m=>{u=m.releasedDistance?m.releasedDistance:1e4,this.disTance([a,s,c],[m.center._lng,m.center._lat,m.center._alt],this.calculateDistance(f,u))?window.map.getLayer(m.id,"modelId")&&this.emit("leave",m):window.map.getLayer(m.id,"modelId")||this.emit("enter",m)})},200));mars3d?(a&&a!=null&&(this.modelArray=a),this.showModelArray=[],this.Cesium=mars3d.Cesium,this.events={}):console.error("未引入指定插件")}on(a,s){a=="enter"||a=="leave"?this.events[a]?this.events[a].push(s):this.events[a]=[s]:console.log("未开放自定义")}emit(a,...s){this.events[a]!=null&&this.events[a].forEach(c=>c(...s))}off(a,s){this.events[a]=this.events[a].filter(c=>c!==s)}once(a,s){const c=()=>{s(),this.off(a,c)};this.on(a,c)}say(a){return this[a]}add(a,s){this[a].push(s)}remove(a,s){this[a]=this[a].filter(function(c){return c!==s})}initial(){this.modelArray=[],this.events={}}updateCustomExcavationDetails(a,s,c,f=[],u={}){let m,g,_;switch(m=this.modelArray.find(S=>S.modelId==a).customize.bimModelExcavationDetails,_=m.find((S,b)=>{if(S.id==s)return g=b,S}),c){case"delete":m.splice(g,1);break;case"update":_.excavationDetails=f;break;case"add":m.push(u);break;case"edit":_.excavationDetails=u.excavationDetails,_.kId=u.kId;break}return m}resourceRelease(){window.map.viewer.camera.moveEnd.addEventListener(()=>{this.freed()})}freed(){let{alt:a}=window.map.getCameraView();a<2e4&&(this.freed=ec.throttle(()=>{let{lng:s,lat:c,alt:f,pitch:u}=window.map.getCameraView();this.modelArray&&this.modelArray.forEach(m=>{let g=m.bimModel.releasedDistance?m.bimModel.releasedDistance:1e4;m.center&&this.disTance([s,c,f],[m.center._lng,m.center._lat,m.center._alt],this.calculateDistance(u,g))?window.map.getLayer(m.id,"modelId")&&this.emit("leave",m):this.showModelArray.indexOf(m.id)>=0&&!window.map.getLayer(m.id,"modelId")&&this.emit("enter",m)})},2e3),this.freed())}findPnodeId(a,s,c="id"){let f;if(a){for(var u=0;u<a.length;u++){let m=a[u];if(m[c]==s)return f=m,f;if(m.children&&m.children.length>0&&(f=this.findPnodeId(m.children,s,c),f))return f}return f}}disTance(a,s,c){let f,u,m;return f=Cesium.Cartesian3.fromDegrees(...a),u=Cesium.Cartesian3.fromDegrees(...s),m=Cesium.Cartesian3.distance(f,u),m>c}calculateDistance(a,s){let c=(a+180)%360-180;c=Math.max(-90,Math.min(c,90));let f=(s-s/5)*(Math.abs(c)/90)+s/5;return Math.round(f)}}class fm{constructor(a=[],s){mars3d?(this.entityArr=a,this.entityLayer=new mars3d.layer.GraphicLayer({entityId:"bimEntity"}),window.map.addLayer(this.entityLayer),this.entityItem=null,this.events={},this.entityCloneLayer):console.error("未引入指定插件")}on(a,s){a=="change"||a=="collection"?this.events[a]?this.events[a].push(s):this.events[a]=[s]:console.log("未开放自定义")}emit(a,...s){this.events[a]!=null&&this.events[a].forEach(c=>c(...s))}off(a,s){this.events[a]=this.events[a].filter(c=>c!==s)}offAll(){this.events={}}once(a,s){const c=()=>{s(),this.off(a,c)};this.on(a,c)}add(a,s=null,c){return new Promise((f,u)=>{var m;if(this.entityLayer){let g,_,S;if(c==null?void 0:c.isClone)this.entityCloneLayer&&(_=this.query(a),_?(S=JSON.parse(_.bimPlanPainting.graphic),S.attr=S.attr||{},S.attr.entityId=a,this.entityCloneLayer.addGraphic(S)):f({tite:"【标绘】 ID:「"+a+"」已删除",type:"error",id:a}));else{if(typeof a!="object"?(g=this.entityLayer.getGraphicByAttr(a,"entityId"),_=this.query(a),_?(S=JSON.parse(_.bimPlanPainting.graphic),S.attr=S.attr||{},S.attr.entityId=a):f({tite:"【标绘】ID:「"+a+"」已删除",type:"error",id:a})):(g=this.entityLayer.getGraphicByAttr(a.id,"entityId"),S=JSON.parse(JSON.stringify(a)),S.attr=S.attr||{},S.attr.entityId=S.attr.entityId||s,S.attr==null?S.attr={entityId:a.id}:((m=S.attr)==null?void 0:m.entityId)==null&&s&&(S.attr.entityId=s)),g)return f();this.entityLayer.addGraphic(S),f(S)}}else f(),console.error("未初始化标绘实例图层")})}query(a){return this.entityArr.length==0?!1:this.entityArr.find(s=>s.id==a)}queryEntity(a){if(bimEntity.entityLayer)return bimEntity.entityLayer.getGraphicByAttr(a,"entityId")}selected(a,s=null){let c=this.entityLayer.getGraphicByAttr(a,"entityId");s==null||s.isClone,(c.options.type=="div"||c.options.type=="point")&&c._point?c.flyTo({radius:c._point._alt+500<500?5e3:c._point._alt+500}):c.flyTo()}remove(a,s=null){var f,u;(s==null?void 0:s.isClone)?this.entityCloneLayer&&((f=this.entityCloneLayer.getGraphicByAttr(a,"entityId"))==null||f.remove()):this.entityLayer.getGraphicByAttr(a,"entityId")&&((u=this.entityLayer.getGraphicByAttr(a,"entityId"))==null||u.remove(),this.entityItem&&(this.entityItem._state=="destroy"||this.entityItem.options.attr.entityId==a)&&(this.entityItem=null))}entityCloneLayerInit(){(this.entityCloneLayer==null||this.entityCloneLayer.state=="destroy")&&(this.entityCloneLayer=window.mapClone._mapEx.getLayer("bimEntity","entityId"))}entityCloneLayerRemove(){this.entityCloneLayer.remove(),this.entityCloneLayer=null}removeEntityItem(){this.entityItem=null}updateData(a){this.entityArr=a}startDrawGraphic(a){return new Promise((s,c)=>{let{type:f,style:u}=a;if(a.drawShow=!1,f=="div")if(u.html)this.entityLayer.startDraw(a).then(m=>{setTimeout(()=>{this.entityItem=m,this.entityLayer.startEditing(m)},500)});else{let{title:m,divType:g,theme_color:_,font_color:S,scaleByDistance:b,scaleByDistance_far:I,scaleByDistance_farValue:k,scaleByDistance_near:D,scaleByDistance_nearValue:F,distanceDisplayCondition:E,distanceDisplayCondition_far:L,distanceDisplayCondition_near:T,clampToGround:M}=u,R={type:"div",style:{pointerEvents:!0,scaleByDistance:b,scaleByDistance_far:I,scaleByDistance_farValue:k,scaleByDistance_near:D,scaleByDistance_nearValue:F,distanceDisplayCondition:E,distanceDisplayCondition_far:L,distanceDisplayCondition_near:T,clampToGround:M,horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}};switch(g){case"1":R.style.html=`<div class="entity-div-style entity-div-style1" style="--theme-color1:${_};--theme-font-color1:${S};">
2640
+ }`;var Mi=Np(function(){return Fi(ut,Je+"return "+de).apply(s,yt)});if(Mi.source=de,cf(Mi))throw Mi;return Mi}function P_(r){return Zi(r).toLowerCase()}function L_(r){return Zi(r).toUpperCase()}function R_(r,h,v){if(r=Zi(r),r&&(v||h===s))return ya(r);if(!r||!(h=Ye(h)))return r;var O=ar(r),Y=ar(h),ut=ts(O,Y),yt=bs(O,Y)+1;return xn(O,ut,yt).join("")}function O_(r,h,v){if(r=Zi(r),r&&(v||h===s))return r.slice(0,_a(r)+1);if(!r||!(h=Ye(h)))return r;var O=ar(r),Y=bs(O,ar(h))+1;return xn(O,0,Y).join("")}function I_(r,h,v){if(r=Zi(r),r&&(v||h===s))return r.replace(lo,"");if(!r||!(h=Ye(h)))return r;var O=ar(r),Y=ts(O,ar(h));return xn(O,Y).join("")}function D_(r,h){var v=ct,O=Rt;if(wn(h)){var Y="separator"in h?h.separator:Y;v="length"in h?wi(h.length):v,O="omission"in h?Ye(h.omission):O}r=Zi(r);var ut=r.length;if(Ir(r)){var yt=ar(r);ut=yt.length}if(v>=ut)return r;var bt=v-$r(O);if(bt<1)return O;var Bt=yt?xn(yt,0,bt).join(""):r.slice(0,bt);if(Y===s)return Bt+O;if(yt&&(bt+=Bt.length-bt),ff(Y)){if(r.slice(bt).search(Y)){var oe,le=Bt;for(Y.global||(Y=Kn(Y.source,Zi(jl.exec(Y))+"g")),Y.lastIndex=0;oe=Y.exec(le);)var de=oe.index;Bt=Bt.slice(0,de===s?bt:de)}}else if(r.indexOf(Ye(Y),bt)!=bt){var ke=Bt.lastIndexOf(Y);ke>-1&&(Bt=Bt.slice(0,ke))}return Bt+O}function z_(r){return r=Zi(r),r&&qo.test(r)?r.replace(Ao,th):r}var k_=ze(function(r,h,v){return r+(v?" ":"")+h.toUpperCase()}),mf=Me("toUpperCase");function Bp(r,h,v){return r=Zi(r),h=v?s:h,h===s?Ls(r)?jc(r):ol(r):r.match(h)||[]}var Np=ae(function(r,h){try{return yr(r,s,h)}catch(v){return cf(v)?v:new ai(v)}}),B_=Vs(function(r,h){return Ji(h,function(v){v=us(v),Bo(r,v,hf(r[v],r))}),r});function N_(r){var h=r==null?0:r.length,v=si();return r=h?Yi(r,function(O){if(typeof O[1]!="function")throw new lr(m);return[v(O[0]),O[1]]}):[],ae(function(O){for(var Y=-1;++Y<h;){var ut=r[Y];if(yr(ut[0],this,O))return yr(ut[1],this,O)}})}function F_(r){return Ra(wr(r,I))}function gf(r){return function(){return r}}function U_(r,h){return r==null||r!==r?h:r}var G_=Oi(),H_=Oi(!0);function Gr(r){return r}function vf(r){return H(typeof r=="function"?r:wr(r,I))}function V_(r){return gt(wr(r,I))}function W_(r,h){return Ct(r,wr(h,I))}var j_=ae(function(r,h){return function(v){return e(v,r,h)}}),X_=ae(function(r,h){return function(v){return e(r,v,h)}});function yf(r,h,v){var O=Jn(h),Y=Us(h,O);v==null&&!(wn(h)&&(Y.length||!O.length))&&(v=h,h=r,r=this,Y=Us(h,Jn(h)));var ut=!(wn(v)&&"chain"in v)||!!v.chain,yt=js(r);return Ji(Y,function(bt){var Bt=h[bt];r[bt]=Bt,yt&&(r.prototype[bt]=function(){var oe=this.__chain__;if(ut||oe){var le=r(this.__wrapped__),de=le.__actions__=er(this.__actions__);return de.push({func:Bt,args:arguments,thisArg:r}),le.__chain__=oe,le}return Bt.apply(r,fo([this.value()],arguments))})}),r}function q_(){return gn._===this&&(gn._=Kr),this}function _f(){}function Y_(r){return r=wi(r),ae(function(h){return J(h,r)})}var Z_=Nn(Yi),J_=Nn(Bh),$_=Nn(Po);function Fp(r){return nf(r)?$o(us(r)):$t(r)}function K_(r){return function(h){return r==null?s:ls(r,h)}}var Q_=eu(),t1=eu(!0);function xf(){return[]}function wf(){return!1}function e1(){return{}}function i1(){return""}function n1(){return!0}function r1(r,h){if(r=wi(r),r<1||r>ce)return[];var v=It,O=Vn(r,It);h=si(h),r-=It;for(var Y=Ro(O,h);++v<r;)h(v);return Y}function o1(r){return vi(r)?Yi(r,us):to(r)?[r]:er(op(Zi(r)))}function s1(r){var h=++ur;return Zi(r)+h}var a1=Tr(function(r,h){return r+h},0),l1=dh("ceil"),h1=Tr(function(r,h){return r/h},1),u1=dh("floor");function c1(r){return r&&r.length?Mo(r,Gr,uh):s}function f1(r,h){return r&&r.length?Mo(r,si(h,2),uh):s}function d1(r){return va(r,Gr)}function p1(r,h){return va(r,si(h,2))}function m1(r){return r&&r.length?Mo(r,Gr,rt):s}function g1(r,h){return r&&r.length?Mo(r,si(h,2),rt):s}var v1=Tr(function(r,h){return r*h},1),y1=dh("round"),_1=Tr(function(r,h){return r-h},0);function x1(r){return r&&r.length?Qo(r,Gr):0}function w1(r,h){return r&&r.length?Qo(r,si(h,2)):0}return it.after=Vv,it.ary=gp,it.assign=Ly,it.assignIn=Lp,it.assignInWith=Qu,it.assignWith=Ry,it.at=Oy,it.before=vp,it.bind=hf,it.bindAll=B_,it.bindKey=yp,it.castArray=ey,it.chain=dp,it.chunk=u0,it.compact=c0,it.concat=f0,it.cond=N_,it.conforms=F_,it.constant=gf,it.countBy=xv,it.create=Iy,it.curry=_p,it.curryRight=xp,it.debounce=wp,it.defaults=Dy,it.defaultsDeep=zy,it.defer=Wv,it.delay=jv,it.difference=d0,it.differenceBy=p0,it.differenceWith=m0,it.drop=g0,it.dropRight=v0,it.dropRightWhile=y0,it.dropWhile=_0,it.fill=x0,it.filter=Tv,it.flatMap=Ev,it.flatMapDeep=bv,it.flatMapDepth=Cv,it.flatten=hp,it.flattenDeep=w0,it.flattenDepth=T0,it.flip=Xv,it.flow=G_,it.flowRight=H_,it.fromPairs=M0,it.functions=Hy,it.functionsIn=Vy,it.groupBy=Av,it.initial=E0,it.intersection=b0,it.intersectionBy=C0,it.intersectionWith=A0,it.invert=jy,it.invertBy=Xy,it.invokeMap=Lv,it.iteratee=vf,it.keyBy=Rv,it.keys=Jn,it.keysIn=Ur,it.map=qu,it.mapKeys=Yy,it.mapValues=Zy,it.matches=V_,it.matchesProperty=W_,it.memoize=Zu,it.merge=Jy,it.mergeWith=Rp,it.method=j_,it.methodOf=X_,it.mixin=yf,it.negate=Ju,it.nthArg=Y_,it.omit=$y,it.omitBy=Ky,it.once=qv,it.orderBy=Ov,it.over=Z_,it.overArgs=Yv,it.overEvery=J_,it.overSome=$_,it.partial=uf,it.partialRight=Tp,it.partition=Iv,it.pick=Qy,it.pickBy=Op,it.property=Fp,it.propertyOf=K_,it.pull=O0,it.pullAll=cp,it.pullAllBy=I0,it.pullAllWith=D0,it.pullAt=z0,it.range=Q_,it.rangeRight=t1,it.rearg=Zv,it.reject=kv,it.remove=k0,it.rest=Jv,it.reverse=af,it.sampleSize=Nv,it.set=e_,it.setWith=i_,it.shuffle=Fv,it.slice=B0,it.sortBy=Hv,it.sortedUniq=W0,it.sortedUniqBy=j0,it.split=E_,it.spread=$v,it.tail=X0,it.take=q0,it.takeRight=Y0,it.takeRightWhile=Z0,it.takeWhile=J0,it.tap=cv,it.throttle=Kv,it.thru=Xu,it.toArray=Cp,it.toPairs=Ip,it.toPairsIn=Dp,it.toPath=o1,it.toPlainObject=Pp,it.transform=n_,it.unary=Qv,it.union=$0,it.unionBy=K0,it.unionWith=Q0,it.uniq=tv,it.uniqBy=ev,it.uniqWith=iv,it.unset=r_,it.unzip=lf,it.unzipWith=fp,it.update=o_,it.updateWith=s_,it.values=gh,it.valuesIn=a_,it.without=nv,it.words=Bp,it.wrap=ty,it.xor=rv,it.xorBy=ov,it.xorWith=sv,it.zip=av,it.zipObject=lv,it.zipObjectDeep=hv,it.zipWith=uv,it.entries=Ip,it.entriesIn=Dp,it.extend=Lp,it.extendWith=Qu,yf(it,it),it.add=a1,it.attempt=Np,it.camelCase=c_,it.capitalize=zp,it.ceil=l1,it.clamp=l_,it.clone=iy,it.cloneDeep=ry,it.cloneDeepWith=oy,it.cloneWith=ny,it.conformsTo=sy,it.deburr=kp,it.defaultTo=U_,it.divide=h1,it.endsWith=f_,it.eq=Uo,it.escape=d_,it.escapeRegExp=p_,it.every=wv,it.find=Mv,it.findIndex=ap,it.findKey=ky,it.findLast=Sv,it.findLastIndex=lp,it.findLastKey=By,it.floor=u1,it.forEach=pp,it.forEachRight=mp,it.forIn=Ny,it.forInRight=Fy,it.forOwn=Uy,it.forOwnRight=Gy,it.get=df,it.gt=ay,it.gte=ly,it.has=Wy,it.hasIn=pf,it.head=up,it.identity=Gr,it.includes=Pv,it.indexOf=S0,it.inRange=h_,it.invoke=qy,it.isArguments=Pl,it.isArray=vi,it.isArrayBuffer=hy,it.isArrayLike=Fr,it.isArrayLikeObject=Dn,it.isBoolean=uy,it.isBuffer=ka,it.isDate=cy,it.isElement=fy,it.isEmpty=dy,it.isEqual=py,it.isEqualWith=my,it.isError=cf,it.isFinite=gy,it.isFunction=js,it.isInteger=Mp,it.isLength=$u,it.isMap=Sp,it.isMatch=vy,it.isMatchWith=yy,it.isNaN=_y,it.isNative=xy,it.isNil=Ty,it.isNull=wy,it.isNumber=Ep,it.isObject=wn,it.isObjectLike=Ln,it.isPlainObject=ou,it.isRegExp=ff,it.isSafeInteger=My,it.isSet=bp,it.isString=Ku,it.isSymbol=to,it.isTypedArray=mh,it.isUndefined=Sy,it.isWeakMap=Ey,it.isWeakSet=by,it.join=P0,it.kebabCase=m_,it.last=bo,it.lastIndexOf=L0,it.lowerCase=g_,it.lowerFirst=v_,it.lt=Cy,it.lte=Ay,it.max=c1,it.maxBy=f1,it.mean=d1,it.meanBy=p1,it.min=m1,it.minBy=g1,it.stubArray=xf,it.stubFalse=wf,it.stubObject=e1,it.stubString=i1,it.stubTrue=n1,it.multiply=v1,it.nth=R0,it.noConflict=q_,it.noop=_f,it.now=Yu,it.pad=y_,it.padEnd=__,it.padStart=x_,it.parseInt=w_,it.random=u_,it.reduce=Dv,it.reduceRight=zv,it.repeat=T_,it.replace=M_,it.result=t_,it.round=y1,it.runInContext=Lt,it.sample=Bv,it.size=Uv,it.snakeCase=S_,it.some=Gv,it.sortedIndex=N0,it.sortedIndexBy=F0,it.sortedIndexOf=U0,it.sortedLastIndex=G0,it.sortedLastIndexBy=H0,it.sortedLastIndexOf=V0,it.startCase=b_,it.startsWith=C_,it.subtract=_1,it.sum=x1,it.sumBy=w1,it.template=A_,it.times=r1,it.toFinite=Xs,it.toInteger=wi,it.toLength=Ap,it.toLower=P_,it.toNumber=Co,it.toSafeInteger=Py,it.toString=Zi,it.toUpper=L_,it.trim=R_,it.trimEnd=O_,it.trimStart=I_,it.truncate=D_,it.unescape=z_,it.uniqueId=s1,it.upperCase=k_,it.upperFirst=mf,it.each=pp,it.eachRight=mp,it.first=up,yf(it,function(){var r={};return Nr(it,function(h,v){Ti.call(it.prototype,v)||(r[v]=h)}),r}(),{chain:!1}),it.VERSION=c,Ji(["bind","bindKey","curry","curryRight","partial","partialRight"],function(r){it[r].placeholder=it}),Ji(["drop","take"],function(r,h){_i.prototype[r]=function(v){v=v===s?1:vn(wi(v),0);var O=this.__filtered__&&!h?new _i(this):this.clone();return O.__filtered__?O.__takeCount__=Vn(v,O.__takeCount__):O.__views__.push({size:Vn(v,It),type:r+(O.__dir__<0?"Right":"")}),O},_i.prototype[r+"Right"]=function(v){return this.reverse()[r](v).reverse()}}),Ji(["filter","map","takeWhile"],function(r,h){var v=h+1,O=v==G||v==Et;_i.prototype[r]=function(Y){var ut=this.clone();return ut.__iteratees__.push({iteratee:si(Y,3),type:v}),ut.__filtered__=ut.__filtered__||O,ut}}),Ji(["head","last"],function(r,h){var v="take"+(h?"Right":"");_i.prototype[r]=function(){return this[v](1).value()[0]}}),Ji(["initial","tail"],function(r,h){var v="drop"+(h?"":"Right");_i.prototype[r]=function(){return this.__filtered__?new _i(this):this[v](1)}}),_i.prototype.compact=function(){return this.filter(Gr)},_i.prototype.find=function(r){return this.filter(r).head()},_i.prototype.findLast=function(r){return this.reverse().find(r)},_i.prototype.invokeMap=ae(function(r,h){return typeof r=="function"?new _i(this):this.map(function(v){return e(v,r,h)})}),_i.prototype.reject=function(r){return this.filter(Ju(si(r)))},_i.prototype.slice=function(r,h){r=wi(r);var v=this;return v.__filtered__&&(r>0||h<0)?new _i(v):(r<0?v=v.takeRight(-r):r&&(v=v.drop(r)),h!==s&&(h=wi(h),v=h<0?v.dropRight(-h):v.take(h-r)),v)},_i.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},_i.prototype.toArray=function(){return this.take(It)},Nr(_i.prototype,function(r,h){var v=/^(?:filter|find|map|reject)|While$/.test(h),O=/^(?:head|last)$/.test(h),Y=it[O?"take"+(h=="last"?"Right":""):h],ut=O||/^find/.test(h);Y&&(it.prototype[h]=function(){var yt=this.__wrapped__,bt=O?[1]:arguments,Bt=yt instanceof _i,oe=bt[0],le=Bt||vi(yt),de=function(Ri){var Ui=Y.apply(it,fo([Ri],bt));return O&&ke?Ui[0]:Ui};le&&v&&typeof oe=="function"&&oe.length!=1&&(Bt=le=!1);var ke=this.__chain__,Je=!!this.__actions__.length,hi=ut&&!ke,Mi=Bt&&!Je;if(!ut&&le){yt=Mi?yt:new _i(this);var ui=r.apply(yt,bt);return ui.__actions__.push({func:Xu,args:[de],thisArg:s}),new qn(ui,ke)}return hi&&Mi?r.apply(this,bt):(ui=this.thru(de),hi?O?ui.value()[0]:ui.value():ui)})}),Ji(["pop","push","shift","sort","splice","unshift"],function(r){var h=On[r],v=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",O=/^(?:pop|shift)$/.test(r);it.prototype[r]=function(){var Y=arguments;if(O&&!this.__chain__){var ut=this.value();return h.apply(vi(ut)?ut:[],Y)}return this[v](function(yt){return h.apply(vi(yt)?yt:[],Y)})}}),Nr(_i.prototype,function(r,h){var v=it[h];if(v){var O=v.name+"";Ti.call(rs,O)||(rs[O]=[]),rs[O].push({name:h,func:v})}}),rs[$i(s,T).name]=[{name:"wrapper",func:s}],_i.prototype.clone=ba,_i.prototype.reverse=Ou,_i.prototype.value=Ca,it.prototype.at=fv,it.prototype.chain=dv,it.prototype.commit=pv,it.prototype.next=mv,it.prototype.plant=vv,it.prototype.reverse=yv,it.prototype.toJSON=it.prototype.valueOf=it.prototype.value=_v,it.prototype.first=it.prototype.head,ns&&(it.prototype[ns]=gv),it},es=Xc();Zr?((Zr.exports=es)._=es,Zo._=es):gn._=es}).call(Er)}(lu,lu.exports);var am=lu.exports;const ec=tc(am);class lm{constructor(a=[],s=!1){Ba(this,"simplifyFunc",a=>{try{a=turf.simplify(a,{tolerance:5e-4,highQuality:!1,mutate:!0})}catch{}return a});mars3d?(this.vectorArr=a,this.geoJsonType=new Map([["Point"],["LineString"],["Polygon"],["MultiPoint"],["MultiLineString"],["MultiPolygon"]]),this.avoidanceArr=[],this.editDate={id:""},this.isDynamicMasking=s,this.disabled=!1):console.error("未引入指定插件")}remove(a,s=null){s&&s.isClone=="true"?window.mapClone.mapEx.removeLayer(window.mapClone.mapEx.getLayer(a,"vectorId")):(window.map.removeLayer(window.map.getLayer(a,"vectorId")),window.dynamicMasking&&window.dynamicMasking.remove(a))}add(a,s){return new Promise((c,f)=>{let u,m=s==null?void 0:s.isClone;if(typeof a!="object"){let g=window.map.getLayer(a,"vectorId");if(g)return c(g);u=this.query(a)}else{let g=window.map.getLayer(a.id,"vectorId");if(g)return c(g);u=a}if(u){let{value:g,url:_,id:S,title:b}=u;new Cesium.Resource({url:_}).fetchJson().then(k=>{let{id:D,title:F,shpInfo:E}=u,{attributes:L,geometryType:T,geometryCount:M,pointCount:R}=E;if(L){let{width:C,materialType:U,materialOptions:N,clampToGround:X,distanceDisplayCondition:K,distanceDisplayCondition_near:Z,distanceDisplayCondition_far:ct,zIndex:Rt,label:tt,fill:_t,diffHeight:G,outline:Pt,outlineStyle:Et,color:At,pixelSize:ce,outlineColor:re,outlineWidth:Ft,classificationType:It,setHeight:Nt}=JSON.parse(L),Pe;switch(tt.height==""&&(tt.height=null),this.isDynamicMasking?(tt.color=Cesium.Color.fromCssColorString(tt.color).withAlpha(0),tt.outlineColor=Cesium.Color.fromCssColorString(tt.outlineColor).withAlpha(.001),tt.backgroundColor=Cesium.Color.fromCssColorString(tt.backgroundColor).withAlpha(.001),tt.background=!1,tt.outline=!1,tt.show=!1):(tt.color=Cesium.Color.fromCssColorString(tt.color),tt.outlineColor=Cesium.Color.fromCssColorString(tt.outlineColor),tt.backgroundColor=Cesium.Color.fromCssColorString(tt.backgroundColor)),T){case"LineString":case"MultiLineString":tt.backgroundPadding=5,Pe=new mars3d.layer.GeoJsonLayer({data:k,vectorId:D,symbol:{type:"polylineC",styleOptions:{width:C,clampToGround:X,distanceDisplayCondition:K,distanceDisplayCondition_far:ct,distanceDisplayCondition_near:Z,materialType:U,materialOptions:N,classificationType:It,setHeight:Nt,label:tt}},hasZIndex:!0,zIndex:Rt});break;case"Polygon":case"MultiPolygon":U=="PolyGrass"&&(N={evenColor:new Cesium.Color(.25,.4,.1,1),oddColor:new Cesium.Color(.1,.1,.1,1),frequency:1.5}),Pe=new mars3d.layer.GeoJsonLayer({data:k,vectorId:D,symbol:{type:"polygon",styleOptions:{fill:_t,diffHeight:G,clampToGround:X,materialType:U,materialOptions:N,distanceDisplayCondition:K,distanceDisplayCondition_far:ct,distanceDisplayCondition_near:Z,outlineStyle:Et,outline:Pt,classificationType:It,setHeight:Nt,label:tt}}});break;case"Point":case"MultiPoint":Pe=new mars3d.layer.GeoJsonLayer({data:k,vectorId:D,symbol:{type:"pointC",styleOptions:{color:At,pixelSize:ce,outline:Pt,outlineColor:re,outlineWidth:Ft,visibleDepth:!1,label:tt}}});break}m?window.mapClone.mapEx.addLayer(Pe):window.map.addLayer(Pe),Pe.bindPopup(Wt=>{if(this.disabled==!0)return!1;let $e='<div class="bim-map-popup">';return Object.keys(Wt.graphic.attr).forEach((Si,Oe)=>{Wt.graphic.attr[Si]&&($e+=`<p><b>${Si}</b> : ${Wt.graphic.attr[Si]}</p>`)}),$e+="</div>",$e});let pe=ec.debounce(Wt=>{window.dynamicMasking.add(Wt,JSON.parse(L))},500);Pe.readyPromise.then(Wt=>{window.dynamicMasking&&pe(Wt),c(Wt)}).catch(Wt=>{console.error("测试shp矢量加载失败",Wt),c({tite:"【矢量】「"+F+"」无法加载",type:"error",id:D,url:_})})}else c({tite:"【矢量】「"+F+"」无法加载",type:"error",id:D,url:_})}).catch(k=>{console.error("数据有误",k),c({tite:"【矢量】「"+b+"」链接地址有误",type:"error",id:S,url:_})})}else c({tite:"【矢量】ID:「"+a+"」已删除",type:"error",id:a})})}updateData(a){this.vectorArr=a}processingKML(a){let s,c=2e3,f=!0,{kmlInfo:u}=a,{fill:m,areaColor:g,areaSideColor:_,transparency:S,isAreaSideColor:b,minDistinct:I,textDistinct:k,textSize:D,textColor:F,fontStyle:E,outLine:L,sideColor:T,backGround:M,backGroundColor:R,clampToGround:C}=u,U={fill:m,color:g,opacity:S||.5,outline:b,outlineColor:_,outlineWidth:2,clampToGround:C,distanceDisplayCondition:!0,distanceDisplayCondition_far:k||1e6,distanceDisplayCondition_near:I||0,classificationType:s,opacity:String(S)},N={text:"{name}",horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffsetY:-10,font_size:26,color:F||"#ffffff",font_family:E||"黑体",outline:L||!0,outlineColor:T||"#000000",outlineWidth:4,scaleByDistance:!0,distanceDisplayCondition:!0,distanceDisplayCondition_far:k||1e6,distanceDisplayCondition_near:I||0,background:M||!1,backgroundColor:R||"",visibleDepth:f,clampToGround:C||!1,disableDepthTestDistance:c};return{...U,label:N}}selected(a){window.map.getLayer(a,"vectorId")&&window.map.getLayer(a,"vectorId").flyTo()}query(a){return this.vectorArr.length==0?!1:this.vectorArr.find(s=>s.id==a)}queryVector(a){return window.map.getLayer(a,"vectorId")}editVector(a,s,c){let f=window.map.getLayer(a,"vectorId"),u=bf(s,c);f&&(f.eachGraphic(m=>{m.label&&m.label.show===!1&&(delete m.label.outline,delete m.label.background,delete m.label.outlineColor,delete m.label.backgroundColor),u.label&&u.label.height==""&&(u.label.height=null),m.setStyle({...u})}),window.dynamicMasking&&dynamicMasking.modify(a,u))}nationalBoundaries(a="/gis/nationalBoundaries.json"){let s=new mars3d.layer.GeoJsonLayer({name:"国界",url:a,vectorId:"border",format:c=>{try{c=turf.simplify(c,{tolerance:1e-5,highQuality:!1,mutate:!0})}catch(f){console.error(f)}return c},symbol:{type:"polylineC",styleOptions:{width:2,materialType:"Color",materialOptions:{color:"#CD9B1D"},distanceDisplayCondition:!0,distanceDisplayCondition_near:1e3,distanceDisplayCondition_far:2e7,clampToGround:!0,classificationType:Cesium.ClassificationType.TERRAIN}}});map.addLayer(s)}switchDynamicMasking(a){this.isDynamicMasking=a}}class hm{constructor(a=[]){mars3d?(this.terrainProviderArr=a,this.terrainProviderId="",this.events={},window.map.on(mars3d.EventType.terrainLoadError,s=>{console.error("地形服务加载失败",s),this.hide()}),window.map.viewer.scene.globe.tileLoadProgressEvent.addEventListener(s=>{window.map.viewer.scene.globe.tilesLoaded&&this.emit("load",s)})):console.error("未引入指定插件")}add(a,s){if(s==null?void 0:s.isClone)mapClone?window.mapClone.mapEx.terrainProvider=window.map.terrainProvider:console.error("副屏幕未初始化");else{let{url:f,id:u}=a;if(this.terrainProviderId==u&&window.map.terrainProvider._layers)return!1;window.map.terrainProvider=mars3d.LayerUtil.createTerrainProvider({imageXyzId:u,type:"xyz",url:f,requestVertexNormals:!0,requestMetadata:!0}),this.terrainProviderId=u}}show(a){(a==null?void 0:a.isClone)?window.mapClone.mapEx.hasTerrain=!0:window.map.hasTerrain=!0}hide(a){(a==null?void 0:a.isClone)?window.mapClone.mapEx.hasTerrain=!1:window.map.hasTerrain=!1}on(a,s){a=="load"?this.events[a]?this.events[a].push(s):this.events[a]=[s]:console.log("未开放自定义")}emit(a,...s){this.events[a]!=null&&this.events[a].forEach(c=>c(...s))}off(a,s){this.events[a]=this.events[a].filter(c=>c!==s)}once(a,s){const c=()=>{s(),this.off(a,c)};this.on(a,c)}addClip(a){return new Promise((s,c)=>{window.bimClip?s(bimClip.clipGisAdd(a)):c("挖洞工具未初始化")})}}class um{constructor(a=[],s){mars3d?(this.elevationImageArr=a,this.elevationImageLayer,s?this.gisTkone={Authorization:`Bearer ${s}`}:this.gisTkone={},this.form={brightnessVal:1.3,msaaSamples:4,surfaceOpacity:1,layerOpacity:1,layerBrightness:2,layerContrast:1,layerHue:0,layerSaturation:1,layerGamma:1},this.tdtLayer=null):console.error("未引入指定插件")}pushVector(a){this.elevationImageArr.push(a)}add(a,s=!0,c){let f;if(typeof a!="object"?f=a:f=a.imageXyzId,window.map.getLayer(f,"imageXyzId"))return!1;const{layerOpacity:u,layerBrightness:m,layerContrast:g,layerHue:_,layerSaturation:S,layerGamma:b,surfaceOpacity:I}=this.exposureEnvironmentSettings();return new Promise((k,D)=>{let F,E,L,T,M,R;if(typeof a!="object"){let C=this.query(a);C||D("缺少树结构");let{gisInfo:U}=C;F=U.id,L=U.order,E=C.url,T=U.minLevel,M=U.maxLevel}else F=a.imageXyzId,E=a.url,L=a.zIndex,T=a.minimumLevel,M=a.maximumLevel,R=a.chinaCRS;this.elevationImageLayer=new mars3d.layer.XyzLayer({imageXyzId:F,type:"xyz",url:E,hasZIndex:!0,zIndex:L.toString(),brightness:m,opacity:u,saturation:S,contrast:g,hue:_,gamma:b,alpha:I,show:!0,minimumLevel:T||0,maximumLevel:M||15,chinaCRS:R,headers:s?this.gisTkone:null}),this.elevationImageLayer.on(mars3d.EventType.load,C=>{k(C)}),window.map.addLayer(this.elevationImageLayer),c&&Object.keys(c).forEach(C=>{this.elevationImageLayer.on(fnType.get(C),U=>{c[C](U)})})})}remove(a){console.log(a),window.map.removeLayer(window.map.getLayer(a,"imageXyzId"))}query(a){return this.elevationImageArr.length==0?!1:this.elevationImageArr.find(s=>s.id==a)}initial(){this.elevationImageArr=[],this.elevationImageLayer=null}exposureEnvironmentSettings(){return localStorage.getItem("environmentSettings")?JSON.parse(localStorage.getItem("environmentSettings")):(localStorage.setItem("environmentSettings",JSON.stringify(this.form)),JSON.parse(JSON.stringify(this.form)))}}class cm{constructor(a,...s){Ba(this,"manualFreed",ec.debounce(()=>{let{lng:a,lat:s,alt:c,pitch:f}=window.map.getCameraView(),u;this.modelArray.forEach(m=>{u=m.releasedDistance?m.releasedDistance:1e4,this.disTance([a,s,c],[m.center._lng,m.center._lat,m.center._alt],this.calculateDistance(f,u))?window.map.getLayer(m.id,"modelId")&&this.emit("leave",m):window.map.getLayer(m.id,"modelId")||this.emit("enter",m)})},200));mars3d?(a&&a!=null&&(this.modelArray=a),this.showModelArray=[],this.Cesium=mars3d.Cesium,this.events={}):console.error("未引入指定插件")}on(a,s){a=="enter"||a=="leave"?this.events[a]?this.events[a].push(s):this.events[a]=[s]:console.log("未开放自定义")}emit(a,...s){this.events[a]!=null&&this.events[a].forEach(c=>c(...s))}off(a,s){this.events[a]=this.events[a].filter(c=>c!==s)}once(a,s){const c=()=>{s(),this.off(a,c)};this.on(a,c)}say(a){return this[a]}add(a,s){this[a].push(s)}remove(a,s){this[a]=this[a].filter(function(c){return c!==s})}initial(){this.modelArray=[],this.events={}}updateCustomExcavationDetails(a,s,c,f=[],u={}){let m,g,_;switch(m=this.modelArray.find(S=>S.modelId==a).customize.bimModelExcavationDetails,_=m.find((S,b)=>{if(S.id==s)return g=b,S}),c){case"delete":m.splice(g,1);break;case"update":_.excavationDetails=f;break;case"add":m.push(u);break;case"edit":_.excavationDetails=u.excavationDetails,_.kId=u.kId;break}return m}resourceRelease(){window.map.viewer.camera.moveEnd.addEventListener(()=>{this.freed()})}freed(){let{alt:a}=window.map.getCameraView();a<2e4&&(this.freed=ec.throttle(()=>{let{lng:s,lat:c,alt:f,pitch:u}=window.map.getCameraView();this.modelArray&&this.modelArray.forEach(m=>{let g=m.bimModel.releasedDistance?m.bimModel.releasedDistance:1e4;m.center&&this.disTance([s,c,f],[m.center._lng,m.center._lat,m.center._alt],this.calculateDistance(u,g))?window.map.getLayer(m.id,"modelId")&&this.emit("leave",m):this.showModelArray.indexOf(m.id)>=0&&!window.map.getLayer(m.id,"modelId")&&this.emit("enter",m)})},2e3),this.freed())}findPnodeId(a,s,c="id"){let f;if(a){for(var u=0;u<a.length;u++){let m=a[u];if(m[c]==s)return f=m,f;if(m.children&&m.children.length>0&&(f=this.findPnodeId(m.children,s,c),f))return f}return f}}disTance(a,s,c){let f,u,m;return f=Cesium.Cartesian3.fromDegrees(...a),u=Cesium.Cartesian3.fromDegrees(...s),m=Cesium.Cartesian3.distance(f,u),m>c}calculateDistance(a,s){let c=(a+180)%360-180;c=Math.max(-90,Math.min(c,90));let f=(s-s/5)*(Math.abs(c)/90)+s/5;return Math.round(f)}}class fm{constructor(a=[],s){mars3d?(this.entityArr=a,this.entityLayer=new mars3d.layer.GraphicLayer({entityId:"bimEntity"}),window.map.addLayer(this.entityLayer),this.entityItem=null,this.events={},this.entityCloneLayer):console.error("未引入指定插件")}on(a,s){a=="change"||a=="collection"?this.events[a]?this.events[a].push(s):this.events[a]=[s]:console.log("未开放自定义")}emit(a,...s){this.events[a]!=null&&this.events[a].forEach(c=>c(...s))}off(a,s){this.events[a]=this.events[a].filter(c=>c!==s)}offAll(){this.events={}}once(a,s){const c=()=>{s(),this.off(a,c)};this.on(a,c)}add(a,s=null,c){return new Promise((f,u)=>{var m;if(this.entityLayer){let g,_,S;if(c==null?void 0:c.isClone)this.entityCloneLayer&&(_=this.query(a),_?(S=JSON.parse(_.bimPlanPainting.graphic),S.attr=S.attr||{},S.attr.entityId=a,this.entityCloneLayer.addGraphic(S)):f({tite:"【标绘】 ID:「"+a+"」已删除",type:"error",id:a}));else{if(typeof a!="object"?(g=this.entityLayer.getGraphicByAttr(a,"entityId"),_=this.query(a),_?(S=JSON.parse(_.bimPlanPainting.graphic),S.attr=S.attr||{},S.attr.entityId=a):f({tite:"【标绘】ID:「"+a+"」已删除",type:"error",id:a})):(g=this.entityLayer.getGraphicByAttr(a.id,"entityId"),S=JSON.parse(JSON.stringify(a)),S.attr=S.attr||{},S.attr.entityId=S.attr.entityId||s,S.attr==null?S.attr={entityId:a.id}:((m=S.attr)==null?void 0:m.entityId)==null&&s&&(S.attr.entityId=s)),g)return f();this.entityLayer.addGraphic(S),f(S)}}else f(),console.error("未初始化标绘实例图层")})}query(a){return this.entityArr.length==0?!1:this.entityArr.find(s=>s.id==a)}queryEntity(a){if(bimEntity.entityLayer)return bimEntity.entityLayer.getGraphicByAttr(a,"entityId")}selected(a,s=null){let c=this.entityLayer.getGraphicByAttr(a,"entityId");s==null||s.isClone,(c.options.type=="div"||c.options.type=="point")&&c._point?c.flyTo({radius:c._point._alt+500<500?5e3:c._point._alt+500}):c.flyTo()}remove(a,s=null){var f,u;(s==null?void 0:s.isClone)?this.entityCloneLayer&&((f=this.entityCloneLayer.getGraphicByAttr(a,"entityId"))==null||f.remove()):this.entityLayer.getGraphicByAttr(a,"entityId")&&((u=this.entityLayer.getGraphicByAttr(a,"entityId"))==null||u.remove(),this.entityItem&&(this.entityItem._state=="destroy"||this.entityItem.options.attr.entityId==a)&&(this.entityItem=null))}entityCloneLayerInit(){(this.entityCloneLayer==null||this.entityCloneLayer.state=="destroy")&&(this.entityCloneLayer=window.mapClone._mapEx.getLayer("bimEntity","entityId"))}entityCloneLayerRemove(){this.entityCloneLayer.remove(),this.entityCloneLayer=null}removeEntityItem(){this.entityItem=null}updateData(a){this.entityArr=a}startDrawGraphic(a){return new Promise((s,c)=>{let{type:f,style:u}=a;if(a.drawShow=!1,f=="div")if(u.html)this.entityLayer.startDraw(a).then(m=>{setTimeout(()=>{this.entityItem=m,this.entityLayer.startEditing(m)},500)});else{let{title:m,divType:g,theme_color:_,font_color:S,scaleByDistance:b,scaleByDistance_far:I,scaleByDistance_farValue:k,scaleByDistance_near:D,scaleByDistance_nearValue:F,distanceDisplayCondition:E,distanceDisplayCondition_far:L,distanceDisplayCondition_near:T,clampToGround:M}=u,R={type:"div",style:{pointerEvents:!0,scaleByDistance:b,scaleByDistance_far:I,scaleByDistance_farValue:k,scaleByDistance_near:D,scaleByDistance_nearValue:F,distanceDisplayCondition:E,distanceDisplayCondition_far:L,distanceDisplayCondition_near:T,clampToGround:M,horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}};switch(g){case"1":R.style.html=`<div class="entity-div-style entity-div-style1" style="--theme-color1:${_};--theme-font-color1:${S};">
2641
2641
  <div class="title">${m}</div>
2642
2642
  </div>`,R.style.horizontalOrigin=Cesium.HorizontalOrigin.CENTER;break}this.entityLayer.startDraw(R).then(C=>{setTimeout(()=>{this.entityItem=C,this.entityLayer.startEditing(C),s(C)},500)})}else this.entityLayer.startDraw(a).then(m=>{setTimeout(()=>{this.entityItem=m,this.entityLayer.startEditing(m),s(m)},500)})})}stopDraw(a=!0){this.entityLayer&&this.entityLayer.stopDraw(),a&&this.entityItem&&(this.entityItem.stopEditing(),this.entityItem.remove(),this.entityItem=null)}updateEntityItem(a){let s=this.entityLayer.getGraphicByAttr(a,"entityId");s?this.entityItem=s:this.removeEntityItem()}edit(a,s,c,f){let u=bf(s,c);if(s.vectorStyle&&this.entityItem)if(s.vectorStyle.divType==5)this.entityItem.setStyle({...u,horizontalOrigin:Cesium.HorizontalOrigin.LEFT});else{if(this.entityItem.type=="circleP"&&Object.keys(u).length==1&&Object.keys(u)[0]=="radius"&&u.radius==this.entityItem.options.style.radius)return!1;this.entityItem.setStyle({...u,horizontalOrigin:Cesium.HorizontalOrigin.CENTER})}}enableDragging(a=!0){a?this.entityLayer.startEditing(this.entityItem):(this.entityLayer.stopDraw(),this.entityItem&&this.entityItem.stopEditing())}addRightMenu(){this.entityLayer.bindContextMenu([{text:"编辑对象",callback:a=>{this.emit("change",a)}},{text:"收藏对象",callback:a=>{this.emit("collection",a)}}])}removeRightMenu(){this.entityLayer.hasContextMenu()&&this.entityLayer.unbindContextMenu()}processDivData(a){let s={"--theme-color1":"theme_color","--theme-font-color1":"font_color","--theme-color2":"theme_color2","--theme-color3":"theme_color3"},c={title:"",theme_color:"",font_color:"",content:"",divType:"",divStyle:{},isMirror:!1};const f=document.createElement("div");f.innerHTML=a;const u=f.querySelector(".entity-div-style");return console.log("解耦",u),Object.keys(s).forEach(m=>{m=="--theme-color2"||m=="--theme-color3"?c.divStyle[s[m]]=u.style.getPropertyValue(m)||"#fff":c[s[m]]=u.style.getPropertyValue(m)}),c.title=u.querySelector(".title")?u.querySelector(".title").innerText:"标题",c.content=u.querySelector(".content")?u.querySelector(".content").innerText:"内容",c.divType=u.classList[1]?u.classList[1].replace("entity-div-style",""):"",c.isMirror=u.classList.contains("isMirror"),console.log("解耦",c),c}updateHtml(a,s){let{theme_color:c,font_color:f,title:u,content:m,divStyle:g}=s,{theme_color2:_,theme_color3:S}=g,b="";switch(a){case"1":b=`<div class="entity-div-style entity-div-style1" style="--theme-color1:${c};--theme-font-color1:${f};">
2643
2643
  <div class="title">${u}</div>
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "chbim-plugins",
3
3
  "private": false,
4
- "version": "0.0.150",
4
+ "version": "0.0.151",
5
5
  "description": "此插件和chbim云平台强绑定",
6
6
  "main": "chbim-plugins.js",
7
- "keywords": [
8
- "vue",
9
- "Cesium"
10
- ],
7
+ "keywords": ["vue", "Cesium"],
11
8
  "author": "zhang",
12
9
  "license": "ISC"
13
10
  }
package/README.md DELETED
@@ -1,273 +0,0 @@
1
- <br />
2
-
3
- <p align="center">
4
- <a href="#">
5
- <img src="https://chbim.ccshcc.cn/baseResources//Logo/Logo.png" alt="Logo" height="60">
6
- </a>
7
- <h3 align="center">基于<font color="#4bbbef"> CHBIM云平台 </font>服务的插件</h3>
8
-
9
- </p>
10
-
11
- ## 使用指南
12
-
13
- 1. 此插件和 CHBIM 平台强绑定
14
- 2. node 版本>=16.14.2
15
-
16
- #### 安装
17
-
18
- ```sh
19
- npm i chbim-plugins
20
- ```
21
-
22
- #### 引入
23
-
24
- ```sh
25
- import "chbim-plugins/style.css";
26
- import { ChbimPlugins } from "chbim-plugins";
27
- ......
28
- ......
29
- ......
30
- app.use(ChbimPlugins);
31
- ```
32
-
33
- #### 使用
34
-
35
- 在需要使用的.vue 文件里面引入
36
-
37
- ```sh
38
- import {
39
- BimTerrainProvider, // 地形
40
- BimElevationImage, // 瓦片
41
- BimModel, // 模型
42
- BimVector, // 矢量
43
- BimEntity, // 注记
44
- PanoramicView, // 全景图
45
- ......
46
- } from "chbim-plugins";
47
- ```
48
-
49
- 添加模型为例:
50
-
51
- ```
52
- /* data 为模型树的扁平化json */
53
- window.bimModel = new BimModel(data);
54
-
55
- /* 给地图添加模型
56
- ** id => 模型id
57
- ** fn => 自定义注册事件
58
- */
59
- window.bimModel.add(id,fn).then((e) => {
60
- if (e.type == "error") {
61
- console.error('失败')
62
- }
63
- }).catch((e) => {
64
- console.error('失败')
65
- })
66
- ```
67
-
68
- ### API
69
-
70
- #### window.bimElevationImage `影像`
71
-
72
- ##### add( id || xyzParameter,isGisTkone,fn)添加影像
73
-
74
- | 类参数名 | 类型 | 默认参数 | 描述 |
75
- | ------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
76
- | id | String | “ ” | 需要添加的影像 id |
77
- | xyzParameter | Object | { } | 三方影像数据 `{imageXyzId:影像id,url:影像路由,zIndex:影像层级,minimumLevel:服务支持的最小层级,maximumLevel:服务支持的最大层级,chinaCRS:标识瓦片的国内坐标系(用于自动纠偏或加偏)}` chinaCRS 默认 GCJ02 |
78
- | isGisTkone | Boolean | true | 是否开启 Tkone 验证,三方影像不需要开启验证 |
79
- | fn | Object | { } | 例如:绑定 click 事件 `{ click: (e) => { console.log(e) } }` |
80
-
81
- ##### remove( id )添加影像
82
-
83
- | 类参数名 | 类型 | 默认参数 | 描述 |
84
- | -------- | ------ | -------- | ----------------- |
85
- | id | String | “ ” | 需要移除的影像 id |
86
-
87
- ##### query( id )查询影像的数据
88
-
89
- | 类参数名 | 类型 | 默认参数 | 描述 |
90
- | -------- | ------ | -------- | ------------------------------- |
91
- | id | String | “ ” | 需要查询的模型 id,返回模型数据 |
92
-
93
- <br /><br />
94
-
95
- #### window.bimModel `模型`
96
-
97
- ##### add( id,fn,list )添加模型
98
-
99
- | 类参数名 | 类型 | 默认参数 | 描述 |
100
- | -------- | ------ | -------- | ------------------------------------------------------------ |
101
- | id | String | “ ” | 需要添加的模型 id |
102
- | fn | Object | { } | 例如:绑定 click 事件 `{ click: (e) => { console.log(e) } }` |
103
- | list | Object | { } | 字段目前用于处理分屏数据 `{ isClone:true }` |
104
-
105
- ##### remove( id,list )移除模型
106
-
107
- | 类参数名 | 类型 | 默认参数 | 描述 |
108
- | -------- | ------ | -------- | ------------------------------------------- |
109
- | id | String | “ ” | 需要移除的模型 id |
110
- | list | Object | { } | 字段目前用于处理分屏数据 `{ isClone:true }` |
111
-
112
- ##### selected( id )选中模型
113
-
114
- | 类参数名 | 类型 | 默认参数 | 描述 |
115
- | -------- | ------- | -------- | ------------------------------------------------------------ |
116
- | id | String | “ ” | 需要选中的模型 id |
117
- | fn | Object | { } | 例如:绑定 click 事件 `{ click: (e) => { console.log(e) } }` |
118
- | list | Object | { } | 字段目前用于处理分屏数据 `{ isClone:true }` |
119
- | flyTo | Boolean | true | 默认会自动飞行,模型选中变红,设置`false`不会飞行 |
120
-
121
- ##### query( id )查询模型的数据
122
-
123
- | 类参数名 | 类型 | 默认参数 | 描述 |
124
- | -------- | ------ | -------- | ------------------------------- |
125
- | id | String | “ ” | 需要查询的模型 id,返回模型数据 |
126
-
127
- ##### queryModel( id )查询 map 上模型的实体
128
-
129
- | 类参数名 | 类型 | 默认参数 | 描述 |
130
- | -------- | ------ | -------- | ------------------------------- |
131
- | id | String | “ ” | 需要查询的模型 id,返回模型实体 |
132
-
133
- ##### editColor( id,newColor,list )模型染色
134
-
135
- | 类参数名 | 类型 | 默认参数 | 描述 |
136
- | -------- | ------ | -------- | ------------------------------------------- |
137
- | id | String | “ ” | 模型 id |
138
- | newColor | String | “ ” | css 颜色值 |
139
- | list | Object | { } | 字段目前用于处理分屏数据 `{ isClone:true }` |
140
-
141
- ##### editOpacity( id,opacity)模型染色
142
-
143
- | 类参数名 | 类型 | 默认参数 | 描述 |
144
- | -------- | ------ | -------- | ------------ |
145
- | id | String | “ ” | 模型 id |
146
- | opacity | String | “ ” | 透明度值 0~1 |
147
-
148
- <br /><br />
149
-
150
- #### window.bimVector `矢量`
151
-
152
- ##### add( id,list )添加矢量
153
-
154
- | 类参数名 | 类型 | 默认参数 | 描述 |
155
- | -------- | ------ | -------- | ------------------------------------------- |
156
- | id | Object | “ ” | 需要添加的矢量 id |
157
- | list | Object | { } | 字段目前用于处理分屏数据 `{ isClone:true }` |
158
-
159
- ##### remove( id,list )移除矢量
160
-
161
- | 类参数名 | 类型 | 默认参数 | 描述 |
162
- | -------- | ------ | -------- | ------------------------------------------- |
163
- | id | String | “ ” | 需要移除的矢量 id |
164
- | list | Object | { } | 字段目前用于处理分屏数据 `{ isClone:true }` |
165
-
166
- ##### selected( id )添加矢量
167
-
168
- | 类参数名 | 类型 | 默认参数 | 描述 |
169
- | -------- | ------ | -------- | ------------------------------------------ |
170
- | id | Object | “ ” | 需要选中的矢量 id ,选中会飞行到选中的矢量 |
171
-
172
- ##### query( id )查询矢量数据
173
-
174
- | 类参数名 | 类型 | 默认参数 | 描述 |
175
- | -------- | ------ | -------- | -------------------------------- |
176
- | id | Object | “ ” | 需要选中的矢量 id ,返回矢量数据 |
177
-
178
- ##### queryVector( id )查询矢量实体
179
-
180
- | 类参数名 | 类型 | 默认参数 | 描述 |
181
- | -------- | ------ | -------- | -------------------------------- |
182
- | id | Object | “ ” | 需要选中的矢量 id ,返回矢量实体 |
183
-
184
- <br /><br />
185
-
186
- #### window.bimEntity `标绘`
187
-
188
- ##### add( id,entityId,list )添加标绘
189
-
190
- | 类参数名 | 类型 | 默认参数 | 描述 |
191
- | -------- | ------ | -------- | ----------------------------------------------- |
192
- | id | Object | “ ” | 需要添加的标绘 id |
193
- | entityId | String | null | 临时添加的标绘是不带 id 的,需要自定义的一个 id |
194
- | list | Object | { } | 字段目前用于处理分屏数据 `{ isClone:true }` |
195
-
196
- ##### remove( id,list )移除标绘
197
-
198
- | 类参数名 | 类型 | 默认参数 | 描述 |
199
- | -------- | ------ | -------- | ------------------------------------------- |
200
- | id | String | “ ” | 需要移除的标绘 id |
201
- | list | Object | { } | 字段目前用于处理分屏数据 `{ isClone:true }` |
202
-
203
- ##### query( id )查询标绘数据
204
-
205
- | 类参数名 | 类型 | 默认参数 | 描述 |
206
- | -------- | ------ | -------- | -------------------------------- |
207
- | id | Object | “ ” | 需要选中的矢量 id ,返回矢量数据 |
208
-
209
- ##### queryEntity( id )查询标绘实体
210
-
211
- | 类参数名 | 类型 | 默认参数 | 描述 |
212
- | -------- | ------ | -------- | -------------------------------- |
213
- | id | Object | “ ” | 需要选中的矢量 id ,返回矢量实体 |
214
-
215
- <br /><br />
216
-
217
- #### window.bimModify `环境修改`
218
-
219
- ##### evnModifyById( id,list )添加环境修改
220
-
221
- | 类参数名 | 类型 | 默认参数 | 描述 |
222
- | -------- | ------ | -------- | ------------------------------------------- |
223
- | id | Object | “ ” | 需要添加的环境修改的 id |
224
- | list | Object | { } | 字段目前用于处理分屏数据 `{ isClone:true }` |
225
-
226
- ##### clearEvnModifyById( id,list )移除环境修改
227
-
228
- | 类参数名 | 类型 | 默认参数 | 描述 |
229
- | -------- | ------ | -------- | ------------------------------------------- |
230
- | id | String | “ ” | 需要移除的环境修改 id |
231
- | list | Object | { } | 字段目前用于处理分屏数据 `{ isClone:true }` |
232
-
233
- ##### clearAllModelModify( list )移除所有对于模型的环境修改
234
-
235
- | 类参数名 | 类型 | 默认参数 | 描述 |
236
- | -------- | ------ | -------- | ------------------------------------------- |
237
- | list | Object | { } | 字段目前用于处理分屏数据 `{ isClone:true }` |
238
-
239
- ##### clearAllTerrainModify( list )移除所有对于地形的环境修改
240
-
241
- | 类参数名 | 类型 | 默认参数 | 描述 |
242
- | -------- | ------ | -------- | ------------------------------------------- |
243
- | list | Object | { } | 字段目前用于处理分屏数据 `{ isClone:true }` |
244
-
245
- ##### clearAllEvnModify()移除所有的环境修改
246
-
247
- <br /><br />
248
-
249
- #### window.Bimroaming `漫游`
250
-
251
- ##### init( viewPoints, savePoint, option )初始化漫游
252
-
253
- | 类参数名 | 类型 | 默认参数 | 描述 |
254
- | ---------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
255
- | viewPoints | Array | [] | 漫游路径的点集,每个点是一个对象{lng: 0, lat: 0, alt: 0} |
256
- | savePoint | Function | null | 新增点的回调函数 |
257
- | option | Object | { } | 漫游配置项 followedX:距离视角的距离, followedZ:距离视角垂直高度,smooth:平衡值使漫游转角顺滑, speed:飞行速度 ,Viewovalue:类型 (1:第一人称 2:跟随 3:俯视) |
258
-
259
- ##### startDrawGraphic()添加点
260
-
261
- ##### start()开始漫游
262
-
263
- ##### pause()暂停漫游
264
-
265
- ##### resume()继续漫游
266
-
267
- ##### stop()停止漫游
268
-
269
- ##### remove()移除漫游
270
-
271
- ### 版本控制
272
-
273
- 该项目使用 Git 进行版本管理。