chbim-plugins 0.0.76 → 0.0.78
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 +4 -4
- package/chbim-plugins.umd.cjs +1 -1
- package/package.json +5 -2
package/chbim-plugins.js
CHANGED
|
@@ -24404,7 +24404,7 @@ class f1 {
|
|
|
24404
24404
|
*
|
|
24405
24405
|
*/
|
|
24406
24406
|
remove(l, o = null) {
|
|
24407
|
-
o
|
|
24407
|
+
console.log("customAttributes", o), o && o.isClone == "true" ? window.mapClone.mapEx.removeLayer(
|
|
24408
24408
|
window.mapClone.mapEx.getLayer(l, "vectorId")
|
|
24409
24409
|
) : (window.map.removeLayer(window.map.getLayer(l, "vectorId")), window.dynamicMasking && window.dynamicMasking.remove(l));
|
|
24410
24410
|
}
|
|
@@ -24554,7 +24554,7 @@ class f1 {
|
|
|
24554
24554
|
window.dynamicMasking && ke(ce), p(ce);
|
|
24555
24555
|
}).catch((ce) => {
|
|
24556
24556
|
console.error("测试shp矢量加载失败", ce), p({
|
|
24557
|
-
tite: "
|
|
24557
|
+
tite: "【矢量】<" + F + ">无法加载",
|
|
24558
24558
|
type: "error",
|
|
24559
24559
|
id: I,
|
|
24560
24560
|
url: T
|
|
@@ -24562,14 +24562,14 @@ class f1 {
|
|
|
24562
24562
|
});
|
|
24563
24563
|
} else
|
|
24564
24564
|
p({
|
|
24565
|
-
tite: "
|
|
24565
|
+
tite: "【矢量】<" + F + ">无法加载",
|
|
24566
24566
|
type: "error",
|
|
24567
24567
|
id: I,
|
|
24568
24568
|
url: T
|
|
24569
24569
|
});
|
|
24570
24570
|
}).catch((B) => {
|
|
24571
24571
|
console.error("数据有误", B), p({
|
|
24572
|
-
tite: "
|
|
24572
|
+
tite: "【矢量】<" + C + ">链接地址有误",
|
|
24573
24573
|
type: "error",
|
|
24574
24574
|
id: S,
|
|
24575
24575
|
url: T
|
package/chbim-plugins.umd.cjs
CHANGED
|
@@ -2632,7 +2632,7 @@ __p += '`),Fi&&(de+=`' +
|
|
|
2632
2632
|
function print() { __p += __j.call(arguments, '') }
|
|
2633
2633
|
`:`;
|
|
2634
2634
|
`)+de+`return __p
|
|
2635
|
-
}`;var Mi=Od(function(){return Ni(ut,Je+"return "+de).apply(o,_t)});if(Mi.source=de,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=ct,O=It;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 Nt=_t?xn(_t,0,bt).join(""):r.slice(0,bt);if(Y===o)return Nt+O;if(_t&&(bt+=Nt.length-bt),af(Y)){if(r.slice(bt).search(Y)){var se,le=Nt;for(Y.global||(Y=Kn(Y.source,Yi(Gl.exec(Y))+"g")),Y.lastIndex=0;se=Y.exec(le);)var de=se.index;Nt=Nt.slice(0,de===o?bt:de)}}else if(r.indexOf(Ye(Y),bt)!=bt){var ze=Nt.lastIndexOf(Y);ze>-1&&(Nt=Nt.slice(0,ze))}return Nt+O}function yy(r){return r=Yi(r),r&&Xs.test(r)?r.replace(As,Jl):r}var xy=De(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,z))}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,z))}function Ay(r){return gt(wr(r,z))}function Cy(r,h){return At(r,wr(h,z))}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 Nt=h[bt];r[bt]=Nt,_t&&(r.prototype[bt]=function(){var se=this.__chain__;if(ut||se){var le=r(this.__wrapped__),de=le.__actions__=er(this.__actions__);return de.push({func:Nt,args:arguments,thisArg:r}),le.__chain__=se,le}return Nt.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>fe)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 it.after=Av,it.ary=ud,it.assign=d_,it.assignIn=Sd,it.assignInWith=Zu,it.assignWith=m_,it.at=g_,it.before=cd,it.bind=rf,it.bindAll=wy,it.bindKey=fd,it.castArray=Fv,it.chain=ad,it.chunk=Yg,it.compact=Zg,it.concat=Jg,it.cond=Ty,it.conforms=My,it.constant=cf,it.countBy=rv,it.create=v_,it.curry=pd,it.curryRight=dd,it.debounce=md,it.defaults=__,it.defaultsDeep=y_,it.defer=Cv,it.delay=Pv,it.difference=$g,it.differenceBy=Kg,it.differenceWith=Qg,it.drop=t0,it.dropRight=e0,it.dropRightWhile=i0,it.dropWhile=n0,it.fill=r0,it.filter=ov,it.flatMap=hv,it.flatMapDeep=uv,it.flatMapDepth=cv,it.flatten=nd,it.flattenDeep=s0,it.flattenDepth=o0,it.flip=Lv,it.flow=Ey,it.flowRight=by,it.fromPairs=a0,it.functions=b_,it.functionsIn=A_,it.groupBy=fv,it.initial=h0,it.intersection=u0,it.intersectionBy=c0,it.intersectionWith=f0,it.invert=P_,it.invertBy=L_,it.invokeMap=dv,it.iteratee=ff,it.keyBy=mv,it.keys=Jn,it.keysIn=Ur,it.map=Vu,it.mapKeys=O_,it.mapValues=I_,it.matches=Ay,it.matchesProperty=Cy,it.memoize=ju,it.merge=D_,it.mergeWith=Ed,it.method=Py,it.methodOf=Ly,it.mixin=pf,it.negate=Xu,it.nthArg=Oy,it.omit=z_,it.omitBy=k_,it.once=Rv,it.orderBy=gv,it.over=Iy,it.overArgs=Ov,it.overEvery=Dy,it.overSome=zy,it.partial=sf,it.partialRight=gd,it.partition=vv,it.pick=B_,it.pickBy=bd,it.property=Id,it.propertyOf=ky,it.pull=g0,it.pullAll=sd,it.pullAllBy=v0,it.pullAllWith=_0,it.pullAt=y0,it.range=By,it.rangeRight=Ny,it.rearg=Iv,it.reject=xv,it.remove=x0,it.rest=Dv,it.reverse=ef,it.sampleSize=Tv,it.set=F_,it.setWith=U_,it.shuffle=Mv,it.slice=w0,it.sortBy=bv,it.sortedUniq=C0,it.sortedUniqBy=P0,it.split=hy,it.spread=zv,it.tail=L0,it.take=R0,it.takeRight=O0,it.takeRightWhile=I0,it.takeWhile=D0,it.tap=Z0,it.throttle=kv,it.thru=Hu,it.toArray=wd,it.toPairs=Ad,it.toPairsIn=Cd,it.toPath=Vy,it.toPlainObject=Md,it.transform=G_,it.unary=Bv,it.union=z0,it.unionBy=k0,it.unionWith=B0,it.uniq=N0,it.uniqBy=F0,it.uniqWith=U0,it.unset=H_,it.unzip=nf,it.unzipWith=od,it.update=V_,it.updateWith=W_,it.values=fh,it.valuesIn=j_,it.without=G0,it.words=Rd,it.wrap=Nv,it.xor=H0,it.xorBy=V0,it.xorWith=W0,it.zip=j0,it.zipObject=X0,it.zipObjectDeep=q0,it.zipWith=Y0,it.entries=Ad,it.entriesIn=Cd,it.extend=Sd,it.extendWith=Zu,pf(it,it),it.add=jy,it.attempt=Od,it.camelCase=Z_,it.capitalize=Pd,it.ceil=Xy,it.clamp=X_,it.clone=Uv,it.cloneDeep=Hv,it.cloneDeepWith=Vv,it.cloneWith=Gv,it.conformsTo=Wv,it.deburr=Ld,it.defaultTo=Sy,it.divide=qy,it.endsWith=J_,it.eq=Fs,it.escape=$_,it.escapeRegExp=K_,it.every=sv,it.find=av,it.findIndex=ed,it.findKey=x_,it.findLast=lv,it.findLastIndex=id,it.findLastKey=w_,it.floor=Yy,it.forEach=ld,it.forEachRight=hd,it.forIn=T_,it.forInRight=M_,it.forOwn=S_,it.forOwnRight=E_,it.get=lf,it.gt=jv,it.gte=Xv,it.has=C_,it.hasIn=hf,it.head=rd,it.identity=Gr,it.includes=pv,it.indexOf=l0,it.inRange=q_,it.invoke=R_,it.isArguments=bl,it.isArray=vi,it.isArrayBuffer=qv,it.isArrayLike=Fr,it.isArrayLikeObject=Dn,it.isBoolean=Yv,it.isBuffer=Da,it.isDate=Zv,it.isElement=Jv,it.isEmpty=$v,it.isEqual=Kv,it.isEqualWith=Qv,it.isError=of,it.isFinite=t_,it.isFunction=Wo,it.isInteger=vd,it.isLength=qu,it.isMap=_d,it.isMatch=e_,it.isMatchWith=i_,it.isNaN=n_,it.isNative=r_,it.isNil=o_,it.isNull=s_,it.isNumber=yd,it.isObject=wn,it.isObjectLike=Ln,it.isPlainObject=eu,it.isRegExp=af,it.isSafeInteger=a_,it.isSet=xd,it.isString=Yu,it.isSymbol=ts,it.isTypedArray=ch,it.isUndefined=l_,it.isWeakMap=h_,it.isWeakSet=u_,it.join=p0,it.kebabCase=Q_,it.last=Es,it.lastIndexOf=d0,it.lowerCase=ty,it.lowerFirst=ey,it.lt=c_,it.lte=f_,it.max=Zy,it.maxBy=Jy,it.mean=$y,it.meanBy=Ky,it.min=Qy,it.minBy=t1,it.stubArray=mf,it.stubFalse=gf,it.stubObject=Fy,it.stubString=Uy,it.stubTrue=Gy,it.multiply=e1,it.nth=m0,it.noConflict=Ry,it.noop=df,it.now=Wu,it.pad=iy,it.padEnd=ny,it.padStart=ry,it.parseInt=sy,it.random=Y_,it.reduce=_v,it.reduceRight=yv,it.repeat=oy,it.replace=ay,it.result=N_,it.round=i1,it.runInContext=Lt,it.sample=wv,it.size=Sv,it.snakeCase=ly,it.some=Ev,it.sortedIndex=T0,it.sortedIndexBy=M0,it.sortedIndexOf=S0,it.sortedLastIndex=E0,it.sortedLastIndexBy=b0,it.sortedLastIndexOf=A0,it.startCase=uy,it.startsWith=cy,it.subtract=n1,it.sum=r1,it.sumBy=s1,it.template=fy,it.times=Hy,it.toFinite=jo,it.toInteger=wi,it.toLength=Td,it.toLower=py,it.toNumber=bs,it.toSafeInteger=p_,it.toString=Yi,it.toUpper=dy,it.trim=my,it.trimEnd=gy,it.trimStart=vy,it.truncate=_y,it.unescape=yy,it.uniqueId=Wy,it.upperCase=xy,it.upperFirst=uf,it.each=ld,it.eachRight=hd,it.first=rd,pf(it,function(){var r={};return Nr(it,function(h,g){Ti.call(it.prototype,g)||(r[g]=h)}),r}(),{chain:!1}),it.VERSION=p,Zi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(r){it[r].placeholder=it}),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=it[O?"take"+(h=="last"?"Right":""):h],ut=O||/^find/.test(h);Y&&(it.prototype[h]=function(){var _t=this.__wrapped__,bt=O?[1]:arguments,Nt=_t instanceof yi,se=bt[0],le=Nt||vi(_t),de=function(Pi){var Fi=Y.apply(it,fs([Pi],bt));return O&&ze?Fi[0]:Fi};le&&g&&typeof se=="function"&&se.length!=1&&(Nt=le=!1);var ze=this.__chain__,Je=!!this.__actions__.length,hi=ut&&!ze,Mi=Nt&&!Je;if(!ut&&le){_t=Mi?_t:new yi(this);var ui=r.apply(_t,bt);return ui.__actions__.push({func:Hu,args:[de],thisArg:o}),new qn(ui,ze)}return hi&&Mi?r.apply(this,bt):(ui=this.thru(de),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);it.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=it[h];if(g){var O=g.name+"";Ti.call(no,O)||(no[O]=[]),no[O].push({name:h,func:g})}}),no[Ji(o,x).name]=[{name:"wrapper",func:o}],yi.prototype.clone=Sa,yi.prototype.reverse=Cu,yi.prototype.value=Ea,it.prototype.at=J0,it.prototype.chain=$0,it.prototype.commit=K0,it.prototype.next=Q0,it.prototype.plant=ev,it.prototype.reverse=iv,it.prototype.toJSON=it.prototype.valueOf=it.prototype.value=nv,it.prototype.first=it.prototype.head,io&&(it.prototype[io]=tv),it},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.vectorArr=o,this.geoJsonType=new Map([["Point"],["LineString"],["Polygon"],["MultiPoint"],["MultiLineString"],["MultiPolygon"]]),this.avoidanceArr=[],this.editDate={id:""},this.isDynamicMasking=p):console.error("未引入指定插件")}remove(l,o=null){o?o.isClone&&window.mapClone.mapEx.removeLayer(window.mapClone.mapEx.getLayer(l,"vectorId")):(window.map.removeLayer(window.map.getLayer(l,"vectorId")),window.dynamicMasking&&window.dynamicMasking.remove(l))}add(l,o){return new Promise((p,d)=>{let u,m=o==null?void 0:o.isClone;if(typeof l!="object"){let B=window.map.getLayer(l,"vectorId");if(B)return p(B);u=this.query(l)}else{let B=window.map.getLayer(l.id,"vectorId");if(B)return p(B);u=l}let{value:_,url:w,id:S,title:C}=u;new Cesium.Resource({url:w}).fetchJson().then(B=>{let{id:I,title:F,shpInfo:E}=u,{attributes:L,geometryType:x,geometryCount:M,pointCount:R}=E;if(L){let{width:b,materialType:U,materialOptions:N,clampToGround:j,distanceDisplayCondition:J,distanceDisplayCondition_near:$,distanceDisplayCondition_far:ct,zIndex:It,label:et,fill:yt,diffHeight:G,outline:Pt,outlineStyle:Et,color:Ct,pixelSize:fe,outlineColor:re,outlineWidth:Ft,classificationType:Ot}=JSON.parse(L),Bt;switch(this.isDynamicMasking?(et.color=Cesium.Color.fromCssColorString(et.color).withAlpha(0),et.outlineColor=Cesium.Color.fromCssColorString(et.outlineColor).withAlpha(.001),et.backgroundColor=Cesium.Color.fromCssColorString(et.backgroundColor).withAlpha(.001),et.background=!1,et.outline=!1,et.show=!1):(et.color=Cesium.Color.fromCssColorString(et.color),et.outlineColor=Cesium.Color.fromCssColorString(et.outlineColor),et.backgroundColor=Cesium.Color.fromCssColorString(et.backgroundColor)),x){case"LineString":case"MultiLineString":et.backgroundPadding=5,Bt=new mars3d.layer.GeoJsonLayer({data:B,vectorId:I,format:R>1e4?this.simplifyFunc:null,symbol:{type:"polylineC",styleOptions:{width:b,clampToGround:j,distanceDisplayCondition:J,distanceDisplayCondition_far:ct,distanceDisplayCondition_near:$,materialType:U,materialOptions:N,classificationType:Ot,label:et}},hasZIndex:!0,zIndex:It});break;case"Polygon":case"MultiPolygon":U=="PolyGrass"&&(N={evenColor:new Cesium.Color(.25,.4,.1,1),oddColor:new Cesium.Color(.1,.1,.1,1),frequency:1.5}),Bt=new mars3d.layer.GeoJsonLayer({data:B,vectorId:I,format:R>1e4?this.simplifyFunc:null,symbol:{type:"polygon",styleOptions:{fill:yt,diffHeight:G,clampToGround:j,materialType:U,materialOptions:N,distanceDisplayCondition:J,distanceDisplayCondition_far:ct,distanceDisplayCondition_near:$,outlineStyle:Et,outline:Pt,classificationType:Ot,label:et}}});break;case"Point":case"MultiPoint":Bt=new mars3d.layer.GeoJsonLayer({data:B,vectorId:I,format:R>1e4?this.simplifyFunc:null,symbol:{type:"pointP",styleOptions:{color:Ct,pixelSize:fe,outline:Pt,outlineColor:re,outlineWidth:Ft,visibleDepth:!1,label:et}}});break}m?window.mapClone.mapEx.addLayer(Bt):window.map.addLayer(Bt),Bt.bindPopup(ce=>{let Yt='<div class="bim-map-popup">';return console.log("event",ce.graphic.attr),Object.keys(ce.graphic.attr).forEach(($e,Oi)=>{ce.graphic.attr[$e]&&(Yt+=`<p><b>${$e}</b> : ${ce.graphic.attr[$e]}</p>`)}),Yt+="</div>",Yt});let ke=$u.debounce(ce=>{console.log("测试shp矢量加载完成"),window.dynamicMasking.add(ce,JSON.parse(L))},500);Bt.readyPromise.then(ce=>{window.dynamicMasking&&ke(ce),p(ce)}).catch(ce=>{console.error("测试shp矢量加载失败",ce),p({tite:"【矢量】「 "+F+"」无法加载",type:"error",id:I,url:w})})}else p({tite:"【矢量】「 "+F+"」无法加载",type:"error",id:I,url:w})}).catch(B=>{console.error("数据有误",B),p({tite:"【矢量】「"+C+"」链接地址有误",type:"error",id:S,url:w})})})}updateData(l){this.vectorArr=l}processingKML(l){let o,p=2e3,d=!0,{kmlInfo:u}=l,{fill:m,areaColor:_,areaSideColor:w,transparency:S,isAreaSideColor:C,minDistinct:z,textDistinct:B,textSize:I,textColor:F,fontStyle:E,outLine:L,sideColor:x,backGround:M,backGroundColor:R,clampToGround:b}=u,U={fill:m,color:_,opacity:S||.5,outline:C,outlineColor:w,outlineWidth:2,clampToGround:b,distanceDisplayCondition:!0,distanceDisplayCondition_far:B||1e6,distanceDisplayCondition_near:z||0,classificationType:o,opacity:String(S)},N={text:"{name}",horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffsetY:-10,font_size:26,color:F||"#ffffff",font_family:E||"黑体",outline:L||!0,outlineColor:x||"#000000",outlineWidth:4,scaleByDistance:!0,distanceDisplayCondition:!0,distanceDisplayCondition_far:B||1e6,distanceDisplayCondition_near:z||0,background:M||!1,backgroundColor:R||"",visibleDepth:d,clampToGround:b||!1,disableDepthTestDistance:p};return{...U,label:N}}selected(l){window.map.getLayer(l,"vectorId")&&window.map.getLayer(l,"vectorId").flyTo()}query(l){return this.vectorArr.length==0?!1:this.vectorArr.find(o=>o.id==l)}queryVector(l){return window.map.getLayer(l,"vectorId")}editVector(l,o,p){let d=window.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=[]){mars3d?(this.terrainProviderArr=l,this.terrainProviderId="",this.events={},window.map.on(mars3d.EventType.terrainLoadError,o=>{console.error("地形服务加载失败",o),this.hide()}),window.map.viewer.scene.globe.tileLoadProgressEvent.addEventListener(o=>{window.map.viewer.scene.globe.tilesLoaded&&this.emit("load",o)})):console.error("未引入指定插件")}add(l){let{url:o,id:p}=l;if(this.terrainProviderId==p&&window.map.terrainProvider._layers)return!1;window.map.terrainProvider=mars3d.LayerUtil.createTerrainProvider({imageXyzId:p,type:"xyz",url:o,requestVertexNormals:!0,requestMetadata:!0}),this.terrainProviderId=p}show(){window.map.hasTerrain=!0}hide(){window.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=[]){mars3d?(this.elevationImageArr=l,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,window.map.getLayer(p,"imageXyzId"))return!1;const{layerOpacity:d,layerBrightness:u,layerContrast:m,layerHue:_,layerSaturation:w,layerGamma:S,surfaceOpacity:C}=this.exposureEnvironmentSettings();return new Promise((z,B)=>{let I,F,E,L,x,M;if(typeof l!="object"){let R=this.query(l);R||B("缺少树结构");let{gisInfo:b}=R;I=b.id,E=b.order,F=R.url,L=b.minLevel,x=b.maxLevel}else I=l.imageXyzId,F=l.url,E=l.zIndex,L=l.minimumLevel,x=l.maximumLevel,M=l.chinaCRS;this.elevationImageLayer=new mars3d.layer.XyzLayer({imageXyzId:I,type:"xyz",url:F,hasZIndex:!0,zIndex:E.toString(),brightness:u,opacity:d,saturation:w,contrast:m,hue:_,gamma:S,alpha:C,show:!0,minimumLevel:L||0,maximumLevel:x||15,chinaCRS:M}),this.elevationImageLayer.on(mars3d.EventType.load,R=>{z(R)}),window.map.addLayer(this.elevationImageLayer),o&&Object.keys(o).forEach(R=>{this.elevationImageLayer.on(fnType.get(R),b=>{o[R](b)})})})}remove(l){console.log(l),window.map.removeLayer(window.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,_,w;switch(m=this.modelArray.find(S=>S.modelId==l).customize.bimModelExcavationDetails,w=m.find((S,C)=>{if(S.id==o)return _=C,S}),p){case"delete":m.splice(_,1);break;case"update":w.excavationDetails=d;break;case"add":m.push(u);break;case"edit":w.excavationDetails=u.excavationDetails,w.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){mars3d?(this.entityArr=l,this.entityLayer=new mars3d.layer.GraphicLayer({entityId:"bimEntity"}),window.map.addLayer(this.entityLayer),this.entityItem=null,this.events={},this.entityCloneLayer):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=null,p){return new Promise((d,u)=>{var m;if(this.entityLayer){let _,w,S;if(p==null?void 0:p.isClone)this.entityCloneLayer&&(w=this.query(l),S=JSON.parse(w.bimPlanPainting.graphic),S.attr=S.attr||{},S.attr.entityId=l,this.entityCloneLayer.addGraphic(S));else{if(typeof l!="object"?(_=this.entityLayer.getGraphicByAttr(l,"entityId"),w=this.query(l),S=JSON.parse(w.bimPlanPainting.graphic),S.attr=S.attr||{},S.attr.entityId=l):(_=this.entityLayer.getGraphicByAttr(l.id,"entityId"),S=JSON.parse(JSON.stringify(l)),S.attr=S.attr||{},S.attr.entityId=S.attr.entityId||o,S.attr==null?S.attr={entityId:l.id}:((m=S.attr)==null?void 0:m.entityId)==null&&o&&(S.attr.entityId=o)),_)return d();this.entityLayer.addGraphic(S),d(S)}}else d(),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,o=null){let p=this.entityLayer.getGraphicByAttr(l,"entityId");o==null||o.isClone,p._point&&p._point._alt>0?p.flyTo({radius:p._point._alt+500}):p.flyTo()}remove(l,o=null){(o==null?void 0:o.isClone)?this.entityCloneLayer&&this.entityCloneLayer.getGraphicByAttr(l,"entityId").remove():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))}entityCloneLayerInit(){this.entityCloneLayer==null&&(this.entityCloneLayer=window.mapClone._mapEx.getLayer("bimEntity","entityId"))}entityCloneLayerRemove(){console.log("没用移除"),this.entityCloneLayer.remove(),this.entityCloneLayer=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:w,scaleByDistance_far:S,scaleByDistance_farValue:C,scaleByDistance_near:z,scaleByDistance_nearValue:B,distanceDisplayCondition:I,distanceDisplayCondition_far:F,distanceDisplayCondition_near:E,clampToGround:L}=p,x={type:"div",style:{pointerEvents:!0,scaleByDistance:w,scaleByDistance_far:S,scaleByDistance_farValue:C,scaleByDistance_near:z,scaleByDistance_nearValue:B,distanceDisplayCondition:I,distanceDisplayCondition_far:F,distanceDisplayCondition_near:E,clampToGround:L,horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}};switch(u){case"1":x.style.html=`<div class="entity-div-style entity-div-style1" style="--theme-color1:${m};--theme-font-color1:${_};">
|
|
2635
|
+
}`;var Mi=Od(function(){return Ni(ut,Je+"return "+de).apply(o,_t)});if(Mi.source=de,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=ct,O=It;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 Nt=_t?xn(_t,0,bt).join(""):r.slice(0,bt);if(Y===o)return Nt+O;if(_t&&(bt+=Nt.length-bt),af(Y)){if(r.slice(bt).search(Y)){var se,le=Nt;for(Y.global||(Y=Kn(Y.source,Yi(Gl.exec(Y))+"g")),Y.lastIndex=0;se=Y.exec(le);)var de=se.index;Nt=Nt.slice(0,de===o?bt:de)}}else if(r.indexOf(Ye(Y),bt)!=bt){var ze=Nt.lastIndexOf(Y);ze>-1&&(Nt=Nt.slice(0,ze))}return Nt+O}function yy(r){return r=Yi(r),r&&Xs.test(r)?r.replace(As,Jl):r}var xy=De(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,z))}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,z))}function Ay(r){return gt(wr(r,z))}function Cy(r,h){return At(r,wr(h,z))}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 Nt=h[bt];r[bt]=Nt,_t&&(r.prototype[bt]=function(){var se=this.__chain__;if(ut||se){var le=r(this.__wrapped__),de=le.__actions__=er(this.__actions__);return de.push({func:Nt,args:arguments,thisArg:r}),le.__chain__=se,le}return Nt.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>fe)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 it.after=Av,it.ary=ud,it.assign=d_,it.assignIn=Sd,it.assignInWith=Zu,it.assignWith=m_,it.at=g_,it.before=cd,it.bind=rf,it.bindAll=wy,it.bindKey=fd,it.castArray=Fv,it.chain=ad,it.chunk=Yg,it.compact=Zg,it.concat=Jg,it.cond=Ty,it.conforms=My,it.constant=cf,it.countBy=rv,it.create=v_,it.curry=pd,it.curryRight=dd,it.debounce=md,it.defaults=__,it.defaultsDeep=y_,it.defer=Cv,it.delay=Pv,it.difference=$g,it.differenceBy=Kg,it.differenceWith=Qg,it.drop=t0,it.dropRight=e0,it.dropRightWhile=i0,it.dropWhile=n0,it.fill=r0,it.filter=ov,it.flatMap=hv,it.flatMapDeep=uv,it.flatMapDepth=cv,it.flatten=nd,it.flattenDeep=s0,it.flattenDepth=o0,it.flip=Lv,it.flow=Ey,it.flowRight=by,it.fromPairs=a0,it.functions=b_,it.functionsIn=A_,it.groupBy=fv,it.initial=h0,it.intersection=u0,it.intersectionBy=c0,it.intersectionWith=f0,it.invert=P_,it.invertBy=L_,it.invokeMap=dv,it.iteratee=ff,it.keyBy=mv,it.keys=Jn,it.keysIn=Ur,it.map=Vu,it.mapKeys=O_,it.mapValues=I_,it.matches=Ay,it.matchesProperty=Cy,it.memoize=ju,it.merge=D_,it.mergeWith=Ed,it.method=Py,it.methodOf=Ly,it.mixin=pf,it.negate=Xu,it.nthArg=Oy,it.omit=z_,it.omitBy=k_,it.once=Rv,it.orderBy=gv,it.over=Iy,it.overArgs=Ov,it.overEvery=Dy,it.overSome=zy,it.partial=sf,it.partialRight=gd,it.partition=vv,it.pick=B_,it.pickBy=bd,it.property=Id,it.propertyOf=ky,it.pull=g0,it.pullAll=sd,it.pullAllBy=v0,it.pullAllWith=_0,it.pullAt=y0,it.range=By,it.rangeRight=Ny,it.rearg=Iv,it.reject=xv,it.remove=x0,it.rest=Dv,it.reverse=ef,it.sampleSize=Tv,it.set=F_,it.setWith=U_,it.shuffle=Mv,it.slice=w0,it.sortBy=bv,it.sortedUniq=C0,it.sortedUniqBy=P0,it.split=hy,it.spread=zv,it.tail=L0,it.take=R0,it.takeRight=O0,it.takeRightWhile=I0,it.takeWhile=D0,it.tap=Z0,it.throttle=kv,it.thru=Hu,it.toArray=wd,it.toPairs=Ad,it.toPairsIn=Cd,it.toPath=Vy,it.toPlainObject=Md,it.transform=G_,it.unary=Bv,it.union=z0,it.unionBy=k0,it.unionWith=B0,it.uniq=N0,it.uniqBy=F0,it.uniqWith=U0,it.unset=H_,it.unzip=nf,it.unzipWith=od,it.update=V_,it.updateWith=W_,it.values=fh,it.valuesIn=j_,it.without=G0,it.words=Rd,it.wrap=Nv,it.xor=H0,it.xorBy=V0,it.xorWith=W0,it.zip=j0,it.zipObject=X0,it.zipObjectDeep=q0,it.zipWith=Y0,it.entries=Ad,it.entriesIn=Cd,it.extend=Sd,it.extendWith=Zu,pf(it,it),it.add=jy,it.attempt=Od,it.camelCase=Z_,it.capitalize=Pd,it.ceil=Xy,it.clamp=X_,it.clone=Uv,it.cloneDeep=Hv,it.cloneDeepWith=Vv,it.cloneWith=Gv,it.conformsTo=Wv,it.deburr=Ld,it.defaultTo=Sy,it.divide=qy,it.endsWith=J_,it.eq=Fs,it.escape=$_,it.escapeRegExp=K_,it.every=sv,it.find=av,it.findIndex=ed,it.findKey=x_,it.findLast=lv,it.findLastIndex=id,it.findLastKey=w_,it.floor=Yy,it.forEach=ld,it.forEachRight=hd,it.forIn=T_,it.forInRight=M_,it.forOwn=S_,it.forOwnRight=E_,it.get=lf,it.gt=jv,it.gte=Xv,it.has=C_,it.hasIn=hf,it.head=rd,it.identity=Gr,it.includes=pv,it.indexOf=l0,it.inRange=q_,it.invoke=R_,it.isArguments=bl,it.isArray=vi,it.isArrayBuffer=qv,it.isArrayLike=Fr,it.isArrayLikeObject=Dn,it.isBoolean=Yv,it.isBuffer=Da,it.isDate=Zv,it.isElement=Jv,it.isEmpty=$v,it.isEqual=Kv,it.isEqualWith=Qv,it.isError=of,it.isFinite=t_,it.isFunction=Wo,it.isInteger=vd,it.isLength=qu,it.isMap=_d,it.isMatch=e_,it.isMatchWith=i_,it.isNaN=n_,it.isNative=r_,it.isNil=o_,it.isNull=s_,it.isNumber=yd,it.isObject=wn,it.isObjectLike=Ln,it.isPlainObject=eu,it.isRegExp=af,it.isSafeInteger=a_,it.isSet=xd,it.isString=Yu,it.isSymbol=ts,it.isTypedArray=ch,it.isUndefined=l_,it.isWeakMap=h_,it.isWeakSet=u_,it.join=p0,it.kebabCase=Q_,it.last=Es,it.lastIndexOf=d0,it.lowerCase=ty,it.lowerFirst=ey,it.lt=c_,it.lte=f_,it.max=Zy,it.maxBy=Jy,it.mean=$y,it.meanBy=Ky,it.min=Qy,it.minBy=t1,it.stubArray=mf,it.stubFalse=gf,it.stubObject=Fy,it.stubString=Uy,it.stubTrue=Gy,it.multiply=e1,it.nth=m0,it.noConflict=Ry,it.noop=df,it.now=Wu,it.pad=iy,it.padEnd=ny,it.padStart=ry,it.parseInt=sy,it.random=Y_,it.reduce=_v,it.reduceRight=yv,it.repeat=oy,it.replace=ay,it.result=N_,it.round=i1,it.runInContext=Lt,it.sample=wv,it.size=Sv,it.snakeCase=ly,it.some=Ev,it.sortedIndex=T0,it.sortedIndexBy=M0,it.sortedIndexOf=S0,it.sortedLastIndex=E0,it.sortedLastIndexBy=b0,it.sortedLastIndexOf=A0,it.startCase=uy,it.startsWith=cy,it.subtract=n1,it.sum=r1,it.sumBy=s1,it.template=fy,it.times=Hy,it.toFinite=jo,it.toInteger=wi,it.toLength=Td,it.toLower=py,it.toNumber=bs,it.toSafeInteger=p_,it.toString=Yi,it.toUpper=dy,it.trim=my,it.trimEnd=gy,it.trimStart=vy,it.truncate=_y,it.unescape=yy,it.uniqueId=Wy,it.upperCase=xy,it.upperFirst=uf,it.each=ld,it.eachRight=hd,it.first=rd,pf(it,function(){var r={};return Nr(it,function(h,g){Ti.call(it.prototype,g)||(r[g]=h)}),r}(),{chain:!1}),it.VERSION=p,Zi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(r){it[r].placeholder=it}),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=it[O?"take"+(h=="last"?"Right":""):h],ut=O||/^find/.test(h);Y&&(it.prototype[h]=function(){var _t=this.__wrapped__,bt=O?[1]:arguments,Nt=_t instanceof yi,se=bt[0],le=Nt||vi(_t),de=function(Pi){var Fi=Y.apply(it,fs([Pi],bt));return O&&ze?Fi[0]:Fi};le&&g&&typeof se=="function"&&se.length!=1&&(Nt=le=!1);var ze=this.__chain__,Je=!!this.__actions__.length,hi=ut&&!ze,Mi=Nt&&!Je;if(!ut&&le){_t=Mi?_t:new yi(this);var ui=r.apply(_t,bt);return ui.__actions__.push({func:Hu,args:[de],thisArg:o}),new qn(ui,ze)}return hi&&Mi?r.apply(this,bt):(ui=this.thru(de),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);it.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=it[h];if(g){var O=g.name+"";Ti.call(no,O)||(no[O]=[]),no[O].push({name:h,func:g})}}),no[Ji(o,x).name]=[{name:"wrapper",func:o}],yi.prototype.clone=Sa,yi.prototype.reverse=Cu,yi.prototype.value=Ea,it.prototype.at=J0,it.prototype.chain=$0,it.prototype.commit=K0,it.prototype.next=Q0,it.prototype.plant=ev,it.prototype.reverse=iv,it.prototype.toJSON=it.prototype.valueOf=it.prototype.value=nv,it.prototype.first=it.prototype.head,io&&(it.prototype[io]=tv),it},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.vectorArr=o,this.geoJsonType=new Map([["Point"],["LineString"],["Polygon"],["MultiPoint"],["MultiLineString"],["MultiPolygon"]]),this.avoidanceArr=[],this.editDate={id:""},this.isDynamicMasking=p):console.error("未引入指定插件")}remove(l,o=null){console.log("customAttributes",o),o&&o.isClone=="true"?window.mapClone.mapEx.removeLayer(window.mapClone.mapEx.getLayer(l,"vectorId")):(window.map.removeLayer(window.map.getLayer(l,"vectorId")),window.dynamicMasking&&window.dynamicMasking.remove(l))}add(l,o){return new Promise((p,d)=>{let u,m=o==null?void 0:o.isClone;if(typeof l!="object"){let B=window.map.getLayer(l,"vectorId");if(B)return p(B);u=this.query(l)}else{let B=window.map.getLayer(l.id,"vectorId");if(B)return p(B);u=l}let{value:_,url:w,id:S,title:C}=u;new Cesium.Resource({url:w}).fetchJson().then(B=>{let{id:I,title:F,shpInfo:E}=u,{attributes:L,geometryType:x,geometryCount:M,pointCount:R}=E;if(L){let{width:b,materialType:U,materialOptions:N,clampToGround:j,distanceDisplayCondition:J,distanceDisplayCondition_near:$,distanceDisplayCondition_far:ct,zIndex:It,label:et,fill:yt,diffHeight:G,outline:Pt,outlineStyle:Et,color:Ct,pixelSize:fe,outlineColor:re,outlineWidth:Ft,classificationType:Ot}=JSON.parse(L),Bt;switch(this.isDynamicMasking?(et.color=Cesium.Color.fromCssColorString(et.color).withAlpha(0),et.outlineColor=Cesium.Color.fromCssColorString(et.outlineColor).withAlpha(.001),et.backgroundColor=Cesium.Color.fromCssColorString(et.backgroundColor).withAlpha(.001),et.background=!1,et.outline=!1,et.show=!1):(et.color=Cesium.Color.fromCssColorString(et.color),et.outlineColor=Cesium.Color.fromCssColorString(et.outlineColor),et.backgroundColor=Cesium.Color.fromCssColorString(et.backgroundColor)),x){case"LineString":case"MultiLineString":et.backgroundPadding=5,Bt=new mars3d.layer.GeoJsonLayer({data:B,vectorId:I,format:R>1e4?this.simplifyFunc:null,symbol:{type:"polylineC",styleOptions:{width:b,clampToGround:j,distanceDisplayCondition:J,distanceDisplayCondition_far:ct,distanceDisplayCondition_near:$,materialType:U,materialOptions:N,classificationType:Ot,label:et}},hasZIndex:!0,zIndex:It});break;case"Polygon":case"MultiPolygon":U=="PolyGrass"&&(N={evenColor:new Cesium.Color(.25,.4,.1,1),oddColor:new Cesium.Color(.1,.1,.1,1),frequency:1.5}),Bt=new mars3d.layer.GeoJsonLayer({data:B,vectorId:I,format:R>1e4?this.simplifyFunc:null,symbol:{type:"polygon",styleOptions:{fill:yt,diffHeight:G,clampToGround:j,materialType:U,materialOptions:N,distanceDisplayCondition:J,distanceDisplayCondition_far:ct,distanceDisplayCondition_near:$,outlineStyle:Et,outline:Pt,classificationType:Ot,label:et}}});break;case"Point":case"MultiPoint":Bt=new mars3d.layer.GeoJsonLayer({data:B,vectorId:I,format:R>1e4?this.simplifyFunc:null,symbol:{type:"pointP",styleOptions:{color:Ct,pixelSize:fe,outline:Pt,outlineColor:re,outlineWidth:Ft,visibleDepth:!1,label:et}}});break}m?window.mapClone.mapEx.addLayer(Bt):window.map.addLayer(Bt),Bt.bindPopup(ce=>{let Yt='<div class="bim-map-popup">';return console.log("event",ce.graphic.attr),Object.keys(ce.graphic.attr).forEach(($e,Oi)=>{ce.graphic.attr[$e]&&(Yt+=`<p><b>${$e}</b> : ${ce.graphic.attr[$e]}</p>`)}),Yt+="</div>",Yt});let ke=$u.debounce(ce=>{console.log("测试shp矢量加载完成"),window.dynamicMasking.add(ce,JSON.parse(L))},500);Bt.readyPromise.then(ce=>{window.dynamicMasking&&ke(ce),p(ce)}).catch(ce=>{console.error("测试shp矢量加载失败",ce),p({tite:"【矢量】<"+F+">无法加载",type:"error",id:I,url:w})})}else p({tite:"【矢量】<"+F+">无法加载",type:"error",id:I,url:w})}).catch(B=>{console.error("数据有误",B),p({tite:"【矢量】<"+C+">链接地址有误",type:"error",id:S,url:w})})})}updateData(l){this.vectorArr=l}processingKML(l){let o,p=2e3,d=!0,{kmlInfo:u}=l,{fill:m,areaColor:_,areaSideColor:w,transparency:S,isAreaSideColor:C,minDistinct:z,textDistinct:B,textSize:I,textColor:F,fontStyle:E,outLine:L,sideColor:x,backGround:M,backGroundColor:R,clampToGround:b}=u,U={fill:m,color:_,opacity:S||.5,outline:C,outlineColor:w,outlineWidth:2,clampToGround:b,distanceDisplayCondition:!0,distanceDisplayCondition_far:B||1e6,distanceDisplayCondition_near:z||0,classificationType:o,opacity:String(S)},N={text:"{name}",horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffsetY:-10,font_size:26,color:F||"#ffffff",font_family:E||"黑体",outline:L||!0,outlineColor:x||"#000000",outlineWidth:4,scaleByDistance:!0,distanceDisplayCondition:!0,distanceDisplayCondition_far:B||1e6,distanceDisplayCondition_near:z||0,background:M||!1,backgroundColor:R||"",visibleDepth:d,clampToGround:b||!1,disableDepthTestDistance:p};return{...U,label:N}}selected(l){window.map.getLayer(l,"vectorId")&&window.map.getLayer(l,"vectorId").flyTo()}query(l){return this.vectorArr.length==0?!1:this.vectorArr.find(o=>o.id==l)}queryVector(l){return window.map.getLayer(l,"vectorId")}editVector(l,o,p){let d=window.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=[]){mars3d?(this.terrainProviderArr=l,this.terrainProviderId="",this.events={},window.map.on(mars3d.EventType.terrainLoadError,o=>{console.error("地形服务加载失败",o),this.hide()}),window.map.viewer.scene.globe.tileLoadProgressEvent.addEventListener(o=>{window.map.viewer.scene.globe.tilesLoaded&&this.emit("load",o)})):console.error("未引入指定插件")}add(l){let{url:o,id:p}=l;if(this.terrainProviderId==p&&window.map.terrainProvider._layers)return!1;window.map.terrainProvider=mars3d.LayerUtil.createTerrainProvider({imageXyzId:p,type:"xyz",url:o,requestVertexNormals:!0,requestMetadata:!0}),this.terrainProviderId=p}show(){window.map.hasTerrain=!0}hide(){window.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=[]){mars3d?(this.elevationImageArr=l,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,window.map.getLayer(p,"imageXyzId"))return!1;const{layerOpacity:d,layerBrightness:u,layerContrast:m,layerHue:_,layerSaturation:w,layerGamma:S,surfaceOpacity:C}=this.exposureEnvironmentSettings();return new Promise((z,B)=>{let I,F,E,L,x,M;if(typeof l!="object"){let R=this.query(l);R||B("缺少树结构");let{gisInfo:b}=R;I=b.id,E=b.order,F=R.url,L=b.minLevel,x=b.maxLevel}else I=l.imageXyzId,F=l.url,E=l.zIndex,L=l.minimumLevel,x=l.maximumLevel,M=l.chinaCRS;this.elevationImageLayer=new mars3d.layer.XyzLayer({imageXyzId:I,type:"xyz",url:F,hasZIndex:!0,zIndex:E.toString(),brightness:u,opacity:d,saturation:w,contrast:m,hue:_,gamma:S,alpha:C,show:!0,minimumLevel:L||0,maximumLevel:x||15,chinaCRS:M}),this.elevationImageLayer.on(mars3d.EventType.load,R=>{z(R)}),window.map.addLayer(this.elevationImageLayer),o&&Object.keys(o).forEach(R=>{this.elevationImageLayer.on(fnType.get(R),b=>{o[R](b)})})})}remove(l){console.log(l),window.map.removeLayer(window.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,_,w;switch(m=this.modelArray.find(S=>S.modelId==l).customize.bimModelExcavationDetails,w=m.find((S,C)=>{if(S.id==o)return _=C,S}),p){case"delete":m.splice(_,1);break;case"update":w.excavationDetails=d;break;case"add":m.push(u);break;case"edit":w.excavationDetails=u.excavationDetails,w.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){mars3d?(this.entityArr=l,this.entityLayer=new mars3d.layer.GraphicLayer({entityId:"bimEntity"}),window.map.addLayer(this.entityLayer),this.entityItem=null,this.events={},this.entityCloneLayer):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=null,p){return new Promise((d,u)=>{var m;if(this.entityLayer){let _,w,S;if(p==null?void 0:p.isClone)this.entityCloneLayer&&(w=this.query(l),S=JSON.parse(w.bimPlanPainting.graphic),S.attr=S.attr||{},S.attr.entityId=l,this.entityCloneLayer.addGraphic(S));else{if(typeof l!="object"?(_=this.entityLayer.getGraphicByAttr(l,"entityId"),w=this.query(l),S=JSON.parse(w.bimPlanPainting.graphic),S.attr=S.attr||{},S.attr.entityId=l):(_=this.entityLayer.getGraphicByAttr(l.id,"entityId"),S=JSON.parse(JSON.stringify(l)),S.attr=S.attr||{},S.attr.entityId=S.attr.entityId||o,S.attr==null?S.attr={entityId:l.id}:((m=S.attr)==null?void 0:m.entityId)==null&&o&&(S.attr.entityId=o)),_)return d();this.entityLayer.addGraphic(S),d(S)}}else d(),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,o=null){let p=this.entityLayer.getGraphicByAttr(l,"entityId");o==null||o.isClone,p._point&&p._point._alt>0?p.flyTo({radius:p._point._alt+500}):p.flyTo()}remove(l,o=null){(o==null?void 0:o.isClone)?this.entityCloneLayer&&this.entityCloneLayer.getGraphicByAttr(l,"entityId").remove():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))}entityCloneLayerInit(){this.entityCloneLayer==null&&(this.entityCloneLayer=window.mapClone._mapEx.getLayer("bimEntity","entityId"))}entityCloneLayerRemove(){console.log("没用移除"),this.entityCloneLayer.remove(),this.entityCloneLayer=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:w,scaleByDistance_far:S,scaleByDistance_farValue:C,scaleByDistance_near:z,scaleByDistance_nearValue:B,distanceDisplayCondition:I,distanceDisplayCondition_far:F,distanceDisplayCondition_near:E,clampToGround:L}=p,x={type:"div",style:{pointerEvents:!0,scaleByDistance:w,scaleByDistance_far:S,scaleByDistance_farValue:C,scaleByDistance_near:z,scaleByDistance_nearValue:B,distanceDisplayCondition:I,distanceDisplayCondition_far:F,distanceDisplayCondition_near:E,clampToGround:L,horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}};switch(u){case"1":x.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
2637
|
</div>`,x.style.horizontalOrigin=Cesium.HorizontalOrigin.CENTER;break}this.entityLayer.startDraw(x).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:w,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>
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chbim-plugins",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.78",
|
|
5
5
|
"description": "一个简单的组件库",
|
|
6
6
|
"main": "chbim-plugins.js",
|
|
7
|
-
"keywords": [
|
|
7
|
+
"keywords": [
|
|
8
|
+
"vue",
|
|
9
|
+
"Cesium"
|
|
10
|
+
],
|
|
8
11
|
"author": "zhang",
|
|
9
12
|
"license": "ISC"
|
|
10
13
|
}
|