chbim-plugins 0.0.59 → 0.0.61
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 +11 -3
- package/chbim-plugins.umd.cjs +2 -2
- package/package.json +1 -1
package/chbim-plugins.js
CHANGED
|
@@ -25127,17 +25127,19 @@ class m1 {
|
|
|
25127
25127
|
}
|
|
25128
25128
|
class g1 {
|
|
25129
25129
|
constructor(l, o = [], p) {
|
|
25130
|
-
mars3d ? (this.map = l, this.entityArr = o, this.entityLayer =
|
|
25130
|
+
mars3d ? (this.map = l, this.entityArr = o, this.entityLayer = new mars3d.layer.GraphicLayer({
|
|
25131
|
+
entityId: "bimEntity"
|
|
25132
|
+
}), this.map.addLayer(this.entityLayer), this.entityItem = null, this.events = {}) : console.error("未引入指定插件");
|
|
25131
25133
|
}
|
|
25132
25134
|
/**
|
|
25133
25135
|
* events
|
|
25134
25136
|
* 事件监听
|
|
25135
|
-
* @param { string } event - 事件名 目前只支持
|
|
25137
|
+
* @param { string } event - 事件名 目前只支持change和collection
|
|
25136
25138
|
* @param { function } fn - 回调函数
|
|
25137
25139
|
* @returns { any }
|
|
25138
25140
|
*/
|
|
25139
25141
|
on(l, o) {
|
|
25140
|
-
l == "change" ? this.events[l] ? this.events[l].push(o) : this.events[l] = [o] : console.log("未开放自定义");
|
|
25142
|
+
l == "change" || l == "collection" ? this.events[l] ? this.events[l].push(o) : this.events[l] = [o] : console.log("未开放自定义");
|
|
25141
25143
|
}
|
|
25142
25144
|
/**
|
|
25143
25145
|
* events
|
|
@@ -25365,6 +25367,12 @@ class g1 {
|
|
|
25365
25367
|
callback: (l) => {
|
|
25366
25368
|
this.emit("change", l);
|
|
25367
25369
|
}
|
|
25370
|
+
},
|
|
25371
|
+
{
|
|
25372
|
+
text: "收藏对象",
|
|
25373
|
+
callback: (l) => {
|
|
25374
|
+
this.emit("collection", l);
|
|
25375
|
+
}
|
|
25368
25376
|
}
|
|
25369
25377
|
]);
|
|
25370
25378
|
}
|
package/chbim-plugins.umd.cjs
CHANGED
|
@@ -2632,9 +2632,9 @@ __p += '`),Ni&&(pe+=`' +
|
|
|
2632
2632
|
function print() { __p += __j.call(arguments, '') }
|
|
2633
2633
|
`:`;
|
|
2634
2634
|
`)+pe+`return __p
|
|
2635
|
-
}`;var Mi=Od(function(){return Bi(ut,Je+"return "+pe).apply(o,_t)});if(Mi.source=pe,of(Mi))throw Mi;return Mi}function py(r){return Yi(r).toLowerCase()}function dy(r){return Yi(r).toUpperCase()}function my(r,h,g){if(r=Yi(r),r&&(g||h===o))return ga(r);if(!r||!(h=Ye(h)))return r;var O=ar(r),Y=ar(h),ut=Qs(O,Y),_t=Eo(O,Y)+1;return xn(O,ut,_t).join("")}function gy(r,h,g){if(r=Yi(r),r&&(g||h===o))return r.slice(0,va(r)+1);if(!r||!(h=Ye(h)))return r;var O=ar(r),Y=Eo(O,ar(h))+1;return xn(O,0,Y).join("")}function vy(r,h,g){if(r=Yi(r),r&&(g||h===o))return r.replace(ls,"");if(!r||!(h=Ye(h)))return r;var O=ar(r),Y=Qs(O,ar(h));return xn(O,Y).join("")}function _y(r,h){var g=ft,O=Ct;if(wn(h)){var Y="separator"in h?h.separator:Y;g="length"in h?wi(h.length):g,O="omission"in h?Ye(h.omission):O}r=Yi(r);var ut=r.length;if(Ir(r)){var _t=ar(r);ut=_t.length}if(g>=ut)return r;var bt=g-$r(O);if(bt<1)return O;var Bt=_t?xn(_t,0,bt).join(""):r.slice(0,bt);if(Y===o)return Bt+O;if(_t&&(bt+=Bt.length-bt),af(Y)){if(r.slice(bt).search(Y)){var se,le=Bt;for(Y.global||(Y=Kn(Y.source,Yi(Gl.exec(Y))+"g")),Y.lastIndex=0;se=Y.exec(le);)var pe=se.index;Bt=Bt.slice(0,pe===o?bt:pe)}}else if(r.indexOf(Ye(Y),bt)!=bt){var ke=Bt.lastIndexOf(Y);ke>-1&&(Bt=Bt.slice(0,ke))}return Bt+O}function yy(r){return r=Yi(r),r&&Xs.test(r)?r.replace(As,Jl):r}var xy=ze(function(r,h,g){return r+(g?" ":"")+h.toUpperCase()}),uf=Me("toUpperCase");function Rd(r,h,g){return r=Yi(r),h=g?o:h,h===o?Po(r)?Uc(r):il(r):r.match(h)||[]}var Od=ae(function(r,h){try{return _r(r,o,h)}catch(g){return of(g)?g:new ai(g)}}),wy=Ho(function(r,h){return Zi(h,function(g){g=ho(g),ks(r,g,rf(r[g],r))}),r});function Ty(r){var h=r==null?0:r.length,g=oi();return r=h?qi(r,function(O){if(typeof O[1]!="function")throw new lr(m);return[g(O[0]),O[1]]}):[],ae(function(O){for(var Y=-1;++Y<h;){var ut=r[Y];if(_r(ut[0],this,O))return _r(ut[1],this,O)}})}function My(r){return Pa(wr(r,I))}function cf(r){return function(){return r}}function Sy(r,h){return r==null||r!==r?h:r}var Ey=Li(),by=Li(!0);function Gr(r){return r}function ff(r){return H(typeof r=="function"?r:wr(r,I))}function Ay(r){return gt(wr(r,I))}function Cy(r,h){return At(r,wr(h,I))}var Py=ae(function(r,h){return function(g){return e(g,r,h)}}),Ly=ae(function(r,h){return function(g){return e(r,g,h)}});function pf(r,h,g){var O=Jn(h),Y=Fo(h,O);g==null&&!(wn(h)&&(Y.length||!O.length))&&(g=h,h=r,r=this,Y=Fo(h,Jn(h)));var ut=!(wn(g)&&"chain"in g)||!!g.chain,_t=Wo(r);return Zi(Y,function(bt){var Bt=h[bt];r[bt]=Bt,_t&&(r.prototype[bt]=function(){var se=this.__chain__;if(ut||se){var le=r(this.__wrapped__),pe=le.__actions__=er(this.__actions__);return pe.push({func:Bt,args:arguments,thisArg:r}),le.__chain__=se,le}return Bt.apply(r,fs([this.value()],arguments))})}),r}function Ry(){return gn._===this&&(gn._=Kr),this}function df(){}function Oy(r){return r=wi(r),ae(function(h){return Z(h,r)})}var Iy=Nn(qi),Dy=Nn(Ih),zy=Nn(Cs);function Id(r){return $c(r)?Js(ho(r)):$t(r)}function ky(r){return function(h){return r==null?o:ao(r,h)}}var By=$h(),Ny=$h(!0);function mf(){return[]}function gf(){return!1}function Fy(){return{}}function Uy(){return""}function Gy(){return!0}function Hy(r,h){if(r=wi(r),r<1||r>ce)return[];var g=Ot,O=Vn(r,Ot);h=oi(h),r-=Ot;for(var Y=Ls(O,h);++g<r;)h(g);return Y}function Vy(r){return vi(r)?qi(r,ho):ts(r)?[r]:er(Qp(Yi(r)))}function Wy(r){var h=++ur;return Yi(r)+h}var jy=Tr(function(r,h){return r+h},0),Xy=hh("ceil"),qy=Tr(function(r,h){return r/h},1),Yy=hh("floor");function Zy(r){return r&&r.length?Ts(r,Gr,oh):o}function Jy(r,h){return r&&r.length?Ts(r,oi(h,2),oh):o}function $y(r){return ma(r,Gr)}function Ky(r,h){return ma(r,oi(h,2))}function Qy(r){return r&&r.length?Ts(r,Gr,rt):o}function t1(r,h){return r&&r.length?Ts(r,oi(h,2),rt):o}var e1=Tr(function(r,h){return r*h},1),i1=hh("round"),n1=Tr(function(r,h){return r-h},0);function r1(r){return r&&r.length?Ks(r,Gr):0}function s1(r,h){return r&&r.length?Ks(r,oi(h,2)):0}return et.after=Av,et.ary=ud,et.assign=d_,et.assignIn=Sd,et.assignInWith=Zu,et.assignWith=m_,et.at=g_,et.before=cd,et.bind=rf,et.bindAll=wy,et.bindKey=fd,et.castArray=Fv,et.chain=ad,et.chunk=Yg,et.compact=Zg,et.concat=Jg,et.cond=Ty,et.conforms=My,et.constant=cf,et.countBy=rv,et.create=v_,et.curry=pd,et.curryRight=dd,et.debounce=md,et.defaults=__,et.defaultsDeep=y_,et.defer=Cv,et.delay=Pv,et.difference=$g,et.differenceBy=Kg,et.differenceWith=Qg,et.drop=t0,et.dropRight=e0,et.dropRightWhile=i0,et.dropWhile=n0,et.fill=r0,et.filter=ov,et.flatMap=hv,et.flatMapDeep=uv,et.flatMapDepth=cv,et.flatten=nd,et.flattenDeep=s0,et.flattenDepth=o0,et.flip=Lv,et.flow=Ey,et.flowRight=by,et.fromPairs=a0,et.functions=b_,et.functionsIn=A_,et.groupBy=fv,et.initial=h0,et.intersection=u0,et.intersectionBy=c0,et.intersectionWith=f0,et.invert=P_,et.invertBy=L_,et.invokeMap=dv,et.iteratee=ff,et.keyBy=mv,et.keys=Jn,et.keysIn=Ur,et.map=Vu,et.mapKeys=O_,et.mapValues=I_,et.matches=Ay,et.matchesProperty=Cy,et.memoize=ju,et.merge=D_,et.mergeWith=Ed,et.method=Py,et.methodOf=Ly,et.mixin=pf,et.negate=Xu,et.nthArg=Oy,et.omit=z_,et.omitBy=k_,et.once=Rv,et.orderBy=gv,et.over=Iy,et.overArgs=Ov,et.overEvery=Dy,et.overSome=zy,et.partial=sf,et.partialRight=gd,et.partition=vv,et.pick=B_,et.pickBy=bd,et.property=Id,et.propertyOf=ky,et.pull=g0,et.pullAll=sd,et.pullAllBy=v0,et.pullAllWith=_0,et.pullAt=y0,et.range=By,et.rangeRight=Ny,et.rearg=Iv,et.reject=xv,et.remove=x0,et.rest=Dv,et.reverse=ef,et.sampleSize=Tv,et.set=F_,et.setWith=U_,et.shuffle=Mv,et.slice=w0,et.sortBy=bv,et.sortedUniq=C0,et.sortedUniqBy=P0,et.split=hy,et.spread=zv,et.tail=L0,et.take=R0,et.takeRight=O0,et.takeRightWhile=I0,et.takeWhile=D0,et.tap=Z0,et.throttle=kv,et.thru=Hu,et.toArray=wd,et.toPairs=Ad,et.toPairsIn=Cd,et.toPath=Vy,et.toPlainObject=Md,et.transform=G_,et.unary=Bv,et.union=z0,et.unionBy=k0,et.unionWith=B0,et.uniq=N0,et.uniqBy=F0,et.uniqWith=U0,et.unset=H_,et.unzip=nf,et.unzipWith=od,et.update=V_,et.updateWith=W_,et.values=fh,et.valuesIn=j_,et.without=G0,et.words=Rd,et.wrap=Nv,et.xor=H0,et.xorBy=V0,et.xorWith=W0,et.zip=j0,et.zipObject=X0,et.zipObjectDeep=q0,et.zipWith=Y0,et.entries=Ad,et.entriesIn=Cd,et.extend=Sd,et.extendWith=Zu,pf(et,et),et.add=jy,et.attempt=Od,et.camelCase=Z_,et.capitalize=Pd,et.ceil=Xy,et.clamp=X_,et.clone=Uv,et.cloneDeep=Hv,et.cloneDeepWith=Vv,et.cloneWith=Gv,et.conformsTo=Wv,et.deburr=Ld,et.defaultTo=Sy,et.divide=qy,et.endsWith=J_,et.eq=Fs,et.escape=$_,et.escapeRegExp=K_,et.every=sv,et.find=av,et.findIndex=ed,et.findKey=x_,et.findLast=lv,et.findLastIndex=id,et.findLastKey=w_,et.floor=Yy,et.forEach=ld,et.forEachRight=hd,et.forIn=T_,et.forInRight=M_,et.forOwn=S_,et.forOwnRight=E_,et.get=lf,et.gt=jv,et.gte=Xv,et.has=C_,et.hasIn=hf,et.head=rd,et.identity=Gr,et.includes=pv,et.indexOf=l0,et.inRange=q_,et.invoke=R_,et.isArguments=bl,et.isArray=vi,et.isArrayBuffer=qv,et.isArrayLike=Fr,et.isArrayLikeObject=Dn,et.isBoolean=Yv,et.isBuffer=Da,et.isDate=Zv,et.isElement=Jv,et.isEmpty=$v,et.isEqual=Kv,et.isEqualWith=Qv,et.isError=of,et.isFinite=t_,et.isFunction=Wo,et.isInteger=vd,et.isLength=qu,et.isMap=_d,et.isMatch=e_,et.isMatchWith=i_,et.isNaN=n_,et.isNative=r_,et.isNil=o_,et.isNull=s_,et.isNumber=yd,et.isObject=wn,et.isObjectLike=Ln,et.isPlainObject=eu,et.isRegExp=af,et.isSafeInteger=a_,et.isSet=xd,et.isString=Yu,et.isSymbol=ts,et.isTypedArray=ch,et.isUndefined=l_,et.isWeakMap=h_,et.isWeakSet=u_,et.join=p0,et.kebabCase=Q_,et.last=Es,et.lastIndexOf=d0,et.lowerCase=ty,et.lowerFirst=ey,et.lt=c_,et.lte=f_,et.max=Zy,et.maxBy=Jy,et.mean=$y,et.meanBy=Ky,et.min=Qy,et.minBy=t1,et.stubArray=mf,et.stubFalse=gf,et.stubObject=Fy,et.stubString=Uy,et.stubTrue=Gy,et.multiply=e1,et.nth=m0,et.noConflict=Ry,et.noop=df,et.now=Wu,et.pad=iy,et.padEnd=ny,et.padStart=ry,et.parseInt=sy,et.random=Y_,et.reduce=_v,et.reduceRight=yv,et.repeat=oy,et.replace=ay,et.result=N_,et.round=i1,et.runInContext=Rt,et.sample=wv,et.size=Sv,et.snakeCase=ly,et.some=Ev,et.sortedIndex=T0,et.sortedIndexBy=M0,et.sortedIndexOf=S0,et.sortedLastIndex=E0,et.sortedLastIndexBy=b0,et.sortedLastIndexOf=A0,et.startCase=uy,et.startsWith=cy,et.subtract=n1,et.sum=r1,et.sumBy=s1,et.template=fy,et.times=Hy,et.toFinite=jo,et.toInteger=wi,et.toLength=Td,et.toLower=py,et.toNumber=bs,et.toSafeInteger=p_,et.toString=Yi,et.toUpper=dy,et.trim=my,et.trimEnd=gy,et.trimStart=vy,et.truncate=_y,et.unescape=yy,et.uniqueId=Wy,et.upperCase=xy,et.upperFirst=uf,et.each=ld,et.eachRight=hd,et.first=rd,pf(et,function(){var r={};return Nr(et,function(h,g){Ti.call(et.prototype,g)||(r[g]=h)}),r}(),{chain:!1}),et.VERSION=p,Zi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(r){et[r].placeholder=et}),Zi(["drop","take"],function(r,h){yi.prototype[r]=function(g){g=g===o?1:vn(wi(g),0);var O=this.__filtered__&&!h?new yi(this):this.clone();return O.__filtered__?O.__takeCount__=Vn(g,O.__takeCount__):O.__views__.push({size:Vn(g,Ot),type:r+(O.__dir__<0?"Right":"")}),O},yi.prototype[r+"Right"]=function(g){return this.reverse()[r](g).reverse()}}),Zi(["filter","map","takeWhile"],function(r,h){var g=h+1,O=g==G||g==Et;yi.prototype[r]=function(Y){var ut=this.clone();return ut.__iteratees__.push({iteratee:oi(Y,3),type:g}),ut.__filtered__=ut.__filtered__||O,ut}}),Zi(["head","last"],function(r,h){var g="take"+(h?"Right":"");yi.prototype[r]=function(){return this[g](1).value()[0]}}),Zi(["initial","tail"],function(r,h){var g="drop"+(h?"":"Right");yi.prototype[r]=function(){return this.__filtered__?new yi(this):this[g](1)}}),yi.prototype.compact=function(){return this.filter(Gr)},yi.prototype.find=function(r){return this.filter(r).head()},yi.prototype.findLast=function(r){return this.reverse().find(r)},yi.prototype.invokeMap=ae(function(r,h){return typeof r=="function"?new yi(this):this.map(function(g){return e(g,r,h)})}),yi.prototype.reject=function(r){return this.filter(Xu(oi(r)))},yi.prototype.slice=function(r,h){r=wi(r);var g=this;return g.__filtered__&&(r>0||h<0)?new yi(g):(r<0?g=g.takeRight(-r):r&&(g=g.drop(r)),h!==o&&(h=wi(h),g=h<0?g.dropRight(-h):g.take(h-r)),g)},yi.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},yi.prototype.toArray=function(){return this.take(Ot)},Nr(yi.prototype,function(r,h){var g=/^(?:filter|find|map|reject)|While$/.test(h),O=/^(?:head|last)$/.test(h),Y=et[O?"take"+(h=="last"?"Right":""):h],ut=O||/^find/.test(h);Y&&(et.prototype[h]=function(){var _t=this.__wrapped__,bt=O?[1]:arguments,Bt=_t instanceof yi,se=bt[0],le=Bt||vi(_t),pe=function(Pi){var Ni=Y.apply(et,fs([Pi],bt));return O&&ke?Ni[0]:Ni};le&&g&&typeof se=="function"&&se.length!=1&&(Bt=le=!1);var ke=this.__chain__,Je=!!this.__actions__.length,hi=ut&&!ke,Mi=Bt&&!Je;if(!ut&&le){_t=Mi?_t:new yi(this);var ui=r.apply(_t,bt);return ui.__actions__.push({func:Hu,args:[pe],thisArg:o}),new qn(ui,ke)}return hi&&Mi?r.apply(this,bt):(ui=this.thru(pe),hi?O?ui.value()[0]:ui.value():ui)})}),Zi(["pop","push","shift","sort","splice","unshift"],function(r){var h=On[r],g=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",O=/^(?:pop|shift)$/.test(r);et.prototype[r]=function(){var Y=arguments;if(O&&!this.__chain__){var ut=this.value();return h.apply(vi(ut)?ut:[],Y)}return this[g](function(_t){return h.apply(vi(_t)?_t:[],Y)})}}),Nr(yi.prototype,function(r,h){var g=et[h];if(g){var O=g.name+"";Ti.call(no,O)||(no[O]=[]),no[O].push({name:h,func:g})}}),no[Ji(o,w).name]=[{name:"wrapper",func:o}],yi.prototype.clone=Sa,yi.prototype.reverse=Cu,yi.prototype.value=Ea,et.prototype.at=J0,et.prototype.chain=$0,et.prototype.commit=K0,et.prototype.next=Q0,et.prototype.plant=ev,et.prototype.reverse=iv,et.prototype.toJSON=et.prototype.valueOf=et.prototype.value=nv,et.prototype.first=et.prototype.head,io&&(et.prototype[io]=tv),et},to=Gc();Zr?((Zr.exports=to)._=to,Ys._=to):gn._=to}).call(Er)}(ru,ru.exports);var em=ru.exports;const $u=Ju(em);class im{constructor(l,o=[],p=!1){vf(this,"simplifyFunc",l=>{try{l=turf.simplify(l,{tolerance:5e-4,highQuality:!1,mutate:!0})}catch{}return l});mars3d?(this.map=l,this.vectorArr=o,this.geoJsonType=new Map([["Point"],["LineString"],["Polygon"],["MultiPoint"],["MultiLineString"],["MultiPolygon"]]),this.avoidanceArr=[],this.editDate={id:""},this.isDynamicMasking=p):console.error("未引入指定插件")}remove(l){this.map.removeLayer(this.map.getLayer(l,"vectorId")),window.dynamicMasking&&window.dynamicMasking.remove(l)}add(l,o){return new Promise((p,d)=>{let u;if(typeof l!="object"){let I=this.map.getLayer(l,"vectorId");if(I)return p(I);u=this.query(l)}else{let I=this.map.getLayer(l.id,"vectorId");if(I)return p(I);u=l}let{value:m,url:_,id:x,title:S}=u;new Cesium.Resource({url:_}).fetchJson().then(I=>{let{id:N,title:z,shpInfo:F}=u,{attributes:E,geometryType:L,geometryCount:w,pointCount:M}=F;if(E){let{width:R,materialType:b,materialOptions:U,clampToGround:B,distanceDisplayCondition:X,distanceDisplayCondition_near:J,distanceDisplayCondition_far:K,zIndex:ft,label:Ct,fill:it,diffHeight:yt,outline:G,outlineStyle:Lt,color:Et,pixelSize:Pt,outlineColor:ce,outlineWidth:re,classificationType:Ft}=JSON.parse(E),Ot;switch(this.isDynamicMasking?(Ct.color=Cesium.Color.fromCssColorString(Ct.color).withAlpha(0),Ct.outlineColor=Cesium.Color.fromCssColorString(Ct.outlineColor).withAlpha(.001),Ct.backgroundColor=Cesium.Color.fromCssColorString(Ct.backgroundColor).withAlpha(.001),Ct.background=!1,Ct.outline=!1,Ct.show=!1):(Ct.color=Cesium.Color.fromCssColorString(Ct.color),Ct.outlineColor=Cesium.Color.fromCssColorString(Ct.outlineColor),Ct.backgroundColor=Cesium.Color.fromCssColorString(Ct.backgroundColor)),L){case"LineString":case"MultiLineString":Ct.backgroundPadding=5,Ot=new mars3d.layer.GeoJsonLayer({data:I,vectorId:N,format:M>1e4?this.simplifyFunc:null,symbol:{type:"polylineC",styleOptions:{width:R,clampToGround:B,distanceDisplayCondition:X,distanceDisplayCondition_far:K,distanceDisplayCondition_near:J,materialType:b,materialOptions:U,classificationType:Ft,label:Ct}},popup:` ${z} `,hasZIndex:!0,zIndex:ft});break;case"Polygon":case"MultiPolygon":b=="PolyGrass"&&(U={evenColor:new Cesium.Color(.25,.4,.1,1),oddColor:new Cesium.Color(.1,.1,.1,1),frequency:1.5}),Ot=new mars3d.layer.GeoJsonLayer({data:I,vectorId:N,format:M>1e4?this.simplifyFunc:null,symbol:{type:"polygon",styleOptions:{fill:it,diffHeight:yt,clampToGround:B,materialType:b,materialOptions:U,distanceDisplayCondition:X,distanceDisplayCondition_far:K,distanceDisplayCondition_near:J,outlineStyle:Lt,outline:G,classificationType:Ft,label:Ct}},popup:` ${z} `});break;case"Point":case"MultiPoint":Ot=new mars3d.layer.GeoJsonLayer({data:I,vectorId:N,format:M>1e4?this.simplifyFunc:null,symbol:{type:"pointP",styleOptions:{color:Et,pixelSize:Pt,outline:G,outlineColor:ce,outlineWidth:re,visibleDepth:!1,label:Ct}}});break}window.map.addLayer(Ot),Ot.bindPopup(Ce=>{console.log("event",Ce)});let Nt=$u.debounce(Ce=>{console.log("测试shp矢量加载完成"),window.dynamicMasking.add(Ce,JSON.parse(E))},500);Ot.readyPromise.then(Ce=>{window.dynamicMasking&&Nt(Ce),p(Ce)}).catch(Ce=>{console.error("测试shp矢量加载失败",Ce),p({tite:"【矢量】"+z+"加载失败",type:"error",id:N,url:_})})}else p({tite:"【矢量】"+z+"加载失败",type:"error",id:N,url:_})}).catch(I=>{console.error("数据有误",I),p({tite:"【矢量】"+S+"数据有误",type:"error",id:x,url:_})})})}updateData(l){this.vectorArr=l}processingKML(l){let o,p=2e3,d=!0,{kmlInfo:u}=l,{fill:m,areaColor:_,areaSideColor:x,transparency:S,isAreaSideColor:C,minDistinct:I,textDistinct:N,textSize:z,textColor:F,fontStyle:E,outLine:L,sideColor:w,backGround:M,backGroundColor:R,clampToGround:b}=u,U={fill:m,color:_,opacity:S||.5,outline:C,outlineColor:x,outlineWidth:2,clampToGround:b,distanceDisplayCondition:!0,distanceDisplayCondition_far:N||1e6,distanceDisplayCondition_near:I||0,classificationType:o,opacity:String(S)},B={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:w||"#000000",outlineWidth:4,scaleByDistance:!0,distanceDisplayCondition:!0,distanceDisplayCondition_far:N||1e6,distanceDisplayCondition_near:I||0,background:M||!1,backgroundColor:R||"",visibleDepth:d,clampToGround:b||!1,disableDepthTestDistance:p};return{...U,label:B}}selected(l){this.map.getLayer(l,"vectorId")&&this.map.getLayer(l,"vectorId").flyTo()}query(l){return this.vectorArr.length==0?!1:this.vectorArr.find(o=>o.id==l)}queryVector(l){return this.map.getLayer(l,"vectorId")}editVector(l,o,p){let d=this.map.getLayer(l,"vectorId"),u=Tf(o,p);d&&(d.eachGraphic(m=>{m.label.show===!1&&(delete m.label.outline,delete m.label.background,delete m.label.outlineColor,delete m.label.backgroundColor),m.setStyle({...u})}),window.dynamicMasking&&dynamicMasking.modify(l,u))}nationalBoundaries(){let l="/gis/nationalBoundaries.json",o=new mars3d.layer.GeoJsonLayer({name:"国界",url:l,format:p=>{try{p=turf.simplify(p,{tolerance:1e-5,highQuality:!1,mutate:!0})}catch(d){console.error(d)}return p},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(l){this.isDynamicMasking=l}}class nm{constructor(l,o=[]){mars3d?(this.map=l,this.terrainProviderArr=o,this.terrainProviderId="",this.events={},this.map.on(mars3d.EventType.terrainLoadError,p=>{console.error("地形服务加载失败",p),this.hide()}),this.map.viewer.scene.globe.tileLoadProgressEvent.addEventListener(p=>{this.map.viewer.scene.globe.tilesLoaded&&this.emit("load",p)})):console.error("未引入指定插件")}add(l){let{url:o,id:p}=l;if(this.terrainProviderId==p&&this.map.terrainProvider._layers)return!1;this.map.terrainProvider=mars3d.LayerUtil.createTerrainProvider({imageXyzId:p,type:"xyz",url:o,requestVertexNormals:!0,requestMetadata:!0}),this.terrainProviderId=p}show(){this.map.hasTerrain=!0}hide(){this.map.hasTerrain=!1}on(l,o){l=="load"?this.events[l]?this.events[l].push(o):this.events[l]=[o]:console.log("未开放自定义")}emit(l,...o){this.events[l]!=null&&this.events[l].forEach(p=>p(...o))}off(l,o){this.events[l]=this.events[l].filter(p=>p!==o)}once(l,o){const p=()=>{o(),this.off(l,p)};this.on(l,p)}addClip(l){return new Promise((o,p)=>{window.bimClip?o(bimClip.clipGisAdd(l)):p("挖洞工具未初始化")})}}class rm{constructor(l,o=[]){mars3d?(this.map=l,this.elevationImageArr=o,this.elevationImageLayer,this.form={brightnessVal:1.3,msaaSamples:4,surfaceOpacity:1,layerOpacity:1,layerBrightness:2,layerContrast:1,layerHue:0,layerSaturation:1,layerGamma:1}):console.error("未引入指定插件")}pushVector(l){this.elevationImageArr.push(l)}add(l,o){let p;if(typeof l!="object"?p=l:p=l.imageXyzId,this.map.getLayer(p,"imageXyzId"))return!1;const{layerOpacity:d,layerBrightness:u,layerContrast:m,layerHue:_,layerSaturation:x,layerGamma:S,surfaceOpacity:C}=this.exposureEnvironmentSettings();return new Promise((I,N)=>{let z,F,E,L,w;if(typeof l!="object"){let M=this.query(l);M||N("缺少树结构");let{gisInfo:R}=M;z=R.id,E=R.order,F=M.url,L=R.minLevel,w=R.maxLevel}else z=l.imageXyzId,F=l.url,E=l.zIndex,L=l.minimumLevel,w=l.maximumLevel;this.elevationImageLayer=new mars3d.layer.XyzLayer({imageXyzId:z,type:"xyz",url:F,hasZIndex:!0,zIndex:E.toString(),brightness:u,opacity:d,saturation:x,contrast:m,hue:_,gamma:S,alpha:C,show:!0,minimumLevel:L||0,maximumLevel:w||15}),this.elevationImageLayer.on(mars3d.EventType.load,M=>{I(M)}),this.map.addLayer(this.elevationImageLayer),o&&Object.keys(o).forEach(M=>{this.elevationImageLayer.on(fnType.get(M),R=>{o[M](R)})})})}remove(l){console.log(l),this.map.removeLayer(this.map.getLayer(l,"imageXyzId"))}query(l){return this.elevationImageArr.length==0?!1:this.elevationImageArr.find(o=>o.id==l)}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 sm{constructor(l,o,...p){vf(this,"manualFreed",$u.debounce(()=>{let{lng:l,lat:o,alt:p,pitch:d}=this.map.getCameraView(),u;this.modelArray.forEach(m=>{u=m.releasedDistance?m.releasedDistance:1e4,this.disTance([l,o,p],[m.center._lng,m.center._lat,m.center._alt],this.calculateDistance(d,u))?this.map.getLayer(m.id,"modelId")&&this.emit("leave",m):this.map.getLayer(m.id,"modelId")||this.emit("enter",m)})},200));mars3d?(l&&l!=null&&(this.modelArray=l),this.showModelArray=[],o&&o!=null&&(this.map=o),this.Cesium=mars3d.Cesium,this.events={}):console.error("未引入指定插件")}on(l,o){l=="enter"||l=="leave"?this.events[l]?this.events[l].push(o):this.events[l]=[o]:console.log("未开放自定义")}emit(l,...o){this.events[l]!=null&&this.events[l].forEach(p=>p(...o))}off(l,o){this.events[l]=this.events[l].filter(p=>p!==o)}once(l,o){const p=()=>{o(),this.off(l,p)};this.on(l,p)}say(l){return this[l]}add(l,o){this[l].push(o)}remove(l,o){this[l]=this[l].filter(function(p){return p!==o})}initial(){this.modelArray=[],this.events={}}updateCustomExcavationDetails(l,o,p,d=[],u={}){let m,_,x;switch(m=this.modelArray.find(S=>S.modelId==l).customize.bimModelExcavationDetails,x=m.find((S,C)=>{if(S.id==o)return _=C,S}),p){case"delete":m.splice(_,1);break;case"update":x.excavationDetails=d;break;case"add":m.push(u);break;case"edit":x.excavationDetails=u.excavationDetails,x.kId=u.kId;break}return m}resourceRelease(){this.map.viewer.camera.moveEnd.addEventListener(()=>{this.freed()})}freed(){let{alt:l}=this.map.getCameraView();l<2e4&&(this.freed=$u.throttle(()=>{let{lng:o,lat:p,alt:d,pitch:u}=this.map.getCameraView();this.modelArray&&this.modelArray.forEach(m=>{let _=m.bimModel.releasedDistance?m.bimModel.releasedDistance:1e4;m.center&&this.disTance([o,p,d],[m.center._lng,m.center._lat,m.center._alt],this.calculateDistance(u,_))?this.map.getLayer(m.id,"modelId")&&this.emit("leave",m):this.showModelArray.indexOf(m.id)>=0&&!this.map.getLayer(m.id,"modelId")&&this.emit("enter",m)})},2e3),this.freed())}findPnodeId(l,o,p="id"){let d;if(l){for(var u=0;u<l.length;u++){let m=l[u];if(m[p]==o)return d=m,d;if(m.children&&m.children.length>0&&(d=this.findPnodeId(m.children,o,p),d))return d}return d}}disTance(l,o,p){let d,u,m;return d=Cesium.Cartesian3.fromDegrees(...l),u=Cesium.Cartesian3.fromDegrees(...o),m=Cesium.Cartesian3.distance(d,u),m>p}calculateDistance(l,o){let p=(l+180)%360-180;p=Math.max(-90,Math.min(p,90));let d=(o-o/5)*(Math.abs(p)/90)+o/5;return Math.round(d)}}class om{constructor(l,o=[],p){mars3d?(this.map=l,this.entityArr=o,this.entityLayer=l.getLayer("bimEntity","entityId"),this.entityItem=null,this.events={}):console.error("未引入指定插件")}on(l,o){l=="change"?this.events[l]?this.events[l].push(o):this.events[l]=[o]:console.log("未开放自定义")}emit(l,...o){this.events[l]!=null&&this.events[l].forEach(p=>p(...o))}off(l,o){this.events[l]=this.events[l].filter(p=>p!==o)}once(l,o){const p=()=>{o(),this.off(l,p)};this.on(l,p)}add(l,o){return new Promise((p,d)=>{var u;if(this.entityLayer){let m,_,x;if(typeof l!="object"?(m=this.entityLayer.getGraphicByAttr(l,"entityId"),_=this.query(l),x=JSON.parse(_.bimPlanPainting.graphic),x.attr=x.attr||{},x.attr.entityId=l):(m=this.entityLayer.getGraphicByAttr(l.id,"entityId"),x=JSON.parse(JSON.stringify(l)),x.attr=x.attr||{},x.attr.entityId=x.attr.entityId||o,x.attr==null?x.attr={entityId:l.id}:((u=x.attr)==null?void 0:u.entityId)==null&&o&&(x.attr.entityId=o)),m)return p();this.entityLayer.addGraphic(x),p(x)}else p(),console.error("未初始化标绘实例图层")})}query(l){return this.entityArr.length==0?!1:this.entityArr.find(o=>o.id==l)}queryEntity(l){if(bimEntity.entityLayer)return bimEntity.entityLayer.getGraphicByAttr(l,"entityId")}selected(l){let o=this.entityLayer.getGraphicByAttr(l,"entityId");o._point&&o._point._alt>0?o.flyTo({radius:o._point._alt+500}):o.flyTo()}remove(l){this.entityLayer.getGraphicByAttr(l,"entityId")&&(this.entityLayer.getGraphicByAttr(l,"entityId").remove(),this.entityItem&&(this.entityItem._state=="destroy"||this.entityItem.options.attr.entityId==l)&&(this.entityItem=null))}removeEntityItem(){this.entityItem=null}updateData(l){this.entityArr=l}startDrawGraphic(l){let{type:o,style:p}=l;if(o=="div")if(p.html)this.entityLayer.startDraw(l).then(d=>{setTimeout(()=>{this.entityItem=d,this.entityLayer.startEditing(d)},500)});else{let{title:d,divType:u,theme_color:m,font_color:_,scaleByDistance:x,scaleByDistance_far:S,scaleByDistance_farValue:C,scaleByDistance_near:I,scaleByDistance_nearValue:N,distanceDisplayCondition:z,distanceDisplayCondition_far:F,distanceDisplayCondition_near:E,clampToGround:L}=p,w={type:"div",style:{pointerEvents:!0,scaleByDistance:x,scaleByDistance_far:S,scaleByDistance_farValue:C,scaleByDistance_near:I,scaleByDistance_nearValue:N,distanceDisplayCondition:z,distanceDisplayCondition_far:F,distanceDisplayCondition_near:E,clampToGround:L,horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}};switch(u){case"1":w.style.html=`<div class="entity-div-style entity-div-style1" style="--theme-color1:${m};--theme-font-color1:${_};">
|
|
2635
|
+
}`;var Mi=Od(function(){return Bi(ut,Je+"return "+pe).apply(o,_t)});if(Mi.source=pe,of(Mi))throw Mi;return Mi}function py(r){return Yi(r).toLowerCase()}function dy(r){return Yi(r).toUpperCase()}function my(r,h,g){if(r=Yi(r),r&&(g||h===o))return ga(r);if(!r||!(h=Ye(h)))return r;var O=ar(r),Y=ar(h),ut=Qs(O,Y),_t=Eo(O,Y)+1;return xn(O,ut,_t).join("")}function gy(r,h,g){if(r=Yi(r),r&&(g||h===o))return r.slice(0,va(r)+1);if(!r||!(h=Ye(h)))return r;var O=ar(r),Y=Eo(O,ar(h))+1;return xn(O,0,Y).join("")}function vy(r,h,g){if(r=Yi(r),r&&(g||h===o))return r.replace(ls,"");if(!r||!(h=Ye(h)))return r;var O=ar(r),Y=Qs(O,ar(h));return xn(O,Y).join("")}function _y(r,h){var g=ft,O=Ct;if(wn(h)){var Y="separator"in h?h.separator:Y;g="length"in h?wi(h.length):g,O="omission"in h?Ye(h.omission):O}r=Yi(r);var ut=r.length;if(Ir(r)){var _t=ar(r);ut=_t.length}if(g>=ut)return r;var bt=g-$r(O);if(bt<1)return O;var Bt=_t?xn(_t,0,bt).join(""):r.slice(0,bt);if(Y===o)return Bt+O;if(_t&&(bt+=Bt.length-bt),af(Y)){if(r.slice(bt).search(Y)){var se,le=Bt;for(Y.global||(Y=Kn(Y.source,Yi(Gl.exec(Y))+"g")),Y.lastIndex=0;se=Y.exec(le);)var pe=se.index;Bt=Bt.slice(0,pe===o?bt:pe)}}else if(r.indexOf(Ye(Y),bt)!=bt){var ke=Bt.lastIndexOf(Y);ke>-1&&(Bt=Bt.slice(0,ke))}return Bt+O}function yy(r){return r=Yi(r),r&&Xs.test(r)?r.replace(As,Jl):r}var xy=ze(function(r,h,g){return r+(g?" ":"")+h.toUpperCase()}),uf=Me("toUpperCase");function Rd(r,h,g){return r=Yi(r),h=g?o:h,h===o?Po(r)?Uc(r):il(r):r.match(h)||[]}var Od=ae(function(r,h){try{return _r(r,o,h)}catch(g){return of(g)?g:new ai(g)}}),wy=Ho(function(r,h){return Zi(h,function(g){g=ho(g),ks(r,g,rf(r[g],r))}),r});function Ty(r){var h=r==null?0:r.length,g=oi();return r=h?qi(r,function(O){if(typeof O[1]!="function")throw new lr(m);return[g(O[0]),O[1]]}):[],ae(function(O){for(var Y=-1;++Y<h;){var ut=r[Y];if(_r(ut[0],this,O))return _r(ut[1],this,O)}})}function My(r){return Pa(wr(r,I))}function cf(r){return function(){return r}}function Sy(r,h){return r==null||r!==r?h:r}var Ey=Li(),by=Li(!0);function Gr(r){return r}function ff(r){return H(typeof r=="function"?r:wr(r,I))}function Ay(r){return gt(wr(r,I))}function Cy(r,h){return At(r,wr(h,I))}var Py=ae(function(r,h){return function(g){return e(g,r,h)}}),Ly=ae(function(r,h){return function(g){return e(r,g,h)}});function pf(r,h,g){var O=Jn(h),Y=Fo(h,O);g==null&&!(wn(h)&&(Y.length||!O.length))&&(g=h,h=r,r=this,Y=Fo(h,Jn(h)));var ut=!(wn(g)&&"chain"in g)||!!g.chain,_t=Wo(r);return Zi(Y,function(bt){var Bt=h[bt];r[bt]=Bt,_t&&(r.prototype[bt]=function(){var se=this.__chain__;if(ut||se){var le=r(this.__wrapped__),pe=le.__actions__=er(this.__actions__);return pe.push({func:Bt,args:arguments,thisArg:r}),le.__chain__=se,le}return Bt.apply(r,fs([this.value()],arguments))})}),r}function Ry(){return gn._===this&&(gn._=Kr),this}function df(){}function Oy(r){return r=wi(r),ae(function(h){return Z(h,r)})}var Iy=Nn(qi),Dy=Nn(Ih),zy=Nn(Cs);function Id(r){return $c(r)?Js(ho(r)):$t(r)}function ky(r){return function(h){return r==null?o:ao(r,h)}}var By=$h(),Ny=$h(!0);function mf(){return[]}function gf(){return!1}function Fy(){return{}}function Uy(){return""}function Gy(){return!0}function Hy(r,h){if(r=wi(r),r<1||r>ce)return[];var g=Ot,O=Vn(r,Ot);h=oi(h),r-=Ot;for(var Y=Ls(O,h);++g<r;)h(g);return Y}function Vy(r){return vi(r)?qi(r,ho):ts(r)?[r]:er(Qp(Yi(r)))}function Wy(r){var h=++ur;return Yi(r)+h}var jy=Tr(function(r,h){return r+h},0),Xy=hh("ceil"),qy=Tr(function(r,h){return r/h},1),Yy=hh("floor");function Zy(r){return r&&r.length?Ts(r,Gr,oh):o}function Jy(r,h){return r&&r.length?Ts(r,oi(h,2),oh):o}function $y(r){return ma(r,Gr)}function Ky(r,h){return ma(r,oi(h,2))}function Qy(r){return r&&r.length?Ts(r,Gr,rt):o}function t1(r,h){return r&&r.length?Ts(r,oi(h,2),rt):o}var e1=Tr(function(r,h){return r*h},1),i1=hh("round"),n1=Tr(function(r,h){return r-h},0);function r1(r){return r&&r.length?Ks(r,Gr):0}function s1(r,h){return r&&r.length?Ks(r,oi(h,2)):0}return et.after=Av,et.ary=ud,et.assign=d_,et.assignIn=Sd,et.assignInWith=Zu,et.assignWith=m_,et.at=g_,et.before=cd,et.bind=rf,et.bindAll=wy,et.bindKey=fd,et.castArray=Fv,et.chain=ad,et.chunk=Yg,et.compact=Zg,et.concat=Jg,et.cond=Ty,et.conforms=My,et.constant=cf,et.countBy=rv,et.create=v_,et.curry=pd,et.curryRight=dd,et.debounce=md,et.defaults=__,et.defaultsDeep=y_,et.defer=Cv,et.delay=Pv,et.difference=$g,et.differenceBy=Kg,et.differenceWith=Qg,et.drop=t0,et.dropRight=e0,et.dropRightWhile=i0,et.dropWhile=n0,et.fill=r0,et.filter=ov,et.flatMap=hv,et.flatMapDeep=uv,et.flatMapDepth=cv,et.flatten=nd,et.flattenDeep=s0,et.flattenDepth=o0,et.flip=Lv,et.flow=Ey,et.flowRight=by,et.fromPairs=a0,et.functions=b_,et.functionsIn=A_,et.groupBy=fv,et.initial=h0,et.intersection=u0,et.intersectionBy=c0,et.intersectionWith=f0,et.invert=P_,et.invertBy=L_,et.invokeMap=dv,et.iteratee=ff,et.keyBy=mv,et.keys=Jn,et.keysIn=Ur,et.map=Vu,et.mapKeys=O_,et.mapValues=I_,et.matches=Ay,et.matchesProperty=Cy,et.memoize=ju,et.merge=D_,et.mergeWith=Ed,et.method=Py,et.methodOf=Ly,et.mixin=pf,et.negate=Xu,et.nthArg=Oy,et.omit=z_,et.omitBy=k_,et.once=Rv,et.orderBy=gv,et.over=Iy,et.overArgs=Ov,et.overEvery=Dy,et.overSome=zy,et.partial=sf,et.partialRight=gd,et.partition=vv,et.pick=B_,et.pickBy=bd,et.property=Id,et.propertyOf=ky,et.pull=g0,et.pullAll=sd,et.pullAllBy=v0,et.pullAllWith=_0,et.pullAt=y0,et.range=By,et.rangeRight=Ny,et.rearg=Iv,et.reject=xv,et.remove=x0,et.rest=Dv,et.reverse=ef,et.sampleSize=Tv,et.set=F_,et.setWith=U_,et.shuffle=Mv,et.slice=w0,et.sortBy=bv,et.sortedUniq=C0,et.sortedUniqBy=P0,et.split=hy,et.spread=zv,et.tail=L0,et.take=R0,et.takeRight=O0,et.takeRightWhile=I0,et.takeWhile=D0,et.tap=Z0,et.throttle=kv,et.thru=Hu,et.toArray=wd,et.toPairs=Ad,et.toPairsIn=Cd,et.toPath=Vy,et.toPlainObject=Md,et.transform=G_,et.unary=Bv,et.union=z0,et.unionBy=k0,et.unionWith=B0,et.uniq=N0,et.uniqBy=F0,et.uniqWith=U0,et.unset=H_,et.unzip=nf,et.unzipWith=od,et.update=V_,et.updateWith=W_,et.values=fh,et.valuesIn=j_,et.without=G0,et.words=Rd,et.wrap=Nv,et.xor=H0,et.xorBy=V0,et.xorWith=W0,et.zip=j0,et.zipObject=X0,et.zipObjectDeep=q0,et.zipWith=Y0,et.entries=Ad,et.entriesIn=Cd,et.extend=Sd,et.extendWith=Zu,pf(et,et),et.add=jy,et.attempt=Od,et.camelCase=Z_,et.capitalize=Pd,et.ceil=Xy,et.clamp=X_,et.clone=Uv,et.cloneDeep=Hv,et.cloneDeepWith=Vv,et.cloneWith=Gv,et.conformsTo=Wv,et.deburr=Ld,et.defaultTo=Sy,et.divide=qy,et.endsWith=J_,et.eq=Fs,et.escape=$_,et.escapeRegExp=K_,et.every=sv,et.find=av,et.findIndex=ed,et.findKey=x_,et.findLast=lv,et.findLastIndex=id,et.findLastKey=w_,et.floor=Yy,et.forEach=ld,et.forEachRight=hd,et.forIn=T_,et.forInRight=M_,et.forOwn=S_,et.forOwnRight=E_,et.get=lf,et.gt=jv,et.gte=Xv,et.has=C_,et.hasIn=hf,et.head=rd,et.identity=Gr,et.includes=pv,et.indexOf=l0,et.inRange=q_,et.invoke=R_,et.isArguments=bl,et.isArray=vi,et.isArrayBuffer=qv,et.isArrayLike=Fr,et.isArrayLikeObject=Dn,et.isBoolean=Yv,et.isBuffer=Da,et.isDate=Zv,et.isElement=Jv,et.isEmpty=$v,et.isEqual=Kv,et.isEqualWith=Qv,et.isError=of,et.isFinite=t_,et.isFunction=Wo,et.isInteger=vd,et.isLength=qu,et.isMap=_d,et.isMatch=e_,et.isMatchWith=i_,et.isNaN=n_,et.isNative=r_,et.isNil=o_,et.isNull=s_,et.isNumber=yd,et.isObject=wn,et.isObjectLike=Ln,et.isPlainObject=eu,et.isRegExp=af,et.isSafeInteger=a_,et.isSet=xd,et.isString=Yu,et.isSymbol=ts,et.isTypedArray=ch,et.isUndefined=l_,et.isWeakMap=h_,et.isWeakSet=u_,et.join=p0,et.kebabCase=Q_,et.last=Es,et.lastIndexOf=d0,et.lowerCase=ty,et.lowerFirst=ey,et.lt=c_,et.lte=f_,et.max=Zy,et.maxBy=Jy,et.mean=$y,et.meanBy=Ky,et.min=Qy,et.minBy=t1,et.stubArray=mf,et.stubFalse=gf,et.stubObject=Fy,et.stubString=Uy,et.stubTrue=Gy,et.multiply=e1,et.nth=m0,et.noConflict=Ry,et.noop=df,et.now=Wu,et.pad=iy,et.padEnd=ny,et.padStart=ry,et.parseInt=sy,et.random=Y_,et.reduce=_v,et.reduceRight=yv,et.repeat=oy,et.replace=ay,et.result=N_,et.round=i1,et.runInContext=Rt,et.sample=wv,et.size=Sv,et.snakeCase=ly,et.some=Ev,et.sortedIndex=T0,et.sortedIndexBy=M0,et.sortedIndexOf=S0,et.sortedLastIndex=E0,et.sortedLastIndexBy=b0,et.sortedLastIndexOf=A0,et.startCase=uy,et.startsWith=cy,et.subtract=n1,et.sum=r1,et.sumBy=s1,et.template=fy,et.times=Hy,et.toFinite=jo,et.toInteger=wi,et.toLength=Td,et.toLower=py,et.toNumber=bs,et.toSafeInteger=p_,et.toString=Yi,et.toUpper=dy,et.trim=my,et.trimEnd=gy,et.trimStart=vy,et.truncate=_y,et.unescape=yy,et.uniqueId=Wy,et.upperCase=xy,et.upperFirst=uf,et.each=ld,et.eachRight=hd,et.first=rd,pf(et,function(){var r={};return Nr(et,function(h,g){Ti.call(et.prototype,g)||(r[g]=h)}),r}(),{chain:!1}),et.VERSION=p,Zi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(r){et[r].placeholder=et}),Zi(["drop","take"],function(r,h){yi.prototype[r]=function(g){g=g===o?1:vn(wi(g),0);var O=this.__filtered__&&!h?new yi(this):this.clone();return O.__filtered__?O.__takeCount__=Vn(g,O.__takeCount__):O.__views__.push({size:Vn(g,Ot),type:r+(O.__dir__<0?"Right":"")}),O},yi.prototype[r+"Right"]=function(g){return this.reverse()[r](g).reverse()}}),Zi(["filter","map","takeWhile"],function(r,h){var g=h+1,O=g==G||g==Et;yi.prototype[r]=function(Y){var ut=this.clone();return ut.__iteratees__.push({iteratee:oi(Y,3),type:g}),ut.__filtered__=ut.__filtered__||O,ut}}),Zi(["head","last"],function(r,h){var g="take"+(h?"Right":"");yi.prototype[r]=function(){return this[g](1).value()[0]}}),Zi(["initial","tail"],function(r,h){var g="drop"+(h?"":"Right");yi.prototype[r]=function(){return this.__filtered__?new yi(this):this[g](1)}}),yi.prototype.compact=function(){return this.filter(Gr)},yi.prototype.find=function(r){return this.filter(r).head()},yi.prototype.findLast=function(r){return this.reverse().find(r)},yi.prototype.invokeMap=ae(function(r,h){return typeof r=="function"?new yi(this):this.map(function(g){return e(g,r,h)})}),yi.prototype.reject=function(r){return this.filter(Xu(oi(r)))},yi.prototype.slice=function(r,h){r=wi(r);var g=this;return g.__filtered__&&(r>0||h<0)?new yi(g):(r<0?g=g.takeRight(-r):r&&(g=g.drop(r)),h!==o&&(h=wi(h),g=h<0?g.dropRight(-h):g.take(h-r)),g)},yi.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},yi.prototype.toArray=function(){return this.take(Ot)},Nr(yi.prototype,function(r,h){var g=/^(?:filter|find|map|reject)|While$/.test(h),O=/^(?:head|last)$/.test(h),Y=et[O?"take"+(h=="last"?"Right":""):h],ut=O||/^find/.test(h);Y&&(et.prototype[h]=function(){var _t=this.__wrapped__,bt=O?[1]:arguments,Bt=_t instanceof yi,se=bt[0],le=Bt||vi(_t),pe=function(Pi){var Ni=Y.apply(et,fs([Pi],bt));return O&&ke?Ni[0]:Ni};le&&g&&typeof se=="function"&&se.length!=1&&(Bt=le=!1);var ke=this.__chain__,Je=!!this.__actions__.length,hi=ut&&!ke,Mi=Bt&&!Je;if(!ut&&le){_t=Mi?_t:new yi(this);var ui=r.apply(_t,bt);return ui.__actions__.push({func:Hu,args:[pe],thisArg:o}),new qn(ui,ke)}return hi&&Mi?r.apply(this,bt):(ui=this.thru(pe),hi?O?ui.value()[0]:ui.value():ui)})}),Zi(["pop","push","shift","sort","splice","unshift"],function(r){var h=On[r],g=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",O=/^(?:pop|shift)$/.test(r);et.prototype[r]=function(){var Y=arguments;if(O&&!this.__chain__){var ut=this.value();return h.apply(vi(ut)?ut:[],Y)}return this[g](function(_t){return h.apply(vi(_t)?_t:[],Y)})}}),Nr(yi.prototype,function(r,h){var g=et[h];if(g){var O=g.name+"";Ti.call(no,O)||(no[O]=[]),no[O].push({name:h,func:g})}}),no[Ji(o,w).name]=[{name:"wrapper",func:o}],yi.prototype.clone=Sa,yi.prototype.reverse=Cu,yi.prototype.value=Ea,et.prototype.at=J0,et.prototype.chain=$0,et.prototype.commit=K0,et.prototype.next=Q0,et.prototype.plant=ev,et.prototype.reverse=iv,et.prototype.toJSON=et.prototype.valueOf=et.prototype.value=nv,et.prototype.first=et.prototype.head,io&&(et.prototype[io]=tv),et},to=Gc();Zr?((Zr.exports=to)._=to,Ys._=to):gn._=to}).call(Er)}(ru,ru.exports);var em=ru.exports;const $u=Ju(em);class im{constructor(l,o=[],p=!1){vf(this,"simplifyFunc",l=>{try{l=turf.simplify(l,{tolerance:5e-4,highQuality:!1,mutate:!0})}catch{}return l});mars3d?(this.map=l,this.vectorArr=o,this.geoJsonType=new Map([["Point"],["LineString"],["Polygon"],["MultiPoint"],["MultiLineString"],["MultiPolygon"]]),this.avoidanceArr=[],this.editDate={id:""},this.isDynamicMasking=p):console.error("未引入指定插件")}remove(l){this.map.removeLayer(this.map.getLayer(l,"vectorId")),window.dynamicMasking&&window.dynamicMasking.remove(l)}add(l,o){return new Promise((p,d)=>{let u;if(typeof l!="object"){let I=this.map.getLayer(l,"vectorId");if(I)return p(I);u=this.query(l)}else{let I=this.map.getLayer(l.id,"vectorId");if(I)return p(I);u=l}let{value:m,url:_,id:x,title:S}=u;new Cesium.Resource({url:_}).fetchJson().then(I=>{let{id:N,title:z,shpInfo:F}=u,{attributes:E,geometryType:L,geometryCount:w,pointCount:M}=F;if(E){let{width:R,materialType:b,materialOptions:U,clampToGround:B,distanceDisplayCondition:X,distanceDisplayCondition_near:J,distanceDisplayCondition_far:K,zIndex:ft,label:Ct,fill:it,diffHeight:yt,outline:G,outlineStyle:Lt,color:Et,pixelSize:Pt,outlineColor:ce,outlineWidth:re,classificationType:Ft}=JSON.parse(E),Ot;switch(this.isDynamicMasking?(Ct.color=Cesium.Color.fromCssColorString(Ct.color).withAlpha(0),Ct.outlineColor=Cesium.Color.fromCssColorString(Ct.outlineColor).withAlpha(.001),Ct.backgroundColor=Cesium.Color.fromCssColorString(Ct.backgroundColor).withAlpha(.001),Ct.background=!1,Ct.outline=!1,Ct.show=!1):(Ct.color=Cesium.Color.fromCssColorString(Ct.color),Ct.outlineColor=Cesium.Color.fromCssColorString(Ct.outlineColor),Ct.backgroundColor=Cesium.Color.fromCssColorString(Ct.backgroundColor)),L){case"LineString":case"MultiLineString":Ct.backgroundPadding=5,Ot=new mars3d.layer.GeoJsonLayer({data:I,vectorId:N,format:M>1e4?this.simplifyFunc:null,symbol:{type:"polylineC",styleOptions:{width:R,clampToGround:B,distanceDisplayCondition:X,distanceDisplayCondition_far:K,distanceDisplayCondition_near:J,materialType:b,materialOptions:U,classificationType:Ft,label:Ct}},popup:` ${z} `,hasZIndex:!0,zIndex:ft});break;case"Polygon":case"MultiPolygon":b=="PolyGrass"&&(U={evenColor:new Cesium.Color(.25,.4,.1,1),oddColor:new Cesium.Color(.1,.1,.1,1),frequency:1.5}),Ot=new mars3d.layer.GeoJsonLayer({data:I,vectorId:N,format:M>1e4?this.simplifyFunc:null,symbol:{type:"polygon",styleOptions:{fill:it,diffHeight:yt,clampToGround:B,materialType:b,materialOptions:U,distanceDisplayCondition:X,distanceDisplayCondition_far:K,distanceDisplayCondition_near:J,outlineStyle:Lt,outline:G,classificationType:Ft,label:Ct}},popup:` ${z} `});break;case"Point":case"MultiPoint":Ot=new mars3d.layer.GeoJsonLayer({data:I,vectorId:N,format:M>1e4?this.simplifyFunc:null,symbol:{type:"pointP",styleOptions:{color:Et,pixelSize:Pt,outline:G,outlineColor:ce,outlineWidth:re,visibleDepth:!1,label:Ct}}});break}window.map.addLayer(Ot),Ot.bindPopup(Ce=>{console.log("event",Ce)});let Nt=$u.debounce(Ce=>{console.log("测试shp矢量加载完成"),window.dynamicMasking.add(Ce,JSON.parse(E))},500);Ot.readyPromise.then(Ce=>{window.dynamicMasking&&Nt(Ce),p(Ce)}).catch(Ce=>{console.error("测试shp矢量加载失败",Ce),p({tite:"【矢量】"+z+"加载失败",type:"error",id:N,url:_})})}else p({tite:"【矢量】"+z+"加载失败",type:"error",id:N,url:_})}).catch(I=>{console.error("数据有误",I),p({tite:"【矢量】"+S+"数据有误",type:"error",id:x,url:_})})})}updateData(l){this.vectorArr=l}processingKML(l){let o,p=2e3,d=!0,{kmlInfo:u}=l,{fill:m,areaColor:_,areaSideColor:x,transparency:S,isAreaSideColor:C,minDistinct:I,textDistinct:N,textSize:z,textColor:F,fontStyle:E,outLine:L,sideColor:w,backGround:M,backGroundColor:R,clampToGround:b}=u,U={fill:m,color:_,opacity:S||.5,outline:C,outlineColor:x,outlineWidth:2,clampToGround:b,distanceDisplayCondition:!0,distanceDisplayCondition_far:N||1e6,distanceDisplayCondition_near:I||0,classificationType:o,opacity:String(S)},B={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:w||"#000000",outlineWidth:4,scaleByDistance:!0,distanceDisplayCondition:!0,distanceDisplayCondition_far:N||1e6,distanceDisplayCondition_near:I||0,background:M||!1,backgroundColor:R||"",visibleDepth:d,clampToGround:b||!1,disableDepthTestDistance:p};return{...U,label:B}}selected(l){this.map.getLayer(l,"vectorId")&&this.map.getLayer(l,"vectorId").flyTo()}query(l){return this.vectorArr.length==0?!1:this.vectorArr.find(o=>o.id==l)}queryVector(l){return this.map.getLayer(l,"vectorId")}editVector(l,o,p){let d=this.map.getLayer(l,"vectorId"),u=Tf(o,p);d&&(d.eachGraphic(m=>{m.label.show===!1&&(delete m.label.outline,delete m.label.background,delete m.label.outlineColor,delete m.label.backgroundColor),m.setStyle({...u})}),window.dynamicMasking&&dynamicMasking.modify(l,u))}nationalBoundaries(){let l="/gis/nationalBoundaries.json",o=new mars3d.layer.GeoJsonLayer({name:"国界",url:l,format:p=>{try{p=turf.simplify(p,{tolerance:1e-5,highQuality:!1,mutate:!0})}catch(d){console.error(d)}return p},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(l){this.isDynamicMasking=l}}class nm{constructor(l,o=[]){mars3d?(this.map=l,this.terrainProviderArr=o,this.terrainProviderId="",this.events={},this.map.on(mars3d.EventType.terrainLoadError,p=>{console.error("地形服务加载失败",p),this.hide()}),this.map.viewer.scene.globe.tileLoadProgressEvent.addEventListener(p=>{this.map.viewer.scene.globe.tilesLoaded&&this.emit("load",p)})):console.error("未引入指定插件")}add(l){let{url:o,id:p}=l;if(this.terrainProviderId==p&&this.map.terrainProvider._layers)return!1;this.map.terrainProvider=mars3d.LayerUtil.createTerrainProvider({imageXyzId:p,type:"xyz",url:o,requestVertexNormals:!0,requestMetadata:!0}),this.terrainProviderId=p}show(){this.map.hasTerrain=!0}hide(){this.map.hasTerrain=!1}on(l,o){l=="load"?this.events[l]?this.events[l].push(o):this.events[l]=[o]:console.log("未开放自定义")}emit(l,...o){this.events[l]!=null&&this.events[l].forEach(p=>p(...o))}off(l,o){this.events[l]=this.events[l].filter(p=>p!==o)}once(l,o){const p=()=>{o(),this.off(l,p)};this.on(l,p)}addClip(l){return new Promise((o,p)=>{window.bimClip?o(bimClip.clipGisAdd(l)):p("挖洞工具未初始化")})}}class rm{constructor(l,o=[]){mars3d?(this.map=l,this.elevationImageArr=o,this.elevationImageLayer,this.form={brightnessVal:1.3,msaaSamples:4,surfaceOpacity:1,layerOpacity:1,layerBrightness:2,layerContrast:1,layerHue:0,layerSaturation:1,layerGamma:1}):console.error("未引入指定插件")}pushVector(l){this.elevationImageArr.push(l)}add(l,o){let p;if(typeof l!="object"?p=l:p=l.imageXyzId,this.map.getLayer(p,"imageXyzId"))return!1;const{layerOpacity:d,layerBrightness:u,layerContrast:m,layerHue:_,layerSaturation:x,layerGamma:S,surfaceOpacity:C}=this.exposureEnvironmentSettings();return new Promise((I,N)=>{let z,F,E,L,w;if(typeof l!="object"){let M=this.query(l);M||N("缺少树结构");let{gisInfo:R}=M;z=R.id,E=R.order,F=M.url,L=R.minLevel,w=R.maxLevel}else z=l.imageXyzId,F=l.url,E=l.zIndex,L=l.minimumLevel,w=l.maximumLevel;this.elevationImageLayer=new mars3d.layer.XyzLayer({imageXyzId:z,type:"xyz",url:F,hasZIndex:!0,zIndex:E.toString(),brightness:u,opacity:d,saturation:x,contrast:m,hue:_,gamma:S,alpha:C,show:!0,minimumLevel:L||0,maximumLevel:w||15}),this.elevationImageLayer.on(mars3d.EventType.load,M=>{I(M)}),this.map.addLayer(this.elevationImageLayer),o&&Object.keys(o).forEach(M=>{this.elevationImageLayer.on(fnType.get(M),R=>{o[M](R)})})})}remove(l){console.log(l),this.map.removeLayer(this.map.getLayer(l,"imageXyzId"))}query(l){return this.elevationImageArr.length==0?!1:this.elevationImageArr.find(o=>o.id==l)}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 sm{constructor(l,o,...p){vf(this,"manualFreed",$u.debounce(()=>{let{lng:l,lat:o,alt:p,pitch:d}=this.map.getCameraView(),u;this.modelArray.forEach(m=>{u=m.releasedDistance?m.releasedDistance:1e4,this.disTance([l,o,p],[m.center._lng,m.center._lat,m.center._alt],this.calculateDistance(d,u))?this.map.getLayer(m.id,"modelId")&&this.emit("leave",m):this.map.getLayer(m.id,"modelId")||this.emit("enter",m)})},200));mars3d?(l&&l!=null&&(this.modelArray=l),this.showModelArray=[],o&&o!=null&&(this.map=o),this.Cesium=mars3d.Cesium,this.events={}):console.error("未引入指定插件")}on(l,o){l=="enter"||l=="leave"?this.events[l]?this.events[l].push(o):this.events[l]=[o]:console.log("未开放自定义")}emit(l,...o){this.events[l]!=null&&this.events[l].forEach(p=>p(...o))}off(l,o){this.events[l]=this.events[l].filter(p=>p!==o)}once(l,o){const p=()=>{o(),this.off(l,p)};this.on(l,p)}say(l){return this[l]}add(l,o){this[l].push(o)}remove(l,o){this[l]=this[l].filter(function(p){return p!==o})}initial(){this.modelArray=[],this.events={}}updateCustomExcavationDetails(l,o,p,d=[],u={}){let m,_,x;switch(m=this.modelArray.find(S=>S.modelId==l).customize.bimModelExcavationDetails,x=m.find((S,C)=>{if(S.id==o)return _=C,S}),p){case"delete":m.splice(_,1);break;case"update":x.excavationDetails=d;break;case"add":m.push(u);break;case"edit":x.excavationDetails=u.excavationDetails,x.kId=u.kId;break}return m}resourceRelease(){this.map.viewer.camera.moveEnd.addEventListener(()=>{this.freed()})}freed(){let{alt:l}=this.map.getCameraView();l<2e4&&(this.freed=$u.throttle(()=>{let{lng:o,lat:p,alt:d,pitch:u}=this.map.getCameraView();this.modelArray&&this.modelArray.forEach(m=>{let _=m.bimModel.releasedDistance?m.bimModel.releasedDistance:1e4;m.center&&this.disTance([o,p,d],[m.center._lng,m.center._lat,m.center._alt],this.calculateDistance(u,_))?this.map.getLayer(m.id,"modelId")&&this.emit("leave",m):this.showModelArray.indexOf(m.id)>=0&&!this.map.getLayer(m.id,"modelId")&&this.emit("enter",m)})},2e3),this.freed())}findPnodeId(l,o,p="id"){let d;if(l){for(var u=0;u<l.length;u++){let m=l[u];if(m[p]==o)return d=m,d;if(m.children&&m.children.length>0&&(d=this.findPnodeId(m.children,o,p),d))return d}return d}}disTance(l,o,p){let d,u,m;return d=Cesium.Cartesian3.fromDegrees(...l),u=Cesium.Cartesian3.fromDegrees(...o),m=Cesium.Cartesian3.distance(d,u),m>p}calculateDistance(l,o){let p=(l+180)%360-180;p=Math.max(-90,Math.min(p,90));let d=(o-o/5)*(Math.abs(p)/90)+o/5;return Math.round(d)}}class om{constructor(l,o=[],p){mars3d?(this.map=l,this.entityArr=o,this.entityLayer=new mars3d.layer.GraphicLayer({entityId:"bimEntity"}),this.map.addLayer(this.entityLayer),this.entityItem=null,this.events={}):console.error("未引入指定插件")}on(l,o){l=="change"||l=="collection"?this.events[l]?this.events[l].push(o):this.events[l]=[o]:console.log("未开放自定义")}emit(l,...o){this.events[l]!=null&&this.events[l].forEach(p=>p(...o))}off(l,o){this.events[l]=this.events[l].filter(p=>p!==o)}once(l,o){const p=()=>{o(),this.off(l,p)};this.on(l,p)}add(l,o){return new Promise((p,d)=>{var u;if(this.entityLayer){let m,_,x;if(typeof l!="object"?(m=this.entityLayer.getGraphicByAttr(l,"entityId"),_=this.query(l),x=JSON.parse(_.bimPlanPainting.graphic),x.attr=x.attr||{},x.attr.entityId=l):(m=this.entityLayer.getGraphicByAttr(l.id,"entityId"),x=JSON.parse(JSON.stringify(l)),x.attr=x.attr||{},x.attr.entityId=x.attr.entityId||o,x.attr==null?x.attr={entityId:l.id}:((u=x.attr)==null?void 0:u.entityId)==null&&o&&(x.attr.entityId=o)),m)return p();this.entityLayer.addGraphic(x),p(x)}else p(),console.error("未初始化标绘实例图层")})}query(l){return this.entityArr.length==0?!1:this.entityArr.find(o=>o.id==l)}queryEntity(l){if(bimEntity.entityLayer)return bimEntity.entityLayer.getGraphicByAttr(l,"entityId")}selected(l){let o=this.entityLayer.getGraphicByAttr(l,"entityId");o._point&&o._point._alt>0?o.flyTo({radius:o._point._alt+500}):o.flyTo()}remove(l){this.entityLayer.getGraphicByAttr(l,"entityId")&&(this.entityLayer.getGraphicByAttr(l,"entityId").remove(),this.entityItem&&(this.entityItem._state=="destroy"||this.entityItem.options.attr.entityId==l)&&(this.entityItem=null))}removeEntityItem(){this.entityItem=null}updateData(l){this.entityArr=l}startDrawGraphic(l){let{type:o,style:p}=l;if(o=="div")if(p.html)this.entityLayer.startDraw(l).then(d=>{setTimeout(()=>{this.entityItem=d,this.entityLayer.startEditing(d)},500)});else{let{title:d,divType:u,theme_color:m,font_color:_,scaleByDistance:x,scaleByDistance_far:S,scaleByDistance_farValue:C,scaleByDistance_near:I,scaleByDistance_nearValue:N,distanceDisplayCondition:z,distanceDisplayCondition_far:F,distanceDisplayCondition_near:E,clampToGround:L}=p,w={type:"div",style:{pointerEvents:!0,scaleByDistance:x,scaleByDistance_far:S,scaleByDistance_farValue:C,scaleByDistance_near:I,scaleByDistance_nearValue:N,distanceDisplayCondition:z,distanceDisplayCondition_far:F,distanceDisplayCondition_near:E,clampToGround:L,horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}};switch(u){case"1":w.style.html=`<div class="entity-div-style entity-div-style1" style="--theme-color1:${m};--theme-font-color1:${_};">
|
|
2636
2636
|
<div class="title">${d}</div>
|
|
2637
|
-
</div>`,w.style.horizontalOrigin=Cesium.HorizontalOrigin.CENTER;break}this.entityLayer.startDraw(w).then(M=>{setTimeout(()=>{this.entityItem=M,this.entityLayer.startEditing(M)},500)})}else this.entityLayer.startDraw(l).then(d=>{setTimeout(()=>{this.entityItem=d,this.entityLayer.startEditing(d)},500)})}stopDraw(l=!0){this.entityLayer&&this.entityLayer.stopDraw(),l&&this.entityItem&&(this.entityItem.stopEditing(),this.entityItem.remove(),this.entityItem=null)}updateEntityItem(l){let o=this.entityLayer.getGraphicByAttr(l,"entityId");o&&(this.entityItem=o)}edit(l,o,p,d){let u=Tf(o,p);o.vectorStyle&&this.entityItem&&(o.vectorStyle.divType==5?this.entityItem.setStyle({...u,horizontalOrigin:Cesium.HorizontalOrigin.LEFT}):this.entityItem.setStyle({...u}))}enableDragging(l=!0){l?this.entityLayer.startEditing(this.entityItem):(this.entityLayer.stopDraw(),this.entityItem&&this.entityItem.stopEditing())}addRightMenu(){this.entityLayer.bindContextMenu([{text:"编辑对象",callback:l=>{this.emit("change",l)}}])}removeRightMenu(){this.entityLayer.hasContextMenu()&&this.entityLayer.unbindContextMenu()}processDivData(l){let o={"--theme-color1":"theme_color","--theme-font-color1":"font_color","--theme-color2":"theme_color2","--theme-color3":"theme_color3"},p={title:"",theme_color:"",font_color:"",content:"",divType:"",divStyle:{}};const d=document.createElement("div");d.innerHTML=l;const u=d.querySelector(".entity-div-style");return console.log("解耦",u),Object.keys(o).forEach(m=>{m=="--theme-color2"||m=="--theme-color3"?p.divStyle[o[m]]=u.style.getPropertyValue(m)||"#fff":p[o[m]]=u.style.getPropertyValue(m)}),p.title=u.querySelector(".title")?u.querySelector(".title").innerText:"标题",p.content=u.querySelector(".content")?u.querySelector(".content").innerText:"内容",p.divType=u.classList[1]?u.classList[1].replace("entity-div-style",""):"",p}updateHtml(l,o){let{theme_color:p,font_color:d,title:u,content:m,divStyle:_}=o,{theme_color2:x,theme_color3:S}=_,C="";switch(l){case"1":C=`<div class="entity-div-style entity-div-style1" style="--theme-color1:${p};--theme-font-color1:${d};">
|
|
2637
|
+
</div>`,w.style.horizontalOrigin=Cesium.HorizontalOrigin.CENTER;break}this.entityLayer.startDraw(w).then(M=>{setTimeout(()=>{this.entityItem=M,this.entityLayer.startEditing(M)},500)})}else this.entityLayer.startDraw(l).then(d=>{setTimeout(()=>{this.entityItem=d,this.entityLayer.startEditing(d)},500)})}stopDraw(l=!0){this.entityLayer&&this.entityLayer.stopDraw(),l&&this.entityItem&&(this.entityItem.stopEditing(),this.entityItem.remove(),this.entityItem=null)}updateEntityItem(l){let o=this.entityLayer.getGraphicByAttr(l,"entityId");o&&(this.entityItem=o)}edit(l,o,p,d){let u=Tf(o,p);o.vectorStyle&&this.entityItem&&(o.vectorStyle.divType==5?this.entityItem.setStyle({...u,horizontalOrigin:Cesium.HorizontalOrigin.LEFT}):this.entityItem.setStyle({...u}))}enableDragging(l=!0){l?this.entityLayer.startEditing(this.entityItem):(this.entityLayer.stopDraw(),this.entityItem&&this.entityItem.stopEditing())}addRightMenu(){this.entityLayer.bindContextMenu([{text:"编辑对象",callback:l=>{this.emit("change",l)}},{text:"收藏对象",callback:l=>{this.emit("collection",l)}}])}removeRightMenu(){this.entityLayer.hasContextMenu()&&this.entityLayer.unbindContextMenu()}processDivData(l){let o={"--theme-color1":"theme_color","--theme-font-color1":"font_color","--theme-color2":"theme_color2","--theme-color3":"theme_color3"},p={title:"",theme_color:"",font_color:"",content:"",divType:"",divStyle:{}};const d=document.createElement("div");d.innerHTML=l;const u=d.querySelector(".entity-div-style");return console.log("解耦",u),Object.keys(o).forEach(m=>{m=="--theme-color2"||m=="--theme-color3"?p.divStyle[o[m]]=u.style.getPropertyValue(m)||"#fff":p[o[m]]=u.style.getPropertyValue(m)}),p.title=u.querySelector(".title")?u.querySelector(".title").innerText:"标题",p.content=u.querySelector(".content")?u.querySelector(".content").innerText:"内容",p.divType=u.classList[1]?u.classList[1].replace("entity-div-style",""):"",p}updateHtml(l,o){let{theme_color:p,font_color:d,title:u,content:m,divStyle:_}=o,{theme_color2:x,theme_color3:S}=_,C="";switch(l){case"1":C=`<div class="entity-div-style entity-div-style1" style="--theme-color1:${p};--theme-font-color1:${d};">
|
|
2638
2638
|
<div class="title">${u}</div>
|
|
2639
2639
|
</div>`;break;case"2":C=`<div class="entity-div-style entity-div-style2" style="--theme-color1:${p};--theme-font-color1:${d};">
|
|
2640
2640
|
<div class="title">${u}</div>
|