chbim-plugins 0.1.7 → 0.1.8
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 +2 -13
- package/chbim-plugins.umd.cjs +1 -1
- package/package.json +1 -1
package/chbim-plugins.js
CHANGED
|
@@ -24366,17 +24366,6 @@ class x1 {
|
|
|
24366
24366
|
});
|
|
24367
24367
|
});
|
|
24368
24368
|
}
|
|
24369
|
-
// /**
|
|
24370
|
-
// * 三方注记
|
|
24371
|
-
// * @param { Object || String } xyzParameter 影像属性 或者 影像id
|
|
24372
|
-
// * @param { Object || String } isGisTkone
|
|
24373
|
-
// * @param { Object } fn 监听函数
|
|
24374
|
-
// *
|
|
24375
|
-
// */
|
|
24376
|
-
// addTdt() {
|
|
24377
|
-
// if (this.tdtLayer == null) {
|
|
24378
|
-
// }
|
|
24379
|
-
// }
|
|
24380
24369
|
/**
|
|
24381
24370
|
* 移除影像方法
|
|
24382
24371
|
* @param { String } id 影像id
|
|
@@ -24686,7 +24675,7 @@ class T1 {
|
|
|
24686
24675
|
if (this.entityLayer) {
|
|
24687
24676
|
let g, v, S;
|
|
24688
24677
|
if (c == null ? void 0 : c.isClone)
|
|
24689
|
-
this.entityCloneLayer && (v = this.query(a), v ? (S = JSON.parse(v.bimPlanPainting.graphic), S.attr = S.attr || {}, S.attr.entityId = a, this.entityCloneLayer.addGraphic(S)) : f({
|
|
24678
|
+
this.entityCloneLayer && (v = this.query(a), v ? (S = v.bimPlanPainting ? JSON.parse(v.bimPlanPainting.graphic) : JSON.parse(v.graphic), S.attr = S.attr || {}, S.attr.entityId = a, this.entityCloneLayer.addGraphic(S)) : f({
|
|
24690
24679
|
tite: "【标绘】 ID:「" + a + "」已删除",
|
|
24691
24680
|
type: "error",
|
|
24692
24681
|
id: a
|
|
@@ -24695,7 +24684,7 @@ class T1 {
|
|
|
24695
24684
|
if (typeof a != "object" ? (g = this.entityLayer.getGraphicByAttr(
|
|
24696
24685
|
a,
|
|
24697
24686
|
"entityId"
|
|
24698
|
-
), v = this.query(a), v ? (S = JSON.parse(v.bimPlanPainting.graphic), S.attr = S.attr || {}, S.attr.entityId = a) : f({
|
|
24687
|
+
), v = this.query(a), v ? (S = v.bimPlanPainting ? JSON.parse(v.bimPlanPainting.graphic) : JSON.parse(v.graphic), S.attr = S.attr || {}, S.attr.entityId = a) : f({
|
|
24699
24688
|
tite: "【标绘】ID:「" + a + "」已删除",
|
|
24700
24689
|
type: "error",
|
|
24701
24690
|
id: a
|
package/chbim-plugins.umd.cjs
CHANGED
|
@@ -2633,7 +2633,7 @@ __p += '`),Ui&&(de+=`' +
|
|
|
2633
2633
|
function print() { __p += __j.call(arguments, '') }
|
|
2634
2634
|
`:`;
|
|
2635
2635
|
`)+de+`return __p
|
|
2636
|
-
}`;var Mi=Np(function(){return Fi(ut,Ze+"return "+de).apply(o,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,y){if(r=Zi(r),r&&(y||h===o))return _a(r);if(!r||!(h=Ye(h)))return r;var D=ar(r),Y=ar(h),ut=es(D,Y),yt=Cs(D,Y)+1;return xn(D,ut,yt).join("")}function O_(r,h,y){if(r=Zi(r),r&&(y||h===o))return r.slice(0,xa(r)+1);if(!r||!(h=Ye(h)))return r;var D=ar(r),Y=Cs(D,ar(h))+1;return xn(D,0,Y).join("")}function I_(r,h,y){if(r=Zi(r),r&&(y||h===o))return r.replace(lo,"");if(!r||!(h=Ye(h)))return r;var D=ar(r),Y=es(D,ar(h));return xn(D,Y).join("")}function D_(r,h){var y=ct,D=Rt;if(wn(h)){var Y="separator"in h?h.separator:Y;y="length"in h?wi(h.length):y,D="omission"in h?Ye(h.omission):D}r=Zi(r);var ut=r.length;if(Ir(r)){var yt=ar(r);ut=yt.length}if(y>=ut)return r;var bt=y-$r(D);if(bt<1)return D;var Bt=yt?xn(yt,0,bt).join(""):r.slice(0,bt);if(Y===o)return Bt+D;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===o?bt:de)}}else if(r.indexOf(Ye(Y),bt)!=bt){var ke=Bt.lastIndexOf(Y);ke>-1&&(Bt=Bt.slice(0,ke))}return Bt+D}function z_(r){return r=Zi(r),r&&Yo.test(r)?r.replace(Ao,th):r}var k_=ze(function(r,h,y){return r+(y?" ":"")+h.toUpperCase()}),mf=Me("toUpperCase");function Bp(r,h,y){return r=Zi(r),h=y?o:h,h===o?Rs(r)?jc(r):rl(r):r.match(h)||[]}var Np=ae(function(r,h){try{return yr(r,o,h)}catch(y){return cf(y)?y:new ai(y)}}),B_=Ws(function(r,h){return Ji(h,function(y){y=cs(y),Bo(r,y,hf(r[y],r))}),r});function N_(r){var h=r==null?0:r.length,y=si();return r=h?Yi(r,function(D){if(typeof D[1]!="function")throw new lr(m);return[y(D[0]),D[1]]}):[],ae(function(D){for(var Y=-1;++Y<h;){var ut=r[Y];if(yr(ut[0],this,D))return yr(ut[1],this,D)}})}function F_(r){return Oa(wr(r,O))}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,O))}function V_(r){return gt(wr(r,O))}function W_(r,h){return Ct(r,wr(h,O))}var j_=ae(function(r,h){return function(y){return e(y,r,h)}}),X_=ae(function(r,h){return function(y){return e(r,y,h)}});function yf(r,h,y){var D=Jn(h),Y=Gs(h,D);y==null&&!(wn(h)&&(Y.length||!D.length))&&(y=h,h=r,r=this,Y=Gs(h,Jn(h)));var ut=!(wn(y)&&"chain"in y)||!!y.chain,yt=Xs(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 $(h,r)})}var Z_=Nn(Yi),J_=Nn(Bh),$_=Nn(Po);function Fp(r){return nf(r)?Ko(cs(r)):$t(r)}function K_(r){return function(h){return r==null?o:hs(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 y=It,D=Vn(r,It);h=si(h),r-=It;for(var Y=Ro(D,h);++y<r;)h(y);return Y}function o1(r){return vi(r)?Yi(r,cs):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):o}function f1(r,h){return r&&r.length?Mo(r,si(h,2),uh):o}function d1(r){return ya(r,Gr)}function p1(r,h){return ya(r,si(h,2))}function m1(r){return r&&r.length?Mo(r,Gr,rt):o}function g1(r,h){return r&&r.length?Mo(r,si(h,2),rt):o}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?ts(r,Gr):0}function w1(r,h){return r&&r.length?ts(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=Al,it.isArray=vi,it.isArrayBuffer=hy,it.isArrayLike=Fr,it.isArrayLikeObject=Dn,it.isBoolean=uy,it.isBuffer=Ba,it.isDate=cy,it.isElement=fy,it.isEmpty=dy,it.isEqual=py,it.isEqualWith=my,it.isError=cf,it.isFinite=gy,it.isFunction=Xs,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=qs,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,y){Ti.call(it.prototype,y)||(r[y]=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(y){y=y===o?1:vn(wi(y),0);var D=this.__filtered__&&!h?new _i(this):this.clone();return D.__filtered__?D.__takeCount__=Vn(y,D.__takeCount__):D.__views__.push({size:Vn(y,It),type:r+(D.__dir__<0?"Right":"")}),D},_i.prototype[r+"Right"]=function(y){return this.reverse()[r](y).reverse()}}),Ji(["filter","map","takeWhile"],function(r,h){var y=h+1,D=y==G||y==Et;_i.prototype[r]=function(Y){var ut=this.clone();return ut.__iteratees__.push({iteratee:si(Y,3),type:y}),ut.__filtered__=ut.__filtered__||D,ut}}),Ji(["head","last"],function(r,h){var y="take"+(h?"Right":"");_i.prototype[r]=function(){return this[y](1).value()[0]}}),Ji(["initial","tail"],function(r,h){var y="drop"+(h?"":"Right");_i.prototype[r]=function(){return this.__filtered__?new _i(this):this[y](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(y){return e(y,r,h)})}),_i.prototype.reject=function(r){return this.filter(Ju(si(r)))},_i.prototype.slice=function(r,h){r=wi(r);var y=this;return y.__filtered__&&(r>0||h<0)?new _i(y):(r<0?y=y.takeRight(-r):r&&(y=y.drop(r)),h!==o&&(h=wi(h),y=h<0?y.dropRight(-h):y.take(h-r)),y)},_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 y=/^(?:filter|find|map|reject)|While$/.test(h),D=/^(?:head|last)$/.test(h),Y=it[D?"take"+(h=="last"?"Right":""):h],ut=D||/^find/.test(h);Y&&(it.prototype[h]=function(){var yt=this.__wrapped__,bt=D?[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 D&&ke?Ui[0]:Ui};le&&y&&typeof oe=="function"&&oe.length!=1&&(Bt=le=!1);var ke=this.__chain__,Ze=!!this.__actions__.length,hi=ut&&!ke,Mi=Bt&&!Ze;if(!ut&&le){yt=Mi?yt:new _i(this);var ui=r.apply(yt,bt);return ui.__actions__.push({func:Xu,args:[de],thisArg:o}),new qn(ui,ke)}return hi&&Mi?r.apply(this,bt):(ui=this.thru(de),hi?D?ui.value()[0]:ui.value():ui)})}),Ji(["pop","push","shift","sort","splice","unshift"],function(r){var h=On[r],y=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",D=/^(?:pop|shift)$/.test(r);it.prototype[r]=function(){var Y=arguments;if(D&&!this.__chain__){var ut=this.value();return h.apply(vi(ut)?ut:[],Y)}return this[y](function(yt){return h.apply(vi(yt)?yt:[],Y)})}}),Nr(_i.prototype,function(r,h){var y=it[h];if(y){var D=y.name+"";Ti.call(os,D)||(os[D]=[]),os[D].push({name:h,func:y})}}),os[$i(o,w).name]=[{name:"wrapper",func:o}],_i.prototype.clone=Ca,_i.prototype.reverse=Ou,_i.prototype.value=Aa,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,rs&&(it.prototype[rs]=gv),it},is=Xc();Zr?((Zr.exports=is)._=is,Jo._=is):gn._=is}).call(Er)}(lu,lu.exports);var am=lu.exports;const ec=tc(am);class lm{constructor(a=[],o=!1){Ho(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=o,this.disabled=!1)}remove(a,o=null){o&&o.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,o){return new Promise((c,f)=>{let u,m=o==null?void 0:o.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:v,id:S,title:b}=u;new Cesium.Resource({url:v}).fetchJson().then(k=>{let{id:I,title:N,shpInfo:E}=u,{attributes:P,geometryType:w,geometryCount:M,pointCount:R}=E;if(P){let{width:C,materialType:U,materialOptions:F,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(P),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)),w){case"LineString":case"MultiLineString":tt.backgroundPadding=5,Pe=new mars3d.layer.GeoJsonLayer({data:k,vectorId:I,symbol:{type:"polylineC",styleOptions:{width:C,clampToGround:X,distanceDisplayCondition:K,distanceDisplayCondition_far:ct,distanceDisplayCondition_near:Z,materialType:U,materialOptions:F,classificationType:It,setHeight:Nt,label:tt}},hasZIndex:!0,zIndex:Rt});break;case"Polygon":case"MultiPolygon":U=="PolyGrass"&&(F={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:I,symbol:{type:"polygon",styleOptions:{fill:_t,diffHeight:G,clampToGround:X,materialType:U,materialOptions:F,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:I,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(P))},500);Pe.readyPromise.then(Wt=>{window.dynamicMasking&&pe(Wt),c(Wt)}).catch(Wt=>{c({tite:"【矢量】「"+N+"」无法加载",type:"error",id:I,url:v})})}else c({tite:"【矢量】「"+N+"」无法加载",type:"error",id:I,url:v})}).catch(k=>{c({tite:"【矢量】「"+b+"」链接地址有误",type:"error",id:S,url:v})})}else c({tite:"【矢量】ID:「"+a+"」已删除",type:"error",id:a})})}updateData(a){this.vectorArr=a}processingKML(a){let o,c=2e3,f=!0,{kmlInfo:u}=a,{fill:m,areaColor:g,areaSideColor:v,transparency:S,isAreaSideColor:b,minDistinct:O,textDistinct:k,textSize:I,textColor:N,fontStyle:E,outLine:P,sideColor:w,backGround:M,backGroundColor:R,clampToGround:C}=u,U={fill:m,color:g,opacity:S||.5,outline:b,outlineColor:v,outlineWidth:2,clampToGround:C,distanceDisplayCondition:!0,distanceDisplayCondition_far:k||1e6,distanceDisplayCondition_near:O||0,classificationType:o,opacity:String(S)},F={text:"{name}",horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffsetY:-10,font_size:26,color:N||"#ffffff",font_family:E||"黑体",outline:P||!0,outlineColor:w||"#000000",outlineWidth:4,scaleByDistance:!0,distanceDisplayCondition:!0,distanceDisplayCondition_far:k||1e6,distanceDisplayCondition_near:O||0,background:M||!1,backgroundColor:R||"",visibleDepth:f,clampToGround:C||!1,disableDepthTestDistance:c};return{...U,label:F}}selected(a){window.map.getLayer(a,"vectorId")&&window.map.getLayer(a,"vectorId").flyTo()}query(a){return this.vectorArr.length==0?!1:this.vectorArr.find(o=>o.id==a)}queryVector(a){return window.map.getLayer(a,"vectorId")}editVector(a,o,c){let f=window.map.getLayer(a,"vectorId"),u=bf(o,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 o=new mars3d.layer.GeoJsonLayer({name:"国界",url:a,vectorId:"border",format:c=>{try{c=turf.simplify(c,{tolerance:1e-5,highQuality:!1,mutate:!0})}catch{}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(o)}switchDynamicMasking(a){this.isDynamicMasking=a}}class hm{constructor(a=[]){mars3d&&(this.terrainProviderArr=a,this.terrainProviderId="",this.events={},window.map.on(mars3d.EventType.terrainLoadError,o=>{this.hide()}),window.map.viewer.scene.globe.tileLoadProgressEvent.addEventListener(o=>{window.map.viewer.scene.globe.tilesLoaded&&this.emit("load",o)}))}add(a,o){if(o==null?void 0:o.isClone)mapClone&&(window.mapClone.mapEx.terrainProvider=window.map.terrainProvider);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,clip:!0,flat:!0,uplift:!0,flood:!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,o){a=="load"&&(this.events[a]?this.events[a].push(o):this.events[a]=[o])}emit(a,...o){this.events[a]!=null&&this.events[a].forEach(c=>c(...o))}off(a,o){this.events[a]=this.events[a].filter(c=>c!==o)}once(a,o){const c=()=>{o(),this.off(a,c)};this.on(a,c)}addClip(a){return new Promise((o,c)=>{window.bimClip?o(bimClip.clipGisAdd(a)):c("挖洞工具未初始化")})}}class um{constructor(a=[],o){mars3d&&(this.elevationImageArr=a,this.elevationImageLayer,o?this.gisTkone={Authorization:`Bearer ${o}`}: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)}pushVector(a){this.elevationImageArr.push(a)}add(a,o=!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:v,layerSaturation:S,layerGamma:b,surfaceOpacity:O}=this.exposureEnvironmentSettings();return new Promise((k,I)=>{let N,E,P,w,M,R;if(typeof a!="object"){let C=this.query(a);C||I("缺少树结构");let{gisInfo:U}=C;N=U.id,P=U.order,E=C.url,w=U.minLevel,M=U.maxLevel}else N=a.imageXyzId,E=a.url,P=a.zIndex,w=a.minimumLevel,M=a.maximumLevel,R=a.chinaCRS;this.elevationImageLayer=new mars3d.layer.XyzLayer({imageXyzId:N,type:"xyz",url:E,hasZIndex:!0,zIndex:P.toString(),brightness:m,opacity:u,saturation:S,contrast:g,hue:v,gamma:b,alpha:O,show:!0,minimumLevel:w||0,maximumLevel:M||15,chinaCRS:R,headers:o?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){window.map.removeLayer(window.map.getLayer(a,"imageXyzId"))}query(a){return this.elevationImageArr.length==0?!1:this.elevationImageArr.find(o=>o.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,...o){Ho(this,"manualFreed",ec.debounce(()=>{let{lng:a,lat:o,alt:c,pitch:f}=window.map.getCameraView(),u;this.modelArray.forEach(m=>{u=m.releasedDistance?m.releasedDistance:1e4,this.disTance([a,o,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={})}on(a,o){(a=="enter"||a=="leave")&&(this.events[a]?this.events[a].push(o):this.events[a]=[o])}emit(a,...o){this.events[a]!=null&&this.events[a].forEach(c=>c(...o))}off(a,o){this.events[a]=this.events[a].filter(c=>c!==o)}once(a,o){const c=()=>{o(),this.off(a,c)};this.on(a,c)}say(a){return this[a]}add(a,o){this[a].push(o)}remove(a,o){this[a]=this[a].filter(function(c){return c!==o})}initial(){this.modelArray=[],this.events={}}updateCustomExcavationDetails(a,o,c,f=[],u={}){let m,g,v;switch(m=this.modelArray.find(S=>S.modelId==a).customize.bimModelExcavationDetails,v=m.find((S,b)=>{if(S.id==o)return g=b,S}),c){case"delete":m.splice(g,1);break;case"update":v.excavationDetails=f;break;case"add":m.push(u);break;case"edit":v.excavationDetails=u.excavationDetails,v.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:o,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([o,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,o,c="id"){let f;if(a){for(var u=0;u<a.length;u++){let m=a[u];if(m[c]==o)return f=m,f;if(m.children&&m.children.length>0&&(f=this.findPnodeId(m.children,o,c),f))return f}return f}}disTance(a,o,c){let f,u,m;return f=Cesium.Cartesian3.fromDegrees(...a),u=Cesium.Cartesian3.fromDegrees(...o),m=Cesium.Cartesian3.distance(f,u),m>c}calculateDistance(a,o){let c=(a+180)%360-180;c=Math.max(-90,Math.min(c,90));let f=(o-o/5)*(Math.abs(c)/90)+o/5;return Math.round(f)}}class fm{constructor(a=[],o){mars3d&&(this.entityArr=a,this.entityLayer=new mars3d.layer.GraphicLayer({entityId:"bimEntity"}),window.map.addLayer(this.entityLayer),this.entityItem=null,this.events={},this.entityCloneLayer)}on(a,o){(a=="change"||a=="collection")&&(this.events[a]?this.events[a].push(o):this.events[a]=[o])}emit(a,...o){this.events[a]!=null&&this.events[a].forEach(c=>c(...o))}off(a,o){this.events[a]=this.events[a].filter(c=>c!==o)}offAll(){this.events={}}once(a,o){const c=()=>{o(),this.off(a,c)};this.on(a,c)}add(a,o=null,c){return new Promise((f,u)=>{var m;if(this.entityLayer){let g,v,S;if(c==null?void 0:c.isClone)this.entityCloneLayer&&(v=this.query(a),v?(S=JSON.parse(v.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"),v=this.query(a),v?(S=JSON.parse(v.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||o,S.attr==null?S.attr={entityId:a.id}:((m=S.attr)==null?void 0:m.entityId)==null&&o&&(S.attr.entityId=o)),g)return f();this.entityLayer.addGraphic(S),f(S)}}else f()})}query(a){return this.entityArr.length==0?!1:this.entityArr.find(o=>o.id==a)}queryEntity(a){if(bimEntity.entityLayer)return bimEntity.entityLayer.getGraphicByAttr(a,"entityId")}selected(a,o=null){let c=this.entityLayer.getGraphicByAttr(a,"entityId");o==null||o.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,o=null){var f,u;(o==null?void 0:o.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((o,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:v,font_color:S,scaleByDistance:b,scaleByDistance_far:O,scaleByDistance_farValue:k,scaleByDistance_near:I,scaleByDistance_nearValue:N,distanceDisplayCondition:E,distanceDisplayCondition_far:P,distanceDisplayCondition_near:w,clampToGround:M}=u,R={type:"div",style:{pointerEvents:!0,scaleByDistance:b,scaleByDistance_far:O,scaleByDistance_farValue:k,scaleByDistance_near:I,scaleByDistance_nearValue:N,distanceDisplayCondition:E,distanceDisplayCondition_far:P,distanceDisplayCondition_near:w,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:${v};--theme-font-color1:${S};">
|
|
2636
|
+
}`;var Mi=Np(function(){return Fi(ut,Ze+"return "+de).apply(o,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,y){if(r=Zi(r),r&&(y||h===o))return _a(r);if(!r||!(h=Ye(h)))return r;var D=ar(r),Y=ar(h),ut=es(D,Y),yt=Cs(D,Y)+1;return xn(D,ut,yt).join("")}function O_(r,h,y){if(r=Zi(r),r&&(y||h===o))return r.slice(0,xa(r)+1);if(!r||!(h=Ye(h)))return r;var D=ar(r),Y=Cs(D,ar(h))+1;return xn(D,0,Y).join("")}function I_(r,h,y){if(r=Zi(r),r&&(y||h===o))return r.replace(lo,"");if(!r||!(h=Ye(h)))return r;var D=ar(r),Y=es(D,ar(h));return xn(D,Y).join("")}function D_(r,h){var y=ct,D=Rt;if(wn(h)){var Y="separator"in h?h.separator:Y;y="length"in h?wi(h.length):y,D="omission"in h?Ye(h.omission):D}r=Zi(r);var ut=r.length;if(Ir(r)){var yt=ar(r);ut=yt.length}if(y>=ut)return r;var bt=y-$r(D);if(bt<1)return D;var Bt=yt?xn(yt,0,bt).join(""):r.slice(0,bt);if(Y===o)return Bt+D;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===o?bt:de)}}else if(r.indexOf(Ye(Y),bt)!=bt){var ke=Bt.lastIndexOf(Y);ke>-1&&(Bt=Bt.slice(0,ke))}return Bt+D}function z_(r){return r=Zi(r),r&&Yo.test(r)?r.replace(Ao,th):r}var k_=ze(function(r,h,y){return r+(y?" ":"")+h.toUpperCase()}),mf=Me("toUpperCase");function Bp(r,h,y){return r=Zi(r),h=y?o:h,h===o?Rs(r)?jc(r):rl(r):r.match(h)||[]}var Np=ae(function(r,h){try{return yr(r,o,h)}catch(y){return cf(y)?y:new ai(y)}}),B_=Ws(function(r,h){return Ji(h,function(y){y=cs(y),Bo(r,y,hf(r[y],r))}),r});function N_(r){var h=r==null?0:r.length,y=si();return r=h?Yi(r,function(D){if(typeof D[1]!="function")throw new lr(m);return[y(D[0]),D[1]]}):[],ae(function(D){for(var Y=-1;++Y<h;){var ut=r[Y];if(yr(ut[0],this,D))return yr(ut[1],this,D)}})}function F_(r){return Oa(wr(r,O))}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,O))}function V_(r){return gt(wr(r,O))}function W_(r,h){return Ct(r,wr(h,O))}var j_=ae(function(r,h){return function(y){return e(y,r,h)}}),X_=ae(function(r,h){return function(y){return e(r,y,h)}});function yf(r,h,y){var D=Jn(h),Y=Gs(h,D);y==null&&!(wn(h)&&(Y.length||!D.length))&&(y=h,h=r,r=this,Y=Gs(h,Jn(h)));var ut=!(wn(y)&&"chain"in y)||!!y.chain,yt=Xs(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 $(h,r)})}var Z_=Nn(Yi),J_=Nn(Bh),$_=Nn(Po);function Fp(r){return nf(r)?Ko(cs(r)):$t(r)}function K_(r){return function(h){return r==null?o:hs(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 y=It,D=Vn(r,It);h=si(h),r-=It;for(var Y=Ro(D,h);++y<r;)h(y);return Y}function o1(r){return vi(r)?Yi(r,cs):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):o}function f1(r,h){return r&&r.length?Mo(r,si(h,2),uh):o}function d1(r){return ya(r,Gr)}function p1(r,h){return ya(r,si(h,2))}function m1(r){return r&&r.length?Mo(r,Gr,rt):o}function g1(r,h){return r&&r.length?Mo(r,si(h,2),rt):o}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?ts(r,Gr):0}function w1(r,h){return r&&r.length?ts(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=Al,it.isArray=vi,it.isArrayBuffer=hy,it.isArrayLike=Fr,it.isArrayLikeObject=Dn,it.isBoolean=uy,it.isBuffer=Ba,it.isDate=cy,it.isElement=fy,it.isEmpty=dy,it.isEqual=py,it.isEqualWith=my,it.isError=cf,it.isFinite=gy,it.isFunction=Xs,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=qs,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,y){Ti.call(it.prototype,y)||(r[y]=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(y){y=y===o?1:vn(wi(y),0);var D=this.__filtered__&&!h?new _i(this):this.clone();return D.__filtered__?D.__takeCount__=Vn(y,D.__takeCount__):D.__views__.push({size:Vn(y,It),type:r+(D.__dir__<0?"Right":"")}),D},_i.prototype[r+"Right"]=function(y){return this.reverse()[r](y).reverse()}}),Ji(["filter","map","takeWhile"],function(r,h){var y=h+1,D=y==G||y==Et;_i.prototype[r]=function(Y){var ut=this.clone();return ut.__iteratees__.push({iteratee:si(Y,3),type:y}),ut.__filtered__=ut.__filtered__||D,ut}}),Ji(["head","last"],function(r,h){var y="take"+(h?"Right":"");_i.prototype[r]=function(){return this[y](1).value()[0]}}),Ji(["initial","tail"],function(r,h){var y="drop"+(h?"":"Right");_i.prototype[r]=function(){return this.__filtered__?new _i(this):this[y](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(y){return e(y,r,h)})}),_i.prototype.reject=function(r){return this.filter(Ju(si(r)))},_i.prototype.slice=function(r,h){r=wi(r);var y=this;return y.__filtered__&&(r>0||h<0)?new _i(y):(r<0?y=y.takeRight(-r):r&&(y=y.drop(r)),h!==o&&(h=wi(h),y=h<0?y.dropRight(-h):y.take(h-r)),y)},_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 y=/^(?:filter|find|map|reject)|While$/.test(h),D=/^(?:head|last)$/.test(h),Y=it[D?"take"+(h=="last"?"Right":""):h],ut=D||/^find/.test(h);Y&&(it.prototype[h]=function(){var yt=this.__wrapped__,bt=D?[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 D&&ke?Ui[0]:Ui};le&&y&&typeof oe=="function"&&oe.length!=1&&(Bt=le=!1);var ke=this.__chain__,Ze=!!this.__actions__.length,hi=ut&&!ke,Mi=Bt&&!Ze;if(!ut&&le){yt=Mi?yt:new _i(this);var ui=r.apply(yt,bt);return ui.__actions__.push({func:Xu,args:[de],thisArg:o}),new qn(ui,ke)}return hi&&Mi?r.apply(this,bt):(ui=this.thru(de),hi?D?ui.value()[0]:ui.value():ui)})}),Ji(["pop","push","shift","sort","splice","unshift"],function(r){var h=On[r],y=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",D=/^(?:pop|shift)$/.test(r);it.prototype[r]=function(){var Y=arguments;if(D&&!this.__chain__){var ut=this.value();return h.apply(vi(ut)?ut:[],Y)}return this[y](function(yt){return h.apply(vi(yt)?yt:[],Y)})}}),Nr(_i.prototype,function(r,h){var y=it[h];if(y){var D=y.name+"";Ti.call(os,D)||(os[D]=[]),os[D].push({name:h,func:y})}}),os[$i(o,w).name]=[{name:"wrapper",func:o}],_i.prototype.clone=Ca,_i.prototype.reverse=Ou,_i.prototype.value=Aa,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,rs&&(it.prototype[rs]=gv),it},is=Xc();Zr?((Zr.exports=is)._=is,Jo._=is):gn._=is}).call(Er)}(lu,lu.exports);var am=lu.exports;const ec=tc(am);class lm{constructor(a=[],o=!1){Ho(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=o,this.disabled=!1)}remove(a,o=null){o&&o.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,o){return new Promise((c,f)=>{let u,m=o==null?void 0:o.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:v,id:S,title:b}=u;new Cesium.Resource({url:v}).fetchJson().then(k=>{let{id:I,title:N,shpInfo:E}=u,{attributes:P,geometryType:w,geometryCount:M,pointCount:R}=E;if(P){let{width:C,materialType:U,materialOptions:F,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(P),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)),w){case"LineString":case"MultiLineString":tt.backgroundPadding=5,Pe=new mars3d.layer.GeoJsonLayer({data:k,vectorId:I,symbol:{type:"polylineC",styleOptions:{width:C,clampToGround:X,distanceDisplayCondition:K,distanceDisplayCondition_far:ct,distanceDisplayCondition_near:Z,materialType:U,materialOptions:F,classificationType:It,setHeight:Nt,label:tt}},hasZIndex:!0,zIndex:Rt});break;case"Polygon":case"MultiPolygon":U=="PolyGrass"&&(F={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:I,symbol:{type:"polygon",styleOptions:{fill:_t,diffHeight:G,clampToGround:X,materialType:U,materialOptions:F,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:I,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(P))},500);Pe.readyPromise.then(Wt=>{window.dynamicMasking&&pe(Wt),c(Wt)}).catch(Wt=>{c({tite:"【矢量】「"+N+"」无法加载",type:"error",id:I,url:v})})}else c({tite:"【矢量】「"+N+"」无法加载",type:"error",id:I,url:v})}).catch(k=>{c({tite:"【矢量】「"+b+"」链接地址有误",type:"error",id:S,url:v})})}else c({tite:"【矢量】ID:「"+a+"」已删除",type:"error",id:a})})}updateData(a){this.vectorArr=a}processingKML(a){let o,c=2e3,f=!0,{kmlInfo:u}=a,{fill:m,areaColor:g,areaSideColor:v,transparency:S,isAreaSideColor:b,minDistinct:O,textDistinct:k,textSize:I,textColor:N,fontStyle:E,outLine:P,sideColor:w,backGround:M,backGroundColor:R,clampToGround:C}=u,U={fill:m,color:g,opacity:S||.5,outline:b,outlineColor:v,outlineWidth:2,clampToGround:C,distanceDisplayCondition:!0,distanceDisplayCondition_far:k||1e6,distanceDisplayCondition_near:O||0,classificationType:o,opacity:String(S)},F={text:"{name}",horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffsetY:-10,font_size:26,color:N||"#ffffff",font_family:E||"黑体",outline:P||!0,outlineColor:w||"#000000",outlineWidth:4,scaleByDistance:!0,distanceDisplayCondition:!0,distanceDisplayCondition_far:k||1e6,distanceDisplayCondition_near:O||0,background:M||!1,backgroundColor:R||"",visibleDepth:f,clampToGround:C||!1,disableDepthTestDistance:c};return{...U,label:F}}selected(a){window.map.getLayer(a,"vectorId")&&window.map.getLayer(a,"vectorId").flyTo()}query(a){return this.vectorArr.length==0?!1:this.vectorArr.find(o=>o.id==a)}queryVector(a){return window.map.getLayer(a,"vectorId")}editVector(a,o,c){let f=window.map.getLayer(a,"vectorId"),u=bf(o,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 o=new mars3d.layer.GeoJsonLayer({name:"国界",url:a,vectorId:"border",format:c=>{try{c=turf.simplify(c,{tolerance:1e-5,highQuality:!1,mutate:!0})}catch{}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(o)}switchDynamicMasking(a){this.isDynamicMasking=a}}class hm{constructor(a=[]){mars3d&&(this.terrainProviderArr=a,this.terrainProviderId="",this.events={},window.map.on(mars3d.EventType.terrainLoadError,o=>{this.hide()}),window.map.viewer.scene.globe.tileLoadProgressEvent.addEventListener(o=>{window.map.viewer.scene.globe.tilesLoaded&&this.emit("load",o)}))}add(a,o){if(o==null?void 0:o.isClone)mapClone&&(window.mapClone.mapEx.terrainProvider=window.map.terrainProvider);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,clip:!0,flat:!0,uplift:!0,flood:!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,o){a=="load"&&(this.events[a]?this.events[a].push(o):this.events[a]=[o])}emit(a,...o){this.events[a]!=null&&this.events[a].forEach(c=>c(...o))}off(a,o){this.events[a]=this.events[a].filter(c=>c!==o)}once(a,o){const c=()=>{o(),this.off(a,c)};this.on(a,c)}addClip(a){return new Promise((o,c)=>{window.bimClip?o(bimClip.clipGisAdd(a)):c("挖洞工具未初始化")})}}class um{constructor(a=[],o){mars3d&&(this.elevationImageArr=a,this.elevationImageLayer,o?this.gisTkone={Authorization:`Bearer ${o}`}: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)}pushVector(a){this.elevationImageArr.push(a)}add(a,o=!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:v,layerSaturation:S,layerGamma:b,surfaceOpacity:O}=this.exposureEnvironmentSettings();return new Promise((k,I)=>{let N,E,P,w,M,R;if(typeof a!="object"){let C=this.query(a);C||I("缺少树结构");let{gisInfo:U}=C;N=U.id,P=U.order,E=C.url,w=U.minLevel,M=U.maxLevel}else N=a.imageXyzId,E=a.url,P=a.zIndex,w=a.minimumLevel,M=a.maximumLevel,R=a.chinaCRS;this.elevationImageLayer=new mars3d.layer.XyzLayer({imageXyzId:N,type:"xyz",url:E,hasZIndex:!0,zIndex:P.toString(),brightness:m,opacity:u,saturation:S,contrast:g,hue:v,gamma:b,alpha:O,show:!0,minimumLevel:w||0,maximumLevel:M||15,chinaCRS:R,headers:o?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){window.map.removeLayer(window.map.getLayer(a,"imageXyzId"))}query(a){return this.elevationImageArr.length==0?!1:this.elevationImageArr.find(o=>o.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,...o){Ho(this,"manualFreed",ec.debounce(()=>{let{lng:a,lat:o,alt:c,pitch:f}=window.map.getCameraView(),u;this.modelArray.forEach(m=>{u=m.releasedDistance?m.releasedDistance:1e4,this.disTance([a,o,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={})}on(a,o){(a=="enter"||a=="leave")&&(this.events[a]?this.events[a].push(o):this.events[a]=[o])}emit(a,...o){this.events[a]!=null&&this.events[a].forEach(c=>c(...o))}off(a,o){this.events[a]=this.events[a].filter(c=>c!==o)}once(a,o){const c=()=>{o(),this.off(a,c)};this.on(a,c)}say(a){return this[a]}add(a,o){this[a].push(o)}remove(a,o){this[a]=this[a].filter(function(c){return c!==o})}initial(){this.modelArray=[],this.events={}}updateCustomExcavationDetails(a,o,c,f=[],u={}){let m,g,v;switch(m=this.modelArray.find(S=>S.modelId==a).customize.bimModelExcavationDetails,v=m.find((S,b)=>{if(S.id==o)return g=b,S}),c){case"delete":m.splice(g,1);break;case"update":v.excavationDetails=f;break;case"add":m.push(u);break;case"edit":v.excavationDetails=u.excavationDetails,v.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:o,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([o,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,o,c="id"){let f;if(a){for(var u=0;u<a.length;u++){let m=a[u];if(m[c]==o)return f=m,f;if(m.children&&m.children.length>0&&(f=this.findPnodeId(m.children,o,c),f))return f}return f}}disTance(a,o,c){let f,u,m;return f=Cesium.Cartesian3.fromDegrees(...a),u=Cesium.Cartesian3.fromDegrees(...o),m=Cesium.Cartesian3.distance(f,u),m>c}calculateDistance(a,o){let c=(a+180)%360-180;c=Math.max(-90,Math.min(c,90));let f=(o-o/5)*(Math.abs(c)/90)+o/5;return Math.round(f)}}class fm{constructor(a=[],o){mars3d&&(this.entityArr=a,this.entityLayer=new mars3d.layer.GraphicLayer({entityId:"bimEntity"}),window.map.addLayer(this.entityLayer),this.entityItem=null,this.events={},this.entityCloneLayer)}on(a,o){(a=="change"||a=="collection")&&(this.events[a]?this.events[a].push(o):this.events[a]=[o])}emit(a,...o){this.events[a]!=null&&this.events[a].forEach(c=>c(...o))}off(a,o){this.events[a]=this.events[a].filter(c=>c!==o)}offAll(){this.events={}}once(a,o){const c=()=>{o(),this.off(a,c)};this.on(a,c)}add(a,o=null,c){return new Promise((f,u)=>{var m;if(this.entityLayer){let g,v,S;if(c==null?void 0:c.isClone)this.entityCloneLayer&&(v=this.query(a),v?(S=v.bimPlanPainting?JSON.parse(v.bimPlanPainting.graphic):JSON.parse(v.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"),v=this.query(a),v?(S=v.bimPlanPainting?JSON.parse(v.bimPlanPainting.graphic):JSON.parse(v.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||o,S.attr==null?S.attr={entityId:a.id}:((m=S.attr)==null?void 0:m.entityId)==null&&o&&(S.attr.entityId=o)),g)return f();this.entityLayer.addGraphic(S),f(S)}}else f()})}query(a){return this.entityArr.length==0?!1:this.entityArr.find(o=>o.id==a)}queryEntity(a){if(bimEntity.entityLayer)return bimEntity.entityLayer.getGraphicByAttr(a,"entityId")}selected(a,o=null){let c=this.entityLayer.getGraphicByAttr(a,"entityId");o==null||o.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,o=null){var f,u;(o==null?void 0:o.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((o,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:v,font_color:S,scaleByDistance:b,scaleByDistance_far:O,scaleByDistance_farValue:k,scaleByDistance_near:I,scaleByDistance_nearValue:N,distanceDisplayCondition:E,distanceDisplayCondition_far:P,distanceDisplayCondition_near:w,clampToGround:M}=u,R={type:"div",style:{pointerEvents:!0,scaleByDistance:b,scaleByDistance_far:O,scaleByDistance_farValue:k,scaleByDistance_near:I,scaleByDistance_nearValue:N,distanceDisplayCondition:E,distanceDisplayCondition_far:P,distanceDisplayCondition_near:w,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:${v};--theme-font-color1:${S};">
|
|
2637
2637
|
<div class="title">${m}</div>
|
|
2638
2638
|
</div>`,R.style.horizontalOrigin=Cesium.HorizontalOrigin.CENTER;break}this.entityLayer.startDraw(R).then(C=>{setTimeout(()=>{this.entityItem=C,this.entityLayer.startEditing(C),o(C)},500)})}else a.type.type=="polylineP"&&a.style.materialType=="Color"&&a.style.depthFail==!0&&(a.style.depthFailColor=a.style.materialOptions.color),this.entityLayer.startDraw(a).then(m=>{setTimeout(()=>{this.entityItem=m,this.entityLayer.startEditing(m),o(m)},500)})})}stopDraw(a=!0){this.entityLayer&&this.entityLayer.clearDrawing(),a&&this.entityItem&&(this.entityItem.stopEditing(),this.entityItem.remove(),this.entityItem=null)}updateEntityItem(a){let o=this.entityLayer.getGraphicByAttr(a,"entityId");o?this.entityItem=o:this.removeEntityItem()}edit(a,o,c,f){let u=bf(o,c);if(o.vectorStyle&&this.entityItem)if(o.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 o={"--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 Object.keys(o).forEach(m=>{m=="--theme-color2"||m=="--theme-color3"?c.divStyle[o[m]]=u.style.getPropertyValue(m)||"#fff":c[o[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"),c}updateHtml(a,o){let{theme_color:c,font_color:f,title:u,content:m,divStyle:g}=o,{theme_color2:v,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};">
|
|
2639
2639
|
<div class="title">${u}</div>
|