lixuliang
2024-04-18 7453188ddfaef750c5f367abadb8afa1ad877909
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
/**
 * 
 * SmartEarthSDK 基于Cesium的三维web开发
 * author: 张丹钊、金磊、薛鹏、张恒
 * 
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SmartEarth={})}(this,function(o){"use strict";function f(e,t,i,o){var r=Math.PI;function n(e){return e*r/180}var a=n((e+i)/2),e=n((e-i)/2),i=n((t-o)/2),t=Math.sin(e),o=Math.sin(i),e=Math.sin(a),i=(t*=t)*(1-(o*=o))+(1-(e*=e))*o,a=(1-t)*(1-o)+e*o;return 2*(o=Math.atan(Math.sqrt(i/a)))*6378137*(1+1/298.257*((3*(o=Math.sqrt(i*a)/o)-1)/2/a*e*(1-t)-(3*o+1)/2/i*(1-e)*t))}function m(e,t){this._viewer=e,this._cesium=t}function y(e,t){this._viewer=e,this._cesium=t}function v(e,t){var i=Math.PI/180,o=180/Math.PI,r=e.y*i,n=e.x*i,e=t.y*i,i=t.x*i,i=-Math.atan2(Math.sin(n-i)*Math.cos(e),Math.cos(r)*Math.sin(e)-Math.sin(r)*Math.cos(e)*Math.cos(n-i));return i<0&&(i+=2*Math.PI),i*=o}function C(e,t,i){i=v(t,e)-v(t,i);return i<0&&(i+=360),i}function w(e){if(!e||e.length<3)return 0;for(var t=Math.PI/180,i=0,o=0;o<e.length;o++){var r=(o+1)%e.length,n=(o+2)%e.length;i+=C(e[o],e[r],e[n])}var a=180*(e.length-2),s=i-a;return 420<s?s=(i=360*e.length-i)-a:300<s&&s<420&&(s=Math.abs(360-s)),s*t*6371e3*6371e3}function b(e,t){this._viewer=e,this._cesium=t}function T(e,t){this._viewer=e,this._cesium=t}m.prototype.measureTerrainPerimeter=function(e){var t=e[e.length-2],e=e[e.length-1];return Math.abs(t.x-e.x),Math.abs(t.y-e.y),f(t.y,t.x,e.y,e.x)},y.prototype.measureTerrainHeight=function(e){var t=e[e.length-2],e=e[e.length-1];return Math.abs(t.x-e.x),Math.abs(t.y-e.y),t.hit,e.hit,Math.abs(t.z-e.z)},b.prototype.measureTerrainArea=function(e){return w(e).toFixed(1)},T.prototype.measureTerrainkPerimeter=function(e){var t=e[e.length-2],i=e[e.length-1];Math.abs(t.x-i.x),Math.abs(t.y-i.y);e=Math.abs(t.z-i.z),i=f(t.y,t.z,i.y,i.z);return Math.sqrt(e*e+i*i)};var D=Object.freeze({testModel:"Workers/Model/xiaoche.gltf",modelAxis:"Workers/Model/axis.gltf",flyModel:"Workers/Model/fly.glb",divpoint:"Workers/image/divpoint.png",divpoint1:"Workers/image/divpoint1.png",richtextpoint:"Workers/image/richtextpoint1.png",mark:"Workers/image/mark.png",TrailLine:"Workers/image/TrailLine.png",road:"Workers/image/road.jpg",colors3:"Workers/image/colors3.png",loading:"Workers/image/loading.gif",smog:"Workers/image/smog.png",penquan:"Workers/image/penquan.png",fire:"Workers/image/fire.png",fire2:"Workers/image/fire2.png",bottomplane:"Workers/image/bottomplane.jpg",wall:"Workers/image/ggy.jpg",rotate:"Workers/image/rotate.png",move:"Workers/image/move.png",draw:"Workers/image/cursor/draw.cur",water:"Workers/image/waterNormals.jpg",movingRiver:"Workers/image/movingRiver.png"});function S(e,t,i){!function(){Cesium.PolylineTrailLinkMaterialProperty||(Cesium.PolylineTrailLinkMaterialProperty=S,Cesium.Material.PolylineTrailLinkType="PolylineTrailLink",Cesium.Material.PolylineTrailLinkImage=window.SmartEarthRootUrl+D.colors1,Cesium.Material.PolylineTrailLinkSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n                                                      {\n                                                           czm_material material = czm_getDefaultMaterial(materialInput);\n                                                           vec2 st = materialInput.st;\n                                                           if(twoColor){\n                                                            if(st.s<time){\n                                                                material.alpha = color1.a;\n                                                                material.diffuse = color1.rgb;\n                                                            }else{\n                                                                material.alpha = color2.a;\n                                                                material.diffuse = color2.rgb;\n                                                            }\n                                                           }else if(lightSpot){\n                                                            if(st.s<time){\n                                                                material.alpha = pow(st.s / time, 20.0);\n                                                                if(material.alpha<alpha){\n                                                                    material.alpha = alpha;\n                                                                    material.diffuse = color.rgb;\n                                                                }else{\n                                                                    material.diffuse = lightSpotColor.rgb;\n                                                                }\n                                                            }else{\n                                                                material.alpha = alpha;\n                                                                material.diffuse = color.rgb;\n                                                            }\n                                                           }else{\n                                                            vec4 colorImage = texture2D(image, vec2(fract(st.s - time), st.t));\n                                                            material.alpha = colorImage.a * color.a;\n                                                            material.diffuse = (colorImage.rgb+color.rgb)/2.0;\n                                                           }\n                                                           return material;\n                                                       }",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailLinkType,{fabric:{type:Cesium.Material.PolylineTrailLinkType,uniforms:{color:new Cesium.Color(1,0,0,.5),color1:new Cesium.Color(0,1,0,.5),color2:new Cesium.Color(1,0,0,.5),image:Cesium.Material.PolylineTrailLinkImage,twoColor:!1,lightSpot:!1,lightSpotColor:new Cesium.Color(1,1,1,.5),alpha:.3,time:0},source:Cesium.Material.PolylineTrailLinkSource},translucent:function(e){return!0}}));Cesium.Material}(),this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=Cesium.Color.fromCssColorString(e||"#ffffff"),this._Line=t||Cesium.Material.PolylineTrailLinkImage,this.duration=i||3e3,this.alpha=.3,this._time=(new Date).getTime(),"object"==typeof this._Line&&(this._Line.LightSpot?this._Line.color=Cesium.Color.fromCssColorString(this._Line.color):(this._Line.color1=Cesium.Color.fromCssColorString(this._Line.color1),this._Line.color2=Cesium.Color.fromCssColorString(this._Line.color2)))}function P(e,t){return null!=e?e:t}function E(e=!0){this.async=e}function x(e){if(this._mapContainer=e,!window.echarts){let e=new E(!1);e.addJs(document.body,window.SmartEarthRootUrl+"Workers/echarts.min.js")}this.Init(e)}function I(e){this.serverUrl=e}function L(e,t){this.mediaOutputPath=e||"test.mp4",this.videoBPS=t||512e4}Object.defineProperties(S.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),S.prototype.getType=function(e){return"PolylineTrailLink"},S.prototype.setScale=function(e){this.scale=e},S.prototype.getValue=function(e,t){return(t=!Cesium.defined(t)?{}:t).color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),"object"==typeof this._Line?this._Line.LightSpot?(t.lightSpot=!0,t.lightSpotColor=this._Line.color):(t.color1=this._Line.color1,t.color2=this._Line.color2,t.twoColor=!0):t.image=this._Line,void 0!==this.scale?t.time=this.scale:t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t.alpha=this.alpha,t},S.prototype.equals=function(e){return this===e||e instanceof S&&Cesium.Property.equals(this._color,e._color)},E.prototype.getXmlHttpRequest=function(){return window.XMLHttpRequest?new XMLHttpRequest:window.ActiveXObject?new ActiveXObject("MsXml2.XmlHttp"):void 0},E.prototype.includeJsText=function(e,t){var i;null!=e&&((i=document.createElement("script")).type="text/javascript",i.text=t,e.appendChild(i))},E.prototype.includeJsSrc=function(e,t){var i;null!=e&&((i=document.createElement("script")).type="text/javascript",i.src=t,e.appendChild(i))},E.prototype.addJs=function(e,t){var i=this.getXmlHttpRequest(),o=this;i.onreadystatechange=function(){4===i.readyState&&(200===i.status||304===i.status?o.includeJsSrc(e,t):console.log("XML request error: "+i.statusText+" ("+i.status+")"))},i.open("GET",t,o.async),i.send(null),404===i.status?console.log(t+" is not found"):o.includeJsText(e,i.responseText)},x.prototype.setOption=function(e,t){return this._echartsContainer&&t&&this.clear(),this._overlay||(this._overlay=this._createChartOverlay()),this._overlay.setOption(e),this},x.prototype._createChartOverlay=function(){var e=this._mapContainer.scene;e.canvas.setAttribute("tabIndex",0);var t=document.createElement("div");return t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width=e.canvas.width+"px",t.style.height=e.canvas.height+"px",t.style.pointerEvents="none",t.setAttribute("id","smartearth-cesium-echarts"),t.setAttribute("class","echartMap"),this._mapContainer.container.appendChild(t),this._echartsContainer=t,echarts.init(t)},x.prototype.deleteObject=x.prototype.clear=function(){this._echartsContainer&&(this._mapContainer.container.removeChild(this._echartsContainer),this._echartsContainer=null),this._overlay&&(this._overlay.dispose(),this._overlay=null)},x.prototype.updateOverlay=function(e){this._overlay&&this._overlay.setOption(e)},x.prototype.getMap=function(){return this._mapContainer},x.prototype.getOverlay=function(){return this._overlay},x.prototype.show=function(){document.getElementById(this._id).style.visibility="visible"},x.prototype.hide=function(){document.getElementById(this._id).style.visibility="hidden"},x.prototype.Init=function(u){function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var i,o;i=[function(e,t,i){e.exports=i(1)},function(e,t,i){echarts?i(2).load():console.error("missing echarts lib")},function(e,t,i){function o(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}i.r(t);var r,n,a=(n=[{key:"create",value:function(e,t){var i;e.eachComponent("GLMap",function(e){(i=new s(u,t)).setMapOffset(e.__mapOffset||[0,0]),e.coordinateSystem=i}),e.eachSeries(function(e){"GLMap"===e.get("coordinateSystem")&&(e.coordinateSystem=i)})}},{key:"dimensions",get:function(){return["lng","lat"]}}],o((r=s).prototype,[{key:"setMapOffset",value:function(e){return this._mapOffset=e,this}},{key:"getViewer",value:function(){return this._viewer}},{key:"dataToPoint",value:function(e){if(this._viewer&&this._viewer.scene){var t=this._viewer.scene,e=Cesium.Cartesian3.fromDegrees(e[0],e[1]);if(!e)return[0,0];if(t.mode===Cesium.SceneMode.SCENE3D&&Cesium.Cartesian3.angleBetween(t.camera.position,e)>Cesium.Math.toRadians(80))return!1;e=t.cartesianToCanvasCoordinates(e);return e?[e.x-this._mapOffset[0],e.y-this._mapOffset[1]]:[]}return[]}},{key:"pointToData",value:function(e){var t=this._mapOffset,i=u.scene.globe.ellipsoid,t=new Cesium.cartesian3(e[1]+t,e[2]+t[2],0),t=i.cartesianToCartographic(t);return[t.lng,t.lat]}},{key:"getViewRect",value:function(){var e=this._api;return new echarts.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())}},{key:"getRoamTransform",value:function(){return echarts.matrix.create()}}]),o(r,n),s);function s(e,t){!function(e){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")}(this),this._viewer=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}function l(){echarts.registerCoordinateSystem("GLMap",a),echarts.registerAction({type:"GLMapRoam",event:"GLMapRoam",update:"updateLayout"},function(e,t){})}echarts.extendComponentModel({type:"GLMap",getViewer:function(){return u},defaultOption:{roam:!1}}),echarts.extendComponentView({type:"GLMap",init:function(e,t){this.api=t,this.dispose(),u.scene.postRender.addEventListener(this.moveHandler,this)},moveHandler:function(e,t){this.api.dispatchAction({type:"GLMapRoam"})},render:function(e,t,i){},dispose:function(e){u.scene.postRender.removeEventListener(this.moveHandler,this)}}),i.d(t,"load",function(){return l})}],o={},r.m=i,r.c=o,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(i,o,function(e){return t[e]}.bind(null,o));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)},I.prototype.getSceneList=function(t){$.ajax({url:this.serverUrl+"/scene/sceneList",type:"get",success:function(e){t&&"function"==typeof t&&e&&t(JSON.parse(e))}})},I.prototype.query=function(e,t){var i=e.database,e={type:P(e.type,"building"),id:e.id,returnGeometry:P(e.returnGeometry,!0),returnChildren:P(e.returnChildren,!0)};$.ajax({url:this.serverUrl+"/"+i+"/query?version=v2.1",type:"post",async:!0,data:e,success:function(e){t&&"function"==typeof t&&e&&t(JSON.parse(e))},error:function(e,t,i){alert("error:"+e.status)}})},L.prototype.startRecord=function(){navigator.mediaDevices.getDisplayMedia({video:!0,audio:!0}).then(e=>{this.createRecorder(e)}).catch(e=>{this.getUserMediaError(e)})},L.prototype.getUserMediaError=function(e){console.log("mediaError",e)},L.prototype.createRecorder=function(e){console.log("start record");var t={videoBitsPerSecond:this.videoBPS};this.recorder=new MediaRecorder(e,t),this.recorder.start();var i=[];this.recorder.onstop=e=>{var t=new Blob(i,{type:"video/mp4"});this.saveMedia(t)},this.recorder.ondataavailable=e=>{i.push(e.data)}},L.prototype.saveMedia=function(e){var t=window.URL.createObjectURL(e),e=document.createElement("a");e.innerHTML="test",e.download=this.mediaOutputPath,e.href=t,e.click()},L.prototype.stopRecord=function(){this.recorder.stop()};const M=52.35987755982988,A=3.141592653589793,R=6378245,O=.006693421622965943,H={BD09ToGCJ02(e,t){var i=+e-.0065,e=+t-.006,t=Math.sqrt(i*i+e*e)-2e-5*Math.sin(e*M),i=Math.atan2(e,i)-3e-6*Math.cos(i*M);return[t*Math.cos(i),t*Math.sin(i)]},GCJ02ToBD09(e,t){t=+t,e=+e;var i=Math.sqrt(e*e+t*t)+2e-5*Math.sin(t*M),e=Math.atan2(t,e)+3e-6*Math.cos(e*M);return[i*Math.cos(e)+.0065,i*Math.sin(e)+.006]},WGS84ToGCJ02(e,t){if(this.out_of_china(e=+e,t=+t))return[e,t];var i=this.delta(e,t);return[e+i[0],t+i[1]]},GCJ02ToWGS84(e,t){if(this.out_of_china(e=+e,t=+t))return[e,t];var i=this.delta(e,t);return[2*e-(e+i[0]),2*t-(t+i[1])]},delta(e,t){var i=this.transformLng(e-105,t-35),o=this.transformLat(e-105,t-35),r=t/180*A,e=Math.sin(r),e=1-O*e*e,t=Math.sqrt(e);return[i=180*i/(R/t*Math.cos(r)*A),o=180*o/(R*(1-O)/(e*t)*A)]},transformLng(e,t){t=300+(e=+e)+2*(t=+t)+.1*e*e+.1*e*t+.1*Math.sqrt(Math.abs(e));return t+=2*(20*Math.sin(6*e*A)+20*Math.sin(2*e*A))/3,t+=2*(20*Math.sin(e*A)+40*Math.sin(e/3*A))/3,t+=2*(150*Math.sin(e/12*A)+300*Math.sin(e/30*A))/3},transformLat(e,t){var i=2*(e=+e)-100+3*(t=+t)+.2*t*t+.1*e*t+.2*Math.sqrt(Math.abs(e));return i+=2*(20*Math.sin(6*e*A)+20*Math.sin(2*e*A))/3,i+=2*(20*Math.sin(t*A)+40*Math.sin(t/3*A))/3,i+=2*(160*Math.sin(t/12*A)+320*Math.sin(t*A/30))/3},out_of_china(e,t){return t=+t,!(73.66<(e=+e)&&e<135.05&&3.86<t&&t<53.55)}};function V(){}V.prototype.defaultValue=P,V.prototype.mouse=function(e,t,i){e.style.cursor=1==t?"url("+i+"),auto":"default"},V.prototype.CreateTooltip=function(e={},t,i){var o,r,n;(o="object"==typeof e?e:o)&&o.origin?("center"===o.origin&&(r=15,n=-12),"top"===o.origin&&(r=15,n=-44),"bottom"===o.origin&&(r=15,n=20)):(r=15,n=20),o&&o.color?("white"===o.color&&(s="background: rgba(255, 255, 255, 0.8);color: black;"),"black"===o.color&&(s="background: rgba(0, 0, 0, 0.5);color: white;"),"yellow"===o.color&&(s="color: black;background-color: #ffcc33;border: 1px solid white;")):s="background: rgba(0, 0, 0, 0.5);color: white;";var a,s,l=o&&o.id?"toolTip"+o.id:"toolTip",u=document.getElementById(l);return u||(a=document.createElement("div"),$(".cesium-viewer").append(a),s='<div id="'+l+'" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:黑体;color:white;font-weight: bolder;font-size: 14px;'+s+'"></div>',$(".cesium-viewer").append(s),u=document.getElementById(l)),i?(u.innerHTML=e,u.style.left=t.x+r+"px",u.style.top=t.y+n+"px",u.style.display="block"):u.style.display="none",{tooltip:u,style:o,showAt:function(e,t){this.tooltip.innerHTML=t,this.style&&this.style.origin?("center"===this.style.origin&&(r=15,n=-this.tooltip.offsetHeight/2),"top"===this.style.origin&&(r=15,n=-this.tooltip.offsetHeight-20),"bottom"===this.style.origin&&(r=15,n=20)):(r=15,n=-this.tooltip.offsetHeight/2),this.tooltip.style.left=e.x+r+"px",this.tooltip.style.top=e.y+n+"px",this.tooltip.style.display="block"},show:function(e){this.tooltip.style.display=e?"block":"none"}}},V.prototype.getPointToCameraDistance=function(e,t){let i;var o;return i=2===e.scene.mode?(o=e.camera.positionCartographic.clone(),Cesium.Cartesian3.distance(t,Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,o.height))):Cesium.Cartesian3.distance(t,e.camera.position),i},V.prototype.getPositionFromHR=function(e,t,i,o=0){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=6356725+21412*(90-t)/90;return[180*(r/(o*Math.cos(t*Math.PI/180))+e*Math.PI/180)/Math.PI,180*(i/o+t*Math.PI/180)/Math.PI]},V.prototype.getPositionFromHPR=function(e,t,i=0,o=0){var r=Math.cos(Math.radians(o))*t,t=Math.sin(Math.radians(o))*t,i=this.getPositionFromHR(e[0],e[1],r,i);return{lon:i[0],lat:i[1],height:e[2]+t}},V.prototype.CreateResultTooltip=function(i,t={}){var o,r,e,n=t.id?"resultToolTip"+t.id:"resultToolTip",a=document.getElementById(n);t.color?("white"===t.color&&(e="background: rgba(255, 255, 255, 0.8);color: black;"),"black"===t.color&&(e="background: rgba(0, 0, 0, 0.5);color: white;"),"blue"===t.color&&(e="background: rgba(48, 119, 221);color: white;"),"yellow"===t.color&&(e="color: black;background-color: #ffcc33;border: 1px solid white;")):e="color: black;background-color: #ffcc33;border: 1px solid white;",a||(e='<div id="'+n+'" class="resultToolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:黑体;color:white;font-weight: bolder;font-size: 14px;'+e+'"></div>',$(i.container).append(e),a=document.getElementById(n));var s,l=t.addX||0,u=t.addY||0,c=this;function h(){if(s){if(void 0!==t.far||void 0!==t.near){var e=c.getPointToCameraDistance(i,s);if(e>t.far)return void(a.style.display="none");if(e<t.near)return void(a.style.display="none");a.style.display="block"}e=i.scene.cartesianToCanvasCoordinates(s);e&&(o=-a.offsetWidth/2+l,r=-a.offsetHeight+u,a.style.left=e.x+o+"px",a.style.top=e.y+r+"px")}}return i.clock.onTick.addEventListener(h),{tooltip:a,position:s,showAt:function(e,t){this.tooltip.innerHTML=t,this.tooltip.style.display="block",this.position=e,!(s=e)||(e=i.scene.cartesianToCanvasCoordinates(s))&&(o=-this.tooltip.offsetWidth/2+l,r=-this.tooltip.offsetHeight+u,this.tooltip.style.left=e.x+o+"px",this.tooltip.style.top=e.y+r+"px")},show:function(e){s=e?(this.tooltip.style.display="block",this.position):void(this.tooltip.style.display="none")},destroy(){i.clock.onTick.removeEventListener(h),a.remove()}}},V.prototype.CombineEcharts=function(e,t,i){return this._CombineEcharts||(this._CombineEcharts=new x(e)),this._CombineEcharts.setOption(t,i)},V.prototype.getHeatmapData=function(t,i,o=600){let r=[];for(let e=0;e<o;e++){var n=Math.random()*(t.east-t.west)+t.west,a=Math.random()*(t.north-t.south)+t.south,s=i.value||Math.random()*(i.max-i.min)+i.min;r.push({x:n,y:a,value:s})}return r},V.prototype.pickFromRay=function(e,t,i,o=[]){i=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(i,t,new Cesium.Cartesian3),new Cesium.Cartesian3),i=new Cesium.Ray(t,i);return e.scene.pickFromRay(i,o)},V.prototype.isDOM=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName},V.prototype.getJSON=function(e,t){const i=new XMLHttpRequest;i.responseType="json",i.open("get",e,!0),i.onload=function(){if(!(200<=i.status&&i.status<300))throw new Error(i.statusText);t(i.response)},i.send()},V.prototype.getPositionFromWKT=function(e){let t=e+"!",n,a=[];return-1<t.indexOf("MULTIPOLYGON")?(n=t.replace("MULTIPOLYGON(",""),n=n.replace(")!",""),n=n.split(")),(("),n.forEach((e,t)=>{let r;r=1===n.length?e.substring(1,e.length-1):0===t?e.substring(1,e.length)+")":t===n.length-1?"("+e.substring(0,e.length-1):"("+e+")",r=r.split("),("),r.forEach((e,t)=>{let i;1===r.length?i=e.substring(1,e.length-1):0===t?i=e.substring(1,e.length):t===r.length-1&&(i=e.substring(0,e.length-1)),i=i.split(",");let o=[];i.forEach(e=>{e=e.split(" ");o.push(Cesium.Cartesian3.fromDegrees(e[0],e[1]))}),a.push(o)})})):-1<t.indexOf("POLYGON")&&(n=t.replace("POLYGON(",""),n=n.replace(")!",""),n=n.split("),("),n.forEach((e,t)=>{let i;1===n.length?i=e.substring(1,e.length-1):0===t?i=e.substring(1,e.length):t===n.length-1&&(i=e.substring(0,e.length-1)),i=i.split(",");let o=[];i.forEach(e=>{e=e.split(" ");o.push(Cesium.Cartesian3.fromDegrees(e[0],e[1]))}),a.push(o)})),a},V.prototype.VectorSlice=function(e){var t="EPSG:4490";return e.port&&(t=e.port),{url:e.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:e.layer,STYLE:"",TILEMATRIX:t+":{z}",TILEMATRIXSET:t,FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:e.upperLevelLimit,lowerLevelLimit:e.lowerLevelLimit,rectangle:Cesium.Rectangle.fromDegrees(e.minx,e.miny,e.maxx,e.maxy)}},V.prototype.arge=function(e,t,i,o="180",r=!1){var n=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),a=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),s=Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2)),a=(Math.pow(n,2)+Math.pow(a,2)-Math.pow(s,2))/(2*n*a);let l=Math.round(180*Math.acos(a)/Math.PI);return"360"!==o&&"+-"!==o||(this.isClockwise([[t.x,(r=r?-1:1)*t.y],[e.x,r*e.y],[i.x,r*i.y],[t.x,r*t.y]])||(l="+-"===o?-l:360-l)),l},V.prototype.isClockwise=function(e){e=Cesium_turf.lineString(e);return Cesium_turf.booleanClockwise(e)},V.prototype.saveAs=function(e,t){if(!window.saveAs){let e=new E(!1);e.addJs(document.body,window.SmartEarthRootUrl+"Workers/FileSaver.js")}saveAs(e,t)},V.prototype.setheight=function(e,t){e=Cesium.Cartographic.fromCartesian(e);return Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,t)},V.prototype.setpolylineheight=function(e,t){var i=[];return e.forEach(function(e){e=Cesium.Cartographic.fromCartesian(e);i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,t))}),i},V.prototype.StyleContrastGeoJson=function(e,t){var i={color:t.Color.WHITE,pixelSize:1,outlineColor:t.Color.BLACK,outlineWidth:0,show:!0,distanceDisplayCondition:new t.DistanceDisplayCondition(0,999999999)},o={id:"my label",text:"",font:"30px sans-serif",fillColor:t.Color.WHITE,outlineColor:t.Color.WHITE,outlineWidth:"10",scale:1,distanceDisplayCondition:new t.DistanceDisplayCondition(0,999999999)},r={show:!0,scale:1,width:void 0,height:void 0,pixelOffset:void 0,color:t.Color.WHITE,image:"",distanceDisplayCondition:new t.DistanceDisplayCondition(0,999999999)},n={positions:[],arcType:t.ArcType.GEODESIC,clampToGround:!0,width:1,show:!0,material:t.Color.RED,height:30},a={height:0,heightReference:t.HeightReference.NONE,show:!0,fill:!0,material:t.Color.WHITE,outline:!1,outlineColor:t.Color.BLACK,outlineWidth:1,stRotation:0,granularity:t.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:t.ShadowMode.ENABLED,clampToGround:!0};this.isnull(e.near)&&(e.near=0),this.isnull(e.far)&&(e.far=999999999);var s=parseFloat(e.near),l=parseFloat(e.far);return delete e.near,delete e.far,null!=e.point&&(e.point=this.extend(i,e.point,!0),e.point.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),null!=e.label&&(e.label=this.extend(o,e.label,!0),e.label.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),null!=e.billboard&&(e.billboard=this.extend(r,e.billboard,!0),e.billboard.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),null!=e.polyline&&(e.polyline=this.extend(n,e.polyline,!0),e.polyline.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),null!=e.polygon&&(e.polygon=this.extend(a,e.polygon,!0),e.polygon.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),e},V.prototype.getCatesian3FromPX=function(e,t,i,o){var r,n=t.scene.pick(e),a=t.scene.drillPick(e),s=null;if(o){for(var l=0;l<a.length;l++)if(a[l].id._id!=(o&&o[0]&&o[0].id)&&a[l].id._id!=(o&&o[1]&&o[1].id)){s=a[l].id;break}}else s=n;if(t.scene.pickPositionSupported&&i.defined(s))r=t.scene.pickPosition(e);else{e=t.camera.getPickRay(e);if(!e)return;r=t.scene.globe.pick(e,t.scene)}return r},V.prototype.StyleContrast=function(e,t,i){var o={text:"",font:" 30px sans-serif",style:i.LabelStyle.FILL_AND_OUTLINE,fillColor:i.Color.WHITE,outlineColor:i.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new i.Color(.165,.165,.165,.8),backgroundPadding:new i.Cartesian2(7,5),scale:1,horizontalOrigin:i.HorizontalOrigin.CENTER,verticalOrigin:i.VerticalOrigin.CENTER,eyeOffset:i.Cartesian3.ZERO,pixelOffset:i.Cartesian2.ZERO,heightReference:i.HeightReference.NONE,scaleByDistance:void 0,distanceDisplayCondition:void 0},r={show:!0,position:i.Cartesian3.ZERO,pixelOffset:i.Cartesian2.ZERO,eyeOffset:i.Cartesian3.ZERO,heightReference:i.HeightReference.NONE,horizontalOrigin:i.HorizontalOrigin.CENTER,verticalOrigin:i.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:i.Color.WHITE,rotation:0,alignedAxis:i.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0},n={show:!0,pixelSize:1,heightReference:i.HeightReference.NONE,color:i.WHITE,outlineColor:i.Color.BLACK,outlineWidth:1,scaleByDistance:void 0,translucencyByDistance:void 0,distanceDisplayCondition:void 0},a={positions:[],width:5,material:i.Color.ALICEBLUE,arcType:i.ArcType.GEODESIC},s={polygonHierarchy:new i.PolygonHierarchy(i.Cartesian3.fromDegreesArray([-72,40,-70,35,-75,30,-70,30,-68,40])),height:0,extrudedHeight:0,material:"rgba(245, 20, 20, 0.91)"};this.isnull(t.near)&&(t.near=0),this.isnull(t.far)&&(t.far=999999999);var l=parseFloat(t.near),u=parseFloat(t.far);return delete t.near,delete t.far,t.distanceDisplayCondition=new i.DistanceDisplayCondition(l,u),"lable"==e?t=this.extend(o,t,!0):"billboard"==e?t=this.extend(r,t,!0):"point"==e?t=this.extend(n,t,!0):"polyline"==e?t=this.extend(a,t,!0):"polygon"==e&&(t=this.extend(s,t,!0)),t},V.prototype.createPolyline=function(e,t,i,o){var r;return-1==t?(r=new o.PolylineGeometry(e),new o.GeometryInstance({id:i,geometry:r})):(r=new o.GroundPolylineGeometry(e),new o.GeometryInstance({geometry:r,id:i}))},V.prototype.createPolygon=function(e,t,i,o){var r=e.material,n=new o.PolygonGeometry(e);return delete e.material,new o.GeometryInstance({id:i,geometry:n,attributes:{color:new o.ColorGeometryInstanceAttribute.fromColor(r)}})},V.prototype.coordinate=function(e,t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?this.coordinate(e,t[i]):e.push(t[i]);return e},V.prototype.Analysis=function(e,t){var i;return/^\[/.test(e)&&/\]$/.test(e)&&(i=e.replace(/\[/,"").replace(/\]/,""),null!=t.properties[i]&&(e=t.properties[i])),e},V.prototype.unique=function(e){for(var t=[],i=0;i<e.length;i++)-1===t.indexOf(e[i])&&t.push(e[i]);return t},V.prototype.extend=function(e,t,i=!1,o=!1){for(var r in t)o?e.hasOwnProperty(r)&&(e[r]=t[r]):e.hasOwnProperty(r)&&!i||(e[r]=t[r]);return e},V.prototype.getOffsetTilingScheme=function(e="GCJ02"){let t,i;return"GCJ02"===e&&(t=new Cesium.WebMercatorTilingScheme,i=new Cesium.WebMercatorProjection,t._projection.project=function(e,t){return t=H.WGS84ToGCJ02(Cesium.Math.toDegrees(e.longitude),Cesium.Math.toDegrees(e.latitude)),t=i.project(new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]))),new Cesium.Cartesian2(t.x,t.y)},t._projection.unproject=function(e,t){e=i.unproject(e);return t=H.GCJ02ToWGS84(Cesium.Math.toDegrees(e.longitude),Cesium.Math.toDegrees(e.latitude)),new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]))}),t},V.prototype.trackedEntity=function(n,a,e={}){let c={type:"tracked",heading:0,pitch:-45,distance:1e3,minDistance:0};Object.assign(c,e);let h,m,d;if(c.tooltip){c.tooltip=Object.assign({innerHTML:"",drag:!1,near:0,far:1e3,addX:0,addY:0},c.tooltip);e=`<div id="trackedTooltip${a.id}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;"><div class="trackedTooltipContainer"></div></div>`;if($(n.container).append(e),h=document.getElementById("trackedTooltip"+a.id),m=h.firstElementChild,m.innerHTML=c.tooltip.innerHTML,m.style.left=c.tooltip.addX+"px",m.style.top=c.tooltip.addY+"px",m.style.position="relative",c.tooltip.drag){d=document.createElement("div"),d.className="trackedTooltip-arrow",h.appendChild(d);let n,a,s,l,u=(e,t)=>{let i;n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),a=-(n-e)/2+"px",s=-t/2+"px",e?(i=Cesium.Math.toDegrees(Math.atan(t/e)),e<0&&(a=(n+e)/2-n+"px")):i=0<t?90:-90,l=`rotate(${i}deg)`};u(c.tooltip.addX,c.tooltip.addY),d.style.cssText=`
                position: absolute;
                bottom: ${s};
                left: ${a};
                width: ${n}px;
                height: 0px;
                transform: ${l};
                border-top: 2px dashed #f00;
            `,m.style.pointerEvents="all",m.addEventListener("mousedown",function(e){let t=e.pageX-m.offsetLeft,i=e.pageY-m.offsetTop,o,r;document.onmousemove=e=>{o=e.pageX-t,r=e.pageY-i,m.style.left=o+"px",m.style.top=r+"px",u(o,r),d.style.width=`${n}px`,d.style.left=a,d.style.bottom=s,d.style.transform=l},document.onmouseup=e=>{document.onmousemove=null}})}}this.endTrackedEntity&&this.endTrackedEntity(),c.start&&"function"==typeof c.start&&c.start();let s=new Cesium.ScreenSpaceEventHandler(n.scene.canvas),l;if("setView"===c.type){l=()=>{var e=n.clock.currentTime.clone(),t=a.position.getValue(e);if(n.scene.camera.setView({destination:t,orientation:{heading:Cesium.Math.toRadians(c.heading),pitch:Cesium.Math.toRadians(c.pitch)}}),n.scene.camera.moveBackward(c.distance),c.tooltip){c.distance<=c.tooltip.far&&c.distance>=c.tooltip.near?h.style.display="block":h.style.display="none";e=n.scene.cartesianToCanvasCoordinates(t);if(!e)return;h.style.left=e.x+"px",h.style.top=e.y-h.offsetHeight+"px"}c.position=t,c.update&&"function"==typeof c.update&&c.update()},n.scene.preRender.addEventListener(l);let t,i,o,r;s.setInputAction(e=>{t={position:e.position,heading:c.heading,pitch:c.pitch}},Cesium.ScreenSpaceEventType.LEFT_DOWN),s.setInputAction(e=>{t=void 0},Cesium.ScreenSpaceEventType.LEFT_UP),s.setInputAction(e=>{t&&(i=e.endPosition,o=i.x-t.position.x,r=i.y-t.position.y,c.heading=t.heading+o/8,c.pitch=t.pitch-r/6)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(e=>{c.distance-=e*c.distance/1e3,c.distance<c.minDistance&&(c.distance=c.minDistance)},Cesium.ScreenSpaceEventType.WHEEL)}else c.viewFrom&&(a.viewFrom=c.viewFrom),n.trackedEntity=a;return s.setInputAction(e=>{this.endTrackedEntity&&this.endTrackedEntity()},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.endTrackedEntity=()=>{s&&s.destroy(),n.trackedEntity=void 0,l&&n.scene.preRender.removeEventListener(l),h&&h.remove(),h=void 0,l=void 0,s=void 0,c.end&&"function"==typeof c.end&&c.end()},c.destroy=this.endTrackedEntity,c.updataTooltip=e=>{m.innerHTML=c.tooltip.innerHTML=e},c},V.prototype.getPointFromWindowPoint=function(e,t){if("EllipsoidTerrainProvider"==t.scene.terrainProvider.constructor.name)return t.camera.pickEllipsoid(e,t.scene.globe.ellipsoid);e=t.scene.camera.getPickRay(e);return t.scene.globe.pick(e,t.scene)},V.prototype.isnull=function(e){return null==e||""===e},V.prototype.getuid=function(){return this.uuid(8,16)},V.prototype.extendgl=function(e,t,i){return null!=t?("string"==typeof t&&"["==t.charAt(0)&&"]"==t.charAt(t.length-1)&&(t=(t=t.substr(0,t.length-1)).substr(1),null!=e.properties[t]._value?t=e.properties[t]._value:null!=e.properties[t]&&(t=e.properties[t])),t):i},V.prototype.uuid=function(e,t){var i,o,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],n=[];if(t=t||r.length,e)for(i=0;i<e;i++)n[i]=r[0|Math.random()*t];else for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",i=0;i<36;i++)n[i]||(o=0|16*Math.random(),n[i]=r[19==i?3&o|8:o]);return n.join("")},V.prototype.Shaders=function(e){var t="";return"VSHADER_SOURCE "==e?t="attribute vec4 a_Position;\nattribute vec2 a_TexCoord;\nuniform mat4 u_MvpMatrix;\nvarying vec2 v_TexCoord;\nvoid main(){\ngl_Position = u_MvpMatrix * a_Position;\nv_TexCoord = a_TexCoord;\n}\n":"TRIANGLE_FSHADER_SOURCE"==e?t="#ifdef GL_ES\nprecision mediump float;\n#endif\nvarying vec4 v_Color;\nvoid main() {\ngl_FragColor = v_Color;\n'}\n":"TRIANGLE_VSHADER_SOURCE"==e?t="attribute vec4 a_Position;\nattribute vec4 a_Normal;\nuniform mat4 u_MvpMatrix;\nuniform mat4 u_NormalMatrix;\nvarying vec4 v_Color;\nvoid main() {\nvec3 lightDirection = vec3(0.0, 0.0, 1.0);\nvec4 color = vec4(1.0, 1.0, 0.0, 1.0);\ngl_Position = u_MvpMatrix * a_Position;\nvec3 normal = normalize(vec3(u_NormalMatrix * a_Normal));\nfloat nDotL = max(dot(normal, lightDirection), 0.0);\nv_Color = vec4(color.rgb * nDotL, color.a);\n}\n":"vertexShaderSource"==e?t="attribute vec3 position3DHigh;\r\nattribute vec3 position3DLow;\r\nattribute vec3 normal;\r\nattribute vec2 st;\r\nattribute vec4 color;\r\nattribute float batchId;\r\nvarying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\nvarying vec2 v_st;\r\nvarying vec4 v_color;\r\nvoid main()\r\n{\r\nvec4 p = czm_computePosition();\r\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\r\nv_normalEC = czm_normal * normal;\r\nv_st = st;\r\nv_color = color;\r\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\r\n}\r\n":"fragmentShaderSource"==e&&(t="varying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\nvarying vec2 v_st;\r\nvarying vec4 v_color;\r\n\r\nvec4 czm_phong(vec3 toEye, czm_material material)\r\n{\r\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\r\nif (czm_sceneMode == czm_sceneMode3D) {\r\n    diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\r\n}\r\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\r\nvec3 materialDiffuse = material.diffuse * 0.5;\r\nvec3 ambient = materialDiffuse;\r\nvec3 color = ambient + material.emission;\r\ncolor += materialDiffuse * diffuse;\r\ncolor += material.specular * specular;\r\nreturn vec4(color, material.alpha);\r\n}void main()\r\n{\r\nvec3 positionToEyeEC = -v_positionEC;\r\nvec3 normalEC = normalize(v_normalEC);\r\n#ifdef FACE_FORWARD\r\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\r\n#endif\r\nvec4 color = czm_gammaCorrect(v_color);\r\nczm_materialInput materialInput;\r\nmaterialInput.normalEC = normalEC;\r\nmaterialInput.positionToEyeEC = positionToEyeEC;\r\nmaterialInput.st = v_st;\r\nczm_material material = czm_getDefaultMaterial(materialInput);\r\nmaterial.diffuse = color.rgb;\r\nmaterial.alpha = color.a;\r\n#ifdef FLAT\r\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\r\n#else\r\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\r\n#endif\r\n}\r\n"),t},V.prototype.isHtmlColor=function(e){return/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e)},V.prototype.isUrl=function(e){if(this.isnull(e))return!1;return/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.test(e)},V.prototype.dateTimespan=function(){return(new Date).toTimeString()},V.prototype.getPointFromTwoPointCenter=function(e,t,i){var o=this.getSpaceDistancem(e,Cesium),r=e[0],n=e[1],a=Cesium.Cartographic.fromCartesian(r),s=Cesium.Math.toDegrees(a.longitude),l=Cesium.Math.toDegrees(a.latitude),e=a.height,r=Cesium.Cartographic.fromCartesian(n),a=Cesium.Math.toDegrees(r.longitude),n=Cesium.Math.toDegrees(r.latitude),r=r.height,t=parseFloat(o/t),a=Cesium.Math.lerp(s,a,1/t)-s,n=Cesium.Math.lerp(l,n,1/t)-l,t=Cesium.Math.lerp(e,r,1/t)-e;return Cesium.Cartesian3.fromDegrees(s+a,l+n,i||e+t)},V.prototype.getSpaceDistance=function(e,t){for(var i=0,o=0;o<e.length-1;o++){var r=t.Cartographic.fromCartesian(e[o]),n=t.Cartographic.fromCartesian(e[o+1]),a=new t.EllipsoidGeodesic;a.setEndPoints(r,n);a=a.surfaceDistance;i+=a=Math.sqrt(Math.pow(a,2)+Math.pow(n.height-r.height,2))}return 1e3<=i?(i/1e3).toFixed(2)+"千米":i.toFixed(2)+"米"},V.prototype.getSpaceDistancem=function(e,t){for(var i=0,o=0;o<e.length-1;o++){var r=t.Cartographic.fromCartesian(e[o]),n=t.Cartographic.fromCartesian(e[o+1]),a=new t.EllipsoidGeodesic;a.setEndPoints(r,n);a=a.surfaceDistance;i+=a=Math.sqrt(Math.pow(a,2)+Math.pow(n.height-r.height,2))}return i.toFixed(2)},V.prototype.getHorizontalDistance=function(e,t){for(var i=0,o=0;o<e.length-1;o++){var r=t.Cartographic.fromCartesian(e[o]),n=t.Cartographic.fromCartesian(e[o+1]),a=new t.EllipsoidGeodesic;a.setEndPoints(r,n),i+=a.surfaceDistance}return i=1e3<=i?(i/1e3).toFixed(2)+"千米":i.toFixed(2)+"米"},V.prototype.getPointsInPolygon=function(o,r=50,e=!0){if(!(o.length<3)){o.push(o[0]);var t=Cesium_turf.lineString(o),n=Cesium_turf.bbox(t),t=Cesium_turf.pointGrid(n,r,{units:"meters"}),n=Cesium_turf.polygon([o]);let i=Cesium_turf.pointsWithinPolygon(t,n);if(e)for(let e=0;e<o.length-1;e++){var a=Cesium_turf.lineString([o[e],o[e+1]]),s={units:"meters"},l=Cesium_turf.length(a,s);let t;for(let e=r;;e+=r){1;{if(!(e<=l)){t=Cesium_turf.along(a,l,s),i.features.push(t);break}t=Cesium_turf.along(a,e,s),i.features.push(t)}}}return i}},V.prototype.tinFromPoints=function(e,t={}){let{polygon:r,getArea:n}=t,i=Cesium_turf.tin(e),a=0;return i&&i.features&&i.features.forEach(e=>{let t=!0;var i;if(r&&(i=Cesium_turf.centerOfMass(e),t=Cesium_turf.booleanPointInPolygon(i,r)),t){var o=e.geometry.coordinates[0];let t=[],i=[];for(let e=0;e<3;e++)t.push([o[e][0],o[e][1]]),i.push(Cesium.Cartesian3.fromDegrees(o[e][0],o[e][1],o[e][2]));e.positions=i,n&&(e.area=this.getArea(t,i,!0),a+=e.area)}}),{tin:i,area:a}},V.prototype.getSpaceArea=function(i,e,t={}){var o=this.defaultValue(t.distance,50),r=this.defaultValue(t.onlyTerrain,!1);let n=this.defaultValue(t.isNum,!1),a=this.getPointsInPolygon(e,o,!0),s=Cesium_turf.polygon([e]),l=()=>{let{tin:e,area:t}=this.tinFromPoints(a,{getArea:!0,polygon:s});return n||(t=t<1e6?t.toFixed(2)+"平方米":(t/1e6).toFixed(2)+"平方千米"),{area:t,tin:e}};if(r){let t=[];a.features.forEach(e=>{e=e.geometry.coordinates;t.push(Cesium.Cartographic.fromDegrees(e[0],e[1]))});let e=Cesium.sampleTerrainMostDetailed(i.scene.globe.terrainProvider,t);return e.then(o=>(a.features.forEach((e,t)=>{let i=e.geometry.coordinates;i[2]=o[t]&&o[t].height?o[t].height:0}),l()))}return a.features.forEach(e=>{let t=e.geometry.coordinates;e=new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1])),e=i.scene.sampleHeight(e)||0;t[2]=e}),l()},V.prototype.starPositions=function(e,t,i){for(var o=Math.PI/e,r=[],n=0;n<2*e;n++){var a=n%2==0?t:i,a=new Cesium.Cartesian2(Math.cos(n*o)*a,Math.sin(n*o)*a);r.push(a)}return r},V.prototype.computeCircle=function(e){for(var t=[],i=0;i<360;i++){var o=Cesium.Math.toRadians(i);t.push(new Cesium.Cartesian2(e*Math.cos(o),e*Math.sin(o)))}return t},V.prototype.getArea=function(t,u,i){if(!(t.length<3)){let r=Array.concat(t,[t[0]]);var c=0,t=Cesium_turf.polygon([r]);let e;e=4===r.length?[t]:Cesium_turf.tesselate(t).features;let n,a,s,l;return(e.forEach(e=>{n=e.geometry.coordinates[0],a=r.findIndex(e=>e.toString()===n[0].toString()),s=r.findIndex(e=>e.toString()===n[1].toString()),l=r.findIndex(e=>e.toString()===n[2].toString());var t=this.getdistance(u[a],u[s]),i=this.getdistance(u[s],u[l]),o=this.getdistance(u[a],u[l]),e=(t+i+o)/2;c+=Math.sqrt((e-t)*(e-i)*(e-o)*e)}),i)?c:c=c<1e6?c.toFixed(2)+"平方米":(c/1e6).toFixed(2)+"平方千米"}},V.prototype.getdistance=function(e,t){var i=Cesium.Cartographic.fromCartesian(e),e=Cesium.Cartographic.fromCartesian(t),t=new Cesium.EllipsoidGeodesic;t.setEndPoints(i,e);t=t.surfaceDistance;return t=Math.sqrt(Math.pow(t,2)+Math.pow(e.height-i.height,2))},V.prototype.Angle=function(e,t,i){i=this.Bearing(t,e)-this.Bearing(t,i);return i<0&&(i+=360),i},V.prototype.Bearing=function(e,t){var i=Math.PI/180,o=180/Math.PI,r=e.lat*i,n=e.lon*i,e=t.lat*i,i=t.lon*i,i=-Math.atan2(Math.sin(n-i)*Math.cos(e),Math.cos(r)*Math.sin(e)-Math.sin(r)*Math.cos(e)*Math.cos(n-i));return i<0&&(i+=2*Math.PI),i*=o},V.prototype.getHeight=function(e,t){try{if(1<e.length){var i=t.Cartographic.fromCartesian(e[0]);return((t.Cartographic.fromCartesian(e[1]).height-i.height)/1e3).toFixed(2)}return 0}catch(e){console.log(e)}},V.prototype.getPmfx=function(e,t,i,o,r,n){var a={gcs:[],min:99999,max:0,juli:0,cys:t},s=this.getSpaceDistancem(e,o);a.juli=s,0==i||(t=parseInt(s/i)),a.cys=t;var l=e[0],s=e[e.length-1],i=o.Cartographic.fromCartesian(l),u=o.Math.toDegrees(i.longitude),c=o.Math.toDegrees(i.latitude);i.height;e=o.Cartographic.fromCartesian(s),l=o.Math.toDegrees(e.longitude),s=o.Math.toDegrees(e.latitude);e.height;var h=t,m=o.Math.lerp(u,l,1/h)-u,d=o.Math.lerp(c,s,1/h)-c,p=[],g=[];p.push(i);for(var _=0;_<h;_++){var f=u+(_+1)*m,y=c+(_+1)*d,y=o.Cartesian3.fromDegrees(f,y);p.push(o.Cartographic.fromCartesian(y))}var v=this;this.getHeightsFromLonLat(p,o,r,function(e){if(e){g=e;e=!1;for(!0!==r.scene.globe.depthTestAgainstTerrain&&(e=r.scene.globe.depthTestAgainstTerrain=!0),_=0;_<g.length;_++){var t=v.get3DTileOrPrimitivesHeights(p[_],r);void 0!==t&&(g[_]=t);t=g[_].toFixed(2);parseFloat(t)<parseFloat(a.min)&&(a.min=parseFloat(t)),parseFloat(t)>parseFloat(a.max)&&(a.max=parseFloat(t)),a.gcs.push(t)}e&&(r.scene.globe.depthTestAgainstTerrain=!1),""!=n&&null!=n&&"function"==typeof n&&n(a)}})},V.prototype.getPmfxPro=function(m,t,i,d,o,r){let n=this,a={gcs:[],min:99999,max:0,juli:0,cys:0},p=[],s=[];for(let e=0;e<m.length-1;e++){var l=n.getSpaceDistancem([m[e],m[e+1]],d),l=parseFloat(l);a.juli+=l,0==i||(t=parseInt(l/i)),s.push(t),a.cys+=t}let u=()=>{s.forEach((e,t)=>{var i=m[t],o=m[t+1],r=d.Cartographic.fromCartesian(i),n=d.Math.toDegrees(r.longitude),a=d.Math.toDegrees(r.latitude),i=d.Cartographic.fromCartesian(o),o=d.Math.toDegrees(i.longitude),i=d.Math.toDegrees(i.latitude),s=e,l=d.Math.lerp(n,o,1/s)-n,u=d.Math.lerp(a,i,1/s)-a;0===t&&p.push(r);for(let e=0;e<s;e++){var c=n+(e+1)*l,h=a+(e+1)*u,h=d.Cartesian3.fromDegrees(c,h);p.push(d.Cartographic.fromCartesian(h))}}),p.push(d.Cartographic.fromCartesian(m[m.length-1]));let i=[];a.allPoint=p,this.getHeightsFromLonLat(p,d,o,function(e){if(e){i=e;e=o.scene.globe.depthTestAgainstTerrain;o.scene.globe.depthTestAgainstTerrain=!0;for(let e=0;e<i.length;e++){var t=n.get3DTileOrPrimitivesHeights(p[e],o);void 0!==t&&(i[e]=t);t=i[e].toFixed(2);parseFloat(t)<parseFloat(a.min)&&(a.min=parseFloat(t)),parseFloat(t)>parseFloat(a.max)&&(a.max=parseFloat(t)),a.gcs.push(t)}o.scene.globe.depthTestAgainstTerrain=e,r&&"function"==typeof r&&r(a)}})};1e3<a.cys?layuiLayer&&layuiLayer.msg("当前采样点数过多,是否继续分析?",{time:0,btn:["继续","取消"],btnAlign:"c",yes:e=>{layuiLayer.close(e),setTimeout(()=>{u()},10)},btn2:()=>{r&&"function"==typeof r&&r(a)}}):setTimeout(()=>{u()},10)},V.prototype.get3DTileOrPrimitivesHeights=function(e,t){return t.scene.sampleHeight(e)},V.prototype.getHeightsFromLonLat=function(e,t,i,o){var r,n=i.camera,a=[];i.scene&&i.scene.terrainProvider&&i.scene.terrainProvider._layers?(r=t.sampleTerrainMostDetailed(i.terrainProvider,e),n.positionCartographic.height,t.when(r,function(e){e.forEach(function(e){a.push(e.height)}),"function"==typeof o&&o(a)})):(e.forEach(function(e){a.push(i.scene.globe.getHeight(e))}),"function"==typeof o&&o(a))},V.prototype.getColorRamp=function(e,i,t,o){var r=[],n=document.createElement("canvas");n.width=100,n.height=1;var a,s=n.getContext("2d");"elevation"===e?a=[0,.05,.2,.35,.5,.65,.8,.95,1]:"slope"===e?a=r:"aspect"===e&&(a=[0,0,.2,.4,.6,.8,.9,1,1]),i=i||["#0b0b88","#2747E0","#D33B7D","#D33038","#FF9742","#ffd700","#bbff00"];var l=s.createLinearGradient(0,0,100,0);if("slope"===e){void 0===t&&(t=0),0==(t=void 0===o?90:t)?r.push(0):(r.push(t/90),l.addColorStop(0,"#000000"));var u=(o-t)/6;if(90==o){for(var c=1;c<=5;c++)r.push((t+c*u)/90);r.push(1),r.forEach(function(e,t){l.addColorStop(e,i[t])})}else{for(c=1;c<=5;c++)r.push((t+c*u)/90);r.push(o/90),r.forEach(function(e,t){l.addColorStop(e,i[t])}),l.addColorStop(1,"#000000")}}else l.addColorStop(a[0],"#000000"),l.addColorStop(a[1],i[0]),l.addColorStop(a[2],i[1]),l.addColorStop(a[3],i[2]),l.addColorStop(a[4],i[3]),l.addColorStop(a[5],i[4]),l.addColorStop(a[6],i[5]),l.addColorStop(a[7],i[6]),l.addColorStop(a[8],"#000000");return s.fillStyle=l,s.fillRect(0,0,100,1),n},V.prototype.Gauss_to_XY=function(e,t,i,o){var r,n,a=6356752.3142,s=Math.sqrt(272331606681.9453)/a,l=0,u=this.to_Radian(i);t=this.to_Radian(t);var c=(e=this.to_Radian(e))-u,h=Math.cos(t),m=(l=this.to_N(t))*Math.cos(t);r=Math.tan(t),n=s*h;var d=Math.pow(r,2),a=Math.pow(r,4),i=Math.pow(n,2),e=Math.pow(n,4),u=Math.pow(h,3),s=Math.pow(h,5),m=this.to_Sm(t)+Math.pow(c,2)/2*m*h*r+Math.pow(c,4)/24*r*m*u*(5-d+9*i+4*e)+Math.pow(c,6)/720*r*m*s*(61-58*r*r+a+270*i-330*r*r*i),d=c*l*h+Math.pow(c,3)/6*l*u*(1-r*r+n*n)+Math.pow(c,5)/120*l*s*(5-18*r*r+a+14*i-58*i*d);return new o.Cartesian2(d,m)},V.prototype.to_Radian=function(e){return e*Math.PI/180},V.prototype.to_N=function(e){var t=6378137,i=6356752.3142,i=Math.sqrt(t*t-i*i)/t;return t/Math.sqrt(1-i*i*Math.sin(e)*Math.sin(e))},V.prototype.to_Sm=function(e){var t=6378137,i=6356752.3142,o=Math.sqrt(t*t-i*i)/t,r=1+o*o*3/4+45*Math.pow(o,4)/64+175*Math.pow(o,6)/256+11025*Math.pow(o,8)/16384,n=3*Math.pow(o,2)/4+15*Math.pow(o,4)/16+525*Math.pow(o,6)/512+2205*Math.pow(o,8)/2048,a=15*Math.pow(o,4)/64+105*Math.pow(o,6)/256+2205*Math.pow(o,8)/4096,s=35*Math.pow(o,6)/512+315*Math.pow(o,8)/2048,i=315*Math.pow(o,8)/16384;return t*(1-o*o)*(r*e-n/2*Math.sin(2*e)+a/4*Math.sin(4*e)-s/6*Math.sin(6*e)+i/8*Math.sin(8*e))},V.prototype.ElevationAngle=function(e,t,i){var o=i.Cartographic.fromCartesian(e),r=i.Cartographic.fromCartesian(t);o.height,o.height,r.height;r=i.Cartesian3.fromDegrees(i.Math.toDegrees(r.longitude),i.Math.toDegrees(r.latitude),o.height),o=parseFloat(function(e,t){for(var i=0,o=0;o<e.length-1;o++){var r=t.Cartographic.fromCartesian(e[o]),n=t.Cartographic.fromCartesian(e[o+1]),a=new t.EllipsoidGeodesic;a.setEndPoints(r,n);a=a.surfaceDistance;i+=a=Math.sqrt(Math.pow(a,2)+Math.pow(n.height-r.height,2))}return i}([e,t],i));parseFloat(function(e,t){for(var i=0,o=0;o<e.length-1;o++){var r=t.Cartographic.fromCartesian(e[o]),n=t.Cartographic.fromCartesian(e[o+1]),a=new t.EllipsoidGeodesic;a.setEndPoints(r,n),i+=a.surfaceDistance}return i}([e,r],i));i=parseFloat(function(e,t){try{if(1<e.length){var i=t.Cartographic.fromCartesian(e[0]);return t.Cartographic.fromCartesian(e[1]).height-i.height}return 0}catch(e){console.log(e)}}([r,t],i));return 180*Math.asin(i/o)/3.14},V.prototype.TwoPointAzimuth=function(e,t,i,o){function r(e){return e*Math.PI/180}var n=0,a=Math.round(.5+36e4*t),s=Math.round(.5+36e4*o),l=Math.round(.5+36e4*e),u=Math.round(.5+36e4*i);return t=r(t),e=r(e),o=r(o),i=r(i),a===s&&l===u||(l===u?s<a&&(n=180):(t=Math.acos(Math.sin(o)*Math.sin(t)+Math.cos(o)*Math.cos(t)*Math.cos(i-e)),n=180*Math.asin(Math.cos(o)*Math.sin(i-e)/Math.sin(t))/Math.PI,a<s&&l<u||(s<a&&u<l||s<a&&l<u?n=180-n:a<s&&u<l&&(n+=360)))),n},V.prototype.ThreePointAzimuth=function(e,t,i,o){var r=Math.PI/180,n=180/Math.PI,a=o.Cartographic.fromCartesian(e),s=o.Cartographic.fromCartesian(t),e=o.Cartographic.fromCartesian(i);function l(e,t){var i=e.latitude*r,o=e.longitude*r,e=t.latitude*r,t=t.longitude*r,t=-Math.atan2(Math.sin(o-t)*Math.cos(e),Math.cos(i)*Math.sin(e)-Math.sin(i)*Math.cos(e)*Math.cos(o-t));return t<0&&(t+=2*Math.PI),t*=n}t=o.Cartesian3.fromDegrees(o.Math.toDegrees(s.longitude),o.Math.toDegrees(s.latitude),a.height),i=o.Cartesian3.fromDegrees(o.Math.toDegrees(e.longitude),o.Math.toDegrees(e.latitude),a.height);var u,c,s=o.Cartographic.fromCartesian(t),e=o.Cartographic.fromCartesian(i);return c=e,(c=l(u=s,a)-l(u,c))<0&&(c+=360),c},V.prototype.setDepthTest=function(e,t){"open"===e&&void 0===this.defaultDepthTest?(this.defaultDepthTest=!!t.scene.globe.depthTestAgainstTerrain,t.scene.globe.depthTestAgainstTerrain=!0):"close"===e&&void 0!==this.defaultDepthTest&&(t.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0)},V.prototype.setImageMaterialProperty=function(e,t,i,o){this.id=o;var n=this,r=document.createElement("canvas");r.id=this.id+"-a",r.width=700,r.height=100;o=document.createElement("canvas");o.id=this.id+"-b",o.width=700,o.height=100,document.body.appendChild(r),document.body.appendChild(o),e&&(n.images=e);e=new t.CallbackProperty(function(e,t){var i=document.getElementById(n.id+"-"+n.curCanvas),o=i.getContext("2d"),r=new Image;return r.src=n.images,o.clearRect(0,0,700,100),r.onload=function(){n.i<=700?(o.drawImage(r,n.i,0),o.drawImage(r,n.i+100,0)):n.i=0,n.i+=5},n.curCanvas="a"===n.curCanvas?"b":"a",i},!1);return 1==i&&(e=new t.CallbackProperty(function(e,t){var i=document.getElementById(n.id+"-"+n.curCanvas),o=i.getContext("2d"),r=o.createLinearGradient(0,100,0,0);return r.addColorStop(0,"red"),1<n.i&&(n.i=1),r.addColorStop(n.i,"rgb(255,0,0,0.6)"),r.addColorStop(1,"rgb(255,0,0,0.1)"),o.clearRect(0,0,700,100),o.fillStyle=r,o.fillRect(0,0,700,100),n.i<1?n.i+=.01:n.i=0,n.curCanvas="a"===n.curCanvas?"b":"a",i},!1)),new t.ImageMaterialProperty({image:e,transparent:!0})},V.prototype.setDrawCanvasImage=function(e,t){var o=document.getElementById("canvas-"+curCanvas),r=o.getContext("2d"),n=new Image;return n.src=images,r.clearRect(0,0,700,100),n.onload=function(){i<=700?(r.drawImage(n,i,0),r.drawImage(n,i+100,0)):i=0,i+=5},curCanvas="a"===curCanvas?"b":"a",o},V.prototype.setDrawCanvasColorUpdown=function(e,t){var o=document.getElementById("canvas-"+curCanvas),r=o.getContext("2d"),n=r.createLinearGradient(0,100,0,0);return n.addColorStop(0,"red"),1<i&&(i=1),n.addColorStop(i,"rgb(255,0,0,0.6)"),n.addColorStop(1,"rgb(255,0,0,0.1)"),r.clearRect(0,0,700,100),r.fillStyle=n,r.fillRect(0,0,700,100),i<1?i+=.01:i=0,curCanvas="a"===curCanvas?"b":"a",o},V.prototype.getMousePosition=function(e,t,i,o,r,n,a){var s,l,u,c,e=e.endPosition||e.position;void 0===r&&(r=0),this._cesium=t,this._viewer=i,n=this._cesium.defaultValue(n,!1),void 0===this.defaultDepthTest&&(this.defaultDepthTest=!!this._viewer.scene.globe.depthTestAgainstTerrain);i=n?a||30:1;if(0!==r?(this._viewer.scene.globe.depthTestAgainstTerrain=!0,(s=this._viewer.camera.getPickRay(e))&&(l=this._viewer.scene.globe.pick(s,this._viewer.scene)),c=this._viewer.scene.drillPick(e,o&&o.length&&o.length+1||1,i,i),(c=this.getNotExcludedObj(c,o))&&!n?(this._viewer.scene.pick(e),(u=this._viewer.scene.pickPosition(e))&&(l=u)):(u=l&&n?this._getAdsorptionPosition(e,c,a):u)&&(l=u)):(c=this._viewer.scene.drillPick(e,o&&o.length&&o.length+1||1,i,i),(c=this.getNotExcludedObj(c,o))&&!n?(this._viewer.scene.pick(e),l=this._viewer.scene.pickPosition(e)):c&&n?(this._viewer.scene.pick(e),l=this._viewer.scene.pickPosition(e),(u=this._getAdsorptionPosition(e,c,a))&&(l=u)):(this._viewer.scene.globe.depthTestAgainstTerrain=!0,(s=this._viewer.camera.getPickRay(e))&&(l=this._viewer.scene.globe.pick(s,this._viewer.scene)))),l)return this._viewer.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0,l;console.log("未拾取到坐标!")},V.prototype.toDegrees=function(e){e=Cesium.Cartographic.fromCartesian(e);return{lon:Cesium.Math.toDegrees(e.longitude),lat:Cesium.Math.toDegrees(e.latitude),height:e.height}},V.prototype.LineInterpolation=function(i,e){let t,h,m=!1;t=e.positions||e,h=e.num||100,e.getHeight&&(m=!0);let d={positions:[],cartographic:[],lon_lat:[],height:[]};for(let e=0;e<t.length-1;e++){var o=this.toDegrees(t[e]),r=this.toDegrees(t[e+1]);!function(t,i,e,o){var r=Cesium.Math.lerp(t,e,1/h)-t,n=Cesium.Math.lerp(i,o,1/h)-i;d.lon_lat.push(t,i);let a;if(m){a=p(t,i),d.height.push(a),d.positions.push(Cesium.Cartesian3.fromDegrees(t,i,a));for(let e=0;e<h;e++){var s=t+(e+1)*r,l=i+(e+1)*n;d.lon_lat.push(s,l),a=p(s,l),d.height.push(a),d.positions.push(Cesium.Cartesian3.fromDegrees(s,l,a))}d.lon_lat.push(e,o),a=p(e,o),d.height.push(a),d.positions.push(Cesium.Cartesian3.fromDegrees(e,o,a))}else{d.positions.push(Cesium.Cartesian3.fromDegrees(t,i));for(let e=0;e<h;e++){var u=t+(e+1)*r,c=i+(e+1)*n;d.lon_lat.push(u,c),d.positions.push(Cesium.Cartesian3.fromDegrees(u,c))}d.lon_lat.push(e,o),d.positions.push(Cesium.Cartesian3.fromDegrees(e,o))}}(o.lon,o.lat,r.lon,r.lat)}function p(e,t){t=Cesium.Cartographic.fromDegrees(e,t);return i.scene.globe.getHeight(t)}return d},V.prototype.CIMServerTool=function(e){return new I(e)},V.prototype.Recorder=function(e,t){return this._Recorder?(this._Recorder.mediaOutputPath=this.defaultValue(e,"test.mp4"),t&&(this._Recorder.videoBPS=t)):this._Recorder=new L(e,t),this._Recorder},V.prototype.getLinkMaterial=function(e,t,i){function o(e,t,i){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.lightSpotColor=t,this.duration=i,this.old=void 0,this._time=(new Date).getTime()}return Cesium.PolylineLinkMaterialProperty||(Object.defineProperties(o.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),o.prototype.getType=function(e){return"PolylineLink"},o.prototype.getValue=function(e,t){return(t=!Cesium.defined(t)?{}:t).color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),t.lightSpotColor=this.lightSpotColor,t.time=((new Date).getTime()-this._time)%this.duration/this.duration,void 0===this.old&&(this.old=t.time),.5<this.old&&t.time<.5&&(t.plus=!t.plus,t.inverse=!t.inverse),this.old=t.time,t.plus?t.time=1.1*t.time:t.time=1.2*t.time-.1,t},o.prototype.equals=function(e){return this===e||e instanceof o&&Cesium.Property.equals(this._color,e._color)},Cesium.PolylineLinkMaterialProperty=o,Cesium.Material.PolylineLinkType="PolylineLink",Cesium.Material.PolylineLinkSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n                                                      {\n                                                           czm_material material = czm_getDefaultMaterial(materialInput);\n                                                           vec2 st = materialInput.st;\n                                                           if(plus && st.s < time && time - st.s <= 0.1){\n                                                                material.alpha = 1.0 - (time - st.s) / 0.1;\n                                                                if(material.alpha < 0.3){\n                                                                    material.alpha = 0.3;\n                                                                    material.diffuse = color.rgb;\n                                                                }else{\n                                                                    material.diffuse = lightSpotColor.rgb;\n                                                                }\n                                                            }else if(inverse && st.s < (1.0 - time) && (1.0 - time) - st.s <= 0.1){\n                                                                material.alpha = ((1.0-time) - st.s) / 0.1;\n                                                                if(material.alpha < 0.3){\n                                                                    material.alpha = 0.3;\n                                                                    material.diffuse = color.rgb;\n                                                                }else{\n                                                                    material.diffuse = lightSpotColor.rgb;\n                                                                }\n                                                            }else{\n                                                                material.alpha = 0.3;\n                                                                material.diffuse = color.rgb;\n                                                            }\n                                                           return material;\n                                                       }",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineLinkType,{fabric:{type:Cesium.Material.PolylineLinkType,uniforms:{color:new Cesium.Color(1,0,0,.5),lightSpotColor:new Cesium.Color(1,1,1,.5),time:0,plus:!0,inverse:!1},source:Cesium.Material.PolylineLinkSource},translucent:function(e){return!0}})),new Cesium.PolylineLinkMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#0000ff")),Cesium.Color.fromCssColorString(this.defaultValue(t,"#ffffff")),this.defaultValue(i,3e3))},V.prototype.getTrailLinkMaterial=function(e,t,i){return new S(e,t,i)},V.prototype.getConeRadarMaterial=function(e){function t(e,t){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=t,this._time=(new Date).getTime()}return Cesium.ConeRadarMaterialProperty||(Object.defineProperties(t.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),t.prototype.getType=function(e){return"ConeRadar"},t.prototype.getValue=function(e,t){return(t=!Cesium.defined(t)?{}:t).color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},t.prototype.equals=function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)},Cesium.ConeRadarMaterialProperty=t,Cesium.Material.ConeRadarType="ConeRadar",Cesium.Material.ConeRadarSource="\n                                                float ripple(float dist, float rippleIntensity, float rippleScale) {\n                                                    return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n                                                }\n                                                czm_material czm_getMaterial(czm_materialInput materialInput)\n                                                {\n                                                    czm_material material = czm_getDefaultMaterial(materialInput);\n                                                    material.diffuse = color.rgb;\n                                                    vec2 st = materialInput.st;\n                                                    float dis = distance(st, vec2(0.5, 0.5));\n                                                    material.alpha = 0.0;\n                                                    float intensity = step(0.001,ripple(dis, 80.0, 15.0));\n                                                    if(intensity == 1.0)\n                                                    {\n                                                        material.alpha = 1.0;\n                                                    }\n                                                    return material;\n                                                }",Cesium.Material._materialCache.addMaterial(Cesium.Material.ConeRadarType,{fabric:{type:Cesium.Material.ConeRadarType,uniforms:{color:new Cesium.Color(1,0,0,.5),time:0},source:Cesium.Material.ConeRadarSource},translucent:function(e){return!0}})),new Cesium.ConeRadarMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#0000ff")),3e3)},V.prototype.getMultiCircleScanMaterial=function(e,t){function i(e,t){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.u_radius1=0,this.u_radius2=0,this.u_radius3=0,this.duration=t,this._time=(new Date).getTime()}return Cesium.CircleScanMultiMaterialProperty||(Object.defineProperties(i.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),i.prototype.getType=function(e){return"CircleScanMulti"},i.prototype.getValue=function(e,t){return(t=!Cesium.defined(t)?{}:t).color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t.time<1/3&&0===this.u_radius2&&0===this.u_radius1?this.u_radius3=t.time:t.time>=1/3&&t.time<2/3&&0===this.u_radius1?(this.u_radius3=t.time,this.u_radius2=this.u_radius3-1/3):t.time>=2/3?(this.u_radius3=t.time,this.u_radius2=this.u_radius3-1/3,this.u_radius1=this.u_radius3-2/3):t.time<1/3&&0!==this.u_radius2&&0!==this.u_radius1?(this.u_radius1=t.time,this.u_radius2=t.time+1/3,this.u_radius3=t.time+2/3):t.time>=1/3&&t.time<2/3&&0!==this.u_radius1&&(this.u_radius1=t.time-1/3,this.u_radius2=t.time,this.u_radius3=t.time+1/3),t.u_radius1=this.u_radius1,t.u_radius2=this.u_radius2,t.u_radius3=this.u_radius3,t},i.prototype.equals=function(e){return this===e||e instanceof i&&Cesium.Property.equals(this._color,e._color)},Cesium.CircleScanMultiMaterialProperty=i,Cesium.Material.CircleScanMultiType="CircleScanMulti",Cesium.Material.CircleScanMultiSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n                {\n                    czm_material material = czm_getDefaultMaterial(materialInput);\n                    material.diffuse = color.rgb;\n                    vec2 st = materialInput.st;\n                    float dis = distance(st, vec2(0.5, 0.5));\n                    dis = dis * 2.0;\n                    if(dis < u_radius1)\n\n                    {\n                        float f = dis / u_radius1;\n                        material.alpha  = pow(f, 9.0);\n                    }else if(dis < u_radius2){\n                        float f = dis / u_radius2;\n                        material.alpha  = pow(f, 9.0);\n                    }else if(dis < u_radius3){\n                        float f = dis / u_radius3;\n                        material.alpha  = pow(f, 9.0);\n                    }else{\n                        material.alpha = 0.0;\n                    }\n                    return material;\n                }",Cesium.Material._materialCache.addMaterial(Cesium.Material.CircleScanMultiType,{fabric:{type:Cesium.Material.CircleScanMultiType,uniforms:{color:new Cesium.Color(1,0,0,1),time:0,u_radius1:0,u_radius2:0,u_radius3:0},source:Cesium.Material.CircleScanMultiSource},translucent:function(e){return!0}})),new Cesium.CircleScanMultiMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,3e3))},V.prototype.getSectorScanMaterial=function(e,t){function i(e,t,i){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=i,this._angle=t,this._time=(new Date).getTime()}return Cesium.EllipsoidFadeMaterialProperty||(Object.defineProperties(i.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color"),angle:Cesium.createPropertyDescriptor("angle")}),i.prototype.getType=function(e){return"EllipsoidFade"},i.prototype.getValue=function(e,t){return(t=!Cesium.defined(t)?{}:t).color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.ColorWHITE,t.color),t.angle=this._angle,t},i.prototype.equals=function(e){return this===e||e instanceof i&&Property.equals(this._color,e._color)},Cesium.EllipsoidFadeMaterialProperty=i,Cesium.Material.EllipsoidFadeType="EllipsoidFade",Cesium.Material.EllipsoidFadeSource="float getAngle(in vec2 dv)\n{\n    if(dv.y == 0.0 && dv.x > 0.0)\n    {\n        return 90.0;\n    }\n    if(dv.y == 0.0 && dv.x < 0.0)\n    {\n        return 270.0;\n    }\n    float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n    if(dv.x > 0.0)\n    {\n        if(dv.y < 0.0)\n        {\n            rAngle = 180.0 + rAngle;\n        }\n    }\n    if(dv.x <= 0.0)\n    {\n        if(dv.y < 0.0)\n        {\n            rAngle = 180.0 + rAngle;\n        }\n        if(dv.y > 0.0)\n        {\n            rAngle = 360.0 + rAngle;\n        }\n    }\n    return rAngle;\n}\nfloat ripple(float dist, float rippleIntensity, float rippleScale) {\n    return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n  czm_material material = czm_getDefaultMaterial(materialInput);\n  material.diffuse = 1.5 * color.rgb;\n  vec2 st = materialInput.st;\n  float dis = distance(st, vec2(0.5, 0.5));\n  float nowAngle = getAngle(st.xy-vec2(0.5, 0.5));\n  if(nowAngle < angle)\n  {\n       material.alpha = 1.0 - dis/0.5;\n       float intensity =step(0.001,ripple(dis, 100.0, 15.0));\n       if(intensity == 1.0)\n       {\n           material.alpha = material.alpha/2.0;\n       }\n  }\n  else{\n       material.alpha = 0.0;\n       discard;\n  }\n  return material;\n}",Cesium.Material._materialCache.addMaterial(Cesium.Material.EllipsoidFadeType,{fabric:{type:Cesium.Material.EllipsoidFadeType,uniforms:{color:new Cesium.Color(1,0,0,1),angle:90},source:Cesium.Material.EllipsoidFadeSource},translucent:function(e){return!0}})),new Cesium.EllipsoidFadeMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,45))},V.prototype.getCircleScanMaterial=function(e,t){function i(e,t){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=t,this._time=(new Date).getTime()}return Cesium.CircleScanMaterialProperty||(Object.defineProperties(i.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),i.prototype.getType=function(e){return"CircleScan"},i.prototype.getValue=function(e,t){return(t=!Cesium.defined(t)?{}:t).color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},i.prototype.equals=function(e){return this===e||e instanceof i&&Cesium.Property.equals(this._color,e._color)},Cesium.CircleScanMaterialProperty=i,Cesium.Material.CircleScanType="CircleScan",Cesium.Material.CircleScanSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n                {\n                    czm_material material = czm_getDefaultMaterial(materialInput);\n                    material.diffuse = color.rgb;\n                    vec2 st = materialInput.st;\n                    float dis = distance(st, vec2(0.5, 0.5));\n                    if(dis<time){\n                        float f = dis / time;\n                        material.alpha = pow(f, 4.0);\n                    }else{\n                        material.alpha = 0.0;\n                    }\n                    return material;\n                }",Cesium.Material._materialCache.addMaterial(Cesium.Material.CircleScanType,{fabric:{type:Cesium.Material.CircleScanType,uniforms:{color:new Cesium.Color(1,0,0,1),time:0},source:Cesium.Material.CircleScanSource},translucent:function(e){return!0}})),new Cesium.CircleScanMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,3e3))},V.prototype.getRadarScanMaterial=function(e,t){function i(e,t){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=t,this._time=(new Date).getTime()}return Cesium.RadarScanMaterialProperty||(Object.defineProperties(i.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),i.prototype.getType=function(e){return"RadarScan"},i.prototype.getValue=function(e,t){return(t=!Cesium.defined(t)?{}:t).color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t.angle1=360*t.time,t.angle2=360*t.time+60,360<t.angle2&&(t.angle2=t.angle2-360),t},i.prototype.equals=function(e){return this===e||e instanceof i&&Cesium.Property.equals(this._color,e._color)},Cesium.RadarScanMaterialProperty=i,Cesium.Material.RadarScanType="RadarScan",Cesium.Material.RadarScanSource="float getAngle(in vec2 dv)\n                {\n                    if(dv.y == 0.0 && dv.x > 0.0)\n                    {\n                        return 90.0;\n                    }\n                    if(dv.y == 0.0 && dv.x < 0.0)\n                    {\n                        return 270.0;\n                    }\n                    float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n                    if(dv.x > 0.0)\n                    {\n                        if(dv.y < 0.0)\n                        {\n                            rAngle = 180.0 + rAngle;\n                        }\n                    }\n                    if(dv.x <= 0.0)\n                    {\n                        if(dv.y < 0.0)\n                        {\n                            rAngle = 180.0 + rAngle;\n                        }\n                        if(dv.y > 0.0)\n                        {\n                            rAngle = 360.0 + rAngle;\n                        }\n                    }\n                    return rAngle;\n                }\n                float ripple(float dist, float rippleIntensity, float rippleScale) {\n                    return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n                }\n                czm_material czm_getMaterial(czm_materialInput materialInput)\n                {\n                    czm_material material = czm_getDefaultMaterial(materialInput);\n                    material.diffuse = color.rgb;\n                    vec2 st = materialInput.st;\n                    float dis = distance(st, vec2(0.5, 0.5));\n                    float f = 0.0;\n                    float nowAngle = getAngle(st.xy-vec2(0.5, 0.5));\n                    if(nowAngle < angle2 && nowAngle > angle1)\n                    {\n                        f = (nowAngle - angle1) / 60.0;\n                        material.alpha = f;\n                    }else if(nowAngle < 360.0 && nowAngle > angle1 && angle2 < 60.0){\n                        f = (nowAngle - angle1) / 60.0;\n                        material.alpha = f;\n                    }else if(nowAngle < angle2 && nowAngle > 0.0 && angle2 < 60.0){\n                        f = (nowAngle + 360.0 - angle1) / 60.0;\n                        material.alpha = f;\n                    }else{\n                        material.alpha = 0.0;\n                        discard;\n                    }\n                    return material;\n                }",Cesium.Material._materialCache.addMaterial(Cesium.Material.RadarScanType,{fabric:{type:Cesium.Material.RadarScanType,uniforms:{color:new Cesium.Color(1,0,0,1),time:0,angle2:0,angle1:0},source:Cesium.Material.RadarScanSource},translucent:function(e){return!0}})),new Cesium.RadarScanMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,3e3))},V.prototype.gradientColor=function(e,t,i){return new F(e,t,i)},V.prototype.xhr=function(e){var t=new XMLHttpRequest,i=!0,i=null==e.async||(null==e.async||e.async);t.open(e.type,e.url,i),t.send(e.data||{}),t.onreadystatechange=function(){4===this.readyState&&200===this.status?e.success&&"function"==typeof e.success&&e.success(e.isXml?this.responseXML:JSON.parse(this.responseText)):e.error&&"function"==typeof e.error&&e.error(t),e.complete&&"function"==typeof e.complete&&e.complete()}};var zn,k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function F(e,t,i){if(e&&t){"#"!==e[0]&&(e=this.colorHex(e)),"#"!==t[0]&&(t=this.colorHex(t));for(var e=this.colorRgb(e),o=e[0],r=e[1],n=e[2],t=this.colorRgb(t),a=(t[0]-o)/i,s=(t[1]-r)/i,l=(t[2]-n)/i,u=[],c=0;c<i;c++){var h=this.colorHex("rgb("+parseInt(a*c+o)+","+parseInt(s*c+r)+","+parseInt(l*c+n)+")");u.push(h)}return u}return this}function G(e,t){this._viewer=e,this._cesium=t,this._core=new V}function N(e,t){this._viewer=e,this._cesium=t,this._core=new V}function B(e,t){this._viewer=e,this._cesium=t}V.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":k(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},V.prototype.xml2json=function(e,u){if(!e)return{};"string"==typeof e&&(e=function(t){var i=null;if(window.DOMParser)try{let e=new DOMParser;i=e.parseFromString(t,"text/xml")}catch(e){}else{if(window.DOMParser||!window.ActiveXObject)return null;for(var e=["MSXML2.DOMDocument","Microsoft.XMLDOM"],o=0;o<e.length;o++)try{(i=new ActiveXObject(e[o])).async=!1,i.loadXML(t);break}catch(e){continue}}return i}(e));var c=this;function h(e){return String(e||"").replace(/-/g,"Core")}function m(e){return(e=!Array.isArray(e)?[e]:e).length=e.length,e}if(e.nodeType){if(3==e.nodeType||4==e.nodeType)return e.nodeValue;var t=function n(i,e){if(!i)return null;var a="",s=null,o=null;if(i.nodeType,h(i.localName||i.nodeName),i.text||i.nodeValue,i.childNodes&&0<i.childNodes.length&&i.childNodes.forEach((e,t)=>{var i=e.nodeType,o=h(e.localName||e.nodeName),r=e.text||e.nodeValue||"";8==i||(3!=i&&4!=i&&o?(s=s||{})[o]?(s[o].length||(s[o]=m(s[o])),s[o]=m(s[o]),s[o][s[o].length]=n(e,!0),s[o].length=s[o].length):s[o]=n(e):r.match(/^\s+$/)||(a+=r.replace(/^\s+/,"").replace(/\s+$/,"")))}),i.attributes&&0<i.attributes.length){o={},s=s||{};for(let e=0,t;e<i.attributes.length;e++){t=i.attributes[e];var r=h("@"+t.name),l=t.value;o[r]=l,s[r]?(s[cnn]=m(s[cnn]),s[r][s[r].length]=l,s[r].length=s[r].length):s[r]=l}}s&&(s=c.extend(""!=a?new String(a):{},s||{}),(a=s.text?[s.text||""].concat([a]):a)&&(s.text=a),a="");var t=s||a;return u&&((a=(t=a?{}:t).text||a||"")&&(t.text=a),e||(t=m(t))),t}(9==e.nodeType?e.documentElement:e,!0);e=null;return t}},F.prototype.colorRgb=function(e){if((e=e.toLowerCase())&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)){if(4===e.length){for(var t="#",i=1;i<4;i+=1)t+=e.slice(i,i+1).concat(e.slice(i,i+1));e=t}for(var o=[],i=1;i<7;i+=2)o.push(parseInt("0x"+e.slice(i,i+2)));return o}return e},F.prototype.colorHex=function(e){if(/^(rgb|RGB)/.test(e)){for(var t=e.replace(/(rgb|RGB)*/g,"").replace("(","").replace(")","").split(","),i="#",o=0;o<t.length;o++){var r=Number(t[o]).toString(16);"0"===(r=1===r.length?"0"+r:r)&&(r+=r),i+=r}return i=7!==i.length?e:i}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e))return e;var n=e.replace(/#/,"").split("");if(6===n.length)return e;if(3===n.length){for(var a="#",o=0;o<n.length;o+=1)a+=n[o]+n[o];return a}},V.prototype.getBrowser=function(){var e=navigator.userAgent.toLowerCase(),t=(e.match(/firefox|chrome|safari|opera/g)||"other")[0];(e.match(/msie|trident/g)||[])[0]&&(t="msie");var i,o="",r="",o="ontouchstart"in window||-1!==e.indexOf("touch")||-1!==e.indexOf("mobile")?-1!==e.indexOf("ipad")?"pad":-1!==e.indexOf("mobile")?"mobile":-1!==e.indexOf("android")?"androidPad":"pc":"pc";switch(t){case"chrome":case"safari":case"mobile":r="webkit";break;case"msie":r="ms";break;case"firefox":r="Moz";break;case"opera":r="O";break;default:r="webkit"}return i=0<e.indexOf("android")?"android":navigator.platform.toLowerCase(),{version:(e.match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],plat:i,type:t,pc:o,prefix:r,isMobile:"pc"!=o}},G.prototype.VectorColorTransformation=function(e,t){var i=e;return i&&"["==i.toString().charAt(0)&&"]"==i.toString().charAt(i.length-1)&&(e=styleOption.fillColor.replace(/\[/,"").replace(/\]/,""),i=t.properties[e]),this._core.isnull(i)||(this._core.isHtmlColor(i)?i=this.colorFromHtmlColor(i):null!=(i=/^rgb/.test(i)?this.rgbaStringToRgbaObj(i):i).r?(1<i.r&&(i.r=i.r/255),1<i.g&&(i.g=i.g/255),1<i.b&&(i.b=i.b/255),1<i.a&&(i.a=i.a/255),i=this.createColor(i.r,i.g,i.b,i.a)):null!=i.red&&(1<i.red&&(i.red=i.red/255),1<i.green&&(i.green=i.green/255),1<i.blue&&(i.blue=i.blue/255),1<i.alpha&&(i.alpha=i.alpha/255),i=this.createColor(i.red,i.green,i.blue,i.alpha))),i},G.prototype.createColorTransformation=function(e){return e=!(this._core.isnull(e)||"["==e.toString().charAt(0)&&"]"==e.toString().charAt(e.length-1))?this._core.isHtmlColor(e)?this.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this.createColor(e.r,e.g,e.b,e.a)):e},G.prototype.createColor=function(e,t,i,o){return new this._cesium.Color(e,t,i,o)},G.prototype.colorFromHtmlColor=function(e){if("object"==typeof e)return e.color||void 0;if(e=e.toLowerCase(),/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e)){if(4==e.length){for(var t="#",i=1;i<4;i+=1)t+=e.slice(i,i+1).concat(e.slice(i,i+1));e=t}for(var o=[],i=1;i<7;i+=2)o.push(parseInt("0x"+e.slice(i,i+2)));if(9!=e.length)return this.createColor(o[0]/255,o[1]/255,o[2]/255,1);var r=parseInt(e.substr(7,2))/100;return this.createColor(o[0]/255,o[1]/255,o[2]/255,r)}console.log("不是有效的html颜色",e)},G.prototype.toHtmlColor=function(e){e=e.split(",");return"#"+((1<<24)+(parseInt(e[0].split("(")[1])<<16)+(parseInt(e[1])<<8)+parseInt(e[2].split(")")[0])).toString(16).slice(1)},G.prototype.rgbaStringToRgbaObj=function(e){var t;return/^rgb/.test(e)&&(t=(e=(e=(e=e.replace(/rgba\(/g,"")).replace(/rgb\(/g,"")).replace(/\)/g,"")).split(","),e={},3==t.length?(e.r=parseFloat(t[0]),e.g=parseFloat(t[1]),e.b=parseFloat(t[2]),e.a=1):4==t.length&&(e.r=parseFloat(t[0]),e.g=parseFloat(t[1]),e.b=parseFloat(t[2]),e.a=parseFloat(t[3]))),e},G.prototype.CreateColor=function(e,t,i,o){return new this._cesium.Color(e,t,i,o)},N.prototype.createElevationContour=function(e,t,i){var o=this;o.item={};var r=this._core.defaultValue(i.min,-414),n=o._core.defaultValue(i.max,8844);o.item.selectedShading=t;var a,e=e,s=o._viewer.scene.globe;return e?("elevation"===t?(a=new o._cesium.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1}),o.item.shadingUniforms=a.materials.elevationRampMaterial.uniforms,o.item.shadingUniforms.minimumHeight=r,o.item.shadingUniforms.maximumHeight=n,o.item.contourUniforms=a.materials.contourMaterial.uniforms):"slope"===t?(a=new o._cesium.Material({fabric:{type:"SlopeColorContour",materials:{contourMaterial:{type:"ElevationContour"},slopeRampMaterial:{type:"SlopeRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, slopeRampMaterial.alpha)"}},translucent:!1}),o.item.shadingUniforms=a.materials.slopeRampMaterial.uniforms,o.item.contourUniforms=a.materials.contourMaterial.uniforms):"aspect"===t?(a=new o._cesium.Material({fabric:{type:"AspectColorContour",materials:{contourMaterial:{type:"ElevationContour"},aspectRampMaterial:{type:"AspectRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, aspectRampMaterial.alpha)"}},translucent:!1}),o.item.shadingUniforms=a.materials.aspectRampMaterial.uniforms,o.item.contourUniforms=a.materials.contourMaterial.uniforms):(a=o._cesium.Material.fromType("ElevationContour"),o.item.contourUniforms=a.uniforms),o.item.contourUniforms.width=o._core.defaultValue(i.width,2),o.item.contourUniforms.spacing=o._core.defaultValue(i.spacing,150),o.item.contourUniforms.color=o._cesium.Color.fromCssColorString(o._core.defaultValue(i.lineColor,"#ff0000"))):"elevation"===t?(a=o._cesium.Material.fromType("ElevationRamp"),o.item.shadingUniforms=a.uniforms,o.item.shadingUniforms.minimumHeight=r,o.item.shadingUniforms.maximumHeight=n):"slope"===t?(a=o._cesium.Material.fromType("SlopeRamp"),o.item.shadingUniforms=a.uniforms):"aspect"===t&&(a=o._cesium.Material.fromType("AspectRamp"),o.item.shadingUniforms=a.uniforms),"none"!==t&&(o.item.shadingUniforms.image=i?o._core.getColorRamp(t,i.colorArr,i.min,i.max):o._core.getColorRamp(t)),s.material=void 0,o._viewer.render(),s.material=a,o.item.material=s.material,this},N.prototype.executeMaterial=function(e){var t=this;t.item={};t.item.selectedShading=e,t.item.shadingUniforms={};var i,e=this._viewer.scene.globe;return"elevation"===t.item.selectedShading?(i=this._cesium.Material.fromType("ElevationRamp"),t.item.shadingUniforms=i.uniforms,t.item.shadingUniforms.minHeight=-414,t.item.shadingUniforms.maxHeight=8777):"slope"===t.item.selectedShading?(i=this._cesium.Material.fromType("SlopeRamp"),t.item.shadingUniforms=i.uniforms):"aspect"===t.item.selectedShading&&(i=this._cesium.Material.fromType("AspectRamp"),t.item.shadingUniforms=i.uniforms),"none"!==t.item.selectedShading&&(t.item.shadingUniforms.image=this._core.getColorRamp(t.item.selectedShading)),e.material=i,t.item.material=e.material,this},N.prototype.setSpacing=function(e){try{this.item.contourUniforms.spacing=parseFloat(e)}catch(e){console.log(e)}return this},N.prototype.setMaterialColor=function(e){try{this.item.contourUniforms.color=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},N.prototype.setWidth=function(e){try{this.item.contourUniforms.width=parseFloat(e)}catch(e){console.log(e)}return this},N.prototype.executeContourMaterial=function(e){var t=this;t.item={};t.item.selectedShading=e;var i,e=t._viewer.scene.globe;return"elevation"===t.item.selectedShading?(i=new this._cesium.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1}),t.item.shadingUniforms=i.materials.elevationRampMaterial.uniforms,t.item.shadingUniforms.minHeight=-414,t.item.shadingUniforms.maxHeight=8777,t.item.contourUniforms=i.materials.contourMaterial.uniforms):"slope"===t.item.selectedShading?(i=getSlopeContourMaterial(),t.item.shadingUniforms=i.materials.slopeRampMaterial.uniforms,t.item.contourUniforms=i.materials.contourMaterial.uniforms):"aspect"===t.item.selectedShading?(i=getAspectContourMaterial(),t.item.shadingUniforms=i.materials.aspectRampMaterial.uniforms,t.item.contourUniforms=i.materials.contourMaterial.uniforms):(i=this._cesium.Material.fromType("ElevationContour"),t.item.contourUniforms=i.uniforms),"none"!==t.item.selectedShading&&(t.item.shadingUniforms.image=this._core.getColorRamp(t.item.selectedShading)),t.item.contourUniforms.width=2,t.item.contourUniforms.spacing=150,t.item.contourUniforms.color=this._cesium.Color.fromRandom({alpha:1},this._cesium.Color.RED.clone()),e.material=i,t.item.material=e.material,this},Object.defineProperties(N.prototype,{elevation:{get:function(){return this.item},set:function(e){this.item=e}}}),B.prototype.createTerrainProfile=function(e){for(var t=[],i=0;i<e.length;i++){var o=this._cesium.Ellipsoid.WGS84.cartesianToCartographic(e[i]);t.push(o.height)}return t};var Un="Expected a function",Wn="__lodash_hash_undefined__",Yn="__lodash_placeholder__",qn=128,Qn=9007199254740991,Jn=NaN,Xn=4294967295,Kn=[["ary",qn],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],$n="[object Arguments]",Zn="[object Array]",ea="[object Boolean]",ta="[object Date]",ia="[object Error]",oa="[object Function]",ra="[object GeneratorFunction]",na="[object Map]",aa="[object Number]",sa="[object Object]",la="[object Promise]",ua="[object RegExp]",ca="[object Set]",ha="[object String]",ma="[object Symbol]",da="[object WeakMap]",pa="[object ArrayBuffer]",ga="[object DataView]",_a="[object Float32Array]",fa="[object Float64Array]",ya="[object Int8Array]",va="[object Int16Array]",Ca="[object Int32Array]",wa="[object Uint8Array]",ba="[object Uint8ClampedArray]",Ta="[object Uint16Array]",Sa="[object Uint32Array]",Pa=/\b__p \+= '';/g,Ea=/\b(__p \+=) '' \+/g,xa=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ia=/&(?:amp|lt|gt|quot|#39);/g,Da=/[&<>"']/g,La=RegExp(Ia.source),Ma=RegExp(Da.source),Aa=/<%-([\s\S]+?)%>/g,Ra=/<%([\s\S]+?)%>/g,Oa=/<%=([\s\S]+?)%>/g,Ha=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Va=/^\w*$/,ka=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Fa=/[\\^$.*+?()[\]{}|]/g,Ga=RegExp(Fa.source),Na=/^\s+/,j=/\s/,Ba=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ja=/\{\n\/\* \[wrapped with (.+)\] \*/,za=/,? & /,Ua=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Wa=/[()=,{}\[\]\/\s]/,Ya=/\\(\\)?/g,qa=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Qa=/\w*$/,Ja=/^[-+]0x[0-9a-f]+$/i,Xa=/^0b[01]+$/i,Ka=/^\[object .+?Constructor\]$/,$a=/^0o[0-7]+$/i,Za=/^(?:0|[1-9]\d*)$/,es=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ts=/($^)/,is=/['\n\r\u2028\u2029\\]/g,z="\\ud800-\\udfff",U="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",W="\\u2700-\\u27bf",Y="a-z\\xdf-\\xf6\\xf8-\\xff",q="A-Z\\xc0-\\xd6\\xd8-\\xde",Q="\\ufe0e\\ufe0f",J="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",X="['’]",K="["+z+"]",Z="["+J+"]",ee="["+U+"]",te="\\d+",ie="["+W+"]",oe="["+Y+"]",re="[^"+z+J+te+W+Y+q+"]",ne="\\ud83c[\\udffb-\\udfff]",ae="[^"+z+"]",se="(?:\\ud83c[\\udde6-\\uddff]){2}",le="[\\ud800-\\udbff][\\udc00-\\udfff]",ue="["+q+"]",ce="\\u200d",he="(?:"+oe+"|"+re+")",J="(?:"+ue+"|"+re+")",W="(?:['’](?:d|ll|m|re|s|t|ve))?",Y="(?:['’](?:D|LL|M|RE|S|T|VE))?",q="(?:"+ee+"|"+ne+")"+"?",re="["+Q+"]?",q=re+q+("(?:"+ce+"(?:"+[ae,se,le].join("|")+")"+re+q+")*"),ie="(?:"+[ie,se,le].join("|")+")"+q,K="(?:"+[ae+ee+"?",ee,se,le,K].join("|")+")",os=RegExp(X,"g"),rs=RegExp(ee,"g"),me=RegExp(ne+"(?="+ne+")|"+K+q,"g"),ns=RegExp([ue+"?"+oe+"+"+W+"(?="+[Z,ue,"$"].join("|")+")",J+"+"+Y+"(?="+[Z,ue+he,"$"].join("|")+")",ue+"?"+he+"+"+W,ue+"+"+Y,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",te,ie].join("|"),"g"),de=RegExp("["+ce+z+U+Q+"]"),as=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ss=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ls=-1,us={};us[_a]=us[fa]=us[ya]=us[va]=us[Ca]=us[wa]=us[ba]=us[Ta]=us[Sa]=!0,us[$n]=us[Zn]=us[pa]=us[ea]=us[ga]=us[ta]=us[ia]=us[oa]=us[na]=us[aa]=us[sa]=us[ua]=us[ca]=us[ha]=us[da]=!1;var cs={};cs[$n]=cs[Zn]=cs[pa]=cs[ga]=cs[ea]=cs[ta]=cs[_a]=cs[fa]=cs[ya]=cs[va]=cs[Ca]=cs[na]=cs[aa]=cs[sa]=cs[ua]=cs[ca]=cs[ha]=cs[ma]=cs[wa]=cs[ba]=cs[Ta]=cs[Sa]=!0,cs[ia]=cs[oa]=cs[da]=!1;var pe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},hs=parseFloat,ms=parseInt,U="object"==typeof global&&global&&global.Object===Object&&global,Q="object"==typeof self&&self&&self.Object===Object&&self,ds=U||Q||Function("return this")(),Q="object"==typeof o&&o&&!o.nodeType&&o,ge=Q&&"object"==typeof module&&module&&!module.nodeType&&module,gs=ge&&ge.exports===Q,_e=gs&&U.process,Q=function(){try{var e=ge&&ge.require&&ge.require("util").types;return e?e:_e&&_e.binding&&_e.binding("util")}catch(e){}}(),_s=Q&&Q.isArrayBuffer,fs=Q&&Q.isDate,ys=Q&&Q.isMap,vs=Q&&Q.isRegExp,Cs=Q&&Q.isSet,ws=Q&&Q.isTypedArray;function bs(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}function Ts(e,t,i,o){for(var r=-1,n=null==e?0:e.length;++r<n;){var a=e[r];t(o,a,i(a),e)}return o}function Ss(e,t){for(var i=-1,o=null==e?0:e.length;++i<o&&!1!==t(e[i],i,e););return e}function Ps(e,t){for(var i=null==e?0:e.length;i--&&!1!==t(e[i],i,e););return e}function Es(e,t){for(var i=-1,o=null==e?0:e.length;++i<o;)if(!t(e[i],i,e))return!1;return!0}function xs(e,t){for(var i=-1,o=null==e?0:e.length,r=0,n=[];++i<o;){var a=e[i];t(a,i,e)&&(n[r++]=a)}return n}function Is(e,t){return!!(null==e?0:e.length)&&-1<ks(e,t,0)}function Ds(e,t,i){for(var o=-1,r=null==e?0:e.length;++o<r;)if(i(t,e[o]))return!0;return!1}function Ls(e,t){for(var i=-1,o=null==e?0:e.length,r=Array(o);++i<o;)r[i]=t(e[i],i,e);return r}function Ms(e,t){for(var i=-1,o=t.length,r=e.length;++i<o;)e[r+i]=t[i];return e}function As(e,t,i,o){var r=-1,n=null==e?0:e.length;for(o&&n&&(i=e[++r]);++r<n;)i=t(i,e[r],r,e);return i}function Rs(e,t,i,o){var r=null==e?0:e.length;for(o&&r&&(i=e[--r]);r--;)i=t(i,e[r],r,e);return i}function Os(e,t){for(var i=-1,o=null==e?0:e.length;++i<o;)if(t(e[i],i,e))return!0;return!1}var fe=Bs("length");function Hs(e,o,t){var r;return t(e,function(e,t,i){if(o(e,t,i))return r=t,!1}),r}function Vs(e,t,i,o){for(var r=e.length,n=i+(o?1:-1);o?n--:++n<r;)if(t(e[n],n,e))return n;return-1}function ks(e,t,i){return t==t?function(e,t,i){var o=i-1,r=e.length;for(;++o<r;)if(e[o]===t)return o;return-1}(e,t,i):Vs(e,Gs,i)}function Fs(e,t,i,o){for(var r=i-1,n=e.length;++r<n;)if(o(e[r],t))return r;return-1}function Gs(e){return e!=e}function Ns(e,t){var i=null==e?0:e.length;return i?zs(e,t)/i:Jn}function Bs(t){return function(e){return null==e?zn:e[t]}}function ye(t){return function(e){return null==t?zn:t[e]}}function js(e,o,r,n,t){return t(e,function(e,t,i){r=n?(n=!1,e):o(r,e,t,i)}),r}function zs(e,t){for(var i,o=-1,r=e.length;++o<r;){var n=t(e[o]);n!==zn&&(i=i===zn?n:i+n)}return i}function Us(e,t){for(var i=-1,o=Array(e);++i<e;)o[i]=t(i);return o}function Ws(e){return e&&e.slice(0,sl(e)+1).replace(Na,"")}function Ys(t){return function(e){return t(e)}}function qs(t,e){return Ls(e,function(e){return t[e]})}function Qs(e,t){return e.has(t)}function Js(e,t){for(var i=-1,o=e.length;++i<o&&-1<ks(t,e[i],0););return i}function Xs(e,t){for(var i=e.length;i--&&-1<ks(t,e[i],0););return i}var Ks=ye({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),$s=ye({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Zs(e){return"\\"+pe[e]}function el(e){return de.test(e)}function tl(e){var i=-1,o=Array(e.size);return e.forEach(function(e,t){o[++i]=[t,e]}),o}function il(t,i){return function(e){return t(i(e))}}function ol(e,t){for(var i=-1,o=e.length,r=0,n=[];++i<o;){var a=e[i];a!==t&&a!==Yn||(e[i]=Yn,n[r++]=i)}return n}function rl(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}function nl(e){return(el(e)?function(e){var t=me.lastIndex=0;for(;me.test(e);)++t;return t}:fe)(e)}function al(e){return el(e)?e.match(me)||[]:e.split("")}function sl(e){for(var t=e.length;t--&&j.test(e.charAt(t)););return t}var ll=ye({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var ve,Ce=function e(t){var T=(t=null==t?ds:_.defaults(ds.Object(),t,_.pick(ds,ss))).Array,i=t.Date,h=t.Error,m=t.Function,r=t.Math,g=t.Object,d=t.RegExp,c=t.String,y=t.TypeError,n=T.prototype,o=m.prototype,p=g.prototype,a=t["__core-js_shared__"],s=o.toString,v=p.hasOwnProperty,l=0,u=(On=/[^.]+$/.exec(a&&a.keys&&a.keys.IE_PROTO||""))?"Symbol(src)_1."+On:"",f=p.toString,C=s.call(g),w=ds._,b=d("^"+s.call(v).replace(Fa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),S=gs?t.Buffer:zn,P=t.Symbol,E=t.Uint8Array,x=S?S.allocUnsafe:zn,I=il(g.getPrototypeOf,g),D=g.create,L=p.propertyIsEnumerable,M=n.splice,A=P?P.isConcatSpreadable:zn,R=P?P.iterator:zn,O=P?P.toStringTag:zn,H=function(){try{var e=ji(g,"defineProperty");return e({},"",{}),e}catch(e){}}(),V=t.clearTimeout!==ds.clearTimeout&&t.clearTimeout,k=i&&i.now!==ds.Date.now&&i.now,F=t.setTimeout!==ds.setTimeout&&t.setTimeout,G=r.ceil,N=r.floor,B=g.getOwnPropertySymbols,j=S?S.isBuffer:zn,z=t.isFinite,U=n.join,W=il(g.keys,g),Y=r.max,q=r.min,Q=i.now,J=t.parseInt,X=r.random,K=n.reverse,$=ji(t,"DataView"),Z=ji(t,"Map"),ee=ji(t,"Promise"),te=ji(t,"Set"),ie=ji(t,"WeakMap"),oe=ji(g,"create"),re=ie&&new ie,ne={},ae=fo($),se=fo(Z),le=fo(ee),ue=fo(te),ce=fo(ie),he=P?P.prototype:zn,me=he?he.valueOf:zn,de=he?he.toString:zn;function pe(e){if(Or(e)&&!Tr(e)&&!(e instanceof ve)){if(e instanceof ye)return e;if(v.call(e,"__wrapped__"))return yo(e)}return new ye(e)}var ge=function(e){if(!Rr(e))return{};if(D)return D(e);_e.prototype=e;e=new _e;return _e.prototype=zn,e};function _e(){}function fe(){}function ye(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=zn}function ve(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Xn,this.__views__=[]}function Ce(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var o=e[t];this.set(o[0],o[1])}}function we(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var o=e[t];this.set(o[0],o[1])}}function be(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var o=e[t];this.set(o[0],o[1])}}function Te(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new be;++t<i;)this.add(e[t])}function Se(e){e=this.__data__=new we(e);this.size=e.size}function Pe(e,t){var i,o=Tr(e),r=!o&&br(e),n=!o&&!r&&xr(e),a=!o&&!r&&!n&&jr(e),s=o||r||n||a,l=s?Us(e.length,c):[],u=l.length;for(i in e)!t&&!v.call(e,i)||s&&("length"==i||n&&("offset"==i||"parent"==i)||a&&("buffer"==i||"byteLength"==i||"byteOffset"==i)||Ji(i,u))||l.push(i);return l}function Ee(e){var t=e.length;return t?e[Tt(0,t-1)]:zn}function xe(e,t){return ho(ri(e),Ve(t,0,e.length))}function Ie(e){return ho(ri(e))}function De(e,t,i){(i===zn||vr(e[t],i))&&(i!==zn||t in e)||Oe(e,t,i)}function Le(e,t,i){var o=e[t];v.call(e,t)&&vr(o,i)&&(i!==zn||t in e)||Oe(e,t,i)}function Me(e,t){for(var i=e.length;i--;)if(vr(e[i][0],t))return i;return-1}function Ae(e,o,r,n){return Be(e,function(e,t,i){o(n,e,r(e),i)}),n}function Re(e,t){return e&&ni(t,hn(t),e)}function Oe(e,t,i){"__proto__"==t&&H?H(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function He(e,t){for(var i=-1,o=t.length,r=T(o),n=null==e;++i<o;)r[i]=n?zn:an(e,t[i]);return r}function Ve(e,t,i){return e==e&&(i!==zn&&(e=e<=i?e:i),t!==zn&&(e=t<=e?e:t)),e}function ke(i,o,r,e,t,n){var a,s=1&o,l=2&o,u=4&o;if((a=r?t?r(i,e,t,n):r(i):a)!==zn)return a;if(!Rr(i))return i;var c,h,m=Tr(i);if(m){if(a=function(e){var t=e.length,i=new e.constructor(t);t&&"string"==typeof e[0]&&v.call(e,"index")&&(i.index=e.index,i.input=e.input);return i}(i),!s)return ri(i,a)}else{var d=Wi(i),e=d==oa||d==ra;if(xr(i))return $t(i,s);if(d==sa||d==$n||e&&!t){if(a=l||e?{}:qi(i),!s)return l?(e=c=i,h=(h=a)&&ni(e,mn(e),h),ni(c,Ui(c),h)):(h=Re(a,c=i),ni(c,zi(c),h))}else{if(!cs[d])return t?i:{};a=function(e,t,i){var o=e.constructor;switch(t){case pa:return Zt(e);case ea:case ta:return new o(+e);case ga:return function(e,t){t=t?Zt(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}(e,i);case _a:case fa:case ya:case va:case Ca:case wa:case ba:case Ta:case Sa:return ei(e,i);case na:return new o;case aa:case ha:return new o(e);case ua:return function(e){var t=new e.constructor(e.source,Qa.exec(e));return t.lastIndex=e.lastIndex,t}(e);case ca:return new o;case ma:return function(e){return me?g(me.call(e)):{}}(e)}}(i,d,s)}}s=(n=n||new Se).get(i);if(s)return s;n.set(i,a),Gr(i)?i.forEach(function(e){a.add(ke(e,o,r,e,i,n))}):Hr(i)&&i.forEach(function(e,t){a.set(t,ke(e,o,r,t,i,n))});var p=m?zn:(u?l?Hi:Oi:l?mn:hn)(i);return Ss(p||i,function(e,t){p&&(e=i[t=e]),Le(a,t,ke(e,o,r,t,i,n))}),a}function Fe(e,t,i){var o=i.length;if(null==e)return!o;for(e=g(e);o--;){var r=i[o],n=t[r],a=e[r];if(a===zn&&!(r in e)||!n(a))return!1}return!0}function Ge(e,t,i){if("function"!=typeof e)throw new y(Un);return so(function(){e.apply(zn,i)},t)}function Ne(e,t,i,o){var r=-1,n=Is,a=!0,s=e.length,l=[],u=t.length;if(!s)return l;i&&(t=Ls(t,Ys(i))),o?(n=Ds,a=!1):200<=t.length&&(n=Qs,a=!1,t=new Te(t));e:for(;++r<s;){var c=e[r],h=null==i?c:i(c),c=o||0!==c?c:0;if(a&&h==h){for(var m=u;m--;)if(t[m]===h)continue e;l.push(c)}else n(t,h,o)||l.push(c)}return l}pe.templateSettings={escape:Aa,evaluate:Ra,interpolate:Oa,variable:"",imports:{_:pe}},(pe.prototype=fe.prototype).constructor=pe,(ye.prototype=ge(fe.prototype)).constructor=ye,(ve.prototype=ge(fe.prototype)).constructor=ve,Ce.prototype.clear=function(){this.__data__=oe?oe(null):{},this.size=0},Ce.prototype.delete=function(e){return e=this.has(e)&&delete this.__data__[e],this.size-=e?1:0,e},Ce.prototype.get=function(e){var t=this.__data__;if(oe){var i=t[e];return i===Wn?zn:i}return v.call(t,e)?t[e]:zn},Ce.prototype.has=function(e){var t=this.__data__;return oe?t[e]!==zn:v.call(t,e)},Ce.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=oe&&t===zn?Wn:t,this},we.prototype.clear=function(){this.__data__=[],this.size=0},we.prototype.delete=function(e){var t=this.__data__;return!((e=Me(t,e))<0)&&(e==t.length-1?t.pop():M.call(t,e,1),--this.size,!0)},we.prototype.get=function(e){var t=this.__data__;return(e=Me(t,e))<0?zn:t[e][1]},we.prototype.has=function(e){return-1<Me(this.__data__,e)},we.prototype.set=function(e,t){var i=this.__data__,o=Me(i,e);return o<0?(++this.size,i.push([e,t])):i[o][1]=t,this},be.prototype.clear=function(){this.size=0,this.__data__={hash:new Ce,map:new(Z||we),string:new Ce}},be.prototype.delete=function(e){return e=Ni(this,e).delete(e),this.size-=e?1:0,e},be.prototype.get=function(e){return Ni(this,e).get(e)},be.prototype.has=function(e){return Ni(this,e).has(e)},be.prototype.set=function(e,t){var i=Ni(this,e),o=i.size;return i.set(e,t),this.size+=i.size==o?0:1,this},Te.prototype.add=Te.prototype.push=function(e){return this.__data__.set(e,Wn),this},Te.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.clear=function(){this.__data__=new we,this.size=0},Se.prototype.delete=function(e){var t=this.__data__,e=t.delete(e);return this.size=t.size,e},Se.prototype.get=function(e){return this.__data__.get(e)},Se.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.set=function(e,t){var i=this.__data__;if(i instanceof we){var o=i.__data__;if(!Z||o.length<199)return o.push([e,t]),this.size=++i.size,this;i=this.__data__=new be(o)}return i.set(e,t),this.size=i.size,this};var Be=li(Je),je=li(Xe,!0);function ze(e,o){var r=!0;return Be(e,function(e,t,i){return r=!!o(e,t,i)}),r}function Ue(e,t,i){for(var o=-1,r=e.length;++o<r;){var n,a,s=e[o],l=t(s);null!=l&&(n===zn?l==l&&!Br(l):i(l,n))&&(n=l,a=s)}return a}function We(e,o){var r=[];return Be(e,function(e,t,i){o(e,t,i)&&r.push(e)}),r}function Ye(e,t,i,o,r){var n=-1,a=e.length;for(i=i||Qi,r=r||[];++n<a;){var s=e[n];0<t&&i(s)?1<t?Ye(s,t-1,i,o,r):Ms(r,s):o||(r[r.length]=s)}return r}var qe=ui(),Qe=ui(!0);function Je(e,t){return e&&qe(e,t,hn)}function Xe(e,t){return e&&Qe(e,t,hn)}function Ke(t,e){return xs(e,function(e){return Lr(t[e])})}function $e(e,t){for(var i=0,o=(t=Qt(t,e)).length;null!=e&&i<o;)e=e[_o(t[i++])];return i&&i==o?e:zn}function Ze(e,t,i){t=t(e);return Tr(e)?t:Ms(t,i(e))}function et(e){return null==e?e===zn?"[object Undefined]":"[object Null]":O&&O in g(e)?function(e){var t=v.call(e,O),i=e[O];try{e[O]=zn;var o=!0}catch(e){}var r=f.call(e);o&&(t?e[O]=i:delete e[O]);return r}(e):f.call(e)}function tt(e,t){return t<e}function it(e,t){return null!=e&&v.call(e,t)}function ot(e,t){return null!=e&&t in g(e)}function rt(e,t,i){for(var o=i?Ds:Is,r=e[0].length,n=e.length,a=n,s=T(n),l=1/0,u=[];a--;){var c=e[a];a&&t&&(c=Ls(c,Ys(t))),l=q(c.length,l),s[a]=!i&&(t||120<=r&&120<=c.length)?new Te(a&&c):zn}var c=e[0],h=-1,m=s[0];e:for(;++h<r&&u.length<l;){var d=c[h],p=t?t(d):d,d=i||0!==d?d:0;if(!(m?Qs(m,p):o(u,p,i))){for(a=n;--a;){var g=s[a];if(!(g?Qs(g,p):o(e[a],p,i)))continue e}m&&m.push(p),u.push(d)}}return u}function nt(e,t,i){t=null==(e=ro(e,t=Qt(t,e)))?e:e[_o(Do(t))];return null==t?zn:bs(t,e,i)}function at(e){return Or(e)&&et(e)==$n}function st(e,t,i,o,r){return e===t||(null==e||null==t||!Or(e)&&!Or(t)?e!=e&&t!=t:function(e,t,i,o,r,n){var a=Tr(e),s=Tr(t),l=a?Zn:Wi(e),u=s?Zn:Wi(t),c=(l=l==$n?sa:l)==sa,s=(u=u==$n?sa:u)==sa,u=l==u;if(u&&xr(e)){if(!xr(t))return!1;c=!(a=!0)}if(u&&!c)return n=n||new Se,a||jr(e)?Ai(e,t,i,o,r,n):function(e,t,i,o,r,n,a){switch(i){case ga:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case pa:return e.byteLength==t.byteLength&&n(new E(e),new E(t))?!0:!1;case ea:case ta:case aa:return vr(+e,+t);case ia:return e.name==t.name&&e.message==t.message;case ua:case ha:return e==t+"";case na:var s=tl;case ca:var l=1&o;if(s=s||rl,e.size!=t.size&&!l)return!1;l=a.get(e);if(l)return l==t;o|=2,a.set(e,t);s=Ai(s(e),s(t),o,r,n,a);return a.delete(e),s;case ma:if(me)return me.call(e)==me.call(t)}return!1}(e,t,l,i,o,r,n);if(!(1&i)){c=c&&v.call(e,"__wrapped__"),s=s&&v.call(t,"__wrapped__");if(c||s){c=c?e.value():e,s=s?t.value():t;return n=n||new Se,r(c,s,i,o,n)}}return u&&(n=n||new Se,function(e,t,i,o,r,n){var a=1&i,s=Oi(e),l=s.length,u=Oi(t).length;if(l!=u&&!a)return!1;var c=l;for(;c--;){var h=s[c];if(!(a?h in t:v.call(t,h)))return!1}var m=n.get(e),u=n.get(t);if(m&&u)return m==t&&u==e;var d=!0;n.set(e,t),n.set(t,e);var p=a;for(;++c<l;){h=s[c];var g,_=e[h],f=t[h];if(!((g=o?a?o(f,_,h,t,e,n):o(_,f,h,e,t,n):g)===zn?_===f||r(_,f,i,o,n):g)){d=!1;break}p=p||"constructor"==h}d&&!p&&(m=e.constructor,u=t.constructor,m!=u&&"constructor"in e&&"constructor"in t&&!("function"==typeof m&&m instanceof m&&"function"==typeof u&&u instanceof u)&&(d=!1));return n.delete(e),n.delete(t),d}(e,t,i,o,r,n))}(e,t,i,o,st,r))}function lt(e,t,i,o){var r=i.length,n=r,a=!o;if(null==e)return!n;for(e=g(e);r--;){var s=i[r];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++r<n;){var l=(s=i[r])[0],u=e[l],c=s[1];if(a&&s[2]){if(u===zn&&!(l in e))return!1}else{var h,m=new Se;if(!((h=o?o(u,c,l,e,t,m):h)===zn?st(c,u,3,o,m):h))return!1}}return!0}function ut(e){return!(!Rr(e)||(t=e,u&&u in t))&&(Lr(e)?b:Ka).test(fo(e));var t}function ct(e){return"function"==typeof e?e:null==e?Hn:"object"==typeof e?Tr(e)?_t(e[0],e[1]):gt(e):Gn(e)}function ht(e){if(!eo(e))return W(e);var t,i=[];for(t in g(e))v.call(e,t)&&"constructor"!=t&&i.push(t);return i}function mt(e){if(!Rr(e))return function(e){var t=[];if(null!=e)for(var i in g(e))t.push(i);return t}(e);var t,i=eo(e),o=[];for(t in e)("constructor"!=t||!i&&v.call(e,t))&&o.push(t);return o}function dt(e,t){return e<t}function pt(e,o){var r=-1,n=Pr(e)?T(e.length):[];return Be(e,function(e,t,i){n[++r]=o(e,t,i)}),n}function gt(t){var i=Bi(t);return 1==i.length&&i[0][2]?io(i[0][0],i[0][1]):function(e){return e===t||lt(e,t,i)}}function _t(i,o){return Ki(i)&&to(o)?io(_o(i),o):function(e){var t=an(e,i);return t===zn&&t===o?sn(e,i):st(o,t,3)}}function ft(g,_,f,y,v){g!==_&&qe(_,function(e,t){var i,o,r,n,a,s,l,u,c,h,m,d,p;v=v||new Se,Rr(e)?(o=_,n=f,a=ft,s=y,l=v,m=no(i=g,r=t),d=no(o,r),(p=l.get(d))?De(i,r,p):(u=s?s(m,d,r+"",i,o,l):zn,(c=u===zn)&&(h=Tr(d),p=!h&&xr(d),o=!h&&!p&&jr(d),u=d,h||p||o?u=Tr(m)?m:Er(m)?ri(m):p?$t(d,!(c=!1)):o?ei(d,!(c=!1)):[]:kr(d)||br(d)?br(u=m)?u=Xr(m):Rr(m)&&!Lr(m)||(u=qi(d)):c=!1),c&&(l.set(d,u),a(u,d,n,s,l),l.delete(d)),De(i,r,u))):(u=y?y(no(g,t),e,t+"",g,_,v):zn,De(g,t,u=u===zn?e:u))},mn)}function yt(e,t){var i=e.length;if(i)return Ji(t+=t<0?i:0,i)?e[t]:zn}function vt(e,o,i){o=o.length?Ls(o,function(t){return Tr(t)?function(e){return $e(e,1===t.length?t[0]:t)}:t}):[Hn];var r=-1;return o=Ls(o,Ys(Gi())),function(e,t){var i=e.length;for(e.sort(t);i--;)e[i]=e[i].value;return e}(pt(e,function(t,e,i){return{criteria:Ls(o,function(e){return e(t)}),index:++r,value:t}}),function(e,t){return function(e,t,i){var o=-1,r=e.criteria,n=t.criteria,a=r.length,s=i.length;for(;++o<a;){var l=ti(r[o],n[o]);if(l){if(s<=o)return l;var u=i[o];return l*("desc"==u?-1:1)}}return e.index-t.index}(e,t,i)})}function Ct(e,t,i){for(var o=-1,r=t.length,n={};++o<r;){var a=t[o],s=$e(e,a);i(s,a)&&It(n,Qt(a,e),s)}return n}function wt(e,t,i,o){var r=o?Fs:ks,n=-1,a=t.length,s=e;for(e===t&&(t=ri(t)),i&&(s=Ls(e,Ys(i)));++n<a;)for(var l=0,u=t[n],c=i?i(u):u;-1<(l=r(s,c,l,o));)s!==e&&M.call(s,l,1),M.call(e,l,1);return e}function bt(e,t){for(var i=e?t.length:0,o=i-1;i--;){var r,n=t[i];i!=o&&n===r||(Ji(r=n)?M.call(e,n,1):Nt(e,n))}return e}function Tt(e,t){return e+N(X()*(t-e+1))}function St(e,t){var i="";if(!e||t<1||Qn<t)return i;for(;t%2&&(i+=e),(t=N(t/2))&&(e+=e),t;);return i}function Pt(e,t){return lo(oo(e,t,Hn),e+"")}function Et(e){return Ee(Cn(e))}function xt(e,t){e=Cn(e);return ho(e,Ve(t,0,e.length))}function It(e,t,i,o){if(!Rr(e))return e;for(var r=-1,n=(t=Qt(t,e)).length,a=n-1,s=e;null!=s&&++r<n;){var l,u=_o(t[r]),c=i;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;r!=a&&(l=s[u],(c=o?o(l,u,s):zn)===zn&&(c=Rr(l)?l:Ji(t[r+1])?[]:{})),Le(s,u,c),s=s[u]}return e}var Dt=re?function(e,t){return re.set(e,t),e}:Hn,Lt=H?function(e,t){return H(e,"toString",{configurable:!0,enumerable:!1,value:Rn(t),writable:!0})}:Hn;function Mt(e){return ho(Cn(e))}function At(e,t,i){var o=-1,r=e.length;(i=r<i?r:i)<0&&(i+=r),r=i<(t=t<0?r<-t?0:r+t:t)?0:i-t>>>0,t>>>=0;for(var n=T(r);++o<r;)n[o]=e[o+t];return n}function Rt(e,o){var r;return Be(e,function(e,t,i){return!(r=o(e,t,i))}),!!r}function Ot(e,t,i){var o=0,r=null==e?o:e.length;if("number"==typeof t&&t==t&&r<=2147483647){for(;o<r;){var n=o+r>>>1,a=e[n];null!==a&&!Br(a)&&(i?a<=t:a<t)?o=1+n:r=n}return r}return Ht(e,t,Hn,i)}function Ht(e,t,i,o){var r=0,n=null==e?0:e.length;if(0===n)return 0;for(var a=(t=i(t))!=t,s=null===t,l=Br(t),u=t===zn;r<n;){var c=N((r+n)/2),h=i(e[c]),m=h!==zn,d=null===h,p=h==h,g=Br(h),h=a?o||p:u?p&&(o||m):s?p&&m&&(o||!d):l?p&&m&&!d&&(o||!g):!d&&!g&&(o?h<=t:h<t);h?r=c+1:n=c}return q(n,4294967294)}function Vt(e,t){for(var i=-1,o=e.length,r=0,n=[];++i<o;){var a,s=e[i],l=t?t(s):s;i&&vr(l,a)||(a=l,n[r++]=0===s?0:s)}return n}function kt(e){return"number"==typeof e?e:Br(e)?Jn:+e}function Ft(e){if("string"==typeof e)return e;if(Tr(e))return Ls(e,Ft)+"";if(Br(e))return de?de.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Gt(e,t,i){var o=-1,r=Is,n=e.length,a=!0,s=[],l=s;if(i)a=!1,r=Ds;else if(200<=n){var u=t?null:Ei(e);if(u)return rl(u);a=!1,r=Qs,l=new Te}else l=t?[]:s;e:for(;++o<n;){var c=e[o],h=t?t(c):c,c=i||0!==c?c:0;if(a&&h==h){for(var m=l.length;m--;)if(l[m]===h)continue e;t&&l.push(h),s.push(c)}else r(l,h,i)||(l!==s&&l.push(h),s.push(c))}return s}function Nt(e,t){return null==(e=ro(e,t=Qt(t,e)))||delete e[_o(Do(t))]}function Bt(e,t,i,o){return It(e,t,i($e(e,t)),o)}function jt(e,t,i,o){for(var r=e.length,n=o?r:-1;(o?n--:++n<r)&&t(e[n],n,e););return i?At(e,o?0:n,o?n+1:r):At(e,o?n+1:0,o?r:n)}function zt(e,t){var i=e;return As(t,function(e,t){return t.func.apply(t.thisArg,Ms([e],t.args))},i=e instanceof ve?e.value():i)}function Ut(e,t,i){var o=e.length;if(o<2)return o?Gt(e[0]):[];for(var r=-1,n=T(o);++r<o;)for(var a=e[r],s=-1;++s<o;)s!=r&&(n[r]=Ne(n[r]||a,e[s],t,i));return Gt(Ye(n,1),t,i)}function Wt(e,t,i){for(var o=-1,r=e.length,n=t.length,a={};++o<r;){var s=o<n?t[o]:zn;i(a,e[o],s)}return a}function Yt(e){return Er(e)?e:[]}function qt(e){return"function"==typeof e?e:Hn}function Qt(e,t){return Tr(e)?e:Ki(e,t)?[e]:go(Kr(e))}var Jt=Pt;function Xt(e,t,i){var o=e.length;return i=i===zn?o:i,!t&&o<=i?e:At(e,t,i)}var Kt=V||function(e){return ds.clearTimeout(e)};function $t(e,t){if(t)return e.slice();t=e.length,t=x?x(t):new e.constructor(t);return e.copy(t),t}function Zt(e){var t=new e.constructor(e.byteLength);return new E(t).set(new E(e)),t}function ei(e,t){t=t?Zt(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}function ti(e,t){if(e!==t){var i=e!==zn,o=null===e,r=e==e,n=Br(e),a=t!==zn,s=null===t,l=t==t,u=Br(t);if(!s&&!u&&!n&&t<e||n&&a&&l&&!s&&!u||o&&a&&l||!i&&l||!r)return 1;if(!o&&!n&&!u&&e<t||u&&i&&r&&!o&&!n||s&&i&&r||!a&&r||!l)return-1}return 0}function ii(e,t,i,o){for(var r=-1,n=e.length,a=i.length,s=-1,l=t.length,u=Y(n-a,0),c=T(l+u),h=!o;++s<l;)c[s]=t[s];for(;++r<a;)(h||r<n)&&(c[i[r]]=e[r]);for(;u--;)c[s++]=e[r++];return c}function oi(e,t,i,o){for(var r=-1,n=e.length,a=-1,s=i.length,l=-1,u=t.length,c=Y(n-s,0),h=T(c+u),m=!o;++r<c;)h[r]=e[r];for(var d=r;++l<u;)h[d+l]=t[l];for(;++a<s;)(m||r<n)&&(h[d+i[a]]=e[r++]);return h}function ri(e,t){var i=-1,o=e.length;for(t=t||T(o);++i<o;)t[i]=e[i];return t}function ni(e,t,i,o){var r=!i;i=i||{};for(var n=-1,a=t.length;++n<a;){var s=t[n],l=o?o(i[s],e[s],s,i,e):zn;(r?Oe:Le)(i,s,l=l===zn?e[s]:l)}return i}function ai(r,n){return function(e,t){var i=Tr(e)?Ts:Ae,o=n?n():{};return i(e,r,Gi(t,2),o)}}function si(s){return Pt(function(e,t){var i=-1,o=t.length,r=1<o?t[o-1]:zn,n=2<o?t[2]:zn,r=3<s.length&&"function"==typeof r?(o--,r):zn;for(n&&Xi(t[0],t[1],n)&&(r=o<3?zn:r,o=1),e=g(e);++i<o;){var a=t[i];a&&s(e,a,i,r)}return e})}function li(n,a){return function(e,t){if(null==e)return e;if(!Pr(e))return n(e,t);for(var i=e.length,o=a?i:-1,r=g(e);(a?o--:++o<i)&&!1!==t(r[o],o,r););return e}}function ui(l){return function(e,t,i){for(var o=-1,r=g(e),n=i(e),a=n.length;a--;){var s=n[l?a:++o];if(!1===t(r[s],s,r))break}return e}}function ci(o){return function(e){var t=el(e=Kr(e))?al(e):zn,i=t?t[0]:e.charAt(0),e=t?Xt(t,1).join(""):e.slice(1);return i[o]()+e}}function hi(t){return function(e){return As(Mn(Tn(e).replace(os,"")),t,"")}}function mi(o){return function(){var e=arguments;switch(e.length){case 0:return new o;case 1:return new o(e[0]);case 2:return new o(e[0],e[1]);case 3:return new o(e[0],e[1],e[2]);case 4:return new o(e[0],e[1],e[2],e[3]);case 5:return new o(e[0],e[1],e[2],e[3],e[4]);case 6:return new o(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new o(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=ge(o.prototype),i=o.apply(t,e);return Rr(i)?i:t}}function di(n,a,s){var l=mi(n);return function e(){for(var t=arguments.length,i=T(t),o=t,r=Fi(e);o--;)i[o]=arguments[o];r=t<3&&i[0]!==r&&i[t-1]!==r?[]:ol(i,r);return(t-=r.length)<s?Si(n,a,_i,e.placeholder,zn,i,r,zn,zn,s-t):bs(this&&this!==ds&&this instanceof e?l:n,this,i)}}function pi(n){return function(e,t,i){var o,r=g(e);Pr(e)||(o=Gi(t,3),e=hn(e),t=function(e){return o(r[e],e,r)});i=n(e,t,i);return-1<i?r[o?e[i]:i]:zn}}function gi(l){return Ri(function(r){var n=r.length,e=n,t=ye.prototype.thru;for(l&&r.reverse();e--;){var i=r[e];if("function"!=typeof i)throw new y(Un);t&&!s&&"wrapper"==ki(i)&&(s=new ye([],!0))}for(e=s?e:n;++e<n;)var o=ki(i=r[e]),a="wrapper"==o?Vi(i):zn,s=a&&$i(a[0])&&424==a[1]&&!a[4].length&&1==a[9]?s[ki(a[0])].apply(s,a[3]):1==i.length&&$i(i)?s[o]():s.thru(i);return function(){var e=arguments,t=e[0];if(s&&1==e.length&&Tr(t))return s.plant(t).value();for(var i=0,o=n?r[i].apply(this,e):t;++i<n;)o=r[i].call(this,o);return o}})}function _i(s,l,u,c,h,m,d,p,g,_){var f=l&qn,y=1&l,v=2&l,C=24&l,w=512&l,b=v?zn:mi(s);return function e(){for(var t,i=T(a=arguments.length),o=a;o--;)i[o]=arguments[o];if(C&&(t=function(e,t){for(var i=e.length,o=0;i--;)e[i]===t&&++o;return o}(i,n=Fi(e))),c&&(i=ii(i,c,h,C)),m&&(i=oi(i,m,d,C)),a-=t,C&&a<_){var r=ol(i,n);return Si(s,l,_i,e.placeholder,u,i,r,p,g,_-a)}var n=y?u:this,r=v?n[s]:s,a=i.length;return p?i=function(e,t){for(var i=e.length,o=q(t.length,i),r=ri(e);o--;){var n=t[o];e[o]=Ji(n,i)?r[n]:zn}return e}(i,p):w&&1<a&&i.reverse(),f&&g<a&&(i.length=g),(r=this&&this!==ds&&this instanceof e?b||mi(r):r).apply(n,i)}}function fi(i,a){return function(e,t){return e=e,o=i,r=a(t),n={},Je(e,function(e,t,i){o(n,r(e),t,i)}),n;var o,r,n}}function yi(o,r){return function(e,t){var i;if(e===zn&&t===zn)return r;if(e!==zn&&(i=e),t!==zn){if(i===zn)return t;t="string"==typeof e||"string"==typeof t?(e=Ft(e),Ft(t)):(e=kt(e),kt(t)),i=o(e,t)}return i}}function vi(o){return Ri(function(e){return e=Ls(e,Ys(Gi())),Pt(function(t){var i=this;return o(e,function(e){return bs(e,i,t)})})})}function Ci(e,t){var i=(t=t===zn?" ":Ft(t)).length;if(i<2)return i?St(t,e):t;i=St(t,G(e/nl(t)));return el(t)?Xt(al(i),0,e).join(""):i.slice(0,e)}function wi(s,e,l,u){var c=1&e,h=mi(s);return function e(){for(var t=-1,i=arguments.length,o=-1,r=u.length,n=T(r+i),a=this&&this!==ds&&this instanceof e?h:s;++o<r;)n[o]=u[o];for(;i--;)n[o++]=arguments[++t];return bs(a,c?l:this,n)}}function bi(o){return function(e,t,i){return i&&"number"!=typeof i&&Xi(e,t,i)&&(t=i=zn),e=Yr(e),t===zn?(t=e,e=0):t=Yr(t),function(e,t,i,o){for(var r=-1,n=Y(G((t-e)/(i||1)),0),a=T(n);n--;)a[o?n:++r]=e,e+=i;return a}(e,t,i=i===zn?e<t?1:-1:Yr(i),o)}}function Ti(i){return function(e,t){return"string"==typeof e&&"string"==typeof t||(e=Jr(e),t=Jr(t)),i(e,t)}}function Si(e,t,i,o,r,n,a,s,l,u){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);u=[e,t,r,c?n:zn,c?a:zn,c?zn:n,c?zn:a,s,l,u],i=i.apply(zn,u);return $i(e)&&ao(i,u),i.placeholder=o,uo(i,e,t)}function Pi(e){var o=r[e];return function(e,t){if(e=Jr(e),(t=null==t?0:q(qr(t),292))&&z(e)){var i=(Kr(e)+"e").split("e");return+((i=(Kr(o(i[0]+"e"+(+i[1]+t)))+"e").split("e"))[0]+"e"+(+i[1]-t))}return o(e)}}var Ei=te&&1/rl(new te([,-0]))[1]==1/0?function(e){return new te(e)}:Fn;function xi(n){return function(e){var t,i,o,r=Wi(e);return r==na?tl(e):r==ca?(r=e,t=-1,i=Array(r.size),r.forEach(function(e){i[++t]=[e,e]}),i):Ls(n(o=e),function(e){return[e,o[e]]})}}function Ii(e,t,i,o,r,n,a,s){var l=2&t;if(!l&&"function"!=typeof e)throw new y(Un);var u,c,h=o?o.length:0;h||(t&=-97,o=r=zn),a=a===zn?a:Y(qr(a),0),s=s===zn?s:qr(s),h-=r?r.length:0,64&t&&(u=o,c=r,o=r=zn);var m,d,p,g,_=l?zn:Vi(e),a=[e,t,i,o,r,u,c,n,a,s];_&&function(e,t){var i=e[1],o=t[1],r=i|o,n=r<131,a=o==qn&&8==i||o==qn&&256==i&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==i;if(!n&&!a)return;1&o&&(e[2]=t[2],r|=1&i?0:4);i=t[3];{var s;i&&(s=e[3],e[3]=s?ii(s,i,t[4]):i,e[4]=s?ol(e[3],Yn):t[4])}(i=t[5])&&(s=e[5],e[5]=s?oi(s,i,t[6]):i,e[6]=s?ol(e[5],Yn):t[6]);(i=t[7])&&(e[7]=i);o&qn&&(e[8]=null==e[8]?t[8]:q(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=r}(a,_),e=a[0],t=a[1],i=a[2],o=a[3],r=a[4],!(s=a[9]=a[9]===zn?l?0:e.length:Y(a[9]-h,0))&&24&t&&(t&=-25);i=t&&1!=t?8==t||16==t?di(e,t,s):32!=t&&33!=t||r.length?_i.apply(zn,a):wi(e,t,i,o):(d=i,p=1&t,g=mi(m=e),function e(){return(this&&this!==ds&&this instanceof e?g:m).apply(p?d:this,arguments)});return uo((_?Dt:ao)(i,a),e,t)}function Di(e,t,i,o){return e===zn||vr(e,p[i])&&!v.call(o,i)?t:e}function Li(e,t,i,o,r,n){return Rr(e)&&Rr(t)&&(n.set(t,e),ft(e,t,zn,Li,n),n.delete(t)),e}function Mi(e){return kr(e)?zn:e}function Ai(e,t,i,o,r,n){var a=1&i,s=e.length,l=t.length;if(s!=l&&!(a&&s<l))return!1;var u=n.get(e),l=n.get(t);if(u&&l)return u==t&&l==e;var c=-1,h=!0,m=2&i?new Te:zn;for(n.set(e,t),n.set(t,e);++c<s;){var d,p=e[c],g=t[c];if((d=o?a?o(g,p,c,t,e,n):o(p,g,c,e,t,n):d)!==zn){if(d)continue;h=!1;break}if(m){if(!Os(t,function(e,t){return!Qs(m,t)&&(p===e||r(p,e,i,o,n))&&m.push(t)})){h=!1;break}}else if(p!==g&&!r(p,g,i,o,n)){h=!1;break}}return n.delete(e),n.delete(t),h}function Ri(e){return lo(oo(e,zn,So),e+"")}function Oi(e){return Ze(e,hn,zi)}function Hi(e){return Ze(e,mn,Ui)}var Vi=re?function(e){return re.get(e)}:Fn;function ki(e){for(var t=e.name+"",i=ne[t],o=v.call(ne,t)?i.length:0;o--;){var r=i[o],n=r.func;if(null==n||n==e)return r.name}return t}function Fi(e){return(v.call(pe,"placeholder")?pe:e).placeholder}function Gi(){var e=(e=pe.iteratee||Vn)===Vn?ct:e;return arguments.length?e(arguments[0],arguments[1]):e}function Ni(e,t){var i,o=e.__data__;return("string"==(e=typeof(i=t))||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==i:null===i)?o["string"==typeof t?"string":"hash"]:o.map}function Bi(e){for(var t=hn(e),i=t.length;i--;){var o=t[i],r=e[o];t[i]=[o,r,to(r)]}return t}function ji(e,t){t=t,t=null==(e=e)?zn:e[t];return ut(t)?t:zn}var zi=B?function(t){return null==t?[]:(t=g(t),xs(B(t),function(e){return L.call(t,e)}))}:Nn,Ui=B?function(e){for(var t=[];e;)Ms(t,zi(e)),e=I(e);return t}:Nn,Wi=et;function Yi(e,t,i){for(var o=-1,r=(t=Qt(t,e)).length,n=!1;++o<r;){var a=_o(t[o]);if(!(n=null!=e&&i(e,a)))break;e=e[a]}return n||++o!=r?n:!!(r=null==e?0:e.length)&&Ar(r)&&Ji(a,r)&&(Tr(e)||br(e))}function qi(e){return"function"!=typeof e.constructor||eo(e)?{}:ge(I(e))}function Qi(e){return Tr(e)||br(e)||!!(A&&e&&e[A])}function Ji(e,t){var i=typeof e;return!!(t=null==t?Qn:t)&&("number"==i||"symbol"!=i&&Za.test(e))&&-1<e&&e%1==0&&e<t}function Xi(e,t,i){if(Rr(i)){var o=typeof t;return("number"==o?Pr(i)&&Ji(t,i.length):"string"==o&&t in i)&&vr(i[t],e)}}function Ki(e,t){if(!Tr(e)){var i=typeof e;return"number"==i||"symbol"==i||"boolean"==i||null==e||Br(e)||(Va.test(e)||!Ha.test(e)||null!=t&&e in g(t))}}function $i(e){var t=ki(e),i=pe[t];if("function"==typeof i&&t in ve.prototype){if(e===i)return 1;i=Vi(i);return i&&e===i[0]}}($&&Wi(new $(new ArrayBuffer(1)))!=ga||Z&&Wi(new Z)!=na||ee&&Wi(ee.resolve())!=la||te&&Wi(new te)!=ca||ie&&Wi(new ie)!=da)&&(Wi=function(e){var t=et(e),e=t==sa?e.constructor:zn,e=e?fo(e):"";if(e)switch(e){case ae:return ga;case se:return na;case le:return la;case ue:return ca;case ce:return da}return t});var Zi=a?Lr:Bn;function eo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||p)}function to(e){return e==e&&!Rr(e)}function io(t,i){return function(e){return null!=e&&(e[t]===i&&(i!==zn||t in g(e)))}}function oo(n,a,s){return a=Y(a===zn?n.length-1:a,0),function(){for(var e=arguments,t=-1,i=Y(e.length-a,0),o=T(i);++t<i;)o[t]=e[a+t];for(var t=-1,r=T(a+1);++t<a;)r[t]=e[t];return r[a]=s(o),bs(n,this,r)}}function ro(e,t){return t.length<2?e:$e(e,At(t,0,-1))}function no(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ao=co(Dt),so=F||function(e,t){return ds.setTimeout(e,t)},lo=co(Lt);function uo(e,t,i){var o,r,t=t+"";return lo(e,function(e,t){var i=t.length;if(!i)return e;var o=i-1;return t[o]=(1<i?"& ":"")+t[o],t=t.join(2<i?", ":" "),e.replace(Ba,"{\n/* [wrapped with "+t+"] */\n")}(t,(o=(t=(t=t).match(ja))?t[1].split(za):[],r=i,Ss(Kn,function(e){var t="_."+e[0];r&e[1]&&!Is(o,t)&&o.push(t)}),o.sort())))}function co(i){var o=0,r=0;return function(){var e=Q(),t=16-(e-r);if(r=e,0<t){if(800<=++o)return arguments[0]}else o=0;return i.apply(zn,arguments)}}function ho(e,t){var i=-1,o=e.length,r=o-1;for(t=t===zn?o:t;++i<t;){var n=Tt(i,r),a=e[n];e[n]=e[i],e[i]=a}return e.length=t,e}var mo,po,go=(po=(mo=dr(mo=function(e){var r=[];return 46===e.charCodeAt(0)&&r.push(""),e.replace(ka,function(e,t,i,o){r.push(i?o.replace(Ya,"$1"):t||e)}),r},function(e){return 500===po.size&&po.clear(),e})).cache,mo);function _o(e){if("string"==typeof e||Br(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function fo(e){if(null!=e){try{return s.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function yo(e){if(e instanceof ve)return e.clone();var t=new ye(e.__wrapped__,e.__chain__);return t.__actions__=ri(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var vo=Pt(function(e,t){return Er(e)?Ne(e,Ye(t,1,Er,!0)):[]}),Co=Pt(function(e,t){var i=Do(t);return Er(i)&&(i=zn),Er(e)?Ne(e,Ye(t,1,Er,!0),Gi(i,2)):[]}),wo=Pt(function(e,t){var i=Do(t);return Er(i)&&(i=zn),Er(e)?Ne(e,Ye(t,1,Er,!0),zn,i):[]});function bo(e,t,i){var o=null==e?0:e.length;if(!o)return-1;i=null==i?0:qr(i);return i<0&&(i=Y(o+i,0)),Vs(e,Gi(t,3),i)}function To(e,t,i){var o=null==e?0:e.length;if(!o)return-1;var r=o-1;return i!==zn&&(r=qr(i),r=i<0?Y(o+r,0):q(r,o-1)),Vs(e,Gi(t,3),r,!0)}function So(e){return(null==e?0:e.length)?Ye(e,1):[]}function Po(e){return e&&e.length?e[0]:zn}var Eo=Pt(function(e){var t=Ls(e,Yt);return t.length&&t[0]===e[0]?rt(t):[]}),xo=Pt(function(e){var t=Do(e),i=Ls(e,Yt);return t===Do(i)?t=zn:i.pop(),i.length&&i[0]===e[0]?rt(i,Gi(t,2)):[]}),Io=Pt(function(e){var t=Do(e),i=Ls(e,Yt);return(t="function"==typeof t?t:zn)&&i.pop(),i.length&&i[0]===e[0]?rt(i,zn,t):[]});function Do(e){var t=null==e?0:e.length;return t?e[t-1]:zn}var Lo=Pt(Mo);function Mo(e,t){return e&&e.length&&t&&t.length?wt(e,t):e}var Ao=Ri(function(e,t){var i=null==e?0:e.length,o=He(e,t);return bt(e,Ls(t,function(e){return Ji(e,i)?+e:e}).sort(ti)),o});function Ro(e){return null==e?e:K.call(e)}var Oo=Pt(function(e){return Gt(Ye(e,1,Er,!0))}),Ho=Pt(function(e){var t=Do(e);return Er(t)&&(t=zn),Gt(Ye(e,1,Er,!0),Gi(t,2))}),Vo=Pt(function(e){var t="function"==typeof(t=Do(e))?t:zn;return Gt(Ye(e,1,Er,!0),zn,t)});function ko(t){if(!t||!t.length)return[];var i=0;return t=xs(t,function(e){return Er(e)&&(i=Y(e.length,i),1)}),Us(i,function(e){return Ls(t,Bs(e))})}function Fo(e,t){if(!e||!e.length)return[];e=ko(e);return null==t?e:Ls(e,function(e){return bs(t,zn,e)})}var Go=Pt(function(e,t){return Er(e)?Ne(e,t):[]}),No=Pt(function(e){return Ut(xs(e,Er))}),Bo=Pt(function(e){var t=Do(e);return Er(t)&&(t=zn),Ut(xs(e,Er),Gi(t,2))}),jo=Pt(function(e){var t="function"==typeof(t=Do(e))?t:zn;return Ut(xs(e,Er),zn,t)}),zo=Pt(ko);var Uo=Pt(function(e){var t=e.length,t="function"==typeof(t=1<t?e[t-1]:zn)?(e.pop(),t):zn;return Fo(e,t)});function Wo(e){e=pe(e);return e.__chain__=!0,e}function Yo(e,t){return t(e)}var qo=Ri(function(t){function e(e){return He(e,t)}var i=t.length,o=i?t[0]:0,r=this.__wrapped__;return!(1<i||this.__actions__.length)&&r instanceof ve&&Ji(o)?((r=r.slice(o,+o+(i?1:0))).__actions__.push({func:Yo,args:[e],thisArg:zn}),new ye(r,this.__chain__).thru(function(e){return i&&!e.length&&e.push(zn),e})):this.thru(e)});var Qo=ai(function(e,t,i){v.call(e,i)?++e[i]:Oe(e,i,1)});var Jo=pi(bo),Xo=pi(To);function Ko(e,t){return(Tr(e)?Ss:Be)(e,Gi(t,3))}function $o(e,t){return(Tr(e)?Ps:je)(e,Gi(t,3))}var Zo=ai(function(e,t,i){v.call(e,i)?e[i].push(t):Oe(e,i,[t])});var er=Pt(function(e,t,i){var o=-1,r="function"==typeof t,n=Pr(e)?T(e.length):[];return Be(e,function(e){n[++o]=r?bs(t,e,i):nt(e,t,i)}),n}),tr=ai(function(e,t,i){Oe(e,i,t)});function ir(e,t){return(Tr(e)?Ls:pt)(e,Gi(t,3))}var or=ai(function(e,t,i){e[i?0:1].push(t)},function(){return[[],[]]});var rr=Pt(function(e,t){if(null==e)return[];var i=t.length;return 1<i&&Xi(e,t[0],t[1])?t=[]:2<i&&Xi(t[0],t[1],t[2])&&(t=[t[0]]),vt(e,Ye(t,1),[])}),nr=k||function(){return ds.Date.now()};function ar(e,t,i){return t=i?zn:t,t=e&&null==t?e.length:t,Ii(e,qn,zn,zn,zn,zn,t)}function sr(e,t){var i;if("function"!=typeof t)throw new y(Un);return e=qr(e),function(){return 0<--e&&(i=t.apply(this,arguments)),e<=1&&(t=zn),i}}var lr=Pt(function(e,t,i){var o,r=1;return i.length&&(o=ol(i,Fi(lr)),r|=32),Ii(e,r,t,i,o)}),ur=Pt(function(e,t,i){var o,r=3;return i.length&&(o=ol(i,Fi(ur)),r|=32),Ii(t,r,e,i,o)});function cr(o,i,e){var r,n,a,s,l,u,c=0,h=!1,m=!1,t=!0;if("function"!=typeof o)throw new y(Un);function d(e){var t=r,i=n;return r=n=zn,c=e,s=o.apply(i,t)}function p(e){var t=e-u;return u===zn||i<=t||t<0||m&&a<=e-c}function g(){var e,t=nr();if(p(t))return _(t);l=so(g,(t=i-((e=t)-u),m?q(t,a-(e-c)):t))}function _(e){return l=zn,t&&r?d(e):(r=n=zn,s)}function f(){var e=nr(),t=p(e);if(r=arguments,n=this,u=e,t){if(l===zn)return c=t=u,l=so(g,i),h?d(t):s;if(m)return Kt(l),l=so(g,i),d(u)}return l===zn&&(l=so(g,i)),s}return i=Jr(i)||0,Rr(e)&&(h=!!e.leading,m="maxWait"in e,a=m?Y(Jr(e.maxWait)||0,i):a,t="trailing"in e?!!e.trailing:t),f.cancel=function(){l!==zn&&Kt(l),c=0,r=u=n=l=zn},f.flush=function(){return l===zn?s:_(nr())},f}var hr=Pt(function(e,t){return Ge(e,1,t)}),mr=Pt(function(e,t,i){return Ge(e,Jr(t)||0,i)});function dr(o,r){if("function"!=typeof o||null!=r&&"function"!=typeof r)throw new y(Un);function n(){var e=arguments,t=r?r.apply(this,e):e[0],i=n.cache;return i.has(t)?i.get(t):(e=o.apply(this,e),n.cache=i.set(t,e)||i,e)}return n.cache=new(dr.Cache||be),n}function pr(t){if("function"!=typeof t)throw new y(Un);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}dr.Cache=be;var gr=Jt(function(o,r){var n=(r=1==r.length&&Tr(r[0])?Ls(r[0],Ys(Gi())):Ls(Ye(r,1),Ys(Gi()))).length;return Pt(function(e){for(var t=-1,i=q(e.length,n);++t<i;)e[t]=r[t].call(this,e[t]);return bs(o,this,e)})}),_r=Pt(function(e,t){var i=ol(t,Fi(_r));return Ii(e,32,zn,t,i)}),fr=Pt(function(e,t){var i=ol(t,Fi(fr));return Ii(e,64,zn,t,i)}),yr=Ri(function(e,t){return Ii(e,256,zn,zn,zn,t)});function vr(e,t){return e===t||e!=e&&t!=t}var Cr=Ti(tt),wr=Ti(function(e,t){return t<=e}),br=at(function(){return arguments}())?at:function(e){return Or(e)&&v.call(e,"callee")&&!L.call(e,"callee")},Tr=T.isArray,Sr=_s?Ys(_s):function(e){return Or(e)&&et(e)==pa};function Pr(e){return null!=e&&Ar(e.length)&&!Lr(e)}function Er(e){return Or(e)&&Pr(e)}var xr=j||Bn,Ir=fs?Ys(fs):function(e){return Or(e)&&et(e)==ta};function Dr(e){if(!Or(e))return!1;var t=et(e);return t==ia||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!kr(e)}function Lr(e){if(!Rr(e))return!1;e=et(e);return e==oa||e==ra||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Mr(e){return"number"==typeof e&&e==qr(e)}function Ar(e){return"number"==typeof e&&-1<e&&e%1==0&&e<=Qn}function Rr(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Or(e){return null!=e&&"object"==typeof e}var Hr=ys?Ys(ys):function(e){return Or(e)&&Wi(e)==na};function Vr(e){return"number"==typeof e||Or(e)&&et(e)==aa}function kr(e){if(!Or(e)||et(e)!=sa)return!1;e=I(e);if(null===e)return!0;e=v.call(e,"constructor")&&e.constructor;return"function"==typeof e&&e instanceof e&&s.call(e)==C}var Fr=vs?Ys(vs):function(e){return Or(e)&&et(e)==ua};var Gr=Cs?Ys(Cs):function(e){return Or(e)&&Wi(e)==ca};function Nr(e){return"string"==typeof e||!Tr(e)&&Or(e)&&et(e)==ha}function Br(e){return"symbol"==typeof e||Or(e)&&et(e)==ma}var jr=ws?Ys(ws):function(e){return Or(e)&&Ar(e.length)&&!!us[et(e)]};var zr=Ti(dt),Ur=Ti(function(e,t){return e<=t});function Wr(e){if(!e)return[];if(Pr(e))return(Nr(e)?al:ri)(e);if(R&&e[R])return function(e){for(var t,i=[];!(t=e.next()).done;)i.push(t.value);return i}(e[R]());var t=Wi(e);return(t==na?tl:t==ca?rl:Cn)(e)}function Yr(e){return e?(e=Jr(e))!==1/0&&e!==-1/0?e==e?e:0:17976931348623157e292*(e<0?-1:1):0===e?e:0}function qr(e){var t=Yr(e),e=t%1;return t==t?e?t-e:t:0}function Qr(e){return e?Ve(qr(e),0,Xn):0}function Jr(e){if("number"==typeof e)return e;if(Br(e))return Jn;if("string"!=typeof(e=Rr(e)?Rr(t="function"==typeof e.valueOf?e.valueOf():e)?t+"":t:e))return 0===e?e:+e;e=Ws(e);var t=Xa.test(e);return t||$a.test(e)?ms(e.slice(2),t?2:8):Ja.test(e)?Jn:+e}function Xr(e){return ni(e,mn(e))}function Kr(e){return null==e?"":Ft(e)}var $r=si(function(e,t){if(eo(t)||Pr(t))ni(t,hn(t),e);else for(var i in t)v.call(t,i)&&Le(e,i,t[i])}),Zr=si(function(e,t){ni(t,mn(t),e)}),en=si(function(e,t,i,o){ni(t,mn(t),e,o)}),tn=si(function(e,t,i,o){ni(t,hn(t),e,o)}),on=Ri(He);var rn=Pt(function(e,t){e=g(e);var i=-1,o=t.length,r=2<o?t[2]:zn;for(r&&Xi(t[0],t[1],r)&&(o=1);++i<o;)for(var n=t[i],a=mn(n),s=-1,l=a.length;++s<l;){var u=a[s],c=e[u];(c===zn||vr(c,p[u])&&!v.call(e,u))&&(e[u]=n[u])}return e}),nn=Pt(function(e){return e.push(zn,Li),bs(pn,zn,e)});function an(e,t,i){t=null==e?zn:$e(e,t);return t===zn?i:t}function sn(e,t){return null!=e&&Yi(e,t,ot)}var ln=fi(function(e,t,i){e[t=null!=t&&"function"!=typeof t.toString?f.call(t):t]=i},Rn(Hn)),un=fi(function(e,t,i){null!=t&&"function"!=typeof t.toString&&(t=f.call(t)),v.call(e,t)?e[t].push(i):e[t]=[i]},Gi),cn=Pt(nt);function hn(e){return(Pr(e)?Pe:ht)(e)}function mn(e){return Pr(e)?Pe(e,!0):mt(e)}var dn=si(function(e,t,i){ft(e,t,i)}),pn=si(function(e,t,i,o){ft(e,t,i,o)}),gn=Ri(function(t,e){var i={};if(null==t)return i;var o=!1;e=Ls(e,function(e){return e=Qt(e,t),o=o||1<e.length,e}),ni(t,Hi(t),i),o&&(i=ke(i,7,Mi));for(var r=e.length;r--;)Nt(i,e[r]);return i});var _n=Ri(function(e,t){return null==e?{}:Ct(i=e,t,function(e,t){return sn(i,t)});var i});function fn(e,i){if(null==e)return{};var t=Ls(Hi(e),function(e){return[e]});return i=Gi(i),Ct(e,t,function(e,t){return i(e,t[0])})}var yn=xi(hn),vn=xi(mn);function Cn(e){return null==e?[]:qs(e,hn(e))}var wn=hi(function(e,t,i){return t=t.toLowerCase(),e+(i?bn(t):t)});function bn(e){return Ln(Kr(e).toLowerCase())}function Tn(e){return(e=Kr(e))&&e.replace(es,Ks).replace(rs,"")}var Sn=hi(function(e,t,i){return e+(i?"-":"")+t.toLowerCase()}),Pn=hi(function(e,t,i){return e+(i?" ":"")+t.toLowerCase()}),En=ci("toLowerCase");var xn=hi(function(e,t,i){return e+(i?"_":"")+t.toLowerCase()});var In=hi(function(e,t,i){return e+(i?" ":"")+Ln(t)});var Dn=hi(function(e,t,i){return e+(i?" ":"")+t.toUpperCase()}),Ln=ci("toUpperCase");function Mn(e,t,i){return e=Kr(e),(t=i?zn:t)===zn?(i=e,as.test(i)?e.match(ns)||[]:e.match(Ua)||[]):e.match(t)||[]}var An=Pt(function(e,t){try{return bs(e,zn,t)}catch(e){return Dr(e)?e:new h(e)}}),o=Ri(function(t,e){return Ss(e,function(e){e=_o(e),Oe(t,e,lr(t[e],t))}),t});function Rn(e){return function(){return e}}var On=gi(),S=gi(!0);function Hn(e){return e}function Vn(e){return ct("function"==typeof e?e:ke(e,1))}i=Pt(function(t,i){return function(e){return nt(e,t,i)}}),t=Pt(function(t,i){return function(e){return nt(t,e,i)}});function kn(o,t,e){var i=hn(t),r=Ke(t,i);null!=e||Rr(t)&&(r.length||!i.length)||(e=t,t=o,o=this,r=Ke(t,hn(t)));var n=!(Rr(e)&&"chain"in e&&!e.chain),a=Lr(o);return Ss(r,function(e){var i=t[e];o[e]=i,a&&(o.prototype[e]=function(){var e=this.__chain__;if(n||e){var t=o(this.__wrapped__);return(t.__actions__=ri(this.__actions__)).push({func:i,args:arguments,thisArg:o}),t.__chain__=e,t}return i.apply(o,Ms([this.value()],arguments))})}),o}function Fn(){}P=vi(Ls),he=vi(Es),V=vi(Os);function Gn(e){return Ki(e)?Bs(_o(e)):(t=e,function(e){return $e(e,t)});var t}$=bi(),ee=bi(!0);function Nn(){return[]}function Bn(){return!1}ie=yi(function(e,t){return e+t},0),a=Pi("ceil"),F=yi(function(e,t){return e/t},1),Lt=Pi("floor");var jn,k=yi(function(e,t){return e*t},1),Jt=Pi("round"),j=yi(function(e,t){return e-t},0);return pe.after=function(e,t){if("function"!=typeof t)throw new y(Un);return e=qr(e),function(){if(--e<1)return t.apply(this,arguments)}},pe.ary=ar,pe.assign=$r,pe.assignIn=Zr,pe.assignInWith=en,pe.assignWith=tn,pe.at=on,pe.before=sr,pe.bind=lr,pe.bindAll=o,pe.bindKey=ur,pe.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Tr(e)?e:[e]},pe.chain=Wo,pe.chunk=function(e,t,i){t=(i?Xi(e,t,i):t===zn)?1:Y(qr(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var r=0,n=0,a=T(G(o/t));r<o;)a[n++]=At(e,r,r+=t);return a},pe.compact=function(e){for(var t=-1,i=null==e?0:e.length,o=0,r=[];++t<i;){var n=e[t];n&&(r[o++]=n)}return r},pe.concat=function(){var e=arguments.length;if(!e)return[];for(var t=T(e-1),i=arguments[0],o=e;o--;)t[o-1]=arguments[o];return Ms(Tr(i)?ri(i):[i],Ye(t,1))},pe.cond=function(o){var r=null==o?0:o.length,t=Gi();return o=r?Ls(o,function(e){if("function"!=typeof e[1])throw new y(Un);return[t(e[0]),e[1]]}):[],Pt(function(e){for(var t=-1;++t<r;){var i=o[t];if(bs(i[0],this,e))return bs(i[1],this,e)}})},pe.conforms=function(e){return t=ke(e,1),i=hn(t),function(e){return Fe(e,t,i)};var t,i},pe.constant=Rn,pe.countBy=Qo,pe.create=function(e,t){return e=ge(e),null==t?e:Re(e,t)},pe.curry=function e(t,i,o){i=Ii(t,8,zn,zn,zn,zn,zn,i=o?zn:i);return i.placeholder=e.placeholder,i},pe.curryRight=function e(t,i,o){i=Ii(t,16,zn,zn,zn,zn,zn,i=o?zn:i);return i.placeholder=e.placeholder,i},pe.debounce=cr,pe.defaults=rn,pe.defaultsDeep=nn,pe.defer=hr,pe.delay=mr,pe.difference=vo,pe.differenceBy=Co,pe.differenceWith=wo,pe.drop=function(e,t,i){var o=null==e?0:e.length;return o?At(e,(t=i||t===zn?1:qr(t))<0?0:t,o):[]},pe.dropRight=function(e,t,i){var o=null==e?0:e.length;return o?At(e,0,(t=o-(t=i||t===zn?1:qr(t)))<0?0:t):[]},pe.dropRightWhile=function(e,t){return e&&e.length?jt(e,Gi(t,3),!0,!0):[]},pe.dropWhile=function(e,t){return e&&e.length?jt(e,Gi(t,3),!0):[]},pe.fill=function(e,t,i,o){var r=null==e?0:e.length;return r?(i&&"number"!=typeof i&&Xi(e,t,i)&&(i=0,o=r),function(e,t,i,o){var r=e.length;for((i=qr(i))<0&&(i=r<-i?0:r+i),(o=o===zn||r<o?r:qr(o))<0&&(o+=r),o=o<i?0:Qr(o);i<o;)e[i++]=t;return e}(e,t,i,o)):[]},pe.filter=function(e,t){return(Tr(e)?xs:We)(e,Gi(t,3))},pe.flatMap=function(e,t){return Ye(ir(e,t),1)},pe.flatMapDeep=function(e,t){return Ye(ir(e,t),1/0)},pe.flatMapDepth=function(e,t,i){return i=i===zn?1:qr(i),Ye(ir(e,t),i)},pe.flatten=So,pe.flattenDeep=function(e){return(null==e?0:e.length)?Ye(e,1/0):[]},pe.flattenDepth=function(e,t){return(null==e?0:e.length)?Ye(e,t=t===zn?1:qr(t)):[]},pe.flip=function(e){return Ii(e,512)},pe.flow=On,pe.flowRight=S,pe.fromPairs=function(e){for(var t=-1,i=null==e?0:e.length,o={};++t<i;){var r=e[t];o[r[0]]=r[1]}return o},pe.functions=function(e){return null==e?[]:Ke(e,hn(e))},pe.functionsIn=function(e){return null==e?[]:Ke(e,mn(e))},pe.groupBy=Zo,pe.initial=function(e){return(null==e?0:e.length)?At(e,0,-1):[]},pe.intersection=Eo,pe.intersectionBy=xo,pe.intersectionWith=Io,pe.invert=ln,pe.invertBy=un,pe.invokeMap=er,pe.iteratee=Vn,pe.keyBy=tr,pe.keys=hn,pe.keysIn=mn,pe.map=ir,pe.mapKeys=function(e,o){var r={};return o=Gi(o,3),Je(e,function(e,t,i){Oe(r,o(e,t,i),e)}),r},pe.mapValues=function(e,o){var r={};return o=Gi(o,3),Je(e,function(e,t,i){Oe(r,t,o(e,t,i))}),r},pe.matches=function(e){return gt(ke(e,1))},pe.matchesProperty=function(e,t){return _t(e,ke(t,1))},pe.memoize=dr,pe.merge=dn,pe.mergeWith=pn,pe.method=i,pe.methodOf=t,pe.mixin=kn,pe.negate=pr,pe.nthArg=function(t){return t=qr(t),Pt(function(e){return yt(e,t)})},pe.omit=gn,pe.omitBy=function(e,t){return fn(e,pr(Gi(t)))},pe.once=function(e){return sr(2,e)},pe.orderBy=function(e,t,i,o){return null==e?[]:vt(e,t=!Tr(t)?null==t?[]:[t]:t,i=!Tr(i=o?zn:i)?null==i?[]:[i]:i)},pe.over=P,pe.overArgs=gr,pe.overEvery=he,pe.overSome=V,pe.partial=_r,pe.partialRight=fr,pe.partition=or,pe.pick=_n,pe.pickBy=fn,pe.property=Gn,pe.propertyOf=function(t){return function(e){return null==t?zn:$e(t,e)}},pe.pull=Lo,pe.pullAll=Mo,pe.pullAllBy=function(e,t,i){return e&&e.length&&t&&t.length?wt(e,t,Gi(i,2)):e},pe.pullAllWith=function(e,t,i){return e&&e.length&&t&&t.length?wt(e,t,zn,i):e},pe.pullAt=Ao,pe.range=$,pe.rangeRight=ee,pe.rearg=yr,pe.reject=function(e,t){return(Tr(e)?xs:We)(e,pr(Gi(t,3)))},pe.remove=function(e,t){var i=[];if(!e||!e.length)return i;var o=-1,r=[],n=e.length;for(t=Gi(t,3);++o<n;){var a=e[o];t(a,o,e)&&(i.push(a),r.push(o))}return bt(e,r),i},pe.rest=function(e,t){if("function"!=typeof e)throw new y(Un);return Pt(e,t=t===zn?t:qr(t))},pe.reverse=Ro,pe.sampleSize=function(e,t,i){return t=(i?Xi(e,t,i):t===zn)?1:qr(t),(Tr(e)?xe:xt)(e,t)},pe.set=function(e,t,i){return null==e?e:It(e,t,i)},pe.setWith=function(e,t,i,o){return o="function"==typeof o?o:zn,null==e?e:It(e,t,i,o)},pe.shuffle=function(e){return(Tr(e)?Ie:Mt)(e)},pe.slice=function(e,t,i){var o=null==e?0:e.length;return o?(i=i&&"number"!=typeof i&&Xi(e,t,i)?(t=0,o):(t=null==t?0:qr(t),i===zn?o:qr(i)),At(e,t,i)):[]},pe.sortBy=rr,pe.sortedUniq=function(e){return e&&e.length?Vt(e):[]},pe.sortedUniqBy=function(e,t){return e&&e.length?Vt(e,Gi(t,2)):[]},pe.split=function(e,t,i){return i&&"number"!=typeof i&&Xi(e,t,i)&&(t=i=zn),(i=i===zn?Xn:i>>>0)?(e=Kr(e))&&("string"==typeof t||null!=t&&!Fr(t))&&!(t=Ft(t))&&el(e)?Xt(al(e),0,i):e.split(t,i):[]},pe.spread=function(i,o){if("function"!=typeof i)throw new y(Un);return o=null==o?0:Y(qr(o),0),Pt(function(e){var t=e[o],e=Xt(e,0,o);return t&&Ms(e,t),bs(i,this,e)})},pe.tail=function(e){var t=null==e?0:e.length;return t?At(e,1,t):[]},pe.take=function(e,t,i){return e&&e.length?At(e,0,(t=i||t===zn?1:qr(t))<0?0:t):[]},pe.takeRight=function(e,t,i){var o=null==e?0:e.length;return o?At(e,(t=o-(t=i||t===zn?1:qr(t)))<0?0:t,o):[]},pe.takeRightWhile=function(e,t){return e&&e.length?jt(e,Gi(t,3),!1,!0):[]},pe.takeWhile=function(e,t){return e&&e.length?jt(e,Gi(t,3)):[]},pe.tap=function(e,t){return t(e),e},pe.throttle=function(e,t,i){var o=!0,r=!0;if("function"!=typeof e)throw new y(Un);return Rr(i)&&(o="leading"in i?!!i.leading:o,r="trailing"in i?!!i.trailing:r),cr(e,t,{leading:o,maxWait:t,trailing:r})},pe.thru=Yo,pe.toArray=Wr,pe.toPairs=yn,pe.toPairsIn=vn,pe.toPath=function(e){return Tr(e)?Ls(e,_o):Br(e)?[e]:ri(go(Kr(e)))},pe.toPlainObject=Xr,pe.transform=function(e,o,r){var t,i=Tr(e),n=i||xr(e)||jr(e);return o=Gi(o,4),null==r&&(t=e&&e.constructor,r=n?i?new t:[]:Rr(e)&&Lr(t)?ge(I(e)):{}),(n?Ss:Je)(e,function(e,t,i){return o(r,e,t,i)}),r},pe.unary=function(e){return ar(e,1)},pe.union=Oo,pe.unionBy=Ho,pe.unionWith=Vo,pe.uniq=function(e){return e&&e.length?Gt(e):[]},pe.uniqBy=function(e,t){return e&&e.length?Gt(e,Gi(t,2)):[]},pe.uniqWith=function(e,t){return t="function"==typeof t?t:zn,e&&e.length?Gt(e,zn,t):[]},pe.unset=function(e,t){return null==e||Nt(e,t)},pe.unzip=ko,pe.unzipWith=Fo,pe.update=function(e,t,i){return null==e?e:Bt(e,t,qt(i))},pe.updateWith=function(e,t,i,o){return o="function"==typeof o?o:zn,null==e?e:Bt(e,t,qt(i),o)},pe.values=Cn,pe.valuesIn=function(e){return null==e?[]:qs(e,mn(e))},pe.without=Go,pe.words=Mn,pe.wrap=function(e,t){return _r(qt(t),e)},pe.xor=No,pe.xorBy=Bo,pe.xorWith=jo,pe.zip=zo,pe.zipObject=function(e,t){return Wt(e||[],t||[],Le)},pe.zipObjectDeep=function(e,t){return Wt(e||[],t||[],It)},pe.zipWith=Uo,pe.entries=yn,pe.entriesIn=vn,pe.extend=Zr,pe.extendWith=en,kn(pe,pe),pe.add=ie,pe.attempt=An,pe.camelCase=wn,pe.capitalize=bn,pe.ceil=a,pe.clamp=function(e,t,i){return i===zn&&(i=t,t=zn),i!==zn&&(i=(i=Jr(i))==i?i:0),t!==zn&&(t=(t=Jr(t))==t?t:0),Ve(Jr(e),t,i)},pe.clone=function(e){return ke(e,4)},pe.cloneDeep=function(e){return ke(e,5)},pe.cloneDeepWith=function(e,t){return ke(e,5,t="function"==typeof t?t:zn)},pe.cloneWith=function(e,t){return ke(e,4,t="function"==typeof t?t:zn)},pe.conformsTo=function(e,t){return null==t||Fe(e,t,hn(t))},pe.deburr=Tn,pe.defaultTo=function(e,t){return null==e||e!=e?t:e},pe.divide=F,pe.endsWith=function(e,t,i){e=Kr(e),t=Ft(t);var o=e.length,o=i=i===zn?o:Ve(qr(i),0,o);return 0<=(i-=t.length)&&e.slice(i,o)==t},pe.eq=vr,pe.escape=function(e){return(e=Kr(e))&&Ma.test(e)?e.replace(Da,$s):e},pe.escapeRegExp=function(e){return(e=Kr(e))&&Ga.test(e)?e.replace(Fa,"\\$&"):e},pe.every=function(e,t,i){return(Tr(e)?Es:ze)(e,Gi(t=i&&Xi(e,t,i)?zn:t,3))},pe.find=Jo,pe.findIndex=bo,pe.findKey=function(e,t){return Hs(e,Gi(t,3),Je)},pe.findLast=Xo,pe.findLastIndex=To,pe.findLastKey=function(e,t){return Hs(e,Gi(t,3),Xe)},pe.floor=Lt,pe.forEach=Ko,pe.forEachRight=$o,pe.forIn=function(e,t){return null==e?e:qe(e,Gi(t,3),mn)},pe.forInRight=function(e,t){return null==e?e:Qe(e,Gi(t,3),mn)},pe.forOwn=function(e,t){return e&&Je(e,Gi(t,3))},pe.forOwnRight=function(e,t){return e&&Xe(e,Gi(t,3))},pe.get=an,pe.gt=Cr,pe.gte=wr,pe.has=function(e,t){return null!=e&&Yi(e,t,it)},pe.hasIn=sn,pe.head=Po,pe.identity=Hn,pe.includes=function(e,t,i,o){return e=Pr(e)?e:Cn(e),i=i&&!o?qr(i):0,o=e.length,i<0&&(i=Y(o+i,0)),Nr(e)?i<=o&&-1<e.indexOf(t,i):!!o&&-1<ks(e,t,i)},pe.indexOf=function(e,t,i){var o=null==e?0:e.length;return o?(i=null==i?0:qr(i),ks(e,t,i=i<0?Y(o+i,0):i)):-1},pe.inRange=function(e,t,i){return t=Yr(t),i===zn?(i=t,t=0):i=Yr(i),(e=e=Jr(e))>=q(t=t,i=i)&&e<Y(t,i)},pe.invoke=cn,pe.isArguments=br,pe.isArray=Tr,pe.isArrayBuffer=Sr,pe.isArrayLike=Pr,pe.isArrayLikeObject=Er,pe.isBoolean=function(e){return!0===e||!1===e||Or(e)&&et(e)==ea},pe.isBuffer=xr,pe.isDate=Ir,pe.isElement=function(e){return Or(e)&&1===e.nodeType&&!kr(e)},pe.isEmpty=function(e){if(null==e)return!0;if(Pr(e)&&(Tr(e)||"string"==typeof e||"function"==typeof e.splice||xr(e)||jr(e)||br(e)))return!e.length;var t,i=Wi(e);if(i==na||i==ca)return!e.size;if(eo(e))return!ht(e).length;for(t in e)if(v.call(e,t))return!1;return!0},pe.isEqual=function(e,t){return st(e,t)},pe.isEqualWith=function(e,t,i){var o=(i="function"==typeof i?i:zn)?i(e,t):zn;return o===zn?st(e,t,zn,i):!!o},pe.isError=Dr,pe.isFinite=function(e){return"number"==typeof e&&z(e)},pe.isFunction=Lr,pe.isInteger=Mr,pe.isLength=Ar,pe.isMap=Hr,pe.isMatch=function(e,t){return e===t||lt(e,t,Bi(t))},pe.isMatchWith=function(e,t,i){return i="function"==typeof i?i:zn,lt(e,t,Bi(t),i)},pe.isNaN=function(e){return Vr(e)&&e!=+e},pe.isNative=function(e){if(Zi(e))throw new h("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return ut(e)},pe.isNil=function(e){return null==e},pe.isNull=function(e){return null===e},pe.isNumber=Vr,pe.isObject=Rr,pe.isObjectLike=Or,pe.isPlainObject=kr,pe.isRegExp=Fr,pe.isSafeInteger=function(e){return Mr(e)&&-Qn<=e&&e<=Qn},pe.isSet=Gr,pe.isString=Nr,pe.isSymbol=Br,pe.isTypedArray=jr,pe.isUndefined=function(e){return e===zn},pe.isWeakMap=function(e){return Or(e)&&Wi(e)==da},pe.isWeakSet=function(e){return Or(e)&&"[object WeakSet]"==et(e)},pe.join=function(e,t){return null==e?"":U.call(e,t)},pe.kebabCase=Sn,pe.last=Do,pe.lastIndexOf=function(e,t,i){var o=null==e?0:e.length;if(!o)return-1;var r=o;return i!==zn&&(r=(r=qr(i))<0?Y(o+r,0):q(r,o-1)),t==t?function(e,t,i){for(var o=i+1;o--;)if(e[o]===t)return o;return o}(e,t,r):Vs(e,Gs,r,!0)},pe.lowerCase=Pn,pe.lowerFirst=En,pe.lt=zr,pe.lte=Ur,pe.max=function(e){return e&&e.length?Ue(e,Hn,tt):zn},pe.maxBy=function(e,t){return e&&e.length?Ue(e,Gi(t,2),tt):zn},pe.mean=function(e){return Ns(e,Hn)},pe.meanBy=function(e,t){return Ns(e,Gi(t,2))},pe.min=function(e){return e&&e.length?Ue(e,Hn,dt):zn},pe.minBy=function(e,t){return e&&e.length?Ue(e,Gi(t,2),dt):zn},pe.stubArray=Nn,pe.stubFalse=Bn,pe.stubObject=function(){return{}},pe.stubString=function(){return""},pe.stubTrue=function(){return!0},pe.multiply=k,pe.nth=function(e,t){return e&&e.length?yt(e,qr(t)):zn},pe.noConflict=function(){return ds._===this&&(ds._=w),this},pe.noop=Fn,pe.now=nr,pe.pad=function(e,t,i){e=Kr(e);var o=(t=qr(t))?nl(e):0;return!t||t<=o?e:Ci(N(o=(t-o)/2),i)+e+Ci(G(o),i)},pe.padEnd=function(e,t,i){e=Kr(e);var o=(t=qr(t))?nl(e):0;return t&&o<t?e+Ci(t-o,i):e},pe.padStart=function(e,t,i){e=Kr(e);var o=(t=qr(t))?nl(e):0;return t&&o<t?Ci(t-o,i)+e:e},pe.parseInt=function(e,t,i){return t=i||null==t?0:t&&+t,J(Kr(e).replace(Na,""),t||0)},pe.random=function(e,t,i){var o;if(i&&"boolean"!=typeof i&&Xi(e,t,i)&&(t=i=zn),i===zn&&("boolean"==typeof t?(i=t,t=zn):"boolean"==typeof e&&(i=e,e=zn)),e===zn&&t===zn?(e=0,t=1):(e=Yr(e),t===zn?(t=e,e=0):t=Yr(t)),t<e&&(o=e,e=t,t=o),i||e%1||t%1){i=X();return q(e+i*(t-e+hs("1e-"+((i+"").length-1))),t)}return Tt(e,t)},pe.reduce=function(e,t,i){var o=Tr(e)?As:js,r=arguments.length<3;return o(e,Gi(t,4),i,r,Be)},pe.reduceRight=function(e,t,i){var o=Tr(e)?Rs:js,r=arguments.length<3;return o(e,Gi(t,4),i,r,je)},pe.repeat=function(e,t,i){return t=(i?Xi(e,t,i):t===zn)?1:qr(t),St(Kr(e),t)},pe.replace=function(){var e=arguments,t=Kr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},pe.result=function(e,t,i){var o=-1,r=(t=Qt(t,e)).length;for(r||(r=1,e=zn);++o<r;){var n=null==e?zn:e[_o(t[o])];n===zn&&(o=r,n=i),e=Lr(n)?n.call(e):n}return e},pe.round=Jt,pe.runInContext=e,pe.sample=function(e){return(Tr(e)?Ee:Et)(e)},pe.size=function(e){if(null==e)return 0;if(Pr(e))return Nr(e)?nl(e):e.length;var t=Wi(e);return t==na||t==ca?e.size:ht(e).length},pe.snakeCase=xn,pe.some=function(e,t,i){return(Tr(e)?Os:Rt)(e,Gi(t=i&&Xi(e,t,i)?zn:t,3))},pe.sortedIndex=function(e,t){return Ot(e,t)},pe.sortedIndexBy=function(e,t,i){return Ht(e,t,Gi(i,2))},pe.sortedIndexOf=function(e,t){var i=null==e?0:e.length;if(i){var o=Ot(e,t);if(o<i&&vr(e[o],t))return o}return-1},pe.sortedLastIndex=function(e,t){return Ot(e,t,!0)},pe.sortedLastIndexBy=function(e,t,i){return Ht(e,t,Gi(i,2),!0)},pe.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var i=Ot(e,t,!0)-1;if(vr(e[i],t))return i}return-1},pe.startCase=In,pe.startsWith=function(e,t,i){return e=Kr(e),i=null==i?0:Ve(qr(i),0,e.length),t=Ft(t),e.slice(i,i+t.length)==t},pe.subtract=j,pe.sum=function(e){return e&&e.length?zs(e,Hn):0},pe.sumBy=function(e,t){return e&&e.length?zs(e,Gi(t,2)):0},pe.template=function(a,e,t){var i=pe.templateSettings;t&&Xi(a,e,t)&&(e=zn),a=Kr(a),e=en({},e,i,Di);var s,l,o=hn(i=en({},e.imports,i.imports,Di)),r=qs(i,o),u=0,i=e.interpolate||ts,c="__p += '",i=d((e.escape||ts).source+"|"+i.source+"|"+(i===Oa?qa:ts).source+"|"+(e.evaluate||ts).source+"|$","g"),n="//# sourceURL="+(v.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ls+"]")+"\n";if(a.replace(i,function(e,t,i,o,r,n){return i=i||o,c+=a.slice(u,n).replace(is,Zs),t&&(s=!0,c+="' +\n__e("+t+") +\n'"),r&&(l=!0,c+="';\n"+r+";\n__p += '"),i&&(c+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),u=n+e.length,e}),c+="';\n",e=v.call(e,"variable")&&e.variable){if(Wa.test(e))throw new h("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";if(c=(l?c.replace(Pa,""):c).replace(Ea,"$1").replace(xa,"$1;"),c="function("+(e||"obj")+") {\n"+(e?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(l?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}",(e=An(function(){return m(o,n+"return "+c).apply(zn,r)})).source=c,Dr(e))throw e;return e},pe.times=function(e,t){if((e=qr(e))<1||Qn<e)return[];var i=Xn,o=q(e,Xn);for(t=Gi(t),e-=Xn,o=Us(o,t);++i<e;)t(i);return o},pe.toFinite=Yr,pe.toInteger=qr,pe.toLength=Qr,pe.toLower=function(e){return Kr(e).toLowerCase()},pe.toNumber=Jr,pe.toSafeInteger=function(e){return e?Ve(qr(e),-Qn,Qn):0===e?e:0},pe.toString=Kr,pe.toUpper=function(e){return Kr(e).toUpperCase()},pe.trim=function(e,t,i){return(e=Kr(e))&&(i||t===zn)?Ws(e):e&&(t=Ft(t))?(e=al(e),t=al(t),Xt(e,Js(e,t),Xs(e,t)+1).join("")):e},pe.trimEnd=function(e,t,i){return(e=Kr(e))&&(i||t===zn)?e.slice(0,sl(e)+1):e&&(t=Ft(t))?Xt(e=al(e),0,Xs(e,al(t))+1).join(""):e},pe.trimStart=function(e,t,i){return(e=Kr(e))&&(i||t===zn)?e.replace(Na,""):e&&(t=Ft(t))?Xt(e=al(e),Js(e,al(t))).join(""):e},pe.truncate=function(e,t){var i,o=30,r="...";Rr(t)&&(i="separator"in t?t.separator:i,o="length"in t?qr(t.length):o,r="omission"in t?Ft(t.omission):r);var n,t=(e=Kr(e)).length;if((t=el(e)?(n=al(e)).length:t)<=o)return e;if((t=o-nl(r))<1)return r;if(o=n?Xt(n,0,t).join(""):e.slice(0,t),i===zn)return o+r;if(n&&(t+=o.length-t),Fr(i)){if(e.slice(t).search(i)){var a,s=o;for((i=!i.global?d(i.source,Kr(Qa.exec(i))+"g"):i).lastIndex=0;a=i.exec(s);)var l=a.index;o=o.slice(0,l===zn?t:l)}}else e.indexOf(Ft(i),t)==t||-1<(t=o.lastIndexOf(i))&&(o=o.slice(0,t));return o+r},pe.unescape=function(e){return(e=Kr(e))&&La.test(e)?e.replace(Ia,ll):e},pe.uniqueId=function(e){var t=++l;return Kr(e)+t},pe.upperCase=Dn,pe.upperFirst=Ln,pe.each=Ko,pe.eachRight=$o,pe.first=Po,kn(pe,(jn={},Je(pe,function(e,t){v.call(pe.prototype,t)||(jn[t]=e)}),jn),{chain:!1}),pe.VERSION="4.17.21",Ss(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){pe[e].placeholder=pe}),Ss(["drop","take"],function(i,o){ve.prototype[i]=function(e){e=e===zn?1:Y(qr(e),0);var t=this.__filtered__&&!o?new ve(this):this.clone();return t.__filtered__?t.__takeCount__=q(e,t.__takeCount__):t.__views__.push({size:q(e,Xn),type:i+(t.__dir__<0?"Right":"")}),t},ve.prototype[i+"Right"]=function(e){return this.reverse()[i](e).reverse()}}),Ss(["filter","map","takeWhile"],function(e,t){var i=t+1,o=1==i||3==i;ve.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Gi(e,3),type:i}),t.__filtered__=t.__filtered__||o,t}}),Ss(["head","last"],function(e,t){var i="take"+(t?"Right":"");ve.prototype[e]=function(){return this[i](1).value()[0]}}),Ss(["initial","tail"],function(e,t){var i="drop"+(t?"":"Right");ve.prototype[e]=function(){return this.__filtered__?new ve(this):this[i](1)}}),ve.prototype.compact=function(){return this.filter(Hn)},ve.prototype.find=function(e){return this.filter(e).head()},ve.prototype.findLast=function(e){return this.reverse().find(e)},ve.prototype.invokeMap=Pt(function(t,i){return"function"==typeof t?new ve(this):this.map(function(e){return nt(e,t,i)})}),ve.prototype.reject=function(e){return this.filter(pr(Gi(e)))},ve.prototype.slice=function(e,t){e=qr(e);var i=this;return i.__filtered__&&(0<e||t<0)?new ve(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==zn?(t=qr(t))<0?i.dropRight(-t):i.take(t-e):i)},ve.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ve.prototype.toArray=function(){return this.take(Xn)},Je(ve.prototype,function(u,e){var c=/^(?:filter|find|map|reject)|While$/.test(e),h=/^(?:head|last)$/.test(e),m=pe[h?"take"+("last"==e?"Right":""):e],d=h||/^find/.test(e);m&&(pe.prototype[e]=function(){function e(e){return e=m.apply(pe,Ms([e],i)),h&&a?e[0]:e}var t=this.__wrapped__,i=h?[1]:arguments,o=t instanceof ve,r=i[0],n=o||Tr(t);n&&c&&"function"==typeof r&&1!=r.length&&(o=n=!1);var a=this.__chain__,s=!!this.__actions__.length,r=d&&!a,s=o&&!s;if(d||!n)return r&&s?u.apply(this,i):(l=this.thru(e),r?h?l.value()[0]:l.value():l);var t=s?t:new ve(this),l=u.apply(t,i);return l.__actions__.push({func:Yo,args:[e],thisArg:zn}),new ye(l,a)})}),Ss(["pop","push","shift","sort","splice","unshift"],function(e){var i=n[e],o=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);pe.prototype[e]=function(){var t=arguments;if(!r||this.__chain__)return this[o](function(e){return i.apply(Tr(e)?e:[],t)});var e=this.value();return i.apply(Tr(e)?e:[],t)}}),Je(ve.prototype,function(e,t){var i,o=pe[t];o&&(i=o.name+"",v.call(ne,i)||(ne[i]=[]),ne[i].push({name:t,func:o}))}),ne[_i(zn,2).name]=[{name:"wrapper",func:zn}],ve.prototype.clone=function(){var e=new ve(this.__wrapped__);return e.__actions__=ri(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ri(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ri(this.__views__),e},ve.prototype.reverse=function(){var e;return this.__filtered__?((e=new ve(this)).__dir__=-1,e.__filtered__=!0):(e=this.clone()).__dir__*=-1,e},ve.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,i=Tr(e),o=t<0,r=i?e.length:0,n=function(e,t,i){var o=-1,r=i.length;for(;++o<r;){var n=i[o],a=n.size;switch(n.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=q(t,e+a);break;case"takeRight":e=Y(e,t-a)}}return{start:e,end:t}}(0,r,this.__views__),a=n.start,s=(n=n.end)-a,l=o?n:a-1,u=this.__iteratees__,c=u.length,h=0,m=q(s,this.__takeCount__);if(!i||!o&&r==s&&m==s)return zt(e,this.__actions__);var d=[];e:for(;s--&&h<m;){for(var p=-1,g=e[l+=t];++p<c;){var _=u[p],f=_.iteratee,_=_.type,f=f(g);if(2==_)g=f;else if(!f){if(1==_)continue e;break e}}d[h++]=g}return d},pe.prototype.at=qo,pe.prototype.chain=function(){return Wo(this)},pe.prototype.commit=function(){return new ye(this.value(),this.__chain__)},pe.prototype.next=function(){this.__values__===zn&&(this.__values__=Wr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?zn:this.__values__[this.__index__++]}},pe.prototype.plant=function(e){for(var t,i=this;i instanceof fe;){var o=yo(i);o.__index__=0,o.__values__=zn,t?r.__wrapped__=o:t=o;var r=o,i=i.__wrapped__}return r.__wrapped__=e,t},pe.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof ve){e=e;return(e=(e=this.__actions__.length?new ve(this):e).reverse()).__actions__.push({func:Yo,args:[Ro],thisArg:zn}),new ye(e,this.__chain__)}return this.thru(Ro)},pe.prototype.toJSON=pe.prototype.valueOf=pe.prototype.value=function(){return zt(this.__wrapped__,this.__actions__)},pe.prototype.first=pe.prototype.head,R&&(pe.prototype[R]=function(){return this}),pe}(),we={Source:[],TempSource:[],entity:[],lastSelectEntity:null,pointsId:[],states:0,PointSelectSource:[],currentObj:null,selectedItem:null,setSource:function(e){this.Source=e},setTempSource:function(e){this.TempSource=e},setPointSelectSource:function(e){this.PointSelectSource=e},getSource:function(){return this.Source},getTempSource:function(){return this.TempSource},getPointSelectSource:function(){return this.PointSelectSource},push:function(e){this.Source.push(e)},pusTemSource:function(e){this.TempSource.push(e)},pusPointSelectSource:function(e){this.PointSelectSource.push(e)},insertGroupId:function(e,t){null!=e.checked&&"true"!=e.checked&&null!=e.checked||(e.checked=!0);try{0==e.item.item.show&&(e.checked=!1)}catch(e){}var i=this.getSourceById(we.Source,t);if(i){for(var o=0,r=this.TempSource.length;o<r;o++)if(this.TempSource[o].id==t){e.checked&&!this.TempSource[o].checked&&(this.TempSource[o].checked=!0);break}i.children||(i.children=[]),i.children.push(e)}else this.push(e);i=Ce.clone(e);return i.item=null,we.currentObj=i,this.pusTemSource(i),e.id},getSourceById:function(e,t){if(e)for(var i=0;i<e.length;i++){if(e[i].id==t)return e[i];if(e[i]&&e[i].children&&0<e[i].children.length){var o=this.getSourceById(e[i].children,t);if(null!=o)return o}}},exitsGroup:function(e,t){if(e)for(var i=we.Source,o=0;o<i.length;o++){if(i[o].id==e){if("group"==i[o].type)for(var r=0;r<i[o].children.length;r++)if(i[o].children[r].name==t)return!0;return!1}i[o]&&i[o].children&&0<i[o].children.length&&this.getSourceById(i[o].children,e)}},getTempSourceById:function(e){for(var t=0;t<this.TempSource.length;t++)if(this.TempSource[t].id==e)return this.TempSource[t]},getPointSelectSourceById:function(e){for(var t=0;t<this.PointSelectSource.length;t++)if(this.PointSelectSource[t].id==e)return this.PointSelectSource[t]},getSourceByName:function(e,t){return Ce.find(e,function(e){return e.name==t})},delete:function(e,t,i){var o=this.getSourceById(we.Source,e);if(o&&o.children&&0<o.children.length){for(;0<o.children.length;)this.delete(o.children[0].id);if(o&&"group"==o.type)0==o.pId||""==o.pId?(a=this.getIndex(we.Source,o),we.Source.splice(a,1)):(n=this.getSourceById(we.Source,o.pId),a=this.getIndex(n.children,o),n.children.splice(a,1)),this.delete1(o.id);else{if(o.item)o.item.deleteObject(e);else{try{t.entities.removeById(o.id)}catch(e){}try{(r=t.dataSources.get(o.id))&&t.dataSources.remove(r)}catch(e){}try{(r=t.imageryLayers.get(o.id))&&t.imageryLayers.remove(r)}catch(e){}try{var r=t.scene.primitives.get(o.id);t.scene.primitives.remove(r)}catch(e){}}var n=this.getSourceById(we.Source,o.pId),a=this.getIndex(n.children,o);n.children.splice(a,1),this.delete1(o.id)}}else if(o&&"group"==o.type)0==o.pId||""==o.pId?(a=this.getIndex(we.Source,o),we.Source.splice(a,1)):(n=this.getSourceById(we.Source,o.pId),a=this.getIndex(n.children,o),n.children.splice(a,1)),this.delete1(o.id);else if(o){if(o.item&&o.item.deleteObject)o.item.deleteObject(e);else{try{t.entities.removeById(o.id)}catch(e){}try{(r=t.dataSources.get(o.id))&&t.dataSources.remove(r)}catch(e){}try{(r=t.imageryLayers.get(o.id))&&t.imageryLayers.remove(r)}catch(e){}try{r=t.scene.primitives.get(o.id);t.scene.primitives.remove(r)}catch(e){}}this.delete1(o.id),(n=this.getSourceById(we.Source,o.pId))&&(a=this.getIndex(n.children,o),n.children.splice(a,1))}},temporaryItem:{obj:[],state:"start",operation:""},endtemporaryItem:function(){we.temporaryItem.obj=[],we.temporaryItem.state="end",we.temporaryItem.operation=""},starttemporaryItem:function(e){var t=null;try{t=document.getElementById("toolTip")}catch(e){}if(null!=t&&(t.style.display="none"),null!=we.handler&&(we.handler.destroy(),we.handler=null),0<we.temporaryItem.obj.length&&"start"==we.temporaryItem.state)for(var i=0;i<we.temporaryItem.obj.length;i++){try{we.temporaryItem.obj[i].destroy()}catch(e){}try{e.entities.remove(we.temporaryItem.obj[i])}catch(e){}}return we.temporaryItem.obj=[],we.temporaryItem.state="start",we.temporaryItem.operation},delete1:function(e){for(var t=0;t<this.TempSource.length;t++)this.TempSource[t].id==e&&this.TempSource.splice(t,1)},getIndex:function(e,t){for(var i=0;i<e.length;i++)if(e[i].id==t.id)return i;return-1},setVisibilityTemp:function(t,e){var i=Ce.filter(this.TempSource,function(e){return e.id==t});i&&i.length&&(i[0].checked=e)},setVisibility:function(e,t,i,o){this.setVisibilityTemp(e,t);var r=this.getSourceById(we.Source,e);if(r)if(r.children&&0<r.children.length){for(var n,a=0;a<r.children.length;a++)this.setVisibility(r.children[a].id,t);if("group"!=r.type)if(r.item&&r.item.setVisibility)r.item.setVisibility(t,e);else{try{(n=i.entities.getById(r.id))&&(n.show=t)}catch(e){}try{(n=i.dataSources.get(r.id))&&(n.show=t)}catch(e){}try{(n=i.imageryLayers.get(r.id))&&(n.show=t)}catch(e){}try{(n=i.scene.primitives.get(r.id))&&(n.show=t)}catch(e){}}}else if("group"!=r.type)if(r.item&&r.item.setVisibility)r.item.setVisibility(t,e);else{try{(n=i.entities.getById(r.id))&&(n.show=t)}catch(e){}try{(n=i.dataSources.get(r.id))&&(n.show=t)}catch(e){}try{(n=i.imageryLayers.get(r.id))&&(n.show=t)}catch(e){}try{(n=i.scene.primitives.get(r.id))&&(n.show=t)}catch(e){}}},removeItem:function(e){if(e)for(var t=0;t<e.length;t++)e[t].item=null,e[t].children&&this.removeItem(e[t].children);return e},changeGroup:function(e,t){var i,o,r=this.getSourceById(this.Source,e),n=this.getSourceById(this.Source,t);r&&n&&n.children&&(0==r.id||null==r.id||null==r.id?(o=this.getIndex(this.Source,r),this.Source.splice(o,1)):(i=this.getSourceById(this.Source,r.pId),o=this.getIndex(i.children,r),i.children.splice(o,1)),r.pId=t,n.children.push(r)),(r=this.getTempSourceById(e))&&(r.pId=t)},handler:null,removeHandler:function(){we.handler&&(we.handler.destroy(),we.handler=null)}},be=1e-5*Math.PI/180;function Te(e,t){ve=t,this._cesium=t,this._viewer=e,this._core=new V,this._polylines=[],this._points=[],this._tree=we,this._interval=20}function Se(e){this._viewer=e,this._core=new V,this.tooltip=this._core.CreateTooltip({id:"ModelEdit"})}function Pe(e){this._viewer=e,this._core=new V,this._tree=we}function Ee(e,t){this._viewer=e,this._cesium=t,this._core=new V}function xe(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we}function Ie(e,t){this._viewer=e,this._cesium=t,this._tree=we.getSource(),this._core=new V}Te.prototype.createlineOfSight=function(n,r){var a=this;this._tree.starttemporaryItem(this._viewer);var s=[],l=[],u={polyline:[]};this._tree.removeHandler();var c=this._core.CreateTooltip();a.objectsToExclude=null;var h=void 0;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw);var m=(e.prototype._init=function(){var e=this;this.options.polyline.positions=new a._cesium.CallbackProperty(function(){return e.positionsp},!1),this.polyline=a._viewer.entities.add(this.options),a.item=this.polyline,a._tree.temporaryItem.obj.push(this.polyline),l.push(this.polyline)},e);function e(e){this.options={polyline:{show:!0,positions:[],material:a._cesium.Color.YELLOW,width:3,clampToGround:!1}},this.positionsp=e,this._init()}this._tree.handler=new a._cesium.ScreenSpaceEventHandler(a._viewer.scene.canvas);var d=[],p=void 0;if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._viewer.entities.remove(this._points[t]);var g=[];this._tree.handler.setInputAction(function(e){var t,i,o=a._viewer.camera.getPickRay(e.position),r=a._viewer.scene.globe.pick(o,a._viewer.scene);!a._viewer.scene.pick(e.position)||(i=a._viewer.scene.pickPosition(e.position))&&(r=i),r&&(0===d.length?(d.push(r.clone(),r.clone()),t={leftX:e.position.x,leftY:e.position.y},g.push(t),h=r.clone()):(t={rightX:e.position.x,rightY:e.position.y},g.push(t),o={postion:d,entity:l,cartesian:g},s.push(o),g=[],p=void 0,d=[],i=h.clone(),null!=n.height&&(r=ellipsoid.cartesianToCartographic(h.clone()),e=ve.Math.toDegrees(cartograhphic.latitude),t=ve.Math.toDegrees(cartograhpinc.longitude),o=n.height,r=ve.Cartographic.fromDegrees(t,e,o),i=ellipsoid.cartographicToCartesian(r)),d.push(i),d.push(i),p=new m(d)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){var t=a._viewer.camera.getPickRay(e.endPosition),i=a._viewer.scene.globe.pick(t,a._viewer.scene);!a._viewer.scene.pick(e.endPosition)||(t=a._viewer.scene.pickPosition(e.endPosition))&&(i=t),i&&(0===d.length?c.showAt(e.endPosition,"点击添加视点"):c.showAt(e.endPosition,"点击添加目标视点,右键结束"),2<=d.length&&(a._cesium.defined(p)?null!=i&&(d.pop(),d.push(i)):p=new m(d)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var _=0,f=0;return this._tree.handler.setInputAction(function(e){a.end&&a.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{if(c.show(!1),this.end=void 0,a._core.mouse(a._viewer.container,0),a._tree.endtemporaryItem(),a._tree.handler.destroy(),"cancel"!==e){for(var t,i=0;i<s.length;i++)t=(0==i?(_=s[i].cartesian[0].leftX,f=s[i].cartesian[0].leftY,a.tsjx(s[i].postion,_,f,s[i].cartesian[1].rightX,s[i].cartesian[1].rightY,50,l,a._cesium,a._viewer)):a.tsjx(s[i].postion,_,f,s[i].cartesian[0].rightX,s[i].cartesian[0].rightY,50,l,a._cesium,a._viewer))?a._viewer.entities.add({name:"polyline1",polyline:{positions:s[i].postion,width:3,material:a._cesium.Color.GREEN}}):a._viewer.entities.add({name:"polyline1",polyline:{positions:s[i].postion,width:3,material:a._cesium.Color.RED}}),u.polyline.push(t);d.pop(),a._polylines=u.polyline,a._tree.handler.destroy();for(o=0;o<l.length;o++)a._viewer.entities.remove(l[o]);""!=r&&null!=r&&"function"==typeof r&&r(u)}else for(var o=0;o<l.length;o++)a._viewer.entities.remove(l[o])},this},Te.prototype.tsjx=function(e,t,i,o,r,n,a,s,l){var u=this._core.getSpaceDistancem(e,s);u<=100&&10<=u?n=parseInt(u/2):u<10&&0<u?n=parseInt(+u):100<u&&(n=parseInt(u/10));var c=e[0],u=e[e.length-1],e=s.Cartographic.fromCartesian(c),h=s.Math.toDegrees(e.longitude),m=s.Math.toDegrees(e.latitude);e.height;var d=e.height,c=s.Cartographic.fromCartesian(u),e=s.Math.toDegrees(c.longitude),u=s.Math.toDegrees(c.latitude);c.height;var c=c.height,p=n,g=s.Math.lerp(h,e,1/p)-h,_=s.Math.lerp(m,u,1/p)-m,f=s.Math.lerp(d,c,1/p)-d;s.Math.lerp(t,o,1/p),s.Math.lerp(i,r,1/p);for(var y=!0,v=0;v<p-2;v++){var C=d+(v+1)*f,w=s.Cartesian3.fromDegrees(h+(v+1)*g,m+(v+1)*_,C),b=s.Cartographic.fromCartesian(w),w=l.scene.globe.getHeight(b),b=l.scene.sampleHeight(b,a);if(b&&(w=b),w=parseFloat(w.toFixed(1)),(C=parseFloat(C.toFixed(1)))<w)return y=!1}return y},Te.prototype.deleteObject=function(){if(0<this._points.length){this.objectsToExclude=null;for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e])}},Te.prototype.InterpolateLineCartographic=function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=[];o.push(new ve.Cartographic(e.longitude,e.latitude));var r=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2)),i=i&&"number"==typeof i?i:be;if(r<=i)return o.push(new ve.Cartographic(t.longitude,t.latitude)),o;for(var n=r/i,a=(t.longitude-e.longitude)/n,s=(t.latitude-e.latitude)/n,l=0;l<n;l++){var u=e.longitude+(l+1)*a,c=e.latitude+(l+1)*s;o.push(new ve.Cartographic(u,c))}return o.push(new ve.Cartographic(t.longitude,t.latitude,t.height)),o},Te.prototype.InterpolateLineCartographicxp=function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=[];o.push(new ve.Cartographic(e.longitude,e.latitude));var r=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2)),i=i&&"number"==typeof i?i:be;if(r<=i)return o.push(new ve.Cartographic(t.longitude,t.latitude)),o;for(var n=r/i,a=(t.longitude-e.longitude)/n,s=(t.latitude-e.latitude)/n,l=(t.height-e.height)/n,u=0;u<n;u++){var c=e.longitude+(u+1)*a,h=e.latitude+(u+1)*s,m=e.height+l*(u+1);o.push(new ve.Cartographic(c,h,m))}return o.push(new ve.Cartographic(t.longitude,t.latitude,t.height)),o},Te.prototype.InterpolateLineHeightCartographic=function(e,t){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var i=[];i.push(new ve.Cartographic(e.longitude,e.latitude,e.height));var o=Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2));if(o<=be)return i.push(new ve.Cartographic(t.longitude,t.latitude,t.height)),i;for(var r=o/be,n=(t.longitude-e.longitude)/r,a=(t.latitude-e.latitude)/r,s=(t.height-e.height)/r,l=0;l<r;l++){var u=e.longitude+(l+1)*n,c=e.latitude+(l+1)*a,h=e.height+(l+1)*s;i.push(new ve.Cartographic(u,c,h))}return i.push(new ve.Cartographic(t.longitude,t.latitude,t.height)),i},Te.prototype.InterpolateIndexLineHeightCartographic=function(e,t,i,o){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var r=(t.longitude-e.longitude)/i,n=(t.latitude-e.latitude)/i,i=(t.height-e.height)/i,r=e.longitude+o*r,n=e.latitude+o*n,i=e.height+o*i;return new ve.Cartographic(r,n,i)},Te.prototype.InterpolateIndexLineHeightCartographicxp=function(e,t,i,o){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var r=(t.longitude-e.longitude)/i,n=(t.latitude-e.latitude)/i,i=(t.height-e.height)/i,r=e.longitude+o*r,n=e.latitude+o*n,i=e.height+o*i;return new ve.Cartographic(r,n,i)},Te.prototype.Interpolate2IndexLineHeightCartographic=function(e,t,i,o){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var r=[];r.push(new ve.Cartographic(e.longitude,e.latitude,e.height));for(var n=(t.longitude-e.longitude)/i,a=(t.latitude-e.latitude)/i,s=(t.height-e.height)/i,l=0;l<o;l++){var u=e.longitude+(l+1)*n,c=e.latitude+(l+1)*a,h=e.height+(l+1)*s;r.push(new ve.Cartographic(u,c,h))}return r},Te.prototype.CartographicPointsTerrainData=function(e,t){e.length&&0<e.length&&(e=ve.sampleTerrain(this._viewer.terrainProvider,11,e),ve.when(e,function(e){t(e)}))},Te.prototype.setVisibility=function(e){if(0<this._polylines.length)for(var t=0;t<this._polylines.length;t++)this._polylines[t].show=e},Te.prototype.deleteObject=function(){if(0<this._polylines.length)for(var e=0;e<this._polylines.length;e++)this._viewer.entities.remove(this._polylines[e])},Object.defineProperties(Te.prototype,{sight:{get:function(){return this.item.sight},set:function(e){this.item.sight=sight}}}),Se.prototype.start=function(t,e={}){if(this.end(),t){var i=this._viewer.scene.primitives._primitives.findIndex(e=>e.id&&e.id.id===t.id);if(!(i<0)){var o=2*this._viewer.scene.primitives.get(i).boundingSphere.radius/3.63,i=Cesium.Transforms.eastNorthUpToFixedFrame(t.position.getValue());return(this.model=t).heading||(t.heading=0),t.pitch||(t.pitch=0),t.roll||(t.roll=0),this.axis=this._viewer.scene.primitives.add(Cesium.Model.fromGltf({id:"modeEditAxis",modelMatrix:i,url:window.SmartEarthRootUrl+D.modelAxis,scale:o,minimumPixelSize:e.minimumPixelSize})),this.initEvent(),this}}},Se.prototype.initEvent=function(){this.editHandler&&this.editHandler.destroy(),this.editHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);let i,o;this.editHandler.setInputAction(e=>{i?(o=e.position,this.originPosition=this.model.position.getValue(),this.originHeading=this.model.heading||0,this.originPitch=this.model.pitch||0,this.originRoll=this.model.roll||0,this.startPosition=this._viewer.scene.pickPosition(o),this.defaultEvent(!1),this.setMouseStyle("edit")):o=void 0},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(e=>{o=void 0,this.defaultEvent(!0),this.setMouseStyle("default")},Cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(e=>{if(o)return this.mouseTooltip(i,e),void this.edit(i,o,e.endPosition);var t=this._viewer.scene.pick(e.endPosition);i=t&&"modeEditAxis"===t.id?"XArrow_1"===t.mesh.name?"y":"YArrow_1"===t.mesh.name?"x":"ZArrow_1"===t.mesh.name?"z":"ZAxis_1"===t.mesh.name?"heading":"XAxis_1"===t.mesh.name?"pitch":"YAxis_1"===t.mesh.name?"roll":void 0:void 0,this.mouseTooltip(i,e)},Cesium.ScreenSpaceEventType.MOUSE_MOVE)},Se.prototype.defaultEvent=function(e){let t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},Se.prototype.setMouseStyle=function(e){"edit"===e?(this.defaultMouseStyle=this._viewer.container.style.cursor,this._viewer.container.style.cursor="crosshair"):"default"===e&&(this._viewer.container.style.cursor=this.defaultMouseStyle||"default")},Se.prototype.edit=function(i,o,r){if(i){var n=this.originPosition,a=this.startPosition;let t=this._core.toDegrees(n);var s=this._core.toDegrees(a),l=this._viewer.scene.cartesianToCanvasCoordinates(n),u=r.x-o.x,a=r.y-o.y;let e;if("x"===i){n=u*(s.lon-t.lon)/(o.x-l.x);t.lon+=n,e=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height),this.model.position=e,this.axis.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(e)}else if("y"===i){var c=u*(s.lat-t.lat)/(o.x-l.x);t.lat+=c,e=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height),this.model.position=e,this.axis.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(e)}else if("z"===i){c=s.height-t.height,c=a*Math.abs(c/(o.y-l.y));t.height-=c,e=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height),this.model.position=e,this.axis.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(e),window.SmartEarthPopupData&&window.SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.model input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="height"]').value=t.height.toFixed(2))}else if("heading"===i){var h=this.originHeading,m=this._core.arge(l,o,r,"+-",!0);this.setRotate("heading",h-=m),window.SmartEarthPopupData&&window.SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').value=h)}else if("pitch"===i){m=(s.lon-t.lon)/(o.x-l.x);let e=this.originPitch;h=this._core.arge(l,o,r,"+-",!0);0<m?e+=h:e-=h,this.setRotate("pitch",e),window.SmartEarthPopupData&&window.SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]').value=e)}else if("roll"===i){s=(s.lat-t.lat)/(o.x-l.x);let e=this.originRoll;r=this._core.arge(l,o,r,"+-",!0);s<0?e-=r:e+=r,this.setRotate("roll",e),window.SmartEarthPopupData&&window.SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]').value=e)}}},Se.prototype.setRotate=function(o,r){if(this.model){let e=this.model.heading,t=this.model.pitch,i=this.model.roll;"heading"===o?this.model.heading=e=r:"pitch"===o?this.model.pitch=t=r:"roll"===o&&(this.model.roll=i=r),this.model.orientation=Cesium.Transforms.headingPitchRollQuaternion(this.model.position.getValue(),new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(e),Cesium.Math.toRadians(t),Cesium.Math.toRadians(i)))}},Se.prototype.mouseTooltip=function(e,t){e?(t=t.endPosition||t.position,"x"===e?this.tooltip.showAt(t,"X方向平移"):"y"===e?this.tooltip.showAt(t,"Y方向平移"):"z"===e?this.tooltip.showAt(t,"Z方向平移"):"heading"===e?this.tooltip.showAt(t,"绕Z轴旋转"):"pitch"===e?this.tooltip.showAt(t,"绕Y轴旋转"):"roll"===e?this.tooltip.showAt(t,"绕X轴旋转"):this.tooltip.show(!1)):this.tooltip.show(!1)},Se.prototype.end=function(){this.axis&&this._viewer.scene.primitives.remove(this.axis),this.axis=void 0,this.editHandler&&this.editHandler.destroy(),this.editHandler=void 0,this.model&&(this.model.ModelEdit=void 0),this.model=void 0,this.tooltip&&this.tooltip.show(!1)},Pe.prototype.createDivPoint=function(e,t,i={}){var o,r=i.id||"DivPoint"+this._core.getuid();Array.isArray(t)?2===t.length?o=Cesium.Cartesian3.fromDegrees(t[0],t[1]):3===t.length&&(o=Cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])):t.x&&t.y?o=t instanceof Cesium.Cartesian3?t:Cesium.Cartesian3.fromDegrees(t.x,t.y,t.z):t.lon&&t.lat&&(o=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height)),this.item={id:r,show:!0,name:e,type:"default",offset:"l",position:o},Object.assign(this.item,i),this._viewer.clock.onTick.addEventListener(this.updateDivPointEvent,this);i={id:this.item.id,name:e,pId:i.GroupID||0,type:"DivPoint",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,i.pId),this},Pe.prototype.updateDivPointEvent=function(){if(this.item){let o=this.item,r=document.getElementById(o.id),e=!1;var t,i;if(o.show?void 0!==o.near||void 0!==o.far?(t=this._core.getPointToCameraDistance(this._viewer,o.position),i=o.near||0,n=o.far||1/0,i<=t&&t<=n?(r&&(r.style.display="block"),e=!0):r&&(r.style.display="none")):(r&&(r.style.display="block"),e=!0):r&&(r.style.display="none"),e){var n=this._viewer.scene.cartesianToCanvasCoordinates(o.position);if(!n)return;if(o.name||(o.name="SmartEarth"),!r){let i;if("default"===o.type)if(o.description){let e=o.description;var a=this._core.isDOM(e);a&&(e="");let t="";Array.isArray(e)?e.forEach(e=>{t+='<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">'+e+"</div>"}):t='<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">'+e+"</div>",i=`<div id="${o.id}" style="${o.onclick?"cursor: pointer;":"pointer-events: none;"}position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;">
                                <div class="divpoint">
                                    <div class="divpoint-wrap" style="position: relative;padding: 30px;overflow: hidden;">
                                        <div class="divpoint-area" style="background-image:linear-gradient(135deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50%,transparent 50%),linear-gradient(-45deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50.1%,transparent 50%);position: relative;min-width: 180px;">
                                            <div class="divpoint-arrow-lt"></div>
                                            <div class="divpoint-b-t" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 44px;right: 0;height: 1px;z-index: 10;"></div>
                                            <div class="divpoint-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;right: 0;bottom: 44px;width: 1px;z-index: 10;"></div>
                                            <div class="divpoint-b-b" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;left: 0;right: 44px;bottom: 0;height: 1px;z-index: 10;"></div>
                                            <div class="divpoint-b-l" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 44px;left: 0;bottom: 0;width: 1px;z-index: 10;"></div>
                                            <div class="divpoint-arrow-rb"></div>
                                            <div class="divpoint-label-wrap" style="padding-left: 12px;color:#fff;font-size: 16px;white-space: nowrap;overflow: hidden;">
                                                <div class="divpoint-title" style="background-image: linear-gradient(135deg,transparent 25px,#29baf1 25px);    margin-top: 20px;padding: 0 12px 0 30px;height: 36px;line-height: 36px;position: relative;">${o.name}</div>
                                                <div class="divpoint-label-content" style="padding: 15px 0;margin-top: 3px;border-top: 2px solid #29baf1;">
                                                    ${t}
                                                </div>
                                            </div>
                                        </div>
                                        <div class="divpoint-b-t-l" style="background-color:#29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(52px,-22px);z-index: 10;"></div>
                                        <div class="divpoint-b-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;bottom: 0;right: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(-52px,22px);z-index: 10;"></div>
                                    </div>
                                    <div class="divpoint-arrow" style="background-color: #28bbf0;position: absolute;bottom: 0;left: 0;width: 45px;height: 2px;transform: rotate(-45deg) translate(5px,-15px);"></div>
                                </div>
                            </div>`,$(this._viewer.container).append(i),r=document.getElementById(o.id),a&&r.querySelector(".divpoint-data-li").append(o.description),o.onclick&&(r.onclick=()=>{o.onclick(o)})}else i=`<div id="${o.id}"  style="${o.onclick?"cursor: pointer;":"pointer-events: none;"}position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;">
                                <div class="divpoint">
                                    <div class="divpoint-wrap" style="position: relative;padding: 30px;overflow: hidden;">
                                        <div class="divpoint-area" style="background-image:linear-gradient(135deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50%,transparent 50%),linear-gradient(-45deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50.1%,transparent 50%);position: relative;min-width: 180px;">
                                            <div class="divpoint-arrow-lt"></div>
                                            <div class="divpoint-b-t" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 44px;right: 0;height: 1px;z-index: 10;"></div>
                                            <div class="divpoint-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;right: 0;bottom: 44px;width: 1px;z-index: 10;"></div>
                                            <div class="divpoint-b-b" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;left: 0;right: 44px;bottom: 0;height: 1px;z-index: 10;"></div>
                                            <div class="divpoint-b-l" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 44px;left: 0;bottom: 0;width: 1px;z-index: 10;"></div>
                                            <div class="divpoint-arrow-rb"></div>
                                            <div class="divpoint-label-wrap" style="padding-left: 12px;color:#fff;font-size: 16px;white-space: nowrap;overflow: hidden;">
                                                <div class="divpoint-title" style="background-image: linear-gradient(135deg,transparent 25px,#28bbf0 25px,#28bbf0 50%,transparent 50%),linear-gradient(-45deg,transparent 32px,#28bbf0 32px,#28bbf0 50%,transparent 50%);margin-top: 10px;margin-bottom: 10px;padding: 0 12px 0 30px;height: 36px;line-height: 36px;position: relative;">${o.name}</div>
                                            </div>
                                        </div>
                                        <div class="divpoint-b-t-l" style="background-color:#29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(52px,-22px);z-index: 10;"></div>
                                        <div class="divpoint-b-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;bottom: 0;right: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(-52px,22px);z-index: 10;"></div>
                                    </div>
                                    <div class="divpoint-arrow" style="background-color: #28bbf0;position: absolute;bottom: 0;left: 0;width: 45px;height: 2px;transform: rotate(-45deg) translate(5px,-15px);"></div>
                                </div>
                            </div>`,$(this._viewer.container).append(i),r=document.getElementById(o.id),o.onclick&&(r.onclick=()=>{o.onclick(o)});else{let e=o.description;a=this._core.isDOM(e);a&&(e=""),i=`<div id="${o.id}"  style="${o.onclick?"cursor: pointer;":"pointer-events: none;"}position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">
                            <div class="divpoint">
                                ${e}
                            </div>
                        </div>`,$(this._viewer.container).append(i),r=document.getElementById(o.id),a&&r.querySelector(".divpoint").append(o.description),o.onclick&&(r.onclick=()=>{o.onclick(o)})}}let e=n.x,t=n.y-r.offsetHeight;"c"===o.offset?e-=r.offsetWidth/2:"r"===o.offset?e-=r.offsetWidth:Array.isArray(o.offset)&&("c"===o.offset[0]?e-=r.offsetWidth/2:"r"===o.offset[0]?e-=r.offsetWidth:"number"==typeof o.offset[0]&&(e-=o.offset[0]),"number"==typeof o.offset[1]&&(t-=o.offset[1])),r.style.transform=`matrix(1, 0, 0, 1, ${e}, ${t})`}o.update&&o.update()}},Pe.prototype.updateDivPoint=function(t,i={}){if(this.item){Object.assign(this.item,i),this.item.name=t;let e=document.getElementById(this.item.id);e&&e.remove()}},Pe.prototype.deleteObject=function(){this._viewer.clock.onTick.removeEventListener(this.updateDivPointEvent,this);let e=document.getElementById(this.item.id);e&&e.remove()},Pe.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},Pe.prototype.getVisibility=function(){return this.item&&this.item.show},Pe.prototype.setTreeobj=function(e){this.treeobj=e},Ee.prototype.getPosition=function(){return this._viewer.camera.position},Ee.prototype.getDegrees=function(){var e=this._viewer.camera.positionCartographic;return{lon:this._cesium.Math.toDegrees(e.longitude),lat:this._cesium.Math.toDegrees(e.latitude),height:e.height}},Ee.prototype.getMousePosition=function(e,t){e=e.endPosition||e.position||e;void 0===this.defaultDepthTest&&(this.defaultDepthTest=!!this._viewer.scene.globe.depthTestAgainstTerrain),this._viewer.scene.globe.depthTestAgainstTerrain=!0;this._viewer.camera.getPickRay(e);e={position:e=this._viewer.scene.pickPosition(e)};let i;if(i=e.position,this._viewer.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0,i)return i;console.log("未拾取到坐标!")},Ee.prototype.getMouseDegrees=function(e,t){t=this.getMousePosition(e,t);if(t)return this._core.toDegrees(t)},xe.prototype.createPopupMessage=function(e){var t=document.createElement("div");t.className="kz",t.id="kzmb",t.style.position="absolute",t.style.width="200px",t.style.height="500px",t.style.padding="15px",t.style.background="rgba(0, 0, 0, 0.5)",t.style.color="#fff",t.style.top="0px",t.style.right="0px",t.style.border="solid 2px #358ABA",document.body.appendChild(t);var i=document.createElement("div");t.id="bt",i.style.overflow="hidden",i.style.height="45px",i.style.height="100%",i.className="layui-form-item",i.style.borderBottom="solid 2px #358ABA";var o=document.createElement("span");o.textContent=e,i.appendChild(o),t.appendChild(i),this.getElement("bt","kzmb")},xe.prototype.createPlotting=function(e,t){var i=document.createElement("main");i.id="kzmb",i.style.position="absolute",i.style.cursor="auto",i.style.left="0px",i.style.top="0px;",i.className="mainView",document.body.appendChild(i);var o=document.createElement("button");o.id="closeScene",o.setAttribute("aria-label","Close"),o.innerHTML="<span aria-hidden='true'>×</span>",o.onclick=closeScene,o.className="myModal-close",i.appendChild(o);var r=document.createElement("input");r.id="objectTab1",r.type="radio",r.setAttribute("checked",""),r.name="objectTab";o=document.createElement("label");o.setAttribute("for","objectTab1"),o.id="objectLabel1",o.className="function-module-caption",o.innerHTML="二维",i.appendChild(r),i.appendChild(o);r=document.createElement("input");r.id="objectTab2",r.type="radio",r.name="objectTab";o=document.createElement("label");o.setAttribute("for","objectTab2"),o.id="objectLabel2",o.className="function-module-caption",o.innerHTML="三维",i.appendChild(r),i.appendChild(o);o=document.createElement("section");o.id="objectContent1",i.appendChild(o);this.getBh(o,[{title:"点",src:"../../static/image/point/points.png",onclick:"labelDraw()"},{title:"线",src:"../../static/image/point/polyline.png",onclick:"polylineDraw()"},{title:"多边形",src:"../../static/image/point/polygon_clampToGround.png",onclick:"polygonDraw()"},{title:"矩形",src:"../../static/image/point/rectangle.png",onclick:"rectangleDraw()"},{title:"圆",src:"../../static/image/point/Cricle.png",onclick:"circleDraw()"}]);o=document.createElement("section");o.id="objectContent2",i.appendChild(o);this.getBh(o,[{title:"立方体",src:"../../static/image/point/extrudedRectangle.png",onclick:"boxDraw()"},{title:"圆柱体",src:"../../static/image/point/extrudedCircle.png",onclick:"cylinderDraw()"},{title:"圆锥体",src:"../../static/image/point/Cone.png",onclick:"coneDraw()"},{title:"球体",src:"../../static/image/point/ellipsoid.png",onclick:"circleDraw()"},{title:"多边体",src:"../../static/image/point/Multilateral.png",onclick:"multilateralDraw()"}]),this.getElement("kzmb","kzmb")},xe.prototype.getBh=function(e,t){for(var i="",i="<div class='function-module-content' style(height:'500px')><div class='function-module-sub-section'> <label class='function-module-sub-section-caption'>符号库</label><div id='icons' class='mark-list'>",o=0;o<t.length;o++)i=i+"<div class='mark-list-item'><img title="+t[o].title+" src="+t[o].src+" id="+t[o].title+" onclick="+t[o].onclick+"></div>";e.innerHTML=i+="</div></div></div>"},xe.prototype.createMeasurement=function(e,t){var i=document.createElement("div");i.className="kz",i.id="kzmb",i.style.position="absolute",i.style.width="330px",i.style.height="500px",i.style.padding="15px",i.style.background="rgba(0, 0, 0, 0.5)",i.style.color="#fff",i.style.top="0px",i.style.right="0px",i.style.border="solid 2px #358ABA",document.body.appendChild(i);var o=document.createElement("div");o.id="bt",o.style.height="100%",o.style.overflow="hidden",o.style.height="25px",o.className="layui-form-item",o.style.borderBottom="solid 2px #358ABA";var r=document.createElement("span");r.textContent=e,o.appendChild(r),i.appendChild(o);o=document.createElement("div");o.className="layui-tab-content",i.appendChild(o);i=document.createElement("div");i.className="layui-tab-item layui-show",o.appendChild(i);o=document.createElement("div");o.className="kind",i.appendChild(o);i=document.createElement("ul");o.appendChild(i);o=[{img:"../../img/bh/labels.png",text:"垂直高度",onclick:MeasurementVd},{img:"../../img/bh/labels.png",text:"海拔高度",onclick:MeasurementAltitude},{img:"../../img/bh/labels.png",text:"空间距离",onclick:MeasurementSpaceD},{img:"../../img/bh/labels.png",text:"水平距离",onclick:MeasurementHD},{img:"../../img/bh/labels.png",text:"三维面积",onclick:MeasurementThreeDSurfaceArea},{img:"../../img/bh/labels.png",text:"平面面积",onclick:MeasurementPlaneArea},{img:"../../img/bh/labels.png",text:"角度测量",onclick:MeasurementAngle}];this.getLi(i,o),"function"==typeof t&&t(),this.getElement("bt","kzmb")},xe.prototype.getLi=function(e,t){for(var i=0;i<t.length;i++){var o=document.createElement("li");o.innerHTML=`<img src="${t[i].img}" /><p>${t[i].text}</p>`,o.onclick=t[i].onclick,e.appendChild(o)}},xe.prototype.getElement=function(e,t){var r=0,n=0,e=document.getElementById(e);e.style.cursor="move";var a=document.getElementById(t),s=!1;e.onmousedown=function(e){e=e||window.event;r=e.clientX-a.offsetLeft,n=e.clientY-a.offsetTop,s=!0},document.onmousemove=function(e){var t,i,o;s&&(t=(e=e||window.event).clientX-r,i=e.clientY-n,o=document.documentElement.clientWidth-a.offsetWidth,e=document.documentElement.clientHeight-a.offsetHeight,t<0?t=0:o<t&&(t=o),i<0?i=0:e<i&&(i=e),a.style.left=t+"px",a.style.top=i+"px")},document.onmouseup=function(){s=!1}},xe.prototype.createPopupProp=function(e,t){layuiLayer.close(SmartEarthPopupData.layerProp);var i=t.width,o=t.height,r=t.fn||{};SmartEarthPopupData.propType=t.type;var n,a=null,s=null,l=null;for(n in r)a="cancel"==n?r[n]:a,s="success"==n?r[n]:s,l="end"==n?r[n]:l;SmartEarthPopupData.layerProp=layuiLayer.open({title:e,type:2,skin:"other-class",shade:t.shade||0,shadeClose:!0,offset:t.offset||"r",resize:!1,area:["number"==typeof i?i+"px":i,"number"==typeof o?o+"px":o],content:SmartEarthRootUrl+t.url,success:function(e,t){s&&"function"==typeof s&&s(e,t)},cancel:function(){a&&"function"==typeof a&&a()},end:function(){l&&"function"==typeof l&&l()}})},xe.prototype.createModelLibrary=function(e){layuiLayer.close(SmartEarthPopupData.ModelLibraryLayer);var t,i=(e=e||{}).width||342,o=e.height||"90%",r=e.offset||"r",n=e.fn||{},a=null,s=null,l=null;for(t in n)a="cancel"==t?n[t]:a,s="success"==t?n[t]:s,l="end"==t?n[t]:l;SmartEarthPopupData.ModelLibraryLayer=layuiLayer.open({title:"模型库",type:2,skin:"other-class",shade:0,shadeClose:!0,offset:r,resize:!1,area:[i+"px","number"==typeof o?o+"px":o],content:SmartEarthRootUrl+"Workers/Model/ModelLibrary.html",success:function(e,t){s&&"function"==typeof s&&s(e,t)},cancel:function(){a&&"function"==typeof a&&a()},end:function(){l&&"function"==typeof l&&l()}})},Ie.prototype.createGroup=function(e,t,i){if(0!=i&&(null==i||""==i)&&(i=this._core.isnull(we.selectedItem)?0:we.selectedItem.id,o=we.getSourceByName(this._tree,e)))return o.id;var o,r=we.getSourceById(this._tree,i);if(r){if(o=we.getSourceByName(r.children,e))return o.id;var n={id:this._core.getuid(),name:e,pId:i,checked:t,type:"group",item:this};return this.item=n,we.insertGroupId(n,i)}n={id:this._core.getuid(),name:e,pId:i,type:"group",checked:t,item:this};return this.item=n,we.insertGroupId(n,i)},Ie.prototype.getVisibility=function(){return this.item.checked},Ie.prototype.changeGroup=function(e,t){we.changeGroup(e,t)},Ie.prototype.starttemporaryItem=function(){return we.starttemporaryItem(this._viewer)},Ie.prototype.pushtemporaryItem=function(e){we.temporaryItem.obj.push(e)},Ie.prototype.pushStateItem=function(e){we.temporaryItem.operation=e},Ie.prototype.endtemporaryItem=function(){we.endtemporaryItem()},Ie.prototype.export=function(){return{type:"group",style:{name:this.item.name,pId:this.item.pId,id:this.item.id}}};var De=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],o=!0,r=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(o=(a=s.next()).done)&&(i.push(a.value),!t||i.length!==t);o=!0);}catch(e){r=!0,n=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw n}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Me(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function Ae(e,t,i){this._viewer=e,this._cesium=t,this._Cesium=i.Cesium,this._url=i.url,this._urlParams=i.urlParams,this._urlTemplate=this._url+"?"+this._serialize(this._urlParams),this._rectangle=i.rectangle,this._maximumLevel=i.maximumLevel||19,this._minimumLevel=i.minimumLevel||1,this._tilingScheme=i.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=i.lowerLevelLimit||1,this._upperLevelLimit=i.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var o=this._radianToDegree(this._rectangle.west),r=this._radianToDegree(this._rectangle.south),n=this._radianToDegree(this._rectangle.east),a=this._radianToDegree(this._rectangle.north),s=this._minimumLevel;s<=this._maximumLevel;s++){var l=this._lonLatToTileInWGS84([o,r],s),u=this._lonLatToTileInWGS84([n,a],s),c=Math.min(l[0],u[0]),h=Math.max(l[0],u[0]),m=Math.min(l[1],u[1]),u=Math.max(l[1],u[1]);this._tileRangeByLevel[s]={minCol:m,maxCol:u,minRow:c,maxRow:h}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1,this._core=new V,this.tooltip=this._core.CreateTooltip(),this._getPosition=new Ee(this._viewer,this._cesium)}function Re(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we,this._Provider=void 0,this._cache=!1,this._forceRefreshPrvimitive=null}function Oe(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._getPosition=new Ee(this._viewer,this._cesium),this._tree=we,this._popupmessage=new xe(this._viewer,this._cesium),this.Legend=[],this.tooltip=this._core.CreateTooltip(),this.enty=null}function He(e,t,i){this._viewer=e,this._cesium=t,this._quadtree=void 0,this._tilingScheme=i||new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._reTilesKey=[],this._state=!0,this._client=!0,this._reTiles=[],this._normalTile=16,this._minimumHeight=0,this._maximumHeight=0,this._PrimitiveCollection=new Cesium.PrimitiveCollection,this._levelZeroMaximumError=Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE),He.prototype.ready||Object.defineProperties(He.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}}}),this._core=new V,this.tooltip=this._core.CreateTooltip(),this._getPosition=new Ee(this._viewer,this._cesium)}function Ve(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we,this._Provider=void 0,this.labelCollections1=[],this.labelCollections2=[],this.labelCollections=this._cesium.PointPrimitiveCollection(),this.gd=0,this.item={show:!0},this.model=[],this.Legend=[],this.sj=!0,this._cache=!1,this._forceRefreshPrvimitive=null}function ke(e,t,i,o){this.UrlTemplateGeojsonProvider=new t.UrlTemplateGeojsonProvider(i,1),this.UrlTemplateGeojsonProvider.loadtitle=o,this.ent=e.imageryLayers.addImageryProvider(this.UrlTemplateGeojsonProvider)}function Fe(e,t){var n=e,a=t;this.project=function(e,t){var i=t.xMax-t.xMin,o=t.yMin-t.yMax,r=Math.abs(e[0]-t.xMin),t=e[1]-t.yMax;return{x:r/i*n,y:t/o*a}},this.unproject=function(e,t){var i=t.xMax-t.xMin,t=t.yMin-t.yMax;return[e.x/n*i,e.y/a*t]},this.getBoundingRect=function(e){for(var t=Number.MAX_VALUE,i={xMin:t,yMin:t,xMax:-t,yMax:-t},o=0,r=e.length;o<r;o++){var n=e[o].getBoundingRect(),a={x:n.xMin,y:n.yMin},n={x:n.xMax,y:n.yMax};i.xMin=i.xMin<a.x?i.xMin:a.x,i.yMin=i.yMin<a.y?i.yMin:a.y,i.xMax=i.xMax>n.x?i.xMax:n.x,i.yMax=i.yMax>n.y?i.yMax:n.y}return i}}function Ge(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0,this.Legend=[],this.datas=[],this.models=0,this.entity=null,this.primitve=[],this.probj=[],this.PrimitiveData=[],this.loadFinishKey=[],this.loadAllKey=[],this.PrimitiveObj={key:"",data:{}},this.start=0,this.Primitivekey=[],this.tilesLength=0,this.returnCount=0,this._primitiveByTile={},this._primitiveCollection=new this._cesium.PrimitiveCollection,this.img=null,this._defaultStyle=null,this._canvas=null,this._context=null,this._cache=!1,this._forceRefreshPrvimitive=null}function Ne(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function Be(e,t){var i=[];return(e.level>=t?function(e,t,i){for(var o=e,r=0;r<30;r++){if(o.level==t)return i.push({x:o.x,y:o.y,level:o.level});o=o.parent}}:function e(t,i,o){{if(t.level==i)return o.push({x:t.x,y:t.y,level:t.level}),!0;if(t.level>i)return!1;for(var r=0;r<t.children.length;r++)e(t.children[r],i,o)}return!0})(e,t,i),i}Ae.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":Le(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},Ae.prototype._fetch=function(r){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(t,i){var o=new XMLHttpRequest;if(o.open(n.method||"GET",r),n.headers)for(var e in n.headers)o.setRequestHeader(e,n.headers[e]);o.onload=function(){if(4===o.readyState&&200===o.status)try{var e=JSON.parse(o.responseText);t(e)}catch(e){i(new Error("INVALID RESPONSE"))}},o.onerror=function(e){i(e)},o.onloadend=function(e){200!==e.target.status&&i(new Error("["+e.target.status+"]request failed: "+r))},o.send(n.body||null)})},Ae.prototype._lonLatToTileInWGS84=function(e,t){var i=De(e,2),e=i[0],i=i[1];return[Math.floor(Math.pow(2,t)*(90-i)/180),Math.floor(Math.pow(2,t)*(180+e)/180)]},Ae.prototype._radianToDegree=function(e){return e/Math.PI*180},Ae.prototype._isTileInRange=function(e){try{var t=this._tileRangeByLevel[e.level],i=t.minCol,o=t.maxCol,r=t.minRow,n=t.maxRow;return e.x>=i&&e.x<=o&&e.y>=r&&e.y<=n}catch(e){return!1}},Ae.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},Ae.prototype._loadTile=function(e){var r=[],n=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),a=this;return e.features.forEach(function(e){if(a._propertyToBeFiltered&&Array.isArray(a._valuesToBeFiltered)){var t=e.properties[a._propertyToBeFiltered];if(a._valuesToBeFiltered.includes(t))return}var o,t=e.geometry.type;"Polygon"===t||"MultiPolygon"===t?(o=[],a.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){o.push([]),e.forEach(function(e){var t;2<e.length?e.forEach(function(e){var t;2<=e.length&&(t=o[i]).push.apply(t,Me(e))}):(t=o[i]).push.apply(t,Me(e))});var t=new a._Cesium.PolygonHierarchy(a._Cesium.Cartesian3.fromDegreesArray(o[i])),e=a._Cesium.BoundingSphere.fromPoints(t.positions).center,e=a._viewer.scene.globe.getHeight(a._Cesium.Cartographic.fromCartesian(e))||0,e=new a._Cesium.PolygonGeometry({polygonHierarchy:t,height:e,vertexFormat:a._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),e=new a._Cesium.GeometryInstance({geometry:e,attributes:{color:n}});r.push(e)})):console.warn('GeoJSONVectorTileProvider: geometry type "'+e.geometry.type+'" detected, but is not going to be rendered')}),new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:r})},Ae.prototype._cameraMoveEndHandler=function(){if(!this._stop){var o=this,r=Date.now(),e=this._viewer.scene.globe._surface._tilesToRender,t=e.map(function(e){return e.level}),i=Math.min.apply(Math,Me(t)),n=Math.max.apply(Math,Me(t));if(n<this._lowerLevelLimit)return o._tileKeys=[],o._removeObsoletePrimitives(o._primitiveByTile,[]),void(e=[]);if(this._upperLevelLimit&&i>this._upperLevelLimit)return o._tileKeys=[],o._removeObsoletePrimitives(o._primitiveByTile,[]),void(e=[]);(e=2<n-i?e.filter(function(e){return e.level>=n-2}):e).sort(function(e,t){return-(e.level-t.level)}),e=e.filter(function(e){return o._isTileInRange(e)}),this._upperLevelLimit&&(e=this._refineTiles(e,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=r;var a=[],s=0,l=0;e.forEach(function(t){var e,i="z"+t.level+"x"+t.x+"y"+t.y;a.push(i),o._tileKeys.push(i),o._primitiveByTile[i]||(e=o._urlTemplate.replace(window.encodeURIComponent("{x}"),t.x).replace(window.encodeURIComponent("{y}"),t.y).replace(window.encodeURIComponent("{z}"),t.level),s++,o._fetch(e).then(function(e){if(o._isRemoved)throw new Error("DISCARD");if(o._isCameraMoving)throw new Error("DISCARD");if(r!==o._moveEndTimestamp)throw new Error("DISCARD");e=o._loadTile(e,t);o._primitiveCollection.add(e),o._primitiveByTile[i]=e,s<=++l&&(o._tileKeys=a,o._removeObsoletePrimitives(o._primitiveByTile,a))}).catch(function(e){s<=++l&&(o._tileKeys=a,o._removeObsoletePrimitives(o._primitiveByTile,a)),e.message}))})}},Ae.prototype._refineTiles=function(e,s){var l=[],u=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level<s-1)u.includes(t)||(l.push(e),u.push(t));else if(e.level===s-1)for(var i=0;i<2;i++)for(var o=0;o<2;o++){var r="Z"+(e.level+1)+"X"+(2*e.x+i)+"Y"+(2*e.y+o);u.includes(r)||(l.push({x:2*e.x+i,y:2*e.y+o,level:e.level+1}),u.push(r))}else{var n,a=e.level-s;0==a?u.includes(t)||(l.push(e),u.push(t)):(n=2*a,t=Math.floor(e.x/n),a=Math.floor(e.y/n),u.includes(n="Z"+s+"X"+t+"Y"+a)||(l.push({x:t,y:a,level:s}),u.push(n)))}}),l},Ae.prototype._removeObsoletePrimitives=function(e,t){var i,o=[];for(i in 0<t.length&&(o=t),e)o.includes(i)||this._primitiveCollection.remove(e[i])&&delete e[i]},Ae.prototype.addTo=function(e){this._viewer=e,this._viewer.scene.primitives.add(this._primitiveCollection,this.availability),this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()},Ae.prototype.remove=function(){if(this._viewer){for(var e in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[e]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}},Ae.prototype.setStatus=function(e){this._stop=e,this._primitiveCollection._availability&&e?this._primitiveCollection._availability=void 0:this.availability&&!e&&(this._primitiveCollection._availability=this.availability)},Ae.prototype.isRemoved=function(){return this._isRemoved},Ae.prototype.filterBy=function(e,t,i){this._propertyToBeFiltered=e,this._valuesToBeFiltered=t},Ae.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null},Ae.prototype.edit=function(e,r){let d=this,p=this._viewer;if(r=r||{},this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),e=void 0===e?!0:e){var g,_,f,y;this.editHandler=new this._cesium.ScreenSpaceEventHandler(p.scene.canvas),this.isEditting=!1;let m;return this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))d.isEditting&&(v(),d.defaultEvent(!1));else{var i=t.position,o=p.scene.pick(i);if((!o||!o.id||o.id.treeID===d.treeID)&&o&&o.id&&(o.id instanceof Cesium.Entity||o.id.VectorType)){let e=o.id;d.isEditting||0!=we.states?(e!=g||"point"!==e.VectorType&&"billboard"!==e.VectorType&&"label"!==e.VectorType&&"model"!==e.VectorType)&&"_height_point"!=e.name&&"_edit_point"!=e.name&&"_move_point"!=e.name&&"_add_point"!=e.name&&"_size_point"!=e.name||(p.container.style.cursor="crosshair",d.defaultEvent(!1),"_height_point"==e.name?(f={windowPosition:i,originHeight:d._cesium.Cartographic.fromCartesian(e.position.getValue()).height},m="_height_point"):"_move_point"==e.name?m="_move_point":"point"===e.VectorType||"billboard"===e.VectorType||"label"===e.VectorType||"model"===e.VectorType?(d.tooltip.showAt(t.position,"释放后完成修改"),m="_move_point","model"===e.VectorType&&(e.show=!1)):"_edit_point"==e.name?m="_edit_point":"_add_point"==e.name?m="_add_point":"_size_point"==e.name&&(m="_size_point"),_=e):(r.callBack&&r.callBack.start&&r.callBack.start(e),y=e.VectorType,(g=d.createEditEntity(y,e.VectorStyle)).feature=e,g.treeID=d.treeID,d.getSimpleGraphicData(y,g),"point"===y||"billboard"===y||"label"===y||"model"===y?(d.isEditting=!0,d.tooltip.showAt(t.position,"拖拽修改位置")):(d.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint(),SmartEarthPopupData.editGraphic.setTreeID(d.treeID)),d.setStatus(!0),we.editVector=!0,d._primitiveCollection.show=!1)}}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))d.isEditting&&(v(),d.defaultEvent(!1));else{var o=p.scene.pick(t.endPosition);if((!o||!o.id||o.id.treeID===d.treeID)&&(d._cesium.defined(o)?d.isEditting&&!_?"point"!==y&&"billboard"!==y&&"label"!==y&&"model"!==y||o.id!=g?o.id&&"_edit_point"===o.id.name&&g.pottingPoint?("polyline"===y||"wall"===y)&&2<g.pottingPoint.length||"polygon"===y&&3<g.pottingPoint.length?d.tooltip.showAt(t.endPosition,"拖拽修改位置,右键删除点"):d.tooltip.showAt(t.endPosition,"拖拽修改位置"):!o.id||"_move_point"!==o.id.name&&"_size_point"!==o.id.name?o.id&&"_add_point"===o.id.name?d.tooltip.showAt(t.endPosition,"拖拽增加节点"):o.id&&"_height_point"===o.id.name?d.tooltip.showAt(t.endPosition,"拖拽修改高度"):o.id==g&&d.tooltip.show(!1):d.tooltip.showAt(t.endPosition,"拖拽修改位置"):d.tooltip.showAt(t.endPosition,"拖拽修改位置,右键删除"):d.isEditting||0!==we.states||(o.id&&o.id.VectorType?d.tooltip.showAt(t.endPosition,"点击激活编辑"):d.tooltip.show(!1)):0!=we.states||_||d.tooltip.show(!1),d.isEditting&&_)){d.tooltip.showAt(t.endPosition,"释放后完成修改");let i=d._getPosition.getMousePosition(t);if(i||"_height_point"===m)if("_edit_point"===m){_.position=i;var r=we.editPointID.edit.indexOf(_.id);if(void 0!==g[y].height?(o=d.toDegrees(i),g.pottingPoint[r]=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,g[y].height.getValue()),_.position=g.pottingPoint[r]):g.pottingPoint[r]=i,0<we.editPointID.add.length){if(0<r){let i=p.entities.getById(we.editPointID.add[r-1]);if(i){let e=p.entities.getById(we.editPointID.edit[r-1]),t=p.entities.getById(we.editPointID.edit[r]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}if(r<g.pottingPoint.length-1){let i=p.entities.getById(we.editPointID.add[r]);if(i){let e=p.entities.getById(we.editPointID.edit[r]),t=p.entities.getById(we.editPointID.edit[r+1]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}if("polygon"===y&&(0===r||r===g.pottingPoint.length-1)){let i=p.entities.getById(we.editPointID.add[we.editPointID.add.length-1]);if(i){let e=p.entities.getById(we.editPointID.edit[0]),t=p.entities.getById(we.editPointID.edit[g.pottingPoint.length-1]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}}let e=g.pottingPoint.concat([]),t=new d._cesium.Cartesian3;r=e.length;e.forEach(e=>{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=r,t.y/=r,t.z/=r,we.editPointID.move&&(we.editPointID.move.position=t),"polyline"!==y&&"wall"!==y&&"polygon"!==y&&"rectangle"!==y||SmartEarthPopupData.editGraphic.setValue("positions",e)}else if("_height_point"===m){var n=we.editPointID.height.indexOf(_.id);let e=p.entities.getById(we.editPointID.edit[n]);"ellipse"!==y&&"cylinder"!==y&&"box"!==y||(e=we.editPointID.move);let i=d.toDegrees(e.position.getValue());var a=f.originHeight-i.height,s=p.scene.cartesianToCanvasCoordinates(e.position.getValue()),n=(f.windowPosition.y-t.endPosition.y)*a/Math.abs(s.y-f.windowPosition.y);let o=Math.abs(a+n);we.editPointID.height.forEach(e=>{let t=p.entities.getById(e);t&&(e=t.position.getValue(),e=d.toDegrees(e),t.position=d._cesium.Cartesian3.fromDegrees(e.lon,e.lat,o+i.height))}),g[y].extrudedHeight?g[y].extrudedHeight=o+i.height:"box"===y?SmartEarthPopupData.editGraphic.setValue("height",o):"cylinder"===y&&SmartEarthPopupData.editGraphic.setValue("length",o)}else if("_add_point"===m){t=we.editPointID.add.indexOf(_.id);p.entities.remove(_);s=p.entities.add({name:"_edit_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.edit.splice(t+1,0,s.id),g.pottingPoint.splice(t+1,0,i.clone());a=Cesium.Cartesian3.midpoint(g.pottingPoint[t],g.pottingPoint[t+1],new Cesium.Cartesian3),n=p.entities.add({name:"_add_point",position:a,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),a=Cesium.Cartesian3.midpoint(g.pottingPoint[t+1],g.pottingPoint[t+2===g.pottingPoint.length?0:t+2],new Cesium.Cartesian3),a=p.entities.add({name:"_add_point",position:a,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.add.splice(t,1,n.id,a.id),SmartEarthPopupData.editGraphic.setTreeID(d.treeID),_=s,m="_edit_point";s=g.pottingPoint.concat([]);if("polyline"===y||"polygon"===y)SmartEarthPopupData.editGraphic.setValue("positions",s);else if("wall"===y){SmartEarthPopupData.editGraphic.setValue("positions",s);let e=SmartEarthPopupData.editGraphic.getValue("minimumHeights"),t=SmartEarthPopupData.editGraphic.getValue("maximumHeights");e.push(e[0]),t.push(t[0]),SmartEarthPopupData.editGraphic.setValue("minimumHeights",e),SmartEarthPopupData.editGraphic.setValue("maximumHeights",t)}}else if("_size_point"===m){var e=we.editPointID.move.position.getValue(),e=d._cesium.Cartesian3.distance(e,i);"ellipse"===y||"cylinder"===y||"ellipsoid"===y&&g.isSphere?SmartEarthPopupData.editGraphic.setValue("radius",e):"box"===y&&(l=90===_.angle?"long":"width",SmartEarthPopupData.editGraphic.setValue(l,2*e))}else if("point"!==y&&"billboard"!==y&&"label"!==y&&"model"!==y){var l=d.toDegrees(i);f=_.position.getValue();e=d.toDegrees(f);let n=l.lon-e.lon,a=l.lat-e.lat,s=l.height-e.height;_.position=i,g[y].height&&(h=d.toDegrees(i).height,g[y].height=h,g.thisHeight=h),g.pottingPoint.forEach((e,t)=>{let i,o,r=p.entities.getById(we.editPointID.edit[t]);if(r=r||p.entities.getById(we.editPointID.size[t]),i=r?d.toDegrees(r.position.getValue()):d.toDegrees(e),o=d._cesium.Cartesian3.fromDegrees(i.lon+n,i.lat+a,i.height+s),e.x=o.x,e.y=o.y,e.z=o.z,r&&(r.position=o),0<we.editPointID.add.length&&we.editPointID.add[t]){let e=p.entities.getById(we.editPointID.add[t]);e&&(i=d.toDegrees(e.position.getValue()),e.position=d._cesium.Cartesian3.fromDegrees(i.lon+n,i.lat+a,i.height+s))}});var u,c,h=g.pottingPoint.concat([]);"polyline"===y||"wall"===y||"polygon"===y||"rectangle"===y?SmartEarthPopupData.editGraphic.setValue("positions",h):"ellipse"===y?(g.pottingPoint[1]=i,g.position=i.clone()):"box"===y?(g.pottingPoint[2]=i,c=g.box.dimensions.getValue(),u=d.toDegrees(i),g.position=Cesium.Cartesian3.fromDegrees(u.lon,u.lat,u.height+c.z/2)):"cylinder"===y?(g.pottingPoint[1]=i,u=g.cylinder.length.getValue(),c=d.toDegrees(g.pottingPoint[1]),g.position=Cesium.Cartesian3.fromDegrees(c.lon,c.lat,c.height+u/2)):"ellipsoid"===y&&(g.pottingPoint[g.pottingPoint.length-1]=i,g.position=i.clone())}else _.position=i}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(e=>{Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?d.isEditting&&(v(),d.defaultEvent(!1)):(_&&"model"===_.VectorType&&(_.show=!0),_&&r.callBack&&r.callBack.updata&&r.callBack.updata(_.name,g),p.container.style.cursor="default",_=void 0,d.defaultEvent(!0))},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(e=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))d.isEditting&&(v(),d.defaultEvent(!1));else{var i=p.scene.pick(e.position);if((!i||!i.id||i.id.treeID===d.treeID)&&d._cesium.defined(i)&&0==we.states){e=i.id;if(!e.VectorType&&-1<we.editPointID.edit.indexOf(e.id)&&(("polyline"===y||"wall"===y)&&2<we.editPointID.edit.length||"polygon"===y&&3<we.editPointID.edit.length)){i=we.editPointID.edit.indexOf(e.id);if(p.entities.removeById(e.id),we.editPointID.edit.splice(i,1),g.pottingPoint.splice(i,1),0<we.editPointID.add.length)if(we.editPointID.add[i]){if(p.entities.removeById(we.editPointID.add[i]),we.editPointID.add.splice(i,1),0<=i-1){let e=p.entities.getById(we.editPointID.add[i-1]);e&&(e.position=Cesium.Cartesian3.midpoint(g.pottingPoint[i-1],g.pottingPoint[i===g.pottingPoint.length?0:i],new Cesium.Cartesian3))}else if(i-1==-1&&"polygon"===y){let e=p.entities.getById(we.editPointID.add[we.editPointID.add.length-1]);e&&(e.position=Cesium.Cartesian3.midpoint(g.pottingPoint[0],g.pottingPoint[g.pottingPoint.length-1],new Cesium.Cartesian3))}}else p.entities.removeById(we.editPointID.add[i-1]),we.editPointID.add.pop();let t=new d._cesium.Cartesian3;i=g.pottingPoint.length;g.pottingPoint.forEach(e=>{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=i,t.y/=i,t.z/=i,we.editPointID.move&&(we.editPointID.move.position=t);i=g.pottingPoint.concat([]);if("polyline"===y||"polygon"===y)SmartEarthPopupData.editGraphic.setValue("positions",i);else if("wall"===y){SmartEarthPopupData.editGraphic.setValue("positions",i);let e=SmartEarthPopupData.editGraphic.getValue("minimumHeights"),t=SmartEarthPopupData.editGraphic.getValue("maximumHeights");e.pop(),t.pop(),SmartEarthPopupData.editGraphic.setValue("minimumHeights",e),SmartEarthPopupData.editGraphic.setValue("maximumHeights",t)}d.tooltip.show(!1),r.callBack&&r.callBack.updata&&r.callBack.updata(_&&_.name,g)}}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),v(),{endThisEdit:v,getEditData:function(){return{entity:g}}};function v(){d.defaultEvent(!0),we.editPointID.edit.forEach(e=>{p.entities.removeById(e)}),we.editPointID.edit=[],we.editPointID.height.forEach(e=>{p.entities.removeById(e)}),we.editPointID.height=[],we.editPointID.add.forEach(e=>{p.entities.removeById(e)}),we.editPointID.add=[],we.editPointID.size.forEach(e=>{p.entities.removeById(e)}),we.editPointID.size=[],we.editPointID.move&&p.entities.remove(we.editPointID.move),we.editPointID.move=void 0,g&&p.entities.remove(g),y=g=void 0,SmartEarthPopupData.editGraphic={},d.isEditting=!1,d.setStatus(!1),we.editVector=!1,d._primitiveCollection.show=!0,d.delButton(!1)}}else v()},Ae.prototype.createEditEntity=function(e,i){let o;var r=this;let n=this._viewer;if("polygon"===e){let e=i.positions;var a=r._core.defaultValue(i.height,void 0);let t;t=i.hierarchy||(e=i.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(e):r._cesium.Cartesian3.fromDegreesArray(e),new r._cesium.PolygonHierarchy(e)),o=n.entities.add({polygon:{hierarchy:new r._cesium.CallbackProperty(function(){return t},!1),extrudedHeight:r._core.defaultValue(i.extrudedHeight,void 0),height:a,material:new r._cesium.ImageMaterialProperty({image:r._core.defaultValue(i.image,null),repeat:r._core.defaultValue(i.repeat,new r._cesium.Cartesian2(1,1)),color:i.material}),shadows:r._cesium.ShadowMode.ENABLED,fill:!0}}),o.VectorType="polygon"}else if("polyline"===e){let e=i.positions;e=i.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(e):r._cesium.Cartesian3.fromDegreesArray(e),o=n.entities.add({polyline:{positions:new r._cesium.CallbackProperty(function(){return e},!1),clampToGround:r._core.defaultValue(i.clampToGround,!1),material:new Cesium.PolylineOutlineMaterialProperty({color:i.material,outlineWidth:r._core.defaultValue(i.outlineWidth,0),outlineColor:r._cesium.Color.fromCssColorString(r._core.defaultValue(i.outlineColor,"rgba(255,255,255,0.6)"))}),width:r._core.defaultValue(i.width,3)}}),o.VectorType="polyline"}else if("wall"===e){let e=i.positions;e=i.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(e):r._cesium.Cartesian3.fromDegreesArray(e),o=n.entities.add({wall:{positions:new r._cesium.CallbackProperty(function(){return e},!1),minimumHeights:i.minimumHeights,maximumHeights:i.maximumHeights,material:i.material,outline:!0,outlineWidth:r._core.defaultValue(i.outlineWidth,0),outlineColor:i.outlineColor}}),o.VectorType="wall"}else"label"===e?(o=n.entities.add({position:i.position,label:{text:i.text,font:i.font,scale:i.scale,style:i.style,fillColor:i.fillColor,outlineColor:i.outlineColor,outlineWidth:i.outlineWidth,showBackground:i.showBackground,backgroundColor:i.backgroundColor,heightReference:i.heightReference,horizontalOrigin:i.horizontalOrigin,verticalOrigin:i.verticalOrigin,scaleByDistance:i.scaleByDistance,distanceDisplayCondition:i.distanceDisplayCondition}}),o.VectorType="label"):"billboard"===e&&(o=n.entities.add({position:i.position,billboard:{rotation:i.rotation,width:i.width,height:i.height,image:i.image,color:i.color,scale:i.scale,heightReference:i.heightReference,horizontalOrigin:i.horizontalOrigin,verticalOrigin:i.verticalOrigin,scaleByDistance:i.scaleByDistance,distanceDisplayCondition:i.distanceDisplayCondition}}),o.VectorType="billboard");return o},Ae.prototype.delButton=function(e,t,i){if(e){let e=document.getElementById("DeleteMilitaryStandardDelete");e||(e=document.createElement("button"),e.id="DeleteMilitaryStandardDelete",e.innerText="删除对象",e.style.cssText=`height: 38px;
                    line-height: 38px;
                    padding: 0 18px;
                    background-color: #052355;
                    color: #fff;
                    white-space: nowrap;
                    text-align: center;
                    font-size: 14px;
                    border: none;
                    border-radius: 2px;
                    cursor: pointer;
                    position: absolute;`,this._viewer.container.appendChild(e)),e.style.display="block",e.style.top=t.y+"px",e.style.left=t.x+"px",e.onclick=i}else{let e=document.getElementById("DeleteMilitaryStandardDelete");e&&(e.style.display="none",e.onclick=null)}},Ae.prototype.defaultEvent=function(e){let t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},Ae.prototype.getEntityTypeAndObject=function(e){let t={type:"",object:null};return e&&(e.billboard?(t.type="billboard",t.object=e.billboard):e.box?(t.type="box",t.object=e.box):e.corridor?(t.type="corridor",t.object=e.corridor):e.cylinder?(t.type="cylinder",t.object=e.cylinder):e.ellipse?(t.type="ellipse",t.object=e.ellipse):e.ellipsoid?(t.type="ellipsoid",t.object=e.ellipsoid):e.label?(t.type="label",t.object=e.label):e.model?(t.type="model",t.object=e.model):e.path?(t.type="path",t.object=e.path):e.plane?(t.type="plane",t.object=e.plane):e.point?(t.type="point",t.object=e.point):e.polygon?(t.type="polygon",t.object=e.polygon):e.polyline?(t.type="polyline",t.object=e.polyline):e.polylineVolume?(t.type="polylineVolume",t.object=e.polylineVolume):e.rectangle?(t.type="rectangle",t.object=e.rectangle):e.wall&&(t.type="wall",t.object=e.wall)),t},Ae.prototype.toDegrees=function(e){e=this._cesium.Cartographic.fromCartesian(e);return{lon:this._cesium.Math.toDegrees(e.longitude),lat:this._cesium.Math.toDegrees(e.latitude),height:e.height}},Ae.prototype.getSimpleGraphicData=function(e,a){let s=this,l=this._viewer;var t,i,o,r,n;function u(e){SmartEarthPopupData.editGraphic.fillColor=h("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.alpha=100*e.alpha}function c(e){SmartEarthPopupData.editGraphic.outlineColor=h("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.outlineAlpha=100*e.alpha}function h(e){let t=e;if(/^(rgb|RGB)/.test(t)){let e=t.replace(/(rgb|RGB)*/g,"");e=e.replace("(","").replace(")","");var o=e.split(",");let i="#";for(let t=0;t<o.length;t++){let e=Number(o[t]).toString(16);e=1===e.length?"0"+e:e,"0"===e&&(e+=e),i+=e}return 7!==i.length&&(i=t),i}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;var i=t.replace(/#/,"").split("");if(6===i.length)return t;if(3===i.length){let t="#";for(let e=0;e<i.length;e+=1)t+=i[e]+i[e];return t}}SmartEarthPopupData.editGraphic={entity:a,type:e,graphic:a[e],getValue:function(e){if("position"===e||"name"===e||"id"===e)return this.entity[e]&&(this.entity[e].getValue?this.entity[e].getValue():this.entity[e]);if("radius"===e)return"ellipse"===this.type?this.graphic.semiMajorAxis.getValue():"ellipsoid"===this.type?this.graphic.radii.getValue().x:"cylinder"===this.type?this.graphic.bottomRadius.getValue():void 0;if("pHeight"!==e)return"repeat"===e?this.graphic.material[e]&&(this.graphic.material[e].getValue?this.graphic.material[e].getValue():this.graphic.material[e]):this.graphic[e]&&(this.graphic[e].getValue?this.graphic[e].getValue():this.graphic[e]);if(this.getValue("position")){e=this.getValue("position");return Cesium.Cartographic.fromCartesian(e).height}},changeHeightPoint:function(i){0<we.editPointID.height.length&&we.editPointID.height.forEach(e=>{let t=l.entities.getById(e);t&&(e=t.position.getValue(),e=s.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i))})},changeEditPoint:function(i){0<we.editPointID.edit.length&&we.editPointID.edit.forEach(e=>{let t=l.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=s.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))}),0<we.editPointID.size.length&&we.editPointID.size.forEach(e=>{let t=l.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=s.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))}),0<we.editPointID.add.length&&we.editPointID.add.forEach(e=>{let t=l.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=s.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))});let e=we.editPointID.move;var t;e&&("clampToGround"===i?e.point.heightReference=1:(e.point.heightReference=0,t=e.position.getValue(),t=s.toDegrees(t),e.position=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,i)))},clearAllEditPoint:function(){we.editPointID.edit.forEach(e=>{l.entities.removeById(e)}),we.editPointID.edit=[],we.editPointID.height.forEach(e=>{l.entities.removeById(e)}),we.editPointID.height=[],we.editPointID.add.forEach(e=>{l.entities.removeById(e)}),we.editPointID.add=[],we.editPointID.size.forEach(e=>{l.entities.removeById(e)}),we.editPointID.size=[],we.editPointID.move&&l.entities.remove(we.editPointID.move),we.editPointID.move=void 0},setTreeID:function(i){we.editPointID.edit.forEach(e=>{let t=l.entities.getById(e);t.treeID=i}),we.editPointID.height.forEach(e=>{let t=l.entities.getById(e);t.treeID=i}),we.editPointID.add.forEach(e=>{let t=l.entities.getById(e);t.treeID=i}),we.editPointID.size.forEach(e=>{let t=l.entities.getById(e);t.treeID=i}),we.editPointID.move&&(we.editPointID.move.treeID=i)}},"billboard"===e||"point"===e||"label"===e||"model"===e?((t=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor"))?u(t):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(t=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(t):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),"label"===e&&((i=SmartEarthPopupData.editGraphic.getValue("backgroundColor"))?(n=i,SmartEarthPopupData.editGraphic.backgroundColor=h("rgb("+255*n.red+","+255*n.green+","+255*n.blue+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=100*n.alpha):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("position"===e||"name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e||"backgroundColor"===e||"fillColor"===e)t=Cesium.Color.fromCssColorString(t);else if("fontSize"===e){let e=this.getValue("font");e=e.split(" "),e[0]=t,t=e.join(" ")}else{if("alpha"===e)return void("label"===this.type?this.graphic.fillColor._value.alpha=t:this.graphic.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("backgroundAlpha"===e)return void(this.graphic.backgroundColor._value.alpha=t);if("pHeight"===e&&this.getValue("position")){var i=this.getValue("position");let e=Cesium.Cartographic.fromCartesian(i);return e.height=t,void(this.entity.position=Cesium.Cartographic.toCartesian(e))}}this.graphic[e]=t}}):"polyline"===e?((i=SmartEarthPopupData.editGraphic.getValue("material")).color?u(i.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),i.outlineColor?c(i.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e)return t=Cesium.Color.fromCssColorString(t),void(this.graphic.material[e]=t);"outlineWidth"!==e?"alpha"!==e?"outlineAlpha"!==e?this.graphic[e]="positions"!==e?t:new Cesium.CallbackProperty(function(){return t},!1):this.graphic.material.outlineColor._value.alpha=t:this.graphic.material.color._value.alpha=t:this.graphic.material[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("positions");return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let o=new Cesium.Cartesian3;t.forEach((e,t)=>{var i=l.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=t.length,o.y/=t.length,o.z/=t.length,we.editPointID.move=l.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let e=0;e<t.length-1;e++){var i=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),i=l.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.add.push(i.id)}}}):"polygon"===e?((o=SmartEarthPopupData.editGraphic.getValue("material")).color?u(o.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(o=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(o):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,i){if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("positions"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(i)},!1));if("hierarchy"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return i},!1));if("clampToGround"===e){function t(e,t,i){i?(e.perPositionHeight=!1,e.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(e.perPositionHeight=!0,e.heightReference=Cesium.HeightReference.NONE),0<we.editPointID.edit.length&&!i&&t.forEach((e,t)=>{let i=l.entities.getById(we.editPointID.edit[t]);i&&(t=i.position.getValue(),e.x=t.x,e.y=t.y,e.z=t.z)}),e.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)}return this.graphic.hierarchy instanceof Cesium.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(()=>{t(this.graphic,this.entity.pottingPoint,i)},100)):t(this.graphic,this.entity.pottingPoint,i),void(0<we.editPointID.add.length&&we.editPointID.add.forEach(e=>{let t=l.entities.getById(e);t&&(t.point.heightReference=i?1:0)}))}"extrudedHeight"===e?this.changeHeightPoint(i):"height"===e&&this.changeEditPoint(i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let e=this.getValue("hierarchy"),t=e.positions.concat([]);if(void 0!==this.getValue("height")){let i=this.getValue("height");t.forEach(e=>{var t=s.toDegrees(e),t=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,i);e.x=t.x,e.y=t.y,e.z=t.z})}return this.entity.pottingPoint=t,t},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let o=new Cesium.Cartesian3;t.forEach((e,t)=>{var i=l.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=t.length,o.y/=t.length,o.z/=t.length,we.editPointID.move=l.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let e=0;e<t.length-1;e++){var i=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),i=l.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.add.push(i.id)}var e=Cesium.Cartesian3.midpoint(t[0],t[t.length-1],new Cesium.Cartesian3),e=l.entities.add({name:"_add_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.add.push(e.id)}}):"ellipse"===e||"cylinder"===e||a.isSphere?((o=SmartEarthPopupData.editGraphic.getValue("material")).color?u(o.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(o=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(o):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,i){if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("semiMajorAxis"===e)return void(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return i},!1));if("semiMinorAxis"===e)return void(this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return i},!1));if("radii"===e)return void(this.graphic.radii=new Cesium.CallbackProperty(function(){return i},!1));if("topRadius"===e)return void(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return i},!1));if("bottomRadius"===e)return void(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return i},!1));if("radius"===e){"ellipse"===this.type?(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return i},!1),this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return i},!1)):"ellipsoid"===this.type?null!==this.graphic.material.image.getValue()?this.graphic.radii=new Cesium.Cartesian3(i,i,i):this.graphic.radii=new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(i,i,i)},!1):"cylinder"===this.type&&(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return i},!1),this.entity.changeTop&&(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return i},!1)));var o=we.editPointID.move.position.getValue(),r=s.GetPositionFromA_D(o,i,90);let e=l.entities.getById(we.editPointID.size[0]);e.position=r,a.pottingPoint[0]=r,a.pottingPoint[a.pottingPoint.length-1]=o;let t=l.entities.getById(we.editPointID.height[0]);return void(t&&(r=s.toDegrees(r),n=s._cesium.Cartographic.fromCartesian(t.position.getValue()),t.position=s._cesium.Cartesian3.fromDegrees(r.lon,r.lat,n.height)))}if("cylinder"===this.type&&"length"===e){this.graphic.length=i;var n=s.toDegrees(this.entity.pottingPoint[1]);return this.entity.position=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,n.height+i/2),void this.changeHeightPoint(n.height+i)}if("ellipse"===this.type&&"clampToGround"===e){function t(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);let o=t.semiMinorAxis.getValue();t.semiMinorAxis=new Cesium.CallbackProperty(function(){return o},!1),t.semiMajorAxis=new Cesium.CallbackProperty(function(){return o},!1)}return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(()=>{t(this.entity,this.graphic,i)},100)):t(this.entity,this.graphic,i),void(i?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"ellipse"===this.type&&"extrudedHeight"===e?this.changeHeightPoint(i):"ellipse"===this.type&&"height"===e&&(this.changeEditPoint(i),this.entity.thisHeight=i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e,t=this.getValue("radius");let i=this.getValue("position");if("ellipse"===this.type||this.entity.isSphere){"ellipse"===this.type&&void 0!==this.getValue("height")&&(o=this.getValue("height"),e=s.toDegrees(i),i=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,o));var o=s.GetPositionFromA_D(i,t,90);return this.entity.pottingPoint=[o,i],[o,i]}o=s.toDegrees(i);i=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height-this.getValue("length")/2);t=s.GetPositionFromA_D(i,t,90);return this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var t=this.getPottingPoint();if(t){let e=l.entities.add({name:"_size_point",position:t[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});e.angle=90,we.editPointID.size.push(e.id),we.editPointID.move=l.entities.add({name:"_move_point",position:t[1],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}):"rectangle"===e?((r=SmartEarthPopupData.editGraphic.getValue("material")).color?u(r.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(r=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(r):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return Cesium.Rectangle.fromCartesianArray(t)},!1));if("coordinates"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return t},!1));if("clampToGround"===e){function i(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);let o=t.coordinates.getValue();t.coordinates=new Cesium.CallbackProperty(function(){return o},!1)}return this.graphic.coordinates instanceof Cesium.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(()=>{i(this.entity,this.graphic,t)},100)):i(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"extrudedHeight"===e?this.changeHeightPoint(t):"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("coordinates");let t,i,o=this.getValue("height");return i=(void 0!==o?t=Cesium.Cartesian3.fromRadians(e.west,e.north,o):(o=l.scene.sampleHeight(new Cesium.Cartographic(e.west,e.north,0),[this.entity]),t=Cesium.Cartesian3.fromRadians(e.west,e.north,o),o=l.scene.sampleHeight(new Cesium.Cartographic(e.east,e.south,0),[this.entity])),Cesium.Cartesian3.fromRadians(e.east,e.south,o)),this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let e=this.getPottingPoint();if(e){let o=new Cesium.Cartesian3;e.forEach((e,t)=>{var i=l.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=e.length,o.y/=e.length,o.z/=e.length,we.editPointID.move=l.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}):"box"===e?((r=SmartEarthPopupData.editGraphic.getValue("material")).color?u(r.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(r=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(r):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(t,i){if("name"===t)this.entity[t]=i;else{if("color"===t||"outlineColor"===t){if(i=Cesium.Color.fromCssColorString(i),"color"===t)return void(this.graphic.material.color=i)}else{if("image"===t||"repeat"===t)return void(this.graphic.material[t]=i);if("alpha"===t)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===t)return void(this.graphic.outlineColor._value.alpha=i);if("long"===t||"width"===t||"height"===t){let e=this.getValue("dimensions");if("long"===t?e.x=i:"width"===t?e.y=i:e.z=i,this.graphic.dimensions=new Cesium.CallbackProperty(function(){return e},!1),"long"===t||"width"===t){var o="long"===t?90:180,r="long"===t?0:1,n=we.editPointID.move.position.getValue(),o=s.GetPositionFromA_D(n,i/2,o);let e=l.entities.getById(we.editPointID.size[r]);e.position=o,this.entity.pottingPoint[r]=o,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{n=s.toDegrees(we.editPointID.move.position.getValue());this.entity.position=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,n.height+i/2),this.changeHeightPoint(n.height+i)}return}if("dimensions"===t)return void(this.graphic.dimensions=new Cesium.CallbackProperty(function(){return i},!1))}this.graphic[t]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("dimensions"),t=this.getValue("position"),i=s.toDegrees(t),t=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height-e.z/2),i=s.GetPositionFromA_D(t,e.x/2,90),e=s.GetPositionFromA_D(t,e.y/2,180);return this.entity.pottingPoint=[i,e,t],[i,e,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var i=this.getPottingPoint();if(i){let e=l.entities.add({name:"_size_point",position:i[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});e.angle=90;let t=l.entities.add({name:"_size_point",position:i[1],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});t.angle=180,we.editPointID.size.push(e.id),we.editPointID.size.push(t.id),we.editPointID.move=l.entities.add({name:"_move_point",position:i[2],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}):"corridor"===e||"ellipsoid"===e&&!a.isSphere||"path"===e||"plane"===e||"polylineVolume"===e||"wall"===e&&((e=SmartEarthPopupData.editGraphic.getValue("material")).color?u(e.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(e=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(e):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e)return t=Cesium.Color.fromCssColorString(t),void(this.graphic.material[e]=t);"alpha"!==e?"outlineAlpha"!==e?this.graphic[e]="positions"!==e?t:new Cesium.CallbackProperty(function(){return t},!1):this.graphic.outlineColor._value.alpha=t:this.graphic.material.color._value.alpha=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("positions");return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let i=new Cesium.Cartesian3,o=this.getValue("minimumHeights");t.forEach((e,t)=>{e=Cesium.Cartographic.fromCartesian(e),e=Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,o[t]),t=l.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.edit.push(t.id),i.x+=e.x,i.y+=e.y,i.z+=e.z}),i.x/=t.length,i.y/=t.length,i.z/=t.length,we.editPointID.move=l.entities.add({name:"_move_point",position:i,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let e=0;e<t.length-1;e++){var r=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),r=l.entities.add({name:"_add_point",position:r,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.add.push(r.id)}}})},Re.prototype.createBillboardPointGeoJsonFeatureLayer=function(e,t,l,i,u){null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t),c=this;o.then(function(e){var t={show:!0,position:c._cesium.Cartesian3.ZERO,pixelOffset:c._cesium.Cartesian2.ZERO,eyeOffset:c._cesium.Cartesian3.ZERO,heightReference:c._cesium.HeightReference.NONE,horizontalOrigin:c._cesium.HorizontalOrigin.CENTER,verticalOrigin:c._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:c._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:c._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0};c._core.isnull(l)||c._core.isnull(l.color)||/^\[/.test(l.color)&&"["==l.color.charAt(0)&&"]"==l.color.charAt(l.color.length-1)||(c._core.isHtmlColor(l.color)?l.color=c._color.colorFromHtmlColor(l.color):(/^rgb/.test(l.color)&&(l.color=c._color.rgbaStringToRgbaObj(l.color)),1<l.color.r&&(l.color.r=l.color.r/255),1<l.color.g&&(l.color.g=l.color.g/255),1<l.color.b&&(l.color.b=l.color.b/255),1<l.color.a&&(l.color.a=l.color.a/255),l.color=c._color.createColor(l.color.r,l.color.g,l.color.b,l.color.a)));var i=c._core.extend(t,l,!0);c._core.isnull(l.near)&&(l.near=0),c._core.isnull(l.far)&&(l.far=999999999);var o=parseFloat(l.near),t=parseFloat(l.far);new c._cesium.DistanceDisplayCondition(o,t);for(var r=new c._cesium.BillboardCollection,n=e.entities.values,a=0;a<n.length;a++){var s=n[a];i.position=s.position._value,r.add(i)}e=c._viewer.scene.primitives.add(r);"function"==typeof u&&u(e)});o=this._core.getuid(),t={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"billboardLayer",item:this,url:t,style:options};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Re.prototype.createBillboardGeoJsonFeatureLayerProvider=function(e,t,n,i,o,r){var a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},s=new Ae(this._viewer,this._cesium,a);this._Provider=s;var l=this;s._loadTile=function(e){var t={show:!0,position:l._cesium.Cartesian3.ZERO,pixelOffset:l._cesium.Cartesian2.ZERO,eyeOffset:l._cesium.Cartesian3.ZERO,heightReference:l._cesium.HeightReference.NONE,horizontalOrigin:l._cesium.HorizontalOrigin.CENTER,verticalOrigin:l._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:l._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:l._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0};l._core.isnull(n)||l._core.isnull(n.color)||/^\[/.test(n.color)&&"["==n.color.charAt(0)&&"]"==n.color.charAt(n.color.length-1)||(l._core.isHtmlColor(n.color)?n.color=l._color.colorFromHtmlColor(n.color):(/^rgb/.test(n.color)&&(n.color=l._color.rgbaStringToRgbaObj(n.color)),1<n.color.r&&(n.color.r=n.color.r/255),1<n.color.g&&(n.color.g=n.color.g/255),1<n.color.b&&(n.color.b=n.color.b/255),1<n.color.a&&(n.color.a=n.color.a/255),n.color=l._color.createColor(n.color.r,n.color.g,n.color.b,n.color.a)));var i=l._core.extend(t,n,!0);l._core.isnull(n.near)&&(n.near=0),l._core.isnull(n.far)&&(n.far=999999999);var o=parseFloat(n.near),t=parseFloat(n.far);new l._cesium.DistanceDisplayCondition(o,t);var r=new l._cesium.BillboardCollection;return e.features.forEach(function(e){var t;i.id=e,/^\[/.test(i.pointHeight)&&/\]$/.test(i.pointHeight)?(t=i.pointHeight.replace(/\[/,"").replace(/\]/,""),t=parseFloat(e.properties[t]),e.geometry.coordinates.push(t),i.position=l._cesium.Cartesian3.fromDegreesArrayHeights(e.geometry.coordinates)[0]):i.pointHeight?(t=parseFloat(i.pointHeight),e.geometry.coordinates.push(t),i.position=l._cesium.Cartesian3.fromDegreesArrayHeights(e.geometry.coordinates)[0]):i.position=l._cesium.Cartesian3.fromDegreesArray(e.geometry.coordinates)[0],i.id.treeID=n.id,i.id.VectorType="billboard",i.id.VectorStyle={position:i.position,pointHeight:t,rotation:i.rotation,width:i.width,height:i.height,image:i.image,color:i.color,scale:i.scale,heightReference:i.heightReference,horizontalOrigin:i.horizontalOrigin,verticalOrigin:i.verticalOrigin,scaleByDistance:i.scaleByDistance,distanceDisplayCondition:i.distanceDisplayCondition},r.add(i)}),r},n&&n.time&&(s.availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:n.time.start?l._cesium.JulianDate.fromDate(new Date(n.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:n.time.end?l._cesium.JulianDate.fromDate(new Date(n.time.end)):l._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=s._primitiveCollection,s.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+n.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;a={id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"imageLayer",item:this,url:a.url,style:n};return this._Provider.treeID=n.id,this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Re.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},Re.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(e)}catch(e){}},Re.prototype.setVisibility=function(e){this.item.show=e,this._Provider&&this._Provider.setStatus(!e),e||this.item.removeAll()},Re.prototype.deleteObject=function(){if(null!=this._Provider&&this._Provider.setStatus(!1),null!=this.items&&null!=this.items&&0<this.items.length)for(var e=0;e<this.items.length;e++)this._viewer.scene.primitives.remove(this.items[e]);else this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},Re.prototype.setTreeobj=function(e){this.treeobj=e},Re.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},Re.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},Oe.prototype.createGeojsonFeatureLayer=function(e,t,i,o,r,s){var n=t.url,a=t.maxLevel,l=t.minLevel,u=this._core.StyleContrastGeoJson(i,this._cesium);null==n&&console.log("geojson is required");var c=null,c=n.then?n:this._cesium.GeoJsonDataSource.load(n);this._viewer.dataSources.add(c);var h=this;!this.setNearAndFar&&a&&l&&(this.setNearAndFar=!0,this.Level=0,this._viewer.scene.preRender.addEventListener(function(){h.isShow&&h.item&&(h.Level=h.getLevel(),h.Level>=l&&h.Level<=a&&!h.item.show?h.item.show=!0:(h.Level<l||h.Level>a)&&(h.item.show=!1))})),c.then(function(e){for(var t=(h.item=e).entities.values,i=0;i<t.length;i++){var o,r,n,a=t[i];null!=u.point&&((o=u.point).color=h._color.VectorColorTransformation(o.color,a),o.outlineColor=h._color.VectorColorTransformation(o.outlineColor,a),null!=o.pointHeight&&(a.position._value=h._core.setheight(a.position._value,o.pointHeight,h._cesium,h._viewer),delete o.pointHeight),a.point=new h._cesium.PointGraphics(o)),null!=u.label&&((r=u.label).fillColor=h._color.VectorColorTransformation(r.fillColor,a),r.outlineColor=h._color.VectorColorTransformation(r.outlineColor,a),null!=r.pointHeight&&(a.position._value=h._core.setheight(a.position._value,r.pointHeight,h._cesium,h._viewer),delete r.pointHeight),a.label=new h._cesium.LabelGraphics(r)),null!=u.billboard&&((r=u.billboard).color=h._color.VectorColorTransformation(r.color,a),null!=r.pointHeight&&(a.position._value=h._core.setheight(a.position._value,r.pointHeight,h._cesium,h._viewer),delete r.pointHeight),a.billboard=new h._cesium.BillboardGraphics(r)),null!=u.polyline&&((n=u.polyline).material=h._color.VectorColorTransformation(n.material,a),n.positions=a.polyline.positions,null!=n.pointHeight&&(a.position._value=h._core.setpolylineheight(a.position._value,n.pointHeight,h._cesium,h._viewer),delete n.pointHeight),a.polyline=new h._cesium.PolylineGraphics(n)),null!=u.polygon&&((n=u.polygon).hierarchy=a.polygon.hierarchy,n.material=h._color.VectorColorTransformation(n.material,a),n.outlineColor=h._color.VectorColorTransformation(n.outlineColor,a),n.outlineColor&&(n.outline=!0),a.polygon=new h._cesium.PolygonGraphics(n))}"function"==typeof s&&s(e)}),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),r?h.isShow=!0:h.setVisibility(!1);r={id:u.id,name:e,checked:r,pId:this._core.isnull(o)?0:o,type:"datasource",item:this,url:n,style:u,treeData:{name:e,geoOptions:t,styleOption:i,GroupID:o,checked:r,disFnc:s}};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(o)?0:o),this},Oe.prototype.createGeojsonKmlFeatureLayer=function(e,t,i,o,r){var n=t,a={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas};this._viewer.dataSources.add(this._cesium.KmlDataSource.load(t,a));this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),o||this.setVisibility(!1);r={id:a.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"datasource",item:this,url:n,style:a,treeData:{name:e,geoOptions:t,styleOption:"",GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),this},Oe.prototype.createGeoJsonFeatureLayerAlawys=function(e,t,s,i,l){var o={id:this._core.getuid(),layertype:"",text:"",font:"16px",fillColor:this._cesium.WHITE,outlineColor:this._cesium.BLACK,outlineWidth:"1.0",scale:"1.0",maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,icon:""};this._core.isnull(s)||this._core.isnull(s.fillColor)||"["==s.fillColor.toString().charAt(0)&&"]"==s.fillColor.toString().charAt(s.fillColor.length-1)||(this._core.isHtmlColor(s.fillColor)?s.fillColor=this._color.colorFromHtmlColor(s.fillColor):s.fillColor=this._color.createColor(s.fillColor.r,s.fillColor.g,s.fillColor.b,s.fillColor.a)),this._core.isnull(s)||this._core.isnull(s.outlineColor)||"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(this._core.isHtmlColor(s.outlineColor)?s.outlineColor=this._color.colorFromHtmlColor(s.outlineColor):s.outlineColor=this._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a));var u=this._core.extend(o,s,!0);null==t&&console.log("geojson is required");o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o);var c,h=this;s&&s.time&&(c=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:s.time.start?h._cesium.JulianDate.fromDate(new Date(s.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?h._cesium.JulianDate.fromDate(new Date(s.time.end)):h._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(h.item=e).entities.values,i=0;i<t.length;i++){var o=t[i];u.id=h._core.extendgl(o,s.id,u.id),u.text=h._core.extendgl(o,s.text,u.text),u.font=h._core.extendgl(o,s.font,u.font),u.fillColor=h._core.extendgl(o,s.fillColor,u.fillColor),u.outlineColor=h._core.extendgl(o,s.outlineColor,u.outlineColor),u.outlineWidth=parseInt(h._core.extendgl(o,s.outlineWidth,u.outlineWidth)),u.scale=parseFloat(h._core.extendgl(o,s.scale,u.scale)),u.image=h._core.extendgl(o,s.image,u.image),u.icon=h._core.extendgl(o,s.icon,u.icon);var r,n=parseFloat(h._core.extendgl(o,u.minDistanceDisplay||u.near)),a=parseFloat(h._core.extendgl(o,u.maxDistanceDisplay||u.far)),a=new h._cesium.DistanceDisplayCondition(n,a);o.billboard&&(u?(h._core.isUrl(o.properties[u.icon])||h._core.isUrl(u.icon))&&!h._core.isnull(o.properties[u.text])||!h._core.isnull(u.text)?(r="fillColor:"+255*u.fillColor.red+","+255*u.fillColor.green+","+255*u.fillColor.blue+";outlineColor:"+255*u.outlineColor.red+","+255*u.outlineColor.green+","+255*u.outlineColor.blue,h.Legend.push(r),o.label={id:"my label",text:h._core.isnull(o.properties[u.text])?u.text:o.properties[u.text]+"",font:u.font+" sans-serif",fillColor:u.fillColor,outlineColor:u.outlineColor,outlineWidth:u.outlineWidth,scale:parseFloat(u.scale),distanceDisplayCondition:a},o.billboard={image:h._core.isUrl(o.properties[u.icon])?o.properties[u.icon]:u.icon,distanceDisplayCondition:a}):h._core.isnull(u.icon)?h._core.isnull(o.properties[u.text])&&h._core.isnull(u.text)?(r="color:"+255*u.fillColor.red+","+255*u.fillColor.green+","+255*u.fillColor.blue,h.Legend.push(r),o.billboard=void 0,o.point=new h._cesium.PointGraphics({color:h._cesium.Color.RED,pixelSize:10,distanceDisplayCondition:a})):(o.billboard=void 0,r="fillColor:"+255*u.fillColor.red+","+255*u.fillColor.green+","+255*u.fillColor.blue+";outlineColor:"+255*u.outlineColor.red+","+255*u.outlineColor.green+","+255*u.outlineColor.blue,h.Legend.push(r),o.label={id:"my label",text:h._core.isnull(o.properties[u.text])?u.text:o.properties[u.text]+"",font:u.font+" sans-serif",fillColor:u.fillColor,outlineColor:u.outlineColor,outlineWidth:u.outlineWidth,scale:parseFloat(u.scale),distanceDisplayCondition:a}):o.billboard={image:h._core.isUrl(o.properties[u.icon])?o.properties[u.icon]:u.icon,distanceDisplayCondition:a}:o.polygon?o.polygon.distanceDisplayCondition=a:o.polyline&&(o.polyline.distanceDisplayCondition=a),c&&(o.availability=c))}"function"==typeof l&&l(e)}),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id);t={id:u.id,name:e,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t,style:u,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:!0,disFnc:l}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Oe.prototype.createGeoJsonFeatureLayer=function(t,e,i,o,r,n){var a=this._cesium.GeoJsonDataSource.load(e),s=this;return a.then(function(e){e=e.entities.values[0];/^point.fid/.test(e._id)||null!=e.point?s.createPointGeojsonFeatureLayer(t,a,i,o,r,n):/^polygon.fid/.test(e._id)||null!=e.polygon?s.createPolygonGeoJsonFeatureLayer(t,a,i,o,r,n):/^line.fid/.test(e._id)||null!=e.polyline?s.createPolylineGeoJsonFeatureLayer(t,a,i,o,r,n):s.createGeoJsonFeatureLayerAlawys(t,a,i,o,n)}),this},Oe.prototype.createPointGeojsonFeatureLayer=function(e,t,s,i,l,u){var o={color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),height:0,pointHeight:0,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0};this._core.isnull(s)||this._core.isnull(s.color)||"["==s.color.toString().charAt(0)&&"]"==s.color.toString().charAt(s.color.length-1)||(this._core.isHtmlColor(s.color)?s.color=this._color.colorFromHtmlColor(s.color):(/^rgb/.test(s.color)&&(s.color=this._color.rgbaStringToRgbaObj(s.color)),1<s.color.r&&(s.color.r=s.color.r/255),1<s.color.g&&(s.color.g=s.color.g/255),1<s.color.b&&(s.color.b=s.color.b/255),1<s.color.a&&(s.color.a=s.color.a/255),s.color=this._color.createColor(s.color.r,s.color.g,s.color.b,s.color.a))),this._core.isnull(s)||this._core.isnull(s.outlineColor)||"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(this._core.isHtmlColor(s.outlineColor)?s.outlineColor=this._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=this._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=this._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a)));var c=this._core.extend(o,s,!0);null==t&&console.log("geojson is required");o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o);var h,m=this;s&&s.time&&(h=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(m.item=e).entities.values,i=0;i<t.length;i++){var o=t[i];c.color=m._core.extendgl(o,s.color,c.color),c.pixelSize=parseInt(m._core.extendgl(o,s.pixelSize,c.pixelSize)),c.outlineColor=m._core.extendgl(o,s.outlineColor,c.outlineColor),c.outlineWidth=parseFloat(m._core.extendgl(o,s.outlineWidth,c.outlineWidth)),c.show=m._core.extendgl(o,s.show,c.show),c.height=parseFloat(m._core.extendgl(o,s.height,c.height)),c.scaleByDistance=m._core.extendgl(o,s.scaleByDistance,c.scaleByDistance);var r=parseFloat(m._core.extendgl(o,c.minDistanceDisplay||c.near)),n=parseFloat(m._core.extendgl(o,c.maxDistanceDisplay||c.far)),a=new m._cesium.DistanceDisplayCondition(r,n),r="color:"+255*c.color.red+","+255*c.color.green+","+255*c.color.blue+";outlineColor:"+255*c.outlineColor.red+","+255*c.outlineColor.green+","+255*c.outlineColor.blue;m.Legend.push(r),c.distanceDisplayCondition=a,c.pointHeight=m._core.extendgl(o,s.pointHeight,c.pointHeight),c.pointHeight=parseFloat(c.pointHeight),m._viewer.scene.globe.ellipsoid;n=m._cesium.Cartographic.fromCartesian(o.position._value),r=m._cesium.Math.toDegrees(n.longitude),a=m._cesium.Math.toDegrees(n.latitude),n=c.pointHeight||n.height,n=new m._cesium.Cartesian3.fromDegrees(r,a,n);o.position._value=n,o.point=new m._cesium.PointGraphics(c),o.billboard=void 0,o.description={positions:n},h&&(o.availability=h)}l||m.setVisibility(!1),"function"==typeof u&&u(e)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id);t={id:c.id,name:e,checked:l,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t,style:c,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:l,disFnc:u}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Oe.prototype.createModelGeojsonFeatureLayer=function(e,t,i={},o,n,a){var r={color:Cesium.Color.fromCssColorString(i.color||"#ffffff"),url:window.SmartEarthRootUrl+D.testModel,scale:1,minimumPixelSize:0,height:0,far:5e3,near:0},s=this._core.extend(r,i,!0);null==t&&console.log("geojson is required");var l,u=null,u=t.then?t:this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(u),i&&i.time&&(l=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:i.time.start?this._cesium.JulianDate.fromDate(new Date(i.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:i.time.end?this._cesium.JulianDate.fromDate(new Date(i.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})]));var c=parseFloat(s.near),r=parseFloat(s.far),h=new Cesium.DistanceDisplayCondition(c,r);u.then(e=>{for(var t=(this.item=e).entities.values,i=0;i<t.length;i++){var o=t[i],r=this._core.toDegrees(o.position.getValue());s.height&&(r.height=s.height);r=new Cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height);o.position=r,o.model=new Cesium.ModelGraphics({uri:s.url,distanceDisplayCondition:h,...s}),o.billboard=void 0,o.point=void 0,l&&(o.availability=l)}n||this.setVisibility(!1),"function"==typeof a&&a(e)}),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id);i={id:s.id,name:e,checked:n,pId:this._core.isnull(o)?0:o,type:"pointLayer",item:this,url:t,style:s,treeData:{name:e,geoOptions:t,styleOption:i,GroupID:o,checked:n,disFnc:a}};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),this},Oe.prototype.createCirclePointGeoJsonFeatureLayer=function(e,t,a,i,s){var o={semiMajorAxis:1,semiMinorAxis:1,height:0,heightReference:this._cesium.HeightReference.NONE,extrudedHeight:0,extrudedHeightReference:this._cesium.HeightReference.NONE,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};this._core.isnull(a)||this._core.isnull(a.outlineColor)||"["==a.outlineColor.toString().charAt(0)&&"]"==a.outlineColor.toString().charAt(a.outlineColor.length-1)||(this._core.isHtmlColor(a.outlineColor)?a.outlineColor=this._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=this._color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=this._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))),this._core.isnull(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||"("==a.material.toString().charAt(0)&&")"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),this._core.isnull(a)||this._core.isnull(a.radius)||(o.semiMajorAxis=a.radius,o.semiMinorAxis=a.radius),(void 0)._core.isnull(a.near)&&(a.near=0),(void 0)._core.isnull(a.far)&&(a.far=999999999);var l=this._core.extend(o,a,!0);null==t&&console.log("geojson is required");o=this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o);var u=this;o.then(function(e){for(var t=(u.item=e).entities.values,i=0;i<t.length;i++){var o=t[i];l.semiMajorAxis=parseFloat(u._core.extendgl(o,a.semiMajorAxis,l.semiMajorAxis)),l.semiMinorAxis=parseFloat(u._core.extendgl(o,a.semiMinorAxis,l.semiMinorAxis)),l.height=parseFloat(u._core.extendgl(o,a.height,l.height)),l.heightReference=u._core.extendgl(o,a.heightReference,l.heightReference),l.extrudedHeight=parseFloat(u._core.extendgl(o,a.extrudedHeight,l.extrudedHeight)),l.extrudedHeightReference=u._core.extendgl(o,a.extrudedHeightReference,l.extrudedHeightReference),l.show=u._core.extendgl(o,a.show,l.show),l.fill=u._core.extendgl(o,a.fill,l.fill),l.material=u._core.extendgl(o,a.material,l.material),l.outline=u._core.extendgl(o,a.outline,l.outline),l.outlineColor=u._core.extendgl(o,a.outlineColor,l.outlineColor),l.outlineWidth=parseFloat(u._core.extendgl(o,a.outlineWidth,l.outlineWidth)),l.scaleByDistance=u._core.extendgl(o,a.scaleByDistance,l.scaleByDistance);var r="material:"+255*l.material.red+","+255*l.material.green+","+255*l.material.blue+";outlineColor:"+255*l.outlineColor.red+","+255*l.outlineColor.green+","+255*l.outlineColor.blue;u.Legend.push(r);var n=parseFloat(u._core.extendgl(o,l.near)),r=parseFloat(u._core.extendgl(o,l.far)),r=new u._cesium.DistanceDisplayCondition(n,r);l.distanceDisplayCondition=r,o.billboard=void 0,o.ellipse=new u._cesium.EllipseGraphics(l)}"function"==typeof s&&s(e)}),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id);t={id:l.id,name:e,pId:this._core.isnull(i)?0:i,type:"layer",item:this,url:t,style:l,treeData:{name:e,geoOptions:t,styleOption:a,GroupID:i,checked:!0,disFnc:s}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Oe.prototype.createModelPointGeoJsonFeatureLayer=function(e,t,s,i,l,u){var o={uri:"",show:!0,scale:1,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,lightColor:void 0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),color:this._cesium.Color.WHITE,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},c=this;this._core.isnull(s)||this._core.isnull(s.color)||(this._core.isHtmlColor(s.color)?s.color=this._color.colorFromHtmlColor(s.color):(/^rgb/.test(s.color)&&(s.color=this._color.rgbaStringToRgbaObj(s.color)),1<s.color.r&&(s.color.r=s.color.r/255),1<s.color.g&&(s.color.g=s.color.g/255),1<s.color.b&&(s.color.b=s.color.b/255),1<s.color.a&&(s.color.a=s.color.a/255),s.color=this._color.createColor(s.color.r,s.color.g,s.color.b,s.color.a))),c._core.isnull(s.near)&&(s.near=0),c._core.isnull(s.far)&&(s.far=999999999);var h=this._core.extend(o,s,!0);null==t&&console.log("geojson is required");var m,o=this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o),s&&s.time&&(m=new c._cesium.TimeIntervalCollection([new c._cesium.TimeInterval({start:s.time.start?c._cesium.JulianDate.fromDate(new Date(s.time.start)):c._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?c._cesium.JulianDate.fromDate(new Date(s.time.end)):c._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(c.item=e).entities.values,i=0;i<t.length;i++){var o=t[i];h.uri=c._core.extendgl(o,s.uri,h.uri),h.scale=parseFloat(c._core.extendgl(o,s.scale,h.scale)),h.incrementallyLoadTextures=c._core.extendgl(o,s.incrementallyLoadTextures,h.incrementallyLoadTextures),h.runAnimations=c._core.extendgl(o,s.runAnimations,h.runAnimations),h.clampAnimations=c._core.extendgl(o,s.clampAnimations,h.clampAnimations),h.shadows=c._core.extendgl(o,s.shadows,h.shadows),h.heightReference=c._core.extendgl(o,s.heightReference,h.heightReference),h.lightColor=c._core.extendgl(o,s.lightColor,h.lightColor),h.scaleByDistance=c._core.extendgl(o,s.scaleByDistance,h.scaleByDistance),h.color=c._core.extendgl(o,s.color,h.color),h.height?h.height=parseFloat(c._core.extendgl(o,s.height,h.height)):h.height=void 0;var r=parseFloat(c._core.extendgl(o,s.near,h.near)),n=parseFloat(c._core.extendgl(o,s.far,h.far)),a="color:"+255*h.color.red+","+255*h.color.green+","+255*h.color.blue;c.Legend.push(a);r=new c._cesium.DistanceDisplayCondition(r,n);h.distanceDisplayCondition=r,o.billboard=void 0,o.model=new c._cesium.ModelGraphics(h),h.height&&(n=c._cesium.Cartographic.fromCartesian(o.position._value),r=c._cesium.Math.toDegrees(n.longitude),n=c._cesium.Math.toDegrees(n.latitude),o.position=c._cesium.Cartesian3.fromDegrees(r,n,h.height)),m&&(o.availability=m)}"function"==typeof u&&u(e),l||c.setVisibility(!1)}),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h.id);t={id:h.id,name:e,checked:l,pId:this._core.isnull(i)?0:i,type:"modelLayer",item:this,url:t,style:h,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:!0,disFnc:u}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Oe.prototype.createLabelPointGeoJsonFeatureLayer=function(u,e,c,t,h,m){var d,i={Name:"",text:"test",font:" 30px sans-serif",style:this._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),pointHeight:0,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,addHeight:0},p=this;this._core.isnull(c)||this._core.isnull(c.fillColor)||(this._core.isHtmlColor(c.fillColor)?c.fillColor=this._color.colorFromHtmlColor(c.fillColor):(/^rgb/.test(c.fillColor)&&(c.fillColor=this._color.rgbaStringToRgbaObj(c.fillColor)),1<c.fillColor.r&&(c.fillColor.r=c.fillColor.r/255),1<c.fillColor.g&&(c.fillColor.g=c.fillColor.g/255),1<c.fillColor.b&&(c.fillColor.b=c.fillColor.b/255),1<c.fillColor.a&&(c.fillColor.a=c.fillColor.a/255),c.fillColor=this._color.createColor(c.fillColor.r,c.fillColor.g,c.fillColor.b,c.fillColor.a))),this._core.isnull(c)||this._core.isnull(c.outlineColor)||(this._core.isHtmlColor(c.outlineColor)?c.outlineColor=this._color.colorFromHtmlColor(c.outlineColor):(/^rgb/.test(c.outlineColor)&&(c.outlineColor=this._color.rgbaStringToRgbaObj(c.outlineColor)),1<c.outlineColor.r&&(c.outlineColor.r=c.outlineColor.r/255),1<c.outlineColor.g&&(c.outlineColor.g=c.outlineColor.g/255),1<c.outlineColor.b&&(c.outlineColor.b=c.outlineColor.b/255),1<c.outlineColor.a&&(c.outlineColor.a=c.outlineColor.a/255),c.outlineColor=this._color.createColor(c.outlineColor.r,c.outlineColor.g,c.outlineColor.b,c.outlineColor.a))),this._core.isnull(c)||this._core.isnull(c.backgroundColor)||(this._core.isHtmlColor(c.backgroundColor)?c.backgroundColor=this._color.colorFromHtmlColor(c.backgroundColor):(/^rgb/.test(c.backgroundColor)&&(c.backgroundColor=this._color.rgbaStringToRgbaObj(c.backgroundColor)),1<c.backgroundColor.r&&(c.backgroundColor.r=c.backgroundColor.r/255),1<c.backgroundColor.g&&(c.backgroundColor.g=c.backgroundColor.g/255),1<c.backgroundColor.b&&(c.backgroundColor.b=c.backgroundColor.b/255),1<c.backgroundColor.a&&(c.backgroundColor.a=c.backgroundColor.a/255),c.backgroundColor=this._color.createColor(c.backgroundColor.r,c.backgroundColor.g,c.backgroundColor.b,c.backgroundColor.a))),p._core.isnull(c.near)&&(c.near=0),p._core.isnull(c.far)&&(c.far=999999999),c&&c.time&&(d=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:c.time.start?this._cesium.JulianDate.fromDate(new Date(c.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:c.time.end?this._cesium.JulianDate.fromDate(new Date(c.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})]));var g=this._core.extend(i,c,!0);null==e&&console.log("geojson is required");i=this._cesium.GeoJsonDataSource.load(e);this._viewer.dataSources.add(i);p=this;i.then(function(e){var t=(p.item=e).entities.values;p._core.isnull(g.font_size)&&(g.font_size="30px"),p._core.isnull(g.font_family)&&(g.font_family=" sans-serif"),-1==g.font_size.toString().indexOf("px")?g.font=g.font_size+"px "+g.font_family:g.font=g.font_size+" "+g.font_family;for(var i=0;i<t.length;i++){var o=t[i];g.font=p._core.extendgl(o,c.font,g.font),g.style=parseInt(p._core.extendgl(o,g.style,g.style)),g.fillColor=p._core.extendgl(o,c.fillColor,g.fillColor),g.outlineColor=p._core.extendgl(o,c.outlineColor,g.outlineColor),g.outlineWidth=parseFloat(p._core.extendgl(o,c.outlineWidth,g.outlineWidth)),g.show=p._core.extendgl(o,c.show,g.show),g.showBackground=p._core.extendgl(o,c.showBackground,g.showBackground),g.backgroundColor=p._core.extendgl(o,c.backgroundColor,g.backgroundColor),g.backgroundPadding=p._core.extendgl(o,c.backgroundPadding,g.backgroundPadding),g.scale=parseFloat(p._core.extendgl(o,c.scale,g.scale)),g.horizontalOrigin=p._core.extendgl(o,c.horizontalOrigin,g.horizontalOrigin),g.pointHeight=parseFloat(p._core.extendgl(o,c.pointHeight,g.pointHeight)),g.text=p._core.extendgl(o,c.text,g.text).toString();var r=parseFloat(p._core.extendgl(o,g.near)),n=parseFloat(p._core.extendgl(o,g.far)),n=new p._cesium.DistanceDisplayCondition(r,n);g.distanceDisplayCondition=n,null!=g.image&&null!=g.image&&0<g.image.length?(o.billboard.image=g.image,o.billboard.scale=g.scale,o.billboard.color=g.fillColor,o.billboard.verticalOrigin=g.verticalOrigin,o.billboard.horizontalOrigin=g.horizontalOrigin,o.billboard.disableDepthTestDistance=g.disableDepthTestDistance,o.billboard.heightReference=g.heightReference,o.billboard.distanceDisplayCondition=g.distanceDisplayCondition):"ellipsoidlayer"==g.layertype?(o.billboard=void 0,o.name=u,a={show:!0,radii:new p._cesium.Cartesian3(g.long_axis,g.short_axis,g.long_axis),material:p._cesium.Color.fromRandom({alpha:1})},o.ellipsoid=new p._cesium.EllipsoidGraphics(a),o.ellipsoid.heightReference=g.heightReference,o.ellipsoid.material=url):(o.billboard=void 0,l={Name:g.Name,text:g.text,font:g.font,style:g.stylet,...g},s="fillColor:"+255*g.fillColor.red+","+255*g.fillColor.green+","+255*g.fillColor.blue+";outlineColor:"+255*g.outlineColor.red+","+255*g.outlineColor.green+","+255*g.outlineColor.blue,p.Legend.push(s),o.label=new p._cesium.LabelGraphics(l),d&&(o.availability=d));var a=p._viewer.scene.globe.ellipsoid,n=p._cesium.Cartographic.fromCartesian(o.position._value),s=p._cesium.Math.toDegrees(n.longitude),l=p._cesium.Math.toDegrees(n.latitude),n=(g.pointHeight||n.height)+g.addHeight,n=new p._cesium.Cartesian3.fromDegrees(s,l,n);o.position._value=n,o.description={positions:n}}h||p.setVisibility(!1),"function"==typeof m&&m(e)}),this._core.isnull(g.id)&&(g.id=this._core.getuid()),this._core.isnull(u)&&(u="新建街景"+g.id);e={id:g.id,name:u,checked:h,pId:this._core.isnull(t)?0:t,type:"labelPointLayer",item:this,url:e,style:g,treeData:{name:u,geoOptions:e,styleOption:c,GroupID:t,checked:h,disFnc:m}};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(t)?0:t),this},Oe.prototype.createStreetscapeGeoJsonFeatureLayer=function(e,t,u,i,c,h){var o={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!0,width:1,show:!0,material:this._cesium.Color.RED,height:30,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},m=this;this._core.isnull(u)||this._core.isnull(u.material)||"["==u.material.toString().charAt(0)&&"]"==u.material.toString().charAt(u.material.length-1)||"("==u.material.toString().charAt(0)&&")"==u.material.toString().charAt(u.material.length-1)||(this._core.isHtmlColor(u.material)?u.material=this._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=this._color.rgbaStringToRgbaObj(u.material)),1<u.material.r&&(u.material.r=u.material.r/255),1<u.material.g&&(u.material.g=u.material.g/255),1<u.material.b&&(u.material.b=u.material.b/255),1<u.material.a&&(u.material.a=u.material.a/255),u.material=this._color.createColor(u.material.r,u.material.g,u.material.b,u.material.a)),"1"==u.arcType||1==u.arcType?u.material=new Cesium.PolylineDashMaterialProperty({color:u.material}):u.material=u.material),m._core.isnull(u.near)&&(u.near=0),m._core.isnull(u.far)&&(u.far=999999999);var d=this._core.extend(o,u,!0);null==t&&console.log("geojson is required");var p,o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o,{camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas,clampToGround:!0}),u&&u.time&&(p=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:u.time.start?this._cesium.JulianDate.fromDate(new Date(u.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:u.time.end?this._cesium.JulianDate.fromDate(new Date(u.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(m.item=e).entities.values,i=0;i<t.length;i++){var o=t[i];d.arcType=m._core.extendgl(o,u.arcType,d.arcType),d.clampToGround=m._core.extendgl(o,u.clampToGround,d.clampToGround),d.width=parseFloat(m._core.extendgl(o,u.width,d.width)),d.show=m._core.extendgl(o,u.show,d.show),d.material=m._core.extendgl(o,u.material,d.material),d.height=parseFloat(m._core.extendgl(o,u.height,d.height));var r=parseFloat(m._core.extendgl(o,d.near)),n=parseFloat(m._core.extendgl(o,d.far)),n=new m._cesium.DistanceDisplayCondition(r,n);d.distanceDisplayCondition=n,o.polyline.arcType=!0,0==d.heightReference?o.polyline.arcType=0:o.polyline.arcType=1,o.polyline.clampToGround=d.clampToGround,o.polyline.width=d.width,o.polyline.height=d.height,o.polyline.show=d.show,o.polyline.material=d.material,o.polyline.distanceDisplayCondition=n;var a,s,l=[];o.polyline.positions._value.forEach(function(e){d.height?(s=m._cesium.Cartographic.fromCartesian(e),a=m._cesium.Math.toDegrees(s.longitude),s=m._cesium.Math.toDegrees(s.latitude),l.push(m._cesium.Cartesian3.fromDegrees(a,s,d.height))):l.push(e)}),o.polyline.positions=l,p&&(o.availability=p);o="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;m.Legend.push(o)}c||m.setVisibility(!1),"function"==typeof h&&h(e)}),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建街景"+d.id);t={id:d.id,name:e,checked:c,pId:this._core.isnull(i)?0:i,type:"Streetscape",item:this,url:t,style:d,treeData:{name:e,geoOptions:t,styleOption:u,GroupID:i,checked:c,disFnc:h}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Oe.prototype.createEllipsoidlayerPointGeoJsonFeatureLayer=function(e,t,a,i,s){var o={Name:"",text:"",font:" 30px sans-serif",style:this._cesium.LabelStyle.OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};this._core.isnull(a)||this._core.isnull(a.fillColor)||"["==a.fillColor.toString().charAt(0)&&"]"==a.fillColor.toString().charAt(a.fillColor.length-1)||"("==a.material.toString().charAt(0)&&")"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.fillColor)?a.fillColor=this._color.colorFromHtmlColor(a.fillColor):(/^rgb/.test(a.fillColor)&&(a.fillColor=this._color.rgbaStringToRgbaObj(a.fillColor)),1<a.fillColor.r&&(a.fillColor.r=a.fillColor.r/255),1<a.fillColor.g&&(a.fillColor.g=a.fillColor.g/255),1<a.fillColor.b&&(a.fillColor.b=a.fillColor.b/255),1<a.fillColor.a&&(a.fillColor.a=a.fillColor.a/255),a.fillColor=this._color.createColor(a.fillColor.r,a.fillColor.g,a.fillColor.b,a.fillColor.a))),this._core.isnull(a)||this._core.isnull(a.outlineColor)||"["==a.outlineColor.toString().charAt(0)&&"]"==a.outlineColor.toString().charAt(a.outlineColor.length-1)||(this._core.isHtmlColor(a.outlineColor)?a.outlineColor=this._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=this._color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=this._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))),this._core.isnull(a)||this._core.isnull(a.backgroundColor)||"["==a.backgroundColor.toString().charAt(0)&&"]"==a.backgroundColor.toString().charAt(a.backgroundColor.length-1)||(this._core.isHtmlColor(a.backgroundColor)?a.backgroundColor=this._color.colorFromHtmlColor(a.backgroundColor):(/^rgb/.test(a.backgroundColor)&&(a.backgroundColor=this._color.rgbaStringToRgbaObj(a.backgroundColor)),1<a.backgroundColor.r&&(a.backgroundColor.r=a.backgroundColor.r/255),1<a.backgroundColor.g&&(a.backgroundColor.g=a.backgroundColor.g/255),1<a.backgroundColor.b&&(a.backgroundColor.b=a.backgroundColor.b/255),1<a.backgroundColor.a&&(a.backgroundColor.a=a.backgroundColor.a/255),a.backgroundColor=this._color.createColor(a.backgroundColor.r,a.backgroundColor.g,a.backgroundColor.b,a.backgroundColor.a))),(void 0)._core.isnull(a.near)&&(a.near=0),(void 0)._core.isnull(a.far)&&(a.far=999999999);var l=this._core.extend(o,a,!0);null==t&&console.log("geojson is required");o=this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o);var u=this;o.then(function(e){var t=(u.item=e).entities.values;u._core.isnull(a.font_size)&&(a.font_size="30px"),u._core.isnull(a.font_family)&&(a.font_family=" sans-serif"),l.font=a.font_size+"px "+a.font_family;for(var i=0;i<t.length;i++){l.text=u._core.extendgl(entity,a.text,l.text),l.font=u._core.extendgl(entity,a.font,l.font),l.stylet=u._core.extendgl(entity,a.stylet,l.stylet),l.fillColor=u._core.extendgl(entity,a.fillColor,l.fillColor),l.outlineColor=u._core.extendgl(entity,a.outlineColor,l.outlineColor),l.outlineWidth=parseFloat(u._core.extendgl(entity,a.outlineWidth,l.outlineWidth)),l.show=u._core.extendgl(entity,a.show,l.show),l.showBackground=u._core.extendgl(entity,a.showBackground,l.showBackground),l.backgroundColor=u._core.extendgl(entity,a.backgroundColor,l.backgroundColor),l.backgroundPadding=u._core.extendgl(entity,a.backgroundPadding,l.backgroundPadding),l.scale=parseFloat(u._core.extendgl(entity,a.scale,l.scale)),l.horizontalOrigin=u._core.extendgl(entity,a.horizontalOrigin,l.horizontalOrigin),l.pointheight=parseFloat(u._core.extendgl(entity,a.pointheight,l.pointheight));var o=parseFloat(u._core.extendgl(entity,l.near)),r=parseFloat(u._core.extendgl(entity,l.far)),n="fillColor:"+255*l.fillColor.red+","+255*l.fillColor.green+","+255*l.fillColor.blue+";outlineColor:"+255*l.outlineColor.red+","+255*l.outlineColor.green+","+255*l.outlineColor.blue;u.Legend.push(n);o=new u._cesium.DistanceDisplayCondition(o,r);l.distanceDisplayCondition=o,entity.ellipsoid.radii=new _this._cesium.Cartesian3(a.long_axis,a.short_axis,a.short_axis),entity.label=new u._cesium.LabelGraphics(l),entity.label.text=null==entity.properties[a.text]?a.text:entity.properties[a.text]._value,l.pointheight&&(r=u._cesium.Cartographic.fromCartesian(entity.position._value),o=u._cesium.Math.toDegrees(r.longitude),r=u._cesium.Math.toDegrees(r.latitude),entity.position=u._cesium.Cartesian3.fromDegrees(o,r,l.pointheight))}"function"==typeof s&&s(e)}),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id);t={id:l.id,name:e,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t,style:l,treeData:{name:e,geoOptions:t,styleOption:a,GroupID:i,checked:!0,disFnc:s}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Oe.prototype.createBillboardGeoJsonFeature=function(e,t,s,i,l,u){var o={image:"",show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:2,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};this._core.isnull(s)||this._core.isnull(s.color)||"["==s.color.toString().charAt(0)&&"]"==s.color.toString().charAt(s.color.length-1)||(this._core.isHtmlColor(s.color)?s.color=this._color.colorFromHtmlColor(s.color):(/^rgb/.test(s.color)&&(s.color=this._color.rgbaStringToRgbaObj(s.color)),1<s.color.r&&(s.color.r=s.color.r/255),1<s.color.g&&(s.color.g=s.color.g/255),1<s.color.b&&(s.color.b=s.color.b/255),1<s.color.a&&(s.color.a=s.color.a/255),s.color=this._color.createColor(s.color.r,s.color.g,s.color.b,s.color.a)));var c=this._core.extend(o,s,!0);null==t&&console.log("geojson is required");o=this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o);var h,m=this;m._core.isnull(s.near)&&(s.near=0),m._core.isnull(s.far)&&(s.far=999999999),s&&s.time&&(h=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(m.item=e).entities.values,i=0;i<t.length;i++){var o=t[i];c.image=m._core.extendgl(o,s.image,c.image),c.show=m._core.extendgl(o,s.show,c.show),c.scale=parseFloat(m._core.extendgl(o,s.scale,c.scale)),c.horizontalOrigin=m._core.extendgl(o,s.horizontalOrigin,c.horizontalOrigin),c.verticalOrigin=m._core.extendgl(o,s.verticalOrigin,c.verticalOrigin),c.eyeOffset=m._core.extendgl(o,s.eyeOffset,c.eyeOffset),c.pixelOffset=m._core.extendgl(o,s.pixelOffset,c.pixelOffset),c.alignedAxis=m._core.extendgl(o,s.alignedAxis,c.alignedAxis),c.rotation=m._core.extendgl(o,s.rotation,c.rotation),c.width?c.width=parseFloat(m._core.extendgl(o,s.width,c.width)):c.width=void 0,c.height?c.height=parseFloat(m._core.extendgl(o,s.height,c.height)):c.height=void 0,c.color=m._core.extendgl(o,s.color,c.color);var r="color:"+255*c.color.red+","+255*c.color.green+","+255*c.color.blue+";image:"+c.image;m.Legend.push(r);var n=parseFloat(m._core.extendgl(o,c.near)),a=parseFloat(m._core.extendgl(o,c.far)),r=new m._cesium.DistanceDisplayCondition(n,a);c.distanceDisplayCondition=r,o.billboard=void 0,o.billboard=new m._cesium.BillboardGraphics(c),m._viewer.scene.globe.ellipsoid;n=m._cesium.Cartographic.fromCartesian(o.position._value),a=m._cesium.Math.toDegrees(n.longitude),r=m._cesium.Math.toDegrees(n.latitude);n=s.pointHeight||n.height;n=new m._cesium.Cartesian3.fromDegrees(a,r,n);o.position._value=n,o.description={positions:n},h&&(o.availability=h)}l||m.setVisibility(!1),"function"==typeof u&&u(e)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id);t={id:c.id,name:e,checked:l,pId:this._core.isnull(i)?0:i,type:"imageLayer",item:this,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:l,disFnc:u}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Oe.prototype.createPolylineGeoJsonFeatureLayer=function(e,t,a,i,s,l){var o={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!0,width:1,show:!0,material:this._cesium.Color.WHITE,height:30,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},u=this;this._core.isnull(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||"("==a.material.toString().charAt(0)&&")"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),u._core.isnull(a.near)&&(a.near=0),u._core.isnull(a.far)&&(a.far=999999999);var c=this._core.extend(o,a,!0);null==t&&console.log("geojson is required");var h,o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o,{camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas,clampToGround:!0}),a&&a.time&&(h=new u._cesium.TimeIntervalCollection([new u._cesium.TimeInterval({start:a.time.start?u._cesium.JulianDate.fromDate(new Date(a.time.start)):u._cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?u._cesium.JulianDate.fromDate(new Date(a.time.end)):u._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(u.item=e).entities.values,i=0;i<t.length;i++){var o=t[i];c.arcType=u._core.extendgl(o,a.arcType,c.arcType),c.clampToGround=u._core.extendgl(o,a.clampToGround,c.clampToGround),c.width=parseFloat(u._core.extendgl(o,a.width,c.width)),c.show=u._core.extendgl(o,a.show,c.show),c.material=u._core.extendgl(o,a.material,c.material),c.height=parseFloat(u._core.extendgl(o,a.height,c.height));var r=parseFloat(u._core.extendgl(o,c.near)),n=parseFloat(u._core.extendgl(o,c.far)),n=new u._cesium.DistanceDisplayCondition(r,n);c.distanceDisplayCondition=n,u._viewer.scene.globe.ellipsoid,o.polyline.clampToGround=c.clampToGround,o.polyline.width=c.width,o.polyline.show=c.show,o.polyline.material=c.material,o.polyline.distanceDisplayCondition=n,o.polyline.distanceDisplayCondition=n,h&&(o.availability=h);o="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue;u.Legend.push(o)}s||u.setVisibility(!1),"function"==typeof l&&l(e)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id);t={id:c.id,name:e,checked:s,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t,style:c,treeData:{name:e,geoOptions:t,styleOption:a,GroupID:i,checked:s,disFnc:l}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Oe.prototype.createpolylineVolumeGeojsonFeatureLayer=function(e,t,d,i,p,g){var o={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,radius:.5,radiusScale:1};this._core.isnull(d)||this._core.isnull(d.material)||"["==d.material.toString().charAt(0)&&"]"==d.material.toString().charAt(d.material.length-1)||"("==d.material.toString().charAt(0)&&")"==d.material.toString().charAt(d.material.length-1)||(this._core.isHtmlColor(d.material)?d.material=this._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=this._color.rgbaStringToRgbaObj(d.material)),1<d.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=this._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a)));var _=this._core.extend(o,d,!0);null==t&&console.log("geojson is required");o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o);var f,y=this;_.shape=this.computeCircle(d.radius),d&&d.time&&(f=new y._cesium.TimeIntervalCollection([new y._cesium.TimeInterval({start:d.time.start?y._cesium.JulianDate.fromDate(new Date(d.time.start)):y._cesium.Iso8601.MINIMUM_VALUE,stop:d.time.end?y._cesium.JulianDate.fromDate(new Date(d.time.end)):y._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){var t=(y.item=e).entities.values;y._core.isnull(d.near)&&(d.near=0),y._core.isnull(d.far)&&(d.far=999999999);var i,o,r=parseFloat(d.near),n=parseFloat(d.far),a=new y._cesium.DistanceDisplayCondition(r,n);if(_.distanceDisplayCondition=a,"string"==typeof _.radius&&-1<_.radius.indexOf("[")&&-1<_.radius.indexOf("]")){let e;_.radius=_.radius.replace("[",""),_.radius=_.radius.replace("]",""),t[0]&&t[0].properties[_.radius]?(e=t[0].properties[_.radius].getValue(),e.indexOf&&(-1<e.indexOf("*")||-1<e.indexOf("x")||-1<e.indexOf("X"))?(-1<e.indexOf("*")?e=e.split("*"):-1<e.indexOf("X")?e=e.split("X"):-1<e.indexOf("x")&&(e=e.split("x")),i=parseFloat(e[0])*_.radiusScale,o=parseFloat(e[1])*_.radiusScale,_.shape=[new y._cesium.Cartesian2(-i,-o),new y._cesium.Cartesian2(i,-o),new y._cesium.Cartesian2(i,o),new y._cesium.Cartesian2(-i,o)]):_.shape=y._core.computeCircle(e*_.radiusScale)):_.shape=y._core.computeCircle(.5)}else"0"==_.slttype||0==_.slttype?_.shape=y._core.computeCircle(_.radius):"1"==_.slttype||1==_.slttype?_.shape=y._core.starPositions(_.number,_.exradius,_.inradius):"2"!=_.slttype&&2!=_.slttype||(i=_.orth_width/2,o=_.orth_height/2,_.shape=[new y._cesium.Cartesian2(-i,-o),new y._cesium.Cartesian2(i,-o),new y._cesium.Cartesian2(i,o),new y._cesium.Cartesian2(-i,o)]);for(var s=0;s<t.length;s++){var l=t[s];_.show=y._core.extendgl(l,d.show,_.show),_.shape=y._core.extendgl(l,d.shape,_.shape),_.cornerType=y._core.extendgl(l,d.cornerType,_.cornerType),_.granularity=y._core.extendgl(l,d.granularity,_.granularity),_.fill=y._core.extendgl(l,d.fill,_.fill),_.material=y._core.extendgl(l,d.material,_.material),_.outline=y._core.extendgl(l,d.outline,_.outline),_.outlineColor=y._core.extendgl(l,d.outlineColor,_.outlineColor),_.outlineWidth=parseFloat(y._core.extendgl(l,d.outlineWidth,_.outlineWidth)),_.shadows=y._core.extendgl(l,d.shadows,_.shadows);var u,c,h=[];l.polyline.positions._value.forEach(function(e){_.height?(c=y._cesium.Cartographic.fromCartesian(e),u=y._cesium.Math.toDegrees(c.longitude),c=y._cesium.Math.toDegrees(c.latitude),h.push(y._cesium.Cartesian3.fromDegrees(u,c,_.height))):h.push(e)}),l.polylineVolume=new y._cesium.PolylineVolumeGraphics({positions:h,show:_.show,shape:_.shape,cornerType:_.cornerType,fill:_.fill,outline:_.outline,outlineWidth:_.outlineWidth,material:_.material,distanceDisplayCondition:a});var m="material:"+255*_.material.red+","+255*_.material.green+","+255*_.material.blue;y.Legend.push(m),l.polyline=void 0,f&&(l.availability=f)}p||y.setVisibility(!1),"function"==typeof g&&g(e)}),this._core.isnull(_.id)&&(_.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+_.id);t={id:_.id,name:e,checked:p,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t,style:_,treeData:{name:e,geoOptions:t,styleOption:d,GroupID:i,checked:p,disFnc:g}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Oe.prototype.createpolylineVolumeGeojsonPrimitiveLayer=function(e,t,a,i,s,l){var o={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,radius:.5,height:0,radiusScale:1};this._core.isnull(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||"("==a.material.toString().charAt(0)&&")"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a)));var c=this._core.extend(o,a,!0);null==t&&console.log("geojson is required");var o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t),h=this;a&&a.time&&new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:a.time.start?h._cesium.JulianDate.fromDate(new Date(a.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?h._cesium.JulianDate.fromDate(new Date(a.time.end)):h._cesium.Iso8601.MAXIMUM_VALUE})]);let m=new Cesium.PrimitiveCollection,d={allowPicking:!0,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),shadows:c.shadows,geometryInstances:void 0};o.then(function(e){var t=(h.item=e).entities.values;h._core.isnull(a.near)&&(a.near=0),h._core.isnull(a.far)&&(a.far=999999999);var i,o,r=parseFloat(a.near),e=parseFloat(a.far),e=new h._cesium.DistanceDisplayCondition(r,e);if(c.distanceDisplayCondition=e,"string"==typeof c.radius&&-1<c.radius.indexOf("[")&&-1<c.radius.indexOf("]")){let e;c.radius=c.radius.replace("[",""),c.radius=c.radius.replace("]",""),t[0]&&t[0].properties[c.radius]?(e=t[0].properties[c.radius].getValue(),e.indexOf&&(-1<e.indexOf("*")||-1<e.indexOf("x")||-1<e.indexOf("X"))?(-1<e.indexOf("*")?e=e.split("*"):-1<e.indexOf("X")?e=e.split("X"):-1<e.indexOf("x")&&(e=e.split("x")),i=parseFloat(e[0])*c.radiusScale,o=parseFloat(e[1])*c.radiusScale,c.shape=[new h._cesium.Cartesian2(-i,-o),new h._cesium.Cartesian2(i,-o),new h._cesium.Cartesian2(i,o),new h._cesium.Cartesian2(-i,o)],c.radius=o):(c.shape=h._core.computeCircle(e*c.radiusScale),c.connect&&(c.connectRadius=e*c.radiusScale*1.1,c.connectRadius2=e*c.radiusScale*1.2,c.connectShape1=h._core.computeCircle(c.connectRadius),c.connectShape2=h._core.computeCircle(c.connectRadius2)),c.radius=e*c.radiusScale)):(c.shape=h._core.computeCircle(.5),c.radius=.5,c.connect&&(c.connectRadius=1.1*c.radius,c.connectRadius2=1.2*c.radius,c.connectShape1=h._core.computeCircle(c.connectRadius),c.connectShape2=h._core.computeCircle(c.connectRadius2)))}else"0"==c.slttype||0==c.slttype?(c.shape=h._core.computeCircle(c.radius),c.connect&&(c.connectRadius=1.1*c.radius,c.connectRadius2=1.2*c.radius,c.connectShape1=h._core.computeCircle(c.connectRadius),c.connectShape2=h._core.computeCircle(c.connectRadius2))):"1"==c.slttype||1==c.slttype?c.shape=h._core.starPositions(c.number,c.exradius,c.inradius):"2"!=c.slttype&&2!=c.slttype||(i=c.orth_width/2,o=c.orth_height/2,c.shape=[new h._cesium.Cartesian2(-i,-o),new h._cesium.Cartesian2(i,-o),new h._cesium.Cartesian2(i,o),new h._cesium.Cartesian2(-i,o)],c.radius=o);c.show=h._core.extendgl(t[0],a.show,c.show),c.shape=h._core.extendgl(t[0],a.shape,c.shape),c.cornerType=h._core.extendgl(t[0],a.cornerType,c.cornerType),c.granularity=h._core.extendgl(t[0],a.granularity,c.granularity),c.fill=h._core.extendgl(t[0],a.fill,c.fill),c.material=h._core.extendgl(t[0],a.material,c.material),c.outline=h._core.extendgl(t[0],a.outline,c.outline),c.outlineColor=h._core.extendgl(t[0],a.outlineColor,c.outlineColor),c.outlineWidth=parseFloat(h._core.extendgl(t[0],a.outlineWidth,c.outlineWidth)),c.shadows=h._core.extendgl(t[0],a.shadows,c.shadows);for(var n=0;n<t.length;n++)!async function(e){var t,i,o=[];e.polyline&&e.polyline.positions._value.forEach(function(e){c.height?(i=h._cesium.Cartographic.fromCartesian(e),t=h._cesium.Math.toDegrees(i.longitude),i=h._cesium.Math.toDegrees(i.latitude),o.push(h._cesium.Cartesian3.fromDegrees(t,i,c.height-c.radius))):o.push(e)}),e.polyline=void 0;var r={polylinePositions:o,shapePositions:c.shape,cornerType:c.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},r=new h._cesium.PolylineVolumeGeometry(r),r=new h._cesium.GeometryInstance({id:e,geometry:r,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}});d.geometryInstances=r,m.add(new h._cesium.Primitive(d)),c.connect&&1<o.length&&async function(n,a){let s=[];if(!(a.length<=1)){var l=c.height-c.connectRadius,u=c.height-c.connectRadius2;let e=h._core.getPointFromTwoPointCenter([a[0],a[1]],2*c.connectRadius,l),t=h._core.getPointFromTwoPointCenter([a[0],a[1]],2*c.connectRadius2,u),i=h._core.getPointFromTwoPointCenter([a[a.length-1],a[a.length-2]],2*c.connectRadius,l),o=h._core.getPointFromTwoPointCenter([a[a.length-1],a[a.length-2]],2*c.connectRadius2,u);a[0].x==a[1].x&&a[2]&&(e=h._core.getPointFromTwoPointCenter([a[0],a[2]],2*c.connectRadius,l),t=h._core.getPointFromTwoPointCenter([a[0],a[2]],2*c.connectRadius2,u)),a[a.length-1].x==a[a.length-2].x&&a[a.length-3]&&(i=h._core.getPointFromTwoPointCenter([a[a.length-1],a[a.length-3]],2*c.connectRadius,l),o=h._core.getPointFromTwoPointCenter([a[a.length-1],a[a.length-3]],2*c.connectRadius2,u));l=new h._cesium.PolylineVolumeGeometry({polylinePositions:[a[0],e],shapePositions:c.connectShape1,cornerType:c.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}});s.push(l);u=new h._cesium.PolylineVolumeGeometry({polylinePositions:[e,t],shapePositions:c.connectShape2,cornerType:c.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}});s.push(u);l=new h._cesium.PolylineVolumeGeometry({polylinePositions:[a[a.length-1],i],shapePositions:c.connectShape1,cornerType:c.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}});s.push(l);u=new h._cesium.PolylineVolumeGeometry({polylinePositions:[i,o],shapePositions:c.connectShape2,cornerType:c.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}});s.push(u);let r=[];s.forEach(e=>{e=new h._cesium.GeometryInstance({id:n,geometry:e,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}});r.push(e)});l=new Cesium.EllipsoidGeometry({vertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0},stackPartitions:16,slicePartitions:16,radii:new Cesium.Cartesian3(c.connectRadius,c.connectRadius,c.connectRadius)}),u=new Cesium.GeometryInstance({geometry:l,modelMatrix:Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(a[0]),new Cesium.Cartesian3(0,0,c.connectRadius),new Cesium.Matrix4),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}});r.push(u);a=new Cesium.GeometryInstance({geometry:l,modelMatrix:Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(a[a.length-1]),new Cesium.Cartesian3(0,0,c.connectRadius),new Cesium.Matrix4),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}});r.push(a),d.geometryInstances=r,m.add(new h._cesium.Primitive(d))}}(e,o);e="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue;h.Legend.push(e)}(t[n]);h._viewer.scene.primitives.add(m),h.item=m,s||h.setVisibility(!1),"function"==typeof l&&l(m)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+c.id);t={id:c.id,name:e,checked:s,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t,style:c,treeData:{name:e,geoOptions:t,styleOption:a,GroupID:i,checked:s,disFnc:l}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Oe.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var o=Cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(o),e*Math.sin(o)))}return t},Oe.prototype.createWallGeoFeatureLayer=function(e,t,u,i,c,h){var o={positions:[],minimumHeights:[],maximumHeights:[],granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0};this._core.isnull(u)||this._core.isnull(u.material)||"["==u.material.toString().charAt(0)&&"]"==u.material.toString().charAt(u.material.length-1)||(this._core.isHtmlColor(u.material)?u.material=this._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=this._color.rgbaStringToRgbaObj(u.material)),1<u.material.r&&(u.material.r=u.material.r/255),1<u.material.g&&(u.material.g=u.material.g/255),1<u.material.b&&(u.material.b=u.material.b/255),1<u.material.a&&(u.material.a=u.material.a/255),u.material=this._color.createColor(u.material.r,u.material.g,u.material.b,u.material.a))),this._core.isnull(u)||this._core.isnull(u.outlineColor)||"["==u.outlineColor.toString().charAt(0)&&"]"==u.outlineColor.toString().charAt(u.outlineColor.length-1)||(this._core.isHtmlColor(u.outlineColor)?u.outlineColor=this._color.colorFromHtmlColor(u.outlineColor):(/^rgb/.test(u.outlineColor)&&(u.outlineColor=this._color.rgbaStringToRgbaObj(u.outlineColor)),1<u.outlineColor.r&&(u.outlineColor.r=u.outlineColor.r/255),1<u.outlineColor.g&&(u.outlineColor.g=u.outlineColor.g/255),1<u.outlineColor.b&&(u.outlineColor.b=u.outlineColor.b/255),1<u.outlineColor.a&&(u.outlineColor.a=u.outlineColor.a/255),u.outlineColor=this._color.createColor(u.outlineColor.r,u.outlineColor.g,u.outlineColor.b,u.outlineColor.a)));var m=this._core.extend(o,u,!0);null==t&&console.log("geojson is required");o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o);var d,p=this;u&&u.time&&(d=new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({start:u.time.start?p._cesium.JulianDate.fromDate(new Date(u.time.start)):p._cesium.Iso8601.MINIMUM_VALUE,stop:u.time.end?p._cesium.JulianDate.fromDate(new Date(u.time.end)):p._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){var t=(p.item=e).entities.values;p._core.isnull(u.near)&&(u.near=0),p._core.isnull(u.far)&&(u.far=999999999);var i=parseFloat(u.near),o=parseFloat(u.far),r=new p._cesium.DistanceDisplayCondition(i,o);m.distanceDisplayCondition=r;for(var n=0;n<t.length;n++){var a=t[n];m.granularity=p._core.extendgl(a,u.granularity,m.granularity),m.fill=p._core.extendgl(a,u.fill,m.fill),m.material=p._core.extendgl(a,u.material,m.material),m.outline=p._core.extendgl(a,u.outline,m.outline),m.outlineColor=p._core.extendgl(a,u.outlineColor,m.outlineColor),m.outlineWidth=parseFloat(p._core.extendgl(a,u.outlineWidth,m.outlineWidth)),m.shadows=p._core.extendgl(a,u.shadows,m.shadows);var s=a.polyline.positions._value.length,l=new Array(s),s=new Array(s);l.fill(m.minimumHeights),s.fill(m.maximumHeights),a.wall=new p._cesium.WallGraphics({positions:a.polyline.positions._value,maximumHeights:s,minimumHeights:l,outline:m.outline,fill:m.fill,material:m.material,outlineColor:m.outlineColor,outlineWidth:m.outlineWidth,shadows:m.shadows,distanceDisplayCondition:r});l="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue+";outlineColor:"+255*m.outlineColor.red+","+255*m.outlineColor.green+","+255*m.outlineColor.blue;p.Legend.push(l),a.polyline=void 0,d&&(a.availability=d)}c||p.setVisibility(!1),"function"==typeof h&&h(e)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建墙图层"+m.id);t={id:m.id,name:e,checked:c,pId:this._core.isnull(i)?0:i,type:"polylineWallLayer",item:this,url:t,style:m,treeData:{name:e,geoOptions:t,styleOption:u,GroupID:i,checked:c,disFnc:h}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Oe.prototype.createterrainProvider=function(e,t,i,o){var r=this._core.extend({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"},t,!0),t=new this._cesium.CesiumTerrainProvider(r);return this._viewer.terrainProvider=t,this.item=t,"function"==typeof o&&o(dataSource),this._core.isnull(r.id)&&(r.id=this._core.getuid()),this._tree.insertGroupId({id:r.id,name:e,pId:this._core.isnull(i)?0:i,type:"terrainProvider",item:this},this._core.isnull(i)?0:i),this},Oe.prototype.createPolygonGeoJsonFeatureLayers=function(e,t,s,i,o,l){var r={height:0,extrudedHeight:0,heightReference:this._cesium.HeightReference.NONE,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:this._cesium.ShadowMode.ENABLED,clampToGround:!0};this._core.isnull(s)||this._core.isnull(s.material)||"["==s.material.toString().charAt(0)&&"]"==s.material.toString().charAt(s.material.length-1)||"("==s.material.toString().charAt(0)&&")"==s.material.toString().charAt(s.material.length-1)||(this._core.isHtmlColor(s.material)?s.material=this._color.colorFromHtmlColor(s.material):(/^rgb/.test(s.material)&&(s.material=this._color.rgbaStringToRgbaObj(s.material)),1<s.material.r&&(s.material.r=s.material.r/255),1<s.material.g&&(s.material.g=s.material.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=this._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a))),this._core.isnull(s)||this._core.isnull(s.outlineColor)||"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(this._core.isHtmlColor(s.outlineColor)?s.outlineColor=this._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=this._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=this._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a))),s.checked=o;var u=this._core.extend(r,s,!0);null==t&&console.log("geojson is required");r=null,r=t.then?t:this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(r);var c=this;r.then(function(e){var t=(c.item=e).entities.values;c._core.isnull(s.near)&&(s.near=0),c._core.isnull(s.far)&&(s.far=999999999);var i=parseFloat(s.near),o=parseFloat(s.far),r=new c._cesium.DistanceDisplayCondition(i,o);u.distanceDisplayCondition=r;for(var n=0;n<t.length;n++){var a=t[n];u.height=parseFloat(c._core.extendgl(a,s.height,u.height)),u.extrudedHeight=parseFloat(c._core.extendgl(a,s.extrudedHeight,u.extrudedHeight)),u.heightReference=c._core.extendgl(a,s.heightReference,u.heightReference),u.show=c._core.extendgl(a,s.show,u.show),u.fill=c._core.extendgl(a,s.fill,u.fill),u.material=c._core.extendgl(a,s.material,u.material),u.outline=c._core.extendgl(a,s.outline,u.outline),u.outlineColor=c._core.extendgl(a,s.outlineColor,u.outlineColor),u.outlineWidth=parseFloat(c._core.extendgl(a,s.outlineWidth,u.outlineWidth)),u.stRotation=parseInt(c._core.extendgl(a,s.stRotation,u.stRotation)),u.granularity=c._core.extendgl(a,s.granularity,u.granularity),u.shadows=c._core.extendgl(a,s.shadows,u.shadows),a.polygon.height=u.height,a.polygon.extrudedHeight=u.extrudedHeight,a.polygon.heightReference=u.heightReference,a.polygon.show=u.show,a.polygon.fill=u.fill,a.polygon.material=u.material,a.polygon.outline=u.outline,a.polygon.outlineColor=u.outlineColor,a.polygon.outlineWidth=u.outlineWidth,a.polygon.stRotation=u.stRotation,a.polygon.granularity=u.granularity,a.polygon.distanceDisplayCondition=r,a.polygon.perPositionHeight=u.perPositionHeight,a.polygon.closeTop=u.closeTop,a.polygon.closeBottom=u.closeBottom,a.polygon.shadows=u.shadows;a="material:"+255*u.material.red+","+255*u.material.green+","+255*u.material.blue+";outlineColor:"+255*u.outlineColor.red+","+255*u.outlineColor.green+","+255*u.outlineColor.blue;c.Legend.push(a)}"function"==typeof l&&l(e),s.checked||c.setVisibility(!1)}),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id);o={id:u.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t,style:u,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:o,disFnc:l}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},Oe.prototype.createPolygonGeoJsonFeatureLayer=function(e,t,l,i,o,u){var r={height:0,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:0,shadows:this._cesium.ShadowMode.ENABLED,clampToGround:!0,classificationType:this._cesium.ClassificationType.BOTH,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0};this._core.isnull(l)||this._core.isnull(l.material)||(-1!=l.material.indexOf("type")?"checker"==l.material.type?l.material=new this._cesium.CheckerboardMaterialProperty({evenColor:l.material.evenColor,oddColor:l.material.oddColor,repeat:l.material.repeat}):"stripe"==l.material.type?l.material=new this._cesium.StripeMaterialProperty({evenColor:l.material.evenColor,oddColor:l.material.oddColor,repeat:l.material.repeat,offset:l.material.repeat,orientation:l.material.repeat}):"grid"==l.material.type&&(l.material=new this._cesium.GridMaterialProperty({color:l.material.color,cellAlpha:l.material.cellAlpha,lineCount:l.material.lineCount,lineThickness:l.material.lineThickness})):this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):-1!=l.material.indexOf("[")||"("==l.material.toString().charAt(0)&&")"==l.material.toString().charAt(l.material.length-1)||(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),this._core.isnull(l)||this._core.isnull(l.outlineColor)||(this._core.isHtmlColor(l.outlineColor)?l.outlineColor=this._color.colorFromHtmlColor(l.outlineColor):(/^rgb/.test(l.outlineColor)&&(l.outlineColor=this._color.rgbaStringToRgbaObj(l.outlineColor)),1<l.outlineColor.r&&(l.outlineColor.r=l.outlineColor.r/255),1<l.outlineColor.g&&(l.outlineColor.g=l.outlineColor.g/255),1<l.outlineColor.b&&(l.outlineColor.b=l.outlineColor.b/255),1<l.outlineColor.a&&(l.outlineColor.a=l.outlineColor.a/255),l.outlineColor=this._color.createColor(l.outlineColor.r,l.outlineColor.g,l.outlineColor.b,l.outlineColor.a)));var c=this._core.extend(r,l,!0);l.checked=o;null==t&&console.log("geojson is required");r=null,r=t.then?t:this._cesium.GeoJsonDataSource.load(t,{clampToGround:!0});this._viewer.dataSources.add(r);var h,m=this;l&&l.time&&(h=new m._cesium.TimeIntervalCollection([new m._cesium.TimeInterval({start:l.time.start?m._cesium.JulianDate.fromDate(new Date(l.time.start)):m._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?m._cesium.JulianDate.fromDate(new Date(l.time.end)):m._cesium.Iso8601.MAXIMUM_VALUE})])),r.then(function(e){var t=(m.item=e).entities.values;m._core.isnull(l.near)&&(l.near=0),m._core.isnull(l.far)&&(l.far=999999999);var i=parseFloat(l.near),o=parseFloat(l.far),r=new m._cesium.DistanceDisplayCondition(i,o);c.distanceDisplayCondition=r;for(var n=0;n<t.length;n++){var a=t[n];c.height=parseFloat(m._core.extendgl(a,l.height,c.height)),c.height!=c.height&&(c.height=void 0),c.extrudedHeight=m._core.extendgl(a,l.extrudedHeight,c.extrudedHeight),c.heightReference=m._core.extendgl(a,l.heightReference,c.heightReference),c.show=m._core.extendgl(a,l.show,c.show),c.fill=m._core.extendgl(a,l.fill,c.fill),c.material=m._core.extendgl(a,l.material,c.material),void 0!==c.extrudedHeight&&(c.extrudedHeight=parseFloat(c.extrudedHeight)),c.outline=m._core.extendgl(a,l.outline,c.outline),c.outlineColor=m._core.extendgl(a,l.outlineColor,c.outlineColor),c.outlineWidth=parseFloat(m._core.extendgl(a,l.outlineWidth,c.outlineWidth)),c.stRotation=m._core.extendgl(a,l.stRotation,c.stRotation),c.granularity=m._core.extendgl(a,l.granularity,c.granularity),c.distanceDisplayCondition=m._core.extendgl(a,l.distanceDisplayCondition,c.distanceDisplayCondition),c.perPositionHeight=m._core.extendgl(a,l.perPositionHeight,c.perPositionHeight),c.closeTop=m._core.extendgl(a,l.closeTop,c.closeTop),c.closeBottom=m._core.extendgl(a,l.closeBottom,c.closeBottom),c.shadows=m._core.extendgl(a,l.shadows,c.shadows),c.classificationType=m._core.extendgl(a,l.classificationType,c.classificationType),a.polygon._hierarchy._value.positions,a.polygon.extrudedHeightReference=c.extrudedHeightReference,a.polygon.heightReference=c.heightReference,1!=c.heightReference&&(a.polygon.height=c.height,c.height&&(a.polygon.perPositionHeight=!1)),1!=c.extrudedHeightReference&&(a.polygon.extrudedHeight=c.extrudedHeight),a.polygon.show=c.show,a.polygon.fill=c.fill,a.polygon.material=c.material,a.polygon.outline=c.outline,a.polygon.outlineColor=c.outlineColor,a.polygon.outlineWidth=c.outlineWidth,a.polygon.stRotation=c.stRotation,a.polygon.granularity=c.granularity,a.polygon.distanceDisplayCondition=r,a.polygon.closeTop=c.closeTop,a.polygon.closeBottom=c.closeBottom,a.polygon.shadows=c.shadows,a.polygon.classificationType=c.classificationType;var s="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue+";outlineColor:"+255*c.outlineColor.red+","+255*c.outlineColor.green+","+255*c.outlineColor.blue;m.Legend.push(s),h&&(a.availability=h)}l.checked?m.isShow=!0:m.setVisibility(!1),"function"==typeof u&&u(e)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id);o={id:c.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t,style:c,treeData:{name:e,geoOptions:t,styleOption:l,GroupID:i,checked:o,disFnc:u}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},Oe.prototype.createGeoJsonDataSource=function(e,t,i,o,r){i=this._cesium.GeoJsonDataSource.load(t,i);this._viewer.dataSources.add(i);var n=this;return i.then(function(e){n.item=e,"function"==typeof r&&r(e)}),this._tree.insertGroupId({id:this._core.getuid(),name:e,pId:this._core.isnull(o)?0:o,type:"layer",item:this},this._core.isnull(o)?0:o),this},Oe.prototype.deleteObject=function(){this._viewer.dataSources.remove(this.item)},Oe.prototype.getLevel=function(){var e,t=this._viewer.camera;return t&&t.positionCartographic&&t.positionCartographic.height?(e=this._viewer.scene.globe.getHeight(t.positionCartographic)||0,e=t.positionCartographic.height-e,Math.round(80955.31/(1+Math.pow(e/91610.74,7096758e-11))-40467.74)):0},Oe.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t},treeData:this.treeobj.treeData}},Oe.prototype.setVisibility=function(e){this.isShow=e,null!=this.item&&(this.item.show=e)},Oe.prototype.getVisibility=function(){return this.item.show},Oe.prototype.getProperties=function(){var e=[];if(this.item.entities.values){var t=this.item.entities.values[0];if(t.properties)for(var i=0;i<t.properties.propertyNames.length;i++)e.push({value:"["+t.properties.propertyNames[i]+"]",label:t.properties.propertyNames[i]})}return e},Oe.prototype.getTypes=function(){if(this.item.entities.values){var e=this.item.entities.values[0];return/^point.fid/.test(e._id)||null!=e.point?[{label:"文本标签",value:"labelLayer"},{label:"图片标签",value:"billboardLayer"},{label:"点标签",value:"pointLayer"},{label:"模型",value:"modelLayer"},{label:"圆",value:"circleLayer"}]:/^polygon.fid/.test(e._id)||null!=e.polygon?[{label:"面",value:"polygonLayer"}]:/^line.fid/.test(e._id)||null!=e.polyline?[{label:"线",value:"polylineLayer"}]:void 0}},Oe.prototype.getType=function(){if(this.item.entities.values){var e=this.item.entities.values[0];return null!=e.label&&e.label.show?{label:"文本标签",value:"labelLayer"}:null!=e.model&&e.model.show?{label:"模型",value:"modelLayer"}:null!=e.billboard&&e.billboard.show?{label:"图片标签",value:"billboardLayer"}:null!=e.ellipse&&e.ellipse.show?{label:"圆",value:"circleLayer"}:/^polygon.fid/.test(e._id)||null!=e.polygon?{label:"面",value:"polygonLayer"}:/^line.fid/.test(e._id)||null!=e.polyline?{label:"线",value:"polylineLayer"}:null!=e.polylineVolume&&e.polylineVolume.show?{label:"扫掠体",value:"polylineVolume"}:null!=e.wall&&null!=e.wall?{label:"墙",value:"polylineWall"}:{label:"点标签",value:"pointLayer"}}},Oe.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},Oe.prototype.getFirstDataSourceItem=function(){if(this.item.entities.values)return this.item.entities.values[0]},Oe.prototype.setTreeobj=function(e){this.treeobj=e},Oe.prototype.setItem=function(e){this.item=e},Object.defineProperties(Oe.prototype,{labelText:{set:Ce.debounce(function(e){var t=e;if(!this._core.isnull(e)){var i=this.item.entities.values;if(i&&0<i.length)for(var o=0;o<i.length;o++)if(/^\[/.test(e)&&(t=e.replace(/\[/,"").replace(/\]/,""),t=i[o].properties[t]._value),i[o].label){i[o].label.text=t;try{i[o].point.show=!1}catch(e){}}else{try{i[o].point.show=!1}catch(e){}i[o].label=new this._cesium.LabelGraphics({text:t,font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})}}},500)},labelStyles:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.style=e}},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.style:void 0}},labelFont:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,o=16;if(i&&(o=(i=i._value.trimLeft().trimRight()).split("px")[0]),t&&0<t.length&&t[0].label)for(var r=0;r<t.length;r++)t[r].label.font=o+"px "+e}}},500)},labelFontSize1:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,o="sans-serif";if(i&&(o=(i=i._value.trimLeft().trimRight()).split("px")[1]),t&&0<t.length&&t[0].label)for(var r=0;r<t.length;r++)t[r].label.font=e+"px  "+o}}},500)},labelFontSize:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if(e=e.toString().replace(/px/g,""),(!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.font=e+"px  sans-serif"}},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?parseFloat(e[0].label.font):void 0}},labelFillColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.fillColor=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.fillColor;return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}}},labelOutlineColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.outlineColor=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.outlineColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},labelOutlineWidth:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.outlineWidth=e}},200),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.outlineWidth;if(e)return e._value}}},labelBackgroundColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.backgroundColor=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.backgroundColor;return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}}},labelBackground:{set:Ce.debounce(function(e){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.showBackground=e},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.background:void 0}},labelScale:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.scale=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.scale;if(e)return e._value}}},labelHorizontalOrigin:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.horizontalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.horizontalOrigin;if(e)return e._value}}},labelVerticalOrigin:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.verticalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.verticalOrigin;if(e)return e._value}}},labelHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.heightReference;if(e)return e._value}}},labelDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,parseInt(e)),t[o].label.scaleByDistance=new this._cesium.NearFarScalar(i,1,parseInt(e),0)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&(e&&0<e.length&&e[0].label))return e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE}},labelDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(parseInt(e),i),t[o].label.scaleByDistance=new this._cesium.NearFarScalar(parseInt(e),1,i,0)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&(e&&0<e.length&&e[0].label))return e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.near:0}},labelHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),o=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=o}}},500),get:function(){return 0}},labelShow:{set:Ce.debounce(function(e){var t=this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].label&&e?(t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].label=new this._cesium.LabelGraphics({text:"label",font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})):(t[i].label&&(t[i].label.show=e),t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.show:void 0}},pointColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.color=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},pointShow:{set:Ce.debounce(function(e){var t=this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].point&&e?(t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].point=new this._cesium.PointGraphics({color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0})):(t[i].point&&(t[i].point.show=e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)return e&&0<e.length&&e[0].point?e[0].point.show:void 0}},pointPixelSize:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.pixelSize=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.pixelSize;if(e)return e._value}}},pointOutlineColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.outlineColor=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.outlineColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},pointOutlineWidth:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.outlineWidth=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.outlineWidth;if(e)return e._value}}},pointHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.heightReference;if(e)return e._value}}},pointDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[o].point.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&(e&&0<e.length&&e[0].point))return e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE}},pointDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[o].point.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&(e&&0<e.length&&e[0].point))return e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.near:0}},pointHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),o=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=o}}},500),get:function(){return 0}},modelShow:{set:Ce.debounce(function(e){var t=this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e),!t[i].model&&e?t[i].model=new this._cesium.ModelGraphics({show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}):(t[i].model&&(t[i].model.show=e),t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)return e&&0<e.length&&e[0].model?e[0].model.show:void 0}},modelUri:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length)for(var i,o=0;o<t.length;o++)t[o].model?t[o].model.uri=e:(/^\[/.test(e)&&(e=1<(i=e.split("[")).length?i[0]+i[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[o].properties[e])),t[o].model=new this._cesium.ModelGraphics({uri:e,show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}))}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.uri;if(e)return e._value}}},modelScale:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){e=parseFloat(e);var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].model.scale=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.scale;if(e)return e._value}}},modelShadows:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.shadows=e}},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)return e&&0<e.length&&e[0].model?e[0].model.shadows:void 0}},modelHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.heightReference;if(e)return e._value}}},modelDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities.values;e&&!/^point.fid/.test(e[0]._id)&&null==e[0].model||e&&0<e.length&&e[0].model&&(e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE)}},modelDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&(e&&0<e.length&&e[0].model))return e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.near:0}},modelColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.color=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},modelLightColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.lightColor=e}},100),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.lightColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},modelHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),o=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=o}}},500),get:function(){return 0}},billboardShow:{set:Ce.debounce(function(e){var t=this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].billboard&&e?(t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard=new this._cesium.BillboardGraphics({show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})):(t[i].billboard&&(t[i].billboard.show=e),t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.show:void 0}},billboardImage:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length)for(var i,o=0;o<t.length;o++)/^\[/.test(e)&&(e=1<(i=e.split("[")).length?i[0]+i[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[o].properties[e])),t[o].billboard?t[o].billboard.image=e:t[o].billboard=new this._cesium.BillboardGraphics({image:e,show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.image;if(e)return e._value}}},billboardScale:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.scale=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.scale;if(e)return e._value}}},billboardHorizontalOrigin:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.horizontalOrigin=e}},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.horizontalOrigin:void 0}},billboardVerticalOrigin:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.verticalOrigin=e}},500),get:function(){var e=this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.verticalOrigin:void 0}},billboardWidth:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.width=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.width;if(e)return e._value}}},billboardHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.height=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.height;if(e)return e._value}}},billboardColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.color=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},billboardHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].billboard.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].model){e=e[0].billboard.heightReference;if(e)return e._value}}},billboardDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[o].billboard.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&(e&&0<e.length&&e[0].billboard))return e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE}},billboardDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[o].billboard.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&(e&&0<e.length&&e[0].billboard))return e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.near:0}},billboardPHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),o=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=o}}},500),get:function(){return 0}},polylineShow:{set:Ce.debounce(function(e){var t=this.item.entities.values;if(/^line.fid/.test(t[0]._id)&&t&&0<t.length&&t[0].polyline)for(var i=0;i<t.length;i++)t[i].polyline&&(t[i].polyline.show=e)},500),get:function(){var e=this.item.entities.values;if(/^line.fid/.test(e[0]._id)||null!=e[0].polyline)return e&&0<e.length&&e[0].polyline?e[0].polyline.b:void 0}},polylineWidth:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){e=parseFloat(e);var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=0;i<t.length;i++)t[i].polyline.width=e}},500),get:function(){var e=this.item.entities.values;if((/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&e&&0<e.length&&e[0].polyline){e=e[0].polyline.width;if(e)return e._value}}},polylinemMterial:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=0;i<t.length;i++)t[i].polyline.material=e}},500),get:function(){var e=this.item.entities.values;if((/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&e&&0<e.length&&e[0].polyline){e=e[0].polyline.material;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},polylinemArcType:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=0;i<t.length;i++)t[i].polyline.arcType=e}},500),get:function(){var e=this.item.entities.values;if((/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&e&&0<e.length&&e[0].polyline){e=e[0].polyline.arcType;if(e)return e._value}}},polylineDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=t[0].polyline.distanceDisplayCondition?t[0].polyline.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].polyline.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities.values;if((/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&(e&&0<e.length&&e[0].polyline))return e[0].polyline.distanceDisplayCondition?e[0].polyline.distanceDisplayCondition._value.far:Number.MAX_VALUE}},polylineDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=t[0].polyline.distanceDisplayCondition?t[0].polyline.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].polyline.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities.values;if((/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&(e&&0<e.length&&e[0].polyline))return e[0].polyline.distanceDisplayCondition?e[0].polyline.distanceDisplayCondition._value.near:0}},polygonShow:{set:Ce.debounce(function(e){var t=this.item.entities.values;if(/^polygon.fid/.test(t[0]._id)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon&&(t[i].polygon.show=e)},500),get:function(){var e=this.item.entities.values;if(/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)return e&&0<e.length&&e[0].polygon?e[0].polygon.b:void 0}},polygonHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].polygon.height=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.height;if(e)return e._value}}},polygonHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.heightReference;if(e)return e._value}}},polygonExtrudedHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].polygon.extrudedHeight=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.extrudedHeight;if(e)return e._value}}},polygonExtrudedHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.extrudedHeightReference=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.extrudedHeightReference;if(e)return e._value}}},polygonFill:{set:Ce.debounce(function(e){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.fill=e},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.fill;if(e)return e._value}}},polygonMaterial:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.material=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.material;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},polygonOutline:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.outline=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.outline;if(e)return e._value}}},polygonOutlineColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.outlineColor=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.outlineColor;return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}}},polygonOutlineWidth:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].polygon.outlineWidth=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.outlineWidth;if(e)return e._value}}},polygonDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=t[0].polygon.distanceDisplayCondition?t[0].polygon.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].polygon.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&(e&&0<e.length&&e[0].polygon))return e[0].polygon.distanceDisplayCondition?e[0].polygon.distanceDisplayCondition._value.far:Number.MAX_VALUE}},polygonDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=t[0].polygon.distanceDisplayCondition?t[0].polygon.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].polygon.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&(e&&0<e.length&&e[0].polygon))return e[0].polygon.distanceDisplayCondition?e[0].polygon.distanceDisplayCondition._value.near:0}}}),He.prototype.update=function(e){this._quadtree.beginFrame(e),this._quadtree.render(e),this._quadtree.endFrame(e)},He.prototype.static=function(e){this.cs=e},He.prototype.initialize=function(e){},He.prototype.beginUpdate=function(e){},He.prototype.endUpdate=function(e){},He.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)},He.prototype.loadTile=function(e,t){},He.prototype.computeTileVisibility=function(e,t,i){var o=this.computeDistanceToTile(e,t);if(e._distance=o,t.fog.enabled&&1<=Cesium.Math.fog(o,t.fog.density))return Cesium.Visibility.NONE;var r=e.data;if(r.tileBoundingRegion,void 0===r.boundingVolumeSourceTile)return Cesium.Visibility.PARTIAL;var n=t.cullingVolume,a=r.orientedBoundingBox;!a&&r.renderedMesh&&(a=r.renderedMesh.boundingSphere3D),r.clippedByBoundaries=!1;var s,l,u=(s=e.rectangle,(l=this.cartographicLimitRectangle).west<l.east||(l=Rectangle.clone(l,splitCartographicLimitRectangleScratch),0<Rectangle.center(s,rectangleCenterScratch).longitude?l.east=CesiumMath.PI:l.west=-CesiumMath.PI),l),o=new Cesium.Rectangle,o=Cesium.Rectangle.simpleIntersection(u,e.rectangle,o);if(!o)return Visibility.NONE;if(Cesium.Rectangle.equals(o,e.rectangle)||(r.clippedByBoundaries=!0),t.mode,Cesium.SceneMode.SCENE3D,!a)return Cesium.Intersect.INTERSECTING;o=this._clippingPlanes;if(o&&o.enabled){o=o.computeIntersectionWithBoundingVolume(a);if(e.isClipped=o!==Intersect.INSIDE,o===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE}n=n.computeVisibility(a);if(n===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE;a=t.mode===Cesium.SceneMode.SCENE3D&&t.camera.frustum instanceof Cesium.OrthographicFrustum;if(t.mode!==Cesium.SceneMode.SCENE3D||a||!i)return n;r=r.occludeePointInScaledSpace;return!r||i.ellipsoid.isScaledSpacePointVisible(r)?n:Cesium.Visibility.NONE},He.prototype.canRefine=function(e,t,i){return e.level<=this._normalTile+1},He.prototype.showTileThisFrame=function(e,t,i,o){this._availability&&(this._state=this.isAvailable(t.time)),e.data.geometryPrimitive&&this._state&&this._client&&"function"==typeof e.data.geometryPrimitive.update&&(e.data.geometryPrimitive instanceof Cesium.Cesium3DTileset||e.data.geometryPrimitive.update(t,i,o))},He.prototype.computeDistanceToTile=function(e,t){var i,o,r,n,a,s,l,u,c,h,m,d=(i=this._maximumHeight,o=this._minimumHeight,r=e,this.terrainProvider,void 0===(n=r.data)&&(n=r.data=new Cesium.GlobeSurfaceTile),r._minimumHeight&&(o=r._minimumHeight),r._maximumHeight&&(i=r._maximumHeight),void 0===n.tileBoundingRegion&&(n.tileBoundingRegion=new Cesium.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:r.rectangle,ellipsoid:r.tilingScheme.ellipsoid,minimumHeight:o||0,maximumHeight:i||0})),r),p=e.data,g=p.tileBoundingRegion;if(void 0===d)return 9999999999;p.boundingVolumeSourceTile!==d&&(p.boundingVolumeSourceTile=d,(_=e.rectangle)&&_.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(p.orientedBoundingBox=Cesium.OrientedBoundingBox.fromRectangle(e.rectangle,g.minimumHeight,g.maximumHeight,e.tilingScheme.ellipsoid,p.orientedBoundingBox),p.occludeePointInScaledSpace=(a=this,s=p.orientedBoundingBox.center,l=e.rectangle,u=g.maximumHeight,c=p.occludeePointInScaledSpace,h=a.quadtree._occluders.ellipsoid,m=h.ellipsoid,a=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],Cesium.Cartesian3.fromRadians(l.west,l.south,u,m,a[0]),Cesium.Cartesian3.fromRadians(l.east,l.south,u,m,a[1]),Cesium.Cartesian3.fromRadians(l.west,l.north,u,m,a[2]),Cesium.Cartesian3.fromRadians(l.east,l.north,u,m,a[3]),h.computeHorizonCullingPoint(s,a,c))));var d=g.minimumHeight,_=g.maximumHeight;p.boundingVolumeSourceTile!==e&&(p=t.camera.positionCartographic.height,e=Math.abs(p-d),Math.abs(p-_)<e?(g.minimumHeight=d,g.maximumHeight=d):(g.minimumHeight=_,g.maximumHeight=_));t=g.distanceToCamera(t);return g.minimumHeight=d,g.maximumHeight=_,t},He.prototype.isDestroyed=function(){return!1},He.prototype.destroy=function(){return Cesium.destroyObject(this)},He.prototype.remove=function(){this.destroy()},He.prototype.setStatus=function(e){this._state=e,this._client=e},He.prototype.edit=function(e,r){let d=this,p=this._viewer;if(r=r||{},this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),e=void 0===e?!0:e){var g,_,f,y;this.editHandler=new this._cesium.ScreenSpaceEventHandler(p.scene.canvas),this.isEditting=!1;let m;return this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))d.isEditting&&(v(),d.defaultEvent(!1));else{var i=t.position,o=p.scene.pick(i);if((!o||!o.id||o.id.treeID===d.treeID)&&o&&o.id&&(o.id instanceof Cesium.Entity||o.id.VectorType)){let e=o.id;d.isEditting||0!=we.states?(e!=g||"point"!==e.VectorType&&"billboard"!==e.VectorType&&"label"!==e.VectorType&&"model"!==e.VectorType)&&"_height_point"!=e.name&&"_edit_point"!=e.name&&"_move_point"!=e.name&&"_add_point"!=e.name&&"_size_point"!=e.name||(p.container.style.cursor="crosshair",d.defaultEvent(!1),"_height_point"==e.name?(f={windowPosition:i,originHeight:d._cesium.Cartographic.fromCartesian(e.position.getValue()).height},m="_height_point"):"_move_point"==e.name?m="_move_point":"point"===e.VectorType||"billboard"===e.VectorType||"label"===e.VectorType||"model"===e.VectorType?(d.tooltip.showAt(t.position,"释放后完成修改"),m="_move_point","model"===e.VectorType&&(e.show=!1)):"_edit_point"==e.name?m="_edit_point":"_add_point"==e.name?m="_add_point":"_size_point"==e.name&&(m="_size_point"),_=e):(r.callBack&&r.callBack.start&&r.callBack.start(e),y=e.VectorType,(g=d.createEditEntity(y,e.VectorStyle)).feature=e,g.treeID=d.treeID,d.getSimpleGraphicData(y,g),"point"===y||"billboard"===y||"label"===y||"model"===y?(d.isEditting=!0,d.tooltip.showAt(t.position,"拖拽修改位置")):(d.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint(),SmartEarthPopupData.editGraphic.setTreeID(d.treeID)),d.setStatus(!1),we.editVector=!0)}}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))d.isEditting&&(v(),d.defaultEvent(!1));else{var o=p.scene.pick(t.endPosition);if((!o||!o.id||o.id.treeID===d.treeID)&&(d._cesium.defined(o)?d.isEditting&&!_?"point"!==y&&"billboard"!==y&&"label"!==y&&"model"!==y||o.id!=g?o.id&&"_edit_point"===o.id.name&&g.pottingPoint?"polyline"===y&&2<g.pottingPoint.length||"polygon"===y&&3<g.pottingPoint.length?d.tooltip.showAt(t.endPosition,"拖拽修改位置,右键删除点"):d.tooltip.showAt(t.endPosition,"拖拽修改位置"):!o.id||"_move_point"!==o.id.name&&"_size_point"!==o.id.name?o.id&&"_add_point"===o.id.name?d.tooltip.showAt(t.endPosition,"拖拽增加节点"):o.id&&"_height_point"===o.id.name?d.tooltip.showAt(t.endPosition,"拖拽修改高度"):o.id==g&&d.tooltip.show(!1):d.tooltip.showAt(t.endPosition,"拖拽修改位置"):d.tooltip.showAt(t.endPosition,"拖拽修改位置,右键删除"):d.isEditting||0!==we.states||(o.id&&o.id.VectorType?d.tooltip.showAt(t.endPosition,"点击激活编辑"):d.tooltip.show(!1)):0!=we.states||_||d.tooltip.show(!1),d.isEditting&&_)){d.tooltip.showAt(t.endPosition,"释放后完成修改");let i=d._getPosition.getMousePosition(t);if(i||"_height_point"===m)if("_edit_point"===m){_.position=i;var r=we.editPointID.edit.indexOf(_.id);if(void 0!==g[y].height?(o=d.toDegrees(i),g.pottingPoint[r]=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,g[y].height.getValue()),_.position=g.pottingPoint[r]):g.pottingPoint[r]=i,0<we.editPointID.add.length){if(0<r){let i=p.entities.getById(we.editPointID.add[r-1]);if(i){let e=p.entities.getById(we.editPointID.edit[r-1]),t=p.entities.getById(we.editPointID.edit[r]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}if(r<g.pottingPoint.length-1){let i=p.entities.getById(we.editPointID.add[r]);if(i){let e=p.entities.getById(we.editPointID.edit[r]),t=p.entities.getById(we.editPointID.edit[r+1]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}if("polygon"===y&&(0===r||r===g.pottingPoint.length-1)){let i=p.entities.getById(we.editPointID.add[we.editPointID.add.length-1]);if(i){let e=p.entities.getById(we.editPointID.edit[0]),t=p.entities.getById(we.editPointID.edit[g.pottingPoint.length-1]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}}let e=g.pottingPoint.concat([]),t=new d._cesium.Cartesian3;r=e.length;e.forEach(e=>{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=r,t.y/=r,t.z/=r,we.editPointID.move&&(we.editPointID.move.position=t),"polyline"!==y&&"polygon"!==y&&"rectangle"!==y||SmartEarthPopupData.editGraphic.setValue("positions",e)}else if("_height_point"===m){var n=we.editPointID.height.indexOf(_.id);let e=p.entities.getById(we.editPointID.edit[n]);"ellipse"!==y&&"cylinder"!==y&&"box"!==y||(e=we.editPointID.move);let i=d.toDegrees(e.position.getValue());var a=f.originHeight-i.height,s=p.scene.cartesianToCanvasCoordinates(e.position.getValue()),n=(f.windowPosition.y-t.endPosition.y)*a/Math.abs(s.y-f.windowPosition.y);let o=Math.abs(a+n);we.editPointID.height.forEach(e=>{let t=p.entities.getById(e);t&&(e=t.position.getValue(),e=d.toDegrees(e),t.position=d._cesium.Cartesian3.fromDegrees(e.lon,e.lat,o+i.height))}),g[y].extrudedHeight?g[y].extrudedHeight=o+i.height:"box"===y?SmartEarthPopupData.editGraphic.setValue("height",o):"cylinder"===y&&SmartEarthPopupData.editGraphic.setValue("length",o)}else if("_add_point"===m){t=we.editPointID.add.indexOf(_.id);p.entities.remove(_);s=p.entities.add({name:"_edit_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.edit.splice(t+1,0,s.id),g.pottingPoint.splice(t+1,0,i.clone());a=Cesium.Cartesian3.midpoint(g.pottingPoint[t],g.pottingPoint[t+1],new Cesium.Cartesian3),n=p.entities.add({name:"_add_point",position:a,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),a=Cesium.Cartesian3.midpoint(g.pottingPoint[t+1],g.pottingPoint[t+2===g.pottingPoint.length?0:t+2],new Cesium.Cartesian3),a=p.entities.add({name:"_add_point",position:a,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.add.splice(t,1,n.id,a.id),SmartEarthPopupData.editGraphic.setTreeID(d.treeID),_=s,m="_edit_point";s=g.pottingPoint.concat([]);"polyline"!==y&&"polygon"!==y||SmartEarthPopupData.editGraphic.setValue("positions",s)}else if("_size_point"===m){var e=we.editPointID.move.position.getValue(),e=d._cesium.Cartesian3.distance(e,i);"ellipse"===y||"cylinder"===y||"ellipsoid"===y&&g.isSphere?SmartEarthPopupData.editGraphic.setValue("radius",e):"box"===y&&(l=90===_.angle?"long":"width",SmartEarthPopupData.editGraphic.setValue(l,2*e))}else if("point"!==y&&"billboard"!==y&&"label"!==y&&"model"!==y){var l=d.toDegrees(i);f=_.position.getValue();e=d.toDegrees(f);let n=l.lon-e.lon,a=l.lat-e.lat,s=l.height-e.height;_.position=i,g[y].height&&(h=d.toDegrees(i).height,g[y].height=h,g.thisHeight=h),g.pottingPoint.forEach((e,t)=>{let i,o,r=p.entities.getById(we.editPointID.edit[t]);if(r=r||p.entities.getById(we.editPointID.size[t]),i=r?d.toDegrees(r.position.getValue()):d.toDegrees(e),o=d._cesium.Cartesian3.fromDegrees(i.lon+n,i.lat+a,i.height+s),e.x=o.x,e.y=o.y,e.z=o.z,r&&(r.position=o),0<we.editPointID.add.length&&we.editPointID.add[t]){let e=p.entities.getById(we.editPointID.add[t]);e&&(i=d.toDegrees(e.position.getValue()),e.position=d._cesium.Cartesian3.fromDegrees(i.lon+n,i.lat+a,i.height+s))}});var u,c,h=g.pottingPoint.concat([]);"polyline"===y||"polygon"===y||"rectangle"===y?SmartEarthPopupData.editGraphic.setValue("positions",h):"ellipse"===y?(g.pottingPoint[1]=i,g.position=i.clone()):"box"===y?(g.pottingPoint[2]=i,c=g.box.dimensions.getValue(),u=d.toDegrees(i),g.position=Cesium.Cartesian3.fromDegrees(u.lon,u.lat,u.height+c.z/2)):"cylinder"===y?(g.pottingPoint[1]=i,u=g.cylinder.length.getValue(),c=d.toDegrees(g.pottingPoint[1]),g.position=Cesium.Cartesian3.fromDegrees(c.lon,c.lat,c.height+u/2)):"ellipsoid"===y&&(g.pottingPoint[g.pottingPoint.length-1]=i,g.position=i.clone())}else _.position=i}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(e=>{Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?d.isEditting&&(v(),d.defaultEvent(!1)):(_&&"model"===_.VectorType&&(_.show=!0),_&&r.callBack&&r.callBack.updata&&r.callBack.updata(_.name,g),p.container.style.cursor="default",_=void 0,d.defaultEvent(!0))},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(e=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))d.isEditting&&(v(),d.defaultEvent(!1));else{var i=p.scene.pick(e.position);if((!i||!i.id||i.id.treeID===d.treeID)&&d._cesium.defined(i)&&0==we.states){e=i.id;if(!e.VectorType&&-1<we.editPointID.edit.indexOf(e.id)&&("polyline"===y&&2<we.editPointID.edit.length||"polygon"===y&&3<we.editPointID.edit.length)){i=we.editPointID.edit.indexOf(e.id);if(p.entities.removeById(e.id),we.editPointID.edit.splice(i,1),g.pottingPoint.splice(i,1),0<we.editPointID.add.length)if(we.editPointID.add[i]){if(p.entities.removeById(we.editPointID.add[i]),we.editPointID.add.splice(i,1),0<=i-1){let e=p.entities.getById(we.editPointID.add[i-1]);e&&(e.position=Cesium.Cartesian3.midpoint(g.pottingPoint[i-1],g.pottingPoint[i===g.pottingPoint.length?0:i],new Cesium.Cartesian3))}else if(i-1==-1&&"polygon"===y){let e=p.entities.getById(we.editPointID.add[we.editPointID.add.length-1]);e&&(e.position=Cesium.Cartesian3.midpoint(g.pottingPoint[0],g.pottingPoint[g.pottingPoint.length-1],new Cesium.Cartesian3))}}else p.entities.removeById(we.editPointID.add[i-1]),we.editPointID.add.pop();let t=new d._cesium.Cartesian3;i=g.pottingPoint.length;g.pottingPoint.forEach(e=>{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=i,t.y/=i,t.z/=i,we.editPointID.move&&(we.editPointID.move.position=t);i=g.pottingPoint.concat([]);"polyline"!==y&&"polygon"!==y||SmartEarthPopupData.editGraphic.setValue("positions",i),d.tooltip.show(!1),r.callBack&&r.callBack.updata&&r.callBack.updata(_&&_.name,g)}}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),v(),{endThisEdit:v,getEditData:function(){return{entity:g}}};function v(){d.defaultEvent(!0),we.editPointID.edit.forEach(e=>{p.entities.removeById(e)}),we.editPointID.edit=[],we.editPointID.height.forEach(e=>{p.entities.removeById(e)}),we.editPointID.height=[],we.editPointID.add.forEach(e=>{p.entities.removeById(e)}),we.editPointID.add=[],we.editPointID.size.forEach(e=>{p.entities.removeById(e)}),we.editPointID.size=[],we.editPointID.move&&p.entities.remove(we.editPointID.move),we.editPointID.move=void 0,g&&p.entities.remove(g),y=g=void 0,SmartEarthPopupData.editGraphic={},d.isEditting=!1,d.setStatus(!0),we.editVector=!1,d.delButton(!1)}}else v()},He.prototype.createEditEntity=function(e,i){let o;var r=this;let n=this._viewer;if("polygon"===e){let e=i.positions;var a=r._core.defaultValue(i.height,void 0);let t;t=i.hierarchy||(e=i.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(e):r._cesium.Cartesian3.fromDegreesArray(e),new r._cesium.PolygonHierarchy(e)),o=n.entities.add({polygon:{hierarchy:new r._cesium.CallbackProperty(function(){return t},!1),extrudedHeight:r._core.defaultValue(i.extrudedHeight,void 0),height:a,material:new r._cesium.ImageMaterialProperty({image:r._core.defaultValue(i.image,null),repeat:r._core.defaultValue(i.repeat,new r._cesium.Cartesian2(1,1)),color:i.material}),shadows:r._cesium.ShadowMode.ENABLED,fill:!0}}),o.VectorType="polygon"}else if("polyline"===e){let e=i.positions;e=i.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(e):r._cesium.Cartesian3.fromDegreesArray(e),o=n.entities.add({polyline:{positions:new r._cesium.CallbackProperty(function(){return e},!1),clampToGround:r._core.defaultValue(i.clampToGround,!1),material:new Cesium.PolylineOutlineMaterialProperty({color:i.material,outlineWidth:r._core.defaultValue(i.outlineWidth,0),outlineColor:r._cesium.Color.fromCssColorString(r._core.defaultValue(i.outlineColor,"rgba(255,255,255,0.6)"))}),width:r._core.defaultValue(i.width,3)}}),o.VectorType="polyline"}else if("wall"===e){let e=i.positions;e=i.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(e):r._cesium.Cartesian3.fromDegreesArray(e),o=n.entities.add({wall:{positions:new r._cesium.CallbackProperty(function(){return e},!1),minimumHeights:i.minimumHeights,maximumHeights:i.maximumHeights,material:i.material,outline:!0,outlineWidth:r._core.defaultValue(i.outlineWidth,0),outlineColor:i.outlineColor}}),o.VectorType="wall"}else"label"===e?(o=n.entities.add({position:i.position,label:{text:i.text,font:i.font,scale:i.scale,style:i.style,fillColor:i.fillColor,outlineColor:i.outlineColor,outlineWidth:i.outlineWidth,showBackground:i.showBackground,backgroundColor:i.backgroundColor,heightReference:i.heightReference,horizontalOrigin:i.horizontalOrigin,verticalOrigin:i.verticalOrigin,scaleByDistance:i.scaleByDistance,distanceDisplayCondition:i.distanceDisplayCondition}}),o.VectorType="label"):"billboard"===e?(o=n.entities.add({position:i.position,billboard:{rotation:i.rotation,width:i.width,height:i.height,image:i.image,color:i.color,scale:i.scale,heightReference:i.heightReference,horizontalOrigin:i.horizontalOrigin,verticalOrigin:i.verticalOrigin,scaleByDistance:i.scaleByDistance,distanceDisplayCondition:i.distanceDisplayCondition}}),o.VectorType="billboard"):"point"===e&&(o=n.entities.add({position:i.position,point:{pixelSize:i.pixelSize,color:i.color,outlineWidth:i.outlineWidth,outlineColor:i.outlineColor,heightReference:i.heightReference,scaleByDistance:i.scaleByDistance,distanceDisplayCondition:i.distanceDisplayCondition}}),o.VectorType="point");return o},He.prototype.delButton=function(e,t,i){if(e){let e=document.getElementById("DeleteMilitaryStandardDelete");e||(e=document.createElement("button"),e.id="DeleteMilitaryStandardDelete",e.innerText="删除对象",e.style.cssText=`height: 38px;
                        line-height: 38px;
                        padding: 0 18px;
                        background-color: #052355;
                        color: #fff;
                        white-space: nowrap;
                        text-align: center;
                        font-size: 14px;
                        border: none;
                        border-radius: 2px;
                        cursor: pointer;
                        position: absolute;`,this._viewer.container.appendChild(e)),e.style.display="block",e.style.top=t.y+"px",e.style.left=t.x+"px",e.onclick=i}else{let e=document.getElementById("DeleteMilitaryStandardDelete");e&&(e.style.display="none",e.onclick=null)}},He.prototype.defaultEvent=function(e){let t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},He.prototype.getEntityTypeAndObject=function(e){let t={type:"",object:null};return e&&(e.billboard?(t.type="billboard",t.object=e.billboard):e.box?(t.type="box",t.object=e.box):e.corridor?(t.type="corridor",t.object=e.corridor):e.cylinder?(t.type="cylinder",t.object=e.cylinder):e.ellipse?(t.type="ellipse",t.object=e.ellipse):e.ellipsoid?(t.type="ellipsoid",t.object=e.ellipsoid):e.label?(t.type="label",t.object=e.label):e.model?(t.type="model",t.object=e.model):e.path?(t.type="path",t.object=e.path):e.plane?(t.type="plane",t.object=e.plane):e.point?(t.type="point",t.object=e.point):e.polygon?(t.type="polygon",t.object=e.polygon):e.polyline?(t.type="polyline",t.object=e.polyline):e.polylineVolume?(t.type="polylineVolume",t.object=e.polylineVolume):e.rectangle?(t.type="rectangle",t.object=e.rectangle):e.wall&&(t.type="wall",t.object=e.wall)),t},He.prototype.toDegrees=function(e){e=this._cesium.Cartographic.fromCartesian(e);return{lon:this._cesium.Math.toDegrees(e.longitude),lat:this._cesium.Math.toDegrees(e.latitude),height:e.height}},He.prototype.getSimpleGraphicData=function(e,a){let s=this,l=this._viewer;var t,i,o,r,n;function u(e){SmartEarthPopupData.editGraphic.fillColor=h("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.alpha=100*e.alpha}function c(e){SmartEarthPopupData.editGraphic.outlineColor=h("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.outlineAlpha=100*e.alpha}function h(e){let t=e;if(/^(rgb|RGB)/.test(t)){let e=t.replace(/(rgb|RGB)*/g,"");e=e.replace("(","").replace(")","");var o=e.split(",");let i="#";for(let t=0;t<o.length;t++){let e=Number(o[t]).toString(16);e=1===e.length?"0"+e:e,"0"===e&&(e+=e),i+=e}return 7!==i.length&&(i=t),i}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;var i=t.replace(/#/,"").split("");if(6===i.length)return t;if(3===i.length){let t="#";for(let e=0;e<i.length;e+=1)t+=i[e]+i[e];return t}}SmartEarthPopupData.editGraphic={entity:a,type:e,graphic:a[e],getValue:function(e){if("position"===e||"name"===e||"id"===e)return this.entity[e]&&(this.entity[e].getValue?this.entity[e].getValue():this.entity[e]);if("radius"===e)return"ellipse"===this.type?this.graphic.semiMajorAxis.getValue():"ellipsoid"===this.type?this.graphic.radii.getValue().x:"cylinder"===this.type?this.graphic.bottomRadius.getValue():void 0;if("pHeight"!==e)return"repeat"===e?this.graphic.material[e]&&(this.graphic.material[e].getValue?this.graphic.material[e].getValue():this.graphic.material[e]):this.graphic[e]&&(this.graphic[e].getValue?this.graphic[e].getValue():this.graphic[e]);if(this.getValue("position")){e=this.getValue("position");return Cesium.Cartographic.fromCartesian(e).height}},changeHeightPoint:function(i){0<we.editPointID.height.length&&we.editPointID.height.forEach(e=>{let t=l.entities.getById(e);t&&(e=t.position.getValue(),e=s.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i))})},changeEditPoint:function(i){0<we.editPointID.edit.length&&we.editPointID.edit.forEach(e=>{let t=l.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=s.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))}),0<we.editPointID.size.length&&we.editPointID.size.forEach(e=>{let t=l.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=s.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))}),0<we.editPointID.add.length&&we.editPointID.add.forEach(e=>{let t=l.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=s.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))});let e=we.editPointID.move;var t;e&&("clampToGround"===i?e.point.heightReference=1:(e.point.heightReference=0,t=e.position.getValue(),t=s.toDegrees(t),e.position=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,i)))},clearAllEditPoint:function(){we.editPointID.edit.forEach(e=>{l.entities.removeById(e)}),we.editPointID.edit=[],we.editPointID.height.forEach(e=>{l.entities.removeById(e)}),we.editPointID.height=[],we.editPointID.add.forEach(e=>{l.entities.removeById(e)}),we.editPointID.add=[],we.editPointID.size.forEach(e=>{l.entities.removeById(e)}),we.editPointID.size=[],we.editPointID.move&&l.entities.remove(we.editPointID.move),we.editPointID.move=void 0},setTreeID:function(i){we.editPointID.edit.forEach(e=>{let t=l.entities.getById(e);t.treeID=i}),we.editPointID.height.forEach(e=>{let t=l.entities.getById(e);t.treeID=i}),we.editPointID.add.forEach(e=>{let t=l.entities.getById(e);t.treeID=i}),we.editPointID.size.forEach(e=>{let t=l.entities.getById(e);t.treeID=i}),we.editPointID.move&&(we.editPointID.move.treeID=i)}},"billboard"===e||"point"===e||"label"===e||"model"===e?((t=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor"))?u(t):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(t=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(t):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),"label"===e&&((i=SmartEarthPopupData.editGraphic.getValue("backgroundColor"))?(n=i,SmartEarthPopupData.editGraphic.backgroundColor=h("rgb("+255*n.red+","+255*n.green+","+255*n.blue+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=100*n.alpha):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("position"===e||"name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e||"backgroundColor"===e||"fillColor"===e)t=Cesium.Color.fromCssColorString(t);else if("fontSize"===e){let e=this.getValue("font");e=e.split(" "),e[0]=t,t=e.join(" ")}else{if("alpha"===e)return void("label"===this.type?this.graphic.fillColor._value.alpha=t:this.graphic.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("backgroundAlpha"===e)return void(this.graphic.backgroundColor._value.alpha=t);if("pHeight"===e&&this.getValue("position")){var i=this.getValue("position");let e=Cesium.Cartographic.fromCartesian(i);return e.height=t,void(this.entity.position=Cesium.Cartographic.toCartesian(e))}}this.graphic[e]=t}}):"polyline"===e?((i=SmartEarthPopupData.editGraphic.getValue("material")).color?u(i.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),i.outlineColor?c(i.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e)return t=Cesium.Color.fromCssColorString(t),void(this.graphic.material[e]=t);"outlineWidth"!==e?"alpha"!==e?"outlineAlpha"!==e?this.graphic[e]="positions"!==e?t:new Cesium.CallbackProperty(function(){return t},!1):this.graphic.material.outlineColor._value.alpha=t:this.graphic.material.color._value.alpha=t:this.graphic.material[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("positions");return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let o=new Cesium.Cartesian3;t.forEach((e,t)=>{var i=l.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=t.length,o.y/=t.length,o.z/=t.length,we.editPointID.move=l.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let e=0;e<t.length-1;e++){var i=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),i=l.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.add.push(i.id)}}}):"polygon"===e?((o=SmartEarthPopupData.editGraphic.getValue("material")).color?u(o.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(o=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(o):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,i){if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("positions"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(i)},!1));if("hierarchy"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return i},!1));if("clampToGround"===e){function t(e,t,i){i?(e.perPositionHeight=!1,e.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(e.perPositionHeight=!0,e.heightReference=Cesium.HeightReference.NONE),0<we.editPointID.edit.length&&!i&&t.forEach((e,t)=>{let i=l.entities.getById(we.editPointID.edit[t]);i&&(t=i.position.getValue(),e.x=t.x,e.y=t.y,e.z=t.z)}),e.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)}return this.graphic.hierarchy instanceof Cesium.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(()=>{t(this.graphic,this.entity.pottingPoint,i)},100)):t(this.graphic,this.entity.pottingPoint,i),void(0<we.editPointID.add.length&&we.editPointID.add.forEach(e=>{let t=l.entities.getById(e);t&&(t.point.heightReference=i?1:0)}))}"extrudedHeight"===e?this.changeHeightPoint(i):"height"===e&&this.changeEditPoint(i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let e=this.getValue("hierarchy"),t=e.positions.concat([]);if(void 0!==this.getValue("height")){let i=this.getValue("height");t.forEach(e=>{var t=s.toDegrees(e),t=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,i);e.x=t.x,e.y=t.y,e.z=t.z})}return this.entity.pottingPoint=t,t},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let o=new Cesium.Cartesian3;t.forEach((e,t)=>{var i=l.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=t.length,o.y/=t.length,o.z/=t.length,we.editPointID.move=l.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let e=0;e<t.length-1;e++){var i=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),i=l.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.add.push(i.id)}var e=Cesium.Cartesian3.midpoint(t[0],t[t.length-1],new Cesium.Cartesian3),e=l.entities.add({name:"_add_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.add.push(e.id)}}):"ellipse"===e||"cylinder"===e||a.isSphere?((o=SmartEarthPopupData.editGraphic.getValue("material")).color?u(o.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(o=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(o):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,i){if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("semiMajorAxis"===e)return void(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return i},!1));if("semiMinorAxis"===e)return void(this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return i},!1));if("radii"===e)return void(this.graphic.radii=new Cesium.CallbackProperty(function(){return i},!1));if("topRadius"===e)return void(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return i},!1));if("bottomRadius"===e)return void(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return i},!1));if("radius"===e){"ellipse"===this.type?(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return i},!1),this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return i},!1)):"ellipsoid"===this.type?null!==this.graphic.material.image.getValue()?this.graphic.radii=new Cesium.Cartesian3(i,i,i):this.graphic.radii=new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(i,i,i)},!1):"cylinder"===this.type&&(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return i},!1),this.entity.changeTop&&(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return i},!1)));var o=we.editPointID.move.position.getValue(),r=s.GetPositionFromA_D(o,i,90);let e=l.entities.getById(we.editPointID.size[0]);e.position=r,a.pottingPoint[0]=r,a.pottingPoint[a.pottingPoint.length-1]=o;let t=l.entities.getById(we.editPointID.height[0]);return void(t&&(r=s.toDegrees(r),n=s._cesium.Cartographic.fromCartesian(t.position.getValue()),t.position=s._cesium.Cartesian3.fromDegrees(r.lon,r.lat,n.height)))}if("cylinder"===this.type&&"length"===e){this.graphic.length=i;var n=s.toDegrees(this.entity.pottingPoint[1]);return this.entity.position=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,n.height+i/2),void this.changeHeightPoint(n.height+i)}if("ellipse"===this.type&&"clampToGround"===e){function t(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);let o=t.semiMinorAxis.getValue();t.semiMinorAxis=new Cesium.CallbackProperty(function(){return o},!1),t.semiMajorAxis=new Cesium.CallbackProperty(function(){return o},!1)}return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(()=>{t(this.entity,this.graphic,i)},100)):t(this.entity,this.graphic,i),void(i?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"ellipse"===this.type&&"extrudedHeight"===e?this.changeHeightPoint(i):"ellipse"===this.type&&"height"===e&&(this.changeEditPoint(i),this.entity.thisHeight=i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e,t=this.getValue("radius");let i=this.getValue("position");if("ellipse"===this.type||this.entity.isSphere){"ellipse"===this.type&&void 0!==this.getValue("height")&&(o=this.getValue("height"),e=s.toDegrees(i),i=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,o));var o=s.GetPositionFromA_D(i,t,90);return this.entity.pottingPoint=[o,i],[o,i]}o=s.toDegrees(i);i=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height-this.getValue("length")/2);t=s.GetPositionFromA_D(i,t,90);return this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var t=this.getPottingPoint();if(t){let e=l.entities.add({name:"_size_point",position:t[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});e.angle=90,we.editPointID.size.push(e.id),we.editPointID.move=l.entities.add({name:"_move_point",position:t[1],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}):"rectangle"===e?((r=SmartEarthPopupData.editGraphic.getValue("material")).color?u(r.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(r=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(r):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return Cesium.Rectangle.fromCartesianArray(t)},!1));if("coordinates"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return t},!1));if("clampToGround"===e){function i(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);let o=t.coordinates.getValue();t.coordinates=new Cesium.CallbackProperty(function(){return o},!1)}return this.graphic.coordinates instanceof Cesium.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(()=>{i(this.entity,this.graphic,t)},100)):i(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"extrudedHeight"===e?this.changeHeightPoint(t):"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("coordinates");let t,i,o=this.getValue("height");return i=(void 0!==o?t=Cesium.Cartesian3.fromRadians(e.west,e.north,o):(o=l.scene.sampleHeight(new Cesium.Cartographic(e.west,e.north,0),[this.entity]),t=Cesium.Cartesian3.fromRadians(e.west,e.north,o),o=l.scene.sampleHeight(new Cesium.Cartographic(e.east,e.south,0),[this.entity])),Cesium.Cartesian3.fromRadians(e.east,e.south,o)),this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let e=this.getPottingPoint();if(e){let o=new Cesium.Cartesian3;e.forEach((e,t)=>{var i=l.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});we.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=e.length,o.y/=e.length,o.z/=e.length,we.editPointID.move=l.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}):"box"===e?((r=SmartEarthPopupData.editGraphic.getValue("material")).color?u(r.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(r=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(r):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(t,i){if("name"===t)this.entity[t]=i;else{if("color"===t||"outlineColor"===t){if(i=Cesium.Color.fromCssColorString(i),"color"===t)return void(this.graphic.material.color=i)}else{if("image"===t||"repeat"===t)return void(this.graphic.material[t]=i);if("alpha"===t)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===t)return void(this.graphic.outlineColor._value.alpha=i);if("long"===t||"width"===t||"height"===t){let e=this.getValue("dimensions");if("long"===t?e.x=i:"width"===t?e.y=i:e.z=i,this.graphic.dimensions=new Cesium.CallbackProperty(function(){return e},!1),"long"===t||"width"===t){var o="long"===t?90:180,r="long"===t?0:1,n=we.editPointID.move.position.getValue(),o=s.GetPositionFromA_D(n,i/2,o);let e=l.entities.getById(we.editPointID.size[r]);e.position=o,this.entity.pottingPoint[r]=o,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{n=s.toDegrees(we.editPointID.move.position.getValue());this.entity.position=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,n.height+i/2),this.changeHeightPoint(n.height+i)}return}if("dimensions"===t)return void(this.graphic.dimensions=new Cesium.CallbackProperty(function(){return i},!1))}this.graphic[t]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("dimensions"),t=this.getValue("position"),i=s.toDegrees(t),t=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height-e.z/2),i=s.GetPositionFromA_D(t,e.x/2,90),e=s.GetPositionFromA_D(t,e.y/2,180);return this.entity.pottingPoint=[i,e,t],[i,e,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var i=this.getPottingPoint();if(i){let e=l.entities.add({name:"_size_point",position:i[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});e.angle=90;let t=l.entities.add({name:"_size_point",position:i[1],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});t.angle=180,we.editPointID.size.push(e.id),we.editPointID.size.push(t.id),we.editPointID.move=l.entities.add({name:"_move_point",position:i[2],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}):"corridor"===e||"ellipsoid"===e&&a.isSphere},Ve.prototype.createLabelPointGeoJsonFeatureLayer=function(e,t,s,i,l){null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t),u=this;o.then(function(e){var t={Name:"",text:"",font:" 30px sans-serif",stylet:u._cesium.LabelStyle.OUTLINE,fillColor:u._cesium.Color.WHITE,outlineColor:u._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new u._cesium.Color(.165,.165,.165,.8),backgroundPadding:new u._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:u._cesium.HorizontalOrigin.CENTER,verticalOrigin:u._cesium.VerticalOrigin.CENTER,eyeOffset:u._cesium.Cartesian3.ZERO,pixelOffset:u._cesium.Cartesian2.ZERO,heightReference:u._cesium.HeightReference.NONE,scaleByDistance:new u._cesium.NearFarScalar(0,0,1,1)};s.material,u._core.isnull(s)||u._core.isnull(s.fillColor)||/^\[/.test(s.fillColor)&&"["==s.fillColor.toString().charAt(0)&&"]"==s.fillColor.toString().charAt(s.fillColor.length-1)||(u._core.isHtmlColor(s.fillColor)?s.fillColor=u._color.colorFromHtmlColor(s.fillColor):(/^rgb/.test(s.fillColor)&&(s.fillColor=u._color.rgbaStringToRgbaObj(s.fillColor)),1<s.fillColor.r&&(s.fillColor.r=s.fillColor.r/255),1<s.fillColor.g&&(s.fillColor.g=s.fillColor.g/255),1<s.fillColor.b&&(s.fillColor.b=s.fillColor.b/255),1<s.fillColor.a&&(s.fillColor.a=s.fillColor.a/255),s.fillColor=u._color.createColor(s.fillColor.r,s.fillColor.g,s.fillColor.b,s.fillColor.a))),u._core.isnull(s)||u._core.isnull(s.material)||/^\[/.test(s.material)&&"["==s.material.toString().charAt(0)&&"]"==s.material.toString().charAt(s.material.length-1)||(u._core.isHtmlColor(s.material)?s.material=u._color.colorFromHtmlColor(s.material):(/^rgb/.test(s.material)&&(s.material=u._color.rgbaStringToRgbaObj(s.material)),1<s.material.r&&(s.material.r=s.fillColor.r/255),1<s.material.g&&(s.material.g=s.fillColor.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=u._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a))),u._core.isnull(s)||u._core.isnull(s.outlineColor)||/^\[/.test(s.outlineColor)&&"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(u._core.isHtmlColor(s.outlineColor)?s.outlineColor=u._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=u._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=u._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a))),u._core.isnull(s)||u._core.isnull(s.backgroundColor)||/^\[/.test(s.backgroundColor)&&"["==s.backgroundColor.toString().charAt(0)&&"]"==s.backgroundColor.toString().charAt(s.backgroundColor.length-1)||(u._core.isHtmlColor(s.backgroundColor)?s.backgroundColor=u._color.colorFromHtmlColor(s.backgroundColor):(/^rgb/.test(s.backgroundColor)&&(s.backgroundColor=u._color.rgbaStringToRgbaObj(s.backgroundColor)),1<s.backgroundColor.r&&(s.backgroundColor.r=s.backgroundColor.r/255),1<s.backgroundColor.g&&(s.backgroundColor.g=s.backgroundColor.g/255),1<s.backgroundColor.b&&(s.backgroundColor.b=s.backgroundColor.b/255),1<s.backgroundColor.a&&(s.backgroundColor.a=s.backgroundColor.a/255),s.backgroundColor=u._color.createColor(s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.backgroundColor.a)));var i=u._core.extend(t,s,!0),o=(u.item=e).entities.values;u._core.isnull(s.near)&&(s.near=0),u._core.isnull(s.far)&&(s.far=999999999);t=parseFloat(s.near),e=parseFloat(s.far),e=new u._cesium.DistanceDisplayCondition(t,e);i.distanceDisplayCondition=e,u._core.isnull(s.font_size)&&(s.font_size="30px"),u._core.isnull(s.font_family)&&(s.font_family=" sans-serif"),i.font=parseFloat(s.font_size)+"px "+s.font_family;for(var r=new u._cesium.LabelCollection,n=0;n<o.length;n++){var a=o[n];i.position=a.position._value,i.text="a label";a="fillColor:"+255*i.fillColor.red+","+255*i.fillColor.green+","+255*i.fillColor.blue+";outlineColor:"+255*i.outlineColor.red+","+255*i.outlineColor.green+","+255*i.outlineColor.blue;u.Legend.push(a),r.add(i)}e=u._viewer.scene.primitives.add(r);"function"==typeof l&&l(e)});o=this._core.getuid(),t={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t,style:options,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:!0,disFnc:l}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Ve.prototype.createLabelPolymerizationGeoJsonFeatureLayer=function(e,t,c,i,h,m){var o={Name:"",text:"",font:" 30px sans-serif",style:this._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,pointHeight:0},d=this;this._core.isnull(c)||this._core.isnull(c.fillColor)||(this._core.isHtmlColor(c.fillColor)?c.fillColor=this._color.colorFromHtmlColor(c.fillColor):(/^rgb/.test(c.fillColor)&&(c.fillColor=this._color.rgbaStringToRgbaObj(c.fillColor)),1<c.fillColor.r&&(c.fillColor.r=c.fillColor.r/255),1<c.fillColor.g&&(c.fillColor.g=c.fillColor.g/255),1<c.fillColor.b&&(c.fillColor.b=c.fillColor.b/255),1<c.fillColor.a&&(c.fillColor.a=c.fillColor.a/255),c.fillColor=this._color.createColor(c.fillColor.r,c.fillColor.g,c.fillColor.b,c.fillColor.a))),this._core.isnull(c)||this._core.isnull(c.outlineColor)||(this._core.isHtmlColor(c.outlineColor)?c.outlineColor=this._color.colorFromHtmlColor(c.outlineColor):(/^rgb/.test(c.outlineColor)&&(c.outlineColor=this._color.rgbaStringToRgbaObj(c.outlineColor)),1<c.outlineColor.r&&(c.outlineColor.r=c.outlineColor.r/255),1<c.outlineColor.g&&(c.outlineColor.g=c.outlineColor.g/255),1<c.outlineColor.b&&(c.outlineColor.b=c.outlineColor.b/255),1<c.outlineColor.a&&(c.outlineColor.a=c.outlineColor.a/255),c.outlineColor=this._color.createColor(c.outlineColor.r,c.outlineColor.g,c.outlineColor.b,c.outlineColor.a))),this._core.isnull(c)||this._core.isnull(c.backgroundColor)||(this._core.isHtmlColor(c.backgroundColor)?c.backgroundColor=this._color.colorFromHtmlColor(c.backgroundColor):(/^rgb/.test(c.backgroundColor)&&(c.backgroundColor=this._color.rgbaStringToRgbaObj(c.backgroundColor)),1<c.backgroundColor.r&&(c.backgroundColor.r=c.backgroundColor.r/255),1<c.backgroundColor.g&&(c.backgroundColor.g=c.backgroundColor.g/255),1<c.backgroundColor.b&&(c.backgroundColor.b=c.backgroundColor.b/255),1<c.backgroundColor.a&&(c.backgroundColor.a=c.backgroundColor.a/255),c.backgroundColor=this._color.createColor(c.backgroundColor.r,c.backgroundColor.g,c.backgroundColor.b,c.backgroundColor.a))),d._core.isnull(c.near)&&(c.near=0),d._core.isnull(c.far)&&(c.far=999999999);var p=this._core.extend(o,c,!0);this._viewer.scene.camera,this._viewer.scene.canvas;o=this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t)),d=this;o.then(function(t){var e=(d.item=t).entities.values;d._core.isnull(p.font_size)&&(p.font_size="30"),d._core.isnull(p.font_family)&&(p.font_family=" sans-serif"),p.font=p.font_size+"px "+p.font_family;for(var i,o=0;o<e.length;o++){var r=e[o];p.font=d._core.extendgl(r,c.font,p.font),p.style=parseInt(d._core.extendgl(r,p.stylet,p.style)),p.fillColor=d._core.extendgl(r,c.fillColor,p.fillColor),p.outlineColor=d._core.extendgl(r,c.outlineColor,p.outlineColor),p.outlineWidth=parseFloat(d._core.extendgl(r,c.outlineWidth,p.outlineWidth)),p.show=d._core.extendgl(r,c.show,p.show),p.showBackground=d._core.extendgl(r,c.showBackground,p.showBackground),p.backgroundColor=d._core.extendgl(r,c.backgroundColor,p.backgroundColor),p.backgroundPadding=d._core.extendgl(r,c.backgroundPadding,p.backgroundPadding),p.scale=parseFloat(d._core.extendgl(r,c.scale,p.scale)),p.horizontalOrigin=d._core.extendgl(r,c.horizontalOrigin,p.horizontalOrigin),p.pointHeight=parseFloat(d._core.extendgl(r,c.pointHeight,p.pointHeight)),p.text=d._core.extendgl(r,c.text,p.text);var n=parseFloat(d._core.extendgl(r,p.near)),a=parseFloat(d._core.extendgl(r,p.far)),s=new d._cesium.DistanceDisplayCondition(n,a);p.distanceDisplayCondition=s,p.text=null==r.properties[p.text]?p.text:r.properties[p.text]._value,r.billboard.color=d._cesium.Color.WHITE.withAlpha(0),r.label=new d._cesium.LabelGraphics(p),d._viewer.scene.globe.ellipsoid;n=d._cesium.Cartographic.fromCartesian(r.position._value),a=d._cesium.Math.toDegrees(n.longitude),s=d._cesium.Math.toDegrees(n.latitude),n=p.pointHeight||n.height,n=new d._cesium.Cartesian3.fromDegrees(a,s,n);r.position._value=n}t.clustering.enabled=!0,t.clustering.pixelRange=45,t.clustering.minimumClusterSize=3;var l=new d._cesium.PinBuilder;l.fromText("50+",d._cesium.Color.RED,48).toDataURL(),l.fromText("40+",d._cesium.Color.ORANGE,48).toDataURL(),l.fromText("30+",d._cesium.Color.YELLOW,48).toDataURL(),l.fromText("20+",d._cesium.Color.GREEN,48).toDataURL(),l.fromText("10+",d._cesium.Color.BLUE,48).toDataURL();for(var u=new Array(8),o=0;o<u.length;++o)u[o]=l.fromText(""+(o+2),d._cesium.Color.VIOLET,48).toDataURL();!function(){i=d._cesium.defined(i)?void i():t.clustering.clusterEvent.addEventListener(function(e,t){t.label.show=!1,t.point.show=!1,t.billboard.show=!0,t.billboard.id=t.label.id,t.billboard.verticalOrigin=d._cesium.VerticalOrigin.BOTTOM,50<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.RED,48).toDataURL():40<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.ORANGE,48).toDataURL():30<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.YELLOW,48).toDataURL():20<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.GREEN,48).toDataURL():10<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.BLUE,48).toDataURL():t.billboard.image=u[e.length-2]});var e=t.clustering.pixelRange;t.clustering.pixelRange=0,t.clustering.pixelRange=e,h||d.setVisibility(h)}(),d._cesium.knockout.track({pixelRange:45,minimumClusterSize:3}),"function"==typeof m&&m(ps)});o=this._core.getuid(),t={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:h,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t,treeData:{name:e,geoOptions:t,styleOption:c,GroupID:i,checked:h,disFnc:m}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Ve.prototype.createPointPolymerizationGeoJsonFeatureLayer=function(e,t,c,i,h,m){var o={color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};this._core.isnull(c)||this._core.isnull(c.color)||"["==c.color.toString().charAt(0)&&"]"==c.color.toString().charAt(c.color.length-1)||(this._core.isHtmlColor(c.color)?c.color=this._color.colorFromHtmlColor(c.color):(/^rgb/.test(c.color)&&(c.color=this._color.rgbaStringToRgbaObj(c.color)),1<c.color.r&&(c.color.r=c.color.r/255),1<c.color.g&&(c.color.g=c.color.g/255),1<c.color.b&&(c.color.b=c.color.b/255),1<c.color.a&&(c.color.a=c.color.a/255),c.color=this._color.createColor(c.color.r,c.color.g,c.color.b,c.color.a))),this._core.isnull(c)||this._core.isnull(c.outlineColor)||"["==c.outlineColor.toString().charAt(0)&&"]"==c.outlineColor.toString().charAt(c.outlineColor.length-1)||(this._core.isHtmlColor(c.outlineColor)?c.outlineColor=this._color.colorFromHtmlColor(c.outlineColor):(/^rgb/.test(c.outlineColor)&&(c.outlineColor=this._color.rgbaStringToRgbaObj(c.outlineColor)),1<c.outlineColor.r&&(c.outlineColor.r=c.outlineColor.r/255),1<c.outlineColor.g&&(c.outlineColor.g=c.outlineColor.g/255),1<c.outlineColor.b&&(c.outlineColor.b=c.outlineColor.b/255),1<c.outlineColor.a&&(c.outlineColor.a=c.outlineColor.a/255),c.outlineColor=this._color.createColor(c.outlineColor.r,c.outlineColor.g,c.outlineColor.b,c.outlineColor.a)));var d=this._core.extend(o,c,!0);this._viewer.scene.camera,this._viewer.scene.canvas;var p,o=this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t)),g=this;c&&c.time&&(p=new g._cesium.TimeIntervalCollection([new g._cesium.TimeInterval({start:c.time.start?g._cesium.JulianDate.fromDate(new Date(c.time.start)):g._cesium.Iso8601.MINIMUM_VALUE,stop:c.time.end?g._cesium.JulianDate.fromDate(new Date(c.time.end)):g._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(t){for(var i,e=(g.item=t).entities.values,o=0;o<e.length;o++){var r=e[o];d.color=g._core.extendgl(r,c.color,d.color),d.pixelSize=parseInt(g._core.extendgl(r,c.pixelSize,d.pixelSize)),d.outlineColor=g._core.extendgl(r,c.outlineColor,d.outlineColor),d.outlineWidth=parseFloat(g._core.extendgl(r,c.outlineWidth,d.outlineWidth)),d.show=g._core.extendgl(r,c.show,d.show),d.height=parseFloat(g._core.extendgl(r,c.height,d.height)),d.scaleByDistance=g._core.extendgl(r,c.scaleByDistance,d.scaleByDistance);var n=parseFloat(g._core.extendgl(r,d.minDistanceDisplay)),a=parseFloat(g._core.extendgl(r,d.maxDistanceDisplay)),s=new g._cesium.DistanceDisplayCondition(n,a);r.billboard.image="",d.distanceDisplayCondition=s,r.point=new g._cesium.PointGraphics(d),d.pointHeight=g._core.extendgl(r,c.pointHeight,d.pointHeight),d.pointHeight=parseFloat(d.pointHeight),g._viewer.scene.globe.ellipsoid;n=g._cesium.Cartographic.fromCartesian(r.position._value),a=g._cesium.Math.toDegrees(n.longitude),s=g._cesium.Math.toDegrees(n.latitude),n=d.pointHeight||n.height,n=new g._cesium.Cartesian3.fromDegrees(a,s,n);r.position._value=n,p&&(r.availability=p)}t.clustering.enabled=!0,t.clustering.pixelRange=45,t.clustering.minimumClusterSize=3;var l=new g._cesium.PinBuilder;l.fromText("50+",g._cesium.Color.RED,48).toDataURL(),l.fromText("40+",g._cesium.Color.ORANGE,48).toDataURL(),l.fromText("30+",g._cesium.Color.YELLOW,48).toDataURL(),l.fromText("20+",g._cesium.Color.GREEN,48).toDataURL(),l.fromText("10+",g._cesium.Color.BLUE,48).toDataURL();for(var u=new Array(8),o=0;o<u.length;++o)u[o]=l.fromText(""+(o+2),g._cesium.Color.VIOLET,48).toDataURL();!function(){i=g._cesium.defined(i)?void i():t.clustering.clusterEvent.addEventListener(function(e,t){t.label.show=!1,t.point.show=!1,t.billboard.show=!0,t.billboard.id=t.label.id,t.billboard.verticalOrigin=g._cesium.VerticalOrigin.BOTTOM,50<=e.length?t.billboard.image=l.fromText(e.length,g._cesium.Color.RED,48).toDataURL():40<=e.length?t.billboard.image=l.fromText(e.length,g._cesium.Color.ORANGE,48).toDataURL():30<=e.length?t.billboard.image=l.fromText(e.length,g._cesium.Color.YELLOW,48).toDataURL():20<=e.length?t.billboard.image=l.fromText(e.length,g._cesium.Color.GREEN,48).toDataURL():10<=e.length?t.billboard.image=l.fromText(e.length,g._cesium.Color.BLUE,48).toDataURL():t.billboard.image=u[e.length-2]});var e=t.clustering.pixelRange;t.clustering.pixelRange=0,t.clustering.pixelRange=e,h||g.setVisibility(h)}(),g._cesium.knockout.track({pixelRange:45,minimumClusterSize:3}),"function"==typeof m&&m(ps)});o=this._core.getuid(),t={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:h,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t,treeData:{name:e,geoOptions:t,styleOption:c,GroupID:i,checked:h,disFnc:m}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Ve.prototype._cameraMoveEndHandler=function(){if(this._viewer.camera.getMagnitude()<this.gd){if(this.sj){this._viewer.scene.primitives.remove(this.labelCollections),this.labelCollections=new this._cesium.LabelCollection;for(var e=0;e<this.labelCollections1.length;e++)this.labelCollections.add(this.labelCollections1[e]);this._viewer.scene.primitives.add(this.labelCollections),this.sj=!1}}else{this._viewer.scene.primitives.remove(this.labelCollections),new this._cesium.BillboardCollection;for(e=0;e<this.labelCollections2.length;e++)this.BillboardCollections.add(this.labelCollections2[e]);this._viewer.scene.primitives.add(this.BillboardCollections),this.sj=!0}},Ve.prototype.createLabelpolymerizationGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=t;this._viewer.scene.primitives,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this.gd=i.height,new this._cesium.BillboardCollection;for(var s={},l=[],u=0;u<a.length;u++){var c={position:new this._cesium.Cartesian3.fromDegrees(a[u].lng,a[u].lat,100),text:a[u].name};this.labelCollections1.push(c);var h=a[u];if(s[h[i.adminname]])for(var m=0;m<l.length;m++){var d=l[m];if(d.adminname==h[i.adminname]){d.data.push(h);break}}else l.push({adminname:h[i.adminname],name:h.name,showBackground:!0,lat:h.lat,lng:h.lng,data:[h]}),s[h[i.adminname]]=h}for(var p,u=0;u<l.length;u++){c={position:new this._cesium.Cartesian3.fromDegrees(l[u].lng,l[u].lat,100),image:pinBuilder.fromText(l[u].data.length+"",this._cesium.Color.BLACK,48).toDataURL()};this.labelCollections2.push(c),this.BillboardCollections.add(c)}i&&i.time&&(p=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:i.time.start?this._cesium.JulianDate.fromDate(new Date(i.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:i.time.end?this._cesium.JulianDate.fromDate(new Date(i.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this._viewer.scene.primitives.add(this.BillboardCollections,p)},Ve.prototype.createLabelpolymerizationGeoJsonFeatureLayers=function(e,t,o,i,r,n){var a={height:0,material:this._cesium.Color.WHITE,size:50,fill:this._cesium.Color.RED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(o)||this._core.isnull(o.material)||"["==o.material.toString().charAt(0)&&"]"==o.material.toString().charAt(o.material.length-1)||(this._core.isHtmlColor(o.material)?o.material=this._color.colorFromHtmlColor(o.material):/^http/.test(o.material)||(/^rgb/.test(o.material)&&(o.material=this._color.rgbaStringToRgbaObj(o.material)),1<o.material.r&&(o.material.r=o.material.r/255),1<o.material.g&&(o.material.g=o.material.g/255),1<o.material.b&&(o.material.b=o.material.b/255),1<o.material.a&&(o.material.a=o.material.a/255),o.material=this._color.createColor(o.material.r,o.material.g,o.material.b,o.material.a))),this._core.isnull(o)||this._core.isnull(o.fill)||"["==o.fill.toString().charAt(0)&&"]"==o.fill.toString().charAt(o.fill.length-1)||(this._core.isHtmlColor(o.fill)?o.fill=this._color.colorFromHtmlColor(o.fill):/^http/.test(o.fill)||(/^rgb/.test(o.fill)&&(o.fill=this._color.rgbaStringToRgbaObj(o.fill)),1<o.fill.r&&(o.fill.r=o.fill.r/255),1<o.fill.g&&(o.fill.g=o.fill.g/255),1<o.fill.b&&(o.fill.b=o.fill.b/255),1<o.fill.a&&(o.fill.a=o.fill.a/255),o.fill=this._color.createColor(o.fill.r,o.fill.g,o.fill.b,o.fill.a)));var l=this._core.extend(a,o,!0),u=this;this._urlTemplate=t.url+"?"+this._core._serialize(s.urlParams);var c=t.url+"?"+this._core._serialize(s.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider._minimumHeight=parseFloat(l.height)||0,this._Provider.loadTile=function(t,i){if(i.state===Cesium.QuadtreeTileLoadState.START){if(i.data={lines:[],geometryPrimitive:void 0},!(i.level>=o.level_min&&i.level<o.level_max&&u.item.show))return i.state=Cesium.QuadtreeTileLoadState.DONE,void(i.renderable=!0);var e=c.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level);u._cache&&(e+="&"+u._core.getuid()),u._core.xhr({url:e,type:"get",dataType:"json",success:function(e){""==cluster?u.labelCollections=new u._cesium.PointPrimitiveCollection:u.labelCollections=new u._cesium.BillboardCollection;var o=new u._cesium.PinBuilder;if(null==e)return i.state=Cesium.QuadtreeTileLoadState.DONE,void(i.renderable=!0);e.features.forEach(function(e){var t=(l.id=e).geometry.coordinates[2]||0;null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(l.height)&&/\]$/.test(l.height)?(i=l.height.replace(/\[/,"").replace(/\]/,""),t+=parseFloat(e.properties[i])):t+=parseFloat(l.height)||0;var i={},t=new u._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),i=""==cluster?{id:e,color:l.material,position:t}:{position:t,image:o.fromText(e.count+"",l.fill,l.size).toDataURL(),verticalOrigin:u._cesium.VerticalOrigin.BOTTOM};u.labelCollections.add(i)}),0==e.features.length&&(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0),i.data.geometryPrimitive=u.labelCollections,i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state===Cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive.update(t,[]),i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0)},error:function(){null==i.count&&(i.count=0),i.count+=1,2<=i.count?(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0):i.state=Cesium.QuadtreeTileLoadState.START}}),i.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});a=this._viewer.scene,s=a.primitives;o&&o.time&&(this._Provider._availability=new u._cesium.TimeIntervalCollection([new u._cesium.TimeInterval({start:o.time.start?u._cesium.JulianDate.fromDate(new Date(o.time.start)):u._cesium.Iso8601.MINIMUM_VALUE,stop:o.time.end?u._cesium.JulianDate.fromDate(new Date(o.time.end)):u._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),s.add(this._primitive),a.primitivesQuadTrees&&a.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;r={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o,treeData:{name:e,geoOptions:t,styleOption:o,GroupID:i,checked:r,disFnc:n}};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},Ve.prototype.createLabelGeoJsonFeatureLayerProvider=function(e,t,s,i,o,r){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},l=this;s.material,l._core.isnull(s)||l._core.isnull(s.fillColor)||/^\[/.test(s.fillColor)&&"["==s.fillColor.toString().charAt(0)&&"]"==s.fillColor.toString().charAt(s.fillColor.length-1)||(l._core.isHtmlColor(s.fillColor)?s.fillColor=l._color.colorFromHtmlColor(s.fillColor):(/^rgb/.test(s.fillColor)&&(s.fillColor=l._color.rgbaStringToRgbaObj(s.fillColor)),1<s.fillColor.r&&(s.fillColor.r=s.fillColor.r/255),1<s.fillColor.g&&(s.fillColor.g=s.fillColor.g/255),1<s.fillColor.b&&(s.fillColor.b=s.fillColor.b/255),1<s.fillColor.a&&(s.fillColor.a=s.fillColor.a/255),s.fillColor=l._color.createColor(s.fillColor.r,s.fillColor.g,s.fillColor.b,s.fillColor.a))),l._core.isnull(s)||l._core.isnull(s.material)||/^\[/.test(s.material)&&"["==s.material.toString().charAt(0)&&"]"==s.material.toString().charAt(s.material.length-1)||(l._core.isHtmlColor(s.material)?s.material=l._color.colorFromHtmlColor(s.material):(/^rgb/.test(s.material)&&(s.material=l._color.rgbaStringToRgbaObj(s.material)),1<s.material.r&&(s.material.r=s.material.r/255),1<s.material.g&&(s.material.g=s.material.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=l._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a))),l._core.isnull(s)||l._core.isnull(s.outlineColor)||/^\[/.test(s.outlineColor)&&"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(l._core.isHtmlColor(s.outlineColor)?s.outlineColor=l._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=l._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=l._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a))),l._core.isnull(s)||l._core.isnull(s.backgroundColor)||/^\[/.test(s.backgroundColor)&&"["==s.backgroundColor.toString().charAt(0)&&"]"==s.backgroundColor.toString().charAt(s.backgroundColor.length-1)||(l._core.isHtmlColor(s.backgroundColor)?s.backgroundColor=l._color.colorFromHtmlColor(s.backgroundColor):(/^rgb/.test(s.backgroundColor)&&(s.backgroundColor=l._color.rgbaStringToRgbaObj(s.backgroundColor)),1<s.backgroundColor.r&&(s.backgroundColor.r=s.backgroundColor.r/255),1<s.backgroundColor.g&&(s.backgroundColor.g=s.backgroundColor.g/255),1<s.backgroundColor.b&&(s.backgroundColor.b=s.backgroundColor.b/255),1<s.backgroundColor.a&&(s.backgroundColor.a=s.backgroundColor.a/255),s.backgroundColor=l._color.createColor(s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.backgroundColor.a))),this._urlTemplate=t.url+"?"+this._core._serialize(n.urlParams);var u=t.url+"?"+this._core._serialize(n.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=s.level_max-1,this._Provider._minimumHeight=parseFloat(s.height)||0,this._Provider.loadTile=function(o,a){if(a.state===Cesium.QuadtreeTileLoadState.START){if(a.data={lines:[],geometryPrimitive:void 0},!(a.level>=s.level_min&&a.level<s.level_max&&l.item.show))return a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0);var e=u.replace(window.encodeURIComponent("{x}"),a.x).replace(window.encodeURIComponent("{y}"),a.y).replace(window.encodeURIComponent("{z}"),a.level);l._cache&&(e+="&"+l._core.getuid()),l._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0);var t={Name:"",text:"",font:" 30px sans-serif",style:l._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:l._cesium.Color.WHITE,outlineColor:l._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new l._cesium.Color(.165,.165,.165,.8),backgroundPadding:new l._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:l._cesium.HorizontalOrigin.CENTER,verticalOrigin:l._cesium.VerticalOrigin.CENTER,eyeOffset:l._cesium.Cartesian3.ZERO,pixelOffset:l._cesium.Cartesian2.ZERO,heightReference:l._cesium.HeightReference.NONE,scaleByDistance:new l._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},r=l._core.extend(t,s,!0);l._core.isnull(s.near)&&(s.near=0),l._core.isnull(s.far)&&(s.far=999999999);var n,i=parseFloat(s.near),t=parseFloat(s.far),t=new l._cesium.DistanceDisplayCondition(i,t);r.distanceDisplayCondition=t,l._core.isnull(s.font_size)&&(s.font_size="30px"),l._core.isnull(s.font_family)&&(s.font_family=" sans-serif"),r.font=parseFloat(s.font_size)+"px "+s.font_family,n=new(null!=r.image&&null!=r.image?l._cesium.BillboardCollection:l._cesium.LabelCollection),e.features.forEach(function(e){r.id=e;var t=r.pointHeight;/^\[/.test(t)&&/\]$/.test(t)?(o=t.replace(/\[/,"").replace(/\]/,""),t=parseFloat(e.properties[o])):null!=t&&""!=t?t=parseFloat(t):null!=e.properties.height&&(t=parseFloat(e.properties.height)),r.position=new l._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),/^\[/.test(s.fillColor)&&/\]$/.test(s.fillColor)&&(i=s.fillColor.replace(/\[/,"").replace(/\]/,""),r.fillColor=e.properties[i],l._core.isHtmlColor(r.fillColor)?r.fillColor=l._color.colorFromHtmlColor(r.fillColor):(/^rgb/.test(r.fillColor)&&(r.fillColor=l._color.rgbaStringToRgbaObj(r.fillColor)),1<r.fillColor.r&&(r.fillColor.r=r.fillColor.r/255),1<r.fillColor.g&&(r.fillColor.g=r.fillColor.g/255),1<r.fillColor.b&&(r.fillColor.b=r.fillColor.b/255),1<r.fillColor.a&&(r.fillColor.a=r.fillColor.a/255),r.fillColor=l._color.createColor(r.fillColor.r,r.fillColor.g,r.fillColor.b,r.fillColor.a))),/^\[/.test(s.outlineColor)&&/\]$/.test(s.outlineColor)&&(i=s.outlineColor.replace(/\[/,"").replace(/\]/,""),r.outlineColor=e.properties[i],l._core.isHtmlColor(r.outlineColor)?r.outlineColor=l._color.colorFromHtmlColor(r.outlineColor):(/^rgb/.test(r.outlineColor)&&(r.outlineColor=l._color.rgbaStringToRgbaObj(r.outlineColor)),1<r.outlineColor.r&&(r.outlineColor.r=r.outlineColor.r/255),1<r.outlineColor.g&&(r.outlineColor.g=r.outlineColor.g/255),1<r.outlineColor.b&&(r.outlineColor.b=r.outlineColor.b/255),1<r.outlineColor.a&&(r.outlineColor.a=r.outlineColor.a/255),r.outlineColor=l._color.createColor(r.outlineColor.r,r.outlineColor.g,r.outlineColor.b,r.outlineColor.a)));var i,o="fillColor:"+255*r.fillColor.red+","+255*r.fillColor.green+","+255*r.fillColor.blue+";outlineColor:"+255*r.outlineColor.red+","+255*r.outlineColor.green+","+255*r.outlineColor.blue;l.Legend.push(o),/^\[/.test(s.text)&&/\]$/.test(s.text)&&(i=s.text.replace(/\[/,"").replace(/\]/,""),r.text=e.properties[i]),r.id.treeID=s.id,r.id.VectorType="label",r.id.VectorStyle={position:r.position,pointHeight:t,text:r.text,font:r.font,scale:r.scale,style:r.style,fillColor:r.fillColor,outlineColor:r.outlineColor,outlineWidth:r.outlineWidth,showBackground:r.showBackground,backgroundColor:r.backgroundColor,heightReference:r.heightReference,horizontalOrigin:r.horizontalOrigin,verticalOrigin:r.verticalOrigin,scaleByDistance:r.scaleByDistance,distanceDisplayCondition:r.distanceDisplayCondition},n.add(r)}),0==e.features.length&&(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0),a.data.geometryPrimitive=n,a.state=Cesium.QuadtreeTileLoadState.LOADING,a.state===Cesium.QuadtreeTileLoadState.LOADING&&(a.data.geometryPrimitive.update(o,[]),a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0)},error:function(){null==a.count&&(a.count=0),a.count+=1,2<=a.count?(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0):a.state=Cesium.QuadtreeTileLoadState.START}}),a.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var a=this._viewer.scene,n=a.primitives;s&&s.time&&(this._Provider._availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:s.time.start?l._cesium.JulianDate.fromDate(new Date(s.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?l._cesium.JulianDate.fromDate(new Date(s.time.end)):l._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),n.add(this._primitive),a.primitivesQuadTrees&&a.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:s,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:o,disFnc:r}};return this._Provider.treeID=s.id,this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ve.prototype.createLabelImageGeoJsonFeatureLayerProvider=function(e,r,c,t,i,o){var n={url:r.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:r.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(r.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(r.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:r.upperLevelLimit,lowerLevelLimit:r.lowerLevelLimit,Cesium:this._cesium},h=this;c.material,h._core.isnull(c)||h._core.isnull(c.fillColor)||"string"!=typeof c.fillColor||/^\[/.test(c.fillColor)&&/\]$/.test(c.fillColor)||(h._core.isHtmlColor(c.fillColor)||/^rgb/.test(c.fillColor))&&(c.fillColor=Cesium.Color.fromCssColorString(c.fillColor)),h._core.isnull(c)||h._core.isnull(c.outlineColor)||"string"!=typeof c.outlineColor||/^\[/.test(c.outlineColor)&&/\]$/.test(c.outlineColor)||(h._core.isHtmlColor(c.outlineColor)||/^rgb/.test(c.outlineColor))&&(c.outlineColor=Cesium.Color.fromCssColorString(c.outlineColor)),h._core.isnull(c)||h._core.isnull(c.color)||"string"!=typeof c.color||/^\[/.test(c.color)&&/\]$/.test(c.color)||(h._core.isHtmlColor(c.color)||/^rgb/.test(c.color))&&(c.color=Cesium.Color.fromCssColorString(c.color)),h._core.isnull(c)||h._core.isnull(c.backgroundColor)||"string"!=typeof c.backgroundColor||/^\[/.test(c.backgroundColor)&&/\]$/.test(c.backgroundColor)||(h._core.isHtmlColor(c.backgroundColor)||/^rgb/.test(c.backgroundColor))&&(c.backgroundColor=Cesium.Color.fromCssColorString(c.backgroundColor)),h._core.isnull(c.font)&&(h._core.isnull(c.font_size)&&(c.font_size="30px"),h._core.isnull(c.font_family)&&(c.font_family=" sans-serif"),c.font=c.font_size+" "+c.font_family,c.bold&&(c.font="bold "+c.font),c.italic&&(c.font="italic "+c.font)),h._core.isnull(c.near)&&(c.near=0),h._core.isnull(c.far)&&(c.far=999999999);var s=parseFloat(c.near),l=parseFloat(c.far),a=new h._cesium.DistanceDisplayCondition(s,l);c.distanceDisplayCondition=a,this._urlTemplate=r.url+"?"+this._core._serialize(n.urlParams);var u=r.url+"?"+this._core._serialize(n.urlParams);function m(e,t){let i;var o,r;return i="string"==typeof t.value?/^\[/.test(t.value)&&/\]$/.test(t.value)?(i=t.value.replace(/\[/,"").replace(/\]/,""),e.properties[i]):t.value:(r=(o=t.value).Condition,r=e.properties[r],o.Value[r]),i=i||t.defaultValue,h._core.isHtmlColor(i)&&(i=Cesium.Color.fromCssColorString(i)),i}function d(){return{name:"",text:"",font:" 30px sans-serif",style:h._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:h._cesium.Color.WHITE,outlineColor:h._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new h._cesium.Color(.165,.165,.165,.8),backgroundPadding:new h._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:h._cesium.HorizontalOrigin.CENTER,verticalOrigin:h._cesium.VerticalOrigin.CENTER,eyeOffset:h._cesium.Cartesian3.ZERO,pixelOffset:h._cesium.Cartesian2.ZERO,heightReference:h._cesium.HeightReference.NONE,scaleByDistance:new h._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0}}this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=c.level_max,this._Provider._minimumHeight=parseFloat(c.height)||0,h._core.xhr({url:r.url+"?service=WMTS&request=GetCapabilities",type:"get",isXml:!0,success:function(o){o=h._core.xml2json(o);let e=o.Contents&&o.Contents.Layer;o=e.filter(e=>e.Identifier===r.layer)[0];if(o){let e=o.TileMatrixSetLink,t=r.srs||"EPSG:4490",i=e.filter(e=>e.TileMatrixSet===t)[0];i&&(h.TileMatrixLimits={},i.TileMatrixSetLimits&&i.TileMatrixSetLimits.TileMatrixLimits.forEach(e=>{let t=e.TileMatrix;t=t.split(":");var i=t[t.length-1];h.TileMatrixLimits[i]={maxCol:e.MaxTileCol,minCol:e.MinTileCol,maxRow:e.MaxTileRow,minRow:e.MinTileRow}}))}h.initThisProvider()}}),this.initThisProvider=()=>{this.initThisProvider=void 0,this._Provider.loadTile=function(e,i){if(i.state===Cesium.QuadtreeTileLoadState.START){if(i.data={lines:[],geometryPrimitive:void 0},!(i.level>=c.level_min&&i.level<=c.level_max&&h.item.show))return i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0,void(h._Provider.EntityCollection.show=!1);if(h.TileMatrixLimits){var t=h.TileMatrixLimits[i.level];if(t&&(i.x>t.maxCol||i.x<t.minCol||i.y>t.maxRow||i.y<t.minRow))return i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0,void y()}if(h._Provider.EntityCollection.isShow&&(h._Provider.EntityCollection.show=!0),h._Provider.EntityCollection.childrenCollection[i.level+"-"+i.x+"-"+i.y]){let e=h._Provider.EntityCollection.childrenCollection[i.level+"-"+i.x+"-"+i.y];return e.setVisibility(!0),i.data.geometryPrimitive=e,i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0,void y()}t=u.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level);h._cache&&(t+="&"+h._core.getuid()),h._core.xhr({url:t,type:"get",dataType:"json",success:function(e){if(!e||!e.features||!e.features.length)return i.state=Cesium.QuadtreeTileLoadState.DONE,void(i.renderable=!0);var a,s,t=d(),l=h._core.extend(t,c,!0);l.image&&!l.text?s=!0:a=!(l.image||!l.text)||(!l.image||!l.text||(s=!0));let u=new _(h._viewer,h._Provider.EntityCollection,i);!async function(e){e.features.forEach(function(e,t){u.isDestroy||async function(e){l.id=e.id;var t=l.pointHeight;{var i;"string"==typeof t&&/^\[/.test(t)&&/\]$/.test(t)?(i=t.replace(/\[/,"").replace(/\]/,""),t=parseFloat(e.properties[i])):null!=t&&""!=t?t=parseFloat(t):null!=e.properties.height&&(t=parseFloat(e.properties.height))}l.position=new h._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),"object"==typeof c.font&&(l.font=m(e,c.font));"string"==typeof c.fillColor&&/^\[/.test(c.fillColor)&&/\]$/.test(c.fillColor)?(o=c.fillColor.replace(/\[/,"").replace(/\]/,""),l.fillColor=e.properties[o],(h._core.isHtmlColor(l.fillColor)||/^rgb/.test(l.fillColor))&&(l.fillColor=Cesium.Color.fromCssColorString(l.fillColor))):"object"==typeof c.fillColor&&c.fillColor.value&&(l.fillColor=m(e,c.fillColor));"string"==typeof c.outlineColor&&/^\[/.test(c.outlineColor)&&/\]$/.test(c.outlineColor)?(o=c.outlineColor.replace(/\[/,"").replace(/\]/,""),l.outlineColor=e.properties[o],(h._core.isHtmlColor(l.outlineColor)||/^rgb/.test(l.outlineColor))&&(l.outlineColor=Cesium.Color.fromCssColorString(l.outlineColor))):"object"==typeof c.outlineColor&&c.outlineColor.value&&(l.outlineColor=m(e,c.outlineColor));c.showBackground&&("string"==typeof c.backgroundColor&&/^\[/.test(c.backgroundColor)&&/\]$/.test(c.backgroundColor)?(o=c.backgroundColor.replace(/\[/,"").replace(/\]/,""),l.backgroundColor=e.properties[o],(h._core.isHtmlColor(l.backgroundColor)||/^rgb/.test(l.backgroundColor))&&(l.backgroundColor=Cesium.Color.fromCssColorString(l.backgroundColor))):"object"==typeof c.backgroundColor&&c.backgroundColor.value&&(l.backgroundColor=m(e,c.backgroundColor)));t="fillColor:"+255*l.fillColor.red+","+255*l.fillColor.green+","+255*l.fillColor.blue+";outlineColor:"+255*l.outlineColor.red+","+255*l.outlineColor.green+","+255*l.outlineColor.blue;h.Legend.push(t),"string"==typeof c.text&&/^\[/.test(c.text)&&/\]$/.test(c.text)?(o=c.text.replace(/\[/,"").replace(/\]/,""),l.text=e.properties[o]):"object"==typeof c.text&&(l.text=m(e,c.text));{var o;"string"==typeof c.image&&/^\[/.test(c.image)&&/\]$/.test(c.image)?(o=c.image.replace(/\[/,"").replace(/\]/,""),l.image=e.properties[o]):"object"==typeof c.image&&(l.image=m(e,c.image))}let r={position:l.position};if(a){let e=l;l.labelData&&(e=Object.assign({},l,l.labelData,!0)),(l.offsetX||l.offsetY)&&(e.pixelOffset=new Cesium.Cartesian2(l.offsetX||0,l.offsetY||0)),r.label=e}if(s){let e=l;l.imageData&&(e=Object.assign({},l,l.imageData,!0)),r.billboard=e}let n=new Cesium.Entity(r);n.feature=e,u.add(n)}(e)})}(e),i.data.geometryPrimitive=u,h._Provider.EntityCollection.childrenCollection[i.level+"-"+i.x+"-"+i.y]=u,i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state===Cesium.QuadtreeTileLoadState.LOADING&&(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0),y()},error:function(){i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0,y()}}),i.state=Cesium.QuadtreeTileLoadState.LOADING}y()}};let p,g;function _(e,t,i){this.viewer=e,this.collection=t,this.key=i.level+"-"+i.x+"-"+i.y,this.isDestroy=!1,this.values=[],this._time=void 0,this.show=!0}this.saveDefaultVectorData=()=>{g=h._core.extend({},c,!0)},this.restoreVector=()=>{if(g&&(c=g,h._Provider._normalTile=c.level_max,h._Provider&&h._Provider.EntityCollection)){var e=d();let r=h._core.extend(e,c,!0),n,a;r.image&&!r.text?a=!0:n=(!r.image&&r.text||r.image&&r.text&&(a=!0),!0),h._Provider.EntityCollection.values.forEach(t=>{var e=t.feature;void 0!==r.pointHeight&&(t.position=new Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],r.pointHeight));let i;"string"==typeof r.text&&/^\[/.test(r.text)&&/\]$/.test(r.text)?(i=r.text.replace(/\[/,"").replace(/\]/,""),i=e.properties[i]):"object"==typeof r.text&&(i=m(e,r.text));let o;if("string"==typeof r.image&&/^\[/.test(r.image)&&/\]$/.test(r.image)?(o=r.image.replace(/\[/,"").replace(/\]/,""),o=e.properties[o]):"object"==typeof r.image&&(o=m(e,r.image)),n){let e=Object.assign({},r);i&&(e.text=i),r.labelData&&(e=Object.assign(e,r.labelData)),(r.offsetX||r.offsetY)&&(e.pixelOffset=new Cesium.Cartesian2(r.offsetX||0,r.offsetY||0)),t.label=e}else t.label=void 0;if(a){let e=Object.assign({},r);o&&(e.image=o),r.imageData&&(e=Object.assign(e,r.imageData)),t.billboard=e}else t.billboard=void 0})}g=void 0},this.updataVector=(a={})=>{var e;(a.color||a.fillColor||a.outlineColor||a.backgroundColor)&&(a.color&&(a.color=Cesium.Color.fromCssColorString(a.color)),a.fillColor&&(a.fillColor=Cesium.Color.fromCssColorString(a.fillColor)),a.outlineColor&&(a.outlineColor=Cesium.Color.fromCssColorString(a.outlineColor)),a.backgroundColor&&(a.backgroundColor=Cesium.Color.fromCssColorString(a.backgroundColor))),void 0===a.near&&void 0===a.far||(void 0!==a.near&&(s=parseFloat(a.near)),void 0!==a.far&&(l=parseFloat(a.far)),e=new Cesium.DistanceDisplayCondition(s,l),a.distanceDisplayCondition=e),void 0===a.minimumLevel&&void 0===a.maximumLevel||(void 0!==a.minimumLevel&&(a.level_min=a.minimumLevel),void 0!==a.maximumLevel&&(a.level_max=a.maximumLevel)),c=h._core.extend(c,a,!0),h._Provider._normalTile=c.level_max,c.font=c.font_size+" "+c.font_family,c.bold&&(c.font="bold "+c.font),c.italic&&(c.font="italic "+c.font),a.font=c.font,h._Provider&&h._Provider.EntityCollection&&(clearTimeout(p),p=setTimeout(()=>{let o,r,n;h._Provider.EntityCollection.values.forEach(e=>{o=e.label,r=e.billboard,n=e.feature,void 0!==a.height&&(e.position=new Cesium.Cartesian3.fromDegrees(n.geometry.coordinates[0],n.geometry.coordinates[1],a.height));let t;"string"==typeof a.text&&/^\[/.test(a.text)&&/\]$/.test(a.text)?(t=a.text.replace(/\[/,"").replace(/\]/,""),t=n.properties[t]):"object"==typeof a.text&&(t=m(n,a.text));let i;"string"==typeof a.image&&/^\[/.test(a.image)&&/\]$/.test(a.image)?(i=a.image.replace(/\[/,"").replace(/\]/,""),i=n.properties[i]):"object"==typeof a.image&&(i=m(n,a.image)),o?((a.offsetX||a.offsetY)&&(a.pixelOffset=new Cesium.Cartesian2(c.offsetX||0,c.offsetY||0)),Object.assign(o,a),t&&(o.text=t),void 0!==a.text&&(o.show=!!a.text)):a.text&&(e.label={...c},t&&(e.label.text=t)),void 0!==a.image&&(r?(r.image=a.image,r.show=!!a.image,i&&(r.image=i)):a.image&&(e.billboard={image:i||a.image,disableDepthTestDistance:c.disableDepthTestDistance,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(0,0)}))})},100))},this._Provider.EntityCollection=new Cesium.EntityCollection,this._Provider.EntityCollection.isShow=!0,this._Provider.EntityCollection.childrenCollection={},_.prototype.update=function(){clearTimeout(this._time),this.setVisibility(!0),this._time=setTimeout(()=>{this.setVisibility(!1)},500)},_.prototype.add=function(e){this.isDestroy||(this.viewer&&this.viewer.entities.add(e),this.collection&&this.collection.add(e),this.values.push(e.id))},_.prototype.setVisibility=function(i){this.show=i,this.values.forEach(e=>{let t=this.viewer.entities.getById(e);t&&(t.show=i)})},_.prototype.destroy=function(){this.isDestroy=!0,this.add=()=>{},this.update=()=>{},this.values.forEach(e=>{this.viewer&&this.viewer.entities.removeById(e),this.collection&&this.collection.removeById(e)}),delete this.collection.childrenCollection[this.key],this.collection=void 0,this.values=[],this.viewer=void 0,Cesium.destroyObject(this)};let f;function y(){h._Provider.EntityCollection.show&&(clearTimeout(f),f=setTimeout(function(){!function(){if(h._Provider.quadtree&&h._Provider.quadtree._tilesToRender&&h._Provider.quadtree._tilesToRender.length){let t=[];for(var e in h._Provider.quadtree._tilesToRender.forEach(e=>{t.push(e.level+"-"+e.x+"-"+e.y)}),h._Provider.EntityCollection.childrenCollection)t.indexOf(e)<0&&h._Provider.EntityCollection.childrenCollection[e].setVisibility(!1)}}()},500))}this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});a=this._viewer.scene,n=a.primitives;c&&c.time&&(this._Provider._availability=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:c.time.start?h._cesium.JulianDate.fromDate(new Date(c.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:c.time.end?h._cesium.JulianDate.fromDate(new Date(c.time.end)):h._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),n.add(this._primitive),a.primitivesQuadTrees&&a.primitivesQuadTrees.push(this._primitive),i||this.setVisibility(!1),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),this.west=r.minx,this.south=r.miny,this.east=r.maxx,this.north=r.maxy;i={id:c.id,name:e,checked:!0,pId:this._core.isnull(t)?0:t,type:"polygonLayer",item:this,url:r.url,style:c,treeData:{name:e,geoOptions:r,styleOption:c,GroupID:t,checked:i,disFnc:o}};return this._Provider.treeID=c.id,this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(t)?0:t),"function"==typeof o&&o(this.item),this},Ve.prototype.createLabelImageGeoJsonFeatureLayerProvider1=function(e,t,c,i,o,r){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},h=this;c.material;var a={Name:"",text:"",font:" 30px sans-serif",style:h._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:h._cesium.Color.WHITE,outlineColor:h._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new h._cesium.Color(.165,.165,.165,.8),backgroundPadding:new h._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:h._cesium.HorizontalOrigin.CENTER,verticalOrigin:h._cesium.VerticalOrigin.CENTER,eyeOffset:h._cesium.Cartesian3.ZERO,pixelOffset:h._cesium.Cartesian2.ZERO,heightReference:h._cesium.HeightReference.NONE,scaleByDistance:new h._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0};this._urlTemplate=t.url+"?"+this._core._serialize(n.urlParams);var s=t.url+"?"+this._core._serialize(n.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=21,this._Provider._minimumHeight=parseFloat(c.height)||0,this._Provider.loadTile=function(i,o){if(o.state===Cesium.QuadtreeTileLoadState.START){if(o.data={lines:[],geometryPrimitive:void 0},!(o.level>=c.level_min&&o.level<c.level_max&&h.item.show))return o.state=Cesium.QuadtreeTileLoadState.DONE,void(o.renderable=!0);var e=s.replace(window.encodeURIComponent("{x}"),o.x).replace(window.encodeURIComponent("{y}"),o.y).replace(window.encodeURIComponent("{z}"),o.level);h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return o.state=Cesium.QuadtreeTileLoadState.DONE,void(o.renderable=!0);var s,l,t,u=h._core.extend(a,c,!0);u.font=c.font,u.image&&!u.text?l=new h._cesium.BillboardCollection({scene:h._viewer.scene}):(u.image||!u.text)&&u.image&&u.text?(s=new h._cesium.LabelCollection({scene:h._viewer.scene}),l=new h._cesium.BillboardCollection({scene:h._viewer.scene}),(t=new h._cesium.PrimitiveCollection).add(s),t.add(l)):s=new h._cesium.LabelCollection({scene:h._viewer.scene}),e.features.forEach(function(e){u.id=e;var t,i=u.pointHeight;if(/^\[/.test(i)&&/\]$/.test(i)?(t=i.replace(/\[/,"").replace(/\]/,""),i=parseFloat(e.properties[t])):null!=i&&""!=i?i=parseFloat(i):null!=e.properties.height&&(i=parseFloat(e.properties.height)),u.position=new h._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i),c.fillColor)/^\[/.test(c.fillColor)&&/\]$/.test(c.fillColor)&&(a=c.fillColor.replace(/\[/,"").replace(/\]/,""),u.fillColor=e.properties[a]),h._core.isHtmlColor(u.fillColor)?u.fillColor=h._color.colorFromHtmlColor(u.fillColor):(/^rgb/.test(u.fillColor)&&(u.fillColor=h._color.rgbaStringToRgbaObj(u.fillColor)),1<u.fillColor.r&&(u.fillColor.r=u.fillColor.r/255),1<u.fillColor.g&&(u.fillColor.g=u.fillColor.g/255),1<u.fillColor.b&&(u.fillColor.b=u.fillColor.b/255),1<u.fillColor.a&&(u.fillColor.a=u.fillColor.a/255),u.fillColor=h._color.createColor(u.fillColor.r,u.fillColor.g,u.fillColor.b,u.fillColor.a));else if(c.fillColor&&c.fillColor.Class instanceof Array){for(var o=0;o<c.fillColor.Class.length;o++)if((n=(r=c.fillColor.Class[o]).Condition.replace("<","").replace(">","").split("="))[0]=n[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),n[1]=n[1].replace(/\"/,"").replace(/\"/,""),e.properties[n[0]]==n[1]){u.fillColor=r.Value,h._core.isHtmlColor(u.fillColor)?u.fillColor=h._color.colorFromHtmlColor(u.fillColor):(/^rgb/.test(u.fillColor)&&(u.fillColor=h._color.rgbaStringToRgbaObj(u.fillColor)),1<u.fillColor.r&&(u.fillColor.r=u.fillColor.r/255),1<u.fillColor.g&&(u.fillColor.g=u.fillColor.g/255),1<u.fillColor.b&&(u.fillColor.b=u.fillColor.b/255),1<u.fillColor.a&&(u.fillColor.a=u.fillColor.a/255),u.fillColor=h._color.createColor(u.fillColor.r,u.fillColor.g,u.fillColor.b,u.fillColor.a));break}}else(c.fillColor&&"{}"!=c.fillColor.Class.toString()||style.fillColor&&"{}"!=style.fillColor.toString())&&(u.fillColor=c.fillColor.Value,h._core.isHtmlColor(u.fillColor)?u.fillColor=h._color.colorFromHtmlColor(u.fillColor):(/^rgb/.test(u.fillColor)&&(u.fillColor=h._color.rgbaStringToRgbaObj(u.fillColor)),1<u.fillColor.r&&(u.fillColor.r=u.fillColor.r/255),1<u.fillColor.g&&(u.fillColor.g=u.fillColor.g/255),1<u.fillColor.b&&(u.fillColor.b=u.fillColor.b/255),1<u.fillColor.a&&(u.fillColor.a=u.fillColor.a/255),u.fillColor=h._color.createColor(u.fillColor.r,u.fillColor.g,u.fillColor.b,u.fillColor.a)));if(c.outlineColor)/^\[/.test(c.outlineColor)&&/\]$/.test(c.outlineColor)&&(a=c.outlineColor.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),u.outlineColor=e.properties[a],h._core.isHtmlColor(u.outlineColor)?u.outlineColor=h._color.colorFromHtmlColor(u.outlineColor):(/^rgb/.test(u.outlineColor)&&(u.outlineColor=h._color.rgbaStringToRgbaObj(u.outlineColor)),1<u.outlineColor.r&&(u.outlineColor.r=u.outlineColor.r/255),1<u.outlineColor.g&&(u.outlineColor.g=u.outlineColor.g/255),1<u.outlineColor.b&&(u.outlineColor.b=u.outlineColor.b/255),1<u.outlineColor.a&&(u.outlineColor.a=u.outlineColor.a/255),u.outlineColor=h._color.createColor(u.outlineColor.r,u.outlineColor.g,u.outlineColor.b,u.outlineColor.a)));else if(c.outlineColor&&c.outlineColor.Class instanceof Array){for(o=0;o<c.fillColor.Class.length;o++)if((n=(r=c.fillColor.Class[o]).Condition.replace("<","").replace(">","").split("="))[0]=n[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),n[1]=n[1].replace(/\"/,"").replace(/\"/,""),e.properties[n[0]]==n[1]){u.outlineColor=n.Value,h._core.isHtmlColor(u.outlineColor)?u.outlineColor=h._color.colorFromHtmlColor(u.outlineColor):(/^rgb/.test(u.outlineColor)&&(u.outlineColor=h._color.rgbaStringToRgbaObj(u.outlineColor)),1<u.outlineColor.r&&(u.outlineColor.r=u.outlineColor.r/255),1<u.outlineColor.g&&(u.outlineColor.g=u.outlineColor.g/255),1<u.outlineColor.b&&(u.outlineColor.b=u.outlineColor.b/255),1<u.outlineColor.a&&(u.outlineColor.a=u.outlineColor.a/255),u.outlineColor=h._color.createColor(u.outlineColor.r,u.outlineColor.g,u.outlineColor.b,u.outlineColor.a));break}}else(c.outlineColor&&"{}"!=c.outlineColor.Class.toString()||c.outlineColorTe&&"{}"!=c.outlineColor.toString())&&(u.outlineColor=c.outlineColor.Value,h._core.isHtmlColor(u.outlineColor)?u.outlineColor=h._color.colorFromHtmlColor(u.outlineColor):(/^rgb/.test(u.outlineColor)&&(u.outlineColor=h._color.rgbaStringToRgbaObj(u.outlineColor)),1<u.outlineColor.r&&(u.outlineColor.r=u.outlineColor.r/255),1<u.outlineColor.g&&(u.outlineColor.g=u.outlineColor.g/255),1<u.outlineColor.b&&(u.outlineColor.b=u.outlineColor.b/255),1<u.outlineColor.a&&(u.outlineColor.a=u.outlineColor.a/255),u.outlineColor=h._color.createColor(u.outlineColor.r,u.outlineColor.g,u.outlineColor.b,u.outlineColor.a)));if(c.backgroundColor)/^\[/.test(c.backgroundColor)&&/\]$/.test(c.backgroundColor)&&(a=c.backgroundColor.replace(/\[/,"").replace(/\]/,""),u.backgroundColor=e.properties[a],h._core.isHtmlColor(u.backgroundColor)?u.backgroundColor=h._color.colorFromHtmlColor(u.backgroundColor):(/^rgb/.test(u.backgroundColor)&&(u.backgroundColor=h._color.rgbaStringToRgbaObj(u.backgroundColor)),1<u.backgroundColor.r&&(u.backgroundColor.r=u.backgroundColor.r/255),1<u.backgroundColor.g&&(u.backgroundColor.g=u.backgroundColor.g/255),1<u.backgroundColor.b&&(u.backgroundColor.b=u.backgroundColor.b/255),1<u.backgroundColor.a&&(u.backgroundColor.a=u.backgroundColor.a/255),u.backgroundColor=h._color.createColor(u.backgroundColor.r,u.backgroundColor.g,u.backgroundColor.b,u.backgroundColor.a)));else if(c.backgroundColor&&c.backgroundColor.Class instanceof Array){for(o=0;o<c.backgroundColor.Class.length;o++)if((n=(r=c.backgroundColor.Class[o]).Condition.replace("<","").replace(">","").split("="))[0]=n[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),n[1]=n[1].replace(/\"/,"").replace(/\"/,""),e.properties[n[0]]==n[1]){u.backgroundColor=getSGColor(n.Value),h._core.isHtmlColor(u.backgroundColor)?u.backgroundColor=h._color.colorFromHtmlColor(u.backgroundColor):(/^rgb/.test(u.backgroundColor)&&(u.backgroundColor=h._color.rgbaStringToRgbaObj(u.backgroundColor)),1<u.backgroundColor.r&&(u.backgroundColor.r=u.backgroundColor.r/255),1<u.backgroundColor.g&&(u.backgroundColor.g=u.backgroundColor.g/255),1<u.backgroundColor.b&&(u.backgroundColor.b=u.backgroundColor.b/255),1<u.backgroundColor.a&&(u.backgroundColor.a=u.backgroundColor.a/255),u.backgroundColor=h._color.createColor(u.backgroundColor.r,u.backgroundColor.g,u.backgroundColor.b,u.backgroundColor.a));break}}else c.backgroundColor&&"{}"!=c.backgroundColor.Class.toString()?(u.backgroundColor=getSGColor(c.backgroundColor.Value),h._core.isHtmlColor(u.backgroundColor)?u.backgroundColor=h._color.colorFromHtmlColor(u.backgroundColor):(/^rgb/.test(u.backgroundColor)&&(u.backgroundColor=h._color.rgbaStringToRgbaObj(u.backgroundColor)),1<u.backgroundColor.r&&(u.backgroundColor.r=u.backgroundColor.r/255),1<u.backgroundColor.g&&(u.backgroundColor.g=u.backgroundColor.g/255),1<u.backgroundColor.b&&(u.backgroundColor.b=u.backgroundColor.b/255),1<u.backgroundColor.a&&(u.backgroundColor.a=u.backgroundColor.a/255),u.backgroundColor=h._color.createColor(u.backgroundColor.r,u.backgroundColor.g,u.backgroundColor.b,u.backgroundColor.a))):c.backgroundColor&&"{}"!=c.backgroundColor.toString()&&(u.backgroundColor=c.backgroundColor.Value,h._core.isHtmlColor(u.backgroundColor)?u.backgroundColor=h._color.colorFromHtmlColor(u.backgroundColor):(/^rgb/.test(u.backgroundColor)&&(u.backgroundColor=h._color.rgbaStringToRgbaObj(u.backgroundColor)),1<u.backgroundColor.r&&(u.backgroundColor.r=u.backgroundColor.r/255),1<u.backgroundColor.g&&(u.backgroundColor.g=u.backgroundColor.g/255),1<u.backgroundColor.b&&(u.backgroundColor.b=u.backgroundColor.b/255),1<u.backgroundColor.a&&(u.backgroundColor.a=u.backgroundColor.a/255),u.backgroundColor=h._color.createColor(u.backgroundColor.r,u.backgroundColor.g,u.backgroundColor.b,u.backgroundColor.a)));if(c.scale)/^\[/.test(c.scale)&&/\]$/.test(c.scale)&&(a=c.scale.replace(/\[/,"").replace(/\]/,""),u.scale=e.properties[a]);else if(c.scale&&c.scale.Class instanceof Array)for(o=0;o<c.scale.Class.length;o++)(n=(r=c.scale.Class[o]).Condition.replace("<","").replace(">","").split("="))[0]=n[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),n[1]=n[1].replace(/\"/,"").replace(/\"/,""),e.properties[n[0]]==n[1]&&(u.scale=r.Value);else c.scale&&"{}"!=c.scale.Class.toString()?u.scale=c.scale.Value:c.scale&&"[object Object]"!=c.scale.toString()&&"{}"!=c.scale.toString()&&(u.scale=c.scale);if(/^\[/.test(c.text)&&/\]$/.test(c.text)||c.textTe?c.textTe?c.text.Class instanceof Object?(i=c.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),u.text=e.properties[i]):(a=(c.text&&c.text.Class&&"{}"!=c.text.Class.toString()?c.text.Class.Value:c.text).replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),u.text=e.properties[a]):c.text&&"[object Object]"!=c.text.toString()&&"{}"!=c.text.toString()?u.text=c.text:(a=c.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),u.text=e.properties[a]):c.text&&"[object Object]"!=c.text.toString()&&"{}"!=c.text.toString()&&(u.text=c.text),(u=u.labelData?h._core.extend(u,u.labelData,!0):u).verticalOrigin=Cesium.VerticalOrigin.CENTER,u.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,s&&s.add(u),c.image&&c.image.Class instanceof Array){for(var r,n,o=0;o<c.image.Class.length;o++)if((n=(r=c.image.Class[o]).Condition.replace("<","").replace(">","").split("="))[0]=n[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),n[1]=n[1].replace(/\"/,"").replace(/\"/,""),e.properties[n[0]]==n[1]){u.image=r.Value;break}}else c.image&&c.image.Class&&"{}"!=c.image.Class.toString()?(a=c.image.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),u.image=e.properties[a]):c.image&&"[object Object]"!=c.image.toString()&&"{}"!=c.image.toString()&&(u.image=c.image);var a=Ce.cloneDeep(u);a.verticalOrigin=Cesium.VerticalOrigin.CENTER,a.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,l&&l.add(a)}),0==e.features.length&&(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0),o.data.geometryPrimitive=t||l||s,o.state===Cesium.QuadtreeTileLoadState.LOADING&&(o.data.geometryPrimitive.update(i,[]),o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0)},error:function(){o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0}}),o.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var l=this._viewer.scene,n=l.primitives;c&&c.time&&(this._Provider._availability=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:c.time.start?h._cesium.JulianDate.fromDate(new Date(c.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:c.time.end?h._cesium.JulianDate.fromDate(new Date(c.time.end)):h._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),n.add(this._primitive),l.primitivesQuadTrees&&l.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:c,treeData:{name:e,geoOptions:t,styleOption:c,GroupID:i,checked:o,disFnc:r}};return this._Provider.treeID=c.id,this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ve.prototype.createSXTLabelGeoJsonFeatureLayerProvider=function(e,t,s,i,o,r){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},l=this;s.material;var u={show:!0,position:l._cesium.Cartesian3.ZERO,pixelOffset:l._cesium.Cartesian2.ZERO,eyeOffset:l._cesium.Cartesian3.ZERO,heightReference:l._cesium.HeightReference.NONE,horizontalOrigin:l._cesium.HorizontalOrigin.CENTER,verticalOrigin:l._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:l._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:l._cesium.Cartesian3.ZERO,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0};s.width&&(u.width=s.width),s.height&&(u.height=s.height),s.image&&(u.image=s.image),this._urlTemplate=t.url+"?"+this._core._serialize(n.urlParams);var c=t.url+"?"+this._core._serialize(n.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=s.level_max-1,this._Provider._minimumHeight=parseFloat(s.height)||0,this._Provider.loadTile=function(n,a){if(a.state===Cesium.QuadtreeTileLoadState.START){if(a.data={lines:[],geometryPrimitive:void 0},!(a.level>=s.level_min&&a.level<=s.level_max&&l.item.show))return a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0);var e=c.replace(window.encodeURIComponent("{x}"),a.x).replace(window.encodeURIComponent("{y}"),a.y).replace(window.encodeURIComponent("{z}"),a.level);l._cache&&(e+="&"+l._core.getuid()),l._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0);var t;if(a.level==parseInt(s.level_max)-1)"function"==typeof initSXTData&&(t=initSXTData(e));else{t=new Cesium.BillboardCollection;for(var i of e.features){var o=i.geometry.coordinates[0],r=i.geometry.coordinates[1],i=s.pointHeight?parseFloat(s.pointHeight):0;u.position=Cesium.Cartesian3.fromDegrees(o,r,i),t.add(u)}}0==e.features.length&&(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0),a.data.geometryPrimitive=t,a.state=Cesium.QuadtreeTileLoadState.LOADING,a.state===Cesium.QuadtreeTileLoadState.LOADING&&"function"==typeof a.data.geometryPrimitive.update?(a.data.geometryPrimitive.update(n,[]),a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0):(a.data.geometryPrimitive.destroy=function(){},a.data.geometryPrimitive.update=function(){})},error:function(){null==a.count&&(a.count=0),a.count+=1,2<=a.count?(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0):a.state=Cesium.QuadtreeTileLoadState.START}}),a.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var a=this._viewer.scene,n=a.primitives;s&&s.time&&(this._Provider._availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:s.time.start?l._cesium.JulianDate.fromDate(new Date(s.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?l._cesium.JulianDate.fromDate(new Date(s.time.end)):l._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),n.add(this._primitive),a.primitivesQuadTrees&&a.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:s,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ve.prototype.createCustomCallbackGeoJsonFeatureLayerProvider=function(e,t,r,i,o,n,a){var s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},l=this;r.material,l._cesium.Cartesian3.ZERO,l._cesium.Cartesian2.ZERO,l._cesium.Cartesian3.ZERO,l._cesium.HeightReference.NONE,l._cesium.HorizontalOrigin.CENTER,l._cesium.VerticalOrigin.CENTER,l._cesium.Color.WHITE,l._cesium.Cartesian3.ZERO,r.width,r.height,r.image,this._urlTemplate=t.url+"?"+this._core._serialize(s.urlParams);var u=t.url+"?"+this._core._serialize(s.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=r.level_max-1,this._Provider._minimumHeight=parseFloat(r.height)||0,this._Provider.loadTile=function(i,o){if(o.state===Cesium.QuadtreeTileLoadState.START){if(o.data={lines:[],geometryPrimitive:void 0},!(o.level>=r.level_min&&o.level<=r.level_max&&l.item.show))return o.state=Cesium.QuadtreeTileLoadState.DONE,void(o.renderable=!0);var e=u.replace(window.encodeURIComponent("{x}"),o.x).replace(window.encodeURIComponent("{y}"),o.y).replace(window.encodeURIComponent("{z}"),o.level);l._cache&&(e+="&"+l._core.getuid()),l._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return o.state=Cesium.QuadtreeTileLoadState.DONE,void(o.renderable=!0);var t;"function"==typeof n&&(t=n(e)),0==e.features.length&&(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0),o.data.geometryPrimitive=t,o.state=Cesium.QuadtreeTileLoadState.LOADING,o.state===Cesium.QuadtreeTileLoadState.LOADING&&"function"==typeof o.data.geometryPrimitive.update?(o.data.geometryPrimitive.update(i,[]),o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0):(o.data.geometryPrimitive.destroy=function(){},o.data.geometryPrimitive.update=function(){})},error:function(){null==o.count&&(o.count=0),o.count+=1,2<=o.count?(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0):o.state=Cesium.QuadtreeTileLoadState.START}}),o.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var c=this._viewer.scene,s=c.primitives;r&&r.time&&(this._Provider._availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:r.time.start?l._cesium.JulianDate.fromDate(new Date(r.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:r.time.end?l._cesium.JulianDate.fromDate(new Date(r.time.end)):l._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),s.add(this._primitive),c.primitivesQuadTrees&&c.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(r.id)&&(r.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+r.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:r.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:r,treeData:{name:e,geoOptions:t,styleOption:r,GroupID:i,checked:o,disFnc:a}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof a&&a(this.item),this},Ve.prototype.createLabelRichtextGeoJsonFeatureLayerProvider=function(e,t,c,i,h,m){null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o);var d=this,p=new this._cesium.PointPrimitiveCollection;d.optiontext=[],o.then(function(e){for(var t,i=(d.item=e).entities.values,o=0;o<i.length;o++){var r=i[o];a=/^\[/.test(c.text)&&/\]$/.test(c.text)?(a=c.text.replace(/\[/,"").replace(/\]/,""),r.properties[a]._value):c.text,d.optiontext.push(a),r.billboard=void 0,d._viewer.scene.globe.ellipsoid;var n,a=d._cesium.Cartographic.fromCartesian(r.position._value),r=[d._cesium.Math.toDegrees(a.longitude),d._cesium.Math.toDegrees(a.latitude),c.pointHeight||a.height],a=d._core.getuid();r instanceof Array?2===r.length?n=d._cesium.Cartesian3.fromDegrees(r[0],r[1]):3===r.length&&(n=d._cesium.Cartesian3.fromDegrees(r[0],r[1],r[2])):n=r.z?d._cesium.Cartesian3.fromDegrees(r.x,r.y,r.z):d._cesium.Cartesian3.fromDegrees(r.x,r.y),p.add({id:"DivPoint"+a,position:n,color:d._cesium.Color.YELLOW,description:c.text})}c&&c.time&&(t=new d._cesium.TimeIntervalCollection([new d._cesium.TimeInterval({start:c.time.start?d._cesium.JulianDate.fromDate(new Date(c.time.start)):d._cesium.Iso8601.MINIMUM_VALUE,stop:c.time.end?d._cesium.JulianDate.fromDate(new Date(c.time.end)):d._cesium.Iso8601.MAXIMUM_VALUE})])),d.item=p,d.pointPrimitive=d._viewer.scene.primitives.add(p,t);var s,l,u=!0;d.pointPrimitive.update=function(){for(var e,t,i=0;i<d.pointPrimitive.length;i++){if(e=d.pointPrimitive.get(i),l=e.position,!(s=d._viewer.scene.cartesianToCanvasCoordinates(l)))return;(l=document.getElementById(e.id))||(t='<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+D.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+d.optiontext[i]+"</div>\n           </div>",$(".cesium-viewer").append(t),l=document.getElementById(e.id)),e.description?l.style.transform="matrix(1, 0, 0, 1, "+s.x+", "+(s.y-157)+")":l.style.transform="matrix(1, 0, 0, 1, "+s.x+", "+(s.y-134)+")",l&&(l.style.display=d.pointPrimitive.show?"block":"none")}u&&(h||d.setVisibility(!1),u=!1)},"function"==typeof m&&m(e)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本");t={id:c.id,name:e,checked:h,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t,style:c,treeData:{name:e,geoOptions:t,styleOption:c,GroupID:i,checked:h,disFnc:m}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Ve.prototype.createLabelRichtextGeoJsonFeatureLayerProviderLayer=function(e,t,s,i,l,o){var r={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},u=this,r=new Ae(this._viewer,this._cesium,r);(this._Provider=r)._loadTile=function(e){var o,r,n=new u._cesium.PointPrimitiveCollection;u.optiontext=[],e.features.forEach(function(e){var t,i=options.pointHeight;null!=e.properties.height&&(i=parseFloat(e.properties.height)+i),/^\[/.test(options.pointHeight)&&/\]$/.test(options.pointHeight)&&(t=options.pointHeight.replace(/\[/,"").replace(/\]/,""),i=parseFloat(e.properties[t])),s.position=new u._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i),/^\[/.test(s.text)&&/\]$/.test(s.text)&&(o=s.text.replace(/\[/,"").replace(/\]/,""),s.text=e.properties[o]);var o=u._core.getuid();n.add({id:"DivPoint"+o,position:Cartesian3,color:u._cesium.Color.YELLOW,description:s.text}),u.optiontext.push(option.text)}),u.pointPrimitive=u._viewer.scene.primitives.add(n);var a=!0;return u.pointPrimitive.update=function(){for(var e,t,i=0;i<u.pointPrimitive.length;i++){if(e=u.pointPrimitive.get(i),r=e.position,!(o=u._viewer.scene.cartesianToCanvasCoordinates(r)))return;(r=document.getElementById(e.id))||(t='<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+D.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+u.optiontext[i]+"</div>\n           </div>",$(".cesium-viewer").append(t),r=document.getElementById(e.id)),e.description?r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-157)+")":r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-134)+")"}a&&(l||u.setVisibility(!1),a=!1)},u.item=n,""},r.addTo(this._viewer),l||this.setVisibility(!1),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本"+s.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t.url,style:s,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:l,disFnc:o}};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},Ve.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,s,i,o,r){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,Cesium:this._cesium},l=this;s.material,l._core.isnull(s)||l._core.isnull(s.color)||/^\[/.test(s.color)&&"["==s.color.toString().charAt(0)&&"]"==s.color.toString().charAt(s.color.length-1)||(l._core.isHtmlColor(s.color)?s.color=l._color.colorFromHtmlColor(s.color):(/^rgb/.test(s.color)&&(s.color=l._color.rgbaStringToRgbaObj(s.color)),1<s.color.r&&(s.color.r=s.color.r/255),1<s.color.g&&(s.color.g=s.color.g/255),1<s.color.b&&(s.color.b=s.color.b/255),1<s.color.a&&(s.color.a=s.color.a/255),s.color=l._color.createColor(s.color.r,s.color.g,s.color.b,s.color.a))),this._urlTemplate=t.url+"?"+this._core._serialize(n.urlParams);var u=t.url+"?"+this._core._serialize(n.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=s.level_max-1,this._Provider._minimumHeight=parseFloat(s.height)||0,this._Provider.loadTile=function(n,a){if(a.state===Cesium.QuadtreeTileLoadState.START){if(a.data={lines:[],geometryPrimitive:void 0},!(a.level>=s.level_min&&a.level<s.level_max&&l.item.show))return a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0);var e=u.replace(window.encodeURIComponent("{x}"),a.x).replace(window.encodeURIComponent("{y}"),a.y).replace(window.encodeURIComponent("{z}"),a.level);l._cache&&(e+="&"+l._core.getuid()),l._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0);var t={url:"",modelMatrix:l._cesium.Transforms.eastNorthUpToFixedFrame(origin),color:l._cesium.Color.DARKSALMON,scale:2},o=l._core.extend(t,s,!0);l._core.isnull(s.near)&&(s.near=0),l._core.isnull(s.far)&&(s.far=999999999);var i=parseFloat(s.near),t=parseFloat(s.far),t=new l._cesium.DistanceDisplayCondition(i,t);o.distanceDisplayCondition=t;var r=new l._cesium.PrimitiveCollection;e.features.forEach(function(e){o.id=e;var t,i=o.height;null!=e.properties.height&&(i=parseFloat(e.properties.height)),/^\[/.test(o.height)&&/\]$/.test(o.height)&&(t=o.height.replace(/\[/,"").replace(/\]/,""),i=parseFloat(e.properties[t])),o.modelMatrix=l._cesium.Transforms.eastNorthUpToFixedFrame(l._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i));e=l._cesium.Model.fromGltf({id:e,url:o.uri,color:o.color,modelMatrix:o.modelMatrix,scale:o.scale,heightReference:parseInt(o.heightReference),distanceDisplayCondition:o.distanceDisplayCondition});r.add(e)}),0==e.features.length&&(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0),a.data.geometryPrimitive=r,a.state=Cesium.QuadtreeTileLoadState.LOADING,a.state===Cesium.QuadtreeTileLoadState.LOADING&&(a.data.geometryPrimitive.update(n,[]),a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0)},error:function(){null==a.count&&(a.count=0),a.count+=1,2<=a.count?(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0):a.state=Cesium.QuadtreeTileLoadState.START}}),a.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});n=this._viewer.scene;n.primitives.add(this._primitive),n.primitivesQuadTrees&&n.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:s,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ve.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,s,i,o,r){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},l=this;l._core.isnull(s)||l._core.isnull(s.color)||/^\[/.test(s.color)&&"["==s.color.toString().charAt(0)&&"]"==s.color.toString().charAt(s.color.length-1)||(l._core.isHtmlColor(s.color)?s.color=l._color.colorFromHtmlColor(s.color):(/^rgb/.test(s.color)&&(s.color=l._color.rgbaStringToRgbaObj(s.color)),1<s.color.r&&(s.color.r=s.color.r/255),1<s.color.g&&(s.color.g=s.color.g/255),1<s.color.b&&(s.color.b=s.color.b/255),1<s.color.a&&(s.color.a=s.color.a/255),s.color=l._color.createColor(s.color.r,s.color.g,s.color.b,s.color.a))),l._core.isnull(s)||l._core.isnull(s.outlineColor)||/^\[/.test(s.outlineColor)&&"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(l._core.isHtmlColor(s.outlineColor)?s.outlineColor=l._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=l._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=l._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a))),this._urlTemplate=t.url+"?"+this._core._serialize(n.urlParams);var u=t.url+"?"+this._core._serialize(n.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=s.level_max-1,this._Provider._minimumHeight=parseFloat(s.height)||0,this._Provider.loadTile=function(o,a){if(a.state===Cesium.QuadtreeTileLoadState.START){if(a.data={lines:[],geometryPrimitive:void 0},!(a.level>=s.level_min&&a.level<s.level_max&&l.item.show))return a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0);var e=u.replace(window.encodeURIComponent("{x}"),a.x).replace(window.encodeURIComponent("{y}"),a.y).replace(window.encodeURIComponent("{z}"),a.level);l._cache&&(e+="&"+l._core.getuid()),l._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0);var t={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:l._cesium.LabelStyle.OUTLINE,fillColor:l._cesium.Color.WHITE,outlineColor:l._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new l._cesium.Color(.165,.165,.165,.8),backgroundPadding:new l._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:l._cesium.HorizontalOrigin.CENTER,verticalOrigin:l._cesium.VerticalOrigin.CENTER,eyeOffset:l._cesium.Cartesian3.ZERO,pixelOffset:l._cesium.Cartesian2.ZERO,heightReference:l._cesium.HeightReference.NONE,scaleByDistance:new l._cesium.NearFarScalar(0,0,1,1)};s.material,l._core.isnull(s)||l._core.isnull(s.backgroundColor)||/^\[/.test(s.backgroundColor)&&"["==s.backgroundColor.toString().charAt(0)&&"]"==s.backgroundColor.toString().charAt(s.backgroundColor.length-1)||(l._core.isHtmlColor(s.backgroundColor)?s.backgroundColor=l._color.colorFromHtmlColor(s.backgroundColor):(/^rgb/.test(s.backgroundColor)&&(s.backgroundColor=l._color.rgbaStringToRgbaObj(s.backgroundColor)),1<s.backgroundColor.r&&(s.backgroundColor.r=s.backgroundColor.r/255),1<s.backgroundColor.g&&(s.backgroundColor.g=s.backgroundColor.g/255),1<s.backgroundColor.b&&(s.backgroundColor.b=s.backgroundColor.b/255),1<s.backgroundColor.a&&(s.backgroundColor.a=s.backgroundColor.a/255),s.backgroundColor=l._color.createColor(s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.backgroundColor.a)));var r=l._core.extend(t,s,!0);l._core.isnull(s.near)&&(s.near=0),l._core.isnull(s.far)&&(s.far=999999999);var i=parseFloat(s.near),t=parseFloat(s.far),t=new l._cesium.DistanceDisplayCondition(i,t);r.distanceDisplayCondition=t,l._core.isnull(s.font_size)&&(s.font_size="30px"),l._core.isnull(s.font_family)&&(s.font_family=" sans-serif"),r.font=parseFloat(s.font_size)+"px "+s.font_family;var n=new l._cesium.PointPrimitiveCollection;e.features.forEach(function(e){r.id=e;var t,i,o=0;/^\[/.test(r.pointHeight)&&/\]$/.test(r.pointHeight)?(t=r.pointHeight.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[t])):void 0!==r.pointHeight&&""!==r.pointHeight?o=parseFloat(r.pointHeight):null!=e.properties.height&&(o=parseFloat(e.properties.height)),/^\[/.test(s.color)&&/\]$/.test(s.color)&&(i=s.color.replace(/\[/,"").replace(/\]/,""),r.color=e.properties[i],l._core.isHtmlColor(r.color)?r.color=l._color.colorFromHtmlColor(r.color):(/^rgb/.test(r.color)&&(r.color=l._color.rgbaStringToRgbaObj(r.color)),1<r.color.r&&(r.color.r=r.color.r/255),1<r.color.g&&(r.color.g=r.color.g/255),1<r.color.b&&(r.color.b=r.color.b/255),1<r.color.a&&(r.color.a=r.color.a/255),r.color=l._color.createColor(r.color.r,r.color.g,r.color.b,r.color.a))),/^\[/.test(s.outlineColor)&&/\]$/.test(s.outlineColor)&&(i=s.outlineColor.replace(/\[/,"").replace(/\]/,""),r.outlineColor=e.properties[i],l._core.isHtmlColor(r.outlineColor)?r.outlineColor=l._color.colorFromHtmlColor(r.outlineColor):(/^rgb/.test(r.outlineColor)&&(r.outlineColor=l._color.rgbaStringToRgbaObj(r.outlineColor)),1<r.outlineColor.r&&(r.outlineColor.r=r.outlineColor.r/255),1<r.outlineColor.g&&(r.outlineColor.g=r.outlineColor.g/255),1<r.outlineColor.b&&(r.outlineColor.b=r.outlineColor.b/255),1<r.outlineColor.a&&(r.outlineColor.a=r.outlineColor.a/255),r.outlineColor=l._color.createColor(r.outlineColor.r,r.outlineColor.g,r.outlineColor.b,r.outlineColor.a))),r.position=new l._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],o),r.text=e.properties.name;o={show:r.show,position:r.position,pixelSize:r.pixelSize,color:r.color,outlineColor:r.outlineColor,outlineWidth:r.outlineWidth,id:e},e="color:"+255*r.color.red+","+255*r.color.green+","+255*r.color.blue+";outlineColor:"+255*r.outlineColor.red+","+255*r.outlineColor.green+","+255*r.outlineColor.blue;l.Legend.push(e),n.add(o)}),0==e.features.length&&(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0),a.data.geometryPrimitive=n,a.state=Cesium.QuadtreeTileLoadState.LOADING,a.state===Cesium.QuadtreeTileLoadState.LOADING&&(a.data.geometryPrimitive.update(o,[]),a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0)},error:function(){null==a.count&&(a.count=0),a.count+=1,2<=a.count?(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0):a.state=Cesium.QuadtreeTileLoadState.START}}),a.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});n=this._viewer.scene;n.primitives.add(this._primitive),n.primitivesQuadTrees&&n.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:s,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ve.prototype.setTreeobj=function(e){this.treeobj=e},Ve.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},Ve.prototype.deleteObject=function(){if(this._viewer.scene.primitives.remove(this.item),this.probj&&0<this.probj.length&&(this._viewer.scene.primitives.remove(this.probj[0]),this.probj.pop()),null!=this.img&&this._viewer.imageryLayers.remove(this.img),this.primitve&&0<this.primitve.length){for(var e=0;e<this.primitve.length;e++)this._viewer.scene.primitives.remove(this.primitve[e]);this.primitve=[]}this.loadAllKey&&0<this.loadAllKey.length&&(this.loadAllKey=[]);try{this._Provider.remove()}catch(e){}if(null!=this._Provider&&this._Provider.setStatus(!1),null!=this.items&&null!=this.items&&0<this.items.length)for(e=0;e<this.items.length;e++)this._viewer.scene.primitives.remove(this.items[e]);else this._viewer.scene.primitives.remove(this.item);if(this.treeobj&&"DivPoint"===this.treeobj.type&&this.item&&null!=this.item._pointPrimitives&&null!=this.item._pointPrimitives)for(e=0;e<this.item._pointPrimitives.length;e++){var t=document.getElementById(this.item._pointPrimitives[e].id);t&&t.remove()}try{this._Provider.remove()}catch(e){}},Ve.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t},treeData:this.treeobj.treeData}},Ve.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},Ve.prototype.setVisibility=function(e){try{if(this.loadAllKey=[],null!=this.item&&null!=this.item.show&&(this.item.show=e),null!=this.img&&(this.img.show=e),this.primitve&&0<this.primitve.length)for(var t=0;t<this.primitve.length;t++)this.primitve[t].show=e;if(this._Provider&&this._Provider.setStatus&&void 0!==this._Provider._state&&this._Provider.setStatus(e),this._Provider&&this._Provider.EntityCollection&&(e||(this._Provider.EntityCollection.show=e),this._Provider.EntityCollection.isShow=e),this.probj&&0<this.probj.length)for(t=0;t<this.probj.length;t++)this.probj[t].show=e}catch(e){}if(null!=this.treeobj&&"DivPoint"===this.treeobj.type&&this.item&&null!=this.item._pointPrimitives&&null!=this.item._pointPrimitives)for(t=0;t<this.item._pointPrimitives.length;t++){var i=document.getElementById(this.item._pointPrimitives[t].id);i&&(i.style.display=e?"block":"none")}null!=this.item&&(this.item.show=e),this._Provider&&void 0!==this._Provider._stop&&this._Provider.setStatus(!e)},Ve.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},Ve.prototype.forceRefresh=function(){try{this._cache=!0,this._forceRefreshPrvimitive||(this._forceRefreshPrvimitive=Ce.cloneDeep(this._primitive));var e=Ce.cloneDeep(this._forceRefreshPrvimitive);this._viewer.scene.primitives.remove(this._primitive),this._viewer.scene.primitives.add(e),this.edit(this.isEditting,this.editoption)}catch(e){}},Object.defineProperties(Ve.prototype,{labelText:{set:Ce.debounce(function(e){var t=e;if(!this._core.isnull(e)){var i=this.item.entities&&this.item.entities.values;if(i&&0<i.length)for(var o=0;o<i.length;o++)if(/^\[/.test(e)&&(t=e.replace(/\[/,"").replace(/\]/,""),t=i[o].properties[t]._value),i[o].label){i[o].label.text=t;try{i[o].point.show=!1}catch(e){}}else{try{i[o].point.show=!1}catch(e){}i[o].label=new this._cesium.LabelGraphics({text:t,font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})}}},500)},labelStyles:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.style=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.style:void 0}},labelFont:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,o=16;if(i&&(o=(i=i._value.trimLeft().trimRight()).split("px")[0]),t&&0<t.length&&t[0].label)for(var r=0;r<t.length;r++)t[r].label.font=o+"px "+e}}},500)},labelFontSize1:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,o="sans-serif";if(i&&(o=(i=i._value.trimLeft().trimRight()).split("px")[1]),t&&0<t.length&&t[0].label)for(var r=0;r<t.length;r++)t[r].label.font=e+"px  "+o}}},500)},labelFontSize:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),(!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.font=e+"px  sans-serif"}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?parseFloat(e[0].label.font):void 0}},labelFillColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.fillColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.fillColor;return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}}},labelOutlineColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.outlineColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.outlineColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},labelOutlineWidth:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.outlineWidth=e}},200),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.outlineWidth;if(e)return e._value}}},labelBackgroundColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.backgroundColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.backgroundColor;return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}}},labelBackground:{set:Ce.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.showBackground=e},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.background:void 0}},labelScale:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.scale;if(e)return e._value}}},labelHorizontalOrigin:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.horizontalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.horizontalOrigin;if(e)return e._value}}},labelVerticalOrigin:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.verticalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.verticalOrigin;if(e)return e._value}}},labelHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.heightReference;if(e)return e._value}}},labelDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,parseInt(e)),t[o].label.scaleByDistance=new this._cesium.NearFarScalar(i,1,parseInt(e),0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&(e&&0<e.length&&e[0].label))return e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE}},labelDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(parseInt(e),i),t[o].label.scaleByDistance=new this._cesium.NearFarScalar(parseInt(e),1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&(e&&0<e.length&&e[0].label))return e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.near:0}},labelHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),o=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=o}}},500),get:function(){return 0}},labelShow:{set:Ce.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].label&&e?(t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].label=new this._cesium.LabelGraphics({text:"label",font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})):(t[i].label&&(t[i].label.show=e),t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.show:void 0}},modelShow:{set:Ce.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e),!t[i].model&&e?t[i].model=new this._cesium.ModelGraphics({show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}):(t[i].model&&(t[i].model.show=e),t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)return e&&0<e.length&&e[0].model?e[0].model.show:void 0}},modelUri:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length)for(var i,o=0;o<t.length;o++)t[o].model?t[o].model.uri=e:(/^\[/.test(e)&&(e=1<(i=e.split("[")).length?i[0]+i[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[o].properties[e])),t[o].model=new this._cesium.ModelGraphics({uri:e,show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}))}},500)},modelScale:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){e=parseFloat(e);var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].model.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.scale;if(e)return e._value}}},modelShadows:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.shadows=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)return e&&0<e.length&&e[0].model?e[0].model.shadows:void 0}},modelHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.heightReference;if(e)return e._value}}},modelDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;e&&!/^point.fid/.test(e[0]._id)&&null==e[0].model||e&&0<e.length&&e[0].model&&(e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE)}},modelDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&(e&&0<e.length&&e[0].model))return e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.near:0}},modelColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},modelLightColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.lightColor=e}},100),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.lightColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},modelHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),o=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=o}}},500),get:function(){return 0}},pointColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},pointShow:{set:Ce.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].point&&e?(t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].point=new this._cesium.PointGraphics({color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0})):(t[i].point&&(t[i].point.show=e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)return e&&0<e.length&&e[0].point?e[0].point.show:void 0}},pointPixelSize:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.pixelSize=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.pixelSize;if(e)return e._value}}},pointOutlineColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.outlineColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.outlineColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},pointOutlineWidth:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.outlineWidth=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.outlineWidth;if(e)return e._value}}},pointHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.heightReference;if(e)return e._value}}},pointDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[o].point.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&(e&&0<e.length&&e[0].point))return e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE}},pointDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[o].point.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&(e&&0<e.length&&e[0].point))return e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.near:0}},pointHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),o=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=o}}},500),get:function(){return 0}},billboardShow:{set:Ce.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].billboard&&e?(t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard=new this._cesium.BillboardGraphics({show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})):(t[i].billboard&&(t[i].billboard.show=e),t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.show:void 0}},billboardImage:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length)for(var i,o=0;o<t.length;o++)/^\[/.test(e)&&(e=1<(i=e.split("[")).length?i[0]+i[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[o].properties[e])),t[o].billboard?t[o].billboard.image=e:t[o].billboard=new this._cesium.BillboardGraphics({image:e,show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})}},500)},billboardScale:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.scale;if(e)return e._value}}},billboardHorizontalOrigin:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.horizontalOrigin=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.horizontalOrigin:void 0}},billboardVerticalOrigin:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.verticalOrigin=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.verticalOrigin:void 0}},billboardWidth:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.width=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.width;if(e)return e._value}}},billboardHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.height=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.height;if(e)return e._value}}},billboardColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},billboardHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].billboard.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].model){e=e[0].billboard.heightReference;if(e)return e._value}}},billboardDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[o].billboard.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&(e&&0<e.length&&e[0].billboard))return e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE}},billboardDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[o].billboard.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&(e&&0<e.length&&e[0].billboard))return e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.near:0}},billboardPHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),o=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=o}}},500),get:function(){return 0}}});var je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function ze(i,o,r,n,a,e,s,l){var u=0,c=[];if(e.map(function(e){var t;!s||u<=0?(t=0,i.beginPath(),e.map(function(e){e=o.project(e,r);0==t?i.moveTo(n+e.x,a+e.y):i.lineTo(n+e.x,a+e.y),t++}),s&&(i.closePath(),i.fill()),l&&i.stroke()):c.push(e),u++}),s)return c;c=null}function Ue(e,t,i){this._viewer=e,this._cesium=t,this._tree=i}function We(e,t){this._viewer=e,this._cesium=t,this.item={show:!0},this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we,this._flyTo=new Ue(this._viewer,this._cesium,this._tree),this._Provider=void 0,this.Legend=[],this.model=[],this._cache=!1,this._forceRefreshPrvimitive=null,this._forceRefreshProvider=null}function Ye(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we,this._createGroup=new Ie,this.model=[],this.heading=this._cesium.Math.toRadians(0),this.pitch=this._cesium.Math.toRadians(0),this.roll=this._cesium.Math.toRadians(0),this.rotate=10,this.state=0,this.modelPointArr=[],this.modifyModel=null,this.modifyPoint=null,this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.position=null,this.tempPoints=[],this.scale=0,this.Radius=20}function qe(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we,this._Provider=void 0,this._primitive=void 0,this._taskProcessor=new this._cesium.TaskProcessor("vectorTileProvider"),this.model=[],this.Legend=[],this._ajax=null,this.datas=null}Ge.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":je(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},Ge.prototype.createHistogramVectorGeoJsonFeatureLayer=function(e,t,r,i,o,n){var a={radius:50,height:100,scale:1,defaultColor:"#ffffff",showLabel:!0,label:{showBackground:!1,fillColor:"#ffffff",outlineColor:"#000000",backgroundColor:"rgba(0,0,0,0.5)",style:2,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,outlineWidth:1,font:"20px 微软雅黑"},alpha:.5,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit};r.label&&(a.label=this._core.extend(a.label,r.label,!0),delete r.label);let g=this._core.extend(a,r,!0);null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");let _;Array.isArray(g.color)&&(_={name:g.color[0].name,value:{">":{},"<":{}}},g.color.forEach(e=>{var t;e.value.indexOf&&-1<e.value.indexOf(">")?(t=e.value.split(">"),_.value[">"][t[1]]=Cesium.Color.fromCssColorString(e.color).withAlpha(g.alpha)):e.value.indexOf&&-1<e.value.indexOf("<")?(t=e.value.split("<"),_.value["<"][t[1]]=Cesium.Color.fromCssColorString(e.color).withAlpha(g.alpha)):_.value[e.value]=Cesium.Color.fromCssColorString(e.color).withAlpha(g.alpha)}));let f=Cesium.Color.fromCssColorString(g.defaultColor).withAlpha(g.alpha);var l=this,y={text:"",...g.label,fillColor:Cesium.Color.fromCssColorString(g.label.fillColor),outlineColor:Cesium.Color.fromCssColorString(g.label.outlineColor),backgroundColor:Cesium.Color.fromCssColorString(g.label.backgroundColor)};this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var u=t.url+"?"+this._serialize(s.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=r.level_max-1,this._Provider._minimumHeight=0,this._Provider.loadTile=function(e,t){!function(i,o,p){if(o.state===Cesium.QuadtreeTileLoadState.START){if(o.data={lines:[],geometryPrimitive:void 0},!(o.level>=r.level_min&&o.level<r.level_max&&p.item.show))return o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0;{var t=u.replace(window.encodeURIComponent("{x}"),o.x).replace(window.encodeURIComponent("{y}"),o.y).replace(window.encodeURIComponent("{z}"),o.level);p._cache&&(t+="&"+p._core.getuid());let m=[],d=new Cesium.LabelCollection,e=Cesium.GeoJsonDataSource.load(t);e.then(e=>{let t=e.entities.values;if(!t||!t.length)return o.state=Cesium.QuadtreeTileLoadState.DONE,void(o.renderable=!0);let h=new Cesium.PrimitiveCollection;t.forEach(e=>{var t=e.properties.getValue();let i=g.height;t&&"string"==typeof g.height&&/^\[/.test(g.height)&&/\]$/.test(g.height)&&(o=g.height.replace(/\[/,"").replace(/\]/,""),i=t[o]||100);var o=i*g.scale;let r;if(t&&"string"==typeof g.color&&/^\[/.test(g.color)&&/\]$/.test(g.color)){var n=t[n=g.color.replace(/\[/,"").replace(/\]/,"")]||g.defaultColor;r=Cesium.Color.fromCssColorString(n).withAlpha(g.alpha)}else if(_&&t[_.name]){var a=t[_.name];if(_.value[a])r=_.value[a];else{for(var s in _.value[">"])if(a>s){r=_.value[">"][s];break}if(!r)for(var l in _.value["<"])if(a<l){r=_.value["<"][l];break}}}r=r||f.clone();let u;e.polygon?(n=e.polygon.hierarchy.getValue().positions,u=Cesium.BoundingSphere.fromPoints(n).center,n=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(n),height:0,extrudedHeight:0,vertexFormat:Cesium.VertexFormat.DEFAULT,perPositionHeight:!1}),n=new Cesium.GeometryInstance({id:t,geometry:n,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),m.push(n)):(e.point||e.billboard)&&(u=e.position.getValue());t=new Cesium.GeometryInstance({geometry:new Cesium.EllipseGeometry({extrudedHeight:o,center:u,semiMinorAxis:g.radius,semiMajorAxis:g.radius,vertexFormat:Cesium.VertexFormat.POSITION_AND_ST}),id:t});let c=Cesium.Material.fromType("Color");c.uniforms.color=r.withAlpha(1);t=new p._cesium.Primitive({geometryInstances:t,appearance:new Cesium.EllipsoidSurfaceAppearance({material:c}),shadows:g.shadows});h.add(t),g.showLabel&&(t=p._core.toDegrees(u),y.text=i+"",y.position=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,1.1*o),d.add(y))}),m.length&&(e=new p._cesium.GroundPrimitive({geometryInstances:m,appearance:new p._cesium.PerInstanceColorAppearance({translucent:g.alpha<1}),classificationType:p._cesium.ClassificationType.BOTH,shadows:g.shadows}),h.add(e)),g.showLabel&&h.add(d),p.probj.push(h),o.data.geometryPrimitive=h,o.state=Cesium.QuadtreeTileLoadState.LOADING,o.state===Cesium.QuadtreeTileLoadState.LOADING&&(o.data.geometryPrimitive.update(i,[]),o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0)},e=>{null==o.count&&(o.count=0),o.count+=1,2<=o.count?(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0):o.state=Cesium.QuadtreeTileLoadState.START})}o.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(g.id)&&(g.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+g.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:g.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:r,treeData:{name:e,geoOptions:t,styleOption:r,GroupID:i,checked:o,disFnc:n}};return this._Provider.treeID=o.id,this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},Ge.prototype.createLaycolorVectorGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit};let c=this._core.extend({type:"2D",height:100,scale:1,defaultColor:"#ffffff",alpha:.5,level_max:20,level_min:10},i,!0);null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");let h;Array.isArray(c.color)&&(h={name:c.color[0].name,value:{">":{},"<":{}}},c.color.forEach(e=>{var t;e.value.indexOf&&-1<e.value.indexOf(">")?(t=e.value.split(">"),h.value[">"][t[1]]=Cesium.Color.fromCssColorString(e.color).withAlpha(c.alpha)):e.value.indexOf&&-1<e.value.indexOf("<")?(t=e.value.split("<"),h.value["<"][t[1]]=Cesium.Color.fromCssColorString(e.color).withAlpha(c.alpha)):h.value[e.value]=Cesium.Color.fromCssColorString(e.color).withAlpha(c.alpha)}));let m=Cesium.Color.fromCssColorString(c.defaultColor).withAlpha(c.alpha);var s=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams);var l=t.url+"?"+this._serialize(a.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider._minimumHeight=0,this._Provider.loadTile=function(e,t){!function(o,r,n){if(r.state===Cesium.QuadtreeTileLoadState.START){if(r.data={lines:[],geometryPrimitive:void 0},!(r.level>=i.level_min&&r.level<i.level_max&&n.item.show))return r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0;{var t=l.replace(window.encodeURIComponent("{x}"),r.x).replace(window.encodeURIComponent("{y}"),r.y).replace(window.encodeURIComponent("{z}"),r.level);n._cache&&(t+="&"+n._core.getuid());let u=[],e=Cesium.GeoJsonDataSource.load(t);e.then(e=>{let t=e.entities.values;if(!t||!t.length)return r.state=Cesium.QuadtreeTileLoadState.DONE,void(r.renderable=!0);t.forEach(e=>{var t=e.properties.getValue();let i,o;"3D"===c.type&&(i=c.height,t&&"string"==typeof c.height&&/^\[/.test(c.height)&&/\]$/.test(c.height)&&(n=c.height.replace(/\[/,"").replace(/\]/,""),i=t[n]||100),o=i*c.scale);let r;if(t&&"string"==typeof c.color&&/^\[/.test(c.color)&&/\]$/.test(c.color)){var n=t[n=c.color.replace(/\[/,"").replace(/\]/,"")]||c.defaultColor;r=Cesium.Color.fromCssColorString(n).withAlpha(c.alpha)}else if(h&&t[h.name]){var a=t[h.name];if(h.value[a])r=h.value[a];else{for(var s in h.value[">"])if(a>s){r=h.value[">"][s];break}if(!r)for(var l in h.value["<"])if(a<l){r=h.value["<"][l];break}}}r=r||m.clone(),e.polygon&&(e=e.polygon.hierarchy.getValue().positions,e=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(e),height:0,extrudedHeight:"3D"===c.type?o:0,vertexFormat:Cesium.VertexFormat.DEFAULT,perPositionHeight:!1}),e=new Cesium.GeometryInstance({id:t,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),u.push(e))});let i;if(u.length){let e="3D"===c.type?Cesium.Primitive:Cesium.GroundPrimitive;i=new e({geometryInstances:u,appearance:new n._cesium.PerInstanceColorAppearance({translucent:c.alpha<1}),classificationType:n._cesium.ClassificationType.BOTH,shadows:c.shadows})}n.probj.push(i),r.data.geometryPrimitive=i,r.state=Cesium.QuadtreeTileLoadState.LOADING,r.state===Cesium.QuadtreeTileLoadState.LOADING&&(r.data.geometryPrimitive.update(o,[]),r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0)},e=>{null==r.count&&(r.count=0),r.count+=1,2<=r.count?(r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0):r.state=Cesium.QuadtreeTileLoadState.START})}r.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,s)},this._primitive=new s._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});a=this._viewer.scene;a.primitives.add(this._primitive),a.primitivesQuadTrees&&a.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;r={id:c.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i,treeData:{name:e,geoOptions:t,styleOption:i,GroupID:o,checked:r,disFnc:n}};return this._Provider.treeID=r.id,this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},Ge.prototype.createVector3DTilesFeatureLayer=function(e,t,n,i,o,r){var a={color:"#ffffff",level_max:20,level_min:10,tilingScheme:new Cesium.WebMercatorTilingScheme},s=(t.url,t._x||0),l=t._y||0;t.upperLevelLimit,t.lowerLevelLimit;let u=this._core.extend(a,n,!0);null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var c=this;this._urlTemplate=t.url;var h=t.url;this._Provider=new He(this._viewer,this._cesium,u.tilingScheme),this._Provider._normalTile=n.level_max-1,this._Provider._minimumHeight=0,this._Provider.loadTile=function(e,t){!function(t,i,o){if(i.state===Cesium.QuadtreeTileLoadState.START){if(i.data={lines:[],geometryPrimitive:void 0},!(i.level>=n.level_min&&i.level<n.level_max&&o.item.show))return i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0;{var r=h.replace("{x}",i.x-s).replace("{y}",i.y-l).replace("{z}",i.level);o._cache&&(r+="&"+o._core.getuid());let e=new Cesium.Cesium3DTileset({url:r,...u});e.readyPromise.then(function(e){o.probj.push(e),i.data.geometryPrimitive=e,o._viewer.scene.primitives.add(e),i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state===Cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive.update(t,[]),i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0)}).otherwise(function(e){null==i.count&&(i.count=0),i.count+=1,2<=i.count?(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0):i.state=Cesium.QuadtreeTileLoadState.START})}i.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,c)},this._primitive=new c._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});a=this._viewer.scene;a.primitives.add(this._primitive),a.primitivesQuadTrees&&a.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id);t={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"modelLayer",item:this,url:t.url,style:n};return this._Provider.treeID=t.id,this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ge.prototype.createVector3DTilesFeatureLayerRelease=function(e,t,n,i,o,r){var a={color:"#ffffff",level_max:20,level_min:10,tilingScheme:new Cesium.WebMercatorTilingScheme},s=(t.url,t._x||0),l=t._y||0;t.upperLevelLimit,t.lowerLevelLimit;let u=this._core.extend(a,n,!0);null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var c=this;c.models=0,this._urlTemplate=t.url;var h=t.url;this._Provider=new He(this._viewer,this._cesium,u.tilingScheme),this._Provider._normalTile=n.level_max-1,this._Provider._minimumHeight=0,this._Provider.loadTile=function(e,t){!function(i,o,r){if(o.state===Cesium.QuadtreeTileLoadState.START){if(o.data={lines:[],geometryPrimitive:void 0},!(o.level>=n.level_min&&o.level<n.level_max&&r.item.show))return o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0;{var t=h.replace("{x}",o.x-s).replace("{y}",o.y-l).replace("{z}",18);r._cache&&(t+="&"+r._core.getuid());let e=new Cesium.Cesium3DTileset({url:t,...u});e.readyPromise.then(function(e){function t(e){Cesium.defined(e)&&e.freeResources()}o.freeResources=function(){o.state=0,o.renderable=!1,o.upsampledFromParent=!1,Cesium.defined(o.data)&&Cesium.defined(o.data.freeResources)&&o.data.freeResources(),Cesium.defined(this.data)&&Cesium.defined(this.data.geometryPrimitive)&&18<=o._level&&(this.data.geometryPrimitive.destroy(),this.data.geometryPrimitive=void 0),t(o._southwestChild),o._southwestChild=void 0,t(o._southeastChild),o._southeastChild=void 0,t(o._northwestChild),o._northwestChild=void 0,t(o._northeastChild),o._northeastChild=void 0},r.probj.push(e),r._viewer.scene.primitives.add(e),o.state=Cesium.QuadtreeTileLoadState.LOADING,o.state===Cesium.QuadtreeTileLoadState.LOADING&&(o.data.geometryPrimitive.update(i,[]),o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0)}).otherwise(function(e){null==o.count&&(o.count=0),o.count+=1,2<=o.count?(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0):o.state=Cesium.QuadtreeTileLoadState.START})}o.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,c)},this._primitive=new c._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});a=this._viewer.scene;a.primitives.add(this._primitive),a.primitivesQuadTrees&&a.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id);t={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"modelLayer",item:this,url:t.url,style:n};return this._Provider.treeID=t.id,this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ge.prototype.VectorGeoJsonFeatureLayer=function(e,t,g,i,o,r){var n=this._core.VectorSlice(t,this._cesium),n=new Ae(this._viewer,this._cesium,n),_=this;(this._Provider=n)._loadTile=function(e){var t=new _._cesium.PrimitiveCollection,u=new _._cesium.PointPrimitiveCollection,c=new _._cesium.LabelCollection,h=new _._cesium.BillboardCollection,m=[],d=[],p=-1;return e.features.forEach(function(e){var t,i=[];if(null!=g.lable&&null==e.geometry.coordinates[0][0]&&(o=0,null!=g.lable.height&&/^\[/.test(g.lable.height)&&/\]$/.test(g.lable.height)&&(l=g.lable.height.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[l])),(t=_._core.StyleContrast("lable",g.lable,_._cesium)).fillColor=_._color.VectorColorTransformation(t.fillColor,e),t.outlineColor=_._color.VectorColorTransformation(t.outlineColor,e),t.backgroundColor=_._color.VectorColorTransformation(t.backgroundColor,e),t.text=_._core.Analysis(t.text,e),t.position=new _._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],o),c.add(t)),null!=g.billboard&&null==e.geometry.coordinates[0][0]&&(o=0,null!=(s=g.billboard).height&&/^\[/.test(s.height)&&/\]$/.test(s.height)&&(l=s.height.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[l])),(r=_._core.StyleContrast("billboard",s,_._cesium)).position=new _._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],o),h.add(r)),null!=g.point&&null==e.geometry.coordinates[0][0]&&(o=0,null!=(s=g.point).height&&/^\[/.test(s.height)&&/\]$/.test(s.height)&&(l=s.height.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[l])),(r=_._core.StyleContrast("point",s,_._cesium)).position=new _._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],o),r.color=_._color.VectorColorTransformation(r.color,e),r.outlineColor=_._color.VectorColorTransformation(r.outlineColor,e),u.add(r)),null!=g.polyline){var o=0;null!=(s=g.polyline).height&&/^\[/.test(s.height)&&/\]$/.test(s.height)&&(l=s.height.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[l]));var r=_._core.StyleContrast("polyline",s,_._cesium);if(p=r.classificationType,delete r.classificationType,Array.isArray(e.geometry.coordinates)&&0<e.geometry.coordinates.length)if(Array.isArray(e.geometry.coordinates[0][0]))for(var n=0;n<e.geometry.coordinates.length;n++){i=_._core.coordinate(i=[],e.geometry.coordinates[n]),r.positions=_._cesium.Cartesian3.fromDegreesArray(i);var a=_._core.createPolyline(r,p,e,_._cesium);m.push(a)}else{i=_._core.coordinate(i,e.geometry.coordinates),r.positions=_._cesium.Cartesian3.fromDegreesArray(i);a=_._core.createPolyline(r,p,e,_._cesium);m.push(a)}}if(null!=g.polygon){var s,l,o=0;if(null!=(s=g.polygon).height&&/^\[/.test(s.height)&&/\]$/.test(s.height)&&(l=s.height.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[l])),(r=_._core.StyleContrast("polygon",s,_._cesium)).material=_._color.VectorColorTransformation(r.material,e),p=r.classificationType,delete r.classificationType,Array.isArray(e.geometry.coordinates)&&0<e.geometry.coordinates.length)if(Array.isArray(e.geometry.coordinates[0][0]))for(n=0;n<e.geometry.coordinates.length;n++){i=[],e.geometry.coordinates[n].pop(),i=_._core.coordinate(i,e.geometry.coordinates[n]),r.polygonHierarchy=new _._cesium.PolygonHierarchy(_._cesium.Cartesian3.fromDegreesArray(i));a=_._core.createPolygon(r,p,e,_._cesium);d.push(a)}else{i=_._core.coordinate(i,e.geometry.coordinates),r.polygonHierarchy=new _._cesium.PolygonHierarchy(_._cesium.Cartesian3.fromDegreesArray(i));a=_._core.createPolygon(r,p,e,_._cesium);d.push(a)}}}),t.add(c),t.add(h),t.add(u),0<m.length&&(-1!=p?t.add(new _._cesium.GroundPolylinePrimitive({geometryInstances:m,classificationType:p,appearance:new _._cesium.PolylineMaterialAppearance})):t.add(new _._cesium.Primitive({geometryInstances:m,appearance:new _._cesium.PolylineMaterialAppearance}))),0<d.length&&(-1!=p?t.add(new _._cesium.GroundPrimitive({geometryInstances:d,classificationType:p,appearance:new _._cesium.PerInstanceColorAppearance({translucent:!0,vertexShaderSource:_._core.Shaders("vertexShaderSource"),fragmentShaderSource:_._core.Shaders("fragmentShaderSource")})})):t.add(new _._cesium.Primitive({geometryInstances:d,appearance:new _._cesium.PerInstanceColorAppearance({translucent:!0,vertexShaderSource:_._core.Shaders("vertexShaderSource"),fragmentShaderSource:_._core.Shaders("fragmentShaderSource")})}))),t},this.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(g.id)&&(g.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+g.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:g.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"Vector",item:this,url:t.url,style:g,treeData:{name:e,geoOptions:t,styleOption:g,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ge.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp=function(e,t,i,o,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var m={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var d=t.url+"?"+this._serialize(s.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){!function(u,c,h){if(c.state===Cesium.QuadtreeTileLoadState.START){if(c.data={lines:[],geometryPrimitive:void 0},!(c.level>=i.level_min&&c.level<i.level_max&&h.item.show))return c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0;var e=d.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return c.state=Cesium.QuadtreeTileLoadState.DONE,void(c.renderable=!0);var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function t(){var e,t;/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)&&(e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=parseFloat(a.properties[e])),m.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(t=h._option.material.replace(/\[/,"").replace(/\]/,""),m.material=a.properties[t],h._core.isHtmlColor(m.material)?m.material=h._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=h._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=h._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(h._option.material&&(m.material=h._option.material),m.material&&(h._core.isHtmlColor(m.material)?m.material=h._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=h._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=h._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)))),2<=n.length&&(e=h._cesium.Cartesian3.fromDegreesArray(n),m.polygonHierarchy=new h._cesium.PolygonHierarchy(e),t=new h._cesium.PolygonGeometry(m),e=new h._cesium.GeometryInstance({id:a,geometry:t,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),t="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue,h.Legend.push(t),i.push(e))}h.Legend=[];for(var r=0;r<e.features.length;r++){var n=[],a=e.features[r];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)n=[],a.geometry.coordinates[s].pop(),o(a.geometry.coordinates[s]),t();else o(a.geometry.coordinates),t()}0==i.length&&(c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0);var l=new h._cesium.Primitive({geometryInstances:i,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),shadows:h._option.shadows});c.data.geometryPrimitive=l,c.state=Cesium.QuadtreeTileLoadState.LOADING,c.state===Cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive.update(u,[]),c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0)},error:function(){null==c.count&&(c.count=0),c.count+=1,2<=c.count?(c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0):c.state=Cesium.QuadtreeTileLoadState.START}}),c.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;r={id:m.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i,treeData:{name:e,geoOptions:t,styleOption:i,GroupID:o,checked:r,disFnc:n}};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},Ge.prototype.VolumeVectorGeoJsonFeatureLayerOptimization1ss=function(e,t,l,i,o,r){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(l)||this._core.isnull(l.material)||"["==l.material.toString().charAt(0)&&"]"==l.material.toString().charAt(l.material.length-1)||(this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),this._option=this._core.extend(n,l,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var u=[],m={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},d=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=l.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&d.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>=l.level_min&&t.level<l.level_max&&d.item.show){var o=Ce.filter(u,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)return t.data.geometryPrimitive=new d._cesium.Primitive({geometryInstances:o[0].data,appearance:new d._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:d._cesium.ShadowMode.ENABLED}),t.state=d._cesium.QuadtreeTileLoadState.LOADING,void(t.state===d._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=d._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<d.PrimitiveData.length)for(var r=0;r<d.PrimitiveData.length;r++)if(d.PrimitiveData[r].key==i)return void(d.Primitivekey.includes(i)||d.Primitivekey.push(i));if(!d.Primitivekey.includes(i)){d.Primitivekey.push(i),u.push({level:t.level,x:t.x,y:t.y,data:void 0});for(var o=d._option.level_min+(d._option.level_max-d._option.level_min)/2,n=Be(t,o),r=0;r<n.length;r++){var a=n[r],s="z"+a.level+"x"+a.x+"y"+a.y;d.loadAllKey.includes(s)||(d.loadAllKey.push(s),function(c){var e=d._urlTemplate.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);d.tilesLength++,d._cache&&(e+="&"+d._core.getuid());var h="z"+c.level+"x"+c.x+"y"+c.y;d._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):s.push(e[t])}function t(){var e,t;/^\[/.test(d._option.extrudedHeight)&&/\]$/.test(d._option.extrudedHeight)&&(e=d._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=parseFloat(l.properties[e])),m.material=d._option.material,/^\[/.test(d._option.material)&&/\]$/.test(d._option.material)?(t=d._option.material.replace(/\[/,"").replace(/\]/,""),m.material=l.properties[t],d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(d._option.material&&(m.material=d._option.material),m.material&&(d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)))),2<=s.length&&(e=d._cesium.Cartesian3.fromDegreesArray(s),m.polygonHierarchy=new d._cesium.PolygonHierarchy(e),t=new d._cesium.PolygonGeometry(m),e=new d._cesium.GeometryInstance({id:l,geometry:t,attributes:{color:new d._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),t="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue,d.Legend.push(t),i.push(e))}d.Legend=[];for(var r,n,a=0;a<e.features.length;a++){var s=[],l=e.features[a];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var u=0;u<l.geometry.coordinates.length;u++)s=[],l.geometry.coordinates[u].pop(),o(l.geometry.coordinates[u]),t();else o(l.geometry.coordinates),t()}0<i.length&&(r=new d._cesium.Primitive({geometryInstances:i,appearance:new d._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:d._core.Shaders("vertexShaderSource"),fragmentShaderSource:d._core.Shaders("fragmentShaderSource")}),shadows:d._option.shadows}),n={level:c.level,key:h,data:r},d.probj.push(r),d.loadFinishKey.push(h),d.PrimitiveData.push(n),d._viewer.scene.primitives.add(r),d.returnCount++)},error:function(){},complete:function(e,t){}})}(a))}}}else t.state=d._cesium.QuadtreeTileLoadState.LOADING,t.state===d._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=d._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)}},this._primitive=new d._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});a=this._viewer.scene;a.primitives.add(this._primitive),a.primitivesQuadTrees&&a.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:l,treeData:{name:e,geoOptions:t,styleOption:l,GroupID:i,checked:o,disFnc:r}};this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},Ge.prototype.VolumeVectorGeoJsonFeatureLayerGis=function(e,t,n,i,o,r){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10};t.url,t.layer,t.upperLevelLimit,t.lowerLevelLimit,this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),this._cesium,this._core.isnull(n)||this._core.isnull(n.material)||"["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)||(this._core.isHtmlColor(n.material)?n.material=this._color.colorFromHtmlColor(n.material):(/^rgb/.test(n.material)&&(n.material=this._color.rgbaStringToRgbaObj(n.material)),1<n.material.r&&(n.material.r=n.material.r/255),1<n.material.g&&(n.material.g=n.material.g/255),1<n.material.b&&(n.material.b=n.material.b/255),1<n.material.a&&(n.material.a=n.material.a/255),n.material=this._color.createColor(n.material.r,n.material.g,n.material.b,n.material.a))),this._option=this._core.extend(a,n,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var s=[],l=[],m={id:t.id,polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},d=this;this._urlTemplate=t.url+"/"+window.encodeURIComponent("{z}")+"/"+window.encodeURIComponent("{x}")+"/"+window.encodeURIComponent("{reverseY}")+".json",this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=n.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&d.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>=n.level_min&&t.level<n.level_max&&d.item.show){var o=Ce.filter(s,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)return t.data.geometryPrimitive=new d._cesium.Primitive({geometryInstances:o[0].data,appearance:new d._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:d._cesium.ShadowMode.ENABLED}),t.state=d._cesium.QuadtreeTileLoadState.LOADING,void(t.state===d._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=d._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<d.PrimitiveData.length)for(var r=0;r<d.PrimitiveData.length;r++)if(d.PrimitiveData[r].key==i)return void(d.Primitivekey.includes(i)||d.Primitivekey.push(i));d.Primitivekey.includes(i)||(d.Primitivekey.push(i),s.push({level:t.level,x:t.x,y:t.y,data:void 0}),function(c){var e=c.tilingScheme.getNumberOfYTilesAtLevel(c.level)-c.y-1,t=d._urlTemplate.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{reverseY}"),e).replace(window.encodeURIComponent("{z}"),c.level);d.tilesLength++;var h="z"+c.level+"x"+c.x+"y"+c.y;d._cache&&(t+="&"+d._core.getuid()),0<Ce.filter(l,function(e){return e.url==t}).length||(l.push({url:t}),d._core.xhr({url:t,type:"get",dataType:"json",success:function(e){var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function t(){m.extrudedHeight=parseFloat(d._option.extrudedHeight),/^\[/.test(d._option.extrudedHeight)&&/\]$/.test(d._option.extrudedHeight)&&(t=d._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=3*parseFloat(a.properties[t])),m.material=d._option.material,/^\[/.test(d._option.material)&&/\]$/.test(d._option.material)?(e=d._option.material.replace(/\[/,"").replace(/\]/,""),m.material=a.properties[e],d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(d._option.material&&(m.material=d._option.material),m.material&&(d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))));var e,t=d._cesium.Color.WHITE;2<=n.length&&(e=d._cesium.Cartesian3.fromDegreesArray(n),m.polygonHierarchy=new d._cesium.PolygonHierarchy(e),e=new d._cesium.PolygonGeometry(m),e=new d._cesium.GeometryInstance({id:a,geometry:e,attributes:{color:new d._cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),t="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue,d.Legend.push(t),i.push(e))}d.Legend=[];for(var r=0;r<e.features.length;r++){var n=[],a=e.features[r];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)n=[],a.geometry.coordinates[s].pop(),o(a.geometry.coordinates[s]),t();else o(a.geometry.coordinates),t()}var l=new d._cesium.Primitive({geometryInstances:i,appearance:new d._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:d._core.Shaders("vertexShaderSource"),fragmentShaderSource:d._core.Shaders("fragmentShaderSource")}),shadows:d._option.shadows});d.probj.push(l);var u={level:c.level,key:h,data:l};d.loadFinishKey.push(h),d.PrimitiveData.push(u),d._viewer.scene.primitives.add(l),d.returnCount++;try{2==d.probj.length&&(d._viewer.scene.primitives.remove(d.probj[0]),d.probj.pop())}catch(e){}},error:function(){var e=d.Primitivekey.indexOf(h);-1<e&&d.Primitivekey.splice(e,1),s=Ce.remove(s,function(e){return e.x==c.x&&e.y==c.y&&e.level==c.level})},complete:function(e,t){c.state=d._cesium.QuadtreeTileLoadState.LOADING,c.state===d._cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive&&(c.state=d._cesium.QuadtreeTileLoadState.DONE),c.renderable=!0)}}))}(t))}else t.state=d._cesium.QuadtreeTileLoadState.LOADING,t.state===d._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=d._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)}},this._primitive=new d._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});a=this._viewer.scene;a.primitives.add(this._primitive),a.primitivesQuadTrees&&a.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:n,treeData:{name:e,geoOptions:t,styleOption:n,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ge.prototype.PointVectorGeoJsonFeatureLayerGis=function(e,t,h,i,o,r){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10};this._option=this._core.extend(n,h,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var a=[],n={id:t.id,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,arcType:this._cesium.ArcType.GEODESIC},m=this;this._urlTemplate=t.url+"/{z}/{x}/{reverseY}.json",this._Provider={},this._Provider1=new ke(this._viewer,this._cesium,{url:this._urlTemplate},function(e){if(m.Level=m.getLevel(),m.Level<m._option.level_min){if(0<m.primitve.length){for(var t=0;t<m.primitve.length;t++)m._viewer.scene.primitives.remove(m.primitve[t]);m.primitve=[]}if(0<m.probj.length){for(t=0;t<m.probj.length;t++)m._viewer.scene.primitives.remove(m.probj[t]);m.probj=[]}a=[]}else{var s=new m._cesium.PrimitiveCollection,l=new m._cesium.PointPrimitiveCollection,u=new m._cesium.LabelCollection,c=new m._cesium.BillboardCollection;e.templateValues.z,e.templateValues.x,e.templateValues.reverseY,e.data={lines:[],geometryPrimitive:void 0};var i=e.url.replace("png","json");0<Ce.filter(a,function(e){return e.url==i}).length||1!=m.start&&(a.push({url:i}),m._core.xhr({url:i,type:"get",dataType:"json",success:function(e){if(0!=e.features.length){m.Legend=[];for(var t=0;t<e.features.length;t++){var n=[],a=e.features[t];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var i=0;i<a.geometry.coordinates.length;i++)n=[],a.geometry.coordinates[i].pop(),o(a.geometry.coordinates[i]),r();else o(a.geometry.coordinates),r()}0<u.length&&s.add(u),0<c.length&&s.add(c),0<l.length&&s.add(l),m.primitve.push(s),m.probj.push(s),m._viewer.scene.primitives.add(s),m.returnCount++;try{2==m.probj.length&&(m._viewer.scene.primitives.remove(m.probj[0]),m.probj.pop())}catch(e){}}function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function r(){var e,t,i,o,r;null!=h.lable&&(t=0,null!=h.lable.height&&/^\[/.test(h.lable.height)&&/\]$/.test(h.lable.height)&&(o=h.lable.height.replace(/\[/,"").replace(/\]/,""),t=parseFloat(a.properties[o])),(e=m._core.StyleContrast("lable",h.lable,m._cesium)).fillColor=m._color.VectorColorTransformation(e.fillColor,a),e.outlineColor=m._color.VectorColorTransformation(e.outlineColor,a),e.backgroundColor=m._color.VectorColorTransformation(e.backgroundColor,a),e.text=m._core.Analysis(e.text,a),e.position=new m._cesium.Cartesian3.fromDegrees(n[0],n[1],t),u.add(e)),null!=h.billboard&&(t=0,null!=(i=h.billboard).height&&/^\[/.test(i.height)&&/\]$/.test(i.height)&&(o=i.height.replace(/\[/,"").replace(/\]/,""),t=parseFloat(a.properties[o])),(r=m._core.StyleContrast("billboard",i,m._cesium)).position=new m._cesium.Cartesian3.fromDegrees(n[0],n[1],t),c.add(r)),null!=h.point&&(t=0,null!=(i=h.point).height&&/^\[/.test(i.height)&&/\]$/.test(i.height)&&(o=i.height.replace(/\[/,"").replace(/\]/,""),t=parseFloat(a.properties[o])),(r=m._core.StyleContrast("point",i,m._cesium)).position=new m._cesium.Cartesian3.fromDegrees(n[0],n[1],t),r.color=m._color.VectorColorTransformation(r.color,a),r.outlineColor=m._color.VectorColorTransformation(r.outlineColor,a),l.add(r))}}}))}}),this.img=this._Provider1.ent,o||this.setVisibility(!1),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+n.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:h,treeData:{name:e,geoOptions:t,styleOption:h,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ge.prototype.PolylineVectorGeoJsonFeatureLayerGis=function(e,t,c,i,o,r){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10};this._option=this._core.extend(n,c,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var a=[],n={id:t.id,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,arcType:this._cesium.ArcType.GEODESIC},h=this;this._urlTemplate=t.url+"/{z}/{x}/{reverseY}.json",this._Provider={},this._Provider1=new ke(this._viewer,this._cesium,{url:this._urlTemplate},function(e){if(h.Level=h.getLevel(),h.Level<h._option.level_min){if(0<h.primitve.length){for(var t=0;t<h.primitve.length;t++)h._viewer.scene.primitives.remove(h.primitve[t]);h.primitve=[]}if(0<h.probj.length){for(t=0;t<h.probj.length;t++)h._viewer.scene.primitives.remove(h.probj[t]);h.probj=[]}a=[]}else{var u=-1;e.templateValues.z,e.templateValues.x,e.templateValues.reverseY,e.data={lines:[],geometryPrimitive:void 0};var i=e.url.replace("png","json");0<Ce.filter(a,function(e){return e.url==i}).length||1!=h.start&&(a.push({url:i}),h._core.xhr({url:i,type:"get",dataType:"json",success:function(e){if(0!=e.features.length){var o=[];h.Legend=[];for(var t=0;t<e.features.length;t++){var r=[],n=e.features[t];if(Array.isArray(n.geometry.coordinates)&&0<n.geometry.coordinates.length)if(Array.isArray(n.geometry.coordinates[0][0]))for(var i=0;i<n.geometry.coordinates.length;i++)r=[],n.geometry.coordinates[i].pop(),s(n.geometry.coordinates[i]),l();else s(n.geometry.coordinates),l()}var a=new h._cesium.Primitive({geometryInstances:o,appearance:new h._cesium.PolylineColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:h._option.shadows,classificationType:u});h.probj.push(a),h.primitve.push(a),h._viewer.scene.primitives.add(a),h.returnCount++;try{2==h.probj.length&&(h._viewer.scene.primitives.remove(h.probj[0]),h.probj.pop())}catch(e){}}function s(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?s(e[t]):r.push(e[t])}function l(){var e,t=c;null!=t.height&&/^\[/.test(t.height)&&/\]$/.test(t.height)&&(e=t.height.replace(/\[/,"").replace(/\]/,""),parseFloat(n.properties[e]));var i,t=h._core.StyleContrast("polyline",t,h._cesium);u=t.classificationType,delete t.classificationType,t.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(i=h._option.material.replace(/\[/,"").replace(/\]/,""),t.material=n.properties[i],h._core.isHtmlColor(t.material)?t.material=h._color.colorFromHtmlColor(t.material):(/^rgb/.test(t.material)&&(t.material=h._color.rgbaStringToRgbaObj(t.material)),1<t.material.red&&(t.material.red=t.material.red/255),1<t.material.green&&(t.material.green=t.material.green/255),1<t.material.blue&&(t.material.blue=t.material.blue/255),1<t.material.alpha&&(t.material.a=t.material.alpha/255),t.material=h._color.createColor(t.material.red,t.material.green,t.material.blue,t.material.alpha))):(h._option.material&&(t.material=h._option.material),t.material&&(h._core.isHtmlColor(t.material)?t.material=h._color.colorFromHtmlColor(t.material):(/^rgb/.test(t.material)&&(t.material=h._color.rgbaStringToRgbaObj(t.material)),1<t.material.red&&(t.material.red=t.material.red/255),1<t.material.green&&(t.material.green=t.material.green/255),1<t.material.blue&&(t.material.blue=t.material.blue/255),1<t.material.alpha&&(t.material.a=t.material.alpha/255),t.material=h._color.createColor(t.material.red,t.material.green,t.material.blue,t.material.alpha)))),2<=r.length&&(t.positions=h._cesium.Cartesian3.fromDegreesArray(r),i=new h._cesium.GeometryInstance({id:n,geometry:new h._cesium.PolylineGeometry(t),attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(t.material)}}),t="material:"+255*t.material.red+","+255*t.material.green+","+255*t.material.blue,h.Legend.push(t),o.push(i))}}}))}}),this.img=this._Provider1.ent,o||this.setVisibility(!1),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+n.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:c,treeData:{name:e,geoOptions:t,styleOption:c,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ge.prototype.VolumeVectorGeoJsonFeatureLayerGisOptimization=function(e,t,i,o,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10};t.url,t.layer,t.upperLevelLimit,t.lowerLevelLimit,this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),this._cesium,this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var s=[],u={id:t.id,polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},c=this;this._urlTemplate=t.url+"/{z}/{x}/{reverseY}.json",this._Provider={},this._Provider1=new ke(this._viewer,this._cesium,{url:this._urlTemplate},function(e){if(c.Level=c.getLevel(),c.Level<c._option.level_min){if(0<c.primitve.length){for(var t=0;t<c.primitve.length;t++)c._viewer.scene.primitives.remove(c.primitve[t]);c.primitve=[]}if(0<c.probj.length){for(t=0;t<c.probj.length;t++)c._viewer.scene.primitives.remove(c.probj[t]);c.probj=[]}s=[]}else{e.templateValues.z,e.templateValues.x,e.templateValues.reverseY,e.data={lines:[],geometryPrimitive:void 0};var i=e.url.replace("png","json");0<Ce.filter(s,function(e){return e.url==i}).length||1!=c.start&&(s.push({url:i}),c._core.xhr({url:i,type:"get",dataType:"json",success:function(e){if(0!=e.features.length){var i=[];c.Legend=[];for(var t=0;t<e.features.length;t++){var o=[],r=e.features[t];if(Array.isArray(r.geometry.coordinates)&&0<r.geometry.coordinates.length)if(Array.isArray(r.geometry.coordinates[0][0]))for(var n=0;n<r.geometry.coordinates.length;n++)o=[],r.geometry.coordinates[n].pop(),s(r.geometry.coordinates[n]),l();else s(r.geometry.coordinates),l()}var a=new c._cesium.Primitive({geometryInstances:i,appearance:new c._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:c._core.Shaders("vertexShaderSource"),fragmentShaderSource:c._core.Shaders("fragmentShaderSource")}),shadows:c._option.shadows});c.primitve.push(a),c.probj.push(a),c._viewer.scene.primitives.add(a),c.returnCount++;try{2==c.probj.length&&(c._viewer.scene.primitives.remove(c.probj[0]),c.probj.pop())}catch(e){}}function s(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?s(e[t]):o.push(e[t])}function l(){var e,t;u.extrudedHeight=c._option.extrudedHeight,/^\[/.test(c._option.extrudedHeight)&&/\]$/.test(c._option.extrudedHeight)&&(e=c._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),u.extrudedHeight=3*parseFloat(r.properties[e])),u.material=c._option.material,/^\[/.test(c._option.material)&&/\]$/.test(c._option.material)?(t=c._option.material.replace(/\[/,"").replace(/\]/,""),u.material=r.properties[t],c._core.isHtmlColor(u.material)?u.material=c._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=c._color.rgbaStringToRgbaObj(u.material)),1<u.material.red&&(u.material.red=u.material.red/255),1<u.material.green&&(u.material.green=u.material.green/255),1<u.material.blue&&(u.material.blue=u.material.blue/255),1<u.material.alpha&&(u.material.a=u.material.alpha/255),u.material=c._color.createColor(u.material.red,u.material.green,u.material.blue,u.material.alpha))):(c._option.material&&(u.material=c._option.material),u.material&&(c._core.isHtmlColor(u.material)?u.material=c._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=c._color.rgbaStringToRgbaObj(u.material)),1<u.material.red&&(u.material.red=u.material.red/255),1<u.material.green&&(u.material.green=u.material.green/255),1<u.material.blue&&(u.material.blue=u.material.blue/255),1<u.material.alpha&&(u.material.a=u.material.alpha/255),u.material=c._color.createColor(u.material.red,u.material.green,u.material.blue,u.material.alpha)))),2<=o.length&&(t=c._cesium.Cartesian3.fromDegreesArray(o),u.polygonHierarchy=new c._cesium.PolygonHierarchy(t),t=new c._cesium.PolygonGeometry(u),t=new c._cesium.GeometryInstance({id:r,geometry:t,attributes:{color:new c._cesium.ColorGeometryInstanceAttribute.fromColor(u.material)}}),u.material.red,u.material.green,u.material.blue,i.push(t))}}}))}}),this.img=this._Provider1.ent,r||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;r={id:u.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i,treeData:{name:e,geoOptions:t,styleOption:i,GroupID:o,checked:r,disFnc:n}};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},Ge.prototype.VolumeVectorGeoJsonFeatureLayerClassOptimization=function(e,t,m,i,o,r){var n={polygonHierarchy:void 0,height:0,extrudedHeight:999999,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(m)||this._core.isnull(m.material)||"["==m.material.toString().charAt(0)&&"]"==m.material.toString().charAt(m.material.length-1)||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),1<m.material.r&&(m.material.r=m.material.r/255),1<m.material.g&&(m.material.g=m.material.g/255),1<m.material.b&&(m.material.b=m.material.b/255),1<m.material.a&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)));var d=this._core.extend(n,m,!0);null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var s=[],p=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&p.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>=m.level_min&&t.level<m.level_max&&p.item.show){var o=Ce.filter(s,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)return t.data.geometryPrimitive=new p._cesium.Primitive({geometryInstances:o[0].data,appearance:new p._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:p._cesium.ShadowMode.ENABLED}),t.state=p._cesium.QuadtreeTileLoadState.LOADING,void(t.state===p._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=p._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<p.PrimitiveData.length)for(var r=0;r<p.PrimitiveData.length;r++)if(p.PrimitiveData[r].key==i)return void p.Primitivekey.push(i);p.Primitivekey.includes(i)||(p.Primitivekey.push(i),s.push({level:t.level,x:t.x,y:t.y,data:void 0}),h=t,o=p._urlTemplate.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.y).replace(window.encodeURIComponent("{z}"),h.level),p.tilesLength++,p._cache&&(o+="&"+p._core.getuid()),p._core.xhr({url:o,type:"get",dataType:"json",success:function(e){var o=[];function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):(n.push(e[t]),2!==t||a||(a=!0))}function t(){var e,t=a?p._cesium.Cartesian3.fromDegreesArrayHeights(n):p._cesium.Cartesian3.fromDegreesArray(n);/^\[/.test(m.extrudedHeight)&&/\]$/.test(m.extrudedHeight)&&(e=m.extrudedHeight.replace(/\[/,"").replace(/\]/,""),d.extrudedHeight=parseFloat(s.properties[e])),d.extrudedHeight=parseFloat(d.extrudedHeight),1==d.heightReference&&delete d.height,1==d.extrudedHeightReference&&delete d.extrudedHeight,/^\[/.test(m.material)&&/\]$/.test(m.material)&&(i=m.material.replace(/\[/,"").replace(/\]/,""),d.material=s.properties[i],p._core.isHtmlColor(d.material)?d.material=p._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=p._color.rgbaStringToRgbaObj(d.material)),1<d.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=p._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a))),d.polygonHierarchy=new p._cesium.PolygonHierarchy(t);var i=new p._cesium.PolygonGeometry(d);s.treeID=d.id,s.VectorType="polygon",s.VectorStyle={haveZ:a,extrudedHeight:d.extrudedHeight,positions:n,material:d.material};t=new p._cesium.GeometryInstance({id:s,geometry:i,attributes:{color:new p._cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}}),i="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;p.Legend.push(i),o.push(t)}p.Legend=[];for(var r=0;r<e.features.length;r++){var n=[],a=!1,s=e.features[r];if(Array.isArray(s.geometry.coordinates)&&0<s.geometry.coordinates.length)if(Array.isArray(s.geometry.coordinates[0][0]))for(var l=0;l<s.geometry.coordinates.length;l++)n=[],s.geometry.coordinates[l].pop(),i(s.geometry.coordinates[l]),t();else i(s.geometry.coordinates),t()}var u=new p._cesium.ClassificationPrimitive({geometryInstances:o,appearance:new p._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:p._core.Shaders("vertexShaderSource"),fragmentShaderSource:p._core.Shaders("fragmentShaderSource")}),classificationType:d.classificationType,shadows:p._cesium.ShadowMode.ENABLED});p.PrimitiveObj.data=u,p.PrimitiveObj.key=p.Primitivekey[p.returnCount];var c={level:h.level,key:p.Primitivekey[p.returnCount],data:u};p.loadFinishKey.push(p.Primitivekey[p.returnCount]),p.PrimitiveData.push(c),p._viewer.scene.primitives.add(u),p.returnCount++,p.returnCount>=p.tilesLength&&(p.returnCount=0,p.tilesLength=0,p.Primitivekey=[])},error:function(){s=Ce.remove(s,function(e){return e.x==h.x&&e.y==h.y&&e.level==h.level})},complete:function(e,t){h.state=p._cesium.QuadtreeTileLoadState.LOADING,h.state===p._cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive&&(h.state=p._cesium.QuadtreeTileLoadState.DONE),h.renderable=!0)}}))}else t.state=p._cesium.QuadtreeTileLoadState.LOADING,t.state===p._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=p._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)}var h},this._primitive=new p._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});n=this._viewer.scene,a=n.primitives;m&&m.time&&(this._Provider._availability=new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({start:m.time.start?p._cesium.JulianDate.fromDate(new Date(m.time.start)):p._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?p._cesium.JulianDate.fromDate(new Date(m.time.end)):p._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),a.add(this._primitive),n.primitivesQuadTrees&&n.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:d.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:m,treeData:{name:e,geoOptions:t,styleOption:m,GroupID:i,checked:o,disFnc:r}};return this._Provider.treeID=d.id,this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ge.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization2=function(e,t,i,o,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var h={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var m=t.url+"?"+this._serialize(s.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){!function(l,u,c){if(u.state===Cesium.QuadtreeTileLoadState.START){if(u.data={lines:[],geometryPrimitive:void 0},!(u.level>=i.level_min&&u.level<i.level_max&&c.item.show))return u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0;var e=m.replace(window.encodeURIComponent("{x}"),u.x).replace(window.encodeURIComponent("{y}"),u.y).replace(window.encodeURIComponent("{z}"),u.level);c._cache&&(e+="&"+c._core.getuid()),c._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return u.state=Cesium.QuadtreeTileLoadState.DONE,void(u.renderable=!0);var i=new c._cesium.PrimitiveCollection;function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function t(){var e,t;c._option.extrudedHeight&&(h.extrudedHeight=c._option.extrudedHeight),/^\[/.test(c._option.extrudedHeight)&&/\]$/.test(c._option.extrudedHeight)&&(t=c._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),h.extrudedHeight=parseFloat(a.properties[t])),h.material=c._option.material,/^\[/.test(c._option.material)&&/\]$/.test(c._option.material)?(e=c._option.material.replace(/\[/,"").replace(/\]/,""),h.material=a.properties[e],c._core.isHtmlColor(h.material)?h.material=c._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=c._color.rgbaStringToRgbaObj(h.material)),1<h.material.red&&(h.material.red=h.material.red/255),1<h.material.green&&(h.material.green=h.material.green/255),1<h.material.blue&&(h.material.blue=h.material.blue/255),1<h.material.alpha&&(h.material.a=h.material.alpha/255),h.material=c._color.createColor(h.material.red,h.material.green,h.material.blue,h.material.alpha))):(c._option.material&&(h.material=c._option.material),h.material&&(c._core.isHtmlColor(h.material)?h.material=c._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=c._color.rgbaStringToRgbaObj(h.material)),1<h.material.red&&(h.material.red=h.material.red/255),1<h.material.green&&(h.material.green=h.material.green/255),1<h.material.blue&&(h.material.blue=h.material.blue/255),1<h.material.alpha&&(h.material.a=h.material.alpha/255),h.material=c._color.createColor(h.material.red,h.material.green,h.material.blue,h.material.alpha)))),2<=n.length&&(t=c._cesium.Cartesian3.fromDegreesArray(n),h.polygonHierarchy=new c._cesium.PolygonHierarchy(t),e=new c._cesium.PolygonGeometry(h),t=new c._cesium.GeometryInstance({id:a,geometry:e,attributes:{color:new c._cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}}),e=new c._cesium.ClassificationPrimitive({geometryInstances:t,appearance:new c._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:c._core.Shaders("vertexShaderSource"),fragmentShaderSource:c._core.Shaders("fragmentShaderSource")}),classificationType:c._option.classificationType}),t="material:"+255*h.material.red+","+255*h.material.green+","+255*h.material.blue,c.Legend.push(t),i.add(e))}c.Legend=[];for(var r=0;r<e.features.length;r++){var n=[],a=e.features[r];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)n=[],a.geometry.coordinates[s].pop(),o(a.geometry.coordinates[s]),t();else o(a.geometry.coordinates),t()}u.data.geometryPrimitive=i,u.state=Cesium.QuadtreeTileLoadState.LOADING,u.state===Cesium.QuadtreeTileLoadState.LOADING&&(u.data.geometryPrimitive.update(l,[]),u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0)},error:function(){null==u.count&&(u.count=0),u.count+=1,2<=u.count?(u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0):u.state=Cesium.QuadtreeTileLoadState.START}}),u.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;r={id:h.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i,treeData:{name:e,geoOptions:t,styleOption:i,GroupID:o,checked:r,disFnc:n}};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},Ge.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization3=function(e,t,i,o,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var m={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var d=t.url+"?"+this._serialize(s.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){!function(u,c,h){if(c.state===Cesium.QuadtreeTileLoadState.START){if(c.data={lines:[],geometryPrimitive:void 0},!(c.level>=i.level_min&&c.level<i.level_max&&h.item.show))return c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0;var e=d.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return c.state=Cesium.QuadtreeTileLoadState.DONE,void(c.renderable=!0);new h._cesium.PrimitiveCollection,h.Legend=[];var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function t(){var e,t;h._option.extrudedHeight&&(m.extrudedHeight=h._option.extrudedHeight),/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)&&(e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=parseFloat(a.properties[e])),m.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(t=h._option.material.replace(/\[/,"").replace(/\]/,""),m.material=a.properties[t],h._core.isHtmlColor(m.material)?m.material=h._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=h._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=h._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(h._option.material&&(m.material=h._option.material),m.material&&(h._core.isHtmlColor(m.material)?m.material=h._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=h._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=h._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)))),2<=n.length&&(t=h._cesium.Cartesian3.fromDegreesArray(n),m.polygonHierarchy=new h._cesium.PolygonHierarchy(t),t=new h._cesium.PolygonGeometry(m),t=new h._cesium.GeometryInstance({id:a,geometry:t,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),i.push(t))}for(var r=0;r<e.features.length;r++){var n=[],a=e.features[r];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)n=[],a.geometry.coordinates[s].pop(),o(a.geometry.coordinates[s]),t();else o(a.geometry.coordinates),t()}var l=new h._cesium.ClassificationPrimitive1({geometryInstances:i,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),classificationType:h._option.classificationType});c.data.geometryPrimitive=l,c.state=Cesium.QuadtreeTileLoadState.LOADING,c.state===Cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive.update(u,[]),c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0)},error:function(){null==c.count&&(c.count=0),c.count+=1,2<=c.count?(c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0):c.state=Cesium.QuadtreeTileLoadState.START}}),c.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;r={id:m.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i,treeData:{name:e,geoOptions:t,styleOption:i,GroupID:o,checked:r,disFnc:n}};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},Ge.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization=function(e,t,n,i,o,r){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(n)||this._core.isnull(n.material)||"["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)||(this._core.isHtmlColor(n.material)?n.material=this._color.colorFromHtmlColor(n.material):(/^rgb/.test(n.material)&&(n.material=this._color.rgbaStringToRgbaObj(n.material)),1<n.material.r&&(n.material.r=n.material.r/255),1<n.material.g&&(n.material.g=n.material.g/255),1<n.material.b&&(n.material.b=n.material.b/255),1<n.material.a&&(n.material.a=n.material.a/255),n.material=this._color.createColor(n.material.r,n.material.g,n.material.b,n.material.a))),this._option=this._core.extend(a,n,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var l=[],m={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},d=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=n.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&d.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>=n.level_min&&t.level<n.level_max&&d.item.show){var o=Ce.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)return t.data.geometryPrimitive=new d._cesium.Primitive({geometryInstances:o[0].data,appearance:new d._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:d._cesium.ShadowMode.ENABLED}),t.state=d._cesium.QuadtreeTileLoadState.LOADING,void(t.state===d._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=d._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<d.PrimitiveData.length)for(var r=0;r<d.PrimitiveData.length;r++)if(d.PrimitiveData[r].key==i)return void(d.Primitivekey.includes(i)||d.Primitivekey.push(i));d.Primitivekey.includes(i)||(d.Primitivekey.push(i),l.push({level:t.level,x:t.x,y:t.y,data:void 0}),function(c){var e=d._urlTemplate.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);d.tilesLength++;var h="z"+c.level+"x"+c.x+"y"+c.y;d._cache&&(e+="&"+d._core.getuid()),d._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var i=new d._cesium.PrimitiveCollection;function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function t(){var e,t;d._option.extrudedHeight&&(m.extrudedHeight=d._option.extrudedHeight),/^\[/.test(d._option.extrudedHeight)&&/\]$/.test(d._option.extrudedHeight)&&(t=d._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=parseFloat(a.properties[t])),m.material=d._option.material,/^\[/.test(d._option.material)&&/\]$/.test(d._option.material)?(e=d._option.material.replace(/\[/,"").replace(/\]/,""),m.material=a.properties[e],d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(d._option.material&&(m.material=d._option.material),m.material&&(d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)))),2<=n.length&&(t=d._cesium.Cartesian3.fromDegreesArray(n),m.polygonHierarchy=new d._cesium.PolygonHierarchy(t),e=new d._cesium.PolygonGeometry(m),t=new d._cesium.GeometryInstance({id:a,geometry:e,attributes:{color:new d._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),e=new d._cesium.ClassificationPrimitive({geometryInstances:t,appearance:new d._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:d._core.Shaders("vertexShaderSource"),fragmentShaderSource:d._core.Shaders("fragmentShaderSource")}),classificationType:d._option.classificationType}),t="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue,d.Legend.push(t),i.add(e))}d.Legend=[];for(var r=0;r<e.features.length;r++){var n=[],a=e.features[r];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)n=[],a.geometry.coordinates[s].pop(),o(a.geometry.coordinates[s]),t();else o(a.geometry.coordinates),t()}var l=i;d.probj.push(l);var u={level:c.level,key:h,data:l};d.loadFinishKey.push(h),d.PrimitiveData.push(u),d._viewer.scene.primitives.add(l),d.returnCount++,d.removeObsoletePrimitives(c)},error:function(){var e=d.Primitivekey.indexOf(h);-1<e&&d.Primitivekey.splice(e,1),l=Ce.remove(l,function(e){return e.x==c.x&&e.y==c.y&&e.level==c.level})},complete:function(e,t){c.state=d._cesium.QuadtreeTileLoadState.LOADING,c.state===d._cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive&&(c.state=d._cesium.QuadtreeTileLoadState.DONE),c.renderable=!0)}})}(t))}else t.state=d._cesium.QuadtreeTileLoadState.LOADING,t.state===d._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=d._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)}},this._primitive=new d._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:n,treeData:{name:e,geoOptions:t,styleOption:n,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ge.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization1=function(e,t,l,i,o,r){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(l)||this._core.isnull(l.material)||"["==l.material.toString().charAt(0)&&"]"==l.material.toString().charAt(l.material.length-1)||(this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),this._option=this._core.extend(n,l,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var u=[],m={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},d=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=l.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&d.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>=l.level_min&&t.level<l.level_max&&d.item.show){var o=Ce.filter(u,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)return t.data.geometryPrimitive=new d._cesium.Primitive({geometryInstances:o[0].data,appearance:new d._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:d._cesium.ShadowMode.ENABLED}),t.state=d._cesium.QuadtreeTileLoadState.LOADING,void(t.state===d._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=d._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<d.PrimitiveData.length)for(var r=0;r<d.PrimitiveData.length;r++)if(d.PrimitiveData[r].key==i)return void(d.Primitivekey.includes(i)||d.Primitivekey.push(i));if(!d.Primitivekey.includes(i)){d.Primitivekey.push(i),u.push({level:t.level,x:t.x,y:t.y,data:void 0});for(var o=d._option.level_min+Math.floor((d._option.level_max-d._option.level_min)/2),n=Be(t,o),r=0;r<n.length;r++){var a=n[r],s="z"+a.level+"x"+a.x+"y"+a.y;d.loadAllKey.includes(s)||(d.loadAllKey.push(s),function(c){var e=d._urlTemplate.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);d.tilesLength++;var h="z"+c.level+"x"+c.x+"y"+c.y;d._cache&&(e+="&"+d._core.getuid()),d._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):s.push(e[t])}function t(){var e,t;d._option.extrudedHeight&&(m.extrudedHeight=d._option.extrudedHeight),/^\[/.test(d._option.extrudedHeight)&&/\]$/.test(d._option.extrudedHeight)&&(e=d._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=parseFloat(l.properties[e])),m.material=d._option.material,/^\[/.test(d._option.material)&&/\]$/.test(d._option.material)?(t=d._option.material.replace(/\[/,"").replace(/\]/,""),m.material=l.properties[t],d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(d._option.material&&(m.material=d._option.material),m.material&&(d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)))),2<=s.length&&(e=d._cesium.Cartesian3.fromDegreesArray(s),m.polygonHierarchy=new d._cesium.PolygonHierarchy(e),t=new d._cesium.PolygonGeometry(m),e=new d._cesium.GeometryInstance({id:l,geometry:t,attributes:{color:new d._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),t="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue,d.Legend.push(t),i.push(e))}d.Legend=[];for(var r,n,a=0;a<e.features.length;a++){var s=[],l=e.features[a];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var u=0;u<l.geometry.coordinates.length;u++)s=[],l.geometry.coordinates[u].pop(),o(l.geometry.coordinates[u]),t();else o(l.geometry.coordinates),t()}0<i.length&&(r=new d._cesium.GroundPrimitive({geometryInstances:i,appearance:new d._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:d._core.Shaders("vertexShaderSource"),fragmentShaderSource:d._core.Shaders("fragmentShaderSource")}),classificationType:d._option.classificationType,show:d.item.show}),d.probj.push(r),n={level:c.level,key:h,data:r},d.loadFinishKey.push(h),d.PrimitiveData.push(n),d._viewer.scene.primitives.add(r),d.returnCount++)},error:function(){},complete:function(e,t){}})}(a))}}}else t.state=d._cesium.QuadtreeTileLoadState.LOADING,t.state===d._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=d._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)}},this._primitive=new d._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});a=this._viewer.scene;a.primitives.add(this._primitive),a.primitivesQuadTrees&&a.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:l,treeData:{name:e,geoOptions:t,styleOption:l,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ge.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization2=function(e,t,i,o,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var m={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var d=t.url+"?"+this._serialize(s.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){!function(u,c,h){if(c.state===Cesium.QuadtreeTileLoadState.START){if(c.data={lines:[],geometryPrimitive:void 0},!(c.level>=i.level_min&&c.level<i.level_max&&h.item.show))return c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0;var e=d.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return c.state=Cesium.QuadtreeTileLoadState.DONE,void(c.renderable=!0);var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function t(){var e,t;h._option.extrudedHeight&&(m.extrudedHeight=h._option.extrudedHeight),/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)&&(e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=parseFloat(a.properties[e])),m.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(t=h._option.material.replace(/\[/,"").replace(/\]/,""),m.material=a.properties[t],h._core.isHtmlColor(m.material)?m.material=h._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=h._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=h._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(h._option.material&&(m.material=h._option.material),m.material&&(h._core.isHtmlColor(m.material)?m.material=h._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=h._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=h._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)))),2<=n.length&&(e=h._cesium.Cartesian3.fromDegreesArray(n),m.polygonHierarchy=new h._cesium.PolygonHierarchy(e),t=new h._cesium.PolygonGeometry(m),e=new h._cesium.GeometryInstance({id:a,geometry:t,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),t="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue,h.Legend.push(t),i.push(e))}h.Legend=[];for(var r=0;r<e.features.length;r++){var n=[],a=e.features[r];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)n=[],a.geometry.coordinates[s].pop(),o(a.geometry.coordinates[s]),t();else o(a.geometry.coordinates),t()}0==i.length&&(c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0);var l=new h._cesium.GroundPrimitive1({geometryInstances:i,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),classificationType:h._option.classificationType});c.data.geometryPrimitive=l,c.state=Cesium.QuadtreeTileLoadState.LOADING,c.state===Cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive.update1(u,[]),c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0)},error:function(){c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0}}),c.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;r={id:m.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i,treeData:{name:e,geoOptions:t,styleOption:i,GroupID:o,checked:r,disFnc:n}};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},Ge.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization3=function(e,t,i,o,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var d={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);var u=t.url+"?"+this._serialize(s.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){!function(c,h,m){if(h.state===Cesium.QuadtreeTileLoadState.START){if(h.data={lines:[],geometryPrimitive:void 0},!(h.level>=i.level_min&&h.level<i.level_max&&m.item.show))return h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0;var e=u.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.y).replace(window.encodeURIComponent("{z}"),h.level);m._cache&&(e+="&"+m._core.getuid()),m._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var i=["#ffff00","#ffcc00","#ff3300","#ccff00","#cccc00","#99ff66","#999933","#66cc99","#6633ff","#33ffff","#3399cc","#009933","#ccccff","#ff99ff","#9966ff","#336699"];if(null==e)return h.state=Cesium.QuadtreeTileLoadState.DONE,void(h.renderable=!0);var o=[];function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):a.push(e[t])}function t(){var e,t;m._option.extrudedHeight&&(d.extrudedHeight=m._option.extrudedHeight),/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)&&(t=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),d.extrudedHeight=parseFloat(s.properties[t])),d.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)?(e=m._option.material.replace(/\[/,"").replace(/\]/,""),d.material=s.properties[e],m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))):(m._option.material&&(d.material=m._option.material),d.material&&(m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)))),2<=a.length&&(t=m._cesium.Cartesian3.fromDegreesArray(a),d.polygonHierarchy=new m._cesium.PolygonHierarchy(t),0!=d.extrudedHeight&&"0"!=d.extrudedHeight&&null!=d.extrudedHeight&&null!=d.extrudedHeight||(d.extrudedHeight=1e4),e=new m._cesium.PolygonGeometry(d),t=i[Math.floor(Math.random()*i.length)],e=new m._cesium.GeometryInstance({id:s,geometry:e,attributes:{color:m._cesium.ColorGeometryInstanceAttribute.fromColor(m._cesium.Color.fromCssColorString(t).withAlpha(.5))}}),t="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue,m.Legend.push(t),o.push(e))}m.Legend=[];for(var n=0;n<e.features.length;n++){var a=[],s=e.features[n];if(Array.isArray(s.geometry.coordinates)&&0<s.geometry.coordinates.length)if(Array.isArray(s.geometry.coordinates[0][0]))for(var l=0;l<s.geometry.coordinates.length;l++)a=[],s.geometry.coordinates[l].pop(),r(s.geometry.coordinates[l]),t();else r(s.geometry.coordinates),t()}0==o.length&&(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0);var u=new m._cesium.ClassificationPrimitive1({geometryInstances:o,classificationType:m._cesium.ClassificationType.BOTH});h.data.geometryPrimitive=u,h.state=Cesium.QuadtreeTileLoadState.LOADING,h.state===Cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive.update(c,[]),h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0)},error:function(){h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0}}),h.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;r={id:d.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i,treeData:{name:e,geoOptions:t,styleOption:i,GroupID:o,checked:r,disFnc:n}};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},Ge.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,a,i,o,r){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};(s=this)._core.isnull(a)||s._core.isnull(a.color)||/^\[/.test(a.color)&&"["==a.color.toString().charAt(0)&&"]"==a.color.toString().charAt(a.color.length-1)||(s._core.isHtmlColor(a.color)?a.color=s._color.colorFromHtmlColor(a.color):(/^rgb/.test(a.color)&&(a.color=s._color.rgbaStringToRgbaObj(a.color)),1<a.color.r&&(a.color.r=a.color.r/255),1<a.color.g&&(a.color.g=a.color.g/255),1<a.color.b&&(a.color.b=a.color.b/255),1<a.color.a&&(a.color.a=a.color.a/255),a.color=s._color.createColor(a.color.r,a.color.g,a.color.b,a.color.a))),s._core.isnull(a)||s._core.isnull(a.outlineColor)||/^\[/.test(a.outlineColor)&&"["==a.outlineColor.toString().charAt(0)&&"]"==a.outlineColor.toString().charAt(a.outlineColor.length-1)||(s._core.isHtmlColor(a.outlineColor)?a.outlineColor=s._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=s._color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=s._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a)));var s=this;this._urlTemplate=t.url+"?"+this._serialize(n.urlParams);var l=t.url+"?"+this._serialize(n.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=a.level_max-1;var u={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:s._cesium.LabelStyle.OUTLINE,fillColor:s._cesium.Color.WHITE,outlineColor:s._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new s._cesium.Color(.165,.165,.165,.8),backgroundPadding:new s._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:s._cesium.HorizontalOrigin.CENTER,verticalOrigin:s._cesium.VerticalOrigin.CENTER,eyeOffset:s._cesium.Cartesian3.ZERO,pixelOffset:s._cesium.Cartesian2.ZERO,heightReference:s._cesium.HeightReference.NONE,scaleByDistance:new s._cesium.NearFarScalar(0,0,1,1)};s._core.isnull(a)||s._core.isnull(a.backgroundColor)||/^\[/.test(a.backgroundColor)&&"["==a.backgroundColor.toString().charAt(0)&&"]"==a.backgroundColor.toString().charAt(a.backgroundColor.length-1)||(s._core.isHtmlColor(a.backgroundColor)?a.backgroundColor=s._color.colorFromHtmlColor(a.backgroundColor):(/^rgb/.test(a.backgroundColor)&&(a.backgroundColor=s._color.rgbaStringToRgbaObj(a.backgroundColor)),1<a.backgroundColor.r&&(a.backgroundColor.r=a.backgroundColor.r/255),1<a.backgroundColor.g&&(a.backgroundColor.g=a.backgroundColor.g/255),1<a.backgroundColor.b&&(a.backgroundColor.b=a.backgroundColor.b/255),1<a.backgroundColor.a&&(a.backgroundColor.a=a.backgroundColor.a/255),a.backgroundColor=s._color.createColor(a.backgroundColor.r,a.backgroundColor.g,a.backgroundColor.b,a.backgroundColor.a)));var c=s._core.extend(u,a,!0);s._core.isnull(a.near)&&(a.near=0),s._core.isnull(a.far)&&(a.far=999999999);n=parseFloat(a.near),u=parseFloat(a.far),n=new s._cesium.DistanceDisplayCondition(n,u);c.distanceDisplayCondition=n,s._core.isnull(a.font_size)&&(a.font_size="30px"),s._core.isnull(a.font_family)&&(a.font_family=" sans-serif"),c.font=parseFloat(a.font_size)+"px "+a.font_family,a.material,this._Provider.loadTile=function(e,t){!function(t,i,n){if(i.state===Cesium.QuadtreeTileLoadState.START){if(i.data={lines:[],geometryPrimitive:void 0},!(i.level>=a.level_min&&i.level<a.level_max&&n.item.show))return i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0;var e=l.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level);n._cache&&(e+="&"+n._core.getuid()),n._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return i.state=Cesium.QuadtreeTileLoadState.DONE,void(i.renderable=!0);var r=new n._cesium.PointPrimitiveCollection;e.features.forEach(function(e){c.id=e;var t,i=0;/^\[/.test(c.pointHeight)&&/\]$/.test(c.pointHeight)?(t=c.pointHeight.replace(/\[/,"").replace(/\]/,""),i=parseFloat(e.properties[t])):void 0!==c.pointHeight&&""!==c.pointHeight?i=parseFloat(c.pointHeight):null!=e.properties.height&&(i=parseFloat(e.properties.height)),/^\[/.test(a.color)&&/\]$/.test(a.color)&&(o=a.color.replace(/\[/,"").replace(/\]/,""),c.color=e.properties[o],n._core.isHtmlColor(c.color)?c.color=n._color.colorFromHtmlColor(c.color):(/^rgb/.test(c.color)&&(c.color=n._color.rgbaStringToRgbaObj(c.color)),1<c.color.r&&(c.color.r=c.color.r/255),1<c.color.g&&(c.color.g=c.color.g/255),1<c.color.b&&(c.color.b=c.color.b/255),1<c.color.a&&(c.color.a=c.color.a/255),c.color=n._color.createColor(c.color.r,c.color.g,c.color.b,c.color.a))),/^\[/.test(a.outlineColor)&&/\]$/.test(a.outlineColor)&&(o=a.outlineColor.replace(/\[/,"").replace(/\]/,""),c.outlineColor=e.properties[o],n._core.isHtmlColor(c.outlineColor)?c.outlineColor=n._color.colorFromHtmlColor(c.outlineColor):(/^rgb/.test(c.outlineColor)&&(c.outlineColor=n._color.rgbaStringToRgbaObj(c.outlineColor)),1<c.outlineColor.r&&(c.outlineColor.r=c.outlineColor.r/255),1<c.outlineColor.g&&(c.outlineColor.g=c.outlineColor.g/255),1<c.outlineColor.b&&(c.outlineColor.b=c.outlineColor.b/255),1<c.outlineColor.a&&(c.outlineColor.a=c.outlineColor.a/255),c.outlineColor=n._color.createColor(c.outlineColor.r,c.outlineColor.g,c.outlineColor.b,c.outlineColor.a))),c.position=new n._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i),c.text=e.properties.name;var o={show:c.show,position:c.position,pixelSize:c.pixelSize,color:c.color,outlineColor:c.outlineColor,outlineWidth:c.outlineWidth,id:e};c.color&&c.color.red&&(e="color:"+255*c.color.red+","+255*c.color.green+","+255*c.color.blue+";outlineColor:"+255*c.outlineColor.red+","+255*c.outlineColor.green+","+255*c.outlineColor.blue,n.Legend.push(e)),o.id.treeID=a.id,o.id.VectorType="point",o.id.VectorStyle={show:o.show,pointHeight:i,position:o.position,pixelSize:o.pixelSize,color:o.color,outlineColor:o.outlineColor,outlineWidth:o.outlineWidth},r.add(o)}),i.data.geometryPrimitive=r,i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state===Cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive.update(t,[]),i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0)},error:function(){null==i.count&&(i.count=0),i.count+=1,2<=i.count?(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0):i.state=Cesium.QuadtreeTileLoadState.START}}),i.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,s)},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});u=this._viewer.scene,n=u.primitives;a&&a.time&&(this._Provider._availability=new s._cesium.TimeIntervalCollection([new s._cesium.TimeInterval({start:a.time.start?s._cesium.JulianDate.fromDate(new Date(a.time.start)):s._cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?s._cesium.JulianDate.fromDate(new Date(a.time.end)):s._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),n.add(this._primitive),u.primitivesQuadTrees&&u.primitivesQuadTrees.push(this._primitive),o?(this.item.show=!0,this.setVisibility(!0)):this.setVisibility(!1),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:a.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t.url,style:a,treeData:{name:e,geoOptions:t,styleOption:a,GroupID:i,checked:o,disFnc:r}};return this._Provider.treeID=a.id,this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ge.prototype.VolumeVectorGeoJsonFeatureLayerOptimization=function(e,r,i,t,o,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:r.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:r.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(r.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(r.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:r.upperLevelLimit,lowerLevelLimit:r.lowerLevelLimit,Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend({...a},i,!0),null==r&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var d={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=r.url+"?"+this._serialize(s.urlParams);var u=r.url+"?"+this._serialize(s.urlParams);l._core.xhr({url:r.url+"?service=WMTS&request=GetCapabilities",type:"get",isXml:!0,success:function(o){o=l._core.xml2json(o);let e=o.Contents&&o.Contents.Layer;o=e.filter(e=>e.Identifier===r.layer)[0];if(o){let e=o.TileMatrixSetLink,t=r.srs||"EPSG:4326",i=e.filter(e=>e.TileMatrixSet===t)[0];i&&(l.TileMatrixLimits={},i.TileMatrixSetLimits&&i.TileMatrixSetLimits.TileMatrixLimits.forEach(e=>{let t=e.TileMatrix;t=t.split(":");var i=t[t.length-1];l.TileMatrixLimits[i]={maxCol:e.MaxTileCol,minCol:e.MinTileCol,maxRow:e.MaxTileRow,minRow:e.MinTileRow}}))}l.initThisProvider()}}),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this.initThisProvider=()=>{this.initThisProvider=void 0,this._Provider.loadTile=function(e,t){!function(c,h,m){if(h.state===Cesium.QuadtreeTileLoadState.START){if(h.data={lines:[],geometryPrimitive:void 0},!(h.level>=i.level_min&&h.level<i.level_max&&m.item.show))return h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0;if(m.TileMatrixLimits){var e=m.TileMatrixLimits[h.level];if(h.x>e.maxCol||h.x<e.minCol||h.y>e.maxRow||h.y<e.minRow)return h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0}e=u.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.y).replace(window.encodeURIComponent("{z}"),h.level);m._cache&&(e+="&"+m._core.getuid()),m._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return h.state=Cesium.QuadtreeTileLoadState.DONE,void(h.renderable=!0);var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):(a.push(e[t]),2!==t||s||(s=!0))}function t(){var e,t;/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)?(e=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),d.extrudedHeight=parseFloat(l.properties[e])):m._option.extrudedHeight&&(d.extrudedHeight=parseFloat(m._option.extrudedHeight)),d.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)?(t=m._option.material.replace(/\[/,"").replace(/\]/,""),d.material=l.properties[t],m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))):(m._option.material&&(d.material=m._option.material),d.material&&(m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)))),2<=a.length&&(e=s?m._cesium.Cartesian3.fromDegreesArrayHeights(a):m._cesium.Cartesian3.fromDegreesArray(a),d.polygonHierarchy=new m._cesium.PolygonHierarchy(e),t=new m._cesium.PolygonGeometry(d),l.treeID=d.id,l.VectorType="polygon",l.VectorStyle={haveZ:s,extrudedHeight:d.extrudedHeight,positions:a,material:d.material},e=new m._cesium.GeometryInstance({id:l,geometry:t,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(d.material),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(m._option.near,m._option.far)}}),t="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue,m.Legend.push(t),i.push(e))}m.Legend=[];for(var r,n=0;n<e.features.length;n++){var a=[],s=!1,l=e.features[n];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var u=0;u<l.geometry.coordinates.length;u++)a=[],l.geometry.coordinates[u].pop(),o(l.geometry.coordinates[u]),t();else o(l.geometry.coordinates),t()}0==i.length&&(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0),r=d.material.alpha<1?new m._cesium.PerInstanceColorAppearance({translucent:!0}):new m._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:m._core.Shaders("vertexShaderSource"),fragmentShaderSource:m._core.Shaders("fragmentShaderSource")}),r=m._option.clampToGround?new m._cesium.GroundPrimitive({geometryInstances:i,appearance:r,classificationType:m._cesium.ClassificationType.BOTH}):new m._cesium.Primitive({geometryInstances:i,appearance:r,shadows:m._option.shadows}),h.data.geometryPrimitive=r,h.state=Cesium.QuadtreeTileLoadState.LOADING,h.state===Cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive.update(c,[]),h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0)},error:function(){h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0}}),h.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)}};let c,h;this.saveDefaultVectorData=()=>{h=l._core.extend({},i,!0)},this.restoreVector=()=>{h&&(i=h,l._option=l._core.extend({...a},i,!0),l._Provider._normalTile=i.level_max-1,l._primitive&&l._primitive._tilesToRender&&l._primitive._tilesToRender.length&&(l._primitive._tilesToRender.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),l._primitive._tileToUpdateHeights.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),l._primitive._tileToUpdateHeights=[],l._primitive._tilesToRender=[])),h=void 0},this.updataVector=(e={})=>{(e.material||e.outlineColor)&&(e.material&&(e.material=Cesium.Color.fromCssColorString(e.material)),e.outlineColor&&(e.outlineColor=Cesium.Color.fromCssColorString(e.outlineColor))),void 0===e.minimumLevel&&void 0===e.maximumLevel||(void 0!==e.minimumLevel&&(e.level_min=e.minimumLevel),void 0!==e.maximumLevel&&(e.level_max=e.maximumLevel)),i=l._core.extend(i,e,!0),l._option=l._core.extend(l._option,i,!0),l._Provider._normalTile=i.level_max-1,l._primitive&&l._primitive._tilesToRender&&l._primitive._tilesToRender.length&&(clearTimeout(c),c=setTimeout(()=>{l._primitive._tilesToRender.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),l._primitive._tileToUpdateHeights.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),l._primitive._tileToUpdateHeights=[],l._primitive._tilesToRender=[]},100))},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var m=this._viewer.scene,s=m.primitives;i&&i.time&&(this._Provider._availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:i.time.start?l._cesium.JulianDate.fromDate(new Date(i.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:i.time.end?l._cesium.JulianDate.fromDate(new Date(i.time.end)):l._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),s.add(this._primitive),m.primitivesQuadTrees&&m.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(i.id)&&(i.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+i.id),this.west=r.minx,this.south=r.miny,this.east=r.maxx,this.north=r.maxy;o={id:i.id,name:e,checked:!0,pId:this._core.isnull(t)?0:t,type:"polygonLayer",item:this,url:r.url,style:i,treeData:{name:e,geoOptions:r,styleOption:i,GroupID:t,checked:o,disFnc:n}};return this._Provider.treeID=o.id,this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(t)?0:t),"function"==typeof n&&n(this.item),this},Ge.prototype.createModelGeoJsonFeatureLayerProvider0825=function(e,t,o,i,r,n){var a=this,s={url:"",color:a._cesium.Color.DARKSALMON,scale:2},l={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};a._core.isnull(o)||a._core.isnull(o.color)||/^\[/.test(o.color)&&"["==o.color.toString().charAt(0)&&"]"==o.color.toString().charAt(o.color.length-1)||(a._core.isHtmlColor(o.color)?o.color=a._color.colorFromHtmlColor(o.color):(/^rgb/.test(o.color)&&(o.color=a._color.rgbaStringToRgbaObj(o.color)),1<o.color.r&&(o.color.r=o.color.r/255),1<o.color.g&&(o.color.g=o.color.g/255),1<o.color.b&&(o.color.b=o.color.b/255),1<o.color.a&&(o.color.a=o.color.a/255),o.color=a._color.createColor(o.color.r,o.color.g,o.color.b,o.color.a)));var u=a._core.extend(s,o,!0);a._core.isnull(o.near)&&(o.near=0),a._core.isnull(o.far)&&(o.far=999999999);var c=parseFloat(o.near),s=parseFloat(o.far),s=new a._cesium.DistanceDisplayCondition(c,s);u.distanceDisplayCondition=s,o.material,this._urlTemplate=t.url+"?"+this._serialize(l.urlParams);var h=t.url+"?"+this._serialize(l.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider._minimumHeight=parseFloat(u.height)||0,this._Provider.loadTile=function(t,i){if(i.state===Cesium.QuadtreeTileLoadState.START){if(i.data={lines:[],geometryPrimitive:void 0},!(i.level>=o.level_min&&i.level<o.level_max&&a.item.show))return i.state=Cesium.QuadtreeTileLoadState.DONE,void(i.renderable=!0);var e=h.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level);a._cache&&(e+="&"+a._core.getuid()),a._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return i.state=Cesium.QuadtreeTileLoadState.DONE,void(i.renderable=!0);var o=new a._cesium.PrimitiveCollection({isModel:!0});e.features.forEach(function(e){var t,i=(u.id=e).geometry.coordinates[2]||0;null!=e.properties.height&&(i=parseFloat(e.properties.height)),/^\[/.test(u.height)&&/\]$/.test(u.height)?(t=u.height.replace(/\[/,"").replace(/\]/,""),i+=parseFloat(e.properties[t])):i+=parseFloat(u.height)||0,u.modelMatrix=a._cesium.Transforms.eastNorthUpToFixedFrame(a._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i));e=a._cesium.Model.fromGltf({id:e,url:u.uri,color:u.color,modelMatrix:u.modelMatrix,scale:u.scale,heightReference:parseInt(u.heightReference),distanceDisplayCondition:u.distanceDisplayCondition});o.add(e)}),0==e.features.length&&(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0),i.data.geometryPrimitive=o,i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state===Cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive.update(t,[]),i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0)},error:function(){null==i.count&&(i.count=0),i.count+=1,2<=i.count?(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0):i.state=Cesium.QuadtreeTileLoadState.START}}),i.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new a._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});l=this._viewer.scene;l.primitives.add(this._primitive),l.primitivesQuadTrees&&l.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;r={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o,treeData:{name:e,geoOptions:t,styleOption:o,GroupID:i,checked:r,disFnc:n}};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},Ge.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,o,i,r,n){var a=this,s={url:"",color:a._cesium.Color.DARKSALMON,scale:2},l={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,Cesium:this._cesium};a._core.isnull(o)||a._core.isnull(o.color)||/^\[/.test(o.color)&&"["==o.color.toString().charAt(0)&&"]"==o.color.toString().charAt(o.color.length-1)||(a._core.isHtmlColor(o.color)?o.color=a._color.colorFromHtmlColor(o.color):(/^rgb/.test(o.color)&&(o.color=a._color.rgbaStringToRgbaObj(o.color)),1<o.color.r&&(o.color.r=o.color.r/255),1<o.color.g&&(o.color.g=o.color.g/255),1<o.color.b&&(o.color.b=o.color.b/255),1<o.color.a&&(o.color.a=o.color.a/255),o.color=a._color.createColor(o.color.r,o.color.g,o.color.b,o.color.a)));var u=a._core.extend(s,o,!0);a._core.isnull(o.near)&&(o.near=0),a._core.isnull(o.far)&&(o.far=999999999);var c=parseFloat(o.near),s=parseFloat(o.far),s=new a._cesium.DistanceDisplayCondition(c,s);u.distanceDisplayCondition=s,o.material,this._urlTemplate=t.url+"?"+this._serialize(l.urlParams);var h=t.url+"?"+this._serialize(l.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider._minimumHeight=parseFloat(u.height)||0,this._Provider.loadTile=function(i,r){if(r.state===Cesium.QuadtreeTileLoadState.START){if(r.data={lines:[],geometryPrimitive:void 0},!(r.level>=o.level_min&&r.level<o.level_max&&a.item.show))return r.state=Cesium.QuadtreeTileLoadState.DONE,void(r.renderable=!0);var e=h.replace(window.encodeURIComponent("{x}"),r.x).replace(window.encodeURIComponent("{y}"),r.y).replace(window.encodeURIComponent("{z}"),r.level);a._cache&&(e+="&"+a._core.getuid()),a._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return r.state=Cesium.QuadtreeTileLoadState.DONE,void(r.renderable=!0);var o=[];e.features.forEach(function(e){var t,i=(u.id=e).geometry.coordinates[2]||0;null!=e.properties.height&&(i=parseFloat(e.properties.height)),/^\[/.test(u.height)&&/\]$/.test(u.height)?(t=u.height.replace(/\[/,"").replace(/\]/,""),i+=parseFloat(e.properties[t])):i+=parseFloat(u.height)||0;i=a._cesium.Transforms.eastNorthUpToFixedFrame(a._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i));Cesium.Matrix4.multiplyByUniformScale(i,u.scale,i),o.push({modelMatrix:i,modelId:e})});var t=new Cesium.ModelInstanceCollection({url:u.uri,instances:o,color:u.color});0==e.features.length&&(r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0),r.data.geometryPrimitive=t,r.state=Cesium.QuadtreeTileLoadState.LOADING,r.state===Cesium.QuadtreeTileLoadState.LOADING&&(r.data.geometryPrimitive.update(i,[]),r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0)},error:function(){null==r.count&&(r.count=0),r.count+=1,2<=r.count?(r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0):r.state=Cesium.QuadtreeTileLoadState.START}}),r.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});s=this._viewer.scene,l=s.primitives;o&&o.time&&(this._Provider._availability=new a._cesium.TimeIntervalCollection([new a._cesium.TimeInterval({start:o.time.start?a._cesium.JulianDate.fromDate(new Date(o.time.start)):a._cesium.Iso8601.MINIMUM_VALUE,stop:o.time.end?a._cesium.JulianDate.fromDate(new Date(o.time.end)):a._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),l.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;r={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o,treeData:{name:e,geoOptions:t,styleOption:o,GroupID:i,checked:r,disFnc:n}};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},Ge.prototype.VolumeVectorGeoJsonFeatureLayerOptimization1=function(e,t,a,i,o,r){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),this._option=this._core.extend(n,a,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var l=[],n={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},u=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=a.level_max-1,u._defaultStyle={outlineColor:Cesium.Color.fromCssColorString("rgba(209,204,226,0)"),lineWidth:0,outline:!0,fill:!0,fillColor:Cesium.Color.fromCssColorString("rgba(220,20,60,1)"),fillShow:"nod",tileCacheSize:200,showMaker:!1,showCenterLabel:!0,fontColor:Cesium.Color.fromCssColorString("rgba(255,0,0,1)"),labelOffsetX:-10,labelOffsetY:-5,fontSize:13,fontFamily:"黑体",pointColor:Cesium.Color.fromCssColorString("rgba(255,0,0,0)"),centerLabelPropertyName:"NAME"},-1!=u._option.fill.indexOf("[")?u._defaultStyle.fillShow=u._option.fill:u._defaultStyle.fillColor=Cesium.Color.fromCssColorString(u._option.fill),this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&u.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>a.level_max+2&&0<u.probj.length)for(;0<u.probj.length;n++){u._viewer.entities.remove(u.probj[0]);var o=u.probj.indexOf(u.probj[0]);u.probj.splice(o,1)}if(t.level>=a.level_min&&t.level<a.level_max&&u.item.show){var r=Ce.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=r.length&&r[0].data&&0<r[0].data.length)return t.data.geometryPrimitive=new u._cesium.Primitive({geometryInstances:r[0].data,appearance:new u._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:u._cesium.ShadowMode.ENABLED}),t.state=u._cesium.QuadtreeTileLoadState.LOADING,void(t.state===u._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=u._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<u.PrimitiveData.length)for(var n=0;n<u.PrimitiveData.length;n++)if(u.PrimitiveData[n].key==i)return void(u.Primitivekey.includes(i)||u.Primitivekey.push(i));u.Primitivekey.includes(i)||(u.Primitivekey.push(i),l.push({level:t.level,x:t.x,y:t.y,data:void 0}),function(i){var e=u._urlTemplate.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level);u.tilesLength++;var o="z"+i.level+"x"+i.x+"y"+i.y;u._cache&&(e+="&"+u._core.getuid());var r={xMin:Cesium.Math.toDegrees(i._rectangle.west),yMin:Cesium.Math.toDegrees(i._rectangle.south),xMax:Cesium.Math.toDegrees(i._rectangle.east),yMax:Cesium.Math.toDegrees(i._rectangle.north)};u._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var t=e;u._tileWidth=256,u._tileHeight=256,u.x=i._x,u.y=i._y,u.level=i._level,u._createCanvas(),u._drawGeojson(u._context,0,0,e,r,u._tileWidth,u._tileHeight,u._fill,u._outline,u.x,u.y,u.level);t=u._viewer.entities.add({ids:t,name:"Rotating rectangle with rotating texture coordinate",rectangle:{coordinates:i.rectangle,material:new u._cesium.ImageMaterialProperty({image:u._canvas,transparent:!0}),zIndex:i.level,classificationType:u._cesium.ClassificationType.BOTH}});u.probj.push(t);t={level:i.level,key:o,data:t};u.loadFinishKey.push(o),u.PrimitiveData.push(t),u.returnCount++,u.removeObsoleteEntitiesxp(i.rectangle)},error:function(){i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0}})}(t))}else t.state=u._cesium.QuadtreeTileLoadState.LOADING,t.state===u._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=u._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)}},this._primitive=new u._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+n.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:a,treeData:{name:e,geoOptions:t,styleOption:a,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ge.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationtest=function(e,t,a,i,o,r){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),this._option=this._core.extend(n,a,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var l=[],n={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},u=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=a.level_max-1,u._defaultStyle={outlineColor:Cesium.Color.fromCssColorString("rgba(209,204,226,0)"),lineWidth:0,outline:!0,fill:!0,fillColor:Cesium.Color.fromCssColorString("rgba(220,20,60,1)"),fillShow:"nod",tileCacheSize:200,showMaker:!1,showCenterLabel:!0,fontColor:Cesium.Color.fromCssColorString("rgba(255,0,0,1)"),labelOffsetX:-10,labelOffsetY:-5,fontSize:13,fontFamily:"黑体",pointColor:Cesium.Color.fromCssColorString("rgba(255,0,0,0)"),centerLabelPropertyName:"NAME"},-1!=u._option.fill.indexOf("[")?u._defaultStyle.fillShow=u._option.fill:u._defaultStyle.fillColor=Cesium.Color.fromCssColorString(u._option.fill),this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&u.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>a.level_max+2&&0<u.probj.length)for(;0<u.probj.length;n++){u._viewer.entities.remove(u.probj[0]);var o=u.probj.indexOf(u.probj[0]);u.probj.splice(o,1)}if(t.level>=a.level_min&&t.level<a.level_max&&u.item.show){var r=Ce.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=r.length&&r[0].data&&0<r[0].data.length)return t.data.geometryPrimitive=new u._cesium.Primitive({geometryInstances:r[0].data,appearance:new u._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:u._cesium.ShadowMode.ENABLED}),t.state=u._cesium.QuadtreeTileLoadState.LOADING,void(t.state===u._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=u._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<u.PrimitiveData.length)for(var n=0;n<u.PrimitiveData.length;n++)if(u.PrimitiveData[n].key==i)return void(u.Primitivekey.includes(i)||u.Primitivekey.push(i));u.Primitivekey.includes(i)||(u.Primitivekey.push(i),l.push({level:t.level,x:t.x,y:t.y,data:void 0}),function(i){var e=u._urlTemplate.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level);u.tilesLength++;var o="z"+i.level+"x"+i.x+"y"+i.y;u._cache&&(e+="&"+u._core.getuid()),Cesium.Math.toDegrees(i._rectangle.west),Cesium.Math.toDegrees(i._rectangle.south),Cesium.Math.toDegrees(i._rectangle.east),Cesium.Math.toDegrees(i._rectangle.north),u._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var t=e;u._tileWidth=256,u._tileHeight=256,u.x=i._x,u.y=i._y,u.level=i._level;e=u._viewer.entities.add({ids:t,name:"Rotating rectangle with rotating texture coordinate",rectangle:{coordinates:i.rectangle,material:new u._cesium.ImageMaterialProperty({image:e,transparent:!0}),zIndex:i.level,classificationType:u._cesium.ClassificationType.BOTH}});u.probj.push(e);e={level:i.level,key:o,data:e};u.loadFinishKey.push(o),u.PrimitiveData.push(e),u.returnCount++,u.removeObsoleteEntitiesxp(i.rectangle)},error:function(){i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0}})}(t))}else t.state=u._cesium.QuadtreeTileLoadState.LOADING,t.state===u._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=u._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)}},this._primitive=new u._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+n.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;o={id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:a,treeData:{name:e,geoOptions:t,styleOption:a,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ge.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest=function(e,r,i,t,o,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:r.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:r.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(r.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(r.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:r.upperLevelLimit,lowerLevelLimit:r.lowerLevelLimit,Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==r&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var d={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},l=this;this._urlTemplate=r.url+"?"+this._serialize(s.urlParams);var u=r.url+"?"+this._serialize(s.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider._minimumHeight=parseFloat(i.height||0),l._core.xhr({url:r.url+"?service=WMTS&request=GetCapabilities",type:"get",isXml:!0,success:function(o){o=l._core.xml2json(o);let e=o.Contents&&o.Contents.Layer;o=e.filter(e=>e.Identifier===r.layer)[0];if(o){let e=o.TileMatrixSetLink,t=r.srs||"EPSG:4490",i=e.filter(e=>e.TileMatrixSet===t)[0];i&&(l.TileMatrixLimits={},i.TileMatrixSetLimits&&i.TileMatrixSetLimits.TileMatrixLimits.forEach(e=>{let t=e.TileMatrix;t=t.split(":");var i=t[t.length-1];l.TileMatrixLimits[i]={maxCol:e.MaxTileCol,minCol:e.MinTileCol,maxRow:e.MaxTileRow,minRow:e.MinTileRow}}))}l.initThisProvider()}}),this.initThisProvider=()=>{this.initThisProvider=void 0,this._Provider.loadTile=function(e,t){!function(c,h,m){if(h.state===Cesium.QuadtreeTileLoadState.START){if(h.data={lines:[],geometryPrimitive:void 0},!(h.level>=i.level_min&&h.level<i.level_max&&m.item.show))return h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0;if(m.TileMatrixLimits){var e=m.TileMatrixLimits[h.level];if(e&&(h.x>e.maxCol||h.x<e.minCol||h.y>e.maxRow||h.y<e.minRow))return h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0}e=u.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.y).replace(window.encodeURIComponent("{z}"),h.level);m._cache&&(e+="&"+m._core.getuid()),m._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var t=Ce.cloneDeep(e);if(t.features.length<=0)return h.state=Cesium.QuadtreeTileLoadState.DONE,void(h.renderable=!0);if(null==t)return h.state=Cesium.QuadtreeTileLoadState.DONE,void(h.renderable=!0);var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):(a.push(e[t]),2!==t||s||(s=!0))}function r(){var e,t;/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)&&(e=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),d.extrudedHeight=parseFloat(l.properties[e])),d.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)?(t=m._option.material.replace(/\[/,"").replace(/\]/,""),d.material=l.properties[t],m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))):(m._option.material&&(d.material=m._option.material),d.material&&(m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)))),2<=a.length&&(e=s?m._cesium.Cartesian3.fromDegreesArrayHeights(a):m._cesium.Cartesian3.fromDegreesArray(a),d.polygonHierarchy=new m._cesium.PolygonHierarchy(e),t=new m._cesium.PolygonGeometry(d),l.treeID=d.id,l.VectorType="polygon",l.VectorStyle={haveZ:s,extrudedHeight:d.extrudedHeight,positions:a,material:d.material},e=new m._cesium.GeometryInstance({id:l,geometry:t,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}}),t="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue,m.Legend.push(t),i.push(e))}m.Legend=[];for(var n=0;n<t.features.length;n++){var a=[],s=!1,l=t.features[n];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var u=0;u<l.geometry.coordinates.length;u++)a=[],l.geometry.coordinates[u].pop(),o(l.geometry.coordinates[u]),r();else o(l.geometry.coordinates),r()}0==i.length&&(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0);e=new m._cesium.GroundPrimitive({geometryInstances:i,appearance:new m._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:m._core.Shaders("vertexShaderSource"),fragmentShaderSource:m._core.Shaders("fragmentShaderSource")}),classificationType:m._cesium.ClassificationType.BOTH,shadows:m._option.shadows});m.probj.push(e),h.data.geometryPrimitive=e,h.state=Cesium.QuadtreeTileLoadState.LOADING,h.state===Cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive.update(c,[]),h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0)},error:function(){null==h.count&&(h.count=0),h.count+=1,2<=h.count?(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0):h.state=Cesium.QuadtreeTileLoadState.START}}),h.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,l)}},this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});s=this._viewer.scene;s.primitives.add(this._primitive),s.primitivesQuadTrees&&s.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(i.id)&&(i.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+i.id),this.west=r.minx,this.south=r.miny,this.east=r.maxx,this.north=r.maxy;o={id:i.id,name:e,checked:!0,pId:this._core.isnull(t)?0:t,type:"polygonLayer",item:this,url:r.url,style:i,treeData:{name:e,geoOptions:r,styleOption:i,GroupID:t,checked:o,disFnc:n}};return this._Provider.treeID=o.id,this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(t)?0:t),"function"==typeof n&&n(this.item),this},Ge.prototype.createGeojsonImage=function(e){let o=eval;Cesium.loadText("http://36.7.136.132:8090/geoserver/swagger/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=swagger%3A_20200410153959_JZ11&maxFeatures=50&outputFormat=application%2Fjson").then(function(e){e=o("("+e+")");for(var t=0;t<e.features.length;t++)e.features[t].properties.nod=0==t?"rgba(255,255,0,1)":1==t?"rgba(220,20,60,1)":2==t?"rgba(75,0,130,1)":3==t?"rgba(0,0,255,1)":4==t?"rgba(30,144,255,1)":"rgba(50,205,50,1)";try{var i=new VectorTileImageryProvider({source:e,zIndex:99,removeDuplicate:!1,defaultStyle:{outlineColor:"rgba(209,204,226,1)",lineWidth:0,outline:!0,fill:!0,fillColor:"rgba(209,204,226,1)",fillShow:"[nod]",tileCacheSize:200,showMaker:!1,showCenterLabel:!0,fontColor:"rgba(255,0,0,1)",labelOffsetX:-10,labelOffsetY:-5,fontSize:13,fontFamily:"黑体",centerLabelPropertyName:"NAME"},maximumLevel:20,minimumLevel:15,simplify:!1});i.readyPromise.then(function(){viewer.imageryLayers.addImageryProvider(i),Cesium.Camera.DEFAULT_VIEW_RECTANGLE=i.rectangle})}catch(e){console.log(e)}})},Ge.prototype._drawGeojson=function(o,r,n,e,a,t,i,s,l,u,c,h){var m,d,p,g,_=this;function f(e){if(_._styleFilter){if(0==(d=e.style).show)return;p={labelStroke:d.labelStroke,labelStrokeWidth:d.labelStrokeWidth,labelStrokeColor:d.labelStrokeColor,pointSize:d.pointSize,fontSize:d.fontSize,fontFamily:d.fontFamily,color:d.fontColor.toCssColorString(),backgroundColor:d.pointColor.toCssColorString(),pointStyle:d.pointStyle,ringRadius:d.ringRadius,circleLineWidth:d.circleLineWidth,showMaker:d.showMaker,showLabel:d.showLabel,labelOffsetX:d.labelOffsetX,labelOffsetY:d.labelOffsetY,markerSymbol:d.makerImage instanceof Image?d.makerImage:d.makerImageEl}}else d=_._defaultStyle;if(o.lineWidth=d.lineWidth,o.strokeStyle=d.outlineColor.toCssColorString(),o.fillStyle=d.fillColor.toCssColorString(),-1!=d.fillShow.indexOf("[")&&(i=d.fillShow.replace("[","").replace("]",""),o.fillStyle=e.properties[i]),d.lineDash&&o.setLineDash(d.lineDash),o.lineCap=d.lineCap,d.shadowColor&&d.shadowColor instanceof Cesium.Color?o.shadowColor=d.shadowColor.toCssColorString():o.shadowColor=d.shadowColor,o.shadowBlur=d.shadowBlur,o.shadowOffsetX=d.shadowOffsetX,o.shadowOffsetY=d.shadowOffsetY,o.miterLimit=d.miterLimit,o.lineJoin=d.lineJoin,"Point"==e.geometry.type)drawMarker(o,m,a,r,n,e,s,l,d.labelPropertyName,p);else if("Polygon"==e.geometry.type&&d.fill){var t=turf.getCoords(e),i=ze(o,m,a,r,n,t,!0,!1);i&&i.map(function(e){e.style=d,g.push(e)})}else if("MultiPolygon"==e.geometry.type&&d.fill)try{turf.getCoords(e).map(function(e){e=ze(o,m,a,r,n,e,!0,!1);e&&e.map(function(e){e.style=d,g.push(e)})})}catch(e){}else"MultiLineString"==e.geometry.type?e.properties.isOutline&&!d.outline||(t=turf.getCoords(e),ze(o,m,a,r,n,t,!1,!0)):"LineString"==e.geometry.type&&(e.properties.isOutline&&!d.outline||(e=turf.getCoords(e),ze(o,m,a,r,n,t=[e],!1,!0),e=null))}void 0===l&&(l=!0),((s=void 0===s?!0:s)||l)&&(m=new Fe(t=void 0===t?o.canvas.width-r:t,i=void 0===i?o.canvas.height-n:i),d=this._defaultStyle,p={labelStroke:d.labelStroke,labelStrokeWidth:d.labelStrokeWidth,labelStrokeColor:d.labelStrokeColor,pointSize:d.pointSize,fontSize:d.fontSize,fontFamily:d.fontFamily,color:d.fontColor.toCssColorString(),backgroundColor:d.pointColor.toCssColorString(),pointStyle:d.pointStyle,ringRadius:d.ringRadius,circleLineWidth:d.circleLineWidth,showMaker:d.showMaker,showLabel:d.showLabel,labelOffsetX:d.labelOffsetX,labelOffsetY:d.labelOffsetY,markerSymbol:d.makerImage instanceof Image?d.makerImage:d.makerImageEl},g=[],_._styleFilter&&(turf.featureEach(e,function(e,t){_._styleFilter&&(d=_._defaultStyle.clone(),_._styleFilter(e,d,u,c,h),e.style=d)}),e.features.sort(function(e,t){return e.style&&e.style.lineDash?1:t.style&&t.style.lineDash?-1:0})),turf.featureEach(e,function(e,t){"Polygon"!=e.geometry.type&&"MultiPolygon"!=e.geometry.type||f(e)}),g&&g.length&&function(e,o,r,n,a,t){var i=e.canvas,s=e.getImageData(0,0,i.width,i.height),l=document.createElement("canvas");l.width=i.width,l.height=i.height;var u,c=l.getContext("2d");t.map(function(e){c.clearRect(0,0,l.width,l.height),c.beginPath();var t=0;e.map(function(e){e=o.project(e,r);0==t?c.moveTo(n+e.x,a+e.y):c.lineTo(n+e.x,a+e.y),t++}),c.closePath(),c.fillStyle="rgba(255,255,255,1)",c.fill(),u=c.getImageData(0,0,l.width,l.height).data;for(var i=3;i<u.length;i+=4)0<u[i]&&(s.data[i]=0)}),e.putImageData(s,0,0)}(o,m,a,r,n,g),turf.featureEach(e,function(e,t){"LineString"!=e.geometry.type&&"MultiLineString"!=e.geometry.type||f(e)}),turf.featureEach(e,function(e,t){"Point"!=e.geometry.type&&"MultiPoint"!=e.geometry.type||f(e)}))},Ge.prototype._createCanvas=function(){this._canvas=document.createElement("canvas"),this._canvas.width=this._tileWidth,this._canvas.height=this._tileHeight,this._context=this._canvas.getContext("2d"),this._context.lineWidth=this._defaultStyle.lineWidth,this._context.strokeStyle=this._defaultStyle.outlineColor.toCssColorString(),this._context.fillStyle=this._defaultStyle.fillColor.toCssColorString()},Ge.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},Ge.prototype.removeObsoletePrimitives1=function(e){},Ge.prototype.removeObsoletePrimitives=function(e){for(var t=this._viewer.scene.globe._surface._tilesToRender.map(function(e){return e.level}),i=Math.min.apply(Math,Ne(t)),o=Math.max.apply(Math,Ne(t)),r=this.PrimitiveData.length-1;0<=r;r--){var n=this.PrimitiveData[r];(n.level<i||n.level>o)&&this._viewer.scene.primitives.remove(n.data)&&(-1<(c=this.Primitivekey.indexOf(this.loadFinishKey[r]))&&this.Primitivekey.splice(c,1),this.PrimitiveData.splice(r,1),this.loadFinishKey.splice(r,1))}var a=[],t=e.parent;t&&t.parent&&(t=t.parent,a.push(t));var s=e.children;a=a.concat(s);for(r=0;r<s.length;r++)var l=s[r].children,a=a.concat(l);for(var u,c,r=0;r<a.length;r++)a[r]&&(u="z"+a[r].level+"x"+a[r].x+"y"+a[r].y,-1<(c=this.loadFinishKey.indexOf(u))&&this._viewer.scene.primitives.remove(this.PrimitiveData[c].data)&&(-1<(c=this.Primitivekey.indexOf(u))&&this.Primitivekey.splice(c,1),this.PrimitiveData.splice(c,1),this.loadFinishKey.splice(c,1)))},Ge.prototype.removeObsoleteEntities=function(e){for(var t=this._viewer.scene.globe._surface._tilesToRender.map(function(e){return e.level}),i=Math.min.apply(Math,Ne(t))-1,o=Math.max.apply(Math,Ne(t))+1,r=this.PrimitiveData.length-1;0<=r;r--){var n=this.PrimitiveData[r];(n.level<i||n.level>o)&&this._viewer.entities.remove(n.data)&&(-1<(c=this.Primitivekey.indexOf(this.loadFinishKey[r]))&&this.Primitivekey.splice(c,1),this.PrimitiveData.splice(r,1),this.loadFinishKey.splice(r,1))}var a=[],t=e.parent;t&&t.parent&&(t=t.parent,a.push(t));var s=e.children;a=a.concat(s);for(r=0;r<s.length;r++)var l=s[r].children,a=a.concat(l);for(var u,c,r=0;r<a.length;r++)a[r]&&(u="z"+a[r].level+"x"+a[r].x+"y"+a[r].y,-1<(c=this.loadFinishKey.indexOf(u))&&this._viewer.entities.remove(this.PrimitiveData[c].data)&&(-1<(c=this.Primitivekey.indexOf(u))&&this.Primitivekey.splice(c,1),this.PrimitiveData.splice(c,1),this.loadFinishKey.splice(c,1)))},Ge.prototype.removeObsoleteEntitiesxp=function(e){for(var t=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(e.west),this._cesium.Math.toDegrees(e.south)),i=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(e.east),this._cesium.Math.toDegrees(e.north)),o=0;o<this.probj.length;o++)this._cesium.Rectangle.contains(this.probj[o].rectangle.coordinates.getValue(),this._cesium.Cartographic.fromCartesian(t)),this._cesium.Rectangle.contains(this.probj[o].rectangle.coordinates.getValue(),this._cesium.Cartographic.fromCartesian(i));for(var r=this._viewer.camera.computeViewRectangle(),n=0;n<this.probj.length;n++){var a=this.probj[n].rectangle.coordinates.getValue(),s=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(a.west),this._cesium.Math.toDegrees(a.south)),a=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(a.east),this._cesium.Math.toDegrees(a.north)),s=this._cesium.Rectangle.contains(r,this._cesium.Cartographic.fromCartesian(s)),a=this._cesium.Rectangle.contains(r,this._cesium.Cartographic.fromCartesian(a));this.probj[n].show=!(!s&&!a)}},Ge.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var o=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(o),e*Math.sin(o)))}return t},Ge.prototype.setTreeobj=function(e){this.treeobj=e},Ge.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t,pId:this.treeobj.pId},treeData:this.treeobj.treeData}},Ge.prototype.deleteObject=function(){if(this._viewer.scene.primitives.remove(this.item),this.probj&&0<this.probj.length&&(this._viewer.scene.primitives.remove(this.probj[0]),this.probj.pop()),null!=this.img&&this._viewer.imageryLayers.remove(this.img),this.primitve&&0<this.primitve.length){for(var e=0;e<this.primitve.length;e++)this._viewer.scene.primitives.remove(this.primitve[e]);this.primitve=[]}this.loadAllKey&&0<this.loadAllKey.length&&(this.loadAllKey=[]);try{this._Provider.remove()}catch(e){}},Ge.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(e)}catch(e){}},Ge.prototype.getLevel=function(){var e,t=this._viewer.camera;return t&&t.positionCartographic&&t.positionCartographic.height?(e=this._viewer.scene.globe.getHeight(t.positionCartographic)||0,e=t.positionCartographic.height-e,Math.round(80955.31/(1+Math.pow(e/91610.74,7096758e-11))-40467.74)):0},Ge.prototype.setVisibility=function(e){try{if(this.loadAllKey=[],null!=this.item&&null!=this.item.show&&(this.item.show=e),null!=this.img&&(this.img.show=e),this.primitve&&0<this.primitve.length)for(var t=0;t<this.primitve.length;t++)this.primitve[t].show=e;if(this._Provider&&this._Provider.setStatus&&this._Provider.setStatus(e),this.probj&&0<this.probj.length)for(t=0;t<this.probj.length;t++)this.probj[t].show=e}catch(e){}},Ge.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},Ge.prototype.isCache=function(e){this._cache=e},Ge.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},Ue.prototype.flyTo=function(e,t={}){return this._viewer.flyTo(e,{duration:t.time||3,maximumHeight:t.maxHeight,offset:new Cesium.HeadingPitchRange(Cesium.Math.toRadians(t.heading||0),Cesium.Math.toRadians(t.pitch||-45),t.range)})},Ue.prototype.flyToPointsInterest=function(e,t){return this._viewer.camera.flyTo({destination:e.destination,orientation:e.orientation,duration:e.duration,complete:t})},Ue.prototype.flyToPosition=function(e,t,i){Math.abs(e)<=180&&Math.abs(t)<=90?this._viewer.camera.flyTo({destination:this._cesium.Cartesian3.fromDegrees(e,t,i)}):this._viewer.camera.flyTo({destination:{x:e,y:t,z:i}})},We.prototype.createPolylineGeoJsonFeatureLayer=function(e,t,d,i,p,g){var o={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30};this._core.isnull(d)||this._core.isnull(d.material)||"["==d.material.toString().charAt(0)&&"]"==d.material.toString().charAt(d.material.length-1)||(this._core.isHtmlColor(d.material)?d.material=this._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=this._color.rgbaStringToRgbaObj(d.material)),1<d.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=this._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a)));var _=this._core.extend(o,d,!0);null==t&&console.log("geojson is required");var o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t),f=this;o.then(function(e){for(var t,i=e.entities.values,o=new f._cesium.PrimitiveCollection,r=0;r<i.length;r++){var n=i[r],a=null;if(_.clampToGround){_.positions=n.polyline.positions._value;var s={positions:n.polyline.positions._value,width:_.width},s=new f._cesium.GroundPolylineGeometry(s),a=new f._cesium.GeometryInstance({id:n,geometry:s,attributes:{color:new f._cesium.ColorGeometryInstanceAttribute.fromColor(_.material)}})}else{for(var l=[],r=0;r<n.polyline.positions._value.length;r++){f._viewer.scene.globe.ellipsoid;var u=f._cesium.Cartographic.fromCartesian(n.polyline.positions._value[r]),c=f._cesium.Math.toDegrees(u.longitude),h=f._cesium.Math.toDegrees(u.latitude),u=u.height+_.height,u=new f._cesium.Cartesian3.fromDegrees(c,h,u);l.push(u)}_.positions=l;var m=new f._cesium.PolylineGeometry(_),m=f._cesium.PolylineGeometry.createGeometry(m);a=new f._cesium.GeometryInstance({id:n,geometry:m,attributes:{color:new f._cesium.ColorGeometryInstanceAttribute.fromColor(_.material)}})}n.positions=_.positions;m="material:"+255*_.material.red+","+255*_.material.green+","+255*_.material.blue;f.Legend.push(m);m=null,m=_.clampToGround?new f._cesium.GroundPolylinePrimitive({geometryInstances:a,appearance:new f._cesium.MaterialAppearance({material:new f._cesium.Material({fabric:{type:"Color",uniforms:{color:_.material}}}),faceForward:!0,flat:!1})}):new f._cesium.Primitive({geometryInstances:a,appearance:new f._cesium.PolylineMaterialAppearance({material:new f._cesium.Material({fabric:{type:"Color",uniforms:{color:_.material}}})}),shadows:f._cesium.ShadowMode.ENABLED});o.add(m)}d&&d.time&&(t=new f._cesium.TimeIntervalCollection([new f._cesium.TimeInterval({start:d.time.start?f._cesium.JulianDate.fromDate(new Date(d.time.start)):f._cesium.Iso8601.MINIMUM_VALUE,stop:d.time.end?f._cesium.JulianDate.fromDate(new Date(d.time.end)):f._cesium.Iso8601.MAXIMUM_VALUE})])),f._viewer.scene.primitives.add(o,t).show=_.show,f.item=o,p||f.setVisibility(!1),"function"==typeof g&&g(f.item)}),this._core.isnull(_.id)&&(_.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+_.id);t={id:_.id,name:e,checked:p,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t,style:_};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},We.prototype.createGroundPolylineGeoJsonFeatureLayer=function(e,t,d,i,p,g){var o={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30};this._core.isnull(d)||this._core.isnull(d.material)||"["==d.material.toString().charAt(0)&&"]"==d.material.toString().charAt(d.material.length-1)||(this._core.isHtmlColor(d.material)?d.material=this._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=this._color.rgbaStringToRgbaObj(d.material)),1<d.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=this._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a)));var _=this._core.extend(o,d,!0);null==t&&console.log("geojson is required");var o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t),f=this;o.then(function(e){for(var t,i=e.entities.values,o=new f._cesium.PrimitiveCollection,r=0;r<i.length;r++){var n=i[r],a=null;if(_.clampToGround){_.positions=n.polyline.positions._value;var s={positions:n.polyline.positions._value,width:_.width},s=new f._cesium.GroundPolylineGeometry(s),a=new f._cesium.GeometryInstance({id:n,geometry:s,attributes:{color:new f._cesium.ColorGeometryInstanceAttribute.fromColor(_.material)}})}else{for(var l=[],r=0;r<n.polyline.positions._value.length;r++){f._viewer.scene.globe.ellipsoid;var u=f._cesium.Cartographic.fromCartesian(n.polyline.positions._value[r]),c=f._cesium.Math.toDegrees(u.longitude),h=f._cesium.Math.toDegrees(u.latitude),u=u.height+_.height,u=new f._cesium.Cartesian3.fromDegrees(c,h,u);l.push(u)}_.positions=l;var m=new f._cesium.PolylineGeometry(_),m=f._cesium.PolylineGeometry.createGeometry(m);a=new f._cesium.GeometryInstance({id:n,geometry:m,attributes:{color:new f._cesium.ColorGeometryInstanceAttribute.fromColor(_.material)}})}n.positions=_.positions;m="material:"+255*_.material.red+","+255*_.material.green+","+255*_.material.blue;f.Legend.push(m);m=null,m=_.clampToGround?new f._cesium.GroundPolylinePrimitive({geometryInstances:a,appearance:new f._cesium.MaterialAppearance({material:new f._cesium.Material({fabric:{type:"Color",uniforms:{color:_.material}}}),faceForward:!0,flat:!1})}):new f._cesium.Primitive({geometryInstances:a,appearance:new f._cesium.PolylineMaterialAppearance({material:new f._cesium.Material({fabric:{type:"Color",uniforms:{color:_.material}}})}),shadows:f._cesium.ShadowMode.ENABLED});o.add(m)}d&&d.time&&(t=new f._cesium.TimeIntervalCollection([new f._cesium.TimeInterval({start:d.time.start?f._cesium.JulianDate.fromDate(new Date(d.time.start)):f._cesium.Iso8601.MINIMUM_VALUE,stop:d.time.end?f._cesium.JulianDate.fromDate(new Date(d.time.end)):f._cesium.Iso8601.MAXIMUM_VALUE})])),f._viewer.scene.primitives.add(o,t).show=_.show,f.item=o,p||f.setVisibility(!1),"function"==typeof g&&g(f.item)}),this._core.isnull(_.id)&&(_.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+_.id);t={id:_.id,name:e,checked:p,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t,style:_};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},We.prototype.createPolylineVectorGeoJsonFeatureLayerProvider1=function(e,t,c,i,o,r){var n={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(c)||this._core.isnull(c.material)||"["==c.material.toString().charAt(0)&&"]"==c.material.toString().charAt(c.material.length-1)||(this._core.isHtmlColor(c.material)?c.material=this._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=this._color.rgbaStringToRgbaObj(c.material)),1<c.material.r&&(c.material.r=c.material.r/255),1<c.material.g&&(c.material.g=c.material.g/255),1<c.material.b&&(c.material.b=c.material.b/255),1<c.material.a&&(c.material.a=c.material.a/255),c.material=this._color.createColor(c.material.r,c.material.g,c.material.b,c.material.a)));var h=this._core.extend(n,c,!0),m=this,a=new Ae(this._viewer,this._cesium,a);(this._Provider=a)._loadTile=function(e){m.Legend=[];var u=new m._cesium.PrimitiveCollection;return e.features.forEach(function(s){var e,i=[],l=!1;function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):(i.push(e[t]),2!==t||l||(l=!0))}if(/^\[/.test(c.material)&&/\]$/.test(c.material)&&(e=c.material.replace(/\[/,"").replace(/\]/,""),h.material=s.properties[e],m._core.isHtmlColor(h.material)?h.material=m._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=m._color.rgbaStringToRgbaObj(h.material)),1<h.material.r&&(h.material.r=h.material.r/255),1<h.material.g&&(h.material.g=h.material.g/255),1<h.material.b&&(h.material.b=h.material.b/255),1<h.material.a&&(h.material.a=h.material.a/255),h.material=m._color.createColor(h.material.r,h.material.g,h.material.b,h.material.a))),Array.isArray(s.geometry.coordinates)&&0<s.geometry.coordinates.length)if(Array.isArray(s.geometry.coordinates[0][0]))for(var t=0;t<s.geometry.coordinates.length;t++)i=[],o(s.geometry.coordinates[t]),r(i);else o(s.geometry.coordinates),r(i);function r(e){var t=l?m._cesium.Cartesian3.fromDegreesArrayHeights(e):m._cesium.Cartesian3.fromDegreesArray(e);h.positions=t;var i={positions:h.positions,width:h.width};s.positions=t,s.treeID=h.id,s.VectorType="polyline",s.VectorStyle={haveZ:l,width:h.width,positions:e,material:h.material,clampToGround:h.clampToGround};t=null;if(h.clampToGround)i=new m._cesium.GroundPolylineGeometry(i),t=new m._cesium.GeometryInstance({id:s,geometry:i,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}});else{var o=e,r=e.length/2+1+e.length;/^\[/.test(c.height)&&/\]$/.test(c.height)&&(a=c.height.replace(/\[/,"").replace(/\]/,""),h.height=s.properties[a]);for(var n=2;n<r;n+=3)o.splice(n,0,parseFloat(h.height));var a=m._cesium.Cartesian3.fromDegreesArrayHeights(o);h.positions=a,s.positions=a;a=new m._cesium.PolylineGeometry(h);t=new m._cesium.GeometryInstance({id:s,geometry:a,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}})}a="material:"+255*h.material.red+","+255*h.material.green+","+255*h.material.blue;m.Legend.push(a);a=null,a=h.clampToGround?new m._cesium.GroundPolylinePrimitive({geometryInstances:t,appearance:new m._cesium.MaterialAppearance({material:new m._cesium.Material({fabric:{type:"Color",uniforms:{color:h.material}}}),faceForward:!0,flat:!1})}):new m._cesium.Primitive({geometryInstances:t,appearance:new m._cesium.PolylineMaterialAppearance({material:new m._cesium.Material({fabric:{type:"Color",uniforms:{color:h.material}}})}),shadows:m._cesium.ShadowMode.ENABLED});u.add(a)}}),u},c&&c.time&&(a.availability=new m._cesium.TimeIntervalCollection([new m._cesium.TimeInterval({start:c.time.start?m._cesium.JulianDate.fromDate(new Date(c.time.start)):m._cesium.Iso8601.MINIMUM_VALUE,stop:c.time.end?m._cesium.JulianDate.fromDate(new Date(c.time.end)):m._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=a._primitiveCollection,a.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:h.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t.url,style:c};return this._Provider.treeID=h.id,this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},We.prototype.createPolylineVectorGeoJsonFeatureLayerProvider=function(e,r,m,t,i,o){var n={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,outlineWidth:1,show:!0,material:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.WHITE,height:30},a={url:r.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:r.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(r.srs,"EPSG:4326")+":{z}",TILEMATRIXSET:this._core.defaultValue(r.srs,"EPSG:4326"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:m.level_min,lowerLevelLimit:m.level_max,Cesium:this._cesium};this._core.isnull(m)||this._core.isnull(m.material)||"["==m.material.toString().charAt(0)&&"]"==m.material.toString().charAt(m.material.length-1)||(m.material=Cesium.Color.fromCssColorString(m.material)),this._core.isnull(m)||this._core.isnull(m.outlineColor)||(m.outlineColor=Cesium.Color.fromCssColorString(m.outlineColor));var d=this._core.extend({...n},m,!0),s=this;this._urlTemplate=r.url+"?"+this._core._serialize(a.urlParams);var l=r.url+"?"+this._core._serialize(a.urlParams);s._core.xhr({url:r.url+"?service=WMTS&request=GetCapabilities",type:"get",isXml:!0,success:function(o){o=s._core.xml2json(o);let e=o.Contents&&o.Contents.Layer;o=e.filter(e=>e.Identifier===r.layer)[0];if(o){let e=o.TileMatrixSetLink,t=r.srs||"EPSG:4326",i=e.filter(e=>e.TileMatrixSet===t)[0];i&&(s.TileMatrixLimits={},i.TileMatrixSetLimits&&i.TileMatrixSetLimits.TileMatrixLimits.forEach(e=>{let t=e.TileMatrix;t=t.split(":");var i=t[t.length-1];s.TileMatrixLimits[i]={maxCol:e.MaxTileCol,minCol:e.MinTileCol,maxRow:e.MaxTileRow,minRow:e.MinTileRow}}))}s.initThisProvider()}}),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this.initThisProvider=()=>{this.initThisProvider=void 0,this._Provider.loadTile=function(e,t){!function(u,c,h){if(c.state===Cesium.QuadtreeTileLoadState.START){if(c.data={lines:[],geometryPrimitive:void 0},!(c.level>=m.level_min&&c.level<m.level_max&&h.item.show))return c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0;if(h.TileMatrixLimits){var e=h.TileMatrixLimits[c.level];if(c.x>e.maxCol||c.x<e.minCol||c.y>e.maxRow||c.y<e.minRow)return c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0}e=l.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level);h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var r,n=[],i=[],a=!1;for(r of e.features){var t,i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):(2===t&&(e[t]=d.height||e[t],a=!0),i.push(e[t]),1===t&&2===e.length&&i.push(d.height||0))}if(/^\[/.test(m.material)&&/\]$/.test(m.material)&&(t=m.material.replace(/\[/,"").replace(/\]/,""),d.material=r.properties[t],d.material=Cesium.Color.fromCssColorString(d.material)),/^\[/.test(m.height)&&/\]$/.test(m.height)&&(t=m.height.replace(/\[/,"").replace(/\]/,""),d.height=r.properties[t]),Array.isArray(r.geometry.coordinates)&&0<r.geometry.coordinates.length)if(Array.isArray(r.geometry.coordinates[0][0]))for(var s=0;s<r.geometry.coordinates.length;s++)i=[],o(r.geometry.coordinates[s]),l(i);else o(r.geometry.coordinates),l(i);function l(e){var t=h._cesium.Cartesian3.fromDegreesArrayHeights(e);d.positions=t;var i={positions:d.positions,width:d.width};r.positions=t,r.treeID=d.id,r.VectorType="polyline",r.VectorStyle={haveZ:a,width:d.width,positions:e,material:d.material,clampToGround:d.clampToGround};e=null;e=d.clampToGround?(i=new h._cesium.GroundPolylineGeometry(i),new h._cesium.GeometryInstance({id:r,geometry:i,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(d.material),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(d.near,d.far)}})):(o=new h._cesium.PolylineGeometry(d),new h._cesium.GeometryInstance({id:r,geometry:o,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(d.material),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(d.near,d.far)}}));var o="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;h.Legend.push(o),n.push(e)}}e=null,e=d.clampToGround?new h._cesium.GroundPolylinePrimitive({geometryInstances:n,appearance:new h._cesium.MaterialAppearance({material:new h._cesium.Material({fabric:{type:"PolylineOutline",uniforms:{color:d.material,outlineColor:d.outlineColor,outlineWidth:d.outlineWidth}}}),faceForward:!0,flat:!1})}):new h._cesium.Primitive({geometryInstances:n,appearance:new h._cesium.PolylineMaterialAppearance({material:new h._cesium.Material({fabric:{type:"PolylineOutline",uniforms:{color:d.material,outlineColor:d.outlineColor,outlineWidth:d.outlineWidth}}})}),shadows:h._cesium.ShadowMode.ENABLED});c.data.geometryPrimitive=e,c.state=Cesium.QuadtreeTileLoadState.LOADING,c.state===Cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive.update(u,[]),c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0)},error:function(){null==c.count&&(c.count=0),c.count+=1,2<=c.count?(c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0):c.state=Cesium.QuadtreeTileLoadState.START}}),c.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,s)}};let u,c;this.saveDefaultVectorData=()=>{c=s._core.extend({},m,!0)},this.restoreVector=()=>{c&&(m=c,d=s._core.extend({...n},m,!0),s._Provider._normalTile=m.level_max-1,s._primitive&&s._primitive._tilesToRender&&s._primitive._tilesToRender.length&&(s._primitive._tilesToRender.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),s._primitive._tileToUpdateHeights.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),s._primitive._tileToUpdateHeights=[],s._primitive._tilesToRender=[])),c=void 0},this.updataVector=(e={})=>{(e.material||e.outlineColor)&&(e.material&&(e.material=Cesium.Color.fromCssColorString(e.material)),e.outlineColor&&(e.outlineColor=Cesium.Color.fromCssColorString(e.outlineColor))),void 0===e.minimumLevel&&void 0===e.maximumLevel||(void 0!==e.minimumLevel&&(e.level_min=e.minimumLevel),void 0!==e.maximumLevel&&(e.level_max=e.maximumLevel)),m=s._core.extend(m,e,!0),d=s._core.extend(d,m,!0),s._Provider._normalTile=m.level_max-1,s._primitive&&s._primitive._tilesToRender&&s._primitive._tilesToRender.length&&(clearTimeout(u),u=setTimeout(()=>{s._primitive._tilesToRender.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),s._primitive._tileToUpdateHeights.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),s._primitive._tileToUpdateHeights=[],s._primitive._tilesToRender=[]},100))},this._forceRefreshProvider=this._Provider,this._primitive=new s._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});a=this._viewer.scene;a.primitives.add(this._primitive),a.primitivesQuadTrees&&a.primitivesQuadTrees.push(this._primitive),m&&m.time&&(geoJSONVectorTileProvider.availability=new s._cesium.TimeIntervalCollection([new s._cesium.TimeInterval({start:m.time.start?s._cesium.JulianDate.fromDate(new Date(m.time.start)):s._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?s._cesium.JulianDate.fromDate(new Date(m.time.end)):s._cesium.Iso8601.MAXIMUM_VALUE})])),i||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=r.minx,this.south=r.miny,this.east=r.maxx,this.north=r.maxy;e={id:d.id,name:e,checked:!0,pId:this._core.isnull(t)?0:t,type:"polylineLayer",item:this,url:r.url,style:m};return this._Provider.treeID=d.id,this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(t)?0:t),"function"==typeof o&&o(this.item),this},We.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel_obsolete=function(e,t,a,i,o,r){var n={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a)));var c=this._core.extend(n,a,!0),h=this,s=new Ae(this._viewer,this._cesium,s);(this._Provider=s)._loadTile=function(e,t){var l=new h._cesium.PrimitiveCollection,u=[];return e.features.forEach(function(s){var e,i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):i.push(e[t])}if(/^\[/.test(a.material)&&/\]$/.test(a.material)&&(e=a.material.replace(/\[/,"").replace(/\]/,""),c.material=s.properties[e],h._core.isHtmlColor(c.material)?c.material=h._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=h._color.rgbaStringToRgbaObj(c.material)),1<c.material.r&&(c.material.r=c.material.r/255),1<c.material.g&&(c.material.g=c.material.g/255),1<c.material.b&&(c.material.b=c.material.b/255),1<c.material.a&&(c.material.a=c.material.a/255),c.material=h._color.createColor(c.material.r,c.material.g,c.material.b,c.material.a))),Array.isArray(s.geometry.coordinates)&&0<s.geometry.coordinates.length)if(Array.isArray(s.geometry.coordinates[0][0]))for(var t=0;t<s.geometry.coordinates.length;t++)i=[],o(s.geometry.coordinates[t]),r(i),n(i);else o(s.geometry.coordinates),r(i),n(i);function r(e){var t=h._cesium.Cartesian3.fromDegreesArray(e);c.positions=t,s.positions=t;var i={positions:c.positions,width:c.width},t=null;if(c.clampToGround)i=new h._cesium.GroundPolylineGeometry(i),t=new h._cesium.GeometryInstance({id:s,geometry:i,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}});else{for(var o=e,r=e.length/2+1+e.length,n=2;n<r;n+=3)o.splice(n,0,parseFloat(c.height));var a=h._cesium.Cartesian3.fromDegreesArrayHeights(o);c.positions=a;a=new h._cesium.PolylineGeometry(c),a=h._cesium.PolylineGeometry.createGeometry(a);t=new h._cesium.GeometryInstance({id:s,geometry:a,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}})}a=null,a=c.clampToGround?new h._cesium.GroundPolylinePrimitive({geometryInstances:t,appearance:new h._cesium.MaterialAppearance({material:new h._cesium.Material({fabric:{type:"Color",uniforms:{color:c.material}}}),faceForward:!0,flat:!1})}):new h._cesium.Primitive({geometryInstances:t,appearance:new h._cesium.PolylineMaterialAppearance({material:new h._cesium.Material({fabric:{type:"Color",uniforms:{color:c.material}}})}),shadows:h._cesium.ShadowMode.ENABLED});l.add(a)}function n(e){for(var t=c.clampToGround?h._cesium.Cartesian3.fromDegreesArray(e):h._cesium.Cartesian3.fromDegreesArrayHeights(e),i=1;i<t.length;i++){var o=[];o.push(t[i-1]),o.push(t[i]);var r=h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer.scene,t[i-1]).x,n=h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer.scene,t[i-1]).y,a=h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer.scene,t[i]).x,s=h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer.scene,t[i]).y;h.setPolylinemodels(o,r,n,a,s,c,function(e){u.push(e)})}}}),u.length&&(e=new h._cesium.ModelInstanceCollection({url:c.url,instances:u,color:c.color,lightColor:c.lightColor,scale:parseInt(c.scale),heightReference:parseInt(c.heightReference),distanceDisplayCondition:c.distanceDisplayCondition}),l.add(e)),l},a&&a.time&&(s.availability=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:a.time.start?h._cesium.JulianDate.fromDate(new Date(a.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?h._cesium.JulianDate.fromDate(new Date(a.time.end)):h._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=s._primitiveCollection,s.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t.url,style:a};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},We.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel=function(e,t,p,i,o,r){var n={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this.item.show=o,this._core.isnull(p)||this._core.isnull(p.material)||"["==p.material.toString().charAt(0)&&"]"==p.material.toString().charAt(p.material.length-1)||(this._core.isHtmlColor(p.material)?p.material=this._color.colorFromHtmlColor(p.material):(/^rgb/.test(p.material)&&(p.material=this._color.rgbaStringToRgbaObj(p.material)),1<p.material.r&&(p.material.r=p.material.r/255),1<p.material.g&&(p.material.g=p.material.g/255),1<p.material.b&&(p.material.b=p.material.b/255),1<p.material.a&&(p.material.a=p.material.a/255),p.material=this._color.createColor(p.material.r,p.material.g,p.material.b,p.material.a)));var g=this._core.extend(n,p,!0),s=this;this._urlTemplate=t.url+"?"+this._core._serialize(a.urlParams);var l=t.url+"?"+this._core._serialize(a.urlParams);this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=p.level_max-1,this._Provider.loadTile=function(e,t){!function(m,d){if(m.state===Cesium.QuadtreeTileLoadState.START){if(m.data={lines:[],geometryPrimitive:void 0},!(m.level>=p.level_min&&m.level<p.level_max&&d.item.show))return m.state=Cesium.QuadtreeTileLoadState.DONE,m.renderable=!0;var e=l.replace(window.encodeURIComponent("{x}"),m.x).replace(window.encodeURIComponent("{y}"),m.y).replace(window.encodeURIComponent("{z}"),m.level);d._cache&&(e+="&"+d._core.getuid()),d._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var l=[],s=new d._cesium.PrimitiveCollection,t=e.features,i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):i.push(e[t])}function r(e){var t=d._cesium.Cartesian3.fromDegreesArray(e);g.positions=t,c.positions=t;var i={positions:g.positions,width:g.width},t=null;if(g.clampToGround)i=new d._cesium.GroundPolylineGeometry(i),t=new d._cesium.GeometryInstance({id:c,geometry:i,attributes:{color:new d._cesium.ColorGeometryInstanceAttribute.fromColor(g.material)}});else{for(var o=e,r=e.length/2+1+e.length,n=2;n<r;n+=3)o.splice(n,0,parseFloat(g.height));var a=d._cesium.Cartesian3.fromDegreesArrayHeights(o);g.positions=a;a=new d._cesium.PolylineGeometry(g),a=d._cesium.PolylineGeometry.createGeometry(a);t=new d._cesium.GeometryInstance({id:c,geometry:a,attributes:{color:new d._cesium.ColorGeometryInstanceAttribute.fromColor(g.material)}})}a=null,a=g.clampToGround?new d._cesium.GroundPolylinePrimitive({geometryInstances:t,appearance:new d._cesium.MaterialAppearance({material:new d._cesium.Material({fabric:{type:"Color",uniforms:{color:g.material}}}),faceForward:!0,flat:!1})}):new d._cesium.Primitive({geometryInstances:t,appearance:new d._cesium.PolylineMaterialAppearance({material:new d._cesium.Material({fabric:{type:"Color",uniforms:{color:g.material}}})}),shadows:d._cesium.ShadowMode.ENABLED});s.add(a)}function n(e){for(var t=g.clampToGround?d._cesium.Cartesian3.fromDegreesArray(e):d._cesium.Cartesian3.fromDegreesArrayHeights(e),i=1;i<t.length;i++)try{var o=[];o.push(t[i-1]),o.push(t[i]);var r=d._cesium.SceneTransforms.wgs84ToWindowCoordinates(d._viewer.scene,t[i-1]).x,n=d._cesium.SceneTransforms.wgs84ToWindowCoordinates(d._viewer.scene,t[i-1]).y,a=d._cesium.SceneTransforms.wgs84ToWindowCoordinates(d._viewer.scene,t[i]).x,s=d._cesium.SceneTransforms.wgs84ToWindowCoordinates(d._viewer.scene,t[i]).y;d.setPolylinemodels(o,r,n,a,s,g,function(e){l.push(e)})}catch(e){}}/^\[/.test(p.material)&&/\]$/.test(p.material)&&(a=p.material.replace(/\[/,"").replace(/\]/,""),g.material=c.properties[a],d._core.isHtmlColor(g.material)?g.material=d._color.colorFromHtmlColor(g.material):(/^rgb/.test(g.material)&&(g.material=d._color.rgbaStringToRgbaObj(g.material)),1<g.material.r&&(g.material.r=g.material.r/255),1<g.material.g&&(g.material.g=g.material.g/255),1<g.material.b&&(g.material.b=g.material.b/255),1<g.material.a&&(g.material.a=g.material.a/255),g.material=d._color.createColor(g.material.r,g.material.g,g.material.b,g.material.a)));for(var a,u=0;u<t.length;u++){var c=t[u];if(Array.isArray(c.geometry.coordinates)&&0<c.geometry.coordinates.length)if(Array.isArray(c.geometry.coordinates[0][0]))for(var h=0;h<c.geometry.coordinates.length;h++)i=[],o(c.geometry.coordinates[h]),r(i),n(i);else o(c.geometry.coordinates),r(i),n(i)}l.length&&(a=new d._cesium.ModelInstanceCollection({url:g.url,instances:l,color:g.color,lightColor:g.lightColor,scale:parseInt(g.scale),heightReference:parseInt(g.heightReference),distanceDisplayCondition:g.distanceDisplayCondition}),s.add(a)),m.data.geometryPrimitive=s},error:function(){null==m.count&&(m.count=0),m.count+=1,2<=m.count?(m.state=Cesium.QuadtreeTileLoadState.DONE,m.renderable=!0):m.state=Cesium.QuadtreeTileLoadState.START}}),m.state=Cesium.QuadtreeTileLoadState.LOADING}}(t,s)},this._primitive=new s._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});a=this._viewer.scene;a.primitives.add(this._primitive),a.primitivesQuadTrees&&a.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(g.id)&&(g.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+g.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:g.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t.url,style:p};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},We.prototype.setPolylinemodels=function(e,t,i,o,r,n,a){var s=this._cesium,l=this._core.getSpaceDistancem(e,s),u=10,c=parseFloat(n.distance);0==c||(u=parseInt(l/c));for(var c=e[0],e=e[e.length-1],c=s.Cartographic.fromCartesian(c),h=s.Math.toDegrees(c.longitude),m=s.Math.toDegrees(c.latitude),c=s.Cartographic.fromCartesian(e),e=s.Math.toDegrees(c.longitude),c=s.Math.toDegrees(c.latitude),d=u,p=s.Math.lerp(h,e,1/d)-h,g=s.Math.lerp(m,c,1/d)-m,_=0;_<d;_++){var f=s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(h+(_+1)*p,m+(_+1)*g,parseInt(n.height)));Cesium.Matrix4.multiplyByUniformScale(f,parseInt(n.scale),f),a&&a({modelMatrix:f,modelId:n})}},We.prototype.getType=function(){return{label:"线",value:"polylineLayer"}},We.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},We.prototype.deleteObject=function(){if(this._viewer.scene.primitives.remove(this.item),null!=this.model&&null!=this.model&&0<this.model.length)for(var e=0;e<this.model.length;e++)this._viewer.scene.primitives.remove(this.model[e]);try{this._Provider.remove()}catch(e){}},We.prototype.setTreeobj=function(e){this.treeobj=e},We.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},We.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},We.prototype.setVisibility=function(e){if(null!=this.item&&(this.item.show=e),this._Provider&&this._Provider.setStatus(e),null!=this.model&&null!=this.model&&0<this.model.length)for(var t=0;t<this.model.length;t++)this.model[t].show=e},We.prototype.edit=function(e,t){return this.editoption=t,this.isEditting=e,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},We.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},Ye.prototype.exectPointModel=function(e,t,_,i,f,y){var o={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30};this._core.isnull(_)||this._core.isnull(_.material)||"["==_.material.toString().charAt(0)&&"]"==_.material.toString().charAt(_.material.length-1)||(this._core.isHtmlColor(_.material)?_.material=this._color.colorFromHtmlColor(_.material):(/^rgb/.test(_.material)&&(_.material=this._color.rgbaStringToRgbaObj(_.material)),1<_.material.r&&(_.material.r=_.material.r/255),1<_.material.g&&(_.material.g=_.material.g/255),1<_.material.b&&(_.material.b=_.material.b/255),1<_.material.a&&(_.material.a=_.material.a/255),_.material=this._color.createColor(_.material.r,_.material.g,_.material.b,_.material.a))),this._core.isnull(_)||this._core.isnull(_.color)||"["==_.color.toString().charAt(0)&&"]"==_.color.toString().charAt(_.color.length-1)||(this._core.isHtmlColor(_.color)?_.color=this._color.colorFromHtmlColor(_.color):(/^rgb/.test(_.color)&&(_.color=this._color.rgbaStringToRgbaObj(_.color)),1<_.color.r&&(_.color.r=_.color.r/255),1<_.color.g&&(_.color.g=_.color.g/255),1<_.color.b&&(_.color.b=_.color.b/255),1<_.color.a&&(_.color.a=_.color.a/255),_.color=this._color.createColor(_.color.r,_.color.g,_.color.b,_.color.a))),this._core.isnull(_)||this._core.isnull(_.lightColor)||"["==_.lightColor.toString().charAt(0)&&"]"==_.lightColor.toString().charAt(_.lightColor.length-1)||(this._core.isHtmlColor(_.lightColor)?_.lightColor=this._color.colorFromHtmlColor(_.lightColor):(/^rgb/.test(_.lightColor)&&(_.lightColor=this._color.rgbaStringToRgbaObj(_.lightColor)),1<_.lightColor.r&&(_.lightColor.r=_.lightColor.r/255),1<_.lightColor.g&&(_.lightColor.g=_.lightColor.g/255),1<_.lightColor.b&&(_.lightColor.b=_.lightColor.b/255),1<_.lightColor.a&&(_.lightColor.a=_.lightColor.a/255),_.lightColor=this._color.createColor(_.lightColor.r,_.lightColor.g,_.lightColor.b,_.lightColor.a))),this._core.isnull(_)||this._core.isnull(_.linecolor)||"["==_.linecolor.toString().charAt(0)&&"]"==_.linecolor.toString().charAt(_.linecolor.length-1)||(this._core.isHtmlColor(_.linecolor)?_.linecolor=this._color.colorFromHtmlColor(_.linecolor):(/^rgb/.test(_.linecolor)&&(_.linecolor=this._color.rgbaStringToRgbaObj(_.linecolor)),1<_.linecolor.r&&(_.linecolor.r=_.linecolor.r/255),1<_.linecolor.g&&(_.linecolor.g=_.linecolor.g/255),1<_.linecolor.b&&(_.linecolor.b=_.linecolor.b/255),1<_.linecolor.a&&(_.linecolor.a=_.linecolor.a/255),_.linecolor=this._color.createColor(_.linecolor.r,_.linecolor.g,_.linecolor.b,_.linecolor.a)));var v=this._core.extend(o,_,!0);this._core.isnull(_.near)&&(_.near=0),this._core.isnull(_.far)&&(_.far=999999999);var r=parseFloat(_.near),o=parseFloat(_.far),o=new this._cesium.DistanceDisplayCondition(r,o);v.distanceDisplayCondition=o,null==t&&console.log("geojson is required");var o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t),C=this;o.then(function(e){e.entities.values;for(var t,i=[],o=e.entities.values,i=[],r=0;r<o.length;r++){var n=o[r],a=new C._cesium.GeometryInstance({id:n,geometry:new C._cesium.CorridorGeometry({positions:n.polyline.positions._value,width:v.width,height:v.height,arcType:v.arcType,vertexFormat:C._cesium.VertexFormat.POSITION_ONLY}),attributes:{color:new C._cesium.ColorGeometryInstanceAttribute.fromColor(v.linecolor)}});i.push(a)}_&&_.time&&(t=new C._cesium.TimeIntervalCollection([new C._cesium.TimeInterval({start:_.time.start?C._cesium.JulianDate.fromDate(new Date(_.time.start)):C._cesium.Iso8601.MINIMUM_VALUE,stop:_.time.end?C._cesium.JulianDate.fromDate(new Date(_.time.end)):C._cesium.Iso8601.MAXIMUM_VALUE})]));var s=C._viewer.scene.primitives.add(new C._cesium.GroundPrimitive({geometryInstances:i,classificationType:C._cesium.ClassificationType.BOTH}),t);s.show=v.show,C.item=s;for(var l=[],r=0;r<o.length;r++)for(var u=(n=o[r]).polyline.positions.getValue(),c=1;c<u.length;c++)try{var h=[];h.push(u[c-1]),h.push(u[c]);var m=C._cesium.SceneTransforms.wgs84ToWindowCoordinates(C._viewer.scene,u[c-1]).x,d=C._cesium.SceneTransforms.wgs84ToWindowCoordinates(C._viewer.scene,u[c-1]).y,p=C._cesium.SceneTransforms.wgs84ToWindowCoordinates(C._viewer.scene,u[c]).x,g=C._cesium.SceneTransforms.wgs84ToWindowCoordinates(C._viewer.scene,u[c]).y,l=C.setPolylinemodels(h,m,d,p,g,l,v,C._cesium,C._viewer,t)}catch(e){}e=new C._cesium.ModelInstanceCollection({url:v.url,instances:l,color:v.color,lightColor:v.lightColor,scale:parseInt(v.scale),heightReference:parseInt(v.heightReference),distanceDisplayCondition:v.distanceDisplayCondition});C._viewer.scene.primitives.add(e),C.model.push(e),f||C.setVisibility(!1),"function"==typeof y&&y(s)}),this._core.isnull(v.id)&&(v.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+v.id);e={id:v.id,name:e,checked:f,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(i)?0:i),this},Ye.prototype.createPointModel=function(e,c){var h=this,m=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),d=[],t=null,i=0,o=null,p=[],g=e.parameterd;e.objid;var _=e.cyjj,r=e.url;this.modelurl=r;var f=[],n={point:h._cesium.Color.RED,polyline:h._cesium.Color.YELLOW};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(n.point=e.point),""!=e.polyline&&null!=e.polyline&&(n.polyline=e.polyline));var y=this._core.CreateTooltip(),v={spot:[],distance:[],label:[],polyline:[],model:[]};m.setInputAction(function(e){0===d.length?y.showAt(e.endPosition,"左键开始,右键结束!"):y.showAt(e.endPosition,"右键结束!");e=h._viewer.camera.getPickRay(e.endPosition);o=h._viewer.scene.globe.pick(e,h._viewer.scene),2<=d.length&&(h._cesium.defined(t)?(d.pop(),d.push(o)):t=new a(d),i=h._core.getHorizontalDistance(d,h._cesium))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),m.setInputAction(function(e){var t=h._viewer.camera.getPickRay(e.position);o=h._viewer.scene.globe.pick(t,h._viewer.scene),0==d.length&&d.push(o.clone());e={px:e.position.x,py:e.position.y};d.push(o);e={positionsxp:o,lxy:e};f.push(e),v.spot.push(o),v.distance.push(i)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),m.setInputAction(function(e){m.destroy(),d.pop();for(var t=0;t<p.length;t++)h._viewer.entities.remove(p[t]);for(var i=[],o=1;o<f.length;o++){var r=[],n=f[o-1].lxy.px,a=f[o-1].lxy.py,s=f[o].lxy.px,l=f[o].lxy.py,u=g;r.push(f[o-1].positionsxp),r.push(f[o].positionsxp),i=h.setPolylinemodel(r,n,a,s,l,u,_,h.modelurl,i,h._cesium,h._viewer)}v.model=i,""!=c&&null!=c&&"function"==typeof c&&c(v),y.show(!1)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK);var a=(s.prototype._init=function(){var e=this;this.options.polyline.positions=new h._cesium.CallbackProperty(function(){return e.positions},!1);var t=h._viewer.entities.add(this.options);h.item=t,p.push(t),v.polyline.push(t)},s);function s(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:n.polyline,width:3,clampToGround:!0}},this.positions=e,this._init()}return this},Ye.prototype.setPolylinemodel=function(e,t,i,o,r,n,a,s,l,u,c){var h=this._core.getSpaceDistancem(e,u);0==a||(n=parseInt(h/a));var h=e[0],a=e[e.length-1],e=u.Cartographic.fromCartesian(h),m=u.Math.toDegrees(e.longitude),d=u.Math.toDegrees(e.latitude);e.height;h=u.Cartographic.fromCartesian(a),e=u.Math.toDegrees(h.longitude),a=u.Math.toDegrees(h.latitude);h.height;for(var p=n,g=u.Math.lerp(m,e,1/p)-m,_=u.Math.lerp(d,a,1/p)-d,f=u.Math.lerp(t,o,1/p)-t,y=u.Math.lerp(i,r,1/p)-i,v=0;v<p;v++){var C=m+(v+1)*g,w=d+(v+1)*_;(0==v||1==v)&&new u.Cartesian3(C,w,0);b=t+(v+1)*f,C=i+(v+1)*y;var w=c.camera.pickEllipsoid({x:b,y:C},c.scene.globe.ellipsoid),w=u.Cartographic.fromCartesian(w),b=u.Math.toDegrees(w.longitude),C=u.Math.toDegrees(w.latitude),C=u.Transforms.eastNorthUpToFixedFrame(u.Cartesian3.fromDegrees(b,C,6)),C=u.Model.fromGltf({url:s,modelMatrix:C,scale:100});c.scene.primitives.add(C),l.push(C)}return l},Ye.prototype.setPolylinemodels_obsolete=function(e,t,i,o,r,n,a,s,l,u){var c=this._core.getSpaceDistancem(e,s),h=10,m=parseFloat(a.distance);0==m||(h=parseInt(c/m));var d=e[0],c=e[e.length-1],m=s.Cartographic.fromCartesian(d),p=s.Math.toDegrees(m.longitude),g=s.Math.toDegrees(m.latitude);m.height;e=s.Cartographic.fromCartesian(c),d=s.Math.toDegrees(e.longitude),c=s.Math.toDegrees(e.latitude);e.height,s.Math.toDegrees(m.height);var _=h,f=s.Math.lerp(p,d,1/_)-p,y=s.Math.lerp(g,c,1/_)-g;s.Math.lerp(t,o,1/_),s.Math.lerp(i,r,1/_);for(var v=0;v<_;v++){var C=s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(p+(v+1)*f,g+(v+1)*y,a.height));parseInt(a.heightReference);C=s.Model.fromGltf({url:a.url,modelMatrix:C,color:a.color,lightColor:a.lightColor,scale:parseInt(a.scale),heightReference:parseInt(a.heightReference),distanceDisplayCondition:a.distanceDisplayCondition});l.scene.primitives.add(C,u),n.push(C)}return n},Ye.prototype.setPolylinemodels=function(e,t,i,o,r,n,a,s,l,u){var c=this._core.getSpaceDistancem(e,s),h=10,m=parseFloat(a.distance);0==m||(h=parseInt(c/m));var d=e[0],c=e[e.length-1],m=s.Cartographic.fromCartesian(d),p=s.Math.toDegrees(m.longitude),g=s.Math.toDegrees(m.latitude);m.height;e=s.Cartographic.fromCartesian(c),d=s.Math.toDegrees(e.longitude),c=s.Math.toDegrees(e.latitude);e.height,s.Math.toDegrees(m.height);var _=h,f=s.Math.lerp(p,d,1/_)-p,y=s.Math.lerp(g,c,1/_)-g;s.Math.lerp(t,o,1/_),s.Math.lerp(i,r,1/_);for(var v=0;v<_;v++){var C=s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(p+(v+1)*f,g+(v+1)*y,parseInt(a.height||0)));parseInt(a.heightReference),Cesium.Matrix4.multiplyByUniformScale(C,parseInt(a.scale),C),n.push({modelMatrix:C,modelId:a})}return n},Ye.prototype.createPolygonModel=function(e,t,m,i,o,d){var r={height:0,extrudedHeight:0,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:this._cesium.ShadowMode.ENABLED,clampToGround:!0,scale:1,classificationType:this._cesium.ClassificationType.BOTH},p=m.modelurl;this._core.isnull(m)||this._core.isnull(m.fill)||(this._core.isHtmlColor(m.fill)?m.material=this._color.colorFromHtmlColor(m.fill):(/^rgb/.test(m.fill)&&(m.material=this._color.rgbaStringToRgbaObj(m.fill)),1<m.material.r&&(m.material.r=m.material.r/255),1<m.material.g&&(m.material.g=m.material.g/255),1<m.material.b&&(m.material.b=m.material.b/255),1<m.material.a&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))),this._core.isnull(m)||this._core.isnull(m.outlineColor)||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),1<m.outlineColor.r&&(m.outlineColor.r=m.outlineColor.r/255),1<m.outlineColor.g&&(m.outlineColor.g=m.outlineColor.g/255),1<m.outlineColor.b&&(m.outlineColor.b=m.outlineColor.b/255),1<m.outlineColor.a&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))),this._core.isnull(m)||this._core.isnull(m.color)||(this._core.isHtmlColor(m.color)?m.color=this._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=this._color.rgbaStringToRgbaObj(m.color)),1<m.color.r&&(m.color.r=m.color.r/255),1<m.color.g&&(m.color.g=m.color.g/255),1<m.color.b&&(m.color.b=m.color.b/255),1<m.color.a&&(m.color.a=m.color.a/255),m.color=this._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a))),this._core.isnull(m)||this._core.isnull(m.lightColor)||(this._core.isHtmlColor(m.lightColor)?m.lightColor=this._color.colorFromHtmlColor(m.lightColor):(/^rgb/.test(m.lightColor)&&(m.lightColor=this._color.rgbaStringToRgbaObj(m.lightColor)),1<m.lightColor.r&&(m.lightColor.r=m.lightColor.r/255),1<m.lightColor.g&&(m.lightColor.g=m.lightColor.g/255),1<m.lightColor.b&&(m.lightColor.b=m.lightColor.b/255),1<m.lightColor.a&&(m.lightColor.a=m.lightColor.a/255),m.lightColor=this._color.createColor(m.lightColor.r,m.lightColor.g,m.lightColor.b,m.lightColor.a)));var g=this._core.extend(r,m,!0);m.checked=o,g.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND;null==t&&console.log("geojson is required");r=null,r=t.then?t:this._cesium.GeoJsonDataSource.load(t,{clampToGround:!0});this._viewer.dataSources.add(r);var _,f=this;m&&m.time&&(_=new f._cesium.TimeIntervalCollection([new f._cesium.TimeInterval({start:m.time.start?f._cesium.JulianDate.fromDate(new Date(m.time.start)):f._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?f._cesium.JulianDate.fromDate(new Date(m.time.end)):f._cesium.Iso8601.MAXIMUM_VALUE})])),r.then(function(e){f.item=e,f.model=[];var t=e.entities.values;f._core.isnull(m.near)&&(m.near=0),f._core.isnull(m.far)&&(m.far=999999999);var i=parseFloat(m.near),o=parseFloat(m.far),r=new f._cesium.DistanceDisplayCondition(i,o);g.distanceDisplayCondition=r;for(var n=0;n<t.length;n++){var a=t[n];g.height=parseFloat(f._core.extendgl(a,m.height,g.height)),g.extrudedHeight=parseFloat(f._core.extendgl(a,m.extrudedHeight,g.extrudedHeight)),g.heightReference=f._core.extendgl(a,m.heightReference,g.heightReference),g.show=f._core.extendgl(a,m.show,g.show),g.material=f._core.extendgl(a,m.material,g.material),g.outline=f._core.extendgl(a,m.outline,g.outline),g.outlineColor=f._core.extendgl(a,m.outlineColor,g.outlineColor),g.outlineWidth=parseFloat(f._core.extendgl(a,m.outlineWidth,g.outlineWidth)),g.stRotation=f._core.extendgl(a,m.stRotation,g.stRotation),g.granularity=f._core.extendgl(a,m.granularity,g.granularity),g.distanceDisplayCondition=f._core.extendgl(a,m.distanceDisplayCondition,g.distanceDisplayCondition),g.perPositionHeight=f._core.extendgl(a,m.perPositionHeight,g.perPositionHeight),g.closeTop=f._core.extendgl(a,m.closeTop,g.closeTop),g.closeBottom=f._core.extendgl(a,m.closeBottom,g.closeBottom),g.shadows=f._core.extendgl(a,m.shadows,g.shadows),g.classificationType=f._core.extendgl(a,m.classificationType,g.classificationType),a.polygon._hierarchy._value.positions,a.polygon.heightReference=1,a.polygon.show=g.show,a.polygon.material=g.material,a.polygon.outline=g.outline,a.polygon.outlineColor=g.outlineColor,a.polygon.outlineWidth=g.outlineWidth,a.polygon.stRotation=g.stRotation,a.polygon.granularity=g.granularity,a.polygon.distanceDisplayCondition=r,a.polygon.closeTop=g.closeTop,a.polygon.closeBottom=g.closeBottom,a.polygon.shadows=g.shadows,a.polygon.classificationType=g.classificationType,_&&(a.availability=_);for(var s=[],l=a.polygon.hierarchy.getValue().positions,u=0;u<l.length;u++){var c=f._cesium.Math.toDegrees(f._cesium.Cartographic.fromCartesian(l[u]).longitude),h=f._cesium.Math.toDegrees(f._cesium.Cartographic.fromCartesian(l[u]).latitude);s.push(c),s.push(h)}a=f.getTheBottomPoint(s);f.scanningPolygon(a,g.offset_x,g.offset_y,s).forEach(function(e){e=f._cesium.Transforms.eastNorthUpToFixedFrame(f._cesium.Cartesian3.fromDegrees(e.lon,e.lat,g.height)),e=f._cesium.Model.fromGltf({url:p,color:g.color,silhouetteColor:g.lightColor,silhouetteSize:g.lightWidth,modelMatrix:e,scale:g.scale,heightReference:parseInt(g.heightReference),distanceDisplayCondition:r});f._viewer.scene.primitives.add(e,_),e.time=_,f.model.push(e)})}m.checked||f.setVisibility(!1),"function"==typeof d&&d(e)}),this._core.isnull(g.id)&&(g.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+g.id);t={id:g.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t,style:g};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Ye.prototype.setItem=function(e){this.item=e},Ye.prototype.modelMove=function(){this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this.yd=!1;var r=this;this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._tree.handler.setInputAction(function(e){r._viewer.scene.pickPosition(e.position);var t,i,o,e=r._viewer.scene.pick(e.position);null!=r.yd&&r.yd&&r._tree.handler.destroy(),r.yd=!0,null!=e.tileset&&(t=e.tileset,i=r._cesium.Cartographic.fromCartesian(t.boundingSphere.center),o=r._cesium.Cartesian3.fromRadians(i.longitude,i.latitude,i.height),r._tree.handler.setInputAction(function(e){e=r._viewer.scene.pickPosition(e.endPosition),e=r._cesium.Cartographic.fromCartesian(e),e=r._cesium.Cartesian3.fromRadians(e.longitude,e.latitude,i.height),e=r._cesium.Cartesian3.subtract(e,o,new r._cesium.Cartesian3);t.modelMatrix=r._cesium.Matrix4.fromTranslation(e)},r._cesium.ScreenSpaceEventType.MOUSE_MOVE))},r._cesium.ScreenSpaceEventType.LEFT_CLICK)},Ye.prototype.getTheBottomPoint=function(e){for(var t=90,i=0,o=1;o<e.length;o+=2)t=t<e[o]?t:(i=o)&&e[o];return{lon:e[i-1],lat:e[i]}},Ye.prototype.scanningPolygon=function(e,t,i,o){for(var r,n,a,s=[],l=180,u=-180,c=-90,h=0;h<o.length;h+=2)c=c>o[h+1]?c:o[h+1],l=l<o[h]?l:o[h],u=u>o[h]?u:o[h];var i=this.GetPositionFromA_D(e.lat,e.lon,i,0),m=this.GetPositionFromA_D(e.lat,e.lon,t,90)[0]-e.lon,d=i[1]-e.lat;for(s.push({lon:e.lon,lat:e.lat}),(a={lon:e.lon,lat:e.lat}).lat+=d;a.lat<=c;a.lat+=d){for(r={lon:a.lon-m,lat:a.lat},n={lon:a.lon+m,lat:a.lat},this.IsInPolygon(a.lon,a.lat,o)&&s.push({lon:a.lon,lat:a.lat});r.lon>=l;r.lon-=m)this.IsInPolygon(r.lon,r.lat,o)&&s.push({lon:r.lon,lat:r.lat});for(;n.lon<=u;n.lon+=m)this.IsInPolygon(n.lon,n.lat,o)&&s.push({lon:n.lon,lat:n.lat})}return s},Ye.prototype.GetPositionFromA_D=function(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=6356725+21412*(90-e)/90;return[180*(r/(o*Math.cos(e*Math.PI/180))+t*Math.PI/180)/Math.PI,180*(i/o+e*Math.PI/180)/Math.PI]},Ye.prototype.IsInPolygon=function(e,t,i){var o,r,n,a,s=0;if(i.length<6)return!1;i.push(i[0],i[1]);for(var l=0;l<i.length-2;l+=2)o=i[l],n=i[l+1],r=i[l+2],a=i[l+3],(n<=t&&t<a||a<=t&&t<n)&&0<Math.abs(n-a)&&o-(o-r)*(n-t)/(n-a)<=e&&s++;return s%2!=0},Ye.prototype.createModel=function(e,t,i,o,r,n){t={id:this._core.getuid(),uri:t,show:!0,heading:0,pitch:0,roll:0,scale:1},i=this._core.extend(t,i,!0);this._position=e;e={id:i.id,position:this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),model:i};(i.heading||i.pitch||i.roll)&&(this.heading=i.heading,this.pitch=i.pitch,this.roll=i.roll,e.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(i.heading,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(i.pitch,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(i.roll,0)))));var a=this;i.rotate&&(e.orientation=new this._cesium.CallbackProperty(function(){return a.heading=a.heading+a.rotate,a._cesium.Transforms.headingPitchRollQuaternion(a._cesium.Cartesian3.fromDegrees(a._position[0],a._position[1],a._position[2]),new a._cesium.HeadingPitchRoll(a._cesium.Math.toRadians(a._cesium.defaultValue(a.heading,0)),a._cesium.Math.toRadians(a._cesium.defaultValue(a.pitch,0)),a._cesium.Math.toRadians(a._cesium.defaultValue(a.roll,0))))},!1),a.rotate=i.rotate,delete i.rotate),delete i.heading,delete i.pitch,delete i.roll,e.model=i,this.item=this._viewer.entities.add(e),"function"==typeof n&&n(this.item);t={id:this.item.id,name:r||"新建模型"+t.id,pId:this._core.isnull(o)?0:o,type:"Point",item:this.item};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(o)?0:o),this},Ye.prototype.createModelEditable=function(e,t,i,o,r,n){var a={id:this._core.getuid(),uri:t,show:!0,heading:0,pitch:0,roll:0,scale:1},s=this._core.extend(a,i,!0);this._position=e;t={position:this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),model:s},i=this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),e=this.createCylinder(i,new this._cesium.CallbackProperty(function(){var e=l._cesium.Cartesian3.fromDegrees(l._position[0],l._position[1],l._position[2]),t=l._cesium.Math.toRadians(l.heading),t=new l._cesium.HeadingPitchRoll(t,l._cesium.Math.toRadians(l.pitch),l._cesium.Math.toRadians(l.roll));return l._cesium.Transforms.headingPitchRollQuaternion(e,t)},!1),new this._cesium.CallbackProperty(u,!1),new this._cesium.CallbackProperty(c,!1),this._cesium.Color.LIMEGREEN,!1);e.oid=1,this.modelPointArr.push(e);e=this.createCylinder(i,new this._cesium.CallbackProperty(function(){var e=l._cesium.Cartesian3.fromDegrees(l._position[0],l._position[1],l._position[2]),t=l._cesium.Math.toRadians(l.heading),t=new l._cesium.HeadingPitchRoll(t,l._cesium.Math.toRadians(90+l.pitch),l._cesium.Math.toRadians(l.roll));return l._cesium.Transforms.headingPitchRollQuaternion(e,t)},!1),new this._cesium.CallbackProperty(u,!1),new this._cesium.CallbackProperty(c,!1),this._cesium.Color.MEDIUMBLUE,!1);e.oid=2,this.modelPointArr.push(e);e=this.createCylinder(i,new this._cesium.CallbackProperty(function(){var e=l._cesium.Cartesian3.fromDegrees(l._position[0],l._position[1],l._position[2]),t=l._cesium.Math.toRadians(l.heading),t=new l._cesium.HeadingPitchRoll(t,l._cesium.Math.toRadians(l.pitch),l._cesium.Math.toRadians(90+l.roll));return l._cesium.Transforms.headingPitchRollQuaternion(e,t)},!1),new this._cesium.CallbackProperty(u,!1),new this._cesium.CallbackProperty(c,!1),this._cesium.Color.RED,!1);e.oid=3,this.modelPointArr.push(e);e=this.creatBillboard(i,new this._cesium.CallbackProperty(function(){return new l._cesium.Cartesian2(0,-(l.Radius*l.scale))},!1),"../../img/j.png",!1);e.oid=4,this.modelPointArr.push(e);i=this.creatBillboard(i,new this._cesium.CallbackProperty(function(){return new l._cesium.Cartesian2(-(l.Radius*l.scale),0)},!1),"../../img/s.png",!1);i.oid=5,this.modelPointArr.push(i),(s.heading||s.pitch||s.roll)&&(this.heading=s.heading,this.pitch=s.pitch,this.roll=s.roll,t.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(s.heading,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(s.pitch,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(s.roll,0)))));var l=this;function u(){return l.Radius*l.scale}function c(){return 100*l.Radius}s.rotate&&(t.orientation=new this._cesium.CallbackProperty(function(){return l.heading=l.heading+l.rotate,l._cesium.Transforms.headingPitchRollQuaternion(l._cesium.Cartesian3.fromDegrees(l._position[0],l._position[1],l._position[2]),new l._cesium.HeadingPitchRoll(l._cesium.Math.toRadians(l._cesium.defaultValue(l.heading,0)),l._cesium.Math.toRadians(l._cesium.defaultValue(l.pitch,0)),l._cesium.Math.toRadians(l._cesium.defaultValue(l.roll,0))))},!1),l.rotate=s.rotate,delete s.rotate),t.orientation=new this._cesium.CallbackProperty(function(){return l._cesium.Transforms.headingPitchRollQuaternion(l._cesium.Cartesian3.fromDegrees(l._position[0],l._position[1],l._position[2]),new l._cesium.HeadingPitchRoll(l._cesium.Math.toRadians(l._cesium.defaultValue(l.heading,0)),l._cesium.Math.toRadians(l._cesium.defaultValue(l.pitch,0)),l._cesium.Math.toRadians(l._cesium.defaultValue(l.roll,0))))},!1),l.scale=s.scale,t.model.scale=new this._cesium.CallbackProperty(function(){return l.scale},!1),delete s.heading,delete s.pitch,delete s.roll,t.model=s,this.item=this._viewer.entities.add(t),this.item.objId=this.objId,this._core.Entityadd(this),this.state=1,"function"==typeof n&&n(this.item);a={id:this.item.id,name:r||"新建模型"+a.id,pId:this._core.isnull(o)?0:o,type:"Point",item:this.item};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(o)?0:o),this},Ye.prototype.createOrientation=function(e,t,i){var o=this._cesium.Math.toRadians(0),i=new this._cesium.HeadingPitchRoll(o,this._cesium.Math.toRadians(t),this._cesium.Math.toRadians(i));return this._cesium.Transforms.headingPitchRollQuaternion(e,i)},Ye.prototype.createCylinder=function(e,t,i,o,r,n){if(e)return this._viewer.entities.add({position:e,orientation:t,cylinder:{length:10,topRadius:i,bottomRadius:i,fill:!1,material:r.withAlpha(.5),outline:!0,outlineWidth:10,outlineColor:r,numberOfVerticalLines:o,slices:o},show:n})},Ye.prototype.startModify=function(){if(2==this.state||1==this.state){var r=this;this.modifyHandler||(this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var n,a,s,l,u,c,e=0;e<r.modelPointArr.length;e++){var t=r.modelPointArr[e];t&&(t.show=!0)}this.modifyHandler.setInputAction(function(e){var t=r._viewer.scene.pick(e.position);r._cesium.defined(t)&&t.id&&(t.id.objId?r.modifyModel=t.id:!r.modifyPoint||4!=r.modifyPoint.oid&&5!=r.modifyPoint.oid?r.modifyPoint=t.id:(t.id.oid!=r.modifyPoint.oid&&(r.modifyPoint=t.id),4==r.modifyPoint.oid?r.scale=r.scale+1:r.scale=r.scale-1),r.forbidDrawWorld(!0));t=r._cesium.Cartesian3.fromDegrees(r._position[0],r._position[1],r._position[2]);n=r._cesium.SceneTransforms.wgs84ToWindowCoordinates(r._viewer.scene,t),a=e.position,l=r.heading+0,c=r.roll+0,u=r.pitch+0,r.state=2},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){e=r._viewer.scene.pick(e.position);if(!r._cesium.defined(e)||!e.id){for(var t=0;t<r.modelPointArr.length;t++){var i=r.modelPointArr[t];i&&(i.show=!1)}r.modifyHandler&&(r.modifyHandler.destroy(),r.modifyHandler=null)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){if(r._viewer.scene.pick(e.endPosition),r.modifyModel||r.modifyPoint){var t=r._viewer.scene.pickPosition(e.endPosition);if(t)if(r.modifyModel){r.item.position.setValue(t);for(var i=0;i<r.modelPointArr.length;i++){var o=r.modelPointArr[i];o&&o.position.setValue(t)}}else r.modifyPoint&&(s=e.endPosition,e=r.arge(n,a,s),1==r.modifyPoint.oid?r.heading=l+e:2==r.modifyPoint.oid?r.roll=c+e:3==r.modifyPoint.oid&&(r.pitch=u+e))}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){(r.modifyPoint||r.modifyModel)&&(r.modifyPoint&&(4==r.modifyPoint.oid||5==r.modifyPoint.oid)||(r.modifyPoint=null,r.modifyModel=null,r.forbidDrawWorld(!1)))},this._cesium.ScreenSpaceEventType.LEFT_UP)}},Ye.prototype.creatBillboard=function(e,t,i,o){t=this._viewer.entities.add({position:e,show:o,billboard:{image:i,pixelOffset:t,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM}});return t.attr="editPoint",t},Ye.prototype.arge=function(e,t,i){var o=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),e=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),i=Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2)),e=(Math.pow(o,2)+Math.pow(e,2)-Math.pow(i,2))/(2*o*e);return Math.round(180*Math.acos(e)/Math.PI)},Ye.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},Ye.prototype.getCatesian3FromPX=function(e,t,i){var o,r=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=r;if(t.scene.pickPositionSupported&&Cesium.defined(a))o=t.scene.pickPosition(e);else{e=t.camera.getPickRay(e);if(!e)return;o=t.scene.globe.pick(e,t.scene)}return o},Ye.prototype.setTreeobj=function(e){this.treeobj=e},Ye.prototype.setVisibility=function(e){if(this.item.item?this.item.item.show=e:this.item.show=e,0<this.model.length)for(var t=0;t<this.model.length;t++)this.model[t].show=e,this.model[t]._availability&&!e?this.model[t]._availability=void 0:this.model[t].time&&e&&(this.model[t]._availability=this.model[t].time)},Ye.prototype.setOrientation=function(e){(e.heading||e.pitch||e.roll)&&(this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(e.heading,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(e.pitch,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(e.roll,0)))))},Ye.prototype.setScale=function(e){this.item&&this.item.model&&(this.item.model.scale=e)},Ye.prototype.setPosition=function(e){this.item&&this.item.model&&(this._position=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]))},Ye.prototype.getVisibility=function(){return this.item.show},Ye.prototype.deleteObject=function(){if(this.model&&this.model.length)for(var e=0;e<this.model.length;e++)this._viewer.scene.primitives.remove(this.model[e]);try{this._viewer.scene.primitives.remove(this.item)}catch(e){}try{this._viewer.entities.remove(this.item)}catch(e){}try{this._viewer.dataSources.remove(this.item)}catch(e){}try{this._Provider.remove()}catch(e){}},qe.prototype.createPolygonGeoJsonFeatureLayer=function(e,t,i,o,n){var r={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,show:!0};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a)));var a=this._core.extend(r,i,!0);null==t&&console.log("geojson is required");var i=null,i=t.then?t:this._cesium.GeoJsonDataSource.load(t),s=this,l=[];i.then(function(e){for(var t=e.entities.values,i=0;i<t.length;i++){var o=t[i];a.polygonHierarchy=new s._cesium.PolygonHierarchy(o.polygon.hierarchy._value.positions);o=new s._cesium.PolygonGeometry(a),o=s._cesium.PolygonGeometry.createGeometry(o),o=new s._cesium.GeometryInstance({geometry:o});l.push(o)}var r=s._viewer.scene.primitives.add(new s._cesium.Primitive({geometryInstances:l,appearance:new s._cesium.MaterialAppearance({material:new s._cesium.Material({fabric:{type:"Color",uniforms:{color:a.material}}}),faceForward:!0,flat:!1})})),e="material:"+255*a.material.red+","+255*a.material.green+","+255*a.material.blue;s.Legend.push(e),s.item=r,0==a.show&&(r.show=!1),"function"==typeof n&&n(r)}),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id);t={id:a.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t,style:a};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(o)?0:o),this},qe.prototype.deleteObject=function(){if(null!=this.items&&null!=this.items&&0<this.items.length)for(var e=0;e<this.items.length;e++)this._viewer.scene.primitives.remove(this.items[e]);else this._viewer.scene.primitives.remove(this.item);if(null!=this.model&&null!=this.model&&0<this.model.length)for(e=0;e<this.model.length;e++)this._viewer.scene.primitives.remove(this.model[e]);try{this._Provider.remove()}catch(e){}},qe.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},qe.prototype.setVisibility=function(e){if(null!=this.items&&null!=this.items&&0<this.items.length)for(var t=0;t<this.items.length;t++)this.items[t].show=e;else this.item.show=e;if(null!=this.model&&null!=this.model&&0<this.model.length)for(t=0;t<this.model.length;t++)this.model[t].show=e;this._Provider&&this._Provider.setStatus(!e)},qe.prototype.createPolygonVectorGeoJsonFeatureLayerProvider=function(e,t,a,i,o,r){var n={polygonHierarchy:void 0,height:0,extrudedHeight:999999,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a)));var l=this._core.extend(n,a,!0);0==l.extrudedHeight&&(l.extrudedHeight=999999),this.items=[];var u=this,c=new Ae(this._viewer,this._cesium,s);(this._Provider=c)._loadTile=function(e){var n=[];if(scene.primitives,u.Legend=[],new u._cesium.PrimitiveCollection,e.features.forEach(function(o){if(c._isCameraMoving)return null;var i=[];function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):i.push(e[t])}if(Array.isArray(o.geometry.coordinates)&&0<o.geometry.coordinates.length)if(Array.isArray(o.geometry.coordinates[0][0]))for(var e=0;e<o.geometry.coordinates.length;e++)i=[],r(o.geometry.coordinates[e]),t(i);else r(o.geometry.coordinates),t(i);function t(e){var t,i;c._isCameraMoving||(t=u._cesium.Cartesian3.fromDegreesArray(e),/^\[/.test(a.extrudedHeight)&&/\]$/.test(a.extrudedHeight)&&(e=a.extrudedHeight.replace(/\[/,"").replace(/\]/,""),l.extrudedHeight=parseFloat(o.properties[e])),l.extrudedHeight=parseFloat(l.extrudedHeight),1==l.heightReference&&delete l.height,1==l.extrudedHeightReference&&delete l.extrudedHeight,/^\[/.test(a.material)&&/\]$/.test(a.material)&&(i=a.material.replace(/\[/,"").replace(/\]/,""),l.material=o.properties[i],u._core.isHtmlColor(l.material)?l.material=u._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=u._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=u._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),l.polygonHierarchy=new u._cesium.PolygonHierarchy(t),o.positions=t,i=new u._cesium.PolygonGeometry(l),t=null,t=new u._cesium.GeometryInstance({id:o,geometry:i,attributes:{color:new u._cesium.ColorGeometryInstanceAttribute.fromColor(l.material)}}),i="material:"+255*l.material.red+","+255*l.material.green+","+255*l.material.blue,u.Legend.push(i),n.push(t))}}),0<n.length)return new u._cesium.GroundPrimitive({geometryInstances:n,appearance:new u._cesium.PerInstanceColorAppearance({closed:!0,flat:!1}),classificationType:l.classificationType})},this.item=c._primitiveCollection,c.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:a};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},qe.prototype.createPolygonVectorGeoJsonFeatureLayerProviderModel=function(e,t,l,i,o,r){var n={polygonHierarchy:void 0,height:0,extrudedHeight:999999,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},u=l.material,c=l.height;this._core.isnull(l)||this._core.isnull(l.color)||(this._core.isHtmlColor(l.color)?l.color=this._color.colorFromHtmlColor(l.color):(/^rgb/.test(l.color)&&(l.color=this._color.rgbaStringToRgbaObj(l.color)),1<l.color.r&&(l.color.r=l.color.r/255),1<l.color.g&&(l.color.g=l.color.g/255),1<l.color.b&&(l.color.b=l.color.b/255),1<l.color.a&&(l.color.a=l.color.a/255),l.color=this._color.createColor(l.color.r,l.color.g,l.color.b,l.color.a))),this._core.isnull(l)||this._core.isnull(l.lightColor)||(this._core.isHtmlColor(l.lightColor)?l.lightColor=this._color.colorFromHtmlColor(l.lightColor):(/^rgb/.test(l.lightColor)&&(l.lightColor=this._color.rgbaStringToRgbaObj(l.lightColor)),1<l.lightColor.r&&(l.lightColor.r=l.lightColor.r/255),1<l.lightColor.g&&(l.lightColor.g=l.lightColor.g/255),1<l.lightColor.b&&(l.lightColor.b=l.lightColor.b/255),1<l.lightColor.a&&(l.lightColor.a=l.lightColor.a/255),l.lightColor=this._color.createColor(l.lightColor.r,l.lightColor.g,l.lightColor.b,l.lightColor.a))),this._core.isnull(l)||this._core.isnull(l.material)||"["==l.material.toString().charAt(0)&&"]"==l.material.toString().charAt(l.material.length-1)||(this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a)));var h=this._core.extend(n,l,!0);0==h.extrudedHeight&&(h.extrudedHeight=999999),this.items=[];var m=this,d=new Ae(this._viewer,this._cesium,a);(this._Provider=d)._loadTile=function(e){var a=null;scene.primitives;var s=new m._cesium.PrimitiveCollection;return m.Legend=[],e.features.forEach(function(o){if(d._isCameraMoving)return null;var i=[];function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):i.push(e[t])}if(Array.isArray(o.geometry.coordinates)&&0<o.geometry.coordinates.length)if(Array.isArray(o.geometry.coordinates[0][0]))for(var e=0;e<o.geometry.coordinates.length;e++)i=[],r(o.geometry.coordinates[e]),t(i),n(i);else r(o.geometry.coordinates),t(i),n(i);function t(e){var t,i;d._isCameraMoving||(e=m._cesium.Cartesian3.fromDegreesArray(e),/^\[/.test(l.extrudedHeight)&&/\]$/.test(l.extrudedHeight)&&(i=l.extrudedHeight.replace(/\[/,"").replace(/\]/,""),h.extrudedHeight=parseFloat(o.properties[i])),h.extrudedHeight=parseFloat(h.extrudedHeight),1==h.heightReference&&delete h.height,1==h.extrudedHeightReference&&delete h.extrudedHeight,/^\[/.test(l.material)&&/\]$/.test(l.material)&&(t=l.material.replace(/\[/,"").replace(/\]/,""),h.material=o.properties[t],m._core.isHtmlColor(h.material)?h.material=m._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=m._color.rgbaStringToRgbaObj(h.material)),1<h.material.r&&(h.material.r=h.material.r/255),1<h.material.g&&(h.material.g=h.material.g/255),1<h.material.b&&(h.material.b=h.material.b/255),1<h.material.a&&(h.material.a=h.material.a/255),h.material=m._color.createColor(h.material.r,h.material.g,h.material.b,h.material.a))),h.polygonHierarchy=new m._cesium.PolygonHierarchy(e),i=new m._cesium.PolygonGeometry(h),t=null,o.positions=e,t=new m._cesium.GeometryInstance({id:o,geometry:i,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}}),i="material:"+255*h.material.red+","+255*h.material.green+","+255*h.material.blue,m.Legend.push(i),a=new m._cesium.ClassificationPrimitive({geometryInstances:t,appearance:new m._cesium.PerInstanceColorAppearance({closed:!0,flat:!1}),classificationType:h.classificationType,shadows:m._cesium.ShadowMode.ENABLED}),s.add(a))}function n(e){for(var e=m._cesium.Cartesian3.fromDegreesArray(e),t=[],i=new m._cesium.PolygonHierarchy(e).positions,o=0;o<i.length;o++){var r=m._cesium.Math.toDegrees(m._cesium.Cartographic.fromCartesian(i[o]).longitude),n=m._cesium.Math.toDegrees(m._cesium.Cartographic.fromCartesian(i[o]).latitude);t.push(r),t.push(n)}e=m.getTheBottomPoint(t);m.scanningPolygon(e,h.offset_x,h.offset_y,t).forEach(function(e){e=m._cesium.Transforms.eastNorthUpToFixedFrame(m._cesium.Cartesian3.fromDegrees(e.lon,e.lat,c)),e=m._cesium.Model.fromGltf({url:u,color:h.color,lightColor:h.lightColor,modelMatrix:e,scale:h.scale});s.add(e)})}}),s},l&&l.time&&(d.availability=new m._cesium.TimeIntervalCollection([new m._cesium.TimeInterval({start:l.time.start?m._cesium.JulianDate.fromDate(new Date(l.time.start)):m._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?m._cesium.JulianDate.fromDate(new Date(l.time.end)):m._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=d._primitiveCollection,d.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:h.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:l};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},qe.prototype.GetPositionFromA_D=function(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=6356725+21412*(90-e)/90;return[180*(r/(o*Math.cos(e*Math.PI/180))+t*Math.PI/180)/Math.PI,180*(i/o+e*Math.PI/180)/Math.PI]},qe.prototype.getTheBottomPoint=function(e){for(var t=90,i=0,o=1;o<e.length;o+=2)t=t<e[o]?t:(i=o)&&e[o];return{lon:e[i-1],lat:e[i]}},qe.prototype.scanningPolygon=function(e,t,i,o){for(var r,n,a,s=[],l=180,u=-180,c=-90,h=0;h<o.length;h+=2)c=c>o[h+1]?c:o[h+1],l=l<o[h]?l:o[h],u=u>o[h]?u:o[h];var i=this.GetPositionFromA_D(e.lat,e.lon,i,0),m=this.GetPositionFromA_D(e.lat,e.lon,t,90)[0]-e.lon,d=i[1]-e.lat;for(s.push({lon:e.lon,lat:e.lat}),(a={lon:e.lon,lat:e.lat}).lat+=d;a.lat<=c;a.lat+=d){for(r={lon:a.lon-m,lat:a.lat},n={lon:a.lon+m,lat:a.lat},this.IsInPolygon(a.lon,a.lat,o)&&s.push({lon:a.lon,lat:a.lat});r.lon>=l;r.lon-=m)this.IsInPolygon(r.lon,r.lat,o)&&s.push({lon:r.lon,lat:r.lat});for(;n.lon<=u;n.lon+=m)this.IsInPolygon(n.lon,n.lat,o)&&s.push({lon:n.lon,lat:n.lat})}return s},qe.prototype.IsInPolygon=function(e,t,i){var o,r,n,a,s=0;if(i.length<6)return!1;i.push(i[0],i[1]);for(var l=0;l<i.length-2;l+=2)o=i[l],n=i[l+1],r=i[l+2],a=i[l+3],(n<=t&&t<a||a<=t&&t<n)&&0<Math.abs(n-a)&&o-(o-r)*(n-t)/(n-a)<=e&&s++;return s%2!=0},qe.prototype.setPolylinemodels=function(e,t,i,o,r,n,a,s,l){var u=this._core.getSpaceDistancem(e,s),c=10,h=parseFloat(a.distance);0==h||(c=parseInt(u/h));var m=e[0],u=e[e.length-1],h=s.Cartographic.fromCartesian(m),d=s.Math.toDegrees(h.longitude),p=s.Math.toDegrees(h.latitude);h.height;e=s.Cartographic.fromCartesian(u),m=s.Math.toDegrees(e.longitude),u=s.Math.toDegrees(e.latitude);e.height,s.Math.toDegrees(h.height);var g=c,_=s.Math.lerp(d,m,1/g)-d,f=s.Math.lerp(p,u,1/g)-p;s.Math.lerp(t,o,1/g),s.Math.lerp(i,r,1/g);for(var y=0;y<g;y++){var v=s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(d+(y+1)*_,p+(y+1)*f,a.height));parseInt(a.heightReference);v=s.Model.fromGltf({url:a.url,modelMatrix:v,color:a.color,lightColor:a.lightColor,scale:a.scale,heightReference:parseInt(a.heightReference)});l.scene.primitives.add(v),n.push(v)}return n},qe.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsjl=function(e,t,i,o,r,n){var a={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a)));var l=this._core.extend(a,i,!0),u=this,c=new Ae(this._viewer,this._cesium,s);(this._Provider=c)._loadTile=function(e,t){var a,t=u._taskProcessor.scheduleTask({json:e,styleOption:i,options:l,tileKey:t});u._cesium.defined(t)&&(a=u)._cesium.when(t,function(e){if(!c._primitiveByTile[e.tileKey]){for(var t=new a._cesium.PrimitiveCollection,i=0;i<e.geomInstances.length;i++){var o=null,r=e.geomInstances[i],n=r.id.id;c._primitiveByTile[n]||(n=new a._cesium.Material({fabric:{type:"Color",uniforms:{color:e.materials[i]}}}),new a._cesium.MaterialAppearance({material:n,faceForward:!0,flat:!1}),o=new a._cesium.Primitive({allowPicking:!0,appearance:new a._cesium.PerInstanceColorAppearance,geometryInstances:r,shadows:u._cesium.ShadowMode.ENABLED}),t.add(o))}c._primitiveCollection.add(t),c._primitiveByTile[e.tileKey]=t}})},this.item=c._primitiveCollection,c.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:l.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},qe.prototype.createPolygonVectorGeoJsonFeatureLayerProviderls=function(e,t,s,i,o,r){var n={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(s)||this._core.isnull(s.material)||"["==s.material.toString().charAt(0)&&"]"==s.material.toString().charAt(s.material.length-1)||(this._core.isHtmlColor(s.material)?s.material=this._color.colorFromHtmlColor(s.material):/^http/.test(s.material)||(/^rgb/.test(s.material)&&(s.material=this._color.rgbaStringToRgbaObj(s.material)),1<s.material.r&&(s.material.r=s.material.r/255),1<s.material.g&&(s.material.g=s.material.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=this._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a))),this._core.isnull(s)||this._core.isnull(s.fill)||"["==s.fill.toString().charAt(0)&&"]"==s.fill.toString().charAt(s.fill.length-1)||(this._core.isHtmlColor(s.fill)?s.fill=this._color.colorFromHtmlColor(s.fill):/^http/.test(s.fill)||(/^rgb/.test(s.fill)&&(s.fill=this._color.rgbaStringToRgbaObj(s.fill)),1<s.fill.r&&(s.fill.r=s.fill.r/255),1<s.fill.g&&(s.fill.g=s.fill.g/255),1<s.fill.b&&(s.fill.b=s.fill.b/255),1<s.fill.a&&(s.fill.a=s.fill.a/255),s.fill=this._color.createColor(s.fill.r,s.fill.g,s.fill.b,s.fill.a)));var l=this._core.extend(n,s,!0),u=this,a=new Ae(this._viewer,this._cesium,a);(this._Provider=a)._loadTile=function(e){u.Legend=[];var a=new u._cesium.PrimitiveCollection;return e.features.forEach(function(n){var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):i.push(e[t])}if(Array.isArray(n.geometry.coordinates)&&0<n.geometry.coordinates.length)if(Array.isArray(n.geometry.coordinates[0][0]))for(var e=0;e<n.geometry.coordinates.length;e++)i=[],o(n.geometry.coordinates[e]),t(i);else o(n.geometry.coordinates),t(i);function t(e){var t=u._cesium.Cartesian3.fromDegreesArray(e);/^\[/.test(s.extrudedHeight)&&/\]$/.test(s.extrudedHeight)&&(o=s.extrudedHeight.replace(/\[/,"").replace(/\]/,""),l.extrudedHeight=parseFloat(n.properties[o])),l.extrudedHeight=parseFloat(l.extrudedHeight),1==l.heightReference&&delete l.height,1==l.extrudedHeightReference&&delete l.extrudedHeight,/^\[/.test(s.material)&&/\]$/.test(s.material)&&(r=s.material.replace(/\[/,"").replace(/\]/,""),l.material=n.properties[r],u._core.isHtmlColor(l.material)?l.material=u._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=u._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=u._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),l.polygonHierarchy=new u._cesium.PolygonHierarchy(t),n.positions=t;var i=new u._cesium.PolygonGeometry(l),e=null,o=new u._cesium.ColorGeometryInstanceAttribute.fromColor(l.fill),r={},r=/^http/.test(l.material)?new u._cesium.Material({fabric:{type:"Image",uniforms:{image:l.material}}}):(t="material:"+255*l.material.red+","+255*l.material.green+","+255*l.material.blue,u.Legend.push(t),new u._cesium.Material({fabric:{type:"Color",uniforms:{color:l.material}}})),e=new u._cesium.GeometryInstance({id:n,geometry:i,attributes:{color:o}}),o=null,o=new u._cesium.Primitive({allowPicking:!0,appearance:new u._cesium.MaterialAppearance({material:r}),geometryInstances:e,shadows:u._cesium.ShadowMode.ENABLED});a.add(o)}}),a},s&&s.time&&(a.availability=new u._cesium.TimeIntervalCollection([new u._cesium.TimeInterval({start:s.time.start?u._cesium.JulianDate.fromDate(new Date(s.time.start)):u._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?u._cesium.JulianDate.fromDate(new Date(s.time.end)):u._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=a._primitiveCollection,a.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:s};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},qe.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsd=function(e,t,i,o,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._core.isnull(i)||this._core.isnull(i.outlineColor)||"["==i.outlineColor.toString().charAt(0)&&"]"==i.outlineColor.toString().charAt(i.outlineColor.length-1)||(this._core.isHtmlColor(i.outlineColor)?i.outlineColor=this._color.colorFromHtmlColor(i.outlineColor):(/^rgb/.test(i.outlineColor)&&(i.outlineColor=this._color.rgbaStringToRgbaObj(i.outlineColor)),1<i.outlineColor.r&&(i.outlineColor.r=i.outlineColor.r/255),1<i.outlineColor.g&&(i.outlineColor.g=i.outlineColor.g/255),1<i.outlineColor.b&&(i.outlineColor.b=i.outlineColor.b/255),1<i.outlineColor.a&&(i.outlineColor.a=i.outlineColor.a/255),i.outlineColor=this._color.createColor(i.outlineColor.r,i.outlineColor.g,i.outlineColor.b,i.outlineColor.a))),this._option=this._core.extend(a,i,!0);var l=this,a=t.urlinit,u={polygonHierarchy:void 0,height:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED};$.ajax({url:a,type:"get",async:!1,dataType:"json",success:function(e){l.datas=e.features}});s=new Ae(this._viewer,this._cesium,s);(this._Provider=s)._loadTile=function(e){l.Legend=[],new l._cesium.PrimitiveCollection;var n=[],a=[],t=new Cesium.PrimitiveCollection;return e.features.forEach(function(o){var r=[];var e=o.id,e=parseInt(e.split(".")[1])-1;if(o=l.datas[e],Array.isArray(o.geometry.coordinates)&&0<o.geometry.coordinates.length&&Array.isArray(o.geometry.coordinates[0][0][0]))for(var t=0;t<o.geometry.coordinates[0].length;t++)r=[],function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?(3==t[i].length&&t[i].splice(2,1),t[i].push(l._option.height),e(t[i])):r.push(t[i])}(o.geometry.coordinates[0][t]),function(e){{var t;/^\[/.test(l._option.extrudedHeight)&&/\]$/.test(l._option.extrudedHeight)&&(t=l._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),u.extrudedHeight=parseFloat(o.properties[t]))}u.material=l._option.material,/^\[/.test(l._option.material)&&/\]$/.test(l._option.material)?(i=l._option.material.replace(/\[/,"").replace(/\]/,""),u.material=o.properties[i],l._core.isHtmlColor(u.material)?u.material=l._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=l._color.rgbaStringToRgbaObj(u.material)),1<u.material.red&&(u.material.red=u.material.red/255),1<u.material.green&&(u.material.green=u.material.green/255),1<u.material.blue&&(u.material.blue=u.material.blue/255),1<u.material.alpha&&(u.material.a=u.material.alpha/255),u.material=l._color.createColor(u.material.red,u.material.green,u.material.blue,u.material.alpha))):(l._option.material&&(u.material=l._option.material),u.material&&(l._core.isHtmlColor(u.material)?u.material=l._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=l._color.rgbaStringToRgbaObj(u.material)),1<u.material.red&&(u.material.red=u.material.red/255),1<u.material.green&&(u.material.green=u.material.green/255),1<u.material.blue&&(u.material.blue=u.material.blue/255),1<u.material.alpha&&(u.material.a=u.material.alpha/255),u.material=l._color.createColor(u.material.red,u.material.green,u.material.blue,u.material.alpha))));var i=l._cesium.Cartesian3.fromDegreesArrayHeights(e);u.polygonHierarchy=new l._cesium.PolygonHierarchy(i);e=new l._cesium.PolygonGeometry(u),e=new Cesium.GeometryInstance({id:o,geometry:e,attributes:{color:new l._cesium.ColorGeometryInstanceAttribute.fromColor(l._option.randomColor?Cesium.Color.fromRandom().withAlpha(u.material.alpha):u.material)}});n.push(e);i={positions:i,width:l._option.width},i=new l._cesium.GroundPolylineGeometry(i),i=new l._cesium.GeometryInstance({geometry:i});a.push(i);i="material:"+255*u.material.red+","+255*u.material.green+","+255*u.material.blue;l.Legend.push(i)}(r)}),0<n.length&&(u.extrudedHeight?t.add(new l._cesium.Primitive({geometryInstances:n,appearance:new l._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:l._core.Shaders("vertexShaderSource"),fragmentShaderSource:l._core.Shaders("fragmentShaderSource")})})):t.add(new l._cesium.GroundPrimitive({geometryInstances:n,appearance:new l._cesium.PerInstanceColorAppearance({translucent:!0,vertexShaderSource:l._core.Shaders("vertexShaderSource")})}))),0<a.length&&t.add(new l._cesium.GroundPolylinePrimitive({geometryInstances:a,appearance:new l._cesium.PolylineMaterialAppearance({material:new l._cesium.Material({fabric:{type:"Color",uniforms:{color:l._option.outlineColor}}})}),shadows:l._cesium.ShadowMode.ENABLED})),t},this.item=s._primitiveCollection,s.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;i={id:u.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},qe.prototype.setTreeobj=function(e){this.treeobj=e},qe.prototype.createPolygonVectorFeatureLayerProvider=function(e,t,n,i,o){var r={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,show:!0},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(n)||this._core.isnull(n.material)||"["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)||(this._core.isHtmlColor(n.material)?n.material=this._color.colorFromHtmlColor(n.material):(/^rgb/.test(n.material)&&(n.material=this._color.rgbaStringToRgbaObj(n.material)),1<n.material.r&&(n.material.r=n.material.r/255),1<n.material.g&&(n.material.g=n.material.g/255),1<n.material.b&&(n.material.b=n.material.b/255),1<n.material.a&&(n.material.a=n.material.a/255),n.material=this._color.createColor(n.material.r,n.material.g,n.material.b,n.material.a)));var s=this._core.extend(r,n,!0),l=this,a=new Ae(this._viewer,this._cesium,a);(this._Provider=a)._loadTile=function(e){var r=[];return l.Legend=[],e.features.forEach(function(e){var o=[];!function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i]):o.push(t[i])}(e.geometry.coordinates[0]);var t=l._cesium.Cartesian3.fromDegreesArray(o);/^\[/.test(n.extrudedHeight)&&/\]$/.test(n.extrudedHeight)&&(i=n.extrudedHeight.replace(/\[/,"").replace(/\]/,""),s.extrudedHeight=parseFloat(e.properties[i])),s.polygonHierarchy=new l._cesium.PolygonHierarchy(t);var i=new l._cesium.PolygonGeometry(s),t=l._cesium.PolygonGeometry.createGeometry(i),i="material:"+255*s.material.red+","+255*s.material.green+","+255*s.material.blue;l.Legend.push(i);t=new l._cesium.GeometryInstance({geometry:t,attributes:{color:new l._cesium.ColorGeometryInstanceAttribute.fromColor(s.material)},shadows:l._cesium.ShadowMode.ENABLED});r.push(t)}),new this._cesium.Primitive({allowPicking:!1,appearance:new this._cesium.PerInstanceColorAppearance({translucent:!1,flat:!0,faceForward:!0,closed:!0}),geometryInstances:r})},this.item=a._primitiveCollection,a.addTo(this._viewer),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id);t={id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:n};this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item)},qe.prototype.createPolygonVectorMonomerFeatureLayerProvider=function(e,t,n,i,o){var r={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,show:!0},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(n)||this._core.isnull(n.material)||"["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)||(this._core.isHtmlColor(n.material)?n.material=this._color.colorFromHtmlColor(n.material):(/^rgb/.test(n.material)&&(n.material=this._color.rgbaStringToRgbaObj(n.material)),1<n.material.r&&(n.material.r=n.material.r/255),1<n.material.g&&(n.material.g=n.material.g/255),1<n.material.b&&(n.material.b=n.material.b/255),1<n.material.a&&(n.material.a=n.material.a/255),n.material=this._color.createColor(n.material.r,n.material.g,n.material.b,n.material.a)));var s=this._core.extend(r,n,!0),a=new Ae(this._viewer,this._cesium,a);this._Provider=a;var l=this;a._loadTile=function(e){var r=[];return e.features.forEach(function(e){var o=[];!function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i]):o.push(t[i])}(e.geometry.coordinates[0]);var t,i=l._cesium.Cartesian3.fromDegreesArray(o);/^\[/.test(n.extrudedHeight)&&/\]$/.test(n.extrudedHeight)&&(t=n.extrudedHeight.replace(/\[/,"").replace(/\]/,""),s.extrudedHeight=parseFloat(e.properties[t])),s.polygonHierarchy=new l._cesium.PolygonHierarchy(i);i=new l._cesium.PolygonGeometry(s),i=new l._cesium.GeometryInstance({geometry:i,attributes:{color:l._cesium.ColorGeometryInstanceAttribute.fromColor(l._cesium.Color.fromCssColorString("#004FFF").withAlpha(.5)),show:new l._cesium.ShowGeometryInstanceAttribute(!0)}});r.push(i)}),new l._cesium.GroundPrimitive({classificationType:l._cesium.ClassificationType.BOTH,geometryInstances:r})},this.item=a._primitiveCollection,a.addTo(this._viewer),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id);t={id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:n};this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item)},qe.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},qe.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}};var Qe={};function Je(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Qe.read=function(e,t,i,o,r){var n,a,s=8*r-o-1,l=(1<<s)-1,u=l>>1,c=-7,h=i?r-1:0,m=i?-1:1,i=e[t+h];for(h+=m,n=i&(1<<-c)-1,i>>=-c,c+=s;0<c;n=256*n+e[t+h],h+=m,c-=8);for(a=n&(1<<-c)-1,n>>=-c,c+=o;0<c;a=256*a+e[t+h],h+=m,c-=8);if(0===n)n=1-u;else{if(n===l)return a?NaN:1/0*(i?-1:1);a+=Math.pow(2,o),n-=u}return(i?-1:1)*a*Math.pow(2,n-o)},Qe.write=function(e,t,i,o,r,n){var a,s,l=8*n-r-1,u=(1<<l)-1,c=u>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,m=o?0:n-1,d=o?1:-1,n=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-a))<1&&(a--,o*=2),2<=(t+=1<=a+c?h/o:h*Math.pow(2,1-c))*o&&(a++,o/=2),u<=a+c?(s=0,a=u):1<=a+c?(s=(t*o-1)*Math.pow(2,r),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,r),a=0));8<=r;e[i+m]=255&s,m+=d,s/=256,r-=8);for(a=a<<r|s,l+=r;0<l;e[i+m]=255&a,m+=d,a/=256,l-=8);e[i+m-d]|=128*n},Je.Varint=0,Je.Fixed64=1,Je.Bytes=2,Je.Fixed32=5;var Xe=4294967296,Ke=1/Xe;function $e(e){return e.type===Je.Bytes?e.readVarint()+e.pos:e.pos+1}function Ze(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function et(e,t,i){var o=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.ceil(Math.log(t)/(7*Math.LN2));i.realloc(o);for(var r=i.pos-1;e<=r;r--)i.buf[r+o]=i.buf[r]}function tt(e,t){for(var i=0;i<e.length;i++)t.writeVarint(e[i])}function it(e,t){for(var i=0;i<e.length;i++)t.writeSVarint(e[i])}function ot(e,t){for(var i=0;i<e.length;i++)t.writeFloat(e[i])}function rt(e,t){for(var i=0;i<e.length;i++)t.writeDouble(e[i])}function nt(e,t){for(var i=0;i<e.length;i++)t.writeBoolean(e[i])}function at(e,t){for(var i=0;i<e.length;i++)t.writeFixed32(e[i])}function st(e,t){for(var i=0;i<e.length;i++)t.writeSFixed32(e[i])}function lt(e,t){for(var i=0;i<e.length;i++)t.writeFixed64(e[i])}function ut(e,t){for(var i=0;i<e.length;i++)t.writeSFixed64(e[i])}function ct(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function ht(e,t,i){e[i]=t,e[i+1]=t>>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function mt(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function dt(e,t){this.x=e,this.y=t}function pt(e,t,i,o,r){this.properties={},this.extent=i,this.type=0,this._pbf=e,this._geometry=-1,this._keys=o,this._values=r,e.readFields(gt,this,t)}function gt(e,t,i){1==e?t.id=i.readVarint():2==e?function(e,t){var i=e.readVarint()+e.pos;for(;e.pos<i;){var o=t._keys[e.readVarint()],r=t._values[e.readVarint()];t.properties[o]=r}}(i,t):3==e?t.type=i.readVarint():4==e&&(t._geometry=i.pos)}function _t(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(ft,this,t),this.length=this._features.length}function ft(e,t,i){15===e?t.version=i.readVarint():1===e?t.name=i.readString():5===e?t.extent=i.readVarint():2===e?t._features.push(i.pos):3===e?t._keys.push(i.readString()):4===e&&t._values.push(function(e){var t=null,i=e.readVarint()+e.pos;for(;e.pos<i;){var o=e.readVarint()>>3;t=1==o?e.readString():2==o?e.readFloat():3==o?e.readDouble():4==o?e.readVarint64():5==o?e.readVarint():6==o?e.readSVarint():7==o?e.readBoolean():null}return t}(i))}function yt(e,t){this.layers=e.readFields(vt,{},t)}function vt(e,t,i){3!==e||(i=new _t(i,i.readVarint()+i.pos)).length&&(t[i.name]=i)}function Ct(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0,this.labelCollections=new this._cesium.PointPrimitiveCollection,this.geometries_line=[],this.geometries_polygon=[]}Je.prototype={destroy:function(){this.buf=null},readFields:function(e,t,i){for(i=i||this.length;this.pos<i;){var o=this.readVarint(),r=o>>3,n=this.pos;this.type=7&o,e(r,t,this),this.pos===n&&this.skip(o)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=ct(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=mt(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=ct(this.buf,this.pos)+ct(this.buf,this.pos+4)*Xe;return this.pos+=8,e},readSFixed64:function(){var e=ct(this.buf,this.pos)+mt(this.buf,this.pos+4)*Xe;return this.pos+=8,e},readFloat:function(){var e=Qe.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Qe.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,i=t[this.pos++],o=127&i;return i<128?o:(o|=(127&(i=t[this.pos++]))<<7,i<128?o:(o|=(127&(i=t[this.pos++]))<<14,i<128?o:(o|=(127&(i=t[this.pos++]))<<21,i<128?o:function(e,t,i){var o,r,n=i.buf;if(r=n[i.pos++],o=(112&r)>>4,r<128)return Ze(e,o,t);if(r=n[i.pos++],o|=(127&r)<<3,r<128)return Ze(e,o,t);if(r=n[i.pos++],o|=(127&r)<<10,r<128)return Ze(e,o,t);if(r=n[i.pos++],o|=(127&r)<<17,r<128)return Ze(e,o,t);if(r=n[i.pos++],o|=(127&r)<<24,r<128)return Ze(e,o,t);if(r=n[i.pos++],o|=(1&r)<<31,r<128)return Ze(e,o,t);throw new Error("Expected varint not more than 10 bytes")}(o|=(15&t[this.pos])<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=function(e,t,i){var o,r,n,a="",s=t;for(;s<i;){var l=e[s],u=null,c=239<l?4:223<l?3:191<l?2:1;if(i<s+c)break;1===c?l<128&&(u=l):2===c?128==(192&(o=e[s+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===c?(o=e[s+1],r=e[s+2],128==(192&o)&&128==(192&r)&&((u=(15&l)<<12|(63&o)<<6|63&r)<=2047||55296<=u&&u<=57343)&&(u=null)):4===c&&(o=e[s+1],r=e[s+2],n=e[s+3],128==(192&o)&&128==(192&r)&&128==(192&n)&&((u=(15&l)<<18|(63&o)<<12|(63&r)<<6|63&n)<=65535||1114112<=u)&&(u=null)),null===u?(u=65533,c=1):65535<u&&(u-=65536,a+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),a+=String.fromCharCode(u),s+=c}return a}(this.buf,this.pos,e);return this.pos=e,t},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){var i=$e(this);for(e=e||[];this.pos<i;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){var t=$e(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){var t=$e(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){var t=$e(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){var t=$e(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){var t=$e(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){var t=$e(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){var t=$e(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){var t=$e(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){e&=7;if(e===Je.Varint)for(;127<this.buf[this.pos++];);else if(e===Je.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Je.Fixed32)this.pos+=4;else{if(e!==Je.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t,i=this.length||16;i<this.pos+e;)i*=2;i!==this.length&&((t=new Uint8Array(i)).set(this.buf),this.buf=t,this.length=i)},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),ht(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),ht(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),ht(this.buf,-1&e,this.pos),ht(this.buf,Math.floor(e*Ke),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),ht(this.buf,-1&e,this.pos),ht(this.buf,Math.floor(e*Ke),this.pos+4),this.pos+=8},writeVarint:function(e){268435455<(e=+e||0)||e<0?function(e,t){var i,o;0<=e?(i=e%4294967296|0,o=e/4294967296|0):(o=~(-e/4294967296),4294967295^(i=~(-e%4294967296))?i=i+1|0:o=o+1|(i=0));if(0x10000000000000000<=e||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t){t.buf[t.pos++]=127&e|128,e>>>=7,t.buf[t.pos++]=127&e|128,e>>>=7,t.buf[t.pos++]=127&e|128,e>>>=7,t.buf[t.pos++]=127&e|128,e>>>=7,t.buf[t.pos]=127&e}(i,t),function(e,t){var i=(7&e)<<4;t.buf[t.pos++]|=i|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(o,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(127<e?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(127<e?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(127<e?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,i){for(var o,r,n=0;n<t.length;n++){if(55295<(o=t.charCodeAt(n))&&o<57344){if(!r){56319<o||n+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):r=o;continue}if(o<56320){e[i++]=239,e[i++]=191,e[i++]=189,r=o;continue}o=r-55296<<10|o-56320|65536,r=null}else r&&(e[i++]=239,e[i++]=191,e[i++]=189,r=null);o<128?e[i++]=o:(o<2048?e[i++]=o>>6|192:(o<65536?e[i++]=o>>12|224:(e[i++]=o>>18|240,e[i++]=o>>12&63|128),e[i++]=o>>6&63|128),e[i++]=63&o|128)}return i}(this.buf,e,this.pos);e=this.pos-t;128<=e&&et(t,e,this),this.pos=t-1,this.writeVarint(e),this.pos+=e},writeFloat:function(e){this.realloc(4),Qe.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Qe.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var i=0;i<t;i++)this.buf[this.pos++]=e[i]},writeRawMessage:function(e,t){this.pos++;var i=this.pos;e(t,this);t=this.pos-i;128<=t&&et(i,t,this),this.pos=i-1,this.writeVarint(t),this.pos+=t},writeMessage:function(e,t,i){this.writeTag(e,Je.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(e,t){this.writeMessage(e,tt,t)},writePackedSVarint:function(e,t){this.writeMessage(e,it,t)},writePackedBoolean:function(e,t){this.writeMessage(e,nt,t)},writePackedFloat:function(e,t){this.writeMessage(e,ot,t)},writePackedDouble:function(e,t){this.writeMessage(e,rt,t)},writePackedFixed32:function(e,t){this.writeMessage(e,at,t)},writePackedSFixed32:function(e,t){this.writeMessage(e,st,t)},writePackedFixed64:function(e,t){this.writeMessage(e,lt,t)},writePackedSFixed64:function(e,t){this.writeMessage(e,ut,t)},writeBytesField:function(e,t){this.writeTag(e,Je.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Je.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Je.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Je.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Je.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Je.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Je.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Je.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Je.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Je.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}},dt.prototype={clone:function(){return new dt(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,e=e.y-this.y;return t*t+e*e},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,e=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=e,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),i=Math.sin(e),e=t*this.x-i*this.y,t=i*this.x+t*this.y;return this.x=e,this.y=t,this},_rotateAround:function(e,t){var i=Math.cos(e),o=Math.sin(e),e=t.x+i*(this.x-t.x)-o*(this.y-t.y),t=t.y+o*(this.x-t.x)+i*(this.y-t.y);return this.x=e,this.y=t,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},dt.convert=function(e){return!(e instanceof dt)&&Array.isArray(e)?new dt(e[0],e[1]):e},pt.types=["Unknown","Point","LineString","Polygon"],pt.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,i,o=e.readVarint()+e.pos,r=1,n=0,a=0,s=0,l=[];e.pos<o;)if(n<=0&&(r=7&(i=e.readVarint()),n=i>>3),n--,1===r||2===r)a+=e.readSVarint(),s+=e.readSVarint(),1===r&&(t&&l.push(t),t=[]),t.push(new dt(a,s));else{if(7!==r)throw new Error("unknown command "+r);t&&t.push(t[0].clone())}return t&&l.push(t),l},pt.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t,i=e.readVarint()+e.pos,o=1,r=0,n=0,a=0,s=1/0,l=-1/0,u=1/0,c=-1/0;e.pos<i;)if(r<=0&&(o=7&(t=e.readVarint()),r=t>>3),r--,1===o||2===o)(n+=e.readSVarint())<s&&(s=n),l<n&&(l=n),(a+=e.readSVarint())<u&&(u=a),c<a&&(c=a);else if(7!==o)throw new Error("unknown command "+o);return[s,u,l,c]},pt.prototype.toGeoJSON=function(e,t,i,o){var r,n=this.extent*Math.pow(2,i),a=this.extent*e,s=this.extent*t/2,l=this.loadGeometry(),t=pt.types[this.type];function u(e){for(var t=0;t<e.length;t++){var i=e[t],o=90-180*(i.y+s)/(n/2);e[t]=[360*(i.x+a)/n-180,o]}}switch(this.type){case 1:for(var c=[],h=0;h<l.length;h++)c[h]=l[h][0];u(l=c);break;case 2:for(h=0;h<l.length;h++)u(l[h]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var i,o,r=[],n=0;n<t;n++){var a=function(e){for(var t,i,o=0,r=0,n=e.length,a=n-1;r<n;a=r++)t=e[r],i=e[a],o+=(i.x-t.x)*(t.y+i.y);return o}(e[n]);0!==a&&((o=void 0===o?a<0:o)===a<0?(i&&r.push(i),i=[e[n]]):i.push(e[n]))}i&&r.push(i);return r}(l),h=0;h<l.length;h++)for(r=0;r<l[h].length;r++)u(l[h][r])}1===l.length?l=l[0]:t="Multi"+t;t={type:"Feature",geometry:{type:t,coordinates:l},properties:this.properties};return"id"in this&&(t.id=this.id),t},_t.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];e=this._pbf.readVarint()+this._pbf.pos;return new pt(this._pbf,e,this.extent,this._keys,this._values)};var wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function bt(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we,this._VectorTileProvider=new He(this._viewer,this._cesium),this._primitive=void 0,this._Provider=void 0,this.Legend=[]}function Tt(e){this._viewer=e,this._cesium=Cesium,this._core=new V,this._tree=we,this._getPosition=new Ee(this._viewer,this._cesium),this._ModelEdit=new Se(this._viewer),this._popupmessage=new xe(this._viewer,this._cesium),this._createGroup=new Ie(this._viewer,this._cesium),this._billboardGeoJsonFeatureLayer=new Re(this._viewer,this._cesium),this._GeoJsonFeatureLayer=new Oe(this._viewer,this._cesium),this._LabelGeoJsonFeatureLayercopy=new Ve(this._viewer,this._cesium),this._VectorGeoJsonFeatureLayer=new Ge(this._viewer,this._cesium),this._PolylineGeoJsonFeatureLayer=new We(this._viewer,this._cesium),this._PointModel=new Ye(this._viewer,this._cesium),this._PolygonGeoJsonFeatureLayer=new qe(this._viewer,this._cesium),this._PolygonVectorTileLayerArcgis=new Ct(this._viewer,this._cesium),this._WallGeoFeatureLayer=new bt(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip(),this.objectsToExclude=[],this.SimpleGraphicObj=[],we.editPointID||(we.editPointID={edit:[],size:[],move:void 0,height:[],add:[]}),this.editProp=!1,this.PrimitiveCollection=new Cesium.PrimitiveCollection,e.scene.primitives.add(this.PrimitiveCollection),this.SizeData=[],this.featuresPlotting=[]}Ct.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":wt(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},Ct.prototype.createVolumeVectorGeoJsonFeatureLayer=function(e,t,P,i,o){var r={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10};t.url,t.layer,t.upperLevelLimit,t.lowerLevelLimit,this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),this._cesium,this.extent={XMin:t.minx||0,YMin:t.miny||0,XMax:t.maxx||0,YMax:t.maxy||0},this._core.isnull(P)||this._core.isnull(P.fill)||"["==P.fill.toString().charAt(0)&&"]"==P.fill.toString().charAt(P.fill.length-1)||(this._core.isHtmlColor(P.fill)?P.fill=this._color.colorFromHtmlColor(P.fill):(/^rgb/.test(P.fill)&&(P.fill=this._color.rgbaStringToRgbaObj(P.fill)),1<P.fill.r&&(P.fill.r=P.fill.r/255),1<P.fill.g&&(P.fill.g=P.fill.g/255),1<P.fill.b&&(P.fill.b=P.fill.b/255),1<P.fill.a&&(P.fill.a=P.fill.a/255),P.fill=this._color.createColor(P.fill.r,P.fill.g,P.fill.b,P.fill.a))),this._core.isnull(P)||this._core.isnull(P.polylinefill)||"["==P.polylinefill.toString().charAt(0)&&"]"==P.polylinefill.toString().charAt(P.polylinefill.length-1)||(this._core.isHtmlColor(P.polylinefill)?P.polylinefill=this._color.colorFromHtmlColor(P.polylinefill):(/^rgb/.test(P.polylinefill)&&(P.polylinefill=this._color.rgbaStringToRgbaObj(P.polylinefill)),1<P.polylinefill.r&&(P.polylinefill.r=P.polylinefill.r/255),1<P.polylinefill.g&&(P.polylinefill.g=P.polylinefill.g/255),1<P.polylinefill.b&&(P.polylinefill.b=P.polylinefill.b/255),1<P.polylinefill.a&&(P.polylinefill.a=P.polylinefill.a/255),P.polylinefill=this._color.createColor(P.polylinefill.r,P.polylinefill.g,P.polylinefill.b,P.polylinefill.a))),this._core.isnull(P)||this._core.isnull(P.outlineColor)||"["==P.outlineColor.toString().charAt(0)&&"]"==P.outlineColor.toString().charAt(P.outlineColor.length-1)||(this._core.isHtmlColor(P.outlineColor)?P.outlineColor=this._color.colorFromHtmlColor(P.outlineColor):(/^rgb/.test(P.outlineColor)&&(P.outlineColor=this._color.rgbaStringToRgbaObj(P.outlineColor)),1<P.outlineColor.r&&(P.outlineColor.r=P.outlineColor.r/255),1<P.outlineColor.g&&(P.outlineColor.g=P.outlineColor.g/255),1<P.outlineColor.b&&(P.outlineColor.b=P.outlineColor.b/255),1<P.outlineColor.a&&(P.outlineColor.a=P.outlineColor.a/255),P.outlineColor=this._color.createColor(P.outlineColor.r,P.outlineColor.g,P.outlineColor.b,P.outlineColor.a))),this._option=this._core.extend(r,P,!0),null==t&&console.log("url is required"),null==e&&console.log("layername is required");var E=this;Cesium.VertexFormat.DEFAULT,Cesium.Ellipsoid.WGS84,Cesium.ArcType.GEODESIC,Cesium.Color.WHITE;E._core.xhr({url:"http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/resources/styles/root.json",type:"get",dataType:"json",success:function(e){var T=[],S=e.layers;Cesium.Resource.createIfNeeded("http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/tile/0/0/0.pbf").fetchArrayBuffer().then(function(e){function i(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?i(e[t]):T.push(e[t])}function t(e){e={positions:Cesium.Cartesian3.fromDegreesArray(e),width:10,color:Cesium.ColorGeometryInstanceAttribute.fromColor(E._option.polylinefill)},e=new Cesium.PolylineGeometry(e),e=new Cesium.GeometryInstance({geometry:e});a.push(e)}function o(e){e=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(e))}),e=Cesium.PolygonGeometry.createGeometry(e),e=new Cesium.GeometryInstance({geometry:e,attributes:{color:b}});s.push(e)}var r,n=new yt(new Je(e)),a=[],s=[];for(r in E.labelCollections=new E._cesium.LabelCollection,n.layers)for(var l=n.layers[r],u=0;u<l.length;u++)for(var c=l.feature(u),h=c.loadGeometry(),m=0;m<h.length;m++)for(var d=h[m],p=0;p<d.length;p++){d[p];var g=null;if(null!=c.properties._symbol)for(var _=c.properties._symbol,f=0;f<S.length;f++)null!=S[f].filter&&"=="==S[f].filter[0]&&"_symbol"==S[f].filter[1]&&S[f].filter[2]==_&&(g=S[f]);else if(null!=l.name)for(var y=l.name,f=0;f<S.length;f++)null!=S[f]["source-layer"]&&S[f]["source-layer"]==y&&(g=S[f]);if(1==c.type)try{var v,C=c.toGeoJSON(0,0,0,E.extent);null!=P.text&&/^\[/.test(P.text)&&/\]$/.test(P.text)&&(v=P.text.replace(/\[/,"").replace(/\]/,""),E._option.text=c.properties[v]),null!=g.paint&&g.paint["icon-color"]&&(E._option.fill=E._color.createColorTransformation(g.paint["icon-color"])),E._option.position=new E._cesium.Cartesian3.fromDegrees(C.geometry.coordinates[0],C.geometry.coordinates[1],E._option.height);var w={},w="point"==C.geometry.type?{id:C,color:E._option.fill,position:E._option.position}:E._option;E.labelCollections.add(w)}catch(e){}if(2==c.type){d[0];C=c.toGeoJSON(0,0,0,E.extent);if(!E._core.isnull(P.polylinefill)&&null!=g.paint&&g.paint["icon-color"]&&(E._option.polylinefill=E._color.createColorTransformation(g.paint["icon-color"])),Array.isArray(C.geometry.coordinates)&&0<C.geometry.coordinates.length)if(Array.isArray(C.geometry.coordinates[0][0]))for(m=0;m<C.geometry.coordinates.length;m++)T=[],i(C.geometry.coordinates[m]),t(T);else i(C.geometry.coordinates),t(T)}if(3==c.type)try{d[0];var C=c.toGeoJSON(0,0,0,E.extent),b=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA);if(null!=g.paint["fill-color"]&&(b=Cesium.ColorGeometryInstanceAttribute.fromColor(E._color.createColorTransformation(g.paint["fill-color"]))),Array.isArray(C.geometry.coordinates)&&0<C.geometry.coordinates.length)if(Array.isArray(C.geometry.coordinates[0][0]))for(m=0;m<C.geometry.coordinates.length;m++)T=[],i(C.geometry.coordinates[m]),o(T);else i(C.geometry.coordinates),o(T)}catch(e){}}0<E.labelCollections.length&&E._viewer.scene.primitives.add(E.labelCollections),0<a.length&&E._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:a,appearance:new Cesium.PolylineColorAppearance})),0<s.length&&E._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:s,appearance:new E._cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.fromRandom({alpha:1})}}}),faceForward:!0,flat:!1}),shadows:Cesium.ShadowMode.ENABLED}))})}})},Ct.prototype.createVolumeVectorGeoJsonFeatureLayers=function(e,t,o,i,r){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this.extent={XMin:t.minx||0,YMin:t.miny||0,XMax:t.maxx||0,YMax:t.maxy||0},this._core.isnull(o)||this._core.isnull(o.material)||"["==o.material.toString().charAt(0)&&"]"==o.material.toString().charAt(o.material.length-1)||(this._core.isHtmlColor(o.material)?o.material=this._color.colorFromHtmlColor(o.material):(/^rgb/.test(o.material)&&(o.material=this._color.rgbaStringToRgbaObj(o.material)),1<o.material.r&&(o.material.r=o.material.r/255),1<o.material.g&&(o.material.g=o.material.g/255),1<o.material.b&&(o.material.b=o.material.b/255),1<o.material.a&&(o.material.a=o.material.a/255),o.material=this._color.createColor(o.material.r,o.material.g,o.material.b,o.material.a))),this._option=this._core.extend(n,o,!0),null==t&&console.log("url is required"),null==e&&console.log("layername is required");var s=[],w={polygonHierarchy:void 0,height:0,extrudedHeight:100,vertexFormat:Cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:Cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:Cesium.ArcType.GEODESIC,material:Cesium.Color.WHITE},b=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=styleOption.level_max-1,this._Provider.loadTile=function(e,t){if((this.tile=t).state===Cesium.QuadtreeTileLoadState.START&&b.item.show)if(t.data={lines:[],geometryPrimitive:void 0},t.level>=o.level_min&&t.level<o.level_max){var i=Ce.filter(s,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=i.length&&i[0].data&&0<i[0].data.length)return t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:i[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,void(t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));C=t,Cesium.Resource.createIfNeeded("http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/tile/0/0/0.pbf").fetchArrayBuffer().then(function(e){var t=new yt(new Je(e));b.labelCollections=new b._cesium.PointPrimitiveCollection;var i,o=[],r=[];for(i in t.layers)for(var n=t.layers[i],a=0;a<n.length;a++)for(var s=n.feature(a),l=s.loadGeometry(),u=0;u<l.length;u++)for(var c=l[u],h=0;h<c.length;h++){if(c[h],1==s.type)try{var m,d=s.toGeoJSON(0,0,0,b.extent);null!=b._option.text&&/^\[/.test(b._option.text)&&/\]$/.test(b._option.text)&&(m=b._option.text.replace(/\[/,"").replace(/\]/,""),w.text=s.properties[m]),w.position=new b._cesium.Cartesian3.fromDegrees(d.geometry.coordinates[0],d.geometry.coordinates[1],w.height);var p={},p="point"==d.geometry.type?{id:d,color:w.material,position:w.position}:w;b.labelCollections.add(p)}catch(e){}if(2==s.type){c[0];for(d=s.toGeoJSON(C.x,C.y,C.level,b.extent),h=0;h<d.geometry.coordinates.length;h++)try{var g=[];d.geometry.coordinates[h].forEach(function(e){g.push(e[0],e[1])});var _=new Cesium.PolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArray(g),width:10}),f=Cesium.PolylineGeometry.createGeometry(_),y=new Cesium.GeometryInstance({geometry:f});o.push(y)}catch(e){}}if(3==s.type){c[0];for(d=s.toGeoJSON(C.x,C.y,C.level,b.extent),h=0;h<d.geometry.coordinates.length;h++)try{g=[];d.geometry.coordinates[h].forEach(function(e){g.push(e[0],e[1])});var v=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(g))}),f=Cesium.PolygonGeometry.createGeometry(v),y=new Cesium.GeometryInstance({geometry:f});r.push(y)}catch(e){}}}0<b.labelCollections.length&&b._viewer.scene.primitives.add(b.labelCollections),0<o.length&&b._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:o,appearance:new b._cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.fromRandom({alpha:1})}}}),faceForward:!0,flat:!1}),shadows:Cesium.ShadowMode.ENABLED})),0<r.length&&b._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:r,appearance:new b._cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.fromRandom({alpha:1})}}}),faceForward:!0,flat:!1}),shadows:Cesium.ShadowMode.ENABLED}))})}else t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.data.geometryPrimitive.update(e,[]),t._parent&&t._parent.data&&t._parent.data.geometryPrimitive&&(t._parent.data.geometryPrimitive.destroy(),t._parent.data.geometryPrimitive=null,t._parent.state=Cesium.QuadtreeTileLoadState.START),t._southwestChild&&t._southwestChild.data&&t._southwestChild.data.geometryPrimitive&&(t._southwestChild.data.geometryPrimitive.destroy(),t._southwestChild.data.geometryPrimitive=null,t._southwestChild.state=Cesium.QuadtreeTileLoadState.START),t._southeastChild&&t._southeastChild.data&&t._southeastChild.data.geometryPrimitive&&(t._southeastChild.data.geometryPrimitive.destroy(),t._southeastChild.data.geometryPrimitive=null,t._southeastChild.state=Cesium.QuadtreeTileLoadState.START),t._northwestChild&&t._northwestChild.data&&t._northwestChild.data.geometryPrimitive&&(t._northwestChild.data.geometryPrimitive.destroy(),t._northwestChild.data.geometryPrimitive=null,t._northwestChild.state=Cesium.QuadtreeTileLoadState.START),t._northeastChild&&t._northeastChild.data&&t._northeastChild.data.geometryPrimitive&&(t._northeastChild.data.geometryPrimitive.destroy(),t._northeastChild.data.geometryPrimitive=null,t._northeastChild.state=Cesium.QuadtreeTileLoadState.START)),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0);var C},this._primitive=new b._cesium.QuadtreePrimitive({tileProvider:this._Provider}),this._viewer.scene.primitives.add(this._primitive)},Ct.prototype.createVolumeGeoJsonFeatureLayer=function(e,t,n,i,a){var s={polylinePositions:void 0,shapePositions:void 0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:this._cesium.Math.RADIANS_PER_DEGREE,vertexFormat:this._cesium.VertexFormat.DEFAULT,cornerType:this._cesium.CornerType.ROUNDED};null==t&&console.log("geojson is required");var o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t),l=this,u=[];s.shapePositions=this.computeCircle(n.radius),o.then(function(e){var t=l._cesium.Color.WHITE;l._core.isnull(n)||l._core.isnull(n.material)||(t="["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)?n.material.replace(/\[/,"").replace("/]/",""):Ce.clone(n.material),t=l._core.isHtmlColor(t)?l._color.colorFromHtmlColor(n.material):(1<(t=/^rgb/.test(t)?l._color.rgbaStringToRgbaObj(t):t).r&&(t.r=t.r/255),1<t.g&&(t.g=t.g/255),1<t.b&&(t.b=t.b/255),1<t.a&&(t.a=t.a/255),l._color.createColor(t.r,t.g,t.b,t.a)));for(var i=e.entities.values,o=0;o<i.length;o++){var r=i[o];s.polylinePositions=r.polyline.positions._value;r=new l._cesium.PolylineVolumeGeometry(s),r=l._cesium.PolylineVolumeGeometry.createGeometry(r),r=new l._cesium.GeometryInstance({geometry:r});u.push(r)}t=l._viewer.scene.primitives.add(new l._cesium.Primitive({geometryInstances:u,appearance:new l._cesium.MaterialAppearance({material:new l._cesium.Material({fabric:{type:"Color",uniforms:{color:t}}}),faceForward:!0,flat:!1})}));l.item=t,0==n.show&&(t.show=!1),"function"==typeof a&&a(t)}),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+n.id);e={id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:geoOptions.url,style:n};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(i)?0:i),this},Ct.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var o=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(o),e*Math.sin(o)))}return t},Ct.prototype.createVolumeGeoJsonFeatureLayerProvider=function(e,t,c,i,o,r){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,Cesium:this._cesium};this._core.isnull(c)||this._core.isnull(c.material)||"["==c.material.toString().charAt(0)&&"]"==c.material.toString().charAt(c.material.length-1)||(this._core.isHtmlColor(c.material)?c.material=this._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=this._color.rgbaStringToRgbaObj(c.material)),1<c.material.r&&(c.material.r=c.material.r/255),1<c.material.g&&(c.material.g=c.material.g/255),1<c.material.b&&(c.material.b=c.material.b/255),1<c.material.a&&(c.material.a=c.material.a/255),c.material=this._color.createColor(c.material.r,c.material.g,c.material.b,c.material.a)));var h=this._core.extend(n,c,!0),a=new Ae(this._viewer,this._cesium,a);this._Provider=a;var m=this;a._loadTile=function(e){var u=new m._cesium.PrimitiveCollection;return e.features.forEach(function(e){var t=[];/^\[/.test(c.material)&&/\]$/.test(c.material)&&(i=c.material.replace(/\[/,"").replace(/\]/,""),h.material=e.properties[i],that._core.isHtmlColor(h.material)?h.material=that._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=that._color.rgbaStringToRgbaObj(h.material)),1<h.material.r&&(h.material.r=h.material.r/255),1<h.material.g&&(h.material.g=h.material.g/255),1<h.material.b&&(h.material.b=h.material.b/255),1<h.material.a&&(h.material.a=h.material.a/255),h.material=that._color.createColor(h.material.r,h.material.g,h.material.b,h.material.a)));for(var i,o=0;o<e.geometry.coordinates.length;o++){var r=e.geometry.coordinates[o];if(0<r.length)if(Array.isArray(r[0]))for(var n=0;n<r.length;n++){var a=r[n],a=m._cesium.Cartesian3.fromDegrees(a[0],a[1],h.height);t.push(a)}else{var s=m._cesium.Cartesian3.fromDegrees(r[0],r[1],h.height);t.push(s)}}h.position=t,"0"==h.slttype||0==h.slttype?h.shape=m._core.computeCircle(h.radius):"1"==h.slttype||1==h.slttype?h.shape=m._core.starPositions(h.number,h.exradius,h.inradius):"2"!=h.slttype&&2!=h.slttype||(i=h.orth_width/2,l=h.orth_height/2,h.shape=[new m._cesium.Cartesian2(-i,-l),new m._cesium.Cartesian2(i,-l),new m._cesium.Cartesian2(i,l),new m._cesium.Cartesian2(-i,l)]),e.positions=t;var l={polylinePositions:h.position,shapePositions:h.shape,cornerType:h.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},l=new m._cesium.PolylineVolumeGeometry(l),l=m._cesium.PolylineVolumeGeometry.createGeometry(l),l=new m._cesium.GeometryInstance({id:e,geometry:l,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}}),l=new m._cesium.Primitive({allowPicking:!0,appearance:new m._cesium.MaterialAppearance({material:new m._cesium.Material({fabric:{type:"Color",uniforms:{color:h.material}}}),faceForward:!0,flat:!1}),shadows:h.shadows,geometryInstances:l});u.add(l)}),u},this.item=a._primitiveCollection,a.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:h.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t.url,style:c};this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},Ct.prototype.setTreeobj=function(e){this.treeobj=e},Ct.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},Ct.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},Ct.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(e)}catch(e){}},Ct.prototype.setVisibility=function(e){this.item.show=e,this._Provider&&this._Provider.setStatus(e)},bt.prototype.createWallGeoFeatureLayer=function(o,r,e,a,s,t,i){var n={positions:[],minimumHeights:[],maximumHeights:[],granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED};this._core.isnull(e)||this._core.isnull(e.material)||"["==e.material.toString().charAt(0)&&"]"==e.material.toString().charAt(e.material.length-1)||(this._core.isHtmlColor(e.material)?e.material=this._color.colorFromHtmlColor(e.material):(/^rgb/.test(e.material)&&(e.material=this._color.rgbaStringToRgbaObj(e.material)),1<e.material.r&&(e.material.r=e.material.r/255),1<e.material.g&&(e.material.g=e.material.g/255),1<e.material.b&&(e.material.b=e.material.b/255),1<e.material.a&&(e.material.a=e.material.a/255),e.material=this._color.createColor(e.material.r,e.material.g,e.material.b,e.material.a)));var l=this._core.extend(n,e,!0);this._core.isnull(a)&&(a=16),this._core.isnull(s)&&(s=14),null==r&&console.log("url is required"),null==o&&console.log("layername is required");var u=this,c=[];this._VectorTileProvider.loadTile=function(e,t){if((this.tile=t).state===u._cesium.QuadtreeTileLoadState.START)if(t.data={lines:[],geometryPrimitive:void 0},t.level>=s&&t.level<a){var i=Ce.filter(c,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=i.length&&i[0].data&&0<i[0].data.length)return t.data.geometryPrimitive=new u._cesium.Primitive({geometryInstances:i[0].data,appearance:new u._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:u._cesium.ShadowMode.ENABLED}),t.state=u._cesium.QuadtreeTileLoadState.LOADING,void(t.state===u._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=u._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));c.push({level:t.level,x:t.x,y:t.y,data:void 0}),n=t,u._core.xhr({url:r+"?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER="+o+"&STYLE=&TILEMATRIX=EPSG:4490:"+n.level+"&TILEMATRIXSET=EPSG:4490&FORMAT=application/json;type=geojson&TILECOL="+n.x+"&TILEROW="+n.y,type:"get",dataType:"json",success:function(e){var t=[];for(var i=0;i<e.features.length;i++){var o=[];!function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i]):o.push(t[i])}(e.features[i].geometry.coordinates[0]);var r=u._cesium.Cartesian3.fromDegreesArray(o);l.positions=r;r=new u._cesium.GeometryInstance({geometry:new u._cesium.WallGeometry({positions:l.positions}),attributes:{color:new u._cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE)}});t.push(r)}Ce.filter(c,function(e){return e.x==n.x&&e.y==n.y})[0].data=t,n.data.geometryPrimitive=new u._cesium.Primitive({geometryInstances:t,appearance:new u._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:u._cesium.ShadowMode.ENABLED})},error:function(){c=Ce.remove(c,function(e){return e.x==n.x&&e.y==n.y&&e.level==n.level})},complete:function(){n.state=u._cesium.QuadtreeTileLoadState.LOADING,n.state===u._cesium.QuadtreeTileLoadState.LOADING&&(n.data.geometryPrimitive&&n.data.geometryPrimitive.update(e,[]),n.state=u._cesium.QuadtreeTileLoadState.DONE,n.renderable=!0)}})}else t.state=u._cesium.QuadtreeTileLoadState.LOADING,t.state===u._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=u._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0);var n},this._primitive=new u._cesium.QuadtreePrimitive({tileProvider:this._VectorTileProvider}),this._viewer.scene.primitives.add(this._primitive)},bt.prototype.createWallPrimitiveGeoFeatureLayer=function(e,t,u,i,c,h){var m={positions:void 0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,maximumHeights:0,minimumHeights:0,vertexFormat:this._cesium.VertexFormat.DEFAULT};null==t&&console.log("geojson is required");var o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t),d=this,p=[];o.then(function(e){for(var t=e.entities.values,i=0;i<t.length;i++){var o=t[i];m.positions=o.polyline.positions._value;var r=new Array(m.positions.length),n=new Array(m.positions.length),a=void 0,s=void 0,a=/^\[/.test(u.minimumHeights)?(a=u.minimumHeights.replace(/\[/,"").replace("/]/",""),o.properties[a]._value):u.minimumHeights,s=/^\[/.test(u.maximumHeights)?(s=u.maximumHeights.replace(/\[/,"").replace("/]/",""),o.properties[s]._value):u.maximumHeights;r.fill(a),n.fill(s),m.minimumHeights=r,m.maximumHeights=n;r=d._cesium.Color.WHITE;d._core.isnull(u)||d._core.isnull(u.material)||(r="["==u.material.toString().charAt(0)&&"]"==u.material.toString().charAt(u.material.length-1)?u.material.replace(/\[/,"").replace("/]/",""):Ce.clone(u.material),r=d._core.isHtmlColor(r)?d._color.colorFromHtmlColor(u.material):(1<(r=/^rgb/.test(r)?d._color.rgbaStringToRgbaObj(r):r).r&&(r.r=r.r/255),1<r.g&&(r.g=r.g/255),1<r.b&&(r.b=r.b/255),1<r.a&&(r.a=r.a/255),d._color.createColor(r.r,r.g,r.b,r.a)));n="material:"+255*r.red+","+255*r.green+","+255*r.blue;d.Legend.push(n);r=new d._cesium.GeometryInstance({id:o,geometry:new d._cesium.WallGeometry(m),attributes:{color:new d._cesium.ColorGeometryInstanceAttribute.fromColor(r)}});p.push(r)}u&&u.time&&(l=new d._cesium.TimeIntervalCollection([new d._cesium.TimeInterval({start:u.time.start?d._cesium.JulianDate.fromDate(new Date(u.time.start)):d._cesium.Iso8601.MINIMUM_VALUE,stop:u.time.end?d._cesium.JulianDate.fromDate(new Date(u.time.end)):d._cesium.Iso8601.MAXIMUM_VALUE})]));var l=d._viewer.scene.primitives.add(new d._cesium.Primitive({geometryInstances:p,appearance:new d._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0})}),l);d.item=l,c||_this.setVisibility(!1),"function"==typeof h&&h(l)}),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建墙图层"+options.id);t={id:u.id,name:e,pId:this._core.isnull(i)?0:i,type:"polylineWallLayer",item:this,url:t,style:options};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},bt.prototype.createWallGeoJsonFeatureLayerProvider=function(e,t,l,i,o,r){var u={positions:void 0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,maximumHeights:0,minimumHeights:0,vertexFormat:this._cesium.VertexFormat.DEFAULT},n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(l)||this._core.isnull(l.material)||"["==l.material.toString().charAt(0)&&"]"==l.material.toString().charAt(l.material.length-1)||(this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a)));n=new Ae(this._viewer,this._cesium,n);this._Provider=n;var c=this;n._loadTile=function(e){c.Legend=[];var s=new c._cesium.PrimitiveCollection;return e.features.forEach(function(n){var i=[],a=!1;function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):(i.push(e[t]),2!==t||a||(a=!0))}if(Array.isArray(n.geometry.coordinates)&&0<n.geometry.coordinates.length)if(Array.isArray(n.geometry.coordinates[0][0]))for(var e=0;e<n.geometry.coordinates.length;e++)i=[],o(n.geometry.coordinates[e]),t(i);else o(n.geometry.coordinates),t(i);function t(e){/^\[/.test(l.material)&&/\]$/.test(l.material)&&(r=l.material.replace(/\[/,"").replace(/\]/,""),options.material=n.properties[r],c._core.isHtmlColor(options.material)?options.material=c._color.colorFromHtmlColor(options.material):(/^rgb/.test(options.material)&&(options.material=c._color.rgbaStringToRgbaObj(options.material)),1<options.material.r&&(options.material.r=options.material.r/255),1<options.material.g&&(options.material.g=options.material.g/255),1<options.material.b&&(options.material.b=options.material.b/255),1<options.material.a&&(options.material.a=options.material.a/255),options.material=c._color.createColor(options.material.r,options.material.g,options.material.b,options.material.a)));var t=a?c._cesium.Cartesian3.fromDegreesArrayHeights(e):c._cesium.Cartesian3.fromDegreesArray(e);u.positions=t,n.positions=t;var i=new Array(u.positions.length),o=new Array(u.positions.length),r=void 0,t=void 0,r=/^\[/.test(l.minimumHeights)?(r=l.minimumHeights.replace(/\[/,"").replace("/]/",""),entity.properties[r]._value):l.minimumHeights,t=/^\[/.test(l.maximumHeights)?(t=l.maximumHeights.replace(/\[/,"").replace("/]/",""),entity.properties[t]._value):l.maximumHeights;i.fill(r),o.fill(t),u.minimumHeights=i,u.maximumHeights=o,n.treeID=l.id,n.VectorType="wall",n.VectorStyle={haveZ:a,minimumHeights:i,maximumHeights:o,positions:e,material:l.material};o=new c._cesium.GeometryInstance({id:n,geometry:new c._cesium.WallGeometry(u),attributes:{color:new c._cesium.ColorGeometryInstanceAttribute.fromColor(l.material)}}),e="material:"+255*l.material.red+","+255*l.material.green+","+255*l.material.blue;c.Legend.push(e);o=new c._cesium.Primitive({geometryInstances:o,appearance:new c._cesium.MaterialAppearance({material:new c._cesium.Material({fabric:{type:"Color",uniforms:{color:l.material}}}),faceForward:!0,flat:!1}),vertexCacheOptimize:!0,interleave:!0,shadows:c._cesium.ShadowMode.ENABLED});s.add(o)}}),s},l&&l.time&&(n.availability=new c._cesium.TimeIntervalCollection([new c._cesium.TimeInterval({start:l.time.start?c._cesium.JulianDate.fromDate(new Date(l.time.start)):c._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?c._cesium.JulianDate.fromDate(new Date(l.time.end)):c._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建墙图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineWallLayer",item:this,url:t.url,style:l};return this._Provider.treeID=l.id,this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},bt.prototype.setTreeobj=function(e){this.treeobj=e},bt.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},bt.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},bt.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},bt.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},bt.prototype.setVisibility=function(e){this.item.show=e,this._Provider&&this._Provider.setStatus(!e)},bt.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},bt.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},Tt.prototype.createSimpleGraphic=function(e,t={},i){let o=null;var r=e=>{this.SimpleGraphicObj.length&&!this.editHandler?this.edit(this.openEdit,this.editOption):!this.SimpleGraphicObj.length&&this.editHandler&&this.edit(!1),e&&t.removeEdit&&this.SimpleGraphicObj.pop(),i&&i(e)};switch(this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),e){case"point":o=this.createPoint(t,r);break;case"billboard":o=this.createBillboard(t,r);break;case"label":o=this.createLabel(t,r);break;case"model":o=this.createModel(t,r);break;case"polyline":o=this.createPolyline(t,r);break;case"polygon":o=this.createPolygon(t,r);break;case"triangle":o=this.createTriangle(t,r);break;case"polygon-rectangle":o=this.createPolygonRectangle(t,r);break;case"rectangle":o=this.createRectangle(t,r);break;case"circle":o=this.createCircle(t,r);break;case"ellipse":o=this.createEllipse(t,r);break;case"box":o=this.createBox(t,r);break;case"cylinder":o=this.createCylinder(t,r);break;case"cone":o=this.createCone(t,r);break;case"sphere":o=this.createSphere(t,r);break;case"polyhedron":o=this.createPolyhedron(t,r)}return o},Tt.prototype.addSimpleGraphic=function(t,i={},e){let o=null;switch(t){case"point":o=this.addPoint(i);break;case"billboard":o=this.addBillboard(i);break;case"label":o=this.addLabel(i);break;case"model":o=this.addModel(i);break;case"polyline":o=this.addPolyline(i);break;case"polylinePrimitive":o=this.addPolylinePrimitive(i);break;case"polygon":o=this.addPolygon(i);break;case"polygonPrimitive":o=this.addPolygonPrimitive(i);break;case"rectangle":o=this.addRectangle(i);break;case"circle":o=this.addCircle(i);break;case"ellipse":o=this.addEllipse(i);break;case"box":o=this.addBox(i);break;case"cylinder":o=this.addCylinder(i);break;case"cone":o=this.addCone(i);break;case"sphere":case"ellipsoid":o=this.addSphere(i);break;case"polyhedron":o=this.addPolyhedron(i)}if(this.SimpleGraphicObj.length&&!this.editHandler&&this.edit(this.openEdit,this.editOption),o&&i.removeEdit&&this.SimpleGraphicObj.pop(),o.deleteObject=()=>{this.remove(o.id),this._viewer.entities.removeById(o.id)},e&&(i.GroupID=e.pId,i.id=e.id,i.name=e.name),void 0!==i.GroupID){let e={id:o.id,name:o.name,pId:i.GroupID,type:t,item:{item:o,setVisibility:e=>{o.show=e}}};-1<t.indexOf("Primitive")&&(e.id=i.id,e.name=i.name),we.insertGroupId(e,i.GroupID)}return o},Tt.prototype.addSimpleGraphicGroup=function(t,i={},e){let o=null;switch(t){case"point":o=this.addPoint(i);break;case"billboard":o=this.addBillboard(i);break;case"label":o=this.addLabel(i);break;case"model":o=this.addModel(i);break;case"polyline":o=this.addPolyline(i);break;case"polylinePrimitive":o=this.addPolylinePrimitive(i);break;case"polygon":o=this.addPolygon(i);break;case"polygonPrimitive":o=this.addPolygonPrimitive(i);break;case"rectangle":o=this.addRectangle(i);break;case"circle":o=this.addCircle(i);break;case"ellipse":o=this.addEllipse(i);break;case"box":o=this.addBox(i);break;case"cylinder":o=this.addCylinder(i);break;case"cone":o=this.addCone(i);break;case"sphere":case"ellipsoid":o=this.addSphere(i);break;case"polyhedron":o=this.addPolyhedron(i)}if(this.SimpleGraphicObj.length&&!this.editHandler&&this.edit(this.openEdit,this.editOption),o&&i.removeEdit&&this.SimpleGraphicObj.pop(),o.deleteObject=()=>{this.remove(o.id),this._viewer.entities.removeById(o.id)},e&&(i.GroupID=e.pId,i.id=e.id,i.name=e.name),void 0!==i.GroupID){let e={id:o.id,name:o.name,pId:i.GroupID,type:t,item:{item:o,setVisibility:e=>{o.show=e}}};-1<t.indexOf("Primitive")&&(e.id=i.id,e.name=i.name),we.insertGroupId(e,i.GroupID)}return o},Tt.prototype.createPoint=function(t={},i){let o=this,r=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1,this.drawHandler.setInputAction(e=>{e=o._getPosition.getMousePosition(e);e&&(e=r.entities.add({id:o._core.getuid(),name:"Point",position:e,point:{pixelSize:16,color:o._cesium.Color.fromCssColorString(o._core.defaultValue(t.color,"#0000ff")),outlineWidth:o._core.defaultValue(t.outlineWidth,2),outlineColor:o._cesium.Color.fromCssColorString(o._core.defaultValue(t.outlineColor,"rgba(255,255,255,0.6)")),disableDepthTestDistance:o._core.defaultValue(t.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:o._core.defaultValue(t.distanceDisplayCondition,new o._cesium.DistanceDisplayCondition(0,1e8))}}),o.SimpleGraphicObj.push(e.id),o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0"),i&&"function"==typeof i&&i(e))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{o.tooltip.showAt(e.endPosition,"点击绘制点")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=()=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0")},this},Tt.prototype.addPoint=function(e={}){var t=this;let i=this._viewer;e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"Point"),position:e.position,point:{pixelSize:t._core.defaultValue(e.pixelSize,16),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"#0000ff")),outlineWidth:t._core.defaultValue(e.outlineWidth,2),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),heightReference:t._core.defaultValue(e.heightReference,1),scaleByDistance:t._core.defaultValue(e.scaleByDistance,void 0),disableDepthTestDistance:t._core.defaultValue(e.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},Tt.prototype.createBillboard=function(t={},i){let o=this,r=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1,this.drawHandler.setInputAction(e=>{e=o._getPosition.getMousePosition(e);e&&(e=r.entities.add({id:o._core.getuid(),name:"Billboard",position:e,billboard:{horizontalOrigin:o._cesium.HorizontalOrigin.CENTER,verticalOrigin:o._cesium.VerticalOrigin.BOTTOM,scale:o._core.defaultValue(t.scale,1),width:o._core.defaultValue(t.width,t.image?void 0:32),height:o._core.defaultValue(t.height,t.image?void 0:44),image:o._core.defaultValue(t.image,window.SmartEarthRootUrl+D.mark),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(t.color,"#ffffff")),disableDepthTestDistance:o._core.defaultValue(t.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:o._core.defaultValue(t.distanceDisplayCondition,new o._cesium.DistanceDisplayCondition(0,1e8))}}),o.SimpleGraphicObj.push(e.id),o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0"),i&&"function"==typeof i&&i(e))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{o.tooltip.showAt(e.endPosition,"点击绘制图标")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=()=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0")},this},Tt.prototype.addBillboard=function(e={}){var t=this;let i=this._viewer;e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"Billboard"),position:e.position,billboard:{horizontalOrigin:t._core.defaultValue(e.horizontalOrigin,t._cesium.HorizontalOrigin.CENTER),verticalOrigin:t._core.defaultValue(e.verticalOrigin,t._cesium.VerticalOrigin.BOTTOM),scale:t._core.defaultValue(e.scale,1),rotation:t._core.defaultValue(e.rotation,0),width:t._core.defaultValue(e.width,void 0),height:t._core.defaultValue(e.height,void 0),image:t._core.defaultValue(e.image,window.SmartEarthRootUrl+D.mark),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"#ffffff")),heightReference:t._core.defaultValue(e.heightReference,1),scaleByDistance:t._core.defaultValue(e.scaleByDistance,void 0),disableDepthTestDistance:t._core.defaultValue(e.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},Tt.prototype.createLabel=function(t={},i){let o=this,r=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1,this.drawHandler.setInputAction(e=>{e=o._getPosition.getMousePosition(e);e&&(e=r.entities.add({id:o._core.getuid(),name:"Label",position:e,label:{text:"新建文本",font:"24px 宋体",fillColor:o._cesium.Color.fromCssColorString(o._core.defaultValue(t.fillColor,"#ffffff")),scale:1,style:2,outlineColor:o._cesium.Color.BLACK,outlineWidth:0,showBackground:!1,backgroundColor:new o._cesium.Color(.165,.165,.165,.8),horizontalOrigin:o._cesium.HorizontalOrigin.CENTER,verticalOrigin:o._cesium.VerticalOrigin.CENTER,distanceDisplayCondition:o._core.defaultValue(t.distanceDisplayCondition,new o._cesium.DistanceDisplayCondition(0,1e8)),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),o.SimpleGraphicObj.push(e.id),o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0"),i&&"function"==typeof i&&i(e))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{o.tooltip.showAt(e.endPosition,"点击绘制文本")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=()=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0")},this},Tt.prototype.addLabel=function(e={}){var t=this;let i=this._viewer;e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"Label"),position:e.position,label:{text:t._core.defaultValue(e.text,"新建文本"),font:t._core.defaultValue(e.font,"24px 宋体"),scale:t._core.defaultValue(e.scale,1),style:t._core.defaultValue(e.style,2),fillColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.fillColor,"#ffffff")),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"#000000")),outlineWidth:t._core.defaultValue(e.outlineWidth,0),showBackground:t._core.defaultValue(e.showBackground,!1),backgroundColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.backgroundColor,"rgba(42,42,42,0.8)")),heightReference:t._core.defaultValue(e.heightReference,1),horizontalOrigin:t._core.defaultValue(e.horizontalOrigin,t._cesium.HorizontalOrigin.CENTER),verticalOrigin:t._core.defaultValue(e.verticalOrigin,t._cesium.VerticalOrigin.CENTER),scaleByDistance:t._core.defaultValue(e.scaleByDistance,void 0),pixelOffset:t._core.defaultValue(e.pixelOffset,void 0),disableDepthTestDistance:t._core.defaultValue(e.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},Tt.prototype.createModel=function(o={},t){let r=this,n=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(n.scene.canvas),we.states=1;let a;var e=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(r._core.defaultValue(o.heading,0))),i=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(r._core.defaultValue(o.pitch,0))),s=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(r._core.defaultValue(o.roll,0)));let l=Cesium.Matrix4.fromRotationTranslation(e),u=Cesium.Matrix4.fromRotationTranslation(i),c=Cesium.Matrix4.fromRotationTranslation(s);this.drawHandler.setInputAction(e=>{e=r._getPosition.getMousePosition(e,a);e&&(a&&n.scene.primitives.remove(a),a=n.entities.add({id:r._core.getuid(),name:r._core.defaultValue(o.name,"Model"),position:e,orientation:Cesium.Transforms.headingPitchRollQuaternion(e,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(r._core.defaultValue(o.heading,0)),Cesium.Math.toRadians(r._core.defaultValue(o.pitch,0)),Cesium.Math.toRadians(r._core.defaultValue(o.roll,0)))),model:{uri:r._core.defaultValue(o.url,window.SmartEarthRootUrl+D.testModel),scale:r._core.defaultValue(o.scale,1),minimumPixelSize:0,runAnimations:!0,colorBlendMode:r._core.defaultValue(o.colorBlendMode,void 0),color:r._cesium.Color.fromCssColorString(r._core.defaultValue(o.color,"#ffffff")),distanceDisplayCondition:r._core.defaultValue(o.distanceDisplayCondition,new r._cesium.DistanceDisplayCondition(0,1e8))}}),a.heading=r._core.defaultValue(o.heading,0),a.pitch=r._core.defaultValue(o.pitch,0),a.roll=r._core.defaultValue(o.roll,0),r.SimpleGraphicObj.push(a.id),r.drawHandler.destroy(),r.drawHandler=void 0,r.tooltip.show(!1),setTimeout(function(){we.states=0},100),r._core.mouse(r._viewer.container,0,"0"),t&&"function"==typeof t&&t(a))},this._cesium.ScreenSpaceEventType.LEFT_CLICK);let h=!1;return this.drawHandler.setInputAction(e=>{var t,i=r._getPosition.getMousePosition(e,a);a?(t=Cesium.Transforms.eastNorthUpToFixedFrame(i),Cesium.Matrix4.multiply(t,l,t),Cesium.Matrix4.multiply(t,u,t),Cesium.Matrix4.multiply(t,c,t),a.modelMatrix=t):i&&(i=Cesium.Transforms.eastNorthUpToFixedFrame(i),Cesium.Matrix4.multiply(i,l,i),Cesium.Matrix4.multiply(i,u,i),Cesium.Matrix4.multiply(i,c,i),a=n.scene.primitives.add(Cesium.Model.fromGltf({modelMatrix:i,url:r._core.defaultValue(o.url,window.SmartEarthRootUrl+D.testModel),scale:r._core.defaultValue(o.scale,1),minimumPixelSize:0,colorBlendMode:r._core.defaultValue(o.colorBlendMode,void 0),color:r._cesium.Color.fromCssColorString(r._core.defaultValue(o.color,"#ffffff")),distanceDisplayCondition:r._core.defaultValue(o.distanceDisplayCondition,new r._cesium.DistanceDisplayCondition(0,1e8)),allowPicking:!1})),a.readyPromise.then(()=>{h=!0})),h?r.tooltip.showAt(e.endPosition,"点击绘制模型"):r.tooltip.showAt(e.endPosition,"加载模型中...")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=()=>{this.end=void 0,r.drawHandler.destroy(),r.drawHandler=void 0,r.tooltip.show(!1),setTimeout(function(){we.states=0},100),r._core.mouse(r._viewer.container,0,"0")},this},Tt.prototype.addModel=function(e={}){var t=this;let i=this._viewer,o=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"Model"),position:e.position,orientation:Cesium.Transforms.headingPitchRollQuaternion(e.position,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(t._core.defaultValue(e.heading,0)),Cesium.Math.toRadians(t._core.defaultValue(e.pitch,0)),Cesium.Math.toRadians(t._core.defaultValue(e.roll,0)))),model:{scale:t._core.defaultValue(e.scale,1),uri:t._core.defaultValue(e.url,window.SmartEarthRootUrl+D.testModel),minimumPixelSize:t._core.defaultValue(e.minimumPixelSize,0),runAnimations:t._core.defaultValue(e.runAnimations,!0),colorBlendMode:t._core.defaultValue(e.colorBlendMode,void 0),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"#ffffff")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return o.heading=t._core.defaultValue(e.heading,0),o.pitch=t._core.defaultValue(e.pitch,0),o.roll=t._core.defaultValue(e.roll,0),t.SimpleGraphicObj.push(o.id),o},Tt.prototype.createPolyline=function(i={},t){let o=this,r=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1;let n=[],a;return this.drawHandler.setInputAction(e=>{let t=o._getPosition.getMousePosition(e,a);t&&(0===n.length&&n.push(t.clone()),n.push(t),i.toPoint&&3===n.length&&(n.pop(),o.end()),a||(a=r.entities.add({id:o._core.getuid(),name:o._core.defaultValue(i.name,"新建线"),polyline:{positions:new o._cesium.CallbackProperty(function(){return n},!1),clampToGround:o._core.defaultValue(i.clampToGround,!0),material:new Cesium.PolylineOutlineMaterialProperty({color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)")),outlineWidth:0,outlineColor:o._cesium.Color.WHITE.withAlpha(.6)}),depthFailMaterial:i.depthFailColor&&new Cesium.PolylineOutlineMaterialProperty({color:o._cesium.Color.fromCssColorString(i.depthFailColor),outlineWidth:0,outlineColor:o._cesium.Color.WHITE.withAlpha(.6)}),width:o._core.defaultValue(i.width,3),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}}),o.SimpleGraphicObj.push(a.id)),i.showSize&&o.showSizeData("polyline",[n[n.length-2],n[n.length-1]]))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{0===n.length?o.tooltip.showAt(e.endPosition,"点击开始绘制"):(o.tooltip.showAt(e.endPosition,"点击添加点,右键结束绘制"),(e=o._getPosition.getMousePosition(e,a))&&(n.pop(),n.push(e),i.showSize&&(o.clearLastSizeData(),o.showSizeData("polyline",[n[n.length-2],n[n.length-1]]))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0),o.end=void 0,"cancel"!==e?t&&"function"==typeof t&&t(a,n):a&&(r.entities.remove(a),o.SimpleGraphicObj.pop())},this.drawHandler.setInputAction(e=>{o.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},Tt.prototype.addPolyline=function(e={}){var t=this;let i=this._viewer;var o=e.positions,e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建线"),polyline:{positions:o,clampToGround:t._core.defaultValue(e.clampToGround,!0),material:new Cesium.PolylineOutlineMaterialProperty({color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)")),outlineWidth:t._core.defaultValue(e.outlineWidth,0),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)"))}),depthFailMaterial:e.depthFailColor&&new Cesium.PolylineOutlineMaterialProperty({color:t._cesium.Color.fromCssColorString(e.depthFailColor),outlineWidth:0,outlineColor:t._cesium.Color.WHITE.withAlpha(.6)}),width:t._core.defaultValue(e.width,3),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},Tt.prototype.addPolylinePrimitive=function(e={}){var t=this;this._viewer;var i=e.positions;let o;o=e.clampToGround?new t._cesium.GroundPolylineGeometry({positions:i,width:t._core.defaultValue(e.width,3)}):(r=new Cesium.PolylineGeometry({positions:i,width:t._core.defaultValue(e.width,3)}),Cesium.PolylineGeometry.createGeometry(r));var i=t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)")),r=new Cesium.GeometryInstance({id:t._core.defaultValue(e.id,t._core.getuid()),geometry:o,attributes:{color:new t._cesium.ColorGeometryInstanceAttribute.fromColor(i)}});let n;i=new t._cesium.PolylineColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0});return n=new(e.clampToGround?t._cesium.GroundPolylinePrimitive:t._cesium.Primitive)({geometryInstances:r,appearance:i}),this.PrimitiveCollection.add(n),n},Tt.prototype.createPolygon=function(i={},t){let o=this,r=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1;let n=[],a,s;return this.drawHandler.setInputAction(e=>{let t=o._getPosition.getMousePosition(e,[s,a]);t&&(0===n.length&&n.push(t.clone()),n.push(t),2!==n.length||s||(i.clampToGround=o._core.defaultValue(i.clampToGround,!0),s=r.entities.add({name:"临时线",polyline:{positions:new o._cesium.CallbackProperty(function(){return n},!1),clampToGround:o._core.defaultValue(i.clampToGround,!0),material:new Cesium.PolylineOutlineMaterialProperty({color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)")),outlineWidth:0,outlineColor:o._cesium.Color.WHITE.withAlpha(.6)}),width:3}})),3!==n.length||a||(s&&r.entities.remove(s),a=r.entities.add({id:o._core.getuid(),name:o._core.defaultValue(i.name,"新建面"),polygon:{hierarchy:new o._cesium.CallbackProperty(function(){return new o._cesium.PolygonHierarchy(n)},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),perPositionHeight:!o._core.defaultValue(i.clampToGround,!1),heightReference:i.clampToGround?1:0,outline:o._core.defaultValue(i.outline,!1),outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}}),o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0===n.length?o.tooltip.showAt(e.endPosition,"点击添加第一个点"):1===n.length?(o.tooltip.showAt(e.endPosition,"点击添加第二个点"),(t=o._getPosition.getMousePosition(e,[s,a]))&&(n.pop(),n.push(t))):(o.tooltip.showAt(e.endPosition,"点击添加点,右键结束绘制"),(e=o._getPosition.getMousePosition(e,[s,a]))&&(n.pop(),n.push(e),i.showSize&&(o.clearLastSizeData(),o.showSizeData("polygon",n))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),s&&r.entities.remove(s),o.clearAllSizeData(),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0"),o.end=void 0,"cancel"!==e?t&&"function"==typeof t&&t(a):a&&(r.entities.remove(a),o.SimpleGraphicObj.pop())},this.drawHandler.setInputAction(e=>{o.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},Tt.prototype.createTriangle=function(t={},i){let h=this,o=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(o.scene.canvas),we.states=1;let r=[],n,a;function s(e,t){let i=[];var o,r,n,a,s,l=h.toDegrees(e),u=h.toDegrees(t),c=(o=l.lat,r=l.lon,c=u.lat,n=u.lon,a=p(o),s=p(c),e=p(c)-p(o),t=p(n)-p(r),t=2*Math.asin(Math.sqrt(Math.pow(Math.sin(e/2),2)+Math.cos(a)*Math.cos(s)*Math.pow(Math.sin(t/2),2))),t*=m,t=Math.round(1e4*t)/1e4,{angle:h._core.TwoPointAzimuth(r,o,n,c),distance:t}),t=c.angle,c=c.distance;i.push(u.lon,u.lat);u=d(l.lat,l.lon,c,t+120);return i.push(u[0],u[1]),u=d(l.lat,l.lon,c,t-120),i.push(u[0],u[1]),Cesium.Cartesian3.fromDegreesArray(i)}this.drawHandler.setInputAction(e=>{e=h._getPosition.getMousePosition(e,a);e&&(n?(r=s(n,e),this.end()):(n=e,r=[e,e,e]),r.length&&!a&&(t.clampToGround=h._core.defaultValue(t.clampToGround,!0),a=o.entities.add({id:h._core.getuid(),name:"新建三角形",polygon:{hierarchy:new h._cesium.CallbackProperty(function(){return new h._cesium.PolygonHierarchy(r)},!1),material:new h._cesium.ImageMaterialProperty({image:null,repeat:new h._cesium.Cartesian2(1,1),color:h._cesium.Color.fromCssColorString(h._core.defaultValue(t.color,"rgba(0,255,0,0.6)"))}),perPositionHeight:!h._core.defaultValue(t.clampToGround,!1),heightReference:t.clampToGround?1:0,outline:h._core.defaultValue(t.outline,!1),outlineColor:h._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new h._cesium.DistanceDisplayCondition(0,1e8)}}),h.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;n?(h.tooltip.showAt(e.endPosition,"再次点击结束绘制"),(t=h._getPosition.getMousePosition(e,a))&&(r=s(n,t))):h.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){h.drawHandler.destroy(),h.drawHandler=void 0,h.tooltip.show(!1),setTimeout(function(){we.states=0},100),h._core.mouse(h._viewer.container,0),h.end=void 0,"cancel"!==e?i&&"function"==typeof i&&i(a):a&&(o.entities.remove(a),h.SimpleGraphicObj.pop())},this.drawHandler.setInputAction(e=>{h.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK);let m=6378137,l=6356725;function d(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=l+(m-l)*(90-e)/90;return[180*(r/(o*Math.cos(e*Math.PI/180))+t*Math.PI/180)/Math.PI,180*(i/o+e*Math.PI/180)/Math.PI]}function p(e){return e*Math.PI/180}return this},Tt.prototype.createPolygonRectangle=function(i={},t){let o=this,r=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1;let n=[],a,s,l;return this.drawHandler.setInputAction(e=>{let t=o._getPosition.getMousePosition(e,a);t&&(n.length?o.end():(s=e.position,n.push(t.clone(),t.clone(),t.clone(),t.clone())),a||(i.clampToGround=o._core.defaultValue(i.clampToGround,!0),a=r.entities.add({id:o._core.getuid(),name:"新建面",polygon:{hierarchy:new o._cesium.CallbackProperty(function(){return new o._cesium.PolygonHierarchy(n)},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),perPositionHeight:!o._core.defaultValue(i.clampToGround,!1),heightReference:i.clampToGround?1:0,outline:o._core.defaultValue(i.outline,!1),outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}})))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(t=>{if(0===n.length)o.tooltip.showAt(t.endPosition,"点击开始绘制");else{o.tooltip.showAt(t.endPosition,"点击结束绘制"),s=Viewer.scene.cartesianToCanvasCoordinates(n[0]),l=t.endPosition;var i={x:s.x,y:l.y},t={x:l.x,y:s.y};let e=o._getPosition.getMousePosition(i,a);e&&(n[1]=e),e=o._getPosition.getMousePosition(l,a),e&&(n[2]=e),e=o._getPosition.getMousePosition(t,a),e&&(n[3]=e)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0"),o.end=void 0,"cancel"!==e?t&&"function"==typeof t&&t(a,s,l):a&&r.entities.remove(a)},this},Tt.prototype.addPolygon=function(e={}){var t=this;let i=this._viewer;var o=e.positions;let r;r=e.hierarchy||new t._cesium.PolygonHierarchy(o),e.clampToGround=t._core.defaultValue(e.clampToGround,!0);e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建面"),polygon:{hierarchy:new t._cesium.CallbackProperty(function(){return r},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),outline:t._core.defaultValue(e.outline,!1),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),perPositionHeight:!t._core.defaultValue(e.clampToGround,!1),heightReference:e.clampToGround?1:0,distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},Tt.prototype.addPolygonPrimitive=function(e={}){var t=this;this._viewer;var i=e.positions;let o;o=e.hierarchy||new t._cesium.PolygonHierarchy(i);let r;var n=new t._cesium.PolygonGeometry({height:t._core.defaultValue(e.height,void 0),extrudedHeight:t._core.defaultValue(e.extrudedHeight,void 0),polygonHierarchy:o,vertexFormat:e.water?Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT:void 0}),i=t._cesium.PolygonGeometry.createGeometry(n),n=t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)")),i=new Cesium.GeometryInstance({id:t._core.defaultValue(e.id,t._core.getuid()),geometry:i,attributes:e.water?void 0:{color:new t._cesium.ColorGeometryInstanceAttribute.fromColor(n)}});let a;return e.water?a=new Cesium.Primitive({geometryInstances:i,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:e.watherColor||Cesium.Color.SKYBLUE.withAlpha(.6),blendColor:e.watherColor||Cesium.Color.SKYBLUE.withAlpha(.6),normalMap:e.url,frequency:e.frequency||1e3,animationSpeed:e.watherSpeed||.01,amplitude:e.amplitude||10}}})}),show:!0}):(a=new t._cesium.Primitive({geometryInstances:i,appearance:new t._cesium.PerInstanceColorAppearance({translucent:!0}),shadows:e.shadows}),e.extrudedHeight&&(r=new Cesium.PrimitiveCollection,n=new Cesium.PolygonOutlineGeometry({height:t._core.defaultValue(e.height,void 0),polygonHierarchy:o,extrudedHeight:e.extrudedHeight}),i=Cesium.PolygonOutlineGeometry.createGeometry(n),n=t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),n=new Cesium.GeometryInstance({id:t._core.defaultValue(e.id,t._core.getuid()),geometry:i,attributes:{color:new t._cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),t=new t._cesium.Primitive({geometryInstances:n,appearance:new t._cesium.PolylineColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0})}),r.add(a),r.add(t))),r=r||a,this.PrimitiveCollection.add(r),r},Tt.prototype.createRectangle=function(i={},t){let o=this,r=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1;let n=[],a;return this.drawHandler.setInputAction(e=>{e=o._getPosition.getMousePosition(e,a);e&&(0===n.length?n.push(e,e):(n.pop(),n.push(e),o.end()),a||(e=o.toDegrees(n[0]),i.clampToGround=o._core.defaultValue(i.clampToGround,!0),a=r.entities.add({id:o._core.getuid(),name:"新建矩形",rectangle:{coordinates:new o._cesium.CallbackProperty(function(){return o._cesium.Rectangle.fromCartesianArray(n)},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),height:i.clampToGround?void 0:e.height,heightReference:i.clampToGround?1:0,outline:!0,outlineColor:o._cesium.Color.WHITE.withAlpha(.6),outlineWidth:1,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}}),a.thisHeight=e.height,o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0<n.length?(o.tooltip.showAt(e.endPosition,"再次点击结束绘制,右键取消"),(t=o._getPosition.getMousePosition(e,a))&&(n.pop(),n.push(t),i.showSize&&(o.clearLastSizeData(),o.showSizeData("rectangle",n)))):o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"!==e?t&&"function"==typeof t&&t(a):a&&(r.entities.remove(a),o.SimpleGraphicObj.pop())},this},Tt.prototype.addRectangle=function(e={}){var t=this;let i=this._viewer;var o=e.positions;let r;r=e.coordinates||t._cesium.Rectangle.fromCartesianArray(o);e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建矩形"),rectangle:{coordinates:new t._cesium.CallbackProperty(function(){return r},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),height:t._core.defaultValue(e.height,void 0),rotation:t._core.defaultValue(e.rotation,0),heightReference:t._core.defaultValue(e.heightReference,1),outline:t._core.defaultValue(e.outline,!1),outlineWidth:1,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},Tt.prototype.createCircle=function(i={},t){let o=this,r=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1;let n=[],a,s=0;return this.drawHandler.setInputAction(e=>{e=o._getPosition.getMousePosition(e,a);e&&(0===n.length?n.push(e,e):(n[0]=e,s=o._cesium.Cartesian3.distance(n[0],n[1]),o.end()),a||(e=o.toDegrees(n[1]),i.clampToGround=o._core.defaultValue(i.clampToGround,!0),a=r.entities.add({id:o._core.getuid(),name:"新建圆",position:n[1],ellipse:{semiMajorAxis:new o._cesium.CallbackProperty(function(){return s},!1),semiMinorAxis:new o._cesium.CallbackProperty(function(){return s},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),height:i.clampToGround?void 0:e.height,heightReference:i.clampToGround?1:0,outline:!0,outlineWidth:1,outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}}),a.thisHeight=e.height,o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0<n.length?(o.tooltip.showAt(e.endPosition,"再次点击结束绘制,右键取消"),(t=o._getPosition.getMousePosition(e,a))&&(n[0]=t,s=o._cesium.Cartesian3.distance(n[0],n[1]),i.showSize&&(o.clearLastSizeData(),o.showSizeData("circle",n[1],s)))):o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"!==e?t&&"function"==typeof t&&t(a,{distance:s,positions:n}):a&&(r.entities.remove(a),o.SimpleGraphicObj.pop())},this},Tt.prototype.addCircle=function(e={}){var t=this;let i=this._viewer,o=e.radius;e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建圆"),position:e.position,ellipse:{semiMajorAxis:new t._cesium.CallbackProperty(function(){return o},!1),semiMinorAxis:new t._cesium.CallbackProperty(function(){return o},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),transparent:!0,color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,e.image?"#ffffff":"rgba(0,255,0,0.6)"))}),height:t._core.defaultValue(e.height,void 0),heightReference:t._core.defaultValue(e.heightReference,e.height?0:1),outline:t._core.defaultValue(e.outline,!1),outlineWidth:1,rotation:e.rotation,stRotation:e.outline,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},Tt.prototype.createEllipse=function(t={},i){let o=this,r=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1;let n=[],a,s=0;return this.drawHandler.setInputAction(e=>{e=o._getPosition.getMousePosition(e,a);e&&(0===n.length?n.push(e,e):(n[0]=e,s=o._cesium.Cartesian3.distance(n[0],n[1]),o.end()),a||(e=o.toDegrees(n[1]),t.clampToGround=o._core.defaultValue(t.clampToGround,!0),a=r.entities.add({id:o._core.getuid(),name:"新建椭圆",position:n[1],ellipse:{semiMajorAxis:new o._cesium.CallbackProperty(function(){return s},!1),semiMinorAxis:new o._cesium.CallbackProperty(function(){return s/2},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(t.color,"rgba(0,255,0,0.6)"))}),height:t.clampToGround?void 0:e.height,heightReference:t.clampToGround?1:0,outline:!0,outlineWidth:1,outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}}),a.thisHeight=e.height,o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0<n.length?(o.tooltip.showAt(e.endPosition,"再次点击结束绘制,右键取消"),(t=o._getPosition.getMousePosition(e,a))&&(n[0]=t,s=o._cesium.Cartesian3.distance(n[0],n[1]))):o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"!==e?i&&"function"==typeof i&&i(a):a&&(r.entities.remove(a),o.SimpleGraphicObj.pop())},this},Tt.prototype.addEllipse=function(e={}){var t=this;let i=this._viewer,o=e.semiMajorAxis,r=e.semiMinorAxis;e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建圆"),position:e.position,ellipse:{semiMajorAxis:new t._cesium.CallbackProperty(function(){return o},!1),semiMinorAxis:new t._cesium.CallbackProperty(function(){return r},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),height:t._core.defaultValue(e.height,void 0),heightReference:t._core.defaultValue(e.heightReference,1),outline:t._core.defaultValue(e.outline,!1),outlineWidth:1,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},Tt.prototype.createBox=function(n={},t){let a=this,r=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1;let s=[],l,u=[0,0,200];return this.drawHandler.setInputAction(e=>{let t=a._getPosition.getMouseDegrees(e,l);var i,o;t&&(0===s.length?s.push(t,t):(t.height=s[0].height,s[1]=t,i=a.Cdcl(s[0].lat,s[0].lon,s[0].lat,s[1].lon),o=a.Cdcl(s[0].lat,s[0].lon,s[1].lat,s[0].lon),e={lon:(s[0].lon+s[1].lon)/2,lat:(s[0].lat+s[1].lat)/2},u&&(u[0]=i,u[1]=o),l.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,s[0].height+u[2]/2),a.end()),l||(l=r.entities.add({id:a._core.getuid(),name:"新建立方体",position:a._cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height),box:{dimensions:new a._cesium.CallbackProperty(function(){return a._cesium.Cartesian3.fromArray(u)},!1),material:new a._cesium.ImageMaterialProperty({image:null,repeat:new a._cesium.Cartesian2(1,1),color:a._cesium.Color.fromCssColorString(a._core.defaultValue(n.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:!0,outlineColor:a._cesium.Color.fromCssColorString(a._core.defaultValue(n.outlineColor,"rgba(255,255,255,0.6)")),shadows:a._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new a._cesium.DistanceDisplayCondition(0,1e8)}}),a.SimpleGraphicObj.push(l.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(t=>{if(0<s.length){a.tooltip.showAt(t.endPosition,"再次点击结束绘制,右键取消");let e=a._getPosition.getMouseDegrees(t,l);var i,o,r;e&&(e.height=s[0].height,s[1]=e,i=a.Cdcl(s[0].lat,s[0].lon,s[0].lat,s[1].lon),o=a.Cdcl(s[0].lat,s[0].lon,s[1].lat,s[0].lon),r={lon:(s[0].lon+s[1].lon)/2,lat:(s[0].lat+s[1].lat)/2},u&&(u[0]=i,u[1]=o),l.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,s[0].height+u[2]/2),n.showSize&&(a.clearLastSizeData(),a.showSizeData("box",l.position,u)))}else a.tooltip.showAt(t.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{this.end=void 0,a.drawHandler.destroy(),a.drawHandler=void 0,a.tooltip.show(!1),a.clearAllSizeData(),setTimeout(function(){we.states=0},100),a._core.mouse(a._viewer.container,0,"0"),"cancel"!==e?t&&"function"==typeof t&&t(l):l&&(r.entities.remove(l),a.SimpleGraphicObj.pop())},this},Tt.prototype.addBox=function(e={}){var t=this;let i=this._viewer,o=e.dimensions;e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建立方体"),position:e.position,box:{dimensions:new t._cesium.CallbackProperty(function(){return o},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:t._core.defaultValue(e.outline,!0),shadows:t._cesium.ShadowMode.ENABLED,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},Tt.prototype.createCylinder=function(i={},t){let o=this,r=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1;let n=[],a,s=0;return this.drawHandler.setInputAction(e=>{e=o._getPosition.getMousePosition(e,a);e&&(0===n.length?n.push(e,e):(n[0]=e,s=o._cesium.Cartesian3.distance(n[0],n[1]),o.end()),a||(e=o.toDegrees(e),a=r.entities.add({id:o._core.getuid(),name:"新建圆柱体",position:o._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height+100),cylinder:{length:200,topRadius:new o._cesium.CallbackProperty(function(){return s},!1),bottomRadius:new o._cesium.CallbackProperty(function(){return s},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:o._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.outlineColor,"rgba(255,255,255,0.6)"))}}),a.changeTop=!0,o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0<n.length?(o.tooltip.showAt(e.endPosition,"再次点击结束绘制,右键取消"),(t=o._getPosition.getMousePosition(e,a))&&(n[0]=t,s=o._cesium.Cartesian3.distance(n[0],n[1]),i.showSize&&(o.clearLastSizeData(),o.showSizeData("cylinder",n[1],s,200)))):o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"!==e?t&&"function"==typeof t&&t(a):a&&(r.entities.remove(a),o.SimpleGraphicObj.pop())},this},Tt.prototype.addCylinder=function(e={}){var t=this;let i=this._viewer,o=e.radius,r=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建圆柱体"),position:e.position,cylinder:{length:t._core.defaultValue(e.length,200),topRadius:new t._cesium.CallbackProperty(function(){return o},!1),bottomRadius:new t._cesium.CallbackProperty(function(){return o},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:t._core.defaultValue(e.outline,!0),shadows:t._cesium.ShadowMode.ENABLED,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return r.changeTop=!0,t.SimpleGraphicObj.push(r.id),r},Tt.prototype.createCone=function(i={},t){let o=this,r=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1;let n=[],a,s=0;return this.drawHandler.setInputAction(e=>{e=o._getPosition.getMousePosition(e,a);e&&(0===n.length?n.push(e,e):(n[0]=e,s=o._cesium.Cartesian3.distance(n[0],n[1]),o.end()),a||(e=o.toDegrees(e),a=r.entities.add({id:o._core.getuid(),name:"新建圆锥体",position:o._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height+100),cylinder:{length:200,topRadius:0,bottomRadius:new o._cesium.CallbackProperty(function(){return s},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:o._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.outlineColor,"rgba(255,255,255,0.6)"))}}),a.changeTop=!1,o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0<n.length?(o.tooltip.showAt(e.endPosition,"再次点击结束绘制,右键取消"),(t=o._getPosition.getMousePosition(e,a))&&(n[0]=t,s=o._cesium.Cartesian3.distance(n[0],n[1]),i.showSize&&(o.clearLastSizeData(),o.showSizeData("cone",n[1],s,200)))):o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"!==e?t&&"function"==typeof t&&t(a):a&&(r.entities.remove(a),o.SimpleGraphicObj.pop())},this},Tt.prototype.addCone=function(e={}){var t=this;let i=this._viewer,o=e.bottomRadius,r=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建圆锥体"),position:e.position,cylinder:{length:t._core.defaultValue(e.length,200),topRadius:t._core.defaultValue(e.topRadius,0),bottomRadius:new t._cesium.CallbackProperty(function(){return o},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:t._core.defaultValue(e.outline,!0),shadows:t._cesium.ShadowMode.ENABLED,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return r.changeTop=!1,t.SimpleGraphicObj.push(r.id),r},Tt.prototype.createSphere=function(i={},o){let r=this,n=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(n.scene.canvas),we.states=1;let a=[],s,l=0;return this.drawHandler.setInputAction(e=>{let t=r._getPosition.getMousePosition(e,s);t&&(0===a.length?a.push(t,t):(a[0]=t,l=r._cesium.Cartesian3.distance(a[0],a[1]),r.end()),s||(s=n.entities.add({id:r._core.getuid(),name:"新建球体",position:t.clone(),ellipsoid:{radii:new r._cesium.CallbackProperty(function(){return new Cesium.Cartesian3(l,l,l)},!1),material:new r._cesium.ImageMaterialProperty({image:null,repeat:new r._cesium.Cartesian2(1,1),color:r._cesium.Color.fromCssColorString(r._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:r._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new r._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:r._cesium.Color.fromCssColorString(r._core.defaultValue(i.outlineColor,"rgba(255,255,255,0.6)"))}}),s.isSphere=!0,r.SimpleGraphicObj.push(s.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0<a.length?(r.tooltip.showAt(e.endPosition,"再次点击结束绘制,右键取消"),(t=r._getPosition.getMousePosition(e,s))&&(a[0]=t,l=r._cesium.Cartesian3.distance(a[0],a[1]),i.showSize&&(r.clearLastSizeData(),r.showSizeData("sphere",a[1],l)))):r.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=t=>{if(this.end=void 0,r.drawHandler.destroy(),r.drawHandler=void 0,r.tooltip.show(!1),r.clearAllSizeData(),setTimeout(function(){we.states=0},100),r._core.mouse(r._viewer.container,0,"0"),"cancel"!==t){let e=r.toDegrees(a[0]);t=r.toDegrees(a[1]);e.height=t.height,a[0]=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),o&&"function"==typeof o&&o(s)}else s&&(n.entities.remove(s),r.SimpleGraphicObj.pop())},this},Tt.prototype.addSphere=function(e={}){var t=this;let i=this._viewer;var o=e.radius;let r;r=e.radii||new Cesium.Cartesian3(o,o,o);let n=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建球体"),position:e.position,ellipsoid:{radii:new t._cesium.CallbackProperty(function(){return r},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:t._core.defaultValue(e.outline,!0),shadows:t._cesium.ShadowMode.ENABLED,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return n.isSphere=!0,t.SimpleGraphicObj.push(n.id),n},Tt.prototype.createPolyhedron=function(i={},t){let o=this,r=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1;let n=[],a;return this.drawHandler.setInputAction(e=>{let t=o._getPosition.getMousePosition(e,a);t&&(1===n.length&&n.push(t.clone()),n.push(t),3!==n.length||a||(e=o.toDegrees(n[0]),a=r.entities.add({id:o._core.getuid(),name:"新建多边体",polygon:{hierarchy:new o._cesium.CallbackProperty(function(){return new o._cesium.PolygonHierarchy(n)},!1),extrudedHeight:e.height+200,height:e.height,material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:o._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.outlineColor,"rgba(255,255,255,0.6)"))}}),o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{0===n.length?o.tooltip.showAt(e.endPosition,"点击添加第一个点"):1===n.length?o.tooltip.showAt(e.endPosition,"点击添加第二个点"):(o.tooltip.showAt(e.endPosition,"点击添加点,右键结束绘制"),(e=o._getPosition.getMousePosition(e,a))&&(n.pop(),n.push(e),i.showSize&&(o.clearLastSizeData(),o.showSizeData("polyhedron",n,0,200))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0"),o.end=void 0,"cancel"!==e?t&&"function"==typeof t&&t(a):a&&(r.entities.remove(a),o.SimpleGraphicObj.pop())},this.drawHandler.setInputAction(e=>{o.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},Tt.prototype.addPolyhedron=function(e={}){var t=this;let i=this._viewer;var o=e.positions,r=t._core.defaultValue(e.height,0);let n;n=e.hierarchy||new t._cesium.PolygonHierarchy(o);e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建多边体"),polygon:{hierarchy:new t._cesium.CallbackProperty(function(){return n},!1),extrudedHeight:t._core.defaultValue(e.extrudedHeight,r+200),height:r,material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),shadows:t._cesium.ShadowMode.ENABLED,fill:!0,outline:t._core.defaultValue(e.outline,!0),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},Tt.prototype.toDegrees=function(e){e=this._cesium.Cartographic.fromCartesian(e);return{lon:this._cesium.Math.toDegrees(e.longitude),lat:this._cesium.Math.toDegrees(e.latitude),height:e.height}},Tt.prototype.showSizeData=function(o,r,n,a){let s="",l;switch(o){case"polyline":let e=Cesium.Cartesian3.distance(r[0],r[1]);s=1e3<=e?(e/=1e3,e.toFixed(2)+"千米"):e.toFixed(2)+"米",l=Cesium.Cartesian3.midpoint(r[0],r[1],new Cesium.Cartesian3);break;case"polygon":var u=[];l=new Cesium.Cartesian3,r.forEach(e=>{l=Cesium.Cartesian3.add(e,l,new Cesium.Cartesian3);e=this.toDegrees(e);u.push([e.lon,e.lat])}),l=Cesium.Cartesian3.divideByScalar(l,r.length,new Cesium.Cartesian3),s=this._core.getArea(u,r);break;case"rectangle":var c=this.toDegrees(r[0]),h=this.toDegrees(r[1]),c=Cesium.Cartesian3.distance(r[0],Cesium.Cartesian3.fromDegrees(c.lon,h.lat,c.height))*Cesium.Cartesian3.distance(r[1],Cesium.Cartesian3.fromDegrees(c.lon,h.lat,c.height));s=1e6<=c?(c/=1e6).toFixed(2)+"平方千米":c.toFixed(2)+"平方米",l=Cesium.Cartesian3.midpoint(r[0],r[1],new Cesium.Cartesian3);break;case"circle":l=r,s=1e3<=n?"半径:"+(n/=1e3).toFixed(2)+"千米":"半径:"+n.toFixed(2)+"米";break;case"box":let t=[];n[0]<n[1]?(t.push(n[1]),t.push(n[0])):(t.push(n[0]),t.push(n[1])),t.push(n[2]);let i=["长:","\n宽:","\n高:"];t.forEach((e,t)=>{1e3<=e?(e/=1e3,s+=i[t]+e.toFixed(2)+"千米"):s+=i[t]+e.toFixed(2)+"米"}),l=r;break;case"cylinder":case"cone":l=r,s=1e3<=n?"半径:"+(n/=1e3).toFixed(2)+"千米\n":"半径:"+n.toFixed(2)+"米\n",1e3<=a?(a/=1e3,s+="高度:"+a.toFixed(2)+"千米"):s+="高度:"+a.toFixed(2)+"米";break;case"sphere":l=r,s=1e3<=n?"半径:"+(n/=1e3).toFixed(2)+"千米":"半径:"+n.toFixed(2)+"米";break;case"polyhedron":u=[];l=new Cesium.Cartesian3,r.forEach(e=>{l=Cesium.Cartesian3.add(e,l,new Cesium.Cartesian3);e=this.toDegrees(e);u.push([e.lon,e.lat])}),l=Cesium.Cartesian3.divideByScalar(l,r.length,new Cesium.Cartesian3),s=1e3<=a?"高度:"+(a/=1e3).toFixed(2)+"千米":"高度:"+a.toFixed(2)+"米",s+="\n面积:"+this._core.getArea(u,r)}o=this._viewer.entities.add({position:l,label:{text:s,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});this.SizeData.push(o.id)},Tt.prototype.clearLastSizeData=function(){var e;this.SizeData.length&&(e=this.SizeData.pop(),this._viewer.entities.removeById(e))},Tt.prototype.clearAllSizeData=function(){this.SizeData.forEach(e=>{this._viewer.entities.removeById(e)}),this.SizeData=[]},Tt.prototype.Cdcl=function(e,t,i,o){let r=Math.PI;function n(e){return e*r/180}var a=n((e+i)/2),e=n((e-i)/2),i=n((t-o)/2),t=Math.sin(e),o=Math.sin(i),e=Math.sin(a),i=(t*=t)*(1-(o*=o))+(1-(e*=e))*o,a=(1-t)*(1-o)+e*o;return 2*(o=Math.atan(Math.sqrt(i/a)))*6378137*(1+1/298.257*((3*(o=Math.sqrt(i*a)/o)-1)/2/a*e*(1-t)-(3*o+1)/2/i*(1-e)*t))},Tt.prototype.setEdit=function(e,t={}){void 0===e&&(e=!0),this.editOption=t=t||{},this.openEdit=e},Tt.prototype.openEditProp=function(e,i){i=i||(this.editOption||{editPropData:{}}),void 0===e.GeoType&&(t=this.getEntityTypeAndObject(e),e.GeoType=t.type);var t=e.GeoType;SmartEarthPopupData.editGraphic&&SmartEarthPopupData.editGraphic.entity||(this.getSimpleGraphicData(t,e),"point"===t||"billboard"===t||"label"===t||"model"===t?(this.isEditting=!0,"model"===t&&this._ModelEdit.start(e)):(this.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint())),i.editPropData||(i.editPropData={}),this._popupmessage.createPopupProp("属性编辑",{width:i.editPropData.width||360,height:i.editPropData.height||"90%",url:"Workers/prop/jdtx_prop.html",shade:i.editPropData.shade,offset:i.editPropData.offset,type:t,fn:{success:(e,t)=>{i.editPropData.success&&i.editPropData.success(e,t),SmartEarthPopupData.layerIndex=t,SmartEarthPopupData.window=e.find("iframe")[0].contentWindow},end:()=>{i.callBack&&i.callBack.end&&i.callBack.end(e),SmartEarthPopupData.layerIndex=void 0,SmartEarthPopupData.window=void 0,this.endThisEdit&&this.endThisEdit()}}})},Tt.prototype.edit=function(e,r){let p=this,g=this._viewer;var _,f,y,v;void 0!==(r=r||(this.editOption||{})).editProp&&(this.editProp=r.editProp),this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),void 0===e&&(e=!0),this.isEditting=!1;let C;this.endThisEdit=()=>{p.defaultEvent(!0),we.editPointID.edit.forEach(e=>{g.entities.removeById(e)}),we.editPointID.edit=[],we.editPointID.height.forEach(e=>{g.entities.removeById(e)}),we.editPointID.height=[],we.editPointID.add.forEach(e=>{g.entities.removeById(e)}),we.editPointID.add=[],we.editPointID.size.forEach(e=>{g.entities.removeById(e)}),we.editPointID.size=[],we.editPointID.move&&g.entities.remove(we.editPointID.move),we.editPointID.move=void 0,v=_=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={},p.isEditting=!1,p.tooltip.show(!1),p.delButton(!1),p._ModelEdit.end()},this.endThisEdit(),e&&(this.editHandler=new this._cesium.ScreenSpaceEventHandler(g.scene.canvas),this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))p.isEditting&&(p.endThisEdit(),p.defaultEvent(!1));else if(!we.editVector){var i=t.position,o=g.scene.pick(i);if(p._cesium.defined(o)&&o.id instanceof Cesium.Entity){let e=o.id;p.isEditting||0!=we.states?e==_&&("point"===e.GeoType||"billboard"===e.GeoType||"label"===e.GeoType)||"height_point"==e.name||"edit_point"==e.name||"move_point"==e.name||"add_point"==e.name||"size_point"==e.name?(g.container.style.cursor="crosshair",p.defaultEvent(!1),"height_point"==e.name?(y={windowPosition:i,originHeight:p._cesium.Cartographic.fromCartesian(e.position.getValue()).height},C="height_point"):"move_point"==e.name?C="move_point":"point"===e.GeoType||"billboard"===e.GeoType||"label"===e.GeoType?(p.tooltip.showAt(t.position,"释放后完成修改"),C="move_point"):"edit_point"==e.name?C="edit_point":"add_point"==e.name?C="add_point":"size_point"==e.name&&(C="size_point"),f=e):_&&e.id===_.id||p.endThisEdit():-1!==p.SimpleGraphicObj.indexOf(e.id)&&(void 0===(_=e).GeoType&&(i=p.getEntityTypeAndObject(_),_.GeoType=i.type),v=_.GeoType,p.getSimpleGraphicData(v,_),"point"===v||"billboard"===v||"label"===v||"model"===v?(p.isEditting=!0,"model"===v?p._ModelEdit.start(_):p.tooltip.showAt(t.position,"拖拽修改位置")):(p.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint()),this.editProp&&p.openEditProp(_,r))}else o&&"modeEditAxis"===o.id||p.endThisEdit()}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))p.isEditting&&(p.endThisEdit(),p.defaultEvent(!1));else if(!we.editVector){var o=g.scene.pick(t.endPosition);if(p._cesium.defined(o))if(p.isEditting&&!f){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))return void(p.isEditting&&(p.endThisEdit(),p.defaultEvent(!1)));"point"!==v&&"billboard"!==v&&"label"!==v&&"model"!==v||o.id!=_?o.id&&"edit_point"===o.id.name&&_.pottingPoint?"polyline"===v&&2<_.pottingPoint.length||"polygon"===v&&3<_.pottingPoint.length?p.tooltip.showAt(t.endPosition,"拖拽修改位置,右键删除点"):p.tooltip.showAt(t.endPosition,"拖拽修改位置"):!o.id||"move_point"!==o.id.name&&"size_point"!==o.id.name?o.id&&"add_point"===o.id.name?p.tooltip.showAt(t.endPosition,"拖拽增加节点"):o.id&&"height_point"===o.id.name?p.tooltip.showAt(t.endPosition,"拖拽修改高度"):o.id!=_&&"modeEditAxis"!==o.id||p.tooltip.show(!1):p.tooltip.showAt(t.endPosition,"拖拽修改位置"):p.tooltip.showAt(t.endPosition,"model"===v?"右键删除":"拖拽修改位置,右键删除")}else p.isEditting||0!==we.states||(o.id&&-1<p.SimpleGraphicObj.indexOf(o.id.id)?p.tooltip.showAt(t.endPosition,"点击激活编辑,右键删除"):p.tooltip.show(!1));else 0!=we.states||f||p.tooltip.show(!1);if(p.isEditting&&f){p.tooltip.showAt(t.endPosition,"释放后完成修改");let i=p._getPosition.getMousePosition(t,[f,_]);if(i||"height_point"===C)if("edit_point"===C){f.position=i;var r,n=we.editPointID.edit.indexOf(f.id);if(void 0!==_[v].height?(r=p.toDegrees(i),_.pottingPoint[n]=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,_[v].height.getValue()),f.position=_.pottingPoint[n]):_.pottingPoint[n]=i,0<we.editPointID.height.length){let e=g.entities.getById(we.editPointID.height[n]);e&&(o=p.toDegrees(i),r=p._cesium.Cartographic.fromCartesian(e.position.getValue()),e.position=p._cesium.Cartesian3.fromDegrees(o.lon,o.lat,r.height))}if(0<we.editPointID.add.length){if(0<n){let i=g.entities.getById(we.editPointID.add[n-1]);if(i){let e=g.entities.getById(we.editPointID.edit[n-1]),t=g.entities.getById(we.editPointID.edit[n]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}if(n<_.pottingPoint.length-1){let i=g.entities.getById(we.editPointID.add[n]);if(i){let e=g.entities.getById(we.editPointID.edit[n]),t=g.entities.getById(we.editPointID.edit[n+1]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}if("polygon"===v&&(0===n||n===_.pottingPoint.length-1)){let i=g.entities.getById(we.editPointID.add[we.editPointID.add.length-1]);if(i){let e=g.entities.getById(we.editPointID.edit[0]),t=g.entities.getById(we.editPointID.edit[_.pottingPoint.length-1]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}}let e=_.pottingPoint.concat([]),t=new p._cesium.Cartesian3;n=e.length;e.forEach(e=>{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=n,t.y/=n,t.z/=n,we.editPointID.move&&(we.editPointID.move.position=t),"polyline"!==v&&"polygon"!==v&&"rectangle"!==v||SmartEarthPopupData.editGraphic.setValue("positions",e)}else if("height_point"===C){var a=we.editPointID.height.indexOf(f.id);let e=g.entities.getById(we.editPointID.edit[a]);"ellipse"!==v&&"cylinder"!==v&&"box"!==v||(e=we.editPointID.move);let i=p.toDegrees(e.position.getValue());var s=y.originHeight-i.height,l=g.scene.cartesianToCanvasCoordinates(e.position.getValue()),a=(y.windowPosition.y-t.endPosition.y)*s/Math.abs(l.y-y.windowPosition.y);let o=Math.abs(s+a);we.editPointID.height.forEach(e=>{let t=g.entities.getById(e);t&&(e=t.position.getValue(),e=p.toDegrees(e),t.position=p._cesium.Cartesian3.fromDegrees(e.lon,e.lat,o+i.height))}),_[v].extrudedHeight?_[v].extrudedHeight=new p._cesium.CallbackProperty(function(){return o+i.height},!1):"box"===v?SmartEarthPopupData.editGraphic.setValue("height",o):"cylinder"===v&&SmartEarthPopupData.editGraphic.setValue("length",o),SmartEarthPopupData.window&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="extrudedHeight"]')&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="extrudedHeight"]').value=parseFloat(o).toFixed(2)),SmartEarthPopupData.window.document.querySelector('.box input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.box input[name="height"]').value=parseFloat(o).toFixed(2)),SmartEarthPopupData.window.document.querySelector('.cylinder input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.cylinder input[name="height"]').value=parseFloat(o).toFixed(2)),SmartEarthPopupData.window.document.querySelector('.cone input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.cone input[name="height"]').value=parseFloat(o).toFixed(2)))}else if("add_point"===C){l=we.editPointID.add.indexOf(f.id);g.entities.remove(f);s=g.entities.add({name:"edit_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(we.editPointID.edit.splice(l+1,0,s.id),_.pottingPoint.splice(l+1,0,i.clone()),0<we.editPointID.height.length){let e=p.toDegrees(i);e.height=_[v].extrudedHeight.getValue();var u=g.entities.add({name:"height_point",position:p._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),point:{color:p._cesium.Color.YELLOW,pixelSize:12,outlineColor:p._cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.height.splice(l+1,0,u.id)}a=Cesium.Cartesian3.midpoint(_.pottingPoint[l],_.pottingPoint[l+1],new Cesium.Cartesian3),u=g.entities.add({name:"add_point",position:p.isClampToGround(_[v])?p.getClampToGroundPosition(a):a,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),a=Cesium.Cartesian3.midpoint(_.pottingPoint[l+1],_.pottingPoint[l+2===_.pottingPoint.length?0:l+2],new Cesium.Cartesian3),a=g.entities.add({name:"add_point",position:p.isClampToGround(_[v])?p.getClampToGroundPosition(a):a,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.add.splice(l,1,u.id,a.id),f=s,C="edit_point";s=_.pottingPoint.concat([]);"polyline"!==v&&"polygon"!==v||SmartEarthPopupData.editGraphic.setValue("positions",s)}else if("size_point"===C){var e=we.editPointID.move.position.getValue(),e=p._cesium.Cartesian3.distance(e,i);"ellipse"===v||"cylinder"===v||"ellipsoid"===v&&_.isSphere?(SmartEarthPopupData.editGraphic.setValue("radius",e),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector("."+v+' input[name="radius"]')&&(SmartEarthPopupData.window.document.querySelector("."+v+' input[name="radius"]').value=parseFloat(e).toFixed(2))):"box"===v&&(c=90===f.angle?"long":"width",SmartEarthPopupData.editGraphic.setValue(c,2*e),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.box input[name="'+c+'"]')&&(SmartEarthPopupData.window.document.querySelector('.box input[name="'+c+'"]').value=parseFloat(2*e).toFixed(2)))}else if("model"!==v){if("point"===v||"billboard"===v||"label"===v)return f.position=i,void(SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector("."+v+' input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector("."+v+' input[name="height"]').value=SmartEarthPopupData.editGraphic.getValue("pHeight").toFixed(2)));var c=p.toDegrees(i);y=f.position.getValue();e=p.toDegrees(y);let a=c.lon-e.lon,s=c.lat-e.lat,l=c.height-e.height;f.position=i,_[v].height&&(d=p.toDegrees(i).height,_[v].height=d,_.thisHeight=d),_.pottingPoint.forEach((e,t)=>{let i,o,r,n=g.entities.getById(we.editPointID.edit[t]);if(n=n||g.entities.getById(we.editPointID.size[t]),i=n?p.toDegrees(n.position.getValue()):p.toDegrees(e),r=p._cesium.Cartesian3.fromDegrees(i.lon+a,i.lat+s,i.height+l),e.x=r.x,e.y=r.y,e.z=r.z,n&&(n.position=r),0<we.editPointID.height.length){let e=g.entities.getById(we.editPointID.height[t]);e&&(i=e.position.getValue(),o=p._cesium.Cartographic.fromCartesian(i),i={lon:p._cesium.Math.toDegrees(o.longitude),lat:p._cesium.Math.toDegrees(o.latitude),height:o.height},e.position=p._cesium.Cartesian3.fromDegrees(i.lon+a,i.lat+s,i.height+l))}if(0<we.editPointID.add.length&&we.editPointID.add[t]){let e=g.entities.getById(we.editPointID.add[t]);e&&(i=p.toDegrees(e.position.getValue()),e.position=p._cesium.Cartesian3.fromDegrees(i.lon+a,i.lat+s,i.height+l))}});var h,m,d=_.pottingPoint.concat([]);"polyline"===v||"polygon"===v||"rectangle"===v?(SmartEarthPopupData.editGraphic.setValue("positions",d),0<we.editPointID.height.length&&(SmartEarthPopupData.editGraphic.setValue("extrudedHeight",SmartEarthPopupData.editGraphic.getValue("extrudedHeight")+l),SmartEarthPopupData.window&&_[v].height&&SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]').value=parseFloat(_[v].height.getValue()).toFixed(2))),SmartEarthPopupData.window&&_[v].height&&SmartEarthPopupData.window.document.querySelector('.rectangle input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.rectangle input[name="height"]').value=parseFloat(_[v].height.getValue()).toFixed(2))):"ellipse"===v?(_.pottingPoint[1]=i,_.position=i.clone(),SmartEarthPopupData.window&&_[v].height&&SmartEarthPopupData.window.document.querySelector('.ellipse input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ellipse input[name="height"]').value=parseFloat(_[v].height.getValue()).toFixed(2))):"box"===v?(_.pottingPoint[2]=i,m=_.box.dimensions.getValue(),h=p.toDegrees(i),_.position=Cesium.Cartesian3.fromDegrees(h.lon,h.lat,h.height+m.z/2)):"cylinder"===v?(_.pottingPoint[1]=i,h=_.cylinder.length.getValue(),m=p.toDegrees(_.pottingPoint[1]),_.position=Cesium.Cartesian3.fromDegrees(m.lon,m.lat,m.height+h/2)):"ellipsoid"===v&&(_.pottingPoint[_.pottingPoint.length-1]=i,_.position=i.clone())}}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(e=>{Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?p.isEditting&&(p.endThisEdit(),p.defaultEvent(!1)):we.editVector||(f&&r.callBack&&r.callBack.update&&r.callBack.update(f.name,_),g.container.style.cursor="default",f=void 0,p.defaultEvent(!0))},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(o=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))p.isEditting&&(p.endThisEdit(),p.defaultEvent(!1));else if(!we.editVector){var e=g.scene.pick(o.position);if(p._cesium.defined(e)&&0==we.states){let i=e.id;if(-1<p.SimpleGraphicObj.indexOf(i.id))p.tooltip.show(!1),p.delButton(!0,o.position,function(){i.treeobj&&we.delete(i.treeobj.id,g,p._cesium),g.entities.removeById(i.id);var e=p.SimpleGraphicObj.indexOf(i.id);p.SimpleGraphicObj.splice(e,1),p.delButton(!1),p.tooltip.show(!1),p.endThisEdit(),!p.SimpleGraphicObj.length&&p.editHandler&&p.edit(!1),r.callBack&&r.callBack.delete&&r.callBack.delete(i)});else if(-1<we.editPointID.edit.indexOf(i.id)&&("polyline"===v&&2<we.editPointID.edit.length||"polygon"===v&&3<we.editPointID.edit.length)){o=we.editPointID.edit.indexOf(i.id);if(g.entities.removeById(i.id),we.editPointID.edit.splice(o,1),0<we.editPointID.height.length&&(g.entities.removeById(we.editPointID.height[o]),we.editPointID.height.splice(o,1)),_.pottingPoint.splice(o,1),0<we.editPointID.add.length)if(we.editPointID.add[o]){if(g.entities.removeById(we.editPointID.add[o]),we.editPointID.add.splice(o,1),0<=o-1){let e=g.entities.getById(we.editPointID.add[o-1]);e&&(e.position=Cesium.Cartesian3.midpoint(_.pottingPoint[o-1],_.pottingPoint[o===_.pottingPoint.length?0:o],new Cesium.Cartesian3))}else if(o-1==-1&&"polygon"===v){let e=g.entities.getById(we.editPointID.add[we.editPointID.add.length-1]);e&&(e.position=Cesium.Cartesian3.midpoint(_.pottingPoint[0],_.pottingPoint[_.pottingPoint.length-1],new Cesium.Cartesian3))}}else g.entities.removeById(we.editPointID.add[o-1]),we.editPointID.add.pop();let t=new p._cesium.Cartesian3;o=_.pottingPoint.length;_.pottingPoint.forEach(e=>{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=o,t.y/=o,t.z/=o,we.editPointID.move&&(we.editPointID.move.position=t);o=_.pottingPoint.concat([]);"polyline"!==v&&"polygon"!==v||SmartEarthPopupData.editGraphic.setValue("positions",o),p.tooltip.show(!1),r.callBack&&r.callBack.update&&r.callBack.update(f&&f.name,_)}}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN))},Tt.prototype.delButton=function(e,t,i){if(e){let e=document.getElementById("DeleteMilitaryStandardDelete");e||(e=document.createElement("button"),e.id="DeleteMilitaryStandardDelete",e.innerText="删除对象",e.style.cssText=`height: 38px;
                                    line-height: 38px;
                                    padding: 0 18px;
                                    background-color: #052355;
                                    color: #fff;
                                    white-space: nowrap;
                                    text-align: center;
                                    font-size: 14px;
                                    border: none;
                                    border-radius: 2px;
                                    cursor: pointer;
                                    position: absolute;`,this._viewer.container.appendChild(e)),e.style.display="block",e.style.top=t.y+"px",e.style.left=t.x+"px",e.onclick=i}else{let e=document.getElementById("DeleteMilitaryStandardDelete");e&&(e.style.display="none",e.onclick=null)}},Tt.prototype.defaultEvent=function(e){let t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},Tt.prototype.GetDegreesFromA_D=function(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=6356725+21412*(90-t)/90;return[180*(r/(o*Math.cos(t*Math.PI/180))+e*Math.PI/180)/Math.PI,180*(i/o+t*Math.PI/180)/Math.PI]},Tt.prototype.isClampToGround=function(e){return e.heightReference&&1===e.heightReference.getValue()},Tt.prototype.getClampToGroundPosition=function(e,t){let i=Cesium.Cartographic.fromCartesian(e);t=this._viewer.scene.sampleHeight(i,t);return i.height=t,Cesium.Cartographic.toCartesian(i)},Tt.prototype.GetPositionFromA_D=function(e,t,i){e=this.toDegrees(e),i=this.GetDegreesFromA_D(e.lon,e.lat,t,i);return this._cesium.Cartesian3.fromDegrees(i[0],i[1],e.height)},Tt.prototype.getEntityTypeAndObject=function(e){let t={type:"",object:null};return e&&(e.billboard?(t.type="billboard",t.object=e.billboard):e.box?(t.type="box",t.object=e.box):e.corridor?(t.type="corridor",t.object=e.corridor):e.cylinder?(t.type="cylinder",t.object=e.cylinder):e.ellipse?(t.type="ellipse",t.object=e.ellipse):e.ellipsoid?(t.type="ellipsoid",t.object=e.ellipsoid):e.label?(t.type="label",t.object=e.label):e.model?(t.type="model",t.object=e.model):e.path?(t.type="path",t.object=e.path):e.plane?(t.type="plane",t.object=e.plane):e.point?(t.type="point",t.object=e.point):e.polygon?(t.type="polygon",t.object=e.polygon):e.polyline?(t.type="polyline",t.object=e.polyline):e.polylineVolume?(t.type="polylineVolume",t.object=e.polylineVolume):e.rectangle?(t.type="rectangle",t.object=e.rectangle):e.wall&&(t.type="wall",t.object=e.wall)),t},Tt.prototype.getSimpleGraphicData=function(r,a){let s=this,l=this._viewer;var e,t,i,o,n;function u(e){SmartEarthPopupData.editGraphic.fillColor=h("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.alpha=100*e.alpha}function c(e){SmartEarthPopupData.editGraphic.outlineColor=h("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.outlineAlpha=100*e.alpha}function h(e){let t=e;if(/^(rgb|RGB)/.test(t)){let e=t.replace(/(rgb|RGB)*/g,"");e=e.replace("(","").replace(")","");var o=e.split(",");let i="#";for(let t=0;t<o.length;t++){let e=Number(o[t]).toString(16);e=1===e.length?"0"+e:e,"0"===e&&(e+=e),i+=e}return 7!==i.length&&(i=t),i}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;var i=t.replace(/#/,"").split("");if(6===i.length)return t;if(3===i.length){let t="#";for(let e=0;e<i.length;e+=1)t+=i[e]+i[e];return t}}SmartEarthPopupData.editGraphic={entity:a,type:r,graphic:a[r],getValue:function(e){if("position"===e||"name"===e||"id"===e||"orientation"===e||"heading"===e||"pitch"===e||"roll"===e)return this.entity[e]&&(this.entity[e].getValue?this.entity[e].getValue():this.entity[e]);if("radius"===e)return"ellipse"===this.type?this.graphic.semiMajorAxis.getValue():"ellipsoid"===this.type?this.graphic.radii.getValue().x:"cylinder"===this.type?this.graphic.bottomRadius.getValue():void 0;if("pHeight"!==e)return"repeat"===e?this.graphic.material[e]&&(this.graphic.material[e].getValue?this.graphic.material[e].getValue():this.graphic.material[e]):this.graphic[e]&&(this.graphic[e].getValue?this.graphic[e].getValue():this.graphic[e]);if(this.getValue("position")){e=this.getValue("position");return Cesium.Cartographic.fromCartesian(e).height}},changeHeightPoint:function(i){0<we.editPointID.height.length&&we.editPointID.height.forEach(e=>{let t=l.entities.getById(e);t&&(e=t.position.getValue(),e=s.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i))})},changeEditPoint:function(i){0<we.editPointID.edit.length&&we.editPointID.edit.forEach(e=>{let t=l.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=s.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))}),0<we.editPointID.size.length&&we.editPointID.size.forEach(e=>{let t=l.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=s.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))}),0<we.editPointID.add.length&&we.editPointID.add.forEach(e=>{let t=l.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=s.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))});let e=we.editPointID.move;var t;e&&("clampToGround"===i?e.point.heightReference=1:(e.point.heightReference=0,t=e.position.getValue(),t=s.toDegrees(t),e.position=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,i)))},clearAllEditPoint:function(){we.editPointID.edit.forEach(e=>{l.entities.removeById(e)}),we.editPointID.edit=[],we.editPointID.height.forEach(e=>{l.entities.removeById(e)}),we.editPointID.height=[],we.editPointID.add.forEach(e=>{l.entities.removeById(e)}),we.editPointID.add=[],we.editPointID.size.forEach(e=>{l.entities.removeById(e)}),we.editPointID.size=[],we.editPointID.move&&l.entities.remove(we.editPointID.move),we.editPointID.move=void 0}},"billboard"===r||"point"===r||"label"===r||"model"===r?((e=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor"))?u(e):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(e=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(e):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),"label"===r&&((t=SmartEarthPopupData.editGraphic.getValue("backgroundColor"))?(n=t,SmartEarthPopupData.editGraphic.backgroundColor=h("rgb("+255*n.red+","+255*n.green+","+255*n.blue+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=100*n.alpha):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)),SmartEarthPopupData.editGraphic.setValue=function(e,t){var i,o;if("position"===e&&this.entity.offset?(this.entity.oP=t,i=Cesium.Transforms.eastNorthUpToFixedFrame(this.entity.oP),o=new Cesium.Cartesian3(0,0,0),Cesium.Matrix4.multiplyByPoint(i,this.entity.offset,o),t=o):"offset"===e&&(this.entity.oP||(this.entity.oP=this.getValue("position")),this.entity.offset=t,o=Cesium.Transforms.eastNorthUpToFixedFrame(this.entity.oP),r=new Cesium.Cartesian3(0,0,0),Cesium.Matrix4.multiplyByPoint(o,this.entity.offset,r),t=r,e="position"),"position"===e||"name"===e)this.entity[e]=t;else if("autoRotate"===e&&"model"===this.type)void 0===this.entity.heading&&(this.entity.heading=0,this.entity.pitch=0,this.entity.roll=0),"number"==typeof t?(this.entity.orientation=new Cesium.CallbackProperty(()=>(this.entity.heading+=t,360<this.entity.heading&&(this.entity.heading-=360),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').value=this.entity.heading),Cesium.Transforms.headingPitchRollQuaternion(this.getValue("position"),new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.entity.heading),Cesium.Math.toRadians(this.entity.pitch),Cesium.Math.toRadians(this.entity.roll)))),!1),SmartEarthPopupData.window&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').disabled=!0),SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]').disabled=!0),SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]').disabled=!0))):!1===t&&(this.entity.orientation=Cesium.Transforms.headingPitchRollQuaternion(this.getValue("position"),new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.entity.heading),Cesium.Math.toRadians(this.entity.pitch),Cesium.Math.toRadians(this.entity.roll))),SmartEarthPopupData.window&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').disabled=!1),SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]').disabled=!1),SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]').disabled=!1)));else if("heading"!==e&&"pitch"!==e&&"roll"!==e||"model"!==this.type){if("color"===e||"outlineColor"===e||"backgroundColor"===e||"fillColor"===e)t=Cesium.Color.fromCssColorString(t);else if("fontSize"===e){let e=this.getValue("font");e=e.split(" "),e[0]=t,t=e.join(" ")}else{if("alpha"===e)return void("label"===this.type?this.graphic.fillColor._value.alpha=t:this.graphic.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("backgroundAlpha"===e)return void(this.graphic.backgroundColor._value.alpha=t);if("pHeight"===e&&this.getValue("position")){var r=this.getValue("position");let e=Cesium.Cartographic.fromCartesian(r);return e.height=t,void(this.entity.position=Cesium.Cartographic.toCartesian(e))}}this.graphic[e]=t}else this.entity[e]=t,this.entity.orientation=Cesium.Transforms.headingPitchRollQuaternion(this.getValue("position"),new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.entity.heading),Cesium.Math.toRadians(this.entity.pitch),Cesium.Math.toRadians(this.entity.roll)))}):"polyline"===r?((t=SmartEarthPopupData.editGraphic.getValue("material")).color?u(t.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),t.outlineColor?c(t.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e)return t=Cesium.Color.fromCssColorString(t),void(this.graphic.material[e]=t);"outlineWidth"!==e?"alpha"!==e?"outlineAlpha"!==e?this.graphic[e]="positions"!==e?t:new Cesium.CallbackProperty(function(){return t},!1):this.graphic.material.outlineColor._value.alpha=t:this.graphic.material.color._value.alpha=t:this.graphic.material[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("positions");return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let e=new Cesium.Cartesian3;t.forEach((t,i)=>{let o=l.entities.add({name:"edit_point",position:s.isClampToGround(this.graphic)?s.getClampToGroundPosition(t):t,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(we.editPointID.edit.push(o.id),void 0!==this.getValue("extrudedHeight")){var r=Cesium.Cartographic.fromCartesian(t),r={lon:Cesium.Math.toDegrees(r.longitude),lat:Cesium.Math.toDegrees(r.latitude),height:this.getValue("extrudedHeight")};if(this.getValue("height")){let e=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,this.getValue("height"));t.x=e.x,t.y=e.y,t.z=e.z,o.position=e,this.entity.pottingPoint[i]=e.clone()}r=l.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.height.push(r.id)}e.x+=t.x,e.y+=t.y,e.z+=t.z}),e.x/=t.length,e.y/=t.length,e.z/=t.length,we.editPointID.move=l.entities.add({name:"move_point",position:s.isClampToGround(this.graphic)?s.getClampToGroundPosition(e):e,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});for(let e=0;e<t.length-1;e++){var i=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),i=l.entities.add({name:"add_point",position:s.isClampToGround(this.graphic)?s.getClampToGroundPosition(i):i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.add.push(i.id)}}}):"polygon"===r?((i=SmartEarthPopupData.editGraphic.getValue("material")).color?u(i.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(i=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(i):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1));if("hierarchy"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return t},!1));if("clampToGround"===e){function i(e,t,i){i?(e.perPositionHeight=!1,e.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(e.perPositionHeight=!0,e.heightReference=Cesium.HeightReference.NONE),0<we.editPointID.edit.length&&!i&&t.forEach((e,t)=>{let i=l.entities.getById(we.editPointID.edit[t]);i&&(t=i.position.getValue(),e.x=t.x,e.y=t.y,e.z=t.z)}),e.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)}return void(this.graphic.hierarchy instanceof Cesium.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(()=>{i(this.graphic,this.entity.pottingPoint,t)},100)):i(this.graphic,this.entity.pottingPoint,t))}"extrudedHeight"===e?this.changeHeightPoint(t):"height"===e&&this.changeEditPoint(t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let e=this.getValue("hierarchy"),t=e.positions.concat([]);if(void 0!==this.getValue("height")){let i=this.getValue("height");t.forEach(e=>{var t=s.toDegrees(e),t=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,i);e.x=t.x,e.y=t.y,e.z=t.z})}return this.entity.pottingPoint=t,t},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let e=new Cesium.Cartesian3;t.forEach((t,i)=>{let o=l.entities.add({name:"edit_point",position:s.isClampToGround(this.graphic)?s.getClampToGroundPosition(t):t,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(we.editPointID.edit.push(o.id),void 0!==this.getValue("extrudedHeight")){var r=Cesium.Cartographic.fromCartesian(t),r={lon:Cesium.Math.toDegrees(r.longitude),lat:Cesium.Math.toDegrees(r.latitude),height:this.getValue("extrudedHeight")};if(this.getValue("height")){let e=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,this.getValue("height"));t.x=e.x,t.y=e.y,t.z=e.z,o.position=e,this.entity.pottingPoint[i]=e.clone()}r=l.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.height.push(r.id)}e.x+=t.x,e.y+=t.y,e.z+=t.z}),e.x/=t.length,e.y/=t.length,e.z/=t.length,we.editPointID.move=l.entities.add({name:"move_point",position:s.isClampToGround(this.graphic)?s.getClampToGroundPosition(e):e,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});for(let e=0;e<t.length-1;e++){var i=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),i=l.entities.add({name:"add_point",position:s.isClampToGround(this.graphic)?s.getClampToGroundPosition(i):i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.add.push(i.id)}var o=Cesium.Cartesian3.midpoint(t[0],t[t.length-1],new Cesium.Cartesian3),o=l.entities.add({name:"add_point",position:s.isClampToGround(this.graphic)?s.getClampToGroundPosition(o):o,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.add.push(o.id)}}):"ellipse"===r||"cylinder"===r||a.isSphere?((i=SmartEarthPopupData.editGraphic.getValue("material")).color?u(i.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(i=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(i):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,i){if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("semiMajorAxis"===e)return void(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return i},!1));if("semiMinorAxis"===e)return void(this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return i},!1));if("radii"===e)return void(this.graphic.radii=new Cesium.CallbackProperty(function(){return i},!1));if("topRadius"===e)return void(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return i},!1));if("bottomRadius"===e)return void(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return i},!1));if("radius"===e){"ellipse"===this.type?(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return i},!1),this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return i},!1)):"ellipsoid"===this.type?null!==this.graphic.material.image.getValue()?this.graphic.radii=new Cesium.Cartesian3(i,i,i):this.graphic.radii=new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(i,i,i)},!1):"cylinder"===this.type&&(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return i},!1),this.entity.changeTop&&(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return i},!1)));var o=we.editPointID.move.position.getValue(),r=s.GetPositionFromA_D(o,i,90);let e=l.entities.getById(we.editPointID.size[0]);e.position=r,a.pottingPoint[0]=r,a.pottingPoint[a.pottingPoint.length-1]=o;let t=l.entities.getById(we.editPointID.height[0]);return void(t&&(r=s.toDegrees(r),n=s._cesium.Cartographic.fromCartesian(t.position.getValue()),t.position=s._cesium.Cartesian3.fromDegrees(r.lon,r.lat,n.height)))}if("cylinder"===this.type&&"length"===e){this.graphic.length=i;var n=s.toDegrees(this.entity.pottingPoint[1]);return this.entity.position=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,n.height+i/2),void this.changeHeightPoint(n.height+i)}if("ellipse"===this.type&&"clampToGround"===e){function t(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);let o=t.semiMinorAxis.getValue();t.semiMinorAxis=new Cesium.CallbackProperty(function(){return o},!1),t.semiMajorAxis=new Cesium.CallbackProperty(function(){return o},!1)}return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(()=>{t(this.entity,this.graphic,i)},100)):t(this.entity,this.graphic,i),void(i?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"ellipse"===this.type&&"extrudedHeight"===e?this.changeHeightPoint(i):"ellipse"===this.type&&"height"===e&&(this.changeEditPoint(i),this.entity.thisHeight=i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e,t=this.getValue("radius");let i=this.getValue("position");if("ellipse"===this.type||this.entity.isSphere){"ellipse"===this.type&&void 0!==this.getValue("height")&&(o=this.getValue("height"),e=s.toDegrees(i),i=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,o));var o=s.GetPositionFromA_D(i,t,90);return this.entity.pottingPoint=[o,i],[o,i]}o=s.toDegrees(i);i=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height-this.getValue("length")/2);t=s.GetPositionFromA_D(i,t,90);return this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var t,i=this.getPottingPoint();if(i){let e=l.entities.add({name:"size_point",position:s.isClampToGround(this.graphic)?s.getClampToGroundPosition(i[0]):i[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(e.angle=90,we.editPointID.size.push(e.id),void 0!==this.getValue("extrudedHeight")){let e=s.toDegrees(i[1]);e.height=this.getValue("extrudedHeight");var o=l.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.height.push(o.id)}else"cylinder"===r&&(t=s.toDegrees(i[1]),o=this.getValue("length"),o=l.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height+o),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),we.editPointID.height.push(void 0,o.id));we.editPointID.move=l.entities.add({name:"move_point",position:s.isClampToGround(this.graphic)?s.getClampToGroundPosition(i[1]):i[1],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}):"rectangle"===r?((o=SmartEarthPopupData.editGraphic.getValue("material")).color?u(o.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(o=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(o):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return Cesium.Rectangle.fromCartesianArray(t)},!1));if("coordinates"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return t},!1));if("clampToGround"===e){function i(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);let o=t.coordinates.getValue();t.coordinates=new Cesium.CallbackProperty(function(){return o},!1)}return this.graphic.coordinates instanceof Cesium.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(()=>{i(this.entity,this.graphic,t)},100)):i(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight))}"extrudedHeight"===e?this.changeHeightPoint(t):"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("coordinates");let t,i,o=this.getValue("height");return i=(void 0!==o?t=Cesium.Cartesian3.fromRadians(e.west,e.north,o):(o=l.scene.sampleHeight(new Cesium.Cartographic(e.west,e.north,0),[this.entity]),t=Cesium.Cartesian3.fromRadians(e.west,e.north,o),o=l.scene.sampleHeight(new Cesium.Cartographic(e.east,e.south,0),[this.entity])),Cesium.Cartesian3.fromRadians(e.east,e.south,o)),this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let e=new Cesium.Cartesian3;t.forEach((t,i)=>{let o=l.entities.add({name:"edit_point",position:s.isClampToGround(this.graphic)?s.getClampToGroundPosition(t):t,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(we.editPointID.edit.push(o.id),void 0!==this.getValue("extrudedHeight")){var r=Cesium.Cartographic.fromCartesian(t),r={lon:Cesium.Math.toDegrees(r.longitude),lat:Cesium.Math.toDegrees(r.latitude),height:this.getValue("extrudedHeight")};if(this.getValue("height")){let e=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,this.getValue("height"));t.x=e.x,t.y=e.y,t.z=e.z,o.position=e,this.entity.pottingPoint[i]=e.clone()}r=l.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.height.push(r.id)}e.x+=t.x,e.y+=t.y,e.z+=t.z}),e.x/=t.length,e.y/=t.length,e.z/=t.length,we.editPointID.move=l.entities.add({name:"move_point",position:s.isClampToGround(this.graphic)?s.getClampToGroundPosition(e):e,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}):"box"===r?((o=SmartEarthPopupData.editGraphic.getValue("material")).color?u(o.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(o=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?c(o):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(t,i){if("name"===t)this.entity[t]=i;else{if("color"===t||"outlineColor"===t){if(i=Cesium.Color.fromCssColorString(i),"color"===t)return void(this.graphic.material.color=i)}else{if("image"===t||"repeat"===t)return void(this.graphic.material[t]=i);if("alpha"===t)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===t)return void(this.graphic.outlineColor._value.alpha=i);if("long"===t||"width"===t||"height"===t){let e=this.getValue("dimensions");if("long"===t?e.x=i:"width"===t?e.y=i:e.z=i,this.graphic.dimensions=new Cesium.CallbackProperty(function(){return e},!1),"long"===t||"width"===t){var o="long"===t?90:180,r="long"===t?0:1,n=we.editPointID.move.position.getValue(),o=s.GetPositionFromA_D(n,i/2,o);let e=l.entities.getById(we.editPointID.size[r]);e.position=o,this.entity.pottingPoint[r]=o,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{n=s.toDegrees(we.editPointID.move.position.getValue());this.entity.position=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,n.height+i/2),this.changeHeightPoint(n.height+i)}return}if("dimensions"===t)return void(this.graphic.dimensions=new Cesium.CallbackProperty(function(){return i},!1))}this.graphic[t]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("dimensions"),t=this.getValue("position"),i=s.toDegrees(t),t=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height-e.z/2),i=s.GetPositionFromA_D(t,e.x/2,90),e=s.GetPositionFromA_D(t,e.y/2,180);return this.entity.pottingPoint=[i,e,t],[i,e,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var i=this.getPottingPoint();if(i){let e=l.entities.add({name:"size_point",position:i[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});e.angle=90;let t=l.entities.add({name:"size_point",position:i[1],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});t.angle=180,we.editPointID.size.push(e.id),we.editPointID.size.push(t.id);var o=s.toDegrees(i[2]),r=this.getValue("dimensions"),r=l.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height+r.z),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});we.editPointID.height.push(void 0,void 0,r.id),we.editPointID.move=l.entities.add({name:"move_point",position:i[2],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}):"corridor"===r||"ellipsoid"===r&&a.isSphere},Tt.prototype.getStyle=function(t){let e,i;i=this.getEntityTypeAndObject(t).type;var o=r("distanceDisplayCondition");function r(e){return"position"===e||"name"===e||"id"===e?t[e]&&(t[e].getValue?t[e].getValue():t[e]):"radius"===e?"ellipse"===i?t[i].semiMajorAxis.getValue():"ellipsoid"===i?t[i].radii.getValue().x:"cylinder"===i?t[i].bottomRadius.getValue():void 0:"repeat"===e?t[i].material[e]&&(t[i].material[e].getValue?t[i].material[e].getValue():t[i].material[e]):t[i][e]&&(t[i][e].getValue?t[i][e].getValue():t[i][e])}return"point"===i?e={id:r("id"),name:r("name"),position:r("position"),pixelSize:r("pixelSize"),scaleByDistance:r("scaleByDistance"),color:r("color")&&r("color").toCssColorString(),outlineWidth:r("outlineWidth"),outlineColor:r("outlineColor")&&r("outlineColor").toCssColorString(),heightReference:r("heightReference"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"billboard"===i?e={id:r("id"),name:r("name"),position:r("position"),image:r("image"),scale:r("scale"),scaleByDistance:r("scaleByDistance"),rotation:r("rotation"),width:r("width"),height:r("height"),color:r("color")&&r("color").toCssColorString(),horizontalOrigin:r("horizontalOrigin"),verticalOrigin:r("verticalOrigin"),heightReference:r("heightReference"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"label"===i?e={id:r("id"),name:r("name"),position:r("position"),text:r("text"),font:r("font"),style:r("style"),scale:r("scale"),scaleByDistance:r("scaleByDistance"),fillColor:r("fillColor")&&r("fillColor").toCssColorString(),outlineColor:r("outlineColor")&&r("outlineColor").toCssColorString(),outlineWidth:r("outlineWidth"),showBackground:r("showBackground"),backgroundColor:r("backgroundColor")&&r("backgroundColor").toCssColorString(),horizontalOrigin:r("horizontalOrigin"),verticalOrigin:r("verticalOrigin"),heightReference:r("heightReference"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"model"===i?e={id:r("id"),name:r("name"),position:r("position"),url:r("uri"),minimumPixelSize:r("minimumPixelSize"),runAnimations:r("runAnimations"),scale:r("scale"),color:r("color")&&r("color").toCssColorString(),heightReference:r("heightReference"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"polyline"===i?e={id:r("id"),name:r("name"),positions:r("positions"),clampToGround:r("clampToGround"),color:r("material")&&r("material").color.toCssColorString(),outlineWidth:r("material")&&r("material").outlineWidth,outlineColor:r("material")&&r("material").outlineColor.toCssColorString(),width:r("width"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"polylineVolume"===i||"corridor"===i||"wall"===i||"path"===i||"plane"===i||("polygon"===i?e={id:r("id"),name:r("name"),positions:r("hierarchy").positions,color:r("material")&&r("material").color.toCssColorString(),image:r("material")&&r("material").image,repeat:r("material")&&r("material").repeat,outlineColor:r("outlineColor")&&r("outlineColor").toCssColorString(),outline:r("outline"),perPositionHeight:r("perPositionHeight"),height:r("height"),extrudedHeight:r("extrudedHeight"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"ellipse"===i?(e={id:r("id"),name:r("name"),position:r("position"),radius:r("radius"),semiMajorAxis:r("semiMajorAxis"),semiMinorAxis:r("semiMinorAxis"),color:r("material")&&r("material").color.toCssColorString(),image:r("material")&&r("material").image,repeat:r("material")&&r("material").repeat,outlineColor:r("outlineColor")&&r("outlineColor").toCssColorString(),outline:r("outline"),height:r("height"),heightReference:r("heightReference"),distanceDisplayCondition:o&&{near:o.near,far:o.far}},i="circle"):"rectangle"===i?e={id:r("id"),name:r("name"),coordinates:r("coordinates"),color:r("material")&&r("material").color.toCssColorString(),image:r("material")&&r("material").image,repeat:r("material")&&r("material").repeat,outlineColor:r("outlineColor")&&r("outlineColor").toCssColorString(),outline:r("outline"),height:r("height"),rotation:r("rotation"),heightReference:r("heightReference"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"box"===i?e={id:r("id"),name:r("name"),position:r("position"),dimensions:r("dimensions"),color:r("material")&&r("material").color.toCssColorString(),image:r("material")&&r("material").image,repeat:r("material")&&r("material").repeat,outlineColor:r("outlineColor")&&r("outlineColor").toCssColorString(),outline:r("outline"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"cylinder"===i?e={id:r("id"),name:r("name"),position:r("position"),radius:r("radius"),topRadius:r("topRadius"),bottomRadius:r("bottomRadius"),length:r("length"),color:r("material")&&r("material").color.toCssColorString(),image:r("material")&&r("material").image,repeat:r("material")&&r("material").repeat,outlineColor:r("outlineColor")&&r("outlineColor").toCssColorString(),outline:r("outline"),distanceDisplayCondition:o&&{near:o.near,far:o.far},changeTop:t.changeTop}:"ellipsoid"===i&&(e={id:r("id"),name:r("name"),position:r("position"),radius:r("radius"),radii:r("radii"),color:r("material")&&r("material").color.toCssColorString(),image:r("material")&&r("material").image,repeat:r("material")&&r("material").repeat,outlineColor:r("outlineColor")&&r("outlineColor").toCssColorString(),outline:r("outline"),distanceDisplayCondition:o&&{near:o.near,far:o.far},isSphere:t.isSphere})),e.type=i,e},Tt.prototype.addPlotting=function(e){var t;let i=new this._cesium.EntityCollection;("polygon"===e.type&&void 0!==e.style.extrudedHeight||"cylinder"===e.type&&!e.style.changeTop||"ellipsoid"===e.type&&e.style.isSphere)&&e.type,e.style&&e.style.id&&-1<this.SimpleGraphicObj.indexOf(e.style.id)||(t=this.addSimpleGraphic(e.type,e.style,e.treeobj),e.removeEdit||this.SimpleGraphicObj.push(t.id),i.add(t))},Tt.prototype.addFeatures=function(e){let t=new this._cesium.EntityCollection;return e.forEach(e=>{!e||(e=this.addFeature(e))&&t.add(e)}),t},Tt.prototype.addFeature=function(e){if(("polygon"===e.type&&void 0!==e.style.extrudedHeight||"cylinder"===e.type&&!e.style.changeTop||"ellipsoid"===e.type&&e.style.isSphere)&&e.type,!(e.style&&e.style.id&&-1<this.SimpleGraphicObj.indexOf(e.style.id)))return this.addSimpleGraphic(e.type,e.style)},Tt.prototype.open=function(e,t){let i=this,o=this._viewer,r=new FileReader;r.readAsText(e),r.onload=function(){var e=JSON.parse(this.result).features,e=i.addFeatures(e);o.flyTo(e),t&&"function"==typeof t&&t(e)}},Tt.prototype.ImportPlotting=function(e,t){let i=this,o=this._viewer,r=new FileReader;r.readAsText(e),r.onload=function(){var e=JSON.parse(this.result).features,e=i.addFeatures(e);o.flyTo(e),t&&"function"==typeof t&&t(e)}},Tt.prototype.analysisJson=function(t,e){this.featuresPlotting=[];for(let e=0;e<t.length;e++)t[e]instanceof Array?this.analysisJson(t[e]):this.ScreenPlotting(t[e]);var i=that.addFeatures(featuresPlotting);viewer.flyTo(i),e&&"function"==typeof e&&e(i)},Tt.prototype.ScreenPlotting=function(e){-1!=e.treeobj.type.indexOf("Plotting")&&this.featuresPlotting.push(e)};var St=[];function Pt(e){this._viewer=e,this._core=new V,this.points=[],this._SimpleGraphic=new Tt(this._viewer),this._SimpleGraphic.setEdit(!1)}function Et(e,t){this._viewer=e,this._cesium=t}function xt(e,t){this._viewer=e,this._cesium=t,this.leftIndex=void 0,this.rightIndex=void 0}Tt.prototype.createsj=function(t){let i=0,e="";if(0!=t.style.pId)for(let e=0;e<St.length;e++)St[e].id===t.style.pId&&(i=St[e].real);"group"===t.type?e=this._createGroup.createGroup(t.style.name,!1,i):t.treeData?(t.treeData.GroupID=i,this.CreateLayer(t)):this.addPlotting(t);var o={pid:i,real:e,id:t.style.id};St.push(o)},Tt.prototype.CreateLayer=function(e){let t=e.treeData.geoOptions.styletype,i=e.treeData.geoOptions.servertype;void 0===t&&(t="polygonbase"),void 0===i&&(i="geojson"),e.treeobj.pId&&(e.treeData.GroupID=e.treeobj.pId),"billboardlayer"==t?"vector"==i?this._billboardGeoJsonFeatureLayer.createBillboardGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createBillboardGeoJsonFeature(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"labellayer"==t?"vector"==i?"rich"==e.treeData.styleOption.textType||(1==e.treeData.styleOption.heightReference&&(e.treeData.styleOption.heightReference=void 0),this._LabelGeoJsonFeatureLayercopy.createPrimitiveLabelGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc)):e.treeData.styleOption.collect?this._LabelGeoJsonFeatureLayercopy.createLabelPolymerizationGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"rich"==e.treeData.styleOption.textType?this._LabelGeoJsonFeatureLayercopy.createLabelRichtextGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._LabelGeoJsonFeatureLayercopy.createLabelPointGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"SXTLabellayer"==t?"vector"==i&&("rich"==e.treeData.styleOption.textType||this._LabelGeoJsonFeatureLayercopy.createSXTLabelGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc)):"pointlayer"==t?"vector"==i?this._VectorGeoJsonFeatureLayer.createPointGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):e.treeData.styleOption.collect?this._LabelGeoJsonFeatureLayercopy.createPointPolymerizationGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createPointGeojsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"Streetscape"==t?"vector"==i?this._PolylineGeoJsonFeatureLayer.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):(e.treeData.styleOption.opacity&&e.treeData.styleOption.material&&-1<e.treeData.styleOption.material.indexOf("#")&&1==!e.treeData.styleOption.opacity&&(e.treeData.styleOption.material+=100*e.treeData.styleOption.opacity),this._GeoJsonFeatureLayer.createStreetscapeGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc)):"polylinelayer"==t?"vector"==i?this._PolylineGeoJsonFeatureLayer.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createStreetscapeGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"polylinemodellayer"==t?"vector"==i?this._PolylineGeoJsonFeatureLayer.createPolylineVectorGeoJsonFeatureLayerProviderModel(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._PointModel.exectPointModel(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"polygonmodellayer"==t?"vector"==i?this._PolygonGeoJsonFeatureLayer.createPolygonVectorGeoJsonFeatureLayerProviderModel(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._PointModel.createPolygonModel(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"polygonbase"==t?"vector"==i?"1"==e.treeData.styleOption.ground?(e.treeData.styleOption.extrudedHeightReference=1,this._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderOptimization(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc)):this._VectorGeoJsonFeatureLayer.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):e.treeData.styleOption.material&&-1!=e.treeData.styleOption.material.indexOf(".jpg")?this._GeoJsonFeatureLayer.createPolygonMapGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createPolygonGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"polygonlayer"==t?"vector"==i?(e.treeData.styleOption.classificationType=0)==e.treeData.styleOption.classificationType?this._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderOptimization(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):(e.treeData.styleOption.classificationType=2,e.treeData.styleOption.ground="1",this._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderClassOptimization(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc)):e.treeData.styleOption.material&&-1!=e.treeData.styleOption.material.indexOf(".jpg")?this._PolygonVectorTileLayerArcgis.createPolygonMapGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createPolygonGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"modellayer"==t?"vector"==i?this._VectorGeoJsonFeatureLayer.createModelGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createModelPointGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"polylinevolumelayer"==t?"vector"==i?this._VolumeGeoJsonFeatureLayer.createVolumeGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createpolylineVolumeGeojsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"polylineWallLayer"==t?"vector"==i?this._WallGeoFeatureLayer.createWallGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createWallGeoFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"primiviteModels"==t?this._PolygonVectorGeoJsonFeatureLayer.createPolygonVectorGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.styleOption.level_max,e.treeData.styleOption.level_min,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"primiviteWall"==t?"vector"==i||this._WallGeoFeatureLayer.createWallPrimitiveGeoFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"model"==t||"pointcloudmodel"==t||"rasterlayer"==t||this._GeoJsonFeatureLayer.createGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc)},Tt.prototype.remove=function(e){let t=this._viewer;var i=this.SimpleGraphicObj.indexOf(e);-1<i&&(t.entities.removeById(e),this.SimpleGraphicObj.splice(i,1),SmartEarthPopupData&&SmartEarthPopupData.editGraphic&&SmartEarthPopupData.editGraphic.getValue&&SmartEarthPopupData.editGraphic.getValue("id")===e&&(we.editPointID.edit.forEach(e=>{t.entities.removeById(e)}),we.editPointID.edit=[],we.editPointID.height.forEach(e=>{t.entities.removeById(e)}),we.editPointID.height=[],we.editPointID.add.forEach(e=>{t.entities.removeById(e)}),we.editPointID.add=[],we.editPointID.size.forEach(e=>{t.entities.removeById(e)}),we.editPointID.size=[],we.editPointID.move&&t.entities.remove(we.editPointID.move),we.editPointID.move=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={})),!this.SimpleGraphicObj.length&&this.editHandler&&this.edit(!1)},Tt.prototype.clear=function(){let t=this._viewer;this.SimpleGraphicObj.forEach(e=>{t.entities.removeById(e)}),this.SimpleGraphicObj=[],this.PrimitiveCollection.removeAll(),we.editPointID.edit.forEach(e=>{t.entities.removeById(e)}),we.editPointID.edit=[],we.editPointID.height.forEach(e=>{t.entities.removeById(e)}),we.editPointID.height=[],we.editPointID.add.forEach(e=>{t.entities.removeById(e)}),we.editPointID.add=[],we.editPointID.size.forEach(e=>{t.entities.removeById(e)}),we.editPointID.size=[],we.editPointID.move&&t.entities.remove(we.editPointID.move),we.editPointID.move=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={},!this.SimpleGraphicObj.length&&this.editHandler&&this.edit(!1)},Tt.prototype.save=function(e){let i=this._viewer,o={type:"FeatureCollection",features:[]},r,n=this;this.SimpleGraphicObj.forEach(e=>{var t=i.entities.getById(e);t&&(e=n.getStyle(t),r={id:t.id,name:t.name,type:e.type,style:e}),o.features.push(r)});var t=JSON.stringify(o),t=new Blob([t],{type:"text/plain;charset=utf-8"});this._core.saveAs(t,e?e+".json":"标绘.json")},Tt.prototype.setRichtext=function(e,t){var i=e.position.getValue();this._viewer.entities.removeById(e.id);let o="0";e.treeobj&&(we.delete(e.treeobj.id,this._viewer,this._cesium),o=e.treeobj.pId);let r=new Pe(this._viewer);return r.createDivPoint(e.name,i,{id:e.id,description:t,GroupID:o}),r},Tt.prototype.forceEndHanlder=function(){if(this.editHandler)try{this.editHandler.destroy(),this.editHandler=void 0}catch(e){}if(this.drawHandler)try{this.drawHandler.destroy(),this.drawHandler=void 0}catch(e){}},Pt.prototype.createSightLine=function(n={}){return"circle"===n.type?this._SimpleGraphic.createCircle({},(e,t)=>{let{distance:i,positions:o}=t;this._SimpleGraphic.remove(e.id);e=this._core.toDegrees(o[1]);o[1]=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height+(n.height||1.8)),this.createPoint(o[1],"观察点");e=[e.lon,e.lat];let r=Cesium_turf.circle(e,i,{steps:n.steps||64,units:"meters"});r.geometry.coordinates[0].forEach(e=>{var t=this._viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(e[0],e[1])),e=Cesium.Cartesian3.fromDegrees(e[0],e[1],t),t=this._viewer.scene.clampToHeight(e);this.createLine([o[1],t||e])})}):this._SimpleGraphic.createPolyline({toPoint:!0,clampToGround:!1},(e,t)=>{this._SimpleGraphic.remove(e.id);e=this._core.toDegrees(t[0]);t[0]=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height+(n.height||1.8)),this.createLine(t),this.createPoint(t[0],"观察点"),this.createPoint(t[1],"目标点")}),this},Pt.prototype.createLine=async function(e,t){t=this._core.pickFromRay(this._viewer,e[0],e[1],t);t&&t.position?(this._SimpleGraphic.addPolyline({positions:[e[0],t.position],color:"#00ff00",clampToGround:!1}),this._SimpleGraphic.addPolyline({positions:[t.position,e[1]],color:"#ff0000",depthFailColor:"#ff00c6",clampToGround:!1})):this._SimpleGraphic.addPolyline({positions:e,color:"#00ff00",clampToGround:!1})},Pt.prototype.createPoint=function(e,t){this._SimpleGraphic.addPoint({position:e,pixelSize:8,heightReference:0}),t&&this._SimpleGraphic.addLabel({text:t,position:e,font:"bold 18px 宋体",outlineWidth:2,verticalOrigin:1,pixelOffset:new Cesium.Cartesian2(0,-18),heightReference:0})},Pt.prototype.setVisibility=function(e){},Pt.prototype.deleteObject=function(){this._SimpleGraphic.clear()},Et.prototype.createterrainExaggeration=function(e){this._viewer.scene.globe.terrainExaggeration=e},xt.prototype.curtainContrast=function(e,t){document.getElementById("slider")&&this.clear();var i=this._viewer.imageryLayers,o=this._viewer.scene;It._scene=o;var r=this._viewer.container,n=document.createElement("div");n.id="slider",n.style.position="absolute",n.style.cursor="e-resize",n.style.top=0,n.style.backgroundColor="#D3D3D3",n.style.width="8px",n.style.height="100%",n.style.zIndex="1000",r.appendChild(n);n=i.get(e),i=i.get(t);this.leftIndex=e,this.rightIndex=t,n.splitDirection=this._cesium.ImagerySplitDirection.LEFT,i.splitDirection=this._cesium.ImagerySplitDirection.RIGHT;i=document.getElementById("slider");o.imagerySplitPosition=i.offsetLeft/i.parentElement.offsetWidth,i.addEventListener("mousedown",Lt,!1),window.addEventListener("mouseup",Dt,!1),i.style.left="50%",It._scene.imagerySplitPosition=.5};var It={dragStartX:0,_scene:void 0};function Dt(){window.removeEventListener("mousemove",Mt,!1)}function Lt(e){var t=document.getElementById("slider");It.dragStartX=e.clientX-t.offsetLeft,window.addEventListener("mousemove",Mt,!1)}function Mt(e){var t=document.getElementById("slider"),e=(e.clientX-It.dragStartX)/t.parentElement.offsetWidth;t.style.left=100*e+"%",It._scene.imagerySplitPosition=e}function At(e,t){this._viewer=e,this._cesium=t,this._handler=null,this.setPointerLocker=!1}xt.prototype.close=function(){var e,t=document.getElementById("slider");t&&(It._scene.imagerySplitPosition="0%",t.removeEventListener("mousedown",Lt,!1),window.removeEventListener("mouseup",Dt,!1),window.removeEventListener("mousemove",Mt,!1),t.remove(),t=(e=this._viewer.imageryLayers).get(this.leftIndex),e=e.get(this.rightIndex),t.splitDirection=this._cesium.ImagerySplitDirection.NONE,e.splitDirection=this._cesium.ImagerySplitDirection.NONE,It._scene=void 0)};var Rt,Ot,Ht,Vt={_this:null,X_speedScale:1,Y_speedScale:.8,moveRate:.1,moveRates:[.1,.5,1],clickNum:1,movementX:0,movementY:0,moveFactor:0,enable_looking:!(At.prototype.createIndoormode=function(e){var t=this;if(null==t._handler){e&&e.undergroundMode&&(this.undergroundMode=e.undergroundMode);var e=t._viewer.scene,i=t._viewer.canvas;return i.setAttribute("tabindex","0"),i.focus(),i.onclick=function(){i.focus()},this.ellipsoid=e.globe.ellipsoid,e.screenSpaceCameraController.enableRotate=!1,e.screenSpaceCameraController.enableTranslate=!1,e.screenSpaceCameraController.enableZoom=!1,e.screenSpaceCameraController.enableTilt=!1,e.screenSpaceCameraController.enableLook=!1,t._handler=new t._cesium.ScreenSpaceEventHandler(i),Vt._this=this,Vt.Viewer=t._viewer,Vt.camera=t._viewer.camera,document.addEventListener("pointerlockchange",Bt,!1),document.addEventListener("mousemove",Gt,!1),document.addEventListener("keydown",jt,!1),document.addEventListener("keyup",zt,!1),document.addEventListener("click",Ft,!1),t._viewer.clock.onTick.addEventListener(Nt,t),t._viewer.container.requestPointerLock(),this}}),Viewer:null,camera:null},kt={looking:!1,moveForward:!1,moveBackward:!1,moveUp:!1,moveDown:!1,moveLeft:!1,moveRight:!1};function Ft(e){1===e.button&&Vt.moveFactor<100&&(Vt.moveRate=Vt.moveRates[Vt.clickNum++],2<Vt.clickNum&&(Vt.clickNum=0))}function Gt(e){var t;Vt.enable_looking&&(Vt.movementX=e.movementX,Vt.movementY=e.movementY,t=Vt.Viewer.canvas.clientWidth,e=Vt.Viewer.canvas.clientHeight,t=Vt.movementX/t,e=-Vt.movementY/e,(!Vt.camera.roll&&Vt.camera.pitch<0&&e<0||!Vt.camera.roll&&0<Vt.camera.pitch&&0<e)&&(e=0),Vt.camera.rotate(Vt.camera.position,t*Vt.X_speedScale),Vt.camera.lookUp(e*Vt.Y_speedScale))}function Nt(e){var t=this._viewer.camera,i=this._viewer.scene.globe.getHeight(t.positionCartographic),o=this.ellipsoid.cartesianToCartographic(t.position).height;Vt.moveFactor=o-i;i=100<Vt.moveFactor?Vt.moveFactor/100:Vt.moveRate;kt.moveForward&&t.moveForward(i),kt.moveBackward&&t.moveBackward(i),kt.moveUp&&t.moveUp(i),kt.moveDown&&t.moveDown(i),kt.moveLeft&&t.moveLeft(i),kt.moveRight&&t.moveRight(i)}function Bt(){document.pointerLockElement?Vt.enable_looking=!0:Vt.enable_looking&&Vt._this.Indoormodeclose()}function jt(e){e=Ut(e.keyCode);void 0!==e&&(kt[e]=!0)}function zt(e){e=Ut(e.keyCode);void 0!==e&&(kt[e]=!1)}function Ut(e){switch(e){case"W".charCodeAt(0):return"moveForward";case"S".charCodeAt(0):return"moveBackward";case"Q".charCodeAt(0):return"moveUp";case"E".charCodeAt(0):return"moveDown";case"D".charCodeAt(0):return"moveRight";case"A".charCodeAt(0):return"moveLeft";default:return}}function Wt(e,t){this._viewer=e,this._cesium=t}function Yt(e,t){this._viewer=e,this._cesium=t,this._core=new V,this.Fireworks=[],this.Smog=[],this.Fountain=[],this.Flame=[],this.Blast=[]}function qt(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we,this._indoormode=new At(e,t),this._model=null,this._relativeHeight=-100,this._groundHeightAtCameraPosition=0,this._startMousePosition,this._mousePosition,this._cameraHeight,this._originalOption,this._alpha=.5,this._brightness=.3,this._depth=300,this._canvas=null,this.isIndoor=!1,this.isUndergroundMode=!1,this._flags={move:!1,vertical:!1,horizontally:!1,rotate:!1},this.moveSpeed=1}function Qt(e){var t=e._viewer.scene;e._viewer.canvas,e._tree&&e._tree.handler&&(e._tree.handler.destroy(),e._tree.handler=null),t.screenSpaceCameraController.enableRotate=!0,t.screenSpaceCameraController.enableTranslate=!0,t.screenSpaceCameraController.enableZoom=!0,t.screenSpaceCameraController.enableTilt=!0,t.screenSpaceCameraController.enableLook=!0}function Jt(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we,this.isStreetView=!1,this.StreetViewType=void 0,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!1),this.defaultSkyAtmosphere=!0,this.StreetViewSphere=[null,null],this.StreetViewSphere_Canvas=[null,null],this.StreetViewNavigation=[],this.StreetViewSphereIndex=0,this.URL={getInitImageByPosition:"",getInitImageInfoById:"",getInitImageById:"",getSecondImageById:"",getThirdImageById:"",getImageInfo:""},this.CallBack={getInitImageByPositionCallBack:void 0,getImageInfoByIdCallBack:void 0,getInitImageByIdCallBack:void 0,getSecondImageByIdCallBack:void 0,getThirdImageByIdCallBack:void 0,selectJoinsCallBack:void 0,setImageDataCallback:void 0},this.StreetViewData={name:"",radius:5,defaultFov:60,fov:110,alpha:1,speedScale:1.5,lon:void 0,lat:void 0,height:0,HeadingPitchRoll:null,getImageTileID:"",linkImagesData:[],isTwoTextures:!1,isThreeTextures:!1,_handler:null,navigation_handler:null},this.FirstImage=void 0}At.prototype.Indoormodeclose=function(){var e;this._handler.destroy(),this._handler=null,document.removeEventListener("keydown",jt,!1),document.removeEventListener("keyup",zt,!1),document.removeEventListener("pointerlockchange",Bt,!1),document.removeEventListener("mousemove",Gt,!1),document.removeEventListener("click",Ft,!1),this._viewer.clock.onTick.removeEventListener(Nt,this),document.exitPointerLock(),Vt.enable_looking=!1,document.body.style.cursor="default",this.undergroundMode?(this.undergroundMode.isIndoor=!1,this.undergroundMode.attachMouseEvent(),this.undergroundMode=void 0):((e=this._viewer.scene).screenSpaceCameraController.enableRotate=!0,e.screenSpaceCameraController.enableTranslate=!0,e.screenSpaceCameraController.enableZoom=!0,e.screenSpaceCameraController.enableTilt=!0,e.screenSpaceCameraController.enableLook=!0)},Wt.prototype.createWeather=function(e,t,i){var o=this._viewer.scene.postProcessStages,r=null,n=null,a=null,s=null,l={min:10,max:160},u={min:.5,max:3},c={min:-1,max:1},h={min:0,max:1},m={min:10,max:160},d={min:0,max:1},p={min:0,max:.7},g={min:.1,max:.9};switch(e){case"rain":if(r=i,this._viewer.scene.postProcessStages._stages.length&&this._viewer.scene.postProcessStages._stages.forEach(function(e){e&&"rain"===e.name&&o.remove(e)}),t){if(r?n={test1:i.test1,test2:i.test2,test3:i.test3,test4:i.test4}:(n={test1:7,test2:.3,test3:-.4,test4:1},r={test1:7,test2:.3,test3:-.4,test4:1}),n.test1=15*(10-parseFloat(n.test1))+10,n.test2=2.5*parseFloat(n.test2)+.5,n.test1>l.max||n.test1<l.min)return;if(n.test2>u.max||n.test2<u.min)return;if(n.test3>c.max||n.test3<c.min)return;if(n.test4>h.max||n.test4<h.min)return;n.test1=this.getValue(n.test1+""),n.test2=this.getValue(n.test2+""),n.test3=this.getValue(n.test3+""),n.test4=this.getValue(n.test4+"");var _=new this._cesium.PostProcessStage({name:"rain",fragmentShader:"uniform sampler2D colorTexture; \nvarying vec2 v_textureCoordinates;\n\nfloat hash(float x){\nreturn fract(sin(x*133.3)*13.13);\n}\n\nvoid main(void){\nfloat time = czm_frameNumber / "+n.test1+";\nvec2 resolution = czm_viewport.zw; \nvec2 uv=(gl_FragCoord.xy*"+n.test2+"-resolution.xy)/min(resolution.x,resolution.y); \nvec3 c=vec3(.6,.7,.8);\nfloat a="+n.test3+";\nfloat si=sin(a),co=cos(a);\nuv*=mat2(co,-si,si,co);\nuv*=length(uv+vec2(0,4.9))*.3+"+n.test4+";\nfloat v=1.-sin(hash(floor(uv.x*100.))*2.);\nfloat b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\nc*=v*b; //屏幕上雨的颜色\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c,1), 0.5); \n }"});o.add(_)}break;case"snow":if(a=i,this._viewer.scene.postProcessStages._stages.length&&this._viewer.scene.postProcessStages._stages.forEach(function(e){e&&"snow"===e.name&&o.remove(e)}),t){if(a?n={test1:i.test1,test2:i.test2,test3:i.test3,test4:i.test4}:(n={test1:7,test2:.1,test3:.5,test4:.5},a={test1:7,test2:.1,test3:.5,test4:.5}),n.test1=15*(10-parseFloat(n.test1))+10,n.test2=parseFloat(n.test2)/10,n.test3=.7*parseFloat(n.test3),n.test4=.8*(1-parseFloat(n.test4))+.1,parseFloat(n.test1)>m.max||parseFloat(n.test1)<m.min)return;if(parseFloat(n.test2)>d.max||parseFloat(n.test2)<d.min)return;if(parseFloat(n.test3)>p.max||parseFloat(n.test3)<p.min)return;if(parseFloat(n.test4)>g.max||parseFloat(n.test4)<g.min)return;n.test1=this.getValue(n.test1+""),n.test2=this.getValue(n.test2+""),n.test3=this.getValue(n.test3+""),n.test4=this.getValue(n.test4+"");var f=new this._cesium.PostProcessStage({name:"snow",fragmentShader:"uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nfloat snow(vec2 uv,float scale){\nfloat time = czm_frameNumber / "+n.test1+";\nfloat w=smoothstep(1.0,0.,-uv.y*(scale/10.0));if(w<"+n.test2+")return 0.;\nuv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\nuv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\np="+n.test3+"+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\nk=smoothstep(0.,k,sin(f.x+f.y)*0.01);\nreturn k*w;\n}\nvoid main(void){\nvec2 resolution = czm_viewport.zw;\nvec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\nvec3 finalColor=vec3(0);\nfloat c = 0.0;\nc+=snow(uv,30.)*.0;\nc+=snow(uv,20.)*.0;\nc+=snow(uv,15.)*.0;\nc+=snow(uv,10.);\nc+=snow(uv,8.);\nc+=snow(uv,6.);\nc+=snow(uv,5.);\nfinalColor=(vec3(c)); //屏幕上雪的颜色\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(finalColor,1), "+n.test4+");  //将雪和三维场景融合\n}"});o.add(f)}break;case"fog":if(s=i,this._viewer.scene.postProcessStages._stages.length&&this._viewer.scene.postProcessStages._stages.forEach(function(e){e&&"fog"===e.name&&o.remove(e)}),t){if(s?n={distance:i.distance,color:i.color&&Cesium.Color.fromCssColorString(i.color)}:(n={distance:200,color:"#ffffff"},s={distance:200,color:"#ffffff"}),n.distance<10)return;f=new Cesium.PostProcessStage({name:"fog",fragmentShader:"float getDistance(sampler2D depthTexture, vec2 texCoords) \n{ \n    float depth = czm_unpackDepth(texture2D(depthTexture, texCoords)); \n    if (depth == 0.0) { \n        return czm_infinity; \n    } \n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); \n    return -eyeCoordinate.z / eyeCoordinate.w; \n} \nfloat interpolateByDistance(vec4 nearFarScalar, float distance) \n{ \n    float startDistance = nearFarScalar.x; \n    float startValue = nearFarScalar.y; \n    float endDistance = nearFarScalar.z; \n    float endValue = nearFarScalar.w; \n    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); \n    return mix(startValue, endValue, t); \n} \nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) \n{ \n    return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); \n} \nuniform sampler2D colorTexture; \nuniform sampler2D depthTexture; \nuniform vec4 fogByDistance; \nuniform vec4 fogColor; \nvarying vec2 v_textureCoordinates; \nvoid main(void) \n{ \n    float distance = getDistance(depthTexture, v_textureCoordinates); \n    vec4 sceneColor = texture2D(colorTexture, v_textureCoordinates); \n    float blendAmount = interpolateByDistance(fogByDistance, distance); \n    vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n    gl_FragColor = alphaBlend(finalFogColor, sceneColor); \n} \n",uniforms:{fogByDistance:new Cesium.Cartesian4(10,0,n.distance||200,1),fogColor:n.color||Cesium.Color.WHITE}});o.add(f)}}},Wt.prototype.getValue=function(e){return""===e||"-"===e||"."===e||void 0===e||2<(e="-"===e[e.length-1]?e.substr(0,e.length-1):e).split(".").length?"0.0":e.split(".")[1]&&e.split(".")[1].length?e:parseFloat(e).toFixed(1)},Yt.prototype.createParticleEffect=function(e,t,i,o){switch(this._viewer.clockViewModel.shouldAnimate||(this._viewer.clockViewModel.shouldAnimate=!0),e){case"fireworks":this.createFireworks(t,i,o);break;case"smog":this.createSmog(t,i,o);break;case"fountain":this.createFountain(t,i,o);break;case"flame":this.createFlame(t,i,o);break;case"blast":this.createBlast(t,i,o)}return this},Yt.prototype.deleteObject=function(){var t=this._viewer.scene;0<this.Fireworks.length&&(this.Fireworks.forEach(function(e){t.primitives.remove(e)}),this.Fireworks=[]),0<this.Smog.length&&(this.Smog.forEach(function(e){t.primitives.remove(e)}),this.Smog=[]),0<this.Fountain.length&&(this.Fountain.forEach(function(e){t.primitives.remove(e)}),this.Fountain=[]),0<this.Flame.length&&(this.Flame.forEach(function(e){t.primitives.remove(e)}),this.Flame=[]),0<this.Blast.length&&(this.Blast.forEach(function(e){t.primitives.remove(e)}),this.Blast=[])},Yt.prototype.removeParticleEffect=function(e){var t=this._viewer.scene;switch(e){case"fireworks":0<this.Fireworks.length&&(this.Fireworks.forEach(function(e){t.primitives.remove(e)}),this.Fireworks=[]);break;case"smog":0<this.Smog.length&&(this.Smog.forEach(function(e){t.primitives.remove(e)}),this.Smog=[]);break;case"fountain":0<this.Fountain.length&&(this.Fountain.forEach(function(e){t.primitives.remove(e)}),this.Fountain=[]);break;case"flame":0<this.Flame.length&&(this.Flame.forEach(function(e){t.primitives.remove(e)}),this.Flame=[]);break;case"blast":0<this.Blast.length&&(this.Blast.forEach(function(e){t.primitives.remove(e)}),this.Blast=[])}},Yt.prototype.createFireworks=function(e,t,i){var l=this._viewer.scene,o=this._viewer,u=this._cesium;t=t||{},u.Math.setRandomNumberSeed(315);var c,h=this.computeModelMatrix(e),m=new u.Cartesian3(0,0,100);var d=u.defaultValue(t.minSize,30),p=u.defaultValue(t.maxSize,100),e=u.defaultValue(t.size,7),g=new u.Cartesian2(e,e),_=10,r=u.defaultValue(t.num,20),f=new u.Matrix4;function n(e,t,i){var o=u.Cartesian3.add(m,e,new u.Cartesian3),r=u.Matrix4.fromTranslation(o,f),e=u.Matrix4.multiply(h,r,new u.Matrix4),n=u.Matrix4.inverseTransformation(e,e),a=u.Math.randomBetween(d,p),s=new u.Cartesian3,o=.7*((a-d)/(p-d))+.3;return l.primitives.add(new u.ParticleSystem({image:(u.defined(c)||((c=document.createElement("canvas")).width=20,c.height=20,(e=c.getContext("2d")).beginPath(),e.arc(8,8,8,0,u.Math.TWO_PI,!0),e.closePath(),e.fillStyle="rgb(255, 255, 255)",e.fill()),c),startColor:t,endColor:t.withAlpha(0),particleLife:o,speed:100,imageSize:g,emissionRate:0,emitter:new u.SphereEmitter(.1),bursts:i,lifetime:_,updateCallback:function(e){var t=u.Matrix4.multiplyByPoint(n,e.position,s);u.Cartesian3.magnitudeSquared(t)>=a*a&&u.Cartesian3.clone(u.Cartesian3.ZERO,e.velocity)},modelMatrix:h,emitterModelMatrix:r}))}for(var a=[{minimumRed:.75,green:0,minimumBlue:.8,alpha:1},{red:0,minimumGreen:.75,minimumBlue:.8,alpha:1},{red:0,green:0,minimumBlue:.8,alpha:1},{minimumRed:.75,minimumGreen:.75,blue:0,alpha:1}],s=0;s<r;++s){for(var y=u.Math.randomBetween(-100,100),v=u.Math.randomBetween(-80,100),C=u.Math.randomBetween(-50,50),v=new u.Cartesian3(y,v,C),C=u.Color.fromRandom(a[s%a.length]),w=[],b=0;b<3;++b)w.push(new u.ParticleBurst({time:u.Math.nextRandomNumber()*_,minimum:400,maximum:400}));this.Fireworks.push(n(v,C,w))}i&&"function"==typeof i?i(this.Fireworks):(i=o.scene.camera,o=new u.Cartesian3(-300,0,0),i.lookAtTransform(h,o),i.lookAtTransform(u.Matrix4.IDENTITY),o=u.Cartesian3.subtract(m,o,new u.Cartesian3),u.Cartesian3.normalize(o,o),o=u.Math.PI_OVER_TWO-Math.acos(u.Cartesian3.dot(o,u.Cartesian3.UNIT_Z)),i.lookUp(o))},Yt.prototype.createSmog=function(e,o,t){this._viewer.scene;var r=this._viewer,n=this._cesium,a=this;o&&""!==o||(o={}),n.Math.setRandomNumberSeed(3);var s,l={image:window.SmartEarthRootUrl+D.smog,emissionRate:50,gravity:0,minimumParticleLife:1,maximumParticleLife:1.2,minimumSpeed:1,maximumSpeed:4,startScale:1,endScale:5,particleSize:1,lifetime:6};this._core.extend(l,o,!0);var u=new n.Cartesian3,e=function(i){var e=r.scene;s=e.primitives.add(new n.ParticleSystem({image:l.image,startColor:n.Color.LIGHTSEAGREEN.withAlpha(.7),endColor:n.Color.WHITE.withAlpha(0),startScale:l.startScale,endScale:l.endScale,sizeInMeters:!0,minimumParticleLife:l.minimumParticleLife,maximumParticleLife:l.maximumParticleLife,minimumSpeed:l.minimumSpeed,maximumSpeed:l.maximumSpeed,imageSize:new n.Cartesian2(l.particleSize,l.particleSize),emissionRate:l.emissionRate,lifetime:l.lifetime,emitter:new n.CircleEmitter(2),emitterModelMatrix:a.computeEmitterModelMatrix(o.translation,o.rotation),updateCallback:c})),l.type&&function(e){"圆形放射"===e?s.emitter=new n.CircleEmitter(2):"球体放射"===e?s.emitter=new n.SphereEmitter(2.5):"圆锥体放射"===e?s.emitter=new n.ConeEmitter(n.Math.toRadians(45)):"盒状放射"===e&&(s.emitter=new n.BoxEmitter(new n.Cartesian3(10,10,10)))}(l.type);return r.scene.preUpdate.addEventListener(function(e,t){s&&(s.modelMatrix=a.computeModelMatrix(i,t),s.emitterModelMatrix=a.computeEmitterModelMatrix(o.translation,o.rotation))}),s}(e);function c(e,t){var i=e.position;n.Cartesian3.normalize(i,u),n.Cartesian3.multiplyByScalar(u,l.gravity*t,u),e.velocity=n.Cartesian3.add(e.velocity,u,e.velocity)}this.Smog.push(e),t&&"function"==typeof t&&t(this.Smog)},Yt.prototype.createFountain=function(i,o,e){this._viewer.scene;var t=this._viewer,r=this._cesium,n=this;o&&""!==o||(o={});var a={image:window.SmartEarthRootUrl+D.penquan,emissionRate:50,minimumParticleLife:3,maximumParticleLife:4,minimumSpeed:9,maximumSpeed:9.5,startScale:1,endScale:15,particleSize:1,lifetime:6,gravity:-3.5};this._core.extend(a,o,!0);var s,l=new r.Cartesian3,u=(s=t.scene.primitives.add(new r.ParticleSystem({image:a.image,startColor:new r.Color(1,1,1,.3),endColor:new r.Color(.8,.86,1,.4),startScale:a.startScale,endScale:a.endScale,minimumParticleLife:a.minimumParticleLife,maximumParticleLife:a.maximumParticleLife,minimumSpeed:a.minimumSpeed,maximumSpeed:a.maximumSpeed,imageSize:new r.Cartesian2(a.particleSize,2*a.particleSize),emissionRate:a.emissionRate,lifetime:a.lifetime,loop:!0,emitter:new r.ConeEmitter(r.Math.toRadians(r.defaultValue(a.angle,7))),updateCallback:c,sizeInMeters:!0})),t.scene.preUpdate.addEventListener(function(e,t){s&&(s.modelMatrix=n.computeModelMatrix(i,t),s.emitterModelMatrix=n.computeEmitterModelMatrix(o.translation,o.rotation))}),s);function c(e,t){var i=e.position;r.Cartesian3.normalize(i,l),r.Cartesian3.multiplyByScalar(l,a.gravity*t,l),e.velocity=r.Cartesian3.add(e.velocity,l,e.velocity)}this.Fountain.push(u),e&&"function"==typeof e&&e(this.Fountain)},Yt.prototype.createFlame=function(e,t,i){this._viewer.scene;var o=this._viewer,r=this._cesium,n=this;t&&""!==t||(t={});var a={image:window.SmartEarthRootUrl+D.fire,emissionRate:50,gravity:0,minimumParticleLife:1,maximumParticleLife:3,minimumSpeed:1,maximumSpeed:4,startScale:1,endScale:6,particleSize:1,lifetime:16};this._core.extend(a,t,!0);var s,e=(s=e,o.scene.primitives.add(new r.ParticleSystem({image:a.image,startColor:r.Color.RED.withAlpha(.7),endColor:r.Color.YELLOW.withAlpha(.3),startScale:a.startScale,endScale:a.endScale,minimumParticleLife:a.minimumParticleLife,maximumParticleLife:a.maximumParticleLife,minimumSpeed:a.minimumSpeed,maximumSpeed:a.maximumSpeed,imageSize:new r.Cartesian2(a.particleSize,a.particleSize),emissionRate:a.emissionRate,sizeInMeters:!0,lifetime:a.lifetime,emitter:new r.ConeEmitter(r.Math.toRadians(30)),modelMatrix:n.computeModelMatrix(s),emitterModelMatrix:n.computeEmitterModelMatrix(a.translation,a.rotation)})));this.Flame.push(e),i&&"function"==typeof i&&i(this.Flame)},Yt.prototype.createBlast=function(e,t,i){this._viewer.scene;var o=this._viewer,r=this._cesium,n=this;t&&""!==t||(t={});var a={image:window.SmartEarthRootUrl+D.fire2,emissionRate:10,gravity:0,minimumParticleLife:1,maximumParticleLife:3,minimumSpeed:5,maximumSpeed:20,startScale:1,endScale:10,particleSize:5,lifetime:3};this._core.extend(a,t,!0);e=function(e){let t=new r.ParticleSystem({image:a.image,startColor:a.startColor,endColor:a.endColor,startScale:a.startScale,endScale:a.endScale,minimumParticleLife:a.minimumParticleLife,maximumParticleLife:a.maximumParticleLife,minimumSpeed:a.minimumSpeed,maximumSpeed:a.maximumSpeed,imageSize:new r.Cartesian2(a.particleSize,a.particleSize),emissionRate:a.emissionRate,sizeInMeters:!0,lifetime:a.lifetime,emitter:new r.ConeEmitter(r.Math.toRadians(30)),emitterModelMatrix:n.computeEmitterModelMatrix(a.translation,a.rotation),bursts:a.bursts,updateCallback:()=>{t.modelMatrix=n.computeModelMatrix(e,n._viewer.clock.currentTime)}});return o.scene.primitives.add(t)}(e);this.Blast.push(e),i&&"function"==typeof i&&i(this.Blast)},Yt.prototype.computeModelMatrix=function(e,t){var i=this._cesium;if(e instanceof i.Entity)return e.computeModelMatrix(t,new i.Matrix4);if(e.x&&e.y){e=e.x<=180&&-180<=e.x&&e.y<=90&&-90<=e.y?i.Cartesian3.fromDegrees(e.x,e.y,e.z||0):e;return i.Transforms.eastNorthUpToFixedFrame(e)}},Yt.prototype.computeEmitterModelMatrix=function(e,t){var i=this._cesium,o=new i.TranslationRotationScale,r=i.HeadingPitchRoll.fromDegrees(0,0,0);return o.translation=i.defaultValue(e,i.Cartesian3.fromElements(0,0,0)),o.rotation=i.Quaternion.fromHeadingPitchRoll(i.defaultValue(t,r)),i.Matrix4.fromTranslationRotationScale(o)},qt.prototype.refreshGridLines=function(){var e=this._relativeHeight<0,t=this._viewer.camera,i=new this._cesium.Cartographic(t.positionCartographic.longitude,t.positionCartographic.latitude,-this._depth);this._model?(t=this.UndergroundGridLines(i,e),this._viewer.scene.primitives.remove(this._model),this._model=t):this._model=this.UndergroundGridLines(i,e)},qt.prototype.UndergroundModelOpen=function(e,t){if(!this._model){this._getOriginalOption();var i=this._viewer.camera,o=(new this._cesium.Cartographic(i.positionCartographic.longitude,i.positionCartographic.latitude,-this._depth),new this._cesium.Cartographic(i.positionCartographic.longitude,i.positionCartographic.latitude,i.positionCartographic.height));this.destination=o,this.orientation={heading:i.heading,pitch:i.pitch,roll:0},this._cesium.ExpandBySmartEarth&&(this._cesium.ExpandBySmartEarth.underEarth.cullFace=!1,this._cesium.ExpandBySmartEarth.underEarth.enable=!0,this._cesium.ExpandBySmartEarth.underEarth.enableDepth=this._depth,this._cesium.ExpandBySmartEarth.underEarth.enableSkirt=!0),this._viewer.scene.globe.baseColor=this._cesium.Color.WHITE.withAlpha(0),e=e?(this._depth=this._cesium.defaultValue(e.depth,300),this._alpha=this._cesium.defaultValue(e.alpha,.5),this._brightness=this._cesium.defaultValue(e.brightness,.3),this.isEnterUnderground=this._cesium.defaultValue(e.isEnterUnderground,!0),this.isFlyToSky=this._cesium.defaultValue(e.isFlyToSky,!0),this._cesium.defaultValue(e.height,-100)):(this._depth=300,this._alpha=.5,this._brightness=.3,this.isEnterUnderground=!0,this.isFlyToSky=!0,-100),this.setLayerAlpha(this._alpha,this._brightness),this._viewer.scene.globe.depthTestAgainstTerrain=!0,this._viewer.scene.highDynamicRange=!1,this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.skyBox.show=!1,this._viewer.scene.fog.enabled=!1,this._viewer.scene.backgroundColor=new this._cesium.Color(0,0,0,1),this._viewer.container.style.backgroundImage="unset",this.isUndergroundMode=!0,t?(this.isIndoor=!0,this._indoormode.createIndoormode({undergroundMode:this})):this.isIndoor=!1;var t=this._viewer.camera,r=new this._cesium.Cartographic(t.positionCartographic.longitude,t.positionCartographic.latitude,-this._depth);return this._model=this.UndergroundGridLines(r,!0),this._viewer.scene.preRender.addEventListener(this.getRelativeHeight,this),this.getRelativeHeight(),0<this._relativeHeight&&this.isEnterUnderground&&this.enterUnderground(e),this}},qt.prototype.close=function(){this._model&&(this._viewer.scene.preRender.removeEventListener(this.getRelativeHeight,this),this.setLayerAlpha(this._originalOption.alpha,this._originalOption.brightness),this._viewer.scene.primitives.remove(this._model),this._cesium.ExpandBySmartEarth&&(this._cesium.ExpandBySmartEarth.underEarth.cullFace=void 0,this._cesium.ExpandBySmartEarth.underEarth.enable=!1,this._cesium.ExpandBySmartEarth.underEarth.enableDepth=0,this._cesium.ExpandBySmartEarth.underEarth.enableSkirt=!1),this._viewer.scene.globe.baseColor=this._cesium.Color.WHITE.withAlpha(1),this._viewer.scene.globe.depthTestAgainstTerrain=this._originalOption.depthTest,this._viewer.scene.skyBox&&(this._viewer.scene.skyBox.show=this._originalOption.skyBoxShow),this._viewer.scene.highDynamicRange=this._originalOption.highDynamicRange,this._viewer.scene.skyAtmosphere.show=this._originalOption.skyShow,this._viewer.scene.backgroundColor=this._originalOption.backgroundColor,this._viewer.container.style.backgroundImage=this._originalOption.backgroundImage,this._viewer.scene.fog.enabled=this._originalOption.fog,this.isUndergroundMode=!1,this._model=null,Rt=void 0,this._viewer.camera.positionCartographic,Qt(this),this.isFlyToSky&&(500<this._relativeHeight||this.flyToSky()))},qt.prototype._getOriginalOption=function(){var e={alpha:this._cesium.clone(this._viewer.imageryLayers._layers[0]&&this._viewer.imageryLayers._layers[0].alpha),brightness:this._cesium.clone(this._viewer.imageryLayers._layers[0]&&this._viewer.imageryLayers._layers[0].brightness),highDynamicRange:this._cesium.clone(this._viewer.scene.highDynamicRange),skyShow:this._cesium.clone(this._viewer.scene.skyAtmosphere.show),skyBoxShow:this._cesium.clone(this._viewer.scene.skyBox&&this._viewer.scene.skyBox.show),depthTest:this._cesium.clone(this._viewer.scene.globe.depthTestAgainstTerrain),backgroundColor:this._viewer.scene.backgroundColor.clone(),backgroundImage:this._viewer.container.style.backgroundImage,fog:this._viewer.scene.fog.enabled};this._viewer.scene.globe._surface&&this._viewer.scene.globe._surface._tileProvider&&this._viewer.scene.globe._surface._tileProvider._renderState&&(e.blending=this._cesium.clone(this._viewer.scene.globe._surface._tileProvider._renderState.blending)),this._originalOption=e},qt.prototype.enterUnderground=function(e){var t=this._viewer.camera,i=new this._cesium.Cartographic(t.positionCartographic.longitude,t.positionCartographic.latitude,-this._depth);t.positionCartographic.height<=10||t.flyTo({destination:new this._cesium.Cartesian3.fromRadians(i.longitude,i.latitude,e||-this._depth/3),orientation:{heading:this._cesium.Math.toRadians(0),pitch:this._cesium.Math.toRadians(0),roll:0},complete:function(){}})},qt.prototype.flyToSky=function(){var e=this._viewer.camera;this._viewer.camera.positionCartographic,10<=e.positionCartographic.height||this._viewer.camera.flyTo({destination:new this._cesium.Cartesian3.fromRadians(this.destination.longitude,this.destination.latitude,this.destination.height),orientation:{heading:this.orientation.heading,pitch:this.orientation.pitch,roll:0}})},qt.prototype.setLayerAlpha=function(e,t){for(var i=this._viewer.imageryLayers.length,o=0;o<i;o++)this._viewer.imageryLayers.get(o).alpha=e,void 0!==t&&(this._viewer.imageryLayers.get(o).brightness=t);this._alpha=e,void 0!==t&&(this._brightness=t)},qt.prototype.UndergroundGridLines=function(e,t){var i=e;e instanceof this._cesium.Cartesian3&&(i=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e));e=new this._cesium.GeometryInstance({geometry:new this._cesium.EllipseGeometry({center:this._cesium.Cartesian3.fromRadians(i.longitude,i.latitude),height:i.height,semiMinorAxis:2e4,semiMajorAxis:2e4,vertexFormat:this._cesium.VertexFormat.POSITION_AND_ST}),id:"undergroundSurface"}),i=this._cesium.Material.fromType("Grid");i.uniforms.color=this._cesium.Color.WHITE.withAlpha(.3),i.uniforms.cellAlpha=.01,i.uniforms.lineCount=new this._cesium.Cartesian2(200,200),i.uniforms.lineThickness=new this._cesium.Cartesian2(1,1);i=this._viewer.scene.primitives.add(new this._cesium.Primitive({geometryInstances:e,appearance:new this._cesium.EllipsoidSurfaceAppearance({material:i})}));return i.appearance.renderState.depthTest.enabled=!0,i.show=t,i},qt.prototype.attachMouseEvent=function(){var o=this,e=this._viewer.scene;this._canvas=this._viewer.canvas,this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._canvas),this._canvas.setAttribute("tabindex","0"),this._canvas.onclick=function(){o._canvas.focus()},e.screenSpaceCameraController.enableRotate=!1,e.screenSpaceCameraController.enableTranslate=!1,e.screenSpaceCameraController.enableZoom=!1,e.screenSpaceCameraController.enableTilt=!1,e.screenSpaceCameraController.enableLook=!1,this._tree.handler.setInputAction(function(e){o._flags.move=!0,o._viewer.camera.pitch>o._cesium.Math.toRadians(5)?(o._flags.vertical=!0,o._startMousePosition=e.position):o._flags.horizontally=!0,o._viewer.camera.positionCartographic,o._cameraHeight=o._viewer.camera.positionCartographic.height},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this._tree.handler.setInputAction(function(e){o._flags.move=!0,o._flags.rotate=!0},this._cesium.ScreenSpaceEventType.MIDDLE_DOWN),this._tree.handler.setInputAction(function(e){o._flags.vertical||(o._startMousePosition=e.startPosition),o._mousePosition=e.endPosition,o.mouseMoveEvent()},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){o._flags.move=!1,o._flags.horizontally=!1,o._flags.vertical=!1},this._cesium.ScreenSpaceEventType.LEFT_UP),this._tree.handler.setInputAction(function(e){o._flags.move=!1,o._flags.rotate=!1},this._cesium.ScreenSpaceEventType.MIDDLE_UP);this._tree.handler.setInputAction(function(e){var t=o._viewer.camera,i=500<t.positionCartographic.height?t.positionCartographic.height/1e3:.1;t.pitch<0&&t.positionCartographic.height<-200&&0<e||0<t.pitch&&t.positionCartographic.height<-200&&e<0||t.zoomIn(e*i)},this._cesium.ScreenSpaceEventType.WHEEL)},qt.prototype.mouseMoveEvent=function(){var e,t,i,o=200*this.moveSpeed,r=this._viewer.camera;this._flags.move&&(this._canvas.clientWidth,e=this._canvas.clientHeight,t=this._mousePosition.x-this._startMousePosition.x,i=-(this._mousePosition.y-this._startMousePosition.y),this._flags.horizontally&&(r.moveLeft(2*t),r.moveBackward(2*i),r.setView({destination:this._cesium.Cartesian3.fromRadians(r.positionCartographic.longitude,r.positionCartographic.latitude,this._cameraHeight),orientation:{heading:r.heading,pitch:r.pitch,roll:r.roll}})),this._flags.vertical&&r.setView({destination:this._cesium.Cartesian3.fromRadians(r.positionCartographic.longitude,r.positionCartographic.latitude,this._cameraHeight-(i/=e)*o),orientation:{heading:r.heading,pitch:r.pitch,roll:r.roll}}),this._flags.rotate&&((!r.roll&&r.pitch<0&&i<0||!r.roll&&0<r.pitch&&0<i)&&(i=0),r.rotate(r.position,.001*t),r.lookUp(.001*i)))},qt.prototype.getRelativeHeight=function(){var e=this._viewer.camera,t=this._viewer.scene.globe.getHeight(e.positionCartographic);this._groundHeightAtCameraPosition=t||this._groundHeightAtCameraPosition,this._relativeHeight=e.positionCartographic.height-this._groundHeightAtCameraPosition,this._relativeHeight<1?(this._tree.handler||this.isIndoor||this.attachMouseEvent(),t=Math.abs(this._relativeHeight),this.moveSpeed=t<50?.25:t<100?.5:t<150?.75:1):this._tree.handler&&!this.isIndoor&&Qt(this),Rt=Rt||e.position.clone(),1e4<this._core.getSpaceDistancem([Rt,e.position],this._cesium)&&(Rt=e.position.clone(),this.refreshGridLines()),this._relativeHeight<0?this._model&&(this._model.show=!0):this._model&&(this._model.show=!1)},qt.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)},qt.prototype.setCesiumFov=function(e){this._viewer.camera.frustum.fov=this._cesium.Math.toRadians(e)},Jt.prototype.StreetViewOpen=function(e,t,i){var o,r=this,n=this._viewer;return this.isStreetView||(0<this.StreetViewSphere.length&&(this.StreetViewSphere.forEach(function(e){e&&n.entities.remove(e)}),this.StreetViewSphere=[null,null]),this.StreetViewType=t.type,this.StreetViewData.linkImagesData=[],this.URL=this.extend(this.URL,t,!1),this.CallBack=this.extend(this.CallBack,t,!1),this.defaultSkyAtmosphere=!!n.scene.skyAtmosphere.show,n.scene.skyAtmosphere.show||(n.scene.skyAtmosphere.show=!0),o=n.camera,this.getInitImageByPosition(e,function(e){r.isStreetView=!0,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!0),o.flyTo({destination:new r._cesium.Cartesian3.fromDegrees(r.StreetViewData.lon,r.StreetViewData.lat,r.StreetViewData.height),orientation:{heading:o.heading,pitch:o.pitch>r._cesium.Math.toRadians(45)||o.pitch<r._cesium.Math.toRadians(-45)?0:o.pitch,roll:0},duration:5,complete:function(){i&&"function"==typeof i&&i()}}),r.attachMouseEvent(),r.createNavigation(),r.StreetViewSphereIndex=0,r.StreetViewSphere_Canvas[r.StreetViewSphereIndex]=e,r.StreetViewSphere[r.StreetViewSphereIndex]=r.createScene(r.StreetViewData.lon,r.StreetViewData.lat,r.StreetViewData.height),r.StreetViewSphere[r.StreetViewSphereIndex].show=!0,r.StreetViewSphere[r.StreetViewSphereIndex].orientation=r._cesium.Transforms.headingPitchRollQuaternion(r._cesium.Cartesian3.fromDegrees(r.StreetViewData.lon,r.StreetViewData.lat,r.StreetViewData.height),new r._cesium.HeadingPitchRoll(r._cesium.Math.toRadians(r.StreetViewData.HeadingPitchRoll.heading+("lide"===r.StreetViewType?90:0)),r._cesium.Math.toRadians(-r.StreetViewData.HeadingPitchRoll.roll),r._cesium.Math.toRadians(r.StreetViewData.HeadingPitchRoll.pitch))),"lide"===r.StreetViewType?r._core.xhr({url:r.URL.getImageInfo+r.StreetViewData.getImageTileID,type:"get",dataType:"json",success:function(e){r.CallBack&&r.CallBack.setImageDataCallback&&"function"==typeof r.CallBack.setImageDataCallback&&r.CallBack.setImageDataCallback(r.StreetViewData,e),r.getSecondTexturesFromAtlasFile(r.StreetViewData.getImageTileID,function(e){e.index===r.StreetViewSphereIndex&&!1===r.StreetViewData.isTwoTextures&&(r.StreetViewSphere_Canvas[r.StreetViewSphereIndex]=e.canvas),r.StreetViewData.isTwoTextures=!0,r.StreetViewData.isThreeTextures=!1})}}):r.getSecondTexturesFromAtlasFile(r.StreetViewData.getImageTileID,function(e){e.index===r.StreetViewSphereIndex&&!1===r.StreetViewData.isTwoTextures&&(r.StreetViewSphere_Canvas[r.StreetViewSphereIndex]=e.canvas),r.StreetViewData.isTwoTextures=!0,r.StreetViewData.isThreeTextures=!1})})),this},Jt.prototype.exit=function(){var e,t,i;this.isStreetView&&(t=(e=this)._viewer,0<this.StreetViewSphere.length&&(this.StreetViewSphere.forEach(function(e){e&&t.entities.remove(e)}),this.StreetViewSphere=[null,null],this.StreetViewSphere_Canvas=[null,null]),0<this.StreetViewNavigation.length&&(this.StreetViewNavigation.forEach(function(e){t.entities.remove(e)}),this.StreetViewNavigation=[]),this.setCesiumFov(this.StreetViewData.defaultFov),this.detachMouseEvent(),t.scene.skyAtmosphere.show=this.defaultSkyAtmosphere,this.isStreetView=!1,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!1),i=t.camera.positionCartographic,t.camera.flyTo({destination:new this._cesium.Cartesian3.fromRadians(i.longitude,i.latitude,i.height+3e3),orientation:{heading:t.camera.heading,pitch:this._cesium.Math.toRadians(-90),roll:0},complete:function(){e.isStreetView=!1,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!1)}}))},Jt.prototype.extend=function(e,t,i){for(var o in t)t.hasOwnProperty(o)&&(e.hasOwnProperty(o)||i)&&(e[o]=t[o]);return e},Jt.prototype.getInitImageByPositionURL=function(e){var t,i,o;return o=this.URL&&this.URL.getInitImageByPosition?1<(i=this.URL.getInitImageByPosition.split("{lon}"))[0].split("{lat}").length?(t=i[0].split("{lat}"))[0]+e.lat+t[1]+e.lon+i[1]:(t=i[1].split("{lat}"),i[0]+e.lon+t[0]+e.lat+t[1]):o},Jt.prototype.getImageByIdURL=function(e,t){var i,o;switch(e){case"one":i=this.URL.getInitImageById;break;case"two":i=this.URL.getSecondImageById;break;case"three":i=this.URL.getThirdImageById;break;case"init":i=this.URL.getInitImageInfoById}return"lide"===this.StreetViewType&&(t=t.replace("-0-","-X-"),"one"===e&&(i+="&row=0&col=0")),o=i?(e=i.split("{id}"))[0]+t+e[1]:o},Jt.prototype.getInitImageByPosition=function(e,n){var a=this,e=this.getInitImageByPositionURL(e);this.StreetViewData.linkImagesData=[],this._core.xhr({url:e,type:"get",dataType:"json",success:e=>{if(a.CallBack&&a.CallBack.getInitImageByPositionCallBack){"function"==typeof a.CallBack.getInitImageByPositionCallBack&&a.CallBack.getInitImageByPositionCallBack(a.StreetViewData,e);var e=a.getImageByIdURL("one",a.StreetViewData.getImageTileID),r=new Image;r.onload=function(){var e=r.width,t=r.height;"lide"===a.StreetViewType&&(e=512,t=256);var i=document.createElement("canvas"),o=i.getContext("2d");i.height=t,i.width=e,o.translate(e,0),o.scale(-1,1),o.drawImage(r,0,0,e,t,0,0,e,t),"function"==typeof n&&n(i)},r.setAttribute("crossOrigin","Anonymous");try{r.src=e}catch(e){r.src=""}a.FirstImage=r}else console.log("the getInitImageByPositionCallBack is undefined!")},error:function(e,t,i){}})},Jt.prototype.getInitImage=function(e,r){var e=this.getImageByIdURL("one",e),n=new Image,a=this;n.onload=function(){var e=n.width,t=n.height;"lide"===a.StreetViewType&&(e=512,t=256);var i=document.createElement("canvas"),o=i.getContext("2d");i.height=t,i.width=e,o.translate(e,0),o.scale(-1,1),o.drawImage(n,0,0,e,t,0,0,e,t),"function"==typeof r&&r(i)},n.setAttribute("crossOrigin","Anonymous");try{n.src=e}catch(e){n.src=""}a.FirstImage=n},Jt.prototype.getSecondTexturesFromAtlasFile=function(e,o){var r,n,a,s,l=this.StreetViewSphereIndex,t=this.getImageByIdURL("two",e),u=null,c=null,h=0,m=[];let d=4,p=8,i="{row}-{col}",g=1/0,_=1/0;"lide"===this.StreetViewType&&(i="&row={row}&col={col}",d=this.StreetViewData.row,p=this.StreetViewData.col,g=this.StreetViewData.maxWidth,_=this.StreetViewData.maxHeight);for(var f=()=>{if(++h==d*p){null==u&&(u=document.createElement("canvas"),c=u.getContext("2d"),u.height=s>_?_:s,u.width=a>g?g:a,c.translate(u.width,0),c.scale(-1,1));var e=r,t=n;"lide"===this.StreetViewType&&(e=512,t=256),c.drawImage(this.FirstImage,0,0,e,t,0,0,u.width,u.height);for(var i=0;i<m.length;i++)m[i].src&&c.drawImage(m[i],0,0,r,n,r*(i%p),n*Math.floor(i/p),r,n);o({index:l,canvas:u})}},y=0;y<d;y++)for(var v=0;v<p;v++){var C=(C=t+i).replace("{row}",y).replace("{col}",v),w=new Image;w.onload=function(){r=this.width,n=this.height,a=r*p,s=n*d,f()},w.onerror=function(){this.src="",this.onerror=void 0,f()},w.setAttribute("crossOrigin","Anonymous");try{w.src=C}catch(e){w.src=""}m.push(w)}},Jt.prototype.getThreeTexturesFromAtlasFile=function(e,r){for(var n=this.StreetViewSphereIndex,t=this.getImageByIdURL("three",e),a=null,s=null,l=0,u=[],i=0;i<8;i++)for(var o=0;o<16;o++){var c=t+i+"-"+o,h=new Image;!function(o){o.onload=function(){var e=o.width,t=o.height;if(128==++l){null==a&&(a=document.createElement("canvas"),s=a.getContext("2d"),a.height=4096,a.width=8192,s.translate(8192,0),s.scale(-1,1));for(var i=0;i<u.length;i++)s.drawImage(u[i],0,0,e,t,e*(i%16),t*Math.floor(i/16),e,t);r({index:n,canvas:a})}}}(h),h.setAttribute("crossOrigin","Anonymous");try{h.src=c}catch(e){h.src=""}u.push(h)}},Jt.prototype.InitSceneByID=function(t){var i=this,o=this._viewer;this.updateStreetSphereIndex(),this.StreetViewSphere[this.StreetViewSphereIndex]=this.createScene(this.StreetViewData.lon,this.StreetViewData.lat,this.StreetViewData.height),this.getInitImage(this.StreetViewData.getImageTileID,function(e){i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e,setTimeout(function(){i.StreetViewSphere[i.StreetViewSphereIndex].show=!0},300)}),this.StreetViewData.isTwoTextures=!1,"lide"!==this.StreetViewType?this.getImageInfoById(this.StreetViewData.getImageTileID,function(e){i.StreetViewData.linkImagesData=[],i.CallBack&&i.CallBack.getImageInfoByIdCallBack?("function"==typeof i.CallBack.getImageInfoByIdCallBack&&i.CallBack.getImageInfoByIdCallBack(i.StreetViewData,e),i.StreetViewSphere[i.StreetViewSphereIndex].position=i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),o.camera.cancelFlight(),o.camera.flyTo({destination:i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),orientation:{heading:o.camera.heading,pitch:o.camera.pitch,roll:0},duration:1.5}),setTimeout(function(){o.entities.remove(t),t=null},1300),i.StreetViewSphere[i.StreetViewSphereIndex].orientation=i._cesium.Transforms.headingPitchRollQuaternion(i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),new i._cesium.HeadingPitchRoll(i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.heading),i._cesium.Math.toRadians(-i.StreetViewData.HeadingPitchRoll.roll),i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.pitch))),i.getInitImage(i.StreetViewData.getImageTileID,function(e){i.StreetViewData.isTwoTextures||(i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e)}),i.getSecondTexturesFromAtlasFile(i.StreetViewData.getImageTileID,function(e){e.index===i.StreetViewSphereIndex&&!1===i.StreetViewData.isTwoTextures&&(i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e.canvas),i.StreetViewData.isTwoTextures=!0,i.StreetViewData.isThreeTextures=!1}),i.createNavigation()):console.log("the getImageInfoByIdCallBack is undefined!")}):this.getInitImageByPosition(i.StreetViewData,function(e){i.StreetViewSphere[i.StreetViewSphereIndex].position=i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e,o.camera.cancelFlight(),o.camera.flyTo({destination:i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),orientation:{heading:o.camera.heading,pitch:o.camera.pitch,roll:0},duration:1.5}),setTimeout(function(){o.entities.remove(t),t=null},1300),i.StreetViewSphere[i.StreetViewSphereIndex].orientation=i._cesium.Transforms.headingPitchRollQuaternion(i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),new i._cesium.HeadingPitchRoll(i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.heading+90),i._cesium.Math.toRadians(-i.StreetViewData.HeadingPitchRoll.roll),i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.pitch))),i.getSecondTexturesFromAtlasFile(i.StreetViewData.getImageTileID,function(e){e.index===i.StreetViewSphereIndex&&!1===i.StreetViewData.isTwoTextures&&(i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e.canvas),i.StreetViewData.isTwoTextures=!0,i.StreetViewData.isThreeTextures=!1})})},Jt.prototype.getImageInfoById=function(e,t){e=this.getImageByIdURL("init",e);this._core.xhr({url:e,type:"get",dataType:"json",success:function(e){"function"==typeof t&&t(e)}})},Jt.prototype.createScene=function(e,t,i){var o=this,r=this._viewer,n=this.StreetViewSphereIndex,a=new this._cesium.ImageMaterialProperty({image:new this._cesium.CallbackProperty(function(){return o.StreetViewSphere_Canvas[n]},!1),transparent:!0,color:this._cesium.Color.WHITE.withAlpha(this.StreetViewData.alpha)}),a={show:!1,position:this._cesium.Cartesian3.fromDegrees(e,t,i),ellipsoid:{radii:new this._cesium.Cartesian3(this.StreetViewData.radius,this.StreetViewData.radius,this.StreetViewData.radius),material:a}},a=r.entities.add(a);return a.geometryName="街景",a};var Xt,Kt,$t,Zt,ei,ti,ii,oi,ri,ni=null,ai=null,si={looking:!(Jt.prototype.detachMouseEvent=function(){var e=this._viewer.scene;this._viewer.canvas,this.StreetViewData._handler&&(this.StreetViewData._handler.destroy(),this.StreetViewData._handler=void 0),this.StreetViewData.navigation_handler&&(this.StreetViewData.navigation_handler.destroy(),this.StreetViewData.navigation_handler=void 0),"lide"!==this.StreetViewType&&this._viewer.clock.onTick.removeEventListener(this.StreetView_onTick,this),e.screenSpaceCameraController.enableRotate=!0,e.screenSpaceCameraController.enableTranslate=!0,e.screenSpaceCameraController.enableZoom=!0,e.screenSpaceCameraController.enableTilt=!0,e.screenSpaceCameraController.enableLook=!0})};function li(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we}function ui(e,t){this._viewer=e,this._cesium=t}Jt.prototype.attachMouseEvent=function(){var t=this;ni=this._viewer.scene,ai=this._viewer.canvas,this.StreetViewData._handler=new this._cesium.ScreenSpaceEventHandler(ai),ai.setAttribute("tabindex","0"),ai.focus(),ai.onclick=function(){ai.focus()},setTimeout(function(){t.setCesiumFov(t.StreetViewData.fov)},4e3),ni.screenSpaceCameraController.enableRotate=!1,ni.screenSpaceCameraController.enableTranslate=!1,ni.screenSpaceCameraController.enableZoom=!1,ni.screenSpaceCameraController.enableTilt=!1,ni.screenSpaceCameraController.enableLook=!1,this.StreetViewData._handler.setInputAction(function(e){si.looking=!0},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.StreetViewData._handler.setInputAction(function(e){si.looking&&(Ot=e.startPosition,Ht=e.endPosition,t.StreetView_mouseMove())},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.StreetViewData._handler.setInputAction(function(e){si.looking=!1},this._cesium.ScreenSpaceEventType.LEFT_UP),this.StreetViewData._handler.setInputAction(function(e){e=t.StreetViewData.fov+e/-10;30<e&&e<120&&(t.StreetViewData.fov=e,t.setCesiumFov(t.StreetViewData.fov))},this._cesium.ScreenSpaceEventType.WHEEL),"lide"!==this.StreetViewType&&this._viewer.clock.onTick.addEventListener(t.StreetView_onTick,this)},Jt.prototype.StreetView_onTick=function(){var t=this;!this.StreetViewData.isThreeTextures&&this.StreetViewData.fov<50&&(this.StreetViewData.isThreeTextures=!0,this.getThreeTexturesFromAtlasFile(this.StreetViewData.getImageTileID,function(e){e.index===t.StreetViewSphereIndex&&(t.StreetViewSphere_Canvas[t.StreetViewSphereIndex]=e.canvas)}))},Jt.prototype.StreetView_mouseMove=function(){var e,t,i=this._viewer.camera;si.looking&&(e=ai.clientWidth,t=ai.clientHeight,e=-(Ht.x-Ot.x)/e,t=(Ht.y-Ot.y)/t,(!i.roll&&i.pitch<0&&t<0||!i.roll&&0<i.pitch&&0<t)&&(t=0),i.rotate(i.position,e*this.StreetViewData.speedScale),i.lookUp(t*this.StreetViewData.speedScale))},Jt.prototype.setOpacity=function(t){var i=this;this.StreetViewSphere.forEach(function(e){e&&(e.ellipsoid.material.color._value=i._cesium.Color.WHITE.withAlpha(t))}),this.StreetViewData.alpha=t},Jt.prototype.setCesiumFov=function(e){this._viewer.camera.frustum.fov=this._cesium.Math.toRadians(e)},Jt.prototype.MoveToLinkImage=function(e){e?"lide"!==this.StreetViewType||e.ImageID?(this.StreetViewData.name=e.name,this.StreetViewData.lon=e.Position[0],this.StreetViewData.lat=e.Position[1],this.StreetViewData.height=e.Position[2],this.StreetViewData.getImageTileID=e.ImageID,this.InitSceneByID(this.StreetViewSphere[this.StreetViewSphereIndex])):this.CallBack&&this.CallBack.selectJoinsCallBack&&"function"==typeof this.CallBack.selectJoinsCallBack&&this.CallBack.selectJoinsCallBack():alert("暂无街景数据")},Jt.prototype.updateStreetSphereIndex=function(){this.StreetViewSphereIndex=0===this.StreetViewSphereIndex?1:0},Jt.prototype.createNavigation=function(){var i=this,a=this._viewer;0<this.StreetViewNavigation.length&&(this.StreetViewNavigation.forEach(function(e){a.entities.remove(e)}),this.StreetViewNavigation=[]),this.StreetViewData.navigation_handler&&(this.StreetViewData.navigation_handler.destroy(),this.StreetViewData.navigation_handler=null);var t,s=6378137,n=6356725,o={lon:this.StreetViewData.lon,lat:this.StreetViewData.lat,height:this.StreetViewData.height-1};function l(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=n+(s-n)*(90-t)/90;return[180*(r/(o*Math.cos(t*Math.PI/180))+e*Math.PI/180)/Math.PI,180*(i/o+t*Math.PI/180)/Math.PI]}function u(e){return e*Math.PI/180}this.StreetViewData.linkImagesData.forEach(function(t){var e=a.entities.add({polygon:{hierarchy:new i._cesium.CallbackProperty(function(){var e=function(e,t){var i=[],e=l(e.lon,e.lat,3.5,180*a.camera.heading/Math.PI),o={lon:e[0],lat:e[1]};e=l(e[0],e[1],1.1,0),i.push(e[0],e[1]),e=l(e[0],e[1],.5758,135),i.push(e[0],e[1]),e=l(e[0],e[1],.2,270),i.push(e[0],e[1]),e=l(e[0],e[1],.5,180),i.push(e[0],e[1]),e=l(e[0],e[1],.4,270),i.push(e[0],e[1]),e=l(e[0],e[1],.5,0),i.push(e[0],e[1]),e=l(e[0],e[1],.2,270),i.push(e[0],e[1]);for(var r,n=0;n<i.length-1;n+=2)r=function(e,t,i){t=function(e,t,i,o){var r=u(t),n=u(o),t=u(o)-u(t),e=u(i)-u(e);n=(n=2*Math.asin(Math.sqrt(Math.pow(Math.sin(t/2),2)+Math.cos(r)*Math.cos(n)*Math.pow(Math.sin(e/2),2))))*s,n=Math.round(1e4*n)/1e4,t=0==t&&0<e?90:0==t&&e<0?270:t<0&&0==e?180:0<=t&&0==e?0:t<0&&0<e?180-180*Math.atan(e/-t)/Math.PI:t<0&&e<0?180+180*Math.atan(e/t)/Math.PI:0<t&&e<0?360-180*Math.atan(-e/t)/Math.PI:180*Math.atan(e/t)/Math.PI;return{angle:t,distance:n}}(e.lon,e.lat,t.lon,t.lat);return l(e.lon,e.lat,t.distance,i-t.angle)}(o,{lon:i[n],lat:i[n+1]},t),i[n]=r[0],i[n+1]=r[1];return i}(o,t.NavigationAngle);return new i._cesium.PolygonHierarchy(i._cesium.Cartesian3.fromDegreesArray(e))},!1),fill:!0,outline:!0,outlineColor:i._cesium.Color.BLACK.withAlpha(.2),height:o.height}});e.geometryName="街景",e.isNavigation=!0,e.linkImageData=t,i.StreetViewNavigation.push(e)}),i.StreetViewData.navigation_handler=new i._cesium.ScreenSpaceEventHandler(ai),i.StreetViewData.navigation_handler.setInputAction(function(e){e=a.scene.pick(e.position);i._cesium.defined(e)&&(e&&e.id&&e.id.isNavigation?(t&&(t.polygon.outlineColor=i._cesium.Color.BLACK.withAlpha(.5),t.polygon.material=i._cesium.Color.WHITE),(t=e.id).polygon.outlineColor=i._cesium.Color.BLUE,t.polygon.material=i._cesium.Color.WHITE.withAlpha(.9)):t&&(t.polygon.outlineColor=i._cesium.Color.BLACK.withAlpha(.5),t.polygon.material=i._cesium.Color.WHITE,t=void 0)),t&&i.MoveToLinkImage(t.linkImageData)},i._cesium.ScreenSpaceEventType.LEFT_CLICK)},li.prototype.createCircleScan=function(e,t=1500,i="#ff0000",o=4e3,r=!0){var n=new this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height);this._position=e;i=this._cesium.Color.fromCssColorString(i);this.item=this.AddCircleScanPostStage(n,t,i,o,r);r={id:this._core.getuid(),name:"新建扩散圆扫描",pId:0,type:"scan",item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,0),this},li.prototype.createMultiCircleScan=function(e,t=1500,i="#ff0000",o=4e3,r=!0){var n=new this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height);this._position=e;i=this._cesium.Color.fromCssColorString(i);this.item=this.AddCircleScanMultiPostStage(n,t,i,o,r);r={id:this._core.getuid(),name:"新建扩散圆扫描",pId:0,type:"scan",item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,0),this},li.prototype.createRadarScan=function(e,t=1500,i="#ff0000",o=4e3,r=!0){var n=new this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height);this._position=e;i=this._cesium.Color.fromCssColorString(i);this.item=this.AddRadarScanPostStage(n,t,i,o,r);r={id:this._core.getuid(),name:"新建雷达扫描",pId:0,type:"scan",item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,0),this},li.prototype.createSectorScan=function(e,t=1500,i="#ff0000",o=90,r=0,n=4e3,a=!0){var s=this._cesium,l=new s.Cartesian3.fromDegrees(e.lon,e.lat,e.height);this._position=e;i=s.Color.fromCssColorString(i);this.item=this.AddSectorScanPostStage(l,t,i,o,r,n,a);a={id:this._core.getuid(),name:"新建扇形扩散扫描",pId:0,type:"scan",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,0),this},li.prototype.AddSectorScanPostStage=function(e,t,i,o,r,n,a){var s,l=this._viewer,u=this._cesium,c=this._core.defaultValue(this._position.height,0);function h(e,t,i){this._definitionChanged=new u.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=i,this._angle=t,this._time=(new Date).getTime()}return u.EllipsoidFadeMaterialProperty||(Object.defineProperties(h.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:u.createPropertyDescriptor("color"),angle:u.createPropertyDescriptor("angle")}),h.prototype.getType=function(e){return"EllipsoidFade"},h.prototype.getValue=function(e,t){return(t=!u.defined(t)?{}:t).color=u.Property.getValueOrClonedDefault(this._color,e,u.ColorWHITE,t.color),t.angle=this._angle,t},h.prototype.equals=function(e){return this===e||e instanceof h&&Property.equals(this._color,e._color)},u.EllipsoidFadeMaterialProperty=h,u.Material.EllipsoidFadeType="EllipsoidFade",u.Material.EllipsoidFadeSource="float getAngle(in vec2 dv)\n{\n    if(dv.y == 0.0 && dv.x > 0.0)\n    {\n        return 90.0;\n    }\n    if(dv.y == 0.0 && dv.x < 0.0)\n    {\n        return 270.0;\n    }\n    float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n    if(dv.x > 0.0)\n    {\n        if(dv.y < 0.0)\n        {\n            rAngle = 180.0 + rAngle;\n        }\n    }\n    if(dv.x <= 0.0)\n    {\n        if(dv.y < 0.0)\n        {\n            rAngle = 180.0 + rAngle;\n        }\n        if(dv.y > 0.0)\n        {\n            rAngle = 360.0 + rAngle;\n        }\n    }\n    return rAngle;\n}\nfloat ripple(float dist, float rippleIntensity, float rippleScale) {\n    return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n  czm_material material = czm_getDefaultMaterial(materialInput);\n  material.diffuse = 1.5 * color.rgb;\n  vec2 st = materialInput.st;\n  float dis = distance(st, vec2(0.5, 0.5));\n  float nowAngle = getAngle(st.xy-vec2(0.5, 0.5));\n  if(nowAngle < angle)\n  {\n       material.alpha = 1.0 - dis/0.5;\n       float intensity =step(0.001,ripple(dis, 100.0, 15.0));\n       if(intensity == 1.0)\n       {\n           material.alpha = material.alpha/2.0;\n       }\n  }\n  else{\n       material.alpha = 0.0;\n       discard;\n  }\n  return material;\n}",u.Material._materialCache.addMaterial(u.Material.EllipsoidFadeType,{fabric:{type:u.Material.EllipsoidFadeType,uniforms:{color:new u.Color(1,0,0,1),angle:90},source:u.Material.EllipsoidFadeSource},translucent:function(e){return!0}})),s={name:"EllipsoidFade",position:e,ellipse:{height:a?void 0:c,semiMinorAxis:t,semiMajorAxis:t,stRotation:r*Math.PI/180,material:new u.EllipsoidFadeMaterialProperty(i,o,n)}},l.entities.add(s)},li.prototype.AddCircleScanPostStage=function(e,t,i,o,r){var n=this._viewer,a=this._cesium,s=this._core.defaultValue(this._position.height,0);function l(e,t){this._definitionChanged=new a.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=t,this._time=(new Date).getTime()}a.CircleScanMaterialProperty||(Object.defineProperties(l.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a.createPropertyDescriptor("color")}),l.prototype.getType=function(e){return"CircleScan"},l.prototype.getValue=function(e,t){return(t=!a.defined(t)?{}:t).color=a.Property.getValueOrClonedDefault(this._color,e,a.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.Property.equals(this._color,e._color)},a.CircleScanMaterialProperty=l,a.Material.CircleScanType="CircleScan",a.Material.CircleScanSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n                {\n                    czm_material material = czm_getDefaultMaterial(materialInput);\n                    material.diffuse = color.rgb;\n                    vec2 st = materialInput.st;\n                    float dis = distance(st, vec2(0.5, 0.5));\n                    if(dis<time){\n                        float f = dis / time;\n                        material.alpha = pow(f, 4.0);\n                    }else{\n                        material.alpha = 0.0;\n                    }\n                    return material;\n                }",a.Material._materialCache.addMaterial(a.Material.CircleScanType,{fabric:{type:a.Material.CircleScanType,uniforms:{color:new a.Color(1,0,0,1),time:0},source:a.Material.CircleScanSource},translucent:function(e){return!0}}));o={name:"CircleScan",position:e,ellipse:{height:r?void 0:s,semiMinorAxis:t,semiMajorAxis:t,material:new a.CircleScanMaterialProperty(i,o)}};return n.entities.add(o)},li.prototype.AddCircleScanMultiPostStage=function(e,t,i,o,r){var n=this._viewer,a=this._cesium,s=this._core.defaultValue(this._position.height,0);function l(e,t){this._definitionChanged=new a.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.u_radius1=0,this.u_radius2=0,this.u_radius3=0,this.duration=t,this._time=(new Date).getTime()}a.CircleScanMultiMaterialProperty||(Object.defineProperties(l.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a.createPropertyDescriptor("color")}),l.prototype.getType=function(e){return"CircleScanMulti"},l.prototype.getValue=function(e,t){return(t=!a.defined(t)?{}:t).color=a.Property.getValueOrClonedDefault(this._color,e,a.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t.time<1/3&&0===this.u_radius2&&0===this.u_radius1?this.u_radius3=t.time:t.time>=1/3&&t.time<2/3&&0===this.u_radius1?(this.u_radius3=t.time,this.u_radius2=this.u_radius3-1/3):t.time>=2/3?(this.u_radius3=t.time,this.u_radius2=this.u_radius3-1/3,this.u_radius1=this.u_radius3-2/3):t.time<1/3&&0!==this.u_radius2&&0!==this.u_radius1?(this.u_radius1=t.time,this.u_radius2=t.time+1/3,this.u_radius3=t.time+2/3):t.time>=1/3&&t.time<2/3&&0!==this.u_radius1&&(this.u_radius1=t.time-1/3,this.u_radius2=t.time,this.u_radius3=t.time+1/3),t.u_radius1=this.u_radius1,t.u_radius2=this.u_radius2,t.u_radius3=this.u_radius3,t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.Property.equals(this._color,e._color)},a.CircleScanMultiMaterialProperty=l,a.Material.CircleScanMultiType="CircleScanMulti",a.Material.CircleScanMultiSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n                {\n                    czm_material material = czm_getDefaultMaterial(materialInput);\n                    material.diffuse = color.rgb;\n                    vec2 st = materialInput.st;\n                    float dis = distance(st, vec2(0.5, 0.5));\n                    dis = dis * 2.0;\n                    if(dis < u_radius1)\n\n                    {\n                        float f = dis / u_radius1;\n                        material.alpha  = pow(f, 9.0);\n                    }else if(dis < u_radius2){\n                        float f = dis / u_radius2;\n                        material.alpha  = pow(f, 9.0);\n                    }else if(dis < u_radius3){\n                        float f = dis / u_radius3;\n                        material.alpha  = pow(f, 9.0);\n                    }else{\n                        material.alpha = 0.0;\n                    }\n                    return material;\n                }",a.Material._materialCache.addMaterial(a.Material.CircleScanMultiType,{fabric:{type:a.Material.CircleScanMultiType,uniforms:{color:new a.Color(1,0,0,1),time:0,u_radius1:0,u_radius2:0,u_radius3:0},source:a.Material.CircleScanMultiSource},translucent:function(e){return!0}}));o={name:"CircleScanMulti",position:e,ellipse:{height:r?void 0:s,semiMinorAxis:t,semiMajorAxis:t,material:new a.CircleScanMultiMaterialProperty(i,o)}};return n.entities.add(o)},li.prototype.AddRadarScanPostStage=function(e,t,i,o,r){var n=this._viewer,a=this._cesium,s=this._core.defaultValue(this._position.height,0);function l(e,t){this._definitionChanged=new a.Event,this._color=void 0,this._angle=60,this.range=360,this._colorSubscription=void 0,this.color=e,this.duration=t,this.isReturn=!1,this.isGradient=!0,this._time=(new Date).getTime()}a.RadarScanMaterialProperty||(Object.defineProperties(l.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a.createPropertyDescriptor("color")}),l.prototype.getType=function(e){return"RadarScan"},l.prototype.getValue=function(e,t){return(t=!a.defined(t)?{}:t).color=a.Property.getValueOrClonedDefault(this._color,e,a.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t._angle=this._angle,t.range=this.range,t.gradient=this.isGradient,this.isReturn?(void 0===this.old&&(this.old=t.time),.5<this.old&&t.time<.5&&(t.inverse=!t.inverse),this.old=t.time,t.gradient?t.inverse?(t.angle2=this.range*(1-t.time),t._angle=this.range-t.angle2,t._angle>this._angle&&(t._angle=this._angle),t.angle1=t.angle2-t._angle,t.angle1<0&&(t._angle=t.angle2,t.angle1=0)):(t.angle1=this.range*t.time,t._angle=t.angle1,t._angle>this._angle&&(t._angle=this._angle),t.angle2=t.angle1+t._angle,t.angle2>this.range&&(t.angle2=this.range)):(t.range=this.range-this._angle,t.angle1=t.range*(t.inverse?1-t.time:t.time),t.angle2=t.angle1+this._angle)):(t.inverse=!1,t.angle1=this.range*t.time,t.angle2=t.angle1+this._angle,t.angle2>this.range&&(t.angle2=t.angle2-this.range)),t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.Property.equals(this._color,e._color)},a.RadarScanMaterialProperty=l,a.Material.RadarScanType="RadarScan",a.Material.RadarScanSource="float getAngle(in vec2 dv)\n                {\n                    if(dv.y == 0.0 && dv.x > 0.0)\n                    {\n                        return 90.0;\n                    }\n                    if(dv.y == 0.0 && dv.x < 0.0)\n                    {\n                        return 270.0;\n                    }\n                    float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n                    if(dv.x > 0.0)\n                    {\n                        if(dv.y < 0.0)\n                        {\n                            rAngle = 180.0 + rAngle;\n                        }\n                    }\n                    if(dv.x <= 0.0)\n                    {\n                        if(dv.y < 0.0)\n                        {\n                            rAngle = 180.0 + rAngle;\n                        }\n                        if(dv.y > 0.0)\n                        {\n                            rAngle = 360.0 + rAngle;\n                        }\n                    }\n                    return rAngle;\n                }\n                float ripple(float dist, float rippleIntensity, float rippleScale) {\n                    return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n                }\n                czm_material czm_getMaterial(czm_materialInput materialInput)\n                {\n                    czm_material material = czm_getDefaultMaterial(materialInput);\n                    material.diffuse = color.rgb;\n                    vec2 st = materialInput.st;\n                    float dis = distance(st, vec2(0.5, 0.5));\n                    float f = 0.0;\n                    float nowAngle = getAngle(st.xy-vec2(0.5, 0.5));\n                    if(nowAngle < angle2 && nowAngle > angle1)\n                    {\n                        if(gradient){\n                            f = (nowAngle - angle1) / _angle;\n                            material.alpha = f;\n                            if(inverse){\n                                material.alpha = 1.0 - material.alpha;\n                            }\n                        }else{\n                            material.alpha = 1.0;\n                        }\n                    }else if(nowAngle < range && nowAngle > angle1 && angle2 < _angle){\n                        if(gradient){\n                            f = (nowAngle - angle1) / _angle;\n                            material.alpha = f;\n                            if(inverse){\n                                material.alpha = 1.0 - material.alpha;\n                            }\n                        }else{\n                            material.alpha = 1.0;\n                        }\n                    }else if(nowAngle < angle2 && nowAngle > 0.0 && angle2 < _angle){\n                        if(gradient){\n                            f = (nowAngle + range - angle1) / _angle;\n                            material.alpha = f;\n                            if(inverse){\n                                material.alpha = 1.0 - material.alpha;\n                            }\n                        }else{\n                            material.alpha = 1.0;\n                        }\n                    }else{\n                        material.alpha = 0.0;\n                        discard;\n                    }\n                    return material;\n                }",a.Material._materialCache.addMaterial(a.Material.RadarScanType,{fabric:{type:a.Material.RadarScanType,uniforms:{color:new a.Color(1,0,0,1),time:0,angle2:0,angle1:0,_angle:60,range:360,inverse:!1,gradient:!0},source:a.Material.RadarScanSource},translucent:function(e){return!0}}));o={name:"RadarScan",position:e,ellipse:{height:r?void 0:s,semiMinorAxis:t,semiMajorAxis:t,material:new a.RadarScanMaterialProperty(i,o)}};return n.entities.add(o)},li.prototype.setRadius=function(e){this.item&&(this.item.ellipse.semiMinorAxis=parseFloat(e),this.item.ellipse.semiMajorAxis=parseFloat(e))},li.prototype.setTime=function(e){this.item&&(this.item.ellipse.material.duration=parseFloat(e))},li.prototype.setRadarAngle=function(e){var t;this.item&&"RadarScan"===this.item.ellipse.material.getType()&&(t=this.item.ellipse.material.range,this.item.ellipse.material._angle=t<e?t:parseFloat(e))},li.prototype.setRadarRange=function(e){this.item&&"RadarScan"===this.item.ellipse.material.getType()&&(this.item.ellipse.material.range=360<e?360:parseFloat(e))},li.prototype.setRadarIsReturn=function(e){this.item&&"RadarScan"===this.item.ellipse.material.getType()&&(this.item.ellipse.material.isReturn=e)},li.prototype.setRadarIsGradient=function(e){this.item&&"RadarScan"===this.item.ellipse.material.getType()&&(this.item.ellipse.material.isGradient=e)},li.prototype.setPosition=function(e){this.item&&(this.item.position=new Cesium.Cartesian3.fromDegrees(e.lon,e.lat))},li.prototype.remove=function(){this._viewer.entities.remove(this.item)},li.prototype.setTreeobj=function(e){this.treeobj=e},li.prototype.deleteObject=function(){this.item&&this._viewer.entities.remove(this.item)},li.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},ui.prototype.depthTestAgainstTerrain=function(e){this._viewer.scene.globe.depthTestAgainstTerrain=e},ui.prototype.show=function(){return this._viewer.scene.globe.depthTestAgainstTerrain};var ci,hi,mi,di,pi,gi=[1,1e5];function _i(e,t){if(!(ci.canvas.width<=0||ci.canvas.height<=0)){var i,o=ci.camera.getPickRay(e);o&&(i=ci.scene.globe.pick(o,ci.scene));o=ci.scene.pick(e);return!(o=o&&o.id instanceof Cesium.Entity?void 0:o)||(e=ci.scene.pickPosition(e))&&(i=e),i}}function fi(e,t){this._normalShadowMap=e.scene.shadowMap,ci=e,Cesium.Scene.prototype.screenToWorld=_i,this._viewer=e,this._cesium=t,this._core=new V,this._getPosition=new Ee(e,t),this._startPositionCartesian=null,this._startPositionCartographic=null,this._currentPosition=null,this._prevRadius=null,this._currentRadius=null,this._currentFovHorizontal=null,this._currentFovVertical=null,this._viewshedDirection=null,this._scratchCartesian3=new Cesium.Cartesian3,this._texture=null,this._canEnlarge=!1,this._viewshedPrimitive=null,this._eventListener=null,this._viewshedMap=void 0,this._firstTime=!0,this._editingMode=!1,this._isSliderClicked=!1,this._currentObject=void 0,this._setNewPosition=!1,this._setNewPositionCanDrag=!1,this._setNewName=!1,this._listControl=void 0,this._addingViewshedMode=!1,this._initialCameraParams={},this._isCancelledTerrain=!1,this._isCancelledPrimitives=!1,this._isSpherical=!1,this._occluder=void 0,this._horizonCullingDistanceFromPoint=void 0,this._mousePositionX=void 0,this._mousePositionY=void 0,this._zAxisNewPosition=void 0,this._startingRepoZHeight=void 0,this._viewshedCartoPos=void 0,this._propertiesChanged=!1,this._calculations=[],this._exposures=[],this._calculating=!1,this._calculatingExposure=!1,this.viewshedCalculateNormals=!1,this._txtUnit="meters_short",this.isLoadingScreenOn=!1,this._primitiveColor=Cesium.Color.WHITE,this._predefinedPrimitiveColors={BEYOND_THE_HORIZON:Cesium.Color.WHITE,DEFAULT:Cesium.Color.WHITE},this._layersStorage=null,this.getId=function(){return"Viewshed"},this.maxNumViewshed=8,Xt=53*Cesium.Math.RADIANS_PER_DEGREE,Kt=53*Cesium.Math.RADIANS_PER_DEGREE,$t=6371010,Zt={ABOVE_SEA_LEVEL:0,ABOVE_GROUND_LEVEL:1,ABOVE_MODEL:2},ei=new Cesium.Cartesian3,oi=new Cesium.Matrix4,ti=new Cesium.Cartesian4,ii=new Cesium.Cartesian3,oi=new Cesium.Matrix4,(ri=new Array(4))[0]=new Cesium.Cartesian4(-1,-1,1,1),ri[1]=new Cesium.Cartesian4(1,-1,1,1),ri[2]=new Cesium.Cartesian4(1,1,1,1),ri[3]=new Cesium.Cartesian4(-1,1,1,1)}function yi(e,t){this._viewer=e,this._cesium=t}function vi(e,t,i,r,n,a){const{Pass:o,defined:s,PerspectiveFrustum:l,PerspectiveOffCenterFrustum:u,OrthographicFrustum:c,OrthographicOffCenterFrustum:h}=Cesium;hi=hi||new l,mi=mi||new u,di=di||new c,pi=pi||new h;let m=e._us,d=m._frameState,p=d.camera,g=p._scene,_=g._view,f=_.frustumCommandsList,y=f.length;var v,C,w,b=g._globeTranslucencyState,T=b.translucent;function S(e,t,i,o){a&&!a(e,t)||(r&&n?function(e,t,i,o,r,n){const a=Cesium.defined;var s=o._frameState,o=e.derivedCommands;a(o)&&(o=(e=s.useLogDepth&&a(o.logDepth)?o.logDepth.command:e).derivedCommands,a(o[t])&&(e=o[t][i]).execute(r,n))}(e,r,n,t,i,o):e.execute(i,o))}for(var P=s(p.frustum.fov)?p.frustum.clone(hi):s(p.frustum.infiniteProjectionMatrix)?p.frustum.clone(mi):s(p.frustum.width)?p.frustum.clone(di):p.frustum.clone(pi),E=0;E<y;++E){var x=y-E-1,I=f[x],D=i.framebuffer;if(i.framebuffer=t,P.near=0!=x?I.near*g.opaqueFrustumNearOffset:I.near,P.far=I.far,m.updateFrustum(P),m.updatePass(o.GLOBE),w=I.commands[o.GLOBE],C=I.indices[o.GLOBE],T)b.executeGlobeCommands(I,S,globeTranslucencyFramebuffer,g,i);else for(v=0;v<C;++v)S(w[v],g,e,i);for(m.updatePass(o.CESIUM_3D_TILE),w=I.commands[o.CESIUM_3D_TILE],C=I.indices[o.CESIUM_3D_TILE],v=0;v<C;++v)S(w[v],g,e,i);for(m.updatePass(o.OPAQUE),w=I.commands[o.OPAQUE],C=I.indices[o.OPAQUE],v=0;v<C;++v)S(w[v],g,e,i);for(m.updatePass(o.TRANSLUCENT),w=I.commands[o.TRANSLUCENT],C=I.indices[o.TRANSLUCENT],v=0;v<C;++v)S(w[v],g,e,i);i.framebuffer=D}}fi.prototype.setOptions=function(e){this._currentObject={viewshedPrimitive:this._viewshedPrimitive,viewshedMap:this._viewshedMap,viewshedObjOptions:e||{}}},fi.prototype.startDraw=function(e){this._viewshedPrimitive&&(ci.scene.primitives.remove(this._viewshedPrimitive),this._viewshedPrimitive=null),this._core.setDepthTest("open",this._viewer),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this._eventListener&&this._eventListener.destroy(),this._eventListener=new Cesium.ScreenSpaceEventHandler(ci.scene.canvas),void 0===this._viewshedDefaultNamingArray&&(this._viewshedDefaultNamingArray=new Array(this.maxNumViewshed)),this._addingViewshedMode=!0,this._editingMode=!1,this._currentObject={viewshedPrimitive:this._viewshedPrimitive,viewshedMap:this._viewshedMap,viewshedObjOptions:e||{}},this._isSpherical=e.isSpherical,this._setNewPosition=!1,"pc"!=this._core.getBrowser().pc?(this._eventListener.setInputAction($.proxy(this.setViewshedPositionMobile,this),Cesium.ScreenSpaceEventType.LEFT_CLICK),ci.scene.preRender.addEventListener(this.onPreFrameMobile,this)):(this._eventListener.setInputAction($.proxy(this.setViewshedPosition,this),Cesium.ScreenSpaceEventType.LEFT_CLICK),ci.scene.preRender.addEventListener(this.onPreFrame,this)),this.end=e=>{this.end=void 0,ci.scene.preRender.removeEventListener(this.onPreFrame,this);try{ci.scene.preRender.removeEventListener(this.onPreFrameMobile,this)}catch(e){}this._eventListener&&this._eventListener.destroy(),this._core.setDepthTest("close",this._viewer),this._core.mouse(this._viewer.container,0)}},fi.prototype.close=function(){ci.scene.preRender.removeEventListener(this.onPreFrame,this);try{ci.scene.preRender.removeEventListener(this.onPreFrameMobile,this)}catch(e){}this._eventListener&&this._eventListener.destroy(),this._viewshedPrimitive&&(ci.scene.primitives.remove(this._viewshedPrimitive),this._viewshedPrimitive=null);var e=ci.scene,t={context:ci.scene.context,lightCamera:e._sunCamera};e.shadowMap.destroy(),e.shadowMap=new Cesium.ShadowMap(t);var i=e.shadowMap;this._currentObject&&this._currentObject.viewshedObjOptions&&this._currentObject.viewshedObjOptions.color&&this._currentObject.viewshedObjOptions.color.default&&(t=this._currentObject.viewshedObjOptions.color.default,i._color=new Cesium.Cartesian3(t.r,t.g,t.b)),i.enabled=!0,i.debugShow=!1,i.guid=void 0,i.show=!0,i.maximumDistance=1e4,i.debugCreateRenderStates(),i.dirty=!0,ci.scene.globe.shadows=Cesium.ShadowMode.fromCastReceive(!0,!0),ci.scene.globe.show=!0,e.skyAtmosphere.show=!0,ci.scene.shadowMap=this._normalShadowMap,this._startPositionCartesian=null,this.resetAllVariables(),this._core.setDepthTest("close",this._viewer),this._core.mouse(this._viewer.container,0)},fi.prototype.setVisibility=function(e){this._viewshedPrimitive.show=e,ci.shadowMap.enabled=e},fi.prototype.reset=function(){var e=ci.scene,t={context:ci.scene.context,lightCamera:e._sunCamera};e.shadowMap.destroy(),e.shadowMap=new Cesium.ShadowMap(t);var i=e.shadowMap;this._currentObject&&this._currentObject.viewshedObjOptions&&this._currentObject.viewshedObjOptions.color&&this._currentObject.viewshedObjOptions.color.default&&(t=this._currentObject.viewshedObjOptions.color.default,i._color=new Cesium.Cartesian3(t.r,t.g,t.b)),i.enabled=!0,i.debugShow=!1,i.guid=void 0,i.show=!0,i.maximumDistance=1e4,i.debugCreateRenderStates(),i.dirty=!0,ci.scene.globe.shadows=Cesium.ShadowMode.fromCastReceive(!0,!0),ci.scene.globe.show=!0,e.skyAtmosphere.show=!0,ci.scene.shadowMap=this._normalShadowMap},fi.prototype.addViewshed=function(e={}){this._viewshedPrimitive&&this.close();var t=new Cesium.HeadingPitchRange(e.heading,e.pitch,.01),i=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height);this._currentRadius=e.distance||1e3,this._isSpherical=e.isSpherical,this._currentObject=this.CreateViewshed(i,this._currentRadius,t,e),this._isSpherical?this.createViewshedSpherePrimitive(i):this.createViewshedCameraPrimitive(i,this._currentObject.viewshedMap._lightCamera)},fi.prototype.CreateViewshed=function(e,t,i,o){var r=ci.scene,n=new Cesium.Camera(r),a=ci.scene.context;n.frustum.fov=53*Math.PI/180,n.frustum.aspectRatio=1,n.frustum.near=1,n.frustum.far=t,n.lookAt(e,i);n={context:a,lightCamera:n,cascadesEnabled:!1,isPointLight:this._isSpherical,pointLightRadius:t};r.shadowMap=new Cesium.ShadowMap(n);n=r.shadowMap;o.color&&(n._viewshed_Back=new Cesium.Cartesian3(o.color.Back.r,o.color.Back.g,o.color.Back.b),n._viewshed_Fore=new Cesium.Cartesian3(o.color.Fore.r,o.color.Fore.g,o.color.Fore.b)),n.enabled=!0,n.debugShow=!1,n.guid=Cesium.createGuid(),n.show=!0,n.maximumDistance=1e4,n._pointLightRadius=t,n.debugCreateRenderStates(),n._distance=t,n.dirty=!0,ci.scene.globe.shadows=Cesium.ShadowMode.fromCastReceive(!0,!0),ci.scene.globe.show=!0,r.skyAtmosphere.show=!0;r={};return r.position=e,r.distance=t,r.direction=i,r.viewshedObjOptions=o,r.guid=this._cesium.createGuid(),r.viewshedObjOptions.originalDirection=i,r.type="viewshed",r.viewshedMap=n,r},fi.prototype.resetAllVariables=function(){this._startPositionCartesian=null,this._startPositionCartographic=null,this._currentPosition=null,this._currentRadius=null,this._currentFovHorizontal=null,this._currentFovVertical=null,this._setNewPosition=!1,this._currentObject=void 0,this._viewshedMap=void 0,this._canEnlarge=!1,this._zAxisNewPosition=void 0,this._viewshedDirection=null},fi.prototype.setViewshedPosition=function(e){var t,i,o,r;this._setNewPosition||(this._canEnlarge&&null!=this._viewshedPrimitive?(this._canEnlarge=!1,this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),this._currentObject.viewshedObjOptions.end&&this._currentObject.viewshedObjOptions.end(),this._core.mouse(this._viewer.container,0),null!=this._viewshedMap&&null!=this._viewshedPrimitive&&(t=this._viewshedPrimitive._camera,this._currentObject.viewshedObjOptions.initialHeading=t.heading,this._currentObject.viewshedObjOptions.initialPitch=t.pitch,this._currentObject.viewshedObjOptions.initialRoll=t.roll,this._currentObject.viewshedObjOptions.altitudeMethod=Cesium.defaultValue(this._currentObject.viewshedObjOptions.altitudeMethod,2),i={displayName:this._currentObject.viewshedObjOptions.name,color:this._currentObject.viewshedObjOptions.color,hFOV:t.frustum.fov,vFOV:t.frustum.fovy,aspectRatio:t.frustum.aspectRatio,height:this._currentObject.viewshedObjOptions.height,distance:this._currentObject.viewshedObjOptions.distance,xPos:this._currentObject.viewshedObjOptions.xPos,yPos:this._currentObject.viewshedObjOptions.yPos,altitudeMethod:this._currentObject.viewshedObjOptions.altitudeMethod,pickHeight:this._currentObject.viewshedObjOptions.pickHeight,horizonCullingDistanceFromViewshed:this._horizonCullingDistanceFromPoint,initialHeading:this._currentObject.viewshedObjOptions.initialHeading,initialPitch:this._currentObject.viewshedObjOptions.initialPitch,initialRoll:this._currentObject.viewshedObjOptions.initialRoll},i=this.CreateViewshed(t.position,Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),new Cesium.HeadingPitchRange(t.heading,t.pitch,.01),i),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),-1!=i&&(this.resetAllVariables(),this._currentObject=i,i=ci.scene.primitives._primitives,$.grep(i,function(e){return!0===e.isViewshed}),o=[],i.forEach(function(e,t){e.isViewshed&&o.push(t)}),1<o.length&&(r=o[o.length-2],r=ci.scene.primitives._primitives[r],ci.scene.primitives.remove(r))))):!Cesium.defined(e)||void 0===this._currentObject||void 0!==(r=this._getPosition.getMousePosition(e))&&(e=0,this._startPositionCartographic=ci.scene.globe.ellipsoid.cartesianToCartographic(r),this._currentObject.viewshedObjOptions.pickHeight=this._startPositionCartographic.height,void 0!==this._currentObject.viewshedObjOptions.height&&(e=this._currentObject.viewshedObjOptions.height),r=new Cesium.Cartesian3.fromRadians(this._startPositionCartographic.longitude,this._startPositionCartographic.latitude,this._startPositionCartographic.height+0+e),this._startPositionCartesian=r,e=this._startPositionCartesian,r=new Cesium.BoundingSphere(new Cesium.Cartesian3(0,0,0),$t),this._occluder=new Cesium.Occluder(r,e),this._canEnlarge=!0,this._eventListener.setInputAction($.proxy(this.onMouseMove,this),Cesium.ScreenSpaceEventType.MOUSE_MOVE)))},fi.prototype.update=function(t={}){if(this._currentObject&&this._currentObject.viewshedMap){var i,o=this._currentObject.direction;Object.assign(o,t);let e=this._currentObject.position;void 0===t.lon&&void 0===t.lat&&void 0===t.height||(i=this._core.toDegrees(e),Object.assign(i,t),e=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height),this._currentObject.position=e),void 0!==t.distance&&(this._currentRadius=t.distance),this._currentRadius?this._currentObject.viewshedMap._lightCamera.frustum.far=this._currentRadius:this._currentRadius=this._currentObject.viewshedMap._lightCamera.frustum.far,this._currentObject.viewshedMap._lightCamera.lookAt(e,o),this._isSpherical?this.createViewshedSpherePrimitive(e):this.createViewshedCameraPrimitive(e,this._currentObject.viewshedMap._lightCamera)}},fi.prototype.setViewshedPositionMobile=function(e){var t,i,o,r;this._setNewPosition||(this.onMouseMove(e),this.createViewshedCameraPrimitive(),this._canEnlarge&&null!=this._viewshedPrimitive?(this._currentObject.viewshedObjOptions.end&&this._currentObject.viewshedObjOptions.end(),this._core.mouse(this._viewer.container,0),this.createViewshedMap(),null!=this._viewshedMap&&null!=this._viewshedPrimitive&&(t=this._viewshedPrimitive._camera,this._currentObject.viewshedObjOptions.initialHeading=t.heading,this._currentObject.viewshedObjOptions.initialPitch=t.pitch,this._currentObject.viewshedObjOptions.initialRoll=t.roll,this._currentObject.viewshedObjOptions.altitudeMethod=Cesium.defaultValue(this._currentObject.viewshedObjOptions.altitudeMethod,2),i={displayName:this._currentObject.viewshedObjOptions.name,color:this._currentObject.viewshedObjOptions.color,hFOV:t.frustum.fov,vFOV:t.frustum.fovy,aspectRatio:t.frustum.aspectRatio,height:this._currentObject.viewshedObjOptions.height,distance:this._currentObject.viewshedObjOptions.distance,xPos:this._currentObject.viewshedObjOptions.xPos,yPos:this._currentObject.viewshedObjOptions.yPos,altitudeMethod:this._currentObject.viewshedObjOptions.altitudeMethod,pickHeight:this._currentObject.viewshedObjOptions.pickHeight,horizonCullingDistanceFromViewshed:this._horizonCullingDistanceFromPoint,initialHeading:this._currentObject.viewshedObjOptions.initialHeading,initialPitch:this._currentObject.viewshedObjOptions.initialPitch,initialRoll:this._currentObject.viewshedObjOptions.initialRoll},i=this.CreateViewshed(t.position,Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),new Cesium.HeadingPitchRange(t.heading,t.pitch,.01),i),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),-1!=i&&(this._currentObject=i,i=ci.scene.primitives._primitives,$.grep(i,function(e){return!0===e.isViewshed}),o=[],i.forEach(function(e,t){e.isViewshed&&o.push(t)}),1<o.length&&(r=o[o.length-2],r=ci.scene.primitives._primitives[r],ci.scene.primitives.remove(r))))):!Cesium.defined(e)||void 0===this._currentObject||void 0!==(r=this._getPosition.getMousePosition(e))&&(e=0,this._startPositionCartographic=ci.scene.globe.ellipsoid.cartesianToCartographic(r),this._currentObject.viewshedObjOptions.pickHeight=this._startPositionCartographic.height,void 0!==this._currentObject.viewshedObjOptions.height&&(e=this._currentObject.viewshedObjOptions.height),r=new Cesium.Cartesian3.fromRadians(this._startPositionCartographic.longitude,this._startPositionCartographic.latitude,this._startPositionCartographic.height+0+e),this._startPositionCartesian||(this._startPositionCartesian=r),e=this._startPositionCartesian,r=new Cesium.BoundingSphere(new Cesium.Cartesian3(0,0,0),$t),this._occluder=new Cesium.Occluder(r,e),this._canEnlarge=!0,this._eventListener.setInputAction($.proxy(this.onMouseMove,this),Cesium.ScreenSpaceEventType.MOUSE_MOVE)))},fi.prototype.onMouseMove=function(e){var t,i,o,r;Cesium.defined(e)&&(i={},null!=(t=this._getPosition.getMousePosition(e))?null!=i.pickPrimitive&&null!=i.pickPrimitive._camera||(i={},this._setNewPosition?this._setNewPositionCanDrag?(o=void 0,r=ci.scene.globe.ellipsoid.cartesianToCartographic(t),this._currentObject.viewshedObjOptions.pickHeight=r.height,this._currentObject.viewshedObjOptions.terrainHeight=ci.scene.globe.getHeight(r),o=this._zAxisNewPosition?(e=e.endPosition.y-this._startingRepoZ.y,e=-1*Cesium.Cartesian3.magnitude(Cesium.Cartesian3.subtract(this._currentObject.position,ci.camera.position,this._scratchCartesian3),this._scratchCartesian3)*(e/ci.canvas.height),null==this._viewshedCartoPos&&(this._viewshedCartoPos=new Cesium.Cartographic.fromCartesian(this._currentObject.position)),new Cesium.Cartesian3.fromRadians(this._viewshedCartoPos.longitude,this._viewshedCartoPos.latitude,this._viewshedCartoPos.height+e)):this._currentObject.viewshedObjOptions.altitudeMethod==Zt.ABOVE_SEA_LEVEL?new Cesium.Cartesian3.fromRadians(r.longitude,r.latitude,this._startingRepoZHeight):t,this._newPosition=o):(r=Cesium.Matrix4.multiplyByVector(ci.camera._viewMatrix,Cesium.Cartesian4.fromElements(t.x,t.y,t.z,1,ti),ti),o=Cesium.Matrix4.multiplyByVector(ci.camera.frustum.projectionMatrix,r,ti),r=Cesium.Cartesian3.divideByScalar(o,o.w,ii),o=Math.floor((.5*r.x+.5)*ci.canvas.width),r=Math.floor((.5*r.y+.5)*ci.canvas.height),this._mousePositionX=o,this._mousePositionY=r):null!=this._startPositionCartesian&&(Cesium.Cartesian3.subtract(t,this._startPositionCartesian,i),isNaN(i.x)||isNaN(i.y)||isNaN(i.z)||(this._viewshedDirection=Cesium.Cartesian3.normalize(i,this._scratchCartesian3),this._currentRadius=Cesium.Cartesian3.magnitude(i)))):(this._mousePositionX=void 0,this._mousePositionY=void 0))},fi.prototype.createViewshedSpherePrimitive=function(e,t){try{var i=null!=e?e:this._startPositionCartesian,o=null!=t?t:this._currentRadius;if(o<=1)return!1;null!=this._viewshedPrimitive&&ci.scene.primitives.remove(this._viewshedPrimitive);var r=Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(i),new Cesium.Cartesian3(0,0,0),oi),n=new Cesium.GeometryInstance({geometry:new Cesium.SphereOutlineGeometry({radius:o,stackPartitions:12,slicePartitions:12}),modelMatrix:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1,1,1,.5))}});this._viewshedPrimitive=ci.scene.primitives.add(new Cesium.Primitive({geometryInstances:n,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,renderState:{lineWidth:1}}),allowPicking:!1,asynchronous:!1}));var a=new Cesium.Camera(ci.scene);a.position=i,a.direction=Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z,this._scratchCartesian3),this._viewshedPrimitive._camera=a}catch(e){return!1}return this._viewshedPrimitive},fi.prototype.createViewshedCameraPrimitive=function(e,t){null!=this._viewshedPrimitive&&ci.scene.primitives.remove(this._viewshedPrimitive);var i=new Cesium.Camera(ci.scene);if(this._startPositionCartesian||e)return i.position=null!=e?e:this._startPositionCartesian,null==this._viewshedDirection||isNaN(this._viewshedDirection.x)||isNaN(this._viewshedDirection.y)||(i.direction=this._viewshedDirection.clone(),i.up=ci.scene.globe.ellipsoid.geodeticSurfaceNormal(i.position,ei)),i.frustum.isViewshed=!0,i.frustum.fov=Cesium.defaultValue(this._currentObject.viewshedObjOptions.fov,Xt),i.frustum._fovy=Cesium.defaultValue(this._currentObject.viewshedObjOptions.fovy,Kt),i.frustum.aspectRatio=Math.tan(i.frustum.fov/2)/Math.tan(i.frustum._fovy/2),i.frustum.near=1,!(this._currentRadius<=1)&&(i.frustum.far=Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),this._viewshedPrimitive=ci.scene.primitives.add(new Cesium.DebugCameraPrimitive({camera:t||i,color:this._primitiveColor})),this._viewshedPrimitive._numFrustrums=0,this._viewshedPrimitive._outlineOnlyFrustum=!0,this._viewshedPrimitive.update=this.updateViewshedPrimitive,this._viewshedPrimitive)},fi.prototype.createViewshedMap=function(){null==ci.scene.viewsheds&&ci.scene.viewsheds,null!=this._viewshedPrimitive._camera&&this._canEnlarge&&(null==this._viewshedMap?(this._viewshedMap=new Cesium.ShadowMap({context:ci.scene.context,lightCamera:this._viewshedPrimitive._camera,enabled:1,isSpotLight:!0,fromLightSource:!0,softShadows:!1,isPointLight:this._isSpherical,pointLightRadius:Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius)}),this._viewshedMap.show=!0,this._viewshedMap.isPreviewMode=!0,this._viewshedMap.guid="SamplerViewshed",this._viewshedMap):(this._viewshedMap._lightCamera.direction=this._viewshedPrimitive._camera.direction,this._viewshedMap._lightCamera.frustum.far=Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius)))},fi.prototype.updateViewshedPrimitive=function(e){if(this.show){if(this._updateOnChange&&(this._outlinePrimitive=this._outlinePrimitive&&this._outlinePrimitive.destroy()),!Cesium.defined(this._outlinePrimitive)){var t=this._camera,i=t.frustum,o=e.frustumSplits,r=o.length-1;(r=this._numFrustrums)<=0&&((o=gi)[0]=this._camera.frustum.near,o[1]=this._camera.frustum.far,r=1);var n,a,s=this._camera.viewMatrix;Cesium.defined(t.frustum.fovy)?(p=this._camera.frustum.projectionMatrix,p=Cesium.Matrix4.multiply(p,s,oi),a=Cesium.Matrix4.inverse(p,oi)):n=Cesium.Matrix4.inverseTransformation(s,oi);for(var l=new Float64Array(12*(r+1)+3),u=0;u<r+1;++u)for(var c=0;c<4;++c){var h,m,d=Cesium.Cartesian4.clone(ri[c],fi[c]);Cesium.defined(a)?(m=1/(d=Cesium.Matrix4.multiplyByVector(a,d,d)).w,Cesium.Cartesian3.multiplyByScalar(d,m,d),Cesium.Cartesian3.subtract(d,this._camera.positionWC,d),Cesium.Cartesian3.normalize(d,d),m=Cesium.Cartesian3.dot(this._camera.directionWC,d),Cesium.Cartesian3.multiplyByScalar(d,o[u]/m,d),Cesium.Cartesian3.add(d,this._camera.positionWC,d)):(Cesium.defined(i._offCenterFrustum)&&(i=i._offCenterFrustum),m=u===r?(h=o[u-1],o[u]):(h=o[u],o[u+1]),d.x=.5*(d.x*(i.right-i.left)+i.left+i.right),d.y=.5*(d.y*(i.top-i.bottom)+i.bottom+i.top),d.z=.5*(d.z*(h-m)-h-m),d.w=1,Cesium.Matrix4.multiplyByVector(n,d,d)),l[12*u+3*c]=d.x,l[12*u+3*c+1]=d.y,l[12*u+3*c+2]=d.z}l[12*r+12]=this._camera.positionWC.x,l[12*r+12+1]=this._camera.positionWC.y,l[12*r+12+2]=this._camera.positionWC.z;var p=new Cesium.BoundingSphere.fromVertices(l),s=new Cesium.GeometryAttributes;s.position=new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l});var g,_,f=new Uint16Array(8*(2*r+1+1));for(u=0;u<r+1;++u)f[g=8*u]=_=4*u,f[g+1]=_+1,f[g+2]=_+1,f[g+3]=_+2,f[g+4]=_+2,f[g+5]=_+3,f[g+6]=_+3,f[g+7]=_;for(u=0;u<r;++u)f[g=8*(r+1+u)]=_=4*u,f[g+1]=_+4,f[g+2]=_+1,f[g+3]=_+5,f[g+4]=_+2,f[g+5]=_+6,f[g+6]=_+3,f[g+7]=_+7;f[g+=8]=_+8,f[g+1]=_+1,f[g+2]=_+8,f[g+3]=_+2,f[g+4]=_+8,f[g+5]=_+3,f[g+6]=_+8,f[g+7]=_+4,this._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:{attributes:s,indices:f,primitiveType:Cesium.PrimitiveType.LINES,boundingSphere:p},attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}this._outlinePrimitive.isViewshedPart=!0,this._outlinePrimitive.update(e)}},fi.prototype.getHorizonDistance=function(e){return Math.sqrt(Math.pow($t+e,2)-Math.pow($t,2))},fi.prototype.onPreFrame=function(e){var t,i,o,r;null!=this._currentObject&&null!=this._currentObject.viewshedPrimitive&&null!=this._currentObject.viewshedMap&&(t=new Cesium.Cartographic.fromCartesian(this._currentObject.viewshedPrimitive._camera.position),i=this.getHorizonDistance(t.height),this._currentObject.viewshedMap.horizonCullingDistanceFromViewshed=i,i=ci.scene.globe.getHeight(t),this._currentObject.viewshedMap.isBelowGround=t.height<i+.5),null!=this._currentObject&&this._currentObject.viewshedMap,null!=this._newPosition&&this.toPreviewMode(this._currentObject),this._canEnlarge&&null!=this._currentRadius&&this._prevRadius!=this._currentRadius?(this._prevRadius=this._currentRadius,(this._isSpherical?this.createViewshedSpherePrimitive():this.createViewshedCameraPrimitive())&&this.createViewshedMap()):null!=this._currentObject&&this._setNewPosition&&null!=this._mousePositionX&&null!=this._mousePositionY&&(this.getPosXAndY(),this._currentObject.viewshedObjOptions.isSpherical?(this._currentObject.viewshedMap._lightCamera.position=this._newPosition,this._currentObject.viewshedPrimitive=this.createViewshedSpherePrimitive(this._newPosition,this._currentObject.distance)):(this.checkIfMouseOnPosition(),null!=this._newPosition&&(this._currentObject.viewshedObjOptions.altitudeMethod==Zt.ABOVE_GROUND_LEVEL&&null==this._zAxisNewPosition?(o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),r=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,ci.scene.globe.getHeight(o)+this._currentObject.startingAltitudeAboveGround),this._currentObject.viewshedPrimitive._camera.position=r):this._currentObject.viewshedObjOptions.altitudeMethod==Zt.ABOVE_MODEL&&null==this._zAxisNewPosition?(o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),r=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,o.height+this._currentObject.startingAltitudeAboveModel),this._currentObject.viewshedPrimitive._camera.position=r):this._currentObject.viewshedPrimitive._camera.position=this._newPosition,this.adjustDirections())))},fi.prototype.onPreFrameMobile=function(e){var t,i,o,r;null!=this._currentObject&&null!=this._currentObject.viewshedPrimitive&&null!=this._currentObject.viewshedMap&&(t=new Cesium.Cartographic.fromCartesian(this._currentObject.viewshedPrimitive._camera.position),i=this.getHorizonDistance(t.height),this._currentObject.viewshedMap.horizonCullingDistanceFromViewshed=i,i=ci.scene.globe.getHeight(t),this._currentObject.viewshedMap.isBelowGround=t.height<i+.5),null!=this._currentObject&&this._currentObject.viewshedMap,null!=this._newPosition&&this.toPreviewMode(this._currentObject),this._canEnlarge&&null!=this._currentRadius?(this._prevRadius=this._currentRadius,(this._isSpherical?this.createViewshedSpherePrimitive():this.createViewshedCameraPrimitive())&&this.createViewshedMap()):null!=this._currentObject&&this._setNewPosition&&null!=this._mousePositionX&&null!=this._mousePositionY&&(this.getPosXAndY(),this._currentObject.viewshedObjOptions.isSpherical?(this._currentObject.viewshedMap._lightCamera.position=this._newPosition,this._currentObject.viewshedPrimitive=this.createViewshedSpherePrimitive(this._newPosition,this._currentObject.distance)):(this.checkIfMouseOnPosition(),null!=this._newPosition&&(this._currentObject.viewshedObjOptions.altitudeMethod==Zt.ABOVE_GROUND_LEVEL&&null==this._zAxisNewPosition?(o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),r=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,ci.scene.globe.getHeight(o)+this._currentObject.startingAltitudeAboveGround),this._currentObject.viewshedPrimitive._camera.position=r):this._currentObject.viewshedObjOptions.altitudeMethod==Zt.ABOVE_MODEL&&null==this._zAxisNewPosition?(o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),r=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,o.height+this._currentObject.startingAltitudeAboveModel),this._currentObject.viewshedPrimitive._camera.position=r):this._currentObject.viewshedPrimitive._camera.position=this._newPosition,this.adjustDirections())))},yi.prototype.createSkylineAnalysis=function(e="#ff0000"){this.clear();var t=Cesium.Color.fromCssColorString(e);let i=Viewer.scene.postProcessStages;var o=Cesium.PostProcessStageLibrary.createEdgeDetectionStage(),e=new Cesium.PostProcessStage({name:"czm_skylinetemp",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D depthTexture;varying vec2 v_textureCoordinates;void main(void){float depth = czm_readDepth(depthTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(depth<1.0 - 0.000001){gl_FragColor = color;}else{gl_FragColor = vec4(1.0,0.0,0.0,1.0);}}"}),t=new Cesium.PostProcessStage({name:"czm_skylinetemp1",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform sampler2D silhouetteTexture;uniform vec4 skylineColor;varying vec2 v_textureCoordinates;void main(void){vec4 redcolor=texture2D(redTexture, v_textureCoordinates);vec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(redcolor.r == 1.0){gl_FragColor = mix(color, skylineColor, silhouetteColor.a);}else{gl_FragColor = color;}}",uniforms:{redTexture:e.name,silhouetteTexture:o.name,skylineColor:t,length:.25}});this.postProccessStage=new Cesium.PostProcessStageComposite({name:"czm_skyline",stages:[o,e,t],inputPreviousStageTexture:!1,uniforms:o.uniforms}),i.add(this.postProccessStage)},yi.prototype.clear=function(){this.postProccessStage&&this._viewer.scene.postProcessStages.remove(this.postProccessStage)};const Ci=`
vec3 packNormalToRGB( const in vec3 normal ) {
    return normalize( normal ) * 0.5 + 0.5;
}
 
vec3 unpackRGBToNormal( const in vec3 rgb ) {
    return 2.0 * rgb.xyz - 1.0;
}
 
const float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)
const float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)
 
const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
 
const float ShiftRight8 = 1. / 256.;
 
vec4 packDepthToRGBA( const in float v ) {
    vec4 r = vec4( fract( v * PackFactors ), v );
    r.yzw -= r.xyz * ShiftRight8; // tidy overflow
    return r * PackUpscale;
}
 
float unpackRGBAToDepth( const in vec4 v ) {
    return dot( v, UnpackFactors );
}
 
vec4 pack2HalfToRGBA( vec2 v ) {
    vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));
    return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);
}
vec2 unpackRGBATo2Half( vec4 v ) {
    return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
}
 
// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions
 
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
    return ( viewZ + near ) / ( near - far );
}
float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {
    return linearClipZ * ( near - far ) - near;
}
 
// NOTE: https://twitter.com/gonnavis/status/1377183786949959682
 
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
    return (( near + viewZ ) * far ) / (( far - near ) * viewZ );
}
float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {
    return ( near * far ) / ( ( far - near ) * invClipZ - far );
}
`,wi="uniform sampler2D czm_selectedIdTexture; \nuniform float czm_selectedIdTextureStep; \nuniform float czm_selectedIdTextureWidth; \nbool czm_selected(vec4 id) \n{ \n    bool selected = false;\n    for (int i = 0; i < 1024000; i++) \n    { \n        vec4 selectedId = texture2D(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); \n        if (all(equal(id, selectedId))) \n        { \n            return true; \n        } \n       if(float(i)>czm_selectedIdTextureWidth)break;\n    } \n    return false; \n} \n\n";function bi(e){const{defaultValue:r,BoundingRectangle:i,Pass:u,Sampler:n,DrawCommand:c,Color:h,ShaderSource:v,defined:C,ClearCommand:t,RenderState:m,Texture:d,PixelDatatype:a,PixelFormat:s,Framebuffer:l}=Cesium;this._selectedIdTexture=null;let{name:o,vertexShader:w,fragmentShader:b,uniforms:p,renderStateProcess:g,beforeUpdate:_,renderType:f,textureScale:y,pixelFormat:T,pixelDatatype:S,sampler:P,viewportScale:E,shaderRedefine:x,overrideViewport:I}=e,D="renderPass_"+o.replace(/[\.\\\/\-]/g,"_"),L=`czm_non_${D}_main`,M=`czm_${D}_main`,A=`_cache_${D}`,R=D+"Command",O=null,H=null,V=null,k=null,F,G=new t({color:h.TRANSPARENT,depth:1}),N=new i,B=this;if(I&&i.clone(I,N),x=x||"add",f=f||"all",y=y||1,y<0||8<y)throw new Cesium.DeveloperError("CesiumRenderPass:textureScale必须大于0小于等于8");function j(t,i,o,r){var n=t.shaderCache.getDerivedShaderProgram(i,D);if(!C(n)){var a=i._attributeLocations,s=i.fragmentShaderSource,l=i.vertexShaderSource,u=i._vertexShaderText,c=(y=s.sources).length;let e=!!k&&function(){if(k){var e=k.selected||k.parentSelected;if(e.length)return e}}();var h=wi,m=/texture2D\s?\(\s?tile_pickTexture\s?,\s?tile_featureSt\s?\)/.test(o);h+="varying"!=r||m?`
bool czm_selected(){ 
    return czm_selected(${o}); 
}`:`
varying float me_isSelected;
bool czm_selected(){
    bool isSelected= me_isSelected>0.0000001;
    if(!isSelected){
        isSelected= czm_selected(${o});
    }
    return isSelected;
}
    `;var d=wi+`
varying float me_isSelected;
bool czm_selected(){
    return czm_selected(${o});
}
`,p=!1,o=!1;if(/attribute\s?vec3\s?normal\s?;/.test(u)||/\n\s?vec3\s?normal\s?;/.test(u)?p=!0:/varying\s?vec3\s?v_normal\s?;/.test(u)&&(o=!0),b){var g=!1;for(f=0;f<c;++f)if(/vec4\s?packDepthToRGBA\s?\(/.test(y[f])){g=!0;break}for(var h=(g?"":Ci)+(e?h:"")+v.replaceMain(b,M)+"void main() \n{ \n"+("replace"!=x?`    ${L}(); \n`:"")+`    ${M}(); \n`+"} \n",_=new Array(c+1),f=0;f<c;++f)_[f]=v.replaceMain(y[f],L);_[c]=h,p?s.defines.push("HAS_NORMAL"):o&&s.defines.push("HAS_V_NORMAL"),s=new v({sources:_,defines:s.defines})}if(w||b){var y,c=(y=l.sources).length,g=!1;for(f=0;f<c;++f)if(/vec4\s?packDepthToRGBA\s?\(/.test(y[f])){g=!0;break}e=e&&"varying"==r&&!m,p?l.defines.push("HAS_NORMAL"):o&&l.defines.push("HAS_V_NORMAL");for(d=(g?"":Ci)+(e?d:"")+v.replaceMain(w||"void main(){}",M)+"void main() \n{ \n"+("replace"!=x?`    ${L}(); \n`:"")+(e?"    me_isSelected=czm_selected()?1.:0.;\n":"")+`    ${M}(); \n`+"} \n",_=new Array(c+1),f=0;f<c;++f)_[f]=v.replaceMain(y[f],L);_[c]=d,l=new v({sources:_,defines:l.defines})}n=t.shaderCache.createDerivedShaderProgram(i,D,{vertexShaderSource:l,fragmentShaderSource:s,attributeLocations:a})}return n}function z(t,i,o){let r=t;var n,a,s=i._frameState,l=t.derivedCommands;if(C(l)){let e=(l=(t=s.useLogDepth&&C(l.logDepth)?l.logDepth.command:t).derivedCommands).renderPass;C(l.renderPass)||(e=l.renderPass={}),C(e[R])&&(n=e[R].shaderProgram,a=e[R].renderState),e[R]=c.shallowClone(t,e[R]),C(n)&&e.shaderProgramId===t.shaderProgram.id?(e[R].shaderProgram=n,e[R].renderState=a):(n=t.shaderProgram,a=r._pickIdQualifier=new RegExp(`uniform\\s?vec4\\s?${t.pickId}`,"g").test(n._fragmentShaderText)?"uniform":"varying",e[R].shaderProgram=j(o,n,t.pickId,a),e[R].renderState=function(e,t){e._renderPassCache=e._renderPassCache||{},e._renderPassCache[A]=e._renderPassCache[A]||{};var i=e._renderPassCache[A],o=i[t.id];return C(o)||(e=m.getState(t),"function"==typeof g&&g.call(B,e),o=m.fromCache(e),i[t.id]=o),o}(i,t.renderState),e.shaderProgramId=t.shaderProgram.id),function(e){if(!e.__created&&(e.czm_selectedIdTexture=function(){return k._selectedIdTexture},e.czm_selectedIdTextureWidth=function(){return k._selectedIdTexture?k._selectedIdTexture.width:0},e.czm_selectedIdTextureStep=function(){return k._selectedIdTexture?1/k._selectedIdTexture.width:-1},p))for(var t in e.__created=!0,p){var i;p.hasOwnProperty(t)&&("function"!=typeof p[t]?e[t]=function(t){return function(){var e=p[t];return"function"==typeof e?e():e}}(t):e[t]=p[t],("string"==typeof(i=e[t]())||i instanceof d||i instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement)&&(e[t+"Dimensions"]=function(t,i){return function(){var e=t[i]();if(C(e))return e.dimensions}}(e,t)))}}(e[R].uniformMap)}}function U(e,t,i){var o=t.width,t=t.height;H&&H.width===o&&H.height===t&&i===F||(F=i,H&&(H.destroy(),O.destroy(),O=void 0,H=void 0),V&&(V.destroy(),V=void 0),H=new d({context:e,width:o,height:t,pixelFormat:r(T,s.RGBA),pixelDatatype:r(S,a.FLOAT),sampler:r(P,n.NEAREST)}),V=new d({context:e,width:o,height:t,pixelFormat:s.DEPTH_COMPONENT,pixelDatatype:a.UNSIGNED_SHORT,sampler:n.NEAREST}),O=new l({colorTextures:[H],context:e,destroyAttachments:!1,depthTexture:V}))}function W(e){I||(N=i.clone(e.viewport,N),E?(N.x=N.width*E.x,N.y=N.height*E.y,N.width*=E.width,N.height*=E.height):(N.width*=y,N.height*=y));let t=Object.assign({},e.passState);return t.viewport=N,t}function Y(e,t){var i,o,r=e._us._frameState.camera._scene,n=r._view;try{w||b?(i=W(n),"function"==typeof _&&_.call(B,r,t),U(e,N,r.hdr,n.sceneFramebuffer),function(e){for(var t,i=e._view.frustumCommandsList,o=i.length,r=0;r<o;++r)for(var n=i[o-r-1],a=0;a<n.commands.length;a++){var s=n.commands[a],l=n.indices[a];if(!k||a!=u.GLOBE)for(t=0;t<l;++t)z(s[t],e,e._context)}}(r),vi(e,O,i,"renderPass",R,"all"!=f&&k&&k._selectedIdTexture?q:null)):(o=W(n),"function"==typeof _&&_.call(B,r,t),U(e,N,r.hdr,n.sceneFramebuffer),vi(e,O,o))}catch(e){console.error(e)}}function q(e,t){var i=k&&(k.selected||k.parentSelected);if(!k||!i||!i.length)return!1;if(!e.pickId||"uniform"!=e._pickIdQualifier)return!0;let o=!0,r=e.owner;var n="selected"==f;if(r&&r.isObject3D){for(let e=0;e<i.length;e++)if(i[e]==r)return n;return!n}let a=e.uniformMap;if(a[e.pickId]){var s=a[e.pickId]();o=!n;for(let e=0;e<i.length;e++){var l=i[e],u=l.pickId?[l.pickId]:l.pickIds||l._pickIds;for(let e=0;e<u.length;e++){var c=u[e];if(c.color==s||h.equals(c.color,s))return n}}}return o}function Q(e){var t;O&&(t=e._us._frameState.camera._scene._view,G.framebuffer=O,G.execute(e,t.passState),G.framebuffer=void 0)}this.update=Y,this.clear=Q,Object.defineProperties(this,{texture:{get(){return H}},depthTexture:{get(){return V}},stage:{get(){return k},set(e){k!=e&&function(e){if(k&&B.prevStageUpdate&&(k.update=B.prevStageUpdate,B.prevStageUpdate=null,B.prevStageExecute=null),k=e,k){let o=k.update;B.prevStageUpdate=o,k.update=function(e,t){var i;Q(e),o.call(k,e,t),k.enabled&&(!w&&!b||(i=k.selected||k.parentSelected)&&i.length)&&Y(e,t)}}}(e)}}})}function Ti(e){this._viewer=e,this._core=new V}function Si(e,t){this._viewer=e,this._cesium=t,this._scene=e.scene,this._core=new V,this._getPosition=new Ee(e,t),this.num=100,this.buffs=[],this.tooltip=this._core.CreateTooltip()}function Pi(e,t){this._viewer=e,this._cesium=t,this._scene=e.scene,this._core=new V,this.tooltip=this._core.CreateTooltip(),this._getPosition=new Ee(e,t),this.FlattenIsDraw=!1,this.wallArr=[],this.heightsort=[],this.FlattenPolygon=[],this.showWall=!0,this.deepth=100,this.bottomImg=window.SmartEarthRootUrl+D.bottomplane,this.wallImg=window.SmartEarthRootUrl+D.wall}function Ei(e,t){this._viewer=e,this._cesium=t,this._scene=e.scene,this._core=new V,this.currentSpeed="1x",this.currentTime=null,this.currentPlayMode="1",this.timer=null}function xi(e,t){this._viewer=e,this._cesium=t}function Ii(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._getPosition=new Ee(e,t)}function Di(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we,this._getPosition=new Ee(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip(),this.sunshineOption={},this.loadingImg=window.SmartEarthRootUrl+D.loading}function Li(e){this._viewer=e,this._cesium=Cesium,this._core=new V,this._tree=we,this._color=new G(this._viewer,this._cesium),this.modelEditData={lon:0,lat:0,height:0,scale:1,r_x:0,r_y:0,r_z:0,rotate:!1,rootTransform:void 0}}function Mi(e){this._viewer=e}function Ai(e,t){this._viewer=e,this._cesium=t,this._measureTerrainPerimeter=new m(this._viewer,this._cesium),this._measureTerrainHeight=new y(this._viewer,this._cesium),this._measureTerrainArea=new b(this._viewer,this._cesium),this._measureTerrainkPerimeter=new T(this._viewer,this._cesium),this._elevationContour=new N(this._viewer,this._cesium),this._createTerrainProfile=new B(this._viewer,this._cesium),this._createterrainExaggeration=new Et(this._viewer,this._cesium),this._createcurtaincontrast=new xt(this._viewer,this._cesium),this._createindoormode=new At(this._viewer,this._cesium),this._createWeather=new Wt(this._viewer,this._cesium),this._UndergroundMode=new qt(this._viewer,this._cesium),this._StreetView=new Jt(this._viewer,this._cesium),this._depthTestAgainstTerrain=new ui(this._viewer,this._cesium),this._create3DViewshed=new fi(this._viewer,this._cesium),this._skylineAnalysis=new yi(this._viewer,this._cesium),this._EdgeStage=new Ti(this._viewer,this._cesium),this._bufferAnalysis=new Si(this._viewer,this._cesium),this._shadowsAnalysis=new Ei(this._viewer,this._cesium),this._screenshot=new xi(this._viewer,this._cesium),this._PointFly=new Ii(this._viewer,this._cesium),this._SunshineAnalysis=new Di(this._viewer,this._cesium)}function Ri(e,t){this._viewer=e,this._cesium=t}function Oi(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we}function Hi(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we,this._points=[],this._xjwz=null,this._polygonsd=[],this._rectangle=null}function Vi(e,t){this._viewer=e,this._cesium=t,this._Color=new G(this._viewer,this._cesium),this._core=new V,this._getPosition=new Ee(this._viewer,this._cesium),this._tree=we,this._points=[],this._polylines=[]}function ki(e,t){this._viewer=e,this._cesium=t,this._Color=new G(this._viewer,this._cesium),this._core=new V,this._getPosition=new Ee(this._viewer,this._cesium),this._tree=we,this._points=[],this._lable=null,this._entity=null,this.polygon1,this.id="0",this.curCanvas="a"}function Fi(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we}function Gi(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we}function Ni(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we,this._viewEvent=null,this.positions=[],this._getPosition=new Ee(this._viewer,this._cesium),this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.style=null,this.state=0,this.gonRectangleArr=[]}function Bi(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._getPosition=new Ee(this._viewer,this._cesium),this._tree=we,this._postion={Altitude:0,AltitudeType:0,Cartesian:!0,Distance:0,Pitch:0,Roll:0,X:0,Y:0,Yaw:0},this.positions=[],this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.style=null,this.state=0,this.gonCircleArr=[],this.radius=0}function ji(e,t){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this._viewer=e,this._cesium=t,this._core=new V,this._getPosition=new Ee(this._viewer,this._cesium),this._tree=we,this.modifyPoint=null,this._color=new G(this._viewer,this._cesium),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._position=void 0,this._points=[],this._listeners={},this._point=null}function zi(e,t){this._viewer=e,this._cesium=t,this._tree=we,this._core=new V,this._Color=new G(this._viewer,this._cesium),this._postion={Altitude:0,AltitudeType:0,Cartesian:!0,Distance:0,Pitch:0,Roll:0,X:0,Y:0,Yaw:0}}function Ui(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._getPosition=new Ee(this._viewer,this._cesium),this._tree=we,this._entityFly=null}Ti.prototype.createEdgeStage=function(e={}){this.clear();var t="OutlineEffect";const{PostProcessStage:i,PostProcessStageComposite:o,Sampler:r,TextureMagnificationFilter:n,TextureMinificationFilter:a}=Cesium;let s=this._core.defaultValue(e.width,2),l=this._core.defaultValue(e.thresholdAngle,10)*Math.PI/180,u=!1,c=!1,h=Cesium.Color.fromCssColorString(e.visibleColor||"#00a8e0"),m=Cesium.Color.fromCssColorString(e.hiddenColor||"#4d4d4d"),d=this._core.defaultValue(e.showGlow,!0),p=this._core.defaultValue(e.edgeGlow,1),g=3,_=!1,f=new bi({name:t+"Pass",vertexShader:`
        varying vec3 vOutlineNormal;
        void main(){
            #ifdef HAS_NORMAL
                vOutlineNormal = normal;
            #else
                #ifdef HAS_V_NORMAL
                    vOutlineNormal = v_normal;
                #else
                    vOutlineNormal=vec3(0.);
                #endif
            #endif
        }
        `,fragmentShader:`
        varying vec3 vOutlineNormal;
        void main(){
        //    if(!czm_selected())discard; 
            if(length(vOutlineNormal)>0.)gl_FragColor=vec4( vOutlineNormal ,gl_FragColor.a); 
        }
        `,sampler:new r({minificationFilter:a.LINEAR,magnificationFilter:n.LINEAR}),renderType:"all"});var y=new i({name:t+"Mask",uniforms:{outlineWidth(){return s},devicePixelRatio:devicePixelRatio,thresholdAngle:function(){return l},useSingleColor:function(){return u},showOutlineOnly:function(){return c},visibleEdgeColor:function(){return h},hiddenEdgeColor:function(){return m},maskTexture(){return f.texture},maskDepthTexture(){return f.depthTexture}},fragmentShader:`
        uniform sampler2D colorTexture;
        uniform vec2 colorTextureDimensions;
        uniform sampler2D depthTexture;
 
        uniform sampler2D maskTexture;
        uniform sampler2D maskDepthTexture;
        uniform float thresholdAngle;
        uniform bool showOutlineOnly;
         
        uniform float outlineWidth;
        uniform float devicePixelRatio;
        uniform vec3 visibleEdgeColor;
        uniform vec3 hiddenEdgeColor;
        uniform bool useSingleColor;
 
        varying vec2 v_textureCoordinates;
  
        float lengthSq(vec3 v){
            return v.x * v.x + v.y * v.y + v.z * v.z;
        }
        float normal_angleTo(vec3 a,vec3 b){
            float denominator =  sqrt(  lengthSq(a) * lengthSq(b) );
            if ( denominator == 0. ) return czm_pi / 2.;
            float theta = dot(a, b ) / denominator;
            // clamp, to handle numerical problems
            return  acos(  clamp( theta, - 1., 1. ) );
        }
 
        float compareNormal(vec4 n1,vec4 n2){
              if(  abs (  normal_angleTo( n1.xyz , n2.xyz ) ) < thresholdAngle ){
                  return 0.;
              }else{
                  return 1.;
              }
        }
 
        float compareDepth(const in vec2 uv){
            float maskDepth = czm_readDepth( maskDepthTexture, uv);
            float nonDepth = czm_readDepth( depthTexture, uv);
            return maskDepth>nonDepth?1.:0.;
        }
 
        void main(){
 
            vec2 vUv=v_textureCoordinates;
 
            // vec4 color = texture2D( colorTexture, vUv); 
            vec4 maskColor = texture2D( maskTexture, vUv);
             
            if( maskColor.a < 0.0001){
                // gl_FragColor =color;
                discard;
                return;
            }
 
            vec2 invSize = outlineWidth / colorTextureDimensions;
            vec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);
 
            vec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);
            vec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);
            vec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);
            vec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);
            
            float d;
            if(showOutlineOnly){
                float diff1 = (c1.a - c2.a)*0.5;
                float diff2 = (c3.a - c4.a)*0.5;
                d = length( vec2(diff1, diff2) );
            }
            else{ 
                float diff1 = compareNormal(c1,c2)*0.5;
                float diff2 = compareNormal(c3,c4)*0.5;
                d = length( vec2(diff1, diff2) );
            }
                    
            if(useSingleColor==false){
                float dp1 = compareDepth( vUv + uvOffset.xy);
                float dp2 = compareDepth( vUv - uvOffset.xy);
                float dp3 = compareDepth( vUv + uvOffset.yw);
                float dp4 = compareDepth( vUv - uvOffset.yw);
            
                float a1 = min(dp1, dp2);
                float a2 = min(dp3, dp4);
                float visibilityFactor = min(a1, a2);
                vec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;
            
                // gl_FragColor =color+ vec4( edgeColor , 1. ) * vec4(d);
                 gl_FragColor = vec4( edgeColor , 1. ) * vec4(d);
                 //gl_FragColor = vec4( 0.06, 0.9, 1.0 , 1. ) * vec4(d);
            }else{
                // gl_FragColor =color+ vec4( visibleEdgeColor , 1. ) * vec4(d);
                 gl_FragColor =  vec4( visibleEdgeColor , 1. ) * vec4(d);
                 //gl_FragColor =  vec4(  0.06, 0.9, 1.0 , 1. ) * vec4(d);
            }
        }
        `});f.stage=y;var v=this.createBlurStage(t+"Blur1",4,1,.75),e=this.createBlurStage(t+"Blur2",4,4,.5),e=new o({name:t+"BlurComposite",stages:[y,v,e],inputPreviousStageTexture:!0}),v=new i({name:t+"Additive",uniforms:{showGlow:function(){return d},edgeGlow:function(){return p},edgeStrength:function(){return g},edgeOnly(){return _},maskTexture(){return f.texture},lineTexture:y.name,edgeTexture1:v.name,edgeTexture2:e.name},fragmentShader:`
        uniform sampler2D colorTexture;
        uniform sampler2D edgeTexture1;
        uniform sampler2D edgeTexture2;
        uniform sampler2D lineTexture;
        uniform sampler2D maskTexture;
        uniform bool showGlow;
        uniform float edgeGlow;
        uniform bool edgeOnly;
        uniform float edgeStrength;
 
        varying vec2 v_textureCoordinates;
        void main(){
            
            vec2 vUv =v_textureCoordinates;
            vec4 edgeColor=texture2D( lineTexture, vUv);
            vec4 color=texture2D( colorTexture, vUv);
            float opacity=1.;
            if(edgeOnly){
                vec4 maskColor=texture2D( maskTexture, vUv);
                opacity=1.-maskColor.a;
                gl_FragColor = maskColor;
                return;
            }
  
            if(showGlow){
                float visFactor= 1.;//czm_selected()?1.:0.;
                vec4 edgeValue1 = texture2D(edgeTexture1, vUv);
                vec4 edgeValue2 = texture2D(edgeTexture2, vUv);
                vec4 glowColor = edgeValue1 + edgeValue2 * edgeGlow;
                gl_FragColor = opacity * color + edgeColor + edgeStrength * (1. - edgeColor.r) * glowColor;
            }
            else{
                gl_FragColor = opacity * color + edgeColor;
            }
        }
        `});const C=new o({name:t+"Composite",stages:[e,v],inputPreviousStageTexture:!1});function w(e){Object.defineProperties(e,{showGlow:{get(){return d},set(e){d=e}},edgeGlow:{get(){return p},set(e){p=e}},edgeStrength:{get(){return g},set(e){g=e}},thresholdAngle:{get(){return l},set(e){l=e}},showOutlineOnly:{get(){return c},set(e){c=e}},edgeOnly:{get(){return _},set(e){_=e}},useSingleColor:{get(){return u},set(e){u=e}},outlineWidth:{get(){return s},set(e){s=e}},visibleEdgeColor:{get(){return h},set(e){h=e}},hiddenEdgeColor:{get(){return m},set(e){m=e}}})}return w(C),C._uniforms=C._uniforms||{},w(C._uniforms),C.selected=[1],C.enabled=!0,this._viewer.postProcessStages.add(C),this.postProccessStage=C,this},Ti.prototype.createBlurStage=function(e,t,i,o){const{Cartesian2:r,PostProcessStage:n,PostProcessStageComposite:a,PostProcessStageSampleMode:s}=Cesium;var l=new r(1,0),u=new r(0,1),t={defines:{MAX_RADIUS:t},fragmentShader:"\n    varying vec2 v_textureCoordinates;\n    uniform sampler2D colorTexture;\n    uniform vec2 colorTextureDimensions;\n    uniform vec2 direction;\n    uniform float kernelRadius;\n    \n    float gaussianPdf(in float x, in float sigma) {\n        return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n    }\n    void main() {        vec2 vUv=v_textureCoordinates;\n        vec2 invSize = 1.0 / colorTextureDimensions;        float weightSum = gaussianPdf(0.0, kernelRadius);        vec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;        vec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);        vec2 uvOffset = delta;        for( int i = 1; i <= MAX_RADIUS; i ++ ) {            float w = gaussianPdf(uvOffset.x, kernelRadius);            vec4 sample1 = texture2D( colorTexture, vUv + uvOffset);            vec4 sample2 = texture2D( colorTexture, vUv - uvOffset);            diffuseSum += ((sample1 + sample2) * w);            weightSum += (2.0 * w);            uvOffset += delta;        }        gl_FragColor = diffuseSum/weightSum;    }"};this.parseDefines(t);l=new n({name:e+"_x_direction",fragmentShader:t.fragmentShader,textureScale:o,forcePowerOfTwo:!0,uniforms:{kernelRadius:i,direction:l},sampleMode:s.LINEAR}),u=new n({name:e+"_y_direction",fragmentShader:t.fragmentShader,textureScale:o,forcePowerOfTwo:!0,uniforms:{kernelRadius:i,direction:u},sampleMode:s.LINEAR});return new a({name:e,stages:[l,u],inputPreviousStageTexture:!0})},Ti.prototype.parseDefines=function(e){let t=[];for(const o in e.defines){var i;e.defines.hasOwnProperty(o)&&(i=e.defines[o],t.push("#define "+o+" "+i))}return t=t.join("\n")+"\n",e.fragmentShader&&(e.fragmentShader=t+e.fragmentShader),e.vertexShader&&(e.vertexShader=t+e.vertexShader),e},Ti.prototype.clear=function(){this.postProccessStage&&this._viewer.scene.postProcessStages.remove(this.postProccessStage),this.postProccessStage=void 0},Si.prototype.changeBurr=function(e){if(this.num=e,this.this_buff)switch(this.type){case"point":this.setPointBuff(this.num);break;case"polyline":this.setPolylineBuff(this.num);break;case"polygon":this.setPolygonBuff(this.num)}},Si.prototype.DrawPoint=function(e,o){this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.this_buff&&this.this_buff.entity&&this._viewer.entities.remove(this.this_buff.entity);var r=this._viewer,n=this._cesium;let t,a;return"number"==typeof e?(t=e,a={}):"object"==typeof e&&(a=e,t=a.radius),this.num=t||this.num,this.drawHandler=new n.ScreenSpaceEventHandler(r.scene.canvas),this.this_buff={entity:null,buff:null},this.type="point",this.positions=[],this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this.drawHandler.setInputAction(function(e){var t,i=this._getPosition.getMouseDegrees(e);i&&(t=i.lon,e=i.lat,this.positions.push(t,e),this.this_buff.entity=r.entities.add({name:"新建缓冲点",position:n.Cartesian3.fromDegrees(t,e),point:{pixelSize:10,color:n.Color.YELLOW,outlineWidth:3,outlineColor:n.Color.YELLOW.withAlpha(.4),heightReference:1}}),this.buffs.push(this.this_buff.entity),this.this_buff.entity=void 0,this.setPointBuff(this.num,a),o&&"function"==typeof o&&o(i),this.end&&this.end())}.bind(this),n.ScreenSpaceEventType.LEFT_CLICK),this.end=()=>{this.tooltip.show(!1),this.drawHandler.destroy(),this._core.mouse(this._viewer.container,0),this.drawHandler=null,this.end=void 0},this.drawHandler.setInputAction(function(e){this.tooltip.showAt(e.endPosition,"点击绘制点")}.bind(this),n.ScreenSpaceEventType.MOUSE_MOVE),this},Si.prototype.setPointBuff=function(e,t){var i=Cesium_turf.point(this.positions),e=this.getBuff(i,e);this.this_buff.buff||(this.this_buff.buff=this.addBufferPolyogn(e,t),this.buffs.push(this.this_buff.buff))},Si.prototype.DrawPolyline=function(e,t){this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.this_buff&&this.this_buff.entity&&this._viewer.entities.remove(this.this_buff.entity);var i=this._viewer,o=this._cesium;let r,n;"number"==typeof e?(r=e,n={}):"object"==typeof e&&(n=e,r=n.radius),this.num=r||this.num;var a=0;return this.drawHandler=new o.ScreenSpaceEventHandler(i.scene.canvas),this.this_buff={entity:null,buff:null},this.type="polyline",this.positions=[],this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this.drawHandler.setInputAction(function(e){var t=this._getPosition.getMouseDegrees(e);t&&(e=t.lon,t=t.lat,this.positions.push(e,t),0===a&&(this.positions.push(e,t),this.this_buff.entity=i.entities.add({name:"新建缓冲线",polyline:{positions:o.Cartesian3.fromDegreesArray(this.positions),width:2,material:new o.ColorMaterialProperty(o.Color.YELLOW),clampToGround:!0,zIndex:1}}),this.this_buff.entity.polyline.positions=new o.CallbackProperty(function(){return o.Cartesian3.fromDegreesArray(this.positions)}.bind(this),!1)),a++)}.bind(this),o.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){this.end&&this.end()}.bind(this),o.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{if(this.tooltip.show(!1),this.drawHandler.destroy(),this._core.mouse(this._viewer.container,0),this.drawHandler=null,this.end=void 0,"cancel"===e)return i.entities.remove(this.this_buff.entity),void(this.this_buff=void 0);if(this.positions.length<=4)return window.layuiLayer&&window.layuiLayer.msg("当前点数小于两点,请重新绘制"),i.entities.remove(this.this_buff.entity),this.this_buff=void 0,void(t&&"function"==typeof t&&t(this));this.positions.pop(),this.positions.pop(),this.this_buff.entity.polyline.positions=o.Cartesian3.fromDegreesArray(this.positions),this.buffs.push(this.this_buff.entity),this.this_buff.entity=void 0,this.positions=this.degreesArrayToPoints(this.positions),this.setPolylineBuff(this.num,n),t&&"function"==typeof t&&t(this)},this.drawHandler.setInputAction(function(e){var t,i;0!==a?(1===a?this.tooltip.showAt(e.endPosition,"点击绘制折线"):this.tooltip.showAt(e.endPosition,"右击结束绘制"),(i=this._getPosition.getMouseDegrees(e))&&(t=i.lon,i=i.lat,this.positions.splice(this.positions.length-2,2),this.positions.push(t,i))):this.tooltip.showAt(e.endPosition,"点击开始绘制折线")}.bind(this),o.ScreenSpaceEventType.MOUSE_MOVE),this},Si.prototype.setPolylineBuff=function(e,t){var i=Cesium_turf.lineString(this.positions),e=this.getBuff(i,e);this.this_buff.buff||(this.this_buff.buff=this.addBufferPolyogn(e,t),this.buffs.push(this.this_buff.buff))},Si.prototype.DrawPolygon=function(e,t){this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.this_buff&&this.this_buff.entity&&this._viewer.entities.remove(this.this_buff.entity);var i=this._viewer,o=this._cesium;let r,n;"number"==typeof e?(r=e,n={}):"object"==typeof e&&(n=e,r=n.radius),this.num=r||this.num;var a=0;this.drawHandler=new o.ScreenSpaceEventHandler(i.scene.canvas),this.this_buff={entity:null,buff:null},this.type="polygon",this.positions=[];let s=this;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this.drawHandler.setInputAction(function(e){var t=this._getPosition.getMouseDegrees(e);t&&(e=t.lon,t=t.lat,this.positions.push(e,t),0===a?(this.positions.push(e,t),this.this_buff.entity=i.entities.add({name:"临时线",polyline:{positions:new o.CallbackProperty(function(){return o.Cartesian3.fromDegreesArray(s.positions)},!1),clampToGround:!0,material:new o.ColorMaterialProperty(o.Color.YELLOW.withAlpha(.5)),width:3}})):1===a&&(this.this_buff.entity&&i.entities.remove(this.this_buff.entity),this.this_buff.entity=i.entities.add({name:"新建缓冲面",polygon:{hierarchy:new o.PolygonHierarchy(o.Cartesian3.fromDegreesArray(this.positions)),material:new o.ColorMaterialProperty(o.Color.YELLOW.withAlpha(.5)),zIndex:1}}),this.this_buff.entity.polygon.hierarchy=new o.CallbackProperty(function(){return new o.PolygonHierarchy(o.Cartesian3.fromDegreesArray(this.positions))}.bind(this),!1)),a++)}.bind(this),o.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){this.end&&this.end()}.bind(this),o.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>(this.tooltip.show(!1),this.drawHandler.destroy(),this._core.mouse(this._viewer.container,0),this.drawHandler=null,this.end=void 0,"cancel"===e?(i.entities.remove(this.this_buff.entity),void(this.this_buff=void 0)):(this.positions.length<=6?(window.layuiLayer&&window.layuiLayer.msg("当前点数小于三点,请重新绘制"),i.entities.remove(this.this_buff.entity),this.this_buff=void 0):(this.positions.pop(),this.positions.pop(),this.this_buff.entity.polygon.hierarchy=o.Cartesian3.fromDegreesArray(this.positions),this.buffs.push(this.this_buff.entity),this.this_buff.entity=void 0,this.positions=this.degreesArrayToPoints(this.positions),this.positions.push(this.positions[0]),this.setPolygonBuff(this.num,n)),void(t&&"function"==typeof t&&t(this)))),this.drawHandler.setInputAction(function(e){var t,i;0!==a?(a<3?this.tooltip.showAt(e.endPosition,"点击绘制多边形"):this.tooltip.showAt(e.endPosition,"右击结束绘制"),(i=this._getPosition.getMouseDegrees(e))&&(t=i.lon,i=i.lat,this.positions.splice(this.positions.length-2,2),this.positions.push(t,i))):this.tooltip.showAt(e.endPosition,"点击开始绘制多边形")}.bind(this),o.ScreenSpaceEventType.MOUSE_MOVE),this},Si.prototype.setPolygonBuff=function(e,t){var i=Cesium_turf.polygon([this.positions]),e=this.getBuff(i,e);this.this_buff.buff||(this.this_buff.buff=this.addBufferPolyogn(e,t),this.buffs.push(this.this_buff.buff))},Si.prototype.getBuff=function(e,t,i={}){var o=Cesium_turf.buffer(e,t,{units:"meters",...i}).geometry.coordinates,r=this.pointsToDegreesArray(o[0]);let n={positions:Cesium.Cartesian3.fromDegreesArray(r)};if(1<o.length){n.holes=[];for(let e=1,t;e<o.length;e++)r=this.pointsToDegreesArray(o[e]),t=Cesium.Cartesian3.fromDegreesArray(r),n.holes.push(t)}return n},Si.prototype.pointsToDegreesArray=function(e){let t=[];return e.map(e=>{t.push(e[0]),t.push(e[1])}),t},Si.prototype.degreesArrayToPoints=function(t){let i=[];for(let e=0;e<t.length-1;e+=2)i.push([t[e],t[e+1]]);return i},Si.prototype.addBufferPolyogn=function(e,t={}){let i,o;return i=e.positions,e.holes&&(o=[],e.holes.forEach(e=>{o.push(new Cesium.PolygonHierarchy(e))})),this._viewer.entities.add({polygon:{hierarchy:new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(i,o)},!1),material:Cesium.Color.RED.withAlpha(.6),outline:!0,outlineColor:Cesium.Color.YELLOW,outlineWidth:10,zIndex:0,...t}})},Si.prototype.clearBuff=function(){var t=this._viewer;0<this.buffs.length&&(this.buffs.forEach(function(e){t.entities.remove(e)}),this.buffs.length=0)},Pi.prototype.draw=function(e=100,i={},o){if(!this.FlattenIsDraw){if(this.deepth=e||this.deepth,this.showWall=this._core.defaultValue(i.showWall,!0),i.positions)return this.create(i.positions),"function"==typeof o&&o(),this;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.FlattenIsDraw=!0;var r=this._viewer,n=this._cesium;this.clear();var a,s,l=[],u=[],c=0;this.drawHandler=new n.ScreenSpaceEventHandler(r.scene.canvas);var h=this.tooltip;let t;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this.drawHandler.setInputAction(e=>{s=this._getPosition.getMousePosition(e.position);e=this._core.toDegrees(s);l.push(s),u.push(e.lon,e.lat,e.height),0===c?(l.push(s),u.push(e.lon,e.lat,e.height),t=r.entities.add({name:"临时线",polyline:{positions:new n.CallbackProperty(()=>l,!1),clampToGround:!0,material:new n.ColorMaterialProperty(n.Color.YELLOW.withAlpha(.3)),width:3}})):1===c&&(t&&r.entities.remove(t),a=r.entities.add({name:null,polygon:{hierarchy:new n.CallbackProperty(function(){return new n.PolygonHierarchy(n.Cartesian3.fromDegreesArrayHeights(u))},!1),material:n.Color.YELLOW.withAlpha(.3)}})),c++},n.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0!==c?(1===c?h.showAt(e.endPosition,"点击添加第二个点"):h.showAt(e.endPosition,"右键结束绘制"),s=this._getPosition.getMousePosition(e.endPosition),t=this._core.toDegrees(s),u.splice(u.length-3,3),l.splice(l.length-1,1),l.push(s),u.push(t.lon,t.lat,t.height)):h.showAt(e.endPosition,"左键点击开始绘制点")},n.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(e){this.end&&this.end()}.bind(this),n.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{h.show(!1),this._core.mouse(this._viewer.container,0),this.drawHandler.destroy(),this.drawHandler=null,t&&r.entities.remove(t),a&&r.entities.remove(a),this.FlattenIsDraw=!1,this.end=void 0,"cancel"===e||l.length<3||(c<2?c=0:(c=0,this.create(u),"function"==typeof o&&o(u)))},this}},Pi.prototype.create=function(t){let i=Cesium.Cartesian3.fromDegreesArrayHeights(t);if(this.boundingSphere=Cesium.BoundingSphere.fromPoints(i),i.push(i[0]),this.showWall){this.originHeight=1e5;for(let e=2;e<t.length;e+=3)this.originHeight>t[e]&&(this.originHeight=t[e]);var o,r,e=this._viewer.entities.add({name:"地形开挖底面",polygon:{hierarchy:new Cesium.PolygonHierarchy(i),material:new Cesium.ImageMaterialProperty({image:this._core.defaultValue(this.bottomImg),repeat:new Cesium.Cartesian2(1,1)}),height:this.originHeight-this.deepth}});this.FlattenPolygon.push(e);for(let e=0;e<i.length-1;e++)o=this._core.toDegrees(i[e]),r=this._core.toDegrees(i[e+1]),this.calculateWall(o.lon,o.lat,r.lon,r.lat)}this.groundClipping(i)},Pi.prototype.groundClipping=function(e){var t=this._viewer.scene.globe,i=e.concat();i.splice(i.length-1,1);for(var o=0;o<i.length-1;o++)i[o].x===i[o+1].x&&i[o].y===i[o+1].y&&(i.splice(o,1),o--);var r=i.length;this.PolygonIsClockwise(i)&&i.reverse();for(var n=[],o=0;o<r;++o){var a=(o+1)%r,s=Cesium.Cartesian3.add(i[o],i[a],new Cesium.Cartesian3),s=Cesium.Cartesian3.multiplyByScalar(s,.5,s),l=Cesium.Cartesian3.normalize(s,new Cesium.Cartesian3),a=Cesium.Cartesian3.subtract(i[a],s,new Cesium.Cartesian3),a=Cesium.Cartesian3.normalize(a,a),a=Cesium.Cartesian3.cross(a,l,new Cesium.Cartesian3),a=Cesium.Cartesian3.normalize(a,a),l=new Cesium.Plane(a,0),s=Cesium.Plane.getPointDistance(l,s);n.push(new Cesium.ClippingPlane(a,s))}this.clippingPlane=new Cesium.ClippingPlaneCollection({planes:n}),t.multiClippingPlanes?t.multiClippingPlanes.add(this.clippingPlane):t.multiClippingPlanes=new Cesium.MultiClippingPlaneCollection({collections:[this.clippingPlane],edgeWidth:1,edgeColor:Cesium.Color.WHITE})},Pi.prototype.PolygonIsClockwise=function(e){if(3<=e.length)return!(0<(e[1].x-e[0].x)*(e[2].y-e[1].y)-(e[1].y-e[0].y)*(e[2].x-e[1].x))},Pi.prototype.calculateWall=function(e,t,i,o){var r,n,a=Cesium.Math.lerp(e,i,.01)-e,s=Cesium.Math.lerp(t,o,.01)-t,l=[],u=[];l.push(e,t),n=Cesium.Cartesian3.fromDegrees(e,t),u.push(Cesium.Cartographic.fromCartesian(n));for(var c=0;c<100;c++){var h=e+(c+1)*a,m=t+(c+1)*s;l.push(h,m),n=Cesium.Cartesian3.fromDegrees(h,m),u.push(Cesium.Cartographic.fromCartesian(n))}l.push(i,o),n=Cesium.Cartesian3.fromDegrees(i,o),u.push(Cesium.Cartographic.fromCartesian(n));var d=[];this.getHeightsFromLonLat(u,e=>{if(e){for(r=e,c=0;c<r.length;c++)d.push(this.originHeight-this.deepth);this.createWall(l,r,d)}})},Pi.prototype.createWall=function(e,t,i){i=this._viewer.entities.add({name:"地形开挖岩墙",wall:{positions:Cesium.Cartesian3.fromDegreesArray(e),maximumHeights:t,minimumHeights:i,material:new Cesium.ImageMaterialProperty({image:this.wallImg,repeat:new Cesium.Cartesian2(1,1)})}});this.wallArr.push(i)},Pi.prototype.getHeightsFromLonLat=function(t,i){let o=[];if(this._viewer.terrainProvider)if(this._viewer.terrainProvider instanceof Cesium.EllipsoidTerrainProvider)t.forEach(e=>{o.push(0)}),"function"==typeof i&&i(o);else{let e=Cesium.sampleTerrainMostDetailed(this._viewer.terrainProvider,t);e.then(e=>{e.forEach(function(e){o.push(e.height)}),"function"==typeof i&&i(o)},()=>{t.forEach(e=>{o.push(this._viewer.scene.globe.getHeight(e))}),"function"==typeof i&&i(o)})}else t.forEach(e=>{o.push(this._viewer.scene.globe.getHeight(e))}),"function"==typeof i&&i(o)},Pi.prototype.setDeepth=function(i){this.FlattenPolygon[0]&&this.FlattenPolygon[0].polygon.height.setValue(this.originHeight-i),this.wallArr.forEach(e=>{let t=e.wall.minimumHeights.getValue();t=Array(t.length),t.fill(this.originHeight-i),e.wall.minimumHeights.setValue(t)})},Pi.prototype.setVisibility=function(t){var i=this._viewer;if(this.wallArr.forEach(e=>{e.show=t}),i.scene.globe.multiClippingPlanes&&this.clippingPlane){let e=i.scene.globe.multiClippingPlanes;t&&!e.contains(this.clippingPlane)?e.add(this.clippingPlane):!t&&e.contains(this.clippingPlane)&&e.remove(this.clippingPlane,!1)}this.FlattenPolygon.forEach(e=>{e.show=t})},Pi.prototype.deleteObject=Pi.prototype.clear=function(){var t=this._viewer;this.wallArr.forEach(e=>{t.entities.remove(e)}),this.wallArr=[],t.scene.globe.multiClippingPlanes&&this.clippingPlane&&(t.scene.globe.multiClippingPlanes.remove(this.clippingPlane),this.clippingPlane=void 0),this.FlattenPolygon.forEach(e=>{t.entities.remove(e)}),this.FlattenPolygon=[],this.FlattenIsDraw=!1},Ei.prototype.createAnalysis=function(){return this.shadows=!0,this.currentSpeed=1,this.currentPlayMode="1",this.Forword(),this},Ei.prototype.setCurrentTime=function(e){e=new Date(e),e=this._cesium.JulianDate.fromDate(e);this._viewer.clock.currentTime=e.clone()},Ei.prototype.getCurrentTime=function(e){this.currentSpeed=$(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(),clearInterval(this.timer),timer=null,timer=setInterval(function(){this.currentTime=function(e,t){var i=(e=e.replace(/January|Jan/,"01").replace(/February|Feb/,"02").replace(/March|Mar/,"03").replace(/April|Apr/,"04").replace(/May/,"05").replace(/June|Jun/,"06").replace(/July|Jul/,"07").replace(/August|Aug/,"08").replace(/September|Sept/,"09").replace(/October|Oct/,"10").replace(/November|Nov/,"11").replace(/December|Dec/,"12")).split(" ");e=i[2]+"-"+i[0]+"-"+i[1],t=t.split(" ")[0];t=new Date(Date.parse(e+" "+t));return t=t.getTime()/1e3+28800,new Date(1e3*parseInt(t)).toLocaleString("chinese",{hour12:!1}).replace(/年|月|\//g,"-").replace(/日/g," ")}(this._viewer.animation.viewModel.dateLabel,this._viewer.animation.viewModel.timeLabel),e&&"function"==typeof e&&e(this.currentTime)},1e3)},Ei.prototype.SpeedIncress=function(e){this._viewer.animation.viewModel.faster(),this.currentSpeed=$(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(),e&&"function"==typeof e&&e(this.currentSpeed)},Ei.prototype.SpeedDecress=function(e){this._viewer.animation.viewModel.slower(),this.currentSpeed=$(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(),e&&"function"==typeof e&&e(this.currentSpeed)},Ei.prototype.Forword=function(e){this._viewer.animation.viewModel.playForwardViewModel.command(),this.currentPlayMode="1","-"==this.currentSpeed[0]&&(this.currentSpeed=this.currentSpeed.slice(1)),e&&"function"==typeof e&&e(this.currentSpeed)},Ei.prototype.Bacword=function(e){this._viewer.animation.viewModel.playReverseViewModel.command(),this.currentPlayMode="2","-"!==this.currentSpeed[0]&&(this.currentSpeed="-"+this.currentSpeed),e&&"function"==typeof e&&e(this.currentSpeed)},Ei.prototype.Pause=function(){this._viewer.animation.viewModel.pauseViewModel.command()},Object.defineProperties(Ei.prototype,{shadows:{get:function(){return this._viewer.shadows},set:function(e){this._viewer.shadows=e}},currentSpeed:{get:function(){return $(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html()},set:function(e){e=e.toString().replace("x",""),this._viewer.clock.multiplier=parseFloat(e)}}}),xi.prototype.createScreenshot=function(e="png"){var t=this._viewer.scene.canvas.toDataURL("image/"+e),i=document.createElement("a");i.download="截图."+e,i.href=t,i.click()},xi.prototype.createScreenshotCompared=function(e,t){var i=this._viewer.scene.canvas,o=i.toDataURL("image/png");(t||layuiLayer).open({title:e||"截图对比",type:1,skin:"other-class",shade:0,shadeClose:!0,resize:!1,moveOut:!0,area:[.7*i.width+"px",.7*i.height+42+"px"],content:'<img src="'+o+'" style="height:100%;width:100%;">'})},Ii.prototype.setPointFly=function(i){i=i||{};let t=this._core.CreateTooltip(),o=this._viewer,r=this,n=!1,a,s;i.pitch&&(i.pitch=Cesium.Math.toRadians(i.pitch));let l,u,c=360/(i.time||30),h=function(){var e=Cesium.JulianDate.secondsDifference(o.clock.currentTime,o.clock.startTime),e=Cesium.Math.toRadians(e*c)+l;o.scene.camera.setView({destination:u,orientation:{heading:e,pitch:r.pitch}}),o.scene.camera.moveBackward(r.distance),0<=Cesium.JulianDate.compare(o.clock.currentTime,o.clock.stopTime)&&o.clock.onTick.removeEventListener(h)},m=e=>{u=e,r.pitch=i.pitch||o.camera.pitch,r.distance=i.distance,r.distance||(r.distance=Cesium.Cartesian3.distance(o.camera.position,e)),l=o.camera.heading;let t=Cesium.JulianDate.fromDate(new Date);o.clock.startTime=t.clone(),o.clock.currentTime=t.clone(),o.clock.clockRange=Cesium.ClockRange.CLAMPED,o.clock.clockStep=Cesium.ClockStep.SYSTEM_CLOCK,o.clock.onTick.addEventListener(h),i.hideImage||(a=r._viewer.entities.add({id:r._core.getuid(),name:"定点",position:u,billboard:{horizontalOrigin:r._cesium.HorizontalOrigin.CENTER,verticalOrigin:r._cesium.VerticalOrigin.BOTTOM,scale:r._core.defaultValue(i.scale,1),image:r._core.defaultValue(i.image,window.SmartEarthRootUrl+D.mark),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))};return i.position?m(i.position):(this.drawHandler&&this.drawHandler.destroy(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),s=new Cesium.ScreenSpaceEventHandler(o.scene.canvas),s.setInputAction(function(e){n?r.end&&r.end():(t.showAt(e.position,"点击结束绕飞"),n=!0,e=r._getPosition.getMouseDegrees(e),e=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),m(e))},Cesium.ScreenSpaceEventType.LEFT_CLICK),s.setInputAction(function(e){n||t.showAt(e.endPosition,"点击选择定位点"),n&&t.showAt(e.endPosition,"点击结束绕飞")},Cesium.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(function(e){r.distance-=e*r.distance/2e3,r.distance<1&&(r.distance=1)},Cesium.ScreenSpaceEventType.WHEEL),this.drawHandler=s),this.end=e=>{this.end=void 0,t.show(!1),s&&s.destroy(),r._viewer.entities.remove(a),a=void 0,r._core.mouse(r._viewer.container,0),o.clock.onTick.removeEventListener(h),i.end&&i.end()},this},Di.prototype.PointSunshineAnalysis=function(e,t){if(this._viewer.entities.remove(this._viewer.entities.getById("1")),this._viewer.entities.remove(this._viewer.entities.getById("point")),null==e)throw"无效参数";if("Cartesian3"!=e.constructor.name)throw"传入参数必须是三维坐标";this._viewer.scene.sun.show||(this._viewer.scene.sun.show=!0);var i=this._viewer.scene.context.uniformState.sunPositionWC,o=new Cesium.Cartesian3(i.x-e.x,i.y-e.y,i.z-e.z),i=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z),i=new Cesium.Cartesian3(o.x/i,o.y/i,o.z/i),i=new Cesium.Cartesian3(e.x+200*i.x,e.y+200*i.y,e.z+200*i.z);this.pickFromRay(e,i,t)},Di.prototype.sunshineAnalysisPoint=function(t,i){t=t||{},this.sunshineOption=t;var o=this,r=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1,this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this.drawHandler.setInputAction(function(e){e=o._getPosition.getMousePosition(e);o.PointSunshineAnalysis(e),e&&(e=r.entities.add({id:o._core.getuid(),name:"Point",position:e,point:{pixelSize:16,color:o._cesium.Color.BLUE,outlineWidth:o._core.defaultValue(t.outlineWidth,2),outlineColor:o._cesium.Color.WHITE.withAlpha(.6),heightReference:o._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}}),o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0"),i&&"function"==typeof i&&i(e))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){o.tooltip.showAt(e.endPosition,"点击绘制点")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},Di.prototype.sunshineAnalysisPolygon=function(i,t){i=i||{},this.sunshineOption=i;var o=this,r=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.loading||this.addLoading(),this.remove(),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),we.states=1;var n,a,s=[];return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this.drawHandler.setInputAction(function(e){var t=o._getPosition.getMousePosition(e);t&&(s.length||(e=Cesium.Cartographic.fromCartesian(t),o.sunshineOption.defaultHeight=e.height,s.push(t)),s.push(t),2!==s.length||a||(a=r.entities.add({name:"临时线",polyline:{positions:new o._cesium.CallbackProperty(function(){return s},!1),clampToGround:!0,material:o._cesium.Color.LIME.withAlpha(.6),width:3}})),3!==s.length||n||(a&&r.entities.remove(a),i.clampToGround=o._core.defaultValue(i.clampToGround,!0),n=r.entities.add({id:o._core.getuid(),name:"新建面",polygon:{hierarchy:new o._cesium.CallbackProperty(function(){return new o._cesium.PolygonHierarchy(s)},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.LIME.withAlpha(.6)}),perPositionHeight:!o._core.defaultValue(i.clampToGround,!1),heightReference:i.clampToGround?1:0,outline:o._core.defaultValue(i.outline,!1),outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}})))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){0===s.length?o.tooltip.showAt(e.endPosition,"点击添加第一个点"):1===s.length?o.tooltip.showAt(e.endPosition,"点击添加第二个点"):(o.tooltip.showAt(e.endPosition,"点击添加点,右键结束绘制"),(e=o._getPosition.getMousePosition(e))&&(s.pop(),s.push(e)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.end=void 0,setTimeout(function(){we.states=0},100),o._core.mouse(o._viewer.container,0,"0"),a&&r.entities.remove(a),n&&r.entities.remove(n),"cancel"===e||s.length<3||setTimeout(()=>{o.analysis(n,i.start||"2019-09-17 13:00",i.end||"2019-09-17 15:00",i.interval||60,t)},100)},this.drawHandler.setInputAction(function(e){o.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},Di.prototype.analysis=function(e,t,i,o,r){var n=new Date(t),a=new Date(i),s=0,l=this,i=this.sunshineOption.startHeight||this.sunshineOption.defaultHeight,u=l.getPoint(e,this.sunshineOption.spacing||10,i,i+l._core.defaultValue(this.sunshineOption.addHeight,30));this._viewer.scene.sun.show||(this._viewer.scene.sun.show=!0);let c=this._viewer.clock.currentTime.clone();function h(){var t,e=n.getTime()+6e4*o*s,e=new Date(e);a<e?(l.createPoint(u),l._viewer.clock.currentTime=c,l.isLoading(!1),r&&"function"==typeof r&&r(u)):(t=function(e){!function(t){for(let e=0;e<u.length;e++)l.Sunshine(u[e],t)?u[e].through++:u[e].out++}(e),s++,h()},l.SetTimeNow(e),setTimeout(()=>{var e=l._viewer.scene.context.uniformState.sunPositionWC;t(e)},100))}1500<(a-n)/(6e4*o)*u.length?window.layuiLayer&&window.layuiLayer.msg("当前分析时间过长,是否继续分析?",{time:0,btn:["继续","取消"],btnAlign:"c",yes:e=>{layuiLayer.close(e),l.isLoading(!0),h()},btn2:()=>{r&&"function"==typeof r&&r(u)}}):(l.isLoading(!0),h())},Di.prototype.createPoint=function(e){this.ResultPoint=this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection);for(var t=0;t<e.length;t++){var i=e[t],o=e[t].through+e[t].out,r=e[t].out/o,o="";.7<=r?o=this._cesium.Color.BLUE:r<.7&&.3<=r?o=this._cesium.Color.YELLOW:r<.3&&(o=this._cesium.Color.RED);o={id:{isshowderData:!0,data:"阴影率:"+100*(1-r)+"%"},position:this._cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height),color:o};this.ResultPoint.add(o)}this.showResultTooltip(!0)},Di.prototype.showResultTooltip=function(e){if(this.ResultTooltipHandler&&(this.ResultTooltipHandler.destroy(),this.ResultTooltipHandler=void 0,this.tooltip.show(!1)),e){let i=this;this.ResultTooltipHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.ResultTooltipHandler.setInputAction(function(e){var t=i._viewer.scene.pick(e.position);t&&t.id&&t.id.isshowderData?i.tooltip.showAt(e.position,t.id.data):i.tooltip.show(!1)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.ResultTooltipHandler.setInputAction(function(e){i.tooltip.show(!1)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)}},Di.prototype.getPoint=function(e,t,i,o){for(var r=[],n=e.polygon.hierarchy.getValue().positions,a=0;a<n.length;a++){var s=this._cesium.Math.toDegrees(this._cesium.Cartographic.fromCartesian(n[a]).longitude),l=this._cesium.Math.toDegrees(this._cesium.Cartographic.fromCartesian(n[a]).latitude);r.push(s),r.push(l)}for(var e=this.getTheBottomPoint(r),u=this.scanningPolygon(e,t,t,r),c=[],h=(o-i)/t,m=0;m<h;m++)for(var d=0;d<u.length;d++){var p=u[d],p={lon:p.lon,lat:p.lat,height:i+t*m,through:0,out:0,color:""};c.push(p)}return c},Di.prototype.getTheBottomPoint=function(e){for(var t=90,i=0,o=1;o<e.length;o+=2)t=t<e[o]?t:(i=o)&&e[o];return{lon:e[i-1],lat:e[i]}},Di.prototype.scanningPolygon=function(e,t,i,o){for(var r,n,a,s=[],l=180,u=-180,c=-90,h=0;h<o.length;h+=2)c=c>o[h+1]?c:o[h+1],l=l<o[h]?l:o[h],u=u>o[h]?u:o[h];var i=this.GetPositionFromA_D(e.lat,e.lon,i,0),m=this.GetPositionFromA_D(e.lat,e.lon,t,90)[0]-e.lon,d=i[1]-e.lat;for(s.push({lon:e.lon,lat:e.lat}),(a={lon:e.lon,lat:e.lat}).lat+=d;a.lat<=c;a.lat+=d){for(r={lon:a.lon-m,lat:a.lat},n={lon:a.lon+m,lat:a.lat},this.IsInPolygon(a.lon,a.lat,o)&&s.push({lon:a.lon,lat:a.lat});r.lon>=l;r.lon-=m)this.IsInPolygon(r.lon,r.lat,o)&&s.push({lon:r.lon,lat:r.lat});for(;n.lon<=u;n.lon+=m)this.IsInPolygon(n.lon,n.lat,o)&&s.push({lon:n.lon,lat:n.lat})}return s},Di.prototype.GetPositionFromA_D=function(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=6356725+21412*(90-e)/90;return[180*(r/(o*Math.cos(e*Math.PI/180))+t*Math.PI/180)/Math.PI,180*(i/o+e*Math.PI/180)/Math.PI]},Di.prototype.IsInPolygon=function(e,t,i){var o,r,n,a,s=0;if(i.length<6)return!1;i.push(i[0],i[1]);for(var l=0;l<i.length-2;l+=2)o=i[l],n=i[l+1],r=i[l+2],a=i[l+3],(n<=t&&t<a||a<=t&&t<n)&&0<Math.abs(n-a)&&o-(o-r)*(n-t)/(n-a)<=e&&s++;return s%2!=0},Di.prototype.SetTimeNow=function(e){e=new this._cesium.JulianDate.fromDate(e);this._viewer.clock.currentTime=e},Di.prototype.Sunshine=function(e,t){e=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height);return this.pickFromRay(e,t)},Di.prototype.jiance=function(e,t){var i=!1,e=this._cesium.Cartographic.fromCartesian(e),t=this._cesium.Cartographic.fromCartesian(t),o={};o.longitude=e.longitude/Math.PI*180,o.latitude=e.latitude/Math.PI*180,o.czheight=e.height;var r={};r.longitude=t.longitude/Math.PI*180,r.latitude=t.latitude/Math.PI*180,r.czheight=t.height;for(var n=0;n<20;n++){var a={};a.longitude=this._cesium.Math.lerp(o.longitude,r.longitude,.01*(n+1)),a.latitude=this._cesium.Math.lerp(o.latitude,r.latitude,.01*(n+1)),a.czheight=o.czheight-.01*(o.czheight-r.czheight)*(n+1);var s=new this._cesium.Cartographic(this._cesium.Math.toRadians(a.longitude),this._cesium.Math.toRadians(a.latitude),0),s=this._viewer.scene.sampleHeight(s);this._cesium.Cartesian3.fromDegrees(a.longitude,a.latitude,s),a.zsheight=s,a.zsheight>a.czheight&&(i=!0)}return i},Di.prototype.pickFromRay=function(e,t){t=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t,e,new Cesium.Cartesian3),new Cesium.Cartesian3),t=new Cesium.Ray(e,t),t=this._viewer.scene.pickFromRay(t,[]);let i=!1;return t&&t.object&&(i=!0),i},Di.prototype.remove=function(){this.ResultPoint&&this._viewer.scene.primitives.remove(this.ResultPoint),this.ResultPoint=void 0,this.ResultTooltipHandler&&(this.ResultTooltipHandler.destroy(),this.ResultTooltipHandler=void 0,this.tooltip.show(!1)),this.showResultTooltip(!1)},Di.prototype.addLoading=function(){var e=document.createElement("div");e.id="cesiumLoading",e.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";var t=document.createElement("img");t.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",t.src=this.loadingImg,e.appendChild(t),this.loading=e,this._viewer.container.appendChild(e)},Di.prototype.isLoading=function(e){this.loading.style.display=e?"block":"none"},Di.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0},Li.prototype.create3DTilesets=function(e,t,i,o,r,n,a){var s={url:t};"string"==typeof i.lightColor&&(t=i.lightColor.split(","),i.lightColor=new this._cesium.Cartesian3(t[0],t[1],t[2]));var l=this._core.extend(s,i,!0);l.time&&(l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:l.time.start?this._cesium.JulianDate.fromDate(new Date(l.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?this._cesium.JulianDate.fromDate(new Date(l.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})]),this.availability=l.availability),o.effects&&(l.fShaderBody=o.fShaderBody||this.getEffectsShader(o.effectsMaxHeight));var u=new this._cesium.Cesium3DTileset(l),c=this,i=l.id||c._core.getuid();u.id=i,u.Level=l.Level,c.item=u,setTimeout(function(){var e=c._viewer.scene.primitives.add(u);null!=o.maximumscreenspaceerror&&(u.maximumScreenSpaceError=o.maximumscreenspaceerror),null!=l.maximumscreenspaceerror&&(u.maximumScreenSpaceError=l.maximumscreenspaceerror),null!=l.maximumMemoryUsage&&(u.maximumMemoryUsage=l.maximumMemoryUsage),null!=o.pointcloudshading&&(u.pointCloudShading.maximumAttenuation=c.checkZero(o.pointcloudshading.maximumattenuation),u.pointCloudShading.baseResolution=o.pointcloudshading.baseresolution,u.pointCloudShading.geometricErrorScale=o.pointcloudshading.geometricerrorscale,u.pointCloudShading.attenuation=o.pointcloudshading.attenuation,u.pointCloudShading.eyeDomeLighting=o.pointcloudshading.eyedomelighting,u.pointCloudShading.eyeDomeLightingStrength=o.eyeDomeLightingStrength,u.pointCloudShading.eyeDomeLightingRadius=o.eyeDomeLightingRadius),u.readyPromise.then(function(e){var t;null!=o.groundheight&&c.setHeight(o.groundheight),null!=o.groundHeight&&c.setHeight(o.groundHeight),o.groundCenter&&c.setPosition(o.groundCenter),c.boundingSphereCenter||(c.getCenter(),t=c._cesium.Cartographic.fromCartesian(c.boundingSphereCenter),c.modelEditData.lon=c._cesium.Math.toDegrees(t.longitude),c.modelEditData.lat=c._cesium.Math.toDegrees(t.latitude),c.modelEditData.height=t.height),(o.heading||o.pitch||o.roll)&&c.setEditData({r_y:o.roll,r_x:o.pitch,r_z:o.heading}),o.edit&&c.setEditData(o.edit),"function"==typeof a&&a(c)}).otherwise(function(e){console.log(e)}),u.Level&&(c.Level=0,c._viewer.scene.preRender.addEventListener(function(){c.isShow&&c._viewer.camera.positionCartographic&&c.oldCameraHeight!==c._viewer.camera.positionCartographic.height&&(c.oldCameraHeight=c._viewer.camera.positionCartographic.height,c.Level=c.getLevel(),c.Level>u.Level&&!u.show?u.show=!0:c.Level<u.Level&&u.show&&(u.show=!1))})),c.sd=e,n?c.isShow=!0:c.setVisibility(!1);e=c.setStyle(o);u.style=new c._cesium.Cesium3DTileStyle(e)});e={id:i,name:e=c._core.isnull(e)?"新建模型":e,checked:n,pId:c._core.isnull(r)?0:r,type:"3DTilesets",item:c};return c.setTreeobj(e),c._tree.insertGroupId(e,c._core.isnull(r)?0:r),this},Li.prototype.getLevel=function(){var e,t,i,o=this._viewer.camera;try{i=o&&o.positionCartographic&&o.positionCartographic.height?(e=this._viewer.scene.globe.getHeight(o.positionCartographic)||0,t=o.positionCartographic.height-e,Math.round(80955.31/(1+Math.pow(t/91610.74,7096758e-11))-40467.74)):0}catch(e){}return i},Li.prototype.setVisibility=function(e){this.isShow=e,this.item.show=e,this.item._availability&&!e?this.item._availability=void 0:this.availability&&e&&(this.item._availability=this.availability)},Li.prototype.checkZero=function(e){e=parseFloat(e);return 0===e?void 0:e},Li.prototype.getVisibility=function(){return this.item.show},Li.prototype.deleteObject=function(){try{this._viewer.scene.primitives.remove(this.item)}catch(e){console.log(e.message)}},Li.prototype.restore=function(){this.modelEditData={lon:0,lat:0,height:0,scale:1,r_x:0,r_y:0,r_z:0,rotate:!1,modelMatrix:this.modelEditData.modelMatrix,rootTransform:this.modelEditData.rootTransform,originalMatrix:this.modelEditData.originalMatrix};var e=this._cesium.Cartographic.fromCartesian(this.boundingSphereCenter);this.modelEditData.lon=this._cesium.Math.toDegrees(e.longitude),this.modelEditData.lat=this._cesium.Math.toDegrees(e.latitude),this.modelEditData.height=e.height,this.item.modelMatrix=this.modelEditData.modelMatrix.clone(),this.modelEditData.rootTransform.equals(Cesium.Matrix4.IDENTITY)?this.item.modelMatrix=this.modelEditData.originalMatrix.clone():(this.item._root.transform=this.modelEditData.originalMatrix.clone(),this.modelEditData.rotate=!0),this.moveModelEnd&&(this.moveModelEnd(),this.moveModelEnd=void 0),this.rotatePointPosition=void 0,this.moveEndCenter=void 0},Li.prototype.setHeight=function(e){var t,i;e=Number(e),isNaN(e)||null!=this.item&&null!=this.item.boundingSphere&&(this.boundingSphereCenter||this.getCenter(),t=this._cesium.Cartographic.fromCartesian(this.boundingSphereCenter),this.restore(),this.modelEditData.height=e,i=this._cesium.Cartesian3.fromRadians(t.longitude,t.latitude,0),e=this._cesium.Cartesian3.fromRadians(t.longitude,t.latitude,e),i=this._cesium.Cartesian3.subtract(e,i,new this._cesium.Cartesian3),this.item.modelMatrix=this._cesium.Matrix4.fromTranslation(i))},Li.prototype.setPosition=function(e,t){null!=this.item&&null!=this.item.boundingSphere&&e&&(this.boundingSphereCenter||this.getCenter(),this.setEditData({lon:e[0],lat:e[1],height:t?this.boundingSphereCenterHeight:e[2]}))},Li.prototype.setEditData=function(e){var t,i,o;null!=this.item&&null!=this.item.boundingSphere&&(this.boundingSphereCenter||this.getCenter(),e&&(this.modelEditData=this._core.extend(this.modelEditData,e,!0)),this.modelEditData.rootTransform.equals(Cesium.Matrix4.IDENTITY)?(i=this.boundingSphereCenter,o=this._cesium.Cartesian3.fromDegrees(this.modelEditData.lon,this.modelEditData.lat,this.modelEditData.height),t=this._cesium.Cartesian3.subtract(o,i,new this._cesium.Cartesian3),this.item.modelMatrix=this._cesium.Matrix4.fromTranslation(t)):(e=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(this.modelEditData.r_x)),o=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(this.modelEditData.r_y)),i=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(this.modelEditData.r_z)),t=Cesium.Matrix4.fromRotationTranslation(e),e=Cesium.Matrix4.fromRotationTranslation(o),o=Cesium.Matrix4.fromRotationTranslation(i),i=Cesium.Cartesian3.fromDegrees(this.modelEditData.lon,this.modelEditData.lat,this.modelEditData.height),i=Cesium.Transforms.eastNorthUpToFixedFrame(i),Cesium.Matrix4.multiply(i,t,i),Cesium.Matrix4.multiply(i,e,i),Cesium.Matrix4.multiply(i,o,i),o=Cesium.Matrix4.fromUniformScale(this.modelEditData.scale),Cesium.Matrix4.multiply(i,o,i),this.item._root.transform=i))},Li.prototype.getCenter=function(){var e;this.boundingSphereCenter||(e=this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center),this.boundingSphereCenter=this.item.boundingSphere.center.clone(),this.boundingSphereCenterHeight=e.height,this.boundingSphereRadius=this.item.boundingSphere.radius,this.modelEditData.rootTransform=this.item._root.transform.clone(),this.modelEditData.modelMatrix=this.item.modelMatrix.clone(),this.modelEditData.rootTransform.equals(Cesium.Matrix4.IDENTITY)?this.modelEditData.originalMatrix=this.item.modelMatrix.clone():(this.modelEditData.originalMatrix=this.item._root.transform.clone(),this.modelEditData.rotate=!0))},Li.prototype.arge=function(e,t,i){var o=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),e=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),i=Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2)),e=(Math.pow(o,2)+Math.pow(e,2)-Math.pow(i,2))/(2*o*e);return Math.round(180*Math.acos(e)/Math.PI)},Li.prototype.moveModel=function(i={}){var o=this,r=this._viewer;this.moveHandler&&(this.moveHandler.destroy(),this.moveHandler=void 0,this._viewer.entities.remove(this.movePoint),this._viewer.entities.remove(this.rotatePoint));var n,a,s,l,u,c,h,m=!1,d=!1;o.moveEndCenter||(s=o._cesium.Cartographic.fromCartesian(this.boundingSphereCenter),o.moveEndCenter={lon:this.modelEditData.lon,lat:this.modelEditData.lat});var p=o.moveEndCenter.lon,g=o.moveEndCenter.lat,_=l=0,f=this._viewer.entities.add({name:"tilesetMovePoint",position:new o._cesium.CallbackProperty(function(){return o._cesium.Cartesian3.fromDegrees(p+_,g+l,o.boundingSphereCenterHeight)},!1),billboard:{image:i.moveImg||window.SmartEarthRootUrl+D.move,color:this._cesium.Color.BLUE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scaleByDistance:new Cesium.NearFarScalar(0,1,1e6,0)}});this.rotatePointPosition||(this.rotatePointPosition={lon:o.moveEndCenter.lon+9e-6*this.boundingSphereRadius,lat:o.moveEndCenter.lat});var y=this._viewer.entities.add({show:!!i.rotate,name:"tilesetRotatePoint",position:new o._cesium.CallbackProperty(function(){return o._cesium.Cartesian3.fromDegrees(o.rotatePointPosition.lon,o.rotatePointPosition.lat,o.boundingSphereCenterHeight)},!1),billboard:{image:i.rotateImg||window.SmartEarthRootUrl+D.rotate,color:this._cesium.Color.BLUE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scaleByDistance:new Cesium.NearFarScalar(0,1,1e6,0)}});y.oldPosition={lon:o.moveEndCenter.lon+9e-6*this.boundingSphereRadius,lat:o.moveEndCenter.lat},this.movePoint=f,this.rotatePoint=y,this.moveHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas);var v=o._core.CreateTooltip();function C(e){var t=r.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e}this.moveHandler.setInputAction(function(e){var t=r.scene.pick(e.position);o._cesium.defined(t)&&(m||d||!(t.id==f||t.tileset==o.item||t.primitive&&t.primitive.tileset==o.item||t.content&&t.content.tileset==o.item)?m||d||t.id!=y||(u=o._cesium.SceneTransforms.wgs84ToWindowCoordinates(o._viewer.scene,f.position.getValue()),c=o._cesium.SceneTransforms.wgs84ToWindowCoordinates(o._viewer.scene,o._cesium.Cartesian3.fromDegrees(p+_+9e-6*o.boundingSphereRadius,g+l,o.boundingSphereCenterHeight)),C(!(d=!0)),v.show(!1)):(n=r.camera.getPickRay(e.position),(a=n?r.scene.globe.pick(n,r.scene):a)&&(s=o._cesium.Cartographic.fromCartesian(a),p=o._cesium.Math.toDegrees(s.longitude),g=o._cesium.Math.toDegrees(s.latitude),_=o.moveEndCenter.lon-p,l=o.moveEndCenter.lat-g),f.oldPosition={lon:p+_,lat:g+l},y.oldPosition={lon:o.rotatePointPosition.lon,lat:o.rotatePointPosition.lat},C(!(m=!0)),v.show(!1)))},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.moveHandler.setInputAction(function(t){if(m)n=r.camera.getPickRay(t.endPosition),(a=n?r.scene.globe.pick(n,r.scene):a)&&(s=o._cesium.Cartographic.fromCartesian(a),p=o._cesium.Math.toDegrees(s.longitude),g=o._cesium.Math.toDegrees(s.latitude),o.rotatePointPosition={lon:y.oldPosition.lon+(p+_-f.oldPosition.lon),lat:y.oldPosition.lat+(g+l-f.oldPosition.lat)},o.modelEditData.lon=p+_,o.modelEditData.lat=g+l,o.setEditData(),i.callback&&i.callback.move&&i.callback.move());else if(d){if(n=r.camera.getPickRay(t.endPosition),a=n?r.scene.globe.pick(n,r.scene):a){s=o._cesium.Cartographic.fromCartesian(a),o.rotatePointPosition={lon:o._cesium.Math.toDegrees(s.longitude),lat:o._cesium.Math.toDegrees(s.latitude)},h=t.endPosition;let e=o.arge(u,c,h);o.rotatePointPosition.lat-g-l<0&&(e=-e),o.rotateZ(e),i.callback&&i.callback.rotate&&i.callback.rotate(e)}}else{var e=r.scene.pick(t.endPosition);o._cesium.defined(e)?m||d||!(e.id==f||e.tileset==o.item||e.primitive&&e.primitive.tileset==o.item||e.content&&e.content.tileset==o.item)?m||d||e.id!=y?v.show(!1):v.showAt(t.endPosition,"点击拖拽旋转模型,右键结束编辑"):v.showAt(t.endPosition,"点击拖拽移动模型,右键结束编辑"):v.show(!1)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.moveHandler.setInputAction(function(e){C(!(d=m=!1)),o.moveEndCenter={lon:p+_,lat:g+l}},this._cesium.ScreenSpaceEventType.LEFT_UP),this.moveHandler.setInputAction(function(e){o.moveModelEnd(),o.moveModelEnd=void 0},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this.moveModelEnd=()=>{o.moveHandler.destroy(),o._viewer.entities.remove(f),o._viewer.entities.remove(y),C(!0),v.show(!1)}},Li.prototype.clippingModel=function(t={}){var i,o=this,r=this._viewer;this.moveHandler&&(this.moveHandler.destroy(),this.moveHandler=void 0,this._viewer.entities.remove(this.movePoint),this._viewer.entities.remove(this.rotatePoint)),this.clippingHandler&&(this.clippingHandler.destroy(),this.clippingHandler=void 0,o.planeEntities&&o.planeEntities.forEach(e=>{o._viewer.entities.remove(e)}),o.planeEntities=[]),o.planeEntities=[],this.targetY||(t.start?this.targetY=t.start:this.targetY=0),this.clippingPlanes||(this.clippingPlanes=new this._cesium.ClippingPlaneCollection({planes:[new this._cesium.ClippingPlane(new this._cesium.Cartesian3(0,0,-1),0)],edgeWidth:1}),this.item.clippingPlanes=this.clippingPlanes),this.boundingSphereCenter||this.getCenter();var e,n=this.item.boundingSphere,a=this.boundingSphereRadius;this._cesium.Matrix4.equals(this.item.root.transform,this._cesium.Matrix4.IDENTITY)||(e=this._cesium.Matrix4.getTranslation(this.item.root.transform,new Cesium.Cartesian3),e=this._cesium.Cartographic.fromCartesian(e),e=this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center).height-e.height,this.clippingPlanes.modelMatrix=this._cesium.Matrix4.fromTranslation(new this._cesium.Cartesian3(0,0,e)));for(var s=0;s<this.clippingPlanes.length;++s){var l=this.clippingPlanes.get(s),l=r.entities.add({name:"modelClippingPlane",position:n.center,plane:{dimensions:new Cesium.Cartesian2(1.2*a,1.2*a),material:Cesium.Color.WHITE.withAlpha(.1),plane:new Cesium.CallbackProperty(function(e){return function(){return e.distance=o.targetY,e}}(l),!1),outline:!0,outlineColor:Cesium.Color.WHITE}});o.planeEntities.push(l)}this.clippingHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas);var u=o._core.CreateTooltip();this.clippingHandler.setInputAction(function(e){e=r.scene.pick(e.position);o._cesium.defined(e)&&e.id&&"modelClippingPlane"===e.id.name&&((i=e.id.plane).material=o._cesium.Color.WHITE.withAlpha(.05),i.outlineColor=o._cesium.Color.WHITE,r.scene.screenSpaceCameraController.enableInputs=!1)},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.clippingHandler.setInputAction(e=>{var t;Cesium.defined(i)?(t=e.startPosition.y-e.endPosition.y,this.targetY+=.1*t,u.showAt(e.endPosition,"移动鼠标平移裁切面")):u.showAt(e.endPosition,"长按左键上下拖动裁切面,右键取消")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.clippingHandler.setInputAction(e=>{Cesium.defined(i)&&(i.material=Cesium.Color.WHITE.withAlpha(.1),i.outlineColor=Cesium.Color.WHITE,i=void 0),r.scene.screenSpaceCameraController.enableInputs=!0},this._cesium.ScreenSpaceEventType.LEFT_UP),this.clippingHandler.setInputAction(e=>{o.endClipping(),t.end&&t.end()},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this.endClipping=()=>{o.clippingHandler.destroy(),u.show(!1),o.planeEntities&&o.planeEntities.forEach(e=>{o._viewer.entities.remove(e)}),o.planeEntities=[]}},Li.prototype.rotateX=function(e){this.modelEditData.r_x=e,this.setEditData()},Li.prototype.rotateY=function(e){this.modelEditData.r_y=e,this.setEditData()},Li.prototype.rotateZ=function(e){this.modelEditData.r_z=e,this.setEditData()},Li.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(Li.prototype,{style:{get:function(){return this.item.style}}}),Li.prototype.export=function(){var e=this.item.url,t=this.item.show,i=this.item.shadows;return{type:"3DTilesets",treeobj:{name:this.treeobj.name},style:{url:e,show:t,shadows:i}}},Li.prototype.setTreeobj=function(e){this.treeobj=e},Li.prototype.setItem=function(e){this.item=e},Li.prototype.setShowStyle=function(e){this.item.style,this.item.style=new this._cesium.Cesium3DTileStyle({show:!0})},Li.prototype.setStyle=function(e){var t=[],i={color:void 0,show:!0},o=!0;if(e.colors instanceof Array){for(var r=0;r<e.colors.length;r++){var n=[],a=e.colors[r].color,s=e.colors[r].condition;/^\[/.test(s)&&(s=s.replace(/^\[/,"${").replace(/\]/,"}")),a=this._core.isHtmlColor(a)?this._color.colorFromHtmlColor(a):(1<(a=/^rgb/.test(a)?this._color.rgbaStringToRgbaObj(a):a).r&&(a.r=a.r/255),1<a.g&&(a.g=a.g/255),1<a.b&&(a.b=a.b/255),1<a.a&&(a.a=a.a/255),this._color.createColor(a.r,a.g,a.b,a.a)),n.push(s),n.push(a),t.push(n)}i.color={},i.color.conditions=t}else e.colors&&(i.color=e.colors);return e.show&&/\[/.test(e.show)?o=e.show.replace(/^\[/,"${").replace(/\]/,"}"):e.show&&(o=e.show),i.show=o,i},Object.defineProperties(Li.prototype,{luminanceAtZenith:{get:function(){return this.item.luminanceAtZenith},set:function(e){this.item.luminanceAtZenith=e}},groundHeight:{get:function(){return null==this.item||null==this.item.boundingSphere?0:this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center).altitude},set:function(e){this.setHeight(e)}},lon:{get:function(){return this.modelEditData.lon},set:function(e){this.modelEditData.lon=e,this.setEditData()}},lat:{get:function(){return this.modelEditData.lat},set:function(e){this.modelEditData.lat=e,this.setEditData()}},height:{get:function(){return this.modelEditData.height},set:function(e){this.modelEditData.height=e,this.setEditData()}},scale:{get:function(){return this.modelEditData.scale},set:function(e){this.modelEditData.scale=e,this.setEditData()}},material:{set:function(e){this._core.isHtmlColor(e)||(e="rgba("+(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r+","+e.g+","+e.b+","+e.a+")"),this.item.style=new this._cesium.Cesium3DTileStyle({color:"color('"+e+"')"})}},dynamicScreenSpaceErrorDensity:{get:function(){return this.item.dynamicScreenSpaceErrorDensity},set:function(e){this.item.dynamicScreenSpaceErrorDensity=e}},shadows:{get:function(){return this.item.shadows},set:function(e){this.item.shadows=e}},classificationType:{get:function(){return this.item.classificationType},set:function(e){this.item.classificationType=e}},dynamicScreenSpaceErrorHeightFalloff:{get:function(){return this.item.dynamicScreenSpaceErrorHeightFalloff},set:function(e){this.item.dynamicScreenSpaceErrorHeightFalloff=e}},dynamicScreenSpaceErrorFactor:{get:function(){return this.item.dynamicScreenSpaceErrorFactor},set:function(e){this.item.dynamicScreenSpaceErrorFactor=e}},imageBasedLightingFactor_x:{get:function(){return null==this.item.imageBasedLightingFactor?0:this.item.imageBasedLightingFactor.x},set:function(e){this.item.imageBasedLightingFactor=new this._cesium.Cartesian2(e,this.item.imageBasedLightingFactor_y)}},imageBasedLightingFactor_y:{get:function(){return null==this.item.imageBasedLightingFactor?0:this.item.imageBasedLightingFactor.y},set:function(e){this.item.imageBasedLightingFactor=new this._cesium.Cartesian2(e,this.item.imageBasedLightingFactor_y)}}}),Li.prototype.getEffectsShader=function(e=150){return`    float vtxf_a11 = fract(czm_frameNumber / 120.0) * 3.14159265 * 2.0; \n
                float vtxf_a12 = v_elevationPos.z / ${(e=parseInt(e))/2}.0 + sin(vtxf_a11) * 0.1; \n
                gl_FragColor *= vec4(vtxf_a12, vtxf_a12, vtxf_a12, 1.0); \n
                float vtxf_a13 = fract(czm_frameNumber / 240.0); \n
 
                float vtxf_h = clamp(v_elevationPos.z / ${e}.0, 0.0, 1.0); \n
                vtxf_a13 = abs(vtxf_a13 - 0.5) * 2.0; \n
                float vtxf_diff = step(0.005, abs(vtxf_h - vtxf_a13)); \n
                gl_FragColor.rgb += gl_FragColor.rgb * (1.0 - vtxf_diff); \n`},Li.prototype.getType=function(){return{label:"模型",value:"3DTileset"}},Mi.prototype.start=function(e,t={}){this.time=t.time,this.attr=t.attr,this.attrType=t.attrType,this.startPosition=t.startPosition,this.endPosition=t.endPosition,this.colors=t.colors||["rgb(255,0,0)","rgb(255,152,0)","rgb(0,255,0)"];let i=new Li(this._viewer);return this.tiltModel=i.create3DTilesets("拆迁模型",e,{},{groundCenter:this.startPosition},"0",!0,e=>{this.progress=0,this.useColor(t.useColor)}),this.tiltModel.position="start",this},Mi.prototype.useColor=function(e=!1){this._useColor=e,this.currentProgress(this.progress)},Mi.prototype.currentProgress=function(t){this.progress=t;let i,o=[];var r=parseInt((.5<t?1-t:t)*this.time*2);if("string"===this.attrType){for(let e=1;e<r;e++)i=.5<t?this._useColor?this.colors[0]:"rgba(255, 255, 255, 0)":this._useColor?this.colors[2]:"rgba(255, 255, 255, 0)",o.push(["${"+this.attr+"} === '"+e+"'",i]);i=this._useColor?this.colors[1]:"rgba(255, 255, 255, 0)",o.push(["${"+this.attr+"} === '"+r+"'",i]),.5<t?o.push(["true",this._useColor?this.colors[2]:"rgba(255, 255, 255, 1)"]):o.push(["true",this._useColor?this.colors[0]:"rgba(255, 255, 255, 1)"])}else o=this._useColor?.5<t?[["${"+this.attr+"} < "+r,this.colors[0]],["${"+this.attr+"} === "+r,this.colors[1]],["true",this.colors[2]]]:[["${"+this.attr+"} < "+r,this.colors[2]],["${"+this.attr+"} === "+r,this.colors[1]],["true",this.colors[1]]]:[["${"+attr+"} <= "+r,"rgba(255, 255, 255, 0)"],["true","rgba(255, 255, 255, 1)"]];this.tiltModel.item.style=new Cesium.Cesium3DTileStyle({color:{conditions:o}}),.5<t&&"start"===this.tiltModel.position?(this.tiltModel.setPosition(this.endPosition),this.tiltModel.position="end"):t<=.5&&"end"===this.tiltModel.position&&(this.tiltModel.setPosition(this.startPosition),this.tiltModel.position="start")},Mi.prototype.deleteObject=function(){this.tiltModel&&this.tiltModel.deleteObject()},Ai.prototype.measureTerrainPerimeter=function(e){return this._measureTerrainPerimeter.measureTerrainPerimeter(e)},Ai.prototype.depthTestAgainstTerrain=function(e){return this._depthTestAgainstTerrain.depthTestAgainstTerrain(e)},Ai.prototype.DrawPointBuffer=function(e,t,i){return this._bufferAnalysis.DrawPoint(e,t,i)},Ai.prototype.DrawPolylineBuffer=function(e,t,i){return this._bufferAnalysis.DrawPolyline(e,t,i)},Ai.prototype.DrawPolygonBuffer=function(e,t,i){return this._bufferAnalysis.DrawPolygon(e,t,i)},Ai.prototype.TerrainExcavation=function(e=100,t,i){let o=new Pi(this._viewer,this._cesium);return o.draw(e,t,i)},Ai.prototype.ShadowsAnalysis=function(){return this._shadowsAnalysis.createAnalysis()},Ai.prototype.createSkylineAnalysis=function(e){return this._skylineAnalysis.createSkylineAnalysis(e)},Ai.prototype.createEdgeStage=function(e){return this._EdgeStage.createEdgeStage(e)},Ai.prototype.clearSkylineAnalysis=function(){return this._skylineAnalysis.clear()},Ai.prototype.createScreenshot=function(e){return this._screenshot.createScreenshot(e)},Ai.prototype.ScreenshotCompared=function(e){return this._screenshot.createScreenshotCompared(e)},Ai.prototype.setPointFly=function(e){return this._PointFly.setPointFly(e)},Ai.prototype.createCircleScan=function(e,t,i,o,r){return new li(this._viewer,this._cesium).createCircleScan(e,t,i,o,r)},Ai.prototype.createMultiCircleScan=function(e,t,i,o,r){return new li(this._viewer,this._cesium).createMultiCircleScan(e,t,i,o,r)},Ai.prototype.createSectorScan=function(e,t,i,o,r,n,a){return new li(this._viewer,this._cesium).createSectorScan(e,t,i,o,r,n,a)},Ai.prototype.createRadarScan=function(e,t,i,o,r){return new li(this._viewer,this._cesium).createRadarScan(e,t,i,o,r)},Ai.prototype.UndergroundModelOpen=function(e,t){return this._UndergroundMode.UndergroundModelOpen(e,t)},Ai.prototype.UndergroundModelClose=function(){return this._UndergroundMode.close()},Ai.prototype.UndergroundMode=function(e,i){if(e){this._viewer.scene.globe.translucency.enabled||(this._viewer.scene.globe.translucency.enabled=!0,this._viewer.scene.screenSpaceCameraController.enableCollisionDetection=!1,this._viewer.scene.globe.translucency.backFaceAlpha=0,this.undergroundValue("set")),this._viewer.scene.globe.translucency.frontFaceAlpha=void 0!==i?i:.5;let t=this._viewer;return{get alpha(){return t.scene.globe.translucency.frontFaceAlpha},set alpha(e){t.scene.globe.translucency.frontFaceAlpha=e}}}this._viewer.scene.globe.translucency.enabled&&(this._viewer.scene.globe.translucency.enabled=!1,this._viewer.scene.screenSpaceCameraController.enableCollisionDetection=!0,this._viewer.scene.globe.translucency.backFaceAlpha=1,this.undergroundValue("get"))},Ai.prototype.undergroundValue=function(e){"set"===e?(this.defaultUnderground={highDynamicRange:this._viewer.scene.highDynamicRange,skyBox:this._viewer.scene.skyBox.show,fog:this._viewer.scene.fog.enabled,undergroundColor:this._viewer.scene.globe.undergroundColor},this._viewer.scene.highDynamicRange=!1,this._viewer.scene.skyBox.show=!1,this._viewer.scene.fog.enabled=!1,this._viewer.scene.globe.undergroundColor=void 0):(this._viewer.scene.highDynamicRange=this.defaultUnderground.highDynamicRange,this._viewer.scene.skyBox.show=this.defaultUnderground.skyBox,this._viewer.scene.fog.enabled=this.defaultUnderground.fog,this._viewer.scene.globe.undergroundColor=this.defaultUnderground.undergroundColor)},Ai.prototype.StreetViewOpen=function(e,t,i){return this._StreetView.StreetViewOpen(e,t,i)},Ai.prototype.ExitStreetView=function(){return this._StreetView.exit()},Ai.prototype.createWeather=function(e,t,i){return this._createWeather.createWeather(e,t,i)},Ai.prototype.createParticleEffect=function(e,t,i,o){let r=new Yt(this._viewer,this._cesium);return this._Particle||(this._Particle={}),this._Particle[e]||(this._Particle[e]=[]),this._Particle[e].push(r),r.createParticleEffect(e,t,i,o)},Ai.prototype.removeParticleEffect=function(e){this._Particle&&(this._Particle[e]&&this._Particle[e].forEach(e=>{e.deleteObject()}),this._Particle[e]=[])},Ai.prototype.demolition=function(e,t){let i=new Mi(this._viewer);return i.start(e,t)},Ai.prototype.measureTerrainHeight=function(e){return this._measureTerrainHeight.measureTerrainHeight(e)},Ai.prototype.createindoormode=function(){return this._createindoormode.createIndoormode()},Ai.prototype.Indoormodeclose=function(){return this._createindoormode.Indoormodeclose()},Ai.prototype.createterrainExaggeration=function(e){return this._createterrainExaggeration.createterrainExaggeration(e)},Ai.prototype.createCurtainContrast=function(e,t){return this._createcurtaincontrast.curtainContrast(e,t)},Ai.prototype.clearCurtainContrast=function(){return this._createcurtaincontrast.close()},Ai.prototype.measureTerrainArea=function(e){return this._measureTerrainArea.measureTerrainArea(e)},Ai.prototype.measureTerrainkPerimeter=function(e){return this._measureTerrainkPerimeter.measureTerrainkPerimeter(e)},Ai.prototype.createElevationContour=function(e,t,i){return this._elevationContour.createElevationContour(e,t,i)},Ai.prototype.createTerrainProfile=function(e){return this._createTerrainProfile.createTerrainProfile(e)},Ai.prototype.create3DViewshed=function(e){return this._create3DViewshed.startDraw(e),this._create3DViewshed},Ai.prototype.set3DViewshedOptions=function(e){return this._create3DViewshed.setOptions(e),this._create3DViewshed},Ai.prototype.add3DViewshed=function(e){return this._create3DViewshed.addViewshed(e),this._create3DViewshed},Ai.prototype.close3DViewshed=function(){return this._create3DViewshed.close()},Ai.prototype.createlineOfSight=function(e,t){return new Te(this._viewer,this._cesium).createlineOfSight(e,t)},Ai.prototype.createSightLine=function(e){let t=new Pt(this._viewer);return t.createSightLine(e)},Ai.prototype.SunshineAnalysisPoint=function(e,t){return this._SunshineAnalysis.sunshineAnalysisPoint(e,t)},Ai.prototype.SunshineAnalysisPolygon=function(e,t){return this._SunshineAnalysis.sunshineAnalysisPolygon(e,t)},Ri.prototype.Highvolume=function(e=[]){var t=this._cesium.PostProcessStageLibrary.createEdgeDetectionStage();t.uniforms.color=this._cesium.Color.BLUE,t.uniforms.length=.01,t.selected=e,this._viewer.scene.postProcessStages.add(this._cesium.PostProcessStageLibrary.createSilhouetteStage([t]))},Oi.prototype.createCircleScan=function(e,t,i,o){e=new this._cesium.Cartographic.fromDegrees(e.lon,e.lat),i=i?this._cesium.Color.fromCssColorString(i):new Cesium.Color(1,0,0,1);this.item=this.AddCircleScanPostStage(e,this._cesium.defaultValue(t,1500),i,this._cesium.defaultValue(o,4e3));o={id:this._core.getuid(),name:"新建扩散圆扫描",pId:0,type:"scan",item:this};return this.setTreeobj(o),this._tree.insertGroupId(o,0),this},Oi.prototype.createMultiCircleScan=function(e,t,i,o){e=new this._cesium.Cartographic.fromDegrees(e.lon,e.lat),i=i?this._cesium.Color.fromCssColorString(i):new Cesium.Color(1,0,0,1);this.item=this.AddCircleScanMultiPostStage(e,this._cesium.defaultValue(t,1500),i,this._cesium.defaultValue(o,4e3));o={id:this._core.getuid(),name:"新建扩散圆扫描",pId:0,type:"scan",item:this};return this.setTreeobj(o),this._tree.insertGroupId(o,0),this},Oi.prototype.createRadarScan=function(e,t,i,o){e=new this._cesium.Cartographic.fromDegrees(e.lon,e.lat),i=i?this._cesium.Color.fromCssColorString(i):new Cesium.Color(1,0,0,1);this.item=this.AddRadarScanPostStage(e,this._cesium.defaultValue(t,1500),i,this._cesium.defaultValue(o,4e3));o={id:this._core.getuid(),name:"新建雷达扫描",pId:0,type:"scan",item:this};return this.setTreeobj(o),this._tree.insertGroupId(o,0),this},Oi.prototype.createSectorScan=function(e,t,i,o,r,n){this._viewer;var a=this._cesium,e=new a.Cartographic.fromDegrees(e.lon,e.lat),i=i?a.Color.fromCssColorString(i):new a.Color(1,0,0,1);this.item=this.AddSectorScanPostStage(e,a.defaultValue(t,1500),i,o,r,a.defaultValue(n,4e3));n={id:this._core.getuid(),name:"新建扇形扩散扫描",pId:0,type:"scan",item:this};return this.setTreeobj(n),this._tree.insertGroupId(n,0),this},Oi.prototype.AddSectorScanPostStage=function(e,t,i,o,r,n){var a=this._viewer,s=this._cesium,l=s.Cartographic.toCartesian(e),u=new s.Cartesian4(l.x,l.y,l.z,1),e=new s.Cartographic(e.longitude,e.latitude,e.height+500),e=s.Cartographic.toCartesian(e),c=new s.Cartesian4(e.x,e.y,e.z,1);(new Date).getTime();var h=new s.Cartesian4,m=new s.Cartesian4,d=new s.Cartesian3,i=new s.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform float u_radius;\nuniform float u_maxRadius;\nuniform vec4 u_scanColor;\nuniform float u_angle;\nuniform float u_yaw;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nfloat getAngle(in vec3 dv)\n{\n    if(dv.y == 0.0 && dv.x > 0.0)\n    {\n        return 90.0;\n    }\n    if(dv.y == 0.0 && dv.x < 0.0)\n    {\n        return 270.0;\n    }\n    float angle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n    if(dv.x > 0.0)\n    {\n        if(dv.y < 0.0)\n        {\n            angle = 180.0 + angle;\n        }\n    }\n    if(dv.x <= 0.0)\n    {\n        if(dv.y < 0.0)\n        {\n            angle = 180.0 + angle;\n        }\n        if(dv.y > 0.0)\n        {\n            angle = 360.0 + angle;\n        }\n    }\n    return angle;\n}\nfloat ripple(float dist, float rippleIntensity, float rippleScale) {\n    return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n}\nvoid main()\n{\n   gl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n   float depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\n   vec4 viewPos = toEye(v_textureCoordinates, depth);\n   vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n   float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n   if(dis < u_radius)\n   {\n       vec3 worldCoordi = (czm_inverseView * vec4(prjOnPlane,1.0)).xyz - (czm_inverseView * u_scanCenterEC).xyz; \n       float angle = getAngle(worldCoordi);\n       float maxAngle =  fract((u_yaw + (u_angle/2.0))/360.0)*360.0;\n       float minAngle = fract((u_yaw - (u_angle/2.0) + 360.0)/360.0)*360.0;\n       bool showPixel = false;   \n       if(minAngle < maxAngle)\n       {\n           showPixel = angle > minAngle && angle < maxAngle;\n       }\n       else\n       {\n           showPixel = angle > minAngle || angle < maxAngle;\n       }\n       if(showPixel)\n       {\n           float f = dis / u_radius;\n           f = 1.0 - f;\n           gl_FragColor = mix(gl_FragColor, u_scanColor, f);\n           float intensity =step(0.001,ripple(dis + 0.1, 0.1, 15.0));\n           gl_FragColor.rgb += gl_FragColor.rgb * intensity;\n       }\n   }\n}\n",uniforms:{u_scanCenterEC:function(){return s.Matrix4.multiplyByVector(a.camera._viewMatrix,u,h)},u_scanPlaneNormalEC:function(){var e=s.Matrix4.multiplyByVector(a.camera._viewMatrix,u,h),t=s.Matrix4.multiplyByVector(a.camera._viewMatrix,c,m);return d.x=t.x-e.x,d.y=t.y-e.y,d.z=t.z-e.z,s.Cartesian3.normalize(d,d),d},u_radius:function(){return t},u_angle:function(){return o},u_yaw:function(){return r+150},u_maxRadius:t,u_scanColor:i}});return a.scene.postProcessStages.add(i)},Oi.prototype.AddCircleScanPostStage=function(e,t,i,o){var r=this._viewer,n=this._cesium,a=n.Cartographic.toCartesian(e),s=new n.Cartesian4(a.x,a.y,a.z,1),e=new n.Cartographic(e.longitude,e.latitude,e.height+500),e=n.Cartographic.toCartesian(e),l=new n.Cartesian4(e.x,e.y,e.z,1),u=(new Date).getTime(),c=new n.Cartesian4,h=new n.Cartesian4,m=new n.Cartesian3,i=new n.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform float u_radius;\nuniform vec4 u_scanColor;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\nfloat depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\nvec4 viewPos = toEye(v_textureCoordinates, depth);\nvec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\nfloat dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\nif(dis < u_radius)\n{\nfloat f = 1.0 -abs(u_radius - dis) / u_radius;\nf = pow(f, 4.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}\n}\n",uniforms:{u_scanCenterEC:function(){return n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,c)},u_scanPlaneNormalEC:function(){var e=n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,c),t=n.Matrix4.multiplyByVector(r.camera._viewMatrix,l,h);return m.x=t.x-e.x,m.y=t.y-e.y,m.z=t.z-e.z,n.Cartesian3.normalize(m,m),m},u_radius:function(){return t*(((new Date).getTime()-u)%o)/o},u_scanColor:i}});return r.scene.postProcessStages.add(i)},Oi.prototype.AddCircleScanMultiPostStage=function(e,t,i,o){var r=this._viewer,n=this._cesium,a=n.Cartographic.toCartesian(e),s=new n.Cartesian4(a.x,a.y,a.z,1),e=new n.Cartographic(e.longitude,e.latitude,e.height+500),e=n.Cartographic.toCartesian(e),l=new n.Cartesian4(e.x,e.y,e.z,1),u=(new Date).getTime(),c=new n.Cartesian4,h=new n.Cartesian4,m=new n.Cartesian3,d=0,p=0,g=0,i=new n.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform float u_radius1;\nuniform float u_radius2;\nuniform float u_radius3;\nuniform float u_maxRadius;\nuniform vec4 u_scanColor;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\nfloat depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\nvec4 viewPos = toEye(v_textureCoordinates, depth);\nvec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\nfloat dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\nif(dis < u_radius1)\n{\nfloat f = dis / u_radius1;\nf = pow(f, 9.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}else if(dis < u_radius2){\nfloat f = dis / u_radius2;\nf = pow(f, 9.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}else if(dis < u_radius3){\nfloat f = dis / u_radius3;\nf = pow(f, 9.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}\n}\n",uniforms:{u_scanCenterEC:function(){return n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,c)},u_scanPlaneNormalEC:function(){var e=n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,c),t=n.Matrix4.multiplyByVector(r.camera._viewMatrix,l,h);return m.x=t.x-e.x,m.y=t.y-e.y,m.z=t.z-e.z,n.Cartesian3.normalize(m,m),m},u_radius1:function(){return d},u_radius2:function(){return p},u_radius3:function(){var e=t*(((new Date).getTime()-u)%o)/o;return e<t/3&&0===p&&0===d?g=e:t/3<=e&&e<2*t/3&&0===d?p=(g=e)-t/3:2*t/3<=e?(p=(g=e)-t/3,d=g-2*t/3):e<t/3&&0!==p&&0!==d?(p=(d=e)+t/3,g=e+2*t/3):t/3<=e&&e<2*t/3&&0!==d&&(d=e-t/3,g=(p=e)+t/3),g},u_maxRadius:t,u_scanColor:i}});return r.scene.postProcessStages.add(i)},Oi.prototype.AddRadarScanPostStage=function(e,t,i,o){var r=this._viewer,n=this._cesium,a=n.Cartographic.toCartesian(e),s=new n.Cartesian4(a.x,a.y,a.z,1),a=new n.Cartographic(e.longitude,e.latitude,e.height+500),a=n.Cartographic.toCartesian(a),l=new n.Cartesian4(a.x,a.y,a.z,1),e=new n.Cartographic(e.longitude+n.Math.toRadians(.001),e.latitude,e.height),e=n.Cartographic.toCartesian(e),u=new n.Cartesian4(e.x,e.y,e.z,1),c=new n.Quaternion,h=new n.Matrix3,m=(new Date).getTime(),d=new n.Cartesian4,p=new n.Cartesian4,g=new n.Cartesian4,_=new n.Cartesian3,f=new n.Cartesian3,i=new n.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform vec3 u_scanLineNormalEC;\nuniform float u_radius;\nuniform vec4 u_scanColor;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nbool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)\n{\nvec3 v01 = testPt - ptOnLine;\nnormalize(v01);\nvec3 temp = cross(v01, lineNormal);\nfloat d = dot(temp, u_scanPlaneNormalEC);\nreturn d > 0.5;\n}\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)\n{\nvec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);\nreturn length(tempPt - ptOnLine);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\nfloat depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\nvec4 viewPos = toEye(v_textureCoordinates, depth);\nvec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\nfloat dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\nfloat twou_radius = u_radius * 2.0;\nif(dis < u_radius)\n{\nvec3 lineEndPt = vec3(u_scanCenterEC.xyz) + u_scanLineNormalEC * u_radius;\nfloat f = 0.0;\nif(isPointOnLineRight(u_scanCenterEC.xyz, u_scanLineNormalEC.xyz, prjOnPlane.xyz))\n{\nfloat dis1= length(prjOnPlane.xyz - lineEndPt);\nf = abs(twou_radius -dis1) / twou_radius;\nf = pow(f, 3.0);\n}\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}\n}\n",uniforms:{u_scanCenterEC:function(){return n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,d)},u_scanPlaneNormalEC:function(){var e=n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,d),t=n.Matrix4.multiplyByVector(r.camera._viewMatrix,l,p);return _.x=t.x-e.x,_.y=t.y-e.y,_.z=t.z-e.z,n.Cartesian3.normalize(_,_),_},u_radius:t,u_scanLineNormalEC:function(){var e=n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,d),t=n.Matrix4.multiplyByVector(r.camera._viewMatrix,l,p),i=n.Matrix4.multiplyByVector(r.camera._viewMatrix,u,g);_.x=t.x-e.x,_.y=t.y-e.y,_.z=t.z-e.z,n.Cartesian3.normalize(_,_),f.x=i.x-e.x,f.y=i.y-e.y,f.z=i.z-e.z;e=((new Date).getTime()-m)%o/o;return n.Quaternion.fromAxisAngle(_,e*n.Math.PI*2,c),n.Matrix3.fromQuaternion(c,h),n.Matrix3.multiplyByVector(h,f,f),n.Cartesian3.normalize(f,f),f},u_scanColor:i}});return r.scene.postProcessStages.add(i)},Oi.prototype.remove=function(){this._viewer.scene.postProcessStages.remove(this.item)},Oi.prototype.setTreeobj=function(e){this.treeobj=e},Oi.prototype.deleteObject=function(){this.item&&this._viewer.scene.postProcessStages.remove(this.item)},Oi.prototype.setVisibility=function(e){this.item&&(this.item.enabled=e)},Hi.prototype.executeScopefieldvision=function(){var h=this,t=(e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new h._cesium.CallbackProperty(function(){return e.hierarchy},!1),this.polygon=h._viewer.entities.add(this.options),h.item=this.polygon},e);function e(e){this.options={name:"",polygon:{fill:!0,hierarchy:[],height:0,perPositionHeight:!0,heightReference:h._cesium.HeightReference.CLAMP_TO_GROUND,material:h._cesium.Color.YELLOW.withAlpha(.3)}},this.hierarchy=e,this._init()}var m=new this._cesium.ScreenSpaceEventHandler(h._viewer.scene.canvas),d=[],p=void 0;return m.setInputAction(function(e){e=h._viewer.scene.camera.pickEllipsoid(e.position,h._viewer.scene.globe.ellipsoid);0==d.length&&d.push(e.clone()),d.push(e)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),m.setInputAction(function(e){e=h._viewer.scene.camera.pickEllipsoid(e.endPosition,h._viewer.scene.globe.ellipsoid);2<=d.length&&(h._cesium.defined(p)?null!=e&&(d.pop(),e.y+=1+Math.random(),d.push(e)):p=new t(d))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),m.setInputAction(function(e){m.destroy();var t={polygon:{},positions:[],area:[]};t.polygon=p;for(var i=[],o=0;o<d.length;o++){var r=h._cesium.Cartographic.fromCartesian(d[o]),n=h._cesium.Math.toDegrees(r.longitude),a=h._cesium.Math.toDegrees(r.latitude),r=r.height;i.push({lon:n,lat:a,hei:r}),h._polygonsd.push([n,a])}t.positions=i;var s=h._viewer.camera.heading,l=h._viewer.camera.pitch,u=h._viewer.camera.roll,c=h._viewer.camera.position.clone();h._xjwz={orientation:{heading:s,pitch:l,roll:u},position:c},h._viewer.scene.camera.moveEnd.addEventListener(function(){var e,t,i,o=h._viewer.camera.computeViewRectangle();o!=h._rectangle&&(e=(h._rectangle=o).west/Math.PI*180,t=o.north/Math.PI*180,i=o.east/Math.PI*180,o=o.south/Math.PI*180,h.exports([(e+i)/2,(t+o)/2],h._polygonsd)||null!=h._xjwz&&h._viewer.camera.setView({destination:h._xjwz.position,orientation:h._xjwz.orientation}))});u=0;h._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(u=we.selectedItem.id);c=h._core.getuid();we.insertGroupId({id:c,name:"视野范围面"+c,pId:h._core.isnull(u)?0:u,type:"polygon",item:h},h._core.isnull(u)?0:u),"function"==typeof method&&method(t)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},Hi.prototype.exports=function(e,t){for(var i=e[0],o=e[1],r=!1,n=0,a=t.length-1;n<t.length;a=n++){var s=t[n][0],l=t[n][1],u=t[a][0],c=t[a][1];o<l!=o<c&&i<(u-s)*(o-l)/(c-l)+s&&(r=!r)}return r},Vi.prototype.createPolyline=function(e,t,i,o,r){var n=[];if(e[0].x||e[0].y)if(void 0!==e[0].z)for(a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a].x,e[a].y,e[a].z));else for(a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a].x,e[a].y));else if(2===e[0].length)for(var a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a][0],e[a][1]));else if(3===e[0].length)for(var a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a][0],e[a][1],e[a][2]));i=2!==i;this.item=this._viewer.entities.add({polyline:{positions:n,width:10,material:new this._cesium.PolylineGlowMaterialProperty({outlineColor:this._cesium.Color.BLACK,color:new G(this._viewer,this._cesium).colorFromHtmlColor(t)}),clampToGround:i}});r={id:this.item.id,name:r,pId:this._core.isnull(o)?0:o,type:"polyline",item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(o)?0:o),this},Vi.prototype.getstyles=function(){var e={};return e.show=!this.item.polyline.show||this.item.polyline.show.getValue(),e.positions=this.item.polyline.positions.getValue().toString(),e.width=this.item.polyline.width.toString(),e.granularity=this.item.polyline.granularity?this.item.polyline.granularity.toString():null,e.material={},e.material.color=this.item.polyline.material&&this.item.polyline.material.color&&this.item.polyline.material.color._value?"rgba"+this.item.polyline.material.color.toString():null,e.material.outlineColor=this.item.polyline.material.outlineColor&&this.item.polyline.material.outlineColor._value?"rgba"+this.item.polyline.material.outlineColor.toString():null,e.material.outlineWidth=this.item.polyline.material.outlineWidth&&this.item.polyline.material.outlineWidth._value?this.item.polyline.material.outlineWidth.toString():null,e.classificationType=this.item.polyline.classificationType?this.item.polyline.classificationType.toString():null,e.near=this.item.polyline.distanceDisplayCondition?this.item.polyline.distanceDisplayCondition._value.near:null,e.far=this.item.polyline.distanceDisplayCondition?this.item.polyline.distanceDisplayCondition._value.far:null,e},Vi.prototype.createLink=function(e,t,i){i=i||{};var o,r,n,a,s,l=[],u=[];e.lon&&e.lat?void 0!==e.height?(l.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)),l.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height)),u.push({x:e.lon,y:e.lat,z:e.height},{x:t.lon,y:t.lat,z:t.height})):(l.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat)),l.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat)),u.push({x:e.lon,y:e.lat,z:0},{x:t.lon,y:t.lat,z:0})):e.x&&e.y?(void 0!==e.z?(l.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y,e.z)),l.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y,t.z))):(l.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y)),l.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y)),e.z=0,t.z=0),u.push(e,t)):2===e.length?(l.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1])),l.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1])),u.push({x:e[0],y:e[1],z:0},{x:t[0],y:t[1],z:0})):3===e.length&&(l.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2])),l.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])),u.push({x:e[0],y:e[1],z:e[2]},{x:t[0],y:t[1],z:t[2]})),1===i.lineType?i.material=new this._cesium.PolylineDashMaterialProperty({color:this._core.defaultValue(i.lineColor&&this._cesium.Color.fromCssColorString(i.lineColor),this._cesium.Color.AQUAMARINE)}):2===i.lineType?i.material=new this._cesium.PolylineGlowMaterialProperty({glowPower:.3,color:this._core.defaultValue(i.lineColor&&this._cesium.Color.fromCssColorString(i.lineColor),this._cesium.Color.BLUE)}):i.material=this._core.defaultValue(i.lineColor&&this._cesium.Color.fromCssColorString(i.lineColor),this._cesium.Color.AQUAMARINE),i.cylinder&&(o=u[1].z-u[0].z,r=Cesium.Cartesian3.fromDegrees(u[0].x,u[0].y,0),n=Cesium.Cartesian3.fromDegrees(u[1].x,u[0].y,0),a=this._core.getSpaceDistancem([r,n],this._cesium),e=0==o?Math.PI/2:Math.atan(a/o),t=this._core.getSpaceDistancem(l,this._cesium),n=Cesium.Cartesian3.fromDegrees(u[0].x,u[1].y,0),a=this._core.getSpaceDistancem([r,n],this._cesium),t=Math.asin(a/t),u[0].x>u[1].x&&u[0].y>u[1].y?t=o<0?-t:t:u[0].x>u[1].x&&u[0].y<u[1].y?t=0<=o?-t:t:u[0].x<u[1].x&&u[0].y<=u[1].y?(e=0!=o?-e:e,t=0<o?-t:t):u[0].x<u[1].x&&u[0].y>u[1].y&&(t=o<0?-t:t,e=-e),s=new Cesium.HeadingPitchRoll(0,e,t));var c=l[0];this.item=this._viewer.entities.add({position:new this._cesium.CallbackProperty(function(){return c},!1),orientation:i.cylinder?new this._cesium.CallbackProperty(function(){return Cesium.Transforms.headingPitchRollQuaternion(c,s)},!1):void 0,polyline:{positions:l,width:this._core.defaultValue(i.width,2),material:i.material,clampToGround:!1},cylinder:i.cylinder?{length:this._core.defaultValue(i.length,20),topRadius:this._core.defaultValue(i.size,8),bottomRadius:this._core.defaultValue(i.size,8),material:this._core.defaultValue(i.pointColor&&this._cesium.Color.fromCssColorString(i.pointColor),this._cesium.Color.RED)}:void 0,point:i.cylinder?void 0:{color:this._core.defaultValue(i.pointColor&&this._cesium.Color.fromCssColorString(i.pointColor),this._cesium.Color.RED),outlineColor:this._core.defaultValue(i.outlineColor&&this._cesium.Color.fromCssColorString(i.outlineColor),this._cesium.Color.YELLOW),outlineWidth:this._core.defaultValue(i.outlineWidth,2),pixelSize:this._core.defaultValue(i.size,8)}});var h=this._core.defaultValue(i.num,200),m=this._cesium.Math.lerp(u[0].x,u[1].x,1/h)-u[0].x,d=this._cesium.Math.lerp(u[0].y,u[1].y,1/h)-u[0].y,p=this._cesium.Math.lerp(u[0].z,u[1].z,1/h)-u[0].z,g=[];g.push(l[0]);for(let e=0;e<h;e++){var _=u[0].x+(e+1)*m,f=u[0].y+(e+1)*d,y=u[0].z+(e+1)*p;g.push(this._cesium.Cartesian3.fromDegrees(_,f,y))}g.push(l[1]);var v=this._core.defaultValue(i.speed,1),C=0;this._viewer.clock.onTick.addEventListener(function(){C+=v,((C=parseInt(C))>=g.length-1&&0<v||C<=0&&v<0)&&(v=-v),c=g[C]});i={id:this.item.id,name:"新建链路",pId:0,type:"polyline",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},Vi.prototype.createLinkPros=function(o){this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var r=[],n=null,t="0米",i=null,a=this,s="",l=this._core.CreateTooltip(),u={point:a._cesium.Color.RED,polyline:a._cesium.Color.BLUE};this._tree.handler.setInputAction(function(e){(i=a._getPosition.getMousePosition(e))&&(0===r.length?l.showAt(e.endPosition,"左键开始绘制!"):l.showAt(e.endPosition,"右键结束绘制!"),2<=r.length&&(a._cesium.defined(n)?(r.length>a._points.length&&r.pop(),r.push(i)):n=new c(r)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){a._viewer.camera.getPickRay(e.position),(i=a._getPosition.getMousePosition(e))&&(0!=r.length&&r.length>a._points.length?(r.pop(),r.push(i)):r.push(i,i),2<=r.length&&(a._cesium.defined(n)||(n=new c(r)),t=a._core.getSpaceDistance(r,a._cesium)),s="总长:"+t)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){a.end&&a.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{var t,i;l.show(!1),a._tree&&a._tree.handler.destroy(),a._core.mouse(a._viewer.container,0,"0"),a.end=void 0,n&&(t={width:4,lineColor:"#0000ff"},i=n.positions,a._tree&&a._tree.endtemporaryItem(),a._points[a._points.length-1]&&(a._points[a._points.length-1].label.text=s),a._viewer.entities.remove(a.item),"cancel"===e||r.length<2||(a.item=a._viewer.entities.add({name:"新建链路",polyline:{positions:i,width:a._core.defaultValue(t.width,2),material:a._core.getLinkMaterial(t.lineColor,t.pointColor,t.time),clampToGround:!0}}),o&&o(a.item)))};var c=(e.prototype._init=function(){var e=this;this.options.polyline.positions=new a._cesium.CallbackProperty(function(){return e.positions},!1);var t=a._viewer.entities.add(this.options);a.item=t,a._tree.temporaryItem.obj.push(t),a._core.getuid()},e);function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:u.polyline,width:3,clampToGround:!0}},this.positions=e,this._init()}return this},Vi.prototype.createLandingLine=function(e,t={}){var i=[];e.lon&&e.lat?(i.push(Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)),i.push(Cesium.Cartesian3.fromDegrees(e.lon,e.lat,0))):Array.isArray(e)?(i.push(Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2])),i.push(Cesium.Cartesian3.fromDegrees(e[0],e[1],0))):e instanceof Cesium.Cartesian3&&(i.push(e),e=this._core.toDegrees(e),i.push(Cesium.Cartesian3.fromDegrees(e.lon,e.lat,0))),this.item=this._viewer.entities.add({name:"新建接地线",polyline:{positions:new Cesium.CallbackProperty(function(){return i},!1),width:this._core.defaultValue(t.width,2),material:Cesium.Color.fromCssColorString(t.color||"#fff")}}),this.positions={get value(){return i},set value(e){i[0]=e;let t=Cesium.Cartographic.fromCartesian(e);t.height=0,i[1]=Cesium.Cartographic.toCartesian(t)}};t={id:this.item.id,name:"新建接地线",pId:0,type:"polyline",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,0),this},Vi.prototype.createLinkPro=function(e,t,i){i=i||{};var o=[],r=[];e.lon&&e.lat?void 0!==e.height?(o.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)),o.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height)),r.push({x:e.lon,y:e.lat,z:e.height},{x:t.lon,y:t.lat,z:t.height})):(o.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat)),o.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat)),r.push({x:e.lon,y:e.lat,z:0},{x:t.lon,y:t.lat,z:0})):e.x&&e.y?(void 0!==e.z?(o.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y,e.z)),o.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y,t.z))):(o.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y)),o.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y)),e.z=0,t.z=0),r.push(e,t)):2===e.length?(o.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1])),o.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1])),r.push({x:e[0],y:e[1],z:0},{x:t[0],y:t[1],z:0})):3===e.length&&(o.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2])),o.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])),r.push({x:e[0],y:e[1],z:e[2]},{x:t[0],y:t[1],z:t[2]})),this.item=this._viewer.entities.add({name:"新建链路",polyline:{positions:o,width:this._core.defaultValue(i.width,2),material:this._core.getLinkMaterial(i.lineColor,i.pointColor,i.time),clampToGround:i.clampToGround}});i={id:this.item.id,name:"新建链路",pId:0,type:"polyline",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},Vi.prototype.executePolyline=function(t,l){var u=this,i=(e.prototype._init=function(){var e=this;this.options.polyline.positions=new u._cesium.CallbackProperty(function(){return e.positions},!1),this.polyline=u._viewer.entities.add(this.options),u.item=this.polyline},e);function e(e){this.options={polyline:{show:!0,positions:[],material:new u._cesium.PolylineOutlineMaterialProperty({color:u._core.defaultValue(t.color,u._cesium.Color.YELLOW)}),clampToGround:u._core.defaultValue(t.clampToGround,!0),width:u._core.defaultValue(t.width,3)}},this.positions=e,this._init()}var c=new u._cesium.ScreenSpaceEventHandler(u._viewer.scene.canvas),h=[],m=void 0,d=this._core.CreateTooltip();return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),c.setInputAction(function(e){e=u._getPosition.getMousePosition(e);0==h.length&&h.push(e.clone()),h.push(e)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(e){0===h.length?d.showAt(e.endPosition,"左键开始绘制!"):d.showAt(e.endPosition,"右键结束绘制!");e=u._getPosition.getMousePosition(e);2<=h.length&&(u._cesium.defined(m)?null!=e&&(h.pop(),e.y+=1+Math.random(),h.push(e)):m=new i(h))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),c.setInputAction(function(e){d.show(!1);var t={polyline:{},positions:[],positionsp:[],distance:[],setDistance:function(){alert("qq")}};c.destroy(),t.polyline=m;for(var i=[],o=0;o<h.length;o++){var r=u._cesium.Cartographic.fromCartesian(h[o]),n=u._cesium.Math.toDegrees(r.longitude),a=u._cesium.Math.toDegrees(r.latitude),r=r.height;i.push({lon:n,lat:a,hei:r})}t.positions=i;for(var s=1;s<h.length;s++)t.distance[s-1]=f(h[s-1].y,h[s-1].x,h[s].y,h[s].x);t.positionsp=h,u._core.mouse(u._viewer.container,0,"0"),"function"==typeof l&&l(t)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},Vi.prototype.executePolyline1=function(t,e){this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var i,o,r=[],n=null,a="0米",s=null,l=this,u="",c=this._core.CreateTooltip(),h={name:"",spot:[],distance:[],label:[],ployline:[]},m={point:l._cesium.Color.RED,polyline:l._cesium.Color.YELLOW};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(m.point=e.point),""!=e.polyline&&null!=e.polyline&&(m.polyline=e.polyline)),this._tree.handler.setInputAction(function(e){(s=l._getPosition.getMousePosition(e))&&(0===r.length?c.showAt(e.endPosition,"左键开始绘制!"):c.showAt(e.endPosition,"右键结束绘制!"),2<=r.length&&(l._cesium.defined(n)?(r.length>l._points.length&&r.pop(),r.push(s)):n=new d(r),a=l._core.getSpaceDistance(r,l._cesium)),o&&(l._viewer.entities.remove(o),o=void 0),o=l._viewer.entities.add({name:"空间直线距离",position:r[r.length-1],label:{text:"总长:"+a,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),l._tree.temporaryItem.obj.push(o))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){l._viewer.camera.getPickRay(e.position),(s=l._getPosition.getMousePosition(e))&&(0!=r.length&&r.length>l._points.length?(r.pop(),r.push(s)):r.push(s,s),2<=r.length&&(l._cesium.defined(n)||(n=new d(r)),a=l._core.getSpaceDistance(r,l._cesium)),o&&(l._viewer.entities.remove(o),o=void 0),u="总长:"+(e=a),i=l._viewer.entities.add({name:"空间直线距离",position:r[r.length-1],point:{pixelSize:5,color:m.point,outlineColor:l._cesium.Color.WHITE,outlineWidth:2,clampToGround:!0},label:{text:e,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),l._tree.temporaryItem.obj.push(i),l._points.push(i),h.spot.push(s),h.distance.push(a),h.label.push(i))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){l.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){c.show(!1),l._tree&&l._tree.endtemporaryItem(),l.end=void 0,o&&(l._viewer.entities.remove(o),o=void 0,r.pop()),l._points[l._points.length-1]&&(l._points[l._points.length-1].label.text=u),l._tree&&l._tree.handler.destroy(),l._core.mouse(l._viewer.container,0,"0"),"cancel"!==e?(r.length<2&&l.deleteObject(),""!=t&&null!=t&&"function"==typeof t&&t(h)):l.deleteObject()};var d=(p.prototype._init=function(){var e=this;this.options.polyline.positions=new l._cesium.CallbackProperty(function(){return e.positions},!1);var t=l._viewer.entities.add(this.options);l.item=t,l._tree.temporaryItem.obj.push(t),h.ployline.push(t);t=l._core.getuid();h.name="新建空间距离"+t},p);function p(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:m.polyline,width:3,clampToGround:!1}},this.positions=e,this._init()}return this},Vi.prototype.executeHorizontal=function(t,e){var c=this;this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var i,o,r=[],n=null,a="0米",s=null,c=this,l="",u=this._core.CreateTooltip(),h={spot:[],distance:[],label:[],ployline:[]},m={point:c._cesium.Color.RED,polyline:c._cesium.Color.YELLOW};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(m.point=e.point),""!=e.polyline&&null!=e.polyline&&(m.polyline=e.polyline)),this._tree.handler.setInputAction(function(e){(s=c._getPosition.getMousePosition(e))&&(0===r.length?u.showAt(e.endPosition,"左键开始绘制!"):u.showAt(e.endPosition,"右键结束绘制!"),2<=r.length&&(c._cesium.defined(n)?(r.pop(),r.push(s)):n=new p(r),a=c._core.getSpaceDistance(r,c._cesium)),c._viewer.entities.remove(o),o=c._viewer.entities.add({name:"空间直线距离",position:r[r.length-1],label:{text:"总长:"+a,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),c._tree.temporaryItem.obj.push(o))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){c._viewer.camera.getPickRay(e.position),(s=c._getPosition.getMousePosition(e))&&(d(s),0==r.length&&r.push(s.clone()),r.push(s),l="总长:"+(e=a),i=c._viewer.entities.add({name:"空间直线距离",position:r[r.length-1],point:{pixelSize:5,color:m.point,outlineColor:c._cesium.Color.WHITE,outlineWidth:2,clampToGround:!0},label:{text:e,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),c._tree.temporaryItem.obj.push(i),c._points.push(i),h.spot.push(s),h.distance.push(a),h.label.push(i))},this._cesium.ScreenSpaceEventType.LEFT_CLICK);var d=function(e){polylineCartographic.push(e);var t=[];if(1<polylineCartographic.length){var i=polylineCartographic[polylineCartographic.length-2],o=polylineCartographic[polylineCartographic.length-1],r=1e7*Math.abs(i.longitude-o.longitude),n=1e7*Math.abs(i.latitude-o.latitude);n<r&&(n=r);var a=parseInt(n/10);(a=1e3<a?1e3:a)<2&&(a=2);for(var s=0;s<a;++s)t.push(new c._cesium.Cartographic(c._cesium.Math.lerp(i.longitude,o.longitude,s/(a-1)),c._cesium.Math.lerp(i.latitude,o.latitude,s/(a-1))))}else t=polylineCartographic;if(0<t.length)for(var l=0;l<t.length;l++){var e=t[l],u=c._viewer.scene.globe.getHeight(e);c._cesium.Cartesian3.fromDegrees(e.longitude/Math.PI*180,e.latitude/Math.PI*180,u)}};this._tree.handler.setInputAction(function(e){u.show(!1),c._tree.endtemporaryItem(),c._viewer.entities.remove(o),c._points[c._points.length-1].label.text=l,c._tree.handler.destroy(),r.pop(),""!=t&&null!=t&&"function"==typeof t&&t(h)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK);var p=(g.prototype._init=function(){var e=this;this.options.polyline.positions=new c._cesium.CallbackProperty(function(){return e.positions},!1);var t=c._viewer.entities.add(this.options);c.item=t,c._tree.temporaryItem.obj.push(t),h.ployline.push(t)},g);function g(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:m.polyline,width:3,clampToGround:!1}},this.positions=e,this._init()}return this},Vi.prototype.executeHorizontals=function(t,e){this._tree.removeHandler(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this._tree.starttemporaryItem(this._viewer);var c=this,i=[],o="",h=[],r=void 0,n=c._viewer.scene,l=n.globe.ellipsoid,a={name:"",spot:[],distance:[],label:[],polyline:[]},s={point:c._cesium.Color.RED,polyline:c._cesium.Color.YELLOW};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(s.point=e.point),""!=e.polyline&&null!=e.polyline&&(s.polyline=e.polyline));e=new c._cesium.BillboardCollection;n.primitives.add(e);var u=new c._cesium.WebMercatorProjection;this._tree.handler=new c._cesium.ScreenSpaceEventHandler(n.canvas);var m,d=this._core.CreateTooltip(),p=[];this._tree.handler.setInputAction(function(e){0===i.length?d.showAt(e.endPosition,"左键开始绘制!"):d.showAt(e.endPosition,"右键结束绘制!"),(e=c._getPosition.getMousePosition(e,a.polyline.concat(a.label)))&&c._cesium.Ellipsoid.WGS84.cartesianToCartographic(e)&&(e=e,i.length<1||(c._cesium.defined(r)?(r.path.pop(),r.path.push(e),p.pop(),p.push(e)):r=new _(i,c._cesium),e=g(p),m&&(c._viewer.entities.remove(m),m=void 0),m=c._viewer.entities.add({name:"空间直线距离",position:r.path[r.path.length-1],label:{text:"总长:"+e,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})))},c._cesium.ScreenSpaceEventType.MOUSE_MOVE);this._tree.handler.setInputAction(function(e){var t,e=c._getPosition.getMousePosition(e,a.polyline.concat(a.label));(t=e?c._cesium.Ellipsoid.WGS84.cartesianToCartographic(e):t)&&(e=e,0<p.length&&p.pop(),function(e){h.push(e);var t=[];if(1<h.length){var i=h[h.length-2],o=h[h.length-1],r=1e7*Math.abs(i.longitude-o.longitude),n=1e7*Math.abs(i.latitude-o.latitude);n<r&&(n=r);var a=parseInt(n/10);(a=1e3<a?1e3:a)<2&&(a=2);for(var s=0;s<a;++s)t.push(new c._cesium.Cartographic(c._cesium.Math.lerp(i.longitude,o.longitude,s/(a-1)),c._cesium.Math.lerp(i.latitude,o.latitude,s/(a-1))));t.push(o.clone())}else t=h;if(0<t.length)for(var l=0;l<t.length;l++){var e=t[l],u=c._viewer.scene.globe.getHeight(e),u=c._cesium.Cartesian3.fromRadians(e.longitude,e.latitude,u);p.push(u)}}(t),0===i.length?i.push(e,e):i.push(e),c._cesium.defined(r)||(r=new _(i,c._cesium)),m&&(c._viewer.entities.remove(m),m=void 0),t="0米",r&&(t=g(p)),p.push(e),o="总长:"+t,a.spot.push(e),a.distance.push(t),t=c._viewer.entities.add({position:e,point:{pixelSize:5,color:s.point,outlineColor:c._cesium.Color.WHITE,outlineWidth:1,clampToGround:!0},label:{text:t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),a.label.push(t),c._points.push(t))},c._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(){c.end()},c._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){c._tre&&c._tree.endtemporaryItem(),m&&c._viewer.entities.remove(m),c._points[c._points.length-1]&&(c._points[c._points.length-1].label.text=o),c._tree&&c._tree.handler.destroy(),c.end=void 0,c._core.mouse(c._viewer.container,0,"0"),i.pop(),d.show(!1),"cancel"!==e?(i.length<2&&c.deleteObject(),""!=t&&null!=t&&"function"==typeof t&&t(a)):c.deleteObject()};var g=function(e){for(var t,i,o,r,n=0,a="0米",s=0;s<e.length-1;s++)o=l.cartesianToCartographic(e[s]),t=(r=u.project(o)).x,i=r.y,o=l.cartesianToCartographic(e[s+1]),o=(r=u.project(o)).x,r=r.y,n+=Math.sqrt((t-o)*(t-o)+(i-r)*(i-r));return 0<n&&(a=n.toFixed(2)+"米"),a=1<=n/1e3?(n/1e3).toFixed(2)+"千米":a},_=(f.prototype._init=function(e){var t=this;this.options.polyline.positions=new c._cesium.CallbackProperty(function(){return t.path},!1),this.lineEntity=c._viewer.entities.add(this.options),c.item=this.lineEntity,a.polyline.push(this.lineEntity);var i=c._core.getuid();a.name="新建水平距离"+i},f);function f(e,t){if(!c._cesium.defined(e))throw new c._cesium.DeveloperError("positions is required!");if(e.length<2)throw new c._cesium.DeveloperError("positions 的长度必须大于等于2");c._cesium.Material.fromType(c._cesium.Material.ColorType).uniforms.color=new c._cesium.Color(1,1,0,.5),this.options={name:"直线",polyline:{show:!0,positions:[],material:s.polyline,width:3,clampToGround:!0}},this.path=e,this._init(c._cesium)}return this},Vi.prototype.getHeight=function(e){var t=this._cesium.Cartographic.fromCartesian(e[0]),t=this._cesium.Cartographic.fromCartesian(e[1]).height-t.height;return t=t<1e3?t.toFixed(2)+"米":(t/=1e3).toFixed(2)+"千米"},Vi.prototype.executeHeight=function(t){var r=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler(),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var n=[],i=null,a=0,o=this._core.CreateTooltip(),s=null;this._tree.handler.setInputAction(function(e){(s=r._getPosition.getMousePosition(e))&&(0===n.length?o.showAt(e.endPosition,"左键开始绘制!"):o.showAt(e.endPosition,"右键结束绘制!"),2<=n.length&&(r._cesium.defined(i)?(n.pop(),n.push(s)):i=new l(n),1<n.lenght&&(a=r._core.getHeight(n,r._cesium))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){(s=r._getPosition.getMousePosition(e))&&(e=a+"米",0==n.length?(n.push(s.clone()),n.push(s),e=r._viewer.entities.add({name:"高度",position:n[0],point:{pixelSize:5,color:r._cesium.Color.RED,outlineColor:r._cesium.Color.WHITE,outlineWidth:2,clampToGround:!0,heightReference:r._cesium.HeightReference.none},label:{text:e,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),r._tree.temporaryItem.obj.push(e),r._points.push(e)):1<=n.length&&(r._tree.endtemporaryItem(),""!=t&&null!=t&&"function"==typeof t&&t(n)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){r._tree.handler.destroy();var t=a+"米",i=r._cesium.Cartographic.fromCartesian(n[0]),o=r._cesium.Cartographic.fromCartesian(n[1]),o=r._cesium.Cartesian3.fromDegrees(cesium.Math.toDegrees(i.longitude),r._cesium.Math.toDegrees(i.latitude),o.height),t=r._viewer.entities.add({name:"直线距离",position:o,point:{pixelSize:5,color:r._cesium.Color.RED,outlineColor:r._cesium.Color.WHITE,outlineWidth:2,clampToGround:!0,heightReference:r._cesium.HeightReference.none},label:{text:t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});r._tree.temporaryItem.obj.push(t),r._points.push(t)},this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var l=(e.prototype._init3=function(){var o=this;this.options.polyline.positions=new r._cesium.CallbackProperty(function(){var e=[];e.push(o.positions[0]);var t=r._cesium.Cartographic.fromCartesian(o.positions[0]);try{var i=r._cesium.Cartographic.fromCartesian(o.positions[1])}catch(e){return}i=r._cesium.Cartesian3.fromDegrees(r._cesium.Math.toDegrees(t.longitude),r._cesium.Math.toDegrees(t.latitude),i.height);return e.push(i),e},!1);var e=r._viewer.entities.add(this.options);r.item=e,r._tree.temporaryItem.obj.push(e)},e);function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:r._cesium.Color.YELLOW,clampToGround:!0,width:3},ellipse:{show:!1,material:r._cesium.Color.GREEN.withAlpha(.5),clampToGround:!0,outline:!0}},this.positions=e,this._init3()}return this},Vi.prototype.executeHeightTe=function(t){this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var r,i=[],o=null,n=null,a=this,s={name:"",spot:[],kjdistance:"",spdistance:"",gddistance:"",point:[],polyline:[]},l=!1,u=this._core.CreateTooltip();function c(e){var t,i,o=a._cesium.Cartographic.fromCartesian(e[0]),r=a._cesium.Cartographic.fromCartesian(e[1]);return r.height,r.height,o.height,e=0<r.height-o.height?(t=a._cesium.Cartesian3.fromDegrees(a._cesium.Math.toDegrees(o.longitude),a._cesium.Math.toDegrees(o.latitude),r.height),i=[e[1],t],[e[0],t]):(t=a._cesium.Cartesian3.fromDegrees(a._cesium.Math.toDegrees(r.longitude),a._cesium.Math.toDegrees(r.latitude),o.height),i=[e[0],t],[e[1],t]),{new:t,eq_height:i,eq_lon_lat:e}}this._tree.handler.setInputAction(function(e){0===i.length?u.showAt(e.endPosition,"左键开始绘制!"):u.showAt(e.endPosition,"中键开启/关闭吸附,右键结束!"),(n=a._getPosition.getMousePosition(e,s.polyline.concat(s.point),0,l))&&2<=i.length&&(a._cesium.defined(o)?(i.pop(),i.push(n.clone()),r=c(i)):(o=new h(i),e=a._viewer.entities.add({name:"高度测量",position:new a._cesium.CallbackProperty(function(){return i[1]},!1),point:{pixelSize:5,color:a._cesium.Color.RED,outlineColor:a._cesium.Color.WHITE,outlineWidth:2,heightReference:a._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),a._tree.temporaryItem.obj.push(e),s.point.push(e),a._points.push(e),r=c(i),e=a._viewer.entities.add({position:new a._cesium.CallbackProperty(function(){return a._cesium.Cartesian3.midpoint(r.eq_lon_lat[0],r.eq_lon_lat[1],new a._cesium.Cartesian3)},!1),name:"等经纬度",polyline:{show:!0,positions:new a._cesium.CallbackProperty(function(){return r.eq_lon_lat},!1),material:a._cesium.Color.GOLD,width:2},label:{text:new a._cesium.CallbackProperty(function(){var e="米",t=i=a.getHeight(r.eq_lon_lat);t=-1!==i.indexOf("千米")?i.replace(e="千米",""):i.replace("米","");var i=(t=parseFloat(t))<0?(t=Math.abs(t))+e:t+e;return s.gddistance=i="高度:"+i},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),s.polyline.push(e),a._polylines.push(e),e=a._viewer.entities.add({position:new a._cesium.CallbackProperty(function(){return a._cesium.Cartesian3.midpoint(r.eq_height[0],r.eq_height[1],new a._cesium.Cartesian3)},!1),name:"等高度直线",polyline:{show:!0,positions:new a._cesium.CallbackProperty(function(){return r.eq_height},!1),material:a._cesium.Color.GOLD,width:2},label:{text:new a._cesium.CallbackProperty(function(){var e=a._core.getHorizontalDistance(r.eq_height,a._cesium);return s.spdistance=e="水平距离:"+e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),s.polyline.push(e),a._polylines.push(e)))},a._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){var t;(n=a._getPosition.getMousePosition(e,s.polyline.concat(s.point),0,l))&&(0==i.length?(i.push(n.clone()),i.push(n.clone()),r=c(i),t=a._viewer.entities.add({name:"高度测量",position:i[0],point:{pixelSize:5,color:a._cesium.Color.RED,outlineColor:a._cesium.Color.WHITE,outlineWidth:2,heightReference:a._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),a._tree.temporaryItem.obj.push(t),s.point.push(t),a._points.push(t)):2<=i.length&&(a._cesium.defined(o)?(i.pop(),i.push(n.clone()),r=c(i)):(o=new h(i),t=a._viewer.entities.add({name:"高度测量",position:new a._cesium.CallbackProperty(function(){return i[1]},!1),point:{pixelSize:5,color:a._cesium.Color.RED,outlineColor:a._cesium.Color.WHITE,outlineWidth:2,heightReference:a._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),a._tree.temporaryItem.obj.push(t),s.point.push(t),a._points.push(t),r=c(i),t=a._viewer.entities.add({position:new a._cesium.CallbackProperty(function(){return a._cesium.Cartesian3.midpoint(r.eq_lon_lat[0],r.eq_lon_lat[1],new a._cesium.Cartesian3)},!1),name:"等经纬度",polyline:{show:!0,positions:new a._cesium.CallbackProperty(function(){return r.eq_lon_lat},!1),material:a._cesium.Color.GOLD,width:2},label:{text:new a._cesium.CallbackProperty(function(){var e="米",t=i=a.getHeight(r.eq_lon_lat);t=-1!==i.indexOf("千米")?i.replace(e="千米",""):i.replace("米","");var i=(t=parseFloat(t))<0?(t=Math.abs(t))+e:t+e;return s.gddistance=i="高度:"+i},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),s.polyline.push(t),a._polylines.push(t),t=a._viewer.entities.add({position:new a._cesium.CallbackProperty(function(){return a._cesium.Cartesian3.midpoint(r.eq_height[0],r.eq_height[1],new a._cesium.Cartesian3)},!1),name:"等高度直线",polyline:{show:!0,positions:new a._cesium.CallbackProperty(function(){return r.eq_height},!1),material:a._cesium.Color.GOLD,width:2},label:{text:new a._cesium.CallbackProperty(function(){var e=a._core.getHorizontalDistance(r.eq_height,a._cesium);return s.spdistance=e="水平距离:"+e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),s.polyline.push(t),a._polylines.push(t))))},a._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){l=!l},a._cesium.ScreenSpaceEventType.MIDDLE_CLICK),this._tree.handler.setInputAction(function(e){a.end()},a._cesium.ScreenSpaceEventType.RIGHT_CLICK),this._tree.handler.setInputAction(function(e){a.end()},a._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.end=function(e){a._tree.handler.destroy(),u.show(!1),a.end=void 0,a._tree.endtemporaryItem(),a._core.mouse(a._viewer.container,0,"0"),"cancel"!==e?""!=t&&null!=t&&"function"==typeof t&&t(s):a.deleteObject()};var h=(e.prototype._init=function(){var o=this;this.options.polyline.positions=new a._cesium.CallbackProperty(function(){return o.positions},!1),this.options.position=new a._cesium.CallbackProperty(function(){return a._cesium.Cartesian3.midpoint(r.eq_height[0],r.eq_height[1],new a._cesium.Cartesian3)},!1),this.options.label.text=new a._cesium.CallbackProperty(function(){var e,t,i,i=(i=o.positions,e=a._cesium.Cartographic.fromCartesian(i[0]),t=a._cesium.Cartographic.fromCartesian(i[1]),(i=new a._cesium.EllipsoidGeodesic).setEndPoints(e,t),i=i.surfaceDistance,i=1e3<=(i=Math.sqrt(Math.pow(i,2)+Math.pow(t.height-e.height,2)))?(i/1e3).toFixed(2)+"千米":i.toFixed(2)+"米");return s.kjdistance=i="空间距离:"+i},!1);var e=a._viewer.entities.add(this.options);a.item=e,a._tree.temporaryItem.obj.push(e),s.polyline.push(e);e=a._core.getuid();s.name="新建垂直高度"+e},e);function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:a._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}return this},Vi.prototype.executeHeightTe1=function(t){this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var i=[],o=null,r=null,n=null,a=null,s=this,l={spot:[],kjdistance:"",spdistance:"",gddistance:"",point:[],polyline:[]},u=this._core.CreateTooltip();function c(e){var t=s._cesium.Cartographic.fromCartesian(e[0]),e=s._cesium.Cartographic.fromCartesian(e[1]);return e.height,e.height,t.height,s._cesium.Cartesian3.fromDegrees(s._cesium.Math.toDegrees(t.longitude),s._cesium.Math.toDegrees(t.latitude),e.height)}this._tree.handler.setInputAction(function(e){0===i.length?u.showAt(e.endPosition,"左键开始绘制!"):u.showAt(e.endPosition,"右键结束绘制!"),(a=s._getPosition.getMousePosition(e))&&2<=i.length&&(s._cesium.defined(o)?(i.pop(),i.push(a.clone()),c(i)):o=new h(i),s._cesium.define(r)||(r=new m(i)),s._cesium.define(n)||(n=new p(i)))},s._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){0==i.length&&(a=s._getPosition.getMousePosition(e))&&(i.push(a.clone()),i.push(a.clone()),c(i),e=s._viewer.entities.add({name:"高度测量",position:i[0],point:{pixelSize:5,color:s._cesium.Color.RED,outlineColor:s._cesium.Color.WHITE,outlineWidth:2,heightReference:s._cesium.HeightReference.none}}),s._tree.temporaryItem.obj.push(e),l.point.push(e))},s._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){s._tree.handler.destroy(),u.show(!1),s._tree.endtemporaryItem(),""!=t&&null!=t&&"function"==typeof t&&t(l)},s._cesium.ScreenSpaceEventType.RIGHT_CLICK);var h=(e.prototype._init=function(){var o=this;this.options.polyline.positions=new s._cesium.CallbackProperty(function(){return o.positions},!1),this.options.position=new s._cesium.CallbackProperty(function(){return o.positions[1].clone()},!1),this.options.label.text=new s._cesium.CallbackProperty(function(){var e,t,i,i=(i=o.positions,e=s._cesium.Cartographic.fromCartesian(i[0]),t=s._cesium.Cartographic.fromCartesian(i[1]),(i=new s._cesium.EllipsoidGeodesic).setEndPoints(e,t),i=i.surfaceDistance,i=1e3<=(i=Math.sqrt(Math.pow(i,2)+Math.pow(t.height-e.height,2)))?(i/1e3).toFixed(2)+"千米":i.toFixed(2)+"米");return l.kjdistance=i="空间距离:"+i},!1);var e=s._viewer.entities.add(this.options);s._tree.temporaryItem.obj.push(e),l.polyline.push(e)},e);function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:s._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}var m=(d.prototype._init=function(){var o=this;this.options.polyline.positions=new s._cesium.CallbackProperty(function(){return o.positions},!1),this.options.position=new s._cesium.CallbackProperty(function(){return o.positions[1].clone()},!1),this.options.label.text=new s._cesium.CallbackProperty(function(){var e,t,i,i=(i=o.positions,e=s._cesium.Cartographic.fromCartesian(i[0]),t=s._cesium.Cartographic.fromCartesian(i[1]),(i=new s._cesium.EllipsoidGeodesic).setEndPoints(e,t),i=i.surfaceDistance,i=1e3<=(i=Math.sqrt(Math.pow(i,2)+Math.pow(t.height-e.height,2)))?(i/1e3).toFixed(2)+"千米":i.toFixed(2)+"米");return l.kjdistance=i="空间距离:"+i},!1);var e=s._viewer.entities.add(this.options);s._tree.temporaryItem.obj.push(e),l.polyline.push(e)},d);function d(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:s._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}var p=(g.prototype._init=function(){var o=this;this.options.polyline.positions=new s._cesium.CallbackProperty(function(){return o.positions},!1),this.options.position=new s._cesium.CallbackProperty(function(){return o.positions[1].clone()},!1),this.options.label.text=new s._cesium.CallbackProperty(function(){var e,t,i,i=(i=o.positions,e=s._cesium.Cartographic.fromCartesian(i[0]),t=s._cesium.Cartographic.fromCartesian(i[1]),(i=new s._cesium.EllipsoidGeodesic).setEndPoints(e,t),i=i.surfaceDistance,i=1e3<=(i=Math.sqrt(Math.pow(i,2)+Math.pow(t.height-e.height,2)))?(i/1e3).toFixed(2)+"千米":i.toFixed(2)+"米");return l.kjdistance=i="空间距离:"+i},!1);var e=s._viewer.entities.add(this.options);s._tree.temporaryItem.obj.push(e),l.polyline.push(e)},g);function g(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:s._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}return this},Vi.prototype.executeAngle=function(t){this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var o,r,n,a,s=[],l=null,u=null,c=this,h={name:"",spot:[],kjdistance:"",spdistance:"",gddistance:"",point:[],polyline:[],labels:[]},m=!1,d=this._core.CreateTooltip();function p(e){var t,i,o=c._cesium.Cartographic.fromCartesian(e[0]),r=c._cesium.Cartographic.fromCartesian(e[1]);return r.height,r.height,o.height,e=0<r.height-o.height?(t=c._cesium.Cartesian3.fromDegrees(c._cesium.Math.toDegrees(o.longitude),c._cesium.Math.toDegrees(o.latitude),r.height),i=[e[1],t],[e[0],t]):(t=c._cesium.Cartesian3.fromDegrees(c._cesium.Math.toDegrees(r.longitude),c._cesium.Math.toDegrees(r.latitude),o.height),i=[e[0],t],[e[1],t]),{new:t,eq_height:i,eq_lon_lat:e}}this._tree.handler.setInputAction(function(e){var t,i;0===s.length?d.showAt(e.endPosition,"左键开始绘制!"):d.showAt(e.endPosition,"中键开启/关闭吸附,右键结束!"),(u=c._getPosition.getMousePosition(e,h.polyline.concat(h.point),0,m))&&2<=s.length&&(t=c._core.ElevationAngle(n,u,c._cesium),e=i="",e=n.z<=u.z?(i="角度:"+(90-Math.abs(t)).toFixed(2),"角度:"+Math.abs(t).toFixed(2)):(i="角度:"+Math.abs(t).toFixed(2),"角度:"+(90-Math.abs(t)).toFixed(2)),r.label.text=i,c._cesium.defined(l)?(a.position.setValue(u),a.label.text=e):(a=c._viewer.entities.add({position:u,name:"等经纬度",label:{text:e,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),h.labels.push(a),c._points.push(a)),c._cesium.defined(l)?(s.pop(),s.push(u.clone()),o=p(s)):(l=new g(s),e=c._viewer.entities.add({name:"角度测量",position:new c._cesium.CallbackProperty(function(){return s[1]},!1),point:{pixelSize:5,color:c._cesium.Color.RED,outlineColor:c._cesium.Color.WHITE,outlineWidth:2,heightReference:c._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),c._tree.temporaryItem.obj.push(e),h.point.push(e),c._points.push(e),o=p(s),e=c._viewer.entities.add({position:new c._cesium.CallbackProperty(function(){return s[0]},!1),name:"等经纬度",polyline:{show:!0,positions:new c._cesium.CallbackProperty(function(){return o.eq_lon_lat},!1),material:c._cesium.Color.GOLD,width:2}}),h.polyline.push(e),c._polylines.push(e),e=c._viewer.entities.add({position:new c._cesium.CallbackProperty(function(){return s[1]},!1),name:"等高度直线",polyline:{show:!0,positions:new c._cesium.CallbackProperty(function(){return o.eq_height},!1),material:c._cesium.Color.GOLD,width:2}}),h.polyline.push(e),c._polylines.push(e)))},c._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){var t,i;(u=c._getPosition.getMousePosition(e,h.polyline.concat(h.point),0,m))&&(0==s.length?(n=u,r=c._viewer.entities.add({position:u,name:"等经纬度",label:{text:"0",font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),h.labels.push(r),i=c._viewer.entities.add({position:new c._cesium.CallbackProperty(function(){return c._cesium.Cartesian3.midpoint(o.eq_lon_lat[0],o.eq_lon_lat[1],new c._cesium.Cartesian3)},!1),label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),s.push(u.clone()),s.push(u.clone()),o=p(s),t=c._viewer.entities.add({name:"高度测量",position:s[0],point:{pixelSize:5,color:c._cesium.Color.RED,outlineColor:c._cesium.Color.WHITE,outlineWidth:2,heightReference:c._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),c._tree.temporaryItem.obj.push(t),h.point.push(t),c._points.push(r,t)):2<=s.length&&(c._cesium.defined(l)?(s.pop(),s.push(u.clone()),o=p(s)):(l=new g(s),t=c._viewer.entities.add({name:"高度测量",position:new c._cesium.CallbackProperty(function(){return s[1]},!1),point:{pixelSize:5,color:c._cesium.Color.RED,outlineColor:c._cesium.Color.WHITE,outlineWidth:2,heightReference:c._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),c._tree.temporaryItem.obj.push(t),h.point.push(t),c._points.push(t),o=p(s),i=c._viewer.entities.add({position:new c._cesium.CallbackProperty(function(){return c._cesium.Cartesian3.midpoint(o.eq_lon_lat[0],o.eq_lon_lat[1],new c._cesium.Cartesian3)},!1),name:"等经纬度",polyline:{show:!0,positions:new c._cesium.CallbackProperty(function(){return o.eq_lon_lat},!1),material:c._cesium.Color.GOLD,width:2},label:{text:new c._cesium.CallbackProperty(function(){var e="米",t=i=c.getHeight(o.eq_lon_lat);t=-1!==i.indexOf("千米")?i.replace(e="千米",""):i.replace("米","");var i=(t=parseFloat(t))<0?(t=Math.abs(t))+e:t+e;return h.gddistance=i="高度:"+i},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),h.polyline.push(i),c._polylines.push(i),i=c._viewer.entities.add({position:new c._cesium.CallbackProperty(function(){return c._cesium.Cartesian3.midpoint(o.eq_height[0],o.eq_height[1],new c._cesium.Cartesian3)},!1),name:"等高度直线",polyline:{show:!0,positions:new c._cesium.CallbackProperty(function(){return o.eq_height},!1),material:c._cesium.Color.GOLD,width:2},label:{text:new c._cesium.CallbackProperty(function(){var e="角度:"+(e=c._core.ElevationAngle(firtP,u,c._cesium)).toFixed(2);return h.spdistance=e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(60,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),h.polyline.push(i),c._polylines.push(i))))},c._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){m=!m},c._cesium.ScreenSpaceEventType.MIDDLE_CLICK),this._tree.handler.setInputAction(function(e){c.end()},c._cesium.ScreenSpaceEventType.RIGHT_CLICK),this._tree.handler.setInputAction(function(e){c.end()},c._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.end=function(e){c._tree.handler.destroy(),d.show(!1),c._tree.endtemporaryItem(),c.end=void 0,c._core.mouse(c._viewer.container,0,"0"),"cancel"!==e?""!=t&&null!=t&&"function"==typeof t&&(this.labels=h.labels,t(h)):c.deleteObject()};var g=(e.prototype._init=function(){var e=this;this.options.polyline.positions=new c._cesium.CallbackProperty(function(){return e.positions},!1),this.options.position=new c._cesium.CallbackProperty(function(){return c._cesium.Cartesian3.midpoint(e.positions[0],e.positions[1],new c._cesium.Cartesian3)},!1);var t=c._viewer.entities.add(this.options);c.item=t,c._tree.temporaryItem.obj.push(t),h.polyline.push(t);t=c._core.getuid();h.name="新建垂直高度"+t},e);function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:c._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}return this},Vi.prototype.executeHeightDg=function(e){this._tree.removeHandler();var r=this;this._tree.handler=new r._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas);var n,a=[],t=null,i=null;this._tree.handler.setInputAction(function(e){(i=r._getPosition.getMousePosition(e))&&2<=a.length&&(r._cesium.defined(t)?(a.pop(),a.push(i.clone()),n=point_conf(a)):t=new o(a))},r._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){0==a.length&&(i=r._getPosition.getMousePosition(e))&&(a.push(i.clone()),a.push(i.clone()),r._viewer.entities.add({parent:measure_entities,name:"多边形面积",position:a[0],point:{pixelSize:5,color:r._cesium.Color.RED,outlineColor:r._cesium.Color.WHITE,outlineWidth:2,heightReference:r._cesium.HeightReference.none}}))},r._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){r._tree.handler.destroy();var t=[],i=[];t.push(a[0].clone()),t.push(n.clone());var o=r.getHeight(t);r._viewer.entities.add({parent:measure_entities,name:"等经纬度",position:t[0].clone(),polyline:{show:!0,clampToGround:!0,positions:t,material:new r._cesium.PolylineDashMaterialProperty({color:r._cesium.Color.RED}),width:2},label:{text:o,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),i.push(n.clone()),i.push(a[1].clone()),o=getDistance(i)+"千米",r._viewer.entities.add({parent:measure_entities,name:"等高度直线",position:i[0].clone(),polyline:{show:!0,positions:i,clampToGround:!0,material:new r._cesium.PolylineDashMaterialProperty({color:r._cesium.Color.RED}),width:2},label:{text:o,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(60,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})},r._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var o=(s.prototype._init=function(){var e=this;this.options.polyline.positions=new r._cesium.CallbackProperty(function(){return e.positions},!1),this.options.position=new r._cesium.CallbackProperty(function(){return e.positions[1].clone()},!1),this.options.label.text=new r._cesium.CallbackProperty(function(){return getSpaceDistance(e.positions)},!1),r._viewer.entities.add(this.options)},s);function s(e){this.options={parent:measure_entities,name:"直线",polyline:{show:!0,positions:[],clampToGround:!0,material:r._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}},Vi.prototype.executeAnge=function(t){var i=this;this._tree.removeHandler(),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var o,r=[],n=null,a="",s=null,l=0,u={spot:[],distance:0,label:{},angle:0};this._tree.handler.setInputAction(function(e){i._viewer.camera.getPickRay(e.endPosition),(s=i._getPosition.getMousePosition(e))&&(2<=r.length&&(i._cesium.defined(n)?(r.pop(),r.push(s)):n=new h(r),a=i._core.getSpaceDistance(r,i._cesium)),e=a,i._viewer.entities.remove(o),1<r.length&&(l=(180*Math.atan2(r[1].y-r[0].y,r[1].x-r[0].x)/Math.PI).toFixed(0),o=i._viewer.entities.add({name:"空间直线距离",position:r[r.length-1],label:{text:e+";"+l+"度",font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})))},i._cesium.ScreenSpaceEventType.MOUSE_MOVE);var c=0;this._tree.handler.setInputAction(function(e){0<c&&(i._tree.handler.destroy(),r.pop()),i._viewer.camera.getPickRay(e.position),(s=i._getPosition.getMousePosition(e))&&(0==r.length&&r.push(s.clone()),r.push(s),u.spot.push(s),u.distance=a,u.label=o,i._points.push(o),u.angle=l,1==c&&""!=t&&null!=t&&"function"==typeof t&&t(u),c+=1)},i._cesium.ScreenSpaceEventType.LEFT_CLICK);var h=(e.prototype._init6=function(){var e=this;this.options.polyline.positions=new i._cesium.CallbackProperty(function(){return e.positions},!1);var t=i._viewer.entities.add(this.options);i.item=t},e);function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:i._cesium.Color.YELLOW,width:3,clampToGround:!0}},this.positions=e,this._init6()}return this},Vi.prototype.executeProfile=function(e,i){var o=this;this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var r,n=[],a=[],s=null,l=e.parameterd,u=e.objid,c=e.cyjj,a=[],h=0,m=this._core.CreateTooltip(),d=null,p={spot:[],min:0,max:0,distance:0,label:{},cys:0,gcs:[]};this._tree.handler.setInputAction(function(e){0===n.length?m.showAt(e.endPosition,"左键开始绘制!"):m.showAt(e.endPosition,"再次点击结束绘制!");var t,i=o._viewer.camera.getPickRay(e.endPosition);d=o._viewer.scene.globe.pick(i,o._viewer.scene),!o._viewer.scene.pick(e.endPosition)||(t=o._viewer.scene.pickPosition(e.endPosition))&&(d=t),d&&(2<=n.length&&(o._cesium.defined(s)?(n.pop(),n.push(d)):s=new _(n),h=o._core.getSpaceDistance(n,o._cesium)),t=h,o._viewer.entities.remove(r),1<n.length&&((180*Math.atan2(n[1].y-n[0].y,n[1].x-n[0].x)/Math.PI).toFixed(0),r=o._viewer.entities.add({name:"空间直线距离",position:n[n.length-1],label:{text:t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),o._tree.temporaryItem.obj.push(r),o._points.push(r)))},o._cesium.ScreenSpaceEventType.MOUSE_MOVE);var g=0;this._tree.handler.setInputAction(function(e){0<g&&(o._tree.handler.destroy(),n.pop(),m.show(!1));var t=o._viewer.camera.getPickRay(e.position);d=o._viewer.scene.globe.pick(t,o._viewer.scene),!o._viewer.scene.pick(e.position)||(t=o._viewer.scene.pickPosition(e.position))&&(d=t),d&&(0==n.length&&n.push(d.clone()),a.push(d),n.push(d),p.spot.push(d),p.label=r,1==g?(o._tree.endtemporaryItem(),o._core.getPmfx(a,l,c,o._cesium,o._viewer,function(e){p.distance=e.juli,p.gcs=e.gcs,p.gcs=e.gcs,p.cys=e.cys,p.max=e.max,p.min=e.min,p.obj=o,m.show(!1),""!=i&&null!=i&&"function"==typeof i&&i(p)})):(e.position.x,e.position.y),g+=1)},o._cesium.ScreenSpaceEventType.LEFT_CLICK);var _=(t.prototype._init10=function(){var e=this;this.options.polyline.positions=new o._cesium.CallbackProperty(function(){return e.positions},!1);var t=o._viewer.entities.add(this.options);o.item=t,o._tree.temporaryItem.obj.push(t),o._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||we.selectedItem.id;t=o._core.getuid(),t={id:t,name:"新建剖面分析"+t,pId:o._core.isnull(u)?0:u,type:"polyline",item:o};o.setTreeobj(t),we.insertGroupId(t,o._core.isnull(u)?0:u)},t);function t(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:o._cesium.Color.YELLOW,width:2,clampToGround:!0}},this.positions=e,this._init10()}return this},Vi.prototype.executeProfilePro=function(e,t){var i=this;this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var o=[],r=null,n=e.parameterd,a=e.objid,s=e.cyjj,l=this._core.CreateTooltip(),u=null,c={spot:[],min:0,max:0,distance:0,label:{},cys:0,gcs:[]};this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this._tree.handler.setInputAction(function(e){3<=o.length?l.showAt(e.endPosition,"右键结束绘制"):l.showAt(e.endPosition,"点击绘制剖面点");var t=i._viewer.camera.getPickRay(e.endPosition);u=i._viewer.scene.globe.pick(t,i._viewer.scene),!i._viewer.scene.pick(e.endPosition)||(e=i._viewer.scene.pickPosition(e.endPosition))&&(u=e),u&&2<=o.length&&(i._cesium.defined(r)?(o.pop(),o.push(u)):r=new h(o))},i._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){i.end()},i._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){i._tree.handler.destroy(),i._core.mouse(i._viewer.container,0),i._tree.endtemporaryItem(),"pc"==i._core.getBrowser().pc&&o.pop(),l.show(!1),i.end=void 0,"cancel"!==e?o.length<=1?window.layuiLayer&&window.layuiLayer.msg("剖面点小于两点,请重新绘制"):(c.spot=o,i._core.getPmfxPro(o,n,s,i._cesium,i._viewer,function(e){c.distance=e.juli,c.gcs=e.gcs,c.cys=e.cys,c.max=e.max,c.min=e.min,c.allPoint=e.allPoint,""!=t&&null!=t&&"function"==typeof t&&t(c)})):i.item&&i._viewer.entities.remove(i.item)},this._tree.handler.setInputAction(function(e){var t=i._viewer.camera.getPickRay(e.position);u=i._viewer.scene.globe.pick(t,i._viewer.scene),!i._viewer.scene.pick(e.position)||(e=i._viewer.scene.pickPosition(e.position))&&(u=e),u&&(0===o.length&&o.push(u.clone()),o.push(u),2<o.length&&(i._cesium.defined(r)||(r=new h(o))))},i._cesium.ScreenSpaceEventType.LEFT_CLICK);var h=(m.prototype._init10=function(){var e=this;this.options.polyline.positions=new i._cesium.CallbackProperty(function(){return e.positions},!1);var t=i._viewer.entities.add(this.options);i.item=t,i._tree.temporaryItem.obj.push(t),i._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||we.selectedItem.id;t=i._core.getuid(),t={id:t,name:"新建剖面分析"+t,pId:i._core.isnull(a)?0:a,type:"polyline",item:i};i.setTreeobj(t),we.insertGroupId(t,i._core.isnull(a)?0:a)},m);function m(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:i._cesium.Color.YELLOW,width:2,clampToGround:!0}},this.positions=e,this._init10()}return this},Vi.prototype.executeAngeSdcs=function(o){var r=this;this._tree.removeHandler(),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var n,a=[],s=null,l=[],u=this._core.CreateTooltip(),c="",h=null,m=0,d={spot:[],distance:0,label:{},angle:0};this._tree.handler.setInputAction(function(e){var t,i;0===a.length?u.showAt(e.endPosition,"左键开始绘制!"):u.showAt(e.endPosition,"再次点击结束绘制!"),r._viewer.camera.getPickRay(e.endPosition),(h=r._getPosition.getMousePosition(e))&&2<=a.length&&(r._cesium.defined(s)?(a.pop(),a.push(h)):s=new g(a),c=r._core.getSpaceDistance(a,r._cesium),2<=p&&(r._viewer.entities.remove(n),i=r._cesium.Cartographic.fromCartesian(a[a.length-1]),t=r._cesium.Math.toDegrees(i.longitude),e=r._cesium.Math.toDegrees(i.latitude),i=i.height,l[2]={lon:t,lat:e,hei:i},m=r._core.Angle(l[0],l[1],l[2]).toFixed(1),n=r._viewer.entities.add({name:"三点角度测量",position:a[a.length-1],label:{text:m+"度",font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),r._points.push(n)))},r._cesium.ScreenSpaceEventType.MOUSE_MOVE);var p=0;this._tree.handler.setInputAction(function(e){var t,i;1<p&&(r._tree.handler.destroy(),a.pop()),r._viewer.camera.getPickRay(e.position),(h=r._getPosition.getMousePosition(e))&&(0==a.length&&a.push(h.clone()),a.push(h),i=r._cesium.Cartographic.fromCartesian(a[a.length-1]),t=r._cesium.Math.toDegrees(i.longitude),e=r._cesium.Math.toDegrees(i.latitude),i=i.height,l.push({lon:t,lat:e,hei:i}),d.spot.push(h),d.distance=c,2==p&&(u.show(!1),d.label=n,d.angle=m,""!=o&&null!=o&&"function"==typeof o&&o(d)),p+=1)},r._cesium.ScreenSpaceEventType.LEFT_CLICK);var g=(e.prototype._init6=function(){var e=this;this.options.polyline.positions=new r._cesium.CallbackProperty(function(){return e.positions},!1);var t=r._viewer.entities.add(this.options);r.item=t},e);function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:r._cesium.Color.YELLOW,width:3,clampToGround:!1}},this.positions=e,this._init6()}return this},Vi.prototype.executeAngeSd=function(o){this._tree.removeHandler();var r=[];this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw);var n=this,a=[],s=void 0,l=[],u=[];this._tree.starttemporaryItem(this._viewer);var c=this._core.CreateTooltip(),h=(e.prototype._init=function(){var e=this;this.options.polyline.positions=new n._cesium.CallbackProperty(function(){return e.positionsp},!1),this.polyline=n._viewer.entities.add(this.options),n._tree.temporaryItem.obj.push(this.polyline),n.item=this.polyline},e);function e(e){this.options={polyline:{show:!0,positions:[],material:n._cesium.Color.YELLOW,width:3,clampToGround:!1}},this.positionsp=e,this._init()}this._tree.handler=new n._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas);var m=[],d=void 0;if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._viewer.entities.remove(this._points[t]);return this._tree.handler.setInputAction(function(e){var t,i=n._getPosition.getMousePosition(e);i&&(l.push(i),n._cesium.Cartographic.fromCartesian(i),0==m.length?(m.push(i.clone()),m.push(i.clone()),s=i.clone()):(t=n._core.ElevationAngle(s,i,n._cesium),1==r.length?u.push("俯仰角1 "+t.toFixed(2)):u.push("俯仰角2 "+t.toFixed(2)),d=void 0,(m=[]).push(s.clone()),m.push(s.clone()),d=new h(m),r.push(d.polyline)),2<=u.length&&(c.show(!1),e=n._core.ThreePointAzimuth(l[0],l[1],l[2],n._cesium),u.push("水平角 "+e.toFixed(2)),i=n._viewer.entities.add({name:"三点角度测量",position:l[1],label:{text:u[0],font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),n._tree.temporaryItem.obj.push(i),t=n._viewer.entities.add({name:"三点角度测量",position:l[2],label:{text:u[1],font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),n._tree.temporaryItem.obj.push(t),e=n._viewer.entities.add({name:"三点角度测量",position:l[0],label:{text:u[2],font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),n._tree.temporaryItem.obj.push(e),a.push(i),a.push(t),a.push(e),m.pop(),n._tree.handler.destroy(),n._core.mouse(n._viewer.container,0,"0"),n._tree.endtemporaryItem(),n._points=a,n._polylines=r,n._polylines1=r,""!=o&&null!=o&&"function"==typeof o&&o({polylines:r,labels:a,angles:u})))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){var t=n._getPosition.getMousePosition(e);t&&(0===m.length?c.showAt(e.endPosition,"左键开始绘制!"):m.length<=3?c.showAt(e.endPosition,"点击绘制目标点!"):c.showAt(e.endPosition,"再次点击结束绘制!"),2<=m.length&&(n._cesium.defined(d)?null!=t&&(m.pop(),t.y+=1+Math.random(),m.push(t)):(d=new h(m),r.push(d.polyline))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},Vi.prototype.deleteObject=function(){if(this.item&&this.item.item?this._viewer.entities.remove(this.item.item):this._viewer.entities.remove(this.item),this._points&&0<this._points.length){for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e]);this._points=[]}if(this._polylines&&0<this._polylines.length){for(e=0;e<this._polylines.length;e++)this._viewer.entities.remove(this._polylines[e]);this._polylines=[]}if(this.labels&&0<this.labels.length){for(e=0;e<this.labels.length;e++)this._viewer.entities.remove(this.labels[e]);this.labels=[]}if(this.item&&this.item._points&&0<this.item._points.length){for(e=0;e<this.item._points.length;e++)this._viewer.entities.remove(this.item._points[e]);this.item._points=[]}if(this.item&&this.item._polylines&&0<this.item._polylines.length){for(e=0;e<this.item._polylines.length;e++)this._viewer.entities.remove(this.item._polylines[e]);this.item._polylines=[]}},Vi.prototype.setHeightType=function(e){try{1==e?this.item._polyline.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._polyline.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._polyline.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},Vi.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=this.item.polyline.positions.getValue(),i=null==this.item.polyline.width?void 0:this.item.polyline.width._value,o=this.item.polyline.material;null!=o&&(o={color:null==o.color?void 0:"rgba("+o.color._value.red+","+o.color._value.green+","+o.color._value.blue+","+o.color._value.alpha+")",image:null==o.image?void 0:o.image._value,diffusemap:null==o.diffusemap?void 0:o.diffusemap._value,alphamap:null==o.alphamap?void 0:o.alphamap._value});var r=null==this.item.polyline.clampToGround?void 0:this.item.polyline.clampToGround._value,n=this.item.polyline.distanceDisplayCondition,a=null==n?void 0:n._value.near,n=null==n?void 0:n._value.far;return{type:"polyline",treeobj:{name:this.treeobj.name},style:{show:e,positions:t,width:i,material:o,clampToGround:r,near:a,far:n}}},Vi.prototype.setVisibility=function(e){if(this.item&&this.item.item?this.item.item.show=e:this.item.show=e,this.item&&this.item._points&&0<this.item._points.length)for(var t=0;t<this.item._points.length;t++)this.item._points[t].show=e;if(this._polylines&&0<this._polylines.length)for(t=0;t<this._polylines.length;t++)this._polylines[t].show=e;if(this._points&&0<this._points.length)for(t=0;t<this._points.length;t++)this._points[t].show=e;if(this.item&&this.item._polylines&&0<this.item._polylines.length)for(t=0;t<this.item._polylines.length;t++)this.item._polylines[t].show=e},Vi.prototype.getVisibility=function(){return this.item.show},Vi.prototype.setOutlinewidth=function(e){this.item._polyline.material.outlineWidth=e},Vi.prototype.setMaterial=function(e){try{this._core.extend({outlineWidth:3},e,!0);this.item._polyline.material=new this._cesium.PolylineGlowMaterialProperty(e),this.item.material=this.item._polyline.material}catch(e){console.log(e)}return this},Vi.prototype.setPolylineWall=function(e){try{for(var t=[],i=[],o=this.item._polyline.positions.getValue(),r=this._viewer.scene.globe.ellipsoid,n=0;n<o.length;n++){var a=new this._cesium.Cartesian3(o[n].x,o[n].y,o[n].z),s=r.cartesianToCartographic(a),l=this._cesium.Math.toDegrees(s.latitude),u=this._cesium.Math.toDegrees(s.longitude);t.push(u),t.push(l),i.push(e)}t=this._cesium.Cartesian3.fromDegreesArray(t),this.item.wall=new this._cesium.WallGraphics({positions:t,minimumHeights:i,material:this.item._polyline.material.color._value})}catch(e){console.log(e)}return this},Vi.prototype.setRadius=function(e){try{for(var t=[],i=this.item._polyline.positions.getValue(),o=this._viewer.scene.globe.ellipsoid,r=0;r<i.length;r++){var n=new this._cesium.Cartesian3(i[r].x,i[r].y,i[r].z),a=o.cartesianToCartographic(n),s=this._cesium.Math.toDegrees(a.latitude),l=this._cesium.Math.toDegrees(a.longitude);t.push(l),t.push(s)}t=this._cesium.Cartesian3.fromDegreesArray(t),this.item.corridor=new this._cesium.CorridorGraphics({positions:t,width:e,show:!0,outline:!0,material:this._cesium.Color.RED.withAlpha(.4),heightReference:this._cesium.HeightReference.none})}catch(e){console.log(e)}return this},Vi.prototype.setGlow=function(e){try{this.item._polyline.material=e?new this._cesium.PolylineGlowMaterialProperty({glowPower:.2,taperPower:.5,color:this.item._polyline.material.color}):new this._cesium.PolylineOutlineMaterialProperty({color:this.item._polyline.material.color,outlineWidth:this.item._polyline.material.outlineWidth,outlineColor:this.item._polyline.material.outlineColor}),this.item.material=this.item._polyline.material}catch(e){console.log(e)}return this},Vi.prototype.setMaterialAlpha=function(e){try{this.item._polyline.material.color._value.alpha=e,this.item.material=this.item._polyline.material}catch(e){console.log(e)}return this},Vi.prototype.setType=function(e){try{"PolylineDashMaterialProperty"==e?this.item._polyline.material=new this._cesium.PolylineDashMaterialProperty({color:this.item._polyline.material.color}):"PolylineArrowMaterialProperty"==e?this.item._polyline.material=new this._cesium.PolylineArrowMaterialProperty({color:this.item._polyline.material.color}):"PolylineOutlineMaterialProperty"==e&&(this.item._polyline.material=new this._cesium.PolylineOutlineMaterialProperty({color:this.item._polyline.material.color}))}catch(e){console.log(e)}return this},Vi.prototype.setMaterialColor=function(e){try{this.item._polyline.material.color=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Vi.prototype.setOutlineColor=function(e){try{this.item._polyline.material.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Vi.prototype.setClampToGround=function(e){try{this.item._polyline.clampToGround=e}catch(e){console.log(e)}return this},Vi.prototype.setWidth=function(e){try{this.item._polyline.width=e}catch(e){console.log(e)}return this},Vi.prototype.setDistanceDisplayCondition=function(e,t){t=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._polyline.distanceDisplayCondition=t}catch(e){console.log(e)}return this},Object.defineProperties(Vi.prototype,{HighLight:{set:function(e){e&&(this.item.material=this.item.polyline.material),this.item.polyline.material=e?new this._cesium.PolylineGlowMaterialProperty({glowPower:.8,color:this._cesium.Color.ORANGERED.withAlpha(.9)}):this.item.material}},polylinemMterial:{set:Ce.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.polyline.material=e,this.item.material=this.item.polyline.material)},500),get:function(){var e=this.item.polyline.material;if(e)try{return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}},polylinemArcType:{set:Ce.debounce(function(e){this._core.isnull(e)||(this.item.polyline.arcType=e)},500),get:function(){var e=this.item.polyline.arcType;if(e)return e._value}},polylineWidth:{set:Ce.debounce(function(e){this._core.isnull(e)||(e=parseFloat(e),this.item.polyline.width=e)},500),get:function(){var e=this.item.polyline.width;if(e)return e._value}}}),Object.defineProperties(Vi.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Object.defineProperties(Vi.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(Vi.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(Vi.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(Vi.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(Vi.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Vi.prototype.setItem=function(e){this.item=e},Vi.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(Vi.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(Vi.prototype,{polylineTempOptions:{get:function(){return{positions:[],arcType:ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE}}}}),Object.defineProperties(Vi.prototype,{MaterialColor:{get:function(){return new G(this._viewer,this._cesium).toHtmlColor("rgb("+255*this.item._polyline.material.color._value.red+","+255*this.item._polyline.material.color._value.green+","+255*this.item._polyline.material.color._value.blue+")")}},Height:{get:function(){return this.item._polyline.height}},Visibility:{get:function(){return this.item.show}},Outlinewidth:{get:function(){return this.item._polyline.material.outlineWidth._value}},OutlineColor:{get:function(){var e=this.item._polyline.material.outlineColor;return e?(e=e._value,new G(this._viewer,this._cesium).toHtmlColor("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")")):"#ff0000"}},ClampToGround:{get:function(){return this.item._polyline.clampToGround}},Width:{get:function(){return this.item._polyline.width._value}},Type:{get:function(){return this.item._polyline.material instanceof this._cesium.PolylineDashMaterialProperty?"PolylineDashMaterialProperty":this.item._polyline.material instanceof this._cesium.PolylineArrowMaterialProperty?"PolylineArrowMaterialProperty":"PolylineOutlineMaterialProperty"}},Glow:{get:function(){return this.item._polyline.material instanceof this._cesium.PolylineGlowMaterialProperty}},MaterialAlpha:{get:function(){return 100*this.item._polyline.material.color._value.alpha}}}),Vi.prototype.CreatePolyline=function(e,t,i,o,r){this._Geometry=e;i={color:this._cesium.Color.YELLOW,outlineColor:this._cesium.Color.BLACK,width:10,show:!0,AltitudeType:this._cesium.defaultValue(i,999)};t&&""!==t&&(i.color=new G(this._viewer,this._cesium).colorFromHtmlColor(t));for(var n=[],a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a].x,e[a].y));this.item=this._viewer.entities.add({name:r,polyline:{positions:n,width:i.width,material:new this._cesium.PolylineGlowMaterialProperty({outlineColor:i.outlineColor,color:i.color})}});r={id:this.item.id,name:r,pId:this._core.isnull(o)?0:o,type:"polyline",item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(o)?0:o),this},Vi.prototype.forceEndHanlder=function(){this.handler&&(this.handler.destroy(),this.handler=void 0),this._tree.handler&&(this._tree.handler.destroy(),this._tree.handler=void 0)},ki.prototype.createPolygon=function(e,t,i,o,r){var n,a=[];if(e[0]instanceof Array){if(2===e[0].length){for(var s=0;s<e.length;s++)a.push(e[s][0],e[s][1]);n=this._cesium.Cartesian3.fromDegreesArray(a)}else if(3===e[0].length){for(s=0;s<e.length;s++)a.push(e[s][0],e[s][1],e[s][2]);n=this._cesium.Cartesian3.fromDegreesArrayHeights(a)}}else if(e[0].z){for(s=0;s<e.length;s++)a.push(e[s].x,e[s].y,e[s].z);n=this._cesium.Cartesian3.fromDegreesArrayHeights(a)}else{for(s=0;s<e.length;s++)a.push(e[s].x,e[s].y);n=this._cesium.Cartesian3.fromDegreesArray(a)}"string"==typeof t&&(t={fillColor:t}),this.item=this._viewer.entities.add({name:r,polygon:{hierarchy:new this._cesium.PolygonHierarchy(n),material:new G(this._viewer,this._cesium).colorFromHtmlColor(t.fillColor),heightReference:this._core.defaultValue(i,1),perPositionHeight:1!==i,outline:!0,outlineWidth:this._core.defaultValue(t.outlineWidth,1),outlineColor:new G(this._viewer,this._cesium).colorFromHtmlColor(this._core.defaultValue(t.outlineColor,t.fillColor))}});r={id:this.item.id,name:r||"新建面"+this._core.getuid(),pId:this._core.isnull(o)?0:o,type:"polygon",item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(o)?0:o),this},ki.prototype.getstyles=function(){var e={};return e.show=!this.item.polygon.show||this.item.polygon.show._value,e.hierarchy=this.item.polygon.hierarchy?this.item.polygon.hierarchy.getValue().positions.toString():null,e.height=this.item.polygon.height?this.item.polygon.height._value:null,e.heightReference=this.item.polygon.heightReference?this.item.polygon.heightReference._value:null,e.extrudedHeight=this.item.polygon.extrudedHeight?this.item.polygon.extrudedHeight.getValue():null,e.extrudedHeightReference=this.item.polygon.extrudedHeightReference?this.item.polygon.extrudedHeightReference.toString():null,e.stRotation=this.item.polygon.stRotation?this.item.polygon.stRotation._value:null,e.granularity=this.item.polygon.granularity?this.item.polygon.granularity._value:null,e.fill=this.item.polygon.fill?this.item.polygon.fill._value:null,e.material={},e.material.color=this.item.polygon.material&&this.item.polygon.material.color&&this.item.polygon.material.color._value?"rgba"+this.item.polygon.material.color.toString():null,e.material.image=this.item.polygon.material&&this.item.polygon.material.image?this.item.polygon.material.image._value:null,e.material.repeat=this.item.polygon.material&&this.item.polygon.material.repeat&&this.item.polygon.material.repeat._value?this.item.polygon.material.repeat._value:null,e.outline=this.item.polygon.outline?this.item.polygon.outline._value:null,e.outlineWidth=this.item.polygon.outlineWidth?this.item.polygon.outlineWidth._value:null,e.outlineColor=this.item.polygon.outlineColor&&this.item.polygon.outlineColor._value?"rgba"+this.item.polygon.outlineColor.toString():null,e.perPositionHeight=this.item.polygon.perPositionHeight?this.item.polygon.perPositionHeight.toString():null,e.closeTop=this.item.polygon.closeTop?this.item.polygon.closeTop.toString():null,e.closeBottom=this.item.polygon.closeBottom?this.item.polygon.closeBottom.toString():null,e.arcType=this.item.polygon.arcType?this.item.polygon.arcType.toString():null,e.classificationType=this.item.polygon.classificationType?this.item.polygon.classificationType.toString():null,e.near=this.item.polygon.distanceDisplayCondition?this.item.polygon.distanceDisplayCondition._value.near:null,e.far=this.item.polygon.distanceDisplayCondition?this.item.polygon.distanceDisplayCondition._value.far:null,e},ki.prototype.createCloudMap=function(e,t,i,o){var r=[],n=this;r.push(t.minx,t.miny),r.push(t.maxx,t.miny),r.push(t.maxx,t.maxy),r.push(t.minx,t.maxy);r=this._cesium.Cartesian3.fromDegreesArray(r);o=this._core.defaultValue(o,1);var a=0,s=0;this.item=this._viewer.entities.add({name:e,polygon:{hierarchy:new this._cesium.PolygonHierarchy(r),material:new Cesium.ImageMaterialProperty({image:new this._cesium.CallbackProperty(function(){return 30<(s+=o)&&(s=0,++a>i.length-1&&(a=0)),i[a]},!1),color:new this._cesium.CallbackProperty(function(){return n._cesium.Color.WHITE.withAlpha(s<15?.5+s/30:1.5-s/30)},!1),repeat:new n._cesium.Cartesian2(1,1)})}});e={id:this.item.id,name:e,pId:0,type:"polygon",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},ki.prototype.createSector=function(e,t,c,i,o){var r={fillColor:this._cesium.Color.YELLOW.withAlpha(.5),outlineColor:this._cesium.Color.YELLOW},n=2*Math.PI/360*o,o=Math.sin(n)*t,n=function(e,t,i){var o={a:6378137,b:6356752.3142,f:1/298.257223563};function r(e){return e*Math.PI/180}function n(e){return 180*e/Math.PI}var a=o.a,s=o.b,l=o.f,u=+e.lon,c=+e.lat,h=i,m=r(t),o=Math.sin(m),e=Math.cos(m),i=(1-l)*Math.tan(r(c)),t=1/Math.sqrt(1+i*i),m=i*t,d=Math.atan2(i,e),c=t*o,i=1-c*c,a=i*(a*a-s*s)/(s*s),p=1+a/16384*(4096+a*(a*(320-175*a)-768)),g=a/1024*(256+a*(a*(74-47*a)-128)),_=h/(s*p),f=2*Math.PI;for(;1e-12<Math.abs(_-f);){var y=Math.cos(2*d+_),v=Math.sin(_),C=Math.cos(_);f=_,_=h/(s*p)+g*v*(y+g/4*(C*(2*y*y-1)-g/6*y*(4*v*v-3)*(4*y*y-3)))}a=m*v-t*C*e,a=Math.atan2(m*C+t*v*e,(1-l)*Math.sqrt(c*c+a*a)),e=Math.atan2(v*o,t*C-m*v*e),i=l/16*i*(4+l*(4-3*i));return{lon:u+n(e-(1-i)*l*c*(_+i*v*(y+i*C*(2*y*y-1)))),lat:n(a)}}(e,i,Math.cos(n)*t),t={lon:e.lon,lat:e.lat,height:e.height},o={lon:n.lon,lat:n.lat,height:e.height+o},l=6378137,u=6356725,h=this,a=function(e,t){var i=[],o=function(e,t,i,o){var r=p(e),n=p(i),a=p(i)-p(e),s=p(o)-p(t);return s=(s=2*Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2)+Math.cos(r)*Math.cos(n)*Math.pow(Math.sin(s/2),2))))*l,s=Math.round(1e4*s)/1e4,{anglew:h._core.TwoPointAzimuth(t,e,o,i),distance:s}}(e.lat,e.lon,t.lat,t.lon),r=o.anglew,n=o.distance;i.push(e.lon,e.lat,e.height);for(var a=r-c/2,s=null;a<r+c/2;a++)s=function(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),n=i*Math.cos(o*Math.PI/180),i=u+(l-u)*(90-e)/90,o=i*Math.cos(e*Math.PI/180),t=180*(r/o+t*Math.PI/180)/Math.PI,e=180*(n/i+e*Math.PI/180)/Math.PI;return[t,e]}(e.lat,e.lon,n,a),i.push(s[0],s[1],t.height+10*a);return i}(t,o),o=document.createElement("canvas");o.id="0-a",o.width=800,o.height=800,document.body.appendChild(o);o=document.createElement("canvas");o.id="0-b",o.width=800,o.height=800;var m="a";document.body.appendChild(o);var d=1,o=new Cesium.CallbackProperty(function(e,t){var i=document.getElementById("0-"+m),o=i.getContext("2d");function r(e,t,i){o.beginPath(),o.arc(400,800,i,n(e),n(t),!1),o.stroke()}function n(e){return(e-=90)*Math.PI/180}o.strokeStyle="red",o.lineWidth=15,o.clearRect(0,0,800,800);var a,s,l,u=o.createLinearGradient(0,800,0,0);return u.addColorStop(0,"rgba(255,0,0,0.6)"),u.addColorStop(1,"rgba(255,0,0,0)"),a=-c/2,s=c/2,l=d+600,o.beginPath(),o.arc(400,800,l,n(a),n(s),!1),o.stroke(),o.lineTo(400,800),o.closePath(),o.fillStyle=u,o.fill(),r(-c/2,c/2,d+100),r(-c/2,c/2,d+200),r(-c/2,c/2,d+300),r(-c/2,c/2,d+400),r(-c/2,c/2,d+500),r(-c/2,c/2,d+600),d<100?d+=1:d=1,m="a"===m?"b":"a",i},!1);function p(e){return e*Math.PI/180}return this.item=this._viewer.entities.add({polygon:{hierarchy:new this._cesium.PolygonHierarchy(this._cesium.Cartesian3.fromDegreesArrayHeights(a)),material:new this._cesium.ImageMaterialProperty({image:o,transparent:!0}),perPositionHeight:!0,outlineColor:r.outlineColor}}),this},ki.prototype.setImageMaterialProperty=function(){var r=this,e=document.createElement("canvas");e.id="0-a",e.width=700,e.height=100;var t=document.createElement("canvas");t.id="0-b",t.width=700,t.height=100,document.body.appendChild(e),document.body.appendChild(t);t=new r._cesium.CallbackProperty(function(e,t){var i=document.getElementById("0-"+r.curCanvas),o=i.getContext("2d");return i.strokeStyle="1px solid red",o.strokeStyle="red",o.fillStyle="red",o.save(),o.translate(100,100),o.arc(0,0,100,0,180*Math.PI/180),o.restore(),o.stroke(),r.curCanvas="a"===r.curCanvas?"b":"a",i},!1);return new r._cesium.ImageMaterialProperty({image:t,transparent:!0})},ki.prototype.executeSector=function(t,e){var l=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler();var i,o,r=this._viewer,n=0,a={fillColor:l._cesium.Color.YELLOW.withAlpha(.5),outlineColor:l._cesium.Color.YELLOW};e&&e.fillColor&&(a.fillColor=e.fillColor),e&&e.outlineColor&&(a.outlineColor=e.outlineColor),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(l._viewer.scene.canvas),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw);var s,u,c=[],h=this._core.CreateTooltip();this.item=void 0,this.end=e=>{l._tree.handler.destroy(),l._tree.handler=null,h.show(!1),l._core.mouse(l._viewer.container,0,"0"),this.end=void 0,"cancel"!==e?(l.item&&(l.item.polygon.hierarchy=new l._cesium.PolygonHierarchy(l._cesium.Cartesian3.fromDegreesArray(c))),"function"==typeof t&&t(l.item,{position:i,angle:s,distance:u})):l.item&&r.entities.remove(l.item)},this._tree.handler.setInputAction(function(e){e=l._getPosition.getMouseDegrees(e);0===n?(i={lon:e.lon,lat:e.lat,height:e.height},n++):l.end&&l.end()},l._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){l.end&&l.end("cancel")},l._cesium.ScreenSpaceEventType.RIGHT_CLICK),this._tree.handler.setInputAction(function(e){0!==n?(h.showAt(e.endPosition,"再次点击结束绘制,右键取消"),o=l._getPosition.getMouseDegrees(e),c=function(e,t){var i=[],t=function(e,t,i,o){var r=p(e),n=p(i),a=p(i)-p(e),s=p(o)-p(t);return s=(s=2*Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2)+Math.cos(r)*Math.cos(n)*Math.pow(Math.sin(s/2),2))))*m,s=Math.round(1e4*s)/1e4,{angle:l._core.TwoPointAzimuth(t,e,o,i),distance:s}}(e.lat,e.lon,t.lat,t.lon);s=t.angle,u=t.distance,i.push(e.lon,e.lat);for(var o=s-30,r=null;o<s+30;o++)r=function(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),n=i*Math.cos(o*Math.PI/180),i=d+(m-d)*(90-e)/90,o=i*Math.cos(e*Math.PI/180),t=180*(r/o+t*Math.PI/180)/Math.PI,e=180*(n/i+e*Math.PI/180)/Math.PI;return[t,e]}(e.lat,e.lon,u,o),i.push(r[0],r[1]);return i}(i,o),l.item||(l.item=r.entities.add({polygon:{hierarchy:new l._cesium.PolygonHierarchy(l._cesium.Cartesian3.fromDegreesArray(c)),material:new l._cesium.ColorMaterialProperty(a.fillColor),outlineColor:a.outlineColor,fill:!0}}),l.item.polygon.hierarchy=new l._cesium.CallbackProperty(function(){return new l._cesium.PolygonHierarchy(l._cesium.Cartesian3.fromDegreesArray(c))},!1))):h.showAt(e.endPosition,"点击开始绘制")},l._cesium.ScreenSpaceEventType.MOUSE_MOVE);var m=6378137,d=6356725;function p(e){return e*Math.PI/180}return this},ki.prototype.executePolygon=function(t,s){var l=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler();var i=(e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new l._cesium.CallbackProperty(function(){return e.hierarchy},!1),this.polygon=l._viewer.entities.add(this.options),l.item=this.polygon,l._tree.temporaryItem.obj.push(this.polygon)},e);function e(e){this.options={name:"",polygon:{hierarchy:[],heightReference:l._core.defaultValue(t.heightReference,1),perPositionHeight:0===t.heightReference,material:l._core.defaultValue(t.material,l._cesium.Color.YELLOW.withAlpha(.5))}},this.hierarchy=e,this._init()}this._tree.handler=new this._cesium.ScreenSpaceEventHandler(l._viewer.scene.canvas);var u=[],o={},c=void 0;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw);var h=this._core.CreateTooltip();return this._tree.handler.setInputAction(function(e){e=l._getPosition.getMousePosition(e);0==u.length&&u.push(e.clone()),u.push(e),o=new l._cesium.PolygonHierarchy(u)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){0===u.length?h.showAt(e.endPosition,"左键开始绘制!"):u.length<=2?h.showAt(e.endPosition,"点击继续绘制!"):h.showAt(e.endPosition,"右键结束绘制!");e=l._getPosition.getMousePosition(e);2<=u.length&&(l._cesium.defined(c)?null!=e&&(u.pop(),e.y+=1+Math.random(),u.push(e),o=new l._cesium.PolygonHierarchy(u)):(o=new l._cesium.PolygonHierarchy(u),c=new i(o)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){l._tree.endtemporaryItem(),l._tree.handler.destroy(),h.show(!1);var t={polygon:{},positions:[],area:[]};t.polygon=c;for(var i=[],o=0;o<u.length;o++){var r=l._cesium.Cartographic.fromCartesian(u[o]),n=l._cesium.Math.toDegrees(r.longitude),a=l._cesium.Math.toDegrees(r.latitude),r=r.height;i.push({lon:n,lat:a,hei:r})}t.positions=i,l._core.mouse(l._viewer.container,0,"0"),"function"==typeof s&&s(t)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},ki.prototype.executePolygonvideo=function(a,t){var s=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler();var i=(e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new s._cesium.CallbackProperty(function(){return e.hierarchy},!1),this.polygon=s._viewer.entities.add(this.options),m.style.transform="rotate("+t.angle+"deg)",this.polygon.polygon.stRotation=s._cesium.Math.toRadians(t.angle),s.item=this.polygon,s._tree.temporaryItem.obj.push(this.polygon)},e);function e(e){this.options={name:"",polygon:{hierarchy:[],heightReference:s._cesium.HeightReference.CLAMP_TO_GROUND,classificationType:s._cesium.ClassificationType.BOTH,material:s._cesium.Color.YELLOW.withAlpha(.5)}},this.hierarchy=e,this._init()}this._tree.handler=new this._cesium.ScreenSpaceEventHandler(s._viewer.scene.canvas);var l=[],o={},r=void 0,u=this._core.CreateTooltip(),c=s._core.getuid(),n=document.getElementById("videoToolbar");n||($(".cesium-viewer").append('<div id="videoToolbar"></div>'),n=document.getElementById("videoToolbar"));var h='<video id="video'+c+'"  style="display: none;" muted autoplay loop crossorigin controls><source src="'+t.url+'" type="video/mp4"></video>';$(n).append(h);var m=document.getElementById("video"+c);m.style.transform="rotate("+t.angle+"deg)";let d;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this._tree.handler.setInputAction(function(e){e=s._getPosition.getMousePosition(e);if(0==l.length&&l.push(e.clone()),l.push(e),2!==l.length||d||(d=s._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(()=>l,!1),clampToGround:!0,material:new Cesium.ColorMaterialProperty(Cesium.Color.YELLOW.withAlpha(.5)),width:3}})),3<=l.length&&!r)return d&&s._viewer.entities.remove(d),o=new s._cesium.PolygonHierarchy(l),void(r=new i(o));o=new s._cesium.PolygonHierarchy(l)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){0===l.length?u.showAt(e.endPosition,"左键开始绘制!"):l.length<=2?u.showAt(e.endPosition,"点击继续绘制!"):u.showAt(e.endPosition,"右键结束绘制!"),2<=l.length&&((e=s._getPosition.getMousePosition(e))&&(l.pop(),l.push(e),o=new s._cesium.PolygonHierarchy(l)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){s.end&&s.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{if(s._tree.endtemporaryItem(),s._tree.handler.destroy(),u.show(!1),s._core.mouse(s._viewer.container,0,"0"),this.end=void 0,d&&s._viewer.entities.remove(d),"cancel"===e||l.length<3)s.item&&s._viewer.entities.remove(s.item);else{m.play(),s.item.polygon.material=m;e={polygon:{},positions:[],area:[]};e.polygon=s.item;for(var t=[],i=0;i<l.length;i++){var o=s._cesium.Cartographic.fromCartesian(l[i]),r=s._cesium.Math.toDegrees(o.longitude),n=s._cesium.Math.toDegrees(o.latitude),o=o.height;t.push({lon:r,lat:n,hei:o})}e.positions=t,e.id=c,"function"==typeof a&&a(e)}},this},ki.prototype.addVideoPolygon=function(e,t){var i,o=[];if(e[0]instanceof Array){if(2===e[0].length){for(var r=0;r<e.length;r++)o.push(e[r][0],e[r][1]);i=this._cesium.Cartesian3.fromDegreesArray(o)}else if(3===e[0].length){for(r=0;r<e.length;r++)o.push(e[r][0],e[r][1],e[r][2]);i=this._cesium.Cartesian3.fromDegreesArrayHeights(o)}}else if(e[0].z)if(e[0].x<180&&-180<e[0].x&&e[0].y<90&&-90<e[0].y){for(r=0;r<e.length;r++)o.push(e[r].x,e[r].y,e[r].z);i=this._cesium.Cartesian3.fromDegreesArrayHeights(o)}else i=e;else{for(r=0;r<e.length;r++)o.push(e[r].x,e[r].y);i=this._cesium.Cartesian3.fromDegreesArray(o)}var n=document.getElementById("videoToolbar");n||($(".cesium-viewer").append('<div id="videoToolbar"></div>'),n=document.getElementById("videoToolbar"));var a=this._core.getuid(),s='<video id="video'+a+'"  style="display: none;" muted autoplay loop crossorigin controls><source src="'+t.url+'" type="video/mp4"></video>';$(n).append(s);n=document.getElementById("video"+a);n.play();s=this._core.defaultValue(t.heightReference,1),a=this._core.defaultValue(t.color,"#FFFFFF");return this.item=this._viewer.entities.add({name:"面贴视频",polygon:{hierarchy:new Cesium.PolygonHierarchy(i),material:new Cesium.ImageMaterialProperty({image:n,color:Cesium.Color.fromCssColorString(a)}),heightReference:s,perPositionHeight:1!==s,stRotation:Cesium.Math.toRadians(t.angle||0),rotation:Cesium.Math.toRadians(t.rotation||0)}}),this},ki.prototype.addVideoBox=function(e,t){var i;e instanceof Array?i=this._cesium.Cartesian3.fromDegrees(...e):e.x?i=this._cesium.Cartesian3.fromDegrees(e.x,e.y,e.z):e.lon&&(i=this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height));var o=document.getElementById("videoToolbar");o||($(".cesium-viewer").append('<div id="videoToolbar"></div>'),o=document.getElementById("videoToolbar"));var r=this._core.getuid(),e='<video id="video'+r+'"  style="display: none;" muted autoplay loop crossorigin controls><source src="'+t.url+'" type="video/mp4"></video>';$(o).append(e);e=document.getElementById("video"+r);e.play();r=this._core.defaultValue(t.color,"#FFFFFF");return this.item=this._viewer.entities.add({name:"盒子贴视频",position:i,orientation:Cesium.Transforms.headingPitchRollQuaternion(i,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(t.heading||0),Cesium.Math.toRadians(t.pitch||0),Cesium.Math.toRadians(t.roll||0))),box:{dimensions:new Cesium.Cartesian3(t.long||100,t.width||100,t.height||100),material:new Cesium.ImageMaterialProperty({image:e,color:Cesium.Color.fromCssColorString(r)})}}),this},ki.prototype.deleteObject=function(){if(this._viewer.entities.remove(this.item),0<this._points.length){for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e]);this._points=[]}try{this._viewer.scene.primitives.remove(this.item)}catch(e){console.log(e)}this.item=void 0},ki.prototype.executePolygoncl=function(t,e){this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer);var i,o=this;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var r,n=this._core.CreateTooltip(),a=[],s={},l=[],u=null,c=null,h={point:o._cesium.Color.RED,polyline:o._cesium.Color.YELLOW,polygon:o._cesium.Color.YELLOW.withAlpha(.5)};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(h.point=e.point),""!=e.polyline&&null!=e.polyline&&(h.polyline=e.polyline),""!=e.polygon&&null!=e.polygon&&(h.polygon=e.polygon));var m={mj:0,label:[],polygon:[]};let d;this._tree.handler.setInputAction(function(e){var t,i;0===a.length?n.showAt(e.endPosition,"左键开始绘制!"):a.length<=3?n.showAt(e.endPosition,"点击继续绘制!"):n.showAt(e.endPosition,"右键结束绘制!"),(c=o._getPosition.getMousePosition(e))&&(t=o._cesium.Cartographic.fromCartesian(c),i=o._cesium.Math.toDegrees(t.longitude),e=o._cesium.Math.toDegrees(t.latitude),t.height,2<=a.length&&(o._cesium.defined(u)?(a.pop(),a.push(c),s=new o._cesium.PolygonHierarchy(a),l.pop(),l.push([i,e])):(s=new o._cesium.PolygonHierarchy(a),u=new p(s)),e=o._core.getArea(l,a),o._viewer.entities.remove(r),r=o._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){let t=new Cesium.Cartesian3;return a.forEach(e=>{Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,a.length,new Cesium.Cartesian3)},!1),label:{text:e,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:o._cesium.HeightReference.CLAMP_TO_GROUND}}),o._tree.temporaryItem.obj.push(r),m.label=r))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){var t,i;(c=o._getPosition.getMousePosition(e))&&(t=o._core.getArea(l,a),i=o._cesium.Cartographic.fromCartesian(c),e=o._cesium.Math.toDegrees(i.longitude),i=o._cesium.Math.toDegrees(i.latitude),0==a.length&&(a.push(c.clone()),l.push([e,i])),a.push(c),l.push([e,i]),s=new o._cesium.PolygonHierarchy(a),2===a.length&&(d=o._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(()=>a,!1),clampToGround:!1,material:h.polygon,width:3}})),3<=a.length&&(d&&o._viewer.entities.remove(d),o._cesium.defined(u)||(s=new o._cesium.PolygonHierarchy(a),u=new p(s)),o._viewer.entities.remove(r),r=o._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){let t=new Cesium.Cartesian3;return a.forEach(e=>{Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,a.length,new Cesium.Cartesian3)},!1),label:{text:t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:o._cesium.HeightReference.CLAMP_TO_GROUND}}),o._tree.temporaryItem.obj.push(r),m.label=r))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){o.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){n.show(!1),o._viewer.entities.remove(r),o._tree.handler.destroy(),o.end=void 0,o._core.mouse(o._viewer.container,0,"0"),d&&o._viewer.entities.remove(d),"cancel"===e||a.length<3?o.item&&o._viewer.entities.remove(o.item):(e=o._core.getArea(l,a),i=e,e=o._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){let t=new Cesium.Cartesian3;return a.forEach(e=>{Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,a.length,new Cesium.Cartesian3)},!1),label:{text:e,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:o._cesium.HeightReference.CLAMP_TO_GROUND}}),o._tree.endtemporaryItem(),o._points.push(e),o._lable=e,m.mj=i,m.label=e,""!=t&&null!=t&&"function"==typeof t&&t(m))};var p=(g.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new o._cesium.CallbackProperty(function(){return e.hierarchy},!1),this.polygon=o._viewer.entities.add(this.options),o.item=this.polygon,o._entity=this.polygon,o._tree.temporaryItem.obj.push(this.polygon),m.polygon=this.polygon},g);function g(e){this.options={name:"多边形",polygon:{hierarchy:[],perPositionHeight:!0,material:h.polygon,classificationType:o._cesium.ClassificationType.BOTH}},this.hierarchy=e,this._init()}return this},ki.prototype.executePolygonym=function(i){var o=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler(),this._tree.handler=new o._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas);var r=[],n={},a=null,t=null;this._tree.handler.setInputAction(function(e){e=o._viewer.camera.getPickRay(e.endPosition);t=o._viewer.scene.globe.pick(e,o._viewer.scene),2<=r.length&&(o._cesium.defined(a)?(r.pop(),r.push(t),n=new o._cesium.PolygonHierarchy(r)):(n=new o._cesium.PolygonHierarchy(r),a=new s(n)))},o._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){e=o._viewer.camera.getPickRay(e.position);t=o._viewer.scene.globe.pick(e,o._viewer.scene),0==r.length&&(r.push(t.clone()),n=new o._cesium.PolygonHierarchy(r)),r.push(t),n=new o._cesium.PolygonHierarchy(r);e=o._cesium.Cartographic.fromCartesian(r[r.length-1]);o._cesium.Math.toDegrees(e.longitude),o._cesium.Math.toDegrees(e.latitude),e.height;e=o._viewer.entities.add({name:"多边形面积",position:r[r.length-1],point:{pixelSize:5,color:o._cesium.Color.RED,outlineColor:o._cesium.Color.WHITE,outlineWidth:2,heightReference:o._cesium.HeightReference.CLAMP_TO_GROUND}});o._tree.temporaryItem.obj.push(e),o._points.push(e)},o._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){o._tree.handler.destroy(),o._tree.endtemporaryItem(),r.pop(),n=new o._cesium.PolygonHierarchy(r);var t=o._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){let t=new Cesium.Cartesian3;return r.forEach(e=>{Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,r.length,new Cesium.Cartesian3)},!1),label:{text:"平方千米",font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:o._cesium.HeightReference.CLAMP_TO_GROUND}});o._tree.temporaryItem.obj.push(t),o._points.push(t),""!=i&&null!=i&&"function"==typeof i&&i(a)},o._cesium.ScreenSpaceEventType.RIGHT_CLICK);var s=function(){function e(e){this.options={name:"多边形",polygon:{hierarchy:[],perPositionHeight:!0,material:o._cesium.Color.SKYBLUE.withAlpha(.4),extrudedHeight:0}},this.hierarchy=e,this._init()}e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new o._cesium.CallbackProperty(function(){return e.hierarchy},!1);var t=o._viewer.entities.add(this.options);o._tree.temporaryItem.obj.push(t),o.item=t};var t=0;o._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(t=we.selectedItem.id);var i=o._core.getuid(),i={id:i,name:"新建面"+i,pId:o._core.isnull(t)?0:t,type:"polygon",item:o};return o.setTreeobj(i),we.insertGroupId(i,o._core.isnull(t)?0:t),e}();return this},ki.prototype.executePolygonymsd=function(_={},i){this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer);var f=this;this._tree.handler=new f._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var h,y=this._core.CreateTooltip(),v={},C=[],w=null,m=null,o="0",b=0,T=1e3,r=10,S=!1,P=[];this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw);let E,x;function I(){f.end();let t=r/20;f.waterTimer=setInterval(function(){var e;b<T&&(b+=t,f.item._polygon.extrudedHeight.setValue(b),T<=b&&(clearInterval(f.waterTimer),f.waterTimer=void 0,b=T,f._viewer.entities.remove(f.item),f.polygon1=new f._cesium.PolygonGeometry({polygonHierarchy:new f._cesium.PolygonHierarchy(C),extrudedHeight:T,height:0,vertexFormat:f._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT}),e=new f._cesium.Primitive({geometryInstances:new f._cesium.GeometryInstance({geometry:f.polygon1}),appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:_.watherColor||Cesium.Color.SKYBLUE.withAlpha(.6),blendColor:_.watherColor||Cesium.Color.SKYBLUE.withAlpha(.6),normalMap:_.url,frequency:_.frequency||1e3,animationSpeed:_.watherSpeed||.01,amplitude:_.amplitude||10}}})}),show:!0}),f._viewer.scene.primitives.add(e),f.item=e,""!=i&&null!=i&&"function"==typeof i&&i(b),f._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(o=we.selectedItem.id),e={id:e=f._core.getuid(),name:"新建淹没分析"+e,pId:f._core.isnull(o)?0:o,type:"polygon",item:f},f.setTreeobj(e),we.insertGroupId(e,f._core.isnull(o)?0:o)))},50)}this._tree.handler.setInputAction(function(e){if(S)void 0===b?y.showAt(e.endPosition,"点击拾取初始水面高度"):void 0===T&&y.showAt(e.endPosition,"点击拾取最大淹没高度");else{4<=C.length?y.showAt(e.endPosition,"右键结束绘制"):y.showAt(e.endPosition,"点击左键绘制淹没区域");var t=f._viewer.camera.getPickRay(e.endPosition);if(h=f._viewer.scene.globe.pick(t,f._viewer.scene),2<=C.length){if(f._cesium.defined(w))if(_.rectangle)x=f._core.toDegrees(h),C=[Cesium.Cartesian3.fromDegrees(E.lon,E.lat),Cesium.Cartesian3.fromDegrees(E.lon,x.lat),Cesium.Cartesian3.fromDegrees(x.lon,x.lat),Cesium.Cartesian3.fromDegrees(x.lon,E.lat)],v=new f._cesium.PolygonHierarchy(C),w.hierarchy=v;else{for(var i=C[0],o=f._viewer.scene.globe.ellipsoid.cartesianToCartographic(i),r=Cesium.Math.toDegrees(o.latitude),n=Cesium.Math.toDegrees(o.longitude),e=C[C.length-2],t=f._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),i=Cesium.Math.toDegrees(t.latitude),o=Cesium.Math.toDegrees(t.longitude),e=f._viewer.scene.globe.ellipsoid.cartesianToCartographic(h),t=Cesium.Math.toDegrees(e.latitude),e=Cesium.Math.toDegrees(e.longitude),a=Cesium_turf.lineString([[n,r],[e,t]]),s=Cesium_turf.lineString([[o,i],[e,t]]),l=!0,u=0;u<P.length&&2<=P.length;u++){var c=P[u];if(0!=u){if(u!=P.length-1){if(Cesium_turf.lineIntersect(a,c).features.length)return l=!1,void(y.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>');if(Cesium_turf.lineIntersect(s,c).features.length){l=!1,y.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}else if(Cesium_turf.lineIntersect(a,c).features.length){l=!1,y.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}else if(Cesium_turf.lineIntersect(s,c).features.length){l=!1,y.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}if(!l)return;C.pop(),C.push(h),v=new f._cesium.PolygonHierarchy(C)}else v=new f._cesium.PolygonHierarchy(C),w=new d(v);m||(m=f._viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(function(){return C.concat([C[0]])},!1),clampToGround:!0,width:3}}),f._points.push(m))}}},f._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){e=f._getPosition.getMousePosition(e);if(e)if(S){var t=f._cesium.Cartographic.fromCartesian(e);if(void 0===b)b=t.height;else if(void 0===T){if((T=t.height)<b)return window.layuiLayer&&window.layuiLayer.msg("最大淹没高度小于初始水面高度,请重新拾取"),void(b=T=void 0);I()}}else{if(0==C.length&&(C.push(e.clone()),v=new f._cesium.PolygonHierarchy(C)),2<=C.length)if(0==P.length){var i=C[0],o=f._viewer.scene.globe.ellipsoid.cartesianToCartographic(i),r=Cesium.Math.toDegrees(o.latitude),n=Cesium.Math.toDegrees(o.longitude),a=C[1],s=f._viewer.scene.globe.ellipsoid.cartesianToCartographic(a),l=Cesium.Math.toDegrees(s.latitude),u=Cesium.Math.toDegrees(s.longitude),c=Cesium_turf.lineString([[n,r],[u,l]]);P.push(c)}else{if(2<=P.length){for(var i=C[0],o=f._viewer.scene.globe.ellipsoid.cartesianToCartographic(i),r=Cesium.Math.toDegrees(o.latitude),n=Cesium.Math.toDegrees(o.longitude),a=C[C.length-2],s=f._viewer.scene.globe.ellipsoid.cartesianToCartographic(a),l=Cesium.Math.toDegrees(s.latitude),u=Cesium.Math.toDegrees(s.longitude),t=f._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),a=Cesium.Math.toDegrees(t.latitude),t=Cesium.Math.toDegrees(t.longitude),h=Cesium_turf.lineString([[n,r],[t,a]]),m=Cesium_turf.lineString([[u,l],[t,a]]),d=!0,p=0;p<P.length&&2<=P.length;p++){var g=P[p];if(0!=p){if(p!=P.length-1){if(Cesium_turf.lineIntersect(h,g).features.length)return d=!1,void(y.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>');if(Cesium_turf.lineIntersect(m,g).features.length){d=!1,y.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}else if(Cesium_turf.lineIntersect(h,g).features.length){d=!1,y.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}else if(Cesium_turf.lineIntersect(m,g).features.length){d=!1,y.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}if(!d)return}i=C[C.length-2],o=f._viewer.scene.globe.ellipsoid.cartesianToCartographic(i),r=Cesium.Math.toDegrees(o.latitude),n=Cesium.Math.toDegrees(o.longitude),s=f._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),l=Cesium.Math.toDegrees(s.latitude),u=Cesium.Math.toDegrees(s.longitude),c=Cesium_turf.lineString([[n,r],[u,l]]);P.push(c)}C.push(e),v=new f._cesium.PolygonHierarchy(C),_.rectangle&&(E?(x=f._core.toDegrees(e),C=[Cesium.Cartesian3.fromDegrees(E.lon,E.lat),Cesium.Cartesian3.fromDegrees(E.lon,x.lat),Cesium.Cartesian3.fromDegrees(x.lon,x.lat),Cesium.Cartesian3.fromDegrees(x.lon,E.lat)],v=new f._cesium.PolygonHierarchy(C),w.hierarchy=v,_.pointSelect?S=!(T=b=void 0):I()):E=f._core.toDegrees(e));c=f._cesium.Cartographic.fromCartesian(C[C.length-1]);f._cesium.Math.toDegrees(c.longitude),f._cesium.Math.toDegrees(c.latitude),c.height;e=f._viewer.entities.add({name:"多边形",position:e,point:{pixelSize:5,color:f._cesium.Color.RED,outlineColor:f._cesium.Color.WHITE,outlineWidth:1,heightReference:f._cesium.HeightReference.CLAMP_TO_GROUND}});f._tree.temporaryItem.obj.push(e),f._points.push(e)}},f._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){S||C.length<=3||(y.show(!1),C.pop(),v=new f._cesium.PolygonHierarchy(C),_.pointSelect?S=!(T=b=void 0):I())},f._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{if(y.show(!1),f._core.mouse(f._viewer.container,0),f._tree.handler.destroy(),f._tree.endtemporaryItem(),f.end=void 0,"cancel"===e&&!this.waterTimer&&(f.item&&f._viewer.entities.remove(f.item),0<this._points.length)){for(var t=0;t<this._points.length;t++)this._viewer.entities.remove(this._points[t]);this._points=[]}};var d=(e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new f._cesium.CallbackProperty(function(){return e.hierarchy},!1);var t=f._viewer.entities.add(this.options);f.item=t,f._tree.temporaryItem.obj.push(t);try{null!=_&&""!=_&&(0<_.waterHeight&&(b=_.waterHeight),0<_.targetHeight&&(T=_.targetHeight),0<_.spood&&(r=_.spood),""!=_.GroupID&&null!=_.GroupID&&(o=_.GroupID))}catch(e){console.log(e)}},e);function e(e){this.options={name:"多边形",polygon:{hierarchy:[],material:f._cesium.Color.SKYBLUE.withAlpha(.5),heightReference:f._cesium.HeightReference.NONE,extrudedHeight:0}},this.hierarchy=e,this._init()}return this},ki.prototype.endWater=function(){this.end&&this.end(),this.waterTimer&&clearInterval(this.waterTimer),this._tree.endtemporaryItem(),this.deleteObject()},ki.prototype.executePolygonymsdtt=function(o,e){this._tree.removeHandler();var r=this;this._tree.starttemporaryItem(this._viewer),this._tree.handler=new r._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas);var n=[],t=null,i=null;this._tree.handler.setInputAction(function(e){e=r._viewer.camera.getPickRay(e.endPosition);i=r._viewer.scene.globe.pick(e,r._viewer.scene),2<=n.length&&(r._cesium.defined(t)?(n.pop(),n.push(i)):t=new a(n),new r._cesium.PolygonHierarchy(n))},r._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){e=r._viewer.camera.getPickRay(e.position);i=r._viewer.scene.globe.pick(e,r._viewer.scene),0==n.length&&(n.push(i.clone()),new r._cesium.PolygonHierarchy(n)),n.push(i),new r._cesium.PolygonHierarchy(n);e=r._cesium.Cartographic.fromCartesian(n[n.length-1]);r._cesium.Math.toDegrees(e.longitude),r._cesium.Math.toDegrees(e.latitude),e.height;e=r._viewer.entities.add({name:"多边形面积",position:n[n.length-1],point:{pixelSize:5,color:r._cesium.Color.RED,outlineColor:r._cesium.Color.WHITE,outlineWidth:2,heightReference:r._cesium.HeightReference.CLAMP_TO_GROUND}});r._tree.temporaryItem.obj.push(e),r._points.push(e)},r._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){r._tree.handler.destroy(),r._viewer.entities.remove(r.item),r.polygon1=new r._cesium.PolygonGeometry({polygonHierarchy:new r._cesium.PolygonHierarchy(n),extrudedHeight:0,height:0,vertexFormat:r._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT});var t=new r._cesium.Primitive({geometryInstances:new r._cesium.GeometryInstance({geometry:r.polygon1}),appearance:new r._cesium.EllipsoidSurfaceAppearance({aboveGround:!0}),show:!0}),i=new r._cesium.Material({fabric:{type:"Water",uniforms:{normalMap:o.url,frequency:100,animationSpeed:.01,amplitude:10}}});t.appearance.material=i;i=r._viewer.scene;r.polygon1=i.primitives.add(t),r._tree.endtemporaryItem(),n.pop(),new r._cesium.PolygonHierarchy(n)},r._cesium.ScreenSpaceEventType.RIGHT_CLICK);var a=(s.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new r._cesium.CallbackProperty(function(){return e.hierarchy},!1);var t=r._viewer.entities.add(this.options);r.item=t,r._tree.temporaryItem.obj.push(t);var i=0;r._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(i=we.selectedItem.id);t=r._core.getuid(),t={id:t,name:"新建水面"+t,pId:r._core.isnull(i)?0:i,type:"polyline",item:r};r.setTreeobj(t),we.insertGroupId(t,r._core.isnull(i)?0:i)},s);function s(e){this.options={name:"多边形",polygon:{hierarchy:[],material:r._cesium.Color.SKYBLUE.withAlpha(.4),heightReference:r._cesium.HeightReference.NONE,extrudedHeight:0}},this.hierarchy=e,this._init()}return this},ki.prototype.executePolygontdmj=function(t,e){var r=this;this._tree.starttemporaryItem(this._viewer),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this._tree.removeHandler();var i,o,n={mj:0,label:[],polygon:[]},a=!0,s=[],l=void 0,u=this._viewer.scene,c=u.globe.ellipsoid,h={point:r._cesium.Color.RED,polyline:r._cesium.Color.YELLOW,polygon:r._cesium.Color.YELLOW.withAlpha(.5)};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(h.point=e.point),""!=e.polyline&&null!=e.polyline&&(h.polyline=e.polyline),""!=e.polygon&&null!=e.polygon&&(h.polygon=e.polygon));var m=this._core.CreateTooltip();this._tree.handler=new r._cesium.ScreenSpaceEventHandler(u.canvas);var d=0;this._tree.handler.setInputAction(function(e){0===s.length?m.showAt(e.endPosition,"左键开始绘制!"):s.length<=2?m.showAt(e.endPosition,"点击继续绘制!"):m.showAt(e.endPosition,"右键结束绘制!"),o&&(r._viewer.entities.remove(o),o=void 0);e=r._getPosition.getMousePosition(e,[n.polygon,n.label]);e&&r._cesium.Ellipsoid.WGS84.cartesianToCartographic(e)&&a&&(s.pop(),s.push(e),3<=s.length&&(e=(e=String(g(l.path.positions))).substr(0,e.indexOf(".",0)),d=e.length<6?e+"平方米":(e=(e=String(e/1e6)).substr(0,e.indexOf(".",0)+3))+"平方千米",n.mj=d,o=r._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){let t=new Cesium.Cartesian3;return s.forEach(e=>{Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,s.length,new Cesium.Cartesian3)},!1),label:{text:d,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:r._cesium.HeightReference.CLAMP_TO_GROUND}}),r._tree.temporaryItem.obj.push(o),r._points.push(o),n.label=o))},r._cesium.ScreenSpaceEventType.MOUSE_MOVE);let p;this._tree.handler.setInputAction(function(e){e=r._getPosition.getMousePosition(e,[n.polygon,n.label]);e&&a&&(s.length||s.push(e.clone()),s.push(e),i=new r._cesium.PolygonHierarchy(s),o&&(r._viewer.entities.remove(o),o=void 0),2===s.length&&(p=r._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(()=>s,!1),clampToGround:!0,material:h.polygon,width:3}})),3<=s.length&&!r._cesium.defined(l)&&(p&&r._viewer.entities.remove(p),l=new y(i,r._cesium)),3<=s.length&&(e=(e=String(g(l.path.positions))).substr(0,e.indexOf(".",0)),d=e.length<6?e+"平方米":(e=(e=String(e/1e6)).substr(0,e.indexOf(".",0)+3))+"平方千米",n.mj=d,o=r._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){let t=new Cesium.Cartesian3;return s.forEach(e=>{Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,s.length,new Cesium.Cartesian3)},!1),label:{text:d,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:r._cesium.HeightReference.CLAMP_TO_GROUND}}),r._tree.temporaryItem.obj.push(o),r._points.push(o),n.label=o))},r._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(){r.end&&r.end()},r._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){r._tree.handler.removeInputAction(r._cesium.ScreenSpaceEventType.LEFT_CLICK),r._tree.handler.removeInputAction(r._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),r._cesium.trackedEntity=void 0,r.end=void 0,r._tree.endtemporaryItem(),a=!1,m.show(!1),r._tree.handler.destroy(),r._core.mouse(r._viewer.container,0,"0"),p&&r._viewer.entities.remove(p),"cancel"!==e?(s.length<3&&r.deleteObject(),""!=t&&null!=t&&"function"==typeof t&&t(n)):r.deleteObject()};var g=function(e){for(var t=new Array(e.length),i=0;i<e.length;i++)t[i]=_(c.cartesianToCartographic(e[i]));for(var o=0,i=0;i<t.length;i++)o+=t[i].longitude;o/=t.length;for(i=0;i<t.length;i++)t[i]=r._core.Gauss_to_XY(t[i].longitude,t[i].latitude,o,r._cesium);return Math.abs(f(t))},_=function(e){return e.longitude=e.longitude/Math.PI*180,e.latitude=e.latitude/Math.PI*180,e},f=function(e){for(var t=0,i=0;i<e.length;i++){var o=e[i],r=i<e.length-1?e[i+1]:e[0];t+=o.x*r.y-r.x*o.y}return t/2},y=(v.prototype._init=function(e){var t=this;this.options.polygon.hierarchy=new r._cesium.CallbackProperty(function(){return t.path},!1),this.polygonEntity=r._viewer.entities.add(this.options),r.item=this.polygonEntity,r._tree.temporaryItem.obj.push(this.polygonEntity),n.polygon=this.polygonEntity,r._entity=this.polygonEntity},v);function v(e,t){if(!r._cesium.defined(e))throw new r._cesium.DeveloperError("positions is required!");if(e.length<3)throw new r._cesium.DeveloperError("positions 的长度必须大于等于3");this.options={polygon:{show:!0,hierarchy:void 0,classificationType:r._cesium.ClassificationType.BOTH,material:h.polygon}},this.path=e,this._init(t)}return this},ki.prototype.spaceArea=function(r={},n){var o=this;this._tree.removeHandler(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw);var i,a={mj:0,label:void 0,polygon:void 0},s=[],l=[],u=void 0,e=this._viewer.scene,c={point:r.point||Cesium.Color.RED,polyline:r.polyline||Cesium.Color.YELLOW,polygon:r.polygon||Cesium.Color.YELLOW.withAlpha(.5)},t=this._core.CreateTooltip();this._tree.handler=new o._cesium.ScreenSpaceEventHandler(e.canvas);let h=!1;this._tree.handler.setInputAction(e=>{0===s.length?t.showAt(e.endPosition,"左键开始绘制!"):s.length<=2?t.showAt(e.endPosition,"点击继续绘制!"):t.showAt(e.endPosition,"右键结束绘制!"),!h||(e=this._getPosition.getMousePosition(e,[a.polygon,a.label]))&&(s.pop(),s.push(e))},Cesium.ScreenSpaceEventType.MOUSE_MOVE);let m;this._tree.handler.setInputAction(e=>{h=!0;let t=this._getPosition.getMousePosition(e,[a.polygon,a.label]);t&&(s.length||s.push(t.clone()),s.push(t),e=this._core.toDegrees(t),l.push([e.lon,e.lat,e.height]),i=new o._cesium.PolygonHierarchy(s),2===s.length&&(m=this._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(()=>s,!1),clampToGround:!0,material:c.polygon,width:3}})),3<=s.length&&!Cesium.defined(u)&&(m&&this._viewer.entities.remove(m),u=new d(i)))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(()=>{o.end&&o.end()},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=i=>{if(this.end=void 0,h=!1,t.show(!1),o._tree.handler.destroy(),o._core.mouse(o._viewer.container,0,"0"),m&&o._viewer.entities.remove(m),"cancel"!==i){if(s.pop(),s.length<3&&this.deleteObject(),2<l.length){i=Cesium.BoundingSphere.fromPoints(s);let e=this._core.getSpaceArea(this._viewer,l,{onlyTerrain:r.onlyTerrain,distance:r.distance||i.radius/20}),t=e=>{let{area:t,tin:i}=e;a.mj=t;let o=new Cesium.Cartesian3;s.forEach(e=>{Cesium.Cartesian3.add(o,e,o)});e=Cesium.Cartesian3.divideByScalar(o,s.length,new Cesium.Cartesian3),e=this._viewer.entities.add({name:"多边形面积",position:e,label:{text:t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND}});this._points.push(e),r.tin&&(this._viewer.entities.remove(a.polygon),i.features.forEach(e=>{e.positions&&(e=this._viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(e.positions),material:c.polygon,perPositionHeight:!0,outline:!0,outlineColor:Cesium.Color.YELLOW}}),this._points.push(e))})),a.label=e,n&&"function"==typeof n&&n(a)};r.onlyTerrain?e.then(e=>{t(e)}):t(e)}}else this.deleteObject()};var d=(p.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new Cesium.CallbackProperty(function(){return e.path},!1),this.polygonEntity=o._viewer.entities.add(this.options),o.item=this.polygonEntity,o._tree.temporaryItem.obj.push(this.polygonEntity),a.polygon=this.polygonEntity,o._entity=this.polygonEntity},p);function p(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("positions is required!");if(e.length<3)throw new Cesium.DeveloperError("positions 的长度必须大于等于3");this.options={polygon:{show:!0,hierarchy:void 0,classificationType:Cesium.ClassificationType.BOTH,material:c.polygon}},this.path=e,this._init()}return this},ki.prototype.setVisibility=function(e){if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._points[t].show=e;this._lable&&(this._lable.show=e),this.item.show=e},ki.prototype.getVisibility=function(){return this.item.show},ki.prototype.setRadius=function(e){try{for(var t=[],i=this.item._polygon.hierarchy.getValue(),o=this._viewer.scene.globe.ellipsoid,r=0;r<i.length;r++){var n=new this._cesium.Cartesian3(i[r].x,i[r].y,i[r].z),a=o.cartesianToCartographic(n),s=this._cesium.Math.toDegrees(a.latitude),l=this._cesium.Math.toDegrees(a.longitude);t.push(l),t.push(s)}var u=new this._cesium.Cartesian3(i[0].x,i[0].y,i[0].z),c=o.cartesianToCartographic(u),s=this._cesium.Math.toDegrees(c.latitude),l=this._cesium.Math.toDegrees(c.longitude);t.push(l),t.push(s),t=this._cesium.Cartesian3.fromDegreesArray(t),this.item.corridor=new this._cesium.CorridorGraphics({positions:t,width:e,material:this._cesium.Color.RED.withAlpha(.4)})}catch(e){console.log(e)}return this},ki.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=this.item.polygon.hierarchy.getValue(),i=null==this.item.polygon.height?void 0:this.item.polygon.height._value,o=null==this.item.polygon.extrudedHeight?void 0:this.item.polygon.extrudedHeight._value,r=null==this.item.polygon.stRotation?void 0:this.item.polygon.stRotation._value,n=null==this.item.polygon.fill?void 0:this.item.polygon.fill._value,a=this.item.polygon.material;null!=a&&(a={color:null==a.color?void 0:"rgba("+a.color._value.red+","+a.color._value.green+","+a.color._value.blue+","+a.color._value.alpha+")",image:null==a.image?void 0:a.image._value,diffusemap:null==a.diffusemap?void 0:a.diffusemap._value,alphamap:null==a.alphamap?void 0:a.alphamap._value});var s=null==this.item.polygon.outline?void 0:this.item.polygon.outline._value,l=null==this.item.polygon.outlineColor?void 0:"rgba("+this.item.polygon.outlineColor._value.red+","+this.item.polygon.outlineColor._value.green+","+this.item.polygon.outlineColor._value.blue+","+this.item.polygon.outlineColor._value.alpha+")",u=null==this.item.polygon.outlineWidth?void 0:this.item.polygon.outlineWidth._value,c=null==this.item.polygon.perPositionHeight?void 0:this.item.polygon.perPositionHeight._value,h=null==this.item.polygon.closeTop?void 0:this.item.polygon.closeTop._value,m=null==this.item.polygon.closeBottom?void 0:this.item.polygon.closeBottom._value,d=this.item.polygon.distanceDisplayCondition,p=null==d?void 0:d._value.near,d=null==d?void 0:d._value.far;return{type:"polygon",treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,hierarchy:t,height:i,extrudedHeight:o,stRotation:r,fill:n,material:a,outline:s,outlineColor:l,outlineWidth:u,perPositionHeight:c,closeTop:h,closeBottom:m,near:p,far:d}}},ki.prototype.setTreeobj=function(e){this.treeobj=e},ki.prototype.setDistanceDisplayCondition=function(e,t){t=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._polygon.distanceDisplayCondition=t}catch(e){console.log(e)}return this},ki.prototype.setPolygonAlpha=function(e){try{this.item._polygon.material.color._value.alpha=e}catch(e){console.log(e)}return this},ki.prototype.setPolygonColor=function(e){try{this.item._polygon.material.color=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},ki.prototype.setDistanceDisplayCondition=function(e,t){t=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._polygon.distanceDisplayCondition=t}catch(e){console.log(e)}return this},ki.prototype.setPolygonImage=function(e){try{this.item._polygon.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},ki.prototype.setPolygonRepeat=function(e,t){try{this.item._polygon.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},ki.prototype.setOutlineColor=function(e){try{this.item._polygon.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},ki.prototype.setOutline=function(e){try{this.item._polygon.outline=e}catch(e){console.log(e)}return this},ki.prototype.setExtrudedHeight=function(e){try{this.item._polygon.extrudedHeight=e}catch(e){console.log(e)}return this},ki.prototype.setHeight=function(e){try{this.item._polygon.height=e}catch(e){console.log(e)}return this},ki.prototype.setHeightType=function(e){try{1==e?this.item._polygon.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._polygon.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._polygon.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},Object.defineProperties(ki.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Object.defineProperties(ki.prototype,{HighLight:{set:function(e){e&&(this.item.material=this.item.polygon.material),this.item.polygon.material=e?new G(this._viewer,this._cesium).colorFromHtmlColor(this._core.selectedColor):this.item.material}},polygonShow:{set:Ce.debounce(function(e){this.item.polygon.show=e},500),get:function(){return this.item.polygon.b}},polygonHeight:{set:Ce.debounce(function(e){this._core.isnull(e)||(/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,"")),this.item.polygon.height=e)},500),get:function(){var e=this.item.polygon.height;if(e)return e._value}},polygonHeightReference:{set:Ce.debounce(function(e){this._core.isnull(e)||(this.item.polygon.heightReference=e)},500),get:function(){var e=this.item.polygon.heightReference;if(e)return e._value}},polygonExtrudedHeight:{set:Ce.debounce(function(e){this._core.isnull(e)||(/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,"")),this.item.polygon.extrudedHeight=e)},500),get:function(){var e=this.item.polygon.extrudedHeight;if(e)return e._value}},polygonExtrudedHeightReference:{set:Ce.debounce(function(e){this._core.isnull(e)||(this.item.polygon.extrudedHeightReference=e)},500),get:function(){var e=this.item.polygon.extrudedHeightReference;if(e)return e._value}},polygonFill:{set:Ce.debounce(function(e){this.item.polygon.fill=e},500),get:function(){var e=this.item.polygon.fill;if(e)return e._value}},polygonMaterial:{set:Ce.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.polygon.material=e,this.item.material=this.item.polygon.material)},500),get:function(){var e=this.item.polygon.material;try{return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}},polygonMaterialAlpha:{set:Ce.debounce(function(e){this._core.isnull(e)||(this.item.polygon.material.color.alpha=e)},500),get:function(){this.item.polygon.material;try{return this.item.polygon.material.color.alpha}catch(e){}}},polygonOutline:{set:Ce.debounce(function(e){this._core.isnull(e)||(this.item.polygon.outline=e)},500),get:function(){var e=this.item.polygon.outline;if(e)return e._value}},polygonOutlineColor:{set:Ce.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.polygon.outlineColor=e)},500),get:function(){var e=this.item.polygon.outlineColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},polygonOutlineWidth:{set:Ce.debounce(function(e){this._core.isnull(e)||(/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,"")),this.item.polygon.outlineWidth=e)},500),get:function(){var e=this.item.polygon.outlineWidth;if(e)return e._value}}}),ki.prototype.setItem=function(e){this.item=e},Object.defineProperties(ki.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(ki.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(ki.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(ki.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(ki.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(ki.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(ki.prototype,{polygonTempOptions:{get:function(){return{height:0,extrudedHeight:0,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:ShadowMode.DISABLED,classificationType:ClassificationType.BOTH,arcType:ArcType.GEODESIC}}}}),Object.defineProperties(ki.prototype,{Visibility:{get:function(){return this.item.show}},PolygonColor:{get:function(){var e=this.item._polygon.material.color._value;if(e)return new G(this._viewer,this._cesium).toHtmlColor("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")")}},PolygonAlpha:{get:function(){if(this.item._polygon.material.color)return this.item._polygon.material.color._value.alpha||1}},Outline:{get:function(){if(this.item._polygon.outline)return this.item._polygon.outline._value}},OutlineColor:{get:function(){var e=this.item._polygon.outlineColor;if(this.item._polygon.outlineColor)return e=e._value,new G(this._viewer,this._cesium).toHtmlColor("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")")}},ExtrudedHeight:{get:function(){if(this.item._polygon.extrudedHeight)return this.item._polygon.extrudedHeight._value}},Height:{get:function(){return this.item._polygon.height}},PolygonImage:{get:function(){if(this.item._polygon.material.uniforms)return this.item._polygon.material.uniforms.image}},PolygonRepeat:{get:function(){if(this.item._polygon.material.uniforms)return this.item._polygon.material.repeat}}}),ki.prototype.forceEndHanlder=function(){this._tree.handler&&(this._tree.handler.destroy(),this._tree.handler=void 0)},Fi.prototype.createBox=function(e,t,i,o){var r={id:this._core.getuid(),dimensions:new this._cesium.Cartesian3(4e5,3e5,5e5),material:this._cesium.Color.RED.withAlpha(.5),fill:!0,outline:!0,outlineColor:this._cesium.Color.BLACK},t=this._core.extend(r,t,!0);this.item=this._viewer.entities.add({name:i,position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),box:t});i={id:this.item.id,name:i,pId:this._core.isnull(o)?0:o,type:"box",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),this},Fi.prototype.getstyles=function(){var e={};return e.show=!this.item.box.show||this.item.box.show._value,e.heightReference=this.item.box.heightReference||void 0,e.fill=this.item.box.fill&&this.item.box.fill._value?this.item.box.fill._value:void 0,e.dimensions=this.item.box.dimensions?this.item.box.dimensions.getValue():void 0,e.shadows=this.item.box.shadows&&this.item.box.shadows._value?this.item.box.shadows._value:void 0,e.material={},e.material.color=this.item.box.material&&this.item.box.material.color._value?"rgba"+this.item.box.material.color.toString():void 0,e.material.image=this.item.box.material&&this.item.box.material.image._value?this.item.box.material.image._value:void 0,e.material.repeat=this.item.box.material&&this.item.box.material.repeat?this.item.box.material.repeat._value:void 0,e.outline=this.item.box.outline&&this.item.box.outline._value?this.item.box.outline._value:void 0,e.outlineColor=this.item.box.outlineColor&&this.item.box.outlineColor._value?"rgba"+this.item.box.outlineColor.toString():void 0,e.outlineWidth=this.item.box.outlineWidth&&this.item.box.outlineWidth._value?this.item.box.outlineWidth._value:void 0,e.near=this.item.box.distanceDisplayCondition?this.item.box.distanceDisplayCondition._value.near:void 0,e.far=this.item.box.distanceDisplayCondition?this.item.box.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},Fi.prototype.executeBox=function(i){var o=this;o.shape={tempPoints:[],button:0,position:{}};var r=new this._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas),n=[];return r.setInputAction(function(e){var t=o._viewer.scene.camera.pickEllipsoid(e.position,o._viewer.scene.globe.ellipsoid),e=o._cesium.Cartographic.fromCartesian(t),t=o._cesium.Math.toDegrees(e.longitude),e=o._cesium.Math.toDegrees(e.latitude);n.push({lon:t,lat:e}),0==o.shape.button&&(o.box=o._viewer.entities.add({name:"",position:o._cesium.Cartesian3.fromDegrees(n[0].lon,n[0].lat),box:{id:o._core.getuid(),dimensions:new o._cesium.Cartesian3(4e5,3e5,5e5),material:o._cesium.Color.RED.withAlpha(.5),fill:!0,outline:!0,outlineColor:o._cesium.Color.RED}}),o.item=o.box);t=0;o._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(t=we.selectedItem.id);e=o._core.getuid(),e={id:e,name:"新建立方体"+e,pId:o._core.isnull(t)?0:t,type:"box",item:o};o.setTreeobj(e),o._tree.insertGroupId(e,o._core.isnull(t)?0:t),"function"==typeof i&&i({polyline:{},positions:[],distance:[]}),r.destroy()},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this},Fi.prototype.executeExcavation=function(r,n){var a=this;a.shape={tempPoints:[],button:0,position:{}};var s=new this._cesium.ScreenSpaceEventHandler(a._viewer.scene.canvas),l=[];return s.setInputAction(function(e){var t=a._viewer.scene.camera.pickEllipsoid(e.position,a._viewer.scene.globe.ellipsoid),e=a._cesium.Cartographic.fromCartesian(t),t=a._cesium.Math.toDegrees(e.longitude),e=a._cesium.Math.toDegrees(e.latitude);l.push({lon:t,lat:e});e=-r.z/2;0==a.shape.button&&(a.box=a._viewer.entities.add({name:"",position:a._cesium.Cartesian3.fromDegrees(l[0].lon,l[0].lat,e),box:{id:a._core.getuid(),dimensions:new a._cesium.Cartesian3(r.x,r.y,r.z),material:a._cesium.Color.WHITE.withAlpha(.5),outline:!0,outlineColor:a._cesium.Color.WHITE}}),a.item=a.box,e=a._viewer.scene.globe,i=-r.x/2,o=-r.y/2,e.depthTestAgainstTerrain=!0,e.clippingPlanes=new a._cesium.ClippingPlaneCollection({modelMatrix:a.box.computeModelMatrix(a._cesium.JulianDate.now()),planes:[new a._cesium.Plane(new a._cesium.Cartesian3(1,0,0),i),new a._cesium.Plane(new a._cesium.Cartesian3(-1,0,0),i),new a._cesium.Plane(new a._cesium.Cartesian3(0,1,0),o),new a._cesium.Plane(new a._cesium.Cartesian3(0,-1,0),o)],edgeWidth:1,edgeColor:a._cesium.Color.WHITE}));var i=0;a._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(i=we.selectedItem.id);var o=a._core.getuid(),o={id:o,name:"新建立方体"+o,pId:a._core.isnull(i)?0:i,type:"box",item:a};a.setTreeobj(o),we.insertGroupId(o,a._core.isnull(i)?0:i),"function"==typeof n&&n({polyline:{},positions:[],distance:[]}),s.destroy()},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this},Fi.prototype.executeBox1=function(e){var t,i=this,o=this;i.shape={points:[],button:0,rect:null,entity:null};var r=new this._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas);return r.setInputAction(function(e){t=o._core.getPointFromWindowPoint(e.position,o._viewer),2<=i.shape.button&&(r.removeInputAction(o._cesium.ScreenSpaceEventType.MOUSE_MOVE),r.removeInputAction(o._cesium.ScreenSpaceEventType.LEFT_CLICK)),i.shape.button=i.shape.button+1,t&&(0==i.shape.points.length?(i.shape.points.push(o._viewer.scene.globe.ellipsoid.cartesianToCartographic(t)),i.shape.rect=o._cesium.Rectangle.fromCartographicArray(i.shape.points),i.shape.rect.east+=1e-6,i.shape.rect.north+=1e-6,i.shape.entity=o._viewer.entities.add({rectangle:{coordinates:i.shape.rect,material:o._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:o._cesium.Color.RED,height:0}}),i.bufferEntity=i.shape.entity):2==i.shape.points.length||(r.removeInputAction(o._cesium.ScreenSpaceEventType.MOUSE_MOVE),r.removeInputAction(o._cesium.ScreenSpaceEventType.LEFT_CLICK)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction(function(e){var t;0==i.shape.points.length||(t=o._core.getPointFromWindowPoint(e.endPosition,o._viewer))&&(e=o._viewer.camera.getPickRay(e.endPosition),e=o._viewer.scene.globe.pick(e,o._viewer.scene),i.shape.points[1]=o._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),i.shape.rect=o._cesium.Rectangle.fromCartographicArray(i.shape.points),2==i.shape.button?i.shape.entity.rectangle.extrudedHeight=e.z:(i.shape.rect.west==i.shape.rect.east&&(i.shape.rect.east+=1e-6),i.shape.rect.south==i.shape.rect.north&&(i.shape.rect.north+=1e-6),i.shape.entity.rectangle.coordinates=i.shape.rect))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},Fi.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=null==this.item.box.dimensions?void 0:this.item.box.dimensions.getValue(),i=null==this.item.box.fill?void 0:this.item.box.fill._value,o=this.item.box.material;null!=o&&(o={color:null==o.color._value?void 0:"rgba("+o.color._value.red+","+o.color._value.green+","+o.color._value.blue+","+o.color._value.alpha+")",image:null==o.image?void 0:o.image._value,diffusemap:null==o.diffusemap?void 0:o.diffusemap._value,alphamap:null==o.alphamap?void 0:o.alphamap._value});var r=null==this.item.box.outline?void 0:this.item.box.outline._value,n=null==this.item.box.outlineColor?void 0:"rgba("+this.item.box.outlineColor._value.red+","+this.item.box.outlineColor._value.green+","+this.item.box.outlineColor._value.blue+","+this.item.box.outlineColor._value.alpha+")",a=null==this.item.box.outlineWidth?void 0:this.item.box.outlineWidth._value,s=this.item.box.distanceDisplayCondition,l=null==s?void 0:s._value.near,u=null==s?void 0:s._value.far,s=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"box",position:{x:this._cesium.Math.toDegrees(s.longitude),y:this._cesium.Math.toDegrees(s.latitude),z:this._cesium.Math.toDegrees(s.height)},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,dimensions:t,fill:i,material:o,outline:r,outlineColor:n,outlineWidth:a,near:l,far:u}}},Fi.prototype.setTreeobj=function(e){this.treeobj=e},Fi.prototype.setVisibility=function(e){this.item.show=e},Fi.prototype.setShow=function(e){try{this.item._box.show=e}catch(e){console.log(e)}return this},Fi.prototype.getVolume=function(){try{var e=this.item._box.dimensions._value,t=e.x*e.y*e.z}catch(e){console.log(e)}return t},Fi.prototype.setBoxImage=function(e){try{this.item._box.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},Fi.prototype.setBoxRepeat=function(e,t){try{this.item._box.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},Fi.prototype.setHeightType=function(e){try{1==e?this.item._box.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._box.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._box.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},Fi.prototype.setDistanceDisplayCondition=function(e,t){t=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._box.distanceDisplayCondition=t}catch(e){console.log(e)}return this},Fi.prototype.setFill=function(e){try{this.item._box.fill=e}catch(e){console.log(e)}return this},Fi.prototype.setMaterialAlpha=function(e){try{this.item._box.material.color._value.alpha=e,this.item._box.show=!0}catch(e){console.log(e)}return this},Fi.prototype.setOutlineColor=function(e){try{this.item._box.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Fi.prototype.setMaterial=function(e){try{this.item._box.material.color=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Fi.prototype.setItem=function(e){this.item=e},Fi.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Object.defineProperties(Fi.prototype,{ColorAlpha:{get:function(){return this.item._box.color._value.alpha}},Scale:{get:function(){return this.item._box.scale}},Rotation:{get:function(){return this.item._box.rotation}},Width:{get:function(){return this.item._box.width}},Height:{get:function(){return this.item._box.heightReference}},Color:{get:function(){return this._color.toHtmlColor("rgb("+255*this.item._box.backgroundColor._value.red+","+255*this.item._box.backgroundColor._value.green+","+255*this.item._box.backgroundColor._value.blue+","+255*this.item._box.backgroundColor._value.alpha+")")}}}),Fi.prototype.CreateBox=function(e,t,i,o,r,n,a,s){this._postion=e;var l,i={dimensions:new this._cesium.Cartesian3(o,t,i),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.RED};r&&""!==r&&(i.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(r)),n&&""!==n&&(i.material=new G(this._viewer,this._cesium).colorFromHtmlColor(n)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),box:i,orientation:l});s={id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"box",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(a)?0:a),this},Object.defineProperties(Fi.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),Gi.prototype.createEllipsoid=function(e,t,i,o){var r={radii:new this._cesium.Cartesian3(60,60,60),material:this._cesium.Color.YELLOW},t=this._core.extend(r,t,!0);this.item=this._viewer.entities.add({name:i,position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[1]),ellipsoid:t});i={id:this.item.id,name:i,pId:this._core.isnull(o)?0:o,type:"ellipsoid",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),this},Gi.prototype.getstyles=function(){var e={};return e.show=!this.item.ellipsoid.show||this.item.ellipsoid.show._value,e.radii=this.item.ellipsoid.radii?this.item.ellipsoid.radii.getValue():void 0,e.innerRadii=this.item.ellipsoid.innerRadii?this.item.ellipsoid.innerRadii.getValue():void 0,e.minimumClock=this.item.ellipsoid.minimumClock?this.item.ellipsoid.minimumClock._value:void 0,e.maximumClock=this.item.ellipsoid.maximumClock?this.item.ellipsoid.maximumClock._value:void 0,e.minimumCone=this.item.ellipsoid.minimumCone?this.item.ellipsoid.minimumCone._value:void 0,e.maximumCone=this.item.ellipsoid.maximumCone?this.item.ellipsoid.maximumCone._value:void 0,e.heightReference=this.item.ellipsoid.heightReference&&this.item.ellipsoid.heightReference._value?this.item.ellipsoid.heightReference._value:null,e.fill=this.item.ellipsoid.fill?this.item.ellipsoid.fill._value:void 0,e.material={},e.material.color=this.item.ellipsoid.material&&this.item.ellipsoid.material.color&&this.item.ellipsoid.material.color._value?"rgba"+this.item.ellipsoid.material.color.toString():null,e.material.image=this.item.ellipsoid.material&&this.item.ellipsoid.material.image?this.item.ellipsoid.material.image._value:void 0,e.material.repeat=this.item.ellipsoid.material&&this.item.ellipsoid.material.repeat&&this.item.ellipsoid.material.repeat._value?this.item.ellipsoid.material.repeat._value:null,e.outline=this.item.ellipsoid.outline?this.item.ellipsoid.outline._value:void 0,e.outlineWidth=this.item.ellipsoid.outlineWidth&&this.item.ellipsoid.outlineWidth._value?this.item.ellipsoid.outlineWidth._value:void 0,e.outlineColor=this.item.ellipsoid.outlineColor&&this.item.ellipsoid.outlineColor._value?"rgba"+this.item.ellipsoid.outlineColor.toString():null,e.stackPartitions=this.item.ellipsoid.stackPartitions&&this.item.ellipsoid.stackPartitions._value?this.item.ellipsoid.stackPartitions._value:void 0,e.slicePartitions=this.item.ellipsoid.slicePartitions&&this.item.ellipsoid.slicePartitions._value?this.item.ellipsoid.slicePartitions._value:void 0,e.subdivisions=this.item.ellipsoid.subdivisions&&this.item.ellipsoid.subdivisions._value?this.item.ellipsoid.subdivisions._value:void 0,e.near=this.item.ellipsoid.distanceDisplayCondition?this.item.ellipsoid.distanceDisplayCondition._value.near:void 0,e.far=this.item.ellipsoid.distanceDisplayCondition?this.item.ellipsoid.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},Gi.prototype.executeEllipsoid=function(r){var n=this;n.shape={tempPoints:[],button:0,position:{}};var a=new this._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas),s=[],l=[];return a.setInputAction(function(e){var t=n._viewer.scene.camera.pickEllipsoid(e.position,n._viewer.scene.globe.ellipsoid),i=n._cesium.Cartographic.fromCartesian(t),e=n._cesium.Math.toDegrees(i.longitude),i=n._cesium.Math.toDegrees(i.latitude);l.push({lon:e,lat:i});0==n.shape.button?(s.push(t.clone()),s.push(t),n.shape.position=t,n.ellipsoid=n._viewer.entities.add({name:"",position:n._cesium.Cartesian3.fromDegrees(l[0].lon,l[0].lat),ellipsoid:{radii:new n._cesium.Cartesian3(67500,67500,67500),material:n._cesium.Color.fromRandom({alpha:1})}}),n.item=n.ellipsoid):1==n.shape.button&&(o=f(l[0].lat,l[0].lon,l[1].lat,l[1].lon),n.item.ellipsoid.radii=new n._cesium.Cartesian3(o,o,o),a.destroy());t=0;n._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(t=we.selectedItem.id);var o=n._core.getuid(),o={id:o,name:"新建球"+o,pId:n._core.isnull(t)?0:t,type:"ellipsoid",item:n};n.setTreeobj(o),we.insertGroupId(o,n._core.isnull(t)?0:t),"function"==typeof r&&r({polyline:{},positions:[],distance:[]}),n.shape.button=n.shape.button+1},this._cesium.ScreenSpaceEventType.LEFT_CLICK),a.setInputAction(function(e){var t;1!=n.shape.button||(t=n._viewer.camera.pickEllipsoid(e.endPosition,n._viewer.scene.globe.ellipsoid))&&(e=n._cesium.Cartographic.fromCartesian(t),t=n._cesium.Math.toDegrees(e.longitude),e=n._cesium.Math.toDegrees(e.latitude),Math.ceil(n._viewer.camera.positionCartographic.height),l.push({lon:t,lat:e}),e=f(l[0].lat,l[0].lon,l[l.length-1].lat,l[l.length-1].lon),n.item.ellipsoid.radii=new n._cesium.Cartesian3(e,e,e))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},Gi.prototype.setMaterialColor=function(e){try{this.item._ellipsoid.material.color=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Gi.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=null==this.item.ellipsoid.radii?void 0:this.item.ellipsoid.radii.getValue(),i=null==this.item.ellipsoid.fill?void 0:this.item.ellipsoid.fill.getValue(),o=this.item.ellipsoid.material;null!=o&&(o={color:null==o.color._value?void 0:"rgba("+o.color._value.red+","+o.color._value.green+","+o.color._value.blue+","+o.color._value.alpha+")",image:null==o.image?void 0:o.image._value,diffusemap:null==o.diffusemap?void 0:o.diffusemap._value,alphamap:null==o.alphamap?void 0:o.alphamap._value});var r=null==this.item.ellipsoid.outline?void 0:this.item.ellipsoid.outline._value,n=null==this.item.ellipsoid.outlineColor?void 0:"rgba("+this.item.ellipsoid.outlineColor._value.red+","+this.item.ellipsoid.outlineColor._value.green+","+this.item.ellipsoid.outlineColor._value.blue+","+this.item.ellipsoid.outlineColor._value.alpha+")",a=null==this.item.ellipsoid.outlineWidth?void 0:this.item.ellipsoid.outlineWidth.getValue(),s=this.item.ellipsoid.distanceDisplayCondition,l=null==s?void 0:s._value.near,u=null==s?void 0:s._value.far,s=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"ellipsoid",position:{x:this._cesium.Math.toDegrees(s.longitude),y:this._cesium.Math.toDegrees(s.latitude),z:this._cesium.Math.toDegrees(s.height)},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,radii:t,fill:i,material:o,outline:r,outlineColor:n,outlineWidth:a,near:l,far:u}}},Gi.prototype.setTreeobj=function(e){this.treeobj=e},Gi.prototype.setVisibility=function(e){this.item.show=e},Gi.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Gi.prototype.setHeightType=function(e){try{1==e?this.item._ellipsoid.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._ellipsoid.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._ellipsoid.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},Gi.prototype.setEllipsoidAlpha=function(e){try{this.item._ellipsoid.material.color._value.alpha=e,this.item._ellipsoid.show=!0}catch(e){console.log(e)}return this},Gi.prototype.setDistanceDisplayCondition=function(e,t){t=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._ellipsoid.distanceDisplayCondition=t}catch(e){console.log(e)}return this},Gi.prototype.setEllipsoidImage=function(e){try{this.item._ellipsoid.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},Gi.prototype.setEllipsoidRepeat=function(e,t){try{this.item._ellipsoid.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},Gi.prototype.setMaterial=function(e){try{this.item._ellipsoid.show=e}catch(e){console.log(e)}return this},Gi.prototype.setRadii=function(e){try{this.item._ellipsoid.radii=new this._cesium.Cartesian3(e,e,e)}catch(e){console.log(e)}return this},Gi.prototype.setItem=function(e){this.item=e},Gi.prototype.CreateSphere=function(e,t,i,o,r,n,a,s){this._postion=e;t={radii:this._cesium.defaultValue(new this._cesium.Cartesian3(t,t,t),new this._cesium.Cartesian3(60,60,60)),material:this._cesium.Color.RED,outline:!1,outlineColor:void 0};o&&""!==o&&(t.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(o),t.outline=!0),r&&""!==r&&(t.material=new G(this._viewer,this._cesium).colorFromHtmlColor(r)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),ellipsoid:t,orientation:l});var l={id:this.item.id,name:name,pId:this._core.isnull(a)?0:a,type:"ellipsoid",item:this};return this.setTreeobj(l),this._tree.insertGroupId(l,this._core.isnull(a)?0:a),this},Object.defineProperties(Gi.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),Ni.prototype.createRectangle=function(o,r){var n,a=this,s=this;this._tree.removeHandler(),o=o||{},a.shape={points:[],button:0,rect:null,entity:null};var l={fillColor:this._cesium.Color.YELLOW.withAlpha(.4),outlineColor:this._cesium.Color.RED};o&&o.fillColor&&(l.fillColor=new G(this._viewer,this._cesium).colorFromHtmlColor(fillColor)),o&&o.outlineColor&&(l.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(outlineColor)),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(s._viewer.scene.canvas),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw);var u=null;this._tree.handler.setInputAction(function(e){n=s._getPosition.getMousePosition(e,[a.shape.entity]);var t,i=s._getPosition.getMouseDegrees(e,[a.shape.entity]);1<=a.shape.button?(t={obj1:u,obj2:i},e={position:s._viewer.camera.position.clone(),orientation:{heading:s._viewer.camera.heading,pitch:s._viewer.camera.pitch,roll:s._viewer.camera.roll}},"function"==typeof r&&r({originalCameraLocation:e,pointes:t,terrainExaggeration:"5",zj:"true"}),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.MOUSE_MOVE),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.LEFT_CLICK)):u=i,a.shape.button=a.shape.button+1,n&&(0==a.shape.points.length?(a.shape.points.push(s._viewer.scene.globe.ellipsoid.cartesianToCartographic(n)),a.shape.rect=s._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.east+=1e-6,a.shape.rect.north+=1e-6,a.shape.entity=s._viewer.entities.add({rectangle:{coordinates:a.shape.rect,material:l.fillColor,outline:!0,outlineWidth:2,outlineColor:l.outlineColor,height:o&&o.height,heightReference:o&&o.heightReference}}),a.shape.entity.rectangle.coordinates=new s._cesium.CallbackProperty(function(){return a.shape.rect},!1),a.bufferEntity=a.shape.entity,s.item=a.shape.entity):(s._core.mouse(s._viewer.container,0,"0"),a.shape.entity.rectangle.coordinates=s._cesium.Rectangle.clone(a.shape.rect),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.MOUSE_MOVE),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.LEFT_CLICK)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),s._tree.handler.setInputAction(function(e){0==a.shape.points.length||(e=s._getPosition.getMousePosition(e,[a.shape.entity]))&&(a.shape.points[1]=s._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),a.shape.rect=s._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.west==a.shape.rect.east&&(a.shape.rect.east+=1e-6),a.shape.rect.south==a.shape.rect.north&&(a.shape.rect.north+=1e-6))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var e=0;s._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(e=we.selectedItem.id);var t=s._core.getuid(),t={id:t,name:"新建矩形"+t,pId:s._core.isnull(e)?0:e,type:"rectangle",item:s};return s.setTreeobj(t),we.insertGroupId(t,s._core.isnull(e)?0:e),this},Ni.prototype.getstyles=function(){var e={};return e.show=!this.item.rectangle.show||this.item.rectangle.show._value,e.coordinates=this.item.rectangle.coordinates?{east:this.item.rectangle.coordinates.getValue().east,north:this.item.rectangle.coordinates.getValue().north,south:this.item.rectangle.coordinates.getValue().south,west:this.item.rectangle.coordinates.getValue().west}:[],e.height=this.item.rectangle.height?this.item.rectangle.height.toString():0,e.heightReference=this.item.rectangle.heightReference?this.item.rectangle.heightReference.toString():0,e.extrudedHeight=this.item.rectangle.extrudedHeight?this.item.rectangle.extrudedHeight.getValue().toString():0,e.extrudedHeightReference=this.item.rectangle.extrudedHeightReference?this.item.rectangle.extrudedHeightReference.toString():0,e.rotation=this.item.rectangle.rotation?this.item.rectangle.rotation.toString():0,e.stRotation=this.item.rectangle.stRotation?this.item.rectangle.stRotation.toString():0,e.granularity=this.item.rectangle.granularity&&this.item.rectangle.granularity._value?this.item.rectangle.granularity._value:void 0,e.fill=this.item.rectangle.fill?this.item.rectangle.fill._value:0,e.outline=this.item.rectangle.outline?this.item.rectangle.outline._value:0,e.outlineWidth=this.item.rectangle.outlineWidth&&this.item.rectangle.outlineWidth._value?this.item.rectangle.outlineWidth._value.toString():1,e.outlineColor=this.item.rectangle.outlineColor&&this.item.rectangle.outlineColor._value?"rgba"+this.item.rectangle.outlineColor.toString():null,e.material={},e.material.color=this.item.rectangle.material&&this.item.rectangle.material.color&&this.item.rectangle.material.color._value?"rgba"+this.item.rectangle.material.color.toString():null,e.material.image=this.item.rectangle.material&&this.item.rectangle.material.image&&this.item.rectangle.material.image._value?this.item.rectangle.material.image.toString():null,e.material.repeat=this.item.rectangle.material&&this.item.rectangle.material.repeat&&this.item.rectangle.material.repeat._value?this.item.rectangle.material.repeat._value:null,e.classificationType=this.item.rectangle.classificationType?this.item.rectangle.classificationType.toString():null,e.near=this.item.rectangle.distanceDisplayCondition?this.item.rectangle.distanceDisplayCondition._value.near:null,e.far=this.item.rectangle.distanceDisplayCondition?this.item.rectangle.distanceDisplayCondition._value.far:null,e},Ni.prototype.createRectangleOptimization=function(o,r){var n,a=this;this._tree.removeHandler(),a.shape={points:[],button:0,rect:null,entity:null};var s={fillColor:this._cesium.Color.YELLOW.withAlpha(.4),outlineColor:this._cesium.Color.RED};o&&o.fillColor&&(s.fillColor=new G(this._viewer,this._cesium).colorFromHtmlColor(fillColor)),o&&o.outlineColor&&(s.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(outlineColor)),this.handler=new this._cesium.ScreenSpaceEventHandler(a._viewer.scene.canvas);var l=null;this.handler.setInputAction(function(e){n=a._core.getPointFromWindowPoint(e.position,a._viewer);var t,i=a._viewer.camera.pickEllipsoid(e.position,a._viewer.scene.globe.ellipsoid);1<=a.shape.button?(t={obj1:l,obj2:i},e={position:a._viewer.camera.position.clone(),orientation:{heading:a._viewer.camera.heading,pitch:a._viewer.camera.pitch,roll:a._viewer.camera.roll}},"function"==typeof r&&r({originalCameraLocation:e,pointes:t,terrainExaggeration:"5",zj:"true"}),a.handler.removeInputAction(a._cesium.ScreenSpaceEventType.MOUSE_MOVE),a.handler.removeInputAction(a._cesium.ScreenSpaceEventType.LEFT_CLICK)):l=i,a.shape.button=a.shape.button+1,n&&(0==a.shape.points.length?(a.shape.points.push(a._viewer.scene.globe.ellipsoid.cartesianToCartographic(n)),a.shape.rect=a._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.east+=1e-6,a.shape.rect.north+=1e-6,a.shape.entity=a._viewer.entities.add({rectangle:{coordinates:a.shape.rect,material:s.fillColor,outline:!0,outlineWidth:2,outlineColor:s.outlineColor,height:o&&o.height,heightReference:o&&o.heightReference||1}}),a.shape.entity.objId=a.objId,a.shape.entity.rectangle.coordinates=new a._cesium.CallbackProperty(function(){return a.shape.rect},!1),a._core.Entityadd(a),a.bufferEntity=a.shape.entity,a.item=a.shape.entity):(a.state=1,a.handler.removeInputAction(a._cesium.ScreenSpaceEventType.MOUSE_MOVE),a.handler.removeInputAction(a._cesium.ScreenSpaceEventType.LEFT_CLICK)),(i=a.createPoint(n,!1)).wz=a.gonRectangleArr.length,a.gonRectangleArr.push(i),a.positions.push(n))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){var t;0==a.shape.points.length||(t=a._core.getPointFromWindowPoint(e.endPosition,a._viewer))&&(e=a._viewer.camera.getPickRay(e.endPosition),a._viewer.scene.globe.pick(e,a._viewer.scene),a.shape.points[1]=a._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),a.shape.rect=a._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.west==a.shape.rect.east&&(a.shape.rect.east+=1e-6),a.shape.rect.south==a.shape.rect.north&&(a.shape.rect.north+=1e-6))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var e=0;a._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(e=we.selectedItem.id);var t=a._core.getuid(),t={id:t,name:"新建矩形"+t,pId:a._core.isnull(e)?0:e,type:"rectangle",item:a};return a.setTreeobj(t),we.insertGroupId(t,a._core.isnull(e)?0:e),this},Ni.prototype.startModify=function(){var o="拖动修改位置,右击删除该点";if(1==this.state||2==this.state){this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var r=this,e=0;e<r.gonRectangleArr.length;e++){var t=r.gonRectangleArr[e];t&&(t.show=!0)}this.modifyHandler.setInputAction(function(e){e=r._viewer.scene.pick(e.position);if(Cesium.defined(e)&&e.id)e.id.objId||(r.modifyPoint=e.id,o="释放后完成修改"),r.forbidDrawWorld(!0);else{for(var t=0;t<r.gonRectangleArr.length;t++){var i=r.gonRectangleArr[t];i&&(i.show=!1)}r.modifyHandler&&(r.modifyHandler.destroy(),r.modifyHandler=null)}},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t,i=r._viewer.scene.pick(e.endPosition);r._core.CreateTooltip(o,e.endPosition,!1),r.modifyPoint?r.positions.length<1||!r.modifyPoint||((t=r.getCatesian3FromPX(e.endPosition,r._viewer,[r.shape.entity,r.modifyPoint]))&&(r.modifyPoint.position.setValue(t),r.shape.points[r.modifyPoint.wz]=r._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),r.shape.rect=r._cesium.Rectangle.fromCartographicArray(r.shape.points),r.shape.rect.east+=1e-6,r.shape.rect.north+=1e-6),r._core.CreateTooltip(o,e.endPosition,!0)):r._cesium.defined(i)&&i.id&&i.id.objId&&r._core.CreateTooltip("拖动修改位置",e.endPosition,!0)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){r.forbidDrawWorld(!1),r.modifyPoint&&(e=r.getCatesian3FromPX(e.position,r._viewer,[r.shape.entity,r.modifyPoint]),r.modifyPoint.position.setValue(e),r.shape.points[r.modifyPoint.wz]=r._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),r.shape.rect=r._cesium.Rectangle.fromCartographicArray(r.shape.points),r.shape.rect.east+=1e-6,r.shape.rect.north+=1e-6,r.modifyPoint=null,r.forbidDrawWorld(!1),o="拖动修改位置")},Cesium.ScreenSpaceEventType.LEFT_UP)}},Ni.prototype.createPoint=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},Ni.prototype.getCatesian3FromPX=function(e,t,i){var o,r=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=r;if(t.scene.pickPositionSupported&&this._cesium.defined(a))o=t.scene.pickPosition(e);else{e=t.camera.getPickRay(e);if(!e)return;o=t.scene.globe.pick(e,t.scene)}return o},Ni.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},Ni.prototype.CreateRectangle=function(e,t,i,o,r){var n=this._core.getuid(),a={outlineColor:this._cesium.Color.RED,material:this._cesium.Color.YELLOW.withAlpha(.5)};i&&i.fillColor&&(a.material=new G(this._viewer,this._cesium).colorFromHtmlColor(i.fillColor)),i&&i.outlineColor&&(a.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(i.outlineColor)),(a=this._core.extend(a,i,!1)).coordinates=this.getCoordinates(t),this.item=this._viewer.entities.add({id:n,name:e||"新建矩形",rectangle:a}),"function"==typeof r&&r(this.item),this._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(o=we.selectedItem.id);n={id:n,name:"新建矩形"+n,pId:this._core.isnull(o)?0:o,type:"rectangle",item:this.item};return this.setTreeobj(n),we.insertGroupId(n,this._core.isnull(o)?0:o),this},Ni.prototype.getCoordinates=function(e){var t,i,o=e[0].lon>e[1].lon?(t=e[1].lon,e[0].lon):(t=e[0].lon,e[1].lon),e=e[0].lat>e[1].lat?(i=e[0].lat,e[1].lat):(i=e[1].lat,e[0].lat);return new this._cesium.Rectangle.fromDegrees(t,e,o,i)},Ni.prototype.createRectanglelbj=function(e,o){var r,n=this,a=this;n.shape={points:[],button:0,rect:null,entity:null},this._tree.removeHandler(),this.closeBrowseBorder();var t=0;null!=e&&null!=e.id&&(t=e.id);var i=this._core.CreateTooltip();a._tree.handler=new this._cesium.ScreenSpaceEventHandler(a._viewer.scene.canvas);var s=null,l=null;a._tree.handler.setInputAction(function(e){r=a._core.getPointFromWindowPoint(e.position,a._viewer);var t,i=a._viewer.camera.pickEllipsoid(e.position,a._viewer.scene.globe.ellipsoid);1<=n.shape.button?(t={obj1:s,obj2:l=i},e={position:a._viewer.camera.position.clone(),orientation:{heading:a._viewer.camera.heading,pitch:a._viewer.camera.pitch,roll:a._viewer.camera.roll}},a.llbj({originalCameraLocation:e,pointes:t,terrainExaggeration:"5",zj:"true"},n.shape.entity),"function"==typeof o&&o(n.shape.entity),a._tree.handler.removeInputAction(a._cesium.ScreenSpaceEventType.LEFT_CLICK)):s=i,n.shape.button=n.shape.button+1,r&&(0==n.shape.points.length?(n.shape.points.push(a._viewer.scene.globe.ellipsoid.cartesianToCartographic(r)),n.shape.rect=a._cesium.Rectangle.fromCartographicArray(n.shape.points),n.shape.rect.east+=1e-6,n.shape.rect.north+=1e-6,n.shape.entity=a._viewer.entities.add({rectangle:{coordinates:n.shape.rect,material:a._cesium.Color.YELLOW.withAlpha(0),outline:!0,outlineWidth:10,outlineColor:a._cesium.Color.YELLOW,height:0}}),n.shape.entity.rectangle.coordinates=new a._cesium.CallbackProperty(function(){return n.shape.rect},!1),a.item=n.shape.entity):2==n.shape.points.length||a._tree.handler.removeInputAction(a._cesium.ScreenSpaceEventType.MOUSE_MOVE))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),a._tree.handler.setInputAction(function(e){var t;0==n.shape.points.length?i.showAt(e.endPosition,"点击左键在球面上绘制矩形!"):l&&i.showAt(e.endPosition,"请将视野缩放到范围内以开启边界浏览"),0==n.shape.points.length||l||(i.showAt(e.endPosition,"再次点击结束绘制!"),(t=a._core.getPointFromWindowPoint(e.endPosition,a._viewer))&&(e=a._viewer.camera.getPickRay(e.endPosition),a._viewer.scene.globe.pick(e,a._viewer.scene),n.shape.points[1]=a._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),n.shape.rect=a._cesium.Rectangle.fromCartographicArray(n.shape.points),n.shape.rect.west==n.shape.rect.east&&(n.shape.rect.east+=1e-6),n.shape.rect.south==n.shape.rect.north&&(n.shape.rect.north+=1e-6)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),a._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||we.selectedItem.id;e=a._core.getuid(),e={id:e,name:"新建浏览边界"+e,pId:a._core.isnull(t)?0:t,type:"rectangle",item:a};return a.setTreeobj(e),we.insertGroupId(e,a._core.isnull(t)?0:t),this},Ni.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=null==this.item.rectangle.coordinates?void 0:this.item.rectangle.coordinates._value;null!=t&&(t={east:t.east,north:t.north,south:t.south,west:t.west});var i=null==this.item.rectangle.height?void 0:this.item.rectangle.height._value,o=null==this.item.rectangle.extrudedHeight?void 0:this.item.rectangle.extrudedHeight._value,r=null==this.item.rectangle.rotation?void 0:this.item.rectangle.rotation._value,n=null==this.item.rectangle.stRotation?void 0:this.item.rectangle.stRotation._value,a=null==this.item.rectangle.fill?void 0:this.item.rectangle.fill._value,s=this.item.rectangle.material;null!=s&&(s={color:null==s.color._value?void 0:"rgba("+s.color._value.red+","+s.color._value.green+","+s.color._value.blue+","+s.color._value.alpha+")",image:null==s.image?void 0:s.image._value,diffusemap:null==s.diffusemap?void 0:s.diffusemap._value,alphamap:null==s.alphamap?void 0:s.alphamap._value});var l=null==this.item.rectangle.outline?void 0:this.item.rectangle.outline._value,u=null==this.item.rectangle.outlineColor?void 0:"rgba("+this.item.rectangle.outlineColor._value.red+","+this.item.rectangle.outlineColor._value.green+","+this.item.rectangle.outlineColor._value.blue+","+this.item.rectangle.outlineColor._value.alpha+")",c=null==this.item.rectangle.outlineWidth?void 0:this.item.rectangle.outlineWidth._value,h=this.item.rectangle.distanceDisplayCondition,m=null==h?void 0:h._value.near,h=null==h?void 0:h._value.far;return{type:"rectangle",treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,coordinates:t,height:i,extrudedHeight:o,rotation:r,stRotation:n,fill:a,material:s,outline:l,outlineColor:u,outlineWidth:c,near:m,far:h}}},Ni.prototype.setTreeobj=function(e){this.treeobj=e},Ni.prototype.llbj=function(e,t){var r=document.getElementById("toolTip");r.innerHTML="请将视野缩放到范围内以开启边界浏览";t=t.rectangle;t.height=void 0,t.heightReference=void 0,t.perPositionHeight=!1;var e=e.pointes,i=[];i.push(e.obj1),i.push(e.obj2);for(var o,n,a={},s=0;s<i.length;s++)n=this._cesium.Cartographic.fromCartesian(i[s]),o=this._cesium.Math.toDegrees(n.longitude),n=this._cesium.Math.toDegrees(n.latitude),0===s?(a.west=o,a.north=n,a.east=o,a.south=n):(o>a.west?a.east=o:a.west=o,n>a.south?a.north=n:a.south=n);i[0].x,i[1].x,i[0].y,i[1].y,i[0].z,this._viewer.camera.heading,this._viewer.camera.pitch,this._viewer.camera.roll;var l=this._viewer.camera.heading,u=this._viewer.camera.pitch,c=this._viewer.camera.roll,h=this._viewer.camera.position.clone(),m={orientation:{heading:l,pitch:u,roll:c},position:h},d=this;d.flyListener=function(){var e=d._viewer.camera.computeViewRectangle(),t=e.west/Math.PI*180,i=e.north/Math.PI*180,o=e.east/Math.PI*180,e=e.south/Math.PI*180;d.isInArea({west:t,north:i,east:o,south:e},a)?(d._tree.removeHandler(),r.style.left="50%",r.style.top="50%",r.innerHTML="边界浏览已开启,右键结束边界浏览",setTimeout(function(){r.style.display="none"},2e3),d._viewer.scene.camera.changed.removeEventListener(d.flyListener),d.flyListener=void 0,d._tree.handler=new d._cesium.ScreenSpaceEventHandler(d._viewer.scene.canvas),d._viewEvent=function(e){m=d.limitView(a,m)},d._viewer.scene.camera.percentageChanged=.001,d._viewer.scene.camera.changed.addEventListener(d._viewEvent),d._tree.handler.setInputAction(function(e){d.closeBrowseBorder()},d._cesium.ScreenSpaceEventType.RIGHT_CLICK)):(l=d._viewer.camera.heading,u=d._viewer.camera.pitch,c=d._viewer.camera.roll,h=d._viewer.camera.position.clone(),m={orientation:{heading:l,pitch:u,roll:c},position:h})},this._viewer.scene.camera.percentageChanged=.001,this._viewer.scene.camera.changed.addEventListener(d.flyListener)},Ni.prototype.closeBrowseBorder=function(){var e=document.getElementById("toolTip");this._tree.endtemporaryItem(),this._tree.handler&&this._tree.handler.destroy(),this.flyListener&&(this._viewer.scene.camera.changed.removeEventListener(this.flyListener),this.flyListener=void 0),this._viewEvent?(this._viewer.scene.camera.changed.removeEventListener(this._viewEvent),this._viewEvent=void 0,e.style.display="block",e.innerHTML="取消边界浏览",setTimeout(function(){e.style.display="none"},1e3)):e&&(e.style.display="none")},Ni.prototype.limitView=function(e,t){var i=this._viewer.camera.computeViewRectangle(),o=i.west/Math.PI*180,r=i.north/Math.PI*180,n=i.east/Math.PI*180,i=i.south/Math.PI*180;return this.isInArea({west:o,north:r,east:n,south:i},e)?t={orientation:{heading:this._viewer.camera.heading,pitch:this._viewer.camera.pitch,roll:this._viewer.camera.roll},position:this._viewer.camera.position.clone()}:null!==t&&this._viewer.camera.setView({destination:t.position,orientation:t.orientation}),t},Ni.prototype.isInArea=function(e,t){var i=!1;return i=e.south>t.south&&e.east<t.east&&e.north<t.north&&e.west>t.west?!0:i},Ni.prototype.createRectangledxkz=function(i){var o=this,r=this;r.shape={points:[],rect:null,entity:null};var n,a=null,s=null,l=new o._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas);function u(e){if("EllipsoidTerrainProvider"==o._viewer.scene.terrainProvider.constructor.name)return o._viewer.camera.pickEllipsoid(e,o._viewer.scene.globe.ellipsoid);e=o._viewer.scene.camera.getPickRay(e);return o._viewer.scene.globe.pick(e,o._viewer.scene)}return l.setInputAction(function(e){n=u(e.position);var t=o._viewer.camera.pickEllipsoid(e.position,o._viewer.scene.globe.ellipsoid);(a=null==a?t:a).x==t.x&&a.y==t.y&&a.z==t.z||(s=t),n&&(0==r.shape.points.length?(r.shape.points.push(o._viewer.scene.globe.ellipsoid.cartesianToCartographic(n)),r.shape.rect=o._cesium.Rectangle.fromCartographicArray(r.shape.points),r.shape.rect.east+=1e-6,r.shape.rect.north+=1e-6,r.shape.entity=o._viewer.entities.add({rectangle:{coordinates:r.shape.rect,material:o._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:o._cesium.Color.RED,height:0}}),r.bufferEntity=r.shape.entity):(l.removeInputAction(o._cesium.ScreenSpaceEventType.MOUSE_MOVE),l.removeInputAction(o._cesium.ScreenSpaceEventType.LEFT_CLICK),e={obj1:a,obj2:s},t={position:o._viewer.camera.position.clone(),orientation:{heading:o._viewer.camera.heading,pitch:o._viewer.camera.pitch,roll:o._viewer.camera.roll}},""!=i&&null!=i&&"function"==typeof i&&i({pointes:e,originalCameraLocation:t})))},o._cesium.ScreenSpaceEventType.LEFT_CLICK),l.setInputAction(function(e){0==r.shape.points.length||(e=u(e.endPosition))&&(r.shape.points[1]=o._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),r.shape.rect=o._cesium.Rectangle.fromCartographicArray(r.shape.points),r.shape.rect.west==r.shape.rect.east&&(r.shape.rect.east+=1e-6),r.shape.rect.south==r.shape.rect.north&&(r.shape.rect.north+=1e-6),r.shape.entity.rectangle.coordinates=r.shape.rect)},o._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},Ni.prototype.executeExcavation=function(e){var i,o=this,r=this;o.shape={points:[],button:0,rect:null,entity:null};var n=new this._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas),a=[];n.setInputAction(function(e){var t;i=r._core.getPointFromWindowPoint(e.position,r._viewer),2<=o.shape.button&&(t=o._viewer.scene.globe,o.shape.box=r._viewer.entities.add({position:r._cesium.Cartesian3.fromDegrees(a[0].lon,a[0].lat,100),box:{dimensions:new r._cesium.Cartesian3(1e4,1e4,1e4),material:r._cesium.Color.WHITE.withAlpha(.5),outline:!0,outlineColor:r._cesium.Color.WHITE}}),t.depthTestAgainstTerrain=!0,t.clippingPlanes=new o._cesium.ClippingPlaneCollection({modelMatrix:o.shape.box.computeModelMatrix(r._cesium.JulianDate.now()),planes:[new r._cesium.Plane(new r._cesium.Cartesian3(1,0,0),-700),new r._cesium.Plane(new r._cesium.Cartesian3(-1,0,0),-700),new r._cesium.Plane(new r._cesium.Cartesian3(0,1,0),-700),new r._cesium.Plane(new r._cesium.Cartesian3(0,-1,0),-700)],edgeWidth:1,edgeColor:r._cesium.Color.WHITE}),n.removeInputAction(r._cesium.ScreenSpaceEventType.MOUSE_MOVE),n.removeInputAction(r._cesium.ScreenSpaceEventType.LEFT_CLICK)),o.shape.button=o.shape.button+1,i&&(0==o.shape.points.length?(o.shape.points.push(r._viewer.scene.globe.ellipsoid.cartesianToCartographic(i)),e=r._viewer.scene.camera.pickEllipsoid(movement.position,r._viewer.scene.globe.ellipsoid),t=r._cesium.Cartographic.fromCartesian(e),e=r._cesium.Math.toDegrees(t.longitude),t=r._cesium.Math.toDegrees(t.latitude),a.push({lon:e,lat:t}),o.shape.rect=r._cesium.Rectangle.fromCartographicArray(o.shape.points),o.shape.rect.east+=1e-6,o.shape.rect.north+=1e-6,o.shape.entity=r._viewer.entities.add({rectangle:{coordinates:o.shape.rect,material:r._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:r._cesium.Color.RED,height:0}}),o.bufferEntity=o.shape.entity,r.item=o.shape.entity):2==o.shape.points.length||(n.removeInputAction(r._cesium.ScreenSpaceEventType.MOUSE_MOVE),n.removeInputAction(r._cesium.ScreenSpaceEventType.LEFT_CLICK)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(function(e){var t;0==o.shape.points.length||(t=r._core.getPointFromWindowPoint(e.endPosition,r._viewer))&&(e=r._viewer.camera.getPickRay(e.endPosition),r._viewer.scene.globe.pick(e,r._viewer.scene),o.shape.points[1]=r._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),o.shape.rect=r._cesium.Rectangle.fromCartographicArray(o.shape.points),o.shape.rect.west==o.shape.rect.east&&(o.shape.rect.east+=1e-6),o.shape.rect.south==o.shape.rect.north&&(o.shape.rect.north+=1e-6),o.shape.entity.rectangle.coordinates=o.shape.rect)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var t=0;r._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(t=we.selectedItem.id);var s=r._core.getuid(),s={id:s,name:"新建矩形"+s,pId:r._core.isnull(t)?0:t,type:"rectangle",item:r};return r.setTreeobj(s),we.insertGroupId(s,r._core.isnull(t)?0:t),"function"==typeof e&&e(ploylinejl),this},Ni.prototype.deleteObject=function(){this._viewer.entities.remove(this.item),null!=this._viewEvent&&(this._tree.handler.destroy(),this._viewer.scene.camera.changed.removeEventListener(this._viewEvent))},Ni.prototype.setVisibility=function(e){this.item.show=e},Ni.prototype.getVisibility=function(){return this.item.show},Ni.prototype.setDistanceDisplayCondition=function(e,t){t=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._rectangle.distanceDisplayCondition=t}catch(e){console.log(e)}return this},Ni.prototype.setRectangleAlpha=function(e){try{this.item._rectangle.material.color._value.alpha=e,this.item._rectangle.show=!0}catch(e){console.log(e)}return this},Ni.prototype.setRectangleColor=function(e){try{this.item._rectangle.material.color=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Ni.prototype.setDistanceDisplayCondition=function(e,t){t=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._rectangle.distanceDisplayCondition=t}catch(e){console.log(e)}return this},Ni.prototype.setPolygonImage=function(e){try{this.item._rectangle.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},Ni.prototype.setRectangleRepeat=function(e,t){try{this.item._rectangle.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},Ni.prototype.setOutlineColor=function(e){try{this.item._rectangle.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Ni.prototype.setOutline=function(e){try{this.item._rectangle.outline=e}catch(e){console.log(e)}return this},Ni.prototype.setExtrudedHeight=function(e){try{this.item._rectangle.extrudedHeight=e}catch(e){console.log(e)}return this},Ni.prototype.setHeight=function(e){try{this.item._rectangle.height=e}catch(e){console.log(e)}return this},Object.defineProperties(Ni.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Ni.prototype.setItem=function(e){this.item=e},Object.defineProperties(Ni.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(Ni.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(Ni.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(Ni.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(Ni.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(Ni.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(Ni.prototype,{polygonTempOptions:{get:function(){return{height:0,extrudedHeight:0,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:ShadowMode.DISABLED,classificationType:ClassificationType.BOTH,arcType:ArcType.GEODESIC}}}}),Bi.prototype.createCircle=function(e,t,i,o){var r={id:this._core.getuid(),semiMinorAxis:3e5,semiMajorAxis:3e5,height:2e5,material:this._cesium.Color.GREEN,outline:!0},t=this._Core.extend(r,t,!0);this.item=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),name:i,ellipse:t});i={id:this.item.id,name:i,pId:this._core.isnull(o)?0:o,type:"circle",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),greenCircle},Bi.prototype.getstyles=function(){var e={};return e.show=!this.item.ellipse.show||this.item.ellipse.show._value,e.height=this.item.ellipse.height&&this.item.ellipse.height._value?this.item.ellipse.height._value:void 0,e.semiMajorAxis=this.item.ellipse.semiMajorAxis&&this.item.ellipse.semiMajorAxis.getValue()?this.item.ellipse.semiMajorAxis.getValue():void 0,e.semiMinorAxis=this.item.ellipse.semiMinorAxis&&this.item.ellipse.semiMinorAxis.getValue()?this.item.ellipse.semiMinorAxis.getValue():void 0,e.heightReference=this.item.ellipse.heightReference&&this.item.ellipse.heightReference._value?this.item.ellipse.heightReference._value:void 0,e.extrudedHeight=this.item.ellipse.extrudedHeight&&this.item.ellipse.extrudedHeight.getValue()?this.item.ellipse.extrudedHeight.getValue():void 0,e.extrudedHeightReference=this.item.ellipse.extrudedHeightReference&&this.item.ellipse.extrudedHeightReference._value?this.item.ellipse.extrudedHeightReference._value:void 0,e.rotation=this.item.ellipse.rotation&&this.item.ellipse.rotation._value?this.item.ellipse.rotation._value:void 0,e.stRotation=this.item.ellipse.stRotation&&this.item.ellipse.stRotation._value?this.item.ellipse.stRotation._value:void 0,e.granularity=this.item.ellipse.granularity&&this.item.ellipse.granularity._value?this.item.ellipse.granularity._value:void 0,e.fill=this.item.ellipse.fill?this.item.ellipse.fill._value:void 0,e.material={},e.material.color=this.item.ellipse.material&&this.item.ellipse.material.color&&this.item.ellipse.material.color._value?"rgba"+this.item.ellipse.material.color.toString():void 0,e.material.image=this.item.ellipse.material&&this.item.ellipse.material.image?this.item.ellipse.material.image._value:void 0,e.material.repeat=this.item.ellipse.material&&this.item.ellipse.material.repeat._value?this.item.ellipse.material.repeat._value:void 0,e.outline=this.item.ellipse.outline?this.item.ellipse.outline._value:void 0,e.outlineWidth=this.item.ellipse.outlineWidth&&this.item.ellipse.outlineWidth._value?this.item.ellipse.outlineWidth._value:void 0,e.outlineColor=this.item.ellipse.outlineColor&&this.item.ellipse.outlineColor._value?"rgba"+this.item.ellipse.outlineColor.toString():void 0,e.numberOfVerticalLines=this.item.ellipse.numberOfVerticalLines&&this.item.ellipse.numberOfVerticalLines._value?this.item.ellipse.numberOfVerticalLines._value:void 0,e.classificationType=this.item.ellipse.classificationType&&this.item.ellipse.classificationType._value?this.item.ellipse.classificationType._value:void 0,e.near=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.near:void 0,e.far=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},Bi.prototype.createCircleOptimization=function(e,t){this.style=e;var s=this;this.handler.setInputAction(function(e){e=s.getCatesian3FromPX(e.position,s._viewer,[s.circle]);0==s.positions.length&&s.positions.push(e.clone()),s.positions.push(e);e=s.createPoint(e,!1);0<s.gonCircleArr.length&&(s.positions.pop(),s.state=1,s.handler.destroy()),e.wz=s.gonCircleArr.length,s.gonCircleArr.push(e)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){var t,i,o,r,n,a;s.positions.length<1||(e=s.getCatesian3FromPX(e.endPosition,s._viewer,[s.circle]),2==s.positions.length&&(s._cesium.defined(s.circle)||(t=s._cesium.Cartographic.fromCartesian(s.positions[0]),i=s._cesium.Math.toDegrees(t.longitude),o=s._cesium.Math.toDegrees(t.latitude),r=s._cesium.Cartographic.fromCartesian(s.positions[1]),n=s._cesium.Math.toDegrees(r.longitude),a=s._cesium.Math.toDegrees(r.latitude),s.radius=f(o,i,a,n),s.circle=s.createCircle(s.style),s._core.Entityadd(s),s.circle.objId=s.objId)),s.circle&&(s.positions.pop(),s.positions.push(e),t=s._cesium.Cartographic.fromCartesian(s.positions[0]),i=s._cesium.Math.toDegrees(t.longitude),o=s._cesium.Math.toDegrees(t.latitude),r=s._cesium.Cartographic.fromCartesian(s.positions[1]),n=s._cesium.Math.toDegrees(r.longitude),a=s._cesium.Math.toDegrees(r.latitude),s.radius=f(o,i,a,n)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)},Bi.prototype.startModify=function(){var n="拖动修改位置";if(2==this.state||1==this.state){this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var a=this,e=0;e<a.gonCircleArr.length;e++){var t=a.gonCircleArr[e];t&&(t.show=!0)}this.modifyHandler.setInputAction(function(e){e=a._viewer.scene.pick(e.position);if(Cesium.defined(e)&&e.id)e.id.objId||(a.modifyPoint=e.id,n="释放后完成修改"),a.forbidDrawWorld(!0);else{for(var t=0;t<a.gonCircleArr.length;t++){var i=a.gonCircleArr[t];i&&(i.show=!1)}a.modifyHandler&&(a.modifyHandler.destroy(),a.modifyHandler=null)}a.state=2},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t,i,o,r=a._viewer.scene.pick(e.endPosition);a._core.CreateTooltip(n,e.endPosition,!1),Cesium.defined(r)&&r.id&&(r.id.objId||a._core.CreateTooltip(n,e.endPosition,!0)),a.positions.length<1||!a.modifyPoint||((o=a.getCatesian3FromPX(e.endPosition,a._viewer,[a.circle,a.modifyPoint]))&&(a.modifyPoint.position.setValue(o),a.positions[a.modifyPoint.wz]=o,0==a.modifyPoint.wz?a.gonCircleArr[1].position={x:a.positions[0].x+a.radius,y:a.positions[0].y,z:a.positions[0].z}:(i=a._cesium.Cartographic.fromCartesian(a.positions[0]),t=a._cesium.Math.toDegrees(i.longitude),r=a._cesium.Math.toDegrees(i.latitude),o=a._cesium.Cartographic.fromCartesian(a.positions[a.modifyPoint.wz]),i=a._cesium.Math.toDegrees(o.longitude),o=a._cesium.Math.toDegrees(o.latitude),a.radius=f(r,t,o,i))),a._core.CreateTooltip(n,e.endPosition,!0))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){var t,i,o;a.modifyPoint&&(o=a.getCatesian3FromPX(e.position,a._viewer,[a.circle,a.modifyPoint]),a.modifyPoint.position.setValue(o),a.positions[a.modifyPoint.wz]=o,0==a.modifyPoint.wz?a.gonCircleArr[1].position={x:a.positions[0].x+a.radius,y:a.positions[0].y,z:a.positions[0].z}:(i=a._cesium.Cartographic.fromCartesian(a.positions[0]),t=a._cesium.Math.toDegrees(i.longitude),e=a._cesium.Math.toDegrees(i.latitude),o=a._cesium.Cartographic.fromCartesian(a.positions[a.modifyPoint.wz]),i=a._cesium.Math.toDegrees(o.longitude),o=a._cesium.Math.toDegrees(o.latitude),a.radius=f(e,t,o,i)),a.modifyPoint=null,a.forbidDrawWorld(!1),n="拖动修改位置")},Cesium.ScreenSpaceEventType.LEFT_UP)}},Bi.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},Bi.prototype.getCatesian3FromPX=function(e,t,i){var o,r=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=r;if(t.scene.pickPositionSupported&&Cesium.defined(a))o=t.scene.pickPosition(e);else{e=t.camera.getPickRay(e);if(!e)return;o=t.scene.globe.pick(e,t.scene)}return o},Bi.prototype.createCircle=function(e){var t=this;return this._viewer.entities.add({position:new t._cesium.CallbackProperty(function(){return t.positions[0]},!1),ellipse:{semiMinorAxis:new t._cesium.CallbackProperty(function(){return t.radius},!1),semiMajorAxis:new t._cesium.CallbackProperty(function(){return t.radius},!1),material:t._cesium.Color.BLUE.withAlpha(.5),outline:e.outline||!0}})},Bi.prototype.createPoint=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},Bi.prototype.executeClircle=function(e){var o=[],r=this;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw);var n=new this._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas);function a(){return f(o[0].lat,o[0].lon,o[1].lat,o[1].lon)}return n.setInputAction(function(e){var t,i=r._getPosition.getMousePosition(e,[r.item]);i&&(e=r._cesium.Cartographic.fromCartesian(i),i=r._cesium.Math.toDegrees(e.longitude),e=r._cesium.Math.toDegrees(e.latitude),o.push({lon:i,lat:e}),1==o.length?(o.push({lon:i,lat:e}),(t=r._viewer.entities.add({position:r._cesium.Cartesian3.fromDegrees(o[0].lon,o[0].lat),ellipse:{semiMinorAxis:0,semiMajorAxis:0,material:r._cesium.Color.fromRandom({alpha:.8})}})).ellipse.semiMinorAxis=new r._cesium.CallbackProperty(a,!1),t.ellipse.semiMajorAxis=new r._cesium.CallbackProperty(a,!1),r.item=t):(t=a(),r._core.mouse(r._viewer.container,0,"0"),r.item.ellipse.semiMinorAxis=t,r.item.ellipse.semiMajorAxis=t,n.destroy(),n=void 0,o=[]))},r._cesium.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(function(e){var t;!o.length||(t=r._getPosition.getMousePosition(e,[r.item]))&&(e=r._cesium.Cartographic.fromCartesian(t),t=r._cesium.Math.toDegrees(e.longitude),e=r._cesium.Math.toDegrees(e.latitude),o[1]={lon:t,lat:e})},r._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},Bi.prototype.executeClirclews=function(e){var r=this;this._cesium.Material.fromType(this._cesium.Material.ColorType).uniforms.color=new this._cesium.Color(1,1,0,.5);var t=this._cesium.Ellipsoid.WGS84,i=this,o=this._viewer.scene,n=this._viewer.scene.primitives,a=null,s=new this._cesium.ScreenSpaceEventHandler(o.canvas);s.setInputAction(function(e){null==e.position||(e=o.camera.pickEllipsoid(e.position,t))&&(null==a?(a=new l({center:e,radius:0,asynchronous:!1,material:r._cesium.Color.RED}),n.add(a)):i.stopDrawing())},r._cesium.ScreenSpaceEventType.LEFT_DOWN),s.setInputAction(function(e){e=e.endPosition;null!=e&&(null==a||(e=o.camera.pickEllipsoid(e,t))&&a.setRadius(r._cesium.Cartesian3.distance(a.getCenter(),e)))},r._cesium.ScreenSpaceEventType.MOUSE_MOVE);var l=function(){function e(e){if(!r._cesium.defined(e.center)||!r._cesium.defined(e.radius))throw new r._cesium.DeveloperError("Center and radius are required");e=copyOptions(e,defaultSurfaceOptions),this.initialiseOptions(e),this.setRadius(e.radius)}return(e.prototype=new u).setCenter=function(e){this.setAttribute("center",e)},e.prototype.setRadius=function(e){this.setAttribute("radius",Math.max(.1,e))},e.prototype.getCenter=function(){return this.getAttribute("center")},e.prototype.getRadius=function(){return this.getAttribute("radius")},e.prototype.getGeometry=function(){if(r._cesium.defined(this.center)&&r._cesium.defined(this.radius))return new r._cesium.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:r._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},e.prototype.getOutlineGeometry=function(){return new r._cesium.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},e},u=(c.prototype.initialiseOptions=function(e){fillOptions(this,e),this._ellipsoid=void 0,this._granularity=void 0,this._height=void 0,this._textureRotationAngle=void 0,this._id=void 0,this._createPrimitive=!0,this._primitive=void 0,this._outlinePolygon=void 0},c.prototype.setAttribute=function(e,t){this[e]=t,this._createPrimitive=!0},c.prototype.getAttribute=function(e){return this[e]},c.prototype.update=function(e,t,i){if(!r._cesium.defined(this.ellipsoid))throw new r._cesium.DeveloperError("this.ellipsoid must be defined.");if(!r._cesium.defined(this.appearance))throw new r._cesium.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new r._cesium.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&(this._createPrimitive||r._cesium.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var o=this.getGeometry();if(!o)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new r._cesium.Primitive({geometryInstances:new r._cesium.GeometryInstance({geometry:o,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new r._cesium.Primitive({geometryInstances:new r._cesium.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:r._cesium.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new r._cesium.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:Math.min(this.strokeWidth)}})}))}o=this._primitive;o.appearance.material=this.material,o.debugShowBoundingVolume=this.debugShowBoundingVolume,o.update(e,t,i),this._outlinePolygon&&this._outlinePolygon.update(e,t,i)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),r._cesium.destroyObject(this)},c.prototype.setStrokeStyle=function(e,t){this.strokeColor&&this.strokeColor.equals(e)&&this.strokeWidth==t||(this._createPrimitive=!0,this.strokeColor=e,this.strokeWidth=t)},c);function c(){}},Bi.prototype.setSemiMajorAxis=function(e){try{this.item._ellipse.semiMajorAxis=e}catch(e){console.log(e)}return this},Bi.prototype.setSemiMinorAxis=function(e){try{this.item._ellipse.semiMinorAxis=e}catch(e){console.log(e)}return this},Bi.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=null==this.item.ellipse.semiMajorAxis?void 0:this.item.ellipse.semiMajorAxis._value,i=null==this.item.ellipse.semiMinorAxis?void 0:this.item.ellipse.semiMinorAxis._value,o=null==this.item.ellipse.height?void 0:this.item.ellipse.height._value,r=null==this.item.ellipse.extrudedHeight?void 0:this.item.ellipse.extrudedHeight._value,n=null==this.item.ellipse.rotation?void 0:this.item.ellipse.rotation._value,a=null==this.item.ellipse.stRotation?void 0:this.item.ellipse.stRotation._value,s=null==this.item.ellipse.fill?void 0:this.item.ellipse.fill._value,l=this.item.ellipse.material;null!=l&&(l={color:null==l.color?void 0:"rgba("+l.color._value.red+","+l.color._value.green+","+l.color._value.blue+","+l.color._value.alpha+")",image:null==l.image?void 0:l.image._value,diffusemap:null==l.diffusemap?void 0:l.diffusemap._value,alphamap:null==l.alphamap?void 0:l.alphamap._value});var u=null==this.item.ellipse.outline?void 0:this.item.ellipse.outline._value,c=null==this.item.ellipse.outlineColor?void 0:"rgba("+this.item.ellipse.outlineColor._value.red+","+this.item.ellipse.outlineColor._value.green+","+this.item.ellipse.outlineColor._value.blue+","+this.item.ellipse.outlineColor._value.alpha+")",h=null==this.item.ellipse.outlineWidth?void 0:this.item.ellipse.outlineWidth._value,m=null==this.item.ellipse.numberOfVerticalLines?void 0:this.item.ellipse.numberOfVerticalLines._value,d=this.item.ellipse.distanceDisplayCondition,p=null==d?void 0:d._value.near,g=null==d?void 0:d._value.far,d=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"circle",position:{x:this._cesium.Math.toDegrees(d.longitude),y:this._cesium.Math.toDegrees(d.latitude),z:o=this._cesium.Math.toDegrees(d.height)},treeobj:{name:this.treeobj.name},style:{show:e,semiMajorAxis:t,semiMinorAxis:i,height:o,extrudedHeight:r,rotation:n,stRotation:a,fill:s,material:l,outline:u,outlineColor:c,outlineWidth:h,numberOfVerticalLines:m,near:p,far:g}}},Bi.prototype.setTreeobj=function(e){this.treeobj=e},Bi.prototype.setHeight=function(e){try{this.item._ellipse.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND,this.item._ellipse.height=e}catch(e){console.log(e)}return this},Bi.prototype.setHeightType=function(e){try{1==e?this.item._ellipse.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._ellipse.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._ellipse.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},Bi.prototype.setDistanceDisplayCondition=function(e,t){t=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._ellipse.distanceDisplayCondition=t}catch(e){console.log(e)}return this},Bi.prototype.setEllipseImage=function(e){try{this.item._ellipse.material.uniforms.image=e}catch(e){console.log(e)}return this},Bi.prototype.setOutlineColor=function(e){try{this.item._ellipse.outlineWidth=5,this.item._ellipse.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Bi.prototype.setMaterial=function(e){try{this.item._ellipse.material.color=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Bi.prototype.setMaterialAlpha=function(e){try{this.item._ellipse.material.color._value.alpha=e,this.item._ellipse.show=!0}catch(e){console.log(e)}return this},Bi.prototype.setItem=function(e){this.item=e},Bi.prototype.setExtrudedHeight=function(e){try{this.item._ellipse.extrudedHeight=e}catch(e){console.log(e)}return this},Bi.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Bi.prototype.CreateCircle=function(e,t,i,o,r,n){this._postion=e;var a,t={semiMinorAxis:this._cesium.defaultValue(t,3e5),semiMajorAxis:this._cesium.defaultValue(t,3e5),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.WHITE};i&&""!==i&&(t.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(i)),o&&""!==o&&(t.material=new G(this._viewer,this._cesium).colorFromHtmlColor(o)),(e.Yaw||e.Pitch||e.Roll)&&(a=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:n,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),ellipse:t,orientation:a});n={id:this.item.id,name:n,pId:this._core.isnull(r)?0:r,type:"circle",item:this};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(r)?0:r),this},Bi.prototype.CreateEllipse=function(e,t,i,o,r,n,a,s){this._postion=e;var l,n={semiMinorAxis:this._cesium.defaultValue(t,3e5),semiMajorAxis:this._cesium.defaultValue(i,1e5),numberOfVerticalLines:this._cesium.defaultValue(n,16),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.WHITE};o&&""!==o&&(n.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(o)),r&&""!==r&&(n.material=new G(this._viewer,this._cesium).colorFromHtmlColor(r)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),ellipse:n,orientation:l});s={id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"ellipse",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(a)?0:a),this},Object.defineProperties(Bi.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),ji.prototype.createPoint=function(e,t,i,o,r,n){var a={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.RED,clampToGround:!0},a=this._core.extend(a,o=o||{},!0);i&&(this._core.isHtmlColor(i)?i=this._color.colorFromHtmlColor(i):(1<(i=/^rgb/.test(i)?this._Color.rgbaStringToRgbaObj(i):i).r&&(i.r=i.r/255),1<i.g&&(i.g=i.g/255),1<i.b&&(i.b=i.b/255),1<i.a&&(i.a=i.a/255),i.r&&(i=this._color.createColor(i.r,i.g,i.b,i.a))),a.color=i),this._position=t,this.item=this._viewer.entities.add({name:e,position:this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]||0),point:a});e={id:this.item.id,name:e,pId:this._core.isnull(r)?0:r,type:"Point",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(r)?0:r),this},ji.prototype.getstyles=function(){var e={};return e.show=!this.item.point.show||this.item.point.show._value,e.pixelSize=this.item.point.pixelSize?this.item.point.pixelSize.toString():null,e.heightReference=this.item.point.heightReference&&this.item.point.heightReference._value?this.item.point.heightReference.toString():null,e.color=this.item.point.color&&this.item.point.color._value?"rgba"+this.item.point.color.toString():null,e.outlineColor=this.item.point.outlineColor&&this.item.point.outlineColor._value?"rgba"+this.item.point.outlineColor.toString():null,e.outlineWidth=this.item.point.outlineWidth&&this.item.point.outlineWidth._value?this.item.point.outlineWidth.toString():null,e.near=this.item.point.distanceDisplayCondition?this.item.point.distanceDisplayCondition._value.near:null,e.far=this.item.point.distanceDisplayCondition?this.item.point.distanceDisplayCondition._value.far:null,e.position=this.item.position.getValue().toString(),e},ji.prototype.createLonlat=function(o){var r=this,t=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);t.setInputAction(function(e){var t=r._viewer.camera.pickEllipsoid(e.position,r._viewer.scene.globe.ellipsoid),i=r._cesium.Cartographic.fromCartesian(t,r._viewer.scene.globe.ellipsoid,new r._cesium.Cartographic),e=r._cesium.Math.toDegrees(i.latitude),t=r._cesium.Math.toDegrees(i.longitude),i=i.height;"function"==typeof o&&o({lng:t,lat:e,height:i})},this._cesium.ScreenSpaceEventType.LEFT_CLICK),t.setInputAction(function(e){t.destroy()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK)},ji.prototype.createRichTextPoint=function(t,i,o={}){var r=this,n=this._core.getuid(),e=o.GroupID;void 0!==i.length?2===i.length?l=this._cesium.Cartesian3.fromDegrees(i[0],i[1]):3===i.length&&(l=this._cesium.Cartesian3.fromDegrees(i[0],i[1],i[2])):l=i.z?this._cesium.Cartesian3.fromDegrees(i.x,i.y,i.z):this._cesium.Cartesian3.fromDegrees(i.x,i.y),this._position=l;var m,d,p,g,_,a={horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM,show:!0,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(r._core.defaultValue(o.near,0),r._core.defaultValue(o.far,Number.MAX_VALUE))},s=this._core.extend(a,o,!0),l="",a=15;o&&o.fontColor&&(l=o.fontColor),o&&o.fontSize&&(a=o.fontSize),m=t,d=a,p=l,g=function(e){s.image=e,r.item=r._viewer.entities.add({id:n,name:t,position:r._position,billboard:s}),r.item.degrees=i,r.item.type="RichPoint",r.item.data=o.data},(_=document.createElement("img")).src=r._core.defaultValue(s.url,window.SmartEarthRootUrl+D.richtextpoint),d=parseFloat(d),_.crossOrigin="Anonymous",_.onload=function(){var e,t,i,o,r,n,a,s,l=document.createElement("canvas"),u=l.getContext("2d"),c=_.width,h=_.height;l.width=c,l.height=h,u.drawImage(_,0,0,c,h),u.shadowOffsetX=1,u.shadowOffsetY=0,u.shadowColor="#fff",u.shadowBlur=1,/^\</.test(m)&&/\>$/.test(m)?(a='<svg xmlns="http://www.w3.org/2000/svg" width="'+c+'" height="60"><foreignObject width="100%" height="100%">'+m+"</foreignObject></svg>",e=window.URL||window.webkitURL||window,t=document.createElement("img"),s=new Blob([a],{type:"image/svg+xml;charset=utf-8"}),i=e.createObjectURL(s),t.crossOrigin="Anonymous",t.src=i,t.onload=function(){u.drawImage(t,0,0,t.width,t.height),e.revokeObjectURL(i)}):(u.fillStyle=p||"#fff",u.font=d+"px Calibri,sans-serif",m.length*d>c?(o=m.substring(0,Math.ceil(m.length/2)),r=m.substring(Math.floor(m.length/2),m.length),a=(n=(h-100-2*d)/2)+d,s=(c-o.length*d)/2,u.fillText(o,s,n),u.fillText(r,s,a)):(h=(h-100-d)/2,c=(c-m.length*d)/2,u.fillText(m,c,h))),g(l)};l={id:n,name:"新建富文本点"+n,pId:r._core.isnull(e)?0:e,type:"Imagelabel",item:r};return r.setTreeobj(l),r._tree.insertGroupId(l,r._core.isnull(e)?0:e),this},ji.prototype.createPoints=function(e,t){var i={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.RED,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND},e=this._core.extend(i,e,!0);this._core.isnull(text)||(e.text=text),this._position=position,this.item=this._viewer.entities.add({name:name,position:this._cesium.Cartesian3.fromDegrees(position[0],position[1]),point:e});e={id:this.item.id,name:e.text,pId:this._core.isnull(t)?0:t,type:"Point",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(t)?0:t),this},ji.prototype.createLocations=function(e,t,i){var o={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.TRANSPARENT,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND};this._position=t,this._core.isnull(e)&&(e="新建兴趣点"),this.item=this._viewer.entities.add({name:e,position:this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]),point:o});e={id:o.id,name:e,pId:this._core.isnull(i)?0:i,type:"Location",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(i)?0:i),this},ji.prototype.createLocation=function(t,e,i){var o={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.TRANSPARENT,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND},r={destination:e.position,orientation:{heading:e.orientation.heading,pitch:e.orientation.pitch,roll:e.orientation.roll}};this._position=e,this._core.isnull(t)&&(t="新建兴趣点");var n=this._core.getuid();this.item=this._viewer.entities.add({name:t,position:e.position,point:o}),this.item.originalCameraLocation=r;var a=this;return setTimeout(function(){var e={id:n,name:t+n,pId:a._core.isnull(i)?0:i,type:"Location",item:a};a.setTreeobj(e),a._tree.insertGroupId(e,a._core.isnull(i)?0:i)}),this},ji.prototype.createPointOptimization=function(e,t){var i=this,o=[],r=this._core.StyleContrastGeoJson(e,this._cesium);return this.handler.setInputAction(function(e){var t,e=i._viewer.scene.camera.getPickRay(e.position);(t=e?i._viewer.scene.globe.pick(e,i._viewer.scene):t)&&(e=i._cesium.Ellipsoid.WGS84.cartesianToCartographic(t),t=i._viewer.scene.globe.getHeight(e),i._point=i._cesium.Cartesian3.fromDegrees(e.longitude/Math.PI*180,e.latitude/Math.PI*180,t),r.position=new i._cesium.CallbackProperty(function(){return i._point},!1),i.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),(t=i._viewer.entities.add(r)).objId=i.objId,(t.obj=i)._core.Entityadd(i),o.push({point:t}),i.state=1,i.handler.destroy(),"function"==typeof method&&method(o),i.item=t)},i._cesium.ScreenSpaceEventType.LEFT_CLICK),this},ji.prototype.startModify=function(){var o,r="拖动修改位置";2!=this.state&&1!=this.state||(this._tree.starttemporaryItem(this._viewer),this.modifyHandler||(this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),(o=this).modifyHandler.setInputAction(function(e){e=o._viewer.scene.pick(e.position);o._cesium.defined(e)&&e.id&&o._cesium.defined(e)&&e.id&&e.id.objId&&e.id.objId==o.objId&&(o.modifyPoint=e.id,r="释放后完成修改",o.forbidDrawWorld(!0)),o.state=2},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t,i=o._viewer.scene.pick(e.endPosition);o._core.CreateTooltip(r,e.endPosition,!1),o.modifyPoint?o.modifyPoint&&((t=o.getCatesian3FromPX(e.endPosition,o._viewer,[o.modifyPoint]))&&(o._point=t,o.modifyPoint.position=t),o._core.CreateTooltip(r,e.endPosition,!0)):o._cesium.defined(i)&&i.id&&i.id.objId&&o._core.CreateTooltip("拖动修改位置",e.endPosition,!0)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){e=o.getCatesian3FromPX(e.position,o._viewer,[o.modifyPoint]);o.modifyPoint&&(e&&(o._point=e),o.modifyPoint.position=e,o.modifyPoint=null,o.forbidDrawWorld(!1),r="拖动修改位置")},this._cesium.ScreenSpaceEventType.LEFT_UP))},ji.prototype.getCatesian3FromPX=function(e,t,i){var o,r=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(0<i.length){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=r;if(t.scene.pickPositionSupported&&this._cesium.defined(a))o=t.scene.pickPosition(e);else{e=t.camera.getPickRay(e);if(!e)return;o=t.scene.globe.pick(e,t.scene)}return o},ji.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},ji.prototype.executePoint=function(i,e){this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw);var o=this;this._tree.starttemporaryItem(this._viewer);var r={point:o._cesium.Color.RED};0<Object.keys(e).length&&""!=e.point&&null!=e.point&&(r.point=e.point),this._tree.removeHandler();let n=this._core.CreateTooltip();return this._tree.handler=new o._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas),this._tree.handler.setInputAction(function(e){var t,e=o._viewer.scene.camera.getPickRay(e.position);(t=e?o._viewer.scene.globe.pick(e,o._viewer.scene):t)&&(e=o._cesium.Ellipsoid.WGS84.cartesianToCartographic(t),t=o._viewer.scene.globe.getHeight(e),e=o._cesium.Cartesian3.fromDegrees(e.longitude/Math.PI*180,e.latitude/Math.PI*180,t),t=1e3<=t?(t/1e3).toFixed(2)+"千米":t.toFixed(2)+"米",e=o._viewer.entities.add({name:"高度",position:e,point:{color:r.point,pixelSize:5,outlineColor:o._cesium.Color.WHITE,outlineWidth:2,heightReference:o._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:"海拔高度:"+t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),o._tree.temporaryItem.obj.push(e),t={point:e,height:t},o._tree.endtemporaryItem(),o._core.mouse(o._viewer.container,0,"0"),o._tree.handler.destroy(),n.show(!1),"function"==typeof i&&i(t),o.item=e)},o._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){n.showAt(e.endPosition,"点击拾取高度!")},o._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},ji.prototype.executePointp=function(t,e){this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw);var i=this;this._tree.starttemporaryItem(this._viewer);var o={point:i._cesium.Color.RED};return 0<Object.keys(e).length&&""!=e.point&&null!=e.point&&(o.point=e.point),this._tree.removeHandler(),this._tree.handler=new i._cesium.ScreenSpaceEventHandler(i._viewer.scene.canvas),this._tree.handler.setInputAction(function(e){e=i._getPosition.getMousePosition(e);e&&(e=i._viewer.entities.add({name:"高度",position:e,point:{color:o.point,pixelSize:5,outlineColor:i._cesium.Color.WHITE,outlineWidth:2,heightReference:i._cesium.HeightReference.none}}),i._tree.temporaryItem.obj.push(e),i._tree.endtemporaryItem(),i._core.mouse(i._viewer.container,0,"0"),i._tree.handler.destroy(),"function"==typeof t&&t(e),i.item=e)},i._cesium.ScreenSpaceEventType.LEFT_CLICK),this},ji.prototype.deleteObject=function(){try{if(this._viewer.entities.remove(this.item),0<this._points.length)for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e])}catch(e){}},ji.prototype.setVisibility=function(e){if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._points[t].show=e;this.item.show=e},ji.prototype.getVisibility=function(){return this.item.show},ji.prototype.setPointAlpha=function(e){try{this.item._point.material._value.alpha=e}catch(e){console.log(e)}return this},ji.prototype.export=function(){var e=null==this.item.point.show?void 0:this.item.point.show._value,t=null==this.item.point.pixelSize?void 0:this.item.point.pixelSize._value,i=null==this.item.point.color?void 0:"rgba("+this.item.point.color._value.red+","+this.item.point.color._value.green+","+this.item.point.color._value.blue+","+this.item.point.color._value.alpha+")",o=null==this.item.point.outlineColor?void 0:"rgba("+this.item.point.outlineColor._value.red+","+this.item.point.outlineColor._value.green+","+this.item.point.outlineColor._value.blue+","+this.item.point.outlineColor._value.alpha+")",r=null==this.item.point.outlineWidth?void 0:this.item.point.outlineWidth._value,n=this.item.point.distanceDisplayCondition,a=null==n?void 0:n._value.near,s=null==n?void 0:n._value.far,n=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"point",position:{x:this._cesium.Math.toDegrees(n.longitude),y:this._cesium.Math.toDegrees(n.latitude),z:this._cesium.Math.toDegrees(n.height)},treeobj:{name:this.treeobj.name},style:{show:e,pixelSize:t,color:i,outlineColor:o,outlineWidth:r,near:a,far:s}}},ji.prototype.setTreeobj=function(e){this.treeobj=e},ji.prototype.setPointColor=function(e){try{this.item._point.color=new G(this._viewer,this._cesium).colorFromHtmlColor(e),this.item.fillColor=this.item._point.color}catch(e){console.log(e)}return this},ji.prototype.setRadius=function(e){try{this.item.ellipse=new this._cesium.EllipseGraphics({semiMinorAxis:e,semiMajorAxis:e,material:this._cesium.Color.RED.withAlpha(.4)})}catch(e){console.log(e)}return this},ji.prototype.setOutlineColor=function(e){try{this.item._point.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Object.defineProperties(ji.prototype,{HighLight:{set:function(e){e&&(this.item.fillColor=this.item.point._color),e?this.item._point.color=new G(this._viewer,this._cesium).colorFromHtmlColor(this._core.selectedColor):this.item.point._color=this.item.fillColor}}}),Object.defineProperties(ji.prototype,{pointColor:{get:function(){if(this.item.point._color._value)return this._color.toHtmlColor("rgb("+255*this.item.point._color._value.red+","+255*this.item.point._color._value.green+","+255*this.item.point._color._value.blue+","+255*this.item.point._color._value.alpha+")")},set:function(e){try{/^rgb/.test(e)?(1<(e=this._color.rgbaStringToRgbaObj(e)).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),e=this._color.createColor(e.r,e.g,e.b,e.a),this.item._point.color=e):this.item._point.color=new G(this._viewer,this._cesium).colorFromHtmlColor(e),this.item.fillColor=this.item._point.color}catch(e){}}},pointOutlineColor:{get:function(){if(null!=this.item._point._outlineColor)return this._color.toHtmlColor("rgb("+255*this.item._point.outlineColor._value.red+","+255*this.item._point.outlineColor._value.green+","+255*this.item._point.outlineColor._value.blue+","+255*this.item._point.outlineColor._value.alpha+")")},set:function(e){try{/^rgb/.test(e)?(1<(e=this._color.rgbaStringToRgbaObj(e)).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),e=this._color.createColor(e.r,e.g,e.b,e.a),this.item._point.outlineColor=e):this.item._point.outlineColor=this._color.colorFromHtmlColor(e)}catch(e){console.log(e)}}},pointOutlineWidth:{get:function(){if(null!=this.item.point.outlineWidth)return this.item.point.outlineWidth._value},set:function(e){this.item.point.outlineWidth=e}},pointAlpha:{get:function(){if(null!=this.item._point._color)return this.item._point._color._value.alpha},set:function(e){this.item._point._color._value.alpha=e}},pointOutlineAlpha:{get:function(){if(null!=this.item._point.outlineColor)return this.item._point.outlineColor._value.alpha},set:function(e){try{this.item._point.outlineColor._value.alpha=e}catch(e){}}},pointHeight:{set:function(e){e=parseFloat(e);var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),t=this._cesium.Math.toDegrees(t.latitude),e=this._cesium.Cartesian3.fromDegrees(i,t,e);this.item.position._value=e},get:function(){var e=this._cesium.Cartographic.fromCartesian(this.item.position._value);return this._cesium.Math.toDegrees(e.height)}},pointX:{set:function(e){var t=this._cesium.Cartographic.fromCartesian(this.item.position._value);this._cesium.Math.toDegrees(t.longitude);var i=this._cesium.Math.toDegrees(t.latitude),t=this._cesium.Math.toDegrees(t.height),t=this._cesium.Cartesian3.fromDegrees(e,i,t);this.item.position.position=t},get:function(){var e=this._cesium.Cartographic.fromCartesian(this.item.position._value);return this._cesium.Math.toDegrees(e.longitude)}},pointY:{set:function(e){var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude);this._cesium.Math.toDegrees(t.latitude);t=this._cesium.Math.toDegrees(t.height),t=this._cesium.Cartesian3.fromDegrees(i,e,t);this.item.position.position=t},get:function(){var e=this._cesium.Cartographic.fromCartesian(this.item.position._value);return this._cesium.Math.toDegrees(e.latitude)}}}),Object.defineProperties(ji.prototype,{pixelSize:{get:function(){return this.item.point.pixelSize._value},set:function(e){this.item.point.pixelSize=e}}}),Object.defineProperties(ji.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),ji.prototype.setItem=function(e){this.item=e},Object.defineProperties(ji.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(ji.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(ji.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(ji.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(ji.prototype,{position:{get:function(){return this._position||this.item.position}}}),Object.defineProperties(ji.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(ji.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(ji.prototype,{pointTempOptions:{get:function(){return{color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:G.BLACK,outlineWidth:0,show:!0,scaleByDistance:null,translucencyByDistance:null,heightReference:null,distanceDisplayCondition:null,disableDepthTestDistance:null}}}}),zi.prototype.createLabel=function(e,t,i,o,r){var n={id:this._core.getuid(),text:"default text",backgroundColor:new G(this._viewer,this._cesium).createColor(.165,.165,.165,1),fillColor:new G(this._viewer,this._cesium).createColor(.9411764705882353,.9725490196078431,1,1),font:"30px sans-serif",horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,show:!0,scale:1,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(0,Number.MAX_VALUE)},i=this._core.extend(n,i,!0);this._core.isnull(t)||(i.text=t),i.fillColor&&(this._core.isnull(i)||this._core.isnull(i.fillColor)||"["==i.fillColor.toString().charAt(0)&&"]"==i.fillColor.toString().charAt(i.fillColor.length-1)||(this._core.isHtmlColor(i.fillColor)&&/^#/.test(i.fillColor.toString())?i.fillColor=this._Color.colorFromHtmlColor(i.fillColor):(/^rgb/.test(i.fillColor)&&(i.fillColor=this._Color.rgbaStringToRgbaObj(i.fillColor)),1<i.fillColor.r&&(i.fillColor.r=i.fillColor.r/255),1<i.fillColor.g&&(i.fillColor.g=i.fillColor.g/255),1<i.fillColor.b&&(i.fillColor.b=i.fillColor.b/255),1<i.fillColor.a&&(i.fillColor.a=i.fillColor.a/255),i.fillColor.r&&(i.fillColor=this._Color.createColor(i.fillColor.r,i.fillColor.g,i.fillColor.b,i.fillColor.a))))),i.backgroundColor&&(this._core.isnull(i)||this._core.isnull(i.backgroundColor)||"["==i.backgroundColor.toString().charAt(0)&&"]"==i.backgroundColor.toString().charAt(i.backgroundColor.length-1)||(this._core.isHtmlColor(i.backgroundColor)&&/^#/.test(i.backgroundColor.toString())?i.backgroundColor=this._Color.colorFromHtmlColor(i.backgroundColor):(/^rgb/.test(i.backgroundColor)&&(i.backgroundColor=this._Color.rgbaStringToRgbaObj(i.backgroundColor)),1<i.backgroundColor.r&&(i.backgroundColor.r=i.backgroundColor.r/255),1<i.backgroundColor.g&&(i.backgroundColor.g=i.backgroundColor.g/255),1<i.backgroundColor.b&&(i.backgroundColor.b=i.backgroundColor.b/255),1<i.backgroundColor.a&&(i.backgroundColor.a=i.backgroundColor.a/255),i.backgroundColor.r&&(i.backgroundColor=this._Color.createColor(i.backgroundColor.r,i.backgroundColor.g,i.backgroundColor.b,i.backgroundColor.a))))),i.outlineColor&&(this._core.isnull(i)||this._core.isnull(i.outlineColor)||"["==i.outlineColor.toString().charAt(0)&&"]"==i.outlineColor.toString().charAt(i.outlineColor.length-1)||(this._core.isHtmlColor(i.outlineColor)&&/^#/.test(i.outlineColor.toString())?i.outlineColor=this._Color.colorFromHtmlColor(i.outlineColor):(/^rgb/.test(i.outlineColor)&&(i.outlineColor=this._Color.rgbaStringToRgbaObj(i.outlineColor)),1<i.outlineColor.r&&(i.outlineColor.r=i.outlineColor.r/255),1<i.outlineColor.g&&(i.outlineColor.g=i.outlineColor.g/255),1<i.outlineColor.b&&(i.outlineColor.b=i.outlineColor.b/255),1<i.outlineColor.a&&(i.outlineColor.a=i.outlineColor.a/255),i.outlineColor.r&&(i.outlineColor=this._Color.createColor(i.outlineColor.r,i.outlineColor.g,i.outlineColor.b,i.outlineColor.a))))),i.near&&i.far&&(i.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i.near,i.far)),this.item=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),label:i});i={id:this.item.id,name:i.text,pId:this._core.isnull(o)?0:o,type:"label",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),this},zi.prototype.getstyles=function(){var e={};return e.backgroundColor="rgba"+this.item.label._backgroundColor.toString(),e.fillColor="rgba"+this.item.label._fillColor.toString(),e.text=this.item.label.text.toString(),e.show=!this.item.label.show||this.item.label.show._value,e.font=this.item.label.font?this.item.label.font.toString():null,e.style=!this.item.label.style||"null"==this.item.label.style.toString()?null:this.item.label.style.toString(),e.scale=this.item.label.scale?this.item.label.scale.toString():null,e.showBackground=this.item.label.showBackground?this.item.label.showBackground._value:null,e.horizontalOrigin=this.item.label.horizontalOrigin?this.item.label.horizontalOrigin.toString():null,e.verticalOrigin=this.item.label.verticalOrigin?this.item.label.verticalOrigin.toString():null,e.heightReference=this.item.label.heightReference?this.item.label.heightReference.toString():null,e.outlineColor=this.item.label.outlineColor?"rgba"+this.item.label.outlineColor.toString():null,e.outlineWidth=this.item.label.outlineWidth?this.item.label.outlineWidth._value:null,e.near=this.item.label.distanceDisplayCondition?this.item.label.distanceDisplayCondition._value.near:null,e.far=this.item.label.distanceDisplayCondition?this.item.label.distanceDisplayCondition._value.far:null,e.position=this.item.position.getValue().toString(),e},zi.prototype.executeLabel=function(e){var i=this,t=new i._cesium.ScreenSpaceEventHandler(i._viewer.scene.canvas);return t.setInputAction(function(e){var t=i._viewer.scene.camera.pickEllipsoid(e.position,i._viewer.scene.globe.ellipsoid),e=i._viewer.entities.add({position:t,label:{id:i._core.getuid(),text:"",font:"30px sans-serif",horizontalOrigin:i._cesium.HorizontalOrigin.CENTER,verticalOrigin:i._cesium.VerticalOrigin.CENTER,show:!0,showBackground:!0}});i.item=e;t=0;i._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(t=we.selectedItem.id);e={id:i._core.getuid(),name:"",pId:i._core.isnull(t)?0:t,type:"Point",item:i};i.setTreeobj(e),i._tree.insertGroupId(e,i._core.isnull(t)?0:t)},i._cesium.ScreenSpaceEventType.LEFT_CLICK),t.setInputAction(function(e){t.destroy()},i._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},zi.prototype.deleteObject=function(){try{if("DivPoint"===this.item.type){this.pointPrimitive.remove(this.item);var e=document.getElementById(this.item.id);return void(e&&e.remove())}this._viewer.entities.remove(this.item)}catch(e){}},zi.prototype.setVisibility=function(e){this.item.show=e},zi.prototype.setRichtext=function(e){var t=this._core.getuid();null!=this.item.position._value?this._position=this.item.position._value:this._position=this.item.position;var o,r,n,i=this.treeobj.pId;this.deleteObject(),this.pointPrimitive||(this.pointPrimitive=this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection),(n=this).pointPrimitive.update=function(){for(var e,t,i=0;i<n.pointPrimitive.length;i++){if(e=n.pointPrimitive.get(i),r=e.position,!(o=n._viewer.scene.cartesianToCanvasCoordinates(r)))return;r=document.getElementById(e.id),e.name||(e.name="泰瑞"),r=r||(t=e.description?'<div id="'+e.id+'" style="position: absolute; width: 200px; height: 157px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+D.divpoint+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)"></div>\n                   <div class="content" style="position: inherit;font-size: 14px;top: 50px;left: 50px;width: 140px;text-align: left;color: rgba(255,255,255,1);">'+e.description+"</div> \n           </div>":'<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+D.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+e.name+"</div>\n           </div>",$(".cesium-viewer").append(t),document.getElementById(e.id)),e.description?r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-157)+")":r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-134)+")"}}),this.item=this.pointPrimitive.add({id:"DivPoint"+t,position:this._position,color:this._cesium.Color.YELLOW}),this.item.type="DivPoint",this.item.name=name,this.item.description=e;e={id:this.item.id,name:name,pId:this._core.isnull(i)?0:i,type:"Point",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(i)?0:i),this.item},zi.prototype.getVisibility=function(){return this.item.show},zi.prototype.setRadius=function(e){try{this.item._label.outlineWidth=e,this.item._label.outlineColor=this._cesium.Color.RED.withAlpha(.4)}catch(e){console.log(e)}return this},zi.prototype.setText=function(e){try{this.item._label.text=e}catch(e){console.log(e)}return this},zi.prototype.setHeightType=function(e){try{1==e?this.item._label.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._label.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._label.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},zi.prototype.setUrl=function(e){try{this.item.billboard=new this._cesium.BillboardGraphics({id:this._core.getuid(),image:e,show:!0})}catch(e){console.log(e)}return this},zi.prototype.setFillColorRgba=function(e,t,i,o){try{this.item._label.fillColor=new G(this._viewer,this._cesium).createColor(e,t,i,o)}catch(e){console.log(e)}},zi.prototype.setFillColorHtml=function(e){try{this.item._label.fillColor=new G(this._viewer,this._cesium).colorFromHtmlColor(e),this.item.fillColor=this.item._label.fillColor}catch(e){console.log(e)}},zi.prototype.setFillColorAlpha=function(e){try{this.item._label.fillColor._value.alpha=e}catch(e){console.log(e)}},zi.prototype.setBackgroundColorRgba=function(e,t,i,o){try{this.item._label.backgroundColor=new G(this._viewer,this._cesium).createColor(e,t,i,o)}catch(e){console.log(e)}},zi.prototype.setBackgroundColorHtml=function(e){try{this.item._label.backgroundColor=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}},zi.prototype.setBackgroundColorAlpha=function(e){try{this.item._label.backgroundColor._value.alpha=e}catch(e){console.log(e)}},zi.prototype.setFontSize=function(e){try{this.item._label.font=parseFloat(e)+"px sans-serif"}catch(e){console.log(e)}},zi.prototype.setFillColorAlpha=function(e){try{this.item._label.fillColor._value.alpha=e}catch(e){console.log(e)}},zi.prototype.showBackground=function(e){try{this.item._label.showBackground=e}catch(e){console.log(e)}},zi.prototype.setOutlineWidth=function(e){try{this.item._label.outlineWidth=e}catch(e){console.log(e)}},zi.prototype.setOutlineColorRgba=function(e,t,i,o){try{this.item._label.outlineColor=new this._cesium.Color(e,t,i,o)}catch(e){console.log(e)}},zi.prototype.setOutlineColorHtml=function(e){try{this.item._label.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}},zi.prototype.setOutlineColorAlpha=function(e){try{this.item._label.outlineColor._value.alpha=e}catch(e){console.log(e)}},zi.prototype.setStyle_LabelStyle_FILL=function(e){try{this.item._label.style=this.LabelStyle_FILL}catch(e){console.log(e)}},zi.prototype.setStyle_LabelStyle_FILL_AND_OUTLINE=function(){try{this.item._label.style=this.LabelStyle_FILL_AND_OUTLINE}catch(e){console.log(e)}},zi.prototype.setDistanceDisplayCondition=function(e,t){t=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._label.distanceDisplayCondition=t}catch(e){console.log(e)}return this},zi.prototype.setStyle_LabelStyle_OUTLINE=function(){try{this.item._label.style=this.LabelStyle_OUTLINE}catch(e){console.log(e)}},zi.prototype.setItem=function(e){this.item=e},zi.prototype.CreateLabel=function(e,t,i,o,r,n){this._postion=e;var a={id:this._core.getuid(),text:t,backgroundColor:o.BackgroundColor,font:o.FontName,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM,show:!0,scale:o.Scale,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(o.MinViewingHeight,o.MaxViewingHeight)};o.Italic&&(a.font="italic "+a.font),o.Bold&&(a.font="Bold "+a.font),this._core.isnull(o)||this._core.isnull(o.IconColor)||"["==o.IconColor.toString().charAt(0)&&"]"==o.IconColor.toString().charAt(o.IconColor.length-1)||(this._core.isHtmlColor(o.IconColor)?a.fillColor=this._Color.colorFromHtmlColor(o.IconColor):(/^rgb/.test(o.IconColor)&&(a.fillColor=this._Color.rgbaStringToRgbaObj(o.IconColor)),1<a.fillColor.r&&(a.fillColor.r=a.fillColor.r/255),1<a.fillColor.g&&(a.fillColor.g=a.fillColor.g/255),1<a.fillColor.b&&(a.fillColor.b=a.fillColor.b/255),1<a.fillColor.a&&(a.fillColor.a=a.fillColor.a/255),a.fillColor=this._Color.createColor(a.fillColor.r,a.fillColor.g,a.fillColor.b,a.fillColor.a))),this._core.isnull(o)||this._core.isnull(o.LineColor)||"["==o.LineColor.toString().charAt(0)&&"]"==o.LineColor.toString().charAt(o.LineColor.length-1)||(this._core.isHtmlColor(o.LineColor)?a.outlineColor=this._Color.colorFromHtmlColor(o.LineColor):(/^rgb/.test(o.LineColor)&&(a.outlineColor=this._Color.rgbaStringToRgbaObj(o.LineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=this._Color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a)));a=this._core.extend(a,o,!0),e={position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),label:a};i&&""!==i&&(e.label.pixelOffset=this._cesium.defaultValue(o.pixelOffset,{x:30*(t.length/2+1),y:-30}),i={image:i,horizontalOrigin:this._cesium.defaultValue(o.ImageHorizontal,this._cesium.HorizontalOrigin.CENTER),verticalOrigin:this._cesium.defaultValue(o.ImageVertical,this._cesium.VerticalOrigin.BOTTOM),show:!0,scale:o.ImageScale||1,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(o.ImageMinViewingHeight||0,o.ImageMaxViewingHeight||99999999999999)},o.pixelOffset={x:0,y:0},i=this._core.extend(i,o,!1),e.billboard=i),this.item=this._viewer.entities.add(e);a={id:this.item.id,name:a.text,pId:this._core.isnull(r)?0:r,type:"label",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(r)?0:r),this},zi.prototype.export=function(){var e=null==this.item.label.show?void 0:this.item.label.show._value,t=null==this.item.label.text?void 0:this.item.label.text._value,i=null==this.item.label.font?void 0:this.item.label.font._value,o=null==this.item.label.style?void 0:this.item.label.style._value,r=null==this.item.label.scale?void 0:this.item.label.scale._value,n=null==this.item.label.showBackground?void 0:this.item.label.showBackground._value,a=null==this.item.label.backgroundColor?void 0:"rgba("+this.item.label.backgroundColor._value.red+","+this.item.label.backgroundColor._value.green+","+this.item.label.backgroundColor._value.blue+","+this.item.label.backgroundColor._value.alpha+")",s=null==this.item.label.horizontalOrigin?void 0:this.item.label.horizontalOrigin._value,l=null==this.item.label.verticalOrigin?void 0:this.item.label.verticalOrigin._value,u=null==this.item.label.heightReference?void 0:this.item.label.heightReference._value,c=null==this.item.label.fillColor?void 0:"rgba("+this.item.label.fillColor._value.red+","+this.item.label.fillColor._value.green+","+this.item.label.fillColor._value.blue+","+this.item.label.fillColor._value.alpha+")",h=null==this.item.label.outlineColor?void 0:"rgba("+this.item.label.outlineColor._value.red+","+this.item.label.outlineColor._value.green+","+this.item.label.outlineColor._value.blue+","+this.item.label.outlineColor._value.alpha+")",m=null==this.item.label.outlineWidth?void 0:this.item.label.outlineWidth._value,d=this.item.label.distanceDisplayCondition,p=null==d?void 0:d._value.near,g=null==d?void 0:d._value.far,d=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"label",position:{x:this._cesium.Math.toDegrees(d.longitude),y:this._cesium.Math.toDegrees(d.latitude),z:this._cesium.Math.toDegrees(d.height)},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,text:t,font:i,style:o,scale:r,showBackground:n,backgroundColor:a,horizontalOrigin:s,verticalOrigin:l,heightReference:u,fillColor:c,outlineColor:h,outlineWidth:m,near:p,far:g}}},zi.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(zi.prototype,{position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),o=this._cesium.Math.toDegrees(t.latitude),r=(this._cesium.Math.toDegrees(t.height),this._cesium.Cartesian3.fromDegrees(i,o,e));this.item.position.position=r,this._postion.Altitude=e}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e;var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=(this._cesium.Math.toDegrees(t.longitude),this._cesium.Math.toDegrees(t.latitude)),o=this._cesium.Math.toDegrees(t.height),r=this._cesium.Cartesian3.fromDegrees(e,i,o);this.item.position.position=r}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e;var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),o=(this._cesium.Math.toDegrees(t.latitude),this._cesium.Math.toDegrees(t.height)),r=this._cesium.Cartesian3.fromDegrees(i,e,o);this.item.position.position=r}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e}catch(e){console.log(e)}}}},LabelStyle:{BackgroundColor:{set:Ce.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.backgroundColor=e,this.item.backgroundColor=e)},500),get:function(){var e=this.item.label.backgroundColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Bold:{get:function(){return-1!=this.item._label.font.getValue().indexOf("bold")},set:function(){var e="bold "+this.item._label.font.getValue();this.item._label.font.setValue(e)}},FontName:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if("bold"!=e[t]&&-1==e[t].indexOf("px")&&-1==e[t].indexOf("PX"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,o=0;o<t.length;o++)"bold"!=t[o]&&-1==t[o].indexOf("px")&&-1==t[o].indexOf("PX")||(i=i+" "+t[o]);this.item._label.font.setValue(i)}},FontSize:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if(-1!=e[t].indexOf("px"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,o=0;o<t.length;o++)-1==t[o].indexOf("px")||(i=i+" "+t[o]);this.item._label.font.setValue(i)}},FrameFileName:{get:function(){return""},set:function(e){}},IconColor:{set:Ce.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.fillColor=e)},500),get:function(){var e=this.item.label.fillColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Italic:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if(-1!=e[t].indexOf("italic"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,o=0;o<t.length;o++)-1==t[o].indexOf("italic")||(i=i+" "+t[o]);this.item._label.font.setValue(i)}},LimitScreenSize:{get:function(){return""},set:function(e){}},LineColor:{set:Ce.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.outlineColor=e)},500),get:function(){var e=this.item.label.outlineColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},LineToGround:{get:function(){return""},set:function(e){}},LockMode:{get:function(){return""},set:function(e){}},MaxImageSize:{get:function(){return""},set:function(e){}},MaxViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.far},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.near),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(t,e)}},MinViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.near},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.far),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,t)}},MultilineJustification:{get:function(){return""},set:function(e){}},PivotAlignment:{get:function(){return""},set:function(e){}},Scale:{get:function(){if(null!=this.item._label.scale)return this.item.label.scale.getValue()},set:function(e){this.item.label.scale.setValue(e)}},TextAlignment:{get:function(){return""},set:function(e){}},TextColor:{get:function(){return""},set:function(e){}},TextOnImage:{get:function(){return""},set:function(e){}},Underline:{get:function(){return""},set:function(e){}}}}),Ui.prototype.executeFlycesium=function(t){var i=this,o=(e.prototype._init=function(){var e=this;this.options.polyline.positions=new i._cesium.CallbackProperty(function(){return e.positions},!1),this.flycesium=i._viewer.entities.add(this.options),i.item=this.flycesium},e);function e(e){this.options={polyline:{show:!0,positions:[],material:new i._cesium.PolylineGlowMaterialProperty({glowPower:.1,color:i._cesium.Color.YELLOW}),width:10,clampToGround:!0}},this.positions=e,this._init()}var r=this.handler=new i._cesium.ScreenSpaceEventHandler(i._viewer.scene.canvas),n=[],a=0,s=void 0,l={polyline:{},cameraRoll:null,cameraPitch:null,cameraPosition:null,cameraHeading:null,positions:[],distance:[],Totaltime:""},u=this._core.CreateTooltip();return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),r.setInputAction(function(e){e=i._getPosition.getMousePosition(e);"pc"===i._core.getBrowser().pc&&0==n.length&&n.push(e.clone()),n.push(e),2<=n.length&&(i._cesium.defined(s)||(s=new o(n)),a=i._core.getSpaceDistancem(n,i._cesium))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction(function(e){u.showAt(e.endPosition,"左键开始,右键结束!");e=i._getPosition.getMousePosition(e);2<=n.length&&(i._cesium.defined(s)?e&&(n.pop(),n.push(e)):s=new o(n),a=i._core.getSpaceDistancem(n,i._cesium))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),r.setInputAction(function(e){i.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){r.destroy(),u.show(!1),i._core.mouse(i._viewer.container,0),i.end=void 0,i._viewer.entities.remove(i.item),"cancel"===e||n.length<2||(a=i._core.getSpaceDistancem(n,i._cesium),l.polyline=s,l.positions=n,l.distance=parseFloat(a),i.setFlycesium(l,function(e){i.flyceium=e,i.ploylinejl=l,"function"==typeof t&&t(e)}))},this},Ui.prototype.setFlycesium=function(t,i){for(var o,r=this,n=[],e=0;e<t.positions.length;e++){var a=r._cesium.Cartographic.fromCartesian(t.positions[e]),a=[a.longitude/Math.PI*180,a.latitude/Math.PI*180,a.height];n.push(a)}this._core.getPmfxPro(t.positions,25,0,r._cesium,r._viewer,e=>{o=e.max;e=(t.distance/50).toFixed(1),e={id:r._core.getuid(),name:"新建路线",distance:t.distance,showPoint:!1,showLine:!0,showModel:!0,isLoop:!1,Totaltime:Math.round(e),speed:50,height:(o+100).toFixed(2),pitch:-20,range:100,mode:0,url:window.SmartEarthRootUrl+D.testModel,geojson:{geometry:{type:"LineString",coordinates:n}}};i&&i(e)})},Ui.prototype.Start=function(e,t,i){var o=this;return e.geojson,e.Totaltime||(e.Totaltime=3e3),o._entityFly&&o.exit(),Zi=i,setTimeout(function(){o.executeFly3D(e,t)},200),this};var Wi,Yi,qi,Qi,Ji,Xi,Ki=null,$i=null,Zi=null,eo={start:null,time:null,longitude:0,latitude:0,cameraHeight:100,speed:50,multiplier:1,position:0},to=0;Ui.prototype.executeFly3D=function(e,t){var l=this,i=e.geojson;if(Wi=new l._cesium.Cartesian3,Qi=new l._cesium.SampledProperty(Number),Ji=new l._cesium.SampledPositionProperty,i&&i.geometry){var o=i.geometry.coordinates,r=[],n=[];if(0<o.length){for(var a=0;a<o.length;a++){var s=o[a][0],u=o[a][1],c=o[a][2];void 0!==e.lineHeight&&(c=e.lineHeight),n.push(s,u,c),r.push({x:s,y:u,z:c})}l._viewer.clock.clockRange=e.isLoop?l._cesium.ClockRange.LOOP_STOP:l._cesium.ClockRange.CLAMPED,l._viewer.clock.multiplier=e.multiplier||1,l._viewer.clock.canAnimate=!1,l._viewer.clock.shouldAnimate=!0,eo.distance=e.distance,eo.cameraHeight=e.height,eo.lineHeight=e.lineHeight,eo.pitch=e.pitch,eo.range=e.range,eo.speed=e.speed||50,eo.Totaltime=e.distance/eo.speed,eo.start=l._cesium.JulianDate.fromDate(new Date),eo.stop=l._cesium.JulianDate.addSeconds(eo.start,eo.Totaltime,new l._cesium.JulianDate),l._viewer.clock.startTime=eo.start.clone(),l._viewer.clock.stopTime=eo.stop.clone(),l._viewer.clock.currentTime=eo.start.clone();var h=l.computeCirclularFlight(r);eo.position=h,eo.degrees=r,qi=new l._cesium.VelocityOrientationProperty(h);i={},i=""!==t?{show:l._cesium.defaultValue(e.showModel,!0),scale:l._cesium.defaultValue(e.modelScale,1),uri:t}:{show:l._cesium.defaultValue(e.showModel,!0),scale:l._cesium.defaultValue(e.modelScale,1)};e.modelData&&(i=l._core.extend(i,e.modelData)),io=function(){},Ki=l._viewer.entities.add({availability:new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:eo.start,stop:eo.stop})]),position:h,polyline:{clampToGround:void 0===eo.lineHeight,positions:Cesium.Cartesian3.fromDegreesArrayHeights(n),show:l._cesium.defaultValue(e.showLine,!0),material:new l._cesium.PolylineGlowMaterialProperty({glowPower:.1,color:l._cesium.Color.YELLOW}),width:10},label:{text:new l._cesium.CallbackProperty(function(e,t){if(l._viewer.camera,2===l._viewer.clock.clockRange||!Cesium.JulianDate.equals(l._viewer.clock.currentTime,l._viewer.clock.stopTime)){try{var i,o,r=oo.position.getValue(l._viewer.clock.currentTime),n=l._cesium.Cartographic.fromCartesian(r);eo.longitude=l._cesium.Math.toDegrees(n.longitude),eo.latitude=l._cesium.Math.toDegrees(n.latitude),void 0===eo.lineHeight&&(i=l._viewer.scene.sampleHeight(n,[$i,oo]),o=l._viewer.scene.globe.getHeight(n),$i.position=l._cesium.Cartesian3.fromRadians(n.longitude,n.latitude,i<o?o:i))}catch(e){}try{Yi.getValue(e,Wi),io(e);var a=l._cesium.Cartesian3.magnitude(Wi),s=Math.round(3.6*a);s+=" km/h",eo.time=l._cesium.JulianDate.secondsDifference(e,eo.start),eo.ratio=eo.time/eo.Totaltime,eo.distanceTraveled=eo.ratio*eo.distance,eo.speed=s,eo.height=n.height,eo.globeHeight=l._viewer.scene.globe.getHeight(n),null!=Zi&&"function"==typeof Zi&&Zi(eo)}catch(e){}return""}Ki.label.text="",l.exit(),null!=Zi&&"function"==typeof Zi&&Zi("end"),io=function(){}},!1),font:"20px sans-serif",showBackground:!1,distanceDisplayCondition:new l._cesium.DistanceDisplayCondition(0,100),eyeOffset:new l._cesium.Cartesian3(0,3.5,0)}}),$i=l._viewer.entities.add({availability:new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:eo.start,stop:eo.stop})]),position:h,orientation:qi,point:{show:l._cesium.defaultValue(e.showPoint,!1),color:l._cesium.Color.RED,outlineColor:l._cesium.Color.WHITE,outlineWidth:2,pixelSize:10},model:i,billboard:e.image,viewFrom:e.viewFrom||new l._cesium.Cartesian3(500,500,500)}),oo=Ki,l._viewer.trackedEntity=$i,l._entityFly=Ki,e.mode&&l.changeFlyMode(e.mode)}}};var io,oo=null;function ro(e){to=Qi.getValue(e),eo.heading=to}function no(e){var t=Cesium.Cartographic.fromCartesian(e),e=Cesium.Math.toDegrees(t.longitude),t=Cesium.Math.toDegrees(t.latitude);return Cesium.Cartesian3.fromDegrees(e,t,eo.cameraHeight||100)}function ao(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we,this.positions=[],this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.style=null,this.state=0,this.gonCircleArr=[],this.gonPointStretchingArr=[],this.topRadius=0,this.bottomRadius=0,this.length=50}function so(e,t){this._viewer=e,this._cesium=t,this._Cdcl=new f,this._core=new V,this._polyline=void 0,this._polygon=void 0,this._box=new Fi(e,t),this._ellipsoid=new Gi(e,t),this._rectangle=new Ni(e,t),this._circle=new Bi(e,t),this._point=void 0,this._label=new zi(e,t),this._dynamicObject=new Ui(e,t),this._elevationContour=new N(e,t),this._scopefieldvision=new Hi(e,t),this._cone=new ao(e,t)}function lo(e,t){this._viewer=e,this._cesium=t,this._execute=new so(this._viewer,this._cesium)}Ui.prototype.showPoint=function(e){$i&&$i.point&&($i.point.show=e)},Ui.prototype.showLine=function(e){Ki&&Ki.polyline&&(Ki.polyline.show=e)},Ui.prototype.showModel=function(e){$i&&$i.model&&($i.model.show=e)},Ui.prototype.setFlyHeight=function(e){eo.cameraHeight=e},Ui.prototype.setFlyDistance=function(e){eo.range=e},Ui.prototype.setFlyPitch=function(e){eo.pitch=e},Ui.prototype.changeFlyMode=function(e){var t=this;switch(e){case 0:io=function(){},t.BindingModel(!0);break;case 1:this.BindingModel(!1),io=function(e){ro(e),t.exeuteVisualAngle(t._cesium.Math.toRadians(eo.heading),t._cesium.Math.toRadians(eo.pitch),eo.range)};break;case 2:this.BindingModel(!1),io=function(e){ro(e),(Xi=t._entityFly.position.getValue(t._viewer.clock.currentTime))&&(Xi=no(Xi),t._viewer.camera.setView({destination:Xi,orientation:{heading:t._cesium.Math.toRadians(eo.heading),pitch:t._cesium.Math.toRadians(-90),roll:0}}))}}},Ui.prototype.faster=function(){this._viewer.animation.viewModel.faster()},Ui.prototype.slower=function(){this._viewer.animation.viewModel.slower()},Ui.prototype.setMultiplier=function(e){this._viewer.clock.multiplier=parseFloat(e)},Ui.prototype.isPause=function(e){this._viewer.clockViewModel.shouldAnimate=!e},Ui.prototype.exit=function(){this.isPause(!0),this._viewer.clock.multiplier=1,this.executeSignout(),this.BindingModel(!1),this._viewer.entities.remove(Ki),this._viewer.entities.remove($i),$i=Ki=null,this._entityFly=null},Ui.prototype.updateSpeedLabel=function(e,t){},Ui.prototype.computeCirclularFlight=function(e){var t=this;Yi=new t._cesium.VelocityVectorProperty(Ji,!1);for(var i,o,r,n,a,s,l=0;l<e.length;l++){0===l&&(a=t._cesium.JulianDate.addSeconds(eo.start,0,new t._cesium.JulianDate),i=t._cesium.Cartesian3.fromDegrees(e[0].x,e[0].y,eo.lineHeight),Ji.addSample(a,i),to=t._core.TwoPointAzimuth(e[0].x,e[0].y,e[1].x,e[1].y),Qi.addSample(a,to));try{0<l&&l!=e.length-1&&(i=new t._cesium.Cartesian3(Ji._property._values[3*l-3],Ji._property._values[3*l-2],Ji._property._values[3*l-1]),o=t._cesium.Cartesian3.fromDegrees(e[l].x,e[l].y,t._cesium.defaultValue(eo.lineHeight,e[l].z)),r=[t._cesium.Cartographic.fromCartesian(i),t._cesium.Cartographic.fromCartesian(o)],n=new t._cesium.EllipsoidGeodesic(r[0],r[1]).surfaceDistance,a=t._cesium.JulianDate.addSeconds(Ji._property._times[l-1],.5,new t._cesium.JulianDate),s=t._cesium.JulianDate.addSeconds(Ji._property._times[l-1],n/eo.speed,new t._cesium.JulianDate),Ji.addSample(s,o),to=t._core.TwoPointAzimuth(e[l-1].x,e[l-1].y,e[l].x,e[l].y),Qi.addSample(a,to),Qi.addSample(s,to))}catch(e){console.log(e)}}return Ji},Ui.prototype.executePauseFly3DPaths=function(){var e=this._viewer.clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:this._viewer.clockViewModel.canAnimate&&(e.shouldAnimate=!0)},Ui.prototype.changeModel=function(e){$i.model.uri=e},Ui.prototype.PointView=function(){return{position:Viewer.camera.position.clone(),orientation:{heading:Viewer.camera.heading,pitch:Viewer.camera.pitch,roll:Viewer.camera.roll}}},Ui.prototype.PlayPaths=function(e){var t=this;setInterval(function(){viewer.camera.setView({destination:t._cesium.Cartesian3.fromDegrees(117.48,30.67,15e3),orientation:{heading:t._cesium.Math.toRadians(90,0),pitch:t._cesium.Math.toRadians(-90),roll:0}})},2e3)},Ui.prototype.BindingModel=function(e){e?this._viewer.trackedEntity=$i:(this._viewer.trackedEntity=void 0,this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY))},Ui.prototype.exeuteVisualAngle=function(e,t,i){var o={heading:null,pitch:null,range:null};o.heading=e||this._cesium.Math.toRadians(90),o.pitch=t||this._cesium.Math.toRadians(0),o.range=i||1e3;i=this._entityFly.position.getValue(this._viewer.clock.currentTime);i&&(i=no(i),o=new this._cesium.HeadingPitchRange(o.heading,o.pitch,o.range),this._viewer.camera.lookAt(i,o))},Ui.prototype.Pathshow=function(e){this._entityFly.polyline.show=e},Ui.prototype.Pointshow=function(e){$i._point.show=e},Ui.prototype.Modelshow=function(e){$i._model.show=e},Ui.prototype.executePlayForwardFly3DPaths=function(){var e=this._viewer.clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0},Ui.prototype.executePlayReverseFly3DPaths=function(){var e=this._viewer.clockViewModel,t=e.multiplier;0<t&&(e.multiplier=-t),e.shouldAnimate=!0},Ui.prototype.executeSignout=function(){var e=this._cesium.JulianDate.fromDate(new Date);this._viewer.clock.startTime=e.clone();e=this._cesium.JulianDate.addSeconds(e,86400,new this._cesium.JulianDate);this._viewer.clock.stopTime=e.clone()},Ui.prototype.forceEndHanlder=function(){this.handler&&(this.handler.destroy(),this.handler=void 0)},ao.prototype.createCone=function(e,t,i,o){var r={length:4e5,topRadius:0,bottomRadius:2e5,material:this._cesium.Color.GREEN},t=this._core.extend(r,t,!0);this.item=this._viewer.entities.add({name:i,position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[1]),cylinder:t});i={id:this.item.id,name:i,pId:this._core.isnull(o)?0:o,type:"cylinder",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),this},ao.prototype.getstyles=function(){var e={};return e.show=!this.item.cylinder.show||this.item.cylinder.show._value,e.length=this.item.cylinder.length?this.item.cylinder.length.getValue():void 0,e.topRadius=this.item.cylinder.topRadius?this.item.cylinder.topRadius.getValue():void 0,e.bottomRadius=this.item.cylinder.bottomRadius?this.item.cylinder.bottomRadius.getValue():void 0,e.heightReference=this.item.cylinder.heightReference&&this.item.cylinder.heightReference._value?this.item.cylinder.heightReference._value:void 0,e.fill=this.item.cylinder.fill&&this.item.cylinder.fill._value?this.item.cylinder.fill._value:void 0,e.material={},e.material.color=this.item.cylinder.material&&this.item.cylinder.material.color&&this.item.cylinder.material.color._value?"rgba"+this.item.cylinder.material.color.toString():void 0,e.material.image=this.item.cylinder.material&&this.item.cylinder.material.image&&this.item.cylinder.material.image._value?this.item.cylinder.material.image._value:void 0,e.material.repeat=this.item.cylinder.material&&this.item.cylinder.material.repeat&&this.item.cylinder.material.repeat._value?this.item.cylinder.material.repeat._value:void 0,e.outline=this.item.cylinder.outline?this.item.cylinder.outline._value:void 0,e.outlineWidth=this.item.cylinder.outlineWidth&&this.item.cylinder.outlineWidth._value?this.item.cylinder.outlineWidth._value:void 0,e.outlineColor=this.item.cylinder.outlineColor&&this.item.cylinder.outlineColor&&this.item.cylinder.outlineColor._value?"rgba"+this.item.cylinder.outlineColor.toString():void 0,e.near=this.item.cylinder.distanceDisplayCondition?this.item.cylinder.distanceDisplayCondition._value.near:void 0,e.far=this.item.cylinder.distanceDisplayCondition?this.item.cylinder.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},ao.prototype.createRectangularSensor=function(e,t,i,o){var r=this,n=this._core.defaultValue((t=t||{}).radius,100),a={radii:new this._cesium.Cartesian3(n,n,n),maximumCone:this._cesium.Math.toRadians(90),material:this._cesium.Color.AQUAMARINE.withAlpha(.3),outline:!0,outlineColor:this._cesium.Color.AQUAMARINE.withAlpha(.5),outlineWidth:1},s=this._core.extend(a,t,!0);"string"==typeof t.color&&(s.material=this._cesium.Color.fromCssColorString(t.color)),"string"==typeof t.outlineColor&&(s.outlineColor=this._cesium.Color.fromCssColorString(t.outlineColor));var l=0,u=this.calcPoints(e[0],e[1],e[2],n,l);this.wall=[];var c,a=this._viewer.entities.add({polygon:{hierarchy:new this._cesium.CallbackProperty(function(){return new r._cesium.PolygonHierarchy(r._cesium.Cartesian3.fromDegreesArrayHeights(u))},!1),perPositionHeight:!0,material:this._core.defaultValue(t.wallColor&&this._cesium.Color.fromCssColorString(t.wallColor),this._cesium.Color.AQUAMARINE.withAlpha(.5)),outline:!0,outlineColor:this._core.defaultValue(t.wallOutlineColor&&this._cesium.Color.fromCssColorString(t.wallOutlineColor),this._cesium.Color.RED.withAlpha(.5))}});this.wall.push(a),s.angle&&(c=this.calcPoints(e[0],e[1],e[2],n,l+s.angle),a=this._viewer.entities.add({polygon:{hierarchy:new this._cesium.CallbackProperty(function(){return new r._cesium.PolygonHierarchy(r._cesium.Cartesian3.fromDegreesArrayHeights(c))},!1),perPositionHeight:!0,material:this._core.defaultValue(t.wallColor&&this._cesium.Color.fromCssColorString(t.wallColor),this._cesium.Color.AQUAMARINE.withAlpha(.5)),outline:!0,outlineColor:this._core.defaultValue(t.wallOutlineColor&&this._cesium.Color.fromCssColorString(t.wallOutlineColor),this._cesium.Color.RED.withAlpha(.5))}}),this.wall.push(a),t=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),ellipsoid:{radii:s.radii,minimumClock:this._cesium.Math.toRadians(0),maximumClock:this._cesium.Math.toRadians(s.angle),maximumCone:this._cesium.Math.toRadians(90),material:this._core.defaultValue(t.surfaceColor&&this._cesium.Color.fromCssColorString(t.surfaceColor),this._cesium.Color.RED.withAlpha(.5))},orientation:new r._cesium.CallbackProperty(function(){return r._cesium.Transforms.headingPitchRollQuaternion(r._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),new r._cesium.HeadingPitchRoll(r._cesium.Math.toRadians(-l),0,0))},!1)}),this.wall.push(t)),this.item=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),ellipsoid:s});var h=this._core.defaultValue(s.speed,1);this._viewer.clock.onTick.addEventListener(function(){l+=.1*h,u=r.calcPoints(e[0],e[1],e[2],n,l),c=c&&r.calcPoints(e[0],e[1],e[2],n,l+s.angle)});i={id:this.item.id,name:i,pId:this._core.isnull(o)?0:o,type:"cylinder",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),this},ao.prototype.computeCirclularFlight=function(e,t,i,o,r,n,a){var s=[];s.push(e),s.push(t),s.push(r);for(var l=this._cesium.Cartesian3.distance(this._cesium.Cartesian3.fromDegrees(e,t,r),this._cesium.Cartesian3.fromDegrees(i,o,r)),u=n;u<=n+a;u++){var c=l*Math.sin(u*Math.PI/180),h=Math.cos(u*Math.PI/180),m=(o-t)*h+t;s.push((i-e)*h+e),s.push(m),s.push(c+r)}return s},ao.prototype.calcPoints=function(e,t,i,o,r){var n=this._cesium.Transforms.eastNorthUpToFixedFrame(this._cesium.Cartesian3.fromDegrees(e,t,i)),a=o*Math.cos(r*Math.PI/180),r=o*Math.sin(r*Math.PI/180),r=this._cesium.Cartesian3.fromElements(a,r,0),n=this._cesium.Matrix4.multiplyByPoint(n,r,new this._cesium.Cartesian3),r=this._cesium.Cartographic.fromCartesian(n),n=this._cesium.Math.toDegrees(r.longitude),r=this._cesium.Math.toDegrees(r.latitude);return this.computeCirclularFlight(e,t,n,r,i,0,90)},ao.prototype.createRadarMaskScan=function(e,t,i,o){var r=this._core.defaultValue((i=i||{}).radius,100),n=this._core.defaultValue(i.yaw,0),a=this._core.defaultValue(i.angle,60),s=i.innerOutline,l={innerRadii:new this._cesium.Cartesian3(2,2,2),radii:new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(r,r,r)},!1),maximumCone:this._cesium.Math.toRadians(this._core.defaultValue(i.maxLat,105)),minimumCone:this._cesium.Math.toRadians(this._core.defaultValue(i.minLat,75)),minimumClock:new Cesium.CallbackProperty(function(){return Cesium.Math.toRadians(n)},!1),maximumClock:new Cesium.CallbackProperty(function(){return Cesium.Math.toRadians(n+a)},!1),material:this._cesium.Color.AQUAMARINE.withAlpha(.3),outline:!s,outlineColor:this._cesium.Color.AQUAMARINE.withAlpha(.5),outlineWidth:1},l=this._core.extend(l,i,!0);"string"==typeof i.color&&(l.material=this._cesium.Color.fromCssColorString(i.color)),"string"==typeof i.outlineColor&&(l.outlineColor=this._cesium.Color.fromCssColorString(i.outlineColor));let u,c,h=t instanceof Cesium.Entity?t:void 0;h?(u=new Cesium.CallbackProperty(()=>h.position.getValue(this._viewer.clock.currentTime.clone()),!1),c=new Cesium.CallbackProperty(()=>h.orientation.getValue(this._viewer.clock.currentTime.clone()),!1)):u=Cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]);var m=0,d=this._core.defaultValue(i.scanAngle,15);this._scan=this._viewer.entities.add({position:u,orientation:c,ellipsoid:{...l,minimumClock:new Cesium.CallbackProperty(function(){return Cesium.Math.toRadians(n+m)},!1),maximumClock:new Cesium.CallbackProperty(function(){return Cesium.Math.toRadians(n+m+d)},!1),outline:s,material:this._core.defaultValue(i.scanColor&&this._cesium.Color.fromCssColorString(i.scanColor),this._cesium.Color.RED.withAlpha(.5))}}),this.item=this._viewer.entities.add({position:u,orientation:c,ellipsoid:l});var p=this._core.defaultValue(l.speed,1);function g(){(m+=.1*p)<=0&&p<0?(m=0,p=-p):a-d<=m&&0<p&&(m=a-d,p=-p)}this._viewer.clock.onTick.addEventListener(g),this.setRadarMaskValue=(e,t)=>{"yaw"===e?n=t:"angle"===e?a=360<t?360:t:"radius"===e?r=t:"scanAngle"===e?d=a<t?a:t:"speed"===e&&(p=t)},this.deleteObject=()=>{let e=this._viewer;e.entities.remove(this.item),e.entities.remove(this._scan),this._viewer.clock.onTick.removeEventListener(g)};e={id:this.item.id,name:e,pId:this._core.isnull(o)?0:o,type:"ellipsoid",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(o)?0:o),this},ao.prototype.ConicSensor=function(t,i,e={}){var o=Cesium.Cartesian3.distance(t,i),r=(e.angle||10)/2,n={innerRadii:new this._cesium.Cartesian3(2,2,2),radii:new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(o,o,o)},!1),outline:e.outline,material:Cesium.Color.RED.withAlpha(.2),outlineColor:Cesium.Color.WHITE.withAlpha(.2),maximumCone:Cesium.Math.toRadians(-r),minimumCone:Cesium.Math.toRadians(r)};e.color&&(n.material=Cesium.Color.fromCssColorString(e.color)),e.outlineColor&&(n.outlineColor=Cesium.Color.fromCssColorString(e.outlineColor));let a=this._core.toDegrees(t),s=this._core.toDegrees(i),l,u,c=0;this.item=this._viewer.entities.add({position:t,ellipsoid:n});let h=()=>{l=this._core.TwoPointAzimuth(a.lon,a.lat,s.lon,s.lat)+90,u=Math.acos((s.height-a.height)/o),u=Cesium.Math.toDegrees(u),this.item.orientation=Cesium.Transforms.headingPitchRollQuaternion(t,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this._core.defaultValue(l,0)),Cesium.Math.toRadians(this._core.defaultValue(u,0)),Cesium.Math.toRadians(this._core.defaultValue(c,0))))};h();n={id:this.item.id,name:"锥形传感器",pId:0,type:"ellipsoid",item:this};return this.setTreeobj(n),this._tree.insertGroupId(n,0),this.changeStart=e=>{t=e,a=this._core.toDegrees(t),this.item.position=t,o=Cesium.Cartesian3.distance(t,i),h()},this.changeEnd=e=>{i=e,s=this._core.toDegrees(i),o=Cesium.Cartesian3.distance(t,i),h()},this.changeAngle=e=>{r=e/2,this.item.ellipsoid.maximumCone=Cesium.Math.toRadians(-r),this.item.ellipsoid.minimumCone=Cesium.Math.toRadians(r)},this},ao.prototype.createRadarMask=function(e,t,i,o){var r=this._core.defaultValue((i=i||{}).radius,100),n=this._core.defaultValue(i.yaw,0),a=this._core.defaultValue(i.angle,60),a={innerRadii:new this._cesium.Cartesian3(2,2,2),radii:new this._cesium.Cartesian3(r,r,r),maximumCone:this._cesium.Math.toRadians(this._core.defaultValue(i.maxLat,105)),minimumCone:this._cesium.Math.toRadians(this._core.defaultValue(i.minLat,75)),minimumClock:this._cesium.Math.toRadians(n),maximumClock:this._cesium.Math.toRadians(n+a),material:this._cesium.Color.AQUAMARINE.withAlpha(.3),outline:!1,outlineColor:this._cesium.Color.AQUAMARINE.withAlpha(.5),outlineWidth:1},a=this._core.extend(a,i,!0);"string"==typeof i.color&&(a.material=this._cesium.Color.fromCssColorString(i.color)),"string"==typeof i.outlineColor&&(a.outlineColor=this._cesium.Color.fromCssColorString(i.outlineColor)),this.item=this._viewer.entities.add({position:t,ellipsoid:a});e={id:this.item.id,name:e,pId:this._core.isnull(o)?0:o,type:"ellipsoid",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(o)?0:o),this},ao.prototype.createConeRadar=function(o,e){e=e||{};var r=this;r.lon=o[0],r.lat=o[1],r.height=this._core.defaultValue(o[2],3e3),this.planePosition=null,this.halfLen=r.height/2,this.lengthl=r.height,this.geoD=new this._cesium.EllipsoidGeodesic,this.startPt=this._cesium.Cartographic.fromDegrees(r.lon,r.lat,0),this.changenum=0,this.curCanvas="a";var t=this._viewer.scene.globe.getHeight(this.startPt)||0;this._cesium.Color.fromCssColorString(r._core.defaultValue(e.color,"#0000ff")),this.item=this._viewer.entities.add({name:"Red cone",position:e.rotate?new this._cesium.CallbackProperty(function(){return r.lon>o[0]+.01&&r.lat<o[1]+.005?r.lat+=1e-5:r.lat>o[1]+.005&&r.lon>o[0]?r.lon-=1e-5:r.lon<=o[0]&&r.lat>o[1]?r.lat-=1e-5:r.lon+=1e-5,r.planePosition=r._cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height/2),r.planePosition},!1):r._cesium.Cartesian3.fromDegrees(r.lon,r.lat,(r.height+t)/2),orientation:e.rotate?new this._cesium.CallbackProperty(function(){var e=Cesium.Cartographic.fromDegrees(r.lon,o[1],0);r.geoD.setEndPoints(r.startPt,e);var t=r.geoD.surfaceDistance,i=Math.atan(t/r.halfLen),e=Cesium.Cartographic.fromDegrees(r.lon,r.lat,0);return r.geoD.setEndPoints(r.startPt,e),t=r.geoD.surfaceDistance,r.lengthl=Math.sqrt(t*t+r.halfLen*r.halfLen),e=Cesium.Cartographic.fromDegrees(o[0],r.lat,0),r.geoD.setEndPoints(r.startPt,e),t=r.geoD.surfaceDistance,t=Math.asin(t/r.lengthl),t=new Cesium.HeadingPitchRoll(0,i,t),Cesium.Transforms.headingPitchRollQuaternion(r.planePosition,t)},!1):void 0,cylinder:{length:e.rotate?new r._cesium.CallbackProperty(function(){return 2*r.lengthl},!1):r.height-t,topRadius:0,bottomRadius:r._core.defaultValue(e.radius,300),bottomSurface:!1,material:r._core.getConeRadarMaterial(e.color)}});e={id:this._core.getuid(),name:"新建卫星雷达",pId:0,type:"ConeRadar",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},ao.prototype.setLength=function(e){try{this.item._cylinder.length=e}catch(e){console.log(e)}return this},ao.prototype.createCylinderOptimization=function(e,t){this.style=e;var s=this;this.handler.setInputAction(function(e){var t=s.getCatesian3FromPX(e.position,s._viewer,[s.circle]);0==s.positions.length&&s.positions.push(t.clone()),s.positions.push(t);e=s.createPoint(t,!1);0<s.gonCircleArr.length&&(s.positions.pop(),s.state=1,s.handler.destroy());t=s.createPointStretching(t,!1);t.wq=s.gonCircleArr.length,s.gonPointStretchingArr.push(t),e.wz=s.gonCircleArr.length,s.gonCircleArr.push(e)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){var t,i,o,r,n,a;s.positions.length<1||(e=s.getCatesian3FromPX(e.endPosition,s._viewer,[s.circle]),2==s.positions.length&&(s._cesium.defined(s.circle)||(t=s._cesium.Cartographic.fromCartesian(s.positions[0]),i=s._cesium.Math.toDegrees(t.longitude),o=s._cesium.Math.toDegrees(t.latitude),r=s._cesium.Cartographic.fromCartesian(s.positions[1]),n=s._cesium.Math.toDegrees(r.longitude),a=s._cesium.Math.toDegrees(r.latitude),s.topRadius=f(o,i,a,n),s.bottomRadius=f(o,i,a,n),s.circle=s.createCylinder(s.style),s._core.Entityadd(s),s.circle.objId=s.objId)),s.circle&&(s.positions.pop(),s.positions.push(e),t=s._cesium.Cartographic.fromCartesian(s.positions[0]),i=s._cesium.Math.toDegrees(t.longitude),o=s._cesium.Math.toDegrees(t.latitude),r=s._cesium.Cartographic.fromCartesian(s.positions[1]),n=s._cesium.Math.toDegrees(r.longitude),a=s._cesium.Math.toDegrees(r.latitude),s.topRadius=f(o,i,a,n),s.bottomRadius=f(o,i,a,n)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)},ao.prototype.startModify=function(){var m="拖动修改位置";if(2==this.state||1==this.state){this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var d=this,e=0;e<d.gonCircleArr.length;e++)(t=d.gonCircleArr[e])&&(t.show=!0);if(0<d.gonPointStretchingArr.length)for(var t,e=0;e<d.gonPointStretchingArr.length;e++)(t=d.gonPointStretchingArr[e])&&(t.show=!0);this.modifyHandler.setInputAction(function(e){e=d._viewer.scene.pick(e.position);if(Cesium.defined(e)&&e.id)e.id.objId||(d.modifyPoint=e.id,m="释放后完成修改"),d.forbidDrawWorld(!0);else{for(var t=0;t<d.gonCircleArr.length;t++)(i=d.gonCircleArr[t])&&(i.show=!1);if(0<d.gonPointStretchingArr.length)for(var i,t=0;t<d.gonPointStretchingArr.length;t++)(i=d.gonPointStretchingArr[t])&&(i.show=!1);d.modifyHandler&&(d.modifyHandler.destroy(),d.modifyHandler=null)}d.state=2},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t,i,o,r,n,a,s,l,u,c,h=d._viewer.scene.pick(e.endPosition);d._core.CreateTooltip(m,e.endPosition,!1),Cesium.defined(h)&&h.id&&(h.id.objId||d._core.CreateTooltip(m,e.endPosition,!0)),d.positions.length<1||!d.modifyPoint||((t=d.getCatesian3FromPX(e.endPosition,d._viewer,[d.circle,d.modifyPoint]))&&(null!=d.modifyPoint.wq?(o={x:t.x,y:t.y,z:t.z+ +d.length},d.positions[d.modifyPoint.wq]=t,0==d.modifyPoint.wq?(d.modifyPoint.position.setValue(o),d.gonCircleArr[d.modifyPoint.wq].position=t):(r=d._viewer.scene.pickPosition(e.endPosition),n=d._cesium.Cartographic.fromCartesian(r),a=d._cesium.Math.toDegrees(n.longitude),s=d._cesium.Math.toDegrees(n.latitude),l=d._cesium.Cartographic.fromCartesian(d.positions[1]),u=d._cesium.Math.toDegrees(l.longitude),c=d._cesium.Math.toDegrees(l.latitude),d.length=f(s,a,c,u),i=d._cesium.Cartographic.fromCartesian(d.gonCircleArr[0].position.getValue()),h=d._cesium.Math.toDegrees(i.longitude),o=d._cesium.Math.toDegrees(i.latitude),r=i.height+d.length,i=d._cesium.Cartesian3.fromDegrees(h,o,r),h=d._cesium.Cartographic.fromCartesian(d.gonCircleArr[1].position.getValue()),o=d._cesium.Math.toDegrees(h.longitude),r=d._cesium.Math.toDegrees(h.latitude),h=h.height+d.length,h=d._cesium.Cartesian3.fromDegrees(o,r,h),d.gonPointStretchingArr[0].position.setValue(i),d.gonPointStretchingArr[1].position.setValue(h))):(d.modifyPoint.position.setValue(t),d.positions[d.modifyPoint.wz]=t,d.gonPointStretchingArr[d.modifyPoint.wz].position={x:t.x,y:t.y,z:t.z+d.length},d.modifyPoint.wz&&0==d.modifyPoint.wz?(d.gonCircleArr[1].position={x:d.positions[0].x+d.topRadius,y:d.positions[0].y,z:d.positions[0].z},d.gonPointStretchingArr[1].position={x:d.positions[0].x+d.topRadius,y:d.positions[0].y,z:d.positions[0].z+d.length}):(n=d._cesium.Cartographic.fromCartesian(d.positions[0]),a=d._cesium.Math.toDegrees(n.longitude),s=d._cesium.Math.toDegrees(n.latitude),l=d._cesium.Cartographic.fromCartesian(d.positions[d.modifyPoint.wz]),u=d._cesium.Math.toDegrees(l.longitude),c=d._cesium.Math.toDegrees(l.latitude),d.topRadius=f(s,a,c,u),d.bottomRadius=f(s,a,c,u)))),d._core.CreateTooltip(m,e.endPosition,!0))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){d.modifyPoint&&(d.modifyPoint=null,d.forbidDrawWorld(!1),m="拖动修改位置")},Cesium.ScreenSpaceEventType.LEFT_UP)}},ao.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},ao.prototype.getCatesian3FromPX=function(e,t,i){var o,r=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=r;if(t.scene.pickPositionSupported&&Cesium.defined(a))o=t.scene.pickPosition(e);else{e=t.camera.getPickRay(e);if(!e)return;o=t.scene.globe.pick(e,t.scene)}return o},ao.prototype.createCylinder=function(e){var t=this;return e.length&&(t.length=e.length),this._viewer.entities.add({position:new t._cesium.CallbackProperty(function(){return t.positions[0]},!1),cylinder:{topRadius:new t._cesium.CallbackProperty(function(){return t.topRadius},!1),bottomRadius:new t._cesium.CallbackProperty(function(){return t.bottomRadius},!1),length:new t._cesium.CallbackProperty(function(){return t.length},!1),material:e.material||Cesium.Color.WHITE}})},ao.prototype.createPoint=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},ao.prototype.createPointStretching=function(e,t){if(e){var i=Cesium.Cartographic.fromCartesian(e),o=Cesium.Math.toDegrees(i.longitude),r=Cesium.Math.toDegrees(i.latitude),i=i.height+this.length;return e=Cesium.Cartesian3.fromDegrees(o,r,i),this._viewer.entities.add({position:e,point:{pixelSize:10,color:Cesium.Color.fromAlpha(Cesium.Color.FUCHSIA,.5),outlineWidth:2,outlineColor:Cesium.Color.fromAlpha(Cesium.Color.WHITE,.5),heightReference:Cesium.HeightReference.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})}},ao.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=null==this.item.cylinder.length?void 0:this.item.cylinder.length.getValue(),i=null==this.item.cylinder.topRadius?void 0:this.item.cylinder.topRadius.getValue(),o=null==this.item.cylinder.bottomRadius?void 0:this.item.cylinder.bottomRadius.getValue(),r=null==this.item.cylinder.fill?void 0:this.item.cylinder.fill.getValue(),n=this.item.cylinder.material;null!=n&&(n={color:null==n.color?void 0:"rgba("+n.color._value.red+","+n.color._value.green+","+n.color._value.blue+","+n.color._value.alpha+")",image:null==n.image?void 0:n.image._value,diffusemap:null==n.diffusemap?void 0:n.diffusemap._value,alphamap:null==n.alphamap?void 0:n.alphamap._value});var a=null==this.item.cylinder.outline?void 0:this.item.cylinder.outline._value,s=null==this.item.cylinder.outlineColor?void 0:"rgba("+this.item.cylinder.outlineColor._value.red+","+this.item.cylinder.outlineColor._value.green+","+this.item.cylinder.outlineColor._value.blue+","+this.item.cylinder.outlineColor._value.alpha+")",l=null==this.item.cylinder.outlineWidth?void 0:this.item.cylinder.outlineWidth._value,u=null==this.item.cylinder.numberOfVerticalLines?void 0:this.item.cylinder.numberOfVerticalLines._value,c=null==this.item.cylinder.slices?void 0:this.item.cylinder.slices._value,h=this.item.cylinder.distanceDisplayCondition,m=null==h?void 0:h._value.near,d=null==h?void 0:h._value.far,h=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"cylinder",position:{x:this._cesium.Math.toDegrees(h.longitude),y:this._cesium.Math.toDegrees(h.latitude),z:this._cesium.Math.toDegrees(h.height)},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,length:t,topRadius:i,bottomRadius:o,fill:r,material:n,outline:a,outlineColor:s,outlineWidth:l,numberOfVerticalLines:u,slices:c,near:m,far:d}}},ao.prototype.setTreeobj=function(e){this.treeobj=e},ao.prototype.setVisibility=function(t){this.item.show=t,this._scan&&(this._scan.show=t),this.wall&&this.wall.forEach(e=>{e.show=t})},ao.prototype.getVolume=function(){try{var e=0,t=this.item._cylinder.bottomRadius,i=(this.item._cylinder.topRadius,this.item._cylinder.length),e=0==t?3.14159*t*t*i/3:3.14159*t*t*i}catch(e){console.log(e)}return e},ao.prototype.executeCone=function(r){var n=this;n.shape={tempPoints:[],button:0,position:{}};var a=new this._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas),s=[],l=[];return a.setInputAction(function(e){var t=n._viewer.scene.camera.pickEllipsoid(e.position,n._viewer.scene.globe.ellipsoid),i=n._cesium.Cartographic.fromCartesian(t),e=n._cesium.Math.toDegrees(i.longitude),i=n._cesium.Math.toDegrees(i.latitude);l.push({lon:e,lat:i});var o;0==n.shape.button?(s.push(t.clone()),s.push(t),n.shape.position=t,n.cylinder=n._viewer.entities.add({name:"",position:n._cesium.Cartesian3.fromDegrees(l[0].lon,l[0].lat),cylinder:{length:100,show:!0,fill:!0,topRadius:0,bottomRadius:100,material:n._cesium.Color.RED}}),n.item=n.cylinder):1==n.shape.button?(o=f(l[0].lat,l[0].lon,l[1].lat,l[1].lon),n.item.cylinder.bottomRadius=o):2==n.shape.button&&(a.destroy(),t=0,n._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(t=we.selectedItem.id),o={id:o=n._core.getuid(),name:"新建圆锥"+o,pId:n._core.isnull(t)?0:t,type:"cylinder",item:n},this.setTreeobj(o),we.insertGroupId(o,n._core.isnull(t)?0:t),"function"==typeof r&&r({polyline:{},positions:[],distance:[]})),n.shape.button=n.shape.button+1},this._cesium.ScreenSpaceEventType.LEFT_CLICK),a.setInputAction(function(e){2==n.shape.button&&(e=n._viewer.camera.getPickRay(e.endPosition),e=n._viewer.scene.globe.pick(e,n._viewer.scene),n.item.cylinder.length=e.z)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},ao.prototype.executeCylinder=function(r){var n=this;n.shape={tempPoints:[],button:0,position:{}};var a=new this._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas),s=[],l=[];return a.setInputAction(function(e){var t=n._viewer.scene.camera.pickEllipsoid(e.position,n._viewer.scene.globe.ellipsoid),i=n._cesium.Cartographic.fromCartesian(t),e=n._cesium.Math.toDegrees(i.longitude),i=n._cesium.Math.toDegrees(i.latitude);l.push({lon:e,lat:i});var o;0==n.shape.button?(s.push(t.clone()),s.push(t),n.shape.position=t,n.cylinder=n._viewer.entities.add({name:"",position:n._cesium.Cartesian3.fromDegrees(l[0].lon,l[0].lat),cylinder:{length:100,topRadius:0,bottomRadius:100,material:n._cesium.Color.RED}}),n.item=n.cylinder):1==n.shape.button?(o=f(l[0].lat,l[0].lon,l[1].lat,l[1].lon),n.item.cylinder.bottomRadius=o,n.item.cylinder.topRadius=o):2==n.shape.button&&(a.destroy(),t=0,n._core.isnull(we.selectedItem)||"group"!=we.selectedItem.type||(t=we.selectedItem.id),o={id:o=n._core.getuid(),name:"新建圆柱"+o,pId:n._core.isnull(t)?0:t,type:"cylinder",item:n},n.setTreeobj(o),we.insertGroupId(o,n._core.isnull(t)?0:t),"function"==typeof r&&r({polyline:{},positions:[],distance:[]})),n.shape.button=n.shape.button+1},this._cesium.ScreenSpaceEventType.LEFT_CLICK),a.setInputAction(function(e){2==n.shape.button&&(e=n._viewer.camera.getPickRay(e.endPosition),e=n._viewer.scene.globe.pick(e,n._viewer.scene),n.item.cylinder.length=e.z)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},ao.prototype.setTopRadius=function(e){try{this.item._cylinder.topRadius=e}catch(e){console.log(e)}return this},ao.prototype.setHeight=function(e){try{var t=this._cesium.Cartesian3.fromDegrees(-94.74211811500844,37.34584317651723,e);this.item._position._value.z=t.z}catch(e){console.log(e)}return this},ao.prototype.deleteObject=function(){let t=this._viewer;t.entities.remove(this.item),this.wall&&(this.wall.forEach(e=>{t.entities.remove(e)}),this.wall=[])},ao.prototype.setHeightType=function(e){try{1==e?this.item._cylinder.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._cylinder.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._cylinder.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},ao.prototype.setCylinderImage=function(e){try{this.item._cylinder.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},ao.prototype.setCylinderRepeat=function(e,t){try{this.item._cylinder.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},ao.prototype.setDistanceDisplayCondition=function(e,t){t=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._cylinder.distanceDisplayCondition=t}catch(e){console.log(e)}return this},ao.prototype.setBottomRadius=function(e){try{this.item._cylinder.bottomRadius=e}catch(e){console.log(e)}return this},ao.prototype.setShow=function(e){try{this.item._cylinder.show=e}catch(e){console.log(e)}return this},ao.prototype.setMaterial=function(e){try{this.item._cylinder.material=e}catch(e){console.log(e)}return this},ao.prototype.setMaterial=function(e){try{this.item._cylinder.material.color=new G(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},ao.prototype.setMaterialAlpha=function(e){try{this.item._cylinder.material.color._value.alpha=e,this.item._cylinder.show=!0}catch(e){console.log(e)}return this},ao.prototype.setItem=function(e){this.item=e},ao.prototype.CreateCone=function(e,t,i,o,r,n,a,s){this._postion=e;var l,n={topRadius:0,bottomRadius:this._cesium.defaultValue(t,2e4),length:this._cesium.defaultValue(i,4e4),slices:this._cesium.defaultValue(n,128),material:this._cesium.Color.RED,outline:!1,outlineColor:void 0};o&&""!==o&&(n.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(o),n.outline=!0),r&&""!==r&&(n.material=new G(this._viewer,this._cesium).colorFromHtmlColor(r)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),cylinder:n,orientation:l});s={id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"cylinder",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(a)?0:a),this},ao.prototype.CreateCylinder=function(e,t,i,o,r,n,a,s){this._postion=e;var l,n={topRadius:this._cesium.defaultValue(t,2e4),bottomRadius:this._cesium.defaultValue(t,2e4),length:this._cesium.defaultValue(i,4e4),slices:this._cesium.defaultValue(n,128),material:this._cesium.Color.RED,outline:!1,outlineColor:void 0};o&&""!==o&&(n.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(o),n.outline=!0),r&&""!==r&&(n.material=new G(this._viewer,this._cesium).colorFromHtmlColor(r)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),cylinder:n,orientation:l});s={id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"cylinder",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(a)?0:a),this},Object.defineProperties(ao.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),so.prototype.execute=function(e,t,i={},o){var r=this._viewer,n=this._cesium;if(this._point=new ji(r,n),this._polyline=new Vi(r,n),this._polygon=new ki(r,n),this._core,0==e&&0==t)return this._polyline.executePolyline(i,o);if(4==e&&1==t)return this._elevationContour.executeContourMaterial(o);if(0==e&&1==t)return this._polygon.executePolygon(i,o);if(0==e&&11==t)return this._polygon.executePolygonvideo(o,i);if(1==e&&1==t)return this._box.executeBox(o);if(1==e&&2==t)return this._cone.executeCone(o);if(1==e&&3==t)return this._cone.executeCylinder(o);if(1==e&&4==t)return this._ellipsoid.executeEllipsoid(o);if(1==e&&5==t)return this._rectangle.createRectangle(i,o);if(1==e&&6==t)return this._circle.executeClircle(o);if(1==e&&7==t)return this._polygon.executeSector(o,i);if(1==e&&8==t)return this._box.executeExcavation(i,o);if(1==e&&9==t)return this._box.executeExcavation(i,o);if(1==e&&10==t)return this._circle.executeClirclews(o);if(1==e&&11==t)return this._point.executePoint(o,i);if(1==e&&12==t)return this._rectangle.createRectangledxkz(o);if(0==e&&2==t)return this._polyline.executeHorizontals(o,i);if(0==e&&3==t)return this._polygon.executePolygoncl(o,i);if(0==e&&4==t)return this._polyline.executeHorizontal(o,i);if(0==e&&10==t)return this._polyline.executePolyline1(o,i);if(0==e&&5==t)return this._polyline.executeHeightTe(o,i);if(0==e&&6==t)return this._polyline.executeAnge(o,i);if(0==e&&9==t)return this._polyline.executeAngeSd(o,i);if(0!=e||7!=t){if(0==e&&8==t)return this._polygon.spaceArea(i,o);if(0==e&&12==t)return this._polyline.executeAngle(o,i);if(0==e&&13==t)this._point.executePointp(o,i);else{if(2==e&&0==t)return this._polyline.executeProfile(i,o);if(2==e&&1==t)return this._polygon.executePolygonym(o);if(2==e&&2==t){let e=new ki(r,n);return e.executePolygonymsd(i,o)}if(2==e&&3==t)return this._dynamicObject.executeFlycesium(o);if(2==e&&4==t)return this._polygon.executePolygonymsdtt(i,o);if(2==e&&5==t)return this._rectangle.createRectanglelbj(i,o);if(2==e&&6==t)return this._polyline.executeProfilePro(i,o);if(3==e&&0==t)""!=i&&null!=i&&(o=new Date(i),o=n.JulianDate.fromDate(o),r.clock.currentTime=o.clone());else if(3==e&&1==t)this._viewer.animation.viewModel.faster();else if(3==e&&2==t)this._viewer.animation.viewModel.slower();else if(3==e&&3==t)this._viewer.animation.viewModel.playForwardViewModel.command();else if(3==e&&4==t)this._viewer.animation.viewModel.playReverseViewModel.command();else if(3==e&&5==t)this._viewer.animation.viewModel.pauseViewModel.command();else{if(3==e&&6==t){i=n.Cartographic.fromCartesian(i);return{lon:n.Math.toDegrees(i.longitude),lat:n.Math.toDegrees(i.latitude),hei:i.height}}3==e&&7==t&&this._scopefieldvision.executeScopefieldvision()}}}},lo.prototype.execute=function(e,t,i,o){return this._execute.execute(e,t,i,o)};var uo=Object.freeze({L_Click:"OnLButtonClk",L_DBL_Click:"OnLButtonDblClk",L_Down:"OnLButtonDown",L_Up:"OnLButtonUp",M_Click:"OnMButtonClk",M_Down:"OnMButtonDown",M_Up:"OnMButtonUp",R_Click:"OnRButtonClk",R_Down:"OnRButtonDown",R_Up:"OnRButtonUp",Move:"OnFrame",Wheel:"OnMouseWheel"});function co(e,t={}){this._viewer=e,this.radius=this.defaultValue(t.radius,50),this.alpha=this.defaultValue(t.alpha,1),this.rectangleHeight=t.height,this.minRadius=this.defaultValue(t.minRadius,1),this.maxRadius=this.defaultValue(t.maxRadius,50),this.flyTo=this.defaultValue(t.flyTo,!0),this.datas=[],t.dynamic&&this.dynamicAdjust(!0)}function ho(e,t={}){this._viewer=e,this.radius=this.defaultValue(t.radius,50),this.minRadius=this.defaultValue(t.minRadius,1),this.maxRadius=this.defaultValue(t.maxRadius,50),this.blur=this.defaultValue(t.blur,.85),this.alpha=this.defaultValue(t.alpha,1),this.rectangleHeight=t.height,this.is3D=t.type&&-1<t.type.indexOf("3D"),this.is3D&&(this._3DOption={width:t.TIN_X||200,height:t.TIN_Y||200,grid:this.defaultValue(t.showTIN,!1),scale:this.defaultValue(t.colorScale,1),z:this.defaultValue(t.minHeight,100)}),this.minOpacity=this.defaultValue(t.minOpacity,.1),this.maxOpacity=this.defaultValue(t.maxOpacity,.8),this.gradient=this.defaultValue(t.gradient,{".3":"blue",".5":"green",".7":"yellow",".95":"red"}),this.flyTo=this.defaultValue(t.flyTo,!0),t.dynamic&&!this.is3D&&this.dynamicAdjust(!0),this._core=new V,this.tooltip=this._core.CreateTooltip(),t.tooltip&&this.showTooltip(!0)}function mo(e,t={}){this.sgworld=e,this.contourUniforms=void 0,this.shadingUniforms=void 0,this.min={elevation:10,slope:0},this.max={elevation:2e3,slope:70},this.width=t.width||2,this.spacing=t.spacing||150,this.tf=!1,this.contourColor=t.contourColor||"#ff0000",this.type="none",this.Contour=void 0,this.startColor=t.startColor||"#0055ff",this.endColor=t.endColor||"#ff0000",this.colorArr=this.sgworld.Core.gradientColor(this.startColor,this.endColor,7),this.changeSlopeColor=void 0!==t.changeSlopeColor&&t.changeSlopeColor}co.prototype.defaultValue=function(e,t){return Cesium.defaultValue(e,t)},co.prototype.create=function(e){this.setData(e),this.flyTo&&this.flyToBounding()},co.prototype.setData=function(e){let o=1e3,r=-1e3,n=1e3,a=-1e3,s=-1/0,l=1/0;e.forEach(e=>{var t=e.x,i=e.y;o=Math.min(t,o),n=Math.min(i,n),r=Math.max(t,r),a=Math.max(i,a),s=Math.max(e.value,s),l=Math.min(e.value,l)});var t=r-o,i=a-n;let u={xMin:o-t/10,yMin:n-i/10,xMax:r+t/10,yMax:a+i/10},c;if(this._heatmap)c=this._heatmap.canvas,this._heatmap.clear();else{c=document.createElement("canvas"),document.body.appendChild(c),c.width=1e3,c.height=parseInt(1e3/(u.xMax-u.xMin)*(u.yMax-u.yMin));try{this._heatmap=createWebGLHeatmap({canvas:c,intensityToAlpha:!0})}catch(e){console.error(e)}}this.datas=[];let h=s-l;e.forEach(e=>{var t=(e.x-u.xMin)/(u.xMax-u.xMin)*c.clientWidth,i=(-(e.y-u.yMin)/(u.yMax-u.yMin)+1)*c.clientHeight;this.datas.push({x:t,y:i,size:this.radius,intensity:(e.value-l)/h})}),this._heatmap.addPoints(this.datas),this._heatmap.adjustSize(),this._heatmap.update(),this._heatmap.display(),this.drawHeatmapRect(c,u),this.rectangle=Cesium.Rectangle.fromDegrees(u.xMin,u.yMin,u.xMax,u.yMax);e=Cesium.BoundingSphere.fromRectangle3D(this.rectangle);this.boundingRadius=e.radius},co.prototype.flyToBounding=function(){this._viewer.camera.flyTo({destination:this.rectangle})},co.prototype.drawHeatmapRect=function(e,t){this._worldRectangle&&this._viewer.scene.primitives.remove(this._worldRectangle);e=this.convertCanvasToImage(e);let i=void 0===this.rectangleHeight?Cesium.GroundPrimitive:Cesium.Primitive;this._worldRectangle=this._viewer.scene.primitives.add(new i({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleGeometry({rectangle:Cesium.Rectangle.fromDegrees(t.xMin,t.yMin,t.xMax,t.yMax),vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,height:this.rectangleHeight})}),appearance:new Cesium.EllipsoidSurfaceAppearance({aboveGround:!1,material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:e.src}}})})})),this.setAlpha(0),setTimeout(()=>{this.setAlpha(this.alpha)},100)},co.prototype.destroy=function(){this.dynamicAdjust(!1),this._viewer.scene.primitives.remove(this._worldRectangle),this._heatmap.clear(),this._heatmap.canvas.remove()},co.prototype.dynamicAdjust=function(e){e?this._viewer.clock.onTick.addEventListener(this.dynamicAdjustEvent,this):this._viewer.clock.onTick.removeEventListener(this.dynamicAdjustEvent,this)},co.prototype.dynamicAdjustEvent=function(){if(this._heatmap&&this._viewer){var t=this._viewer.camera.positionCartographic;let e=(t.height-this._viewer.scene.globe.getHeight(t))/this.boundingRadius*this.maxRadius;e=e.toFixed(1),e>this.maxRadius&&(e=this.maxRadius),e<this.minRadius&&(e=this.minRadius),e!==this.radius&&e<=this.maxRadius&&e>=this.minRadius&&this.changeRadius(e)}},co.prototype.updateHeatmap=function(){this._heatmap.adjustSize(),this._heatmap.update(),this._heatmap.display();var e=this.convertCanvasToImage(this._heatmap.canvas);this._worldRectangle.appearance.material.uniforms.image=e.src},co.prototype.multiply=function(e){this._heatmap.multiply(e),this.updateHeatmap()},co.prototype.changeRadius=function(t){this.radius=t,this.datas.forEach(e=>{e.size=t}),this._heatmap.clear(),this._heatmap.addPoints(this.datas),this.updateHeatmap()},co.prototype.clamp=function(e,t){this._heatmap.clamp(e,t),this.updateHeatmap()},co.prototype.blur=function(){this._heatmap.blur(),this.updateHeatmap()},co.prototype.show=function(e){this._worldRectangle&&(this._worldRectangle.show=e)},co.prototype.setAlpha=function(e){this._worldRectangle&&(this._worldRectangle.appearance.material.uniforms.color.alpha=e)},co.prototype.convertCanvasToImage=function(e){var t=new Image;return t.src=e.toDataURL("image/png"),t},ho.prototype.defaultValue=function(e,t){return Cesium.defaultValue(e,t)},ho.prototype.create=function(e){this.setData(e),this.flyTo&&this.flyToBounding()},ho.prototype.setData=function(e){let o=1e3,r=-1e3,n=1e3,a=-1e3,s=-1/0,l=1/0;e.forEach(function(e){var t=e.x,i=e.y;o=Math.min(t,o),n=Math.min(i,n),r=Math.max(t,r),a=Math.max(i,a),s=Math.max(e.value,s),l=Math.min(e.value,l)});var t=r-o,i=a-n;let u={xMin:o-t/10,yMin:n-i/10,xMax:r+t/10,yMax:a+i/10},c=parseInt(1e3/(u.xMax-u.xMin)*(u.yMax-u.yMin));if(this.heatmapInstance)this.heatmapInstance._renderer.canvas.setAttribute("style","width:1000px;height:"+c+"px;");else{let e=document.createElement("div");e.setAttribute("style","width:1000px;height:"+c+"px;display:none;"),document.body.appendChild(e),this.heatmapInstance=h337.create({container:e,maxOpacity:this.maxOpacity,minOpacity:this.minOpacity,blur:this.blur,radius:this.radius,gradient:this.gradient})}var h=[];e.forEach(function(e){var t=(e.x-u.xMin)/(u.xMax-u.xMin)*1e3,i=(-(e.y-u.yMin)/(u.yMax-u.yMin)+1)*c,e={x:Math.round(t),y:Math.round(i),value:e.value};h.push(e)}),this.datas={max:s,min:l,data:h},this.heatmapInstance.setData(this.datas),this.heatmapcanvas=this.heatmapInstance._renderer.canvas,this.drawHeatmapRect(this.heatmapcanvas,u),this.rectangle=Cesium.Rectangle.fromDegrees(u.xMin,u.yMin,u.xMax,u.yMax);e=Cesium.BoundingSphere.fromRectangle3D(this.rectangle);this.boundingRadius=e.radius,this.extent=u},ho.prototype.flyToBounding=function(){this._viewer.camera.flyTo({destination:this.rectangle})},ho.prototype.destroy=function(){this.dynamicAdjust(!1),this._viewer.scene.primitives.remove(this._worldRectangle),this.heatmapcanvas.remove(),this.showTooltip(!1)},ho.prototype.dynamicAdjust=function(e){e?this._viewer.clock.onTick.addEventListener(this.dynamicAdjustEvent,this):this._viewer.clock.onTick.removeEventListener(this.dynamicAdjustEvent,this)},ho.prototype.dynamicAdjustEvent=function(){if(this.heatmapInstance&&this._viewer){var t=this._viewer.camera.positionCartographic;let e=(t.height-this._viewer.scene.globe.getHeight(t))/this.boundingRadius*this.maxRadius;e=e.toFixed(1),e>this.maxRadius&&(e=this.maxRadius),e<this.minRadius&&(e=this.minRadius),e!==this.radius&&e<=this.maxRadius&&e>=this.minRadius&&this.changeRadius(e)}},ho.prototype.changeRadius=async function(e){for(var t in this.radius=e,this.heatmapInstance._store._radi)for(var i in this.heatmapInstance._store._radi[t])this.heatmapInstance._store._radi[t][i]=e;this.heatmapInstance._coordinator.emit("renderall",this.heatmapInstance._store._getInternalData()),this.updateHeatmap()},ho.prototype.drawHeatmapRect=function(t,i){this._worldRectangle&&this._viewer.scene.primitives.remove(this._worldRectangle);t=this.convertCanvasToImage(t);if(this.is3D)Object.assign(this._3DOption,i),this.create3DHeatmap(t);else{let e=void 0===this.rectangleHeight?Cesium.GroundPrimitive:Cesium.Primitive;this._worldRectangle=this._viewer.scene.primitives.add(new e({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleGeometry({rectangle:Cesium.Rectangle.fromDegrees(i.xMin,i.yMin,i.xMax,i.yMax),vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,height:this.rectangleHeight})}),appearance:new Cesium.EllipsoidSurfaceAppearance({aboveGround:!0,material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:t.src}}})})})),this.setAlpha(0),setTimeout(()=>{this.setAlpha(this.alpha)},100)}},ho.prototype.create3DHeatmap=function(t){let e=document.createElement("canvas"),r=this._3DOption,n=r.width+1,a=r.height+1;e.width=n,e.height=a;let s=e.getContext("2d"),l=[],u=0;t.onload=()=>{s.drawImage(t,0,0,n,a);var i=s.getImageData(0,0,n,a);for(let t=0;t<i.height;t++)for(let e=0;e<i.width;e++){var o=4*t*i.width+4*e;l[u++]=i.data[3+o]}s.putImageData(i,0,0,0,0,i.width,i.height),r.imgData=l;var e=new Cesium.GeometryInstance({geometry:this.create3DGeometry(r)}),e=new Cesium.Primitive({geometryInstances:e,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:t.src}}})}),asynchronous:!1});this._worldRectangle=this._viewer.scene.primitives.add(e),this.setAlpha(0),setTimeout(()=>{this.setAlpha(this.alpha)},100)}},ho.prototype.create3DGeometry=function(e){var t=this.construct3DRectangle(e);return new Cesium.Geometry({attributes:{position:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t.positions}),st:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t.st})},indices:t.indexs,primitiveType:e.grid?Cesium.PrimitiveType.LINES:Cesium.PrimitiveType.TRIANGLES,boundingSphere:Cesium.BoundingSphere.fromVertices(t.positions)})},ho.prototype.construct3DRectangle=function(e){for(var t=e.imgData,i=e.xMax-e.xMin,o=e.yMax-e.yMin,r=e.width,n=e.height,a=i/r,s=o/n,l=r+1,u=n+1,c=new Float64Array(l*u*3),h=0,m=new Float32Array(l*u*2),d=0,p=new Uint16Array(r*n*2*3),g=0,_=0;_<u;_++)for(var f=0;f<l;f++){var y=e.xMin+a*f,v=e.yMin+s*_,v=Cesium.Cartesian3.fromDegrees(y,v,t[(n-_)*l+f]*e.scale+e.z);c[h++]=v.x,c[h++]=v.y,c[h++]=v.z,m[d++]=a*f/i,m[d++]=s*_/o,0!=_&&0!=f&&(p[g++]=(_-1)*l+(f-1),p[g++]=(_-1)*l+f,p[g++]=_*l+f-1,p[g++]=(_-1)*l+f,p[g++]=_*l+f,p[g++]=_*l+f-1)}return{positions:c,st:m,indexs:p}},ho.prototype.get3DShader=function(){return"uniform sampler2D image;\n            czm_material czm_getMaterial(czm_materialInput materialInput)\n            {\n                vec2 repeat = vec2(1.0,1.0);\n                czm_material material = czm_getDefaultMaterial(materialInput);\n                vec4 j_color = texture2D(image, fract(repeat * materialInput.st)).rgba; \n                material.diffuse = j_color.rgb; \n                material.alpha = j_color.a;\n                return material;\n            }\n        "},ho.prototype.showTooltip=function(e){e?(this.tooltipHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.tooltipHandler.setInputAction(e=>{var t,i=this._viewer.scene.pickPosition(e.endPosition);this.heatmapInstance&&this.extent&&i?(i=((t=this._core.toDegrees(i)).lon-this.extent.xMin)/(this.extent.xMax-this.extent.xMin)*this.heatmapcanvas.width,t=(-(t.lat-this.extent.yMin)/(this.extent.yMax-this.extent.yMin)+1)*this.heatmapcanvas.height,i<=this.heatmapcanvas.width&&0<=i&t<=this.heatmapcanvas.height&&0<=t?(t=this.heatmapInstance.getValueAt({x:Math.round(i),y:Math.round(t)}),this.tooltip.showAt(e.endPosition,t)):this.tooltip.show(!1)):this.tooltip.show(!1)},Cesium.ScreenSpaceEventType.MOUSE_MOVE)):(this.tooltip.show(!1),this.tooltipHandler&&this.tooltipHandler.destroy(),this.tooltipHandler=void 0)},ho.prototype.updateHeatmap=function(){this.heatmapcanvas=this.heatmapInstance._renderer.canvas;var e=this.convertCanvasToImage(this.heatmapcanvas);this._worldRectangle.appearance.material.uniforms.image=e.src},ho.prototype.show=function(e){this._worldRectangle&&(this._worldRectangle.show=e)},ho.prototype.setAlpha=function(e){this._worldRectangle&&(this._worldRectangle.appearance.material.uniforms.color.alpha=e)},ho.prototype.config=function(e){this.heatmapInstance.configure(e),this.updateHeatmap()},ho.prototype.convertCanvasToImage=function(e){var t=new Image;return t.src=e.toDataURL("image/png"),t},mo.prototype.render=function(){"slope"===this.type?(Cesium.ExpandBySmartEarth.displaySlopeMap=!0,this.changeSlopeColor&&this.setShopeColor()):Cesium.ExpandBySmartEarth.displaySlopeMap=!1,this.Contour=this.sgworld.Analysis.createElevationContour(this.tf,"slope"===this.type?"none":this.type,{colorArr:this.colorArr,min:this.min[this.type],max:this.max[this.type],width:this.width,spacing:this.spacing,lineColor:this.contourColor}),this.shadingUniforms=this.Contour.item.shadingUniforms,this.contourUniforms=this.Contour.item.contourUniforms},mo.prototype.setContourColor=function(e){this.contourColor=e,this.Contour&&this.Contour.setMaterialColor(this.contourColor)},mo.prototype.setShopeColor=function(){let i=[],o=[0,6,17,31,45,70,90];this.colorArr.forEach((e,t)=>{i.unshift({val:100*Math.cos(Cesium.Math.toRadians(o[t])),color:e})}),Cesium.ExpandBySmartEarth.SlopeMapPallete=i,Cesium.ExpandBySmartEarth.isSlopeDirty=!0},mo.prototype.setWidth=function(e){this.width=e,this.Contour&&this.Contour.setWidth(this.width)},mo.prototype.setSpacing=function(e){this.spacing=e,this.Contour&&this.Contour.setSpacing(this.spacing)},mo.prototype.setStartColor=function(e){this.startColor=e,this.colorArr=this.sgworld.Core.gradientColor(this.startColor,this.endColor,7),this.render()},mo.prototype.setEndColor=function(e){this.endColor=e,this.colorArr=this.sgworld.Core.gradientColor(this.startColor,this.endColor,7),this.render()},mo.prototype.setMin=function(e){this.min[this.type]=e,"elevation"===this.type?this.shadingUniforms.minimumHeight=this.min[this.type]:this.render()},mo.prototype.setMax=function(e){this.max[this.type]=e,"elevation"===this.type?this.shadingUniforms.maximumHeight=this.max[this.type]:this.render()},mo.prototype.reset=function(){this.contourColor="#ff0000",this.startColor="#0055ff",this.endColor="#ff0000",this.colorArr=this.sgworld.Core.gradientColor(this.startColor,this.endColor,7),this.render()};var po={version:"1.0.0"},go="doublearrow",_o=.25,fo=.3,yo=.85,vo=.15,Co={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},wo={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};po.algorithm={},po.algorithm.doubleArrow=function(e){this.connPoint=null;var t={controlPoint:this.tempPoint4=null,polygonalPoint:null};if(!((n=(this.points=e).length)<2)){if(2==n)return e;var i=this.points[0],o=this.points[1],r=this.points[2],n=e.length;this.tempPoint4=3==n?po.algorithm.getTempPoint4(i,o,r):this.points[3],this.connPoint=3==n||4==n?bo.PlotUtils.mid(i,o):this.points[4];var a=bo.PlotUtils.isClockWise(i,o,r)?(h=po.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),po.algorithm.getArrowPoints(this.connPoint,o,r,!0)):(h=po.algorithm.getArrowPoints(o,this.connPoint,r,!1),po.algorithm.getArrowPoints(this.connPoint,i,this.tempPoint4,!0)),s=h.length,l=(s-5)/2,u=h.slice(0,l),c=h.slice(l,5+l),e=h.slice(5+l,s),n=a.slice(0,l),h=a.slice(l,5+l),s=a.slice(5+l,s),n=bo.PlotUtils.getBezierPoints(n),u=bo.PlotUtils.getBezierPoints(s.concat(u.slice(1))),e=bo.PlotUtils.getBezierPoints(e),e=n.concat(h,u,c,e),e=po.algorithm.array2Dto1D(e);t.controlPoint=[i,o,r,this.tempPoint4,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(e)}return t},po.algorithm.threeArrow=function(e){this.connPoint=null,this.tempPoint4=null;var t={controlPoint:this.tempPoint5=null,polygonalPoint:null};if(2<=(c=(this.points=e).length)){if(2==c)return e;var i=this.points[0],o=this.points[1],r=this.points[2];3==(c=e.length)?(this.tempPoint4=po.algorithm.getTempPoint4(i,o,r),this.tempPoint5=bo.PlotUtils.mid(r,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=c<6?bo.PlotUtils.mid(i,o):this.points[5];var n=bo.PlotUtils.isClockWise(i,o,r)?(h=po.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),po.algorithm.getArrowPoints(this.connPoint,o,r,!0)):(h=po.algorithm.getArrowPoints(o,this.connPoint,r,!1),po.algorithm.getArrowPoints(this.connPoint,i,this.tempPoint4,!0)),a=h.length,s=(a-5)/2,l=h.slice(0,s),u=h.slice(s,5+s),e=h.slice(5+s,a),c=n.slice(0,s),h=n.slice(s,5+s),a=n.slice(5+s,a),c=bo.PlotUtils.getBezierPoints(c),l=bo.PlotUtils.getBezierPoints(a.concat(l.slice(1))),e=bo.PlotUtils.getBezierPoints(e),e=c.concat(h,l,u,e),e=po.algorithm.array2Dto1D(e);t.controlPoint=[i,o,r,this.tempPoint4,this.tempPoint5,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(e)}return t},po.algorithm.array2Dto1D=function(e){var t=[];return e.forEach(function(e){t.push(e[0]),t.push(e[1])}),t},po.algorithm.getArrowPoints=function(e,t,i,o){this.type=go,this.headHeightFactor=_o,this.headWidthFactor=fo,this.neckHeightFactor=yo,this.neckWidthFactor=vo;var r=bo.PlotUtils.mid(e,t),n=bo.PlotUtils.distance(r,i),a=bo.PlotUtils.getThirdPoint(i,r,0,.3*n,!0),s=bo.PlotUtils.getThirdPoint(i,r,0,.5*n,!0),a=[r,a=bo.PlotUtils.getThirdPoint(r,a,bo.Constants.HALF_PI,n/5,o),s=bo.PlotUtils.getThirdPoint(r,s,bo.Constants.HALF_PI,n/4,o),i],r=po.algorithm.getArrowHeadPoints(a,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),n=r[0],o=r[4],s=bo.PlotUtils.distance(e,t)/bo.PlotUtils.getBaseLength(a)/2,i=po.algorithm.getArrowBodyPoints(a,n,o,s),a=i.length,s=i.slice(0,a/2),a=i.slice(a/2,a);return s.push(n),a.push(o),(s=s.reverse()).push(t),(a=a.reverse()).push(e),s.reverse().concat(r,a)},po.algorithm.getArrowHeadPoints=function(e,t,i){this.type=go,this.headHeightFactor=_o,this.headWidthFactor=fo,this.neckHeightFactor=yo,this.neckWidthFactor=vo;var o=bo.PlotUtils.getBaseLength(e)*this.headHeightFactor,r=e[e.length-1],n=(bo.PlotUtils.distance(t,i),o*this.headWidthFactor),t=o*this.neckWidthFactor,i=o*this.neckHeightFactor,o=bo.PlotUtils.getThirdPoint(e[e.length-2],r,0,o,!0),e=bo.PlotUtils.getThirdPoint(e[e.length-2],r,0,i,!0),i=bo.PlotUtils.getThirdPoint(r,o,bo.Constants.HALF_PI,n,!1),n=bo.PlotUtils.getThirdPoint(r,o,bo.Constants.HALF_PI,n,!0);return[bo.PlotUtils.getThirdPoint(r,e,bo.Constants.HALF_PI,t,!1),i,r,n,bo.PlotUtils.getThirdPoint(r,e,bo.Constants.HALF_PI,t,!0)]},po.algorithm.getArrowBodyPoints=function(e,t,i,o){for(var r=bo.PlotUtils.wholeDistance(e),n=bo.PlotUtils.getBaseLength(e)*o,a=(n-bo.PlotUtils.distance(t,i))/2,s=0,l=[],u=[],c=1;c<e.length-1;c++){var h=bo.PlotUtils.getAngleOfThreePoints(e[c-1],e[c],e[c+1])/2,m=(n/2-(s+=bo.PlotUtils.distance(e[c-1],e[c]))/r*a)/Math.sin(h),d=bo.PlotUtils.getThirdPoint(e[c-1],e[c],Math.PI-h,m,!0),m=bo.PlotUtils.getThirdPoint(e[c-1],e[c],h,m,!1);l.push(d),u.push(m)}return l.concat(u)},po.algorithm.getTempPoint4=function(e,t,i){var o,r,n=bo.PlotUtils.mid(e,t),t=bo.PlotUtils.distance(n,i),i=bo.PlotUtils.getAngleOfThreePoints(e,n,i),a=i<bo.Constants.HALF_PI?(o=t*Math.sin(i),a=t*Math.cos(i),r=bo.PlotUtils.getThirdPoint(e,n,bo.Constants.HALF_PI,o,!1),bo.PlotUtils.getThirdPoint(n,r,bo.Constants.HALF_PI,a,!0)):i>=bo.Constants.HALF_PI&&i<Math.PI?(o=t*Math.sin(Math.PI-i),a=t*Math.cos(Math.PI-i),r=bo.PlotUtils.getThirdPoint(e,n,bo.Constants.HALF_PI,o,!1),bo.PlotUtils.getThirdPoint(n,r,bo.Constants.HALF_PI,a,!1)):i>=Math.PI&&i<1.5*Math.PI?(o=t*Math.sin(i-Math.PI),a=t*Math.cos(i-Math.PI),r=bo.PlotUtils.getThirdPoint(e,n,bo.Constants.HALF_PI,o,!0),bo.PlotUtils.getThirdPoint(n,r,bo.Constants.HALF_PI,a,!0)):(o=t*Math.sin(2*Math.PI-i),a=t*Math.cos(2*Math.PI-i),r=bo.PlotUtils.getThirdPoint(e,n,bo.Constants.HALF_PI,o,!0),bo.PlotUtils.getThirdPoint(n,r,bo.Constants.HALF_PI,a,!1));return a},po.algorithm.tailedAttackArrow=function(e){e=po.algorithm.dereplication(e),this.tailWidthFactor=Co.tailWidthFactor,this.swallowTailFactor=Co.swallowTailFactor,this.swallowTailPnt=Co.swallowTailPnt;var t={controlPoint:null,polygonalPoint:null};if(!((c=(t.controlPoint=e).length)<2)){if(2==e.length)return t.polygonalPoint=e,t;var i=e,o=i[0],r=i[1];bo.PlotUtils.isClockWise(i[0],i[1],i[2])&&(o=i[1],r=i[0]);var n=[bo.PlotUtils.mid(o,r)].concat(i.slice(2)),a=po.algorithm.getAttackArrowHeadPoints(n,o,r,Co),s=a[0],l=a[4],u=bo.PlotUtils.distance(o,r),e=bo.PlotUtils.getBaseLength(n),i=e*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=bo.PlotUtils.getThirdPoint(n[1],n[0],0,i,!0);var e=po.algorithm.getAttackArrowBodyPoints(n,s,l,u/e),c=e.length,o=[o].concat(e.slice(0,c/2));o.push(s);e=[r].concat(e.slice(c/2,c)),c=[];e.push(l),o=bo.PlotUtils.getQBSplinePoints(o),e=bo.PlotUtils.getQBSplinePoints(e),c=po.algorithm.array2Dto1D(o.concat(a,e.reverse(),[this.swallowTailPnt,o[0]])),t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(c)}return t},po.algorithm.getAttackArrowHeadPoints=function(e,t,i,o){this.headHeightFactor=o.headHeightFactor,this.headTailFactor=o.headTailFactor,this.headWidthFactor=o.headWidthFactor,this.neckWidthFactor=o.neckWidthFactor,this.neckHeightFactor=o.neckHeightFactor;var r=(n=bo.PlotUtils.getBaseLength(e))*this.headHeightFactor,o=e[e.length-1],n=bo.PlotUtils.distance(o,e[e.length-2]),t=bo.PlotUtils.distance(t,i),i=(r=r>t*this.headTailFactor?t*this.headTailFactor:r)*this.headWidthFactor,t=r*this.neckWidthFactor,n=(r=n<r?n:r)*this.neckHeightFactor,r=bo.PlotUtils.getThirdPoint(e[e.length-2],o,0,r,!0),e=bo.PlotUtils.getThirdPoint(e[e.length-2],o,0,n,!0),n=bo.PlotUtils.getThirdPoint(o,r,bo.Constants.HALF_PI,i,!1),i=bo.PlotUtils.getThirdPoint(o,r,bo.Constants.HALF_PI,i,!0);return[bo.PlotUtils.getThirdPoint(o,e,bo.Constants.HALF_PI,t,!1),n,o,i,bo.PlotUtils.getThirdPoint(o,e,bo.Constants.HALF_PI,t,!0)]},po.algorithm.getAttackArrowBodyPoints=function(e,t,i,o){for(var r=bo.PlotUtils.wholeDistance(e),n=bo.PlotUtils.getBaseLength(e)*o,a=(n-bo.PlotUtils.distance(t,i))/2,s=0,l=[],u=[],c=1;c<e.length-1;c++){var h=bo.PlotUtils.getAngleOfThreePoints(e[c-1],e[c],e[c+1])/2,m=(n/2-(s+=bo.PlotUtils.distance(e[c-1],e[c]))/r*a)/Math.sin(h),d=bo.PlotUtils.getThirdPoint(e[c-1],e[c],Math.PI-h,m,!0),m=bo.PlotUtils.getThirdPoint(e[c-1],e[c],h,m,!1);l.push(d),u.push(m)}return l.concat(u)},po.algorithm.dereplication=function(e){var t=e[e.length-1],i=!1,o=[],o=e.filter(function(e){return e[0]!=t[0]&&e[1]!=t[1]?e:void(i=!0)});return i&&o.push(t),o},po.algorithm.fineArrow=function(t,o){if(!(t.length<2||o.length<2)){var m=wo.tailWidthFactor,_=wo.neckWidthFactor,f=wo.headWidthFactor,y=wo.headAngle,v=wo.neckAngle,C=[];return C[0]=t,C[1]=o,e=C[0],r=C[1],n=bo.PlotUtils.getBaseLength(C),g=n*m,i=n*_,s=n*f,a=bo.PlotUtils.getThirdPoint(r,e,bo.Constants.HALF_PI,g,!0),l=bo.PlotUtils.getThirdPoint(r,e,bo.Constants.HALF_PI,g,!1),u=bo.PlotUtils.getThirdPoint(e,r,y,s,!1),c=bo.PlotUtils.getThirdPoint(e,r,y,s,!0),p=bo.PlotUtils.getThirdPoint(e,r,v,i,!1),h=bo.PlotUtils.getThirdPoint(e,r,v,i,!0),d=[],d.push(a[0],a[1],p[0],p[1],u[0],u[1],r[0],r[1],c[0],c[1],h[0],h[1],l[0],l[1],e[0],e[1]),Cesium.Cartesian3.fromDegreesArray(d)}};var bo={version:"1.0.0"};function To(e,t,i,o,r,n,a){var s=new Cesium.Credit("WMTS");r=Cesium.defaultValue(r,{}),this._7=new Cesium.GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1}),this._3=256,this._4=256,this._10=Cesium.defaultValue(r.fileExtension,"jpg"),this._9=r.proxy,this._12=r.tileDiscardPolicy,this._2=i,this._1=o,this._8=new Cesium.Rectangle(0-Math.PI,0-Math.PI/2,Math.PI,Math.PI/2),this._5=new Cesium.Rectangle(0-Math.PI,0-Math.PI/2,Math.PI,Math.PI/2),this._6=!0,this.baseurl=e,this.needaddone=t,n&&(this._0=n,this.baseurl2=a);s=Cesium.defaultValue(r.credit,s);"string"==typeof s&&(s=new Cesium.Credit(s)),this._11=s}function So(e,t,i,o){this._extractAttributes=e,this._featureName=t||"featureMember",this._xy=o,this._gmlns=i||"http://www.opengis.net/gml",this._regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g}}function Po(){this._quadtree=void 0,this._loadTileEvent=new Cesium.Event,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE),this._tileCache=[],this._primitivesWaitingToBeAddedToTheScene=[],this._pauseStreaming=!1,this._numTilesInLevel=[],this.STREAM_SPEED_IMIDIATE=0,this.STREAM_SPEED_FAST=1,this.STREAM_SPEED_NORMAL=2,this.STREAM_SPEED_SLOW=3,this._streamSpeed=this.STREAM_SPEED_NORMAL,Po.prototype.ready||Object.defineProperties(Po.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},loadTileEvent:{get:function(){return this._loadTileEvent}},pauseStreaming:{get:function(){return this._pauseStreaming},set:function(e){this._pauseStreaming=e}},streamSpeed:{get:function(){return this._streamSpeed},set:function(e){this._streamSpeed=e}},bestLevelAvailable:{get:function(){for(var e=0,t=0;t<22;t++)null!=this._numTilesInLevel[t]&&0<this._numTilesInLevel[t]&&e<t&&(e=t);return e}}})}function Eo(i,e,o){$.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection){t=t,e=Ro.indexOf(t);return t._parentCollection._primitiveOld=o,-1!==e?(i.scene.primitives.remove(Ro[e]._parentCollection),Ro[e]=t):Ro.push(t),!1}})}function xo(e,t,i){e.scene.primitives.remove(i),t._onDestroyTilePrimitive=function(){e.scene.primitives.remove(i),this._onDestroyTilePrimitive=void 0}}function Io(e,t,i,o){Cesium.when.all(t,function(){e.scene.primitives.remove(o)}),i._onDestroyTilePrimitive=function(){e.scene.primitives.remove(o),this._onDestroyTilePrimitive=void 0}}function Do(e,t,i){Io(e,$.map(t._primitives,function(e){return e.readyPromise}),t,i)}function Lo(e,t,i){Io(e,$.map(t._primitives[0]._primitives,function(e){return e.readyPromise}),t,i)}function Mo(e,t,i){e.scene.primitives.remove(i)}function Ao(e,t,i){Io(e,[t.readyPromise],t,i)}bo.PlotUtils={},bo.PlotUtils.distance=function(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))},bo.PlotUtils.wholeDistance=function(e){for(var t=0,i=0;i<e.length-1;i++)t+=bo.PlotUtils.distance(e[i],e[i+1]);return t},bo.PlotUtils.getBaseLength=function(e){return Math.pow(bo.PlotUtils.wholeDistance(e),.99)},bo.PlotUtils.mid=function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]},bo.PlotUtils.getCircleCenterOfThreePoints=function(e,t,i){var o=[(e[0]+t[0])/2,(e[1]+t[1])/2],r=[o[0]-e[1]+t[1],o[1]+e[0]-t[0]],t=[(e[0]+i[0])/2,(e[1]+i[1])/2],i=[t[0]-e[1]+i[1],t[1]+e[0]-i[0]];return bo.PlotUtils.getIntersectPoint(o,r,t,i)},bo.PlotUtils.getIntersectPoint=function(e,t,i,o){if(e[1]==t[1]){var r=(o[0]-i[0])/(o[1]-i[1]),n=r*(e[1]-i[1])+i[0],a=e[1];return[n,a]}if(i[1]!=o[1])return s=(t[0]-e[0])/(t[1]-e[1]),r=(o[0]-i[0])/(o[1]-i[1]),[n=s*(a=(s*e[1]-e[0]-r*i[1]+i[0])/(s-r))-s*e[1]+e[0],a];var s=(t[0]-e[0])/(t[1]-e[1]);return[n=s*(i[1]-e[1])+e[0],a=i[1]]},bo.PlotUtils.getAzimuth=function(e,t){var i,o=Math.asin(Math.abs(t[1]-e[1])/bo.PlotUtils.distance(e,t));return t[1]>=e[1]&&t[0]>=e[0]?i=o+Math.PI:t[1]>=e[1]&&t[0]<e[0]?i=bo.Constants.TWO_PI-o:t[1]<e[1]&&t[0]<e[0]?i=o:t[1]<e[1]&&t[0]>=e[0]&&(i=Math.PI-o),i},bo.PlotUtils.getAngleOfThreePoints=function(e,t,i){i=bo.PlotUtils.getAzimuth(t,e)-bo.PlotUtils.getAzimuth(t,i);return i<0?i+bo.Constants.TWO_PI:i},bo.PlotUtils.isClockWise=function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},bo.PlotUtils.getPointOnLine=function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},bo.PlotUtils.getCubicValue=function(e,t,i,o,r){var n=1-(e=Math.max(Math.min(e,1),0)),a=e*e,s=a*e,l=n*n,u=l*n;return[u*t[0]+3*l*e*i[0]+3*n*a*o[0]+s*r[0],u*t[1]+3*l*e*i[1]+3*n*a*o[1]+s*r[1]]},bo.PlotUtils.getThirdPoint=function(e,t,i,o,r){e=bo.PlotUtils.getAzimuth(e,t),e=r?e+i:e-i,i=o*Math.cos(e),e=o*Math.sin(e);return[t[0]+i,t[1]+e]},bo.PlotUtils.getArcPoints=function(e,t,i,o){for(var r=[],n=(n=o-i)<0?n+bo.Constants.TWO_PI:n,a=0;a<=bo.Constants.FITTING_COUNT;a++){var s=i+n*a/bo.Constants.FITTING_COUNT,l=e[0]+t*Math.cos(s),s=e[1]+t*Math.sin(s);r.push([l,s])}return r},bo.PlotUtils.getBisectorNormals=function(e,t,i,o){var r,n,a=bo.PlotUtils.getNormal(t,i,o),s=Math.sqrt(a[0]*a[0]+a[1]*a[1]),l=a[0]/s,u=a[1]/s,c=bo.PlotUtils.distance(t,i),a=bo.PlotUtils.distance(i,o),i=s>bo.Constants.ZERO_TOLERANCE?bo.PlotUtils.isClockWise(t,i,o)?(r=[i[0]-(n=e*c)*u,i[1]+n*l],[i[0]+(n=e*a)*u,i[1]-n*l]):(r=[i[0]+(n=e*c)*u,i[1]-n*l],[i[0]-(n=e*a)*u,i[1]+n*l]):(r=[i[0]+e*(t[0]-i[0]),i[1]+e*(t[1]-i[1])],[i[0]+e*(o[0]-i[0]),i[1]+e*(o[1]-i[1])]);return[r,i]},bo.PlotUtils.getNormal=function(e,t,i){var o=e[0]-t[0],r=e[1]-t[1],e=Math.sqrt(o*o+r*r);o/=e,r/=e;e=i[0]-t[0],i=i[1]-t[1],t=Math.sqrt(e*e+i*i);return[o+(e/=t),r+(i/=t)]},bo.PlotUtils.getCurvePoints=function(e,t){for(var i=[bo.PlotUtils.getLeftMostControlPoint(t)],o=0;o<t.length-2;o++)var r=t[o],n=t[o+1],a=t[o+2],a=bo.PlotUtils.getBisectorNormals(e,r,n,a),i=i.concat(a);var s=bo.PlotUtils.getRightMostControlPoint(t);i.push(s);for(var l=[],o=0;o<t.length-1;o++){r=t[o],n=t[o+1],l.push(r);for(e=0;e<bo.Constants.FITTING_COUNT;e++){var u=bo.PlotUtils.getCubicValue(e/bo.Constants.FITTING_COUNT,r,i[2*o],i[2*o+1],n);l.push(u)}l.push(n)}return l},bo.PlotUtils.getLeftMostControlPoint=function(e){var i,o,r,n=e[0],a=e[1],s=e[2],l=bo.PlotUtils.getBisectorNormals(0,n,a,s)[0],u=bo.PlotUtils.getNormal(n,a,s),n=Math.sqrt(u[0]*u[0]+u[1]*u[1])>bo.Constants.ZERO_TOLERANCE?(i=bo.PlotUtils.mid(n,a),r=n[0]-i[0],o=n[1]-i[1],e=bo.PlotUtils.distance(n,a),s=l[0]-i[0],u=l[1]-i[1],r=i[0]+((e=-(l=2/e)*o)*e-(o=l*r)*o)*s+(l=2*e*o)*u,i[1]+l*s+(o*o-e*e)*u):(r=n[0]+t*(a[0]-n[0]),n[1]+t*(a[1]-n[1]));return[r,n]},bo.PlotUtils.getRightMostControlPoint=function(e){var i,o,r=e.length,n=e[r-3],a=e[r-2],s=e[r-1],l=bo.PlotUtils.getBisectorNormals(0,n,a,s)[1],u=bo.PlotUtils.getNormal(n,a,s),s=Math.sqrt(u[0]*u[0]+u[1]*u[1])>bo.Constants.ZERO_TOLERANCE?(i=bo.PlotUtils.mid(a,s),o=s[0]-i[0],e=s[1]-i[1],r=bo.PlotUtils.distance(a,s),n=l[0]-i[0],u=l[1]-i[1],o=i[0]+((r=-(l=2/r)*e)*r-(e=l*o)*e)*n+(l=2*r*e)*u,i[1]+l*n+(e*e-r*r)*u):(o=s[0]+t*(a[0]-s[0]),s[1]+t*(a[1]-s[1]));return[o,s]},bo.PlotUtils.getBezierPoints=function(e){if(e.length<=2)return e;for(var t=[],i=e.length-1,o=0;o<=1;o+=.01){for(var r=0,n=0,a=0;a<=i;a++){var s=bo.PlotUtils.getBinomialFactor(i,a),l=Math.pow(o,a),u=Math.pow(1-o,i-a);r+=s*l*u*e[a][0],n+=s*l*u*e[a][1]}t.push([r,n])}return t.push(e[i]),t},bo.PlotUtils.getBinomialFactor=function(e,t){return bo.PlotUtils.getFactorial(e)/(bo.PlotUtils.getFactorial(t)*bo.PlotUtils.getFactorial(e-t))},bo.PlotUtils.getFactorial=function(e){if(e<=1)return 1;if(2==e)return 2;if(3==e)return 6;if(4==e)return 24;if(5==e)return 120;for(var t=1,i=1;i<=e;i++)t*=i;return t},bo.PlotUtils.getQBSplinePoints=function(e){if(e.length<=2)return e;var t=[],i=e.length-2-1;t.push(e[0]);for(var o=0;o<=i;o++)for(var r=0;r<=1;r+=.05){for(var n=0,a=0,s=0;s<=2;s++){var l=bo.PlotUtils.getQuadricBSplineFactor(s,r);n+=l*e[o+s][0],a+=l*e[o+s][1]}t.push([n,a])}return t.push(e[e.length-1]),t},bo.PlotUtils.getQuadricBSplineFactor=function(e,t){return 0==e?Math.pow(t-1,2)/2:1==e?(-2*Math.pow(t,2)+2*t+1)/2:2==e?Math.pow(t,2)/2:0},bo.Constants={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},Object.defineProperties(To.prototype,{tileWidth:{get:function(){return this._3}},tileHeight:{get:function(){return this._4}},defaultAlpha:{get:function(){return 1}},hasAlphaChannel:{get:function(){return!0}},maximumLevel:{get:function(){return this._1}},minimumLevel:{get:function(){return this._2}},tilingScheme:{get:function(){return this._7}},extent:{get:function(){return this._8}},rectangle:{get:function(){return this._5}},ready:{get:function(){return this._6}},minimumTerrainLevel:{get:function(){return 0}},maximumTerrainLevel:{get:function(){return 17}}}),To.prototype.requestImage=function(e,t,i){this.needaddone&&(e+=1,t+=1,i+=1);var o=this.baseurl,e=(o=this._0&&i>this._0?this.baseurl2:o).replace("{x}",e);return e=(e=(e=e.replace("{l}",t%8)).replace("{y}",t)).replace("{z}",i+1),Cesium.ImageryProvider.loadImage(this,e)},Object.defineProperties(So.prototype,{featureName:{get:function(){return this._featureName},set:function(e){this._featureName=e}},extractAttributes:{get:function(){return this._extractAttributes},set:function(e){this._extractAttributes=e}},xy:{get:function(){return this._xy}}}),So.prototype.getElementsByTagNameNS=function(e,t,i){var o=[];if(e.getElementsByTagNameNS)o=e.getElementsByTagNameNS(t,i);else for(var r,n,a=e.getElementsByTagName("*"),s=0,l=a.length;s<l;++s)n=(r=a[s]).prefix?r.prefix+":"+i:i,"*"!=i&&n!=r.nodeName||"*"!=t&&t!=r.namespaceURI||o.push(r);return o},So.prototype.read=function(e){for(var t=this.getElementsByTagNameNS(e.documentElement,this._gmlns,this.featureName),i=[],o=0;o<t.length;o++){var r=this.parseFeature(t[o]);r&&i.push(r)}return i},So.prototype.parseFeature=function(e){for(var t,i,o,r,n=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope"],a=0;a<n.length;++a)if(0<(i=this.getElementsByTagNameNS(e,this._gmlns,t=n[a])).length){(r=this.parseGeometry[t.toLowerCase()])?o=r.apply(this,[i[0]]):console.log("unsupportedGeometryType:"+t);break}for(var s,l=this.getElementsByTagNameNS(e,this._gmlns,"Box"),a=0;a<l.length;++a){var u=l[a],c=this.parseGeometry.box.apply(this,[u]),u=u.parentNode;"boundedBy"===(u.localName||u.nodeName.split(":").pop())?s=c:o=c.toGeometry()}this.extractAttributes&&(h=this.parseAttributes(e));var h={geometryType:t.toLowerCase(),positions:o,attributes:h};h.bounds=s;for(var m,d=e.firstChild;d&&(1!=d.nodeType||!(m=d.getAttribute("fid")||d.getAttribute("id")));)d=d.nextSibling;return h.fid=m,h},So.prototype.parseGeometry={point:function(e){var t=[],i=this.getElementsByTagNameNS(e,this._gmlns,"pos");return 0==(t=0<i.length?i[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace):t).length&&(0<(i=this.getElementsByTagNameNS(e,this._gmlns,"coordinates")).length&&(t=i[0].firstChild.nodeValue.replace(this._regExes.removeSpace,"").split(","))),0==t.length&&0<(i=this.getElementsByTagNameNS(e,this._gmlns,"coord")).length&&(e=this.getElementsByTagNameNS(i[0],this._gmlns,"X"),i=this.getElementsByTagNameNS(i[0],this._gmlns,"Y"),0<e.length&&0<i.length&&(t=[e[0].firstChild.nodeValue,i[0].firstChild.nodeValue])),2==t.length&&(t[2]=null),this.xy?[parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]:[parseFloat(t[1]),parseFloat(t[0]),parseFloat(t[2])]},multipoint:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"Point"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.point.apply(this,[t[r]]))&&i.push(o);return i},linestring:function(e,t){var i=[],o=[],r=this.getElementsByTagNameNS(e,this._gmlns,"posList");if(0<r.length)for(var n,a,s,i=this.getChildValue(r[0]).replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace),l=parseInt(r[0].getAttribute("dimension")),u=0;u<i.length/l;++u)s=u*l,n=parseFloat(i[s]),a=parseFloat(i[1+s]),s=2==l?null:parseFloat(i[2+s]),this.xy?o.push(n,a,s):o.push(a,n,s);if(0==i.length&&0<(r=this.getElementsByTagNameNS(e,this._gmlns,"coordinates")).length)for(var c=this.getChildValue(r[0]).replace(this._regExes.trimSpace,"").replace(this._regExes.trimComma,",").split(this._regExes.splitSpace),u=0;u<c.length;++u)2==(i=c[u].split(",")).length&&(i[2]=null),this.xy?o.push(parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])):o.push(parseFloat(i[1]),parseFloat(i[0]),parseFloat(i[2]));return o},multilinestring:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"LineString"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.linestring.apply(this,[t[r]]))&&i.push(o);return i},polygon:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"LinearRing"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.linestring.apply(this,[t[r],!0]))&&i.push(o);return i},multipolygon:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"Polygon"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.polygon.apply(this,[t[r]]))&&i.push(o);return i},envelope:function(e){var t,i,o=[],r=this.getElementsByTagNameNS(e,this._gmlns,"lowerCorner");0<r.length&&(n=[],2==(n=0<r.length?r[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace):n).length&&(n[2]=null),i=this.xy?new OpenLayers_Geometry_Point(n[0],n[1],n[2]):new OpenLayers_Geometry_Point(n[1],n[0],n[2]));var n,a,e=this.getElementsByTagNameNS(e,this._gmlns,"upperCorner");return 0<e.length&&(n=[],2==(n=0<e.length?e[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace):n).length&&(n[2]=null),a=this.xy?new OpenLayers_Geometry_Point(n[0],n[1],n[2]):new OpenLayers_Geometry_Point(n[1],n[0],n[2])),i&&a&&(o.push([i.x,i.y,null]),o.push([a.x,i.y,null]),o.push([a.x,a.y,null]),o.push([i.x,a.y,null]),o.push([i.x,i.y,null]),t=new OpenLayers_Geometry_Polygon([[o]])),t},box:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"coordinates"),i=null,e=null;if(0<t.length&&(2==(t=t[0].firstChild.nodeValue.split(" ")).length&&(i=t[0].split(","),e=t[1].split(","))),null!==i&&null!==e)return[parseFloat(i[0]),parseFloat(i[1]),null,parseFloat(e[0]),parseFloat(e[1]),null]}},So.prototype.parseAttributes=function(e){for(var t,i,o,r,n,a={},s=e.firstChild;s;){if(1==s.nodeType){for(t=s.childNodes,i=0;i<t.length;++i)1==(o=t[i]).nodeType&&(1==(r=o.childNodes).length?3!=(n=r[0]).nodeType&&4!=n.nodeType||(r=o.prefix?o.nodeName.split(":")[1]:o.nodeName,n=n.nodeValue.replace(this._regExes.trimSpace,""),a[r]=n):a[o.nodeName.split(":").pop()]=null);break}s=s.nextSibling}return a},So.prototype.getChildValue=function(e,t){var i=t||"";if(e)for(var o=e.firstChild;o;o=o.nextSibling)switch(o.nodeType){case 3:case 4:i+=o.nodeValue}return i},Po.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var Ro=[],Oo=0;Po.prototype.onPreFrame=function(e,t){if(Oo++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;0<this._primitivesWaitingToBeAddedToTheScene.length;){var i=this._primitivesWaitingToBeAddedToTheScene.pop();e.primitives.add(i)}else 0<this._primitivesWaitingToBeAddedToTheScene.length&&Oo%this.streamSpeedFactor()==0&&((i=this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds&&100<i._instanceIds.length&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),e.primitives.add(i));$.each(Ro,function(e,t){t.ready&&this.viewer.scene.primitives.remove(t._parentCollection._primitiveOld)})}},Po.prototype.updateForPick=function(e){};Math.PI;Po.prototype.placeHolder=function(e,t){t=t||Cesium.Color.fromBytes(0,255,0,255);t=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleOutlineGeometry({rectangle:e.rectangle,height:this.viewer.camera.positionCartographic.height-.99*TerraExplorer.internal.Navigate.HeightAboveGround}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0})});e.data.primitive.add(t)},Po.prototype.getTile=function(e){return this._tileCache[e]},Po.prototype.getAllTiles=function(){var e,t=[];for(e in this._tileCache)t.push(this._tileCache[e]);return t},Po.prototype.addToScene=function(e){this._primitivesWaitingToBeAddedToTheScene.push(e)},Po.prototype.removeFromScene=function(e){var t=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=t?(this._primitivesWaitingToBeAddedToTheScene[t].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(t,1)):this.viewer.scene.primitives.remove(e)},Po.prototype.replaceInScene=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else switch(e.ID!=t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),null!=e._replacmentPrimitive&&this.viewer.scene.primitives.remove(e._replacmentPrimitive),e._replacmentPrimitive=t,this.viewer.scene.primitives.add(t),t.ID.split(":")[0]){case"billboards":Eo(this.viewer,t,e);break;case"labels":xo(this.viewer,t,e);break;case"polygons":Do(this.viewer,t,e);break;case"models":Lo(this.viewer,t,e);break;case"polylines":Ao(this.viewer,t,e);break;case"points":Mo(this.viewer,0,e);break;default:console.log("Error updating layer"),this.viewer.scene.primitives.remove(e)}};var Ho={billboards:Eo,labels:xo,polygons:Do,models:Lo,polylines:Ao,points:Mo};Po.prototype.replaceInSceneNew=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=i?this._primitivesWaitingToBeAddedToTheScene[i]=t:(e.ID!==t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(t),i=t.ID.split(":")[0],(i=Ho[i])?i(t,e):(console.log("Error updating layer"),this.viewer.scene.primitives.remove(e)))};var Vo=!(Po.prototype.update=function(e){this._quadtree.beginFrame(e),this._quadtree.render(e),this._quadtree.endFrame(e)});function ko(e){if(e=e||[],!Cesium.defined(e.workerPath))throw new Cesium.DeveloperError("workerPath is required.");this._workerPath=e.workerPath,this._poolSize=Cesium.defaultValue(e.poolSize,16),this._workers=[],this._defered=[]}function Fo(){}function Go(e){return"string"==typeof e?e.replace(/^\s+/g,"").replace(/\s+$/g,""):e}function No(t,e){for(var i=!1,o=0,r="",n=0;n<e.length;n++)!i&&/['"`]/.test(e[n])?i=e[n]:i&&e[n]==i?i=!1:i||"("!=e[n]?i||")"!=e[n]||o--:o++,e[n]==t&&(0<o||i)?r+="######":r+=e[n];return e=(e=(e=r).split(t)).map(function(e){return Go(e.replace(new RegExp("######","g"),t))})}function Bo(e){for(var t="#",i=e.length,o=0;o<i;o++)t+=e[o]+"#";return t}function jo(e){for(var t="",i=e.length,o=1;o<i;o+=2)t+=e[o];return t}function zo(e){this.source=e,this.cursor=0,this.currentChar="",this.readNextChar()}function Uo(e){this.lexer=new zo(e),this.currentToken="",this.readNextToken()}function Wo(e,t){var i="";return void 0!==e.logic?(i=(i=e.terms.map(function(e){return Wo(e,!0)})).join(" "+e.logic+" "),void 0!==t&&(i="("+i+")")):void 0!==e.left?(i=e.left,void 0!==e.operator&&(i+=" "+e.operator,void 0!==e.right&&("IN"===e.operator?i+=" ("+e.right+")":i+=" "+e.right))):i=e,i}function Yo(e){var t,i=0;if(0===e.length)return i;for(t=0;t<e.length;t++)i=(i<<5)-i+e.charCodeAt(t),i|=0;return i}function qo(e){for(var t=[],i=0;i<e.length;i++)for(var o=0;o<e[i].positions.length;o+=3)t.push(Cesium.Cartographic.fromDegrees(e[i].positions[o+0],e[i].positions[o+1],0));return t}function Qo(e,t,i,o){for(var r=0,n=0;n<e.length;n++)for(var a=o?ar:i(e[n]),s=2;s<e[n].positions.length;s+=3){null==t[r].height&&(t[r].height=0),null==e[n].absoluteHeightPositions&&(e[n].absoluteHeightPositions=[]),e[n].absoluteHeightPositions[s-2]=e[n].positions[s-2],e[n].absoluteHeightPositions[s-1]=e[n].positions[s-1],e[n].absoluteHeightPositions[+s]=e[n].positions[+s];var l=o?0:e[n].positions[s];e[n].absoluteHeightPositions[s]=l+t[r].height+a,r++}}function Jo(e,t){this._style=e||{},t.scene.onHoverShowTextArray={},t.scene._lastObjectShowOnText=null,this.setEyeOffset=function(e,t){void 0===t&&(t=0),e.eyeOffset=Cesium.DynamicEyeOffset(t)},this.viewer=t}function Xo(e,t){for(var i=e.length,o=0;o<i;o++){var r=t(e[o]);if("polygon"==e[o].geometryType||"multipolygon"==e[o].geometryType){for(var n=e[o],a=n.positions.length,s=0;s<a;s++){for(var l=n.positions[s],u=2;u<l.length;u+=3)l[u]+=r;n.positions[s]=l}e[o]=n}else{for(var c=e[o],h=c.positions.length,s=2;s<h;s+=3)c.positions[s]+=r;e[o]=c}}return e}function Ko(e,t){if(null==e.isQuery)if(null==e.originalInstanceIds){if(e.parentLayer.isExistRenderedFeatureId(t))return}else if(-1==e.originalInstanceIds.indexOf(t))return;return 1}function $o(t){return function(e){e=Number(t.applyConditionalClassification(t._style.altitudeOffset,e.attributes));return e=isNaN(e)?0:e}}function Zo(e){if("string"!=typeof e)return e;var t=Number(e);if(isNaN(t))return e;var i=t.toString(16);if(i.length<6&&null!=i)for(var o=i.length;o<6;)i="0"+i,o++;e=Cesium.Color.fromCssColorString("#"+i);return null!=e&&(t=e.red,e.red=e.blue,e.blue=t),e}function er(e){if(null!=e){var t=parseInt(e);if(null!=e.alpha||isNaN(t))return e;t<0&&(t&=16777215);var i=t.toString(16);if(i.length<6&&null!=i)for(var o=i.length;o<6;)i="0"+i,o++;e=(e="#"+i).substring(0,7),t=Cesium.Color.fromCssColorString(e);return null!=t&&(e=t.red,t.red=t.blue,t.blue=e),t}}function tr(e){return isNaN(e)?e:parseFloat(e)}function ir(e,i){var t,o=[];return $.each(e.attributeNames,function(e,t){o.push(tr(i[t]))}),1===o.length?t=e.func(o[0]):2===e.attributeNames.length?t=e.func(o[0],o[1]):3===e.attributeNames.length?t=e.func(o[0],o[1],o[2]):4===e.attributeNames.length&&(t=e.func(o[0],o[1],o[2],o[3])),t}function or(e,t,i){return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),i)}Po.prototype.initialize=function(e){Vo||(this.viewer.scene.preRender.addEventListener(this.onPreFrame,this),Vo=!0)},Po.prototype.beginUpdate=function(e){this.quadtree.beginFrame(e)},Po.prototype.endUpdate=function(e){var t=this;e.afterRender.push(function(){t.quadtree.endFrame(e)})},Po.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)},Po.prototype.loadTile=function(e,t){var i=this;null==this._numTilesInLevel[t._level]&&(this._numTilesInLevel[t._level]=0),this._numTilesInLevel[t._level]++,t.state===Cesium.QuadtreeTileLoadState.START&&(t.data={primitive:new Cesium.PrimitiveCollection,wfsLayerData:[],id:Cesium.createGuid(),freeResources:function(){if(i._tileCache[t.data.id]&&i._numTilesInLevel[t._level]--,i._numTilesInLevel[t._level]<0&&(i._numTilesInLevel[t._level]=0),Cesium.defined(this.wfsLayerData)){for(var e in this.wfsLayerData)Cesium.defined(this.wfsLayerData[e])&&this.wfsLayerData[e].freeResources();this.wfsLayerData=void 0}Cesium.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete i._tileCache[t.data.id]}},this._tileCache[t.data.id]=t,Math.abs(6371e3*(t.rectangle.south-t.rectangle.north)),t.data.boundingSphere3D=Cesium.BoundingSphere.fromRectangle3D(t.rectangle),t.data.boundingSphere2D=Cesium.BoundingSphere.fromRectangle2D(t.rectangle,e.mapProjection),t.rectangle.west,t.rectangle.south,t.rectangle.east,t.rectangle.north,this.loadTileEvent.raiseEvent(t),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)},Po.prototype.computeTileVisibility=function(e,t,i){var o=this.computeDistanceToTile(e,t);if(e._distance=o,t.fog.enabled&&1<=Cesium.Math.fog(o,t.fog.density))return Cesium.Visibility.NONE;var r=e.data;if(r.tileBoundingRegion,void 0===r.boundingVolumeSourceTile)return Cesium.Visibility.PARTIAL;var n=t.cullingVolume,a=r.orientedBoundingBox;!a&&r.renderedMesh&&(a=r.renderedMesh.boundingSphere3D),r.clippedByBoundaries=!1;var s,l,u=(s=e.rectangle,(l=this.cartographicLimitRectangle).west<l.east||(l=Rectangle.clone(l,splitCartographicLimitRectangleScratch),0<Rectangle.center(s,rectangleCenterScratch).longitude?l.east=CesiumMath.PI:l.west=-CesiumMath.PI),l),o=new Cesium.Rectangle,o=Cesium.Rectangle.simpleIntersection(u,e.rectangle,o);if(!o)return Visibility.NONE;if(Cesium.Rectangle.equals(o,e.rectangle)||(r.clippedByBoundaries=!0),t.mode,Cesium.SceneMode.SCENE3D,!a)return Cesium.Intersect.INTERSECTING;o=this._clippingPlanes;if(o&&o.enabled){o=o.computeIntersectionWithBoundingVolume(a);if(e.isClipped=o!==Intersect.INSIDE,o===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE}n=n.computeVisibility(a);if(n===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE;a=t.mode===Cesium.SceneMode.SCENE3D&&t.camera.frustum instanceof Cesium.OrthographicFrustum;if(t.mode!==Cesium.SceneMode.SCENE3D||a||!i)return n;r=r.occludeePointInScaledSpace;return!r||i.ellipsoid.isScaledSpacePointVisible(r)?n:Cesium.Visibility.NONE},Po.prototype.canRefine=function(e,t,i){return e.level<16},Po.prototype.showTileThisFrame=function(e,t,i,o){e.data.geometryPrimitive&&e.data.geometryPrimitive.update(t,i,o)},Po.prototype.computeDistanceToTile=function(e,t){var i,o,r,n,a,s,l,u,c,h=(i=e,this.terrainProvider,void 0===(o=void 0===(o=i.data)?i.data=new Cesium.GlobeSurfaceTile:o).tileBoundingRegion&&(o.tileBoundingRegion=new Cesium.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:i.rectangle,ellipsoid:i.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0})),i),m=e.data,d=m.tileBoundingRegion;if(void 0===h)return 9999999999;m.boundingVolumeSourceTile!==h&&(m.boundingVolumeSourceTile=h,(p=e.rectangle)&&p.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(m.orientedBoundingBox=Cesium.OrientedBoundingBox.fromRectangle(e.rectangle,d.minimumHeight,d.maximumHeight,e.tilingScheme.ellipsoid,m.orientedBoundingBox),m.occludeePointInScaledSpace=(r=this,n=m.orientedBoundingBox.center,a=e.rectangle,s=d.maximumHeight,l=m.occludeePointInScaledSpace,u=r.quadtree._occluders.ellipsoid,c=u.ellipsoid,r=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],Cesium.Cartesian3.fromRadians(a.west,a.south,s,c,r[0]),Cesium.Cartesian3.fromRadians(a.east,a.south,s,c,r[1]),Cesium.Cartesian3.fromRadians(a.west,a.north,s,c,r[2]),Cesium.Cartesian3.fromRadians(a.east,a.north,s,c,r[3]),u.computeHorizonCullingPoint(n,r,l))));var h=d.minimumHeight,p=d.maximumHeight;m.boundingVolumeSourceTile!==e&&(m=t.camera.positionCartographic.height,e=Math.abs(m-h),Math.abs(m-p)<e?(d.minimumHeight=h,d.maximumHeight=h):(d.minimumHeight=p,d.maximumHeight=p));t=d.distanceToCamera(t);return d.minimumHeight=h,d.maximumHeight=p,t},Po.prototype.isDestroyed=function(){return!1},Po.prototype.destroy=function(){return Cesium.destroyObject(this)},Po.prototype.remove=function(){this.destroy()},Po.prototype.getInstance=function(e){var t;return 0==Cesium.defined(e.TileManager)&&(t=new Po,(e.TileManager=t).viewer=e,t=new Cesium.QuadtreePrimitive({tileProvider:e.TileManager,maximumScreenSpaceError:2}),e.scene.primitives.add(t)),e.TileManager},Object.defineProperties(ko.prototype,{errorEvent:{get:function(){return this.errorEvent}},poolSize:{get:function(){return this._poolSize}}}),ko.prototype.queueWorkItem=function(e,t){for(var i,o=Cesium.when.defer(),r=null,n=999999,a=0;a<this._workers.length;a++){r=this._workers[a];this._workers[a].jobQueueSize<n&&(r=this._workers[a],n=this._workers[a].jobQueueSize)}0<n&&this._workers.length<this.poolSize&&(r=new Worker(this._workerPath),i=this,r.addEventListener("message",function(e){i.onWorkerMessage(e)},!1),r.addEventListener("error",function(e){i.onWorkerError(e)},!1),r.jobQueueSize=0,this._workers.push(r),r.id=Cesium.createGuid()),e.workerId=r.id;var s=Cesium.createGuid();return e.deferedId=s,this._defered[s]=o,r.jobQueueSize++,r.postMessage(e,t),o},ko.prototype.trimPool=function(e){var t=this;if(null==e)return null!=this.timerId&&clearTimeout(this.timerId),void(this.timerId=setTimeout(function(){t.trimPool(!0)},5e3));for(var i=0;i<this._workers.length;i++)0==this._workers[i].jobQueueSize&&(this._workers[i].terminate(),this._workers.splice(i,1),i--);this._workers.length?this.timerId=setTimeout(function(){t.trimPool(!0)},5e3):this.timerId=null},ko.prototype.onWorkerMessage=function(e){var t=e.data,e=function(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return i}(this._workers,function(e){return e.id===t.workerId});null!=e&&(this._workers[e].jobQueueSize--,this.trimPool());e=this._defered[t.deferedId];delete this._defered[t.deferedId],e.resolve(t)},ko.prototype.onWorkerError=function(e){console.log(e)},Fo.sql2ast=function(r,e){function n(e,t){return t}null==e&&(e=!0);var t="###semi-colon###";r=(r=(r=(r=r.replace(/[("'`].*;.*[)"'`]/g,function(e){return e.replace(/;/g,t)})).replace(/;/g,"###EOR###")).split("###EOR###")[0]).replace(new RegExp(t,"g"),";");var i=["SELECT","FROM","DELETE FROM","INSERT INTO","UPDATE","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","ORDER BY","GROUP BY","HAVING","WHERE","LIMIT","VALUES","SET"],o=i.map(function(e){return e+" "}),a=(o=(o=o.concat(i.map(function(e){return e+"("}))).concat(o.map(function(e){return e.toLowerCase()}))).map(function(e){return e.replace("(","[\\(]")});r=r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(a.join("|"),"gi"),Bo)});var s=[];o.forEach(function(e){var t,i,o=0;do{}while(-1!=(i=r.indexOf(e,o))&&(t=e.replace(/^((\w|\s)+?)\s?\(?$/i,n),o=i+(s[i]=t).length),-1!=i)});var l=0;s.forEach(function(e,t){t<l?delete s[t]:(l=parseInt(t,10)+e.length,"JOIN"==e&&(s[t]="INNER JOIN"))});var u=a.slice(0);u=(u=u.map(Bo)).join("|");var c=r.split(new RegExp(a.join("|"),"i"));r=r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(u,"gi"),jo)});var c=c.map(function(e){return e.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(u,"gi"),jo)})}),h=[];h.SELECT=function(e){return No(",",e).filter(function(e){return""!==e}).map(function(e){return{name:e}})},h.SET=function(e){return No(",",e).filter(function(e){return""!==e}).map(function(e){return{expression:e}})},h.FROM=h["DELETE FROM"]=h.UPDATE=function(e){var i=e.split(",");return(i=i.map(Go)).forEach(function(e,t){""===e&&i.splice(t)}),i=i.map(function(e){var t=e.split(" AS "),e=t[1]||"";return 0===e.indexOf('"')&&e.lastIndexOf('"')==e.length-1&&(e=e.substring(1,e.length-1)),{table:t[0],as:e}})},h["LEFT JOIN"]=h.JOIN=h["INNER JOIN"]=h["RIGHT JOIN"]=function(e){var t=(e=e.split(" ON "))[0].split(" AS "),i={};return i.table=Go(t[0]),i.as=Go(t[1])||"",i.cond=Go(e[1]),i},h.WHERE=Go,h["ORDER BY"]=function(e){e=e.split(",");var o=[];return e.forEach(function(e,t){var i=/([A-Za-z0-9_\.]+)\s*(ASC|DESC){0,1}/gi;null!==(i=i.exec(e))&&((e={}).column=Go(i[1]),e.order=Go(i[2]),void 0===i[2]&&(e.order="ASC"),o.push(e))}),o},h["GROUP BY"]=function(e){e=e.split(",");var o=[];return e.forEach(function(e,t){var i=/([A-Za-z0-9_\.]+)/gi;null!==(i=i.exec(e))&&((e={}).column=Go(i[1]),o.push(e))}),o},h.LIMIT=function(e){var t=/((\d+)\s*,\s*)?(\d+)/gi;void 0===(t=t.exec(e))[2]&&(t[2]=0);e={};return e.nb=parseInt(Go(t[3]),10),e.from=parseInt(Go(t[2]),10),e},h["INSERT INTO"]=function(e){var t=(t=/([A-Za-z0-9_\.]+)\s*(\(([A-Za-z0-9_\., ]+)\))?/gi).exec(e),e={};return e.table=Go(t[1]),void 0!==t[3]&&(e.columns=t[3].split(","),e.columns=e.columns.map(Go)),e},h.VALUES=function(e){var e=No(",",e="("!=(e=Go(e))[0]?"("+e:e),t=[];return e.forEach(function(e){e=No(",",e=e.replace(/^\(/g,"").replace(/\)$/g,"")),t.push(e)}),t};var m={},d=0;return s.forEach(function(e,t){var i,o;e=e.toUpperCase(),d++,void 0!==h[e]?(i=h[e](c[d]),void 0!==m[e]?("string"!=typeof m[e]&&void 0!==m[e][0]||(o=m[e],m[e]=[],m[e].push(o)),m[e].push(i)):m[e]=i):console.log("Can't analyze statement \""+e+'"')}),void 0!==m["LEFT JOIN"]&&(void 0===m.JOIN&&(m.JOIN=[]),void 0!==m["LEFT JOIN"][0]?m["LEFT JOIN"].forEach(function(e){e.type="left",m.JOIN.push(e)}):(m["LEFT JOIN"].type="left",m.JOIN.push(m["LEFT JOIN"])),delete m["LEFT JOIN"]),void 0!==m["INNER JOIN"]&&(void 0===m.JOIN&&(m.JOIN=[]),void 0!==m["INNER JOIN"][0]?m["INNER JOIN"].forEach(function(e){e.type="inner",m.JOIN.push(e)}):(m["INNER JOIN"].type="inner",m.JOIN.push(m["INNER JOIN"])),delete m["INNER JOIN"]),void 0!==m["RIGHT JOIN"]&&(void 0===m.JOIN&&(m.JOIN=[]),void 0!==m["RIGHT JOIN"][0]?m["RIGHT JOIN"].forEach(function(e){e.type="right",m.JOIN.push(e)}):(m["RIGHT JOIN"].type="right",m.JOIN.push(m["RIGHT JOIN"])),delete m["RIGHT JOIN"]),e&&("string"==typeof m.WHERE&&(m.WHERE=Uo.parse(m.WHERE)),void 0!==m.JOIN&&m.JOIN.forEach(function(e,t){m.JOIN[t].cond=Uo.parse(e.cond)})),m},zo.prototype={constructor:zo,readNextChar:function(){"string"!=typeof this.source?this.currentChar="":this.currentChar=this.source[this.cursor++]||""},readNextToken:function(){return/\w|[-]/.test(this.currentChar)?this.readWord():/["'`]/.test(this.currentChar)?this.readString():/[()]/.test(this.currentChar)?this.readGroupSymbol():/[!=<>]/.test(this.currentChar)?this.readOperator():""===this.currentChar?{type:"eot",value:""}:(this.readNextChar(),{type:"empty",value:""})},readWord:function(){for(var e="",t=0,i=!1;/./.test(this.currentChar);){if(!i&&/['"`]/.test(this.currentChar))i=this.currentChar;else if(i&&this.currentChar==i)i=!1;else{if(!i){if(")"==this.currentChar&&t<=0)break;if("("==this.currentChar?t++:")"==this.currentChar&&t--,/[!=<>]/.test(this.currentChar))break}if(" "==this.currentChar&&t<=0)break}e+=this.currentChar,this.readNextChar()}return/^(AND|OR)$/i.test(e)?{type:"logic",value:e}:/^(IN|IS|NOT|LIKE)$/i.test(e)?{type:"operator",value:e}:{type:"word",value:e}},readString:function(){var e="",t=this.currentChar;for(e+=this.currentChar,this.readNextChar();this.currentChar!=t&&""!==this.currentChar;)e+=this.currentChar,this.readNextChar();return e+=this.currentChar,this.readNextChar(),"."==this.currentChar?(e+=this.currentChar,this.readNextChar(),{type:"word",value:e+=this.readString().value}):{type:"string",value:e}},readGroupSymbol:function(){var e=this.currentChar;return this.readNextChar(),{type:"group",value:e}},readOperator:function(){var e=this.currentChar;return this.readNextChar(),/[=<>]/.test(this.currentChar)&&(e+=this.currentChar,this.readNextChar()),{type:"operator",value:e}}},zo.tokenize=function(e){var t=new zo(e),i=[];do{var o=t.readNextToken()}while("empty"!=o.type&&i.push(o),t.currentChar);return i},Uo.prototype={constructor:Uo,readNextToken:function(){for(this.currentToken=this.lexer.readNextToken();"empty"==this.currentToken.type;)this.currentToken=this.lexer.readNextToken();return this.currentToken},parseExpressionsRecursively:function(){return this.parseLogicalExpression()},parseLogicalExpression:function(){for(var e=this.parseConditionExpression();"logic"==this.currentToken.type;){var t=this.currentToken.value;this.readNextToken();var i=this.parseConditionExpression();void 0!==e.logic&&e.logic==t&&void 0!==e.terms?e.terms.push(i):e={logic:t,terms:[e,i].slice(0)}}return e},parseConditionExpression:function(){var e,t=this.parseBaseExpression();return"operator"==this.currentToken.type&&(e=this.currentToken.value,this.readNextToken(),"operator"==this.currentToken.type&&(e+=" "+this.currentToken.value,this.readNextToken()),t={operator:e,left:t,right:this.parseBaseExpression()}),t},parseBaseExpression:function(){var e="";return"word"==this.currentToken.type||"string"==this.currentToken.type?(e=this.currentToken.value,this.readNextToken()):"group"==this.currentToken.type&&(this.readNextToken(),e=this.parseExpressionsRecursively(),this.readNextToken()),e}},Uo.parse=function(e){return new Uo(e).parseExpressionsRecursively()},Fo.ast2sql=function(e){function t(e){return void 0!==e.WHERE?" WHERE "+Wo(e.WHERE):""}var i,o;return void 0!==e.SELECT&&void 0!==e.FROM?(void 0!==(o=e).SELECT?"SELECT "+o.SELECT.map(function(e){return e.name}).join(", "):"")+function(e){if(void 0===e.FROM)return"";var t=" FROM ";return t+=e.FROM.map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", ")}(e)+function(e){if(void 0===e.JOIN)return"";var t="";return e.JOIN.forEach(function(e){t+=" "+e.type.toUpperCase()+" JOIN "+e.table,""!==e.as&&(t+=" AS "+e.as),t+=" ON "+Wo(e.cond)}),t}(e)+t(e)+function(e){if(void 0===e["GROUP BY"])return"";var t=" GROUP BY ";return t+=e["GROUP BY"].map(function(e){return e.column}).join(", ")}(e)+function(e){if(void 0===e["ORDER BY"])return"";var t=" ORDER BY ";return t+=e["ORDER BY"].map(function(e){return e.column+" "+e.order}).join(", ")}(e)+function(e){if(void 0!==e.LIMIT&&void 0!==e.LIMIT.nb&&0<parseInt(e.LIMIT.nb,10)){var t=" LIMIT ";return void 0!==e.LIMIT.from&&1<parseInt(e.LIMIT.from,10)&&(t+=e.LIMIT.from+","),t+=e.LIMIT.nb}return""}(e):void 0!==e["INSERT INTO"]?function(e){if(void 0===e["INSERT INTO"])return"";var t="INSERT INTO "+e["INSERT INTO"].table;return void 0!==e["INSERT INTO"].columns&&(t+=" (",t+=e["INSERT INTO"].columns.join(", "),t+=")"),t}(e)+function(e){if(void 0===e.VALUES)return"";var t=" VALUES ";return t+=e.VALUES.map(function(e){return"("+e.join(", ")+")"}).join(", ")}(e):void 0!==e.UPDATE?function(e){if(void 0===e.UPDATE)return"";var t="UPDATE ";return t+=e.UPDATE.map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", ")}(e)+(void 0!==(i=e).SET?" SET "+i.SET.map(function(e){return e.expression}).join(", "):"")+t(e):void 0!==e["DELETE FROM"]?function(e){if(void 0===e["DELETE FROM"])return"";var t="DELETE FROM ";return t+=e["DELETE FROM"].map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", ")}(e)+t(e):null},Fo.trim=Go,Fo.protect=Bo,Fo.unprotect=jo,Fo.protect_split=No,Fo.CondLexer=zo,Fo.CondParser=Uo;var rr=qo,nr=Qo,ar=1;Object.defineProperties(Jo.prototype,{style:{get:function(){return this._style},set:function(e){this._style=e}}}),Jo.prototype.clonePartOfMultiFeature=function(e,t){return{positions:e.positions[t],attributes:e.attributes,fid:e.fid,geometryType:e.geometryType}},Jo.prototype.createPrimitiveFromWFSFeatures=function(e){new Cesium.PrimitiveCollection;for(var t=[],i=[],o=[],r=e.features.numPositions=0;r<e.features.length;r++){var n=e.features[r];switch(this.sanitizePositions(n.positions),e.features.numPositions+=n.positions.length,n.geometryType){case"polygon":t.push(n);break;case"multipolygon":for(var a=n.positions.length,s=0;s<a;s++)t.push(this.clonePartOfMultiFeature(n,s));break;case"linestring":i.push(n);break;case"multilinestring":for(a=n.positions.length,s=0;s<a;s++)i.push(this.clonePartOfMultiFeature(n,s));break;case"point":o.push(n);break;case"multipoint":for(a=n.positions.length,s=0;s<a;s++)o.push(this.clonePartOfMultiFeature(n,s))}}0<t.length?(e.features=t,this.createPolygonPrimitive(e)):0<i.length?(e.features=i,this.createLinestringPrimitive(e)):0<o.length&&(e.features=o,this.createPointPrimitive(e))},Jo.prototype.createPolygonPrimitive=function(i){function o(e){if(e.isQuery)e.onFinishedQuery(a);else{for(var t,i,o,r,n="",a=[],s=[],l=[],u=[],c=[],h=0;h<e.features.length;h++){var m,d,p,g=e.features[h];Ko(e,g.fid)&&(d=g.absoluteHeightPositions||g.positions,m=_.createPolygonOptions(d,g.attributes),d=_.createCommonOptions(g.attributes),g.absoluteHeightPositions&&delete g.absoluteHeightPositions,a.push(Cesium.BoundingSphere.fromPoints(m.hierarchy.positions)),e.isQuery||(m.outline&&(p=_.createPolygonGeometryHelper(Cesium.PolygonOutlineGeometry,g,m.hierarchy,m.outlineColor,m.perPositionHeight,m.extrudedHeight,m.height),l.push(p)),m.fill&&(p=_.createPolygonGeometryHelper(Cesium.PolygonGeometry,g,m.hierarchy,m.material,m.perPositionHeight,m.extrudedHeight,m.height,m.water),s.push(p)),e.parentLayer.addRenderedFeatureId(g.fid),n+=g.fid+";",u.push(g.fid),c.push(d.tooltip)))}""!=n&&(t=new Cesium.PrimitiveCollection,o=new Cesium.PerInstanceColorAppearance({flat:!0,translucent:m.material.alpha<1}),0<s.length&&(m.water&&(r={color:m.water.color||"rgba(135,206,235,0.6)",image:m.water.image||window.SmartEarthRootUrl+D.water,frequency:m.water.frequency||1e3,speed:m.water.speed||10,amplitude:m.water.amplitude||10},i=Cesium.Color.fromCssColorString(r.color),o=new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:i,blendColor:i,normalMap:r.image,frequency:r.frequency,animationSpeed:r.speed/1e3,amplitude:r.amplitude}}})})),((r=m.clampToGround||!m.perPositionHeight&&!m.extrudedHeight&&!m.height?new Cesium.GroundPrimitive({geometryInstances:s,appearance:o,classificationType:m.classificationType}):new Cesium.Primitive({geometryInstances:s,appearance:o}))._parentCollection=t).add(r)),0<l.length&&(m.clampToGround||((r=new Cesium.Primitive({geometryInstances:l,appearance:o}))._parentCollection=t).add(r)),t.ID="polygons:"+Yo(n),t._instanceIds=u,t._tooltips=c,e.onFinishedCreatePrimitive(t,a))}}var e,_=this;3==this.style.altitudeMethod?(i.features=Xo(i.features,$o(_)),o(i)):(e=function(e){for(var t=[],i=e.length,o=0;o<i;o++)for(var r=e[o],n=r.positions.length,a=0;a<n;a++)for(var s=r.positions[a],l=0;l<s.length;l+=3)t.push(Cesium.Cartographic.fromDegrees(s[l+0],s[l+1],0));return t}(i.features),e=Cesium.sampleRenderedData(e,Cesium.SampleRenderedDataFlags.TERRAIN|Cesium.SampleRenderedDataFlags.FLOOR),Cesium.when(e,function(e){var t=2==_._style.altitudeMethod;(function(e,t,i,o){for(var r=0,n=0;n<e.length;n++){var a=e[n],s=o?ar:i(a);null==a.absoluteHeightPositions&&(a.absoluteHeightPositions=[]);for(var l=0;l<a.positions.length;l++)for(var u=a.positions[l],c=a.absoluteHeightPositions[l]=[],h=2;h<u.length;h+=3){var m=o?0:u[h];null==t[r].height&&(t[r].height=0),c[h-2]=u[h-2],c[h-1]=u[h-1],c[+h]=u[+h],c[h]=m+t[r].height+s,r++}}})(i.features,e,$o(_),t),o(i)}))},Jo.prototype.createPolygonGeometryHelper=function(e,t,i,o,r,n,a,s){var l=null!=n?Cesium.PerInstanceColorAppearance.VERTEX_FORMAT:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,a=new e({polygonHierarchy:i,vertexFormat:l=void 0!==s||void 0!==a?Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT:l,perPositionHeight:void 0!==a?void 0:r,extrudedHeight:n,height:a});return new Cesium.GeometryInstance({geometry:a,id:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(o)}})},Jo.prototype.createLinestringPrimitive=function(i){function o(i){if(i.isQuery)i.onFinishedQuery(r);else{var e,o="",r=[],n=[],a=[];let t=new Cesium.PrimitiveCollection;for(var s,l=0;l<i.features.length;l++){var u=i.features[l];if(Ko(i,u.fid)){var c=u.absoluteHeightPositions||u.positions,h=p.createLinestringOptions(c,u.attributes),m=p.createCommonOptions(u.attributes);if(h.vertexFormat=(e?Cesium.PerInstanceColorAppearance:Cesium.PolylineColorAppearance).VERTEX_FORMAT,u.absoluteHeightPositions&&delete u.absoluteHeightPositions,r.push(Cesium.BoundingSphere.fromPoints(h.positions)),!i.isQuery){var d,c=h.clampToGround?(d=new Cesium.GroundPolylineGeometry({positions:h.positions,width:h.width}),new Cesium.GeometryInstance({id:u,geometry:d,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}})):(d=new Cesium.PolylineGeometry(h),new that._cesium.GeometryInstance({id:u,geometry:d,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}}));i.parentLayer.addRenderedFeatureId(u.fid),o+=u.fid+";",n.push(u.fid),a.push(m.tooltip);let e=null;e=h.clampToGround?new Cesium.GroundPolylinePrimitive({geometryInstances:c,appearance:new Cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:h.material}}}),faceForward:!0,flat:!1}),classificationType:h.classificationType}):new Cesium.Primitive({geometryInstances:c,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:h.material}}})})}),t.add(e)}}}""!=o&&((s=t).ID="polylines:"+Yo(o),s._instanceIds&&0===s._instanceIds.length&&(s._instanceIds=n),s._tooltips=a,i.onFinishedCreatePrimitive(s,r))}}var e,p=this;3==this.style.altitudeMethod?(i.features=Xo(i.features,$o(p)),o(i)):(e=qo(i.features),e=Cesium.sampleRenderedData(e,Cesium.SampleRenderedDataFlags.TERRAIN|Cesium.SampleRenderedDataFlags.FLOOR),Cesium.when(e,function(e){var t=2==p._style.altitudeMethod;Qo(i.features,e,$o(p),t),o(i)}))},Jo.prototype.createPointPrimitive=function(i){function o(e){if(e.isQuery)e.onFinishedQuery(n);else{for(var t,i,o="",r=[],n=[],a=[],s=new Cesium.LabelCollection({scene:v.viewer.scene}),l=new Cesium.PointPrimitiveCollection({scene:v.viewer.scene}),u=new Cesium.BillboardCollection({scene:v.viewer.scene}),c=new Cesium.PrimitiveCollection,h=new Cesium.PolylineCollection,m=0;m<e.features.length;m++){var d,p,_,f,y=e.features[m];Ko(e,y.fid)&&(p=y.absoluteHeightPositions||y.positions,d=v.createPointOptions(p,y.attributes),p=v.createCommonOptions(y.attributes),y.clampToGround=d.clampToGround,d.sgsPointPosition&&(y.sgsPointPosition=d.sgsPointPosition,delete d.sgsPointPosition),y.absoluteHeightPositions&&delete y.absoluteHeightPositions,n.push(Cesium.BoundingSphere.fromPoints([d.position])),e.isQuery||(d.label&&(d.label.position=d.position,d.label.id=y,v.setEyeOffset(d.label),null!=d.label.imageFile&&(d.label.image=v.applyConditionalClassification(d.label.imageFile,y.attributes),d.label.label=d.label,u.add(d.label),v.setEyeOffset(d.label,-5)),null!=d.label.imageFile&&null!=d.label.showText&&d.label.showText&&(v.viewer.scene.onHoverShowTextArray[d.label.id]=!0),null!=d.label.isBold&&d.label.isBold?s.add(g):null!=d.label.isUnderline&&d.label.isUnderline?(_=null!=d.label.text.match(/[iljf1]/g)?d.label.text.match(/[iljf1]/g):[],f=d.label.text.length,f=Array(Math.ceil(f-.5*_.length)).join("_"),_=$.extend({},d.label),null!=d.label.image&&delete d.label.image,_.position=d.label.position,_.id=d.label.id,_.text=f,_.alignment=null!=d.label.alignment?d.label.alignment:void 0,_.underline=!0,_.textRelativeToImage=null!=d.label.textRelativeToImage?d.label.textRelativeToImage:void 0,-1<d.label.font.indexOf("pt")?Number(d.label.font.split("pt")[0]):-1<d.label.font.indexOf("px")&&Number(d.label.font.split("px")[0]),_.pixelOffset=new Cesium.Cartesian2(0,-45),s.add(_)):s.add(d.label)),d.billboard&&(d.billboard.position=d.position,d.billboard.id=y,v.setEyeOffset(d.billboard),u.add(d.billboard)),d.model&&(d.model.url=d.model.uri,d.model.id=y,c.add(Cesium.Model.fromGltf(d.model))),d.point&&(d.point.position=d.position,d.point.id=y,v.setEyeOffset(d.point),l.add(d.point)),0!=d.lineToGround&&(f=Cesium.Cartographic.fromCartesian(d.position),_=Cesium.Cartesian3.fromRadians(f.longitude,f.latitude,0),2==d.lineToGround&&(f=d.lineToGroundLength/Cesium.Cartesian3.distance(d.position,_),Cesium.Cartesian3.lerp(d.position,_,f,_)),h.add({show:!0,width:1,positions:[d.position,_],material:Cesium.Material.fromType("Color",{color:d.lineToGroundColor})})),e.parentLayer.addRenderedFeatureId(y.fid),o+=y.fid+";",r.push(y.fid),a.push(p.tooltip)))}""!=o&&(i=new Cesium.PrimitiveCollection,0<s.length&&($.each(s._labels,function(e,t){t._type="Label"}),(s._billboardCollection._parentCollection=i).add(s),t="labels"),0<u.length&&($.each(u._billboards,function(e,t){t._type="Billboard"}),(u._parentCollection=i).add(u),t="billboards"),0<c.length&&($.each(c._primitives,function(e,t){t._type="Model",t._parentCollection=i}),i.add(c),t="models"),0<l.length&&($.each(l._pointPrimitives,function(e,t){t._type="Point"}),(l._parentCollection=i).add(l),t="points"),0<h.length&&($.each(h._polylines,function(e,t){t._type="L2G"}),(h._parentCollection=i).add(h),t="L2G"),i.ID=t+":"+Yo(o),i._instanceIds=r,i._tooltips=a,e.onFinishedCreatePrimitive(i,n))}}var e,v=this;3==this.style.altitudeMethod?(i.features=Xo(i.features,$o(v)),o(i)):(e=rr(i.features),e=Cesium.sampleRenderedData(e),Cesium.when(e,function(e){var t=2==v._style.altitudeMethod;nr(i.features,e,$o(v),t),o(i)}).otherwise(function(e){}))},Jo.prototype.createCommonOptions=function(e){var t={};return t.tooltip=this.applyConditionalClassification(this.style.tooltip,e),t},Jo.prototype.createPolygonOptions=function(e,t){var i=this.getPolygonStyle(this.style);i.polygon.hierarchy={positions:Cesium.Cartesian3.fromDegreesArrayHeights(e[0]),holes:[]};for(var o=1;o<e.length;o++)i.polygon.hierarchy.holes.push({positions:Cesium.Cartesian3.fromDegreesArrayHeights(e[o])});var r,n=this.applyConditionalClassification(i.polygon.material,t);return i.polygon.material=Zo(n),null!=i.polygon.fill&&null!=i.polygon.fromKml&&(1<(r=this.applyConditionalClassification(i.polygon.fill,t))&&(r/=100),i.polygon.material=new Cesium.Color(i.polygon.material.red,i.polygon.material.green,i.polygon.material.blue,r)),i.polygon.extrudedHeight&&i.polygon.extrudedHeight&&i.polygon.extrudedHeight.indexOf&&-1<i.polygon.extrudedHeight.indexOf("[")&&-1<i.polygon.extrudedHeight.defaultValue.indexOf("]")&&(n=t[i.polygon.extrudedHeight.defaultValue.substring(1,i.polygon.extrudedHeight.defaultValue.length-1)],void 0!==(n=parseInt(n))&&(i.polygon.extrudedHeight=3*n)),t.FSCALE&&(r=this.getLevelDistance(t.FSCALE),i.polygon.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,r)),n=this.applyConditionalClassification(i.polygon.outlineColor,t),i.polygon.outlineColor=Zo(n),i.polygon},Jo.prototype.translateLineWidth=function(e,t){t=this.applyConditionalClassification(e.polyline.width,t);return 0<t?TerraExplorer.USE_CORRIDOR_FOR_LINE_WIDTH_IN_METERS?1<t&&(e.polyline.widthInMeters=!0,t*=.8,0<e.polyline.backgroundOpacity&&(t*=.8)):t=1<t?2:1:t<0?t=Math.min(5,Math.abs(t)):0==t&&(t=1),t},Jo.prototype.createLinestringOptions=function(e,t){var i=this.getLinestringStyle(this.style);i.id=t,i.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e);var o,e=this.applyConditionalClassification(i.polyline.material,t);return i.polyline.material=Zo(e),null!=i.polyline.lineOpacity&&(1<(o=this.applyConditionalClassification(i.polyline.lineOpacity,t))&&(o/=100),i.polyline.material=new Cesium.Color(i.polyline.material.red,i.polyline.material.green,i.polyline.material.blue,o)),i.polyline.far&&(i.polyline.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(void 0!==i.polyline.near?i.polyline.near:0,i.polyline.far)),t.FSCALE&&(o=this.getLevelDistance(t.FSCALE),i.polyline.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,o)),i.polyline.width=this.applyConditionalClassification(i.polyline.width,t),i.polyline},Jo.prototype.applyConditionalClassification=function(e,i){if(null!=e){if(null==e.defaultValue)return e;var o=tr(e.defaultValue);if(void 0===e.classificationArray){if(!isNaN(o))return o;if(o instanceof Cesium.Color)return o}if(void 0!==e.attributeName){var t="["+e.attributeName+"]";if(o===t)o=i[e.attributeName];else if(e.multipleAttributeReplacementNeeded)for(name in i)o=or(o,"["+name+"]",i[name]);else o=or(o,t,i[e.attributeName]);return o}if(void 0!==e.classification)return o=ir(e.classification,i);var r=e.classificationArray;return void 0!==r&&$(Object.keys(r)).each(function(e,t){t=function(e,t){if(void 0!==e&&0!==e.condition.length){if(void 0===e.func)return tr(e.value);var i=void 0;return i=!0===ir(e,t)?tr(e.value):i}}(r[t],i);t&&(o=t)}),o}},Jo.prototype.createLineToGroundOptions=function(e,t){var i=this.applyConditionalClassification(e.lineToGround,t);null!=i&&0!=Number(i)?(e.lineToGround=i,i=er(i=this.applyConditionalClassification(e.lineToGroundColor,t)),e.lineToGroundColor=i,t=this.applyConditionalClassification(e.lineToGroundLength,t),e.lineToGroundLength=Number(t)):(e.lineToGround=0,e.lineToGroundColor=0,e.lineToGroundLength=0)},Jo.prototype.createPointOptions=function(e,t){var i,o,r,n,a,s,l=this.getPointStyle(this.style);return l.pointHeight?(l.position=Cesium.Cartesian3.fromDegrees(e[0],e[1],l.pointHeight),e[2]=l.pointHeight):l.position=Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),l.sgsPointPosition=e,l.id=t,l.label&&(void 0!==(e=l.label.text)&&-1<e.defaultValue.indexOf("[")&&-1<e.defaultValue.indexOf("]")&&(void 0!==(i=t[e.defaultValue.substring(1,e.defaultValue.length-1)])&&(l.label.text=i)),this.applyConditionalClassification(l.label.text,t)?l.label.text=this.applyConditionalClassification(l.label.text,t).toString():l.label.text=this.applyConditionalClassification(l.label.text,t),l.label.text=this.o(l.label.text)?this.s(l.label.text):l.label.text,-1<l.label.text.indexOf("[")&&-1<l.label.text.indexOf("]")&&(l.label.text=""),null!=l.label.family&&(r=this.applyConditionalClassification(l.label.family,t),i=this.applyConditionalClassification(l.label.font,t),l.label.font=0<=i?(3*i/4).toString()+"pt "+r:(3*(-1*(72*i/96))/4).toString()+"pt "+r),l.label.fillColor=er(this.applyConditionalClassification(l.label.fillColor,t)),l.label.backgroundColor=er(this.applyConditionalClassification(l.label.backgroundColor,t)),null==l.label.backgroundColor&&(l.label.backgroundColor=new Cesium.Color(.165,.165,.165,0)),l.label.showBackground=!0,null!=l.label.showText&&((a=this.applyConditionalClassification(l.label.showText,t))&&1===Number(a)&&(l.label.onHoverShowText=!0),a&&null==viewer.scene.canvas.onHoverShowText&&(o=viewer.scene,new Cesium.ScreenSpaceEventHandler(o.canvas).setInputAction(function(e){var t={};o.screenToWorld(e.endPosition,t),Cesium.defined(t.pickPrimitive)&&"Billboard"==t.pickPrimitive.constructor.name&&null!=t.pickPrimitive.label?null!=o.onHoverShowTextArray[t.pickPrimitive.label.id]&&(null!=o._lastObjectShowOnText&&o._lastObjectShowOnText.id!=t.pickPrimitive.label.id&&null!=o._lastObjectShowOnText.show&&(o._lastObjectShowOnText.show=!1),viewer.scene._lastObjectShowOnText=o.onHoverShowTextArray[t.pickPrimitive.label.id],null!=o._lastObjectShowOnText.show&&(viewer.scene._lastObjectShowOnText.show=!0)):null!=o._lastObjectShowOnText&&null!=o._lastObjectShowOnText.show&&(o._lastObjectShowOnText.show=!1)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),viewer.scene.canvas.onHoverShowText=!0)),null!=l.label.textRelativeToImage&&null!=l.label.textAlignment&&(l.label.textRelativeToImage=this.applyConditionalClassification(l.label.textRelativeToImage,t),l.label.alignment=this.applyConditionalClassification(l.label.textAlignment,t)),null!=l.label.underline&&(l.label.isUnderline=this.applyConditionalClassification(l.label.underline,t)),null!=l.label.bold&&1==this.applyConditionalClassification(l.label.bold,t)&&(l.label.font="bold "+l.label.font),null!=l.label.italic&&1==this.applyConditionalClassification(l.label.italic,t)&&(l.label.font="italic "+l.label.font),null!=l.label.backgroundOpacity&&(l.label.backgroundColor.alpha=this.applyConditionalClassification(l.label.backgroundOpacity,t)),null!=l.label.minViewingHeight&&(s=this.applyConditionalClassification(l.label.minViewingHeight,t),n=650*this.applyConditionalClassification(l.label.scaleMPP,t),l.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(s,n)),t.FSCALE&&(a=this.getLevelDistance(t.FSCALE),l.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,a)),l.label.disableDepthTestDistance||(l.label.disableDepthTestDistance=1e3),l.clampToGround&&(l.label.heightReference=1)),l.billboard&&(l.billboard.sizeInMeters=!1,null!=l.billboard.imageColor&&(r=er(r=this.applyConditionalClassification(l.billboard.imageColor,t)),l.billboard.color=r),null!=l.billboard.imageOpacity&&null!=l.billboard.color.alpha&&(l.billboard.color.alpha=Number(this.applyConditionalClassification(l.billboard.imageOpacity,t))),l.billboard.image=this.applyConditionalClassification(l.billboard.image,t),null!=l.billboard.minViewingHeight&&(s=this.applyConditionalClassification(l.billboard.minViewingHeight,t),n=650*this.applyConditionalClassification(l.billboard.scaleMPP,t),l.billboard.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(s,n)),t.FSCALE&&(a=this.getLevelDistance(t.FSCALE),l.billboard.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,a)),l.billboard.link&&l.id&&"object"==typeof l.id&&(l.id.link=this.applyConditionalClassification(l.billboard.link,t)),l.billboard.disableDepthTestDistance||(l.billboard.disableDepthTestDistance=1e3),l.clampToGround&&(l.billboard.heightReference=1)),l.model&&(s=function(e){e=Number(e);return e=!Cesium.defined(e)||isNaN(e)?0:e},l.model.uri=this.applyClassification(l.model.uri,t),l.model.scale=s(this.applyClassification(l.model.scale,t)),n=s(this.applyClassification(l.model.heading,t)),a=s(this.applyClassification(l.model.pitch,t)),s=s(this.applyClassification(l.model.roll,t)),s=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(n),Cesium.Math.toRadians(a),Cesium.Math.toRadians(s)),l.model.modelMatrix=Cesium.Transforms.headingPitchRollToFixedFrame(l.position,s)),this.createLineToGroundOptions(l,t),l},Jo.prototype.s=function(e){return e.split("").reverse().join("")},Jo.prototype.getLevelDistance=function(e){var t=2e7;switch(parseInt(e)){case 2:t=10123e3;break;case 3:t=7123e3;break;case 4:t=6321e3;break;case 5:t=5522e3;break;case 6:t=3436e3;break;case 7:t=539e3;break;case 8:t=305e3;break;case 9:t=18e4;break;case 10:t=133e3;break;case 11:t=1e5;break;case 12:t=76500;break;case 13:t=58200;break;case 14:t=23500;break;case 15:t=9600;break;case 16:t=4e3;break;case 17:t=2e3;break;case 18:t=1700;break;case 19:t=1500;break;case 20:t=1e3;break;case 21:t=500;break;case 22:t=200;break;case 23:t=100}return t},Jo.prototype.o=function(e){if(!e)return e;return new RegExp("^[^A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿]*[֑-߿יִ-﷽ﹰ-ﻼ]").test(e[0])},Jo.prototype.applyClassification=function(e,t){if("string"!==$.type(e))return e;if(null!=/(\[([^\]]+)\])/g.exec(e))for(var i in t)e=or(e,"["+i+"]",t[i]);for(var o=/(\<([^\>]+)\>)/g,r=o.exec(e="undefined"==e?"":e);null!=r;){try{var n=r[r.length-1],a=(0,eval)(n);e=e.replace(r[0],a)}catch(e){}r=o.exec(e)}return e},Jo.prototype.getPolygonStyle=function(e){return $.extend(!0,{},lr.DEFAULT_POLYGON_STYLE,e)},Jo.prototype.getLinestringStyle=function(e){return $.extend(!0,{},lr.DEFAULT_POLYLINE_STYLE,e)},Jo.prototype.getPointStyle=function(e){return null!=e.label?$.extend(!0,{},lr.DEFAULT_LABEL_STYLE,e):null!=e.billboard?$.extend(!0,{},lr.DEFAULT_BILLBOARD_STYLE,e):null!=e.model?$.extend(!0,{},lr.DEFAULT_MODEL_STYLE,e):null==e.point?lr.DEFAULT_POINT_STYLE:$.extend(!0,{},lr.DEFAULT_POINT_STYLE,e)},Jo.prototype.sanitizePositions=function(e){for(var t=0;t<e.length;t++)e[t]instanceof Array?this.sanitizePositions(e[t]):isNaN(e[t])&&(e[t]=0)};var sr,lr={};function ur(e,t,i,o,r,n,a,s,l){var u=this;function c(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var o=Cesium.when.defer();return function e(){t.ready?Cesium.when(d(t,i),function(e){o.resolve(e)}):setTimeout(e,10)}(),o.promise}function h(e,t){for(var i=e.tilingScheme,o=i.positionToTileXY(t,0),e=u._Viewer.scene.globe._surface.tileProvider.quadtree._levelZeroTiles,r=e[0].x==o.x&&e[0].y==o.y?e[0]:e[1],n=1;n<22;n++){var a=function(e,t){for(var i=0;i<e.children.length;i++)if(e.children[i].state>=Cesium.QuadtreeTileLoadState.DONE&&(null!=e.children[i].data.terrainData._mesh||null!=e.children[i].data.terrainData._buffer)&&e.children[i].x==t.x&&e.children[i].y==t.y)return e.children[i]}(r,o=i.positionToTileXY(t,n));if(null==a)break;r=a}return r}function m(e){var t;for($.grep(u._Viewer.scene.primitives._primitives,function(e){return e instanceof Cesium.Cesium3DTileset}),t=0;t<e.length;++t){var i=e[t],o=i instanceof Cesium.Cartographic,r=o?i:Cesium.Cartographic.fromCartesian(i);r.height=u.G,o||(r=Cesium.Cartesian3.fromRadiansArrayHeights([r.longitude,r.latitude,r.height])[0],i.z=r.z)}return e}function d(e,t){for(var i=0;i<t.length;++i){var o=t[i],r=h(e,o);o.height=r.data.terrainData.interpolateHeight(r.rectangle,o.longitude,o.latitude)}return t}function p(e){this.value=new Float32Array([e])}this._viewer=e,this._Viewer=e,u.G=65535,sr=new Po,gr=new ko({workerPath:function(){for(var e=document.scripts,t="./wfs/featurefetcherworker.js",i=0;i<e.length;i++){var o=e[i].src.split("/"),o=o[o.length-1];"SmartEarth.js"==o?t=e[i].outerHTML.split('"')[1].replace("SmartEarth.js","Workers/featurefetcherworker.js"):"SmartEarth.min.js"==o&&(t=e[i].outerHTML.split('"')[1].replace("SmartEarth.min.js","Workers/featurefetcherworker.js"))}return t}()}),Cesium.sampleRenderedData||(Cesium.Resource&&(Cesium.loadText=Cesium.Resource.fetchText,Cesium.loadJson=Cesium.Resource.fetchJson,Cesium.loadBlob=Cesium.Resource.fetchBlob,Cesium.loadArrayBuffer=Cesium.Resource.fetchArrayBuffer,Cesium.loadImage=Cesium.Resource.fetchImage),p.fromZBias=function(e){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return new p(e)},p.toValue=function(e,t){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return Cesium.defined(t)?color.toBytes(t):new Float32Array(e)},p.equals=function(e,t){return e===t||Cesium.defined(e)&&Cesium.defined(t)&&e.value[0]===t.value[0]},p.defaultBias=function(){return p.fromZBias(15e-6)},Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.SampleRenderedDataFlags={TERRAIN:2,MESH:4,FLOOR:8},Cesium.DynamicEyeOffset=function(e){return void 0===e&&(e=0),new Cesium.Cartesian3(.001234321,0,e)},Cesium.sampleRenderedData=function(r,e){var t=2,i=4,o=8;null==e&&(e=t|i);var n=Cesium.when.defer(),a=[];t<e?r.forEach(function(e){a.push(Cesium.Cartographic.fromRadians(e.longitude,e.latitude,e.height))}):a=r;var s=[];e&t&&s.push(c(u._Viewer.terrainProvider,r));var l=0<(e&o);return e&(i|o)&&s.push(function(e){Cesium.Check.defined("positions",e);var t=Cesium.when.defer();return Cesium.when(m(e),function(e){t.resolve(e)}),t.promise}(a)),Cesium.when.all(s).then(function(e){if(1<s.length)for(var t=0;t<r.length;t++){var i=e[0][t],o=e[1][t];o.height!=u.G&&(i.height<o.height||l)&&(i.height=o.height)}n.resolve(e[0])}),n.promise},Cesium.sampleRenderedMesh=function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(m(e),function(e){i.resolve(e)}),i.promise},Cesium.sampleRenderedTerrain=function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var o=Cesium.when.defer();return function e(){t.ready?Cesium.when(d(t,i),function(e){o.resolve(e)}):setTimeout(e,10)}(),o.promise},Cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo=function(){var e,t=this.getRenderedLevelInfo(),i=0;for(e in t)i<Number(e)&&(i=Number(e));return{bestLevel:i,count:t[i]}},Cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo=function(){var t=[];return this._tilesToRender.forEach(function(e){null==t[e.level]&&(t[e.level]=0),t[e.level]++}),t}),r=r||{},this._level=o||{min:0,max:22},"number"==typeof this._level&&(this._level={min:o,max:22}),this._url=t,this._layerName=i,this._guid=Cesium.createGuid(),this._gmlParser=new So(!0,null,null,!0),this._tileManager=sr.getInstance(e),this._tileManager._loadTileEvent.addEventListener(ur.prototype.loadTile,this),this._useWorkers=!0,this._layerDisplayName=n,this._showAttributesAsMessage=r.showAttributesAsMessage,delete r.showAttributesAsMessage,this._entityCreator=new Jo(r,e),this._visible=!0,this._featuresMap={},this._boundingBox=void 0,this._geometryFieldName=void 0,this._operations={},this._subdomains=a,this.latLon=s,this._addedFeatures=[],this.simpleSqlParser=Fo,this.myLayer=l,this._statistics={numberOfAddedFeatures:0,numberOfDeletedFeatures:0,numberOfAddePositions:0,numberOfDeletedPositions:0,getNumberOfCurrentlyRenderedFeatures:function(){return this.numberOfAddedFeatures-this.numberOfDeletedFeatures},getNumberOfCurrentlyRenderedPositions:function(){return this.numberOfAddePositions-this.numberOfDeletedPositions}},function(t){var e=t.cleanUrl(t._url).replace("{s}",t.sTag(t._layerName.length,t._layerName.length,t._level));e+=mr(e),e+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName="+t._layerName;var i=Cesium.TrustedServers.contains(cr(t._url,t._subdomains));$.ajax({dataType:"xml",xhrFields:{withCredentials:i},url:encodeURI(e),success:function(e){var i,o;o=t,hr(e,"FeatureType","wfs").each(function(e,t){if(hr(t,"Name","wfs").text()!=o._layerName)return!0;t=hr(t,"LatLongBoundingBox","wfs");return 1!==t.length||(o._boundingBox=Cesium.Rectangle.fromDegrees(parseFloat(t[0].attributes.minx.value),parseFloat(t[0].attributes.miny.value),parseFloat(t[0].attributes.maxx.value),parseFloat(t[0].attributes.maxy.value))),!1}),i=t,$(e).find("FeatureType").each(function(e,t){if($(t).children("Name").text()!=i._layerName)return!0;t=$(t).children("Operations");return 0==t.length||t.children().each(function(){i._operations[this.tagName.toLowerCase()]={}}),!1})}})}(this),dr(this)}function cr(e,t){e=-1!=e.indexOf("{s}")?null!=t&&0<t.length?e.replace("{s}",t[0]):console.error("Error - sTag with no subdomains."):e;return e}function hr(e,t,i){var o=$(e).find(t);return 0<(o=0==o.length&&"wfs"===i.toLowerCase()?$(e).find("wfs\\:"+t+","+t):o).length?o:$([])}function mr(e){return-1<e.indexOf("?")?"&":"?"}function dr(t){t.featureColumnNames=null;var e=t.cleanUrl(t._url).replace("{s}",t.sTag(t._layerName.length,t._layerName.length,t._level));e+=mr(e),e+="SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName="+t._layerName;var i=Cesium.TrustedServers.contains(cr(t._url,t._subdomains));$.ajax({dataType:"xml",xhrFields:{withCredentials:i},url:encodeURI(e),success:function(e){!function(o,e){var t=$(e).find("[type^='gml:']");o._geometryFieldName=$(t).attr("name"),o.geometryResponseData=e,o.wfsNamespace=function(e,t){let i=eval;if(null==e)return null;try{var o=(new XMLSerializer).serializeToString(e).match(i("/[<]([a-z]+):"+t+"[>]/i"));return null!=o?o[1]:null}catch(e){return!1}}(o.geometryResponseData,"sequence"),null==o.wfsNamespace&&(o.wfsNamespace="xsd"),o.sgSchemaExists=$(o.geometryResponseData).find(o.wfsNamespace+"\\:schema").attr("xmlns:sfs"),o.sgSchemaExists||(o.sgSchemaExists=$(o.geometryResponseData).find("schema").attr("xmlns:sfs"));e=$(o.geometryResponseData).find(o.wfsNamespace+"\\:sequence "+o.wfsNamespace+"\\:element");0==e.length&&(e=$(o.geometryResponseData).find("sequence").find("element")),o.geomFields=[],e.each(function(){var e=$(this),t=e.attr("name"),i=e.attr("type");null==i?i="string":(e=i.match(/.*[:](\w+)/))&&(i=e[1]),o.geomFields.push({name:t,type:i})})}(t,e)}})}function pr(e){return null==e?void 0:e.parentLayer?e:e._parentCollection||(e.primitive&&e.primitive._parentCollection?e.primitive._parentCollection:void 0)}Object.defineProperties(lr,{DEFAULT_POLYGON_STYLE:{get:function(){return{polygon:{perPositionHeight:!0,fill:0,material:Cesium.Color.GREEN,outline:!0,outlineColor:Cesium.Color.WHITE,outlineWidth:1}}}},DEFAULT_POLYLINE_STYLE:{get:function(){return{polyline:{material:Cesium.Color.WHITE,width:1}}}},DEFAULT_POINT_STYLE:{get:function(){return{point:{color:Cesium.Color.RED,pixelSize:5,outlineColor:Cesium.Color.WHITE,outlineWidth:2}}}},DEFAULT_LABEL_STYLE:{get:function(){return{label:{text:"Text",font:"18px arial",style:Cesium.LabelStyle.FILL,fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:5,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,eyeOffset:Cesium.Cartesian3.ZERO,pixelOffset:new Cesium.Cartesian2(0,-50)}}}},DEFAULT_BILLBOARD_STYLE:{get:function(){return{billboard:{image:"./img/query.png",scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}}}},DEFAULT_MODEL_STYLE:{get:function(){return{model:{uri:"./img/CesiumTexturedBoxTest.bgltf",scale:1e3}}}}}),Object.defineProperties(ur.prototype,{LayerDisplayName:{get:function(){return this._layerDisplayName}},displayName:{get:function(){return this.LayerDisplayName}},guid:{get:function(){return this._guid}},Style:{get:function(){return this._entityCreator.style}},show:{get:function(){return this._visible},set:function(e){this.setVisibility(e)}},BoundingBox:{get:function(){return this._boundingBox}},Statistics:{get:function(){return this._statistics}}});var gr,_r=180/Math.PI;function fr(e){this.Viewer=e,this._core=new V,this.colorTool=this._core.gradientColor()}function yr(e,t){this._viewer=e,this._cesium=t}ur.prototype.getRequestMaxFeatures=function(){return 1e3},ur.prototype.isAttributeField=function(e,t){return!(!t||!e||""==e.toLowerCase()||"fid"==e.toLowerCase())&&("string"==t.toLowerCase()||"integer"==t.toLowerCase()||"double"==t.toLowerCase())},ur.prototype.updateFeatures=function(e,o){var t,i,r,n,a,s;e.length<=0?o():(t=this,i=[],$(this.geomFields).each(function(){t.isAttributeField(this.name,this.type)&&i.push(this.name)}),n="<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>",r="",$(e).each(function(){var e=this,t='<wfs:Update typeName="{lyaer_id}">'.replace("{lyaer_id}",this.layerId);$(i).each(function(){t+="<wfs:Property><wfs:Name>"+this+"</wfs:Name><wfs:Value>"+e[this]+"</wfs:Value></wfs:Property>"}),t+='<ogc:Filter><ogc:FeatureId fid="'+e.originFid+'"/></ogc:Filter>',r+=t+="</wfs:Update>"}),n="<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>".replace("{wfs_updates}",r),a="Failed to save changes to server",s=cr(this.cleanUrl(this._url),this._subdomains),e=Cesium.TrustedServers.contains(s),$.ajax({dataType:"xml",type:"POST",data:n,xhrFields:{withCredentials:e},url:encodeURI(s),success:function(e){null!=(new XMLSerializer).serializeToString(e.documentElement).toLowerCase().match(/success\s*\//)?o():o(a)},error:function(e,t,i){o(a)},timeout:1e4}))},ur.prototype.getFeatures=function(e,t,r){var i=this,o=[];$(this.geomFields).each(function(){i.isAttributeField(this.name,this.type)&&o.push(this.name)});var n="<wfs:GetFeature version='1.0.0' service='WFS' username='' password='' maxFeatures='{REQUEST_MAX_FEATURES}'  xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> <wfs:Query typeName='{layer_name}'> {wfs_filter}</wfs:Query> </wfs:GetFeature>";n=(n=n.replace("{layer_name}",this._layerName)).replace("{REQUEST_MAX_FEATURES}",1e3);var a="";""!=e.replace(/[ ]/g,"")&&(a="<ogc:Filter  xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'>",a+=function e(t,i){if(t.operator){var o="";switch(t.operator.toLowerCase()){case"=":o="PropertyIsEqualTo";break;case"<>":o="PropertyIsNotEqualTo";break;case">":o="PropertyIsGreaterThan";break;case">=":o="PropertyIsGreaterThanOrEqualTo";break;case"<":o="PropertyIsLessThan";break;case"<=":o="PropertyIsLessThanOrEqualTo";break;case"like":o="PropertyIsLike"}var r=-1!=i.indexOf(t.right)?t.right:t.left,n="<ogc:"+o+("like"==t.operator.toLowerCase()?' wildCard="*" singleChar="*" escape="*"':"")+">";n+="<ogc:PropertyName>"+r+"</ogc:PropertyName>";var a=-1!=i.indexOf(t.right)?t.left:t.right,r=null==(a=a.replace(/^'|'$$/g,"")).match(/^[%]|[%]$$/);return n+="<ogc:Literal>"+(a="like"==t.operator.toLowerCase()&&r?"%"+a+"%":a)+"</ogc:Literal>",n+="</ogc:"+o+">"}a="and"==t.logic.toLowerCase()?"And":"Or",n="<ogc:"+a+">";return 2==t.terms.length?n+=e(t.terms[0],i):n+=e({logic:a,terms:t.terms.slice(0,t.terms.length-1)},i),n+=e(t.terms[t.terms.length-1],i),n+="</ogc:"+a+">"}(i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE "+e).WHERE,o),a+="</ogc:Filter>"),n=n.replace("{wfs_filter}",a);e=cr(this.cleanUrl(this._url),this._subdomains),a=Cesium.TrustedServers.contains(e);t.xhr=$.ajax({url:encodeURI(e),type:"POST",data:n,dataType:"xml",xhrFields:{withCredentials:a},success:function(e){var t,o;!function(t,i){if(null==t)return!1;try{let e=eval;return null!=(new XMLSerializer).serializeToString(null!=t.context?t.context:t).match(e("/[<](([a-z]+):)?"+i+"[^>]*[>]/i"))}catch(e){return!1}}($(e),"FeatureCollection")?r(null,TELang.i18n("layer_error_reading_features")):(t=e,o=[],(e=0==(e=$(t).find("gml\\:featureMember")).length?$(t).find("featureMember"):e).each(function(){var e={},t=$(this).children().first();e.layerId=t[0].nodeName,e.originFid=t.attr("fid"),e.fid=t.attr("fid"),null==e.fid&&(e.fid=-1);var i=e.fid.match(/[.]?(\d+)$$/);i&&(e.fid=i[1]),e.node=t[0],t.children().each(function(){e[this.nodeName]=this.innerHTML,null==e[this.nodeName]&&(e[this.nodeName]=$(this).text())}),o.push(e)}),e=o,r(e))},error:function(e,t,i){r(null,e.statusText)},timeout:1e4})},ur.prototype.getFeatureColumnNames=function(){if(this.featureColumnNames)return this.featureColumnNames;var e=$(this.geometryResponseData).find(this.wfsNamespace+"\\:sequence "+this.wfsNamespace+"\\:element");0==e.length&&(e=$(this.geometryResponseData).find("sequence").find("element"));var t=[];return e.each(function(){var e=$(this);"geom"!=e.attr("name").toLowerCase()&&t.push(e.attr("name").toLowerCase())}),this.featureColumnNames=t,this.featureColumnNames},ur.prototype.refresh=function(e){for(var t=this._tileManager.getAllTiles(),i=t.length,o=0;o<i;o++)t[o].data.wfsLayerData[this._guid]&&t[o].data.wfsLayerData[this._guid].freeResources(),this.loadTile(t[o]);e&&dr(this)},ur.prototype.setVisibility=function(e){if(this._visible!=e)if(0==(this._visible=e))for(var t=(o=this._tileManager.getAllTiles()).length,i=0;i<t;i++)o[i].data.wfsLayerData[this._guid]&&o[i].data.wfsLayerData[this._guid].primitive&&(o[i].data.wfsLayerData[this._guid].primitive.show=!1);else for(var o,t=(o=this._tileManager.getAllTiles()).length,i=0;i<t;i++)o[i].data.wfsLayerData[this._guid]&&(o[i].data.wfsLayerData[this._guid].primitive?o[i].data.wfsLayerData[this._guid].primitive.show=!0:this.loadTile(o[i]))},ur.prototype.loadTile=function(e){var t=this;e.data.wfsLayerData[this._guid]={id:e.data.id,primitive:void 0,freeResources:function(){Cesium.defined(this.xhr)&&(this.xhr.abort(),this.xhr=void 0),Cesium.defined(this.features)&&(t.removeFeaturesFromLayer(this.features),this.features=void 0),Cesium.defined(this.primitive)&&(t._tileManager.removeFromScene(this.primitive),this.primitive=void 0)}},this.show&&e.level>=this._level.min&&e.level<=this._level.max&&(this.statc=0,this._guide=this._guid,this.beginLoadWFSData(e))},ur.prototype.isDestroyed=function(){return!1},ur.prototype.destroy=function(){var e=this._tileManager.getAllTiles(),t=e.length;if(0<t)for(var i=0;i<t;i++)e[i].data.wfsLayerData[this._guid]&&e[i].data.wfsLayerData[this._guid].freeResources();return this._tileManager._loadTileEvent.removeEventListener(ur.prototype.loadTile,this),Cesium.destroyObject(this)},ur.prototype.sTag=function(e,t,i){if(null==this._subdomains)return"";i=(e+t+i)%this._subdomains.length;return this._subdomains[i]},ur.prototype.cleanUrl=function(e){return-1!=e.indexOf("?")?e.split("?")[0]:e},ur.prototype.beginLoadWFSData=function(t){var i,o,e;null!=this.latLon&&!this.latLon||(null==this.BoundingBox||0!=this.BoundingBox.width&&0!=this.BoundingBox.height||(this.BoundingBox.east+=1,this.BoundingBox.north+=1,this.BoundingBox.beenModified=!0),void 0!==this.BoundingBox&&void 0===Cesium.Rectangle.intersection(this.BoundingBox,t.rectangle)||(e=[_r*t.rectangle.west,_r*t.rectangle.south,_r*t.rectangle.east,_r*t.rectangle.north],o=(i=this).cleanUrl(this._url).replace("{s}",this.sTag(t.x,t.y,t.level)),o+=mr(o),o+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat=GML2&typeName="+this._layerName+"&srsName=EPSG:4326&BBOX="+e.join(","),e=Cesium.TrustedServers.contains(cr(this._url,this._subdomains)),t.data.wfsLayerData[this._guid].xhr=$.ajax({dataType:this._useWorkers?"text":"xml",url:encodeURI(o),cache:!0,xhrFields:{withCredentials:e},success:function(e){i.processWFSData(t,e)},error:function(e,t,i){"abort"!==i&&console.log("Failed to retrieve data from "+o+" :"+i)},complete:function(){t.data.wfsLayerData[i._guid].xhr=void 0}})))},ur.prototype.processWFSData=function(e,t){var i;e.data.wfsLayerData[this._guid].xhr=void 0,this._useWorkers?gr.queueWorkItem({id:e.data.id,text:t,geometryFieldName:(i=this)._geometryFieldName}).then(function(e){i.addFeaturesToTile(e)}):(t=this._gmlParser.read(t),this.addFeaturesToTile({id:e.data.id,features:t}))},ur.prototype.boundingSphereFromGML=function(e,i){var t=viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel,o=this;gr.queueWorkItem({id:"0",text:e,geometryFieldName:this._geometryFieldName}).then(function(e){e={parentLayer:o,features:e.features,sampleTerrainLevel:t+1,isQuery:!0,onFinishedQuery:function(e){var t;0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e)),i(t)}};o._entityCreator.createPrimitiveFromWFSFeatures(e)})},ur.prototype.boundingSphereFromFeature=function(e){var t,e={parentLayer:this,features:[e],sampleTerrainLevel:viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel+1,isQuery:!0,onFinishedQuery:function(e){0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e))}};return this._entityCreator.createPrimitiveFromWFSFeatures(e),t},ur.prototype.addRenderedFeatureId=function(e){null==this._addedFeatures[e]&&(this._addedFeatures[e]=0),this._addedFeatures[e]++},ur.prototype.removeRenderedFeatureId=function(e){null!=this._addedFeatures[e]&&this._addedFeatures[e]--,0==this._addedFeatures[e]&&(this._addedFeatures[e]=void 0)},ur.prototype.isExistRenderedFeatureId=function(e){return null!=this._addedFeatures[e]},ur.prototype.addFeaturesToTile=function(i,o){var r,e,n=this._tileManager.getTile(i.id);void 0!==n&&(e=o?n.data.wfsLayerData[this._guid].primitive._instanceIds:void 0,e={parentLayer:r=this,originalInstanceIds:e,features:i.features,onFinishedCreatePrimitive:function(e){var t;null!=i.features&&null!=n.data.wfsLayerData&&(n.data.wfsLayerData[r._guid].features=i.features,o||r.addFeaturesToLayer(n.data.wfsLayerData[r._guid].features),(void 0===e.length||0<e.length)&&(t=n.data.wfsLayerData[r._guid].primitive,e.show=r.show,(n.data.wfsLayerData[r._guid].primitive=e).parentLayer=r,e.parentTileId=i.id,e._guid=Cesium.createGuid(),o?r._tileManager.replaceInScene(t,e):r._tileManager.addToScene(e)))}},this._entityCreator.createPrimitiveFromWFSFeatures(e))},ur.prototype.addFeaturesToLayer=function(e){this._statistics.numberOfAddedFeatures+=e.length,this._statistics.numberOfAddePositions+=Cesium.defaultValue(e.numPositions,0);for(var t=e.length,i=0;i<t;i++)!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e[i].fid)?this._featuresMap[e[i].fid]={refCount:1,feature:e[i]}:this._featuresMap[e[i].fid].refCount++},ur.prototype.removeFeaturesFromLayer=function(e){this._statistics.numberOfDeletedFeatures+=e.length,this._statistics.numberOfDeletedPositions+=Cesium.defaultValue(e.numPositions,0);for(var t=e.length,i=0;i<t;i++)!1!==Object.prototype.hasOwnProperty.call(this._featuresMap,e[i].fid)&&(this._featuresMap[e[i].fid].refCount--,0===this._featuresMap[e[i].fid].refCount&&delete this._featuresMap[e[i].fid],this.removeRenderedFeatureId(e[i].fid))},ur.prototype.getFeature=function(e){return!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e)?null:this._featuresMap[e]},ur.prototype.updateTile=function(e){e=this._tileManager.getTile(e);void 0!==e&&(null==e.data.wfsLayerData[this._guid].features?this.loadTile(e):this.addFeaturesToTile(e.data.wfsLayerData[this._guid],!0))},ur.blockRequestPrimitiveFromPrimitive=function(e){if(null!=e){var t=pr(e);return null!=t||(e._labelCollection&&e._labelCollection._billboardCollection?t=pr(e._labelCollection._billboardCollection):e._billboardCollection&&(t=pr(e._billboardCollection))),t}},ur.prototype.resetAttributesTable=function(){this.lastEditedCell=null,this.attrTblDialogMemo=null},fr.prototype.CreateWfs=function(e,t){let i={},o,r;var n;if("point"===e?t.sgStyleJSON?i=this.getSGStyle("point",t.sgStyleJSON,t.name):(o=this.colorTool.colorRgb(this._core.defaultValue(t.color,"#ffffff")),n=this.colorTool.colorRgb(this._core.defaultValue(t.bgColor,"#010101")),i={lineToGround:{defaultValue:"0"},lineToGroundLength:{defaultValue:"0"},lineToGroundColor:{defaultValue:{red:1,green:1,blue:1,alpha:1}},altitudeMethod:0,altitudeOffset:{defaultValue:"0"},clampToGround:this._core.defaultValue(t.clampToGround,!1)},t.text&&(t.offsetX&&(t.offsetX=parseInt(t.offsetX)),t.offsetY&&(t.offsetY=parseInt(t.offsetY)),i.label={text:{defaultValue:t.text},scaleMPP:{defaultValue:"15000"},fillColor:{defaultValue:{red:o[0]/255,green:o[1]/255,blue:o[2]/255,alpha:this._core.defaultValue(t.alpha,1)}},scaleByDistance:{near:150,nearValue:1,far:8e5,farValue:.5},minViewingHeight:{defaultValue:"0"},font:{defaultValue:"12"},family:{defaultValue:this._core.defaultValue(t.font,"Arial")},backgroundColor:{defaultValue:{red:n[0]/255,green:n[1]/255,blue:n[2]/255,alpha:this._core.defaultValue(t.alpha,1)}},scale:this._core.defaultValue(t.scale,2),backgroundOpacity:{defaultValue:t.bgColor?"0.5":"0"},italic:{defaultValue:t.italic?"1":"0"},bold:{defaultValue:t.bold?"1":"0"},limitGrowth:{defaultValue:"1"},textRelativeToImage:{defaultValue:"0"},showText:{defaultValue:"0"},textAlignment:{defaultValue:"17"},pixelOffset:new Cesium.Cartesian2(this._core.defaultValue(t.offsetX,0),this._core.defaultValue(t.offsetY,t.image?-10:0)),outlineColor:Cesium.Color.fromCssColorString(this._core.defaultValue(t.outlineColor,"#ffffff")),outlineWidth:this._core.defaultValue(t.outlineWidth,2),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:"Infinity"===t.disableDepthTestDistance?Number.POSITIVE_INFINITY:t.disableDepthTestDistance}),t.outlineColor&&i.label&&(i.label.style=Cesium.LabelStyle.FILL_AND_OUTLINE),t.image&&(i.billboard={image:t.image,scale:this._core.defaultValue(t.imageScale,1),disableDepthTestDistance:t.disableDepthTestDistance,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,link:t.link})):"polyline"===e?i=t.sgStyleJSON?this.getSGStyle("polyline",t.sgStyleJSON,t.name):(o=this.colorTool.colorRgb(this._core.defaultValue(t.color,"#ffff00")),{polyline:{material:{red:o[0]/255,green:o[1]/255,blue:o[2]/255,alpha:this._core.defaultValue(t.alpha,1)},lineOpacity:this._core.defaultValue(t.alpha,1),width:this._core.defaultValue(t.width,4),clampToGround:this._core.defaultValue(t.clampToGround,!0)}}):"polygon"===e&&(i=t.sgStyleJSON?this.getSGStyle("polygon",t.sgStyleJSON,t.name):(o=this.colorTool.colorRgb(this._core.defaultValue(t.color,"#6bbeef")),{polygon:{outlineColor:{defaultValue:{red:(r=this.colorTool.colorRgb(this._core.defaultValue(t.outlineColor,"#ffffff")))[0]/255,green:r[1]/255,blue:r[2]/255,alpha:this._core.defaultValue(t.alpha,1)}},outlineWidth:1,fill:{defaultValue:this._core.defaultValue(t.alpha,1)},extrudedHeight:t.extrudedHeight,clampToGround:t.clampToGround,water:t.water,outline:this._core.defaultValue(t.outline,!0),material:{defaultValue:{red:o[0]/255,green:o[1]/255,blue:o[2]/255,alpha:this._core.defaultValue(t.alpha,1)}},fromKml:!0},altitudeMethod:2,altitudeOffset:{defaultValue:"0"}})),i||!t.sgStyleJSON)return i.position_x&&(t.lon=i.position_x,t.lat=i.position_y,t.height=i.position_z),new ur(this.Viewer,this._core.defaultValue(t.urls,i.urls),this._core.defaultValue(t.layer,i.layer),{min:this._core.defaultValue(t.minimumLevel,i.minimumLevel||0),max:this._core.defaultValue(t.maximumLevel,i.maximumLevel||22)},i,this._core.defaultValue(t.layer,i.layer),t.pID||"0",t.checked,void 0);console.log(t.name+"获取样式失败!")},fr.prototype.getSGColor=function(e){let t=parseInt(e).toString(16);return 2===t.length?t="0000"+t:4===t.length&&(t="00"+t),t="#"+t.slice(4)+t.slice(2,4)+t.slice(0,2),t},fr.prototype.getSGStyle=function(n,e,a){let s;return $.ajax({url:e,async:!1,contentType:"application/json",success:e=>{let t=(e=e&&"string"==typeof e?JSON.parse(e):e).filter(e=>e.LayerName===a);var i,o,r;"point"===n?(o=t[0],t=o.Point,t.Line_Color=this.getSGColor(t.Line_Color),t.Image_Color=this.getSGColor(t.Image_Color),t.Text_Color=this.getSGColor(t.Text_Color),t.Background_Color=this.getSGColor(t.Background_Color),i=this.colorTool.colorRgb(this._core.defaultValue(t.Text_Color,"#ffffff")),e=this.colorTool.colorRgb(this._core.defaultValue(t.Background_Color,"#010101")),s={label:{text:{defaultValue:this._core.defaultValue(t.Text.match(/<Value>(\S*)<\/Value>/)[1],t.Text.match(/<DefaultValue>(\S*)<\/DefaultValue>/)[1])},scaleMPP:{defaultValue:t.Scale},fillColor:{defaultValue:{red:i[0]/255,green:i[1]/255,blue:i[2]/255,alpha:1}},scaleByDistance:{near:0,nearValue:1,far:8e8,farValue:1},minViewingHeight:{defaultValue:"0"},font:{defaultValue:t.Text_Size},family:{defaultValue:this._core.defaultValue(t.Font,"Arial")},backgroundColor:{defaultValue:{red:e[0]/255,green:e[1]/255,blue:e[2]/255,alpha:1}},scale:this._core.defaultValue(t.TextScale,1.5),backgroundOpacity:{defaultValue:t.Background_Opacity},italic:{defaultValue:t.Italic},bold:{defaultValue:t.Bold},limitGrowth:{defaultValue:"1"},textRelativeToImage:{defaultValue:"0"},showText:{defaultValue:"0"},textAlignment:{defaultValue:"17"},pixelOffset:new Cesium.Cartesian2(this._core.defaultValue(t.offsetX,0),this._core.defaultValue(t.offsetY,t.Image_file?-10:0)),outlineColor:Cesium.Color.fromCssColorString(this._core.defaultValue(t.Line_Color,"#ffffff")),outlineWidth:this._core.defaultValue(t.outlineWidth,2),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM},lineToGround:{defaultValue:t.Line_to_Ground},lineToGroundLength:{defaultValue:t.Line_Length},lineToGroundColor:{defaultValue:{red:1,green:1,blue:1,alpha:1}},altitudeMethod:0,altitudeOffset:{defaultValue:"0"},clampToGround:this._core.defaultValue(t.clampToGround,!0),pointHeight:this._core.defaultValue(t.pointHeight,void 0),minimumLevel:this._core.defaultValue(t.level_min,0),maximumLevel:this._core.defaultValue(t.level_max,22),position_x:o.position_x,position_y:o.position_y,position_z:0==o.position_z?1e4:o.position_z,urls:o.Server,layer:o.ServerName},t.Line_Color&&s.label&&(s.label.style=Cesium.LabelStyle.FILL_AND_OUTLINE),t.Image_file&&(s.billboard={image:t.Image_file,scale:this._core.defaultValue(t.ImageScale,1),scaleMPP:{defaultValue:t.Scale},scaleByDistance:{near:0,nearValue:1,far:8e8,farValue:1},minViewingHeight:{defaultValue:"0"},verticalOrigin:Cesium.VerticalOrigin.BOTTOM})):"polyline"===n?(r=t[0],t=r.Line,t.Line_Color=this.getSGColor(t.Line_Color),t.Line_Width&&(2===t.Line_Width.length?t.Line_Width/=10:3===t.Line_Width.length&&(t.Line_Width/=100)),o=this.colorTool.colorRgb(this._core.defaultValue(t.Line_Color,"#ff0000")),s={polyline:{material:{red:o[0]/255,green:o[1]/255,blue:o[2]/255,alpha:1},lineOpacity:parseInt(this._core.defaultValue(t.Line_Opacity,1)),width:parseInt(this._core.defaultValue(t.Line_Width,4)),near:t.Near,far:t.Far,clampToGround:this._core.defaultValue(t.clampToGround,!0)},minimumLevel:this._core.defaultValue(t.level_min,0),maximumLevel:this._core.defaultValue(t.level_max,22),position_x:r.position_x,position_y:r.position_y,position_z:0==r.position_z?1e4:r.position_z,urls:r.Server,layer:r.ServerName}):"polygon"===n&&(r=t[0],t=r.data,t.fill=Cesium.Color.fromCssColorString(t.fill),t.outlineColor=Cesium.Color.fromCssColorString(t.outlineColor),s={polygon:{outlineColor:{defaultValue:t.outlineColor},outlineWidth:t.outlineWidth,fill:{defaultValue:t.fill.alpha},extrudedHeight:t.extrudedHeight||0,height:t.height,outline:t.outline,material:{defaultValue:t.fill},clampToGround:!t.extrudedHeight,fromKml:!0},altitudeMethod:2,altitudeOffset:{defaultValue:"0"},minimumLevel:this._core.defaultValue(t.level_min,0),maximumLevel:this._core.defaultValue(t.level_max,22),position_x:r.position_x,position_y:r.position_y,position_z:0==r.position_z?1e4:r.position_z,urls:r.Server,layer:r.ServerName})},error:()=>{console.log("获取样式配置失败!")}}),s};U=function(e,t,i){return t&&vr(e.prototype,t),i&&vr(e,i),e};function vr(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Cr(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Cr),this._url="http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}",this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._tilingScheme=new Cesium.WebMercatorTilingScheme({rectangleSouthwestInMeters:new Cesium.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new Cesium.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=e.style||"normal"}function wr(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we}function br(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we}function Tr(e){this._viewer=e,this._core=new V,this._tree=we}function Sr(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we}function Pr(e,t,i,o){this._extractAttributes=e,this._featureName=t||"featureMember",this._xy=o,this._gmlns=i||"http://www.opengis.net/gml",this._regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g}}function Er(){this._quadtree=void 0,this._loadTileEvent=new Cesium.Event,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE),this._tileCache=[],this._primitivesWaitingToBeAddedToTheScene=[],this._pauseStreaming=!1,this._numTilesInLevel=[],this.STREAM_SPEED_IMIDIATE=0,this.STREAM_SPEED_FAST=1,this.STREAM_SPEED_NORMAL=2,this.STREAM_SPEED_SLOW=3,this._streamSpeed=this.STREAM_SPEED_NORMAL,Er.prototype.ready||Object.defineProperties(Er.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},loadTileEvent:{get:function(){return this._loadTileEvent}},pauseStreaming:{get:function(){return this._pauseStreaming},set:function(e){this._pauseStreaming=e}},streamSpeed:{get:function(){return this._streamSpeed},set:function(e){this._streamSpeed=e}},bestLevelAvailable:{get:function(){for(var e=0,t=0;t<22;t++)null!=this._numTilesInLevel[t]&&0<this._numTilesInLevel[t]&&e<t&&(e=t);return e}}})}function xr(i,e,o){$.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection){t=t,e=Or.indexOf(t);return t._parentCollection._primitiveOld=o,-1!==e?(i.scene.primitives.remove(Or[e]._parentCollection),Or[e]=t):Or.push(t),!1}})}function Ir(e,t,i){e.scene.primitives.remove(i),t._onDestroyTilePrimitive=function(){e.scene.primitives.remove(i),this._onDestroyTilePrimitive=void 0}}function Dr(e,t,i,o){Cesium.when.all(t,function(){e.scene.primitives.remove(o)}),i._onDestroyTilePrimitive=function(){e.scene.primitives.remove(o),this._onDestroyTilePrimitive=void 0}}function Lr(e,t,i){Dr(e,$.map(t._primitives,function(e){return e.readyPromise}),t,i)}function Mr(e,t,i){Dr(e,$.map(t._primitives[0]._primitives,function(e){return e.readyPromise}),t,i)}function Ar(e,t,i){e.scene.primitives.remove(i)}function Rr(e,t,i){Dr(e,[t.readyPromise],t,i)}yr.prototype.BaiduImageryProvider=(U(Cr,[{key:"getTileCredits",value:function(e,t,i){}},{key:"requestImage",value:function(e,t,i){if(!this.ready)throw new Cesium.DeveloperError("requestImage must not be called before the imagery provider is ready.");var o=this._tilingScheme.getNumberOfXTilesAtLevel(i),r=this._tilingScheme.getNumberOfYTilesAtLevel(i),i=this._url.replace("{x}",e-o/2).replace("{y}",r/2-t-1).replace("{z}",i).replace("{s}",1).replace("{style}",this._style);return Cesium.ImageryProvider.loadImage(this,i)}},{key:"url",get:function(){return this._url}},{key:"token",get:function(){return this._token}},{key:"tileWidth",get:function(){if(!this.ready)throw new Cesium.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},{key:"tileHeight",get:function(){if(!this.ready)throw new Cesium.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},{key:"maximumLevel",get:function(){if(!this.ready)throw new Cesium.DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},{key:"minimumLevel",get:function(){if(!this.ready)throw new Cesium.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},{key:"tilingScheme",get:function(){if(!this.ready)throw new Cesium.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},{key:"rectangle",get:function(){if(!this.ready)throw new Cesium.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},{key:"ready",get:function(){return!!this._url}},{key:"credit",get:function(){return this._credit}}]),Cr),wr.prototype.createBillboardbatch=function(e){for(var t={show:!0,position:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,eyeOffset:this._cesium.Cartesian3.ZERO,heightReference:this._cesium.HeightReference.NONE,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:this._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0},i=0;i<e.length;i++){var o=e[i];t.image=o.image,this._viewer.entities.add({name:"",position:this._cesium.Cartesian3.fromDegrees(o.log,o.lat,o.height),billboard:t})}return this},wr.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=null==this.item.box.dimensions?void 0:this.item.box.dimensions.getValue(),i=null==this.item.box.fill?void 0:this.item.box.fill._value,o=this.item.box.material;null!=o&&(o={color:null==o.color._value?void 0:"rgba("+o.color._value.red+","+o.color._value.green+","+o.color._value.blue+","+o.color._value.alpha+")",image:null==o.image?void 0:o.image._value,diffusemap:null==o.diffusemap?void 0:o.diffusemap._value,alphamap:null==o.alphamap?void 0:o.alphamap._value});var r=null==this.item.box.outline?void 0:this.item.box.outline._value,n=null==this.item.box.outlineColor?void 0:"rgba("+this.item.box.outlineColor._value.red+","+this.item.box.outlineColor._value.green+","+this.item.box.outlineColor._value.blue+","+this.item.box.outlineColor._value.alpha+")",a=null==this.item.box.outlineWidth?void 0:this.item.box.outlineWidth._value,s=this.item.box.distanceDisplayCondition,l=null==s?void 0:s._value.near,u=null==s?void 0:s._value.far,s=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"box",position:{x:this._cesium.Math.toDegrees(s.longitude),y:this._cesium.Math.toDegrees(s.latitude),z:this._cesium.Math.toDegrees(s.height)},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,dimensions:t,fill:i,material:o,outline:r,outlineColor:n,outlineWidth:a,near:l,far:u}}},wr.prototype.setTreeobj=function(e){this.treeobj=e},wr.prototype.setVisibility=function(e){this.item.show=e},wr.prototype.setShow=function(e){try{this.item._box.show=e}catch(e){console.log(e)}return this},wr.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Object.defineProperties(wr.prototype,{ColorAlpha:{get:function(){return this.item._box.color._value.alpha}},Scale:{get:function(){return this.item._box.scale}},Rotation:{get:function(){return this.item._box.rotation}},Width:{get:function(){return this.item._box.width}},Height:{get:function(){return this.item._box.heightReference}},Color:{get:function(){return this._color.toHtmlColor("rgb("+255*this.item._box.backgroundColor._value.red+","+255*this.item._box.backgroundColor._value.green+","+255*this.item._box.backgroundColor._value.blue+","+255*this.item._box.backgroundColor._value.alpha+")")}}}),wr.prototype.CreateBox=function(e,t,i,o,r,n,a,s){this._postion=e;var l,i={dimensions:new this._cesium.Cartesian3(o,t,i),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.RED};r&&""!==r&&(i.outlineColor=new G(this._viewer,this._cesium).colorFromHtmlColor(r)),n&&""!==n&&(i.material=new G(this._viewer,this._cesium).colorFromHtmlColor(n)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),box:i,orientation:l});s={id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"box",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(a)?0:a),this},Object.defineProperties(wr.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),br.prototype.createBoxGeojsonFeatureLayer=function(e,t,i,o,n){var r={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:CesiumMath.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.charAt(0)&&"]"==i.material.charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a)));var a=this._core.extend(r,i,!0);null==t&&console.log("geojson is required");var i=null,i=t.then?t:this._cesium.GeoJsonDataSource.load(t),s=this;return i.then(function(e){for(var t=e.entities.values,i=[],o=0;o<t.length;o++){var r=t[o];a.polygonHierarchy=new s._cesium.PolygonHierarchy(r.polyline.positions._value,[]);r=new s._cesium.GeometryInstance({id:r,geometry:new s._cesium.PolygonGeometry(a),attributes:{color:new s._cesium.ColorGeometryInstanceAttribute.fromColor(a.material)}});i.push(r)}e=s._viewer.scene.primitives.add(new s._cesium.Primitive({geometryInstances:i,appearance:new s._cesium.PerInstanceColorAppearance({translucent:!1}),shadows:s._cesium.ShadowMode.ENABLED}));e.show=a.show,s.item=e,"function"==typeof n&&n(e)}),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),this._tree.insertGroupId({id:a.id,name:e,checked:a.show,pId:this._core.isnull(o)?0:o,type:"polylineLayer",item:this},this._core.isnull(o)?0:o),this},Tr.prototype.create=function(e,t,i={}){this.radius=Cesium.Cartesian3.distance(e,t),this.angle=(i.angle||10)/2,this.heading=this.pitch=this.roll=0,this.startPosition=e,this.endPosition=t;let o={innerRadii:new Cesium.Cartesian3(1,1,1),radii:new Cesium.CallbackProperty(()=>new Cesium.Cartesian3(this.radius,this.radius,this.radius),!1),outline:i.outline,material:Cesium.Color.RED.withAlpha(.2),outlineColor:Cesium.Color.WHITE.withAlpha(.2),maximumCone:new Cesium.CallbackProperty(()=>Cesium.Math.toRadians(-this.angle),!1),minimumCone:new Cesium.CallbackProperty(()=>Cesium.Math.toRadians(this.angle),!1)};i.color&&(o.material=Cesium.Color.fromCssColorString(i.color)),i.outlineColor&&(o.outlineColor=Cesium.Color.fromCssColorString(i.outlineColor)),this.degrees1=this._core.toDegrees(this.startPosition),this.degrees2=this._core.toDegrees(this.endPosition),this.item=this._viewer.entities.add({position:new Cesium.CallbackProperty(()=>this.startPosition,!1),ellipsoid:o}),this.updateOrientation();i={id:this.item.id,name:"锥形传感器",pId:0,type:"ellipsoid",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},Tr.prototype.updateOrientation=function(){this.heading=this._core.TwoPointAzimuth(this.degrees1.lon,this.degrees1.lat,this.degrees2.lon,this.degrees2.lat)+90;var e=Math.acos((this.degrees2.height-this.degrees1.height)/this.radius);this.pitch=Cesium.Math.toDegrees(e),this.item.orientation=Cesium.Transforms.headingPitchRollQuaternion(this.startPosition,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this._core.defaultValue(this.heading,0)),Cesium.Math.toRadians(this._core.defaultValue(this.pitch,0)),Cesium.Math.toRadians(this._core.defaultValue(this.roll,0))))},Tr.prototype.changeStart=function(e){this.startPosition=e,this.degrees1=this._core.toDegrees(this.startPosition),this.radius=Cesium.Cartesian3.distance(this.startPosition,this.endPosition),this.updateOrientation()},Tr.prototype.changeEnd=function(e){this.endPosition=e,this.degrees2=this._core.toDegrees(this.endPosition),this.radius=Cesium.Cartesian3.distance(this.startPosition,this.endPosition),this.updateOrientation()},Tr.prototype.changeAngle=function(e){this.angle=e/2},Tr.prototype.setTreeobj=function(e){this.treeobj=e},Tr.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},Tr.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Object.defineProperties(Tr.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=Cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=Cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this._postion.Yaw),Cesium.Math.toRadians(this._postion.Pitch),Cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=Cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this._postion.Yaw),Cesium.Math.toRadians(this._postion.Pitch),Cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=Cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=Cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=Cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this._postion.Yaw),Cesium.Math.toRadians(this._postion.Pitch),Cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),Sr.prototype.createCorridor=function(e,t,i,o){var r={show:!0,material:this._cesium.Color.RED.withAlpha(.5),width:1e3};if(!this._core.isnull(i)){i=this._core.extend(r,i,!0);var n=[];if(t[0].x||t[0].y)if(void 0!==t[0].z)for(a=0;a<t.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a].x,t[a].y,t[a].z));else for(a=0;a<t.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a].x,t[a].y));else if(2===t[0].length)for(var a=0;a<t.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a][0],t[a][1]));else if(3===t[0].length)for(var a=0;a<t.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a][0],t[a][1],t[a][2]));i.positions=n;i=this._viewer.entities.add({name:e,id:this._core.getuid(),corridor:i});return this.item=i,this._tree.insertGroupId({id:i.id,name:e,pId:this._core.isnull(o)?0:o,type:"corridor",item:this},this._core.isnull(o)?0:o),this}console.log("options is required")},Sr.prototype.getstyles=function(){var e={};return e.show=!this.item.ellipse.show||this.item.ellipse.show._value,e.positions=this.item.ellipse.positions?this.item.ellipse.positions.getValue().toString():void 0,e.width=this.item.ellipse.width&&this.item.ellipse.width._value?this.item.ellipse.width.toString():void 0,e.height=this.item.ellipse.height&&this.item.ellipse.height._value?this.item.ellipse.height.toString():void 0,e.heightReference=this.item.ellipse.heightReference&&this.item.ellipse.heightReference._value?this.item.ellipse.heightReference._value:void 0,e.extrudedHeight=this.item.ellipse.extrudedHeight&&this.item.ellipse.extrudedHeight.getValue()?this.item.ellipse.extrudedHeight.getValue():void 0,e.extrudedHeightReference=this.item.ellipse.extrudedHeightReference&&this.item.ellipse.extrudedHeightReference._value?this.item.ellipse.extrudedHeightReference._value:void 0,e.cornerType=this.item.ellipse.cornerType?this.item.ellipse.cornerType._value:void 0,e.material={},tyles.material.color=this.item.ellipse.material&&this.item.ellipse.material.color&&this.item.ellipse.material.color._value?this.item.ellipse.material.color.toString():void 0,e.material.image=this.item.ellipse.material&&this.item.ellipse.material.image&&this.item.ellipse.material.image._value?this.item.ellipse.material.image._value:void 0,e.material.repeat=this.item.ellipse.material&&this.item.ellipse.material.repeat&&this.item.ellipse.material.repeat._value?this.item.ellipse.material.repeat._value:void 0,e.fill=this.item.ellipse.fill?this.item.ellipse.fill._value:void 0,e.outline=this.item.ellipse.outline?this.item.ellipse.outline._value:void 0,e.outlineWidth=this.item.ellipse.outlineWidth&&this.item.ellipse.outlineWidth._value?this.item.ellipse.outlineWidth._value:void 0,e.outlineColor=this.item.ellipse.outlineColor&&this.item.ellipse.outlineColor._value?"rgba"+this.item.ellipse.outlineColor.toString():void 0,e.near=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.near:void 0,e.far=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},Sr.prototype.setVisibility=function(e){this.item.show=e},Sr.prototype.getVisibility=function(){return this.item.show},Sr.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Sr.prototype.setItem=function(e){this.item=e},Sr.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(Pr.prototype,{featureName:{get:function(){return this._featureName},set:function(e){this._featureName=e}},extractAttributes:{get:function(){return this._extractAttributes},set:function(e){this._extractAttributes=e}},xy:{get:function(){return this._xy}}}),Pr.prototype.getElementsByTagNameNS=function(e,t,i){var o=[];if(e.getElementsByTagNameNS)o=e.getElementsByTagNameNS(t,i);else for(var r,n,a=e.getElementsByTagName("*"),s=0,l=a.length;s<l;++s)n=(r=a[s]).prefix?r.prefix+":"+i:i,"*"!=i&&n!=r.nodeName||"*"!=t&&t!=r.namespaceURI||o.push(r);return o},Pr.prototype.read=function(e){for(var t=this.getElementsByTagNameNS(e.documentElement,this._gmlns,this.featureName),i=[],o=0;o<t.length;o++){var r=this.parseFeature(t[o]);r&&i.push(r)}return i},Pr.prototype.parseFeature=function(e){for(var t,i,o,r,n=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope"],a=0;a<n.length;++a)if(0<(i=this.getElementsByTagNameNS(e,this._gmlns,t=n[a])).length){(r=this.parseGeometry[t.toLowerCase()])?o=r.apply(this,[i[0]]):console.log("unsupportedGeometryType:"+t);break}for(var s,l=this.getElementsByTagNameNS(e,this._gmlns,"Box"),a=0;a<l.length;++a){var u=l[a],c=this.parseGeometry.box.apply(this,[u]),u=u.parentNode;"boundedBy"===(u.localName||u.nodeName.split(":").pop())?s=c:o=c.toGeometry()}this.extractAttributes&&(h=this.parseAttributes(e));var h={geometryType:t.toLowerCase(),positions:o,attributes:h};h.bounds=s;for(var m,d=e.firstChild;d&&(1!=d.nodeType||!(m=d.getAttribute("fid")||d.getAttribute("id")));)d=d.nextSibling;return h.fid=m,h},Pr.prototype.parseGeometry={point:function(e){var t=[],i=this.getElementsByTagNameNS(e,this._gmlns,"pos");return 0==(t=0<i.length?i[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace):t).length&&(0<(i=this.getElementsByTagNameNS(e,this._gmlns,"coordinates")).length&&(t=i[0].firstChild.nodeValue.replace(this._regExes.removeSpace,"").split(","))),0==t.length&&0<(i=this.getElementsByTagNameNS(e,this._gmlns,"coord")).length&&(e=this.getElementsByTagNameNS(i[0],this._gmlns,"X"),i=this.getElementsByTagNameNS(i[0],this._gmlns,"Y"),0<e.length&&0<i.length&&(t=[e[0].firstChild.nodeValue,i[0].firstChild.nodeValue])),2==t.length&&(t[2]=null),this.xy?[parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]:[parseFloat(t[1]),parseFloat(t[0]),parseFloat(t[2])]},multipoint:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"Point"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.point.apply(this,[t[r]]))&&i.push(o);return i},linestring:function(e,t){var i=[],o=[],r=this.getElementsByTagNameNS(e,this._gmlns,"posList");if(0<r.length)for(var n,a,s,i=this.getChildValue(r[0]).replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace),l=parseInt(r[0].getAttribute("dimension")),u=0;u<i.length/l;++u)s=u*l,n=parseFloat(i[s]),a=parseFloat(i[1+s]),s=2==l?null:parseFloat(i[2+s]),this.xy?o.push(n,a,s):o.push(a,n,s);if(0==i.length&&0<(r=this.getElementsByTagNameNS(e,this._gmlns,"coordinates")).length)for(var c=this.getChildValue(r[0]).replace(this._regExes.trimSpace,"").replace(this._regExes.trimComma,",").split(this._regExes.splitSpace),u=0;u<c.length;++u)2==(i=c[u].split(",")).length&&(i[2]=null),this.xy?o.push(parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])):o.push(parseFloat(i[1]),parseFloat(i[0]),parseFloat(i[2]));return o},multilinestring:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"LineString"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.linestring.apply(this,[t[r]]))&&i.push(o);return i},polygon:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"LinearRing"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.linestring.apply(this,[t[r],!0]))&&i.push(o);return i},multipolygon:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"Polygon"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.polygon.apply(this,[t[r]]))&&i.push(o);return i},envelope:function(e){var t,i,o=[],r=this.getElementsByTagNameNS(e,this._gmlns,"lowerCorner");0<r.length&&(n=[],2==(n=0<r.length?r[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace):n).length&&(n[2]=null),i=this.xy?new OpenLayers_Geometry_Point(n[0],n[1],n[2]):new OpenLayers_Geometry_Point(n[1],n[0],n[2]));var n,a,e=this.getElementsByTagNameNS(e,this._gmlns,"upperCorner");return 0<e.length&&(n=[],2==(n=0<e.length?e[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace):n).length&&(n[2]=null),a=this.xy?new OpenLayers_Geometry_Point(n[0],n[1],n[2]):new OpenLayers_Geometry_Point(n[1],n[0],n[2])),i&&a&&(o.push([i.x,i.y,null]),o.push([a.x,i.y,null]),o.push([a.x,a.y,null]),o.push([i.x,a.y,null]),o.push([i.x,i.y,null]),t=new OpenLayers_Geometry_Polygon([[o]])),t},box:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"coordinates"),i=null,e=null;if(0<t.length&&(2==(t=t[0].firstChild.nodeValue.split(" ")).length&&(i=t[0].split(","),e=t[1].split(","))),null!==i&&null!==e)return[parseFloat(i[0]),parseFloat(i[1]),null,parseFloat(e[0]),parseFloat(e[1]),null]}},Pr.prototype.parseAttributes=function(e){for(var t,i,o,r,n,a={},s=e.firstChild;s;){if(1==s.nodeType){for(t=s.childNodes,i=0;i<t.length;++i)1==(o=t[i]).nodeType&&(1==(r=o.childNodes).length?3!=(n=r[0]).nodeType&&4!=n.nodeType||(r=o.prefix?o.nodeName.split(":")[1]:o.nodeName,n=n.nodeValue.replace(this._regExes.trimSpace,""),a[r]=n):a[o.nodeName.split(":").pop()]=null);break}s=s.nextSibling}return a},Pr.prototype.getChildValue=function(e,t){var i=t||"";if(e)for(var o=e.firstChild;o;o=o.nextSibling)switch(o.nodeType){case 3:case 4:i+=o.nodeValue}return i},Er.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var Or=[],Hr=0;Er.prototype.onPreFrame=function(e,t){if(Hr++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;0<this._primitivesWaitingToBeAddedToTheScene.length;){var i=this._primitivesWaitingToBeAddedToTheScene.pop();e.primitives.add(i)}else 0<this._primitivesWaitingToBeAddedToTheScene.length&&Hr%this.streamSpeedFactor()==0&&((i=this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds&&100<i._instanceIds.length&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),e.primitives.add(i));$.each(Or,function(e,t){t.ready&&this.viewer.scene.primitives.remove(t._parentCollection._primitiveOld)})}},Er.prototype.updateForPick=function(e){};Math.PI;Er.prototype.placeHolder=function(e,t){t=t||Cesium.Color.fromBytes(0,255,0,255);t=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleOutlineGeometry({rectangle:e.rectangle,height:this.viewer.camera.positionCartographic.height-.99*TerraExplorer.internal.Navigate.HeightAboveGround}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0})});e.data.primitive.add(t)},Er.prototype.getTile=function(e){return this._tileCache[e]},Er.prototype.getAllTiles=function(){var e,t=[];for(e in this._tileCache)t.push(this._tileCache[e]);return t},Er.prototype.addToScene=function(e){this._primitivesWaitingToBeAddedToTheScene.push(e)},Er.prototype.removeFromScene=function(e){var t=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=t?(this._primitivesWaitingToBeAddedToTheScene[t].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(t,1)):this.viewer.scene.primitives.remove(e)},Er.prototype.replaceInScene=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else switch(e.ID!=t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),null!=e._replacmentPrimitive&&this.viewer.scene.primitives.remove(e._replacmentPrimitive),e._replacmentPrimitive=t,this.viewer.scene.primitives.add(t),t.ID.split(":")[0]){case"billboards":xr(this.viewer,t,e);break;case"labels":Ir(this.viewer,t,e);break;case"polygons":Lr(this.viewer,t,e);break;case"models":Mr(this.viewer,t,e);break;case"polylines":Rr(this.viewer,t,e);break;case"points":Ar(this.viewer,0,e);break;default:console.log("Error updating layer"),this.viewer.scene.primitives.remove(e)}};var Vr={billboards:xr,labels:Ir,polygons:Lr,models:Mr,polylines:Rr,points:Ar};Er.prototype.replaceInSceneNew=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=i?this._primitivesWaitingToBeAddedToTheScene[i]=t:(e.ID!==t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(t),i=t.ID.split(":")[0],(i=Vr[i])?i(t,e):(console.log("Error updating layer"),this.viewer.scene.primitives.remove(e)))};var kr=!(Er.prototype.update=function(e){this._quadtree.beginFrame(e),this._quadtree.render(e),this._quadtree.endFrame(e)});function Fr(){}function Gr(e){return"string"==typeof e?e.replace(/^\s+/g,"").replace(/\s+$/g,""):e}function Nr(t,e){for(var i=!1,o=0,r="",n=0;n<e.length;n++)!i&&/['"`]/.test(e[n])?i=e[n]:i&&e[n]==i?i=!1:i||"("!=e[n]?i||")"!=e[n]||o--:o++,e[n]==t&&(0<o||i)?r+="######":r+=e[n];return e=(e=(e=r).split(t)).map(function(e){return Gr(e.replace(new RegExp("######","g"),t))})}function Br(e){for(var t="#",i=e.length,o=0;o<i;o++)t+=e[o]+"#";return t}function jr(e){for(var t="",i=e.length,o=1;o<i;o+=2)t+=e[o];return t}function zr(e){this.source=e,this.cursor=0,this.currentChar="",this.readNextChar()}function Ur(e){this.lexer=new zr(e),this.currentToken="",this.readNextToken()}function Wr(e,t){var i="";return void 0!==e.logic?(i=(i=e.terms.map(function(e){return Wr(e,!0)})).join(" "+e.logic+" "),void 0!==t&&(i="("+i+")")):void 0!==e.left?(i=e.left,void 0!==e.operator&&(i+=" "+e.operator,void 0!==e.right&&("IN"===e.operator?i+=" ("+e.right+")":i+=" "+e.right))):i=e,i}function Yr(e){var t,i=0;if(0===e.length)return i;for(t=0;t<e.length;t++)i=(i<<5)-i+e.charCodeAt(t),i|=0;return i}function qr(e){for(var t=[],i=0;i<e.length;i++)for(var o=0;o<e[i].positions.length;o+=3)t.push(Cesium.Cartographic.fromDegrees(e[i].positions[o+0],e[i].positions[o+1],0));return t}function Qr(e,t,i,o){for(var r=0,n=0;n<e.length;n++)for(var a=o?sn:i(e[n]),s=2;s<e[n].positions.length;s+=3){null==t[r].height&&(t[r].height=0),null==e[n].absoluteHeightPositions&&(e[n].absoluteHeightPositions=[]),e[n].absoluteHeightPositions[s-2]=e[n].positions[s-2],e[n].absoluteHeightPositions[s-1]=e[n].positions[s-1],e[n].absoluteHeightPositions[+s]=e[n].positions[+s];var l=o?0:e[n].positions[s];e[n].absoluteHeightPositions[s]=l+t[r].height+a,r++}}function Jr(e,t){this._style=e||{},t.scene.onHoverShowTextArray={},t.scene._lastObjectShowOnText=null,this.setEyeOffset=function(e,t){void 0===t&&(t=0),e.eyeOffset=Cesium.DynamicEyeOffset(t)},this.viewer=t}function Xr(e,t){for(var i=e.length,o=0;o<i;o++){var r=t(e[o]);if("polygon"==e[o].geometryType||"multipolygon"==e[o].geometryType){for(var n=e[o],a=n.positions.length,s=0;s<a;s++){for(var l=n.positions[s],u=2;u<l.length;u+=3)l[u]+=r;n.positions[s]=l}e[o]=n}else{for(var c=e[o],h=c.positions.length,s=2;s<h;s+=3)c.positions[s]+=r;e[o]=c}}return e}function Kr(e,t){if(null==e.isQuery)if(null==e.originalInstanceIds){if(e.parentLayer.isExistRenderedFeatureId(t))return}else if(-1==e.originalInstanceIds.indexOf(t))return;return 1}function $r(t){return function(e){e=Number(t.applyConditionalClassification(t._style.altitudeOffset,e.attributes));return e=isNaN(e)?0:e}}function Zr(e){if("string"!=typeof e)return e;var t=Number(e);if(isNaN(t))return e;var i=t.toString(16);if(i.length<6&&null!=i)for(var o=i.length;o<6;)i="0"+i,o++;e=Cesium.Color.fromCssColorString("#"+i);return null!=e&&(t=e.red,e.red=e.blue,e.blue=t),e}function en(e){if(null!=e){var t=parseInt(e);if(null!=e.alpha||isNaN(t))return e;t<0&&(t&=16777215);var i=t.toString(16);if(i.length<6&&null!=i)for(var o=i.length;o<6;)i="0"+i,o++;e=(e="#"+i).substring(0,7),t=Cesium.Color.fromCssColorString(e);return null!=t&&(e=t.red,t.red=t.blue,t.blue=e),t}}function tn(e){return isNaN(e)?e:parseFloat(e)}function on(e,i){var t,o=[];return $.each(e.attributeNames,function(e,t){o.push(tn(i[t]))}),1===o.length?t=e.func(o[0]):2===e.attributeNames.length?t=e.func(o[0],o[1]):3===e.attributeNames.length?t=e.func(o[0],o[1],o[2]):4===e.attributeNames.length&&(t=e.func(o[0],o[1],o[2],o[3])),t}function rn(e,t,i){return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),i)}Er.prototype.initialize=function(e){kr||(this.viewer.scene.preRender.addEventListener(this.onPreFrame,this),kr=!0)},Er.prototype.beginUpdate=function(e){this.quadtree.beginFrame(e)},Er.prototype.endUpdate=function(e){var t=this;e.afterRender.push(function(){t.quadtree.endFrame(e)})},Er.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)},Er.prototype.loadTile=function(e,t){var i=this;null==this._numTilesInLevel[t._level]&&(this._numTilesInLevel[t._level]=0),this._numTilesInLevel[t._level]++,t.state===Cesium.QuadtreeTileLoadState.START&&(t.data={primitive:new Cesium.PrimitiveCollection,wfsLayerData:[],id:Cesium.createGuid(),freeResources:function(){if(i._tileCache[t.data.id]&&i._numTilesInLevel[t._level]--,i._numTilesInLevel[t._level]<0&&(i._numTilesInLevel[t._level]=0),Cesium.defined(this.wfsLayerData)){for(var e in this.wfsLayerData)Cesium.defined(this.wfsLayerData[e])&&this.wfsLayerData[e].freeResources();this.wfsLayerData=void 0}Cesium.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete i._tileCache[t.data.id]}},this._tileCache[t.data.id]=t,Math.abs(6371e3*(t.rectangle.south-t.rectangle.north)),t.data.boundingSphere3D=Cesium.BoundingSphere.fromRectangle3D(t.rectangle),t.data.boundingSphere2D=Cesium.BoundingSphere.fromRectangle2D(t.rectangle,e.mapProjection),t.rectangle.west,t.rectangle.south,t.rectangle.east,t.rectangle.north,this.loadTileEvent.raiseEvent(t),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)},Er.prototype.computeTileVisibility=function(e,t,i){var o=this.computeDistanceToTile(e,t);if(e._distance=o,t.fog.enabled&&1<=Cesium.Math.fog(o,t.fog.density))return Cesium.Visibility.NONE;var r=e.data;if(r.tileBoundingRegion,void 0===r.boundingVolumeSourceTile)return Cesium.Visibility.PARTIAL;var n=t.cullingVolume,a=r.orientedBoundingBox;!a&&r.renderedMesh&&(a=r.renderedMesh.boundingSphere3D),r.clippedByBoundaries=!1;var s,l,u=(s=e.rectangle,(l=this.cartographicLimitRectangle).west<l.east||(l=Rectangle.clone(l,splitCartographicLimitRectangleScratch),0<Rectangle.center(s,rectangleCenterScratch).longitude?l.east=CesiumMath.PI:l.west=-CesiumMath.PI),l),o=new Cesium.Rectangle,o=Cesium.Rectangle.simpleIntersection(u,e.rectangle,o);if(!o)return Visibility.NONE;if(Cesium.Rectangle.equals(o,e.rectangle)||(r.clippedByBoundaries=!0),t.mode,Cesium.SceneMode.SCENE3D,!a)return Cesium.Intersect.INTERSECTING;o=this._clippingPlanes;if(o&&o.enabled){o=o.computeIntersectionWithBoundingVolume(a);if(e.isClipped=o!==Intersect.INSIDE,o===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE}n=n.computeVisibility(a);if(n===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE;a=t.mode===Cesium.SceneMode.SCENE3D&&t.camera.frustum instanceof Cesium.OrthographicFrustum;if(t.mode!==Cesium.SceneMode.SCENE3D||a||!i)return n;r=r.occludeePointInScaledSpace;return!r||i.ellipsoid.isScaledSpacePointVisible(r)?n:Cesium.Visibility.NONE},Er.prototype.canRefine=function(e,t,i){return e.level<16},Er.prototype.showTileThisFrame=function(e,t,i,o){e.data.geometryPrimitive&&e.data.geometryPrimitive.update(t,i,o)},Er.prototype.computeDistanceToTile=function(e,t){var i,o,r,n,a,s,l,u,c,h=(i=e,this.terrainProvider,void 0===(o=void 0===(o=i.data)?i.data=new Cesium.GlobeSurfaceTile:o).tileBoundingRegion&&(o.tileBoundingRegion=new Cesium.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:i.rectangle,ellipsoid:i.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0})),i),m=e.data,d=m.tileBoundingRegion;if(void 0===h)return 9999999999;m.boundingVolumeSourceTile!==h&&(m.boundingVolumeSourceTile=h,(p=e.rectangle)&&p.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(m.orientedBoundingBox=Cesium.OrientedBoundingBox.fromRectangle(e.rectangle,d.minimumHeight,d.maximumHeight,e.tilingScheme.ellipsoid,m.orientedBoundingBox),m.occludeePointInScaledSpace=(r=this,n=m.orientedBoundingBox.center,a=e.rectangle,s=d.maximumHeight,l=m.occludeePointInScaledSpace,u=r.quadtree._occluders.ellipsoid,c=u.ellipsoid,r=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],Cesium.Cartesian3.fromRadians(a.west,a.south,s,c,r[0]),Cesium.Cartesian3.fromRadians(a.east,a.south,s,c,r[1]),Cesium.Cartesian3.fromRadians(a.west,a.north,s,c,r[2]),Cesium.Cartesian3.fromRadians(a.east,a.north,s,c,r[3]),u.computeHorizonCullingPoint(n,r,l))));var h=d.minimumHeight,p=d.maximumHeight;m.boundingVolumeSourceTile!==e&&(m=t.camera.positionCartographic.height,e=Math.abs(m-h),Math.abs(m-p)<e?(d.minimumHeight=h,d.maximumHeight=h):(d.minimumHeight=p,d.maximumHeight=p));t=d.distanceToCamera(t);return d.minimumHeight=h,d.maximumHeight=p,t},Er.prototype.isDestroyed=function(){return!1},Er.prototype.destroy=function(){return Cesium.destroyObject(this)},Er.prototype.remove=function(){this.destroy()},Er.prototype.getInstance=function(e){var t;return 0==Cesium.defined(e.TileManager)&&(t=new Er,(e.TileManager=t).viewer=e,t=new Cesium.QuadtreePrimitive({tileProvider:e.TileManager,maximumScreenSpaceError:2}),e.scene.primitives.add(t)),e.TileManager},Fr.sql2ast=function(r,e){function n(e,t){return t}null==e&&(e=!0);var t="###semi-colon###";r=(r=(r=(r=r.replace(/[("'`].*;.*[)"'`]/g,function(e){return e.replace(/;/g,t)})).replace(/;/g,"###EOR###")).split("###EOR###")[0]).replace(new RegExp(t,"g"),";");var i=["SELECT","FROM","DELETE FROM","INSERT INTO","UPDATE","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","ORDER BY","GROUP BY","HAVING","WHERE","LIMIT","VALUES","SET"],o=i.map(function(e){return e+" "}),a=(o=(o=o.concat(i.map(function(e){return e+"("}))).concat(o.map(function(e){return e.toLowerCase()}))).map(function(e){return e.replace("(","[\\(]")});r=r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(a.join("|"),"gi"),Br)});var s=[];o.forEach(function(e){var t,i,o=0;do{}while(-1!=(i=r.indexOf(e,o))&&(t=e.replace(/^((\w|\s)+?)\s?\(?$/i,n),o=i+(s[i]=t).length),-1!=i)});var l=0;s.forEach(function(e,t){t<l?delete s[t]:(l=parseInt(t,10)+e.length,"JOIN"==e&&(s[t]="INNER JOIN"))});var u=a.slice(0);u=(u=u.map(Br)).join("|");var c=r.split(new RegExp(a.join("|"),"i"));r=r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(u,"gi"),jr)});var c=c.map(function(e){return e.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(u,"gi"),jr)})}),h=[];h.SELECT=function(e){return Nr(",",e).filter(function(e){return""!==e}).map(function(e){return{name:e}})},h.SET=function(e){return Nr(",",e).filter(function(e){return""!==e}).map(function(e){return{expression:e}})},h.FROM=h["DELETE FROM"]=h.UPDATE=function(e){var i=e.split(",");return(i=i.map(Gr)).forEach(function(e,t){""===e&&i.splice(t)}),i=i.map(function(e){var t=e.split(" AS "),e=t[1]||"";return 0===e.indexOf('"')&&e.lastIndexOf('"')==e.length-1&&(e=e.substring(1,e.length-1)),{table:t[0],as:e}})},h["LEFT JOIN"]=h.JOIN=h["INNER JOIN"]=h["RIGHT JOIN"]=function(e){var t=(e=e.split(" ON "))[0].split(" AS "),i={};return i.table=Gr(t[0]),i.as=Gr(t[1])||"",i.cond=Gr(e[1]),i},h.WHERE=Gr,h["ORDER BY"]=function(e){e=e.split(",");var o=[];return e.forEach(function(e,t){var i=/([A-Za-z0-9_\.]+)\s*(ASC|DESC){0,1}/gi;null!==(i=i.exec(e))&&((e={}).column=Gr(i[1]),e.order=Gr(i[2]),void 0===i[2]&&(e.order="ASC"),o.push(e))}),o},h["GROUP BY"]=function(e){e=e.split(",");var o=[];return e.forEach(function(e,t){var i=/([A-Za-z0-9_\.]+)/gi;null!==(i=i.exec(e))&&((e={}).column=Gr(i[1]),o.push(e))}),o},h.LIMIT=function(e){var t=/((\d+)\s*,\s*)?(\d+)/gi;void 0===(t=t.exec(e))[2]&&(t[2]=0);e={};return e.nb=parseInt(Gr(t[3]),10),e.from=parseInt(Gr(t[2]),10),e},h["INSERT INTO"]=function(e){var t=(t=/([A-Za-z0-9_\.]+)\s*(\(([A-Za-z0-9_\., ]+)\))?/gi).exec(e),e={};return e.table=Gr(t[1]),void 0!==t[3]&&(e.columns=t[3].split(","),e.columns=e.columns.map(Gr)),e},h.VALUES=function(e){var e=Nr(",",e="("!=(e=Gr(e))[0]?"("+e:e),t=[];return e.forEach(function(e){e=Nr(",",e=e.replace(/^\(/g,"").replace(/\)$/g,"")),t.push(e)}),t};var m={},d=0;return s.forEach(function(e,t){var i,o;e=e.toUpperCase(),d++,void 0!==h[e]?(i=h[e](c[d]),void 0!==m[e]?("string"!=typeof m[e]&&void 0!==m[e][0]||(o=m[e],m[e]=[],m[e].push(o)),m[e].push(i)):m[e]=i):console.log("Can't analyze statement \""+e+'"')}),void 0!==m["LEFT JOIN"]&&(void 0===m.JOIN&&(m.JOIN=[]),void 0!==m["LEFT JOIN"][0]?m["LEFT JOIN"].forEach(function(e){e.type="left",m.JOIN.push(e)}):(m["LEFT JOIN"].type="left",m.JOIN.push(m["LEFT JOIN"])),delete m["LEFT JOIN"]),void 0!==m["INNER JOIN"]&&(void 0===m.JOIN&&(m.JOIN=[]),void 0!==m["INNER JOIN"][0]?m["INNER JOIN"].forEach(function(e){e.type="inner",m.JOIN.push(e)}):(m["INNER JOIN"].type="inner",m.JOIN.push(m["INNER JOIN"])),delete m["INNER JOIN"]),void 0!==m["RIGHT JOIN"]&&(void 0===m.JOIN&&(m.JOIN=[]),void 0!==m["RIGHT JOIN"][0]?m["RIGHT JOIN"].forEach(function(e){e.type="right",m.JOIN.push(e)}):(m["RIGHT JOIN"].type="right",m.JOIN.push(m["RIGHT JOIN"])),delete m["RIGHT JOIN"]),e&&("string"==typeof m.WHERE&&(m.WHERE=Ur.parse(m.WHERE)),void 0!==m.JOIN&&m.JOIN.forEach(function(e,t){m.JOIN[t].cond=Ur.parse(e.cond)})),m},zr.prototype={constructor:zr,readNextChar:function(){"string"!=typeof this.source?this.currentChar="":this.currentChar=this.source[this.cursor++]||""},readNextToken:function(){return/\w|[-]/.test(this.currentChar)?this.readWord():/["'`]/.test(this.currentChar)?this.readString():/[()]/.test(this.currentChar)?this.readGroupSymbol():/[!=<>]/.test(this.currentChar)?this.readOperator():""===this.currentChar?{type:"eot",value:""}:(this.readNextChar(),{type:"empty",value:""})},readWord:function(){for(var e="",t=0,i=!1;/./.test(this.currentChar);){if(!i&&/['"`]/.test(this.currentChar))i=this.currentChar;else if(i&&this.currentChar==i)i=!1;else{if(!i){if(")"==this.currentChar&&t<=0)break;if("("==this.currentChar?t++:")"==this.currentChar&&t--,/[!=<>]/.test(this.currentChar))break}if(" "==this.currentChar&&t<=0)break}e+=this.currentChar,this.readNextChar()}return/^(AND|OR)$/i.test(e)?{type:"logic",value:e}:/^(IN|IS|NOT|LIKE)$/i.test(e)?{type:"operator",value:e}:{type:"word",value:e}},readString:function(){var e="",t=this.currentChar;for(e+=this.currentChar,this.readNextChar();this.currentChar!=t&&""!==this.currentChar;)e+=this.currentChar,this.readNextChar();return e+=this.currentChar,this.readNextChar(),"."==this.currentChar?(e+=this.currentChar,this.readNextChar(),{type:"word",value:e+=this.readString().value}):{type:"string",value:e}},readGroupSymbol:function(){var e=this.currentChar;return this.readNextChar(),{type:"group",value:e}},readOperator:function(){var e=this.currentChar;return this.readNextChar(),/[=<>]/.test(this.currentChar)&&(e+=this.currentChar,this.readNextChar()),{type:"operator",value:e}}},zr.tokenize=function(e){var t=new zr(e),i=[];do{var o=t.readNextToken()}while("empty"!=o.type&&i.push(o),t.currentChar);return i},Ur.prototype={constructor:Ur,readNextToken:function(){for(this.currentToken=this.lexer.readNextToken();"empty"==this.currentToken.type;)this.currentToken=this.lexer.readNextToken();return this.currentToken},parseExpressionsRecursively:function(){return this.parseLogicalExpression()},parseLogicalExpression:function(){for(var e=this.parseConditionExpression();"logic"==this.currentToken.type;){var t=this.currentToken.value;this.readNextToken();var i=this.parseConditionExpression();void 0!==e.logic&&e.logic==t&&void 0!==e.terms?e.terms.push(i):e={logic:t,terms:[e,i].slice(0)}}return e},parseConditionExpression:function(){var e,t=this.parseBaseExpression();return"operator"==this.currentToken.type&&(e=this.currentToken.value,this.readNextToken(),"operator"==this.currentToken.type&&(e+=" "+this.currentToken.value,this.readNextToken()),t={operator:e,left:t,right:this.parseBaseExpression()}),t},parseBaseExpression:function(){var e="";return"word"==this.currentToken.type||"string"==this.currentToken.type?(e=this.currentToken.value,this.readNextToken()):"group"==this.currentToken.type&&(this.readNextToken(),e=this.parseExpressionsRecursively(),this.readNextToken()),e}},Ur.parse=function(e){return new Ur(e).parseExpressionsRecursively()},Fr.ast2sql=function(e){function t(e){return void 0!==e.WHERE?" WHERE "+Wr(e.WHERE):""}var i,o;return void 0!==e.SELECT&&void 0!==e.FROM?(void 0!==(o=e).SELECT?"SELECT "+o.SELECT.map(function(e){return e.name}).join(", "):"")+function(e){if(void 0===e.FROM)return"";var t=" FROM ";return t+=e.FROM.map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", ")}(e)+function(e){if(void 0===e.JOIN)return"";var t="";return e.JOIN.forEach(function(e){t+=" "+e.type.toUpperCase()+" JOIN "+e.table,""!==e.as&&(t+=" AS "+e.as),t+=" ON "+Wr(e.cond)}),t}(e)+t(e)+function(e){if(void 0===e["GROUP BY"])return"";var t=" GROUP BY ";return t+=e["GROUP BY"].map(function(e){return e.column}).join(", ")}(e)+function(e){if(void 0===e["ORDER BY"])return"";var t=" ORDER BY ";return t+=e["ORDER BY"].map(function(e){return e.column+" "+e.order}).join(", ")}(e)+function(e){if(void 0!==e.LIMIT&&void 0!==e.LIMIT.nb&&0<parseInt(e.LIMIT.nb,10)){var t=" LIMIT ";return void 0!==e.LIMIT.from&&1<parseInt(e.LIMIT.from,10)&&(t+=e.LIMIT.from+","),t+=e.LIMIT.nb}return""}(e):void 0!==e["INSERT INTO"]?function(e){if(void 0===e["INSERT INTO"])return"";var t="INSERT INTO "+e["INSERT INTO"].table;return void 0!==e["INSERT INTO"].columns&&(t+=" (",t+=e["INSERT INTO"].columns.join(", "),t+=")"),t}(e)+function(e){if(void 0===e.VALUES)return"";var t=" VALUES ";return t+=e.VALUES.map(function(e){return"("+e.join(", ")+")"}).join(", ")}(e):void 0!==e.UPDATE?function(e){if(void 0===e.UPDATE)return"";var t="UPDATE ";return t+=e.UPDATE.map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", ")}(e)+(void 0!==(i=e).SET?" SET "+i.SET.map(function(e){return e.expression}).join(", "):"")+t(e):void 0!==e["DELETE FROM"]?function(e){if(void 0===e["DELETE FROM"])return"";var t="DELETE FROM ";return t+=e["DELETE FROM"].map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", ")}(e)+t(e):null},Fr.trim=Gr,Fr.protect=Br,Fr.unprotect=jr,Fr.protect_split=Nr,Fr.CondLexer=zr,Fr.CondParser=Ur;var nn=qr,an=Qr,sn=1;Object.defineProperties(Jr.prototype,{style:{get:function(){return this._style},set:function(e){this._style=e}}}),Jr.prototype.clonePartOfMultiFeature=function(e,t){return{positions:e.positions[t],attributes:e.attributes,fid:e.fid,geometryType:e.geometryType}},Jr.prototype.createPrimitiveFromWFSFeatures=function(e){new Cesium.PrimitiveCollection;for(var t=[],i=[],o=[],r=e.features.numPositions=0;r<e.features.length;r++){var n=e.features[r];switch(this.sanitizePositions(n.positions),e.features.numPositions+=n.positions.length,n.geometryType){case"polygon":t.push(n);break;case"multipolygon":for(var a=n.positions.length,s=0;s<a;s++)t.push(this.clonePartOfMultiFeature(n,s));break;case"linestring":i.push(n);break;case"multilinestring":for(a=n.positions.length,s=0;s<a;s++)i.push(this.clonePartOfMultiFeature(n,s));break;case"point":o.push(n);break;case"multipoint":for(a=n.positions.length,s=0;s<a;s++)o.push(this.clonePartOfMultiFeature(n,s))}}0<t.length?(e.features=t,this.createPolygonPrimitive(e)):0<i.length?(e.features=i,this.createLinestringPrimitive(e)):0<o.length&&(e.features=o,this.createPointPrimitive(e))},Jr.prototype.createPolygonPrimitive=function(i){function o(e){if(e.isQuery)e.onFinishedQuery(a);else{for(var t,i,o,r,n="",a=[],s=[],l=[],u=[],c=[],h=0;h<e.features.length;h++){var m,d,p,g=e.features[h];Kr(e,g.fid)&&(d=g.absoluteHeightPositions||g.positions,m=_.createPolygonOptions(d,g.attributes),d=_.createCommonOptions(g.attributes),g.absoluteHeightPositions&&delete g.absoluteHeightPositions,a.push(Cesium.BoundingSphere.fromPoints(m.hierarchy.positions)),e.isQuery||(m.outline&&(p=_.createPolygonGeometryHelper(Cesium.PolygonOutlineGeometry,g,m.hierarchy,m.outlineColor,m.perPositionHeight,m.extrudedHeight,m.height),l.push(p)),m.fill&&(p=_.createPolygonGeometryHelper(Cesium.PolygonGeometry,g,m.hierarchy,m.material,m.perPositionHeight,m.extrudedHeight,m.height,m.water),s.push(p)),e.parentLayer.addRenderedFeatureId(g.fid),n+=g.fid+";",u.push(g.fid),c.push(d.tooltip)))}""!=n&&(t=new Cesium.PrimitiveCollection,o=new Cesium.PerInstanceColorAppearance({flat:!0,translucent:m.material.alpha<1}),0<s.length&&(m.water&&(r={color:m.water.color||"rgba(135,206,235,0.6)",image:m.water.image||window.SmartEarthRootUrl+D.water,frequency:m.water.frequency||1e3,speed:m.water.speed||10,amplitude:m.water.amplitude||10},i=Cesium.Color.fromCssColorString(r.color),o=new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:i,blendColor:i,normalMap:r.image,frequency:r.frequency,animationSpeed:r.speed/1e3,amplitude:r.amplitude}}})})),((r=m.clampToGround||!m.perPositionHeight&&!m.extrudedHeight&&!m.height?new Cesium.GroundPrimitive({geometryInstances:s,appearance:o,classificationType:m.classificationType}):new Cesium.Primitive({geometryInstances:s,appearance:o}))._parentCollection=t).add(r)),0<l.length&&(m.clampToGround||((r=new Cesium.Primitive({geometryInstances:l,appearance:o}))._parentCollection=t).add(r)),t.ID="polygons:"+Yr(n),t._instanceIds=u,t._tooltips=c,e.onFinishedCreatePrimitive(t,a))}}var e,_=this;3==this.style.altitudeMethod?(i.features=Xr(i.features,$r(_)),o(i)):(e=function(e){for(var t=[],i=e.length,o=0;o<i;o++)for(var r=e[o],n=r.positions.length,a=0;a<n;a++)for(var s=r.positions[a],l=0;l<s.length;l+=3)t.push(Cesium.Cartographic.fromDegrees(s[l+0],s[l+1],0));return t}(i.features),e=Cesium.sampleRenderedData(e,Cesium.SampleRenderedDataFlags.TERRAIN|Cesium.SampleRenderedDataFlags.FLOOR),Cesium.when(e,function(e){var t=2==_._style.altitudeMethod;(function(e,t,i,o){for(var r=0,n=0;n<e.length;n++){var a=e[n],s=o?sn:i(a);null==a.absoluteHeightPositions&&(a.absoluteHeightPositions=[]);for(var l=0;l<a.positions.length;l++)for(var u=a.positions[l],c=a.absoluteHeightPositions[l]=[],h=2;h<u.length;h+=3){var m=o?0:u[h];null==t[r].height&&(t[r].height=0),c[h-2]=u[h-2],c[h-1]=u[h-1],c[+h]=u[+h],c[h]=m+t[r].height+s,r++}}})(i.features,e,$r(_),t),o(i)}))},Jr.prototype.createPolygonGeometryHelper=function(e,t,i,o,r,n,a,s){var l=null!=n?Cesium.PerInstanceColorAppearance.VERTEX_FORMAT:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,a=new e({polygonHierarchy:i,vertexFormat:l=void 0!==s||void 0!==a?Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT:l,perPositionHeight:void 0!==a?void 0:r,extrudedHeight:n,height:a});return new Cesium.GeometryInstance({geometry:a,id:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(o)}})},Jr.prototype.createLinestringPrimitive=function(i){function o(i){if(i.isQuery)i.onFinishedQuery(r);else{var e,o="",r=[],n=[],a=[];let t=new Cesium.PrimitiveCollection;for(var s,l=0;l<i.features.length;l++){var u=i.features[l];if(Kr(i,u.fid)){var c=u.absoluteHeightPositions||u.positions,h=p.createLinestringOptions(c,u.attributes),m=p.createCommonOptions(u.attributes);if(h.vertexFormat=(e?Cesium.PerInstanceColorAppearance:Cesium.PolylineColorAppearance).VERTEX_FORMAT,u.absoluteHeightPositions&&delete u.absoluteHeightPositions,r.push(Cesium.BoundingSphere.fromPoints(h.positions)),!i.isQuery){var d,c=h.clampToGround?(d=new Cesium.GroundPolylineGeometry({positions:h.positions,width:h.width}),new Cesium.GeometryInstance({id:u,geometry:d,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}})):(d=new Cesium.PolylineGeometry(h),new that._cesium.GeometryInstance({id:u,geometry:d,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}}));i.parentLayer.addRenderedFeatureId(u.fid),o+=u.fid+";",n.push(u.fid),a.push(m.tooltip);let e=null;e=h.clampToGround?new Cesium.GroundPolylinePrimitive({geometryInstances:c,appearance:new Cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:h.material}}}),faceForward:!0,flat:!1}),classificationType:h.classificationType}):new Cesium.Primitive({geometryInstances:c,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:h.material}}})})}),t.add(e)}}}""!=o&&((s=t).ID="polylines:"+Yr(o),s._instanceIds&&0===s._instanceIds.length&&(s._instanceIds=n),s._tooltips=a,i.onFinishedCreatePrimitive(s,r))}}var e,p=this;3==this.style.altitudeMethod?(i.features=Xr(i.features,$r(p)),o(i)):(e=qr(i.features),e=Cesium.sampleRenderedData(e,Cesium.SampleRenderedDataFlags.TERRAIN|Cesium.SampleRenderedDataFlags.FLOOR),Cesium.when(e,function(e){var t=2==p._style.altitudeMethod;Qr(i.features,e,$r(p),t),o(i)}))},Jr.prototype.createPointPrimitive=function(i){function o(e){if(e.isQuery)e.onFinishedQuery(n);else{for(var t,i,o="",r=[],n=[],a=[],s=new Cesium.LabelCollection({scene:v.viewer.scene}),l=new Cesium.PointPrimitiveCollection({scene:v.viewer.scene}),u=new Cesium.BillboardCollection({scene:v.viewer.scene}),c=new Cesium.PrimitiveCollection,h=new Cesium.PolylineCollection,m=0;m<e.features.length;m++){var d,p,_,f,y=e.features[m];Kr(e,y.fid)&&(p=y.absoluteHeightPositions||y.positions,d=v.createPointOptions(p,y.attributes),p=v.createCommonOptions(y.attributes),y.clampToGround=d.clampToGround,d.sgsPointPosition&&(y.sgsPointPosition=d.sgsPointPosition,delete d.sgsPointPosition),y.absoluteHeightPositions&&delete y.absoluteHeightPositions,n.push(Cesium.BoundingSphere.fromPoints([d.position])),e.isQuery||(d.label&&(d.label.position=d.position,d.label.id=y,v.setEyeOffset(d.label),null!=d.label.imageFile&&(d.label.image=v.applyConditionalClassification(d.label.imageFile,y.attributes),d.label.label=d.label,u.add(d.label),v.setEyeOffset(d.label,-5)),null!=d.label.imageFile&&null!=d.label.showText&&d.label.showText&&(v.viewer.scene.onHoverShowTextArray[d.label.id]=!0),null!=d.label.isBold&&d.label.isBold?s.add(g):null!=d.label.isUnderline&&d.label.isUnderline?(_=null!=d.label.text.match(/[iljf1]/g)?d.label.text.match(/[iljf1]/g):[],f=d.label.text.length,f=Array(Math.ceil(f-.5*_.length)).join("_"),_=$.extend({},d.label),null!=d.label.image&&delete d.label.image,_.position=d.label.position,_.id=d.label.id,_.text=f,_.alignment=null!=d.label.alignment?d.label.alignment:void 0,_.underline=!0,_.textRelativeToImage=null!=d.label.textRelativeToImage?d.label.textRelativeToImage:void 0,-1<d.label.font.indexOf("pt")?Number(d.label.font.split("pt")[0]):-1<d.label.font.indexOf("px")&&Number(d.label.font.split("px")[0]),_.pixelOffset=new Cesium.Cartesian2(0,-45),s.add(_)):s.add(d.label)),d.billboard&&(d.billboard.position=d.position,d.billboard.id=y,v.setEyeOffset(d.billboard),u.add(d.billboard)),d.model&&(d.model.url=d.model.uri,d.model.id=y,c.add(Cesium.Model.fromGltf(d.model))),d.point&&(d.point.position=d.position,d.point.id=y,v.setEyeOffset(d.point),l.add(d.point)),0!=d.lineToGround&&(f=Cesium.Cartographic.fromCartesian(d.position),_=Cesium.Cartesian3.fromRadians(f.longitude,f.latitude,0),2==d.lineToGround&&(f=d.lineToGroundLength/Cesium.Cartesian3.distance(d.position,_),Cesium.Cartesian3.lerp(d.position,_,f,_)),h.add({show:!0,width:1,positions:[d.position,_],material:Cesium.Material.fromType("Color",{color:d.lineToGroundColor})})),e.parentLayer.addRenderedFeatureId(y.fid),o+=y.fid+";",r.push(y.fid),a.push(p.tooltip)))}""!=o&&(i=new Cesium.PrimitiveCollection,0<s.length&&($.each(s._labels,function(e,t){t._type="Label"}),(s._billboardCollection._parentCollection=i).add(s),t="labels"),0<u.length&&($.each(u._billboards,function(e,t){t._type="Billboard"}),(u._parentCollection=i).add(u),t="billboards"),0<c.length&&($.each(c._primitives,function(e,t){t._type="Model",t._parentCollection=i}),i.add(c),t="models"),0<l.length&&($.each(l._pointPrimitives,function(e,t){t._type="Point"}),(l._parentCollection=i).add(l),t="points"),0<h.length&&($.each(h._polylines,function(e,t){t._type="L2G"}),(h._parentCollection=i).add(h),t="L2G"),i.ID=t+":"+Yr(o),i._instanceIds=r,i._tooltips=a,e.onFinishedCreatePrimitive(i,n))}}var e,v=this;3==this.style.altitudeMethod?(i.features=Xr(i.features,$r(v)),o(i)):(e=nn(i.features),e=Cesium.sampleRenderedData(e),Cesium.when(e,function(e){var t=2==v._style.altitudeMethod;an(i.features,e,$r(v),t),o(i)}).otherwise(function(e){}))},Jr.prototype.createCommonOptions=function(e){var t={};return t.tooltip=this.applyConditionalClassification(this.style.tooltip,e),t},Jr.prototype.createPolygonOptions=function(e,t){var i=this.getPolygonStyle(this.style);i.polygon.hierarchy={positions:Cesium.Cartesian3.fromDegreesArrayHeights(e[0]),holes:[]};for(var o=1;o<e.length;o++)i.polygon.hierarchy.holes.push({positions:Cesium.Cartesian3.fromDegreesArrayHeights(e[o])});var r,n=this.applyConditionalClassification(i.polygon.material,t);return i.polygon.material=Zr(n),null!=i.polygon.fill&&null!=i.polygon.fromKml&&(1<(r=this.applyConditionalClassification(i.polygon.fill,t))&&(r/=100),i.polygon.material=new Cesium.Color(i.polygon.material.red,i.polygon.material.green,i.polygon.material.blue,r)),i.polygon.extrudedHeight&&i.polygon.extrudedHeight&&i.polygon.extrudedHeight.indexOf&&-1<i.polygon.extrudedHeight.indexOf("[")&&-1<i.polygon.extrudedHeight.defaultValue.indexOf("]")&&(n=t[i.polygon.extrudedHeight.defaultValue.substring(1,i.polygon.extrudedHeight.defaultValue.length-1)],void 0!==(n=parseInt(n))&&(i.polygon.extrudedHeight=3*n)),t.FSCALE&&(r=this.getLevelDistance(t.FSCALE),i.polygon.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,r)),n=this.applyConditionalClassification(i.polygon.outlineColor,t),i.polygon.outlineColor=Zr(n),i.polygon},Jr.prototype.translateLineWidth=function(e,t){t=this.applyConditionalClassification(e.polyline.width,t);return 0<t?TerraExplorer.USE_CORRIDOR_FOR_LINE_WIDTH_IN_METERS?1<t&&(e.polyline.widthInMeters=!0,t*=.8,0<e.polyline.backgroundOpacity&&(t*=.8)):t=1<t?2:1:t<0?t=Math.min(5,Math.abs(t)):0==t&&(t=1),t},Jr.prototype.createLinestringOptions=function(e,t){var i=this.getLinestringStyle(this.style);i.id=t,i.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e);var o,e=this.applyConditionalClassification(i.polyline.material,t);return i.polyline.material=Zr(e),null!=i.polyline.lineOpacity&&(1<(o=this.applyConditionalClassification(i.polyline.lineOpacity,t))&&(o/=100),i.polyline.material=new Cesium.Color(i.polyline.material.red,i.polyline.material.green,i.polyline.material.blue,o)),i.polyline.far&&(i.polyline.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(void 0!==i.polyline.near?i.polyline.near:0,i.polyline.far)),t.FSCALE&&(o=this.getLevelDistance(t.FSCALE),i.polyline.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,o)),i.polyline.width=this.applyConditionalClassification(i.polyline.width,t),i.polyline},Jr.prototype.applyConditionalClassification=function(e,i){if(null!=e){if(null==e.defaultValue)return e;var o=tn(e.defaultValue);if(void 0===e.classificationArray){if(!isNaN(o))return o;if(o instanceof Cesium.Color)return o}if(void 0!==e.attributeName){var t="["+e.attributeName+"]";if(o===t)o=i[e.attributeName];else if(e.multipleAttributeReplacementNeeded)for(name in i)o=rn(o,"["+name+"]",i[name]);else o=rn(o,t,i[e.attributeName]);return o}if(void 0!==e.classification)return o=on(e.classification,i);var r=e.classificationArray;return void 0!==r&&$(Object.keys(r)).each(function(e,t){t=function(e,t){if(void 0!==e&&0!==e.condition.length){if(void 0===e.func)return tn(e.value);var i=void 0;return i=!0===on(e,t)?tn(e.value):i}}(r[t],i);t&&(o=t)}),o}},Jr.prototype.createLineToGroundOptions=function(e,t){var i=this.applyConditionalClassification(e.lineToGround,t);null!=i&&0!=Number(i)?(e.lineToGround=i,i=en(i=this.applyConditionalClassification(e.lineToGroundColor,t)),e.lineToGroundColor=i,t=this.applyConditionalClassification(e.lineToGroundLength,t),e.lineToGroundLength=Number(t)):(e.lineToGround=0,e.lineToGroundColor=0,e.lineToGroundLength=0)},Jr.prototype.createPointOptions=function(e,t){var i,o,r,n,a,s,l=this.getPointStyle(this.style);return l.pointHeight?(l.position=Cesium.Cartesian3.fromDegrees(e[0],e[1],l.pointHeight),e[2]=l.pointHeight):l.position=Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),l.sgsPointPosition=e,l.id=t,l.label&&(void 0!==(e=l.label.text)&&-1<e.defaultValue.indexOf("[")&&-1<e.defaultValue.indexOf("]")&&(void 0!==(i=t[e.defaultValue.substring(1,e.defaultValue.length-1)])&&(l.label.text=i)),this.applyConditionalClassification(l.label.text,t)?l.label.text=this.applyConditionalClassification(l.label.text,t).toString():l.label.text=this.applyConditionalClassification(l.label.text,t),l.label.text=this.o(l.label.text)?this.s(l.label.text):l.label.text,-1<l.label.text.indexOf("[")&&-1<l.label.text.indexOf("]")&&(l.label.text=""),null!=l.label.family&&(r=this.applyConditionalClassification(l.label.family,t),i=this.applyConditionalClassification(l.label.font,t),l.label.font=0<=i?(3*i/4).toString()+"pt "+r:(3*(-1*(72*i/96))/4).toString()+"pt "+r),l.label.fillColor=en(this.applyConditionalClassification(l.label.fillColor,t)),l.label.backgroundColor=en(this.applyConditionalClassification(l.label.backgroundColor,t)),null==l.label.backgroundColor&&(l.label.backgroundColor=new Cesium.Color(.165,.165,.165,0)),l.label.showBackground=!0,null!=l.label.showText&&((a=this.applyConditionalClassification(l.label.showText,t))&&1===Number(a)&&(l.label.onHoverShowText=!0),a&&null==viewer.scene.canvas.onHoverShowText&&(o=viewer.scene,new Cesium.ScreenSpaceEventHandler(o.canvas).setInputAction(function(e){var t={};o.screenToWorld(e.endPosition,t),Cesium.defined(t.pickPrimitive)&&"Billboard"==t.pickPrimitive.constructor.name&&null!=t.pickPrimitive.label?null!=o.onHoverShowTextArray[t.pickPrimitive.label.id]&&(null!=o._lastObjectShowOnText&&o._lastObjectShowOnText.id!=t.pickPrimitive.label.id&&null!=o._lastObjectShowOnText.show&&(o._lastObjectShowOnText.show=!1),viewer.scene._lastObjectShowOnText=o.onHoverShowTextArray[t.pickPrimitive.label.id],null!=o._lastObjectShowOnText.show&&(viewer.scene._lastObjectShowOnText.show=!0)):null!=o._lastObjectShowOnText&&null!=o._lastObjectShowOnText.show&&(o._lastObjectShowOnText.show=!1)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),viewer.scene.canvas.onHoverShowText=!0)),null!=l.label.textRelativeToImage&&null!=l.label.textAlignment&&(l.label.textRelativeToImage=this.applyConditionalClassification(l.label.textRelativeToImage,t),l.label.alignment=this.applyConditionalClassification(l.label.textAlignment,t)),null!=l.label.underline&&(l.label.isUnderline=this.applyConditionalClassification(l.label.underline,t)),null!=l.label.bold&&1==this.applyConditionalClassification(l.label.bold,t)&&(l.label.font="bold "+l.label.font),null!=l.label.italic&&1==this.applyConditionalClassification(l.label.italic,t)&&(l.label.font="italic "+l.label.font),null!=l.label.backgroundOpacity&&(l.label.backgroundColor.alpha=this.applyConditionalClassification(l.label.backgroundOpacity,t)),null!=l.label.minViewingHeight&&(s=this.applyConditionalClassification(l.label.minViewingHeight,t),n=650*this.applyConditionalClassification(l.label.scaleMPP,t),l.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(s,n)),t.FSCALE&&(a=this.getLevelDistance(t.FSCALE),l.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,a)),l.label.disableDepthTestDistance||(l.label.disableDepthTestDistance=1e3),l.clampToGround&&(l.label.heightReference=1)),l.billboard&&(l.billboard.sizeInMeters=!1,null!=l.billboard.imageColor&&(r=en(r=this.applyConditionalClassification(l.billboard.imageColor,t)),l.billboard.color=r),null!=l.billboard.imageOpacity&&null!=l.billboard.color.alpha&&(l.billboard.color.alpha=Number(this.applyConditionalClassification(l.billboard.imageOpacity,t))),l.billboard.image=this.applyConditionalClassification(l.billboard.image,t),null!=l.billboard.minViewingHeight&&(s=this.applyConditionalClassification(l.billboard.minViewingHeight,t),n=650*this.applyConditionalClassification(l.billboard.scaleMPP,t),l.billboard.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(s,n)),t.FSCALE&&(a=this.getLevelDistance(t.FSCALE),l.billboard.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,a)),l.billboard.link&&l.id&&"object"==typeof l.id&&(l.id.link=this.applyConditionalClassification(l.billboard.link,t)),l.billboard.disableDepthTestDistance||(l.billboard.disableDepthTestDistance=1e3),l.clampToGround&&(l.billboard.heightReference=1)),l.model&&(s=function(e){e=Number(e);return e=!Cesium.defined(e)||isNaN(e)?0:e},l.model.uri=this.applyClassification(l.model.uri,t),l.model.scale=s(this.applyClassification(l.model.scale,t)),n=s(this.applyClassification(l.model.heading,t)),a=s(this.applyClassification(l.model.pitch,t)),s=s(this.applyClassification(l.model.roll,t)),s=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(n),Cesium.Math.toRadians(a),Cesium.Math.toRadians(s)),l.model.modelMatrix=Cesium.Transforms.headingPitchRollToFixedFrame(l.position,s)),this.createLineToGroundOptions(l,t),l},Jr.prototype.s=function(e){return e.split("").reverse().join("")},Jr.prototype.getLevelDistance=function(e){var t=2e7;switch(parseInt(e)){case 2:t=10123e3;break;case 3:t=7123e3;break;case 4:t=6321e3;break;case 5:t=5522e3;break;case 6:t=3436e3;break;case 7:t=539e3;break;case 8:t=305e3;break;case 9:t=18e4;break;case 10:t=133e3;break;case 11:t=1e5;break;case 12:t=76500;break;case 13:t=58200;break;case 14:t=23500;break;case 15:t=9600;break;case 16:t=4e3;break;case 17:t=2e3;break;case 18:t=1700;break;case 19:t=1500;break;case 20:t=1e3;break;case 21:t=500;break;case 22:t=200;break;case 23:t=100}return t},Jr.prototype.o=function(e){if(!e)return e;return new RegExp("^[^A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿]*[֑-߿יִ-﷽ﹰ-ﻼ]").test(e[0])},Jr.prototype.applyClassification=function(e,t){if("string"!==$.type(e))return e;if(null!=/(\[([^\]]+)\])/g.exec(e))for(var i in t)e=rn(e,"["+i+"]",t[i]);for(var o=/(\<([^\>]+)\>)/g,r=o.exec(e="undefined"==e?"":e);null!=r;){try{var n=r[r.length-1],a=(0,eval)(n);e=e.replace(r[0],a)}catch(e){}r=o.exec(e)}return e},Jr.prototype.getPolygonStyle=function(e){return $.extend(!0,{},un.DEFAULT_POLYGON_STYLE,e)},Jr.prototype.getLinestringStyle=function(e){return $.extend(!0,{},un.DEFAULT_POLYLINE_STYLE,e)},Jr.prototype.getPointStyle=function(e){return null!=e.label?$.extend(!0,{},un.DEFAULT_LABEL_STYLE,e):null!=e.billboard?$.extend(!0,{},un.DEFAULT_BILLBOARD_STYLE,e):null!=e.model?$.extend(!0,{},un.DEFAULT_MODEL_STYLE,e):null==e.point?un.DEFAULT_POINT_STYLE:$.extend(!0,{},un.DEFAULT_POINT_STYLE,e)},Jr.prototype.sanitizePositions=function(e){for(var t=0;t<e.length;t++)e[t]instanceof Array?this.sanitizePositions(e[t]):isNaN(e[t])&&(e[t]=0)};var ln,un={};function cn(e,t,i,o,r,n,a,s,l){var u=this;function c(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var o=Cesium.when.defer();return function e(){t.ready?Cesium.when(d(t,i),function(e){o.resolve(e)}):setTimeout(e,10)}(),o.promise}function h(e,t){for(var i=e.tilingScheme,o=i.positionToTileXY(t,0),e=u._Viewer.scene.globe._surface.tileProvider.quadtree._levelZeroTiles,r=e[0].x==o.x&&e[0].y==o.y?e[0]:e[1],n=1;n<22;n++){var a=function(e,t){for(var i=0;i<e.children.length;i++)if(e.children[i].state>=Cesium.QuadtreeTileLoadState.DONE&&(null!=e.children[i].data.terrainData._mesh||null!=e.children[i].data.terrainData._buffer)&&e.children[i].x==t.x&&e.children[i].y==t.y)return e.children[i]}(r,o=i.positionToTileXY(t,n));if(null==a)break;r=a}return r}function m(e){var t;for($.grep(u._Viewer.scene.primitives._primitives,function(e){return e instanceof Cesium.Cesium3DTileset}),t=0;t<e.length;++t){var i=e[t],o=i instanceof Cesium.Cartographic,r=o?i:Cesium.Cartographic.fromCartesian(i);r.height=u.G,o||(r=Cesium.Cartesian3.fromRadiansArrayHeights([r.longitude,r.latitude,r.height])[0],i.z=r.z)}return e}function d(e,t){for(var i=0;i<t.length;++i){var o=t[i],r=h(e,o);o.height=r.data.terrainData.interpolateHeight(r.rectangle,o.longitude,o.latitude)}return t}function p(e){this.value=new Float32Array([e])}this._viewer=e,this._Viewer=e,u.G=65535,ln=new Er,_n=new ko({workerPath:function(){for(var e=document.scripts,t="./wfs/featurefetcherworker.js",i=0;i<e.length;i++){var o=e[i].src.split("/"),o=o[o.length-1];"SmartEarth.js"==o?t=e[i].outerHTML.split('"')[1].replace("SmartEarth.js","Workers/featurefetcherworker.js"):"SmartEarth.min.js"==o&&(t=e[i].outerHTML.split('"')[1].replace("SmartEarth.min.js","Workers/featurefetcherworker.js"))}return t}()}),Cesium.sampleRenderedData||(Cesium.Resource&&(Cesium.loadText=Cesium.Resource.fetchText,Cesium.loadJson=Cesium.Resource.fetchJson,Cesium.loadBlob=Cesium.Resource.fetchBlob,Cesium.loadArrayBuffer=Cesium.Resource.fetchArrayBuffer,Cesium.loadImage=Cesium.Resource.fetchImage),p.fromZBias=function(e){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return new p(e)},p.toValue=function(e,t){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return Cesium.defined(t)?color.toBytes(t):new Float32Array(e)},p.equals=function(e,t){return e===t||Cesium.defined(e)&&Cesium.defined(t)&&e.value[0]===t.value[0]},p.defaultBias=function(){return p.fromZBias(15e-6)},Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.SampleRenderedDataFlags={TERRAIN:2,MESH:4,FLOOR:8},Cesium.DynamicEyeOffset=function(e){return void 0===e&&(e=0),new Cesium.Cartesian3(.001234321,0,e)},Cesium.sampleRenderedData=function(r,e){var t=2,i=4,o=8;null==e&&(e=t|i);var n=Cesium.when.defer(),a=[];t<e?r.forEach(function(e){a.push(Cesium.Cartographic.fromRadians(e.longitude,e.latitude,e.height))}):a=r;var s=[];e&t&&s.push(c(u._Viewer.terrainProvider,r));var l=0<(e&o);return e&(i|o)&&s.push(function(e){Cesium.Check.defined("positions",e);var t=Cesium.when.defer();return Cesium.when(m(e),function(e){t.resolve(e)}),t.promise}(a)),Cesium.when.all(s).then(function(e){if(1<s.length)for(var t=0;t<r.length;t++){var i=e[0][t],o=e[1][t];o.height!=u.G&&(i.height<o.height||l)&&(i.height=o.height)}n.resolve(e[0])}),n.promise},Cesium.sampleRenderedMesh=function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(m(e),function(e){i.resolve(e)}),i.promise},Cesium.sampleRenderedTerrain=function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var o=Cesium.when.defer();return function e(){t.ready?Cesium.when(d(t,i),function(e){o.resolve(e)}):setTimeout(e,10)}(),o.promise},Cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo=function(){var e,t=this.getRenderedLevelInfo(),i=0;for(e in t)i<Number(e)&&(i=Number(e));return{bestLevel:i,count:t[i]}},Cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo=function(){var t=[];return this._tilesToRender.forEach(function(e){null==t[e.level]&&(t[e.level]=0),t[e.level]++}),t}),r=r||{},this._level=o||{min:0,max:22},"number"==typeof this._level&&(this._level={min:o,max:22}),this._url=t,this._layerName=i,this._guid=Cesium.createGuid(),this._gmlParser=new Pr(!0,null,null,!0),this._tileManager=ln.getInstance(e),this._tileManager._loadTileEvent.addEventListener(cn.prototype.loadTile,this),this._useWorkers=!0,this._layerDisplayName=n,this._showAttributesAsMessage=r.showAttributesAsMessage,delete r.showAttributesAsMessage,this._entityCreator=new Jr(r,e),this._visible=!0,this._featuresMap={},this._boundingBox=void 0,this._geometryFieldName=void 0,this._operations={},this._subdomains=a,this.latLon=s,this._addedFeatures=[],this.simpleSqlParser=Fr,this.myLayer=l,this._statistics={numberOfAddedFeatures:0,numberOfDeletedFeatures:0,numberOfAddePositions:0,numberOfDeletedPositions:0,getNumberOfCurrentlyRenderedFeatures:function(){return this.numberOfAddedFeatures-this.numberOfDeletedFeatures},getNumberOfCurrentlyRenderedPositions:function(){return this.numberOfAddePositions-this.numberOfDeletedPositions}},function(t){var e=t.cleanUrl(t._url).replace("{s}",t.sTag(t._layerName.length,t._layerName.length,t._level));e+=dn(e),e+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName="+t._layerName;var i=Cesium.TrustedServers.contains(hn(t._url,t._subdomains));$.ajax({dataType:"xml",xhrFields:{withCredentials:i},url:encodeURI(e),success:function(e){var i,o;o=t,mn(e,"FeatureType","wfs").each(function(e,t){if(mn(t,"Name","wfs").text()!=o._layerName)return!0;t=mn(t,"LatLongBoundingBox","wfs");return 1!==t.length||(o._boundingBox=Cesium.Rectangle.fromDegrees(parseFloat(t[0].attributes.minx.value),parseFloat(t[0].attributes.miny.value),parseFloat(t[0].attributes.maxx.value),parseFloat(t[0].attributes.maxy.value))),!1}),i=t,$(e).find("FeatureType").each(function(e,t){if($(t).children("Name").text()!=i._layerName)return!0;t=$(t).children("Operations");return 0==t.length||t.children().each(function(){i._operations[this.tagName.toLowerCase()]={}}),!1})}})}(this),pn(this)}function hn(e,t){e=-1!=e.indexOf("{s}")?null!=t&&0<t.length?e.replace("{s}",t[0]):console.error("Error - sTag with no subdomains."):e;return e}function mn(e,t,i){var o=$(e).find(t);return 0<(o=0==o.length&&"wfs"===i.toLowerCase()?$(e).find("wfs\\:"+t+","+t):o).length?o:$([])}function dn(e){return-1<e.indexOf("?")?"&":"?"}function pn(t){t.featureColumnNames=null;var e=t.cleanUrl(t._url).replace("{s}",t.sTag(t._layerName.length,t._layerName.length,t._level));e+=dn(e),e+="SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName="+t._layerName;var i=Cesium.TrustedServers.contains(hn(t._url,t._subdomains));$.ajax({dataType:"xml",xhrFields:{withCredentials:i},url:encodeURI(e),success:function(e){!function(o,e){var t=$(e).find("[type^='gml:']");o._geometryFieldName=$(t).attr("name"),o.geometryResponseData=e,o.wfsNamespace=function(e,t){let i=eval;if(null==e)return null;try{var o=(new XMLSerializer).serializeToString(e).match(i("/[<]([a-z]+):"+t+"[>]/i"));return null!=o?o[1]:null}catch(e){return!1}}(o.geometryResponseData,"sequence"),null==o.wfsNamespace&&(o.wfsNamespace="xsd"),o.sgSchemaExists=$(o.geometryResponseData).find(o.wfsNamespace+"\\:schema").attr("xmlns:sfs"),o.sgSchemaExists||(o.sgSchemaExists=$(o.geometryResponseData).find("schema").attr("xmlns:sfs"));e=$(o.geometryResponseData).find(o.wfsNamespace+"\\:sequence "+o.wfsNamespace+"\\:element");0==e.length&&(e=$(o.geometryResponseData).find("sequence").find("element")),o.geomFields=[],e.each(function(){var e=$(this),t=e.attr("name"),i=e.attr("type");null==i?i="string":(e=i.match(/.*[:](\w+)/))&&(i=e[1]),o.geomFields.push({name:t,type:i})})}(t,e)}})}function gn(e){return null==e?void 0:e.parentLayer?e:e._parentCollection||(e.primitive&&e.primitive._parentCollection?e.primitive._parentCollection:void 0)}Object.defineProperties(un,{DEFAULT_POLYGON_STYLE:{get:function(){return{polygon:{perPositionHeight:!0,fill:0,material:Cesium.Color.GREEN,outline:!0,outlineColor:Cesium.Color.WHITE,outlineWidth:1}}}},DEFAULT_POLYLINE_STYLE:{get:function(){return{polyline:{material:Cesium.Color.WHITE,width:1}}}},DEFAULT_POINT_STYLE:{get:function(){return{point:{color:Cesium.Color.RED,pixelSize:5,outlineColor:Cesium.Color.WHITE,outlineWidth:2}}}},DEFAULT_LABEL_STYLE:{get:function(){return{label:{text:"Text",font:"18px arial",style:Cesium.LabelStyle.FILL,fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:5,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,eyeOffset:Cesium.Cartesian3.ZERO,pixelOffset:new Cesium.Cartesian2(0,-50)}}}},DEFAULT_BILLBOARD_STYLE:{get:function(){return{billboard:{image:"./img/query.png",scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}}}},DEFAULT_MODEL_STYLE:{get:function(){return{model:{uri:"./img/CesiumTexturedBoxTest.bgltf",scale:1e3}}}}}),Object.defineProperties(cn.prototype,{LayerDisplayName:{get:function(){return this._layerDisplayName}},displayName:{get:function(){return this.LayerDisplayName}},guid:{get:function(){return this._guid}},Style:{get:function(){return this._entityCreator.style}},show:{get:function(){return this._visible},set:function(e){this.setVisibility(e)}},BoundingBox:{get:function(){return this._boundingBox}},Statistics:{get:function(){return this._statistics}}});var _n,fn=180/Math.PI;function yn(){this._quadtree=void 0,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._loadTileEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,128,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._tileCache=[],this._primitivesWaitingToBeAddedToTheScene=[],this._pauseStreaming=!1,this._numTilesInLevel=[],this.STREAM_SPEED_IMIDIATE=0,this.STREAM_SPEED_FAST=1,this.STREAM_SPEED_NORMAL=2,this.STREAM_SPEED_SLOW=3,this._streamSpeed=this.STREAM_SPEED_NORMAL}function vn(e,i){$.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection){t=t,e=En.indexOf(t);return t._parentCollection._primitiveOld=i,-1!==e?(viewer.scene.primitives.remove(En[e]._parentCollection),En[e]=t):En.push(t),!1}})}function Cn(e,t){viewer.scene.primitives.remove(t),e._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(t),this._onDestroyTilePrimitive=void 0}}function wn(e,t,i){Cesium.when.all(e,function(){viewer.scene.primitives.remove(i)}),t._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(i),this._onDestroyTilePrimitive=void 0}}function bn(e,t){wn($.map(e._primitives,function(e){return e.readyPromise}),e,t)}function Tn(e,t){wn($.map(e._primitives[0]._primitives,function(e){return e.readyPromise}),e,t)}function Sn(e,t){viewer.scene.primitives.remove(t)}function Pn(e,t){wn([e.readyPromise],e,t)}cn.prototype.getRequestMaxFeatures=function(){return 1e3},cn.prototype.isAttributeField=function(e,t){return!(!t||!e||""==e.toLowerCase()||"fid"==e.toLowerCase())&&("string"==t.toLowerCase()||"integer"==t.toLowerCase()||"double"==t.toLowerCase())},cn.prototype.updateFeatures=function(e,o){var t,i,r,n,a,s;e.length<=0?o():(t=this,i=[],$(this.geomFields).each(function(){t.isAttributeField(this.name,this.type)&&i.push(this.name)}),n="<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>",r="",$(e).each(function(){var e=this,t='<wfs:Update typeName="{lyaer_id}">'.replace("{lyaer_id}",this.layerId);$(i).each(function(){t+="<wfs:Property><wfs:Name>"+this+"</wfs:Name><wfs:Value>"+e[this]+"</wfs:Value></wfs:Property>"}),t+='<ogc:Filter><ogc:FeatureId fid="'+e.originFid+'"/></ogc:Filter>',r+=t+="</wfs:Update>"}),n="<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>".replace("{wfs_updates}",r),a="Failed to save changes to server",s=hn(this.cleanUrl(this._url),this._subdomains),e=Cesium.TrustedServers.contains(s),$.ajax({dataType:"xml",type:"POST",data:n,xhrFields:{withCredentials:e},url:encodeURI(s),success:function(e){null!=(new XMLSerializer).serializeToString(e.documentElement).toLowerCase().match(/success\s*\//)?o():o(a)},error:function(e,t,i){o(a)},timeout:1e4}))},cn.prototype.getFeatures=function(e,t,r){var i=this,o=[];$(this.geomFields).each(function(){i.isAttributeField(this.name,this.type)&&o.push(this.name)});var n="<wfs:GetFeature version='1.0.0' service='WFS' username='' password='' maxFeatures='{REQUEST_MAX_FEATURES}'  xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> <wfs:Query typeName='{layer_name}'> {wfs_filter}</wfs:Query> </wfs:GetFeature>";n=(n=n.replace("{layer_name}",this._layerName)).replace("{REQUEST_MAX_FEATURES}",1e3);var a="";""!=e.replace(/[ ]/g,"")&&(a="<ogc:Filter  xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'>",a+=function e(t,i){if(t.operator){var o="";switch(t.operator.toLowerCase()){case"=":o="PropertyIsEqualTo";break;case"<>":o="PropertyIsNotEqualTo";break;case">":o="PropertyIsGreaterThan";break;case">=":o="PropertyIsGreaterThanOrEqualTo";break;case"<":o="PropertyIsLessThan";break;case"<=":o="PropertyIsLessThanOrEqualTo";break;case"like":o="PropertyIsLike"}var r=-1!=i.indexOf(t.right)?t.right:t.left,n="<ogc:"+o+("like"==t.operator.toLowerCase()?' wildCard="*" singleChar="*" escape="*"':"")+">";n+="<ogc:PropertyName>"+r+"</ogc:PropertyName>";var a=-1!=i.indexOf(t.right)?t.left:t.right,r=null==(a=a.replace(/^'|'$$/g,"")).match(/^[%]|[%]$$/);return n+="<ogc:Literal>"+(a="like"==t.operator.toLowerCase()&&r?"%"+a+"%":a)+"</ogc:Literal>",n+="</ogc:"+o+">"}a="and"==t.logic.toLowerCase()?"And":"Or",n="<ogc:"+a+">";return 2==t.terms.length?n+=e(t.terms[0],i):n+=e({logic:a,terms:t.terms.slice(0,t.terms.length-1)},i),n+=e(t.terms[t.terms.length-1],i),n+="</ogc:"+a+">"}(i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE "+e).WHERE,o),a+="</ogc:Filter>"),n=n.replace("{wfs_filter}",a);e=hn(this.cleanUrl(this._url),this._subdomains),a=Cesium.TrustedServers.contains(e);t.xhr=$.ajax({url:encodeURI(e),type:"POST",data:n,dataType:"xml",xhrFields:{withCredentials:a},success:function(e){var t,o;!function(t,i){if(null==t)return!1;try{let e=eval;return null!=(new XMLSerializer).serializeToString(null!=t.context?t.context:t).match(e("/[<](([a-z]+):)?"+i+"[^>]*[>]/i"))}catch(e){return!1}}($(e),"FeatureCollection")?r(null,TELang.i18n("layer_error_reading_features")):(t=e,o=[],(e=0==(e=$(t).find("gml\\:featureMember")).length?$(t).find("featureMember"):e).each(function(){var e={},t=$(this).children().first();e.layerId=t[0].nodeName,e.originFid=t.attr("fid"),e.fid=t.attr("fid"),null==e.fid&&(e.fid=-1);var i=e.fid.match(/[.]?(\d+)$$/);i&&(e.fid=i[1]),e.node=t[0],t.children().each(function(){e[this.nodeName]=this.innerHTML,null==e[this.nodeName]&&(e[this.nodeName]=$(this).text())}),o.push(e)}),e=o,r(e))},error:function(e,t,i){r(null,e.statusText)},timeout:1e4})},cn.prototype.getFeatureColumnNames=function(){if(this.featureColumnNames)return this.featureColumnNames;var e=$(this.geometryResponseData).find(this.wfsNamespace+"\\:sequence "+this.wfsNamespace+"\\:element");0==e.length&&(e=$(this.geometryResponseData).find("sequence").find("element"));var t=[];return e.each(function(){var e=$(this);"geom"!=e.attr("name").toLowerCase()&&t.push(e.attr("name").toLowerCase())}),this.featureColumnNames=t,this.featureColumnNames},cn.prototype.refresh=function(e){for(var t=this._tileManager.getAllTiles(),i=t.length,o=0;o<i;o++)t[o].data.wfsLayerData[this._guid]&&t[o].data.wfsLayerData[this._guid].freeResources(),this.loadTile(t[o]);e&&pn(this)},cn.prototype.setVisibility=function(e){if(this._visible!=e)if(0==(this._visible=e))for(var t=(o=this._tileManager.getAllTiles()).length,i=0;i<t;i++)o[i].data.wfsLayerData[this._guid]&&o[i].data.wfsLayerData[this._guid].primitive&&(o[i].data.wfsLayerData[this._guid].primitive.show=!1);else for(var o,t=(o=this._tileManager.getAllTiles()).length,i=0;i<t;i++)o[i].data.wfsLayerData[this._guid]&&(o[i].data.wfsLayerData[this._guid].primitive?o[i].data.wfsLayerData[this._guid].primitive.show=!0:this.loadTile(o[i]))},cn.prototype.loadTile=function(e){var t=this;e.data.wfsLayerData[this._guid]={id:e.data.id,primitive:void 0,freeResources:function(){Cesium.defined(this.xhr)&&(this.xhr.abort(),this.xhr=void 0),Cesium.defined(this.features)&&(t.removeFeaturesFromLayer(this.features),this.features=void 0),Cesium.defined(this.primitive)&&(t._tileManager.removeFromScene(this.primitive),this.primitive=void 0)}},this.show&&e.level>=this._level.min&&e.level<=this._level.max&&(this.statc=0,this._guide=this._guid,this.beginLoadWFSData(e))},cn.prototype.isDestroyed=function(){return!1},cn.prototype.destroy=function(){var e=this._tileManager.getAllTiles(),t=e.length;if(0<t)for(var i=0;i<t;i++)e[i].data.wfsLayerData[this._guid]&&e[i].data.wfsLayerData[this._guid].freeResources();return this._tileManager._loadTileEvent.removeEventListener(cn.prototype.loadTile,this),Cesium.destroyObject(this)},cn.prototype.sTag=function(e,t,i){if(null==this._subdomains)return"";i=(e+t+i)%this._subdomains.length;return this._subdomains[i]},cn.prototype.cleanUrl=function(e){return-1!=e.indexOf("?")?e.split("?")[0]:e},cn.prototype.beginLoadWFSData=function(t){var i,o,e;null!=this.latLon&&!this.latLon||(null==this.BoundingBox||0!=this.BoundingBox.width&&0!=this.BoundingBox.height||(this.BoundingBox.east+=1,this.BoundingBox.north+=1,this.BoundingBox.beenModified=!0),void 0!==this.BoundingBox&&void 0===Cesium.Rectangle.intersection(this.BoundingBox,t.rectangle)||(e=[fn*t.rectangle.west,fn*t.rectangle.south,fn*t.rectangle.east,fn*t.rectangle.north],o=(i=this).cleanUrl(this._url).replace("{s}",this.sTag(t.x,t.y,t.level)),o+=dn(o),o+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat=GML2&typeName="+this._layerName+"&srsName=EPSG:4326&BBOX="+e.join(","),e=Cesium.TrustedServers.contains(hn(this._url,this._subdomains)),t.data.wfsLayerData[this._guid].xhr=$.ajax({dataType:this._useWorkers?"text":"xml",url:encodeURI(o),cache:!0,xhrFields:{withCredentials:e},success:function(e){i.processWFSData(t,e)},error:function(e,t,i){"abort"!==i&&console.log("Failed to retrieve data from "+o+" :"+i)},complete:function(){t.data.wfsLayerData[i._guid].xhr=void 0}})))},cn.prototype.processWFSData=function(e,t){var i;e.data.wfsLayerData[this._guid].xhr=void 0,this._useWorkers?_n.queueWorkItem({id:e.data.id,text:t,geometryFieldName:(i=this)._geometryFieldName}).then(function(e){i.addFeaturesToTile(e)}):(t=this._gmlParser.read(t),this.addFeaturesToTile({id:e.data.id,features:t}))},cn.prototype.boundingSphereFromGML=function(e,i){var t=viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel,o=this;_n.queueWorkItem({id:"0",text:e,geometryFieldName:this._geometryFieldName}).then(function(e){e={parentLayer:o,features:e.features,sampleTerrainLevel:t+1,isQuery:!0,onFinishedQuery:function(e){var t;0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e)),i(t)}};o._entityCreator.createPrimitiveFromWFSFeatures(e)})},cn.prototype.boundingSphereFromFeature=function(e){var t,e={parentLayer:this,features:[e],sampleTerrainLevel:viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel+1,isQuery:!0,onFinishedQuery:function(e){0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e))}};return this._entityCreator.createPrimitiveFromWFSFeatures(e),t},cn.prototype.addRenderedFeatureId=function(e){null==this._addedFeatures[e]&&(this._addedFeatures[e]=0),this._addedFeatures[e]++},cn.prototype.removeRenderedFeatureId=function(e){null!=this._addedFeatures[e]&&this._addedFeatures[e]--,0==this._addedFeatures[e]&&(this._addedFeatures[e]=void 0)},cn.prototype.isExistRenderedFeatureId=function(e){return null!=this._addedFeatures[e]},cn.prototype.addFeaturesToTile=function(i,o){var r,e,n=this._tileManager.getTile(i.id);void 0!==n&&(e=o?n.data.wfsLayerData[this._guid].primitive._instanceIds:void 0,e={parentLayer:r=this,originalInstanceIds:e,features:i.features,onFinishedCreatePrimitive:function(e){var t;null!=i.features&&null!=n.data.wfsLayerData&&(n.data.wfsLayerData[r._guid].features=i.features,o||r.addFeaturesToLayer(n.data.wfsLayerData[r._guid].features),(void 0===e.length||0<e.length)&&(t=n.data.wfsLayerData[r._guid].primitive,e.show=r.show,(n.data.wfsLayerData[r._guid].primitive=e).parentLayer=r,e.parentTileId=i.id,e._guid=Cesium.createGuid(),o?r._tileManager.replaceInScene(t,e):r._tileManager.addToScene(e)))}},this._entityCreator.createPrimitiveFromWFSFeatures(e))},cn.prototype.addFeaturesToLayer=function(e){this._statistics.numberOfAddedFeatures+=e.length,this._statistics.numberOfAddePositions+=Cesium.defaultValue(e.numPositions,0);for(var t=e.length,i=0;i<t;i++)!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e[i].fid)?this._featuresMap[e[i].fid]={refCount:1,feature:e[i]}:this._featuresMap[e[i].fid].refCount++},cn.prototype.removeFeaturesFromLayer=function(e){this._statistics.numberOfDeletedFeatures+=e.length,this._statistics.numberOfDeletedPositions+=Cesium.defaultValue(e.numPositions,0);for(var t=e.length,i=0;i<t;i++)!1!==Object.prototype.hasOwnProperty.call(this._featuresMap,e[i].fid)&&(this._featuresMap[e[i].fid].refCount--,0===this._featuresMap[e[i].fid].refCount&&delete this._featuresMap[e[i].fid],this.removeRenderedFeatureId(e[i].fid))},cn.prototype.getFeature=function(e){return!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e)?null:this._featuresMap[e]},cn.prototype.updateTile=function(e){e=this._tileManager.getTile(e);void 0!==e&&(null==e.data.wfsLayerData[this._guid].features?this.loadTile(e):this.addFeaturesToTile(e.data.wfsLayerData[this._guid],!0))},cn.blockRequestPrimitiveFromPrimitive=function(e){if(null!=e){var t=gn(e);return null!=t||(e._labelCollection&&e._labelCollection._billboardCollection?t=gn(e._labelCollection._billboardCollection):e._billboardCollection&&(t=gn(e._billboardCollection))),t}},cn.prototype.resetAttributesTable=function(){this.lastEditedCell=null,this.attrTblDialogMemo=null},Object.defineProperties(yn.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},loadTileEvent:{get:function(){return this._loadTileEvent}},pauseStreaming:{get:function(){return this._pauseStreaming},set:function(e){this._pauseStreaming=e}},streamSpeed:{get:function(){return this._streamSpeed},set:function(e){this._streamSpeed=e}},bestLevelAvailable:{get:function(){for(var e=0,t=0;t<22;t++)null!=this._numTilesInLevel[t]&&0<this._numTilesInLevel[t]&&e<t&&(e=t);return e}}}),yn.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var En=[],xn=0,In=!(yn.prototype.onPreFrame=function(e,t){if(xn++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;0<this._primitivesWaitingToBeAddedToTheScene.length;){var i=this._primitivesWaitingToBeAddedToTheScene.pop();e.primitives.add(i)}else 0<this._primitivesWaitingToBeAddedToTheScene.length&&xn%this.streamSpeedFactor()==0&&((i=this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds&&100<i._instanceIds.length&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),e.primitives.add(i));$.each(En,function(e,t){t.ready&&viewer.scene.primitives.remove(t._parentCollection._primitiveOld)})}});yn.prototype.initialize=function(e){In||(viewer.scene.preRender.addEventListener(this.onPreFrame,this),In=!0)},yn.prototype.beginUpdate=function(e){this.quadtree.beginFrame(e)},yn.prototype.endUpdate=function(e){var t=this;e.afterRender.push(function(){t.quadtree.endFrame(e)})},yn.prototype.updateForPick=function(e){},yn.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)*this._quadtree.maximumScreenSpaceError};Math.PI;yn.prototype.placeHolder=function(e,t){t=t||Cesium.Color.fromBytes(0,255,0,255);t=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleOutlineGeometry({rectangle:e.rectangle,height:viewer.camera.positionCartographic.height-.99*TerraExplorer.internal.Navigate.HeightAboveGround}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0})});e.data.primitive.add(t)},yn.prototype.loadTile=function(e,t){var i=this;null==this._numTilesInLevel[t._level]&&(this._numTilesInLevel[t._level]=0),this._numTilesInLevel[t._level]++,t.state===Cesium.QuadtreeTileLoadState.START&&(t.data={primitive:new Cesium.PrimitiveCollection,wfsLayerData:[],id:Cesium.createGuid(),freeResources:function(){if(i._tileCache[t.data.id]&&i._numTilesInLevel[t._level]--,i._numTilesInLevel[t._level]<0&&(i._numTilesInLevel[t._level]=0),Cesium.defined(this.wfsLayerData)){for(var e in this.wfsLayerData)Cesium.defined(this.wfsLayerData[e])&&this.wfsLayerData[e].freeResources();this.wfsLayerData=void 0}Cesium.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete i._tileCache[t.data.id]}},this._tileCache[t.data.id]=t,Math.abs(6371e3*(t.rectangle.south-t.rectangle.north)),t.data.boundingSphere3D=Cesium.BoundingSphere.fromRectangle3D(t.rectangle),t.data.boundingSphere2D=Cesium.BoundingSphere.fromRectangle2D(t.rectangle,e.mapProjection),t.rectangle.west,t.rectangle.south,t.rectangle.east,t.rectangle.north,this.loadTileEvent.raiseEvent(t),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)},yn.prototype.getTile=function(e){return this._tileCache[e]},yn.prototype.getAllTiles=function(){var e,t=[];for(e in this._tileCache)t.push(this._tileCache[e]);return t},yn.prototype.computeTileVisibility=function(e,t,i){var o=this.computeDistanceToTile(e,t);return e._distance=o,t.fog.enabled&&9<e._level&&1<=Cesium.Math.fog(o,t.fog.density)?Cesium.Visibility.NONE:(e=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D,t.cullingVolume.computeVisibility(e))},yn.prototype.showTileThisFrame=function(e,t){e.data.primitive.update(t)},yn.prototype.computeDistanceToTile=function(e,t){var i=new Cesium.Cartesian3,e=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D,i=Cesium.Cartesian3.subtract(e.center,t.camera.positionWC,i),i=Cesium.Cartesian3.magnitude(i);return Math.max(1,i-TerraExplorer.internal.Navigate.GroundHeightAtCameraPosition)},yn.prototype.isDestroyed=function(){return!1},yn.prototype.destroy=function(){return Cesium.destroyObject(this)},yn.prototype.getInstance=function(t){var i;return 0==Cesium.defined(t.TileManager)&&(t.TileManager=new e,i=new Cesium.QuadtreePrimitive({tileProvider:t.TileManager,maximumScreenSpaceError:2}),t.scene.primitives.add(i)),t.TileManager},yn.prototype.addToScene=function(e){this._primitivesWaitingToBeAddedToTheScene.push(e)},yn.prototype.removeFromScene=function(e){var t=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=t?(this._primitivesWaitingToBeAddedToTheScene[t].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(t,1)):viewer.scene.primitives.remove(e)},yn.prototype.replaceInScene=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else switch(e.ID!=t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),null!=e._replacmentPrimitive&&viewer.scene.primitives.remove(e._replacmentPrimitive),e._replacmentPrimitive=t,viewer.scene.primitives.add(t),t.ID.split(":")[0]){case"billboards":vn(t,e);break;case"labels":Cn(t,e);break;case"polygons":bn(t,e);break;case"models":Tn(t,e);break;case"polylines":Pn(t,e);break;case"points":Sn(0,e);break;default:console.log("Error updating layer"),viewer.scene.primitives.remove(e)}};var Dn,Ln={billboards:vn,labels:Cn,polygons:bn,models:Tn,polylines:Pn,points:Sn};function Mn(e,t){this._viewer=e,this._cesium=t,Dn=new yn}function An(e){this._viewer=e,this._cesium=Cesium,this._core=new V,this._tree=we}function Rn(e,t){this._viewer=e,this._cesium=t}function On(e,t){this._viewer=e,this._cesium=t,this._tree=we,this._core=new V,this._Color=new G(this._viewer,this._cesium)}function Hn(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we}yn.prototype.replaceInSceneNew=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=i?this._primitivesWaitingToBeAddedToTheScene[i]=t:(e.ID!==t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(t),i=t.ID.split(":")[0],(i=Ln[i])?i(t,e):(console.log("Error updating layer"),viewer.scene.primitives.remove(e)))},Mn.prototype.CreateWfsFeatureLayer=function(e,t,i,o,r,n,a,s,l){return new cn(e,t,i,o,r,n,a,s,l)},Mn.prototype.initTileManager=function(){this._viewer.scene;var i=this._viewer;i.scene.preRender.addEventListener(function(e,t){Dn.getInstance(i).streamSpeed=2})},An.prototype.createPolylineVolume=function(e,t,i,o,r){var n={positions:[],shape:this.starPositions(7,3e4,2e4),material:this._cesium.Color.fromRandom({alpha:1})};if(!this._core.isnull(o)){o=this._core.extend(n,o,!0);var a=[];if(t[0].x||t[0].y)if(t[0].z)for(s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x,t[s].y,t[s].z));else for(s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x,t[s].y));else if(2===t[0].length)for(var s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0],t[s][1]));else if(3===t[0].length)for(var s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0],t[s][1],t[s][2]));o.positions=a,"circle"===i?o.shape=this.computeCircle(o.radius||10):"star"===i?(o.shape=this.starPositions(o.arms||7,o.rOuter||30,o.rInner||20),o.cornerType=Cesium.CornerType.MITERED):"box"===i&&(o.radius=o.radius||10,o.shape=[new this._cesium.Cartesian2(-o.radius,-o.radius),new this._cesium.Cartesian2(o.radius,-o.radius),new this._cesium.Cartesian2(o.radius,o.radius),new this._cesium.Cartesian2(-o.radius,o.radius)],o.cornerType=Cesium.CornerType.BEVELED);o=this._viewer.entities.add({id:this._core.getuid(),name:e,polylineVolume:o});return this.item=o,this._tree.insertGroupId({id:o.id,name:e,pId:this._core.isnull(r)?0:r,type:"polylinevolume",item:this},this._core.isnull(r)?0:r),this}console.log("options is required")},An.prototype.getstyles=function(){var e={};return e.show=!this.item.polylineVolume.show||this.item.polylineVolume.show._value,e.positions=this.item.polylineVolume.positions.getValue().toString(),e.shape=this.item.polylineVolume.shape.toString(),e.cornerType=this.item.polylineVolume.cornerType?this.item.polylineVolume.cornerType.toString():null,e.granularity=this.item.polylineVolume.granularity?this.item.polylineVolume.granularity.toString():null,e.fill=this.item.polylineVolume.fill?this.item.polylineVolume.fill._value:null,e.material=this.item.polylineVolume.material?this.item.polylineVolume.material.toString():null,e.outline=this.item.polylineVolume.outline?this.item.polylineVolume.outline._value:null,e.outlineWidth=this.item.polylineVolume.outlineWidth?this.item.polylineVolume.outlineWidth.toString():null,e.outlineColor=this.item.polylineVolume.outlineColor&&this.item.polylineVolume.outlineColor._value?"rgba"+this.item.polylineVolume.outlineColor.toString():null,e.near=this.item.polylineVolume.distanceDisplayCondition?this.item.polylineVolume.distanceDisplayCondition._value.near:null,e.far=this.item.polylineVolume.distanceDisplayCondition?this.item.polylineVolume.distanceDisplayCondition._value.far:null,e},An.prototype.executeWall=function(t,i){var a=[],o=void 0,s=this,r=(e.prototype._init=function(){var n=this;this.options.wall.maximumHeights=new s._cesium.CallbackProperty(function(){for(var e=[],t=0;t<n.positions.length;t++)e.push(2e3);return e},!1),this.options.wall.minimumHeights=new s._cesium.CallbackProperty(function(){for(var e=[],t=0;t<n.positions.length;t++)e.push(1e3);return e},!1),this.options.wall.positions=new s._cesium.CallbackProperty(function(){for(var e=[],t=0;t<n.positions.length;t++){if(!a[t])return;var i=s._viewer.scene.globe.ellipsoid,o=new s._cesium.Cartesian3(a[t].x,a[t].y,a[t].z),r=i.cartesianToCartographic(o),i=s._cesium.Math.toDegrees(r.latitude),o=s._cesium.Math.toDegrees(r.longitude);r.height,e.push(o),e.push(i)}return s._cesium.Cartesian3.fromDegreesArray(e)},!1);var e=s._viewer.entities.add(this.options);s.item=e,s._tree.insertGroupId({id:this.options.id,name:t,pId:s._core.isnull(i)?0:i,type:"wall",item:s},s._core.isnull(i)?0:i)},e);function e(e){this.options={id:s._core.getuid(),type:"wall",wall:{positions:[],minimumHeights:[2e3,2e3],maximumHeights:[1e3,1e3],material:s._cesium.Color.AQUA.withAlpha(1)}},this.positions=e,this._init()}var n=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);n.setInputAction(function(e){e=s._viewer.scene.camera.pickEllipsoid(e.position,s._viewer.scene.globe.ellipsoid);0==a.length&&a.push(Ce.clone(e)),a.push(Ce.clone(e))},s._cesium.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(function(e){e=s._viewer.scene.camera.pickEllipsoid(e.endPosition,s._viewer.scene.globe.ellipsoid);1<=a.length&&(s._cesium.defined(o)?(a.pop(),a.push(e)):o=new r(a))},s._cesium.ScreenSpaceEventType.MOUSE_MOVE),n.setInputAction(function(e){n.destroy(),a.pop()},s._cesium.ScreenSpaceEventType.RIGHT_CLICK)},An.prototype.starPositions=function(e,t,i){for(var o=Math.PI/e,r=[],n=0;n<2*e;n++){var a=n%2==0?t:i,a=new this._cesium.Cartesian2(Math.cos(n*o)*a,Math.sin(n*o)*a);r.push(a)}return r},An.prototype.computeCircle=function(e){for(var t=[],i=0;i<360;i++){var o=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(o),e*Math.sin(o)))}return t},An.prototype.setVisibility=function(e){this.item.polylineVolume.show=e},An.prototype.getVisibility=function(){return this.item.polylineVolume.show},An.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Object.defineProperties(An.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Object.defineProperties(An.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),An.prototype.setItem=function(e){this.item=e},An.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(An.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(An.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(An.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(An.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(An.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(An.prototype,{wallTempOptions:{get:function(){return{positions:[],maximumHeights:[],minimumHeights:[],show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,shadows:ShadowMode.DISABLED,distanceDisplayCondition:null}}}}),Rn.prototype.createPosition=function(e,t,i){return new this.Cartesian3.fromDegrees(e,t,i)},Rn.prototype.CreatePosition=function(e,t,i,o,r,n,a,s){return{X:e,Y:t,Altitude:i,AltitudeType:o,Yaw:r,Pitch:n,Roll:a,Distance:s}},On.prototype.createImageLabel=function(e,t,i,o){var r={id:this._core.getuid(),image:"../images/Cesium_Logo_overlay.png",show:!0,color:this._cesium.Color.IVORY},t=this._core.extend(r,t,!0);t.color&&(this._core.isnull(t)||this._core.isnull(t.color)||"["==t.color.toString().charAt(0)&&"]"==t.color.toString().charAt(t.color.length-1)||(this._core.isHtmlColor(t.color)&&/^#/.test(t.color.toString())?t.color=this._Color.colorFromHtmlColor(t.color):(/^rgb/.test(t.color)&&(t.color=this._Color.rgbaStringToRgbaObj(t.color)),1<t.color.r&&(t.color.r=t.color.r/255),1<t.color.g&&(t.color.g=t.color.g/255),1<t.color.b&&(t.color.b=t.color.b/255),1<t.color.a&&(t.color.a=t.color.a/255),t.color.r&&(t.color=this._Color.createColor(t.color.r,t.color.g,t.color.b,t.color.a))))),t.near&&t.far&&(t.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(t.near,t.far)),this.item=this._viewer.entities.add({name:o,position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),billboard:t});o={id:this.item.id,name:o,pId:this._core.isnull(i)?0:i,type:"Imagelabel",item:this};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},On.prototype.getstyles=function(){var e={};return e.show=!this.item.billboard.show||this.item.billboard.show._value,e.image=this.item.billboard.image&&this.item.billboard.image._value?this.item.billboard.image._value:void 0,e.scale=this.item.billboard.scale&&this.item.billboard.scale._value?this.item.billboard.scale._value:void 0,e.pixelOffset=this.item.billboard.pixelOffset?this.item.billboard.pixelOffset._value:void 0,e.horizontalOrigin=this.item.billboard.horizontalOrigin&&this.item.billboard.horizontalOrigin._value?this.item.billboard.horizontalOrigin._value:void 0,e.verticalOrigin=this.item.billboard.verticalOrigin&&this.item.billboard.verticalOrigin._value?this.item.billboard.verticalOrigin._value:void 0,e.heightReference=this.item.billboard.heightReference&&this.item.billboard.heightReference._value&&this.item.billboard.heightReference._value?this.item.billboard.heightReference._value:null,e.color=this.item.billboard.color&&this.item.billboard.color._value?"rgba"+this.item.billboard.color.toString():void 0,e.width=this.item.billboard.width&&this.item.billboard.width._value?this.item.billboard.width._value:void 0,e.height=this.item.billboard.height&&this.item.billboard.height._value?this.item.billboard.height._value:void 0,e.near=this.item.billboard.distanceDisplayCondition?this.item.billboard.distanceDisplayCondition._value.near:void 0,e.far=this.item.billboard.distanceDisplayCondition?this.item.billboard.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},On.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},On.prototype.setDistanceDisplayCondition=function(e,t){t=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._billboard.distanceDisplayCondition=t}catch(e){console.log(e)}return this},On.prototype.setUrl=function(e){this.item._billboard.image=e},On.prototype.setVisibility=function(e){this.item.show=e},On.prototype.getVisibility=function(){return this.item.show},On.prototype.setColor=function(e){try{this.item._billboard.color=new G(this._viewer,this._cesium).colorFromHtmlColor(e),this.item.color=this.item._billboard.color}catch(e){console.log(e)}return this},On.prototype.setWidth=function(e){try{this.item._billboard.width=e}catch(e){console.log(e)}return this},On.prototype.setColorAlpha=function(e){try{this.item._billboard.color._value.alpha=e}catch(e){console.log(e)}return this},On.prototype.setHeight=function(e){try{this.item._billboard.height=e}catch(e){console.log(e)}return this},On.prototype.setHeightType=function(e){try{1==e?this.item._billboard.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._billboard.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._billboard.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},On.prototype.setRotation=function(e){try{this.item._billboard.rotation=this._cesium.Math.toRadians(e)}catch(e){console.log(e)}return this},On.prototype.setItem=function(e){this.item=e},On.prototype.setScale=function(e){try{this.item._billboard.scale=e}catch(e){console.log(e)}return this},On.prototype.CreateImageLabel=function(e,t,i,o,r){i={id:this._core.getuid(),image:On,show:!0,scale:i.Scale,color:i.IconColor,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(i.MinViewingHeight,i.MaxViewingHeight)};this.item=this._viewer.entities.add({name:r,position:this._cesium.Cartesian3.fromDegrees(positions.X,positions.X,positions.Altitude),billboard:i});i=this.item.id,i={id:this.item.id,name:i=""==r?r:i,pId:this._core.isnull(o)?0:o,type:"Imagelabel",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),this},On.prototype.export=function(){var e=null==this.item.billboard.image?void 0:this.item.billboard.image._value,t=null==this.item.billboard.show?void 0:this.item.billboard.show._value,i=null==this.item.billboard.scale?void 0:this.item.billboard.scale._value,o=null==this.item.billboard.horizontalOrigin?void 0:this.item.billboard.horizontalOrigin._value,r=null==this.item.billboard.verticalOrigin?void 0:this.item.billboard.verticalOrigin._value,n=null==this.item.billboard.rotation?void 0:this.item.billboard.rotation._value,a=null==this.item.billboard.width?void 0:this.item.billboard.width._value,s=null==this.item.billboard.height?void 0:this.item.billboard.height._value,l=null==this.item.billboard.color?void 0:"rgba("+this.item.billboard.color._value.red+","+this.item.billboard.color._value.green+","+this.item.billboard.color._value.blue+","+this.item.billboard.color._value.alpha+")",u=null==this.item.billboard.heightReference?void 0:this.item.billboard.heightReference._value,c=this.item.billboard.distanceDisplayCondition,h=null==c?void 0:c._value.near,m=null==c?void 0:c._value.far,c=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"image",position:{x:this._cesium.Math.toDegrees(c.longitude),y:this._cesium.Math.toDegrees(c.latitude),z:this._cesium.Math.toDegrees(c.height)},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{image:e,show:t,scale:i,horizontalOrigin:o,verticalOrigin:r,rotation:n,width:a,height:s,color:l,heightReference:u,near:h,far:m}}},On.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(On.prototype,{position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),o=this._cesium.Math.toDegrees(t.latitude),r=(this._cesium.Math.toDegrees(t.height),this._cesium.Cartesian3.fromDegrees(i,o,e));this.item.position.position=r,this._postion.Altitude=e}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e;var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=(this._cesium.Math.toDegrees(t.longitude),this._cesium.Math.toDegrees(t.latitude)),o=this._cesium.Math.toDegrees(t.height),r=this._cesium.Cartesian3.fromDegrees(e,i,o);this.item.position.position=r}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e;var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),o=(this._cesium.Math.toDegrees(t.latitude),this._cesium.Math.toDegrees(t.height)),r=this._cesium.Cartesian3.fromDegrees(i,e,o);this.item.position.position=r}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e}catch(e){console.log(e)}}}},LabelStyle:{BackgroundColor:{get:function(){return""},set:function(e){}},Bold:{get:function(){return""},set:function(e){}},FontName:{get:function(){return""},set:function(e){}},FontSize:{get:function(){return""},set:function(e){}},FrameFileName:{get:function(){return""},set:function(e){}},IconColor:{set:Ce.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.fillColor=e)},500),get:function(){var e=this.item.label.fillColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Italic:{get:function(){return""},set:function(e){}},LimitScreenSize:{get:function(){return""},set:function(e){}},LineColor:{get:function(){return""},set:function(e){}},LineToGround:{get:function(){return""},set:function(e){}},LockMode:{get:function(){return""},set:function(e){}},MaxImageSize:{get:function(){return""},set:function(e){}},MaxViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.far},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.near),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(t,e)}},MinViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.near},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.far),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,t)}},MultilineJustification:{get:function(){return""},set:function(e){}},PivotAlignment:{get:function(){return""},set:function(e){}},Scale:{get:function(){if(null!=this.item._label.scale)return this.item.label.scale.getValue()},set:function(e){this.item.label.scale.setValue(e)}},TextAlignment:{get:function(){return""},set:function(e){}},TextColor:{get:function(){return""},set:function(e){}},TextOnImage:{get:function(){return""},set:function(e){}},Underline:{get:function(){return""},set:function(e){}}}}),On.prototype.CreateImageLabel=function(e,t,i,o,r){this._postion=e;t={id:this._core.getuid(),image:t,backgroundColor:i.BackgroundColor,fillColor:i.IconColor,font:i.FontName,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,outlineColor:i.LineColor,show:!0,scale:i.Scale,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(i.MinViewingHeight,i.MaxViewingHeight)};i.Italic&&(t.font="italic "+t.font),i.Italic&&(t.font="Bold "+t.font);i=this._core.extend(t,i,!0);this.item=this._viewer.entities.add({name:r,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),billboard:i});r={id:this.item.id,name:r,pId:this._core.isnull(o)?0:o,type:"ImageLabel",item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(o)?0:o),this},Object.defineProperties(On.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}},LabelStyle:{BackgroundColor:{set:Ce.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.backgroundColor=e,this.item.backgroundColor=e)},500),get:function(){var e=this.item.label.backgroundColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Bold:{get:function(){return-1!=this.item._label.font.getValue().indexOf("bold")},set:function(){var e="bold "+this.item._label.font.getValue();this.item._label.font.setValue(e)}},FontName:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if("bold"!=e[t]&&-1==e[t].indexOf("px")&&-1==e[t].indexOf("PX"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,o=0;o<t.length;o++)"bold"!=t[o]&&-1==t[o].indexOf("px")&&-1==t[o].indexOf("PX")||(i=i+" "+t[o]);this.item._label.font.setValue(i)}},FontSize:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if(-1!=e[t].indexOf("px"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,o=0;o<t.length;o++)-1==t[o].indexOf("px")||(i=i+" "+t[o]);this.item._label.font.setValue(i)}},FrameFileName:{get:function(){return""},set:function(e){}},IconColor:{set:Ce.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.fillColor=e)},500),get:function(){var e=this.item.label.fillColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Italic:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if(-1!=e[t].indexOf("italic"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,o=0;o<t.length;o++)-1==t[o].indexOf("italic")||(i=i+" "+t[o]);this.item._label.font.setValue(i)}},LimitScreenSize:{get:function(){return""},set:function(e){}},LineColor:{set:Ce.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.outlineColor=e)},500),get:function(){var e=this.item.label.outlineColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},LineToGround:{get:function(){return""},set:function(e){}},LockMode:{get:function(){return""},set:function(e){}},MaxImageSize:{get:function(){return""},set:function(e){}},MaxViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.far},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.near),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(t,e)}},MinViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.near},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.far),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,t)}},MultilineJustification:{get:function(){return""},set:function(e){}},PivotAlignment:{get:function(){return""},set:function(e){}},Scale:{get:function(){if(null!=this.item._label.scale)return this.item.label.scale.getValue()},set:function(e){this.item.label.scale.setValue(e)}},TextAlignment:{get:function(){return""},set:function(e){}},TextColor:{get:function(){return""},set:function(e){}},TextOnImage:{get:function(){return""},set:function(e){}},Underline:{get:function(){return""},set:function(e){}}}}),Hn.prototype.createWall=function(e,t,i,o){var r={show:!0,minimumHeights:[100,100,100,100,100,100,100],maximumHeights:[2e3,2e3,2e3,2e3,2e3,2e3,2e3],material:this._cesium.Color.AQUA.withAlpha(1)};if(!this._core.isnull(i)){var n=new V;(i=this._core.extend(r,i,!0))&&"ImageMaterialProperty"==i.material?i.material=n.setImageMaterialProperty("../../img/arrow.png",this._cesium,0,i.id):i&&"DrawCanvasColorUpdown"==i.material&&(i.material=n.setImageMaterialProperty("../../img/arrow.png",this._cesium,1,i.id));var a=[];if(t[0].x||t[0].y)if(void 0!==t[0].z)for(s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x,t[s].y,t[s].z));else for(s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x,t[s].y));else if(2===t[0].length)for(var s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0],t[s][1]));else if(3===t[0].length)for(var s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0],t[s][1],t[s][2]));i.positions=a,void 0!==i.minHeight&&(i.minimumHeights=new Array(i.positions.length).fill(i.minHeight)),void 0!==i.maxHeight&&(i.maximumHeights=new Array(i.positions.length).fill(i.maxHeight));n=this._viewer.entities.add({name:e,id:this._core.getuid(),wall:i});return n.positions=i.positions,this.item=n,this._tree.insertGroupId({id:n.id,name:e,pId:this._core.isnull(o)?0:o,type:"wall",item:this},this._core.isnull(o)?0:o),this}console.log("options is required")},Hn.prototype.executeWall=function(t,i){var a=[],o=void 0,s=this,r=(e.prototype._init=function(){var n=this;this.options.wall.maximumHeights=new s._cesium.CallbackProperty(function(){for(var e=[],t=0;t<n.positions.length;t++)e.push(2e3);return e},!1),this.options.wall.minimumHeights=new s._cesium.CallbackProperty(function(){for(var e=[],t=0;t<n.positions.length;t++)e.push(1e3);return e},!1),this.options.wall.positions=new s._cesium.CallbackProperty(function(){for(var e=[],t=0;t<n.positions.length;t++){if(!a[t])return;var i=s._viewer.scene.globe.ellipsoid,o=new s._cesium.Cartesian3(a[t].x,a[t].y,a[t].z),r=i.cartesianToCartographic(o),i=s._cesium.Math.toDegrees(r.latitude),o=s._cesium.Math.toDegrees(r.longitude);r.height,e.push(o),e.push(i)}return s._cesium.Cartesian3.fromDegreesArray(e)},!1);var e=s._viewer.entities.add(this.options);s.item=e,s._tree.insertGroupId({id:this.options.id,name:t,pId:s._core.isnull(i)?0:i,type:"wall",item:s},s._core.isnull(i)?0:i)},e);function e(e){this.options={id:s._core.getuid(),type:"wall",wall:{positions:[],minimumHeights:[2e3,2e3],maximumHeights:[1e3,1e3],material:s._core.setImageMaterialProperty("img/arrow.png",s._cesium,1)}},this.positions=e,this._init()}var n=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);n.setInputAction(function(e){e=s._viewer.scene.camera.pickEllipsoid(e.position,s._viewer.scene.globe.ellipsoid);0==a.length&&a.push(Ce.clone(e)),a.push(Ce.clone(e))},s._cesium.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(function(e){e=s._viewer.scene.camera.pickEllipsoid(e.endPosition,s._viewer.scene.globe.ellipsoid);1<=a.length&&(s._cesium.defined(o)?(a.pop(),a.push(e)):o=new r(a))},s._cesium.ScreenSpaceEventType.MOUSE_MOVE),n.setInputAction(function(e){n.destroy(),a.pop()},s._cesium.ScreenSpaceEventType.RIGHT_CLICK)};var Vn="a",kn=0;function Fn(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we,this._BaiduImageryProvider=new yr(e,t)}Hn.prototype.drawCanvasImage=function(e,t){var i=document.getElementById("canvas-"+Vn),o=i.getContext("2d"),r=new Image;return r.src="img/arrow.png",o.clearRect(0,0,700,100),r.onload=function(){kn<=700?(o.drawImage(r,kn,0),o.drawImage(r,kn+100,0)):kn=0,kn+=5},Vn="a"===Vn?"b":"a",i},Hn.prototype.setVisibility=function(e){this.item.wall.show=e},Hn.prototype.getVisibility=function(){return this.item.wall.show},Hn.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Object.defineProperties(Hn.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Object.defineProperties(Hn.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Hn.prototype.setItem=function(e){this.item=e},Hn.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(Hn.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(Hn.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(Hn.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(Hn.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(Hn.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(Hn.prototype,{wallTempOptions:{get:function(){return{positions:[],maximumHeights:[],minimumHeights:[],show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,shadows:ShadowMode.DISABLED,distanceDisplayCondition:null}}}}),Fn.prototype.createArcGisImageryLayer=function(e,t,i,o,r,n){var a={url:""},s=null;this._core.isUrl(t)?(s=a).url=t:s=this._core.extend(a,t,!0),this._core.isnull(e)&&(e="新建影像图层");t=new this._cesium.ArcGisMapServerImageryProvider(s);let l={alpha:s.alpha,brightness:s.brightness,availability:s.availability};if(void 0!==s.Level||void 0!==s.level){let e=this._core.defaultValue(s.Level,s.level);e.indexOf&&-1<e.indexOf(",")?(e=e.split(","),l.maximumTerrainLevel=e[1],l.minimumTerrainLevel=e[0]):l.minimumTerrainLevel=e}s.time&&(l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=l.availability,this.item=new this._cesium.ImageryLayer(t,l),this._viewer.imageryLayers.add(this.item,o),r||this.setVisibility(!1),n&&"function"==typeof n&&n(this.item);n=this._core.getuid(),r={id:s.id||n,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",smtype:"arcgis",item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),this},Fn.prototype.createImageryLayerGrid=function(e){e=this._viewer.imageryLayers.addImageryProvider(new this._cesium.GridImageryProvider(e));return this.item=e,this},Fn.prototype.createWebMapServerImageLayer=function(e,t,i,o,r,n){var a={url:"",layers:"",parameters:{service:"WMS",format:"image/png",transparent:!0}},s=null;this._core.isUrl(t)?(s=a).url=t:s=this._core.extend(a,t,!0),this._core.isnull(e)&&(e="新建影像图层");t=new this._cesium.WebMapServiceImageryProvider(s);let l={alpha:s.alpha,brightness:s.brightness,availability:s.availability};if(void 0!==s.Level||void 0!==s.level){let e=this._core.defaultValue(s.Level,s.level);e.indexOf&&-1<e.indexOf(",")?(e=e.split(","),l.maximumTerrainLevel=e[1],l.minimumTerrainLevel=e[0]):l.minimumTerrainLevel=e}s.time&&(l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=l.availability,this.item=new this._cesium.ImageryLayer(t,l),this._viewer.imageryLayers.add(this.item,o),r||this.setVisibility(!1),n&&"function"==typeof n&&n(this.item);n=this._core.getuid(),r={id:s.id||n,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",smtype:"wms",item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),this},Fn.prototype.createMVTWithStyle=function(e,t,i,o){this.item=this._viewer.imageryLayers.addImageryProvider(t),checked||this.setVisibility(!1),t.show=!1;t=this._core.getuid(),e={id:options.id||t,name:e,checked:checked,pId:(this._core.isnull(0),0),type:"ImageryProvider",show:!1,item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,(this._core.isnull(0),0)),this},Fn.prototype.createWebMapTileServerImageLayer=function(e,t,i,o,r,n){var a={url:""},s=null;this._core.isUrl(t)?(s=a).url=t:s=this._core.extend(a,t,!0),this._core.isnull(e)&&(e="新建影像图层");let l={alpha:s.alpha,brightness:s.brightness,availability:s.availability};if(void 0!==s.Level||void 0!==s.level){let e=this._core.defaultValue(s.Level,s.level);e.indexOf&&-1<e.indexOf(",")?(e=e.split(","),l.maximumTerrainLevel=e[1],l.minimumTerrainLevel=e[0]):l.minimumTerrainLevel=e}t=s.TD_SD?new To(s.url,!1,l.minimumTerrainLevel||0,l.maximumTerrainLevel||21):new this._cesium.WebMapTileServiceImageryProvider(s),s.addLevel&&(t.addLevel=s.addLevel),s.time&&(l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=l.availability,this.item=new this._cesium.ImageryLayer(t,l),this._viewer.imageryLayers.add(this.item,o),r||this.setVisibility(!1),n&&"function"==typeof n&&n(this.item);n=this._core.getuid(),r={id:s.id||n,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",smtype:"skymap",item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),this},Fn.prototype.createUrlTemplateImageryProvider=function(e,t,i,o,r,n){var a={url:""},s=null;this._core.isUrl(t)?(s=a).url=t:s=this._core.extend(a,t,!0),this._core.isnull(e)&&(e="新建影像图层");t=new this._cesium.UrlTemplateImageryProvider(s);let l={alpha:s.alpha,brightness:s.brightness,availability:s.availability};if(void 0!==s.Level||void 0!==s.level){let e=this._core.defaultValue(s.Level,s.level);e.indexOf&&-1<e.indexOf(",")?(e=e.split(","),l.maximumTerrainLevel=e[1],l.minimumTerrainLevel=e[0]):l.minimumTerrainLevel=e}s.time&&(l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=l.availability,this.item=new this._cesium.ImageryLayer(t,l),this._viewer.imageryLayers.add(this.item,o),r||this.setVisibility(!1),n&&"function"==typeof n&&n(this.item);n=this._core.getuid(),r={id:s.id||n,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",smtype:"goglemap",item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),this},Fn.prototype.createImageryProvider=function(e,t,i,o,r,n,a){var s,i=this._core.extend({},i,!0);"arcgis"==t?s=new this._cesium.ArcGisMapServerImageryProvider(i):"geoserver"==t||"wms"==t?s=new this._cesium.WebMapServiceImageryProvider(i):"cesiumBlack"==t||"tms"==t?s=new this._cesium.TileMapServiceImageryProvider(i):"skymap"==t?s=new this._cesium.WebMapTileServiceImageryProvider(i):"goglemap"==t?s=new this._cesium.UrlTemplateImageryProvider(i):"BingMap"==t?s=new this._cesium.BingMapsImageryProvider(i):"OpenStreetMap"==t?s=new this._cesium.OpenStreetMapImageryProvider(i):"MapBox"==t?s=new this._cesium.MapboxImageryProvider(i):"BaiduMap"==t&&(s=new this._BaiduImageryProvider.BaiduImageryProvider(i));let l={alpha:i.alpha,brightness:i.brightness,availability:i.availability};if(void 0!==i.Level||void 0!==i.level){let e=this._core.defaultValue(i.Level,i.level);e.indexOf&&-1<e.indexOf(",")?(e=e.split(","),l.maximumTerrainLevel=e[1],l.minimumTerrainLevel=e[0]):l.minimumTerrainLevel=e}i.time&&(l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:i.time.start?this._cesium.JulianDate.fromDate(new Date(i.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:i.time.end?this._cesium.JulianDate.fromDate(new Date(i.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=l.availability,this.item=new this._cesium.ImageryLayer(s,l),this._viewer.imageryLayers.add(this.item,r),n||this.setVisibility(!1),a&&"function"==typeof a&&a(this.item),this._core.isnull(i.id)&&(i.id=this._core.getuid());n={id:i.id,name:e,pId:this._core.isnull(o)?0:o,type:"ImageryProvider",checked:n,item:this};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(o)?0:o),this},Fn.prototype.createCacheImageryProvider=function(e,t,i,o,r,n){o|=1;var a=this._core.extend({fileExtension:"jpg",cacheMaxLevel:16},t,!0);let s={alpha:a.alpha,brightness:a.brightness,availability:a.availability,show:!0},l={alpha:a.alpha,brightness:a.brightness,availability:a.availability,show:!0};if(a.time&&(s.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:a.time.start?this._cesium.JulianDate.fromDate(new Date(a.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?this._cesium.JulianDate.fromDate(new Date(a.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})]),l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:a.time.start?this._cesium.JulianDate.fromDate(new Date(a.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?this._cesium.JulianDate.fromDate(new Date(a.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),void 0!==a.Level||void 0!==a.level){let e=this._core.defaultValue(a.Level,a.level);e.indexOf&&-1<e.indexOf(",")?(e=e.split(","),e[1]>a.cacheMaxLevel?(s.show=!0,l.maximumTerrainLevel=e[1],l.show=!0):(s.show=!0,l.show=!1),e[0]>a.cacheMaxLevel?(s.show=!1,l.minimumTerrainLevel=e[0],l.show=!0):(s.show=!0,l.minimumTerrainLevel=a.cacheMaxLevel)):(e>a.cacheMaxLevel?(s.show=!1,l.minimumTerrainLevel=e):(s.show=!0,l.minimumTerrainLevel=a.cacheMaxLevel),l.show=!0)}else s.show=!0,l.minimumTerrainLevel=a.cacheMaxLevel,l.show=!0;this.availability=s.availability;var u=null;s.show&&(u=new this._cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl(a.cacheUrl),fileExtension:a.fileExtension}),this.item=new this._cesium.ImageryLayer(u,s),this._viewer.imageryLayers.add(this.item,o)),this.items||(this.items=[]);t=null;l.show&&(a.minimumLevel=l.minimumTerrainLevel|a.cacheMaxLevel,l.maximumTerrainLevel&&(a.maximumLevel=l.maximumTerrainLevel),t=new this._cesium.WebMapServiceImageryProvider(a),this.item?(u=this.items.push(new this._cesium.ImageryLayer(t,l)),this._viewer.imageryLayers.add(this.items[u-1],o+1)):(this.item=new this._cesium.ImageryLayer(t,l),this._viewer.imageryLayers.add(this.item,o+1))),r||this.setVisibility(!1),n&&"function"==typeof n&&n(this.item),this._core.isnull(a.id)&&(a.id=this._core.getuid());r={id:a.id,name:e,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",checked:r,item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),this},Fn.prototype.createPolylineImageryProviderer=function(e,t,i,o){var r=this._core.extend({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"},t,!0),t=new this._cesium.WebMapTileServiceImageryProvider(r);this.item=this._viewer.imageryLayers.addImageryProvider(t),"function"==typeof o&&o(this.item),this._core.isnull(r.id)&&(r.id=this._core.getuid());e={id:r.id,name:e,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(i)?0:i),this},Fn.prototype.createterrainProvider=function(e,t,i,o){var r=this._core.extend({url:""},t,!0),t=new this._cesium.CesiumTerrainProvider(r);this._viewer.terrainProvider=t,this.item=this._viewer.terrainProvider,"function"==typeof o&&o(dataSource),this._core.isnull(r.id)&&(r.id=this._core.getuid());e={id:r.id,name:e,pId:this._core.isnull(i)?0:i,type:"terrainProvider",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(i)?0:i),this},Fn.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.item.imageryProvider.url;return{type:"ImageryLayer",treeobj:{name:this.treeobj.name,type:this.treeobj.smtype},style:{show:e,url:t}}},Fn.prototype.setTreeobj=function(e){this.treeobj=e},Fn.prototype.getLevel=function(){var e,t,i,o=this._viewer.camera;try{i=o&&o.positionCartographic&&o.positionCartographic.height?(e=this._viewer.scene.globe.getHeight(o.positionCartographic)||0,t=o.positionCartographic.height-e,Math.round(80955.31/(1+Math.pow(t/91610.74,7096758e-11))-40467.74)):0}catch(e){}return i},Fn.prototype.setVisibility=function(e){if(this.isShow=e,this.item.show=e,this.item._availability&&!e?this.item._availability=void 0:this.availability&&e&&(this.item._availability=this.availability),this.items)for(var t=0;t<this.items.length;t++)this.items[t].show=e,this.items[t]._availability&&!e?this.items[t]._availability=void 0:this.availability&&e&&(this.items[t]._availability=this.availability)},Fn.prototype.getVisibility=function(){return this.item.show},Fn.prototype.getType=function(){return{label:"影像",value:"ImageryProvider"}},Fn.prototype.deleteObject=function(){return this._viewer.imageryLayers.remove(this.item)},Object.defineProperties(Fn.prototype,{url:{set:function(e){},get:function(){}}}),Fn.prototype.setItem=function(e){this.item=e};var Gn=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],o=!0,r=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(o=(a=s.next()).done)&&(i.push(a.value),!t||i.length!==t);o=!0);}catch(e){r=!0,n=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw n}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Bn(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function jn(e,t,i){this._viewer=e,this._cesium=t,this._viewer=null,this._Cesium=i.Cesium,this.UrlData={output:i.output,resultmode:i.resultmode,uid:i.uid,st:i.st,words:i.words,area:i.area,callback:i.callback},this.minLevel1=i.minLevel1,this.minLevel3=i.minLevel3,this._url=i.url,this._urlTemplate=i.url,this._rectangle=i.rectangle,this._maximumLevel=i.maximumLevel||19,this._minimumLevel=i.minimumLevel||1,this.dx={},this._tilingScheme=i.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this.cluster="city",this.primitivecount=null,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=i.lowerLevelLimit||1,this._upperLevelLimit=i.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var o=this._radianToDegree(this._rectangle.west),r=this._radianToDegree(this._rectangle.south),n=this._radianToDegree(this._rectangle.east),a=this._radianToDegree(this._rectangle.north),s=this._minimumLevel;s<=this._maximumLevel;s++){var l=this._lonLatToTileInWGS84([o,r],s),u=this._lonLatToTileInWGS84([n,a],s),c=Math.min(l[0],u[0]),h=Math.max(l[0],u[0]),m=Math.min(l[1],u[1]),u=Math.max(l[1],u[1]);this._tileRangeByLevel[s]={minCol:m,maxCol:u,minRow:c,maxRow:h}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1}function ul(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we,this._Provider=void 0,this.labelCollections1=[],this.labelCollections2=[],this.labelCollections=this._cesium.PointPrimitiveCollection(),this.gd=0,this.model=[],this.Legend=[],this.sj=!0}jn.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":Nn(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},jn.prototype._fetch=function(r){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(t,i){var o=new XMLHttpRequest;if(o.open(n.method||"GET",r),n.headers)for(var e in n.headers)o.setRequestHeader(e,n.headers[e]);o.onload=function(){if(4===o.readyState&&200===o.status)try{var e=JSON.parse(o.responseText);t(e)}catch(e){i(new Error("INVALID RESPONSE"))}},o.onerror=function(e){i(e)},o.onloadend=function(e){200!==e.target.status&&i(new Error("["+e.target.status+"]request failed: "+r))},o.send(n.body||null)})},jn.prototype._lonLatToTileInWGS84=function(e,t){var i=Gn(e,2),e=i[0],i=i[1];return[Math.floor(Math.pow(2,t)*(90-i)/180),Math.floor(Math.pow(2,t)*(180+e)/180)]},jn.prototype._radianToDegree=function(e){return e/Math.PI*180},jn.prototype._isTileInRange=function(e){try{var t=this._tileRangeByLevel[e.level],i=t.minCol,o=t.maxCol,r=t.minRow,n=t.maxRow;return e.x>=i&&e.x<=o&&e.y>=r&&e.y<=n}catch(e){return!1}},jn.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},jn.prototype._loadTile=function(e,t){var r=[],n=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),a=this;return e.features.forEach(function(e){if(a._propertyToBeFiltered&&Array.isArray(a._valuesToBeFiltered)){var t=e.properties[a._propertyToBeFiltered];if(a._valuesToBeFiltered.includes(t))return}var o,t=e.geometry.type;"Polygon"===t||"MultiPolygon"===t?(o=[],a.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){o.push([]),e.forEach(function(e){var t;2<e.length?e.forEach(function(e){var t;2<=e.length&&(t=o[i]).push.apply(t,Bn(e))}):(t=o[i]).push.apply(t,Bn(e))});var t=new a._Cesium.PolygonHierarchy(a._Cesium.Cartesian3.fromDegreesArray(o[i])),e=a._Cesium.BoundingSphere.fromPoints(t.positions).center,e=a._viewer.scene.globe.getHeight(a._Cesium.Cartographic.fromCartesian(e))||0,e=new a._Cesium.PolygonGeometry({polygonHierarchy:t,height:e,vertexFormat:a._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),e=new a._Cesium.GeometryInstance({geometry:e,attributes:{color:n}});r.push(e)})):console.warn('GeoJSONVectorTileProviderPolymerization: geometry type "'+e.geometry.type+'" detected, but is not going to be rendered')}),new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:r})},jn.prototype._cameraMoveEndHandler=function(){var t,e,i,o,r,n,a,s,l;this._stop||(t=this,s=Date.now(),n=(a=this._viewer.scene.globe._surface._tilesToRender).map(function(e){return e.level}),e=Math.min.apply(Math,Bn(n)),i=Math.max.apply(Math,Bn(n)),t._removeObsoletePrimitives(t._primitiveByTile,[]),i<this._lowerLevelLimit&&(t._tileKeys=[],t._removeObsoletePrimitives(t._primitiveByTile,[]),a=[]),this._upperLevelLimit&&e>this._upperLevelLimit&&(t._tileKeys=[],t._removeObsoletePrimitives(t._primitiveByTile,[]),a=[]),(a=2<i-e?a.filter(function(e){return e.level>=i-2}):a).sort(function(e,t){return-(e.level-t.level)}),a=a.filter(function(e){return t._isTileInRange(e)}),this._upperLevelLimit&&(a=this._refineTiles(a,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=s,this._viewer.scene.primitives.remove(this.dx),this.dx={},this._primitiveByTile={},o=[],r=0,l=this._viewer.camera.computeViewRectangle(),n=this._radianToDegree(l.west),a=this._radianToDegree(l.south),s=this._radianToDegree(l.east),l=this._radianToDegree(l.north),this.UrlData.area="RECT("+n+" "+a+","+s+" "+l+")",l="",e<=this.minLevel1||"Infinity"==e?(this.cluster="city",this.UrlData.cluster=this.cluster,l=this._urlTemplate+"?output="+this.UrlData.output+"&resultmode="+this.UrlData.resultmode+"&uid="+this.UrlData.uid+"&st="+this.UrlData.st+"&words="+this.UrlData.words+"&area="+this.UrlData.area+"&cluster="+this.UrlData.cluster+"&callback="+this.UrlData.callback):e>this.minLevel1&&this.minLevel3>e?(this.cluster="county",this.UrlData.cluster=this.cluster,l=this._urlTemplate+"?output="+this.UrlData.output+"&resultmode="+this.UrlData.resultmode+"&uid="+this.UrlData.uid+"&st="+this.UrlData.st+"&words="+this.UrlData.words+"&area="+this.UrlData.area+"&cluster="+this.UrlData.cluster+"&callback="+this.UrlData.callback):e>=this.minLevel3&&(this.cluster="",l=this._urlTemplate+"?output="+this.UrlData.output+"&resultmode="+this.UrlData.resultmode+"&uid="+this.UrlData.uid+"&st="+this.UrlData.st+"&words="+this.UrlData.words+"&area="+this.UrlData.area+"&callback="+this.UrlData.callback),t._fetch(l).then(function(e){e=t._loadTile(e,t.cluster);t._primitiveCollection=e,0<=++r&&(t._tileKeys=o,t._removeObsoletePrimitives(t._primitiveByTile,o))}).catch(function(e){0<=++r&&(t._tileKeys=o,t._removeObsoletePrimitives(t._primitiveByTile,o)),e.message}))},jn.prototype._refineTiles=function(e,s){var l=[],u=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level<s-1)u.includes(t)||(l.push(e),u.push(t));else if(e.level===s-1)for(var i=0;i<2;i++)for(var o=0;o<2;o++){var r="Z"+(e.level+1)+"X"+(2*e.x+i)+"Y"+(2*e.y+o);u.includes(r)||(l.push({x:2*e.x+i,y:2*e.y+o,level:e.level+1}),u.push(r))}else{var n,a=e.level-s;0==a?u.includes(t)||(l.push(e),u.push(t)):(n=2*a,t=Math.floor(e.x/n),a=Math.floor(e.y/n),u.includes(n="Z"+s+"X"+t+"Y"+a)||(l.push({x:t,y:a,level:s}),u.push(n)))}}),l},jn.prototype._removeObsoletePrimitives=function(e,t){var i,o=[];for(i in 0<t.length&&(o=t),e)o.includes(i)||removed&&delete e[i]},jn.prototype.addTo=function(e){this._viewer=e,this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()},jn.prototype.remove=function(){if(this._viewer){for(var e in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[e]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}},jn.prototype.setStatus=function(e){this._stop=e},jn.prototype.isRemoved=function(){return this._isRemoved},jn.prototype.filterBy=function(e,t,i){this._propertyToBeFiltered=e,this._valuesToBeFiltered=t},jn.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null},ul.prototype.createLabelPointGeoJsonFeatureLayer=function(e,t,s,i,l){null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t),u=this;o.then(function(e){var t={Name:"",text:"",font:" 30px sans-serif",stylet:u._cesium.LabelStyle.OUTLINE,fillColor:u._cesium.Color.WHITE,outlineColor:u._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new u._cesium.Color(.165,.165,.165,.8),backgroundPadding:new u._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:u._cesium.HorizontalOrigin.CENTER,verticalOrigin:u._cesium.VerticalOrigin.CENTER,eyeOffset:u._cesium.Cartesian3.ZERO,pixelOffset:u._cesium.Cartesian2.ZERO,heightReference:u._cesium.HeightReference.NONE,scaleByDistance:new u._cesium.NearFarScalar(0,0,1,1)};s.material,u._core.isnull(s)||u._core.isnull(s.fillColor)||/^\[/.test(s.fillColor)&&"["==s.fillColor.toString().charAt(0)&&"]"==s.fillColor.toString().charAt(s.fillColor.length-1)||(u._core.isHtmlColor(s.fillColor)?s.fillColor=u._color.colorFromHtmlColor(s.fillColor):(/^rgb/.test(s.fillColor)&&(s.fillColor=u._color.rgbaStringToRgbaObj(s.fillColor)),1<s.fillColor.r&&(s.fillColor.r=s.fillColor.r/255),1<s.fillColor.g&&(s.fillColor.g=s.fillColor.g/255),1<s.fillColor.b&&(s.fillColor.b=s.fillColor.b/255),1<s.fillColor.a&&(s.fillColor.a=s.fillColor.a/255),s.fillColor=u._color.createColor(s.fillColor.r,s.fillColor.g,s.fillColor.b,s.fillColor.a))),u._core.isnull(s)||u._core.isnull(s.material)||/^\[/.test(s.material)&&"["==s.material.toString().charAt(0)&&"]"==s.material.toString().charAt(s.material.length-1)||(u._core.isHtmlColor(s.material)?s.material=u._color.colorFromHtmlColor(s.material):(/^rgb/.test(s.material)&&(s.material=u._color.rgbaStringToRgbaObj(s.material)),1<s.material.r&&(s.material.r=s.fillColor.r/255),1<s.material.g&&(s.material.g=s.fillColor.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=u._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a))),u._core.isnull(s)||u._core.isnull(s.outlineColor)||/^\[/.test(s.outlineColor)&&"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(u._core.isHtmlColor(s.outlineColor)?s.outlineColor=u._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=u._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=u._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a))),u._core.isnull(s)||u._core.isnull(s.backgroundColor)||/^\[/.test(s.backgroundColor)&&"["==s.backgroundColor.toString().charAt(0)&&"]"==s.backgroundColor.toString().charAt(s.backgroundColor.length-1)||(u._core.isHtmlColor(s.backgroundColor)?s.backgroundColor=u._color.colorFromHtmlColor(s.backgroundColor):(/^rgb/.test(s.backgroundColor)&&(s.backgroundColor=u._color.rgbaStringToRgbaObj(s.backgroundColor)),1<s.backgroundColor.r&&(s.backgroundColor.r=s.backgroundColor.r/255),1<s.backgroundColor.g&&(s.backgroundColor.g=s.backgroundColor.g/255),1<s.backgroundColor.b&&(s.backgroundColor.b=s.backgroundColor.b/255),1<s.backgroundColor.a&&(s.backgroundColor.a=s.backgroundColor.a/255),s.backgroundColor=u._color.createColor(s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.backgroundColor.a)));var i=u._core.extend(t,s,!0),o=(u.item=e).entities.values;u._core.isnull(s.near)&&(s.near=0),u._core.isnull(s.far)&&(s.far=999999999);t=parseFloat(s.near),e=parseFloat(s.far),e=new u._cesium.DistanceDisplayCondition(t,e);i.distanceDisplayCondition=e,u._core.isnull(s.font_size)&&(s.font_size="30px"),u._core.isnull(s.font_family)&&(s.font_family=" sans-serif"),i.font=parseFloat(s.font_size)+"px "+s.font_family;for(var r=new u._cesium.LabelCollection,n=0;n<o.length;n++){var a=o[n];i.position=a.position._value,i.text="a label";a="fillColor:"+255*i.fillColor.red+","+255*i.fillColor.green+","+255*i.fillColor.blue+";outlineColor:"+255*i.outlineColor.red+","+255*i.outlineColor.green+","+255*i.outlineColor.blue;u.Legend.push(a),r.add(i)}e=u._viewer.scene.primitives.add(r);"function"==typeof l&&l(e)});o=this._core.getuid(),t={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t,style:options};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},ul.prototype.createLabelPolymerizationGeoJsonFeatureLayer=function(e,t,c,i,h,m){var o={Name:"",text:"",font:" 30px sans-serif",style:this._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)},d=this;this._core.isnull(c)||this._core.isnull(c.fillColor)||(this._core.isHtmlColor(c.fillColor)?c.fillColor=this._color.colorFromHtmlColor(c.fillColor):(/^rgb/.test(c.fillColor)&&(c.fillColor=this._color.rgbaStringToRgbaObj(c.fillColor)),1<c.fillColor.r&&(c.fillColor.r=c.fillColor.r/255),1<c.fillColor.g&&(c.fillColor.g=c.fillColor.g/255),1<c.fillColor.b&&(c.fillColor.b=c.fillColor.b/255),1<c.fillColor.a&&(c.fillColor.a=c.fillColor.a/255),c.fillColor=this._color.createColor(c.fillColor.r,c.fillColor.g,c.fillColor.b,c.fillColor.a))),this._core.isnull(c)||this._core.isnull(c.outlineColor)||(this._core.isHtmlColor(c.outlineColor)?c.outlineColor=this._color.colorFromHtmlColor(c.outlineColor):(/^rgb/.test(c.outlineColor)&&(c.outlineColor=this._color.rgbaStringToRgbaObj(c.outlineColor)),1<c.outlineColor.r&&(c.outlineColor.r=c.outlineColor.r/255),1<c.outlineColor.g&&(c.outlineColor.g=c.outlineColor.g/255),1<c.outlineColor.b&&(c.outlineColor.b=c.outlineColor.b/255),1<c.outlineColor.a&&(c.outlineColor.a=c.outlineColor.a/255),c.outlineColor=this._color.createColor(c.outlineColor.r,c.outlineColor.g,c.outlineColor.b,c.outlineColor.a))),this._core.isnull(c)||this._core.isnull(c.backgroundColor)||(this._core.isHtmlColor(c.backgroundColor)?c.backgroundColor=this._color.colorFromHtmlColor(c.backgroundColor):(/^rgb/.test(c.backgroundColor)&&(c.backgroundColor=this._color.rgbaStringToRgbaObj(c.backgroundColor)),1<c.backgroundColor.r&&(c.backgroundColor.r=c.backgroundColor.r/255),1<c.backgroundColor.g&&(c.backgroundColor.g=c.backgroundColor.g/255),1<c.backgroundColor.b&&(c.backgroundColor.b=c.backgroundColor.b/255),1<c.backgroundColor.a&&(c.backgroundColor.a=c.backgroundColor.a/255),c.backgroundColor=this._color.createColor(c.backgroundColor.r,c.backgroundColor.g,c.backgroundColor.b,c.backgroundColor.a))),d._core.isnull(c.near)&&(c.near=0),d._core.isnull(c.far)&&(c.far=999999999);var p=this._core.extend(o,c,!0);this._viewer.scene.camera,this._viewer.scene.canvas;o=this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t)),d=this;o.then(function(t){var e=(d.item=t).entities.values;d._core.isnull(p.font_size)&&(p.font_size="30"),d._core.isnull(p.font_family)&&(p.font_family=" sans-serif"),p.font=p.font_size+"px "+p.font_family;for(var i,o=0;o<e.length;o++){var r=e[o];p.font=d._core.extendgl(r,c.font,p.font),p.style=parseInt(d._core.extendgl(r,c.stylet,p.stylet)),p.fillColor=d._core.extendgl(r,c.fillColor,p.fillColor),p.outlineColor=d._core.extendgl(r,c.outlineColor,p.outlineColor),p.outlineWidth=parseFloat(d._core.extendgl(r,c.outlineWidth,p.outlineWidth)),p.show=d._core.extendgl(r,c.show,p.show),p.showBackground=d._core.extendgl(r,c.showBackground,p.showBackground),p.backgroundColor=d._core.extendgl(r,c.backgroundColor,p.backgroundColor),p.backgroundPadding=d._core.extendgl(r,c.backgroundPadding,p.backgroundPadding),p.scale=parseFloat(d._core.extendgl(r,c.scale,p.scale)),p.horizontalOrigin=d._core.extendgl(r,c.horizontalOrigin,p.horizontalOrigin),p.pointHeight=parseFloat(d._core.extendgl(r,c.pointHeight,p.pointHeight)),p.text=d._core.extendgl(r,c.text,p.text);var n=parseFloat(d._core.extendgl(r,p.near)),a=parseFloat(d._core.extendgl(r,p.far)),s=new d._cesium.DistanceDisplayCondition(n,a);p.distanceDisplayCondition=s,p.text=null==r.properties[p.text]?p.text:r.properties[p.text]._value,r.billboard.color=d._cesium.Color.WHITE.withAlpha(0),r.label=new d._cesium.LabelGraphics(p),d._viewer.scene.globe.ellipsoid;n=d._cesium.Cartographic.fromCartesian(r.position._value),a=d._cesium.Math.toDegrees(n.longitude),s=d._cesium.Math.toDegrees(n.latitude),n=p.pointHeight||n.height,n=new d._cesium.Cartesian3.fromDegrees(a,s,n);r.position._value=n}t.clustering.enabled=!0,t.clustering.pixelRange=45,t.clustering.minimumClusterSize=3;var l=new d._cesium.PinBuilder;l.fromText("50+",d._cesium.Color.RED,48).toDataURL(),l.fromText("40+",d._cesium.Color.ORANGE,48).toDataURL(),l.fromText("30+",d._cesium.Color.YELLOW,48).toDataURL(),l.fromText("20+",d._cesium.Color.GREEN,48).toDataURL(),l.fromText("10+",d._cesium.Color.BLUE,48).toDataURL();for(var u=new Array(8),o=0;o<u.length;++o)u[o]=l.fromText(""+(o+2),d._cesium.Color.VIOLET,48).toDataURL();!function(){i=d._cesium.defined(i)?void i():t.clustering.clusterEvent.addEventListener(function(e,t){t.label.show=!1,t.point.show=!1,t.billboard.show=!0,t.billboard.id=t.label.id,t.billboard.verticalOrigin=d._cesium.VerticalOrigin.BOTTOM,50<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.RED,48).toDataURL():40<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.ORANGE,48).toDataURL():30<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.YELLOW,48).toDataURL():20<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.GREEN,48).toDataURL():10<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.BLUE,48).toDataURL():t.billboard.image=u[e.length-2]});var e=t.clustering.pixelRange;t.clustering.pixelRange=0,t.clustering.pixelRange=e,h||d.setVisibility(h)}(),d._cesium.knockout.track({pixelRange:45,minimumClusterSize:3}),"function"==typeof m&&m(ps)});o=this._core.getuid(),t={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:h,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},ul.prototype.createPointPolymerizationGeoJsonFeatureLayer=function(e,t,c,i,h,m){var o={color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};this._core.isnull(c)||this._core.isnull(c.color)||"["==c.color.toString().charAt(0)&&"]"==c.color.toString().charAt(c.color.length-1)||(this._core.isHtmlColor(c.color)?c.color=this._color.colorFromHtmlColor(c.color):(/^rgb/.test(c.color)&&(c.color=this._color.rgbaStringToRgbaObj(c.color)),1<c.color.r&&(c.color.r=c.color.r/255),1<c.color.g&&(c.color.g=c.color.g/255),1<c.color.b&&(c.color.b=c.color.b/255),1<c.color.a&&(c.color.a=c.color.a/255),c.color=this._color.createColor(c.color.r,c.color.g,c.color.b,c.color.a))),this._core.isnull(c)||this._core.isnull(c.outlineColor)||"["==c.outlineColor.toString().charAt(0)&&"]"==c.outlineColor.toString().charAt(c.outlineColor.length-1)||(this._core.isHtmlColor(c.outlineColor)?c.outlineColor=this._color.colorFromHtmlColor(c.outlineColor):(/^rgb/.test(c.outlineColor)&&(c.outlineColor=this._color.rgbaStringToRgbaObj(c.outlineColor)),1<c.outlineColor.r&&(c.outlineColor.r=c.outlineColor.r/255),1<c.outlineColor.g&&(c.outlineColor.g=c.outlineColor.g/255),1<c.outlineColor.b&&(c.outlineColor.b=c.outlineColor.b/255),1<c.outlineColor.a&&(c.outlineColor.a=c.outlineColor.a/255),c.outlineColor=this._color.createColor(c.outlineColor.r,c.outlineColor.g,c.outlineColor.b,c.outlineColor.a)));var d=this._core.extend(o,c,!0);this._viewer.scene.camera,this._viewer.scene.canvas;var o=this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t)),p=this;o.then(function(t){for(var i,e=(p.item=t).entities.values,o=0;o<e.length;o++){var r=e[o];d.color=p._core.extendgl(r,c.color,d.color),d.pixelSize=parseInt(p._core.extendgl(r,c.pixelSize,d.pixelSize)),d.outlineColor=p._core.extendgl(r,c.outlineColor,d.outlineColor),d.outlineWidth=parseFloat(p._core.extendgl(r,c.outlineWidth,d.outlineWidth)),d.show=p._core.extendgl(r,c.show,d.show),d.height=parseFloat(p._core.extendgl(r,c.height,d.height)),d.scaleByDistance=p._core.extendgl(r,c.scaleByDistance,d.scaleByDistance);var n=parseFloat(p._core.extendgl(r,d.minDistanceDisplay)),a=parseFloat(p._core.extendgl(r,d.maxDistanceDisplay)),s=new p._cesium.DistanceDisplayCondition(n,a);r.billboard.image="",d.distanceDisplayCondition=s,r.point=new p._cesium.PointGraphics(d),d.pointHeight=p._core.extendgl(r,c.pointHeight,d.pointHeight),d.pointHeight=parseFloat(d.pointHeight),p._viewer.scene.globe.ellipsoid;n=p._cesium.Cartographic.fromCartesian(r.position._value),a=p._cesium.Math.toDegrees(n.longitude),s=p._cesium.Math.toDegrees(n.latitude),n=d.pointHeight||n.height,n=new p._cesium.Cartesian3.fromDegrees(a,s,n);r.position._value=n}t.clustering.enabled=!0,t.clustering.pixelRange=45,t.clustering.minimumClusterSize=3;var l=new p._cesium.PinBuilder;l.fromText("50+",p._cesium.Color.RED,48).toDataURL(),l.fromText("40+",p._cesium.Color.ORANGE,48).toDataURL(),l.fromText("30+",p._cesium.Color.YELLOW,48).toDataURL(),l.fromText("20+",p._cesium.Color.GREEN,48).toDataURL(),l.fromText("10+",p._cesium.Color.BLUE,48).toDataURL();for(var u=new Array(8),o=0;o<u.length;++o)u[o]=l.fromText(""+(o+2),p._cesium.Color.VIOLET,48).toDataURL();!function(){i=p._cesium.defined(i)?void i():t.clustering.clusterEvent.addEventListener(function(e,t){t.label.show=!1,t.point.show=!1,t.billboard.show=!0,t.billboard.id=t.label.id,t.billboard.verticalOrigin=p._cesium.VerticalOrigin.BOTTOM,50<=e.length?t.billboard.image=l.fromText(e.length,p._cesium.Color.RED,48).toDataURL():40<=e.length?t.billboard.image=l.fromText(e.length,p._cesium.Color.ORANGE,48).toDataURL():30<=e.length?t.billboard.image=l.fromText(e.length,p._cesium.Color.YELLOW,48).toDataURL():20<=e.length?t.billboard.image=l.fromText(e.length,p._cesium.Color.GREEN,48).toDataURL():10<=e.length?t.billboard.image=l.fromText(e.length,p._cesium.Color.BLUE,48).toDataURL():t.billboard.image=u[e.length-2]});var e=t.clustering.pixelRange;t.clustering.pixelRange=0,t.clustering.pixelRange=e,h||p.setVisibility(h)}(),p._cesium.knockout.track({pixelRange:45,minimumClusterSize:3}),"function"==typeof m&&m(ps)});o=this._core.getuid(),t={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:h,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},ul.prototype._cameraMoveEndHandler=function(){if(this._viewer.camera.getMagnitude()<this.gd){if(this.sj){this._viewer.scene.primitives.remove(this.labelCollections),this.labelCollections=new this._cesium.LabelCollection;for(var e=0;e<this.labelCollections1.length;e++)this.labelCollections.add(this.labelCollections1[e]);this._viewer.scene.primitives.add(this.labelCollections),this.sj=!1}}else{this._viewer.scene.primitives.remove(this.labelCollections),new this._cesium.BillboardCollection;for(e=0;e<this.labelCollections2.length;e++)this.BillboardCollections.add(this.labelCollections2[e]);this._viewer.scene.primitives.add(this.BillboardCollections),this.sj=!0}},ul.prototype.createLabelpolymerizationGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=t;this._viewer.scene.primitives,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this.gd=i.height,new this._cesium.BillboardCollection;for(var s={},l=[],u=0;u<a.length;u++){var c={position:new this._cesium.Cartesian3.fromDegrees(a[u].lng,a[u].lat,100),text:a[u].name};this.labelCollections1.push(c);var h=a[u];if(s[h[i.adminname]])for(var m=0;m<l.length;m++){var d=l[m];if(d.adminname==h[i.adminname]){d.data.push(h);break}}else l.push({adminname:h[i.adminname],name:h.name,showBackground:!0,lat:h.lat,lng:h.lng,data:[h]}),s[h[i.adminname]]=h}for(u=0;u<l.length;u++){c={position:new this._cesium.Cartesian3.fromDegrees(l[u].lng,l[u].lat,100),image:pinBuilder.fromText(l[u].data.length+"",this._cesium.Color.BLACK,48).toDataURL()};this.labelCollections2.push(c),this.BillboardCollections.add(c)}this._viewer.scene.primitives.add(this.BillboardCollections)},ul.prototype.createLabelpolymerizationGeoJsonFeatureLayers=function(e,t,i,o,r,n){var a={height:0,material:this._cesium.Color.WHITE,size:50,fill:this._cesium.Color.RED},s={url:t.url,upperLevelLimit:21,lowerLevelLimit:0,minLevel1:t.minLevel1,minLevel3:t.minLevel3,rectangle:this._cesium.Rectangle.fromDegrees(118.74324788700017,32.036708147800084,118.7994917630001,32.07298490959994),Cesium:this._cesium,output:t.output,resultmode:t.resultmode,uid:t.uid,st:t.st,words:t.words,area:t.area,callback:t.callback};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):/^http/.test(i.material)||(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._core.isnull(i)||this._core.isnull(i.fill)||"["==i.fill.toString().charAt(0)&&"]"==i.fill.toString().charAt(i.fill.length-1)||(this._core.isHtmlColor(i.fill)?i.fill=this._color.colorFromHtmlColor(i.fill):/^http/.test(i.fill)||(/^rgb/.test(i.fill)&&(i.fill=this._color.rgbaStringToRgbaObj(i.fill)),1<i.fill.r&&(i.fill.r=i.fill.r/255),1<i.fill.g&&(i.fill.g=i.fill.g/255),1<i.fill.b&&(i.fill.b=i.fill.b/255),1<i.fill.a&&(i.fill.a=i.fill.a/255),i.fill=this._color.createColor(i.fill.r,i.fill.g,i.fill.b,i.fill.a)));var l=this._core.extend(a,i,!0),u=this,s=new jn(this._viewer,this._cesium,s);(this._Provider=s)._loadTile=function(e,o){u._viewer.scene.primitives.remove(u.labelCollections),u.labelCollections=new(""==o?u._cesium.PointPrimitiveCollection:u._cesium.BillboardCollection);var r=new u._cesium.PinBuilder;return e.result.features.forEach(function(e){var t,i={};null!=e.lng&&(t=new u._cesium.Cartesian3.fromDegrees(e.lng,e.lat,l.height),i=""==o?{id:e,color:l.material,position:t}:{position:t,image:r.fromText(e.count+"",l.fill,l.size).toDataURL(),verticalOrigin:u._cesium.VerticalOrigin.BOTTOM},u.labelCollections.add(i))}),u._viewer.scene.primitives.add(u.labelCollections),u.item=u.labelCollections,u.labelCollections},s.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;i={id:l.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},ul.prototype.createLabelGeoJsonFeatureLayerProvider=function(e,t,a,i,o,r){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},s=this;a.material,s._core.isnull(a)||s._core.isnull(a.fillColor)||/^\[/.test(a.fillColor)&&"["==a.fillColor.toString().charAt(0)&&"]"==a.fillColor.toString().charAt(a.fillColor.length-1)||(s._core.isHtmlColor(a.fillColor)?a.fillColor=s._color.colorFromHtmlColor(a.fillColor):(/^rgb/.test(a.fillColor)&&(a.fillColor=s._color.rgbaStringToRgbaObj(a.fillColor)),1<a.fillColor.r&&(a.fillColor.r=a.fillColor.r/255),1<a.fillColor.g&&(a.fillColor.g=a.fillColor.g/255),1<a.fillColor.b&&(a.fillColor.b=a.fillColor.b/255),1<a.fillColor.a&&(a.fillColor.a=a.fillColor.a/255),a.fillColor=s._color.createColor(a.fillColor.r,a.fillColor.g,a.fillColor.b,a.fillColor.a))),s._core.isnull(a)||s._core.isnull(a.material)||/^\[/.test(a.material)&&"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(s._core.isHtmlColor(a.material)?a.material=s._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=s._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=s._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),s._core.isnull(a)||s._core.isnull(a.outlineColor)||/^\[/.test(a.outlineColor)&&"["==a.outlineColor.toString().charAt(0)&&"]"==a.outlineColor.toString().charAt(a.outlineColor.length-1)||(s._core.isHtmlColor(a.outlineColor)?a.outlineColor=s._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=s._color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=s._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))),s._core.isnull(a)||s._core.isnull(a.backgroundColor)||/^\[/.test(a.backgroundColor)&&"["==a.backgroundColor.toString().charAt(0)&&"]"==a.backgroundColor.toString().charAt(a.backgroundColor.length-1)||(s._core.isHtmlColor(a.backgroundColor)?a.backgroundColor=s._color.colorFromHtmlColor(a.backgroundColor):(/^rgb/.test(a.backgroundColor)&&(a.backgroundColor=s._color.rgbaStringToRgbaObj(a.backgroundColor)),1<a.backgroundColor.r&&(a.backgroundColor.r=a.backgroundColor.r/255),1<a.backgroundColor.g&&(a.backgroundColor.g=a.backgroundColor.g/255),1<a.backgroundColor.b&&(a.backgroundColor.b=a.backgroundColor.b/255),1<a.backgroundColor.a&&(a.backgroundColor.a=a.backgroundColor.a/255),a.backgroundColor=s._color.createColor(a.backgroundColor.r,a.backgroundColor.g,a.backgroundColor.b,a.backgroundColor.a)));n=new Ae(this._viewer,this._cesium,n);(this._Provider=n)._loadTile=function(e){var t={Name:"",text:"",font:" 30px sans-serif",style:s._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:s._cesium.Color.WHITE,outlineColor:s._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new s._cesium.Color(.165,.165,.165,.8),backgroundPadding:new s._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:s._cesium.HorizontalOrigin.CENTER,verticalOrigin:s._cesium.VerticalOrigin.CENTER,eyeOffset:s._cesium.Cartesian3.ZERO,pixelOffset:s._cesium.Cartesian2.ZERO,heightReference:s._cesium.HeightReference.NONE,scaleByDistance:new s._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},r=s._core.extend(t,a,!0);s._core.isnull(a.near)&&(a.near=0),s._core.isnull(a.far)&&(a.far=999999999);var n,i=parseFloat(a.near),t=parseFloat(a.far),t=new s._cesium.DistanceDisplayCondition(i,t);return r.distanceDisplayCondition=t,s._core.isnull(a.font_size)&&(a.font_size="30px"),s._core.isnull(a.font_family)&&(a.font_family=" sans-serif"),r.font=parseFloat(a.font_size)+"px "+a.font_family,n=new(null!=r.image&&null!=r.image?s._cesium.BillboardCollection:s._cesium.LabelCollection),e.features.forEach(function(e){r.id=e;var t,i=r.pointHeight;/^\[/.test(i)&&/\]$/.test(i)?(t=i.replace(/\[/,"").replace(/\]/,""),i=parseFloat(e.properties[t])):null!=i&&""!=i?i=parseFloat(i):null!=e.properties.height&&(i=parseFloat(e.properties.height)),r.position=new s._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i),/^\[/.test(a.fillColor)&&/\]$/.test(a.fillColor)&&(o=a.fillColor.replace(/\[/,"").replace(/\]/,""),r.fillColor=e.properties[o],s._core.isHtmlColor(r.fillColor)?r.fillColor=s._color.colorFromHtmlColor(r.fillColor):(/^rgb/.test(r.fillColor)&&(r.fillColor=s._color.rgbaStringToRgbaObj(r.fillColor)),1<r.fillColor.r&&(r.fillColor.r=r.fillColor.r/255),1<r.fillColor.g&&(r.fillColor.g=r.fillColor.g/255),1<r.fillColor.b&&(r.fillColor.b=r.fillColor.b/255),1<r.fillColor.a&&(r.fillColor.a=r.fillColor.a/255),r.fillColor=s._color.createColor(r.fillColor.r,r.fillColor.g,r.fillColor.b,r.fillColor.a))),/^\[/.test(a.outlineColor)&&/\]$/.test(a.outlineColor)&&(o=a.outlineColor.replace(/\[/,"").replace(/\]/,""),r.outlineColor=e.properties[o],s._core.isHtmlColor(r.outlineColor)?r.outlineColor=s._color.colorFromHtmlColor(r.outlineColor):(/^rgb/.test(r.outlineColor)&&(r.outlineColor=s._color.rgbaStringToRgbaObj(r.outlineColor)),1<r.outlineColor.r&&(r.outlineColor.r=r.outlineColor.r/255),1<r.outlineColor.g&&(r.outlineColor.g=r.outlineColor.g/255),1<r.outlineColor.b&&(r.outlineColor.b=r.outlineColor.b/255),1<r.outlineColor.a&&(r.outlineColor.a=r.outlineColor.a/255),r.outlineColor=s._color.createColor(r.outlineColor.r,r.outlineColor.g,r.outlineColor.b,r.outlineColor.a)));var o,i="fillColor:"+255*r.fillColor.red+","+255*r.fillColor.green+","+255*r.fillColor.blue+";outlineColor:"+255*r.outlineColor.red+","+255*r.outlineColor.green+","+255*r.outlineColor.blue;s.Legend.push(i),/^\[/.test(a.text)&&/\]$/.test(a.text)&&(o=a.text.replace(/\[/,"").replace(/\]/,""),r.text=e.properties[o]),n.add(r)}),n},a&&a.time&&(n.availability=new s._cesium.TimeIntervalCollection([new s._cesium.TimeInterval({start:a.time.start?s._cesium.JulianDate.fromDate(new Date(a.time.start)):s._cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?s._cesium.JulianDate.fromDate(new Date(a.time.end)):s._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:a.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t.url,style:a};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},ul.prototype.createLabelRichtextGeoJsonFeatureLayerProvider=function(e,t,u,i,c,h){null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(o);var m=this,d=new this._cesium.PointPrimitiveCollection;m.optiontext=[],o.then(function(e){for(var t=(m.item=e).entities.values,i=0;i<t.length;i++){var o=t[i];n=/^\[/.test(u.text)&&/\]$/.test(u.text)?(n=u.text.replace(/\[/,"").replace(/\]/,""),o.properties[n]._value):u.text,m.optiontext.push(n),o.billboard=void 0,m._viewer.scene.globe.ellipsoid;var r,n=m._cesium.Cartographic.fromCartesian(o.position._value),o=[m._cesium.Math.toDegrees(n.longitude),m._cesium.Math.toDegrees(n.latitude),u.pointHeight||n.height],n=m._core.getuid();o instanceof Array?2===o.length?r=m._cesium.Cartesian3.fromDegrees(o[0],o[1]):3===o.length&&(r=m._cesium.Cartesian3.fromDegrees(o[0],o[1],o[2])):r=o.z?m._cesium.Cartesian3.fromDegrees(o.x,o.y,o.z):m._cesium.Cartesian3.fromDegrees(o.x,o.y),d.add({id:"DivPoint"+n,position:r,color:m._cesium.Color.YELLOW,description:u.text})}m.item=d,m.pointPrimitive=m._viewer.scene.primitives.add(d);var a,s,l=!0;m.pointPrimitive.update=function(){for(var e,t,i=0;i<m.pointPrimitive.length;i++){if(e=m.pointPrimitive.get(i),s=e.position,!(a=m._viewer.scene.cartesianToCanvasCoordinates(s)))return;(s=document.getElementById(e.id))||(t='<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+D.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+m.optiontext[i]+"</div>\n           </div>",$(".cesium-viewer").append(t),s=document.getElementById(e.id)),e.description?s.style.transform="matrix(1, 0, 0, 1, "+a.x+", "+(a.y-157)+")":s.style.transform="matrix(1, 0, 0, 1, "+a.x+", "+(a.y-134)+")"}l&&(c||m.setVisibility(!1),l=!1)},"function"==typeof h&&h(e)}),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本");t={id:u.id,name:e,checked:c,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t,style:u};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},ul.prototype.createLabelRichtextGeoJsonFeatureLayerProviderLayer=function(e,t,s,i,l,o){var r={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},u=this,r=new Ae(this._viewer,this._cesium,r);(this._Provider=r)._loadTile=function(e){var o,r,n=new u._cesium.PointPrimitiveCollection;u.optiontext=[],e.features.forEach(function(e){var t,i=options.pointHeight;null!=e.properties.height&&(i=parseFloat(e.properties.height)+i),/^\[/.test(options.pointHeight)&&/\]$/.test(options.pointHeight)&&(t=options.pointHeight.replace(/\[/,"").replace(/\]/,""),i=parseFloat(e.properties[t])),s.position=new u._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i),/^\[/.test(s.text)&&/\]$/.test(s.text)&&(o=s.text.replace(/\[/,"").replace(/\]/,""),s.text=e.properties[o]);var o=u._core.getuid();n.add({id:"DivPoint"+o,position:Cartesian3,color:u._cesium.Color.YELLOW,description:s.text}),u.optiontext.push(option.text)}),u.pointPrimitive=u._viewer.scene.primitives.add(n);var a=!0;return u.pointPrimitive.update=function(){for(var e,t,i=0;i<u.pointPrimitive.length;i++){if(e=u.pointPrimitive.get(i),r=e.position,!(o=u._viewer.scene.cartesianToCanvasCoordinates(r)))return;(r=document.getElementById(e.id))||(t='<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+D.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+u.optiontext[i]+"</div>\n           </div>",$(".cesium-viewer").append(t),r=document.getElementById(e.id)),e.description?r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-157)+")":r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-134)+")"}a&&(l||u.setVisibility(!1),a=!1)},u.item=n,""},r.addTo(this._viewer),l||this.setVisibility(!1),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本"+s.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t.url,style:s};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},ul.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,n,i,o,r){var a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,Cesium:this._cesium},s=this;n.material,s._core.isnull(n)||s._core.isnull(n.color)||/^\[/.test(n.color)&&"["==n.color.toString().charAt(0)&&"]"==n.color.toString().charAt(n.color.length-1)||(s._core.isHtmlColor(n.color)?n.color=s._color.colorFromHtmlColor(n.color):(/^rgb/.test(n.color)&&(n.color=s._color.rgbaStringToRgbaObj(n.color)),1<n.color.r&&(n.color.r=n.color.r/255),1<n.color.g&&(n.color.g=n.color.g/255),1<n.color.b&&(n.color.b=n.color.b/255),1<n.color.a&&(n.color.a=n.color.a/255),n.color=s._color.createColor(n.color.r,n.color.g,n.color.b,n.color.a)));a=new Ae(this._viewer,this._cesium,a);(this._Provider=a)._loadTile=function(e){var t={url:"",modelMatrix:s._cesium.Transforms.eastNorthUpToFixedFrame(origin),color:s._cesium.Color.DARKSALMON,scale:2},o=s._core.extend(t,n,!0);s._core.isnull(n.near)&&(n.near=0),s._core.isnull(n.far)&&(n.far=999999999);var i=parseFloat(n.near),t=parseFloat(n.far),t=new s._cesium.DistanceDisplayCondition(i,t);o.distanceDisplayCondition=t;var r=new s._cesium.PrimitiveCollection;return e.features.forEach(function(e){o.id=e;var t,i=o.height;null!=e.properties.height&&(i=parseFloat(e.properties.height)),/^\[/.test(o.height)&&/\]$/.test(o.height)&&(t=o.height.replace(/\[/,"").replace(/\]/,""),i=parseFloat(e.properties[t])),o.modelMatrix=s._cesium.Transforms.eastNorthUpToFixedFrame(s._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i));e=s._cesium.Model.fromGltf({id:e,url:o.uri,color:o.color,modelMatrix:o.modelMatrix,scale:o.scale,heightReference:parseInt(o.heightReference),distanceDisplayCondition:o.distanceDisplayCondition});r.add(e)}),r},this.item=a._primitiveCollection,a.addTo(this._viewer),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+n.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,o||this.setVisibility(!1);t={id:n.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"modelLayer",item:this,url:t.url,style:n};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},ul.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,a,i,o,r){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},s=this;s._core.isnull(a)||s._core.isnull(a.color)||/^\[/.test(a.color)&&"["==a.color.toString().charAt(0)&&"]"==a.color.toString().charAt(a.color.length-1)||(s._core.isHtmlColor(a.color)?a.color=s._color.colorFromHtmlColor(a.color):(/^rgb/.test(a.color)&&(a.color=s._color.rgbaStringToRgbaObj(a.color)),1<a.color.r&&(a.color.r=a.color.r/255),1<a.color.g&&(a.color.g=a.color.g/255),1<a.color.b&&(a.color.b=a.color.b/255),1<a.color.a&&(a.color.a=a.color.a/255),a.color=s._color.createColor(a.color.r,a.color.g,a.color.b,a.color.a))),s._core.isnull(a)||s._core.isnull(a.outlineColor)||/^\[/.test(a.outlineColor)&&"["==a.outlineColor.toString().charAt(0)&&"]"==a.outlineColor.toString().charAt(a.outlineColor.length-1)||(s._core.isHtmlColor(a.outlineColor)?a.outlineColor=s._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=s._color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=s._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a)));n=new Ae(this._viewer,this._cesium,n);(this._Provider=n)._loadTile=function(e){var t={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:s._cesium.LabelStyle.OUTLINE,fillColor:s._cesium.Color.WHITE,outlineColor:s._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new s._cesium.Color(.165,.165,.165,.8),backgroundPadding:new s._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:s._cesium.HorizontalOrigin.CENTER,verticalOrigin:s._cesium.VerticalOrigin.CENTER,eyeOffset:s._cesium.Cartesian3.ZERO,pixelOffset:s._cesium.Cartesian2.ZERO,heightReference:s._cesium.HeightReference.NONE,scaleByDistance:new s._cesium.NearFarScalar(0,0,1,1)};a.material,s._core.isnull(a)||s._core.isnull(a.backgroundColor)||/^\[/.test(a.backgroundColor)&&"["==a.backgroundColor.toString().charAt(0)&&"]"==a.backgroundColor.toString().charAt(a.backgroundColor.length-1)||(s._core.isHtmlColor(a.backgroundColor)?a.backgroundColor=s._color.colorFromHtmlColor(a.backgroundColor):(/^rgb/.test(a.backgroundColor)&&(a.backgroundColor=s._color.rgbaStringToRgbaObj(a.backgroundColor)),1<a.backgroundColor.r&&(a.backgroundColor.r=a.backgroundColor.r/255),1<a.backgroundColor.g&&(a.backgroundColor.g=a.backgroundColor.g/255),1<a.backgroundColor.b&&(a.backgroundColor.b=a.backgroundColor.b/255),1<a.backgroundColor.a&&(a.backgroundColor.a=a.backgroundColor.a/255),a.backgroundColor=s._color.createColor(a.backgroundColor.r,a.backgroundColor.g,a.backgroundColor.b,a.backgroundColor.a)));var r=s._core.extend(t,a,!0);s._core.isnull(a.near)&&(a.near=0),s._core.isnull(a.far)&&(a.far=999999999);var i=parseFloat(a.near),t=parseFloat(a.far),t=new s._cesium.DistanceDisplayCondition(i,t);r.distanceDisplayCondition=t,s._core.isnull(a.font_size)&&(a.font_size="30px"),s._core.isnull(a.font_family)&&(a.font_family=" sans-serif"),r.font=parseFloat(a.font_size)+"px "+a.font_family;var n=new s._cesium.PointPrimitiveCollection;return e.features.forEach(function(e){r.id=e;var t,i,o=0;/^\[/.test(r.pointHeight)&&/\]$/.test(r.pointHeight)?(t=r.pointHeight.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[t])):void 0!==r.pointHeight&&""!==r.pointHeight?o=parseFloat(r.pointHeight):null!=e.properties.height&&(o=parseFloat(e.properties.height)),/^\[/.test(a.color)&&/\]$/.test(a.color)&&(i=a.color.replace(/\[/,"").replace(/\]/,""),r.color=e.properties[i],s._core.isHtmlColor(r.color)?r.color=s._color.colorFromHtmlColor(r.color):(/^rgb/.test(r.color)&&(r.color=s._color.rgbaStringToRgbaObj(r.color)),1<r.color.r&&(r.color.r=r.color.r/255),1<r.color.g&&(r.color.g=r.color.g/255),1<r.color.b&&(r.color.b=r.color.b/255),1<r.color.a&&(r.color.a=r.color.a/255),r.color=s._color.createColor(r.color.r,r.color.g,r.color.b,r.color.a))),/^\[/.test(a.outlineColor)&&/\]$/.test(a.outlineColor)&&(i=a.outlineColor.replace(/\[/,"").replace(/\]/,""),r.outlineColor=e.properties[i],s._core.isHtmlColor(r.outlineColor)?r.outlineColor=s._color.colorFromHtmlColor(r.outlineColor):(/^rgb/.test(r.outlineColor)&&(r.outlineColor=s._color.rgbaStringToRgbaObj(r.outlineColor)),1<r.outlineColor.r&&(r.outlineColor.r=r.outlineColor.r/255),1<r.outlineColor.g&&(r.outlineColor.g=r.outlineColor.g/255),1<r.outlineColor.b&&(r.outlineColor.b=r.outlineColor.b/255),1<r.outlineColor.a&&(r.outlineColor.a=r.outlineColor.a/255),r.outlineColor=s._color.createColor(r.outlineColor.r,r.outlineColor.g,r.outlineColor.b,r.outlineColor.a))),r.position=new s._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],o),r.text=e.properties.name;o={show:r.show,position:r.position,pixelSize:r.pixelSize,color:r.color,outlineColor:r.outlineColor,outlineWidth:r.outlineWidth,id:e},e="color:"+255*r.color.red+","+255*r.color.green+","+255*r.color.blue+";outlineColor:"+255*r.outlineColor.red+","+255*r.outlineColor.green+","+255*r.outlineColor.blue;s.Legend.push(e),n.add(o)}),n},this.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:a.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t.url,style:a};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},ul.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,a,i,o,r){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},s=this;s._core.isnull(a)||s._core.isnull(a.color)||/^\[/.test(a.color)&&"["==a.color.toString().charAt(0)&&"]"==a.color.toString().charAt(a.color.length-1)||(s._core.isHtmlColor(a.color)?a.color=s._color.colorFromHtmlColor(a.color):(/^rgb/.test(a.color)&&(a.color=s._color.rgbaStringToRgbaObj(a.color)),1<a.color.r&&(a.color.r=a.color.r/255),1<a.color.g&&(a.color.g=a.color.g/255),1<a.color.b&&(a.color.b=a.color.b/255),1<a.color.a&&(a.color.a=a.color.a/255),a.color=s._color.createColor(a.color.r,a.color.g,a.color.b,a.color.a))),s._core.isnull(a)||s._core.isnull(a.outlineColor)||/^\[/.test(a.outlineColor)&&"["==a.outlineColor.toString().charAt(0)&&"]"==a.outlineColor.toString().charAt(a.outlineColor.length-1)||(s._core.isHtmlColor(a.outlineColor)?a.outlineColor=s._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=s._color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=s._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a)));n=new Ae(this._viewer,this._cesium,n);(this._Provider=n)._loadTile=function(e){var t={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:s._cesium.LabelStyle.OUTLINE,fillColor:s._cesium.Color.WHITE,outlineColor:s._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new s._cesium.Color(.165,.165,.165,.8),backgroundPadding:new s._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:s._cesium.HorizontalOrigin.CENTER,verticalOrigin:s._cesium.VerticalOrigin.CENTER,eyeOffset:s._cesium.Cartesian3.ZERO,pixelOffset:s._cesium.Cartesian2.ZERO,heightReference:s._cesium.HeightReference.NONE,scaleByDistance:new s._cesium.NearFarScalar(0,0,1,1)};a.material,s._core.isnull(a)||s._core.isnull(a.backgroundColor)||/^\[/.test(a.backgroundColor)&&"["==a.backgroundColor.toString().charAt(0)&&"]"==a.backgroundColor.toString().charAt(a.backgroundColor.length-1)||(s._core.isHtmlColor(a.backgroundColor)?a.backgroundColor=s._color.colorFromHtmlColor(a.backgroundColor):(/^rgb/.test(a.backgroundColor)&&(a.backgroundColor=s._color.rgbaStringToRgbaObj(a.backgroundColor)),1<a.backgroundColor.r&&(a.backgroundColor.r=a.backgroundColor.r/255),1<a.backgroundColor.g&&(a.backgroundColor.g=a.backgroundColor.g/255),1<a.backgroundColor.b&&(a.backgroundColor.b=a.backgroundColor.b/255),1<a.backgroundColor.a&&(a.backgroundColor.a=a.backgroundColor.a/255),a.backgroundColor=s._color.createColor(a.backgroundColor.r,a.backgroundColor.g,a.backgroundColor.b,a.backgroundColor.a)));var r=s._core.extend(t,a,!0);s._core.isnull(a.near)&&(a.near=0),s._core.isnull(a.far)&&(a.far=999999999);var i=parseFloat(a.near),t=parseFloat(a.far),t=new s._cesium.DistanceDisplayCondition(i,t);r.distanceDisplayCondition=t,s._core.isnull(a.font_size)&&(a.font_size="30px"),s._core.isnull(a.font_family)&&(a.font_family=" sans-serif"),r.font=parseFloat(a.font_size)+"px "+a.font_family;var n=new s._cesium.PointPrimitiveCollection;return e.features.forEach(function(e){r.id=e;var t,i,o=0;/^\[/.test(r.pointHeight)&&/\]$/.test(r.pointHeight)?(t=r.pointHeight.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[t])):void 0!==r.pointHeight&&""!==r.pointHeight?o=parseFloat(r.pointHeight):null!=e.properties.height&&(o=parseFloat(e.properties.height)),/^\[/.test(a.color)&&/\]$/.test(a.color)&&(i=a.color.replace(/\[/,"").replace(/\]/,""),r.color=e.properties[i],s._core.isHtmlColor(r.color)?r.color=s._color.colorFromHtmlColor(r.color):(/^rgb/.test(r.color)&&(r.color=s._color.rgbaStringToRgbaObj(r.color)),1<r.color.r&&(r.color.r=r.color.r/255),1<r.color.g&&(r.color.g=r.color.g/255),1<r.color.b&&(r.color.b=r.color.b/255),1<r.color.a&&(r.color.a=r.color.a/255),r.color=s._color.createColor(r.color.r,r.color.g,r.color.b,r.color.a))),/^\[/.test(a.outlineColor)&&/\]$/.test(a.outlineColor)&&(i=a.outlineColor.replace(/\[/,"").replace(/\]/,""),r.outlineColor=e.properties[i],s._core.isHtmlColor(r.outlineColor)?r.outlineColor=s._color.colorFromHtmlColor(r.outlineColor):(/^rgb/.test(r.outlineColor)&&(r.outlineColor=s._color.rgbaStringToRgbaObj(r.outlineColor)),1<r.outlineColor.r&&(r.outlineColor.r=r.outlineColor.r/255),1<r.outlineColor.g&&(r.outlineColor.g=r.outlineColor.g/255),1<r.outlineColor.b&&(r.outlineColor.b=r.outlineColor.b/255),1<r.outlineColor.a&&(r.outlineColor.a=r.outlineColor.a/255),r.outlineColor=s._color.createColor(r.outlineColor.r,r.outlineColor.g,r.outlineColor.b,r.outlineColor.a))),r.position=new s._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],o),r.text=e.properties.name;o={show:r.show,position:r.position,pixelSize:r.pixelSize,color:r.color,outlineColor:r.outlineColor,outlineWidth:r.outlineWidth,id:e},e="color:"+255*r.color.red+","+255*r.color.green+","+255*r.color.blue+";outlineColor:"+255*r.outlineColor.red+","+255*r.outlineColor.green+","+255*r.outlineColor.blue;s.Legend.push(e),n.add(o)}),n},this.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:a.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t.url,style:a};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},ul.prototype.setTreeobj=function(e){this.treeobj=e},ul.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},ul.prototype.deleteObject=function(){if(null!=this._Provider&&this._Provider.setStatus(!1),null!=this.items&&null!=this.items&&0<this.items.length)for(var e=0;e<this.items.length;e++)this._viewer.scene.primitives.remove(this.items[e]);else this._viewer.scene.primitives.remove(this.item);if("DivPoint"===this.treeobj.type&&this.item&&null!=this.item._pointPrimitives&&null!=this.item._pointPrimitives)for(e=0;e<this.item._pointPrimitives.length;e++){var t=document.getElementById(this.item._pointPrimitives[e].id);t&&t.remove()}try{this._Provider.remove()}catch(e){}},ul.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},ul.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},ul.prototype.setVisibility=function(e){if(null!=this.treeobj&&"DivPoint"===this.treeobj.type&&this.item&&null!=this.item._pointPrimitives&&null!=this.item._pointPrimitives)for(var t=0;t<this.item._pointPrimitives.length;t++){var i=document.getElementById(this.item._pointPrimitives[t].id);i&&(i.style.display=e?"block":"none")}null!=this.item&&(this.item.show=e),this._Provider&&this._Provider.setStatus(!e)},Object.defineProperties(ul.prototype,{labelText:{set:Ce.debounce(function(e){var t=e;if(!this._core.isnull(e)){var i=this.item.entities&&this.item.entities.values;if(i&&0<i.length)for(var o=0;o<i.length;o++)if(/^\[/.test(e)&&(t=e.replace(/\[/,"").replace(/\]/,""),t=i[o].properties[t]._value),i[o].label){i[o].label.text=t;try{i[o].point.show=!1}catch(e){}}else{try{i[o].point.show=!1}catch(e){}i[o].label=new this._cesium.LabelGraphics({text:t,font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})}}},500)},labelStyles:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.style=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.style:void 0}},labelFont:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,o=16;if(i&&(o=(i=i._value.trimLeft().trimRight()).split("px")[0]),t&&0<t.length&&t[0].label)for(var r=0;r<t.length;r++)t[r].label.font=o+"px "+e}}},500)},labelFontSize1:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,o="sans-serif";if(i&&(o=(i=i._value.trimLeft().trimRight()).split("px")[1]),t&&0<t.length&&t[0].label)for(var r=0;r<t.length;r++)t[r].label.font=e+"px  "+o}}},500)},labelFontSize:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),(!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.font=e+"px  sans-serif"}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?parseFloat(e[0].label.font):void 0}},labelFillColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.fillColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.fillColor;return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}}},labelOutlineColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.outlineColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.outlineColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},labelOutlineWidth:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.outlineWidth=e}},200),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.outlineWidth;if(e)return e._value}}},labelBackgroundColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.backgroundColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.backgroundColor;return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}}},labelBackground:{set:Ce.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.showBackground=e},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.background:void 0}},labelScale:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.scale;if(e)return e._value}}},labelHorizontalOrigin:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.horizontalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.horizontalOrigin;if(e)return e._value}}},labelVerticalOrigin:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.verticalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.verticalOrigin;if(e)return e._value}}},labelHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.heightReference;if(e)return e._value}}},labelDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,parseInt(e)),t[o].label.scaleByDistance=new this._cesium.NearFarScalar(i,1,parseInt(e),0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&(e&&0<e.length&&e[0].label))return e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE}},labelDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(parseInt(e),i),t[o].label.scaleByDistance=new this._cesium.NearFarScalar(parseInt(e),1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&(e&&0<e.length&&e[0].label))return e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.near:0}},labelHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),o=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=o}}},500),get:function(){return 0}},labelShow:{set:Ce.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].label&&e?(t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].label=new this._cesium.LabelGraphics({text:"label",font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})):(t[i].label&&(t[i].label.show=e),t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)return e&&0<e.length&&e[0].label?e[0].label.show:void 0}},modelShow:{set:Ce.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e),!t[i].model&&e?t[i].model=new this._cesium.ModelGraphics({show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}):(t[i].model&&(t[i].model.show=e),t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)return e&&0<e.length&&e[0].model?e[0].model.show:void 0}},modelUri:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length)for(var i,o=0;o<t.length;o++)t[o].model?t[o].model.uri=e:(/^\[/.test(e)&&(e=1<(i=e.split("[")).length?i[0]+i[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[o].properties[e])),t[o].model=new this._cesium.ModelGraphics({uri:e,show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}))}},500)},modelScale:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){e=parseFloat(e);var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].model.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.scale;if(e)return e._value}}},modelShadows:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.shadows=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)return e&&0<e.length&&e[0].model?e[0].model.shadows:void 0}},modelHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.heightReference;if(e)return e._value}}},modelDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;e&&!/^point.fid/.test(e[0]._id)&&null==e[0].model||e&&0<e.length&&e[0].model&&(e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE)}},modelDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&(e&&0<e.length&&e[0].model))return e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.near:0}},modelColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},modelLightColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.lightColor=e}},100),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.lightColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},modelHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),o=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=o}}},500),get:function(){return 0}},pointColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},pointShow:{set:Ce.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].point&&e?(t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].point=new this._cesium.PointGraphics({color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0})):(t[i].point&&(t[i].point.show=e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)return e&&0<e.length&&e[0].point?e[0].point.show:void 0}},pointPixelSize:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.pixelSize=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.pixelSize;if(e)return e._value}}},pointOutlineColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.outlineColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.outlineColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},pointOutlineWidth:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.outlineWidth=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.outlineWidth;if(e)return e._value}}},pointHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.heightReference;if(e)return e._value}}},pointDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[o].point.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&(e&&0<e.length&&e[0].point))return e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE}},pointDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[o].point.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&(e&&0<e.length&&e[0].point))return e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.near:0}},pointHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),o=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=o}}},500),get:function(){return 0}},billboardShow:{set:Ce.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].billboard&&e?(t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard=new this._cesium.BillboardGraphics({show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})):(t[i].billboard&&(t[i].billboard.show=e),t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.show:void 0}},billboardImage:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length)for(var i,o=0;o<t.length;o++)/^\[/.test(e)&&(e=1<(i=e.split("[")).length?i[0]+i[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[o].properties[e])),t[o].billboard?t[o].billboard.image=e:t[o].billboard=new this._cesium.BillboardGraphics({image:e,show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})}},500)},billboardScale:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.scale;if(e)return e._value}}},billboardHorizontalOrigin:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.horizontalOrigin=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.horizontalOrigin:void 0}},billboardVerticalOrigin:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.verticalOrigin=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)return e&&0<e.length&&e[0].billboard?e[0].billboard.verticalOrigin:void 0}},billboardWidth:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.width=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.width;if(e)return e._value}}},billboardHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.height=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.height;if(e)return e._value}}},billboardColor:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},billboardHeightReference:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].billboard.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].model){e=e[0].billboard.heightReference;if(e)return e._value}}},billboardDistanceDisplayMaxCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[o].billboard.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&(e&&0<e.length&&e[0].billboard))return e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE}},billboardDistanceDisplayMinCondition:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[o].billboard.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&(e&&0<e.length&&e[0].billboard))return e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.near:0}},billboardPHeight:{set:Ce.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),o=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=o}}},500),get:function(){return 0}}});function cl(e,c,h,m){var d=[],p=void 0!==e[0].longitude;return e.forEach(function(e){var t,i,o,r,n,a,s,l=[],u=p?e:hl.scene.globe.ellipsoid.cartesianToCartographic(e);t=u,o=m,r=(i=c).west,n=c.east,a=c.south,s=c.north-a,e=180*t.longitude/Math.PI,i=180*t.latitude/Math.PI,t.normalizedLongitude=(e-r)/(n-r)*h,t.normalizedLatitude=(i-a)/s*o,l.push((u=t).normalizedLongitude),l.push(u.normalizedLatitude),d.push(l)}),d}var hl,ml=function(e,t,i){var o=t.west*Cesium.Math.DEGREES_PER_RADIAN,r=t.east*Cesium.Math.DEGREES_PER_RADIAN,n=t.south*Cesium.Math.DEGREES_PER_RADIAN,t=t.north*Cesium.Math.DEGREES_PER_RADIAN,t=new Cesium.Rectangle(o,n,r,t);return function(e,t,i,o,r){if(r===undefined){var r=document.createElement("canvas");r.width=i,r.height=o}var n=r.getContext("2d");if(!(e.length<=0)){n.moveTo(e[0][0],e[0][1]);for(var a=0;a<e.length;a++)n.lineTo(e[a][0],e[a][1]);return null!=t&&(n.fillStyle=t,n.fill()),r}}(cl(e,t,32,32),"#FF0000",32,32)};function dl(e,t){return Math.floor(Math.random()*(t-e+1))+e}function pl(e,o){var t=Cesium.when.defer(),r=[];return e.forEach(function(e){var t,i;r.push((t=e,i=o,e=Cesium.when.defer(),(dl=ml(t.vertices,i,t.heights[0])).timeStamp=t.timeStamp,dl.mtHeight=t.heights,dl.mtType=t.mtType,dl.fromKML=t.fromKML,dl.rect=t.rectangle,dl.level=t.level,e.resolve(dl),e))}),Cesium.when.all(r,function(e){e[0].lenght;var o;1===e.length?t.resolve(e[0]):(e=e.sort(function(e,t){return t.timeStamp-e.timeStamp}),o=e.shift(),e.forEach(function(i){o.forEach(function(e,t){e===dl&&i[t]!==dl&&(o[t]=i[t])})}),t.resolve(o))}),t}function gl(e,t){if(hl=e,!Cesium.defined(t))throw new Cesium.DeveloperError("options is required.");this._errorEvent=new Cesium.Event,this._modelFloorMasks={},this._credit=t.credit,"string"==typeof this._credit&&(this._credit=new Cesium.Credit(this._credit)),t.heightMapWidth=Cesium.defaultValue(t.heightMapWidth,32),t.heightMapHeight=Cesium.defaultValue(t.heightMapHeight,32),this._options=t,this.readyPromise=Cesium.when.resolve(!0),this._subdomains=t.subdomains,t.firstRequestUrl=t.url.replace("{s}",this.sTag(0,0,0)),this._firstRequest=t.firstRequestUrl+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&v=1&layers="+t.layerName+"&Styles=&Format=image/mpt";var i=this,e=t.pngOnly;void 0!==t.maxTerrainLevel&&isNaN(t.maxTerrainLevel)&&(t.maxTerrainLevel=void 0),this._maxTerrainLevel=Cesium.defaultValue(t.maxTerrainLevel,30),e?i.setFormatMPT(!1):$.ajax({url:t.cacheUrl?t.cacheUrl+"/0/0/0.mpt":this._firstRequest,success:function(e){if(!!(Cesium.defined(e.childNodes)&&0<e.childNodes.length))return i.setFormatMPT(!1),null;i.setFormatMPT(!0)},error:function(){return i.setFormatMPT(!1),null},async:!1}),t.cacheUrl&&(this.isCache=!0,this.cacheLevel=t.cacheLevel||16,this._cacheUrl=t.cacheUrl+"/{z}/{x}/{y}.mpt");let o=this._maxTerrainLevel;this._availability={computeMaximumLevelAtPosition:function(e){return Math.min(o,16)}},this._urlTemplate=t.url+"?request=GetMap&Version=1.3.0&Service=WMS&v=1&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers="+t.layerName+"&Styles=&Format=image/"+this._format,this._allElevationLayers=null,this._tilingScheme=new Cesium.GeographicTilingScheme,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,4*t.heightMapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._workerPool=new ko({workerPath:SmartEarthRootUrl+"Workers/ParseElevationWorker.js"}),this._pendingRequests=0,this._requestGridSize=8,this._requestsCache={},this._requestsCacheKeys=[],this.errorEvent.addEventListener(function(e){},this)}gl._geometricErrorFactor=2,Object.defineProperties(gl.prototype,{errorEvent:{get:function(){return this._errorEvent}},availability:{get:function(){return this._availability}},credit:{get:function(){return this._credit}},hasVertexNormals:{get:function(){return!1}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},hasWaterMask:{get:function(){return!1}},heightMapHeight:{get:function(){return this._options.heightMapHeight}},heightMapWidth:{get:function(){return this._options.heightMapWidth}},pendingRequests:{get:function(){return this._pendingRequests}}}),gl.prototype.setFormatMPT=function(e){var t;e&&this.pngOnly||(t=this._format,this._format=e?"mpt":"png",t!==this._format&&(this._isMPT=e,void 0!==this._urlTemplate&&(this._urlTemplate=this._urlTemplate.replace("image/"+t,"image/"+this._format))))},gl.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)*gl._geometricErrorFactor},gl.prototype.createKeyFromTile=function(e,t,i){return e+"_"+t+"_"+i},gl.prototype.getTileDataAvailable=function(e,t,i){var o=Math.min(this._maxTerrainLevel,25);return!!this._isMPT||i<o},gl.prototype.requestFactorForLevel=function(e){var t=Math.log(this._requestGridSize)/Math.log(2),t=Math.min(t,e);return Math.pow(2,t)},gl.prototype.getRequestBaseTerrainUrl=function(e,t,i,o){return this.getRequestUrl(e,t,i,o)},gl.prototype.getRequestElevationLayer=function(e,t,i){return this.getRequestUrl(e,t,i,!1,!0)},gl.prototype.getRequestUrl=function(e,t,i,o,r){var n=i,a=null!=o?this.requestFactorForLevel(i):1,e=null!=o?(e-e%a)/a:e,t=null!=o?(t-t%a)/a:t,i=null!=o?i-Math.log(a)/Math.log(2):i;if(this.isCache&&0!==i&&i<=this.cacheLevel)return this._cacheUrl.replace("{x}",e).replace("{y}",t).replace("{z}",i);var s=this.tilingScheme.tileXYToNativeRectangle(e,t,i),o=this.heightMapWidth*a==256&&o?1:0;return r&&(o=0),this._urlTemplate.replace("{south}",s.south).replace("{north}",s.north).replace("{west}",s.west).replace("{east}",s.east).replace("{optimizedOnly}",o).replace("{width}",this.heightMapWidth*a).replace("{height}",this.heightMapHeight*a).replace("{s}",this.sTag(e,t,i))+"&level="+i+"&origLevel="+n},gl.prototype.isT_Inside_E=function(e,t){return e.west>=t.west*Cesium.Math.DEGREES_PER_RADIAN&&e.east<=t.east*Cesium.Math.DEGREES_PER_RADIAN&&e.south>=t.south*Cesium.Math.DEGREES_PER_RADIAN&&e.north<=t.north*Cesium.Math.DEGREES_PER_RADIAN},gl.prototype.isT_Intersects_E=function(e,t){var i=e.west*Cesium.Math.RADIANS_PER_DEGREE,o=e.east*Cesium.Math.RADIANS_PER_DEGREE,r=e.south*Cesium.Math.RADIANS_PER_DEGREE,e=e.north*Cesium.Math.RADIANS_PER_DEGREE,e=new Cesium.Rectangle(i,r,o,e);return Cesium.Rectangle.intersection(e,t,new Cesium.Rectangle)},gl.prototype.sTag=function(e,t,i){if(null==this._subdomains)return"";i=(e+t+i)%this._subdomains.length;return this._subdomains[i]},gl.prototype.refreshElevationLayer=function(e){e.rectangle&&void 0!==hl.scene.globe._surface._levelZeroTiles&&this.findDirectParent(e.rectangle,!0).freeResources()},gl.prototype.findDirectParent=function(e,t){function a(e,t,i){if(e._rectangle.width<=t.width*(i?4.1:2.1)&&Cesium.Rectangle.contains(e._rectangle,Cesium.Rectangle.center(t)))return e;for(var o=e.children.length,r=0;r<o;r++){var n=e.children[r];if(Cesium.Rectangle.contains(n._rectangle,Cesium.Rectangle.center(t)))return a(n,t,i)}return null}if(e.width==Math.PI)return null;for(var i=0;i<hl.scene.globe._surface._levelZeroTiles.length;i++){var o=a(hl.scene.globe._surface._levelZeroTiles[i],e,t);if(o)return o}return null},gl.prototype.isTileAvailable=function(e,t,i){var o=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),r=this.findDirectParent(o);if(r&&r.data&&r.data.terrainData){if(!(0<r.data.terrainData._childTileMask))return!1;for(var n=r.children.length,a=0;a<n;a++){var s=r.children[a];if(Cesium.Rectangle.equals(s._rectangle,o))return r.data.terrainData._childTileMask&1<<a}}return!0},gl.prototype.markTileAsUnavailable=function(e,t,i){var o=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),r=this.findDirectParent(o);r&&r.data&&r.data.terrainData&&0<r.data.terrainData._childTileMask&&$.each(r.children,function(e,t){if(Cesium.Rectangle.equals(t._rectangle,o)){switch(e){case 0:r.data.terrainData._childTileMask&=-5;break;case 1:r.data.terrainData._childTileMask&=-9;break;case 2:r.data.terrainData._childTileMask&=-2;break;case 3:r.data.terrainData._childTileMask&=-3}return!1}return!0})},gl.prototype.requestBaseTerrainTileGeometry=function(e,t,i,o){return this.requestTileGeometryBuffers(e,t,i,o)},gl.prototype.requestElevationLayerTileGeometry=function(e,t,i,o,r){return this.requestTileGeometryBuffers(e,t,i,o,r)},gl.prototype.requestTileGeometryBuffers=function(e,t,i,o,r){var h=this,m={};m.requestedRectangle=this.tilingScheme.tileXYToNativeRectangle(e,t,i),m.layer=r;var n,a,d=Cesium.when.defer(),s=this.requestTileHeightBuffer(e,t,i,o,void 0,r);return void 0===s?void 0:(n=this.requestTileHeightBuffer(e+1,t,i,o,!0,r),a=this.requestTileHeightBuffer(e,t+1,i,o,!0,r),r=this.requestTileHeightBuffer(e+1,t+1,i,o,!0,r),Cesium.when.all([s,n,a,r],function(e){if(null!=e[0].myReject&&e[0].myReject)d.reject();else{for(var t=h.heightMapWidth+1,i=h.heightMapHeight+1,o=new Float32Array(t*i),r=e[0].isFloor,n=0;n<t;n++)for(var a=0;a<i;a++){var s=n,l=a,u=0;a===t-1&&(l=0,u=1,r&&(u=0,l=t-2)),n===i-1&&(s=0,u=2);l=s*h.heightMapWidth+l;null===e[u]||null!=e[u].myReject&&e[u].myReject||(o[n*t+a]=e[u][l])}null!=e[3].myReject&&e[3].myReject||(o[t*i-1]=e[3][0]);var c=h.arrayToHeightmapTerrainData(o,t,i,15);m.buffer=c,d.resolve(m)}}).otherwise(function(){d.reject()}),d)},gl.prototype.requestTileGeometry=function(o,r,n,a){var s=this,l=[],u=s.tilingScheme.tileXYToNativeRectangle(o,r,n);null!=this._allElevationLayers&&0<this._allElevationLayers.length&&7<n?$(this._allElevationLayers).each(function(e,t){var i;t.show?(i=t.rectangle,s.isT_Inside_E(u,i)?(s.setFormatMPT(!1),l.push(s.requestElevationLayerTileGeometry(o,r,n,a,t))):(null!=s.isT_Intersects_E(u,i)?(s.setFormatMPT(!1),l.push(s.requestElevationLayerTileGeometry(o,r,n,a,t))):s.setFormatMPT(!0),l.push(s.requestBaseTerrainTileGeometry(o,r,n,a)))):(s.setFormatMPT(!0),l.push(s.requestBaseTerrainTileGeometry(o,r,n,a)))}):(s.setFormatMPT(!0),l.push(s.requestBaseTerrainTileGeometry(o,r,n,a)));var c=Cesium.when.defer();return Cesium.when.all(l,function(e){var t,i;1===e.length?(void 0!==e.layer&&console.log("missing scale and offset"),c.resolve(e[0].buffer)):1<e.length?(t=$.grep(e,function(e){return void 0!==e.layer}),i=$.grep(e,function(e){return void 0===e.layer}),0===t.length?c.resolve(e[0].buffer):(e=t[t.length-1],t=i[i.length-1],i={tolerance:e.layer.nullTolerance,nullValueNumber:e.layer.nullValueNumber,verticesX:e.layer.polygonVerticesX,verticesY:e.layer.polygonVerticesY,scale:Cesium.defaultValue(e.layer.scale,1),offset:Cesium.defaultValue(e.layer.offset,0)},c.resolve(s.mergeBuffers(t.buffer,e.buffer,i,t.requestedRectangle)))):c.reject()}).otherwise(function(){c.reject()}),c},gl.prototype.mergeBuffers=function(e,t,i,o){var r,n;o.west,o.north;o.east,o.south;o.width,o.height;var a,s,l=i.scale,u=i.offset,c=i.nullValueNumber,o=i.tolerance,h=void 0!==c&&void 0!==o;h&&(a=Cesium.defaultValue(i.nullValueNumber,0),s=Cesium.defaultValue(Number(i.tolerance),0));for(var m=new Float32Array(1089),d=0;d<33;d++,0)for(r=0,0;r<33;r++,0)m[n=33*d+r]=h?!t._buffer[n]||t._buffer[n]>=a-s&&t._buffer[n]<=a+s?e._buffer[n]:t._buffer[n]*l+u:t._buffer[n]?t._buffer[n]*l+u:e._buffer[n];return this.arrayToHeightmapTerrainData(m,33,33,15)},gl.prototype.requestTileHeightBuffer=function(u,c,h,e,t,o){if(!isNaN(u+c+h)){e=0==(e=!Cesium.defined(e)||!1===e?new Cesium.Request({defer:!0}):e).defer;t=Cesium.defaultValue(e,!1);var i,m,r,n,d,p,g=Cesium.when.defer();if(void 0!==o?(o.getUrlFromSTag=function(e,t,i){return void 0===o.subdomains?o.url:o.subdomains[0]+"/SG"},i=this.getRequestElevationLayer(u,c,h).replace(this._options.url,o.getUrlFromSTag(u,c,h)+"/Elevation").replace(this._options.layerName,o.name),"mpt"===o.format&&(i=i.replace("image/png","image/mpt"))):(i=this.getRequestBaseTerrainUrl(u,c,h,e||t),m=hl.terrainProvider.tilingScheme.tileXYToRectangle(u,c,h),t=hl.terrainProvider._modifyTerrainObjects,r=Cesium.when.defer(),void 0!==t?(n=[],t.forEach(function(e){e.show&&null!=Cesium.Rectangle.intersection(m,e.rectangle,new Cesium.Rectangle)&&n.push(e)}),!(0<n.length)||1===n.length&&n[0].modelFloorBestLevel&&h>n[0].modelFloorBestLevel?r.resolve("NoMerge"):(s=pl(n,m),Cesium.when(s,function(e){r.resolve(e)}).otherwise(function(e){console.log(e)}))):r.resolve("NoMerge"),d=Cesium.when.defer(),1===(s=$.grep([],function(e){return 0<e._selectedTiles.length})).length&&s[0].level&&h>s[0].level?d.resolve("NoFloor"):(p=!1,s.forEach(function(e){if(e.ready&&e.show&&void 0!==e.rootFloorRectangle&&void 0!==Cesium.Rectangle.intersection(m,e.rootFloorRectangle)){var t=new Uint16Array(1024),i=m.west;m.south;for(var o=(m.east-m.west)/32,r=(m.north-m.south)/32,n=0;n<32;n++)for(var a=0;a<32;a++){var s=m.north-r*n-r/2,l=new Cesium.Cartographic(i+o*a+o/2,s),u=65535,s=e.getHRMTFP(e,l,!0);65535!==(u=null!=s&&s.content&&s.content._model&&s.content._model.floor?s.content._model.floor.getHeight(l.longitude,l.latitude):u)&&(u+=1.5),t[32*n+a]=u}p=!0,d.resolve(t)}}),p||d.resolve("NoFloor")),hl.scene.globe.ellipsoid),!1===this._requestsCache.hasOwnProperty(i)){if(this._requestsCache[i]={},this._requestsCacheKeys.push(i),100<this._requestsCacheKeys.length){for(var a=0;a<50;a++)delete this._requestsCache[this._requestsCacheKeys[a]];this._requestsCacheKeys.splice(0,50)}}else{var s=this._requestsCacheKeys.indexOf(i);this._requestsCacheKeys.splice(s,1),this._requestsCacheKeys.push(i)}var l=this._requestsCache[i];if(void 0!==l.dataLoaded||(l.dataLoaded=Cesium.Resource.fetchArrayBuffer(i),Cesium.defined(l.dataLoaded))){var _=this;return this._pendingRequests++,Cesium.when(l.dataLoaded,function(e){void 0===l.workerFinished&&(l.workerFinished=_._workerPool.queueWorkItem({buffer:e,isElevation:void 0!==o,level:h})),Cesium.when.all([l.workerFinished,r,d],function(e){var t=void 0!==e[1]&&"NoMerge"!==e[1],i=void 0!==e[2]&&"NoFloor"!==e[2];if(e[0].rejected){for(var o=_.heightMapWidth*_.heightMapHeight,r=new Int16Array(o),n=0;n<o;n++)r[n]=300;return 2<h&&(r.myReject=!0),g.resolve(r),g}var a=_.extractTileHeightBuffer(e[0].buffer,u,c,h);if(_._pendingRequests--,t)for(n=0;n<32;n++)for(var s=0;s<32;s++)a[l=32*n+s]=e[1].mtHeight[0];if(i){for(var l,n=0;n<32;n++)for(s=0;s<32;s++)a[l=32*n+s]=(65535===e[2][l]||10500<e[2][l]?a:e[2])[l];a.isFloor=!0}g.resolve(a)}).otherwise(function(){for(var e=_.heightMapWidth*_.heightMapHeight,t=new Int16Array(e),i=0;i<e;i++)t[i]=300;return 2<h&&(t.myReject=!0),g.resolve(t),g})}).otherwise(function(){_._pendingRequests--,g.reject()}),g}}},gl.prototype.extractTileHeightBuffer=function(e,t,i,o){try{for(var r=this.requestFactorForLevel(o),n=t%r,a=i%r,s=new Float32Array(this.heightMapWidth*this.heightMapHeight),l=1e6,u=-1e5,c=0;c<this.heightMapHeight;c++)for(var h=0;h<this.heightMapWidth;h++){var m=c+a*this.heightMapHeight,d=h+n*this.heightMapWidth,p=c*this.heightMapWidth+h,g=m*this.heightMapWidth*r+d;e[g]>u&&(u=e[g]),e[g]<l&&(l=e[g]),s[p]=e[g]}}catch(e){console.log(e.message)}return s},gl.prototype.arrayToHeightmapTerrainData=function(e,t,i,o){return!1===Cesium.defined(e)&&(e=new Int16Array(t*i)),new Cesium.HeightmapTerrainData({buffer:e,width:t,height:i,childTileMask:o})};function _l(e,t,i){var o,r,n,a,s,l=t.west*Cesium.Math.DEGREES_PER_RADIAN,u=t.east*Cesium.Math.DEGREES_PER_RADIAN,c=t.south*Cesium.Math.DEGREES_PER_RADIAN,t=t.north*Cesium.Math.DEGREES_PER_RADIAN,t=new Cesium.Rectangle(l,c,u,t);return function(e,t,i,o,r){if(r===undefined){var r=document.createElement("canvas");r.width=i,r.height=o}var n=r.getContext("2d");if(!(e.length<=0)){n.moveTo(e[0][0],e[0][1]);for(var a=0;a<e.length;a++)n.lineTo(e[a][0],e[a][1]);return null!=t&&(n.fillStyle=t,n.fill()),r}}((o=t,n=r=32,a=[],s=void 0!==e[0].longitude,e.forEach(function(e){var t=[],e=s?e:fl.scene.globe.ellipsoid.cartesianToCartographic(e),e=yl(e,o,r,n);t.push(e.normalizedLongitude),t.push(e.normalizedLatitude),a.push(t)}),a),"#FF0000",32,32)}var fl,yl=function(e,t,i,o){var r=t.west,n=t.east,a=t.south,s=t.north-a,l=180*e.longitude/Math.PI,t=180*e.latitude/Math.PI;return e.normalizedLongitude=(l-r)/(n-r)*i,e.normalizedLatitude=(t-a)/s*o,e};function vl(e,t){if(fl=e,!Cesium.defined(t))throw new Cesium.DeveloperError("options is required.");this._errorEvent=new Cesium.Event,this._credit=t.credit,"string"==typeof this._credit&&(this._credit=new Cesium.Credit(this._credit)),t.heightMapWidth=Cesium.defaultValue(t.heightMapWidth,32),t.heightMapHeight=Cesium.defaultValue(t.heightMapHeight,32),this._options=t,this._subdomains=t.subdomains,t.url=t.url.replace("{s}",this.sTag(0,0,0)),this._firstRequest=t.url+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&layers="+t.layerName+"&Styles=&Format=image/mpt",t.token&&(this._firstRequest+="&token="+t.token),this._requestVertexNormals=Cesium.defaultValue(t.requestVertexNormals,!1);var i=this;$.ajax({url:this._firstRequest,success:function(e){if(!!(Cesium.defined(e.childNodes)&&0<e.childNodes.length))return i._isMPT=!1,i._format="png",null;i._isMPT=!0,i._format="mpt"},error:function(){return i._isMPT=!1,i._format="png",null},async:!1});this._availability={computeMaximumLevelAtPosition:function(e){return Math.min(16,16)}},this._urlTemplate=t.url+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers="+t.layerName+"&Styles=&Format=image/"+this._format,t.token&&(this._urlTemplate+="&token="+t.token),this._tilingScheme=new Cesium.GeographicTilingScheme,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,4*t.heightMapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._workerPool=new ko({workerPath:SmartEarthRootUrl+"Workers/ParseElevationWorker.js"}),this._pendingRequests=0,this._requestGridSize=8,this._requestsCache={},this._requestsCacheKeys=[],this.errorEvent.addEventListener(function(e){},this)}function Cl(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function wl(e){this._heightmapWidth=65,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=Cesium.defaultValue(e.requestVertexNormals,!1),this._requestWaterMask=Cesium.defaultValue(e.requestWaterMask,!1),this._requestMetadata=Cesium.defaultValue(e.requestMetadata,!0),this._errorEvent=new Cesium.Event;var t=e.credit;"string"==typeof t&&(t=new Cesium.Credit(t)),this._credit=t,this._availability=void 0;var i=Cesium.when.defer();this._ready=!1,this._readyPromise=i,this._tileCredits=void 0;var v,C,w,b=this,T=this._layers=[],S="",P=[],E=0;function x(e){if(!e.format)return u="The tile format is not specified in the layer.json file.",void(w=Cesium.TileProviderError.handleError(w,b,b._errorEvent,u,void 0,void 0,void 0,D));if(!e.tiles||0===e.tiles.length)return u="The layer.json file does not specify any tile URL templates.",void(w=Cesium.TileProviderError.handleError(w,b,b._errorEvent,u,void 0,void 0,void 0,D));var t=!1,i=!1,o=!1,r=!0,n=!1;if("heightmap-1.0"===e.format)n=!0,Cesium.defined(b._heightmapStructure)||(b._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535}),b._requestWaterMask=i=!0;else if(0!==e.format.indexOf("quantized-mesh-1."))return u='The tile format "'+e.format+'" is invalid or not supported.',void(w=Cesium.TileProviderError.handleError(w,b,b._errorEvent,u,void 0,void 0,void 0,D));var a,s=e.tiles,l=e.maxzoom;if(E=Math.max(E,l),e.projection&&"EPSG:4326"!==e.projection){if("EPSG:3857"!==e.projection)return u='The projection "'+e.projection+'" is invalid or not supported.',void(w=Cesium.TileProviderError.handleError(w,b,b._errorEvent,u,void 0,void 0,void 0,D));b._tilingScheme=new Cesium.WebMercatorTilingScheme({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:b._ellipsoid})}else b._tilingScheme=new Cesium.GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:b._ellipsoid});if(b._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(b._tilingScheme.ellipsoid,b._heightmapWidth,b._tilingScheme.getNumberOfXTilesAtLevel(0)),e.scheme&&"tms"!==e.scheme&&"slippyMap"!==e.scheme)return u='The scheme "'+e.scheme+'" is invalid or not supported.',void(w=Cesium.TileProviderError.handleError(w,b,b._errorEvent,u,void 0,void 0,void 0,D));b._scheme=e.scheme,Cesium.defined(e.extensions)&&-1!==e.extensions.indexOf("octvertexnormals")?t=!0:Cesium.defined(e.extensions)&&-1!==e.extensions.indexOf("vertexnormals")&&(r=!(t=!0)),Cesium.defined(e.extensions)&&-1!==e.extensions.indexOf("watermask")&&(i=!0),Cesium.defined(e.extensions)&&-1!==e.extensions.indexOf("metadata")&&(o=!0);var u=e.metadataAvailability,c=e.available;if(Cesium.defined(c)&&!Cesium.defined(u))for(var h=new Cesium.TileAvailability(b._tilingScheme,c.length),m=0;m<c.length;++m){var d=c[m],p=b._tilingScheme.getNumberOfYTilesAtLevel(m);Cesium.defined(P[m])||(P[m]=[]);for(var g=0;g<d.length;++g){var _=d[g],f=p-_.endY-1,y=p-_.startY-1;P[m].push([_.startX,f,_.endX,y]),h.addAvailableTileRange(m,_.startX,f,_.endX,y)}}else Cesium.defined(u)&&(a=new Cesium.TileAvailability(b._tilingScheme,l),h=new Cesium.TileAvailability(b._tilingScheme,l),P[0]=[[0,0,1,0]],h.addAvailableTileRange(0,0,0,1,0));b._hasWaterMask=b._hasWaterMask||i,b._hasVertexNormals=b._hasVertexNormals||t,b._hasMetadata=b._hasMetadata||o,Cesium.defined(e.attribution)&&(0<S.length&&(S+=" "),S+=e.attribution),T.push(new Cl({resource:v,version:e.version,isHeightmap:n,tileUrlTemplates:s,availability:h,hasVertexNormals:t,hasWaterMask:i,hasMetadata:o,availabilityLevels:u,availabilityTilesLoaded:a,littleEndianExtensionSize:r}));e=e.parentUrl;if(Cesium.defined(e)){if(!Cesium.defined(h))return console.log("A layer.json can't have a parentUrl if it does't have an available array."),Cesium.when.resolve();(v=v.getDerivedResource({url:e})).appendForwardSlash();e=(C=v.getDerivedResource({url:"layer.json"})).fetchJson();return Cesium.when(e,x,I)}return Cesium.when.resolve()}function I(e){var t="An error occurred while accessing "+C.url+".";w=Cesium.TileProviderError.handleError(w,b,b._errorEvent,t,void 0,void 0,void 0,D)}function o(e){x(e).then(function(){if(!Cesium.defined(w)){var e,t=P.length;if(0<t)for(var i=b._availability=new Cesium.TileAvailability(b._tilingScheme,E),o=0;o<t;++o)for(var r=P[o],n=0;n<r.length;++n){var a=r[n];i.addAvailableTileRange(o,a[0],a[1],a[2],a[3])}0<S.length&&(e=new Cesium.Credit(S),Cesium.defined(b._tileCredits)?b._tileCredits.push(e):b._tileCredits=[e]),b._ready=!0,b._readyPromise.resolve(!0)}})}function r(e){o({extensions:["octvertexnormals"],format:"quantized-mesh-1.0",maxzoom:18,minzoom:0,name:"world",projection:"EPSG:3857",scheme:"slippyMap",tilejson:"1.0",tiles:["{z}/{x}/{y}.terrain"],version:"1.0.0"})}function D(){Cesium.when(C.fetchJson()).then(o).otherwise(r)}Cesium.when(e.url).then(function(e){e=Cesium.Resource.createIfNeeded(e);e.appendForwardSlash(),C=(v=e).getDerivedResource({url:"layer.json"}),b._tileCredits=e.credits,D()}).otherwise(function(e){i.reject(e)})}vl._geometricErrorFactor=2,Object.defineProperties(vl.prototype,{errorEvent:{get:function(){return this._errorEvent}},availability:{get:function(){return this._availability}},credit:{get:function(){return this._credit}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},hasWaterMask:{get:function(){return!1}},heightMapHeight:{get:function(){return this._options.heightMapHeight}},heightMapWidth:{get:function(){return this._options.heightMapWidth}},pendingRequests:{get:function(){return this._pendingRequests}}}),vl.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)*vl._geometricErrorFactor},vl.prototype.createKeyFromTile=function(e,t,i){return e+"_"+t+"_"+i},vl.prototype.getTileDataAvailable=function(e,t,i){return this._isMPT?void 0:i<16},vl.prototype.requestFactorForLevel=function(e){var t=Math.log(this._requestGridSize)/Math.log(2),t=Math.min(t,e);return Math.pow(2,t)},vl.prototype.getRequestUrl=function(e,t,i,o){var r=this.requestFactorForLevel(i);e=(e-e%r)/r,t=(t-t%r)/r,i-=Math.log(r)/Math.log(2);var n=this.tilingScheme.tileXYToNativeRectangle(e,t,i),o=this.heightMapWidth*r==256&&o?1:0;return this._urlTemplate.replace("{south}",n.south).replace("{north}",n.north).replace("{west}",n.west).replace("{east}",n.east).replace("{optimizedOnly}",o).replace("{width}",this.heightMapWidth*r).replace("{height}",this.heightMapHeight*r).replace("{s}",this.sTag(e,t,i))},vl.prototype.sTag=function(e,t,i){if(null==this._subdomains)return"";i=(e+t+i)%this._subdomains.length;return this._subdomains[i]},vl.prototype.findDirectParent=function(e){function n(e,t){if(e._rectangle.width<=2.1*t.width&&Cesium.Rectangle.contains(e._rectangle,Cesium.Rectangle.center(t)))return e;for(var i=e.children.length,o=0;o<i;o++){var r=e.children[o];if(Cesium.Rectangle.contains(r._rectangle,Cesium.Rectangle.center(t)))return n(r,t)}return null}if(e.width==Math.PI)return null;for(var t=0;t<fl.scene.globe._surface._levelZeroTiles.length;t++){var i=n(fl.scene.globe._surface._levelZeroTiles[t],e);if(i)return i}return null},vl.prototype.isTileAvailable=function(e,t,i){var o=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),r=this.findDirectParent(o);if(r&&r.data&&r.data.terrainData){if(!(0<r.data.terrainData._childTileMask))return!1;for(var n=r.children.length,a=0;a<n;a++){var s=r.children[a];if(Cesium.Rectangle.equals(s._rectangle,o))return r.data.terrainData._childTileMask&1<<a}}return!0},vl.prototype.markTileAsUnavailable=function(e,t,i){var o=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),r=this.findDirectParent(o);r&&r.data&&r.data.terrainData&&0<r.data.terrainData._childTileMask&&$.each(r.children,function(e,t){if(Cesium.Rectangle.equals(t._rectangle,o)){switch(e){case 0:r.data.terrainData._childTileMask&=-5;break;case 1:r.data.terrainData._childTileMask&=-9;break;case 2:r.data.terrainData._childTileMask&=-2;break;case 3:r.data.terrainData._childTileMask&=-3}return!1}return!0})},vl.prototype.requestTileGeometry=function(c,h,m,e){var t=this.requestTileHeightBuffer(c,h,m,e);if(void 0!==t){var d=this,i=this.requestTileHeightBuffer(c+1,h,m,e,!0),o=this.requestTileHeightBuffer(c,h+1,m,e,!0),e=this.requestTileHeightBuffer(c+1,h+1,m,e,!0),p=Cesium.when.defer();return Cesium.when.all([t,i,o,e],function(e){if(null!=e[0].myReject&&e[0].myReject)return d.markTileAsUnavailable(c,h,m),void p.reject();for(var t=d.heightMapWidth+1,i=d.heightMapHeight+1,o=new Float32Array(t*i),r=0;r<t;r++)for(var n=0;n<i;n++){var a=r,s=n,l=0;n===t-1&&(s=0,l=1),r===i-1&&(a=0,l=2);s=a*d.heightMapWidth+s;null===e[l]||null!=e[l].myReject&&e[l].myReject||(o[r*t+n]=e[l][s])}null!=e[3].myReject&&e[3].myReject||(o[t*i-1]=e[3][0]);var u=d.arrayToHeightmapTerrainData(o,t,i,15);p.resolve(u)}).otherwise(function(){p.reject()}),p}},vl.prototype.requestTileHeightBuffer=function(l,u,c,e,t,i){if(!isNaN(l+u+c)){var o=0==(e=!Cesium.defined(e)||!1===e?new Cesium.Request({defer:!0}):e).defer;t=Cesium.defaultValue(o,!1);var h=Cesium.when.defer(),e=this.getRequestUrl(l,u,c,o||t);if(!1===this._requestsCache.hasOwnProperty(e)){if(this._requestsCache[e]={},this._requestsCacheKeys.push(e),100<this._requestsCacheKeys.length){for(var r=0;r<50;r++)delete this._requestsCache[this._requestsCacheKeys[r]];this._requestsCacheKeys.splice(0,50)}}else{t=this._requestsCacheKeys.indexOf(e);this._requestsCacheKeys.splice(t,1),this._requestsCacheKeys.push(e)}var n=this._requestsCache[e];if(void 0!==n.dataLoaded||(n.dataLoaded=o?Cesium.RequestScheduler.request(e,Cesium.loadArrayBuffer):Cesium.loadArrayBuffer(e),Cesium.defined(n.dataLoaded))){var a=fl.terrainProvider.tilingScheme.tileXYToRectangle(l,u,c),e=fl.terrainProvider._modifyTerrainObjects,m=null,d=null;null!=e&&0<e.length&&e.forEach(function(e){e.show&&Cesium.Rectangle.intersection(a,e.rectangle,new Cesium.Rectangle)&&(m=_l((d=e).vertices,a,d.heights[0]))});var p=this;return this._pendingRequests++,Cesium.when(n.dataLoaded,function(e){void 0===n.workerFinished&&(n.workerFinished=p._workerPool.queueWorkItem({buffer:e,isElevation:void 0!==i,level:c})),Cesium.when(n.workerFinished,function(e){if(e.rejected){for(var t=p.heightMapWidth*p.heightMapHeight,i=new Int16Array(t),o=0;o<t;o++)i[o]=300;return 2<c&&(p.markTileAsUnavailable(l,u,c),i.myReject=!0),h.resolve(i),h}var r=p.extractTileHeightBuffer(e.buffer,l,u,c);if(null!=m)for(var n=m.getContext("2d").getImageData(0,0,32,32).data,a=0;a<32;a++)for(var s=0;s<32;s++)0!==n[4*(32*a+s)]&&(r[32*(31-a)+s]=d.heights[0]);p._pendingRequests--,h.resolve(r)})}).otherwise(function(){p._pendingRequests--,h.reject()}),h}}},vl.prototype.extractTileHeightBuffer=function(e,t,i,o){try{for(var r=this.requestFactorForLevel(o),n=t%r,a=i%r,s=new Float32Array(this.heightMapWidth*this.heightMapHeight),l=1e6,u=-1e5,c=0;c<this.heightMapHeight;c++)for(var h=0;h<this.heightMapWidth;h++){var m=c+a*this.heightMapHeight,d=h+n*this.heightMapWidth,p=c*this.heightMapWidth+h,g=m*this.heightMapWidth*r+d;e[g]>u&&(u=e[g]),e[g]<l&&(l=e[g]),s[p]=e[g]}}catch(e){console.log(e.message)}return s},vl.prototype.arrayToHeightmapTerrainData=function(e,t,i,o){return!1===Cesium.defined(e)&&(e=new Int16Array(t*i)),new Cesium.HeightmapTerrainData({buffer:e,width:t,height:i,childTileMask:o})};var bl={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Tl(e){return Cesium.defined(e)&&0!==e.length?{Accept:"application/vnd.quantized-mesh;extensions="+e.join("-")+",application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function Sl(r,n,a,s,l,e){if(!Cesium.defined(l))return Cesium.when.reject(new Cesium.RuntimeError("Terrain tile doesn't exist"));var t,i=l.tileUrlTemplates;if(0!==i.length){t=r._scheme&&"tms"!==r._scheme?a:r._tilingScheme.getNumberOfYTilesAtLevel(s)-a-1;var o,u=[];r._requestVertexNormals&&l.hasVertexNormals&&u.push(l.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),r._requestWaterMask&&l.hasWaterMask&&u.push("watermask"),r._requestMetadata&&l.hasMetadata&&u.push("metadata");var c=i[(n+t+s)%i.length],i=l.resource,u=Cesium.defined(i._ionEndpoint)&&!Cesium.defined(i._ionEndpoint.externalType)?(0!==u.length&&(o={extensions:u.join("-")}),Tl(void 0)):Tl(u),e=i.getDerivedResource({url:c,templateValues:{version:l.version,z:s,x:n,y:t},queryParameters:o,headers:u,request:e}).fetchArrayBuffer();if(Cesium.defined(e))return e.then(function(e){return Cesium.defined(r._heightmapStructure)?(t=r,i=e,o=new Uint16Array(i,0,t._heightmapWidth*t._heightmapWidth),new Cesium.HeightmapTerrainData({buffer:o,childTileMask:new Uint8Array(i,o.byteLength,1)[0],waterMask:new Uint8Array(i,o.byteLength+1,i.byteLength-o.byteLength-1),width:t._heightmapWidth,height:t._heightmapWidth,structure:t._heightmapStructure,credits:t._tileCredits})):function(e,t,i,o,r,n){var a=n.littleEndianExtensionSize,s=0,l=3*Float64Array.BYTES_PER_ELEMENT,u=4*Float64Array.BYTES_PER_ELEMENT,c=3*Uint16Array.BYTES_PER_ELEMENT,h=Uint16Array.BYTES_PER_ELEMENT,m=3*h,d=new DataView(t),p=new Cesium.Cartesian3(d.getFloat64(s,!0),d.getFloat64(s+8,!0),d.getFloat64(s+16,!0)),g=d.getFloat32(s+=l,!0);s+=Float32Array.BYTES_PER_ELEMENT;var _=d.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;var f=new Cesium.BoundingSphere(new Cesium.Cartesian3(d.getFloat64(s,!0),d.getFloat64(s+8,!0),d.getFloat64(s+16,!0)),d.getFloat64(s+l,!0));s+=u;var y=new Cesium.Cartesian3(d.getFloat64(s,!0),d.getFloat64(s+8,!0),d.getFloat64(s+16,!0)),v=d.getUint32(s+=l,!0);s+=Uint32Array.BYTES_PER_ELEMENT;var C=new Uint16Array(t,s,3*v);s+=v*c,65536<v&&(m=3*(h=Uint32Array.BYTES_PER_ELEMENT));var w=C.subarray(0,v),u=C.subarray(v,2*v),l=C.subarray(2*v,3*v);Cesium.AttributeCompression.zigZagDeltaDecode(w,u,l),s%h!=0&&(s+=h-s%h),c=d.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT;var b=Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(v,t,s,3*c);s+=c*m;for(var T=0,S=b.length,P=0;P<S;++P){var E=b[P];b[P]=T-E,0===E&&++T}w=d.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,u=Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(v,t,s,w),l=d.getUint32(s+=w*h,!0),s+=Uint32Array.BYTES_PER_ELEMENT,c=Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(v,t,s,l),m=d.getUint32(s+=l*h,!0),s+=Uint32Array.BYTES_PER_ELEMENT,w=Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(v,t,s,m),l=d.getUint32(s+=m*h,!0),s+=Uint32Array.BYTES_PER_ELEMENT;var x,I,m=Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(v,t,s,l);for(s+=l*h;s<d.byteLength;){var D=d.getUint8(s,!0);s+=Uint8Array.BYTES_PER_ELEMENT;var L=d.getUint32(s,a);if(s+=Uint32Array.BYTES_PER_ELEMENT,D===bl.OCT_VERTEX_NORMALS&&e._requestVertexNormals)x=new Uint8Array(t,s,2*v);else if(D===bl.WATER_MASK&&e._requestWaterMask)I=new Uint8Array(t,s,L);else if(D===bl.METADATA&&e._requestMetadata){D=d.getUint32(s,!0);if(0<D){var M=Cesium.getJsonFromTypedArray(new Uint8Array(t),s+Uint32Array.BYTES_PER_ELEMENT,D).available;if(Cesium.defined(M))for(var A=0;A<M.length;++A)for(var R=i+A+1,O=M[A],H=e._tilingScheme.getNumberOfYTilesAtLevel(R),V=0;V<O.length;++V){var k=O[V],F=H-k.endY-1,G=H-k.startY-1;e.availability.addAvailableTileRange(R,k.startX,F,k.endX,G),n.availability.addAvailableTileRange(R,k.startX,F,k.endX,G)}}n.availabilityTilesLoaded.addAvailableTileRange(i,o,r,o,r)}s+=L}return l=5*e.getLevelMaximumGeometricError(i),h=e._tilingScheme.tileXYToRectangle(o,r,i),h=Cesium.OrientedBoundingBox.fromRectangle(h,g,_,e._tilingScheme.ellipsoid),new Cesium.QuantizedMeshTerrainData({center:p,minimumHeight:g,maximumHeight:_,boundingSphere:f,orientedBoundingBox:h,horizonOcclusionPoint:y,quantizedVertices:C,encodedNormals:x,indices:b,westIndices:u,southIndices:c,eastIndices:w,northIndices:m,westSkirtHeight:l,southSkirtHeight:l,eastSkirtHeight:l,northSkirtHeight:l,childTileMask:e.availability.computeChildMaskForTile(i,o,r),waterMask:I,credits:e._tileCredits})}(r,e,s,n,a,l);var t,i,o}).otherwise(function(e){return Cesium.when.resolve(new Cesium.HeightmapTerrainData({buffer:new Uint8Array(256),width:16,height:16}))})}}function Pl(e,t,i,o){if(0!==o){e=e.availabilityLevels,e=o%e==0?o-e:(o/e|0)*e,o=1<<o-e;return{level:e,x:t/o|0,y:i/o|0}}}function El(e,t,i,o,r,n){if(!Cesium.defined(r.availabilityLevels))return{result:!1};for(var a,s,l,u=function(){delete r.availabilityPromiseCache[l]},c=r.availabilityTilesLoaded,h=r.availability,m=Pl(r,t,i,o);Cesium.defined(m);){if(h.isTileAvailable(m.level,m.x,m.y)&&!c.isTileAvailable(m.level,m.x,m.y))return n||(l=m.level+"-"+m.x+"-"+m.y,s=r.availabilityPromiseCache[l],Cesium.defined(s)||(a=new Cesium.Request({throttle:!1,throttleByServer:!0,type:Cesium.RequestType.TERRAIN}),s=Sl(e,m.x,m.y,m.level,r,a),Cesium.defined(s)&&(r.availabilityPromiseCache[l]=s).then(u))),{result:!0,promise:s};m=Pl(r,m.x,m.y,m.level)}return{result:!1}}wl.prototype.requestTileGeometry=function(e,t,i,o){var r,n=this._layers,a=n.length;if(1===a)r=n[0];else for(var s=0;s<a;++s){var l=n[s];if(!Cesium.defined(l.availability)||l.availability.isTileAvailable(i,e,t)){r=l;break}}return Sl(this,e,t,i,r,o)},Object.defineProperties(wl.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}}),wl.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},wl.prototype.getTileDataAvailable=function(e,t,i){if(Cesium.defined(this._availability)){if(i>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(i,e,t))return!0;if(!this._hasMetadata)return!1;for(var o=this._layers,r=o.length,n=0;n<r;++n)if(El(this,e,t,i,o[n],0===n).result)return;return!1}},wl.prototype.loadTileDataAvailability=function(e,t,i){if(!(!Cesium.defined(this._availability)||i>this._availability._maximumLevel||this._availability.isTileAvailable(i,e,t))&&this._hasMetadata)for(var o=this._layers,r=o.length,n=0;n<r;++n){var a=El(this,e,t,i,o[n],0===n);if(Cesium.defined(a.promise))return a.promise}},wl._getAvailabilityTile=Pl;function xl(e,t,i){var o,r,n,a,s,l=t.west*Cesium.Math.DEGREES_PER_RADIAN,u=t.east*Cesium.Math.DEGREES_PER_RADIAN,c=t.south*Cesium.Math.DEGREES_PER_RADIAN,t=t.north*Cesium.Math.DEGREES_PER_RADIAN,t=new Cesium.Rectangle(l,c,u,t);return function(e,t,i,o,r){if(r===undefined){var r=document.createElement("canvas");r.width=i,r.height=o}var n=r.getContext("2d");if(!(e.length<=0)){n.moveTo(e[0][0],e[0][1]);for(var a=0;a<e.length;a++)n.lineTo(e[a][0],e[a][1]);return null!=t&&(n.fillStyle=t,n.fill()),r}}((o=t,n=r=32,a=[],s=void 0!==e[0].longitude,e.forEach(function(e){var t=[],e=s?e:Il.scene.globe.ellipsoid.cartesianToCartographic(e),e=Dl(e,o,r,n);t.push(e.normalizedLongitude),t.push(e.normalizedLatitude),a.push(t)}),a),"#FF0000",32,32)}var Il,Dl=function(e,t,i,o){var r=t.west,n=t.east,a=t.south,s=t.north-a,l=180*e.longitude/Math.PI,t=180*e.latitude/Math.PI;return e.normalizedLongitude=(l-r)/(n-r)*i,e.normalizedLatitude=(t-a)/s*o,e};function Ll(e,t){if(Il=e,!Cesium.defined(t))throw new Cesium.DeveloperError("options is required.");this._errorEvent=new Cesium.Event,this._credit=t.credit,"string"==typeof this._credit&&(this._credit=new Cesium.Credit(this._credit)),t.heightMapWidth=Cesium.defaultValue(t.heightMapWidth,32),t.heightMapHeight=Cesium.defaultValue(t.heightMapHeight,32),this._options=t,this._subdomains=t.subdomains,t.url=t.url.replace("{s}",this.sTag(0,0,0)),this._firstRequest=t.url+"{z}/{x}/{y}.terrain",t.token&&(this._firstRequest+="&token="+t.token),this._requestVertexNormals=Cesium.defaultValue(t.requestVertexNormals,!1);var i=this;this._layers=[],this._ready=!1,$.ajax({url:this._firstRequest,success:function(e){if(!!(Cesium.defined(e.childNodes)&&0<e.childNodes.length))return i._isMPT=!1,i._format="png",null;i._isMPT=!0,i._format="mpt"},error:function(){return i._isMPT=!1,i._format="png",null},async:!1}),this._urlTemplate=t.url+"{z}/{x}/{y}.terrain",t.token&&(this._urlTemplate+="&token="+t.token),this._tilingScheme=new Cesium.WebMercatorTilingScheme({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:Il.scene.globe.ellipsoid}),this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,4*t.heightMapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._workerPool=new ko({workerPath:function(){for(var e=document.scripts,t="./js/sfsterrainprovider/ParseElevationWorker.js",i=0;i<e.length;i++){var o=e[i].src.split("/"),o=o[o.length-1];"SmartEarth.js"==o?t=e[i].outerHTML.split('"')[1].replace("SmartEarth.js","Workers/ParseElevationWorker.js"):"SmartEarth.min.js"==o&&(t=e[i].outerHTML.split('"')[1].replace("SmartEarth.min.js","Workers/ParseElevationWorker.js"))}return t}()}),this._pendingRequests=0,this._requestGridSize=8,this._requestsCache={},this._requestsCacheKeys=[],this.errorEvent.addEventListener(function(e){},this)}function Ml(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we,this._url="",this._show=!0}function Al(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we,this.item={show:!0},this._primitive=void 0,this._Provider=void 0,this.Legend=[],this.datas=[],this.PrimitiveData=[],this.PrimitiveObj={key:"",data:{}},this.Primitivekey=[],this.tilesLength=0,this.returnCount=0,this._primitiveByTile={},this._tileKeys=[],this._primitiveCollection=new this._cesium.PrimitiveCollection,this._cache=!1,this._forceRefreshPrvimitive=null}Ll._geometricErrorFactor=2,Object.defineProperties(Ll.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},hasWaterMask:{get:function(){return!1}},heightMapHeight:{get:function(){return this._options.heightMapHeight}},heightMapWidth:{get:function(){return this._options.heightMapWidth}},pendingRequests:{get:function(){return this._pendingRequests}}}),Ll.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)*Ll._geometricErrorFactor},Ll.prototype.createKeyFromTile=function(e,t,i){return e+"_"+t+"_"+i},Ll.prototype.getTileDataAvailable=function(e,t,i){return this._isMPT?void 0:i<16},Ll.prototype.requestFactorForLevel=function(e){var t=Math.log(this._requestGridSize)/Math.log(2),t=Math.min(t,e);return Math.pow(2,t)},Ll.prototype.getRequestUrl=function(e,t,i,o){var r=this.requestFactorForLevel(i);return e=(e-e%r)/r,t=(t-t%r)/r,i-=Math.log(r)/Math.log(2),this.tilingScheme.tileXYToNativeRectangle(e,t,i),this.heightMapWidth,this._urlTemplate.replace("{x}",e).replace("{y}",t).replace("{z}",i)},Ll.prototype.sTag=function(e,t,i){if(null==this._subdomains)return"";i=(e+t+i)%this._subdomains.length;return this._subdomains[i]},Ll.prototype.findDirectParent=function(e){function n(e,t){if(e._rectangle.width<=2.1*t.width&&Cesium.Rectangle.contains(e._rectangle,Cesium.Rectangle.center(t)))return e;for(var i=e.children.length,o=0;o<i;o++){var r=e.children[o];if(Cesium.Rectangle.contains(r._rectangle,Cesium.Rectangle.center(t)))return n(r,t)}return null}if(e.width==Math.PI)return null;for(var t=0;t<Il.scene.globe._surface._levelZeroTiles.length;t++){var i=n(Il.scene.globe._surface._levelZeroTiles[t],e);if(i)return i}return null},Ll.prototype.isTileAvailable=function(e,t,i){var o=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),r=this.findDirectParent(o);if(r&&r.data&&r.data.terrainData){if(!(0<r.data.terrainData._childTileMask))return!1;for(var n=r.children.length,a=0;a<n;a++){var s=r.children[a];if(Cesium.Rectangle.equals(s._rectangle,o))return r.data.terrainData._childTileMask&1<<a}}return!0},Ll.prototype.markTileAsUnavailable=function(e,t,i){var o=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),r=this.findDirectParent(o);r&&r.data&&r.data.terrainData&&0<r.data.terrainData._childTileMask&&$.each(r.children,function(e,t){if(Cesium.Rectangle.equals(t._rectangle,o)){switch(e){case 0:r.data.terrainData._childTileMask&=-5;break;case 1:r.data.terrainData._childTileMask&=-9;break;case 2:r.data.terrainData._childTileMask&=-2;break;case 3:r.data.terrainData._childTileMask&=-3}return!1}return!0})},Ll.prototype.requestTileGeometry=function(c,h,m,e){var t=this.requestTileHeightBuffer(c,h,m,e);if(void 0!==t){var d=this,i=this.requestTileHeightBuffer(c+1,h,m,e,!0),o=this.requestTileHeightBuffer(c,h+1,m,e,!0),e=this.requestTileHeightBuffer(c+1,h+1,m,e,!0),p=Cesium.when.defer();return Cesium.when.all([t,i,o,e],function(e){if(null!=e[0].myReject&&e[0].myReject)return d.markTileAsUnavailable(c,h,m),void p.reject();for(var t=d.heightMapWidth+1,i=d.heightMapHeight+1,o=new Float32Array(t*i),r=0;r<t;r++)for(var n=0;n<i;n++){var a=r,s=n,l=0;n===t-1&&(s=0,l=1),r===i-1&&(a=0,l=2);s=a*d.heightMapWidth+s;null===e[l]||null!=e[l].myReject&&e[l].myReject||(o[r*t+n]=e[l][s])}null!=e[3].myReject&&e[3].myReject||(o[t*i-1]=e[3][0]);var u=d.arrayToHeightmapTerrainData(o,t,i,15);p.resolve(u)}).otherwise(function(){return Cesium.when.resolve(new Cesium.HeightmapTerrainData({buffer:new Uint8Array(256),width:16,height:16}))}),p}},Ll.prototype.requestTileHeightBuffer=function(a,s,l,e,t){if(!isNaN(a+s+l)){var i=0==(e=!Cesium.defined(e)||!1===e?new Cesium.Request({defer:!0}):e).defer;t=Cesium.defaultValue(i,!1);var u=Cesium.when.defer(),e=this.getRequestUrl(a,s,l,i||t);if(!1===this._requestsCache.hasOwnProperty(e)){if(this._requestsCache[e]={},this._requestsCacheKeys.push(e),100<this._requestsCacheKeys.length){for(var o=0;o<50;o++)delete this._requestsCache[this._requestsCacheKeys[o]];this._requestsCacheKeys.splice(0,50)}}else{t=this._requestsCacheKeys.indexOf(e);this._requestsCacheKeys.splice(t,1),this._requestsCacheKeys.push(e)}var r=this._requestsCache[e];if(void 0!==r.dataLoaded||(r.dataLoaded=i?Cesium.RequestScheduler.request(e,Cesium.loadArrayBuffer):Cesium.loadArrayBuffer(e),Cesium.defined(r.dataLoaded))){var n=Il.terrainProvider.tilingScheme.tileXYToRectangle(a,s,l),e=Il.terrainProvider._modifyTerrainObjects,c=null,h=null;null!=e&&0<e.length&&e.forEach(function(e){e.show&&Cesium.Rectangle.intersection(n,e.rectangle,new Cesium.Rectangle)&&(c=xl((h=e).vertices,n,h.heights[0]))});var m=this;return this._pendingRequests++,Cesium.when(r.dataLoaded,function(e){void 0===r.workerFinished&&(r.workerFinished=m._workerPool.queueWorkItem({buffer:e})),Cesium.when(r.workerFinished,function(e){if(e.rejected){var t=new Uint16Array(e,0,m._heightmapWidth*m._heightmapWidth);return u.resolve(new Cesium.HeightmapTerrainData({buffer:t,childTileMask:new Uint8Array(m,t.byteLength,1)[0],waterMask:new Uint8Array(m,t.byteLength+1,buffer.byteLength-t.byteLength-1),width:m._heightmapWidth,height:m._heightmapWidth,structure:m._heightmapStructure,credits:m._tileCredits}))}var i=m.extractTileHeightBuffer(e.buffer,a,s,l);if(null!=c)for(var o=c.getContext("2d").getImageData(0,0,32,32).data,r=0;r<32;r++)for(var n=0;n<32;n++)0!==o[4*(32*r+n)]&&(i[32*(31-r)+n]=h.heights[0]);m._pendingRequests--,u.resolve(i)})}).otherwise(function(){m._pendingRequests--,u.reject()}),u}}},Ll.prototype.extractTileHeightBuffer=function(e,t,i,o){try{for(var r=this.requestFactorForLevel(o),n=t%r,a=i%r,s=new Uint16Array(this.heightMapWidth*this.heightMapHeight),l=1e6,u=-1e5,c=0;c<this.heightMapHeight;c++)for(var h=0;h<this.heightMapWidth;h++){var m=c+a*this.heightMapHeight,d=h+n*this.heightMapWidth,p=c*this.heightMapWidth+h,g=m*this.heightMapWidth*r+d;e[g]>u&&(u=e[g]),e[g]<l&&(l=e[g]),s[p]=e[g]}}catch(e){console.log(e.message)}return s},Ll.prototype.arrayToHeightmapTerrainData=function(e,t,i,o,r){var n=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Cesium.HeightmapTerrainData({buffer:n,childTileMask:new Uint8Array(t,n.byteLength,1)[0],waterMask:new Uint8Array(t,n.byteLength+1,t.byteLength-n.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})},Ml.prototype.createTerrainLayer=function(e,t,i,o,r,n){"Topography"==n?this.createTerrain(e,t,i,o,r):"sgs"==n?this.createSFSTerrain(e,t,i,o,r):"Arcgis"==n?this.createArcGISTerrain(e,t,i,o,r):"Cesium"==r&&this.createCesiumTerrain(e,t,i,o)},Ml.prototype.createTerrain=function(e,t,i,o,r){var n={type:"default",url:"",requestVertexNormals:!1,requestWaterMask:!1,requestMetadata:!0,credit:""};this.name=e,this.option=t,this.GroupID=i,this.checked=o,this.Description=r,this.type="createTerrain";r=null;if(this._core.isUrl(t)?(r=n).url=t:r=this._core.extend(n,t,!0),this._options=r,this._url=r.url,!o){var a={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this}we.setVisibility(i,!1,this._viewer,this._cesium);r=new("vector"===r.type?wl:Cesium.CesiumTerrainProvider)(r);this._viewer.scene.terrainProvider=r,this.item=r,this._show=!0;a={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},Ml.prototype.createCesiumTerrain=function(e,t,i,o){this.name=e,this.option=t,this.GroupID=i,this.checked=o,this.type="createCesiumTerrain";var r=this._core.extend({requestVertexNormals:!0},t,!0);this._options=r;r=Cesium.createWorldTerrain(r);if(this.type="Cesium",this.item=r,!o){var n={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this}we.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.scene.terrainProvider=r,this._show=!0;n={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},Ml.prototype.createSFSTerrain=function(e,t,i,o,r){var n=new gl(this._viewer,{url:t.url,layerName:t.layerName,requestVertexNormals:t.requestVertexNormals,token:t.token,cacheUrl:t.cacheUrl,cacheLevel:t.cacheLevel});if(this.name=e,this.option=t,this.GroupID=i,this.checked=o,this.Description=r,this.type="createSFSTerrain",this.type="SGS",this._url=t.url,this.layerName=t.layerName,this.requestVertexNormals=t.requestVertexNormals,!o){this._show=!0;var a={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this}we.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.terrainProvider=n,this.item=n,this._show=!0;a={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},Ml.prototype.createSFSTerrain71=function(e,t,i,o,r){var n=new vl(this._viewer,{url:t.url,layerName:t.layerName});if(this.name=e,this.option=t,this.GroupID=i,this.checked=o,this.Description=r,this.type="createSFSTerrain",this.type="SGS71",this._url=t.url,this.layerName=t.layerName,this.requestVertexNormals=t.requestVertexNormals,!o){this._show=!0;var a={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this}we.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.terrainProvider=n,this.item=n,this._show=!0;a={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},Ml.prototype.createTerrainVector=function(e,t,i,o,r){var n=new Ll(this._viewer,{url:t.url,layerName:t.layerName});if(this.name=e,this.option=t,this.GroupID=i,this.checked=o,this.Description=r,this.type="createSFSTerrain",this.type="SGS71",this._url=t.url,this.layerName=t.layerName,this.requestVertexNormals=t.requestVertexNormals,!o){this._show=!0;var a={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this}we.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.terrainProvider=n,this.item=n,this._show=!0;a={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},Ml.prototype.createArcGISTerrain=function(e,t,i,o,r){var n={url:""};this.name=e,this.option=t,this.GroupID=i,this.checked=o,this.Description=r,this.type="createArcGISTerrain";r=null;this._core.isUrl(t)?(r=n).url=t:r=this._core.extend(n,t,!0),this.type="ArcGIS",this._url=r.url;r=new this._cesium.ArcGISTiledElevationTerrainProvider(r);if(!o){this._show=!0;var a={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this}we.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.terrainProvider=r,this.item=r,this._show=!0;a={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},Ml.prototype.getType=function(){return{label:"影像",value:"TerrainProvider"}},Ml.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.item._layers[0].resource.url;return{type:"TerrainLayer",treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,url:t}}},Ml.prototype.setVisibility=function(e){var t,i;e?(we.setVisibility(this.GroupID,!1,this._viewer,this._cesium),t="SGS"===this.type?(t=this.option,new gl(this._viewer,{url:t.url,layerName:t.layerName,requestVertexNormals:t.requestVertexNormals,token:t.token,cacheUrl:t.cacheUrl,cacheLevel:t.cacheLevel})):"SGS71"===this.type?(t=this.option,new vl(this._viewer,{url:t.url,layerName:t.layerName,requestVertexNormals:t.requestVertexNormals,token:t.token,cacheUrl:t.cacheUrl,cacheLevel:t.cacheLevel})):"ArcGIS"===this.type?(t=this.option,new Cesium.ArcGISTiledElevationTerrainProvider(t)):"Cesium"===this.type?Cesium.createWorldTerrain(this._options):(i=this._options,e={url:"",requestVertexNormals:!1,requestWaterMask:!1,requestMetadata:!0,credit:""},this._core.isUrl(i)?(t=e).url=i:t=this._core.extend(e,i,!0),new this._cesium.CesiumTerrainProvider(t)),this._show=!0,this.item=t):(t=new this._cesium.EllipsoidTerrainProvider({}),this.item=t,this._show=!1),this._viewer.scene.terrainProvider=t},Ml.prototype.getVisibility=function(){return this._show},Ml.prototype.setTreeobj=function(e){this.treeobj=e},Ml.prototype.deleteObject=function(){try{this.item=new this._cesium.EllipsoidTerrainProvider({}),this._viewer.scene.terrainProvider=this.item}catch(e){console.log(e.message)}},Object.defineProperties(Ml.prototype,{}),Al.prototype.createVolumeVectorGeoJsonFeatureLayer=function(o,r,e,a,s,t,i){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED};this._core.isnull(e)||this._core.isnull(e.material)||"["==e.material.toString().charAt(0)&&"]"==e.material.toString().charAt(e.material.length-1)||(this._core.isHtmlColor(e.material)?e.material=this._color.colorFromHtmlColor(e.material):(/^rgb/.test(e.material)&&(e.material=this._color.rgbaStringToRgbaObj(e.material)),1<e.material.r&&(e.material.r=e.material.r/255),1<e.material.g&&(e.material.g=e.material.g/255),1<e.material.b&&(e.material.b=e.material.b/255),1<e.material.a&&(e.material.a=e.material.a/255),e.material=this._color.createColor(e.material.r,e.material.g,e.material.b,e.material.a)));var l=this._core.extend(n,e,!0);this._core.isnull(a)&&(a=16),this._core.isnull(s)&&(s=14),null==r&&console.log("url is required"),null==o&&console.log("layername is required");var u=[],c=this;this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=styleOption.level_max-1,this._Provider.loadTile=function(e,t){if((this.tile=t).state===c._cesium.QuadtreeTileLoadState.START)if(t.data={lines:[],geometryPrimitive:void 0},t.level>=s&&t.level<a){var i=Ce.filter(u,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=i.length&&i[0].data&&0<i[0].data.length)return t.data.geometryPrimitive=new c._cesium.Primitive({geometryInstances:i[0].data,appearance:new c._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:c._cesium.ShadowMode.ENABLED}),t.state=c._cesium.QuadtreeTileLoadState.LOADING,void(t.state===c._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=c._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));u.push({level:t.level,x:t.x,y:t.y,data:void 0}),n=t,c._core.xhr({url:r+"?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER="+o+"&STYLE=&TILEMATRIX=EPSG:4490:"+n.level+"&TILEMATRIXSET=EPSG:4490&FORMAT=application/json;type=geojson&TILECOL="+n.x+"&TILEROW="+n.y,type:"get",dataType:"json",success:function(e){var t=[];for(var i=0;i<e.features.length;i++){var o=[];!function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i]):o.push(t[i])}(e.features[i].geometry.coordinates[0]);var r=c._cesium.Cartesian3.fromDegreesArray(o);l.positions=r;r=new c._cesium.GeometryInstance({geometry:new c._cesium.PolylineVolumeGeometry({polylinePositions:l.positions}),attributes:{color:new c._cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE)}});t.push(r)}Ce.filter(u,function(e){return e.x==n.x&&e.y==n.y})[0].data=t,n.data.geometryPrimitive=new c._cesium.Primitive({geometryInstances:t,appearance:new c._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:c._cesium.ShadowMode.ENABLED})},error:function(){u=Ce.remove(u,function(e){return e.x==n.x&&e.y==n.y&&e.level==n.level})},complete:function(){n.state=c._cesium.QuadtreeTileLoadState.LOADING,n.state===c._cesium.QuadtreeTileLoadState.LOADING&&(n.data.geometryPrimitive&&n.data.geometryPrimitive.update(e,[]),n.state=c._cesium.QuadtreeTileLoadState.DONE,n.renderable=!0)}})}else t.state=c._cesium.QuadtreeTileLoadState.LOADING,t.state===c._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=c._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0);var n},this._primitive=new c._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});e=this._viewer.scene;e.primitives.add(this._primitive),e.primitivesQuadTrees&&e.primitivesQuadTrees.push(this._primitive)},Al.prototype.createVolumeGeoJsonFeatureLayer1=function(e,t,n,i,a){var s={polylinePositions:void 0,shapePositions:void 0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:this._cesium.Math.RADIANS_PER_DEGREE,vertexFormat:this._cesium.VertexFormat.DEFAULT,cornerType:this._cesium.CornerType.ROUNDED};null==t&&console.log("geojson is required");var o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t),l=this,u=[];s.shapePositions=this.computeCircle(n.radius),o.then(function(e){var t=l._cesium.Color.WHITE;l._core.isnull(n)||l._core.isnull(n.material)||(t="["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)?n.material.replace(/\[/,"").replace("/]/",""):Ce.clone(n.material),t=l._core.isHtmlColor(t)?l._color.colorFromHtmlColor(n.material):(1<(t=/^rgb/.test(t)?l._color.rgbaStringToRgbaObj(t):t).r&&(t.r=t.r/255),1<t.g&&(t.g=t.g/255),1<t.b&&(t.b=t.b/255),1<t.a&&(t.a=t.a/255),l._color.createColor(t.r,t.g,t.b,t.a)));for(var i=e.entities.values,o=0;o<i.length;o++){var r=i[o];s.polylinePositions=r.polyline.positions._value;r=new l._cesium.PolylineVolumeGeometry(s),r=l._cesium.PolylineVolumeGeometry.createGeometry(r),r=new l._cesium.GeometryInstance({geometry:r});u.push(r)}e="material:"+255*t.red+","+255*t.green+","+255*t.blue;l.Legend.push(e);t=l._viewer.scene.primitives.add(new l._cesium.Primitive({geometryInstances:u,appearance:new l._cesium.MaterialAppearance({material:new l._cesium.Material({fabric:{type:"Color",uniforms:{color:t}}}),faceForward:!0,flat:!1})}));l.item=t,0==n.show&&(t.show=!1),"function"==typeof a&&a(t)}),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+n.id);e={id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:geoOptions.url,style:n};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(i)?0:i),this},Al.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var o=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(o),e*Math.sin(o)))}return t},Al.prototype.createVolumeGeoJsonFeatureLayerProvider1=function(e,t,h,i,o,r){var m=this,n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(h)||this._core.isnull(h.material)||"["==h.material.toString().charAt(0)&&"]"==h.material.toString().charAt(h.material.length-1)||(this._core.isHtmlColor(h.material)?h.material=this._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=this._color.rgbaStringToRgbaObj(h.material)),1<h.material.r&&(h.material.r=h.material.r/255),1<h.material.g&&(h.material.g=h.material.g/255),1<h.material.b&&(h.material.b=h.material.b/255),1<h.material.a&&(h.material.a=h.material.a/255),h.material=this._color.createColor(h.material.r,h.material.g,h.material.b,h.material.a)));var d=this._core.extend(n,h,!0),a=new Ae(this._viewer,this._cesium,a);this._Provider=a;var p=this;a._loadTile=function(e){var c=new p._cesium.PrimitiveCollection;return p.Legend=[],e.features.forEach(function(e){var t,i=[];/^\[/.test(h.material)&&/\]$/.test(h.material)&&(t=h.material.replace(/\[/,"").replace(/\]/,""),d.material=e.properties[t],m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=m._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a)));for(var o=0;o<e.geometry.coordinates.length;o++){var r=e.geometry.coordinates[o];if(0<r.length)if(Array.isArray(r[0]))for(var n=0;n<r.length;n++){var a=r[n],a=p._cesium.Cartesian3.fromDegrees(a[0],a[1],d.height);i.push(a)}else{var s=p._cesium.Cartesian3.fromDegrees(r[0],r[1],d.height);i.push(s)}}d.position=i,e.positions=i,"0"==d.slttype||0==d.slttype?d.shape=p._core.computeCircle(d.radius):"1"==d.slttype||1==d.slttype?d.shape=p._core.starPositions(d.number,d.exradius,d.inradius):"2"!=d.slttype&&2!=d.slttype||(l=d.orth_width/2,u=d.orth_height/2,d.shape=[new p._cesium.Cartesian2(-l,-u),new p._cesium.Cartesian2(l,-u),new p._cesium.Cartesian2(l,u),new p._cesium.Cartesian2(-l,u)]);var l={polylinePositions:d.position,shapePositions:d.shape,cornerType:d.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},u=new p._cesium.PolylineVolumeGeometry(l),l=new p._cesium.GeometryInstance({id:e,geometry:u,attributes:{color:new p._cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}}),u="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;p.Legend.push(u);l=new p._cesium.Primitive({allowPicking:!0,appearance:new p._cesium.MaterialAppearance({material:new p._cesium.Material({fabric:{type:"Color",uniforms:{color:d.material}}}),faceForward:!0,flat:!1}),shadows:d.shadows,geometryInstances:l});c.add(l)}),c},this.item=a._primitiveCollection,a.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:d.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t.url,style:h};this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},Al.prototype.createVolumeGeoJsonFeatureLayerProvider=function(e,t,w,i,o,r){var n=this,a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY,radiusScale:1},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,Cesium:this._cesium};this._core.isnull(w)||this._core.isnull(w.material)||"["==w.material.toString().charAt(0)&&"]"==w.material.toString().charAt(w.material.length-1)||(this._core.isHtmlColor(w.material)?w.material=this._color.colorFromHtmlColor(w.material):(/^rgb/.test(w.material)&&(w.material=this._color.rgbaStringToRgbaObj(w.material)),1<w.material.r&&(w.material.r=w.material.r/255),1<w.material.g&&(w.material.g=w.material.g/255),1<w.material.b&&(w.material.b=w.material.b/255),1<w.material.a&&(w.material.a=w.material.a/255),w.material=this._color.createColor(w.material.r,w.material.g,w.material.b,w.material.a)));var l,b=this._core.extend(a,w,!0);"string"==typeof b.radius&&-1<b.radius.indexOf("[")&&-1<b.radius.indexOf("]")?(b.radius=b.radius.replace("[",""),b.radius=b.radius.replace("]",""),b.shape=void 0):"0"==b.slttype||0==b.slttype?(b.shape=this._core.computeCircle(b.radius),l=b.radius/2,u=b.radius/2,b.shape1=[new this._cesium.Cartesian2(-l,-u),new this._cesium.Cartesian2(l,-u),new this._cesium.Cartesian2(l,u),new this._cesium.Cartesian2(-l,u)]):"1"==b.slttype||1==b.slttype?b.shape=this._core.starPositions(b.number,b.exradius,b.inradius):"2"!=b.slttype&&2!=b.slttype||(l=b.orth_width/2,u=b.orth_height/2,b.shape=[new this._cesium.Cartesian2(-l,-u),new this._cesium.Cartesian2(l,-u),new this._cesium.Cartesian2(l,u),new this._cesium.Cartesian2(-l,u)]),this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=w.level_max-1,this._Provider._minimumHeight=parseFloat(w.height||0),this.item.show=o,this._Provider.loadTile=function(e,t){!function(y,v,C){if(v.state===Cesium.QuadtreeTileLoadState.START){if(v.data={lines:[],geometryPrimitive:void 0},0===C.item.show||!1===C.item.show||""===C.item.show||void 0===C.item.show)return v.state=Cesium.QuadtreeTileLoadState.DONE,v.renderable=!0;if(!(v.level>=w.level_min&&v.level<w.level_max&&C.item.show))return v.state=Cesium.QuadtreeTileLoadState.DONE,v.renderable=!0;var e=C._urlTemplate.replace(window.encodeURIComponent("{x}"),v.x).replace(window.encodeURIComponent("{y}"),v.y).replace(window.encodeURIComponent("{z}"),v.level);C._cache&&(e+="&"+C._core.getuid()),C._core.xhr({url:e,type:"get",dataType:"json",success:function(t){if(null==t)return v.state=Cesium.QuadtreeTileLoadState.DONE,void(v.renderable=!0);if(!b.shape&&"string"==typeof b.radius&&0<t.features.length){let e;var i;t.features[0]&&t.features[0].properties[b.radius]?(e=t.features[0].properties[b.radius],e.indexOf&&(-1<e.indexOf("*")||-1<e.indexOf("x")||-1<e.indexOf("X"))?(-1<e.indexOf("*")?e=e.split("*"):-1<e.indexOf("X")?e=e.split("X"):-1<e.indexOf("x")&&(e=e.split("x")),i=parseFloat(e[0])*b.radiusScale,f=parseFloat(e[1])*b.radiusScale,b.shape=[new C._cesium.Cartesian2(-i,-f),new C._cesium.Cartesian2(i,-f),new C._cesium.Cartesian2(i,f),new C._cesium.Cartesian2(-i,f)]):b.shape=C._core.computeCircle(e*b.radiusScale)):b.shape=C._core.computeCircle(.5)}C.Legend=[];for(var e=[],o=0;o<t.features.length;o++){var r=t.features[o];/^\[/.test(w.material)&&/\]$/.test(w.material)&&(d=w.material.replace(/\[/,"").replace(/\]/,""),b.material=r.properties[d],C._core.isHtmlColor(b.material)?b.material=C._color.colorFromHtmlColor(b.material):(/^rgb/.test(b.material)&&(b.material=C._color.rgbaStringToRgbaObj(b.material)),1<b.material.r&&(b.material.r=b.material.r/255),1<b.material.g&&(b.material.g=b.material.g/255),1<b.material.b&&(b.material.b=b.material.b/255),1<b.material.a&&(b.material.a=b.material.a/255),b.material=C._color.createColor(b.material.r,b.material.g,b.material.b,b.material.a)));for(var n=[],a=[],s=parseFloat(w.height||0),l=0;l<r.geometry.coordinates.length;l++){var u=r.geometry.coordinates[l];if(0<u.length)if(Array.isArray(u[0]))for(var c=0;c<u.length;c++){var h=u[c],s=s<(h[2]||0)?h[2]||0:s,h=C._cesium.Cartesian3.fromDegrees(h[0],h[1],b.height);n.push(h),a.push(b.material)}else{s=s<(u[2]||0)?u[2]||0:s;var m=C._cesium.Cartesian3.fromDegrees(u[0],u[1],b.height);n.push(m),a.push(b.material)}}v._minimumHeight=s,b.position=n,r.positions=n;var d,p="",g="";g="0"!=b.slttype&&0!=b.slttype||v.level>=parseFloat(w.level_max)-8&&19<parseFloat(w.level_max)||v.level>=parseFloat(w.level_max)-4&&16<parseFloat(w.level_max)||v.level>=parseFloat(w.level_max)-4?(p=b.shape,d={polylinePositions:b.position,shapePositions:p,cornerType:b.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},new C._cesium.PolylineVolumeGeometry(d)):(p="",_={positions:b.position,width:1,vertexFormat:C._cesium.PolylineColorAppearance.VERTEX_FORMAT,colors:a},new C._cesium.PolylineGeometry(_));var _=new C._cesium.GeometryInstance({id:r,geometry:g,attributes:{color:new C._cesium.ColorGeometryInstanceAttribute.fromColor(b.material)}});""==p&&(_=new C._cesium.GeometryInstance({id:r,geometry:g})),e.push(_)}var f="material:"+255*b.material.red+","+255*b.material.green+","+255*b.material.blue;C.Legend.push(f),0==e.length&&(v.state=Cesium.QuadtreeTileLoadState.DONE,v.renderable=!0);f=null,f=""==p?new C._cesium.Primitive({appearance:new C._cesium.PolylineColorAppearance,geometryInstances:e}):new C._cesium.Primitive({allowPicking:!0,appearance:new C._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:C._core.Shaders("vertexShaderSource"),fragmentShaderSource:C._core.Shaders("fragmentShaderSource")}),shadows:b.shadows,geometryInstances:e});v.data.geometryPrimitive=f,v.state=Cesium.QuadtreeTileLoadState.LOADING,v.state===Cesium.QuadtreeTileLoadState.LOADING&&(v.data.geometryPrimitive.update(y,[]),v.state=Cesium.QuadtreeTileLoadState.DONE,v.renderable=!0)},error:function(){null==v.count&&(v.count=0),v.count+=1,2<=v.count?(v.state=Cesium.QuadtreeTileLoadState.DONE,v.renderable=!0):v.state=Cesium.QuadtreeTileLoadState.START}}),v.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,n)},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var u=this._viewer.scene,s=u.primitives;w&&w.time&&(this._Provider._availability=new n._cesium.TimeIntervalCollection([new n._cesium.TimeInterval({start:w.time.start?n._cesium.JulianDate.fromDate(new Date(w.time.start)):n._cesium.Iso8601.MINIMUM_VALUE,stop:w.time.end?n._cesium.JulianDate.fromDate(new Date(w.time.end)):n._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),s.add(this._primitive),u.primitivesQuadTrees&&u.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(b.id)&&(b.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+b.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:b.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t.url,style:w};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this};var Rl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Ol(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0,this.Legend=[],this.datas=[],this.PrimitiveData=[],this.PrimitiveObj={key:"",data:{}},this.Primitivekey=[],this.tilesLength=0,this.returnCount=0,this._cache=!1,this._forceRefreshPrvimitive=null}Al.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":Rl(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},Al.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization=function(e,t,h,i,o,r){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(h)||this._core.isnull(h.material)||"["==h.material.toString().charAt(0)&&"]"==h.material.toString().charAt(h.material.length-1)||(this._core.isHtmlColor(h.material)?h.material=this._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=this._color.rgbaStringToRgbaObj(h.material)),1<h.material.r&&(h.material.r=h.material.r/255),1<h.material.g&&(h.material.g=h.material.g/255),1<h.material.b&&(h.material.b=h.material.b/255),1<h.material.a&&(h.material.a=h.material.a/255),h.material=this._color.createColor(h.material.r,h.material.g,h.material.b,h.material.a)));var s,m=this,d=this._core.extend(n,h,!0);"0"==d.slttype||0==d.slttype?d.shape=m._core.computeCircle(d.radius):"1"==d.slttype||1==d.slttype?d.shape=m._core.starPositions(d.number,d.exradius,d.inradius):"2"!=d.slttype&&2!=d.slttype||(s=d.orth_width/2,n=d.orth_height/2,d.shape=[new m._cesium.Cartesian2(-s,-n),new m._cesium.Cartesian2(s,-n),new m._cesium.Cartesian2(s,n),new m._cesium.Cartesian2(-s,n)]),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var l=[];this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=h.level_max-1,this._Provider.loadTile=function(e,t){var c,i,o;this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&m.item.show&&(c="z"+t.level+"x"+t.x+"y"+t.y,t.data={lines:[],geometryPrimitive:void 0},t.level>=h.level_min&&t.level<h.level_max&&m.item.show?m.Primitivekey.includes(c)||(i=t,o=m._urlTemplate.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level),m.tilesLength++,m._cache&&(o+="&"+m._core.getuid()),m._core.xhr({url:o,type:"get",dataType:"json",success:function(e){var i=[],o=new m._cesium.PrimitiveCollection;function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):s.push(e[t])}function t(){/^\[/.test(h.material)&&/\]$/.test(h.material)&&(t=h.material.replace(/\[/,"").replace(/\]/,""),d.material=l.properties[t],m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=m._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a)));var e=m._cesium.Cartesian3.fromDegreesArray(s);d.position=e,l.positions=e;var t={polylinePositions:d.position,shapePositions:d.shape,cornerType:d.cornerType},e=new m._cesium.PolylineVolumeGeometry(t),t=new m._cesium.GeometryInstance({id:l,geometry:e,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}}),e="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;m.Legend.push(e),i.push(t);t=new m._cesium.Primitive({allowPicking:!0,appearance:new m._cesium.MaterialAppearance({material:new m._cesium.Material({fabric:{type:"Color",uniforms:{color:d.material}}}),faceForward:!0,flat:!1}),shadows:d.shadows,geometryInstances:t});o.add(t)}m.Legend=[];for(var n,a=0;a<e.features.length;a++){var s=[],l=e.features[a];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var u=0;u<l.geometry.coordinates.length;u++)s=[],l.geometry.coordinates[u].pop(),r(l.geometry.coordinates[u]),2<s.length&&t();else r(l.geometry.coordinates),2<s.length&&t()}0<i.length&&(m.PrimitiveObj.data=o,m.PrimitiveObj.key=m.Primitivekey[m.returnCount],n={key:m.Primitivekey[m.returnCount],data:o},m.PrimitiveData.push(n),m._primitiveCollection.add(o),m._viewer.scene.primitives.add(o),m.datas.push(o),m.returnCount++,m._primitiveByTile[c]=o)},error:function(){l=Ce.remove(l,function(e){return e.x==i.x&&e.y==i.y&&e.level==i.level})},complete:function(e,t){i.state=m._cesium.QuadtreeTileLoadState.LOADING,i.state===m._cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive&&(i.state=m._cesium.QuadtreeTileLoadState.DONE),i.renderable=!0)}})):(t.state=m._cesium.QuadtreeTileLoadState.LOADING,t.state===m._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=m._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)))},this._primitive=new m._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});a=this._viewer.scene;a.primitives.add(this._primitive),a.primitivesQuadTrees&&a.primitivesQuadTrees.push(this._primitive),o||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:d.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:h};this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},Al.prototype.setTreeobj=function(e){this.treeobj=e},Al.prototype._removeObsoletePrimitives=function(e,t){var i,o=[];for(i in 0<t.length&&(o=t),e)o.includes(i)||this._primitiveCollection.remove(e[i])&&delete e[i]},Al.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},Al.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},Al.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},Al.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},Al.prototype.setVisibility=function(e){this.item.show=e,this._Provider&&this._Provider.setStatus(e)},Al.prototype.isCache=function(e){this._cache=e},Al.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},Al.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}};var Hl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Vl(e,t){this._viewer=e,this._cesium=t,this.SkyBoxFS="uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\ngl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n}\n",this.SkyBoxVS="attribute vec3 position;\nuniform mat3 u_rotateMatrix;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n"}function kl(e,t){this._viewer=e,this._cesium=t,this._core=new V}Ol.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":Hl(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},Ol.prototype.createVolumeVectorGeoJsonFeatureLayer=function(e,t,o,i,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(o)||this._core.isnull(o.material)||"["==o.material.toString().charAt(0)&&"]"==o.material.toString().charAt(o.material.length-1)||(this._core.isHtmlColor(o.material)?o.material=this._color.colorFromHtmlColor(o.material):(/^rgb/.test(o.material)&&(o.material=this._color.rgbaStringToRgbaObj(o.material)),1<o.material.r&&(o.material.r=o.material.r/255),1<o.material.g&&(o.material.g=o.material.g/255),1<o.material.b&&(o.material.b=o.material.b/255),1<o.material.a&&(o.material.a=o.material.a/255),o.material=this._color.createColor(o.material.r,o.material.g,o.material.b,o.material.a))),this._option=this._core.extend(a,o,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var u=[],c={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},h=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider.loadTile=function(i,t){if((this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&h.item.show)if(t.level,t.x,t.y,t.data={lines:[],geometryPrimitive:void 0},t.level>=o.level_min&&t.level<o.level_max&&h.item.show){var e=Ce.filter(u,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=e.length&&e[0].data&&0<e[0].data.length)return t.data.geometryPrimitive=new h._cesium.Primitive({geometryInstances:e[0].data,appearance:new h._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:h._cesium.ShadowMode.ENABLED}),t.state=h._cesium.QuadtreeTileLoadState.LOADING,void(t.state===h._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(),t.state=h._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));u.push({level:t.level,x:t.x,y:t.y,data:void 0}),l=t,e=h._urlTemplate.replace(window.encodeURIComponent("{x}"),l.x).replace(window.encodeURIComponent("{y}"),l.y).replace(window.encodeURIComponent("{z}"),l.level),h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function t(){/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)?(e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),c.extrudedHeight=parseFloat(a.properties[e])):c.extrudedHeight=parseFloat(h._option.extrudedHeight),c.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(t=h._option.material.replace(/\[/,"").replace(/\]/,""),c.material=a.properties[t],h._core.isHtmlColor(c.material)?c.material=h._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=h._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=h._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha))):(h._option.material&&(c.material=h._option.material),c.material&&(h._core.isHtmlColor(c.material)?c.material=h._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=h._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=h._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha))));var e=h._cesium.Cartesian3.fromDegreesArray(n);c.polygonHierarchy=new h._cesium.PolygonHierarchy(e);var t=new h._cesium.PolygonGeometry(c),e=h._cesium.PolygonGeometry.createGeometry(t),t=new h._cesium.GeometryInstance({id:a,geometry:e,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}}),e="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue;h.Legend.push(e),i.push(t)}h.Legend=[];for(var r=0;r<e.features.length;r++){var n=[],a=e.features[r];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)n=[],a.geometry.coordinates[s].pop(),o(a.geometry.coordinates[s]),t();else o(a.geometry.coordinates),t()}l.data.geometryPrimitive=new h._cesium.Primitive({geometryInstances:i,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),shadows:h._option.shadows})},error:function(){u=Ce.remove(u,function(e){return e.x==l.x&&e.y==l.y&&e.level==l.level})},complete:function(e,t){l.state=h._cesium.QuadtreeTileLoadState.LOADING,l.state===h._cesium.QuadtreeTileLoadState.LOADING&&(l.data.geometryPrimitive&&l.data.geometryPrimitive.update(i),l.state=h._cesium.QuadtreeTileLoadState.DONE,l.renderable=!0)}})}else t.state=h._cesium.QuadtreeTileLoadState.LOADING,t.state===h._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(i,[]),t.state=h._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0);var l},this._primitive=new h._cesium.QuadtreePrimitive({tileProvider:this._Provider});s=this._viewer.scene.primitives;o&&o.time&&(this._Provider._availability=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:o.time.start?h._cesium.JulianDate.fromDate(new Date(o.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:o.time.end?h._cesium.JulianDate.fromDate(new Date(o.time.end)):h._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),s.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o};this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item)},Ol.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization=function(e,t,a,i,o,r){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),this._option=this._core.extend(n,a,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var l=[],c={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},h=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=a.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&h.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>=a.level_min&&t.level<a.level_max&&h.item.show){var o=Ce.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)return t.data.geometryPrimitive=new h._cesium.Primitive({geometryInstances:o[0].data,appearance:new h._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:h._cesium.ShadowMode.ENABLED}),t.state=h._cesium.QuadtreeTileLoadState.LOADING,void(t.state===h._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=h._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0));if(0<h.PrimitiveData.length)for(var r=0;r<h.PrimitiveData.length;r++)if(h.PrimitiveData[r].key==i)return void h.Primitivekey.push(i);h.Primitivekey.includes(i)||(h.Primitivekey.push(i),l.push({level:t.level,x:t.x,y:t.y,data:void 0}),n=t,o=h._urlTemplate.replace(window.encodeURIComponent("{x}"),n.x).replace(window.encodeURIComponent("{y}"),n.y).replace(window.encodeURIComponent("{z}"),n.level),h._cache&&(o+="&"+h._core.getuid()),h.tilesLength++,h._core.xhr({url:o,type:"get",dataType:"json",success:function(e){var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function t(){/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)&&(e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),c.extrudedHeight=parseFloat(a.properties[e])),c.extrudedHeight=parseFloat(h._option.extrudedHeight),c.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(t=h._option.material.replace(/\[/,"").replace(/\]/,""),c.material=a.properties[t],h._core.isHtmlColor(c.material)?c.material=h._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=h._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=h._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha))):(h._option.material&&(c.material=h._option.material),c.material&&(h._core.isHtmlColor(c.material)?c.material=h._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=h._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=h._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha))));var e=h._cesium.Cartesian3.fromDegreesArray(n);c.polygonHierarchy=new h._cesium.PolygonHierarchy(e);var t=new h._cesium.PolygonGeometry(c),e=new h._cesium.GeometryInstance({id:a,geometry:t,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}}),t="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue;h.Legend.push(t),i.push(e)}h.Legend=[];for(var r=0;r<e.features.length;r++){var n=[],a=e.features[r];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)n=[],a.geometry.coordinates[s].pop(),o(a.geometry.coordinates[s]),t();else o(a.geometry.coordinates),t()}var l=new h._cesium.Primitive({geometryInstances:i,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),shadows:h._option.shadows});h.PrimitiveObj.data=l,h.PrimitiveObj.key=h.Primitivekey[h.returnCount];var u={key:h.Primitivekey[h.returnCount],data:l};h.PrimitiveData.push(u),h._viewer.scene.primitives.add(l),h.datas.push(l),h.returnCount++,h.returnCount>=h.tilesLength&&(h.returnCount=0,h.tilesLength=0,h.Primitivekey=[])},error:function(){l=Ce.remove(l,function(e){return e.x==n.x&&e.y==n.y&&e.level==n.level})},complete:function(e,t){n.state=h._cesium.QuadtreeTileLoadState.LOADING,n.state===h._cesium.QuadtreeTileLoadState.LOADING&&(n.data.geometryPrimitive&&(n.state=h._cesium.QuadtreeTileLoadState.DONE),n.renderable=!0)}}))}else t.state=h._cesium.QuadtreeTileLoadState.LOADING,t.state===h._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=h._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)}var n},this._primitive=new h._cesium.QuadtreePrimitive({tileProvider:this._Provider}),this._viewer.scene.primitives.add(this._primitive),o||this.setVisibility(!1),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:a};this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},Ol.prototype.createVolumeVectorGeoJsonFeatureLayersd=function(e,t,o,i,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(o)||this._core.isnull(o.material)||"["==o.material.toString().charAt(0)&&"]"==o.material.toString().charAt(o.material.length-1)||(this._core.isHtmlColor(o.material)?o.material=this._color.colorFromHtmlColor(o.material):(/^rgb/.test(o.material)&&(o.material=this._color.rgbaStringToRgbaObj(o.material)),1<o.material.r&&(o.material.r=o.material.r/255),1<o.material.g&&(o.material.g=o.material.g/255),1<o.material.b&&(o.material.b=o.material.b/255),1<o.material.a&&(o.material.a=o.material.a/255),o.material=this._color.createColor(o.material.r,o.material.g,o.material.b,o.material.a))),this._core.isnull(o)||this._core.isnull(o.outlineColor)||"["==o.outlineColor.toString().charAt(0)&&"]"==o.outlineColor.toString().charAt(o.outlineColor.length-1)||(this._core.isHtmlColor(o.outlineColor)?o.outlineColor=this._color.colorFromHtmlColor(o.outlineColor):(/^rgb/.test(o.outlineColor)&&(o.outlineColor=this._color.rgbaStringToRgbaObj(o.outlineColor)),1<o.outlineColor.r&&(o.outlineColor.r=o.outlineColor.r/255),1<o.outlineColor.g&&(o.outlineColor.g=o.outlineColor.g/255),1<o.outlineColor.b&&(o.outlineColor.b=o.outlineColor.b/255),1<o.outlineColor.a&&(o.outlineColor.a=o.outlineColor.a/255),o.outlineColor=this._color.createColor(o.outlineColor.r,o.outlineColor.g,o.outlineColor.b,o.outlineColor.a))),this._option=this._core.extend(a,o,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var u=[],c={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:Cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:Cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:Cesium.ArcType.GEODESIC,material:Cesium.Color.RED},h=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams);s=t.url.split("geoserver")[0]+"geoserver/polygon/ows?service=WFS&version=1.0.0&request=GetFeature&typeName="+s.urlParams.LAYER+"&outputFormat=application%2Fjson";h._core.xhr({url:s,type:"get",async:!1,dataType:"json",success:function(e){h.datas=e.features}}),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider.loadTile=function(i,t){if((this.tile=t).state===Cesium.QuadtreeTileLoadState.START&&h.item.show)if(t.level,t.x,t.y,t.data={lines:[],geometryPrimitive:void 0},t.level>=o.level_min&&t.level<o.level_max&&h.item.show){var e=Ce.filter(u,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=e.length&&e[0].data&&0<e[0].data.length)return t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:e[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,void(t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));u.push({level:t.level,x:t.x,y:t.y,data:void 0}),l=t,e=h._urlTemplate.replace(window.encodeURIComponent("{x}"),l.x).replace(window.encodeURIComponent("{y}"),l.y).replace(window.encodeURIComponent("{z}"),l.level),h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var i=[];h.Legend=[];for(var t=0;t<e.features.length;t++){var o=[],r=e.features[t].id,r=parseInt(r.split(".")[1])+1,n=h.datas[r];if(Array.isArray(n.geometry.coordinates)&&0<n.geometry.coordinates.length&&Array.isArray(n.geometry.coordinates[0][0][0]))for(var a=0;a<n.geometry.coordinates[0].length;a++)o=[],function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?(3==t[i].length&&(t[i].splice(2,1),t[i].push(this._option.height)),e(t[i])):o.push(t[i])}(n.geometry.coordinates[0][a]),function(){/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)?(e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),c.extrudedHeight=parseFloat(n.properties[e])):c.extrudedHeight=parseFloat(h._option.extrudedHeight),c.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(t=h._option.material.replace(/\[/,"").replace(/\]/,""),c.material=n.properties[t],h._core.isHtmlColor(c.material)?c.material=h._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=h._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=h._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha))):(h._option.material&&(c.material=h._option.material),c.material&&(h._core.isHtmlColor(c.material)?c.material=h._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=h._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=h._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha))));var e=Cesium.Cartesian3.fromDegreesArrayHeights(o);c.polygonHierarchy=new Cesium.PolygonHierarchy(e);var t={positions:e=Cesium.Cartesian3.fromDegreesArrayHeights(o),width:h._option.outlineWidth,color:Cesium.ColorGeometryInstanceAttribute.fromColor(h._option.outlineColor)},e=new Cesium.PolylineGeometry(t),t=new Cesium.GeometryInstance({geometry:e}),e="material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue;h.Legend.push(e),i.push(t)}()}var s=new Cesium.PrimitiveCollection;s.add(new Cesium.Primitive({geometryInstances:i,appearance:new Cesium.PolylineColorAppearance})),l.data.geometryPrimitive=s},error:function(){u=Ce.remove(u,function(e){return e.x==l.x&&e.y==l.y&&e.level==l.level})},complete:function(e,t){l.state=Cesium.QuadtreeTileLoadState.LOADING,l.state===Cesium.QuadtreeTileLoadState.LOADING&&(l.data.geometryPrimitive&&l.data.geometryPrimitive.update(i),l.state=Cesium.QuadtreeTileLoadState.DONE,l.renderable=!0)}})}else t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(i,[]),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0);var l},this._primitive=new h._cesium.QuadtreePrimitive({tileProvider:this._Provider}),this._viewer.scene.primitives.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},Ol.prototype.createVolumeVectorGeoJsonFeatureLayerDth=function(e,t,o,i,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._option=this._core.extend(a,o,!0),null==t&&console.log("url is required"),null==e&&console.log("layername is required");var u=[],c=(Cesium.VertexFormat.DEFAULT,Cesium.Ellipsoid.WGS84,Cesium.ArcType.GEODESIC,Cesium.Color.WHITE),h=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new He(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider.loadTile=function(e,t){if((this.tile=t).state===Cesium.QuadtreeTileLoadState.START&&h.item.show)if(t.level,t.x,t.y,t.data={lines:[],geometryPrimitive:void 0},t.level>=o.level_min&&t.level<o.level_max&&h.item.show){var i=Ce.filter(u,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=i.length&&i[0].data&&0<i[0].data.length)return t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:i[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,void(t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0));u.push({level:t.level,x:t.x,y:t.y,data:void 0}),l=t,i=h._urlTemplate.replace(window.encodeURIComponent("{x}"),l.x).replace(window.encodeURIComponent("{y}"),l.y).replace(window.encodeURIComponent("{z}"),l.level),h._cache&&(i+="&"+h._core.getuid()),h._core.xhr({url:i,type:"get",dataType:"json",success:function(e){var t=[];h.Legend=[];var i=new h._cesium.PrimitiveCollection;for(var o=0;o<e.features.length;o++){var r=[],n=e.features[o];!function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i]):r.push(t[i])}(e.features[o].geometry.coordinates[0]),/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)?(a=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),h._option.extrudedHeight=parseFloat(n.properties[a])):h._option.extrudedHeight=parseFloat(h._option.extrudedHeight),1==h._option.heightReference&&delete h._option.height,1==h._option.extrudedHeightReference&&delete h._option.extrudedHeight,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(s=h._option.material.replace(/\[/,"").replace(/\]/,""),h._option.material=n.properties[s],h._core.isHtmlColor(h._option.material)?h._option.material=h._color.colorFromHtmlColor(h._option.material):(/^rgb/.test(h._option.material)&&(h._option.material=h._color.rgbaStringToRgbaObj(h._option.material)),1<h._option.material.red&&(h._option.material.red=h._option.material.red/255),1<h._option.material.green&&(h._option.material.green=h._option.material.green/255),1<h._option.material.blue&&(h._option.material.blue=h._option.material.blue/255),1<h._option.material.alpha&&(h._option.material.a=h._option.material.alpha/255),h._option.material=h._color.createColor(h._option.material.red,h._option.material.green,h._option.material.blue,h._option.material.alpha))):(h._option.material&&(h._option.material=h._option.material),h._option.material&&(h._core.isHtmlColor(h._option.material)?h._option.material=h._color.colorFromHtmlColor(h._option.material):(/^rgb/.test(h._option.material)&&(h._option.material=h._color.rgbaStringToRgbaObj(h._option.material)),1<h._option.material.red&&(h._option.material.red=h._option.material.red/255),1<h._option.material.green&&(h._option.material.green=h._option.material.green/255),1<h._option.material.blue&&(h._option.material.blue=h._option.material.blue/255),1<h._option.material.alpha&&(h._option.material.a=h._option.material.alpha/255),h._option.material=h._color.createColor(h._option.material.red,h._option.material.green,h._option.material.blue,h._option.material.alpha))));var a=Cesium.Cartesian3.fromDegreesArray(r);n.positions=a,h._option.polygonHierarchy=new Cesium.PolygonHierarchy(a);var s=new Cesium.PolygonGeometry(h._option),a=Cesium.PolygonGeometry.createGeometry(s),s="material:"+255*c.red+","+255*c.green+","+255*c.blue;h.Legend.push(s),new Cesium.GeometryInstance({id:n,geometry:a,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(h._option.material)}});a=new Cesium.ClassificationPrimitive({geometryInstances:t,appearance:new Cesium.PerInstanceColorAppearance({closed:!0,flat:!1}),classificationType:h._option.classificationType,shadows:Cesium.ShadowMode.ENABLED});i.add(a)}l.data.geometryPrimitive=i},error:function(){u=Ce.remove(u,function(e){return e.x==l.x&&e.y==l.y&&e.level==l.level})},complete:function(){l.state=Cesium.QuadtreeTileLoadState.LOADING,l.state===Cesium.QuadtreeTileLoadState.LOADING&&(l.data.geometryPrimitive&&l.data.geometryPrimitive.update(e,[]),l.state=Cesium.QuadtreeTileLoadState.DONE,l.renderable=!0)}})}else t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0);var l},this._primitive=new h._cesium.QuadtreePrimitive({tileProvider:this._Provider}),this._viewer.scene.primitives.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(h._option.id)&&(h._option.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h._option.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:h._option.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o};this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item)},Ol.prototype.createVolumeGeoJsonFeatureLayer=function(e,t,n,i,a){var s={polylinePositions:void 0,shapePositions:void 0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:this._cesium.Math.RADIANS_PER_DEGREE,vertexFormat:this._cesium.VertexFormat.DEFAULT,cornerType:this._cesium.CornerType.ROUNDED};null==t&&console.log("geojson is required");var o=null,o=t.then?t:this._cesium.GeoJsonDataSource.load(t),l=this,u=[];s.shapePositions=this.computeCircle(n.radius),o.then(function(e){var t=l._cesium.Color.WHITE;l._core.isnull(n)||l._core.isnull(n.material)||(t="["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)?n.material.replace(/\[/,"").replace("/]/",""):Ce.clone(n.material),t=l._core.isHtmlColor(t)?l._color.colorFromHtmlColor(n.material):(1<(t=/^rgb/.test(t)?l._color.rgbaStringToRgbaObj(t):t).r&&(t.r=t.r/255),1<t.g&&(t.g=t.g/255),1<t.b&&(t.b=t.b/255),1<t.a&&(t.a=t.a/255),l._color.createColor(t.r,t.g,t.b,t.a)));for(var i=e.entities.values,o=0;o<i.length;o++){var r=i[o];s.polylinePositions=r.polyline.positions._value;r=new l._cesium.PolylineVolumeGeometry(s),r=l._cesium.PolylineVolumeGeometry.createGeometry(r),r=new l._cesium.GeometryInstance({geometry:r});u.push(r)}t=l._viewer.scene.primitives.add(new l._cesium.Primitive({geometryInstances:u,appearance:new l._cesium.MaterialAppearance({material:new l._cesium.Material({fabric:{type:"Color",uniforms:{color:t}}}),faceForward:!0,flat:!1})}));l.item=t,0==n.show&&(t.show=!1),"function"==typeof a&&a(t)}),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+n.id);e={id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:geoOptions.url,style:n};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(i)?0:i),this},Ol.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var o=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(o),e*Math.sin(o)))}return t},Ol.prototype.createVolumeGeoJsonFeatureLayerProvider=function(e,t,c,i,o,r){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,Cesium:this._cesium};this._core.isnull(c)||this._core.isnull(c.material)||"["==c.material.toString().charAt(0)&&"]"==c.material.toString().charAt(c.material.length-1)||(this._core.isHtmlColor(c.material)?c.material=this._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=this._color.rgbaStringToRgbaObj(c.material)),1<c.material.r&&(c.material.r=c.material.r/255),1<c.material.g&&(c.material.g=c.material.g/255),1<c.material.b&&(c.material.b=c.material.b/255),1<c.material.a&&(c.material.a=c.material.a/255),c.material=this._color.createColor(c.material.r,c.material.g,c.material.b,c.material.a)));var h=this._core.extend(n,c,!0),a=new Ae(this._viewer,this._cesium,a);this._Provider=a;var m=this;a._loadTile=function(e){var u=new m._cesium.PrimitiveCollection;return e.features.forEach(function(e){var t=[];/^\[/.test(c.material)&&/\]$/.test(c.material)&&(i=c.material.replace(/\[/,"").replace(/\]/,""),h.material=e.properties[i],that._core.isHtmlColor(h.material)?h.material=that._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=that._color.rgbaStringToRgbaObj(h.material)),1<h.material.r&&(h.material.r=h.material.r/255),1<h.material.g&&(h.material.g=h.material.g/255),1<h.material.b&&(h.material.b=h.material.b/255),1<h.material.a&&(h.material.a=h.material.a/255),h.material=that._color.createColor(h.material.r,h.material.g,h.material.b,h.material.a)));for(var i,o=0;o<e.geometry.coordinates.length;o++){var r=e.geometry.coordinates[o];if(0<r.length)if(Array.isArray(r[0]))for(var n=0;n<r.length;n++){var a=r[n],a=m._cesium.Cartesian3.fromDegrees(a[0],a[1],h.height);t.push(a)}else{var s=m._cesium.Cartesian3.fromDegrees(r[0],r[1],h.height);t.push(s)}}h.position=t,e.positions=t,"0"==h.slttype||0==h.slttype?h.shape=m._core.computeCircle(h.radius):"1"==h.slttype||1==h.slttype?h.shape=m._core.starPositions(h.number,h.exradius,h.inradius):"2"!=h.slttype&&2!=h.slttype||(i=h.orth_width/2,l=h.orth_height/2,h.shape=[new m._cesium.Cartesian2(-i,-l),new m._cesium.Cartesian2(i,-l),new m._cesium.Cartesian2(i,l),new m._cesium.Cartesian2(-i,l)]);var l={polylinePositions:h.position,shapePositions:h.shape,cornerType:h.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},l=new m._cesium.PolylineVolumeGeometry(l),l=m._cesium.PolylineVolumeGeometry.createGeometry(l),l=new m._cesium.GeometryInstance({id:e,geometry:l,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}}),l=new m._cesium.Primitive({allowPicking:!0,appearance:new m._cesium.MaterialAppearance({material:new m._cesium.Material({fabric:{type:"Color",uniforms:{color:h.material}}}),faceForward:!0,flat:!1}),shadows:h.shadows,geometryInstances:l});u.add(l)}),u},this.item=a._primitiveCollection,a.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;t={id:h.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t.url,style:c};this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},Ol.prototype.setTreeobj=function(e){this.treeobj=e},Ol.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},Ol.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},Ol.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(e)}catch(e){}},Ol.prototype.setVisibility=function(e){try{null!=this.item&&null!=this.item.show&&(this.item.show=e),this._Provider&&this._Provider.setStatus(e)}catch(e){}},Ol.prototype.isCache=function(e){this._cache=e},Ol.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},Ol.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},Vl.prototype.setSpaceBackground=function(e){return this.clear&&this.clear(),this._viewer.container.style.backgroundImage="url("+e+")",this._viewer.scene.backgroundColor=new this._cesium.Color(0,0,0,0),this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.skyBox&&(this._viewer.scene.skyBox.show=!1),this.clear=()=>{this._viewer.container.style.backgroundImage="unset",this._viewer.scene.skyBox&&(this._viewer.scene.skyBox.show=!0),this._viewer.scene.backgroundColor=new this._cesium.Color(0,0,0,1),this._viewer.scene.skyAtmosphere.show=!0},this},Vl.prototype.SkyBox=function(e,t){this.defaultSky||(this.defaultSky=this._viewer.scene.skyBox,this.defaultSky&&!this.defaultSky.show&&(this.defaultSky.show=!0)),this.NearGround=e;var i=this,o=this._viewer,r=this.getSkyBox(t);function n(){var e=o.camera.position;i._cesium.Cartographic.fromCartesian(e).height<23e4?(r&&(o.scene.skyBox=r),o.scene.skyAtmosphere.show=!1):(i.defaultSky&&(o.scene.skyBox=i.defaultSky),o.scene.skyAtmosphere.show=!0)}return this._SkyBox=r,o.scene.skyBox=r,e&&this._viewer.scene.postRender.addEventListener(n),this.clear=function(){i.defaultSky&&(i._viewer.scene.skyBox=i.defaultSky),i.defaultSky=void 0,i._viewer.scene.skyAtmosphere.show=!0,i.NearGround&&i._viewer.scene.postRender.removeEventListener(n),i.clear=void 0},this},Vl.prototype.getSkyBox=function(e){var s=this,e=new this._cesium.SkyBox({sources:e});return this.NearGround&&(e.update=function(e,t){var i=this;if(this.show&&(e.mode===s._cesium.SceneMode.SCENE3D||e.mode===s._cesium.SceneMode.MORPHING)&&e.passes.render){var o=e.context;this._sources!==this.sources&&(this._sources=this.sources,"string"==typeof(r=this.sources).positiveX?s._cesium.loadCubeMap(o,this._sources).then(function(e){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new s._cesium.CubeMap({context:o,source:r})));var r,n,a=this._command;if(s._cesium.defined(a.vertexArray)||(a.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return s.NearGround?(a.modelMatrix=s._cesium.Transforms.eastNorthUpToFixedFrame(e.camera._positionWC),s._cesium.Matrix4.getMatrix3(a.modelMatrix,new s._cesium.Matrix3)):s._cesium.Matrix3.IDENTITY}},r=s._cesium.BoxGeometry.createGeometry(s._cesium.BoxGeometry.fromDimensions({dimensions:new s._cesium.Cartesian3(2,2,2),vertexFormat:s._cesium.VertexFormat.POSITION_ONLY})),n=this._attributeLocations=s._cesium.GeometryPipeline.createAttributeLocations(r),a.vertexArray=s._cesium.VertexArray.fromGeometry({context:o,geometry:r,attributeLocations:n,bufferUsage:s._cesium.BufferUsage.STATIC_DRAW}),a.renderState=s._cesium.RenderState.fromCache({blending:s._cesium.BlendingState.ALPHA_BLEND})),s._cesium.defined(a.shaderProgram)&&this._useHdr===t||(n=new s._cesium.ShaderSource({defines:[t?"HDR":""],sources:[s.SkyBoxFS]}),a.shaderProgram=s._cesium.ShaderProgram.fromCache({context:o,vertexShaderSource:s.SkyBoxVS,fragmentShaderSource:n,attributeLocations:this._attributeLocations}),this._useHdr=t),s._cesium.defined(this._cubeMap))return a}}),e},kl.prototype.createWindField=function(e,t){var i=this;return this.WindFieldOption={color:this._cesium.Color.WHITE,speed:.15,num:2e3,maxAge:10,brighten:1.5},(t=t||{}).color&&(t.color=this._cesium.Color.fromCssColorString(t.color)),this.WindFieldOption=this._core.extend(this.WindFieldOption,t,!1),this.destroy(),this.windData=void 0,this.windField=void 0,this.particles=[],this.lines=void 0,this.timer=void 0,this.primitives=this._viewer.scene.primitives,$.ajax({type:"get",async:!1,url:e,dataType:"json",success:function(e){i.windData=e,i._init(),i.timer=setInterval(function(){i.animate()},200)},error:function(e){console.log("请求风场数据失败!")}}),this},kl.prototype._init=function(){this.windField=this.createField();for(var e=0;e<this.WindFieldOption.num;e++)this.particles.push(this.randomParticle(new Fl))},kl.prototype.createField=function(){var e=this._parseWindJson();return new Gl(e)},kl.prototype.animate=function(){var o,r,n,a=this,s=a.windField,e=a.particles,l=[];e.forEach(function(e){var t,i;e.age<=0&&a.randomParticle(e),0<e.age&&(t=e.x,i=e.y,s.isInBound(t,i)?(n=s.getIn(t,i),o=t+a.WindFieldOption.speed*n[0],r=i+a.WindFieldOption.speed*n[1],e.path.push(o,r),e.x=o,e.y=r,l.push(a._createLineInstance(a._map(e.path),e.age/e.birthAge)),e.age--):e.age=0)}),l.length<=0&&this.removeLines(),a._drawLines(l)},kl.prototype._parseWindJson=function(){var t=null,i=null,o=null;return this.windData.forEach(function(e){switch(e.header.parameterCategory+","+e.header.parameterNumber){case"2,2":t=e.data,o=e.header;break;case"2,3":i=e.data}}),{header:o,uComponent:t,vComponent:i}},kl.prototype.removeLines=function(){this.lines&&(this.primitives.remove(this.lines),this.lines.destroy())},kl.prototype._map=function(e){for(var t=e.length,i=this.windField,o=i.dx,r=i.dy,n=i.west,a=i.north,s=[],l=0;l<=t-2;l+=2)s.push(n+e[l]*o,a-e[l+1]*r);return s},kl.prototype._createLineInstance=function(e,t){for(var i=[],o=e.length,r=o/2,n=0;n<o;n++)i.push("random"===this.WindFieldOption.color?this._cesium.Color.fromRandom({alpha:n/r*t*this.WindFieldOption.brighten}):this.WindFieldOption.color.withAlpha(n/r*t*this.WindFieldOption.brighten));return new this._cesium.GeometryInstance({geometry:new this._cesium.PolylineGeometry({positions:this._cesium.Cartesian3.fromDegreesArray(e),colors:i,width:1.5,colorsPerVertex:!0})})},kl.prototype._drawLines=function(e){this.removeLines();e=new this._cesium.Primitive({appearance:new this._cesium.PolylineColorAppearance({translucent:!0}),geometryInstances:e,asynchronous:!1});this.lines=this.primitives.add(e)},kl.prototype.randomParticle=function(e){for(var t,i,o=30;t=Math.floor(Math.random()*(this.windField.cols-2)),i=Math.floor(Math.random()*(this.windField.rows-2)),this.windField.getIn(t,i)[2]<=0&&o++<30;);return e.x=t,e.y=i,e.age=Math.round(Math.random()*this.WindFieldOption.maxAge),e.birthAge=e.age,e.path=[t,i],e},kl.prototype.changeColor=function(e){this.WindFieldOption.color="random"===e?e:this._cesium.Color.fromCssColorString(e)},kl.prototype.setSpeed=function(e){this.WindFieldOption.speed=e},kl.prototype.setMaxAge=function(e){this.WindFieldOption.maxAge=e},kl.prototype.setBrighten=function(e){this.WindFieldOption.brighten=e},kl.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.timer=void 0,this.removeLines()};var Fl=function(){this.x=null,this.dx=null,this.dx=null,this.y=null,this.age=null,this.birthAge=null,this.path=null},Gl=function(e){this.west=null,this.east=null,this.south=null,this.north=null,this.rows=null,this.cols=null,this.dx=null,this.dy=null,this.unit=null,this.date=null,this.grid=null,this._init(e)};function Nl(e){this._viewer=e,this.PrimitiveCollection=[],this.lineColor=Cesium.Color.fromCssColorString("#330066").withAlpha(.8),this.pointColor=Cesium.Color.fromCssColorString("#CCFFFF").withAlpha(1)}function Bl(e){this._viewer=e,this.PrimitiveCollection=[],this.color=Cesium.Color.BLUE}function jl(e,t){this._viewer=e,this._cesium=t,this._Color=new G(this._viewer,this._cesium),this._core=new V,this._getPosition=new Ee(this._viewer,this._cesium),this._tree=we,this._points=[],this._polylines=[],this.Streamerpath=new Nl(this._viewer),this.Streamerwall=new Bl(this._viewer)}function zl(e){this._viewer=e,this._cesium=Cesium,this._core=new V,this._Buffer=new Si(e,Cesium),this._tree=we}function Ul(e){this._viewer=e,this._scene=e.scene,this._core=new V,this._tooltip=this._core.CreateTooltip(),this._drawColor={point:Cesium.Color.BLUE,polyline:Cesium.Color.YELLOW,polygon:Cesium.Color.YELLOW.withAlpha(.5)},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=window.SmartEarthRootUrl+D.loading}function Wl(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we}function Yl(e){this._viewer=e,this._core=new V,this._tree=we,this._getPosition=new Ee(this._viewer,Cesium),this._popupmessage=new xe(this._viewer,Cesium),this.tooltip=this._core.CreateTooltip({id:"_jb"}),this.objectsToExclude=[],this.MilitaryStandardObj=[],this.drawHandler=void 0,this.editHandler=null,this.heightpointsId=[],this.state=0,this.isEditting=!1,this.editProp=!0}function ql(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we,this._Provider=void 0}function Ql(e){this._viewer=e,this._cesium=Cesium,this._core=new V,this._tree=we,this.texturePixel=1024}function Jl(e){this._viewer=e,this._core=new V}function Xl(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we}function Kl(e){if(this._viewer=e,this._cesium=Cesium,this._core=new V,this._tree=we,!window.h337){let e=new E(!1);e.addJs(document.body,window.SmartEarthRootUrl+"Workers/heatmap/heatmap.min.js"),e.addJs(document.body,window.SmartEarthRootUrl+"Workers/heatmap/webgl-heatmap.js")}}function $l(e,t){this._viewer=e,this._cesium=t,this._core=new V,this.TrailEntitys=[]}function Zl(e){this.lon=0,this.lat=0,this.hei=e,this.phei=e/2,this.time=0}function eu(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._tree=we,this._getPosition=new Ee(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip()}Gl.prototype={constructor:Gl,_init:function(e){var t=e.header,i=e.uComponent,o=e.vComponent;this.west=+t.lo1,this.east=+t.lo2,this.south=+t.la2,this.north=+t.la1,this.rows=+t.ny,this.cols=+t.nx,this.dx=+t.dx,this.dy=+t.dy,this.unit=t.parameterUnit,this.date=t.refTime,this.grid=[];for(var r,n=0,a=null,s=0;s<this.rows;s++){for(var a=[],l=0;l<this.cols;l++,n++)r=this._calcUV(i[n],o[n]),a.push(r);this.grid.push(a)}},_calcUV:function(e,t){return[+e,+t,Math.sqrt(e*e+t*t)]},_bilinearInterpolation:function(e,t,i,o,r,n){var a=1-e,s=1-t,l=a*s,s=e*s,a=a*t,e=e*t,t=i[0]*l+o[0]*s+r[0]*a+n[0]*e,e=i[1]*l+o[1]*s+r[1]*a+n[1]*e;return this._calcUV(t,e)},getIn:function(e,t){var i=Math.floor(e),o=Math.floor(t);if(i===e&&o===t)return this.grid[t][e];var r=i+1,n=o+1,a=this.getIn(i,o),s=this.getIn(r,o),l=this.getIn(i,n),n=this.getIn(r,n);return this._bilinearInterpolation(e-i,t-o,a,s,l,n)},isInBound:function(e,t){return 0<=e&&e<this.cols-2&&0<=t&&t<this.rows-2}},Nl.prototype.create=function(e={}){this.position=e.position||void 0,this.positions=e.positions||void 0,this.linewidth=e.linewidth||void 0,this.near=e.near,this.far=e.far,this._speed=e.speed,Cesium.defined(this._speed)||(this._speed=1),this._id=e.id,e.lineColor&&(this.lineColor=Cesium.Color.fromCssColorString(e.lineColor).withAlpha(e.lineAlpha||1)),e.pointColor&&(this.pointColor=Cesium.Color.fromCssColorString(e.pointColor).withAlpha(e.pointAlpha||1)),this.getShader(),this.collection=new Cesium.PrimitiveCollection,this.collection._guid=this._id,this._viewer.scene.primitives.add(this.collection),this.position?this.getInstance():this.positions&&this.getInstances(),this.addGroundLine(),this.PrimitiveCollection.push(this.collection)},Nl.prototype.getById=function(e){for(var t=null,i=this._viewer.scene.primitives,o=i.length,r=0;r<o;r++){var n=i.get(r);n._guid===e&&(t=n)}return t},Nl.prototype.remove=function(e){e=this.getById(e);e&&this._viewer.scene.primitives.remove(e)},Nl.prototype.removeAll=function(){for(var e=0;e<this.PrimitiveCollection.length;e++){var t=this.PrimitiveCollection[e];this._viewer.scene.primitives.remove(t)}this.PrimitiveCollection=[]},Nl.prototype.show=function(e){for(var t=0;t<this.PrimitiveCollection.length;t++)this.PrimitiveCollection[t].show=e},Nl.prototype.getInstance=function(){let e;e=this.position[0]instanceof Cesium.Cartesian3?this.position:Cesium.Cartesian3.fromDegreesArray(this.position);var t=new Cesium.GroundPolylineGeometry({positions:e,width:this.linewidth,vertexFormat:Cesium.PolylineColorAppearance.VERTEX_FORMAT});this.instances=new Cesium.GeometryInstance({geometry:t,attributes:{distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(this.near,this.far)}})},Nl.prototype.getInstances=function(){this.instances=[];for(let t=0;t<this.positions.length;t++){let e;e=this.positions[t][0]instanceof Cesium.Cartesian3?this.positions[t]:Cesium.Cartesian3.fromDegreesArray(this.positions[t]);var i=new Cesium.GeometryInstance({geometry:new Cesium.GroundPolylineGeometry({positions:e,width:this.linewidth,vertexFormat:Cesium.PolylineColorAppearance.VERTEX_FORMAT}),attributes:{distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(this.near,this.far)}});this.instances.push(i)}},Nl.prototype.addGroundLine=async function(){this.instances.forEach(e=>{e=new Cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new Cesium.MaterialAppearance({material:new Cesium.Material({fabric:{source:this.fs,uniforms:{u_moveColor:this.pointColor,u_lineColor:this.lineColor}}})})});this.collection.add(e)})},Nl.prototype.addLine=function(){var e=new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{source:this.fs,uniforms:{u_moveColor:this.pointColor,u_lineColor:this.lineColor}}})}),e=new Cesium.Primitive({geometryInstances:this.instances,appearance:e});this.collection.add(e)},Nl.prototype.getShader=function(){this.fs=`
        \tuniform vec4 u_moveColor;
        \tuniform vec4 u_lineColor;
        #define PI_OVER_TWO 1.5707963
        \tczm_material czm_getMaterial(czm_materialInput materialInput){
            czm_material material = czm_getDefaultMaterial(materialInput);
            float iTime = czm_frameNumber / 60.0 * ${this._speed.toFixed(1)};
            vec2 uv = materialInput.st;
            vec4 finalColor = u_lineColor;
            float dt = clamp(tan(uv.x * 5.0  - iTime * 1.0) * 0.3 - 0.1, 0.5, PI_OVER_TWO);
            finalColor = mix(finalColor, u_moveColor, dt);
            float alpha = pow(finalColor.w * (1.0 - abs(uv.y - 0.5)), 2.0);
            material.diffuse = finalColor.xyz;
            material.alpha = alpha;
            return material;
        }
    `},Bl.prototype.create=function(e={}){this.position=e.position||void 0,this.positions=e.positions||void 0,this.height=e.height||50,this.minHeight=e.minHeight,this.near=e.near,this.far=e.far,this._speed=e.speed||1,this._id=e.id,e.color&&(this.color=Cesium.Color.fromCssColorString(e.color)),this.getShader(),this.collection=new Cesium.PrimitiveCollection,this.collection._guid=this._id,this._viewer.scene.primitives.add(this.collection),this.position?this.getInstance():this.positions&&this.getInstances(),this.addWall(),this.PrimitiveCollection.push(this.collection)},Bl.prototype.getById=function(e){for(var t=null,i=this._viewer.scene.primitives,o=i.length,r=0;r<o;r++){var n=i.get(r);n._guid===e&&(t=n)}return t},Bl.prototype.remove=function(e){e=this.getById(e);null!=e&&this._viewer.scene.primitives.remove(e)},Bl.prototype.removeAll=function(){for(var e=0;e<this.PrimitiveCollection.length;e++){var t=this.PrimitiveCollection[e];this._viewer.scene.primitives.remove(t)}this.PrimitiveCollection=[]},Bl.prototype.show=function(e){for(var t=0;t<this.PrimitiveCollection.length;t++)this.PrimitiveCollection[t].show=e},Bl.prototype.getInstance=function(){let e;e=this.position[0]instanceof Cesium.Cartesian3?this.position:Cesium.Cartesian3.fromDegreesArray(this.position);var t=Array(e.length).fill(this.height),i=Array(e.length).fill(this.minHeight||0),i=new Cesium.WallGeometry({positions:e,maximumHeights:t,minimumHeights:i});this.instances=[new Cesium.GeometryInstance({geometry:i,attributes:{distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(this.near,this.far)}})]},Bl.prototype.getInstances=function(){this.instances=[];for(let t=0;t<this.positions.length;t++){let e;e=this.positions[t][0]instanceof Cesium.Cartesian3?this.positions[t]:Cesium.Cartesian3.fromDegreesArray(this.positions[t]);var i=Array(e.length).fill(this.height),o=Array(e.length).fill(this.minHeight||0),o=new Cesium.GeometryInstance({geometry:new Cesium.WallGeometry({positions:e,maximumHeights:i,minimumHeights:o}),attributes:{distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(this.near,this.far)}});this.instances.push(o)}},Bl.prototype.addWall=async function(){this.instances.forEach(e=>{e=new Cesium.Primitive({geometryInstances:e,appearance:new Cesium.MaterialAppearance({material:new Cesium.Material({fabric:{source:this.fs,uniforms:{u_wallColor:this.color.withAlpha(.5),u_moveColor:this.color}}})})});this.collection.add(e)})},Bl.prototype.getShader=function(){this.fs=`
    \tuniform vec4 u_moveColor;
    \tuniform vec4 u_wallColor;
    \#define PI_OVER_TWO 1.5707963
    \tczm_material czm_getMaterial(czm_materialInput materialInput){
        czm_material material = czm_getDefaultMaterial(materialInput);
        float iTime = czm_frameNumber / 60.0 * ${this._speed.toFixed(1)};
        vec2 uv = materialInput.st;
        vec4 finalColor = u_wallColor;
        float dt = clamp(tan(uv.y * 5.0  - iTime) * 0.3 - 0.1, 0.5, PI_OVER_TWO);
        finalColor = mix(finalColor, u_moveColor, dt);
        float alpha = pow(finalColor.w * (1.0 - abs(uv.y - 0.5)), 2.0);
        if(uv.y < 0.5){
          alpha = 1.0; 
          finalColor = u_wallColor;
          if(uv.y > 0.4){
            alpha = (0.5 - uv.y) * 5.0 + 0.5;
          }
        }
        material.diffuse = finalColor.xyz;
        material.alpha = alpha;
        return material;
    }
`},jl.prototype.createPathLayer=function(e={}){var t={lineColor:e.color||"#0033FF",lineAlpha:e.alpha||1,linewidth:e.width||5,pointColor:e.pointColor||"#FFFFFF",pointAlpha:e.pointAlpha||1,id:e.id||this._core.getuid(),near:e.near,far:e.far,speed:e.speed||1};let i=Cesium.GeoJsonDataSource.load(e.url);i.then(e=>{var i=e.entities.values;let o=[];for(let t=0;t<i.length;t++){let e=i[t];e.polyline?o.push(e.polyline.positions.getValue()):e.polygon&&o.push(e.polygon.hierarchy.getValue().positions)}this.Streamerpath.create({positions:o,...t})});e={id:t.id,name:"新建流光线图层",pId:0,type:"TrailLineLayer",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},jl.prototype.createWallLayer=function(e={}){var t={color:e.color||"#0000ff",id:e.id||this._core.getuid(),speed:e.speed,height:e.height,minHeight:e.minHeight,near:e.near,far:e.far};let i=Cesium.GeoJsonDataSource.load(e.url);i.then(e=>{var i=e.entities.values;let o=[];for(let t=0;t<i.length;t++){let e=i[t];e.polyline?o.push(e.polyline.positions.getValue()):e.polygon&&o.push(e.polygon.hierarchy.getValue().positions)}this.Streamerwall.create({positions:o,...t})});e={id:t.id,name:"新建流动墙图层",pId:0,type:"TrailLineLayer",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},jl.prototype.getLinePosition=function(e){let i=[];return e.geometries&&e.geometries.forEach(e=>{let t=[];e.coordinates.forEach(e=>{t.push(e[0],e[1])}),i.push(t)}),e.features&&e.features.forEach(e=>{let t=[];e.geometry.coordinates.forEach(e=>{t.push(e[0],e[1])}),i.push(t)}),i},jl.prototype.createPath=function(e,t,i){var o,r={time:3e3,LineColor:this._core.defaultValue((i="number"==typeof(i=i||{})?{time:i}:i).color,"#ff0000"),LinkImage:this._core.defaultValue(i.url,window.SmartEarthRootUrl+D.TrailLine),height:5e4,num:100,width:2,LightSpot:!1,alpha:.3};(r=this._core.extend(r,i,!0)).twoColor&&(o={color1:r.twoColor.color1||"#00ff00",color2:r.twoColor.color2||"#ff0000"}),r.LightSpot&&(o={LightSpot:!0,color:r.LightSpotColor||r.LineColor});var n=new S(r.LineColor,this._core.defaultValue(o,r.LinkImage),r.time);n.alpha=r.alpha;var a=i.inflow;let s,l;for(var u=0;u<t.length;u++){a?(s=t[u],l=e):(l=t[u],s=e);for(var c=this.parabolaEquation({pt1:s,pt2:l,height:r.height,num:r.num}),h=[],m=0;m<c.length;m++)h.push(c[m][0],c[m][1],c[m][2]);this._polylines.push(this._viewer.entities.add({name:"PolylineTrailLink"+u,polyline:{positions:this._cesium.Cartesian3.fromDegreesArrayHeights(h),width:r.width,material:n,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,r.far||1/0)}}))}this.pathMaterial=n,r.static&&this.pathMaterial.setScale(0);i={id:this._core.getuid(),name:"新建流动路径",pId:0,type:"TrailLine",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},jl.prototype.createFlyingLine=function(e,t={}){var i={time:3e3,LineColor:this._core.defaultValue(t.color,"#ffffff"),LinkImage:this._core.defaultValue(t.url,window.SmartEarthRootUrl+D.TrailLine),minHeight:0,width:1,alpha:0},t={LightSpot:!0,color:(i=this._core.extend(i,t,!0)).LightSpotColor||i.LineColor},o=new S(i.LineColor,this._core.defaultValue(t,i.LinkImage),i.time);o.alpha=i.alpha;let r;e.forEach(e=>{r=[e.lon,e.lat,i.minHeight,e.lon,e.lat,e.height],this._polylines.push(this._viewer.entities.add({name:"FlyingLine",polyline:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(r),width:i.width,material:o}}))});e={id:this._core.getuid(),name:"新建垂直飞线",pId:0,type:"TrailLine",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},jl.prototype.createLine=function(e,t){var i={time:3e3,LineColor:this._core.defaultValue((t="number"==typeof(t=t||{})?{time:t}:t).color,"#ff0000"),LinkImage:this._core.defaultValue(t.url,window.SmartEarthRootUrl+D.TrailLine),width:10},t=new S((i=this._core.extend(i,t,!0)).LineColor,i.LinkImage,i.time),o=[];if(e[0].x||e[0].y)if(void 0!==e[0].z)if(-180<=e[0].x&&e[0].x<=180)for(r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y,e[r].z));else o=e;else for(r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y));else if(2===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1]));else if(3===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1],e[r][2]));this._polylines.push(this._viewer.entities.add({name:"PolylineTrail",polyline:{positions:o,width:i.width,material:t,clampToGround:i.clampToGround}}));i={id:this._core.getuid(),name:"新建流动线",pId:0,type:"TrailLine",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},jl.prototype.createWall=function(e,t){var i={time:9e3,LineColor:this._core.defaultValue((t="number"==typeof(t=t||{})?{time:t}:t).color,this._cesium.Color.ORANGE),LinkImage:this._core.defaultValue(t.url,window.SmartEarthRootUrl+D.colors3)},t=new S((i=this._core.extend(i,t,!0)).LineColor,i.LinkImage,i.time||9e3),o=[];if(e[0].x||e[0].y)if(void 0!==e[0].z)if(-180<=e[0].x&&e[0].x<=180)for(r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y,e[r].z));else o=e;else for(r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y));else if(2===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1]));else if(3===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1],e[r][2]));this._polylines.push(this._viewer.entities.add({name:"WallTrail",wall:{positions:o,material:t,maximumHeights:i.maximumHeights,minimumHeights:i.minimumHeights}}));i={id:this._core.getuid(),name:"新建流动墙",pId:0,type:"TrailLine",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},jl.prototype.parabolaEquation=function(e,t){var i=this._core.defaultValue(e.height,5e3),o=Math.abs(e.pt1.lon-e.pt2.lon)>Math.abs(e.pt1.lat-e.pt2.lat)?Math.abs(e.pt1.lon-e.pt2.lon):Math.abs(e.pt1.lat-e.pt2.lat),r=e.num&&50<e.num?e.num:50,n=[],a=o/r,s=e.pt1.height||0,l=e.pt2.height||0;if(Math.abs(e.pt1.lon-e.pt2.lon)>Math.abs(e.pt1.lat-e.pt2.lat)){var u=(e.pt2.lat-e.pt1.lat)/r;0<e.pt1.lon-e.pt2.lon&&(a=-a);for(var c=0;c<=r;c++){var h=i-4*Math.pow(-.5*o+Math.abs(a)*c,2)*i/Math.pow(o,2)+s+(l-s)*c/r,m=e.pt1.lon+a*c,d=e.pt1.lat+u*c;n.push([m,d,h])}}else{var p=(e.pt2.lon-e.pt1.lon)/r;0<e.pt1.lat-e.pt2.lat&&(a=-a);for(c=0;c<=r;c++){h=i-4*Math.pow(-.5*o+Math.abs(a)*c,2)*i/Math.pow(o,2)+s+(l-s)*c/r,m=e.pt1.lon+p*c,d=e.pt1.lat+a*c;n.push([m,d,h])}}return n},jl.prototype.setThisPosition=function(e,t){var i;this.pathMaterial&&(i=this._cesium.Cartesian3.fromDegrees(e[0].lon,e[0].lat),e=this._cesium.Cartesian3.fromDegrees(e[1].lon,e[1].lat),t=this._cesium.Cartesian3.fromDegrees(t.lon,t.lat),e=this._core.getSpaceDistancem([i,e],this._cesium),t=this._core.getSpaceDistancem([i,t],this._cesium),this.pathMaterial.setScale(t/e))},jl.prototype.clear=function(){if(0<this._points.length)for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e]);if(0<this._polylines.length)for(e=0;e<this._polylines.length;e++)this._viewer.entities.remove(this._polylines[e]);this._points=[],this._polylines=[],this.Streamerpath.removeAll(),this.Streamerwall.removeAll()},jl.prototype.setTreeobj=function(e){this.treeobj=e},jl.prototype.deleteObject=function(){this.clear()},jl.prototype.setVisibility=function(e){if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._points[t].show=e;if(0<this._polylines.length)for(t=0;t<this._polylines.length;t++)this._polylines[t].show=e;this.Streamerpath.show(e),this.Streamerwall.show(e)},zl.prototype.createRoad=function(e={}){var t={id:e.id||this._core.getuid(),image:window.SmartEarthRootUrl+D.road,height:1,width:20,alpha:1},t=this._core.extend(t,e,!0);let i=[];e.positions.forEach(e=>{e=this._core.toDegrees(e);i.push([e.lon,e.lat])});var o=Cesium_turf.lineString(i),o=this._Buffer.getBuff(o,t.width,{steps:0});this.item=this._Buffer.addBufferPolyogn(o,{material:new Cesium.ImageMaterialProperty({image:t.image,color:Cesium.Color.WHITE.withAlpha(t.alpha)}),height:e.height,perPositionHeight:!1,stRotation:90,heightReference:0,outline:!1});t={id:t.id,name:"新建道路图层",pId:0,type:"RoadLayer",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,0),this},zl.prototype.setTreeobj=function(e){this.treeobj=e},zl.prototype.deleteObject=function(){this.item&&this._viewer.entities.remove(this.item)},zl.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},Ul.prototype.deleteObject=Ul.prototype.cleanUp=function(){void 0!==this._prevEntity&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),void 0!==this._prevEntity1&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),void 0!==this._volumeLabel&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),void 0!==this._volumeLabel1&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(e=>{this._viewer.entities.remove(e)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)},Ul.prototype.startDrawing=function(e={},t="auto",a){var s,l=this._scene,r=this._tooltip,u=[],c=[],h=[];this._positions=c,this._degreesArr=h,this._drawColor.point=e.point||this._drawColor.point,this._drawColor.polyline=e.polyline||this._drawColor.polyline,this._drawColor.polygon=e.polygon||this._drawColor.polygon,this.loadingImg=e.loading||this.loadingImg,this.tin=this._core.defaultValue(e.tin,!0),this.onlyTerrain=this._core.defaultValue(e.onlyTerrain,!0),this.selectDatum=this._core.defaultValue(e.selectDatum,!0);var m=this;this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading();e=new Cesium.ScreenSpaceEventHandler(l.canvas);this._mouseHandler=e,this.cleanUp(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw);let d;function p(){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(u))}return e.setInputAction(function(e){if(null!=e.position){var t=l.camera.getPickRay(e.position),i=l.globe.pick(t,l);if(!this._viewer.scene.pick(e.position)||(n=this._viewer.scene.pickPosition(e.position))&&(i=n),i){var o=Cesium.Cartographic.fromCartesian(i),r=Cesium.Math.toDegrees(o.longitude),t=Cesium.Math.toDegrees(o.latitude);if(0===u.length&&(u.push(r,t),h.push([r,t]),c.push(i),s=i),4<=c.length){var n=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._viewer.scene,s);if(void 0!==n){o=n.x-e.position.x,e=n.y-e.position.y;if(o*o+e*e<16)return u.splice(u.length-2,2),c.pop(),void this.stopDrawing(a)}}u.push(r,t),h.push([r,t]),c.push(i),2!==c.length||d||(d=this._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(function(){return c},!1),clampToGround:!0,material:m._drawColor.polygon,width:3}})),3===c.length&&(d&&this._viewer.entities.remove(d),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(u)),material:m._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Cesium.CallbackProperty(p,!1))}}}.bind(this),Cesium.ScreenSpaceEventType.LEFT_CLICK),e.setInputAction(function(e){var t,i,o=e.endPosition;null!=o&&(0===c.length?r.showAt(o,"点击开始绘制第一个点"):(i=l.camera.getPickRay(o),e=l.globe.pick(i,l),!this._viewer.scene.pick(o)||(t=this._viewer.scene.pickPosition(o))&&(e=t),e&&(i=Cesium.Cartographic.fromCartesian(e),t=Cesium.Math.toDegrees(i.longitude),i=Cesium.Math.toDegrees(i.latitude),u.splice(u.length-2,2),h.pop(),c.pop(),u.push(t,i),h.push([t,i]),c.push(e),r.showAt(o,"右键结束绘制"),3<=c.length&&4<=c.length&&(void 0!==(i=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._viewer.scene,s))&&(e=i.x-o.x,o=i.y-o.y,document.body.style.cursor=e*e+o*o<16?"pointer":"default")))))}.bind(this),Cesium.ScreenSpaceEventType.MOUSE_MOVE),e.setInputAction(function(e){this.end&&this.end()}.bind(this),Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{void 0!==this._mouseHandler&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._core.mouse(this._viewer.container,0),this._tooltip.show(!1),d&&this._viewer.entities.remove(d),this.end=void 0,c.length<3||(this._prevEntity&&(this._prevEntity.polygon.hierarchy=Cesium.Cartesian3.fromDegreesArray(u)),"cancel"!==e?this.stopDrawing(t,a):this._prevEntity&&this._viewer.entities.remove(this._prevEntity))},this},Ul.prototype.stopDrawing=function(i,o){void 0!==this._mouseHandler&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),void 0!==this._volumeLabel&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),void 0!==this._volumeLabel1&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(e=>{this._viewer.entities.remove(e)}),this._volumeTin=[],this.isLoading(!0),setTimeout(()=>{var e=this.computeCutVolume(i,this.onlyTerrain);let t=i=>{var e=i.maxHeight,t=i.minHeight;this._prevEntity.polygon.height=i.minHeight,this._prevEntity.polygon.heightReference=0;e={id:this._core.getuid(),polygon:{hierarchy:{positions:this._positions},height:t,extrudedHeight:e,closeTop:!1,closeBottom:!1,material:Cesium.Color.CYAN.withAlpha(.2),outline:!0,outlineColor:Cesium.Color.RED,outlineWidth:2}};if(this._prevEntity1=this._viewer.entities.add(e),"function"==typeof o&&o(i),this.selectDatum){let t=()=>{this.addPoint(e=>{this.setDatum(e,e=>{"function"==typeof o&&o({...i,...e}),t()})})};t()}};this.onlyTerrain?e.then(e=>{t(e)}):t(e)},100)},Ul.prototype.computeCentroidOfPolygon=function(e){for(var t=[],i=[],o=0,r=0,n=0;n<e.length;n++){var a=Cesium.Cartographic.fromCartesian(e[n]);o+=a.longitude,r+=a.latitude,t.push(a.longitude),i.push(a.latitude)}var s=o/e.length,l=r/e.length;return new Cesium.Cartographic(s,l)},Ul.prototype.computeCutVolume=function(u,e){var t,c=15e3,h=-15e3;"auto"===u&&(t=Cesium.BoundingSphere.fromPoints(this._positions),u=t.radius/20);let m=this._core.getPointsInPolygon(this._degreesArr,u,!0),d=Cesium_turf.polygon([this._degreesArr]),i=()=>{let e=this._core.tinFromPoints(m,{getArea:!0,polygon:d})["tin"];this.tinData=e;let i={fill:0,dig:0},o={fill:"立方米",dig:"立方米"};var r,n,a,s,l={fill:1,dig:1};this.Triangulation=[],e.features.forEach(e=>{var t;e.positions&&(this.tin&&(t=this._viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(e.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:Cesium.Color.YELLOW}}),this._volumeTin.push(t)),t=e.geometry.coordinates[0],r=t[0][2],n=t[1][2],a=t[2][2],s=e.area,this.Triangulation.push({bottomArea:s,height:[r,n,a]}),0<(a=(r-c+n-c+a-c)/3)?i.dig=i.dig+s*a*l.dig:i.fill=i.fill-s*a*l.fill,1e10<i.dig&&"立方米"===o.dig&&(i.dig=i.dig/1e9,o.dig="立方千米",l.dig=1e-9),1e10<i.fill&&"立方米"===o.fill&&(i.fill=i.fill/1e9,o.fill="立方千米",l.fill=1e-9))});var t=this.computeCentroidOfPolygon(this._positions);return this._volumeLabel=this._viewer.entities.add({position:Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,h),label:{text:"挖方体积:"+i.dig.toFixed(4)+o.dig,pixelOffset:{x:0,y:-30},font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,h),label:{text:"填方体积:"+i.fill.toFixed(4)+o.fill,pixelOffset:{x:0,y:-70},font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),{maxHeight:h,minHeight:c,volume:i,unit:o,spacing:u}};if(e){let t=[];m.features.forEach(e=>{e=e.geometry.coordinates;t.push(Cesium.Cartographic.fromDegrees(e[0],e[1]))});let e=Cesium.sampleTerrainMostDetailed(Viewer.scene.globe.terrainProvider,t);return e.then(o=>(m.features.forEach((e,t)=>{let i=e.geometry.coordinates;i[2]=o[t]&&o[t].height?o[t].height:0,h<i[2]&&(h=i[2]),c>i[2]&&(c=i[2])}),i()))}return m.features.forEach(e=>{let t=e.geometry.coordinates;e=new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]));t[2]=Viewer.scene.sampleHeight(e)||0,h<t[2]&&(h=t[2]),c>t[2]&&(c=t[2])}),i()},Ul.prototype.addLoading=function(){var e=document.createElement("div");e.id="cesiumLoading",e.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";var t=document.createElement("img");t.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",t.src=this.loadingImg,e.appendChild(t),this.loading=e,this._viewer.container.appendChild(e)},Ul.prototype.isLoading=function(e){this.loading.style.display=e?"block":"none"},Ul.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0},Ul.prototype.addPoint=function(i){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(e){var t=this._viewer.scene.pick(e.position);t&&t.id&&t.id.id===this._prevEntity1.id&&((e=this._viewer.scene.pickPosition(e.position))&&(e=Cesium.Cartographic.fromCartesian(e),this.addPointHandle.destroy(),this.addPointHandle=null,i&&"function"==typeof i&&i(e.height.toFixed(1))))}.bind(this),Cesium.ScreenSpaceEventType.LEFT_CLICK),this.addPointHandle.setInputAction(function(e){var t=this._viewer.scene.pick(e.endPosition);t&&t.id&&t.id.id===this._prevEntity1.id?this._tooltip.showAt(e.endPosition,"点击修改基准面高度"):this._tooltip.show(!1)}.bind(this),Cesium.ScreenSpaceEventType.MOUSE_MOVE))},Ul.prototype.showTin=function(e){this.tin=e,this._volumeTin.forEach(e=>{this._viewer.entities.remove(e)}),this._volumeTin=[],e&&this.tinData&&this.tinData.features.forEach(e=>{e.positions&&(e=this._viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(e.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:Cesium.Color.YELLOW}}),this._volumeTin.push(e))})},Ul.prototype.setDatum=function(t,e){var i,o,r,n,a;this.Triangulation&&0<this.Triangulation.length&&(r={fill:0,dig:0},n={fill:"立方米",dig:"立方米"},a={fill:1,dig:1},this.Triangulation.forEach(function(e){i=e.bottomArea,o=e.height,0<(o=(o[0]-t+o[1]-t+o[2]-t)/3)?r.dig=r.dig+i*o*a.dig:r.fill=r.fill-i*o*a.fill,1e10<r.dig&&"立方米"===n.dig&&(r.dig=r.dig/1e9,n.dig="立方千米",a.dig=1e-9),1e10<r.fill&&"立方米"===n.fill&&(r.fill=r.fill/1e9,n.fill="立方千米",a.fill=1e-9)}),this._volumeLabel.label.text="挖方体积:"+r.dig.toFixed(4)+n.dig,this._volumeLabel1.label.text="填方体积:"+r.fill.toFixed(4)+n.fill,this._prevEntity.polygon.height=t,e&&"function"==typeof e&&e({volume:r,unit:n}))},Wl.prototype.createHawkeye=function(e,t){var i=document.createElement("div");i.id="Hawkeye",i.style.position="absolute",i.style.width="15%",i.style.height="20%",i.style.bottom="0",i.style.right="0",i.style.pointerEvents="none",t&&(t.width&&(i.style.width=t.width),t.height&&(i.style.height=t.height),t.bottom&&(i.style.bottom=t.bottom),t.right&&(i.style.right=t.right),t.top&&(i.style.top=t.top,i.style.bottom="unset"),t.left&&(i.style.left=t.left,i.style.right="unset")),this._viewer.container.appendChild(i);let o;o=e.url?new this._cesium.SingleTileImageryProvider({url:e.url}):e.imageryProvider;var r=new this._cesium.Viewer("Hawkeye",{imageryProvider:o,baseLayerPicker:!1,shadows:!1,shouldAnimate:!0,animation:!0,scene3DOnly:!0,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1});r._cesiumWidget._creditContainer.style.display="none";var n=this;let a=this._core.defaultValue(t&&t.height,1e4);function s(){var e=n._viewer.camera.position;let t=Cesium.Cartographic.fromCartesian(e);t.height+=a,r.camera.setView({destination:Cesium.Cartographic.toCartesian(t),orientation:{heading:n._viewer.camera.heading,pitch:n._viewer.camera.pitch,roll:n._viewer.camera.roll}})}return n._viewer.scene.preRender.addEventListener(s),this.close=function(){n._viewer.scene.preRender.removeEventListener(s),r.destroy(),i.remove(),n.close=void 0},this},Yl.prototype.createBezierline=function(o,t){var r,n=this,a=this._viewer,s=[],l=[],u=void 0,c="单击开始绘制";return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw),this.drawHandler=new Cesium.ScreenSpaceEventHandler(a.scene.canvas),we.states=1,this.drawHandler.setInputAction(function(e){c="左键添加点 右键结束";e=e.position,e=n._createGeoPoints(a,[{x:e.x,y:e.y}]);0==s.length&&(s.push({x:e[0],y:e[1],z:e[2]}),l.push(e)),l.push(e),s.push({x:e[0],y:e[1],z:e[2]})},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){n._core.CreateTooltip(c,e.endPosition,!0);var t,i,e=e.endPosition;0<s.length&&(Cesium.defined(u)?(s.pop(),l.pop(),i=n._createGeoPoints(a,[{x:e.x,y:e.y}]),s.push({x:i[0],y:i[1],z:i[2]}),l.push(i),t=n._createBezierPoints(s),i=[],t.forEach(e=>{i.push(e.x,e.y,s[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=n._createBezierPoints(s),i=[],t.forEach(e=>{i.push(e.x,e.y,s[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i),(u=a.entities.add({name:"Bezierline",polyline:{positions:new Cesium.CallbackProperty(function(){return r},!1),clampToGround:!0,width:n._core.defaultValue(o.width,2),material:Cesium.Color.fromCssColorString(n._core.defaultValue(o.color,"#ff0000"))}})).GeoType="Bezierline",n.MilitaryStandardObj.push(u.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(e){n.end&&n.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,u&&(u.pottingPoint=l),n.drawHandler.destroy(),n._core.CreateTooltip(c,void 0,!1),n._core.mouse(n._viewer.container,0),setTimeout(function(){we.states=0},100),"cancel"!==e?t&&t(u):u&&(a.entities.remove(u),n.MilitaryStandardObj.pop())},this},Yl.prototype.createBezierArrow=function(o,t){var r,n=this,a=this._viewer,s="单击开始绘制",l=[],u=[],c=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),n._core.mouse(n._viewer.container,1,window.SmartEarthRootUrl+D.draw),we.states=1,n.drawHandler=new Cesium.ScreenSpaceEventHandler(a.scene.canvas),n.drawHandler.setInputAction(function(e){s="左键添加点 右键结束";e=e.position,e=n._createGeoPoints(a,[{x:e.x,y:e.y}]);0==l.length&&(l.push({x:e[0],y:e[1],z:e[2]}),u.push(e)),l.push({x:e[0],y:e[1],z:e[2]}),u.push(e)},Cesium.ScreenSpaceEventType.LEFT_CLICK),n.drawHandler.setInputAction(function(e){n._core.CreateTooltip(s,e.endPosition,!0);var t,i,e=e.endPosition;0<l.length&&(Cesium.defined(c)?(l.pop(),u.pop(),i=n._createGeoPoints(a,[{x:e.x,y:e.y}]),l.push({x:i[0],y:i[1],z:i[2]}),u.push(i),t=n._createBezierPoints(l),i=[],t.forEach(e=>{i.push(e.x,e.y,l[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=n._createBezierPoints(l),i=[],t.forEach(e=>{i.push(e.x,e.y,l[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i),(c=a.entities.add({name:"BezierArrow",polyline:{positions:new Cesium.CallbackProperty(function(){return r},!1),clampToGround:!0,width:n._core.defaultValue(o.width,5),material:new Cesium.PolylineArrowMaterialProperty(Cesium.Color.fromCssColorString(n._core.defaultValue(o.color,"#ff0000")))}})).GeoType="BezierArrow",n.MilitaryStandardObj.push(c.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),n.drawHandler.setInputAction(function(e){n.end&&n.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,c&&(c.pottingPoint=u),n.drawHandler.destroy(),n._core.CreateTooltip(s,void 0,!1),n._core.mouse(n._viewer.container,0),setTimeout(function(){we.states=0},100),"cancel"!==e?t&&t(c):c&&(a.entities.remove(c),n.MilitaryStandardObj.pop())},this},Yl.prototype.createSwallowtailArrow=function(e,o,t){var r,n=e,a=this,s=this._viewer,l=void 0,u=[],c=[],h="单击开始绘制";return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),a._core.mouse(a._viewer.container,1,window.SmartEarthRootUrl+D.draw),we.states=1,a.drawHandler=new Cesium.ScreenSpaceEventHandler(s.scene.canvas),a.drawHandler.setInputAction(function(e){e=e.position;h="单击完成绘制",0==c.length?(e=a._createGeoPoints(s,[{x:e.x,y:e.y}]),c.push({x:e[0],y:e[1],z:e[2]},{x:e[0]+1e-7,y:e[1]+1e-7,z:e[2]}),u.push(e,e)):2==c.length&&a.end&&a.end()},Cesium.ScreenSpaceEventType.LEFT_CLICK),a.drawHandler.setInputAction(function(e){a._core.CreateTooltip(h,e.endPosition,!0);var t,i,e=e.endPosition;1<c.length&&(Cesium.defined(l)?(c.pop(),u.pop(),i=a._createGeoPoints(s,[{x:e.x,y:e.y}]),c.push({x:i[0],y:i[1],z:i[2]}),u.push(i),t=a._computeSwallowtailArrow(c),i=[],t.forEach(e=>{i.push(e.x,e.y,c[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(l=a.plotingSwallowtailArrow(s,c,n,o),t=a._computeSwallowtailArrow(c),i=[],t.forEach(e=>{i.push(e.x,e.y,c[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i),l.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(r)},!1),l.GeoType="SwallowtailArrow",a.MilitaryStandardObj.push(l.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),a.drawHandler.setInputAction(function(e){a.end&&a.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,l&&(l.pottingPoint=u),a._core.CreateTooltip(h,void 0,!1),a.drawHandler.destroy(),a._core.mouse(a._viewer.container,0),setTimeout(function(){we.states=0},100),"cancel"!==e?t&&t(l):l&&(s.entities.remove(l),a.MilitaryStandardObj.pop())},this},Yl.prototype.createStraightArrow=function(e,o,t){var r,n=e,a=this,s=this._viewer,l=[],u=void 0,c=[],h="单击开始绘制";return we.states=1,this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),a._core.mouse(a._viewer.container,1,window.SmartEarthRootUrl+D.draw),a.drawHandler=new Cesium.ScreenSpaceEventHandler(s.scene.canvas),a.drawHandler.setInputAction(function(e){e=e.position;h="单击完成绘制",0==l.length?(e=a._createGeoPoints(s,[{x:e.x,y:e.y}]),l.push({x:e[0],y:e[1],z:e[2]},{x:e[0]+1e-7,y:e[1]+1e-7,z:e[2]}),c.push(e,e)):2==l.length&&a.end&&a.end()},Cesium.ScreenSpaceEventType.LEFT_CLICK),a.drawHandler.setInputAction(function(e){var t,i,e=e.endPosition;a._core.CreateTooltip(h,e,!0),1<l.length&&(Cesium.defined(u)?(l.pop(),c.pop(),i=a._createGeoPoints(s,[{x:e.x,y:e.y}]),l.push({x:i[0],y:i[1],z:i[2]}),c.push(i),t=a.calculateMorePoints(l),i=[],t.forEach(e=>{i.push(e.x,e.y,l[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=a.calculateMorePoints(l),i=[],t.forEach(e=>{i.push(e.x,e.y,l[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i),"polygon"==n?u=s.entities.add({name:"StraightArrow",polygon:{hierarchy:r,material:Cesium.Color.fromCssColorString(a._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}):"box"==n&&(u=s.entities.add({name:"StraightArrow",polygon:{hierarchy:r,material:Cesium.Color.fromCssColorString(a._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),extrudedHeight:i[2]+a._core.defaultValue(o.extrudedHeight,200),height:i[2],outline:a._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(a._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}})),u.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(r)},!1),u.GeoType="StraightArrow",a.MilitaryStandardObj.push(u.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),a.drawHandler.setInputAction(function(e){a.end&&a.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,u&&(u.pottingPoint=c),a._core.CreateTooltip(h,void 0,!1),a.drawHandler.destroy(),a._core.mouse(a._viewer.container,0),setTimeout(function(){we.states=0},100),"cancel"!==e?t&&t(u):u&&(s.entities.remove(u),a.MilitaryStandardObj.pop())},this},Yl.prototype.createRoundedRectangle=function(e,o,t){var r,n=e,a="单击开始绘制",s=this,l=this._viewer,u=[],c=[],h=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),s._core.mouse(s._viewer.container,1,window.SmartEarthRootUrl+D.draw),we.states=1,s.drawHandler=new Cesium.ScreenSpaceEventHandler(l.scene.canvas),s.drawHandler.setInputAction(function(e){e=e.position;a="单击完成绘制",0==u.length?(e=s._createGeoPoints(l,[{x:e.x,y:e.y}]),u.push({x:e[0],y:e[1],z:e[2]},{x:e[0]+1e-7,y:e[1]+1e-7,z:e[2]}),c.push(e,e)):2==u.length&&s.end&&s.end()},Cesium.ScreenSpaceEventType.LEFT_CLICK),s.drawHandler.setInputAction(function(e){s._core.CreateTooltip(a,e.endPosition,!0);var t,i,e=e.endPosition;1<u.length&&(Cesium.defined(h)?(u.pop(),c.pop(),i=s._createGeoPoints(l,[{x:e.x,y:e.y}]),u.push({x:i[0],y:i[1],z:i[2]}),c.push(i),t=s._computeRoundedRectanglePoints(u),i=[],t.forEach(e=>{i.push(e.x,e.y,u[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=s._computeRoundedRectanglePoints(u),i=[],t.forEach(e=>{i.push(e.x,e.y,u[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i),"polygon"==n?h=l.entities.add({name:"RoundedRectangle",polygon:{hierarchy:r,material:Cesium.Color.fromCssColorString(s._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(s._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}}):"box"==n&&(h=l.entities.add({name:"RoundedRectangle",polygon:{hierarchy:r,material:Cesium.Color.fromCssColorString(s._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(s._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:i[2]+s._core.defaultValue(o.extrudedHeight,200),height:i[2]}})),h.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(r)},!1),h.GeoType="RoundedRectangle",s.MilitaryStandardObj.push(h.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),s.drawHandler.setInputAction(function(e){s.end&&s.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,h&&(h.pottingPoint=c),s._core.CreateTooltip(a,void 0,!1),s.drawHandler.destroy(),s._core.mouse(s._viewer.container,0),setTimeout(function(){we.states=0},100),"cancel"!==e?t&&t(h):h&&(l.entities.remove(h),s.MilitaryStandardObj.pop())},this},Yl.prototype.createSector=function(e,o,t){var r,n,a,s=e,l="单击开始绘制",u=this._viewer,c=this,h=[],m=[];return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),c._core.mouse(c._viewer.container,1,window.SmartEarthRootUrl+D.draw),we.states=1,c.drawHandler=new Cesium.ScreenSpaceEventHandler(u.scene.canvas),c.drawHandler.setInputAction(function(e){l="单击添加点";e=e.position,e=c._createGeoPoints(u,[{x:e.x,y:e.y}]);0==h.length?(h.push({x:e[0],y:e[1],z:e[2]},{x:e[0],y:e[1],z:e[2]}),m.push(e,e)):2==h.length?(h.push({x:e[0],y:e[1],z:e[2]}),m.push(e)):3==h.length&&c.end&&c.end(),2!==m.length||n||(n=u.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(function(){return[Cesium.Cartesian3.fromDegrees(m[0][0],m[0][1]),Cesium.Cartesian3.fromDegrees(m[1][0],m[1][1])]},!1),clampToGround:!0,material:Cesium.Color.fromCssColorString(c._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),width:3}}))},Cesium.ScreenSpaceEventType.LEFT_CLICK),c.drawHandler.setInputAction(function(e){c._core.CreateTooltip(l,e.endPosition,!0);var t,i,e=e.endPosition;2===h.length&&(h.pop(),m.pop(),i=c._createGeoPoints(u,[{x:e.x,y:e.y}]),h.push({x:i[0],y:i[1],z:i[2]}),m.push(i)),2<h.length&&(n&&u.entities.remove(n),Cesium.defined(r)?(h.pop(),m.pop(),i=c._createGeoPoints(u,[{x:e.x,y:e.y}]),h.push({x:i[0],y:i[1],z:i[2]}),m.push(i),t=c._computeSectorPoints(h),i=[],t.forEach(e=>{i.push(e.x,e.y,h[0].z)}),a=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=c._computeSectorPoints(h),i=[],t.forEach(e=>{i.push(e.x,e.y,h[0].z)}),a=Cesium.Cartesian3.fromDegreesArrayHeights(i),"polygon"==s?r=u.entities.add({name:"Sector",polygon:{hierarchy:a,material:Cesium.Color.fromCssColorString(c._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:c._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(c._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}}):"box"==s&&(r=u.entities.add({name:"Sector",polygon:{hierarchy:a,material:Cesium.Color.fromCssColorString(c._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:c._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(c._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:i[2]+c._core.defaultValue(o.extrudedHeight,200),height:i[2]}})),r.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(a)},!1),r.GeoType="Sector",c.MilitaryStandardObj.push(r.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),c.drawHandler.setInputAction(function(e){c.end&&c.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,r&&(r.pottingPoint=m),c._core.CreateTooltip(l,void 0,!1),c.drawHandler.destroy(),c._core.mouse(c._viewer.container,0),n&&u.entities.remove(n),setTimeout(function(){we.states=0},100),"cancel"!==e?t&&t(r):r&&(u.entities.remove(r),c.MilitaryStandardObj.pop())},this},Yl.prototype.createBow=function(e,r,t){var n,a=e,s=this,l=this._viewer,u="单击开始绘制",c=[],h=[],m=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),s._core.mouse(s._viewer.container,1,window.SmartEarthRootUrl+D.draw),we.states=1,s.drawHandler=new Cesium.ScreenSpaceEventHandler(l.scene.canvas),s.drawHandler.setInputAction(function(e){u="单击添加点";e=e.position,e=s._createGeoPoints(l,[{x:e.x,y:e.y}]);0==c.length?(c.push({x:e[0],y:e[1],z:e[2]}),h.push(e)):1==c.length?(c.push({x:e[0],y:e[1],z:e[2]},{x:e[0]+1e-7,y:e[1]+1e-7,z:e[2]}),h.push(e,e)):3==c.length&&s.end&&s.end()},Cesium.ScreenSpaceEventType.LEFT_CLICK),s.drawHandler.setInputAction(function(e){var t,i,o=e.endPosition;s._core.CreateTooltip(u,e.endPosition,!0),2<c.length&&(Cesium.defined(m)?(c.pop(),h.pop(),i=s._createGeoPoints(l,[{x:o.x,y:o.y}]),c.push({x:i[0],y:i[1],z:i[2]}),h.push(i),t=s._computeBowPoints(c),i=[],t.forEach(e=>{i.push(e.x,e.y,c[0].z)}),n=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=s._computeBowPoints(c),i=[],t.forEach(e=>{i.push(e.x,e.y,c[0].z)}),n=Cesium.Cartesian3.fromDegreesArrayHeights(i),"polygon"==a?m=l.entities.add({name:"Bow",polygon:{hierarchy:n,material:Cesium.Color.fromCssColorString(s._core.defaultValue(r.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(r.outline,!0),outlineColor:Cesium.Color.fromCssColorString(s._core.defaultValue(r.outlineColor,"rgba(255,0,0,0.6)"))}}):"box"==a&&(m=l.entities.add({name:"Bow",polygon:{hierarchy:n,material:Cesium.Color.fromCssColorString(s._core.defaultValue(r.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(r.outline,!0),outlineColor:Cesium.Color.fromCssColorString(s._core.defaultValue(r.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:i[2]+s._core.defaultValue(r.extrudedHeight,200),height:i[2]}})),m.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(n)},!1),m.GeoType="Bow",s.MilitaryStandardObj.push(m.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),s.drawHandler.setInputAction(function(e){s.end&&s.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,m&&(m.pottingPoint=h),s._core.CreateTooltip(u,void 0,!1),s.drawHandler.destroy(),s._core.mouse(s._viewer.container,0),setTimeout(function(){we.states=0},100),"cancel"!==e?t&&t(m):m&&(l.entities.remove(m),s.MilitaryStandardObj.pop())},this},Yl.prototype.createPincerArrow=function(e,o,r){var n=e,a=this,s=this._viewer,l=[],u=[],c=void 0,h="单击开始绘制";this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),a._core.mouse(a._viewer.container,1,window.SmartEarthRootUrl+D.draw),we.states=1,a.drawHandler=new Cesium.ScreenSpaceEventHandler(s.scene.canvas),a.drawHandler.setInputAction(function(e){var t,i=e.position;h="单击增加点",(t=a._getPosition.getMousePosition(e))&&(4<l.length?(a._core.CreateTooltip(h,e.position,!1),c.pottingPoint=u,a.drawHandler.destroy(),a._core.mouse(a._viewer.container,0),setTimeout(function(){we.states=0},100),r&&r(c)):(l.push(t),i=a._createGeoPoints(s,[{x:i.x,y:i.y}]),u.push(i)))},Cesium.ScreenSpaceEventType.LEFT_CLICK),a.drawHandler.setInputAction(function(e){var t,i;l.length<2||(a._core.CreateTooltip(h,e.endPosition,!0),(t=a._getPosition.getMousePosition(e))&&2<=l.length&&(Cesium.defined(c)?(l.pop(),u.pop(),l.push(t),i=a._createGeoPoints(s,[e.endPosition]),u.push(i)):(l.push(t),i=a._createGeoPoints(s,[e.endPosition]),u.push(i),(c=a.showArrowOnMap(l,n,o)).GeoType="PincerArrow",a.MilitaryStandardObj.push(c.id))))},Cesium.ScreenSpaceEventType.MOUSE_MOVE)},Yl.prototype.createAttackArrow=function(e,o,t){var r=e,n=this,a=this._viewer,s=[],l=[],u=void 0,c="单击开始绘制";this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),n._core.mouse(n._viewer.container,1,window.SmartEarthRootUrl+D.draw),we.states=1,n.drawHandler=new Cesium.ScreenSpaceEventHandler(a.scene.canvas),n.drawHandler.setInputAction(function(e){var t;c="单击增加点",(t=n._getPosition.getMousePosition(e))&&(s.push(t),e=n._createGeoPoints(a,[e.position]),l.push(e))},Cesium.ScreenSpaceEventType.LEFT_CLICK),n.drawHandler.setInputAction(function(e){1<s.length&&(s.pop(),l.pop())},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n.drawHandler.setInputAction(function(e){var t,i;s.length<2||(n._core.CreateTooltip(c,e.endPosition,!0),(t=n._getPosition.getMousePosition(e))&&2<=s.length&&(Cesium.defined(u)?(s.pop(),l.pop(),s.push(t),i=n._createGeoPoints(a,[e.endPosition]),l.push(i)):(s.push(t),i=n._createGeoPoints(a,[e.endPosition]),l.push(i),(u=n.showAttackArrowOnMap(s,r,o)).GeoType="AttackArrow",n.MilitaryStandardObj.push(u.id))))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),n.drawHandler.setInputAction(function(e){n._core.CreateTooltip(c,e.position,!1),u.pottingPoint=l,n.drawHandler.destroy(),n._core.mouse(n._viewer.container,0),setTimeout(function(){we.states=0},100),t&&t(u)},Cesium.ScreenSpaceEventType.RIGHT_DOWN)},Yl.prototype.createHandlerPolygon=function(e,a,i){var s,l=e,u="单击开始绘制",c=this,h=this._viewer,m=[],d=[],p=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),c._core.mouse(c._viewer.container,1,window.SmartEarthRootUrl+D.draw),we.states=1,c.drawHandler=new Cesium.ScreenSpaceEventHandler(h.scene.canvas),c.drawHandler.setInputAction(function(e){var t=e.position;u="单击完成绘制",0==m.length?(e=c._createGeoPoints(h,[{x:t.x,y:t.y}]),m.push({x:e[0],y:e[1],z:e[2]},{x:e[0]+1e-7,y:e[1]+1e-7,z:e[2]}),d.push(e,e)):2==m.length&&(c._core.CreateTooltip(u,t,!1),p.pottingPoint=d,setTimeout(function(){we.states=0},100),c.drawHandler.destroy(),c._core.mouse(c._viewer.container,0),i&&i(p))},Cesium.ScreenSpaceEventType.LEFT_CLICK),c.drawHandler.setInputAction(function(e){var t,i,o,r,n=e.endPosition;c._core.CreateTooltip(u,e.endPosition,!0),1<m.length&&(Cesium.defined(p)?(m.pop(),d.pop(),r=c._createGeoPoints(h,[{x:n.x,y:n.y}]),m.push({x:r[0],y:r[1],z:r[2]}),d.push(r),t=c._computeGatheringPlacePoints(m),i=c.createCloseCardinal(t),o=c.calculatePointsFBZ3(i,100),r=[],o.forEach(e=>{r.push(e.x,e.y,m[0].z)}),s=r):(t=c._computeGatheringPlacePoints(m),i=c.createCloseCardinal(t),o=c.calculatePointsFBZ3(i,100),r=[],o.forEach(e=>{r.push(e.x,e.y,m[0].z)}),s=r,(p=c.plotingGatheringPlace(h,m,l,a)).polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s))},!1),p.GeoType="GatheringPlace",c.MilitaryStandardObj.push(p.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),m},Yl.prototype.plotingGatheringPlace=function(e,t,i,o){t=this._computeGatheringPlacePoints(t),t=this.createCloseCardinal(t),t=this.calculatePointsFBZ3(t,100),t=this._createGeoPoints(e,t),o="polygon"==i?e.entities.add({name:"GatheringPlace",polygon:{hierarchy:Cesium.Cartesian3.fromDegreesArrayHeights(t),material:Cesium.Color.fromCssColorString(this._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:this._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(this._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}}):e.entities.add({name:"GatheringPlace",polygon:{hierarchy:Cesium.Cartesian3.fromDegreesArrayHeights(t),extrudedHeight:this._core.defaultValue(o.extrudedHeight,200)+t[2],height:t[2],material:Cesium.Color.fromCssColorString(this._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:this._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(this._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}});return o},Yl.prototype.addFeature=function(e){let t,i=e.geometry.coordinates,o=[];if("PincerArrow"==e.type){var r=po.algorithm.doubleArrow(i);let e=[];-1==JSON.stringify(r.polygonalPoint).indexOf("null")&&(e=r.polygonalPoint),t=e}else if("AttackArrow"==e.type){var n=po.algorithm.tailedAttackArrow(i);let e=[];-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(e=n.polygonalPoint),t=e}else i.forEach(e=>{o.push({x:e[0],y:e[1],z:e[2]})}),"StraightArrow"==e.type?t=this.calculateMorePoints(o):"RoundedRectangle"==e.type?t=this._computeRoundedRectanglePoints(o):"Sector"==e.type?t=this._computeSectorPoints(o):"Bow"==e.type?t=this._computeBowPoints(o):"GatheringPlace"==e.type?(n=this._computeGatheringPlacePoints(o),n=this.createCloseCardinal(n),t=this.calculatePointsFBZ3(n,100)):"SwallowtailArrow"==e.type?t=this._computeSwallowtailArrow(o):"Bezierline"!=e.type&&"BezierArrow"!=e.type||(t=this._createBezierPoints(o));let a;a="AttackArrow"!==e.type&&"PincerArrow"!==e.type?(a=[],t.forEach(e=>{a.push(e.x,e.y,o[0].z)}),Cesium.Cartesian3.fromDegreesArrayHeights(a)):t;let s;return s=0<=e.type.indexOf("Bezier")?this._viewer.entities.add({name:e.name,polyline:{positions:new Cesium.CallbackProperty(function(){return a},!1),width:e.style.width,clampToGround:!0,material:"BezierArrow"===e.type?new Cesium.PolylineArrowMaterialProperty(new Cesium.Color.fromCssColorString(e.style.fillColor.color).withAlpha(e.style.fillColor.alpha)):new Cesium.Color.fromCssColorString(e.style.fillColor.color).withAlpha(e.style.fillColor.alpha)}}):this._viewer.entities.add({name:e.name,polygon:{hierarchy:new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(a)},!1),fill:!0,extrudedHeight:void 0!==e.style.extrudedHeight?e.style.extrudedHeight+e.style.height:void 0,height:e.style.height,material:new Cesium.Color.fromCssColorString(e.style.fillColor.color).withAlpha(e.style.fillColor.alpha),outline:e.style.outline,outlineColor:e.style.outlineColor?new Cesium.Color.fromCssColorString(e.style.outlineColor.color).withAlpha(e.style.outlineColor.alpha):void 0}}),s.GeoType=e.type,s.pottingPoint=i,this.MilitaryStandardObj.push(s.id),s},Yl.prototype.open=function(e){var t=this,i=this._viewer,o=new FileReader;o.readAsText(e);var r=new Cesium.EntityCollection;o.onload=function(){let e=JSON.parse(this.result).features;e.forEach(e=>{e=t.addFeature(e);r.add(e)}),i.flyTo(r),t.MilitaryStandardObj.length&&!t.editHandler&&t.edit(t.openEdit,t.editOption)}},Yl.prototype.clear=function(){var t=this._viewer;this.MilitaryStandardObj.forEach(e=>{t.entities.removeById(e)}),this.MilitaryStandardObj=[],window.layuiLayer.close(SmartEarthPopupData.layerIndex),!this.MilitaryStandardObj.length&&this.editHandler&&this.edit(!1)},Yl.prototype.getColor=function(e){return{color:this.colorHex("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),alpha:e.alpha}},Yl.prototype.getFeature=function(e){let t={type:e.GeoType,name:e.name,editType:""};var i=e.pottingPoint;return e.polyline?(t.editType="GroundPolyline",t.geometry={type:"polyline",coordinates:i},t.style={fillColor:this.getColor(e.polyline.material.color._value),width:e.polyline.width.getValue()}):(t.editType="GroundPolygon",t.geometry={type:"polygon",coordinates:i},t.style={fillColor:this.getColor(e.polygon.material.color._value)},e.polygon.extrudedHeight&&(t.editType="ExtrudedPolygon",t.style.height=e.polygon.height.getValue(),t.style.extrudedHeight=e.polygon.extrudedHeight.getValue()-e.polygon.height.getValue(),e.polygon.outline&&(t.style.outline=e.polygon.outline.getValue()),e.polygon.outlineColor&&(t.style.outlineColor=this.getColor(e.polygon.outlineColor._value)))),t},Yl.prototype.save=function(){var t,i=this._viewer,o={type:"FeatureCollection",features:[]};this.MilitaryStandardObj.forEach(e=>{e=i.entities.getById(e);e&&(t=this.getFeature(e)),o.features.push(t)});var e=JSON.stringify(o),e=new Blob([e],{type:"text/plain;charset=utf-8"});this._core.saveAs(e,"军标.json")},Yl.prototype.colorHex=function(e){if(/^(rgb|RGB)/.test(e)){for(var t=e.replace(/(rgb|RGB)*/g,"").replace("(","").replace(")","").split(","),i="#",o=0;o<t.length;o++){var r=Number(t[o]).toString(16);"0"===(r=1===r.length?"0"+r:r)&&(r+=r),i+=r}return i=7!==i.length?e:i}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e))return e;var n=e.replace(/#/,"").split("");if(6===n.length)return e;if(3===n.length){for(var a="#",o=0;o<n.length;o+=1)a+=n[o]+n[o];return a}},Yl.prototype.copyJb=function(e){var t;return"StraightArrow"==e.type||"SwallowtailArrow"==e.type||"PincerArrow"==e.type?(t={holes:[],positions:this.szposis(e.pos)},t=this._viewer.entities.add({name:"StraightArrow",polygon:{hierarchy:t,material:Cesium.Color.RED.withAlpha(.5)}})):"BezierArrow"==e.type?t=this._viewer.entities.add({name:"BezierArrow",polyline:{positions:this.szposis(e.pos),width:5,clampToGround:!0,material:new Cesium.PolylineArrowMaterialProperty(Cesium.Color.RED)}}):e.img?t=this._viewer.entities.add({position:this.zfsz(e.pos),billboard:{image:e.img,show:!0}}):e.text&&(t=this._viewer.entities.add({position:this.zfsz(e.pos),label:{text:e.text,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,show:!0,showBackground:!1}})),t._id=e.id,that.objectsToExclude.push(t),t},Yl.prototype.getEntityById=function(e){var t,e=this._viewer.entities.getById(e);return null!=e.polyline&&e.polyline?t={obj:e.polyline,type:e.name,posion:e.polyline.positions.getValue()}:null!=e.polygon&&e.polygon?t={obj:e.polygon,type:e.name,posion:e.polygon.hierarchy.getValue().positions}:null!=e.label&&e.label?t={obj:e.label,type:"lable",text:e.label.text.getValue(),posion:e.position.getValue()}:null!=e.billboard&&e.billboard&&(t={obj:e.billboard,type:"img",img:e.billboard.image.getValue(),posion:e.position.getValue()}),t},Yl.prototype.szposis=function(e){for(var t=[],i=e.split(",("),o=0;o<i.length;o++){var r=this.zfsz(i[o]);t.push(r)}return t},Yl.prototype.zfsz=function(e){for(var t=e.split(","),i=0;i<t.length;i++)(-1!=t[i].indexOf("(")||-1!=t[i].indexOf(")"))&&(t[i]=t[i].replace("(",""));return{x:parseFloat(t[0]),y:parseFloat(t[1]),z:parseFloat(t[2])}},Yl.prototype.showArrowOnMap=function(a,e,t){function i(){if(a.length<3)return null;for(var e=[],t=0;t<a.length;t++){var i=s._viewer.scene.globe.ellipsoid.cartesianToCartographic(a[t]),o=Cesium.Math.toDegrees(i.latitude),i=Cesium.Math.toDegrees(i.longitude);e.push([i,o])}var r=po.algorithm.doubleArrow(e),n=[];return-1==JSON.stringify(r.polygonalPoint).indexOf("null")&&(n=r.polygonalPoint),new Cesium.PolygonHierarchy(n)}var o,s=this,r=s._viewer.scene.globe.ellipsoid.cartesianToCartographic(a[0]).height;return"polygon"==e?o=s._viewer.entities.add({name:"PincerArrow",polygon:new Cesium.PolygonGraphics({hierarchy:new Cesium.CallbackProperty(i,!1),show:!0,fill:!0,material:Cesium.Color.fromCssColorString(s._core.defaultValue(t.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(t.outline,!0),outlineColor:Cesium.Color.fromCssColorString(s._core.defaultValue(t.outlineColor,"rgba(255,0,0,0.6)"))})}):"box"==e&&(o=s._viewer.entities.add({name:"PincerArrow",polygon:new Cesium.PolygonGraphics({hierarchy:new Cesium.CallbackProperty(i,!1),show:!0,fill:!0,material:Cesium.Color.fromCssColorString(s._core.defaultValue(t.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(t.outline,!0),outlineColor:Cesium.Color.fromCssColorString(s._core.defaultValue(t.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:r+s._core.defaultValue(t.extrudedHeight,200),height:r})})),o},Yl.prototype.showAttackArrowOnMap=function(n,e,t){var a=this,i=a._viewer.scene.globe.ellipsoid.cartesianToCartographic(n[0]).height;return this._viewer.entities.add({name:"AttackArrow",polygon:new Cesium.PolygonGraphics({hierarchy:new Cesium.CallbackProperty(function(){if(n.length<3)return null;for(var e=[],t=0;t<n.length;t++){var i=a.cartesianToLatlng(n[t]);e.push(i)}var o=po.algorithm.tailedAttackArrow(e),r=[];return-1==JSON.stringify(o.polygonalPoint).indexOf("null")&&(r=o.polygonalPoint),new Cesium.PolygonHierarchy(r)},!1),show:!0,fill:!0,classificationType:Cesium.ClassificationType.TERRAIN,extrudedHeight:"box"===e?a._core.defaultValue(t.extrudedHeight,200)+i:void 0,height:"box"===e?i:void 0,material:Cesium.Color.fromCssColorString(a._core.defaultValue(t.color,"rgba(255,0,0,0.6)")),outline:a._core.defaultValue(t.outline,!0),outlineColor:Cesium.Color.fromCssColorString(a._core.defaultValue(t.outlineColor,"rgba(255,0,0,0.6)"))})})},Yl.prototype.cartesianToLatlng=function(e){var t=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),e=Cesium.Math.toDegrees(t.latitude);return[Cesium.Math.toDegrees(t.longitude),e]},Yl.prototype.getCatesian3FromPX=function(e,t){var i,o=this._viewer.scene.drillPick(e);this._viewer.render();for(var r=!0,n=0;n<o.length;n++)(o[n]&&o[n].primitive||o[n]instanceof Cesium.Cesium3DTileFeature)&&(r=!0);if(r)i=this._viewer.scene.pickPosition(e);else{e=this._viewer.camera.getPickRay(e);if(!e)return null;i=this._viewer.scene.globe.pick(e,this._viewer.scene)}return i},Yl.prototype._createGeoPoints=function(e,t){for(var i,o,r,n,a=[],s=0;s<t.length;s++)(i=(r=e.camera.getPickRay(t[s]))?e.scene.globe.pick(r,e.scene):i)&&(n=Cesium.Cartographic.fromCartesian(i),o=Cesium.Math.toDegrees(n.longitude),r=Cesium.Math.toDegrees(n.latitude),n=n.height,a.push(o,r,n));return a},Yl.prototype._createScreenPoints=function(e,t){for(var i,o=[],r=0;r<t.length;r++)i=e.scene.cartesianToCanvasCoordinates(t[r]),o.push(i);return o},Yl.prototype._createBezierPoints=function(e){for(var t=[],i=0;i<=100;i++){var o=this._computeBezierPoints(e,i/100);t.push(o)}return t},Yl.prototype._computeBezierPoints=function(e,t){for(var i=0,o=0,r=this._computeBinomial(e),n=0;n<e.length;n++){var a=e[n];i+=a.x*Math.pow(1-t,e.length-1-n)*Math.pow(t,n)*r[n],o+=a.y*Math.pow(1-t,e.length-1-n)*Math.pow(t,n)*r[n]}return{x:i,y:o}},Yl.prototype._computeBinomial=function(e){var t=e.length,i=[];i.push(1);for(var o=1;o<t-1;o++){for(var r=1,n=1,a=0;a<o;a++)r*=t-1-a,n*=o-a;i.push(r/n)}return i.push(1),i},Yl.prototype._computeGatheringPlacePoints=function(e){var t,i,o,r,n,a,s=[];return 2==e.length&&(t=e[0],o={x:(i=e[e.length-1]).x-t.x,y:i.y-t.y},a=Math.sqrt(o.x*o.x+o.y*o.y),n=this.calculateVector(o,Math.PI/3,Math.sqrt(3)/12*a)[1],r={x:t.x+n.x,y:t.y+n.y},e={x:(t.x+i.x)/2,y:(t.y+i.y)/2},n=this.calculateVector(o,2*Math.PI/3,Math.sqrt(3)/12*a)[1],n={x:i.x+n.x,y:i.y+n.y},a={x:(a=this.calculateVector(o,Math.PI/2,.5*a)[0]).x+e.x,y:a.y+e.y},s.push(t,r,e,n,i,a)),s},Yl.prototype.createCloseCardinal=function(e){if(null==e||e.length<3)return e;var t=e[0];e.push(t);for(var i,o,r=e,n=[],a=r.length-1,s=0;s<=a-1;s++){y=s==a-1?(i=r[a-1],o=r[0],r[1]):(i=r[s],o=r[s+1],r[s+2]);var l={x:void 0,y:void 0},u={x:void 0,y:void 0},c=o.x-i.x,h=o.y-i.y,m=y.x-o.x,d=y.y-o.y,p=Math.sqrt(c*c+h*h),g=Math.sqrt(m*m+d*d),_=c/p,f=h/p,y=m/g,c=d/g,h=_+y,m=f+c,d=Math.sqrt(h*h+m*m),h=h/d,d=m/d;Math.abs(1-(_*y+f*c))<.005?(l.x=o.x-y*p*.4,l.y=o.y-c*p*.4,u.x=o.x+_*g*.4,u.y=o.y+f*g*.4):(l.x=o.x-h*p*.4,l.y=o.y-d*p*.4,u.x=o.x+h*g*.4,u.y=o.y+d*g*.4),s==a-1?(n[0]=o,n[1]=u,n[3*(a-2)+2+3]=l,n[3*(a-2)+2+4]=r[a]):(n[3*s+2]=l,n[3*s+2+1]=o,n[3*s+2+2]=u)}return n},Yl.prototype.calculatePointsFBZ3=function(e,t){var i=[],o=.05;0<(t=t||20)&&(o=1/t);for(var r=0;r<e.length-3;){var n=e[r],a=e[r+1],s=e[r+2],l=e[r+3];i.push(n);for(var u=0;u<1;){var c=(1-u)*(1-u)*(1-u)*n.x+3*u*(1-u)*(1-u)*a.x+3*u*u*(1-u)*s.x+u*u*u*l.x,h=(1-u)*(1-u)*(1-u)*n.y+3*u*(1-u)*(1-u)*a.y+3*u*u*(1-u)*s.y+u*u*u*l.y;i.push({x:c,y:h}),u+=o}(r+=3)>=e.length&&i.push(n)}return i[i.length-1],e[e.length-1],i},Yl.prototype.calculateVector=function(e,t,i){var o,r;t=t||Math.PI/2,i=i||1;var n,a,s,l,u,c,h=Math.sqrt(e.x*e.x+e.y*e.y);return 0==e.y?(s=l=h*i*Math.cos(t)/e.x,0<e.x?c=-(u=Math.sqrt(i*i-s*s)):e.x<0&&(u=-(c=Math.sqrt(i*i-s*s))),o={x:s,y:u},r={x:l,y:c}):(a=1+(n=-e.x/e.y)*n,t=(h=i*h*Math.cos(t)/e.y)*h-i*i,u=n*(s=(-(i=2*n*h)-Math.sqrt(i*i-4*a*t))/(2*a))+h,c=n*(l=(-i+Math.sqrt(i*i-4*a*t))/(2*a))+h,0<=e.y?(o={x:s,y:u},r={x:l,y:c}):e.y<0&&(o={x:l,y:c},r={x:s,y:u})),[o,r]},Yl.prototype.plotingSwallowtailArrow=function(e,t,i,o){var r,n=this._computeSwallowtailArrow(t),a=[];return n.forEach(e=>{a.push(e.x,e.y,t[0].z)}),"polygon"==i?r=e.entities.add({name:"SwallowtailArrow",polygon:{hierarchy:Cesium.Cartesian3.fromDegreesArrayHeights(a),material:Cesium.Color.fromCssColorString(this._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}):"box"==i&&(r=e.entities.add({name:"SwallowtailArrow",polygon:{hierarchy:Cesium.Cartesian3.fromDegreesArrayHeights(a),material:Cesium.Color.fromCssColorString(this._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),extrudedHeight:a[2]+this._core.defaultValue(o.extrudedHeight,200),height:a[2],outline:this._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(this._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}})),r},Yl.prototype._computeSwallowtailArrow=function(e){var t=e[0].x,i=e[0].y,o=e[1].x,r=e[1].y,n=(15.8*o+3.2*t)/19,a=(15.8*r+3.2*i)/19,e=new Array(7);return e[0]={x:o,y:r},e[1]={x:n+.265625*(r-a),y:a-.265625*(o-n)},e[2]={x:n+.078125*(r-a),y:a-.078125*(o-n)},e[3]={x:t+1.6/19*(r-i),y:i-1.6/19*(o-t)},e[4]={x:(3.2*o+15.8*t)/19,y:(3.2*r+15.8*i)/19},e[5]={x:t-1.6/19*(r-i),y:i+1.6/19*(o-t)},e[6]={x:n-.078125*(r-a),y:a+.078125*(o-n)},e[7]={x:n-.265625*(r-a),y:a+.265625*(o-n)},e},Yl.prototype.calculateMorePoints=function(e){if(2<e.length){for(var t,i,o=0,r=0;r<e.length-1;r++)t=e[r],i=e[r+1],o+=Math.sqrt((i.y-t.y)*(i.y-t.y)+(i.x-t.x)*(i.x-t.x));for(var n=o/6,a=[],s=[],l={x:void 0,y:void 0},u={x:void 0,y:void 0},c=0;c<e.length-2;c++){var h,m,d=e[c],p=e[c+1],g=e[c+2],_={x:p.x-d.x,y:p.y-d.y},f={x:g.x-p.x,y:g.y-p.y},y=this.calculateVector(_,Math.PI/2,n/2),v=y[0],C=y[1],g=this.calculateVector(f,Math.PI/2,n/2),y=g[0],g=g[1],v={x:d.x+v.x,y:d.y+v.y},C={x:d.x+C.x,y:d.y+C.y},y={x:p.x+y.x,y:p.y+y.y},g={x:p.x+g.x,y:p.y+g.y},y=this.calculateIntersection(_,f,v,y),g=this.calculateIntersection(_,f,C,g);m=0==c?(h={x:((l=v).x+y.x)/2,y:(l.y+y.y)/2},{x:((u=C).x+g.x)/2,y:(u.y+g.y)/2}):(C=a[a.length-1],m=s[s.length-1],h={x:(C.x+y.x)/2,y:(C.y+y.y)/2},{x:(m.x+g.x)/2,y:(m.y+g.y)/2}),a.push(h),s.push(m),a.push(y),s.push(g)}for(var w,b,T,S=e[e.length-2],P=e[e.length-1],E={x:P.x-S.x,y:P.y-S.y},x=Math.sqrt(E.x*E.x+E.y*E.y),I=[],D={x:void 0,y:void 0},L={x:void 0,y:void 0},M={x:void 0,y:void 0},A={x:void 0,y:void 0},R={x:void 0,y:void 0},O={x:void 0,y:void 0},H=a[a.length-1],V=s[s.length-1],O=x<=n?(D=(I=this.calculateVector(E,Math.PI/2,n/2))[0],L=I[1],b={x:S.x+D.x,y:S.y+D.y},T={x:S.x+L.x,y:S.y+L.y},M={x:(H.x+b.x)/2,y:(H.y+b.y)/2},A={x:(V.x+T.x)/2,y:(V.y+T.y)/2},a.push(M),s.push(A),R={x:2*b.x-S.x,y:2*b.y-S.y},{x:2*T.x-S.x,y:2*T.y-S.y}):(x=P.x-S.x,S=P.y-S.y,w=Math.sqrt(x*x+S*S),x=P.x-x*n/w,w=P.y-S*n/w,D=(I=this.calculateVector(E,Math.PI/2,n/2))[0],L=I[1],b={x:x+D.x,y:w+D.y},T={x:x+L.x,y:w+L.y},M={x:(H.x+b.x)/2,y:(H.y+b.y)/2},A={x:(V.x+T.x)/2,y:(V.y+T.y)/2},a.push(M),s.push(A),R={x:2*b.x-x,y:2*b.y-w},{x:2*T.x-x,y:2*T.y-w}),k=[],F=[],r=0;r<a.length-2;r++){var G=[],N=[],B=a[r],j=a[r+1],z=a[r+2],U=s[r],W=s[r+1],Y=s[r+2];G.push(B,j,z),N.push(U,W,Y);G=this._createBezierPoints(G),N=this._createBezierPoints(N),k=k.concat(G),F=F.concat(N)}(w=(w=[l]).concat(k)).push(b),w.push(R),w.push(P),w.push(O),w.push(T),(w=w.concat(F.reverse())).push(u)}else w=this.calculateTwoPoints(e);return w},Yl.prototype.calculateIntersection=function(e,t,i,o){var r,o=e.y*t.x-e.x*t.y==0?0<e.x*t.x||0<e.y*t.y?(r=(i.x+o.x)/2,(i.y+o.y)/2):(r=o.x,o.y):(r=(e.x*t.x*(o.y-i.y)+i.x*e.y*t.x-o.x*t.y*e.x)/(e.y*t.x-e.x*t.y),0!=e.x?(r-i.x)*e.y/e.x+i.y:(r-o.x)*t.y/t.x+o.y);return{x:r,y:o}},Yl.prototype.calculateTwoPoints=function(e){var t=e[0],i=e[1],o=[],r={x:i.x-t.x,y:i.y-t.y},n=Math.sqrt((i.x-t.x)*(i.x-t.x)+(i.y-t.y)*(i.y-t.y)),a=t.x+5*(i.x-t.x)/6,s=t.y+5*(i.y-t.y)/6,l=this.calculateVector(r,Math.PI/2,n/6/2),u=l[0],e=l[1],r={x:t.x+u.x,y:t.y+u.y},n={x:a+u.x,y:s+u.y},l={x:a+2*u.x,y:s+2*u.y},u={x:i.x,y:i.y},i={x:a+2*e.x,y:s+2*e.y},s={x:a+e.x,y:s+e.y},e={x:t.x+e.x,y:t.y+e.y};return o.push(r,n,l,u,i,s,e),o},Yl.prototype._computeRoundedRectanglePoints=function(e){for(var t=(e[0].x+e[1].x)/2,i=(e[0].y+e[1].y)/2,o=Math.abs(e[0].x-e[1].x),e=Math.abs(e[0].y-e[1].y),r=.1*Math.min(o,e),n=t-o/2+r,a=i-e/2+r,s=t+o/2-r,l=i-e/2+r,u=t+o/2-r,c=i+e/2-r,h=t-o/2+r,m=i+e/2-r,d=Math.PI/180,p=[],g=Math.PI,_=1.5*Math.PI,f=g,y=0;y<Math.abs(g-_);y+=d){var v=n+r*Math.cos(f),C=a+r*Math.sin(f),f=(f=(f+=d)<0?2*Math.PI+f:f)>2*Math.PI?2*Math.PI-f:f;p.push({x:v,y:C})}for(var w=p,b=3*Math.PI/2,T=2*Math.PI,S=b,y=0;y<Math.abs(b-T);y+=d){v=s+r*Math.cos(S),C=l+r*Math.sin(S),S=(S=(S+=d)<0?2*Math.PI+S:S)>2*Math.PI?2*Math.PI-S:S;w.push({x:v,y:C})}for(var P=w,E=.5*Math.PI,x=0,y=0;y<Math.abs(0-E);y+=d){v=u+r*Math.cos(x),C=c+r*Math.sin(x),x=(x=(x+=d)<0?2*Math.PI+x:x)>2*Math.PI?2*Math.PI-x:x;P.push({x:v,y:C})}for(var I=P,D=.5*Math.PI,L=Math.PI,M=D,y=0;y<Math.abs(D-L);y+=d){v=h+r*Math.cos(M),C=m+r*Math.sin(M),M=(M=(M+=d)<0?2*Math.PI+M:M)>2*Math.PI?2*Math.PI-M:M;I.push({x:v,y:C})}return I},Yl.prototype._computeSectorPoints=function(e){var t=this.calculateAngle(e[0],e[1]),i=this.calculateAngle(e[0],e[2]);i<t&&(i=2*Math.PI+i);for(var o=Math.PI/180,r=t,n=[e[0]],a=Math.sqrt((e[1].x-e[0].x)*(e[1].x-e[0].x)+(e[1].y-e[0].y)*(e[1].y-e[0].y)),s=0;s<Math.abs(t-i);s+=o){var l=e[0].x+a*Math.cos(r),u=e[0].y+a*Math.sin(r),r=(r=(r+=o)<0?2*Math.PI+r:r)>2*Math.PI?r-2*Math.PI:r;n.push({x:l,y:u})}return n},Yl.prototype.calculateAngle=function(e,t){e={x:t.x-e.x,y:t.y-e.y},e=Math.atan2(e.y,e.x);return e<0&&(e+=2*Math.PI),e},Yl.prototype._computeBowPoints=function(e){var t=2*(e[1].x-e[0].x),i=2*(e[1].y-e[0].y),o=e[1].x*e[1].x+e[1].y*e[1].y-e[0].x*e[0].x-e[0].y*e[0].y,r=2*(e[2].x-e[1].x),n=2*(e[2].y-e[1].y),a=e[2].x*e[2].x+e[2].y*e[2].y-e[1].x*e[1].x-e[1].y*e[1].y,s=(o*n-a*i)/(t*n-r*i),l=(t*a-r*o)/(t*n-r*i),i={x:s,y:l},u=Math.sqrt((e[0].x-s)*(e[0].x-s)+(e[0].y-l)*(e[0].y-l)),c=this.calculateAngle(i,e[0]),h=this.calculateAngle(i,e[1]),e=this.calculateAngle(i,e[2]),m=Math.PI/180,d=void 0,p=[];if(c<e&&e<h||h<e&&e<c){d=c<h?c:h;for(var g=0;g<Math.abs(c-h);g+=m){var _=s+u*Math.cos(d),f=l+u*Math.sin(d),d=(d=(d+=m)<0?2*Math.PI+d:d)>2*Math.PI?2*Math.PI-d:d;p.push({x:_,y:f})}}else{d=h<c?c:h;for(g=0;g<2*Math.PI-Math.abs(c-h);g+=m){_=s+u*Math.cos(d),f=l+u*Math.sin(d);d=(d=(d+=m)<0?2*Math.PI+d:d)>2*Math.PI?d-2*Math.PI:d,p.push({x:_,y:f})}}return p},Yl.prototype.Cdcl=function(e,t,i,o){var r=Math.PI;function n(e){return e*r/180}var a=n((e+i)/2),e=n((e-i)/2),i=n((t-o)/2),t=Math.sin(e),o=Math.sin(i),e=Math.sin(a),i=(t*=t)*(1-(o*=o))+(1-(e*=e))*o,a=(1-t)*(1-o)+e*o;return 2*(o=Math.atan(Math.sqrt(i/a)))*6378137*(1+1/298.257*((3*(o=Math.sqrt(i*a)/o)-1)/2/a*e*(1-t)-(3*o+1)/2/i*(1-e)*t))},Yl.prototype.createPoint=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},Yl.prototype.setEdit=function(e,t){void 0===e&&(e=!0),this.editOption=t=t||{},this.openEdit=e},Yl.prototype.openEditProp=function(e,i){var t=this;if((i=i||(this.editOption||{editPropData:{}}),!SmartEarthPopupData.editGraphic||!SmartEarthPopupData.editGraphic.entity)&&!this.startEdit(e))return;i.editPropData||(i.editPropData={}),this._popupmessage.createPopupProp("属性编辑",{width:i.editPropData.width||360,height:i.editPropData.height||"90%",url:"Workers/prop/jb_prop.html",shade:i.editPropData.shade,offset:i.editPropData.offset,type:e.polyline?"GroundPolyline":0<t.heightpoints.length?"ExtrudedPolygon":"GroundPolygon",fn:{success:function(e,t){i.editPropData.success&&i.editPropData.success(e,t),SmartEarthPopupData.layerIndex=t,SmartEarthPopupData.window=e.find("iframe")[0].contentWindow},end:function(){i.callBack&&i.callBack.end&&i.callBack.end(e),t.endThisEdit&&t.endThisEdit(),SmartEarthPopupData.layerIndex=void 0,SmartEarthPopupData.window=void 0}}})},Yl.prototype.startEdit=function(t){var i=this._viewer;if(-1!==this.MilitaryStandardObj.indexOf(t.id)){let e=t;t=e.pottingPoint;if(t){this.isEditting=!0;var o,r=t,n={x:0,y:0,z:0};for(o in r){var a=r[o];n.x+=a[0],n.y+=a[1],n.z+=a[2];var s,l,u=Cesium.Cartesian3.fromDegreesArrayHeights(a),c=i.entities.add({name:"polygon_point",position:u[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});c.pottingPoint=a,we.pointsId.push(c.id),this.objectsToExclude.push(c),e.polygon&&e.polygon.extrudedHeight&&(l=u.x?Cesium.Cartographic.fromCartesian(u):Cesium.Cartographic.fromCartesian(u[0]),s=Cesium.Math.toDegrees(l.longitude),u=Cesium.Math.toDegrees(l.latitude),l=e.polygon.extrudedHeight.getValue(),l=Cesium.Cartesian3.fromDegrees(s,u,l),(l=i.entities.add({name:"box_point",position:l,point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,heightReference:Cesium.HeightReference.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}})).pottingPoint=a,l.pointid=c.id,this.objectsToExclude.push(l),this.heightpoints.push(l),this.heightpointsId.push(l.id))}return n.x/=r.length,n.y/=r.length,n.z/=r.length,this.movePoint=i.entities.add({name:"move_point",position:Cesium.Cartesian3.fromDegrees(n.x,n.y,n.z),point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,heightReference:Cesium.HeightReference.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),SmartEarthPopupData.editGraphic={entity:e,graphic:e.polygon||e.polyline,heightpoints:this.heightpoints},!0}}},Yl.prototype.edit=function(e,i){var M=this,A=this._viewer;if(void 0!==(i=i||{}).editProp&&(this.editProp=i.editProp),this.editHandler){for(var t in this.editHandler.destroy(),this.editHandler=void 0,we.pointsId)this._viewer.entities.removeById(we.pointsId[t]);we.pointsId=[]}if(e=void 0===e?!0:e){var R=void 0;this.isEditting=!1;var O,H=void 0,V=void 0;for(t in this.editHandler=new Cesium.ScreenSpaceEventHandler(A.scene.canvas),this.editHandler.setInputAction(e=>{var t;Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?M.isEditting&&(M.endThisEdit(),M.defaultEvent(!1)):we.editVector||(t=e.position,(e=A.scene.pick(t))&&e.id instanceof Cesium.Entity?(t=e.id,M.isEditting||0!=we.states?"box_point"==t.name||"polygon_point"==t.name||"move_point"==t.name?(M.defaultEvent(!1),O="box_point"==t.name?(V=t.position.getValue(),e=Cesium.Cartographic.fromCartesian(V),V={lon:Cesium.Math.toDegrees(e.longitude),lat:Cesium.Math.toDegrees(e.latitude),height:e.height},"box_point"):"move_point"==t.name?"move_point":"polygon_point",H=t):R&&t.id===R.id||M.endThisEdit():this.startEdit(t)&&(R=t,this.editProp&&this.openEditProp(R,i))):M.endThisEdit())},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))M.isEditting&&(M.endThisEdit(),M.defaultEvent(!1));else if(!we.editVector){var t=A.scene.pick(e.endPosition);if(Cesium.defined(t))if(M.isEditting&&!H){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))return void(M.isEditting&&(M.endThisEdit(),M.defaultEvent(!1)));!t.id||"move_point"!==t.id.name&&"polygon_point"!==t.id.name?t.id&&"box_point"===t.id.name?M.tooltip.showAt(e.endPosition,"拖拽修改高度"):t.id==R&&M.tooltip.show(!1):M.tooltip.showAt(e.endPosition,"拖拽修改位置")}else M.isEditting||0!==we.states||(t.id&&-1<M.MilitaryStandardObj.indexOf(t.id.id)?M.tooltip.showAt(e.endPosition,"点击激活编辑,右键删除"):M.tooltip.show(!1));else 0!=we.states||H||M.tooltip.show(!1);if(M.isEditting&&H){M.tooltip.showAt(e.endPosition,"释放后完成修改");var i=e.startPosition;if(y=(t=A.camera.getPickRay(i))?A.scene.globe.pick(t,A.scene):y){var o=void 0;if("polygon_point"==O){for(var r in H.position=y,we.pointsId)if(we.pointsId[r]==H.id){var n=A.entities.getById(M.heightpointsId[r]);if(!n)break;var a=Cesium.Cartographic.fromCartesian(y),s=Cesium.Math.toDegrees(a.longitude),l=Cesium.Math.toDegrees(a.latitude),u=Cesium.Cartographic.fromCartesian(n.position._value),c=a.height+u.height;n.position=Cesium.Cartesian3.fromDegrees(s,l,c)}var h=[],m=[],d=new Cesium.Cartesian3;for(r in we.pointsId){var p=A.entities.getById(we.pointsId[r]).position._value,g=Cesium.Cartographic.fromCartesian(p),g={x:Cesium.Math.toDegrees(g.longitude),y:Cesium.Math.toDegrees(g.latitude),z:g.height};h.push(g),m.push([g.x,g.y,g.z]),d.x+=p.x,d.y+=p.y,d.z+=p.z}if(d.x/=h.length,d.y/=h.length,d.z/=h.length,M.movePoint&&(M.movePoint.position=d),"StraightArrow"==R.GeoType)D=M.calculateMorePoints(h);else if("RoundedRectangle"==R.GeoType)D=M._computeRoundedRectanglePoints(h);else if("Sector"==R.GeoType)D=M._computeSectorPoints(h);else if("Bow"==R.GeoType)D=M._computeBowPoints(h);else if("GatheringPlace"==R.GeoType){i=M._computeGatheringPlacePoints(h),i=M.createCloseCardinal(i);D=M.calculatePointsFBZ3(i,100)}else if("SwallowtailArrow"==R.GeoType)D=M._computeSwallowtailArrow(h);else if("Bezierline"==R.GeoType)D=M._createBezierPoints(h);else if("BezierArrow"==R.GeoType)D=M._createBezierPoints(h);else if("PincerArrow"==R.GeoType){var _=po.algorithm.doubleArrow(m);let e=[];-1==JSON.stringify(_.polygonalPoint).indexOf("null")&&(e=_.polygonalPoint),D=e}else if("AttackArrow"==R.GeoType){_=po.algorithm.tailedAttackArrow(m);let e=[];-1==JSON.stringify(_.polygonalPoint).indexOf("null")&&(e=_.polygonalPoint),D=e}let t;t="AttackArrow"!==R.GeoType&&"PincerArrow"!==R.GeoType?(t=[],D.forEach(e=>{t.push(e.x,e.y,h[0].z)}),Cesium.Cartesian3.fromDegreesArrayHeights(t)):D,R.pottingPoint=m,0<=R.GeoType.indexOf("Bezier")?R.polyline.positions=new Cesium.CallbackProperty(function(){return t},!1):R.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)}else if("box_point"==O){var f,t=A.camera.getPickRay(e.endPosition),y=A.scene.globe.pick(t,A.scene),v=Cesium.Cartographic.fromCartesian(y),C=Cesium.Math.toDegrees(v.longitude),w=Cesium.Math.toDegrees(v.latitude),b=V.lon,T=V.lat,o=c=M.Cdcl(w,C,T,b);for(f in M.heightpointsId){var S=A.entities.getById(M.heightpointsId[f]),P=S.position._value,E=Cesium.Cartographic.fromCartesian(P),P=Cesium.Math.toDegrees(E.longitude),E=Cesium.Math.toDegrees(E.latitude),E=Cesium.Cartesian3.fromDegrees(P,E,o);S.position=E}R.polygon.extrudedHeight=new Cesium.CallbackProperty(function(){return o},!1),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]').value=parseInt(o))}else{v=Cesium.Cartographic.fromCartesian(y),C=Cesium.Math.toDegrees(v.longitude),w=Cesium.Math.toDegrees(v.latitude);V=H.position.getValue();var v=Cesium.Cartographic.fromCartesian(V),x=C-(b=(V={lon:Cesium.Math.toDegrees(v.longitude),lat:Cesium.Math.toDegrees(v.latitude),height:v.height}).lon),I=w-(T=V.lat);H.position=y;var D,h=[],m=[];for(r in we.pointsId){let e,t,i=A.entities.getById(we.pointsId[r]);i&&(e=i.position.getValue(),t=Cesium.Cartographic.fromCartesian(e),e={lon:Cesium.Math.toDegrees(t.longitude),lat:Cesium.Math.toDegrees(t.latitude),height:t.height},i.position=Cesium.Cartesian3.fromDegrees(e.lon+x,e.lat+I,e.height),h.push({x:e.lon+x,y:e.lat+I,z:e.height}),m.push([e.lon+x,e.lat+I,e.height]));let o=A.entities.getById(M.heightpointsId[r]);o&&(e=o.position.getValue(),t=Cesium.Cartographic.fromCartesian(e),e={lon:Cesium.Math.toDegrees(t.longitude),lat:Cesium.Math.toDegrees(t.latitude),height:t.height},o.position=Cesium.Cartesian3.fromDegrees(e.lon+x,e.lat+I,e.height))}if("StraightArrow"==R.GeoType)D=M.calculateMorePoints(h);else if("RoundedRectangle"==R.GeoType)D=M._computeRoundedRectanglePoints(h);else if("Sector"==R.GeoType)D=M._computeSectorPoints(h);else if("Bow"==R.GeoType)D=M._computeBowPoints(h);else if("GatheringPlace"==R.GeoType){T=M._computeGatheringPlacePoints(h),T=M.createCloseCardinal(T);D=M.calculatePointsFBZ3(T,100)}else if("SwallowtailArrow"==R.GeoType)D=M._computeSwallowtailArrow(h);else if("Bezierline"==R.GeoType)D=M._createBezierPoints(h);else if("BezierArrow"==R.GeoType)D=M._createBezierPoints(h);else if("PincerArrow"==R.GeoType){var L=po.algorithm.doubleArrow(m);let e=[];-1==JSON.stringify(L.polygonalPoint).indexOf("null")&&(e=L.polygonalPoint),D=e}else if("AttackArrow"==R.GeoType){L=po.algorithm.tailedAttackArrow(m);let e=[];-1==JSON.stringify(L.polygonalPoint).indexOf("null")&&(e=L.polygonalPoint),D=e}let t;t="AttackArrow"!==R.GeoType&&"PincerArrow"!==R.GeoType?(t=[],D.forEach(e=>{t.push(e.x,e.y,h[0].z)}),Cesium.Cartesian3.fromDegreesArrayHeights(t)):D,R.pottingPoint=m,0<=R.GeoType.indexOf("Bezier")?R.polyline.positions=new Cesium.CallbackProperty(function(){return t},!1):R.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)}}}}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(function(e){Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?M.isEditting&&(M.endThisEdit(),M.defaultEvent(!1)):we.editVector||(H=void 0,M.defaultEvent(!0))},Cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(function(e){var t,i;Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?M.isEditting&&(M.endThisEdit(),M.defaultEvent(!1)):we.editVector||(t=A.scene.pick(e.position),Cesium.defined(t)&&0==we.states&&(i=t.id,-1!==M.MilitaryStandardObj.indexOf(i.id)&&M.delButton(!0,e.position,function(){A.entities.removeById(i.id);var e=M.MilitaryStandardObj.indexOf(i.id);M.MilitaryStandardObj.splice(e,1),M.delButton(!1),M.tooltip.show(!1),M.endThisEdit(),!M.MilitaryStandardObj.length&&M.editHandler&&M.edit(!1)})))},Cesium.ScreenSpaceEventType.RIGHT_DOWN),M.defaultEvent(!0),we.pointsId)A.entities.removeById(we.pointsId[t]);for(t in M.heightpointsId)A.entities.removeById(M.heightpointsId[t]);M.heightpointsId=[],M.heightpoints=[],we.pointsId=[],this.endThisEdit=()=>{for(var e in M.defaultEvent(!0),we.pointsId)A.entities.removeById(we.pointsId[e]);for(var e in M.heightpointsId)A.entities.removeById(M.heightpointsId[e]);M.movePoint&&A.entities.remove(M.movePoint),M.movePoint=void 0,R=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={},M.isEditting=!1,we.pointsId=[],M.heightpointsId=[],M.heightpoints=[],M.delButton(!1)}}},Yl.prototype.spArray=function(e,t){for(var i=[],o=0;o<t.length;)i.push(t.slice(o,o+=e));return i},Yl.prototype.delButton=function(e,t,i){if(e){let e=document.getElementById("DeleteMilitaryStandardDelete");e||(e=document.createElement("button"),e.id="DeleteMilitaryStandardDelete",e.innerText="删除对象",e.style.cssText=`height: 38px;
                                    line-height: 38px;
                                    padding: 0 18px;
                                    background-color: #052355;
                                    color: #fff;
                                    white-space: nowrap;
                                    text-align: center;
                                    font-size: 14px;
                                    border: none;
                                    border-radius: 2px;
                                    cursor: pointer;
                                    position: absolute;`,this._viewer.container.appendChild(e)),e.style.display="block",e.style.top=t.y+"px",e.style.left=t.x+"px",e.onclick=i}else{let e=document.getElementById("DeleteMilitaryStandardDelete");e&&(e.style.display="none",e.onclick=null)}},Yl.prototype.defaultEvent=function(e){var t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},ql.prototype.createKmlLayer=function(e,t,r){var i={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas},n=t;this._cesium.HeightReference.CLAMP_TO_GROUND;var a={show:!0,position:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,eyeOffset:this._cesium.Cartesian3.ZERO,heightReference:this._cesium.HeightReference.NONE,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,scale:1,image:n,imageSubRegion:void 0,color:this._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0},s=this;this._cesium.KmlDataSource.load(e,i).then(function(e){if(e.entities,"model"==r)for(var t=0;t<e.entities.values.length;t++){var i=e.entities.values[t];s._viewer.entities.add({name:"",position:i.position,model:{uri:n,heightReference:s._cesium.HeightReference.CLAMP_TO_GROUND,minimumPixelSize:128,maximumScale:20,scale:1,runAnimations:!1}})}else if("billboard"==r){for(var o=s._core.extend(a,option,!0),t=0;t<e.entities.values.length;t++){i=e.entities.values[t];o.position=i.position._value,billboardCollections.add(o)}s._viewer.scene.primitives.add(billboardCollections)}})},ql.prototype.addKmlLayer=function(e,t,i,o){var r={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas},n=this;let a=t,s;a.id&&(s=a.id,a=a.url);r=this._cesium.KmlDataSource.load(a,r);this._viewer.dataSources.add(r),r.then(function(e){n.item=e,i||n.setVisibility(!1),o&&"function"==typeof o&&o(e)});e={id:s||this._core.getuid(),name:e,pId:0,type:"KML",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},ql.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},ql.prototype.deleteObject=function(){this._viewer.dataSources.remove(this.item)},ql.prototype.setTreeobj=function(e){this.treeobj=e},ql.prototype.setVisibility=function(e){null!=this.item&&(this.item.show=e)},Ql.prototype.createModifyMesh=function(e,t,i,o,r){var n=t.length,a=new Array(n);a.fill(i);var s=o.id||Cesium.createGuid(),n=Date.now(),i=Cesium.Rectangle.fromCartesianArray(t);void 0===o.modifyMeshObject&&(o.modifyMeshObject=[]);t={id:s,show:!0,name:e,rectangle:i,vertices:t,polygon:t,heights:a,meshObject:o,timeStamp:n,polygonGeometry:new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t)}),image:this.createTexture(t),texture:null};return o.modifyMeshObject=t,this.item=o,this},Ql.prototype.createTexture=function(e){var t=Cesium.Rectangle.fromCartesianArray(e),i=180*t.west/Math.PI,o=180*t.south/Math.PI,r=180*t.east/Math.PI,t=180*t.north/Math.PI,n=new Cesium.Rectangle(i,o,r,t),a=[],s=this;e.forEach(function(e){e=e.longitude?e:Cesium.Ellipsoid.WGS84.cartesianToCartographic(e),e=s.getPointRelativePosition(e,n,s.texturePixel,s.texturePixel);a.push([e.normalizedLongitude,e.normalizedLatitude])});t=this.createCanvas(a,"#FF0000",s.texturePixel,s.texturePixel),e=new Image;return e.width=s.texturePixel,e.height=s.texturePixel,e.src=t.toDataURL("image/png"),e},Ql.prototype.getPointRelativePosition=function(e,t,i,o){var r=t.east-t.west,n=t.north-t.south,a=180*e.longitude/Math.PI,s=180*e.latitude/Math.PI;return e.normalizedLongitude=(a-t.west)/r*i,e.normalizedLatitude=(s-t.south)/n*o,e},Ql.prototype.createCanvas=function(e,t,i,o){var r=document.createElement("canvas");r.width=i,r.height=o;var n=r.getContext("2d");if(n.fillStyle="#000",n.fillRect(0,0,i,i),!(e.length<=0)){n.moveTo(e[0][0],e[0][1]);for(var a=0;a<e.length;a++)n.lineTo(e[a][0],e[a][1]);return n.fillStyle=t,n.fill(),r}},Ql.prototype.remove=function(){this.item.modifyMeshObject=void 0},Jl.prototype.addClipping=function(r,n={}){if(this.remove(),"polygon"===n.type){let e=n.positions,t=[];e.forEach(e=>{t.push(this._core.toDegrees(e))}),t.push(t[0]);let i;i=n.isInner?this.isClockWise(t):!this.isClockWise(t),i&&t.reverse();let o=[];var a=this.getInverseTransform(r);for(let e=0;e<t.length-1;e++){var s=this.createPlane(t[e],t[e+1],a);o.push(s)}r.clippingPlanes=new Cesium.ClippingPlaneCollection({planes:o,unionClippingRegions:!n.isInner})}return this.item=r,this},Jl.prototype.getInverseTransform=function(e){let t,i=e.root.transform;return t=i&&i.equals(Cesium.Matrix4.IDENTITY)||!i?Cesium.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center):Cesium.Matrix4.fromArray(e.root.transform),Cesium.Matrix4.inverseTransformation(t,new Cesium.Matrix4)},Jl.prototype.getOriginCoordinateSystemPoint=function(e,t){e=Cesium.Cartesian3.fromDegrees(e.lon,e.lat);return Cesium.Matrix4.multiplyByPoint(t,e,new Cesium.Cartesian3(0,0,0))},Jl.prototype.createPlane=function(e,t,i){e=this.getOriginCoordinateSystemPoint(e,i),t=this.getOriginCoordinateSystemPoint(t,i),i=new Cesium.Cartesian3(0,0,1),t=Cesium.Cartesian3.subtract(t,e,new Cesium.Cartesian3),i=Cesium.Cartesian3.cross(t,i,new Cesium.Cartesian3),i=Cesium.Cartesian3.normalize(i,i),i=Cesium.Plane.fromPointNormal(e,i);return Cesium.ClippingPlane.fromPlane(i)},Jl.prototype.isClockWise=function(t){if(t.length<3)return null;t[0]===t[t.length-1]&&(t=t.slice(0,t.length-1));let i={i:-1,val:90};for(let e=0;e<t.length;e++){var o=t[e]["lat"];o<i.val&&(i.val=o,i.i=e)}var e=(i.i+t.length-1)%t.length,r=i.i,n=(i.i+1)%t.length;let a=t[r].lat-t[e].lat,s=t[r].lon-t[e].lon,l=t[n].lat-t[r].lat,u=t[n].lon-t[r].lon;r=u*a-s*l;return 0==r?t[n].lon<t[e].lon:0<r},Jl.prototype.remove=function(){this.item&&this.item.clippingPlanes&&this.item.clippingPlanes.removeAll(),this.item&&(this.item.clippingPlanes=void 0)},Xl.prototype.addCZML=function(e,t,i){var o=this;t=t||{};var r=new this._cesium.CzmlDataSource;this._viewer.dataSources.add(r),this.item=r,this._option=t,this.item.process(e).then(function(e){o.Pretreatment(e,t),i&&"function"==typeof i&&i(e)});e={id:this._core.getuid(),name:"新建CZML",pId:0,type:"CZML",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},Xl.prototype.process=function(e,t){let i=this;this.item&&this.item.process(e).then(function(e){i.Pretreatment(e,i._option),t&&"function"==typeof t&&t(e)})},Xl.prototype.Pretreatment=function(e,t){let o=this,i=e.entities.values;i.forEach(i=>{var e;0===i.id.indexOf("Link_")?i.polyline.material=o._core.getLinkMaterial(t.linkColor,t.linkPointColor,t.linkTime):0===i.id.indexOf("ConeRadar_")?i.cylinder.material=o._core.getConeRadarMaterial(t.coneRadarColor):0===i.id.indexOf("MultiCircleScan_")?i.ellipse.material=o._core.getMultiCircleScanMaterial(t.multiCircleColor,t.multiCircleTime):0===i.id.indexOf("SectorScan_")?(e=o._core.defaultValue(t.sectorScanAngle,45),i.ellipse.material=o._core.getSectorScanMaterial(t.sectorScanColor,e),i.ellipse.stRotation=new o._cesium.CallbackProperty(function(e,t){t=i.orientation.getValue(e,t);return o._cesium.HeadingPitchRoll.fromQuaternion(t).heading-Math.PI/2},!1)):0===i.id.indexOf("CircleScan_")?i.ellipse.material=o._core.getCircleScanMaterial(t.circleScanColor,t.circleScanTime):0===i.id.indexOf("RadarScan_")&&(i.ellipse.material=o._core.getRadarScanMaterial(t.radarScanColor,t.radarScanTime))})},Xl.prototype.deleteObject=function(){this._viewer.dataSources.remove(this.item)},Xl.prototype.setTreeobj=function(e){this.treeobj=e},Xl.prototype.setVisibility=function(e){null!=this.item&&(this.item.show=e)},Kl.prototype.addHeatMap=function(e,t={}){"HeatmapGL"===t.type?this.item=new co(this._viewer,t):this.item=new ho(this._viewer,t),t.sourceData&&this.item.create(t.sourceData);e={id:this._core.getuid(),name:e,pId:0,type:"Heatmap",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},Kl.prototype.setData=function(e){this.item&&this.item.setData(e)},Kl.prototype.flyToBounding=function(){this.item&&this.item.flyToBounding()},Kl.prototype.deleteObject=function(){this.item&&this.item.destroy()},Kl.prototype.setTreeobj=function(e){this.treeobj=e},Kl.prototype.setVisibility=function(e){null!=this.item&&this.item.show(e)},$l.prototype.createSatelliteTrail=function(t){t=t||{};let e=this._viewer,i=new Cesium.JulianDate.fromDate(new Date),o=Cesium.JulianDate.addSeconds(i,3600,new Cesium.JulianDate);e.clock.startTime=t.start||i.clone(),e.clock.stopTime=t.stop||o.clone(),e.clock.currentTime=t.start||i.clone(),e.clock.clockRange=Cesium.ClockRange.LOOP_STOP,e.clock.multiplier=t.speed||2,this.flyHeight=t.height||7e5;let r=[];return t.path?r=t.path:this.getRandState(r,2),r.forEach(e=>{this.getStatePath(e,t)}),this},$l.prototype.getStatePath=function(e,t){let i=this._viewer;var o=i.clock.startTime.clone(),r=i.clock.stopTime.clone(),n=this.computeCirclularFlight(e,2);let a=i.entities.add({availability:new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({start:o,stop:r})]),position:n,orientation:new Cesium.VelocityOrientationProperty(n),cylinder:{HeightReference:Cesium.HeightReference.CLAMP_TO_GROUND,length:this.flyHeight,topRadius:0,bottomRadius:this.flyHeight/2,material:this._core.getConeRadarMaterial(t.radarColor||"#00ff00"),outline:!1,numberOfVerticalLines:0}});a.position.setInterpolationOptions({interpolationDegree:5,interpolationAlgorithm:Cesium.LagrangePolynomialApproximation}),this.TrailEntitys.push(a);e=this.computeCirclularFlight(e,1);let s={availability:new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({start:o,stop:r})]),position:e,orientation:new Cesium.VelocityOrientationProperty(e),path:{resolution:1,material:new Cesium.PolylineGlowMaterialProperty({color:Cesium.Color.DEEPSKYBLUE}),width:t.width||5}};t.img?"object"==typeof t.img?s.billboard=t.img:"string"==typeof t.img&&(s.billboard={image:t.img,scale:t.scale}):s.model={uri:t.model||window.SmartEarthRootUrl+D.flyModel,minimumPixelSize:32,scale:t.scale};let l=i.entities.add(s);l.position.setInterpolationOptions({interpolationDegree:5,interpolationAlgorithm:Cesium.LagrangePolynomialApproximation}),this.TrailEntitys.push(l)},$l.prototype.clear=function(){this.TrailEntitys.forEach(e=>{this._viewer.entities.remove(e)}),this.TrailEntitys=[]},$l.prototype.faster=function(){this._viewer.animation.viewModel.faster()},$l.prototype.slower=function(){this._viewer.animation.viewModel.slower()},$l.prototype.setSpeed=function(e){this._viewer.clock.multiplier=parseFloat(e)},$l.prototype.isPause=function(e){this._viewer.clockViewModel.shouldAnimate=!e},$l.prototype.computeCirclularFlight=function(t,e){var i=this._viewer.clock.startTime.clone();let o=new Cesium.SampledPositionProperty;if(1==e)for(let e=0;e<t.length;e++){var r=Cesium.JulianDate.addSeconds(i,t[e].time,new Cesium.JulianDate),n=Cesium.Cartesian3.fromDegrees(t[e].lon,t[e].lat,t[e].hei);o.addSample(r,n)}else if(2==e)for(let e=0;e<t.length;e++){var a=Cesium.JulianDate.addSeconds(i,t[e].time,new Cesium.JulianDate),s=Cesium.Cartesian3.fromDegrees(t[e].lon,t[e].lat,t[e].phei);o.addSample(a,s)}return o},$l.prototype.getRandState=function(t,i){var o=this.flyHeight;for(let e=0;e<i;e++){let i=[];var r=Math.floor(180*Math.random());for(let t=0;t<=360;t+=30){let e=new Zl(o);t<=180?(e.lon=r,e.lat=t-90):(e.lon=r-180,e.lat=270-t),e.time=10*t,i.push(e)}t.push(i)}for(let e=0;e<i;e++){let i=[];var n=Math.floor(180*Math.random())-90;for(let t=-180;t<=180;t+=30){let e=new Zl(o);e.lon=t,e.lat=n,e.time=10*(t+180),i.push(e)}t.push(i)}},eu.prototype.createViewCone=function(s,l){s=s||{},s=this._core.extend({roll:0,fov:60,near:1,fillColor:"rgba(0,255,0,0.1)",outlineColor:"rgba(0,255,0,1)"},s,!0),this._option=s,this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+D.draw);let u=this,c=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(c.scene.canvas),we.states=1;let h=[];return this.drawHandler.setInputAction(e=>{var t,i,o,r,n,a=u._getPosition.getMousePosition(e);a&&(0===h.length?h.push(a,a):(u.drawHandler.destroy(),u.drawHandler=void 0,u.tooltip.show(!1),setTimeout(function(){we.states=0},100),u._core.mouse(u._viewer.container,0,"0"),l&&"function"==typeof l&&l(u.item)),u.item||(u.viewConeCamera=new Cesium.Camera(c.scene),t=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(h[1],h[0],new Cesium.Cartesian3),new Cesium.Cartesian3),u.viewConeCamera.position=h[0],u.viewConeCamera.direction=t,u.viewConeCamera.frustum.fov=Cesium.Math.toRadians(s.fov),u.viewConeCamera.frustum.near=s.near,u.viewConeCamera.frustum.far=1,i=new Cesium.Cartesian3,r=new Cesium.Matrix3,n=new Cesium.Quaternion,o=u.viewConeCamera.positionWC,e=u.viewConeCamera.upWC,a=u.viewConeCamera.rightWC,a=Cesium.Cartesian3.negate(a,i),r=r,Cesium.Matrix3.setColumn(r,0,a,r),Cesium.Matrix3.setColumn(r,1,e,r),Cesium.Matrix3.setColumn(r,2,t,r),n=Cesium.Quaternion.fromRotationMatrix(r,n),s.fill&&(u._planesPrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumGeometry({origin:o,orientation:n,frustum:u.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(s.fillColor))},id:s.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1,allowPicking:!1})),u._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({origin:o,orientation:n,frustum:u.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(s.outlineColor))},id:s.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),u.item=new Cesium.PrimitiveCollection,u._viewer.scene.primitives.add(u.item),u._outlinePrimitive&&u.item.add(u._outlinePrimitive),u._planesPrimitive&&u.item.add(u._planesPrimitive)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0<h.length?(u.tooltip.showAt(e.endPosition,"再次点击结束绘制"),(t=u._getPosition.getMousePosition(e))&&(h[1]=t,u.viewConeCamera.direction=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(h[1],h[0],new Cesium.Cartesian3),new Cesium.Cartesian3),u.updata({heading:Cesium.Math.toDegrees(u.viewConeCamera.heading),pitch:Cesium.Math.toDegrees(u.viewConeCamera.pitch),far:u._core.getSpaceDistancem(h,Cesium)}))):u.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},eu.prototype.addViewCone=function(e){var t={position:this._viewer.camera.position.clone(),heading:0,pitch:0,roll:0,fov:60,near:1,far:60,fillColor:"rgba(0,255,0,0.1)",outlineColor:"rgba(0,255,0,1)"};(e=e||{}).position&&e.position.lon&&(e.position=Cesium.Cartesian3.fromDegrees(e.position.lon,e.position.lat,e.position.height)),e=this._core.extend(t,e,!0),this.viewConeCamera=new Cesium.Camera(this._viewer.scene),this.viewConeCamera.setView({destination:e.position,orientation:{heading:Cesium.Math.toRadians(e.heading),pitch:Cesium.Math.toRadians(e.pitch),roll:Cesium.Math.toRadians(e.roll)}}),this.viewConeCamera.frustum.fov=Cesium.Math.toRadians(e.fov),this.viewConeCamera.frustum.near=e.near,this.viewConeCamera.frustum.far=e.far;var i=new Cesium.Cartesian3,o=new Cesium.Matrix3,r=new Cesium.Quaternion,n=this.viewConeCamera.positionWC,a=this.viewConeCamera.directionWC,s=this.viewConeCamera.upWC,t=this.viewConeCamera.rightWC,t=Cesium.Cartesian3.negate(t,i),o=o;Cesium.Matrix3.setColumn(o,0,t,o),Cesium.Matrix3.setColumn(o,1,s,o),Cesium.Matrix3.setColumn(o,2,a,o);r=Cesium.Quaternion.fromRotationMatrix(o,r);return e.fill&&(this._planesPrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumGeometry({origin:n,orientation:r,frustum:this.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.fillColor))},id:e.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1,allowPicking:!1})),this._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({origin:n,orientation:r,frustum:this.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.outlineColor))},id:e.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),this._option=e,this.item=new Cesium.PrimitiveCollection,this._viewer.scene.primitives.add(this.item),this._outlinePrimitive&&this.item.add(this._outlinePrimitive),this._planesPrimitive&&this.item.add(this._planesPrimitive),this},eu.prototype.updata=function(e){(e=e||{}).position&&e.position.lon&&(e.position=Cesium.Cartesian3.fromDegrees(e.position.lon,e.position.lat,e.position.height)),e=this._core.extend(this._option,e,!0),this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive&&this._planesPrimitive.destroy(),this.item.removeAll(),this.viewConeCamera.setView({destination:e.position,orientation:{heading:Cesium.Math.toRadians(e.heading),pitch:Cesium.Math.toRadians(e.pitch),roll:Cesium.Math.toRadians(e.roll)}}),this.viewConeCamera.frustum.fov=Cesium.Math.toRadians(e.fov),this.viewConeCamera.frustum.near=e.near,this.viewConeCamera.frustum.far=e.far;var t=new Cesium.Cartesian3,i=new Cesium.Matrix3,o=new Cesium.Quaternion,r=this.viewConeCamera.positionWC,n=this.viewConeCamera.directionWC,a=this.viewConeCamera.upWC,s=this.viewConeCamera.rightWC,s=Cesium.Cartesian3.negate(s,t),i=i;Cesium.Matrix3.setColumn(i,0,s,i),Cesium.Matrix3.setColumn(i,1,a,i),Cesium.Matrix3.setColumn(i,2,n,i);o=Cesium.Quaternion.fromRotationMatrix(i,o);e.fill&&(this._planesPrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumGeometry({origin:r,orientation:o,frustum:this.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.fillColor))},id:e.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1,allowPicking:!1})),this._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({origin:r,orientation:o,frustum:this.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.outlineColor))},id:e.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),this._option=e,this.item.add(this._outlinePrimitive),this._planesPrimitive&&this.item.add(this._planesPrimitive)},eu.prototype.destroy=function(){return this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive&&this._planesPrimitive.destroy(),this.item&&this._viewer.scene.primitives.removeAndDestroy(this.item),Cesium.destroyObject(this)};var tu=Object.freeze({UNLOADED:0,LOADING:1,PARSING:2,READY:3,FAILED:4}),Q=Object.freeze({LUMINANCE_8:1,LUMINANCE_16:2,ALPHA:3,ALPHA_4_LUMINANCE_4:4,LUMINANCE_ALPHA:5,RGB_565:6,BGR565:7,RGB:10,BGR:11,ARGB:12,ABGR:13,BGRA:14,WEBP:25,RGBA:28,DXT1:17,DXT2:18,DXT3:19,DXT4:20,DXT5:21}),U=Object.freeze({encNONE:0,enrS3TCDXTN:14,enrPVRTPF_PVRTC2:19,enrPVRTPF_PVRTC:20,enrPVRTPF_PVRTC_4bpp:21,enrPVRTPF_ETC1:22}),iu=Object.freeze({SVC_Vertex:1,SVC_Normal:2,SVC_VertexColor:4,SVC_SecondColor:8,SVC_TexutreCoord:16,SVC_TexutreCoordIsW:32}),ou=function o(r,n,a){function s(i,e){if(!n[i]){if(!r[i]){var t="function"==typeof require&&require;if(!e&&t)return t(i,!0);if(l)return l(i,!0);t=new Error("Cannot find module '"+i+"'");throw t.code="MODULE_NOT_FOUND",t}t=n[i]={exports:{}};r[i][0].call(t.exports,function(e){var t=r[i][1][e];return s(t||e)},t,t.exports,o,r,n,a)}return n[i].exports}for(var l="function"==typeof require&&require,e=0;e<a.length;e++)s(a[e]);return s}({1:[function(e,t,i){var o="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var o in i)i.hasOwnProperty(o)&&(e[o]=i[o])}}return e},i.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,i,o,r){if(t.subarray&&e.subarray)e.set(t.subarray(i,i+o),r);else for(var n=0;n<o;n++)e[r+n]=t[i+n]},flattenChunks:function(e){for(var t,i,o,r=0,n=0,a=e.length;n<a;n++)r+=e[n].length;for(o=new Uint8Array(r),n=t=0,a=e.length;n<a;n++)i=e[n],o.set(i,t),t+=i.length;return o}},n={arraySet:function(e,t,i,o,r){for(var n=0;n<o;n++)e[r+n]=t[i+n]},flattenChunks:function(e){return[].concat.apply([],e)}};i.setTyped=function(e){e?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,r)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,n))},i.setTyped(o)},{}],2:[function(e,t,i){var l=e("./common"),r=!0,n=!0;try{String.fromCharCode.apply(null,[0])}catch(e){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){n=!1}for(var u=new l.Buf8(256),o=0;o<256;o++)u[o]=252<=o?6:248<=o?5:240<=o?4:224<=o?3:192<=o?2:1;function c(e,t){if(t<65537&&(e.subarray&&n||!e.subarray&&r))return String.fromCharCode.apply(null,l.shrinkBuf(e,t));for(var i="",o=0;o<t;o++)i+=String.fromCharCode(e[o]);return i}u[254]=u[254]=1,i.string2buf=function(e){for(var t,i,o,r,n=e.length,a=0,s=0;s<n;s++)55296==(64512&(i=e.charCodeAt(s)))&&s+1<n&&56320==(64512&(o=e.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(o-56320),s++),a+=i<128?1:i<2048?2:i<65536?3:4;for(t=new l.Buf8(a),s=r=0;r<a;s++)55296==(64512&(i=e.charCodeAt(s)))&&s+1<n&&56320==(64512&(o=e.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(o-56320),s++),i<128?t[r++]=i:(i<2048?t[r++]=192|i>>>6:(i<65536?t[r++]=224|i>>>12:(t[r++]=240|i>>>18,t[r++]=128|i>>>12&63),t[r++]=128|i>>>6&63),t[r++]=128|63&i);return t},i.buf2binstring=function(e){return c(e,e.length)},i.binstring2buf=function(e){for(var t=new l.Buf8(e.length),i=0,o=t.length;i<o;i++)t[i]=e.charCodeAt(i);return t},i.buf2string=function(e,t){for(var i,o,r=t||e.length,n=new Array(2*r),a=0,s=0;s<r;)if((i=e[s++])<128)n[a++]=i;else if(4<(o=u[i]))n[a++]=65533,s+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&s<r;)i=i<<6|63&e[s++],o--;1<o?n[a++]=65533:i<65536?n[a++]=i:(i-=65536,n[a++]=55296|i>>10&1023,n[a++]=56320|1023&i)}return c(n,a)},i.utf8border=function(e,t){for(var i=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=i&&128==(192&e[i]);)i--;return!(i<0)&&0!==i&&i+u[e[i]]>t?i:t}},{"./common":1}],3:[function(e,t,i){t.exports=function(e,t,i,o){for(var r=65535&e|0,n=e>>>16&65535|0,a=0;0!==i;){for(i-=a=2e3<i?2e3:i;n=n+(r=r+t[o++]|0)|0,--a;);r%=65521,n%=65521}return r|n<<16|0}},{}],4:[function(e,t,i){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,i){var s=function(){for(var e=[],t=0;t<256;t++){for(var i=t,o=0;o<8;o++)i=1&i?3988292384^i>>>1:i>>>1;e[t]=i}return e}();t.exports=function(e,t,i,o){var r=s,n=o+i;e^=-1;for(var a=o;a<n;a++)e=e>>>8^r[255&(e^t[a])];return-1^e}},{}],6:[function(e,t,i){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,i){t.exports=function(e,t){var i,o,r,n,a,s,l=e.state,u=e.next_in,c=e.input,h=u+(e.avail_in-5),m=e.next_out,d=e.output,p=m-(t-e.avail_out),g=m+(e.avail_out-257),_=l.dmax,f=l.wsize,y=l.whave,v=l.wnext,C=l.window,w=l.hold,b=l.bits,T=l.lencode,S=l.distcode,P=(1<<l.lenbits)-1,E=(1<<l.distbits)-1;e:do{b<15&&(w+=c[u++]<<b,b+=8,w+=c[u++]<<b,b+=8),i=T[w&P];t:for(;;){if(w>>>=o=i>>>24,b-=o,0===(o=i>>>16&255))d[m++]=65535&i;else{if(!(16&o)){if(0==(64&o)){i=T[(65535&i)+(w&(1<<o)-1)];continue t}if(32&o){l.mode=12;break e}e.msg="invalid literal/length code",l.mode=30;break e}r=65535&i,(o&=15)&&(b<o&&(w+=c[u++]<<b,b+=8),r+=w&(1<<o)-1,w>>>=o,b-=o),b<15&&(w+=c[u++]<<b,b+=8,w+=c[u++]<<b,b+=8),i=S[w&E];i:for(;;){if(w>>>=o=i>>>24,b-=o,!(16&(o=i>>>16&255))){if(0==(64&o)){i=S[(65535&i)+(w&(1<<o)-1)];continue i}e.msg="invalid distance code",l.mode=30;break e}if(n=65535&i,b<(o&=15)&&(w+=c[u++]<<b,(b+=8)<o&&(w+=c[u++]<<b,b+=8)),_<(n+=w&(1<<o)-1)){e.msg="invalid distance too far back",l.mode=30;break e}if(w>>>=o,b-=o,(o=m-p)<n){if(y<(o=n-o)&&l.sane){e.msg="invalid distance too far back",l.mode=30;break e}if(s=C,(a=0)===v){if(a+=f-o,o<r){for(r-=o;d[m++]=C[a++],--o;);a=m-n,s=d}}else if(v<o){if(a+=f+v-o,(o-=v)<r){for(r-=o;d[m++]=C[a++],--o;);if(a=0,v<r){for(r-=o=v;d[m++]=C[a++],--o;);a=m-n,s=d}}}else if(a+=v-o,o<r){for(r-=o;d[m++]=C[a++],--o;);a=m-n,s=d}for(;2<r;)d[m++]=s[a++],d[m++]=s[a++],d[m++]=s[a++],r-=3;r&&(d[m++]=s[a++],1<r&&(d[m++]=s[a++]))}else{for(a=m-n;d[m++]=d[a++],d[m++]=d[a++],d[m++]=d[a++],2<(r-=3););r&&(d[m++]=d[a++],1<r&&(d[m++]=d[a++]))}break}}break}}while(u<h&&m<g);w&=(1<<(b-=(r=b>>3)<<3))-1,e.next_in=u-=r,e.next_out=m,e.avail_in=u<h?h-u+5:5-(u-h),e.avail_out=m<g?g-m+257:257-(m-g),l.hold=w,l.bits=b}},{}],8:[function(e,t,i){var D=e("../utils/common"),L=e("./adler32"),M=e("./crc32"),A=e("./inffast"),R=e("./inftrees"),O=1,H=2,V=0,k=-2,F=1,o=852,r=592;function G(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new D.Buf16(320),this.work=new D.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=F,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new D.Buf32(o),t.distcode=t.distdyn=new D.Buf32(r),t.sane=1,t.back=-1,V):k}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):k}function l(e,t){var i,o;return e&&e.state?(o=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?k:(null!==o.window&&o.wbits!==t&&(o.window=null),o.wrap=i,o.wbits=t,s(e))):k}function u(e,t){var i;return e?(i=new n,(e.state=i).window=null,(t=l(e,t))!==V&&(e.state=null),t):k}var N,B,j=!0;function z(e,t,i,o){var r=e.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new D.Buf8(r.wsize)),o>=r.wsize?(D.arraySet(r.window,t,i-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(o<(e=r.wsize-r.wnext)&&(e=o),D.arraySet(r.window,t,i-o,e,r.wnext),(o-=e)?(D.arraySet(r.window,t,i-o,o,0),r.wnext=o,r.whave=r.wsize):(r.wnext+=e,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=e))),0}i.inflateReset=s,i.inflateReset2=l,i.inflateResetKeep=a,i.inflateInit=function(e){return u(e,15)},i.inflateInit2=u,i.inflate=function(e,t){var i,o,r,n,a,s,l,u,c,h,m,d,p,g,_,f,y,v,C,w,b,T,S,P,E=0,x=new D.Buf8(4),I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return k;12===(i=e.state).mode&&(i.mode=13),a=e.next_out,r=e.output,l=e.avail_out,n=e.next_in,o=e.input,s=e.avail_in,u=i.hold,c=i.bits,h=s,m=l,T=V;e:for(;;)switch(i.mode){case F:if(0===i.wrap){i.mode=13;break}for(;c<16;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}if(2&i.wrap&&35615===u){x[i.check=0]=255&u,x[1]=u>>>8&255,i.check=M(i.check,x,2,0),c=u=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",i.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",i.mode=30;break}if(c-=4,b=8+(15&(u>>>=4)),0===i.wbits)i.wbits=b;else if(b>i.wbits){e.msg="invalid window size",i.mode=30;break}i.dmax=1<<b,e.adler=i.check=1,i.mode=512&u?10:12,c=u=0;break;case 2:for(;c<16;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}if(i.flags=u,8!=(255&i.flags)){e.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=u>>8&1),512&i.flags&&(x[0]=255&u,x[1]=u>>>8&255,i.check=M(i.check,x,2,0)),c=u=0,i.mode=3;case 3:for(;c<32;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}i.head&&(i.head.time=u),512&i.flags&&(x[0]=255&u,x[1]=u>>>8&255,x[2]=u>>>16&255,x[3]=u>>>24&255,i.check=M(i.check,x,4,0)),c=u=0,i.mode=4;case 4:for(;c<16;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}i.head&&(i.head.xflags=255&u,i.head.os=u>>8),512&i.flags&&(x[0]=255&u,x[1]=u>>>8&255,i.check=M(i.check,x,2,0)),c=u=0,i.mode=5;case 5:if(1024&i.flags){for(;c<16;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}i.length=u,i.head&&(i.head.extra_len=u),512&i.flags&&(x[0]=255&u,x[1]=u>>>8&255,i.check=M(i.check,x,2,0)),c=u=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((d=s<(d=i.length)?s:d)&&(i.head&&(b=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),D.arraySet(i.head.extra,o,n,d,b)),512&i.flags&&(i.check=M(i.check,o,d,n)),s-=d,n+=d,i.length-=d),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===s)break e;for(d=0;b=o[n+d++],i.head&&b&&i.length<65536&&(i.head.name+=String.fromCharCode(b)),b&&d<s;);if(512&i.flags&&(i.check=M(i.check,o,d,n)),s-=d,n+=d,b)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===s)break e;for(d=0;b=o[n+d++],i.head&&b&&i.length<65536&&(i.head.comment+=String.fromCharCode(b)),b&&d<s;);if(512&i.flags&&(i.check=M(i.check,o,d,n)),s-=d,n+=d,b)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;c<16;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}if(u!==(65535&i.check)){e.msg="header crc mismatch",i.mode=30;break}c=u=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;c<32;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}e.adler=i.check=G(u),c=u=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=a,e.avail_out=l,e.next_in=n,e.avail_in=s,i.hold=u,i.bits=c,2;e.adler=i.check=1,i.mode=12;case 12:if(5===t||6===t)break e;case 13:if(i.last){u>>>=7&c,c-=7&c,i.mode=27;break}for(;c<3;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}switch(i.last=1&u,--c,3&(u>>>=1)){case 0:i.mode=14;break;case 1:if(!function(e){if(j){var t;for(N=new D.Buf32(512),B=new D.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(R(O,e.lens,0,288,N,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;R(H,e.lens,0,32,B,0,e.work,{bits:5}),j=!1}e.lencode=N,e.lenbits=9,e.distcode=B,e.distbits=5}(i),i.mode=20,6!==t)break;u>>>=2,c-=2;break e;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=30}u>>>=2,c-=2;break;case 14:for(u>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&u,c=u=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(d=i.length){if(0===(d=l<(d=s<d?s:d)?l:d))break e;D.arraySet(r,o,n,d,a),s-=d,n+=d,l-=d,a+=d,i.length-=d;break}i.mode=12;break;case 17:for(;c<14;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}if(i.nlen=257+(31&u),u>>>=5,c-=5,i.ndist=1+(31&u),u>>>=5,c-=5,i.ncode=4+(15&u),u>>>=4,c-=4,286<i.nlen||30<i.ndist){e.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;c<3;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}i.lens[I[i.have++]]=7&u,u>>>=3,c-=3}for(;i.have<19;)i.lens[I[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,S={bits:i.lenbits},T=R(0,i.lens,0,19,i.lencode,0,i.work,S),i.lenbits=S.bits,T){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;f=(E=i.lencode[u&(1<<i.lenbits)-1])>>>16&255,y=65535&E,!((_=E>>>24)<=c);){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}if(y<16)u>>>=_,c-=_,i.lens[i.have++]=y;else{if(16===y){for(P=_+2;c<P;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}if(u>>>=_,c-=_,0===i.have){e.msg="invalid bit length repeat",i.mode=30;break}b=i.lens[i.have-1],d=3+(3&u),u>>>=2,c-=2}else if(17===y){for(P=_+3;c<P;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}c-=_,b=0,d=3+(7&(u>>>=_)),u>>>=3,c-=3}else{for(P=_+7;c<P;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}c-=_,b=0,d=11+(127&(u>>>=_)),u>>>=7,c-=7}if(i.have+d>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=30;break}for(;d--;)i.lens[i.have++]=b}}if(30===i.mode)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,S={bits:i.lenbits},T=R(O,i.lens,0,i.nlen,i.lencode,0,i.work,S),i.lenbits=S.bits,T){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,S={bits:i.distbits},T=R(H,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,S),i.distbits=S.bits,T){e.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(6<=s&&258<=l){e.next_out=a,e.avail_out=l,e.next_in=n,e.avail_in=s,i.hold=u,i.bits=c,A(e,m),a=e.next_out,r=e.output,l=e.avail_out,n=e.next_in,o=e.input,s=e.avail_in,u=i.hold,c=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;f=(E=i.lencode[u&(1<<i.lenbits)-1])>>>16&255,y=65535&E,!((_=E>>>24)<=c);){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}if(f&&0==(240&f)){for(v=_,C=f,w=y;f=(E=i.lencode[w+((u&(1<<v+C)-1)>>v)])>>>16&255,y=65535&E,!(v+(_=E>>>24)<=c);){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}u>>>=v,c-=v,i.back+=v}if(u>>>=_,c-=_,i.back+=_,i.length=y,0===f){i.mode=26;break}if(32&f){i.back=-1,i.mode=12;break}if(64&f){e.msg="invalid literal/length code",i.mode=30;break}i.extra=15&f,i.mode=22;case 22:if(i.extra){for(P=i.extra;c<P;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}i.length+=u&(1<<i.extra)-1,u>>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;f=(E=i.distcode[u&(1<<i.distbits)-1])>>>16&255,y=65535&E,!((_=E>>>24)<=c);){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}if(0==(240&f)){for(v=_,C=f,w=y;f=(E=i.distcode[w+((u&(1<<v+C)-1)>>v)])>>>16&255,y=65535&E,!(v+(_=E>>>24)<=c);){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}u>>>=v,c-=v,i.back+=v}if(u>>>=_,c-=_,i.back+=_,64&f){e.msg="invalid distance code",i.mode=30;break}i.offset=y,i.extra=15&f,i.mode=24;case 24:if(i.extra){for(P=i.extra;c<P;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}i.offset+=u&(1<<i.extra)-1,u>>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===l)break e;if(i.offset>(d=m-l)){if((d=i.offset-d)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=30;break}p=d>i.wnext?(d-=i.wnext,i.wsize-d):i.wnext-d,d>i.length&&(d=i.length),g=i.window}else g=r,p=a-i.offset,d=i.length;for(l-=d=l<d?l:d,i.length-=d;r[a++]=g[p++],--d;);0===i.length&&(i.mode=21);break;case 26:if(0===l)break e;r[a++]=i.length,l--,i.mode=21;break;case 27:if(i.wrap){for(;c<32;){if(0===s)break e;s--,u|=o[n++]<<c,c+=8}if(m-=l,e.total_out+=m,i.total+=m,m&&(e.adler=i.check=(i.flags?M:L)(i.check,r,m,a-m)),m=l,(i.flags?u:G(u))!==i.check){e.msg="incorrect data check",i.mode=30;break}c=u=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;c<32;){if(0===s)break e;s--,u+=o[n++]<<c,c+=8}if(u!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=30;break}c=u=0}i.mode=29;case 29:T=1;break e;case 30:T=-3;break e;case 31:return-4;default:return k}return e.next_out=a,e.avail_out=l,e.next_in=n,e.avail_in=s,i.hold=u,i.bits=c,(i.wsize||m!==e.avail_out&&i.mode<30&&(i.mode<27||4!==t))&&z(e,e.output,e.next_out,m-e.avail_out),h-=e.avail_in,m-=e.avail_out,e.total_in+=h,e.total_out+=m,i.total+=m,i.wrap&&m&&(e.adler=i.check=(i.flags?M:L)(i.check,r,m,e.next_out-m)),e.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),T=(0==h&&0===m||4===t)&&T===V?-5:T},i.inflateEnd=function(e){if(!e||!e.state)return k;var t=e.state;return t.window&&(t.window=null),e.state=null,V},i.inflateGetHeader=function(e,t){return!e||!e.state||0==(2&(e=e.state).wrap)?k:((e.head=t).done=!1,V)},i.inflateSetDictionary=function(e,t){var i,o=t.length;return!e||!e.state||0!==(i=e.state).wrap&&11!==i.mode?k:11===i.mode&&L(1,t,o,0)!==i.check?-3:z(e,t,o,o)?(i.mode=31,-4):(i.havedict=1,V)},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,i){var O=e("../utils/common"),H=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],V=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],k=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],F=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,i,o,r,n,a,s){for(var l,u,c,h,m,d,p,g,_,f=s.bits,y=0,v=0,C=0,w=0,b=0,T=0,S=0,P=0,E=0,x=0,I=null,D=0,L=new O.Buf16(16),M=new O.Buf16(16),A=null,R=0,y=0;y<=15;y++)L[y]=0;for(v=0;v<o;v++)L[t[i+v]]++;for(b=f,w=15;1<=w&&0===L[w];w--);if(w<b&&(b=w),0===w)return r[n++]=20971520,r[n++]=20971520,s.bits=1,0;for(C=1;C<w&&0===L[C];C++);for(b<C&&(b=C),y=P=1;y<=15;y++)if(P<<=1,(P-=L[y])<0)return-1;if(0<P&&(0===e||1!==w))return-1;for(M[1]=0,y=1;y<15;y++)M[y+1]=M[y]+L[y];for(v=0;v<o;v++)0!==t[i+v]&&(a[M[t[i+v]]++]=v);if(d=0===e?(I=A=a,19):1===e?(I=H,D-=257,A=V,R-=257,256):(I=k,A=F,-1),y=C,m=n,S=v=x=0,c=-1,h=(E=1<<(T=b))-1,1===e&&852<E||2===e&&592<E)return 1;for(;;){for(_=a[v]<d?(g=0,a[v]):a[v]>d?(g=A[R+a[v]],I[D+a[v]]):(g=96,0),l=1<<(p=y-S),C=u=1<<T;r[m+(x>>S)+(u-=l)]=p<<24|g<<16|_|0,0!==u;);for(l=1<<y-1;x&l;)l>>=1;if(0!==l?(x&=l-1,x+=l):x=0,v++,0==--L[y]){if(y===w)break;y=t[i+a[v]]}if(b<y&&(x&h)!==c){for(m+=C,P=1<<(T=y-(S=0===S?b:S));T+S<w&&!((P-=L[T+S])<=0);)T++,P<<=1;if(E+=1<<T,1===e&&852<E||2===e&&592<E)return 1;r[c=x&h]=b<<24|T<<16|m-n|0}}return 0!==x&&(r[m+x]=y-S<<24|64<<16|0),s.bits=b,0}},{"../utils/common":1}],10:[function(e,t,i){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,i){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(e,t,i){var h=e("./zlib/inflate"),m=e("./utils/common"),d=e("./utils/strings"),p=e("./zlib/constants"),o=e("./zlib/messages"),r=e("./zlib/zstream"),n=e("./zlib/gzheader"),g=Object.prototype.toString;function a(e){if(!(this instanceof a))return new a(e);this.options=m.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new r,this.strm.avail_out=0;t=h.inflateInit2(this.strm,t.windowBits);if(t!==p.Z_OK)throw new Error(o[t]);this.header=new n,h.inflateGetHeader(this.strm,this.header)}function s(e,t){t=new a(t);if(t.push(e,!0),t.err)throw t.msg||o[t.err];return t.result}a.prototype.push=function(e,t){var i,o,r,n,a,s=this.strm,l=this.options.chunkSize,u=this.options.dictionary,c=!1;if(this.ended)return!1;o=t===~~t?t:!0===t?p.Z_FINISH:p.Z_NO_FLUSH,"string"==typeof e?s.input=d.binstring2buf(e):"[object ArrayBuffer]"===g.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new m.Buf8(l),s.next_out=0,s.avail_out=l),(i=h.inflate(s,p.Z_NO_FLUSH))===p.Z_NEED_DICT&&u&&(a="string"==typeof u?d.string2buf(u):"[object ArrayBuffer]"===g.call(u)?new Uint8Array(u):u,i=h.inflateSetDictionary(this.strm,a)),i===p.Z_BUF_ERROR&&!0===c&&(i=p.Z_OK,c=!1),i!==p.Z_STREAM_END&&i!==p.Z_OK)return this.onEnd(i),!(this.ended=!0)}while(s.next_out&&(0!==s.avail_out&&i!==p.Z_STREAM_END&&(0!==s.avail_in||o!==p.Z_FINISH&&o!==p.Z_SYNC_FLUSH)||("string"===this.options.to?(r=d.utf8border(s.output,s.next_out),n=s.next_out-r,a=d.buf2string(s.output,r),s.next_out=n,s.avail_out=l-n,n&&m.arraySet(s.output,s.output,r,n,0),this.onData(a)):this.onData(m.shrinkBuf(s.output,s.next_out)))),0===s.avail_in&&0===s.avail_out&&(c=!0),(0<s.avail_in||0===s.avail_out)&&i!==p.Z_STREAM_END);return(o=i===p.Z_STREAM_END?p.Z_FINISH:o)===p.Z_FINISH?(i=h.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===p.Z_OK):o!==p.Z_SYNC_FLUSH||(this.onEnd(p.Z_OK),!(s.avail_out=0))},a.prototype.onData=function(e){this.chunks.push(e)},a.prototype.onEnd=function(e){e===p.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=m.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},i.Inflate=a,i.inflate=s,i.inflateRaw=function(e,t){return(t=t||{}).raw=!0,s(e,t)},i.ungzip=s},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js");function ru(){}let nu={SV_Unkown:0,SV_Standard:1,SV_Compressed:2};function au(e,t,i){t=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;e=new Uint8Array(e,i,t);return{string:Cesium.getStringFromTypedArray(e),bytesOffset:i+=t}}function su(t,i,o,e){let r={};r.rangeList=i.getFloat32(o,!0),o+=Float32Array.BYTES_PER_ELEMENT,r.rangeMode=i.getUint16(o,!0),o+=Uint16Array.BYTES_PER_ELEMENT;let n={};n.x=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,n.y=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,n.z=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT;var a=i.getFloat64(o,!0);o+=Float64Array.BYTES_PER_ELEMENT,r.boundingSphere={center:n,radius:a};a=au(t,i,o);let s=a.string;o=a.bytesOffset;a=s.indexOf("Geometry");-1!==a&&(a=s.substring(a),s=s.replace(a,"")),r.childTile=s,r.geodes=[];var l=i.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<l;e++)o=function(t,i,o,e){let r={},n=[],a=new Array(16);for(let e=0;e<16;e++)a[e]=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT;r.matrix=a,r.skeletonNames=n;var s=i.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<s;e++){var l=au(t,i,o);n.push(l.string),o=l.bytesOffset}return e.push(r),o}(t,i,o,r.geodes);return e.push(r),o}function lu(e,t,i,o){var r=t.getUint32(i,!0);if(o.verticesCount=r,(i+=Uint32Array.BYTES_PER_ELEMENT)<=0)return i;var n=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;t=t.getUint16(i,!0),t=n*Float32Array.BYTES_PER_ELEMENT;i+=Uint16Array.BYTES_PER_ELEMENT;r=r*n*Float32Array.BYTES_PER_ELEMENT,e=new Uint8Array(e,i,r);i+=r;let a=o.vertexAttributes,s=o.attrLocation;return s.aPosition=a.length,a.push({index:s.aPosition,typedArray:e,componentsPerAttribute:n,componentDatatype:Cesium.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:t,normalize:!1}),i}function uu(e,t,i,o){var r=t.getUint32(i,!0);if(i+=Uint32Array.BYTES_PER_ELEMENT,r<=0)return i;var n=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;t=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;r=r*n*Float32Array.BYTES_PER_ELEMENT,e=new Uint8Array(e,i,r);i+=r;let a=o.vertexAttributes,s=o.attrLocation;return s.aNormal=a.length,a.push({index:s.aNormal,typedArray:e,componentsPerAttribute:n,componentDatatype:Cesium.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:t,normalize:!1}),i}function cu(t,i,o,e){var r=i.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;var n=e.verticesCount;let a;if(0<r){i.getUint16(o,!0),o+=Uint16Array.BYTES_PER_ELEMENT,o+=2*Uint8Array.BYTES_PER_ELEMENT;r=r*Uint8Array.BYTES_PER_ELEMENT*4;let e=new Uint8Array(t,o,r);a=e.slice(0,r),o+=r}else{a=new Uint8Array(4*n);for(let e=0;e<n;e++)a[4*e]=255,a[4*e+1]=255,a[4*e+2]=255,a[4*e+3]=255}let s=e.vertexAttributes,l=e.attrLocation;return l.aColor=s.length,s.push({index:l.aColor,typedArray:a,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:4,normalize:!0}),e.vertexColor=a,o}function hu(e,t,i,o){var r=t.getUint32(i,!0);if(i+=Uint32Array.BYTES_PER_ELEMENT,r<=0)return i;t.getUint16(i,!0),i+=Uint16Array.BYTES_PER_ELEMENT,i+=2*Uint8Array.BYTES_PER_ELEMENT;r=r*Uint8Array.BYTES_PER_ELEMENT*4,e=new Uint8Array(e,i,r);i+=r;let n=o.vertexAttributes,a=o.attrLocation;return a.aSecondColor=n.length,n.push({index:a.aSecondColor,typedArray:e,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:4,normalize:!0}),i}function mu(o,r,n,a){var e=r.getUint16(n,!0);n+=Uint16Array.BYTES_PER_ELEMENT,n+=Uint16Array.BYTES_PER_ELEMENT;for(let i=0;i<e;i++){var s=r.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var l=r.getUint16(n,!0);n+=Uint16Array.BYTES_PER_ELEMENT,r.getUint16(n,!0),n+=Uint16Array.BYTES_PER_ELEMENT;var u=s*l*Float32Array.BYTES_PER_ELEMENT,s=new Uint8Array(o,n,u);n+=u;u="aTexCoord"+i;let e=a.vertexAttributes,t=a.attrLocation;t[u]=e.length,e.push({index:t[u],typedArray:s,componentsPerAttribute:l,componentDatatype:Cesium.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:l*Float32Array.BYTES_PER_ELEMENT,normalize:!1})}return n}function du(i,t,o,r){var n=t.getUint16(o,!0);o+=Uint16Array.BYTES_PER_ELEMENT,o+=Uint16Array.BYTES_PER_ELEMENT;let a=r.vertexAttributes,s=r.attrLocation;for(let e=0;e<n;e++){var l=t.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;var u=t.getUint16(o,!0);o+=Uint16Array.BYTES_PER_ELEMENT,t.getUint16(o,!0),o+=Uint16Array.BYTES_PER_ELEMENT;var c=l*u*Float32Array.BYTES_PER_ELEMENT;if(17===u||29===u){let e=new Uint8Array(i,o,c);r.instanceCount=l,r.instanceMode=u,r.instanceBuffer=e,r.instanceIndex=1;var h=e.slice(0,u*l*4);r.vertexColorInstance=h;let t;17===u?(t=17*Float32Array.BYTES_PER_ELEMENT,s.uv2=a.length,a.push({index:s.uv2,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:t,instanceDivisor:1}),s.uv3=a.length,a.push({index:s.uv3,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv4=a.length,a.push({index:s.uv4,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv5=a.length,a.push({index:s.uv5,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv6=a.length,a.push({index:s.uv6,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,normalize:!0,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1})):29===u&&(t=29*Float32Array.BYTES_PER_ELEMENT,s.uv1=a.length,a.push({index:s.uv1,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:t,instanceDivisor:1,byteLength:c}),s.uv2=a.length,a.push({index:s.uv2,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv3=a.length,a.push({index:s.uv3,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv4=a.length,a.push({index:s.uv4,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv5=a.length,a.push({index:s.uv5,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv6=a.length,a.push({index:s.uv6,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:20*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv7=a.length,a.push({index:s.uv7,componentsPerAttribute:3,componentDatatype:Cesium.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:24*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv8=a.length,a.push({index:s.uv8,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,normalize:!0,offsetInBytes:27*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv9=a.length,a.push({index:s.uv9,componentsPerAttribute:4,componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,normalize:!0,offsetInBytes:28*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}))}else{var m=l*u;r.instanceBounds=new Float32Array(m);for(let e=0;e<m;e++)r.instanceBounds[e]=t.getFloat32(o,!0)}o+=c}return o}function pu(e,t,i,o){var r=t.getUint32(i,!0);return o.compressOptions=r,i+=Uint32Array.BYTES_PER_ELEMENT,i=((r&iu.SVC_Vertex)===iu.SVC_Vertex?function(e,t,i,o){var r=t.getUint32(i,!0);if(o.verticesCount=r,(i+=Uint32Array.BYTES_PER_ELEMENT)<=0)return i;var n=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT,t.getUint16(i,!0);var a=n*Int16Array.BYTES_PER_ELEMENT;i+=Uint16Array.BYTES_PER_ELEMENT;var s=t.getFloat32(i,!0);i+=Float32Array.BYTES_PER_ELEMENT;let l={};l.x=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,l.y=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,l.z=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,l.w=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,o.vertCompressConstant=s,o.minVerticesValue=l,r=r*n*Int16Array.BYTES_PER_ELEMENT,e=new Uint8Array(e,i,r),i+=r;let u=o.vertexAttributes,c=o.attrLocation;return c.aPosition=u.length,u.push({index:c.aPosition,typedArray:e,componentsPerAttribute:n,componentDatatype:Cesium.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:a,normalize:!1}),i}:lu)(e,t,i,o),i=hu(e,t,i=cu(e,t,i=((r&iu.SVC_Normal)===iu.SVC_Normal?function(e,t,i,o){var r=t.getUint32(i,!0);if(i+=Uint32Array.BYTES_PER_ELEMENT,r<=0)return i;t.getUint16(i,!0),i+=Uint16Array.BYTES_PER_ELEMENT,t=t.getUint16(i,!0),i+=Uint16Array.BYTES_PER_ELEMENT,r=2*r*Int16Array.BYTES_PER_ELEMENT,e=new Uint8Array(e,i,r),i+=r;let n=o.vertexAttributes,a=o.attrLocation;return a.aNormal=n.length,n.push({index:a.aNormal,typedArray:e,componentsPerAttribute:2,componentDatatype:Cesium.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:t,normalize:!1}),i}:uu)(e,t,i,o),o),o),i=((r&iu.SVC_TexutreCoord)===iu.SVC_TexutreCoord?function(r,n,a,s){s.texCoordCompressConstant=[],s.minTexCoordValue=[];var e=n.getUint16(a,!0);a+=Uint16Array.BYTES_PER_ELEMENT,a+=Uint16Array.BYTES_PER_ELEMENT;for(let o=0;o<e;o++){var l=n.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT,a+=3*Uint8Array.BYTES_PER_ELEMENT;var u=n.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var c=n.getUint16(a,!0);a+=Uint16Array.BYTES_PER_ELEMENT,n.getUint16(a,!0),a+=Uint16Array.BYTES_PER_ELEMENT;var h=n.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT,s.texCoordCompressConstant.push(h);let e={};e.x=n.getFloat32(a,!0),a+=Float32Array.BYTES_PER_ELEMENT,e.y=n.getFloat32(a,!0),a+=Float32Array.BYTES_PER_ELEMENT,e.z=n.getFloat32(a,!0),a+=Float32Array.BYTES_PER_ELEMENT,e.w=n.getFloat32(a,!0),a+=Float32Array.BYTES_PER_ELEMENT,s.minTexCoordValue.push(e);var m=u*c*Int16Array.BYTES_PER_ELEMENT,d=new Uint8Array(r,a,m),h=(a+=m)%4;0!=h&&(a+=4-h);h="aTexCoord"+o;let t=s.vertexAttributes,i=s.attrLocation;i[h]=t.length,t.push({index:i[h],typedArray:d,componentsPerAttribute:c,componentDatatype:Cesium.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:c*Int16Array.BYTES_PER_ELEMENT,normalize:!1}),l&&(m=u*Float32Array.BYTES_PER_ELEMENT,u=new Uint8Array(r,a,m),a+=m,s.texCoordZMatrix=!0,h="aTexCoordZ"+o,i[h]=t.length,t.push({index:i[h],typedArray:u,componentsPerAttribute:1,componentDatatype:Cesium.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:Float32Array.BYTES_PER_ELEMENT,normalize:!1}))}return a}:mu)(e,t,i,o),(r&iu.SVC_TexutreCoordIsW)===iu.SVC_TexutreCoordIsW&&(o.textureCoordIsW=!0),i=du(e,t,i,o)}function gu(t,i,o,r){i.getUint32(o,!0),o+=Uint32Array.BYTES_PER_ELEMENT;var n=i.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<n;e++){var a=au(t,i,o),s=a.string,l=(o=a.bytesOffset)%4;0!=l&&(o+=4-l);var u=i.getUint32(o,!0);o+=Int32Array.BYTES_PER_ELEMENT;a={vertexAttributes:[],attrLocation:{},instanceCount:0,instanceMode:0,instanceIndex:-1};u===nu.SV_Standard?o=du(t,i,mu(t,i,hu(t,i,cu(t,i,uu(t,i,lu(t,i,o,l=a),l),l),l),l),l):u===nu.SV_Compressed&&(o=pu(t,i,o,a));u=[];o=function(o,t,r,n){var i=t.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<i;e++){let i={};var a=t.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;var s=t.getUint8(r,!0);r+=Uint8Array.BYTES_PER_ELEMENT,t.getUint8(r,!0),r+=Uint8Array.BYTES_PER_ELEMENT;var l=t.getUint8(r,!0);if(r+=Uint8Array.BYTES_PER_ELEMENT,r+=Uint8Array.BYTES_PER_ELEMENT,0<a){let e=null,t;1===s||3===s?(t=a*Uint32Array.BYTES_PER_ELEMENT,e=new Uint8Array(o,r,t)):(t=a*Uint16Array.BYTES_PER_ELEMENT,e=new Uint8Array(o,r,t),a%2!=0&&(t+=2)),i.indicesTypedArray=e,r+=t}i.indicesCount=a,i.indexType=s,i.primitiveType=l;var u=t.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<u;e++){var c=au(o,t,r),h=c.string;r=c.bytesOffset,i.materialCode=h}0!=r%4&&(r+=4-r%4),n.push(i)}return r}(t,i,o,u),r[s]={vertexPackage:a,arrIndexPackage:u}}return o+=i.getUint32(o,!0),o+=Uint32Array.BYTES_PER_ELEMENT}function _u(e,t,i){let o=e._gl;this.id=t,this._size=i.imageBuffer.length,this._context=e,this._width=i.width,this._height=i.height,this._texture=null,this._internalFormat=i.internalFormat,this._wrapS=Cesium.defaultValue(i.wrapS,Cesium.TextureWrap.CLAMP_TO_EDGE),this._wrapT=Cesium.defaultValue(i.wrapT,Cesium.TextureWrap.CLAMP_TO_EDGE),this.id=t,this._target=o.TEXTURE_2D,this._texture=o.createTexture(),o.bindTexture(o.TEXTURE_2D,this._texture);let r=0,n=0;var a=function(e,t,i,o){let r=e.length,n=i,a=o,s=0;for(;;){var l=Cesium.PixelFormat.compressedTextureSizeInBytes(t,n,a);if(s+=l,n>>=1,a>>=1,0==n&&0==a)break;n=Math.max(n,1),a=Math.max(a,1)}return s===r}(i.imageBuffer,this._internalFormat,this._width,this._height);let s=this._width,l=this._height;do{var u=Cesium.PixelFormat.compressedTextureSizeInBytes(this._internalFormat,s,l),c=new Uint8Array(i.imageBuffer.buffer,i.imageBuffer.byteOffset+r,u);o.compressedTexImage2D(o.TEXTURE_2D,n++,this._internalFormat,s,l,0,c),s=Math.max(s>>1,1),l=Math.max(l>>1,1),r+=u}while(r<i.imageBuffer.length&&a);1<n?(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR_MIPMAP_LINEAR)):(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR)),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,this._wrapS),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,this._wrapT),o.bindTexture(o.TEXTURE_2D,null)}function fu(){this.ambientColor=new Cesium.Color,this.diffuseColor=new Cesium.Color,this.specularColor=new Cesium.Color(0,0,0,0),this.shininess=50,this.bTransparentSorting=!1,this.textures=[]}ru.parseBuffer=function(e){var t=0;let i={version:void 0,groupNode:void 0,geoPackage:{},matrials:void 0,texturePackage:{}},o=new DataView(e);i.version=o.getFloat32(0,!0),t+=Float32Array.BYTES_PER_ELEMENT,o.getUint32(t,!0),t+=Uint32Array.BYTES_PER_ELEMENT;var r=(s=t,s=new Uint8Array(e,t),ou.inflate(s).buffer);o=new DataView(r);var n,a,s,t=0,l=o.getUint32(0,!0);return t+=Uint32Array.BYTES_PER_ELEMENT,t=function(t,i,o,e){let r={};var n=[];i.getUint32(o,!0),o+=Uint32Array.BYTES_PER_ELEMENT;var a=i.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<a;e++)o=su(t,i,o,n);r.pageLods=n;var s=o%4;return 0!=s&&(o+=4-s),e.groupNode=r,o}(r,o,t,i),t=gu(r,o,t,i.geoPackage),t=function(t,i,o,r){i.getUint32(o,!0),o+=Uint32Array.BYTES_PER_ELEMENT;var n=i.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<n;e++){var a=au(t,i,o),s=a.string,l=(o=a.bytesOffset)%4;0!=l&&(o+=4-l),i.getUint32(o,!0),o+=Uint32Array.BYTES_PER_ELEMENT;var u=i.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;var c=i.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;var h=i.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;var m=i.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;a=i.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;l=new Uint8Array(t,o,m);o+=m,r[s]={id:s,width:u,height:c,compressType:h,nFormat:a,internalFormat:Cesium.PixelFormat.RGBA_DXT5,imageBuffer:l}}return o}(r,o,t,i.texturePackage),n=r,a=o,e=t,s=i,a=a.getUint32(e,!0),e+=Uint32Array.BYTES_PER_ELEMENT,n=new Uint8Array(n,e,a),n=Cesium.getStringFromTypedArray(n),e+=a,s.materials=JSON.parse(n),function(t,o,r,e,n){if(1==(1&e)){o.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT;var i=o.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<i;e++){var a=au(t,o,r),s=a.string;r=a.bytesOffset;var l=o.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;let i={};n[s].pickInfo=i;var u=n[s].vertexPackage.instanceIndex;for(let e=0;e<l;e++){var c=o.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;var h=o.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;let t=[];for(let e=0;e<h;e++){var m=o.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;let e=1;-1===u&&(e=o.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT),t.push({vertexColorOffset:m,vertexColorCount:e})}i[c]=t}}}}(r,o,e,l,i.geoPackage),i},_u.prototype.enable=function(){let e=this._context._gl;e.activeTexture(this._gl.TEXTURE0),e.bindTexture(this._target,this._texture)},_u.prototype.disable=function(){let e=this._context._gl;e.bindTexture(this._target,null)},_u.prototype.isDestroyed=function(){return!1},_u.prototype.destroy=function(){let e=this._context._gl;e.deleteTexture(this._texture),this._texture=null,this.id=0,Cesium.destroyObject(this)},fu.prototype.isDestroyed=function(){return!1},fu.prototype.destroy=function(){return destroyObject(this)};var yu,vu=`
        attribute vec4 aPosition;
        attribute vec4 aTexCoord0;
    #ifdef TexCoord2
        attribute vec4 aTexCoord1;
    #endif
        varying vec4 vTexCoord;
        attribute vec4 aColor;
        varying vec4 vColor;
        void main()
        {
            vTexCoord.xy = aTexCoord0.xy;
        #ifdef TexCoord2
            vTexCoord.zw = aTexCoord1.xy;
        #endif
            vColor = aColor;
            gl_Position = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);
        }
    `,Cu=`
        uniform sampler2D uTexture;
    #ifdef TexCoord2
        uniform sampler2D uTexture2;
    #endif
        uniform vec4 uDiffuseColor;
        uniform vec4 uAmbientColor;
        varying vec4 vColor;
        varying vec4 vTexCoord;
        void main()
        {
            vec4 color = vColor * texture2D(uTexture, vTexCoord.xy);
        #ifdef TexCoord2
            color *= texture2D(uTexture2, vTexCoord.zw);
        #endif
            gl_FragColor = czm_gammaCorrect(color);
        }
    `;function wu(){this.context=void 0,this.model=void 0,this.index=void 0}function bu(){this.model=void 0,this.context=void 0,this.index=0}function Tu(e){this.layer=e.layer,this.vertexPackage=e.vertexPackage,this.arrIndexPackage=e.arrIndexPackage,this.vertexBufferToCreate=new Cesium.Queue,this.indexBufferToCreate=new Cesium.Queue;let t,i;for(t=0,i=this.vertexPackage.vertexAttributes.length;t<i;t++)this.vertexBufferToCreate.enqueue(t);for(t=0,i=this.arrIndexPackage.length;t<i;t++)this.indexBufferToCreate.enqueue(t);this.boundingVolume=e.boundingVolume,this.material=e.material,this.modelMatrix=e.modelMatrix,this.shaderProgram=void 0,this.vertexArray=void 0,this.colorCommand=void 0,this.ready=!1}wu.prototype.set=function(e,t,i){this.context=e,this.model=t,this.index=i},wu.prototype.execute=function(){var e=this.context,t=this.index,i=this.model.vertexPackage;let o=i.vertexAttributes[t];if(!Cesium.defined(o))throw new Cesium.DeveloperError("attribute is null");if(-1!==i.instanceIndex&&!Cesium.defined(this.model._instanceBuffer)){if(!Cesium.defined(i.instanceBuffer))throw new Cesium.DeveloperError("instance buffer is null");this.model.instanceBuffer=Cesium.Buffer.createVertexBuffer({context:e,typedArray:i.instanceBuffer,usage:Cesium.BufferUsage.STATIC_DRAW})}1!==o.instanceDivisor?Cesium.defined(o.vertexBuffer)||(o.vertexBuffer=Cesium.Buffer.createVertexBuffer({context:e,typedArray:o.typedArray,usage:Cesium.BufferUsage.STATIC_DRAW}),o.typedArray=null,delete o.typedArray):o.vertexBuffer=this.model.instanceBuffer},bu.prototype.set=function(e,t,i){this.model=t,this.context=e,this.index=i},bu.prototype.execute=function(){var t=this.context;let i=this.model.arrIndexPackage[this.index];var o=this.model.vertexPackage.verticesCount;if(!Cesium.defined(i))throw new Cesium.DeveloperError("index package is null");if(!Cesium.defined(i.indexBuffer)){if(!Cesium.defined(i.indicesTypedArray))throw new Cesium.DeveloperError("index buffer is null");let e=Cesium.IndexDatatype.UNSIGNED_SHORT;(1===i.indexType||o>=Cesium.Math.SIXTY_FOUR_KILOBYTES)&&t.elementIndexUint&&(e=Cesium.IndexDatatype.UNSIGNED_INT),i.indexBuffer=Cesium.Buffer.createIndexBuffer({context:t,typedArray:i.indicesTypedArray,usage:Cesium.BufferUsage.STATIC_DRAW,indexDatatype:e}),i.indicesTypedArray=null,delete i.indicesTypedArray}};let Su=new wu,Pu=new bu;function Eu(e){Tu.call(this,e)}Tu.prototype.createBuffers=function(e){!function(e,t){var i=e.layer.context;let o=e.vertexBufferToCreate;for(;o.length;){var r=o.peek();if(Su.set(i,e,r),!t.jobScheduler.execute(Su,Cesium.JobType.BUFFER))break;o.dequeue()}}(this,e),function(e,t){var i=e.layer.context;let o=e.indexBufferToCreate;for(;o.length;){var r=o.peek();if(Pu.set(i,e,r),!t.jobScheduler.execute(Pu,Cesium.JobType.BUFFER))break;o.dequeue()}}(this,e)},Tu.prototype.createCommand=Cesium.DeveloperError.throwInstantiationError,Tu.prototype.update=Cesium.DeveloperError.throwInstantiationError,Tu.prototype.isDestroyed=Cesium.DeveloperError.throwInstantiationError,Tu.prototype.destroy=Cesium.DeveloperError.throwInstantiationError,(Eu.prototype=Object.create(Tu.prototype)).constructor=Tu,Eu.prototype.createCommand=function(){var e,t,i,o,r,n;Cesium.defined(this.colorCommand)||(e=this.layer.context,o=this.vertexPackage,r=this.arrIndexPackage,t=o.vertexAttributes,i=o.attrLocation,r.length<1||(o=r[0],r=this.material,this.shaderProgram=function(e,t,i){let o=new Cesium.ShaderSource({sources:[vu]}),r=new Cesium.ShaderSource({sources:[Cu]});return Cesium.defined(t.aNormal)&&(o.defines.push("VertexNormal"),r.defines.push("VertexNormal")),0<i.textures.length&&(o.defines.push("TexCoord"),r.defines.push("TexCoord")),2==i.textures.length&&(o.defines.push("TexCoord2"),r.defines.push("TexCoord2")),Cesium.ShaderProgram.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:t})}(e,i,r),this.vertexArray=new Cesium.VertexArray({context:e,attributes:t,indexBuffer:o.indexBuffer}),this.colorCommand=new Cesium.DrawCommand({primitiveType:o.primitiveType,modelMatrix:this.modelMatrix,boundingVolume:Cesium.BoundingSphere.clone(this.boundingVolume),pickId:"vSecondColor",vertexArray:this.vertexArray,shaderProgram:this.shaderProgram,pass:r.bTransparentSorting?Cesium.Pass.TRANSLUCENT:Cesium.Pass.CESIUM_3D_TILE,renderState:r.bTransparentSorting?Cesium.RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Cesium.DepthFunction.LESS_OR_EQUAL},blending:Cesium.BlendingState.ALPHA_BLEND}):Cesium.RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Cesium.DepthFunction.LESS_OR_EQUAL}})}),this.colorCommand.uniformMap=(n=r,{uTexture:function(){return n.textures[0]},uTextureWidth:function(){return n.textures[0]._width},uTexture2:function(){return n.textures[1]},uTexture2Width:function(){return n.textures[1]._width},uDiffuseColor:function(){return n.diffuseColor},uAmbientColor:function(){return n.ambientColor}}),this.vertexPackage=null,this.arrIndexPackage=null,this.ready=!0))},Eu.prototype.update=function(e){if(!this.ready)return this.createBuffers(e),void this.createCommand(e);e.commandList.push(this.colorCommand)},Eu.prototype.isDestroyed=function(){return!1},Eu.prototype.destroy=function(){return this.shaderProgram=this.shaderProgram&&!this.shaderProgram.isDestroyed()&&this.shaderProgram.destroy(),this.vertexArray=this.vertexArray&&!this.vertexArray.isDestroyed()&&this.vertexArray.destroy(),this.colorCommand=void 0,this.vertexPackage=null,this.arrIndexPackage=null,Cesium.destroyObject(this)};let xu={OSGBFile:function(e){return new Eu(e)},OSGBCacheFile:function(e){return new Eu(e)}};function Iu(){}function Du(o,r,n,e,a){let s={};var l=e.geodes;for(let e=0,t=l.length;e<t;e++){var u=l[e],c=u.matrix,h=Cesium.Matrix4.multiply(o.modelMatrix,c,new Cesium.Matrix4);let i;Cesium.defined(a.boundingVolume)&&(i=new Cesium.BoundingSphere(a.boundingVolume.sphere.center,a.boundingVolume.sphere.radius),Cesium.BoundingSphere.transform(i,o.modelMatrix,i));var m=u.skeletonNames;for(let t=0,e=m.length;t<e;t++){var d=m[t],p=r.geoPackage[d],g=p.vertexPackage,_=p.arrIndexPackage,f=p.pickInfo;let e;0<_.length&&(e=n[_[0].materialCode]);p=Cesium.defined(i)?i:function(t,e){var i=new Cesium.BoundingSphere;let o=new Cesium.Cartesian3;var r=t.vertexAttributes[0],n=r.componentsPerAttribute,a=Cesium.defined(t.nCompressOptions)&&(t.nCompressOptions&iu.SVC_Vertex)===iu.SVC_Vertex;let s=1,l,u;u=a?(s=t.vertCompressConstant,l=new Cesium.Cartesian3(t.minVerticesValue.x,t.minVerticesValue.y,t.minVerticesValue.z),new Uint16Array(r.typedArray.buffer,r.typedArray.byteOffset,r.typedArray.byteLength/2)):new Float32Array(r.typedArray.buffer,r.typedArray.byteOffset,r.typedArray.byteLength/4);let c=[];for(let e=0;e<t.verticesCount;e++)Cesium.Cartesian3.fromArray(u,n*e,o),a&&(o=Cesium.Cartesian3.multiplyByScalar(o,s,o),o=Cesium.Cartesian3.add(o,l,o)),c.push(Cesium.Cartesian3.clone(o));return Cesium.BoundingSphere.fromPoints(c,i),Cesium.BoundingSphere.transform(i,e,i),c.length=0,i}(g,h);s[d]=xu[o.fileType]({layer:o,vertexPackage:g,arrIndexPackage:_,pickInfo:f,modelMatrix:h,boundingVolume:p,material:e})}}if(!Cesium.defined(a.boundingVolume)){let e=[];for(var t in s)s.hasOwnProperty(t)&&e.push(s[t].boundingVolume);a.boundingVolume=Cesium.BoundingSphere.fromBoundingSpheres(e)}a.geoMap=s}function Lu(e,t,i,o,r,n,a){this.layer=e,this.parent=t,this.fileName=o,this.isLeafTile=Cesium.defaultValue(a,!1),this.boundingVolume=this.createBoundingVolume(i,e.modelMatrix);let s=Cesium.Resource.createIfNeeded(e._baseResource);if(Cesium.defined(t))this.baseUri=t.baseUri;else{let e=new Cesium.Resource(o);this.baseUri=e.getBaseUri()}this.contentResource=s.getDerivedResource({url:o}),this.serverKey=Cesium.RequestScheduler.getServerKey(this.contentResource.getUrlComponent()),this.request=void 0,this.cacheNode=void 0,this.distanceToCamera=0,this.pixel=0,this.visibilityPlaneMask=0,this.visible=!1,this.children=[],this.lodRangeData=r,this.renderEntityMap=n,this.contentState=tu.UNLOADED,this.readerable=!1,this.touchedFrame=0,this.requestedFrame=0,this.selectedFrame=0,this.priority=0}Iu.parse=function(e,t){if(Cesium.defined(t))return function(i,o,r){var n=o.groupNode;let a=[];for(let t=0,e=n.pageLods.length;t<e;t++){let e={};var s=n.pageLods[t];e.rangeMode=s.rangeMode,e.rangeDataList=s.childTile,e.rangeList=s.rangeList;var l=s.boundingSphere.center,u=s.boundingSphere.radius;""!==e.rangeDataList?e.boundingVolume={sphere:{center:new Cesium.Cartesian3(l.x,l.y,l.z),radius:u}}:e.isLeafTile=!0,Du(i,o,r,s,e),a.push(e)}return a}(e,t,function(o,r){let n={};var a=r.materials.material;for(let e=0,t=a.length;e<t;e++){var s=a[e].material,l=s.id;let i=new fu;n[l]=i;l=s.ambient;i.ambientColor=new Cesium.Color(l.r,l.g,l.b,l.a);l=s.diffuse;i.diffuseColor=new Cesium.Color(l.r,l.g,l.b,l.a);l=s.specular;i.specularColor=new Cesium.Color(l.r,l.g,l.b,l.a),i.shininess=s.shininess,i.bTransparentSorting=s.transparentsorting;var u=s.textureunitstates,c=u.length;for(let t=0;t<c;t++){var h=u[t].textureunitstate,m=h.id,d=0===h.addressmode.u?Cesium.TextureWrap.REPEAT:Cesium.TextureWrap.CLAMP_TO_EDGE,p=0===h.addressmode.v?Cesium.TextureWrap.REPEAT:Cesium.TextureWrap.CLAMP_TO_EDGE;i.texMatrix=Cesium.Matrix4.unpack(h.texmodmatrix);let e=r.texturePackage[m];Cesium.defined(e)&&0<e.imageBuffer.byteLength&&(e.wrapS=d,e.wrapT=p,m=new _u(o,m,e),i.textures.push(m))}}return n}(e.context,t))},Object.defineProperties(Lu.prototype,{renderable:{get:function(){return Cesium.defined(this.renderEntityMap)}}});let Mu=new Cesium.Cartesian3;function Au(e){return e.boundingVolume}function Ru(){this._stack=[]}function Ou(e,t){return e.distanceToCamera-t.distanceToCamera}function Hu(t,i,o){for(;i.length;){let e=i.pop();e.visible&&(r=t,n=e,a=o,n.touchedFrame!==a.frameNumber&&(r._cache.touch(n),n.touchedFrame=a.frameNumber),e.canTraverse()?function(e,t,i){let o,r=e.children;var n=r.length;for(o=0;o<n;++o)r[o].updateVisibility(i);for(r.sort(Ou),o=0;o<n;++o){var a=r[o];a.visible&&t.push(a)}}(e,i,o):(r=t,n=e,a=o,n.renderable&&(r._selectedTiles.push(n),n.selectedFrame=a.frameNumber),r=t,n=e,a=o,n.requestedFrame===a.frameNumber||n.contentState!==tu.UNLOADED||n.isLeafTile||(r._requestTiles.push(n),n.requestedFrame=a.frameNumber)))}var r,n,a}function Vu(){this._list=new Cesium.DoublyLinkedList,this._sentinel=this._list.add(),this._trimTiles=!1}function ku(e){e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),Cesium.Check.defined("options.url",e.url),Cesium.Check.defined("options.context",e.context),this.context=e.context,this._url=void 0,this._basePath=void 0,this._baseResource=void 0,this.modelMatrix=void 0,this.fileType=void 0,this._position=void 0,this._rectangle=void 0,this._rootTiles=[],this._schuduler=new Ru,this._requestTiles=[],this._selectedTiles=[],this._cache=new Vu,this._maximumMemoryUsage=-1,this._totalMemoryUsageInBytes=0,this._readyPromise=Cesium.when.defer(),this.loadConfig(e.url)}function Fu(e,t){return e.priority-t.priority}function Gu(e,t){}function Nu(e,t){this._viewer=e,this._cesium=t,this._core=new V,this._color=new G(this._viewer,this._cesium),this._tree=we,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0}function Bu(e){this._viewer=e,yu=e}function ju(e,t){if(this._viewer=e,this._cesium=t,this._core=new V,!window.Hls){let e=new E(!1);e.addJs(document.body,window.SmartEarthRootUrl+"Workers/hls.js")}}function zu(e,t){if(this._viewer=e,this._cesium=t,this._core=new V,!Cesium.GeoWTFS){let e=new E(!1);e.addJs(document.body,window.SmartEarthRootUrl+"Workers/cesiumTdt.js")}}function Uu(e){this._viewer=e,this._core=new V,this._tree=we}function Wu(e){this._viewer=e,this._core=new V}function Yu(e,t){var h;this._viewer=e,this._cesium=t,this._core=new V,this._Label=new zi(this._viewer,this._cesium),this._Circle=new Bi(this._viewer,this._cesium),this._Box=new Fi(this._viewer,this._cesium),this._Cone=new ao(this._viewer,this._cesium),this._Color=new G(this._viewer,this._cesium),this._Polyline=new Vi(this._viewer,this._cesium),this._Rectangle=new Ni(this._viewer,this._cesium),this._Polygon=new ki(this._viewer,this._cesium),this._ImageLabel=new On(this._viewer,this._cesium),this._GeoJsonFeatureLayer=new Oe(this._viewer,this._cesium,this._ImageryProvidererid),this._Ellipsoid=new Gi(this._viewer,this._cesium),this._PointModel=new Ye(this._viewer,this._cesium),this._wall=new Hn(this._viewer,this._cesium),this._Terrain=new Ml(this._viewer,this._cesium),this._createdynamicObject=new Ui(this._viewer,this._cesium),this._GeometryCreator,this._ImageryLayer=new Fn(this._viewer,this._cesium),this._VolumeGeoJsonFeatureLayer=void 0,this._PolygonVectorGeoJsonFeatureLayer=void 0,this._skyBox=new Vl(this._viewer,this._cesium),this._flowField=new kl(this._viewer,this._cesium),this.VectorGeoJsonFeatureLayer=new Ge(this._viewer,this._cesium),this._straightArrow=new Yl(this._viewer,this._cesium),this._SimpleGraphic=new Tt(this._viewer,this._cesium),this._popupmessage=new xe(this._viewer,this._cesium),this.VectorImgFeatureLayer=new Nu(this._viewer,this._cesium),this._TerrainModifier=new Bu(this._viewer,this._cesium),t.Resource._Implementations.createImageSGS||(h=new ko({workerPath:window.SmartEarthRootUrl+"/Workers/nullValueRemoveWorker.js"}),t.Resource._Implementations.createImageSGS=function(e,t,n){var i,a,s={r:0,g:0,b:0,a:255};-1<e.indexOf("nullvalue=")&&(i=e.split("nullvalue=")[1].split("&")[0].split("%2C"),s.r=i[0],s.g=i[1],s.b=i[2]),-1<e.indexOf("nulltolerance=")&&(a=e.split("nulltolerance=")[1].split("&")[0]);var l=new Image,u=document.createElement("canvas"),c=u.getContext("2d");l.url=e,l.onload=function(){if(null!=l.url&&-1!=l.url.indexOf("nullvalue")){delete l.url,u.width=l.width,u.height=l.height,c.drawImage(l,0,0),l.imageProcesses=[];for(var e=l.width/8,t=l.height,i=0;i<8;i++){var o=i*e,r=c.getImageData(o,0,e,t).data;l.imageProcesses[i]=h.queueWorkItem({nullValue:s,nullTolerance:a,canvasData:r,width:e,height:t,startX:o})}Cesium.when.all(l.imageProcesses,function(e){for(var t=0;t<e.length;t++){for(var i=c.createImageData(e[t].width,e[t].height),o=0;o<e[t].canvasData.length;o++)i.data[o]=e[t].canvasData[o];c.putImageData(i,e[t].startX,0)}l.src=u.toDataURL(),n.resolve(l)}).otherwise(function(e){console.log(e)})}else n.resolve(l)},l.onerror=function(e){n.reject(e)},t&&(Cesium.TrustedServers.contains(e)?l.crossOrigin="use-credentials":l.crossOrigin=""),l.src=e})}function qu(e,t){this._viewer=e,this._cesium=t}function Qu(e,t){this._viewer=e,this._cesium=t,this._current=new qu(this._viewer,this._cesium)}function Ju(e,t){this._viewer=e,this._cesium=t,this._Core=new V}function Xu(e,t){this._viewer=e,this._cesium=t}Lu.prototype.createBoundingVolume=function(e,t){return this.isLeafTile?new Cesium.TileBoundingSphere(e.center,e.radius):Cesium.defined(e.sphere)?(i=e.sphere,o=t,r=Cesium.Cartesian3.clone(i.center),i=i.radius,r=Cesium.Matrix4.multiplyByPoint(o,r,r),o=Cesium.Matrix4.getScale(o,Mu),i*=Cesium.Cartesian3.maximumComponent(o),new Cesium.TileBoundingSphere(r,i)):Cesium.defined(e.box)?(i=e.box,e=t,t=new Cesium.Cartesian3(i.min.x,i.min.y,i.min.z),Cesium.Matrix4.multiplyByPoint(e,t,t),i=new Cesium.Cartesian3(i.max.x,i.max.y,i.max.z),Cesium.Matrix4.multiplyByPoint(e,i,i),t=Cesium.BoundingSphere.fromCornerPoints(t,i,new Cesium.BoundingSphere),i=t.center,t=t.radius,e=Cesium.Matrix4.getScale(e,Mu),t*=Cesium.Cartesian3.maximumComponent(e),new Cesium.TileBoundingSphere(i,t)):void 0;var i,o,r},Lu.prototype.canTraverse=function(){return 0!==this.children.length&&!this.isLeafTile&&(!Cesium.defined(this.lodRangeData)||this.pixel>this.lodRangeData)},Lu.prototype.getPixel=function(e){var t=this.boundingVolume,i=t.radius,o=t.center,t=Cesium.Cartesian3.distance(e.camera.positionWC,o),o=e.context.drawingBufferHeight,e=.5*e.camera.frustum._fovy;return.5*o/Math.tan(e)*i/t},Lu.prototype.distanceToTile=function(e){let t=Au(this);return t.distanceToCamera(e)},Lu.prototype.visibility=function(e,t){var i=Au(this);return e.cullingVolume.computeVisibilityWithPlaneMask(i,t)},Lu.prototype.updateVisibility=function(e){var t=this.parent,t=Cesium.defined(t)?t.visibilityPlaneMask:Cesium.CullingVolume.MASK_INDETERMINATE;this.distanceToCamera=this.distanceToTile(e),this.pixel=this.getPixel(e),this.visibilityPlaneMask=this.visibility(e,t),this.visible=this.visibilityPlaneMask!==Cesium.CullingVolume.MASK_OUTSIDE},Lu.prototype.requestContent=function(){let i=this;this.layer;let e=this.contentResource.clone(),t=new Cesium.Request({throttle:!0,throttleByServer:!0,type:Cesium.RequestType.TILES3D,priorityFunction:function(){return o.priority},serverKey:(o=this).serverKey});var o,r;this.request=t,e.request=t;let n=e.fetchArrayBuffer();if(!Cesium.defined(n))return!1;this.contentState=tu.LOADING,this.contentReadyPromise=Cesium.when.defer();let a=(r=this,function(e){r.contentState=tu.FAILED,r.contentReadyPromise.reject(e)});return n.then(function(e){var t;i.isDestroyed()?a():(t=ru.parseBuffer(e),e=Iu.parse(i.layer,t),function(t,i){var o=t.layer,r=i.length;for(let e=0;e<r;e++){var n=i[e],a=n.boundingVolume,s=n.rangeDataList,n=new Lu(o,t,a,s=t.baseUri+s,n.rangeList,n.geoMap,n.isLeafTile);t.children.push(n),t.layer._cache.add(n)}}(i,e),i.selectedFrame=0,i.contentState=tu.READY,i.contentReadyPromise.resolve(t))}).otherwise(function(e){t.state!==Cesium.RequestState.CANCELLED?a(e):i.contentState=tu.UNLOADED}),!0},Lu.prototype.update=function(e){let t=this.renderEntityMap;for(var i in t)t.hasOwnProperty(i)&&t[i].update(e)},Lu.prototype.free=function(){for(let t=0,e=this.children.length;t<e;t++){let e=this.children[t];e.destroy()}this.children.length=0,this.contentState=tu.UNLOADED},Lu.prototype.isDestroyed=function(){return!1},Lu.prototype.destroy=function(){for(var e in this.renderEntityMap)this.renderEntityMap.hasOwnProperty(e)&&this.renderEntityMap[e].destroy();this.renderEntityMap=void 0;for(let t=0,e=this.children.length;t<e;t++){let e=this.children[t];e.destroy()}return this.children.length=0,Cesium.destroyObject(this)},Ru.prototype.scheduler=function(e,t){e._requestTiles.length=0,e._selectedTiles.length=0;var i=this._stack;!function(i,o,r){for(let t=o.length=0,e=i._rootTiles.length;t<e;t++){let e=i._rootTiles[t];e.updateVisibility(r),e.visible&&o.push(e)}}(e,i,t),Hu(e,i,t)},Vu.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)},Vu.prototype.touch=function(e){e=e.cacheNode;Cesium.defined(e)&&this._list.splice(this._sentinel,e)},Vu.prototype.add=function(e){Cesium.defined(e.cacheNode)||(e.cacheNode=this._list.add(e))},Vu.prototype.unloadTile=function(e,t,i){var o=t.cacheNode;Cesium.defined(o)&&(this._list.remove(o),t.cacheNode=void 0,i(e,t))},Vu.prototype.unloadTiles=function(t,i){var e=this._trimTiles;this._trimTiles=!1;var o=this._list,r=1024*t.maximumMemoryUsage*1024,n=this._sentinel;let a=o.head;for(;a!==n&&(t.totalMemoryUsageInBytes>r||e);){let e=a.item;a=a.next,e.isDestroyed(),this.unloadTile(t,e,i)}},Vu.prototype.trim=function(){this._trimTiles=!0},Object.defineProperties(ku.prototype,{ready:{get:function(){return 0<this._rootTiles.length}},readyPromise:{get:function(){return this._readyPromise}},rectangle:{get:function(){return this._rectangle}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes},set:function(e){this._totalMemoryUsageInBytes=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}}}),ku.prototype.loadConfig=function(e){let a=this;Cesium.when(e).then(function(e){let t=Cesium.Resource.createIfNeeded(e);return e=t.getBaseUri(!0),a._url=t.url,a._basePath=e,a._baseResource=t,t.fetchJson()}).then(function(i){var e=i.extensions;a.fileType=e["s3m:FileType"];var t=i.position.x,o=i.position.y,e=i.position.z;a._position=Cesium.Cartesian3.fromDegrees(t,o,e),a.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a._position),a._rectangle=Cesium.Rectangle.fromDegrees(i.geoBounds.left,i.geoBounds.bottom,i.geoBounds.right,i.geoBounds.top);for(let e=0,t=i.tiles.length;e<t;e++){var r=i.tiles[e].url,n={box:i.tiles[e].boundingbox},r=new Lu(a,void 0,n,r);a._cache.add(r),a._rootTiles.push(r)}a._readyPromise.resolve(a)}).otherwise(function(e){a._readyPromise.reject(e)})},ku.prototype.prePassesUpdate=function(e){this.ready&&e.newFrame&&this._cache.reset()},ku.prototype.update=function(e){this.ready&&(this._schuduler.scheduler(this,e),function(e){let i=e._requestTiles;var o=i.length;i.sort(Fu);for(let t=0;t<o;++t){let e=i[t];e.requestContent()}}(this),function(e,t){let i=e._selectedTiles;var o=i.length;for(let e=0;e<o;e++)i[e].update(t)}(this,e),(e=this)._cache.unloadTiles(e,Gu))},Nu.prototype.CreateVectorImageFeatureLayer=function(e,t,i,s,o,r,n){var a={url:"",queryParameters:{layer:"",style:"",tilematrixset:"EPSG:4326",Service:"WMTS",Request:"GetTile",Version:"1.0.0",Format:"image/png",TileMatrix:"EPSG:4326:",TileCol:"",TileRow:""}};this._option=this._core.extend(a,t,!0),this._queryOption=i;var l=this._core.extend(a,t,!0),u=i;null==t&&console.log("options is required");var c=this;this._Provider=new He(this._viewer,this._cesium),this._Provider.loadTile=function(e,a){!function(i,o,r,e,n){if(a.state===Cesium.QuadtreeTileLoadState.START){if(a.data={lines:[],geometryPrimitive:void 0},!(a.level>=s.level_min&&a.level<s.level_max&&e.item.show))return a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0;l.queryParameters.TileMatrix=l.queryParameters.tilematrixset+":"+i.level,l.queryParameters.TileCol=i.x,l.queryParameters.TileRow=i.y,new Cesium.Resource(l).fetchImage().then(function(e){var t=new Cesium.Rectangle(0,0,0,0);n._tilingScheme.tileXYToRectangle(i.x,i.y,i.level,t);e=new Cesium.GroundPrimitive({geometryInstances:[{geometry:new Cesium.RectangleGeometry({rectangle:t})}],appearance:new Cesium.Appearance({material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}})})});e.cusResource=r,a.data.geometryPrimitive=e,a.state=Cesium.QuadtreeTileLoadState.LOADING,a.state===Cesium.QuadtreeTileLoadState.LOADING&&(a.data.geometryPrimitive.update(o,[]),a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0)},function(e){console.log(e)}),a.state=Cesium.QuadtreeTileLoadState.LOADING,a.state=Cesium.QuadtreeTileLoadState.LOADING}}(a,e,u,c,this)},this._primitive=new c._cesium.QuadtreePrimitivezh({tileProvider:this._Provider});i=this._viewer.scene;i.primitives.add(this._primitive),i.primitivesQuadTrees&&i.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(t.id)&&(t.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+t.id);e={id:t.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"rasterLayer",item:this,options:this._option,queryOptions:this._queryOption};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},Nu.prototype.setTreeobj=function(e){this.treeobj=e},Nu.prototype.setVisibility=function(e){try{this._Provider&&this._Provider.setStatus&&this._Provider.setStatus(e)}catch(e){}},Nu.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},Bu.prototype.findDirectParent=function(e){try{var t=[];if(e.width==Math.PI)return null;for(var i=0;i<yu.scene.globe._surface._tilesToRender.length;i++){var o=yu.scene.globe._surface._tilesToRender[i],r=o._rectangle;Cesium.Rectangle.intersection(r,e)&&t.push(o)}return t}catch(e){}return null},Bu.prototype.createTerrainModifier=function(e,t,i){var o=t.length,r=new Array(o);r.fill(i);var n=Cesium.createGuid(),o=Date.now(),i=Cesium.Rectangle.fromCartesianArray(t),a=this.findDirectParent(i);this._viewer.terrainProvider&&void 0===this._viewer.terrainProvider._modifyTerrainObjects&&(this._viewer.terrainProvider._modifyTerrainObjects=[]);var s=this._viewer,o={id:n,name:e,show:!0,rectangle:i,vertices:t,heights:r,timeStamp:o,remove:function(){if(s.terrainProvider&&s.terrainProvider._modifyTerrainObjects)for(var e=s.terrainProvider._modifyTerrainObjects.length-1;0<=e;e--)s.terrainProvider._modifyTerrainObjects[e].id==n&&s.terrainProvider._modifyTerrainObjects.splice(e,1);if(a)try{for(e=0;e<a.length;e++)try{a[e]._parent.freeResources()}catch(e){}}catch(e){}}};if(this._viewer.terrainProvider._modifyTerrainObjects.push(o),a)try{for(var l=0;l<a.length;l++)try{a[l]._parent.freeResources()}catch(e){}}catch(e){}return o},ju.prototype.Video3D=function(e){return this.sp=e.cameraPosition||void 0,this.ep=e.position||void 0,this.alpha=e.alpha||.7,this.horizonAngle=e.horizonAngle||60,this.verticalAngle=e.verticalAngle||30,this.angleZ=e.angleZ||0,this.angle=new Cesium.Cartesian3(this.horizonAngle/2,this.verticalAngle/2,this.angleZ),this.near=e.near||1,this.far=e.far||30,this.offset=e.offset||.1,this.nearAndFar=new Cesium.Cartesian4(this.near,this.far,this.alpha,this.offset),this.video=e.video||void 0,this.videoType=e.type||"mp4",this.center=new Cesium.Cartesian3,this.eupp=new Cesium.Cartesian3,this.epp=new Cesium.Cartesian3,this.upp=this.setSpHeight(this.sp),this.useLine=Cesium.defaultValue(e.useLine,!0),this.controlPoint=null,this.addVideo(e.url),this},ju.prototype.addVideo=function(e){var t,i;this.video||(t=`<video id="${i="Video3D"+this._core.getuid()}" autoplay muted loop crossorigin  style="display: none"></video>`,$(this._viewer.container).append(t),this.video=document.getElementById(i),"hls"!==this.videoType||this.video.canPlayType("application/vnd.apple.mpegurl")?this.video.src=e:Hls.isSupported()&&((i=new Hls).loadSource(e),i.attachMedia(this.video))),this.video.oncanplay=()=>{this.init&&this.init()}},ju.prototype.setSpHeight=function(e,t=5e3){let i=Cesium.Cartographic.fromCartesian(e);return i.height+=t,Cesium.Cartographic.toCartesian(i)},ju.prototype.createLine=function(i,o,r){if(this.line&&(this._viewer.scene.primitives.remove(this.line),this.line=null),this.useLine){this.controlPoint?this.controlPoint.position=this.ep:this.controlPoint=this._viewer.entities.add({position:this.ep,point:{pixelSize:10,color:Cesium.Color.RED}});var n=Cesium.Cartesian3.subtract(o,i,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(n,n);o=Cesium.Cartesian3.subtract(r,i,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(o,o);r=Cesium.Cartesian3.cross(n,o,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(r,r),Cesium.Cartesian3.cross(r,n,o),Cesium.Cartesian3.normalize(o,o);var a=new Cesium.Matrix4.fromArray([r.x,r.y,r.z,0,o.x,o.y,o.z,0,n.x,n.y,n.z,0,i.x,i.y,i.z,1]),r=-this.angleZ*Math.PI/180,o=Math.cos(r),n=Math.sin(r),s=Cesium.Matrix4.fromArray([o,-n,0,0,n,o,0,0,0,0,1,0,0,0,0,1]),r=this.nearAndFar.y,n=Math.tan(this.horizonAngle/2/180*Math.PI)*r,o=Math.tan(this.verticalAngle/2/180*Math.PI)*r;let e=[new Cesium.Cartesian3(-n,-o,r),new Cesium.Cartesian3(n,-o,r),new Cesium.Cartesian3(n,o,r),new Cesium.Cartesian3(-n,o,r)],t=[];var l,u=e.slice();for(l in e){Cesium.Matrix4.multiplyByPoint(s,e[l],e[l]),Cesium.Matrix4.multiplyByPoint(a,e[l],u[l]);var c=new Cesium.PolylineGeometry({positions:[i,u[l]]}),c=new Cesium.GeometryInstance({geometry:c});t.push(c)}this.line=new Cesium.Primitive({geometryInstances:t,appearance:new Cesium.PolylineMaterialAppearance({translucent:!1,material:new Cesium.Material({translucent:!1,fabric:{type:"Color",uniforms:{color:Cesium.Color.RED}}})}),asynchronous:!1}),this._viewer.scene.primitives.add(this.line)}},ju.prototype.init=function(){if(!this.post||!this.texture){if(this.video&&this.video.readyState===this.video.HAVE_ENOUGH_DATA&&this.video.play(),!(this.upp instanceof Cesium.Cartesian3))throw new Error("计算上方向错误");this.createLine(this.sp,this.ep,this.upp);const t=this.video,i=this;let e=this._viewer.scene.context.uniformState;this.texture=new Cesium.Texture({context:this._viewer.scene.context,source:t,width:1,height:1}),this.post=new Cesium.PostProcessStage({uniforms:{cen:function(){return Cesium.Matrix4.multiplyByPoint(e.view3D,i.sp,i.center)},ep:function(){return Cesium.Matrix4.multiplyByPoint(e.view3D,i.ep,i.epp)},eupp:function(){return Cesium.Matrix4.multiplyByPoint(e.view3D,i.upp,i.eupp)},video:function(){return t&&2<=t.readyState&&i.texture.copyFrom({source:t}),i.texture},angle:function(){return i.angle},nearAndFar:function(){return i.nearAndFar}},fragmentShader:this.getFS1()+this.getFS2()+`
                      uniform sampler2D colorTexture;
                      uniform sampler2D depthTexture;
                      varying vec2 v_textureCoordinates;
              
                      uniform vec3 cen;
                      uniform vec3 ep;
                      uniform vec3 eupp;
                      uniform vec3 angle;
                      uniform vec4 nearAndFar;
              
                      uniform sampler2D video;
              
                      mat4 computeMat(){
                        vec3 dir = normalize( ep - cen );
                        vec3 up = normalize( eupp - cen);//vec3( 0. ,0. , 1.);
                        vec3 right = cross(dir , up);
                        right = normalize(right);
                        up = cross(right , dir);
                        up = normalize(up);
              
                        return mat4(
                          right.x,right.y,right.z,0.,
                          up.x,up.y,up.z,0.,
                          dir.x,dir.y,dir.z,0.,
                          cen.x,cen.y,cen.z,1.
                        );
                        // return mat4(
                        //   right.x ,up.x ,dir.x , cen.x,
                        //   right.y ,up.y ,dir.y , cen.y,
                        //   right.z ,up.z ,dir.z , cen.z,
                        //   0. ,0.,0.,1.
                        // );
                      }
                      mat3 computeMat3(float an){
                        float sa = sin(an);
                        float ca = cos(an);
                        return mat3( 
                          ca , -sa ,0.,
                          sa , ca , 0.,
                          0.,0.,1.
                        );
                      }
                      void setNormalColor(vec3 p , vec4 oc){
                        if( p.z < nearAndFar.x || p.z > nearAndFar.y){
                          gl_FragColor = oc;
                          return;
                        }
                        
                        mat3 rm = computeMat3( radians( angle.z ) );
                        p = rm * p;
                        
                        vec3 n = p.xyz;
                        vec3 zn = vec3(0.,0.,1.);
                        float dist = dot( n , zn);
                        float dx = p.x ;
                        float xangle = tan(radians( angle.x ));
                        float yangle = tan(radians( angle.y ));
                        float tanx = p.x / dist;
                        float tany = p.y / dist;
                        if( (tanx > -xangle && tanx< xangle) &&(tany > -yangle && tany < yangle)){
                          // gl_FragColor = vec4(1.);
                          // return;
                          float r = (tanx + xangle) / (2. * xangle);
                          float g = (tany + yangle) / (2. * yangle);
                          vec4 col = texture2D( video , vec2( r , g));
                          float f1 = 1.;
              
                          float v1 = nearAndFar.w ;//羽化距离
                          float v2 = 1. - v1;
                          if(r < v1){
                            f1 = r / v1;
                          }
                          if(r > v2){
                            f1 = (1. - r) / v1;
                          }
                          float f2 = 1.;
                          if(g < v1){
                            f2 = g / v1;
                          }
                          if(g > v2){
                            f2 = (1. - g) / v1;
                          }
                          float f12 = f1 * f2;
                          // float ff = f12;
                          float ff = smoothstep(  0. , 1. , f12 );
                          ff *= nearAndFar.z;
                          // ff = pow(ff , 0.5);
                          gl_FragColor = mix(oc , col , ff);
                          // gl_FragColor = mix(oc , vec4(1.) , 0.5);
                        }else{
                          gl_FragColor = oc;
                        }
                      }
                      void main(){
                        vec2 uv = v_textureCoordinates;
                        float depth = getDepth(texture2D( depthTexture , uv));
                        vec4 oc = texture2D(colorTexture , uv);
                        vec4 ec = toEye( uv , depth);
                        ec /= ec.w;
              
                        vec3 snor = normalize( ep - cen);
              
                        vec3 pd = ec.xyz - cen;
                        float dd = length(pd);
                        vec3 n = normalize(ec.xyz - cen);
                        float d = dot(n ,  snor);
              
                        mat4 localMat = computeMat();
              
                        vec4 p = inverse_mat4(localMat) * ec;
                        p/=p.w;
                        // setColor1( p.xyz , oc);
                        setNormalColor( p.xyz , oc);
                      }
                      `}),this._viewer.scene.postProcessStages.add(this.post)}},ju.prototype.update=function(e){var t=e.horizonAngle,i=e.verticalAngle,o=e.angleZ;isNaN(t)||"number"!=typeof t||(this.horizonAngle=t,this.angle.x=t/2),isNaN(i)||"number"!=typeof i||(this.verticalAngle=i,this.angle.y=i/2),isNaN(o)||"number"!=typeof o||(this.angleZ=this.angle.z=o);var r=e.startPos;r&&r instanceof Cesium.Cartesian3&&(this.sp.x=r.x,this.sp.y=r.y,this.sp.z=r.z);t=e.endPos;t&&t instanceof Cesium.Cartesian3&&(this.ep.x=t.x,this.ep.y=t.y,this.ep.z=t.z);i=e.near,o=e.far,r=e.offset,t=e.alpha;i&&!isNaN(i)&&"number"==typeof i&&(this.nearAndFar.x=i),o&&!isNaN(o)&&"number"==typeof o&&(this.nearAndFar.y=o),r&&!isNaN(r)&&"number"==typeof r&&(this.nearAndFar.w=r),t&&!isNaN(t)&&"number"==typeof t&&(this.nearAndFar.z=t),void 0!==e.useLine&&(this.useLine=e.useLine),this.createLine(this.sp,this.ep,this.upp)},ju.prototype.destroy=function(){for(var e in this.post&&(this._viewer.scene.postProcessStages.remove(this.post),this.post.destroy(),this.post=void 0),this.texture&&(this.texture.destroy(),this.texture=void 0),this.video&&this.video.remove(),this.line&&(this._viewer.scene.primitives.remove(this.line),this.line=null),this.controlPoint&&this._viewer.entities.remove(this.controlPoint),this)delete this[e]},ju.prototype.getFS1=function(){return"vec4 toEye(in vec2 uv, in float depth){\r\n    vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\r\n    vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\r\n    posInCamera =posInCamera / posInCamera.w;\r\n    return posInCamera;\r\n}\r\nfloat getDepth(in vec4 depth){\r\n    float z_window = czm_unpackDepth(depth);\r\n    z_window = czm_reverseLogDepth(z_window);\r\n    float n_range = czm_depthRange.near;\r\n    float f_range = czm_depthRange.far;\r\n    return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\r\n}\r\n"},ju.prototype.getFS2=function(){return`
                    mat4 inverse_mat4(mat4 m)
                      {
                          float Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
                          float Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3];
                          float Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3];
              
                          float Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
                          float Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3];
                          float Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3];
              
                          float Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2];
                          float Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2];
                          float Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2];
              
                          float Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3];
                          float Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3];
                          float Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3];
              
                          float Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2];
                          float Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2];
                          float Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2];
              
                          float Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1];
                          float Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1];
                          float Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1];
              
                          const vec4 SignA = vec4( 1.0, -1.0,  1.0, -1.0);
                          const vec4 SignB = vec4(-1.0,  1.0, -1.0,  1.0);
              
                          vec4 Fac0 = vec4(Coef00, Coef00, Coef02, Coef03);
                          vec4 Fac1 = vec4(Coef04, Coef04, Coef06, Coef07);
                          vec4 Fac2 = vec4(Coef08, Coef08, Coef10, Coef11);
                          vec4 Fac3 = vec4(Coef12, Coef12, Coef14, Coef15);
                          vec4 Fac4 = vec4(Coef16, Coef16, Coef18, Coef19);
                          vec4 Fac5 = vec4(Coef20, Coef20, Coef22, Coef23);
              
                          vec4 Vec0 = vec4(m[1][0], m[0][0], m[0][0], m[0][0]);
                          vec4 Vec1 = vec4(m[1][1], m[0][1], m[0][1], m[0][1]);
                          vec4 Vec2 = vec4(m[1][2], m[0][2], m[0][2], m[0][2]);
                          vec4 Vec3 = vec4(m[1][3], m[0][3], m[0][3], m[0][3]);
              
                          vec4 Inv0 = SignA * (Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2);
                          vec4 Inv1 = SignB * (Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4);
                          vec4 Inv2 = SignA * (Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5);
                          vec4 Inv3 = SignB * (Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5);
              
                          mat4 Inverse = mat4(Inv0, Inv1, Inv2, Inv3);
              
                          vec4 Row0 = vec4(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]);
              
                          float Determinant = dot(m[0], Row0);
              
                          Inverse /= Determinant;
              
                          return Inverse;
                      }
                    `},ju.prototype.changeHorizonAngle=function(e){this.update({horizonAngle:parseFloat(e)})},ju.prototype.changeVerticalAngle=function(e){this.update({verticalAngle:parseFloat(e)})},ju.prototype.changeRotateAngle=function(e){this.update({angleZ:parseFloat(e)})},zu.prototype.GeoWTFS=function(e){var t=(e=e||{}).token||"c53eb074c3fcba5ac86103d4d711bbe8",i=e.url||"https://t{s}.tianditu.gov.cn/",o={viewer:this._viewer,subdomains:["0","1","2","3","4","5","6","7"],metadata:{boundBox:{minX:-180,minY:-90,maxX:180,maxY:90},minLevel:1,maxLevel:20},aotuCollide:!0,collisionPadding:[5,10,8,5],serverFirstStyle:!0,labelGraphics:{font:"28px sans-serif",fontSize:28,fillColor:Cesium.Color.WHITE,scale:.5,outlineColor:Cesium.Color.BLACK,outlineWidth:5,style:Cesium.LabelStyle.FILL_AND_OUTLINE,showBackground:!1,backgroundColor:Cesium.Color.RED,backgroundPadding:new Cesium.Cartesian2(10,10),horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,eyeOffset:Cesium.Cartesian3.ZERO,pixelOffset:new Cesium.Cartesian2(0,8),heightReference:1,disableDepthTestDistance:Number.POSITIVE_INFINITY},billboardGraphics:{horizontalOrigin:Cesium.HorizontalOrigin.RIGHT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,eyeOffset:Cesium.Cartesian3.ZERO,pixelOffset:Cesium.Cartesian2.ZERO,alignedAxis:Cesium.Cartesian3.ZERO,color:Cesium.Color.WHITE,rotation:0,scale:1,width:18,height:18,heightReference:1,disableDepthTestDistance:Number.POSITIVE_INFINITY}};e=this._core.extend(o,e,!0);e=new Cesium.GeoWTFS(e);return e.getTileUrl=function(){return i+"mapservice/GetTiles?lxys={z},{x},{y}&tk="+t},e.getIcoUrl=function(){return i+"mapservice/GetIcon?id={id}&tk="+t},e.initTDT([{x:6,y:1,level:2,boundBox:{minX:90,minY:0,maxX:135,maxY:45}},{x:7,y:1,level:2,boundBox:{minX:135,minY:0,maxX:180,maxY:45}},{x:6,y:0,level:2,boundBox:{minX:90,minY:45,maxX:135,maxY:90}},{x:7,y:0,level:2,boundBox:{minX:135,minY:45,maxX:180,maxY:90}},{x:5,y:1,level:2,boundBox:{minX:45,minY:0,maxX:90,maxY:45}},{x:4,y:1,level:2,boundBox:{minX:0,minY:0,maxX:45,maxY:45}},{x:5,y:0,level:2,boundBox:{minX:45,minY:45,maxX:90,maxY:90}},{x:4,y:0,level:2,boundBox:{minX:0,minY:45,maxX:45,maxY:90}},{x:6,y:2,level:2,boundBox:{minX:90,minY:-45,maxX:135,maxY:0}},{x:6,y:3,level:2,boundBox:{minX:90,minY:-90,maxX:135,maxY:-45}},{x:7,y:2,level:2,boundBox:{minX:135,minY:-45,maxX:180,maxY:0}},{x:5,y:2,level:2,boundBox:{minX:45,minY:-45,maxX:90,maxY:0}},{x:4,y:2,level:2,boundBox:{minX:0,minY:-45,maxX:45,maxY:0}},{x:3,y:1,level:2,boundBox:{minX:-45,minY:0,maxX:0,maxY:45}},{x:3,y:0,level:2,boundBox:{minX:-45,minY:45,maxX:0,maxY:90}},{x:2,y:0,level:2,boundBox:{minX:-90,minY:45,maxX:-45,maxY:90}},{x:0,y:1,level:2,boundBox:{minX:-180,minY:0,maxX:-135,maxY:45}},{x:1,y:0,level:2,boundBox:{minX:-135,minY:45,maxX:-90,maxY:90}},{x:0,y:0,level:2,boundBox:{minX:-180,minY:45,maxX:-135,maxY:90}}]),e},Uu.prototype.createPolygonLayer=function(e={}){let o={color:e.color||"rgba(135,206,235,0.6)",image:e.image||window.SmartEarthRootUrl+D.water,height:e.height,extrudedHeight:e.extrudedHeight,frequency:e.frequency||1e3,speed:e.speed||10,amplitude:e.amplitude||10,near:e.near,far:e.far,id:e.id||this._core.getuid()};Cesium.Color.fromCssColorString(o.color);let t=Cesium.GeoJsonDataSource.load(e.url),r=new Cesium.PrimitiveCollection;t.then(e=>{var t=e.entities.values;for(let e=0;e<t.length;e++){var i=t[e];this.addPolygon(r,i,o)}}),this.item=this._viewer.scene.primitives.add(r);e={id:o.id,name:"新建水面图层",pId:0,type:"polygonLayer",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},Uu.prototype.addPolygon=async function(e,t,i){var o=Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,r=Cesium.Color.fromCssColorString(i.color),o=new Cesium.PolygonGeometry({polygonHierarchy:t.polygon.hierarchy.getValue(),extrudedHeight:i.extrudedHeight,height:i.height,vertexFormat:o}),t=new Cesium.GeometryInstance({geometry:o,id:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(i.near,i.far)}});let n;n=i.height||i.extrudedHeight?Cesium.Primitive:Cesium.GroundPrimitive;i=new n({geometryInstances:t,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:r,blendColor:r,normalMap:i.image,frequency:i.frequency,animationSpeed:i.speed/1e3,amplitude:i.amplitude}}})}),classificationType:i.classificationType});e.add(i)},Uu.prototype.setTreeobj=function(e){this.treeobj=e},Uu.prototype.deleteObject=function(){try{this._viewer.scene.primitives.remove(this.item)}catch(e){console.log(e)}},Uu.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},Wu.prototype.create=function(e,t={}){this.grid=this._core.defaultValue(t.grid,!0);let f=t.center,y=t.scale||1;return this._core.getJSON(e,n=>{var a=Math.max(...n.mData)*y,s=n.mHorPointsNum,l=n.mVerPointsNum;if(n.mCenterPoint&&n.mCenterPoint.length&&(f=n.mCenterPoint),f){var u=new Float64Array(3*n.mData.length),c=0,h=new Float32Array(2*n.mData.length),m=0,d=new Uint16Array(s*(l-1)*2*3),p=0;let r=0;for(let i=n.mHStartAngle,o=0;i<n.mHEndAngle;i+=n.mHStep,o++)for(let e=n.mVStartAngle,t=0;e<=n.mVEndAngle;e+=n.mVStep,t++){var g=n.mData[r++]*y,_=this._core.getPositionFromHPR(f,g,i,e),_=Cesium.Cartesian3.fromDegrees(_.lon,_.lat,_.height);u[c++]=_.x,u[c++]=_.y,u[c++]=_.z,h[m++]=(o+1)/s,h[m++]=Math.pow(g/a,3),0!==o&&0!==t&&(d[p++]=(o-1)*l+(t-1),d[p++]=(o-1)*l+t,d[p++]=o*l+t-1,d[p++]=(o-1)*l+t,d[p++]=o*l+t,d[p++]=o*l+t-1,o===s-1&&(d[p++]=t-1,d[p++]=t,d[p++]=o*l+t-1,d[p++]=t,d[p++]=o*l+t,d[p++]=o*l+t-1))}this.addGeometry({positions:u,st:h,indexs:d,minColor:t.minColor,maxColor:t.maxColor},t.flyTo)}else console.log("缺少场强中心坐标")}),this},Wu.prototype.addGeometry=function(e,t){var i=new Cesium.Geometry({attributes:{position:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),st:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:e.st})},indices:e.indexs,primitiveType:this.grid?Cesium.PrimitiveType.LINES:Cesium.PrimitiveType.TRIANGLES,boundingSphere:Cesium.BoundingSphere.fromVertices(e.positions)}),o=new Cesium.GeometryInstance({geometry:i});this.item=new Cesium.Primitive({geometryInstances:o,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{uniforms:{color1:Cesium.Color.fromCssColorString(e.minColor||"#ff0000"),color2:Cesium.Color.fromCssColorString(e.maxColor||"#00ff00")},source:this.getShader()}})}),asynchronous:!1}),this._viewer.scene.primitives.add(this.item),t&&this._viewer.camera.flyToBoundingSphere(i.boundingSphere)},Wu.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},Wu.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item)},Wu.prototype.getShader=function(){return"uniform vec4 color1;\n    uniform vec4 color2;\n    czm_material czm_getMaterial(czm_materialInput materialInput)\n    {\n        czm_material material = czm_getDefaultMaterial(materialInput);\n        vec2 st = materialInput.st;\n        material.diffuse = color1.rgb * (1.0 - st.y) + color2.rgb * st.y; \n        material.alpha = color1.a * (1.0 - st.y) + color2.a * st.y;\n        return material;\n    }\n        "},Yu.prototype.create3DTilesets=function(e,t,i,o,r,n,a){a=this._D3Tileset.create3DTilesets(e,t,i,o,r,n,a);return this._D3Tilesets||(this._D3Tilesets=[],this._3DTilesets=[]),this._D3Tilesets.push(a.item),a},Yu.prototype.set3DTilesetsAlpha=function(t){this._D3Tilesets&&this._D3Tilesets.forEach(e=>{e.style=0==t?new Cesium.Cesium3DTileStyle({show:!1}):1==t?new Cesium.Cesium3DTileStyle({show:!0}):new Cesium.Cesium3DTileStyle({color:`color('rgba(255,255,255,${t})')`})})},Yu.prototype.createTerrainModifier=function(e,t,i){return this._TerrainModifier.createTerrainModifier(e,t,i)},Yu.prototype.createS3MLayer=function(e,t,i){let o=new ku({context:t._context,url:e});return t.primitives.add(o),o.readyPromise.then(function(){i&&i()}).otherwise(function(e){console.log(e)}),o},Yu.prototype.createWaterPolygonLayer=function(e={}){let t=new Uu(this._viewer);return t.createPolygonLayer(e)},Yu.prototype.createCloudMap=function(e,t,i,o){return new ki(this._viewer,this._cesium).createCloudMap(e,t,i,o)},Yu.prototype.addVideoPolygon=function(e,t){return new ki(this._viewer,this._cesium).addVideoPolygon(e,t)},Yu.prototype.addVideoBox=function(e,t){return new ki(this._viewer,this._cesium).addVideoBox(e,t)},Yu.prototype.CZML=function(e,t,i){let o=new Xl(this._viewer,this._cesium);return o.addCZML(e,t,i)},Yu.prototype.addHeatMap=function(e,t){let i=new Kl(this._viewer,this._cesium);return i.addHeatMap(e,t)},Yu.prototype.militaryPlotting=function(e,t,i,o){var r=this._straightArrow,n=null;let a,s;i?s="function"==typeof i?(a={},i):(a=i,o):a={};var l=e=>{r.MilitaryStandardObj.length&&!r.editHandler?r.edit(r.openEdit,r.editOption):!r.MilitaryStandardObj.length&&r.editHandler&&r.edit(!1),s&&s(e)};switch(e){case"StraightArrow":n=r.createStraightArrow(t,a,l);break;case"SwallowtailArrow":n=r.createSwallowtailArrow(t,a,l);break;case"PincerArrow":n=r.createPincerArrow(t,a,l);break;case"AttackArrow":n=r.createAttackArrow(t,a,l);break;case"GatheringPlace":n=r.createHandlerPolygon(t,a,l);break;case"RoundedRectangle":n=r.createRoundedRectangle(t,a,l);break;case"Sector":n=r.createSector(t,a,l);break;case"Bow":n=r.createBow(t,a,l);break;case"Bezierline":n=r.createBezierline(a,l);break;case"BezierArrow":n=r.createBezierArrow(a,l)}return n},Yu.prototype.MilitaryCopy=function(e){return this._straightArrow.copyJb(e)},Yu.prototype.NightMode=function(e){let t=this._viewer;var i=t.imageryLayers.length;let o,r;r=e?o=.15:o=1;for(let e=0;e<i;e++)t.imageryLayers.get(e).brightness=o;this._D3Tilesets&&this._D3Tilesets.forEach(e=>{e.imageBasedLightingFactor.x=r,e.imageBasedLightingFactor.y=r}),t.scene.skyAtmosphere.show=!e},Yu.prototype.SaveMilitaryStandard=function(){this._straightArrow.save()},Yu.prototype.OpenMilitaryStandard=function(e){this._straightArrow.open(e)},Yu.prototype.ClearMilitaryStandard=function(){this._straightArrow.clear()},Yu.prototype.getEntityById=function(e){return this._straightArrow.getEntityById(e)},Yu.prototype.startModify=function(e){this._straightArrow.edit(e)},Yu.prototype.createSimpleGraphic=function(e,t,i){let o=this._SimpleGraphic;return o.createSimpleGraphic(e,t,i)},Yu.prototype.addSimpleGraphic=function(e,t,i){let o=this._SimpleGraphic;return o.addSimpleGraphic(e,t,i)},Yu.prototype.GeoWTFS=function(e){return this._TdtLabel||(this._TdtLabel=new zu(this._viewer,this._cesium)),this._TdtLabel.GeoWTFS(e)},Yu.prototype.Video3D=function(e){let t=new ju(this._viewer,this._cesium);return t.Video3D(e)},Yu.prototype.createGeoJsonFeatureLayerProviderOptimization=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerOptimization(e,t,i,o,r,n)},Yu.prototype.createGeoJsonFeatureLayerProviderGisOptimization=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerGisOptimization(e,t,i,o,r,n)},Yu.prototype.VolumeVectorGeoJsonFeatureLayerGis=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerGis(e,t,i,o,r,n)},Yu.prototype.PointVectorGeoJsonFeatureLayerGis=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.PointVectorGeoJsonFeatureLayerGis(e,t,i,o,r,n)},Yu.prototype.PolylineVectorGeoJsonFeatureLayerGis=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.PolylineVectorGeoJsonFeatureLayerGis(e,t,i,o,r,n)},Yu.prototype.createGeoJsonFeatureLayerProviderClassOptimization=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerClassOptimization(e,t,i,o,r,n)},Yu.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerOptimization1(e,t,i,o,r,n)},Yu.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimizationtest=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayerDthOptimization(e,t,i,o,r,n)},Yu.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest(e,t,i,o,r,n)},Yu.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationtest=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerOptimizationtest(e,t,i,o,r,n)},Yu.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization(e,t,i,o,r,n)},Yu.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp(e,t,i,o,r,n)},Yu.prototype.createHistogramVectorGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createHistogramVectorGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createLaycolorVectorGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLaycolorVectorGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createVector3DTilesFeatureLayer=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVector3DTilesFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createVector3DTilesFeatureLayerRelease=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVector3DTilesFeatureLayerRelease(e,t,i,o,r,n)},Yu.prototype.createGeojsonImage=function(e){return new Ge(this._viewer,this._cesium).createGeojsonImage(e)},Yu.prototype.createGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.VectorGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createGeojsonFeatureLayer=function(e,t,i,o,r,n){var a=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createGeojsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createGeojsonKmlFeatureLayer=function(e,t,i,o,r){var n=new Oe(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,n.createGeojsonKmlFeatureLayer(e,t,i,o,r)},Yu.prototype.sfsterrainprovider=function(e,t,i,o,r){var n=new Ml(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,n.createSFSTerrain(e,t,i,o,r)},Yu.prototype.createTerrainVector=function(e,t,i,o,r){var n=new Ml(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,n.createTerrainVector(e,t,i,o,r)},Yu.prototype.sfsterrainprovider71=function(e,t,i,o,r){var n=new Ml(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,n.createSFSTerrain71(e,t,i,o,r)},Yu.prototype.createTerrain=function(e,t,i,o,r){var n=new Ml(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,n.createTerrain(e,t,i,o,r)},Yu.prototype.createTerrainLayer=function(e,t,i,o,r,n){var a=new Ml(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,a.createTerrainLayer(e,t,i,o,r,n)},Yu.prototype.createArcGISTerrain=function(e,t,i,o,r){var n=new Ml(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,n.createArcGISTerrain(e,t,i,o,r)},Yu.prototype.createCesiumTerrain=function(e,t,i,o){var r=new Ml(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,r.createCesiumTerrain(e,t,i,o)},Yu.prototype.createDynamicObject=function(e,t,i){return this._createdynamicObject.Start(e,t,i)},Yu.prototype.addmodle=function(e){return this._createdynamicObject.addmodle(e)},Yu.prototype.createSatelliteTrail=function(e){let t=new $l(this._viewer,this._cesium);return t.createSatelliteTrail(e)},Yu.prototype.executePauseFly3DPaths=function(){return this._createdynamicObject.executePauseFly3DPaths()},Yu.prototype.executePlayForwardFly3DPaths=function(){return this._createdynamicObject.executePlayForwardFly3DPaths()},Yu.prototype.executePlayReverseFly3DPaths=function(){return this._createdynamicObject.executePlayReverseFly3DPaths()},Yu.prototype.executeSignout=function(){return this._createdynamicObject.executeSignout()},Yu.prototype.createLabel=function(e,t,i,o,r){var n=new zi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createLabel(e,t,i,o,r)},Yu.prototype.createPosition=function(e,t,i){return new Rn(this._viewer,this._cesium).createPosition(e,t,i)},Yu.prototype.createLocation=function(e,t,i){return this._Point.createLocation(e,t,i)},Yu.prototype.createPoint=function(e,t,i,o,r,n){return this._Point.createPoint(e,t,i,o,r,n)},Yu.prototype.createLonlat=function(e){return this._Point.createLonlat(e)},Yu.prototype.createDivPoint=function(e,t,i){let o=new Pe(this._viewer);return o.createDivPoint(e,t,i)},Yu.prototype.createRichTextPoint=function(e,t,i,o){return this._Point.createRichTextPoint(e,t,i,o)},Yu.prototype.SkyBox=function(e,t){return this._skyBox.SkyBox(e,t)},Yu.prototype.setSpaceBackground=function(e){return this._skyBox.setSpaceBackground(e)},Yu.prototype.createWindField=function(e,t){return this._flowField.createWindField(e,t)},Yu.prototype.createRoad=function(e={}){let t=new zl(this._viewer);return t.createRoad(e)},Yu.prototype.createTrailLinePath=function(e,t,i){return this._trailLine.createPath(e,t,i)},Yu.prototype.createFlyingLine=function(e,t){return this._trailLine.createFlyingLine(e,t)},Yu.prototype.createTrailLineWall=function(e,t){return this._trailLine.createWall(e,t)},Yu.prototype.createTrailLine=function(e,t){return this._trailLine.createLine(e,t)},Yu.prototype.createModel=function(e,t,i,o,r,n){return new Ye(this._viewer,this._cesium).createModel(e,t,i,o,r,n)},Yu.prototype.createModelEditable=function(e,t,i,o,r,n){return new Ye(this._viewer,this._cesium).createModelEditable(e,t,i,o,r,n)},Yu.prototype.createPointModel=function(e,t){return this._PointModel.createPointModel(e,t)},Yu.prototype.executePolyline=function(e){return new Vi(this._viewer,this._cesium).executePolyline(e)},Yu.prototype.executePolygon=function(e){return new ki(this._viewer,this._cesium).executePolygon(e)},Yu.prototype.executeWall=function(e,t){return new Hn(this._viewer,this._cesium).executeWall(e,t)},Yu.prototype.createWall=function(e,t,i,o){return new Hn(this._viewer,this._cesium).createWall(e,t,i,o)},Yu.prototype.executePolyline1=function(e){return new Vi(this._viewer,this._cesium).executePolyline1(method)},Yu.prototype.createPolylineVolume=function(e,t,i,o,r){return new An(this._viewer,this._cesium).createPolylineVolume(e,t,i,o,r)},Yu.prototype.createCorridor=function(e,t,i,o){return new Sr(this._viewer,this._cesium).createCorridor(e,t,i,o)},Yu.prototype.addViewCone=function(e){let t=new eu(this._viewer,this._cesium);return t.addViewCone(e)},Yu.prototype.createViewCone=function(e,t){let i=new eu(this._viewer,this._cesium);return i.createViewCone(e,t)},Yu.prototype.createModifyMesh=function(e,t,i,o,r){return this.createModelClipping(o,{type:"polygon",isInner:!0,positions:t})},Yu.prototype.createModelClipping=function(e,t){return new Jl(this._viewer,this._cesium).addClipping(e,t)},Yu.prototype.createModelModifier=function(i,o,r,n){let a=[];return this._D3Tilesets&&this._D3Tilesets.forEach((e,t)=>{e=this.createModifyMesh(i,o,r,e,n);a.push(e)}),{remove:()=>{a.forEach((e,t)=>{e.remove()}),a=[]}}},Yu.prototype.createPopupMessage=function(e){return new xe(this._viewer,this._cesium).createPopupMessage(e)},Yu.prototype.createMeasurement=function(e){return new xe(this._viewer,this._cesium).createMeasurement(e)},Yu.prototype.createPlotting=function(e){return new xe(this._viewer,this._cesium).createPlotting(e)},Yu.prototype.createPopupProp=function(e,t){return this._popupmessage.createPopupProp(e,t)},Yu.prototype.createModelLibrary=function(e){return this._popupmessage.createModelLibrary(e)},Yu.prototype.createHawkeye=function(e,t){return new Wl(this._viewer,this._cesium).createHawkeye(e,t)},Yu.prototype.createGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createGeoJsonFeatureLayer(e,t,i,o,r)},Yu.prototype.createBillboardGeoJsonFeature=function(e,t,i,o,r,n){var a=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createBillboardGeoJsonFeature(e,t,i,o,r,n)},Yu.prototype.createBillboardPointGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new Re(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createBillboardPointGeoJsonFeatureLayer(e,t,i,o,r)},Yu.prototype.createKmlLayer=function(e,t,i){return new ql(this._viewer,this._cesium).createKmlLayer(e,t,i)},Yu.prototype.addKmlLayer=function(e,t,i,o){return new ql(this._viewer,this._cesium).addKmlLayer(e,t,i,o)},Yu.prototype.createVolumeVectorGeoJsonFeatureLayerArcgis=function(e,t,i,o,r){var n=new Ct(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createVolumeVectorGeoJsonFeatureLayer(e,t,i,o,r)},Yu.prototype.createBillboardGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new Re(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createBillboardGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Yu.prototype.createPointGeojsonFeatureLayer=function(e,t,i,o,r,n){var a=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPointGeojsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createModelGeojsonFeatureLayer=function(e,t,i,o,r,n){var a=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createModelGeojsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createCirclePointGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createCirclePointGeoJsonFeatureLayer(e,t,i,o,r)},Yu.prototype.createModelPointGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createModelPointGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createPrimitivLabelPointGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new Ve(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createLabelPointGeoJsonFeatureLayer(e,t,i,o,r)},Yu.prototype.createLabelPointGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelPointGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createSXTLabelGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new Ve(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createSXTLabelGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Yu.prototype.createCustomCallbackGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n,a){var s=new Ve(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,s.createCustomCallbackGeoJsonFeatureLayerProvider(e,t,i,o,r,a,n)},Yu.prototype.createLabelPolymerizationGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new Ve(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createLabelPolymerizationGeoJsonFeatureLayer(e,t,i,o,r)},Yu.prototype.createPointPolymerizationGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Ve(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPointPolymerizationGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createLabelpolymerizationGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Ve(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelpolymerizationGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createLabelpolymerizationGeoJsonFeatureLayers=function(e,t,i,o,r,n){var a=new Ve(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelpolymerizationGeoJsonFeatureLayers(e,t,i,o,r,n)},Yu.prototype.createStreetscapeGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createStreetscapeGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createPrimitiveLabelGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new Ve(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Yu.prototype.createLabelImageGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new Ve(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelImageGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Yu.prototype.createLabelImageGeoJsonFeatureLayerProvider1=function(e,t,i,o,r,n){var a=new Ve(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelImageGeoJsonFeatureLayerProvider1(e,t,i,o,r,n)},Yu.prototype.createLabelRichtextGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new Ve(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelRichtextGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Yu.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createModelGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Yu.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new Ge(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPointGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Yu.prototype.createArcGisImageryLayer=function(e,t,i,o,r,n){var a=new Fn(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,a.createArcGisImageryLayer(e,t,i,o,r,n)},Yu.prototype.createImageryLayerGrid=function(e){return new Fn(this._viewer,this._cesium).createImageryLayerGrid(e)},Yu.prototype.createWebMapServerImageLayer=function(e,t,i,o,r,n){var a=new Fn(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,a.createWebMapServerImageLayer(e,t,i,o,r,n)},Yu.prototype.createWebMapTileServerImageLayer=function(e,t,i,o,r,n){var a=new Fn(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,a.createWebMapTileServerImageLayer(e,t,i,o,r,n)},Yu.prototype.createUrlTemplateImageryProvider=function(e,t,i,o,r,n){var a=new Fn(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,a.createUrlTemplateImageryProvider(e,t,i,o,r,n)},Yu.prototype.createCirclePointGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createCirclePointGeoJsonFeatureLayer(e,t,i,o,r)},Yu.prototype.createPolylineGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolylineGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createPrimitivePolylineGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new We(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolylineGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createPrimitiveGroundPolylineGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new We(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createGroundPolylineGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.exectPointModel=function(e,t,i,o,r,n){var a=new Ye(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.exectPointModel(e,t,i,o,r,n)},Yu.prototype.createPolygonModel=function(e,t,i,o,r,n){var a=new Ye(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolygonModel(e,t,i,o,r,n)},Yu.prototype.modelMove=function(){return new Ye(this._viewer,this._cesium).modelMove()},Yu.prototype.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new We(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolylineVectorGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Yu.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel=function(e,t,i,o,r,n){var a=new We(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolylineVectorGeoJsonFeatureLayerProviderModel(e,t,i,o,r,n)},Yu.prototype.createpolylineVolumeGeojsonFeatureLayer=function(e,t,i,o,r,n){var a=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createpolylineVolumeGeojsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createpolylineVolumeGeojsonPrimitiveLayer=function(e,t,i,o,r,n){var a=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createpolylineVolumeGeojsonPrimitiveLayer(e,t,i,o,r,n)},Yu.prototype.createVolumeGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new Al(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createVolumeGeoJsonFeatureLayer(e,t,i,o,r)},Yu.prototype.createVolumeGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new Al(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Yu.prototype.createVolumeVectorGeoJsonFeatureLayerOptimizations=function(e,t,i,o,r,n){var a=new Al(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayerOptimization(e,t,i,o,r,n)},Yu.prototype.createVolumeVectorGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Al(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createPolygonVectorGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Ol(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization=function(e,t,i,o,r,n){var a=new Ol(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayerOptimization(e,t,i,o,r,n)},Yu.prototype.createVolumeVectorGeoJsonFeatureLayersd=function(e,t,i,o,r,n){var a=new Ol(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayersd(e,t,i,o,r,n)},Yu.prototype.createWallGeoFeatureLayer=function(e,t,i,o,r,n){var a=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createWallGeoFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createWallPrimitiveGeoFeatureLayer=function(e,t,i,o,r,n){var a=new bt(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createWallPrimitiveGeoFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createWallGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new bt(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createWallGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Yu.prototype.createImageryProvider=function(e,t,i,o,r,n,a){var s=new Fn(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,s.createImageryProvider(e,t,i,o,r,n,a)},Yu.prototype.createCacheImageryProvider=function(e,t,i,o,r,n){var a=new Fn(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,a.createCacheImageryProvider(e,t,i,o,r,n)},Yu.prototype.createterrainProvider=function(e,t,i,o){return this._TerrainProvider.createterrainProvider(e,t,i,o)},Yu.prototype.createPolylineImageryProviderer=function(e,t,i,o){return this._ImageryLayer.createPolylineImageryProviderer(e,t,i,o)},Yu.prototype.createMVTWithStyle=function(e,t,i,o){return this._ImageryLayer.createMVTWithStyle(e,t,i,o)},Yu.prototype.createPolygonGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolygonGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createPolygonGeoJsonFeatureLayer1=function(e,t,i,o,r){var n=new qe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createPolygonGeoJsonFeatureLayer(e,t,i,o,r)},Yu.prototype.createPolygonVectorGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new qe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolygonVectorGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Yu.prototype.createVolumeVectorGeoJsonFeatureLayerDth=function(e,t,i,o,r,n){var a=new Ol(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayerDth(e,t,i,o,r,n)},Yu.prototype.createPolygonVectorGeoJsonFeatureLayerProviderModel=function(e,t,i,o,r,n){var a=new qe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolygonVectorGeoJsonFeatureLayerProviderModel(e,t,i,o,r,n)},Yu.prototype.createPolygonVectorGeoJsonFeatureLayerProviderls=function(e,t,i,o,r,n){var a=new qe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolygonVectorGeoJsonFeatureLayerProviderls(e,t,i,o,r,n)},Yu.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsd=function(e,t,i,o,r,n){var a=new qe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolygonVectorGeoJsonFeatureLayerProviderlsd(e,t,i,o,r,n)},Yu.prototype.createArcgisPolygonVectorGeoJsonFeatureLayerProviderls=function(e,t,i,o,r,n){var a=new qe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,a.createArcgisPolygonVectorGeoJsonFeatureLayerProviderls(e,t,i,o,r,n)},Yu.prototype.createPolygonVectorFeatureLayerProvider=function(e,t,i,o,r){var n=new qe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createPolygonVectorFeatureLayerProvider(e,t,i,o,r)},Yu.prototype.createPolygonVectorMonomerFeatureLayerProvider=function(e,t,i,o,r){var n=new qe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createPolygonVectorMonomerFeatureLayerProvider(e,t,i,o,r)},Yu.prototype.createPolygonMapGeoJsonFeatureLayer=function(e,t,i,o,r,n){return this._MapGeoJsonFeatureLayer.createPolygonMapGeoJsonFeatureLayer(e,t,i,o,r,n)},Yu.prototype.createGeoJsonDataSource=function(e,t,i,o,r){var n=new Oe(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createGeoJsonDataSource(e,t,i,o,r)},Yu.prototype.DeleteObject=function(e){if(this._core.isnull(e._viewer))console.log("obj is null");else for(var t in e.deleteObject(),e)delete e[t]},Yu.prototype.createCircle=function(e,t,i,o){return new Bi(this._viewer,this._cesium).createCircle(e,t,i,o)},Yu.prototype.CreateRectangle=function(e,t,i,o,r){return new Ni(this._viewer,this._cesium).CreateRectangle(e,t,i,o,r)},Yu.prototype.createBox=function(e,t,i,o){return(t=new Fi(this._viewer,this._cesium)).createBox(e,t,i,o)},Yu.prototype.createBillboardbatch=function(e){return new wr(this._viewer,this._cesium).createBillboardbatch(e)},Yu.prototype.createCone=function(e,t,i,o){return new ao(this._viewer,this._cesium).createCone(e,t,i,o)},Yu.prototype.createRectangularSensor=function(e,t,i,o){return new ao(this._viewer,this._cesium).createRectangularSensor(e,t,i,o)},Yu.prototype.createRadarMaskScan=function(e,t,i,o){return new ao(this._viewer,this._cesium).createRadarMaskScan(e,t,i,o)},Yu.prototype.ConicSensor=function(e,t,i){return new Tr(this._viewer).create(e,t,i)},Yu.prototype.FieldIntensity=function(e,t){return new Wu(this._viewer).create(e,t)},Yu.prototype.createRadarMask=function(e,t,i,o){return new ao(this._viewer,this._cesium).createRadarMask(e,t,i,o)},Yu.prototype.createConeRadar=function(e,t){return new ao(this._viewer,this._cesium).createConeRadar(e,t)},Yu.prototype.createColor=function(e,t,i,o){return new G(this._viewer,this._cesium).createColor(e,t,i,o)},Yu.prototype.createPolyline=function(e,t,i,o,r){var n=new Vi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createPolyline(e,t,i,this._core.isnull(o)?0:o,r)},Yu.prototype.createLink=function(e,t,i){return new Vi(this._viewer,this._cesium).createLink(e,t,i)},Yu.prototype.createLinkPro=function(e,t,i){return new Vi(this._viewer,this._cesium).createLinkPro(e,t,i)},Yu.prototype.createLandingLine=function(e,t={}){return new Vi(this._viewer,this._cesium).createLandingLine(e,t)},Yu.prototype.createLinkPros=function(e){return new Vi(this._viewer,this._cesium).createLinkPros(e)},Yu.prototype.createPathLayer=function(e){return this._trailLine.createPathLayer(e)},Yu.prototype.createTrailWallLayer=function(e){return this._trailLine.createWallLayer(e)},Yu.prototype.createPolygon=function(e,t,i,o,r){var n=new ki(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.createPolygon(e,t,i,o,r)},Yu.prototype.createSector=function(e,t,i,o,r){return new ki(this._viewer,this._cesium).createSector(e,t,i,o,r)},Yu.prototype.executeEllipsoid=function(e,t,i,o){t=new Gi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,t.createEllipsoid(e,t,i,o)},Yu.prototype.createImageLabel=function(e,t,i,o){var r=new On(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(i=we.selectedItem.id),i=this._core.isnull(i)?0:i,r.createImageLabel(e,t,i,o)},Yu.prototype.toHtmlColor=function(e){return this._Color.toHtmlColor(e)},Yu.prototype.CreateLabel=function(e,t,i,o,r,n){var a=new zi(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(r=we.selectedItem.id),r=this._core.isnull(r)?0:r,a.CreateLabel(e,t,i,o,r,n)},Yu.prototype.CreateImageLabel=function(e,t,i,o,r){var n=new On(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.CreateImageLabel(e,t,i,o,r)},Yu.prototype.createImage=function(e,t,i,o,r){var n=new On(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.CreateImageLabel(e,t,i,o,r)},Yu.prototype.CreatePolyline=function(e,t,i,o,r){var n=new Vi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(o=we.selectedItem.id),o=this._core.isnull(o)?0:o,n.CreatePolyline(e,t,i,o,r)},Yu.prototype.CreateCircle=function(e,t,i,o,r,n){var a=new Bi(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(r=we.selectedItem.id),r=this._core.isnull(r)?0:r,a.CreateCircle(e,t,i,o,r,n)},Yu.prototype.CreateEllipse=function(e,t,i,o,r,n,a,s){var l=new Bi(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(a=we.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateEllipse(e,t,i,o,r,n,a,s)},Yu.prototype.CreateBox=function(e,t,i,o,r,n,a,s){var l=new Fi(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(a=we.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateBox(e,t,i,o,r,n,a,s)},Yu.prototype.CreatePosition=function(e,t,i,o,r,n,a,s){return new Rn(this._viewer,this._cesium).CreatePosition(e,t,i,o,r,n,a,s)},Yu.prototype.createColor=function(e,t,i,o){return new G(this._viewer,this._cesium).CreateColor(e,t,i,o)},Yu.prototype.CreateCone=function(e,t,i,o,r,n,a,s){var l=new ao(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(a=we.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateCone(e,t,i,o,r,n,a,s)},Yu.prototype.CreateCylinder=function(e,t,i,o,r,n,a,s){var l=new ao(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(a=we.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateCylinder(e,t,i,o,r,n,a,s)},Yu.prototype.CreateSphere=function(e,t,i,o,r,n,a,s){var l=new Gi(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(we.selectedItem)&&"group"==we.selectedItem.type&&(a=we.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateSphere(e,t,i,o,r,n,a,s)},Yu.prototype.createPointOptimization=function(e,t){return new ji(this._viewer,this._cesium).createPointOptimization(e,t)},Yu.prototype.createRectangleOptimization=function(e,t){return new Ni(this._viewer,this._cesium).createRectangleOptimization(e,t)},Yu.prototype.createCircleOptimization=function(e,t){return new Bi(this._viewer,this._cesium).createCircleOptimization(e,t)},Yu.prototype.createCylinderOptimization=function(e,t){return new ao(this._viewer,this._cesium).createCylinderOptimization(e,t)},Yu.prototype.createPointOptimization=function(e,t){return new ji(this._viewer,this._cesium).createPointOptimization(e,t)},Yu.prototype.CreatePolygonEdit=function(){return this._core.EntityEdit(this._viewer,this._cesium)},Yu.prototype.CreateVectorImageFeatureLayer=function(e,t,i,o,r,n,a){return this.VectorImgFeatureLayer.CreateVectorImageFeatureLayer(e,t,i,o,r,n,a)},Yu.prototype.createVolumetricMeasureTool=function(){return new Ul(this._viewer,this._cesium)},Object.defineProperties(Yu.prototype,{SimpleGraphic:{get:function(){return this._SimpleGraphic}},GeoJsonFeatureLayer:{get:function(){return this._GeoJsonFeatureLayer}},MilitaryPlotting:{get:function(){return this._straightArrow}},_D3Tileset:{get:function(){return new Li(this._viewer,this._cesium)}}}),Object.defineProperties(Yu.prototype,{_trailLine:{get:function(){return new jl(this._viewer,this._cesium)}}}),Object.defineProperties(Yu.prototype,{_Point:{get:function(){return new ji(this._viewer,this._cesium)}},GeometryCreator:{CreateLinearRingGeometry:function(e){return{}}}}),qu.prototype.currentTime=function(e){return""!=e&&null!=e&&(e=new Date(e),e=this.this._cesium.JulianDate.fromDate(e),this._viewer.clock.currentTime=e.clone()),this},qu.prototype.currentTimeFaster=function(){return this._viewer.animation.viewModel.faster(),this},qu.prototype.currentTimeSlower=function(){return this._viewer.animation.viewModel.slower(),this},qu.prototype.currentplayForwardViewModel=function(){return this._viewer.animation.viewModel.playForwardViewModel.command(),this},qu.prototype.currentplayReverseViewModel=function(){return this._viewer.animation.viewModel.playReverseViewModel.command(),this},qu.prototype.currentpauseViewModel=function(){return this._viewer.animation.viewModel.pauseViewModel.command(),this},Qu.prototype.currentTime=function(e){return new qu(this._viewer,this._cesium).currentTime(e)},Qu.prototype.currentTimeFaster=function(){return new qu(this._viewer,this._cesium).currentTimeFaster()},Qu.prototype.currentTimeSlower=function(){return new qu(this._viewer,this._cesium).currentTimeSlower()},Qu.prototype.currentplayForwardViewModel=function(){return new qu(this._viewer,this._cesium).currentplayForwardViewModel()},Qu.prototype.currentplayReverseViewModel=function(){return new qu(this._viewer,this._cesium).currentplayReverseViewModel()},Qu.prototype.currentpauseViewModel=function(){return new qu(this._viewer,this._cesium).currentpauseViewModel()},Ju.prototype.AttachEvent=function(e,o){var r=this._viewer,n=this._Core,n=this._Core;if(e===uo.L_Click){var t=this._viewer.scene;return(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),i}if(e===uo.L_DBL_Click){t=this._viewer.scene;return(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i}if(e===uo.L_Down){t=this._viewer.scene;return(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.LEFT_DOWN),i}if(e===uo.L_Up){t=this._viewer.scene;return(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.LEFT_UP),i}if(e===uo.M_Click){t=this._viewer.scene;return(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.MIDDLE_CLICK),i}if(e===uo.M_Down){t=this._viewer.scene;return(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.MIDDLE_DOWN),i}if(e===uo.M_Up){t=this._viewer.scene;return(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.MIDDLE_UP),i}if(e===uo.R_Click){t=this._viewer.scene;return(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),i}if(e===uo.R_Down){t=this._viewer.scene;return(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),i}if(e===uo.R_Up){t=this._viewer.scene;return(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.RIGHT_UP),i}if(e===uo.Wheel){t=this._viewer.scene;return(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){"function"==typeof o&&o(e)},this._cesium.ScreenSpaceEventType.WHEEL),i}if(e===uo.Move){var i,t=this._viewer.scene;return(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){"function"==typeof o&&o(e)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),i}},Ju.prototype.AttachOnLButtonDblClkEvent=function(i){var e=this._viewer.scene,o=this._viewer,r=this._Core,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),e},Ju.prototype.AttachOnLButtonDownEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.LEFT_DOWN),e},Ju.prototype.AttachOnLButtonUpEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.LEFT_UP),e},Ju.prototype.AttachOnMButtonDblClkEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.MIDDLE_CLICK),e},Ju.prototype.AttachOnMButtonDownEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.MIDDLE_DOWN),e},Ju.prototype.AttachOnMButtonUpEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.MIDDLE_UP),e},Ju.prototype.AttachOnMouseWheelEvent=function(t){var e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){"function"==typeof t&&t(e)},this._cesium.ScreenSpaceEventType.WHEEL),e},Ju.prototype.AttachOnFrameEvent=function(t){var e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){"function"==typeof t&&t(e)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),e},Ju.prototype.AttachOnRButtonDownEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),e},Ju.prototype.AttachOnRButtonUpEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.RIGHT_UP),e},Ju.prototype.AttachCameraChangeEvent=function(e){return this._viewer.scene.camera.percentageChanged=1e-6,this._viewer.scene.camera.changed.addEventListener(e),e},Ju.prototype.CameraMoveEndEvent=function(e){var t=this._viewer,i=!1;function o(){i=!0}function r(){i&&(e&&e(),t.scene.camera.moveStart.removeEventListener(o),t.scene.camera.moveEnd.removeEventListener(r))}setTimeout(function(){t.scene.camera.moveStart.addEventListener(o),t.scene.camera.moveEnd.addEventListener(r)},0)},Xu.prototype.DetachEvent=function(e,t){t===uo.L_Click?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_CLICK):t===uo.L_DBL_Click?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK):t===uo.L_Down?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOWN):t===uo.L_Up?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_UP):t===uo.M_Click?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_CLICK):t===uo.M_Down?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_DOWN):t===uo.M_Up?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_UP):t===uo.R_Click?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_CLICK):t===uo.R_Down?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_DOWN):t===uo.R_Up?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_UP):t===uo.Wheel?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.WHEEL):t===uo.Move?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.MOUSE_MOVE):e&&e.destroy()},Xu.prototype.DetachEventAll=function(e){e&&e.destroy()},Xu.prototype.RemoNormalCesiumLeftDoubleClick=function(){this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)},Xu.prototype.DetachCameraChangeEvent=function(e){this._viewer.scene.camera.percentageChanged=.5,this._viewer.scene.camera.changed.removeEventListener(e)};let Ku="undefined"!=typeof window?window:"undefined"!=typeof self?self:{},$u=document.currentScript&&document.currentScript.src;$u||function(){try{throw Error("获取当前文件路径")}catch(e){e.fileName?$u=e.fileName:e.stack?$u=(e.stack.match(/at\s+(.*?):\d+:\d+/)||["",""])[1]:e.sourceURL&&($u=e.sourceURL)}}(),-1<$u.indexOf("(")&&($u=$u.split("(")[1]);let Zu=$u.indexOf("SmartEarth.js");Zu<0&&(Zu=$u.indexOf("SmartEarth.min.js"));let ec;ec=Zu<0?(Zu=$u.indexOf("Source/Main"),$u.substring(0,Zu)+"Build/"):$u.substring(0,Zu);let tc=document.getElementsByTagName("link"),ic=!1;for(let e=0;e<tc.length;e++)-1!==tc[e].href.indexOf("smartearth.css")&&(ic=!0);if(!ic){let e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=ec+"Workers/css/smartearth.css",document.head.appendChild(e)}Ku.SmartEarthRootUrl=ec;let oc=new E(!1);try{Ku.$||oc.addJs(document.body,ec+"Workers/jquery-2.0.3.js"),Ku.layer||oc.addJs(document.body,ec+"Workers/layui/lay/modules/layer.js"),Ku.layuiLayer=Ku.layer,Ku.Cesium_turf||(oc.addJs(document.body,ec+"Workers/turf.min.js"),Ku.Cesium_turf=Ku.turf),oc.addJs(document.body,ec+"Workers/polyfill.min.js")}catch(e){}function rc(e,t){this._viewer=e,this._cesium=t}function nc(e,t){this._viewer=e,this._cesium=t}function ac(e,t){this._viewer=e,this._cesium=t,this._tree=we.getSource()}function sc(e,t){this._viewer=e,this._cesium=t,this._tree=we.getSource()}function lc(e,t){this._viewer=e,this._cesium=t}function uc(e,t){this._viewer=e,this._cesium=t}function cc(e,t){this._viewer=e,this._cesium=t}function hc(e,t){this._viewer=e,this._cesium=t,this._zoomIn=new rc(this._viewer,this._cesium),this._zoomOut=new nc(this._viewer,this._cesium),this._flyTo=new Ue(this._viewer,this._cesium,this._tree),this._flyToObj=new ac(this._viewer,this._cesium),this._jumpTo=new sc(this._viewer,this._cesium,this._tree),this._northfinger=new lc(this._viewer,this._cesium),this._Stop=new cc(this._viewer,this._cesium)}function mc(e,t){this._viewer=e,this._cesium=t,this._tree=we.getSource()}function dc(e,t){this._viewer=e,this._cesium=t,this._tree=we.getSource()}function pc(e,t){this._viewer=e,this._cesium=t,this._tree=we.getSource()}function gc(e,t){this._viewer=e,this._cesium=t,this._tree=we.getSource()}function _c(e,t){this._viewer=e,this._cesium=t,this._tree=we.getSource()}function fc(e,t){this._viewer=e,this._cesium=t,this._tree=we.getSource()}function yc(e,t){this._viewer=e,this._cesium=t,this._tree=we.getSource()}Ku.SmartEarthPopupData={},Ku.logSmartEarthLog=()=>{var e=Ku.SmartEarth&&Ku.SmartEarth.VERSION,t=Ku.SmartEarth&&Ku.SmartEarth.COMPILETIME,i=Ku.Cesium&&Ku.Cesium.VERSION;setTimeout(console.log.bind(console,`
%c            
%c
版 本 号:${e}    Cesium版本:${i}
编译时间:${t}
授权信息:内部测试版本。
版权声明: SmartEarthSDK版权完全属于【合肥泰瑞数创科技有限公司】
 
 
 
在线示例:http://183.162.245.49:82/05sdkdemo-pro
接口文档:http://183.162.245.49:82/05sdkdemo-pro/static/api
    `,`font-size:50px;background:rgba(34,34,34,0.5) url('${ec}Workers/image/logo.png')`,"color:#018aff;font-size:13px;font-family:微软雅黑"),0)},rc.prototype.zoomIn=function(){var e=.6*Math.ceil(this._viewer.camera.positionCartographic.height);return this._viewer.camera.zoomIn(e)},nc.prototype.zoomOut=function(){var e=.6*Math.ceil(this._viewer.camera.positionCartographic.height);return this._viewer.camera.zoomOut(e)},ac.prototype.flyToObj=function(e){if(e&&null!=e.west&&null!=e.west)this._viewer.camera.flyTo({destination:this._cesium.Rectangle.fromDegrees(e.west,e.south,e.east,e.north)});else{if(e&&e.item&&null!=e.item.id&&null!=e.item.id){var t=we.getSourceById(this._tree,e.item.id);try{var i=this._viewer.scene.primitives.get(t.id);this._viewer.flyTo(i)}catch(e){}}var o,r,n,a,s;e&&e.item?e.item.entities?this._viewer.flyTo(e.item):e.item._primitives&&e.item._primitives.length?0<(i=Ce.filter(e.item._primitives,function(e){return null==e.geometryInstances})).length&&(null!=i[0]._boundingSpheres?this._viewer.camera.flyToBoundingSphere(i[0]._boundingSpheres[0]):null!=i[0]._primitive&&null!=i[0]._primitive&&null!=i[0]._primitive._boundingSpheres[0]&&null!=i[0]._primitive._boundingSpheres[0]?this._viewer.camera.flyToBoundingSphere(i[0]._primitive._boundingSpheres[0]):null!=i[0]._labels&&0<i[0]._labels.length?(o=i[0]._labels[0].position,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,2e3),this._viewer.camera.flyTo({destination:s})):null!=i[0]._pointPrimitives&&0<i[0]._pointPrimitives.length?(o=i[0]._pointPrimitives[0].position,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,2e3),this._viewer.camera.flyTo({destination:s})):null!=i[0]._billboards&&0<i[0]._billboards.length&&(o=i[0]._billboards[0].position,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,2e3),this._viewer.camera.flyTo({destination:s}))):e.item._primitives&&e.item._primitives._boundingSpheres?e.item._primitives._boundingSpheres.length&&this._viewer.camera.flyToBoundingSphere(e.item._primitives._boundingSpheres[0]):e.item._boundingSpheres&&0<e.item._boundingSpheres.length?this._viewer.camera.flyToBoundingSphere(e.item._boundingSpheres[0]):e.item._boundingVolumes&&e.item._boundingVolumes.length?(o=e.item._boundingVolumes[0].center,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,5e3),this._viewer.camera.flyTo({destination:s})):this._viewer.flyTo(e.item):e&&(e.boundingSphere?this._viewer.camera.flyToBoundingSphere(e.boundingSphere):this._viewer.flyTo(e))}},sc.prototype.jumpTo=function(e){if(e&&null!=e.west&&null!=e.west)this._viewer.camera.setView({destination:this._cesium.Rectangle.fromDegrees(e.west,e.south,e.east,e.north)});else if(e&&void 0!==e.destination)this._viewer.camera.setView({destination:e.destination,orientation:e.orientation});else{if(e&&e.item&&null!=e.item.id&&null!=e.item.id){var t=we.getSourceById(this._tree,e.item.id);try{var i=this._viewer.scene.primitives.get(t.id);this._viewer.zoomTo(i)}catch(e){}}var o,r,n,a,s;e&&e.item?e.item.entities?this._viewer.zoomTo(e.item):e.item._primitives&&e.item._primitives.length?0<(i=Ce.filter(e.item._primitives,function(e){return null==e.geometryInstances})).length&&(null!=i[0]._boundingSpheres?this._viewer.camera.viewBoundingSphere(i[0]._boundingSpheres[0]):null!=i[0]._labels&&0<i[0]._labels.length?(o=i[0]._labels[0].position,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,2e3),this._viewer.camera.setView({destination:s})):null!=i[0]._pointPrimitives&&0<i[0]._pointPrimitives.length?(o=i[0]._pointPrimitives[0].position,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,2e3),this._viewer.camera.setView({destination:s})):null!=i[0]._billboards&&0<i[0]._billboards.length&&(o=i[0]._billboards[0].position,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,2e3),this._viewer.camera.setView({destination:s}))):e.item._primitives&&e.item._primitives._boundingSpheres?e.item._primitives._boundingSpheres.length&&this._viewer.camera.viewBoundingSphere(e.item._primitives._boundingSpheres[0]):e.item._boundingSpheres&&0<e.item._boundingSpheres.length?this._viewer.camera.viewBoundingSphere(e.item._boundingSpheres[0]):e.item._boundingVolumes&&e.item._boundingVolumes.length?(o=e.item._boundingVolumes[0].center,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,5e3),this._viewer.camera.setView({destination:s})):this._viewer.zoomTo(e.item):e&&this._viewer.zoomTo(e)}},lc.prototype.northfinger=function(){this._viewer.camera.setView({destination:this._viewer.camera._destination,orientation:{pitch:this._viewer.camera._pitch,roll:0}})},uc.prototype.setPosition=function(e,t,i){Math.abs(e)<=180&&Math.abs(t)<=90?this._viewer.camera.setView({destination:this._cesium.Cartesian3.fromDegrees(e,t,i)}):this._viewer.camera.setView({destination:{x:e,y:t,z:i}})},cc.prototype.Stop=function(){this._viewer.scene.camera.cancelFlight()},hc.prototype.getPosition=function(){return this._getPosition||(this._getPosition=new Ee(this._viewer,this._cesium)),this._getPosition.getPosition()},hc.prototype.getMousePosition=function(e,t,i,o,r){return this._getPosition||(this._getPosition=new Ee(this._viewer,this._cesium)),this._getPosition.getMousePosition(e,t,i,o,r)},hc.prototype.getDegrees=function(){return this._getPosition||(this._getPosition=new Ee(this._viewer,this._cesium)),this._getPosition.getDegrees()},hc.prototype.getMouseDegrees=function(e,t,i,o,r){return this._getPosition||(this._getPosition=new Ee(this._viewer,this._cesium)),this._getPosition.getMouseDegrees(e,t,i,o,r)},hc.prototype.setPosition=function(e,t,i){return this._setPosition||(this._setPosition=new uc(this._viewer,this._cesium)),this._setPosition.setPosition(e,t,i)},hc.prototype.zoomIn=function(){return this._zoomIn.zoomIn()},hc.prototype.zoomOut=function(){return this._zoomOut.zoomOut()},hc.prototype.flyTo=function(e,t){return this._flyTo.flyTo(e,t)},hc.prototype.flyToObj=function(e){this._flyToObj.flyToObj(e)},hc.prototype.jumpTo=function(e){return this._jumpTo.jumpTo(e)},hc.prototype.northfinger=function(){this._northfinger.northfinger()},hc.prototype.flyToPosition=function(e,t,i){this._flyTo.flyToPosition(e,t,i)},hc.prototype.flyToPointsInterest=function(e,t){this._flyTo.flyToPointsInterest(e,t)},hc.prototype.Stop=function(){this._Stop.Stop()},mc.prototype.deleteItem=function(e){we.delete(e,this._viewer,this._cesium)},mc.prototype.testTreeSource=function(){console.log(this._tree)},dc.prototype.findItem=function(e){for(var t="",i=Ce.clone(this._tree),o=e.split("\\"),r=0;r<o.length;r++)if(i=we.getSourceByName(i,o[r]),r==o.length-1){if(i){t=i.id;break}t=""}else{if(!i){t="",i=null;break}i=i.children}return t},pc.prototype.getItemName=function(e){e=we.getSourceById(this._tree,e);return e?e.name:""},gc.prototype.getVisibility=function(e){e=we.getSourceById(this._tree,e);if(e)return e.item.getVisibility()},_c.prototype.setVisibility=function(e,t){we.setVisibility(e,t,this._viewer,this._cesium)},fc.prototype.rename=function(e,t){var i=we.getSourceById(this._tree,e);i&&(i.name=t);e=we.getTempSourceById(e);e&&(e.name=t)},yc.prototype.getNextItem=function(e,t){};var vc=Object.freeze({none:-1,point:0,polyline:1,polygon:2,label:3,imageLabel:4,position:5,imageLayer:6,dynamicObject:7,D3titles:8,box:9,circle:10,cone:11,pointfeaturelayer:12,polylinefeaturelayer:13,polygonfeaturelayer:14,pointmodel:15,rectangle:16,ellipsoid:17,wall:18,polylinevolume:19});function Cc(e,t){this._viewer=e,this._cesium=t,this._tree=we.getSource(),this._treeSource=we.Source,this._treeTemp=we.getTempSource(),this._tree1=we,this._core=new V}function wc(e,t){this._viewer=e,this._cesium=t,this._tree=we.getSource()}function bc(e,t){this._viewer=e,this._cesium=t}function Tc(e,t,i){this._viewer=e,this._cesium=t,this._tree=we.Source,this._createGroup=new Ie(this._viewer,this._cesium,this._tree),this._deleteItem=new mc(this._viewer,this._cesium,this._tree),this._findItem=new dc(this._viewer,this._cesium,this._tree),this._getItemName=new pc(this._viewer,this._cesium,this._tree),this._getVisibility=new gc(this._viewer,this._cesium,this._tree),this._setVisibility=new _c(this._viewer,this._cesium,this._tree),this._renameGroup=new fc(this._viewer,this._cesium,this._tree),this._getNextItem=new yc(this._viewer,this._cesium,this._tree),this._isGroup=new wc(this._viewer,this._cesium,this._tree),this._creator=new Yu(this._viewer,this._cesium),this._getObject=new Cc(this._viewer,this._cesium),this._exportTree=new bc(this._viewer,this._cesium),this._core=new V,this.InitTree(i,0),this.InitRootImageLayerAndTerrainlayer()}Cc.prototype.getObject=function(e){var t=Ce.clone(this._tree),t=we.getSourceById(t,e);if(t)return t.item;t=Ce.clone(we.PointSelectSource),e=we.getPointSelectSourceById(t,e);return e?e.item:void 0},Cc.prototype.getTreeItem=function(e){var t=Ce.clone(this._tree),t=we.getSourceById(t,e);if(t)return t;for(var i=this._viewer.dataSources,o=0;o<i.length;o++){var r,n=i.get(o).entities.getById(e);if(n){if(n.point&&(null==n.point.show||n.point.show._value)){(r=new ji(this._viewer,this._cesium)).setItem(n);var a={id:this._core.getuid(),name:"",pId:0,type:"point",item:r};return we.pusPointSelectSource(a),a}if(n.label&&(null==n.label.show||n.label.show._value)){(r=new zi(this._viewer,this._cesium)).setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"label",item:r};return we.pusPointSelectSource(a),a}if(n.box&&(null==n.box.show||n.box.show._value)){var s=new Fi(this._viewer,this._cesium);s.setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"box",item:s};return we.pusPointSelectSource(a),a}if(n.model&&(null==n.model.show||n.model.show._value)){(r=new model(this._viewer,this._cesium)).setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"model",item:r};return we.pusPointSelectSource(a),a}if(n.wall&&(null==n.wall.show||n.wall.show._value)){var l=new Hn(this._viewer,this._cesium);l.setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"wall",item:l};return we.pusPointSelectSource(a),a}if(n.polyline){l=new Vi(this._viewer,this._cesium);l.setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"polyline",item:l};return we.pusPointSelectSource(a),a}if(n.polygon){var u=new ki(this._viewer,this._cesium);u.setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"polygon",item:u};return we.pusPointSelectSource(a),a}if(n.rectangle){u=new Ni(this._viewer,this._cesium);u.setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"rectangle",item:u};return we.pusPointSelectSource(a),a}if(n.billboard&&(null==n.billboard.show||n.billboard.show._value)){(r=new On(this._viewer,this._cesium)).setItem(n);a={id:this._core.getuid(),name:"",pId:0,type:"billboard",item:r};return we.pusPointSelectSource(a),a}}}},Cc.prototype.updateItemId=function(e,t){var i=this._treeSource,o=we.getSourceById(i,e);if(o&&(o.id=t,"group"==o.type&&o.children&&0<o.children.length))for(var r=0;r<o.children.length;r++)o.children[r].pId=t;i=this._treeTemp,o=we.getSourceById(i,e);if(o&&(o.id=t,"group"==o.type&&o.children&&0<o.children.length))for(r=0;r<o.children.length;r++)o.children[r].pId=t},Cc.prototype.unifiedProject=function(e,t){for(var i=0;i<t.length;i++)t[i].id=e[i].id,t[i].pId=t[i].pId,t[i].children&&0<t[i].children.length&&this.unifiedProject(e[i].children,t[i].children)},Cc.prototype.insertProjectTree=function(e,t,i,o,r){var n,a,s,l,u,c,h,m,d=!0;return this._core.isnull(t)&&(t=this._core.getuid()),d=0!=r,vc.none==i||vc.position==i?(m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"unknown",item:null},we.insertGroupId(m,e)):vc.imageLayer==i?(m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,checked:d,type:"unknown",item:null},we.insertGroupId(m,e)):vc.dynamicObject==i?(m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"unknown",item:null},we.insertGroupId(m,e)):vc.point==i?((l=new ji(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"point",item:l},l.setTreeobj(m),we.insertGroupId(m,e)):vc.polyline==i?((r=new Vi(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"polyline",item:r},r.setTreeobj(m),we.insertGroupId(m,e)):vc.rectangle==i?((n=new Ni(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"rectangle",item:n},n.setTreeobj(m),we.insertGroupId(m,e)):vc.ellipsoid==i?((n=new Gi(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"ellipsoid",item:n},n.setTreeobj(m),we.insertGroupId(m,e)):vc.polygon==i?(a=new ki(this._viewer,this._cesium),o._entity?(a.setItem(o._entity),a._points=o._points):a.setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"polygon",item:a},a.setTreeobj(m),we.insertGroupId(m,e)):vc.wall==i?((a=new Hn(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"wall",item:a},a.setTreeobj(m),we.insertGroupId(m,e)):vc.polylinevolume==i?((s=new An(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"polylinevolume",item:s},s.setTreeobj(m),we.insertGroupId(m,e)):vc.pointmodel==i?((s=new Ye(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"pointmodel",item:s},s.setTreeobj(m),we.insertGroupId(m,e)):vc.label==i?((l=new zi(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"label",item:l},l.setTreeobj(m),we.insertGroupId(m,e)):vc.imageLabel==i?((l=new On(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,checked:d,type:"billboard",item:l},l.setTreeobj(m),we.insertGroupId(m,e)):vc.D3titles==i?((u=new Li(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"3DTilesets",item:u},u.setTreeobj(m),we.insertGroupId(m,e)):vc.box==i?((u=new Fi(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"box",item:u},u.setTreeobj(m),we.insertGroupId(m,e)):vc.circle==i?((c=new Bi(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"circle",item:c},c.setTreeobj(m),we.insertGroupId(m,e)):vc.cone==i?((c=new ao(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"cylinder",item:c},c.setTreeobj(m),we.insertGroupId(m,e)):vc.pointfeaturelayer==i?((h=new Oe(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"pointLayer",item:h},we.insertGroupId(m,e)):vc.pointfeaturelayer==i?((h=new Oe(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"polylineLayer",item:h},we.insertGroupId(m,e)):vc.polygonfeaturelayer==i&&((h=new Oe(this._viewer,this._cesium)).setItem(o),m={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"polygonLayer",item:h},we.insertGroupId(m,e)),m},wc.prototype.isGroup=function(e){var t=Ce.clone(this._tree),e=we.getSourceById(t,e);return!(!e||"group"!=e.type)},bc.prototype.exportMethod=function(e){for(var t,i=[],o=0;o<e.length;o++)"function"==typeof e[o].item.export&&(t=e[o].item.export(),i.push(t),e[o].children&&e[o].children.length&&(t=this.exportMethod(e[o].children),i.push(t)));return i},bc.prototype.export=function(){return this.exportMethod(we.Source)},Tc.prototype.export=function(){var e=this._exportTree.export(),t=new Blob([JSON.stringify(e)],{type:""});return this._core.saveAs(t,"tree.json"),e},Tc.prototype.createGroup=function(e,t,i){return this._createGroup=new Ie(this._viewer,this._cesium),this._createGroup.createGroup(e,t,i)},Tc.prototype.changeGroup=function(e,t){this._createGroup.changeGroup(e,t)},Tc.prototype.starttemporaryItem=function(){return this._createGroup.starttemporaryItem()},Tc.prototype.pushtemporaryItem=function(e){this._createGroup.pushtemporaryItem(e)},Tc.prototype.pushStateItem=function(e){this._createGroup.pushStateItem(e)},Tc.prototype.endtemporaryItem=function(){this._createGroup.endtemporaryItem()},Tc.prototype.deleteItem=function(e){return this._deleteItem.deleteItem(e)},Tc.prototype.findItem=function(e){return this._findItem.findItem(e)},Tc.prototype.getItemName=function(e){return this._getItemName.getItemName(e)},Tc.prototype.getObject=function(e){return this._getObject.getObject(e)},Tc.prototype.getTreeItem=function(e){return this._getObject.getTreeItem(e)},Tc.prototype.updateItemId=function(e,t){return this._getObject.updateItemId(e,t)},Tc.prototype.getVisibility=function(e){return this._getVisibility.getVisibility(e)},Tc.prototype.setVisibility=function(e,t){return this._setVisibility.setVisibility(e,t)},Tc.prototype.rename=function(e,t){return this._renameGroup.rename(e,t)},Tc.prototype.getNextItem=function(e,t){return this._getNextItem.getNextItem(e)},Tc.prototype.isGroup=function(e){return this._isGroup.isGroup(e)},Object.defineProperties(Tc.prototype,{exitsObjectType:{get:function(){return vc}}}),Tc.prototype.insertProjectTree=function(e,t,i,o,r,n){return this._core.isnull(e)&&!this._core.isnull(this._tree.selectedItem)&&"group"==this._tree.selectedItem.type&&(e=this._tree.selectedItem.id),e=this._core.isnull(e)?0:e,this._core.isnull(t)||(e=this.createGroup(t,!0,e)),this._getObject.insertProjectTree(e,i,o,r,n)},Tc.prototype.exitsGroup=function(e,t){return we.exitsGroup(e,t)},Tc.prototype.getTreeSource=function(){var e=Ce.cloneDeep(we.getSource());return we.removeItem(e)},Tc.prototype.unifiedProject=function(e,t){this._getObject.unifiedProject(e,t)},Tc.prototype.clearn=function(){we.clearn()},Object.defineProperties(Tc.prototype,{Source:{get:function(){return we.TempSource}}}),Object.defineProperties(Tc.prototype,{currentObj:{get:function(){return we.currentObj}}}),Tc.prototype.InitTree=function(e,t){if(e&&e.length)for(var i=0;i<e.length;i++){var o=e[i];switch(o.type){case"group":var r=this.createGroup(o.name,t);o.children&&o.children.length&&this.InitTree(o.children,r);break;case"label":this._creator.createLabel(o.position,o.text,o.option,t,o.description);break;case"imgLabel":this._creator.createImageLabel(o.position,o.imageLabel,t,o.description);break;case"polygon":this._creator.createPolygon(o.geometry,o.lineColor,o.altitudeType,t,o.description);break;case"polyline":this._creator.createPolyline(o.geometry,o.lineColor,o.altitudeType,t,o.description);break;case"box":this._creator.createBox(o.position,o.box,o.name,t,o.description);break;case"circle":this._creator.createCircle(o.position,o.circle,o.name,t,o.description);break;case"cone":this._creator.createCone(o.position,o.cylinder,o.name,o.description)}}},Tc.prototype.InitRootImageLayerAndTerrainlayer=function(){},Object.defineProperties(Tc.prototype,{selectedItem:{get:function(){return we.selectedItem},set:function(e){we.selectedItem=e}}});var Sc=setTimeout(()=>{Sc=void 0,logSmartEarthLog&&logSmartEarthLog()},1e4);function Pc(e,t,i={},o,r){this._core=new V,this._cesium=t||Cesium,Sc&&(clearTimeout(Sc),Sc=void 0,logSmartEarthLog&&logSmartEarthLog()),Cesium.Ion.defaultAccessToken=i.defaultAccessToken||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwYWRlZDhiNi1hZTljLTQ4MWItYjdjNS0xYTkyMjk2YzdlOTQiLCJpZCI6NjcxNTksImlhdCI6MTYzMTU4NDY2NX0.l2kHF0uC2pTgJYwzQGpEBj6HCCdbYfRThEbXajcXOI8";var a={toolbar:!1,baseLayerPicker:!1,shadows:!1,skyAtmosphere:new this._cesium.SkyAtmosphere,terrainShadows:this._cesium.ShadowMode.ENABLED,shouldAnimate:!0,animation:!0,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,imageryProviderViewModels:[],terrainProviderViewModels:[],contextOptions:{webgl:{preserveDrawingBuffer:!0},failIfMajorPerformanceCaveat:!1},navigation:!0,disableRightClickMenu:!0};if("string"==typeof i?a.imageryProvider=new this._cesium.SingleTileImageryProvider({url:i}):(i.url&&(a.imageryProvider=new this._cesium.SingleTileImageryProvider({url:i.url})),this._core.extend(a,i,!0)),a.baseLayerPicker){let t=this.getAllImageryView();if(a.basemaps)a.basemaps.forEach(e=>{a.imageryProviderViewModels.push(t[e])});else for(var n in t)a.imageryProviderViewModels.push(t[n])}else a.imageryProvider||(a.imageryProvider=new Cesium.ArcGisMapServerImageryProvider({name:"ArcGisMapServer",url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"}));t={destination:this._cesium.Cartesian3.fromDegrees(i.x||110,i.y||32,i.z||8e6),orientation:{heading:this._cesium.Math.toRadians(this._core.defaultValue(i.heading,0)),pitch:this._cesium.Math.toRadians(this._core.defaultValue(i.pitch,-90)),roll:this._cesium.Math.toRadians(this._core.defaultValue(i.roll,0))},duration:i.duration||.5};if(i.removeGlobe&&(a.skyBox=!1,a.skyAtmosphere=!1,a.contextOptions={failIfMajorPerformanceCaveat:!1,webgl:{alpha:!0,preserveDrawingBuffer:!0}}),this._Viewer=new this._cesium.Viewer(e,a),this._Viewer.scene,this._tree=o,this._Viewer.scene.globe.baseColor=this._cesium.Color.WHITE,this._Viewer.shadowMap.size=2048,this._Viewer._cesiumWidget._creditContainer.style.display="none",this._Viewer.terrainShadows=this._cesium.ShadowMode.ENABLED,this._AttachEvent=void 0,this._DetachEvent=void 0,this._Analysis=void 0,this._Navigate=void 0,this._Creator=void 0,this._Command=void 0,this._ProjectTree=void 0,this._Coordinate=void 0,this._VectorTileProvider=void 0,this.toolbar=i.toolbar,i.removeGlobe?(this._Viewer.imageryLayers.removeAll(),this._Viewer.shadows=!1,this._Viewer.scene.fog.enabled=!1,this._Viewer.scene.globe.show=!1,this._Viewer.scene.backgroundColor=Cesium.Color.fromCssColorString("rgba(0,0,0,0)"),this._Viewer.scene.light=new Cesium.DirectionalLight({direction:new Cesium.Cartesian3(1,-.9,-.9)}),i.backgroundImage&&(this._Viewer.container.style.backgroundImage="url("+i.backgroundImage+")")):this._Viewer.scene.globe.depthTestAgainstTerrain=!0,this.Navigate.flyToPointsInterest(t,r),this._Viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._Viewer.extend(Cesium.viewerCesiumInspectorMixin),a.maxViewHeight&&(this._Viewer.scene.screenSpaceCameraController.maximumZoomDistance=a.maxViewHeight),a.minViewHeight||a.maxViewPitch){this.minViewHeight=a.minViewHeight,this.maxViewPitch=a.maxViewPitch&&Cesium.Math.toRadians(a.maxViewPitch);let r=0,n=this._Viewer.scene,t=!1;if(this.maxViewPitch){let e=new Cesium.ScreenSpaceEventHandler(this._Viewer.scene.canvas);e.setInputAction(()=>{t=!0},Cesium.ScreenSpaceEventType.MIDDLE_DOWN),e.setInputAction(()=>{t=!1},this._cesium.ScreenSpaceEventType.MIDDLE_UP),e.setInputAction(()=>{t=!0},Cesium.ScreenSpaceEventType.RIGHT_DOWN),e.setInputAction(()=>{t=!1},this._cesium.ScreenSpaceEventType.RIGHT_UP)}this._Viewer.scene.preRender.addEventListener(()=>{let i=this._Viewer.camera;if(i&&i.positionCartographic){if(this.maxViewPitch){let e=i.pitch;t&&e>this.maxViewPitch?(e=this.maxViewPitch,i.setView({destination:this.oldPosition||i.position.clone(),orientation:{heading:i.heading,pitch:e,roll:0}})):this.oldPosition=i.position.clone()}if(this.minViewHeight){var o=n.globe.getHeight(i.positionCartographic);r=o||r;let e,t;o=i.positionCartographic.height-r;t=this._Viewer.scene.globe.translucency.enabled||this._Analysis&&(this._Analysis._UndergroundMode&&this._Analysis._UndergroundMode.isUndergroundMode||this._Analysis._StreetView&&this._Analysis._StreetView.isStreetView)?(e=i.positionCartographic.height<-200,-200):(e=o<this.minViewHeight,r+this.minViewHeight);o=i.pitch<0?i.pitch:0;e?i.setView({destination:this.oldPosition||this._cesium.Cartesian3.fromRadians(i.positionCartographic.longitude,i.positionCartographic.latitude,t),orientation:{heading:i.heading,pitch:o,roll:0}}):this.oldPosition=i.position.clone()}}})}if(Object.defineProperties(Cesium.Model.prototype,{_cachedGltf:{configurable:!0,set:function(e){var a,t,s;this._vtxf_cachedGltf=e,this._vtxf_cachedGltf&&this._vtxf_cachedGltf._gltf&&(a=this._vtxf_cachedGltf._gltf).extensionsUsed&&a.extensionsRequired&&(t=a.extensionsUsed.indexOf("KHR_technique_webgl"),e=a.extensionsRequired.indexOf("KHR_technique_webgl"),-1!==t&&(a.extensionsRequired.splice(e,1,"KHR_techniques_webgl"),a.extensionsUsed.splice(t,1,"KHR_techniques_webgl"),a.extensions=a.extensions||{},a.extensions.KHR_techniques_webgl={},a.extensions.KHR_techniques_webgl.programs=a.programs,a.extensions.KHR_techniques_webgl.shaders=a.shaders,a.extensions.KHR_techniques_webgl.techniques=a.techniques,s=a.extensions.KHR_techniques_webgl.techniques,a.materials.forEach(function(e,t){a.materials[t].extensions.KHR_technique_webgl.values=a.materials[t].values,a.materials[t].extensions.KHR_techniques_webgl=a.materials[t].extensions.KHR_technique_webgl;var i,o=a.materials[t].extensions.KHR_techniques_webgl;for(i in o.values){var r,n=s[o.technique].uniforms;for(r in n)if(n[r]===i){o.values[r]=o.values[i],delete o.values[i];break}}}),s.forEach(function(e){for(var t in e.attributes){var i=e.attributes[t];e.attributes[t]=e.parameters[i]}for(var o in e.uniforms){i=e.uniforms[o];e.uniforms[o]=e.parameters[i]}})))},get:function(){return this._vtxf_cachedGltf}}}),Cesium.Resource&&(Cesium.loadText=Cesium.Resource.fetchText,Cesium.loadJson=Cesium.Resource.fetchJson,Cesium.loadBlob=Cesium.Resource.fetchBlob,Cesium.loadArrayBuffer=Cesium.Resource.fetchArrayBuffer,Cesium.loadImage=Cesium.Resource.fetchImage),Cesium.isArray||(Cesium.isArray=Array.isArray),a.navigation){if(!Cesium.viewerCesiumNavigationMixin){let e=new E(!1);e.addJs(document.body,window.SmartEarthRootUrl+"Workers/viewerCesiumNavigationMixin.js")}r={defaultResetView:Cesium.Rectangle.fromDegrees(80,22,130,50),enableCompass:!0,enableZoomControls:!0,enableDistanceLegend:!0,enableCompassOuterRing:!0};this._Viewer.extend(Cesium.viewerCesiumNavigationMixin,i.navigationOption||r)}a.disableRightClickMenu&&(document.oncontextmenu=function(){return!1});!function(e){if(e.cesiumWidget._supportsImageRenderingPixelated&&window&&window.devicePixelRatio){for(var t=window.devicePixelRatio;2<=t;)t/=2;e.resolutionScale=t}e.scene.postProcessStages.fxaa.enabled=!0}(this._Viewer),this._Viewer.scene.light=new Cesium.DirectionalLight({direction:new Cesium.Cartesian3(.35492591601301104,-.8909182691839401,-.2833588392420772),intensity:10});var u=this;function c(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var o=Cesium.when.defer();return function e(){t.ready?Cesium.when(l(t,i),function(e){o.resolve(e)}):setTimeout(e,10)}(),o.promise}function s(e,t){for(var i=e.tilingScheme,o=i.positionToTileXY(t,0),e=u._Viewer.scene.globe._surface.tileProvider.quadtree._levelZeroTiles,r=e[0].x==o.x&&e[0].y==o.y?e[0]:e[1],n=1;n<22;n++){var a=function(e,t){for(var i=0;i<e.children.length;i++)if(e.children[i].state>=Cesium.QuadtreeTileLoadState.DONE&&(null!=e.children[i].data.terrainData._mesh||null!=e.children[i].data.terrainData._buffer)&&e.children[i].x==t.x&&e.children[i].y==t.y)return e.children[i]}(r,o=i.positionToTileXY(t,n));if(null==a)break;r=a}return r}function h(e){var t;for($.grep(u._Viewer.scene.primitives._primitives,function(e){return e instanceof Cesium.Cesium3DTileset}),t=0;t<e.length;++t){var i=e[t],o=i instanceof Cesium.Cartographic,r=o?i:Cesium.Cartographic.fromCartesian(i);r.height=u.G,o||(r=Cesium.Cartesian3.fromRadiansArrayHeights([r.longitude,r.latitude,r.height])[0],i.z=r.z)}return e}function l(e,t){for(var i=0;i<t.length;++i){var o=t[i],r=s(e,o);o.height=r.data.terrainData.interpolateHeight(r.rectangle,o.longitude,o.latitude)}return t}function m(e){this.value=new Float32Array([e])}u.G=65535,m.fromZBias=function(e){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return new m(e)},m.toValue=function(e,t){if(!Cesium.defined(e))throw new DeveloperError("zbias is required.");return Cesium.defined(t)?color.toBytes(t):new Float32Array(e)},m.equals=function(e,t){return e===t||Cesium.defined(e)&&Cesium.defined(t)&&e.value[0]===t.value[0]},m.defaultBias=function(){return m.fromZBias(15e-6)},this._cesium.ZBiasGeometryInstanceAttribute=m,this._cesium.SampleRenderedDataFlags={TERRAIN:2,MESH:4,FLOOR:8},this._cesium.DynamicEyeOffset=function(e){return void 0===e&&(e=0),new Cesium.Cartesian3(.001234321,0,e)},this._cesium.sampleRenderedData=function(r,e){var t=2,i=4,o=8;null==e&&(e=t|i);var n=Cesium.when.defer(),a=[];t<e?r.forEach(function(e){a.push(Cesium.Cartographic.fromRadians(e.longitude,e.latitude,e.height))}):a=r;var s=[];e&t&&s.push(c(u._Viewer.terrainProvider,r));var l=0<(e&o);return e&(i|o)&&s.push(function(e){Cesium.Check.defined("positions",e);var t=Cesium.when.defer();return Cesium.when(h(e),function(e){t.resolve(e)}),t.promise}(a)),Cesium.when.all(s).then(function(e){if(1<s.length)for(var t=0;t<r.length;t++){var i=e[0][t],o=e[1][t];o.height!=u.G&&(i.height<o.height||l)&&(i.height=o.height)}n.resolve(e[0])}),n.promise},this._cesium.sampleRenderedMesh=function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(h(e),function(e){i.resolve(e)}),i.promise},this._cesium.sampleRenderedTerrain=function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var o=Cesium.when.defer();return function e(){t.ready?Cesium.when(l(t,i),function(e){o.resolve(e)}):setTimeout(e,10)}(),o.promise},this._cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo=function(){var e,t=this.getRenderedLevelInfo(),i=0;for(e in t)i<Number(e)&&(i=Number(e));return{bestLevel:i,count:t[i]}},this._cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo=function(){var t=[];return this._tilesToRender.forEach(function(e){null==t[e.level]&&(t[e.level]=0),t[e.level]++}),t}}function Ec(e,t){this._viewer=e,this._cesium=t,this._tree=we.getSource()}Pc.prototype.getAllImageryView=function(){return{arcgis_img:new Cesium.ProviderViewModel({name:"ArcGIS影像",tooltip:"ArcGIS影像",iconUrl:window.SmartEarthRootUrl+"Workers/image/baseLayer/arcgis_img.png",creationFunction:()=>new Cesium.ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"})}),arcgis_dark:new Cesium.ProviderViewModel({name:"蓝色底图",tooltip:"蓝色底图",iconUrl:window.SmartEarthRootUrl+"Workers/image/baseLayer/arcgis_dark.png",creationFunction:()=>new Cesium.ArcGisMapServerImageryProvider({url:"http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer",enablePickFeatures:!1,usePreCachedTilesIfAvailable:!1,tilingScheme:this.Core.getOffsetTilingScheme()})})}},Object.defineProperties(Pc.prototype,{Analysis:{get:function(){return null==this._Analysis&&(this._Analysis=new Ai(this._Viewer,this._cesium)),this._Analysis}},Navigate:{get:function(){return null==this._Navigate&&(this._Navigate=new hc(this._Viewer,this._cesium,this._tree)),this._Navigate}},Creator:{get:function(){return null==this._Creator&&(this._Creator=new Yu(this._Viewer,this._cesium)),this._Creator}},Core:{get:function(){return null==this._Core&&(this._Core=new V),this._Core}},Command:{get:function(){return null==this._Command&&(this._Command=new lo(this._Viewer,this._cesium)),this._Command}},ProjectTree:{get:function(){return null==this._ProjectTree&&(this._ProjectTree=new Tc(this._Viewer,this._cesium,this._tree)),this._ProjectTree}},tree:{get:function(){return this._tree}},Viewer:{get:function(){return this._Viewer}},toolbar:{get:function(){return"block"===this._Viewer._toolbar.style.display},set:function(e){this._Viewer._toolbar.style.display=e?"block":"none"}},wireframe:{get:function(){return this._Viewer.cesiumInspector.viewModel.wireframe},set:function(e){this._Viewer.cesiumInspector.viewModel.wireframe=e}},tileCoordinates:{get:function(){return this._Viewer.cesiumInspector.viewModel.tileCoordinates},set:function(e){this._Viewer.cesiumInspector.viewModel.tileCoordinates=e}}}),Pc.prototype.navControl=function(e,t){t=t?"":"none";this._Viewer.cesiumNavigation&&("all"===e?this._Viewer.cesiumNavigation.container.style.display=t:"nav"===e?this._Viewer.cesiumNavigation.navigationDiv.style.display=t:this._Viewer.cesiumNavigation.distanceLegendDiv.style.display=t)},Pc.prototype.CreateWfs=function(e,t,i,o,r,n,a,s,l){return new ur(e,t,i,o,r,n,a,s,l)},Pc.prototype.AttachEvent=function(e,t){return null==this._AttachEvent&&(this._AttachEvent=new Ju(this._Viewer,this._cesium)),this._AttachEvent.AttachEvent(e,t)},Pc.prototype.RemoNormalCesiumLeftDoubleClick=function(){return null==this._DetachEvent&&(this._DetachEvent=new Xu(this._Viewer,this._cesium)),this._DetachEvent.RemoNormalCesiumLeftDoubleClick()},Pc.prototype.AttachOnLButtonDblClkEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ju(this._Viewer,this._cesium)),this._AttachEvent.AttachOnLButtonDblClkEvent(e)},Pc.prototype.AttachOnLButtonDownEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ju(this._Viewer,this._cesium)),this._AttachEvent.AttachOnLButtonDownEvent(e)},Pc.prototype.AttachOnLButtonUpEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ju(this._Viewer,this._cesium)),this._AttachEvent.AttachOnLButtonUpEvent(e)},Pc.prototype.AttachOnMButtonDblClkEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ju(this._Viewer,this._cesium)),this._AttachEvent.AttachOnMButtonDblClkEvent(e)},Pc.prototype.AttachOnMButtonDownEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ju(this._Viewer,this._cesium)),this._AttachEvent.AttachOnMButtonDownEvent(e)},Pc.prototype.AttachOnMButtonUpEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ju(this._Viewer,this._cesium)),this._AttachEvent.AttachOnMButtonUpEvent(e)},Pc.prototype.AttachOnMouseWheelEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ju(this._Viewer,this._cesium)),this._AttachEvent.AttachOnMouseWheelEvent(e)},Pc.prototype.AttachOnFrameEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ju(this._Viewer,this._cesium)),this._AttachEvent.AttachOnFrameEvent(e)},Pc.prototype.AttachOnRButtonDownEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ju(this._Viewer,this._cesium)),this._AttachEvent.AttachOnRButtonDownEvent(e)},Pc.prototype.AttachOnRButtonUpEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ju(this._Viewer,this._cesium)),this._AttachEvent.AttachOnRButtonUpEvent(e)},Pc.prototype.AttachCameraChangeEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ju(this._Viewer,this._cesium)),this._AttachEvent.AttachCameraChangeEvent(e)},Pc.prototype.CameraMoveEndEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ju(this._Viewer,this._cesium)),this._AttachEvent.CameraMoveEndEvent(e)},Pc.prototype.DetachEvent=function(e,t){return null==this._DetachEvent&&(this._DetachEvent=new Xu(this._Viewer,this._cesium)),this._DetachEvent.DetachEvent(e,t)},Pc.prototype.DetachEventAll=function(e){return null==this._DetachEvent&&(this._DetachEvent=new Xu(this._Viewer,this._cesium)),this._DetachEvent.DetachEventAll(e)},Pc.prototype.DetachCameraChangeEvent=function(e){return null==this._DetachEvent&&(this._DetachEvent=new Xu(this._Viewer,this._cesium)),this._DetachEvent.DetachCameraChangeEvent(e)},Ec.prototype.deleteItem=function(e){};var xc=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],o=!0,r=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(o=(a=s.next()).done)&&(i.push(a.value),!t||i.length!==t);o=!0);}catch(e){r=!0,n=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw n}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Ic="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Dc(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function Lc(e,t,i){this._viewer=e,this._cesium=t,this._viewer=null,this._Cesium=i.Cesium,this._url=i.url,this._urlParams=i.urlParams,this._urlTemplate=this._url+"?"+this._serialize(this._urlParams),this._rectangle=i.rectangle,this._maximumLevel=i.maximumLevel||19,this._minimumLevel=i.minimumLevel||1,this._tilingScheme=i.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=i.lowerLevelLimit||1,this._upperLevelLimit=i.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var o=this._radianToDegree(this._rectangle.west),r=this._radianToDegree(this._rectangle.south),n=this._radianToDegree(this._rectangle.east),a=this._radianToDegree(this._rectangle.north),s=this._minimumLevel;s<=this._maximumLevel;s++){var l=this._lonLatToTileInWGS84([o,r],s),u=this._lonLatToTileInWGS84([n,a],s),c=Math.min(l[0],u[0]),h=Math.max(l[0],u[0]),m=Math.min(l[1],u[1]),u=Math.max(l[1],u[1]);this._tileRangeByLevel[s]={minCol:m,maxCol:u,minRow:c,maxRow:h}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1}function Mc(){this._quadtree=void 0,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._loadTileEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,128,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._tileCache=[],this._primitivesWaitingToBeAddedToTheScene=[],this._pauseStreaming=!1,this._numTilesInLevel=[],this.STREAM_SPEED_IMIDIATE=0,this.STREAM_SPEED_FAST=1,this.STREAM_SPEED_NORMAL=2,this.STREAM_SPEED_SLOW=3,this._streamSpeed=this.STREAM_SPEED_NORMAL}function Ac(e,i){$.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection){t=t,e=Gc.indexOf(t);return t._parentCollection._primitiveOld=i,-1!==e?(viewer.scene.primitives.remove(Gc[e]._parentCollection),Gc[e]=t):Gc.push(t),!1}})}function Rc(e,t){viewer.scene.primitives.remove(t),e._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(t),this._onDestroyTilePrimitive=void 0}}function Oc(e,t,i){Cesium.when.all(e,function(){viewer.scene.primitives.remove(i)}),t._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(i),this._onDestroyTilePrimitive=void 0}}function Hc(e,t){Oc($.map(e._primitives,function(e){return e.readyPromise}),e,t)}function Vc(e,t){Oc($.map(e._primitives[0]._primitives,function(e){return e.readyPromise}),e,t)}function kc(e,t){viewer.scene.primitives.remove(t)}function Fc(e,t){Oc([e.readyPromise],e,t)}Lc.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":Ic(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},Lc.prototype._fetch=function(r){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(t,i){var o=new XMLHttpRequest;if(o.open(n.method||"GET",r),n.headers)for(var e in n.headers)o.setRequestHeader(e,n.headers[e]);o.onload=function(){if(4===o.readyState&&200===o.status)try{var e=JSON.parse(o.responseText);t(e)}catch(e){i(new Error("INVALID RESPONSE"))}},o.onerror=function(e){i(e)},o.onloadend=function(e){200!==e.target.status&&i(new Error("["+e.target.status+"]request failed: "+r))},o.send(n.body||null)})},Lc.prototype._lonLatToTileInWGS84=function(e,t){var i=xc(e,2),e=i[0],i=i[1];return[Math.floor(Math.pow(2,t)*(90-i)/180),Math.floor(Math.pow(2,t)*(180+e)/180)]},Lc.prototype._radianToDegree=function(e){return e/Math.PI*180},Lc.prototype._isTileInRange=function(e){try{var t=this._tileRangeByLevel[e.level],i=t.minCol,o=t.maxCol,r=t.minRow,n=t.maxRow;return e.x>=i&&e.x<=o&&e.y>=r&&e.y<=n}catch(e){return!1}},Lc.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},Lc.prototype._loadTile=function(e){var r=[],n=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),a=this;return e.features.forEach(function(e){if(a._propertyToBeFiltered&&Array.isArray(a._valuesToBeFiltered)){var t=e.properties[a._propertyToBeFiltered];if(a._valuesToBeFiltered.includes(t))return}var o,t=e.geometry.type;"Polygon"===t||"MultiPolygon"===t?(o=[],a.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){o.push([]),e.forEach(function(e){var t;2<e.length?e.forEach(function(e){var t;2<=e.length&&(t=o[i]).push.apply(t,Dc(e))}):(t=o[i]).push.apply(t,Dc(e))});var t=new a._Cesium.PolygonHierarchy(a._Cesium.Cartesian3.fromDegreesArray(o[i])),e=a._Cesium.BoundingSphere.fromPoints(t.positions).center,e=a._viewer.scene.globe.getHeight(a._Cesium.Cartographic.fromCartesian(e))||0,e=new a._Cesium.PolygonGeometry({polygonHierarchy:t,height:e,vertexFormat:a._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),e=new a._Cesium.GeometryInstance({geometry:e,attributes:{color:n}});r.push(e)})):console.warn('GeoJSONVectorTileProvider: geometry type "'+e.geometry.type+'" detected, but is not going to be rendered')}),new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:r})},Lc.prototype._cameraMoveEndHandler=function(){var i,o,e,t,r,n,a,s,l;this._stop||(i=this,o=Date.now(),t=(e=this._viewer.scene.globe._surface._tilesToRender).map(function(e){return e.level}),r=Math.min.apply(Math,Dc(t)),(n=Math.max.apply(Math,Dc(t)))<this._lowerLevelLimit&&(i._tileKeys=[],i._removeObsoletePrimitives(i._primitiveByTile,[]),e=[]),this._upperLevelLimit&&r>this._upperLevelLimit&&(i._tileKeys=[],i._removeObsoletePrimitives(i._primitiveByTile,[]),e=[]),(e=2<n-r?e.filter(function(e){return e.level>=n-2}):e).sort(function(e,t){return-(e.level-t.level)}),e=e.filter(function(e){return i._isTileInRange(e)}),this._upperLevelLimit&&(e=this._refineTiles(e,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=o,a=[],l=s=0,e.forEach(function(e){var t="z"+e.level+"x"+e.x+"y"+e.y;a.push(t),i._tileKeys.push(t),i._primitiveByTile[t]||(e=i._urlTemplate.replace(window.encodeURIComponent("{x}"),e.x).replace(window.encodeURIComponent("{y}"),e.y).replace(window.encodeURIComponent("{z}"),e.level),s++,i._fetch(e).then(function(e){if(i._isRemoved)throw new Error("DISCARD");if(i._isCameraMoving)throw new Error("DISCARD");if(o!==i._moveEndTimestamp)throw new Error("DISCARD");e=i._loadTile(e);i._primitiveCollection.add(e),i._primitiveByTile[t]=e,s<=++l&&(i._tileKeys=a,i._removeObsoletePrimitives(i._primitiveByTile,a))}).catch(function(e){s<=++l&&(i._tileKeys=a,i._removeObsoletePrimitives(i._primitiveByTile,a)),e.message}))}))},Lc.prototype._refineTiles=function(e,s){var l=[],u=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level<s-1)u.includes(t)||(l.push(e),u.push(t));else if(e.level===s-1)for(var i=0;i<2;i++)for(var o=0;o<2;o++){var r="Z"+(e.level+1)+"X"+(2*e.x+i)+"Y"+(2*e.y+o);u.includes(r)||(l.push({x:2*e.x+i,y:2*e.y+o,level:e.level+1}),u.push(r))}else{var n,a=e.level-s;0==a?u.includes(t)||(l.push(e),u.push(t)):(n=2*a,t=Math.floor(e.x/n),a=Math.floor(e.y/n),u.includes(n="Z"+s+"X"+t+"Y"+a)||(l.push({x:t,y:a,level:s}),u.push(n)))}}),l},Lc.prototype._removeObsoletePrimitives=function(e,t){var i,o=[];for(i in 0<t.length&&(o=t),e)o.includes(i)||this._primitiveCollection.remove(e[i])&&delete e[i]},Lc.prototype.addTo=function(e){this._viewer=e,this._viewer.scene.primitives.add(this._primitiveCollection),this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()},Lc.prototype.remove=function(){if(this._viewer){for(var e in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[e]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}},Lc.prototype.setStatus=function(e){this._stop=e},Lc.prototype.isRemoved=function(){return this._isRemoved},Lc.prototype.filterBy=function(e,t,i){this._propertyToBeFiltered=e,this._valuesToBeFiltered=t},Lc.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null},Object.defineProperties(Mc.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},loadTileEvent:{get:function(){return this._loadTileEvent}},pauseStreaming:{get:function(){return this._pauseStreaming},set:function(e){this._pauseStreaming=e}},streamSpeed:{get:function(){return this._streamSpeed},set:function(e){this._streamSpeed=e}},bestLevelAvailable:{get:function(){for(var e=0,t=0;t<22;t++)null!=this._numTilesInLevel[t]&&0<this._numTilesInLevel[t]&&e<t&&(e=t);return e}}}),Mc.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var Gc=[],Nc=0,Bc=!(Mc.prototype.onPreFrame=function(e,t){if(Nc++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;0<this._primitivesWaitingToBeAddedToTheScene.length;){var i=this._primitivesWaitingToBeAddedToTheScene.pop();e.primitives.add(i)}else 0<this._primitivesWaitingToBeAddedToTheScene.length&&Nc%this.streamSpeedFactor()==0&&((i=this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds&&100<i._instanceIds.length&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),e.primitives.add(i));$.each(Gc,function(e,t){t.ready&&viewer.scene.primitives.remove(t._parentCollection._primitiveOld)})}});Mc.prototype.initialize=function(e){Bc||(viewer.scene.preRender.addEventListener(this.onPreFrame,this),Bc=!0)},Mc.prototype.beginUpdate=function(e){this.quadtree.beginFrame(e)},Mc.prototype.endUpdate=function(e){var t=this;e.afterRender.push(function(){t.quadtree.endFrame(e)})},Mc.prototype.updateForPick=function(e){},Mc.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)*this._quadtree.maximumScreenSpaceError};Math.PI;Mc.prototype.placeHolder=function(e,t){t=t||Cesium.Color.fromBytes(0,255,0,255);t=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleOutlineGeometry({rectangle:e.rectangle,height:viewer.camera.positionCartographic.height-.99*TerraExplorer.internal.Navigate.HeightAboveGround}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0})});e.data.primitive.add(t)},Mc.prototype.loadTile=function(e,t){var i=this;null==this._numTilesInLevel[t._level]&&(this._numTilesInLevel[t._level]=0),this._numTilesInLevel[t._level]++,t.state===Cesium.QuadtreeTileLoadState.START&&(t.data={primitive:new Cesium.PrimitiveCollection,wfsLayerData:[],id:Cesium.createGuid(),freeResources:function(){if(i._tileCache[t.data.id]&&i._numTilesInLevel[t._level]--,i._numTilesInLevel[t._level]<0&&(i._numTilesInLevel[t._level]=0),Cesium.defined(this.wfsLayerData)){for(var e in this.wfsLayerData)Cesium.defined(this.wfsLayerData[e])&&this.wfsLayerData[e].freeResources();this.wfsLayerData=void 0}Cesium.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete i._tileCache[t.data.id]}},this._tileCache[t.data.id]=t,Math.abs(6371e3*(t.rectangle.south-t.rectangle.north)),t.data.boundingSphere3D=Cesium.BoundingSphere.fromRectangle3D(t.rectangle),t.data.boundingSphere2D=Cesium.BoundingSphere.fromRectangle2D(t.rectangle,e.mapProjection),t.rectangle.west,t.rectangle.south,t.rectangle.east,t.rectangle.north,this.loadTileEvent.raiseEvent(t),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)},Mc.prototype.getTile=function(e){return this._tileCache[e]},Mc.prototype.getAllTiles=function(){var e,t=[];for(e in this._tileCache)t.push(this._tileCache[e]);return t},Mc.prototype.computeTileVisibility=function(e,t,i){var o=this.computeDistanceToTile(e,t);return e._distance=o,t.fog.enabled&&9<e._level&&1<=Cesium.Math.fog(o,t.fog.density)?Cesium.Visibility.NONE:(e=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D,t.cullingVolume.computeVisibility(e))},Mc.prototype.showTileThisFrame=function(e,t){e.data.primitive.update(t)},Mc.prototype.computeDistanceToTile=function(e,t){var i=new Cesium.Cartesian3,e=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D,i=Cesium.Cartesian3.subtract(e.center,t.camera.positionWC,i),i=Cesium.Cartesian3.magnitude(i);return Math.max(1,i-TerraExplorer.internal.Navigate.GroundHeightAtCameraPosition)},Mc.prototype.isDestroyed=function(){return!1},Mc.prototype.destroy=function(){return Cesium.destroyObject(this)},Mc.prototype.getInstance=function(t){var i;return 0==Cesium.defined(t.TileManager)&&(t.TileManager=new e,i=new Cesium.QuadtreePrimitive({tileProvider:t.TileManager,maximumScreenSpaceError:2}),t.scene.primitives.add(i)),t.TileManager},Mc.prototype.addToScene=function(e){this._primitivesWaitingToBeAddedToTheScene.push(e)},Mc.prototype.removeFromScene=function(e){var t=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=t?(this._primitivesWaitingToBeAddedToTheScene[t].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(t,1)):viewer.scene.primitives.remove(e)},Mc.prototype.replaceInScene=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else switch(e.ID!=t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),null!=e._replacmentPrimitive&&viewer.scene.primitives.remove(e._replacmentPrimitive),e._replacmentPrimitive=t,viewer.scene.primitives.add(t),t.ID.split(":")[0]){case"billboards":Ac(t,e);break;case"labels":Rc(t,e);break;case"polygons":Hc(t,e);break;case"models":Vc(t,e);break;case"polylines":Fc(t,e);break;case"points":kc(0,e);break;default:console.log("Error updating layer"),viewer.scene.primitives.remove(e)}};var jc={billboards:Ac,labels:Rc,polygons:Hc,models:Vc,polylines:Fc,points:kc};Mc.prototype.replaceInSceneNew=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=i?this._primitivesWaitingToBeAddedToTheScene[i]=t:(e.ID!==t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(t),i=t.ID.split(":")[0],(i=jc[i])?i(t,e):(console.log("Error updating layer"),viewer.scene.primitives.remove(e)))};o.Analysis=Ai,o.Angle=C,o.ArcgisNVectorTileProvider=Lc,o.AttachEvent=Ju,o.BaiduImageryProvider=yr,o.Bearing=v,o.Billboard=wr,o.Box=Fi,o.BoxGeoJsonFeatureLayer=br,o.BufferAnalysis=Si,o.CIMServerTool=I,o.COMPILETIME="2022.3.15",o.CZML=Xl,o.Cartesian3_to_WGS84=function(e){return e=Cesium.Cartographic.fromCartesian(e),{lat:Cesium.Math.toDegrees(e.latitude),lon:Cesium.Math.toDegrees(e.longitude),height:e.height}},o.Cdcl=f,o.CesiumHeatmap=ho,o.CesiumHeatmapGL=co,o.CesiumRenderPass=bi,o.Circle=Bi,o.Color=G,o.CombineEcharts=x,o.Command=lo,o.Cone=ao,o.ConicSensor=Tr,o.ContentState=tu,o.CoordTransform=H,o.Core=V,o.Corridor=Sr,o.CreateWfsFeatureLayer=Mn,o.Creator=Yu,o.Current=qu,o.DDSTexture=_u,o.DateTime=Qu,o.DetachEvent=Xu,o.DivPoint=Pe,o.EdgeStage=Ti,o.ElevationContour=N,o.ElevationTool=mo,o.Ellipsoid=Gi,o.EntityCreator=Jo,o.EventType=uo,o.FieldIntensity=Wu,o.FlowField=kl,o.GeoJSONVectorTileProvider=Ae,o.GeoJSONVectorTileProvider1=ke,o.GeoJSONVectorTileProviderPolymerization=jn,o.GeoJsonFeatureLayer=Oe,o.Gettreeid=function(e,t){for(var i="",o=we.getSource(),r=0;r<o.length;r++)e==o[r].name&&o[r].pId==t&&(i=o[r].id);return i},o.GmlParser=So,o.Hawkeye=Wl,o.Heatmap=Kl,o.Highvolume=Ri,o.ImageLabel=On,o.ImageryLayer=Fn,o.JBAlgorithm=po,o.KmlLayer=ql,o.Label=zi,o.LabelGeoJsonFeatureLayer=ul,o.LabelGeoJsonFeatureLayercopy=Ve,o.LonLatProjection=Fe,o.MaterialPass=fu,o.MilitaryStandard=Yl,o.Mjcl=w,o.ModelClipping=Jl,o.ModelEdit=Se,o.ModifyMesh=Ql,o.Navigate=hc,o.Particle=Yt,o.Point=ji,o.PointFly=Ii,o.PointModel=Ye,o.Polygon=ki,o.PolygonGeoJsonFeatureLayer=qe,o.PolygonVectorGeoJsonFeatureLayer=Ol,o.PolygonVectorTileLayerArcgis=Ct,o.Polyline=Vi,o.PolylineGeoJsonFeatureLayer=We,o.PolylineTrailLinkMaterial=S,o.PolylineVolume=An,o.PopupMessage=xe,o.ProjectTree=Tc,o.Recorder=L,o.Rectangle=Ni,o.RenderEntity=Tu,o.Road=zl,o.S3MCacheFileRenderEntity=Eu,o.S3MCompressType=U,o.S3MContentFactory=xu,o.S3MContentParser=Iu,o.S3MCreateIndexJob=bu,o.S3MCreateVertexJob=wu,o.S3MLayerCache=Vu,o.S3MLayerScheduler=Ru,o.S3MPixelFormat=Q,o.S3MTile=Lu,o.S3MTilesFS=Cu,o.S3MTilesLayer=ku,o.S3MTilesVS=vu,o.S3ModelParser=ru,o.SE3DTileset=Li,o.SFSTerrainProvider=vl,o.SFSTerrainProvider7_2_3=gl,o.SFSTerrainProviderjs=Ll,o.SGWorld=Pc,o.SatelliteTrail=$l,o.Scan=li,o.Scan_PostProcessStage=Oi,o.Scopefieldvision=Hi,o.Screenshot=xi,o.ShadowsAnalysis=Ei,o.SightLine=Pt,o.SimpleGraphic=Tt,o.SimpleSqlParser=Fo,o.Skip=E,o.SkyBox=Vl,o.SkylineAnalysis=yi,o.Stop=cc,o.StreamerPath=Nl,o.StreamerWall=Bl,o.StreetView=Jt,o.SunshineAnalysis=Di,o.TdtLabel=zu,o.Terrain=Ml,o.TerrainExcavation=Pi,o.TerrainModifier=Bu,o.TileManager=Mc,o.TileManager1=Po,o.TrailLine=jl,o.UndergroundMode=qt,o.VERSION="2.0.0",o.VectorCesiumTerrainProvider=wl,o.VectorGeoJsonFeatureLayer=Ge,o.VectorImgFeatureLayer=Nu,o.VectorTileProvider=He,o.VertexCompressOption=iu,o.Video=ju,o.ViewCone=eu,o.Viewshed=fi,o.VolumeGeoJsonFeatureLayer=Al,o.VolumetricMeasure=Ul,o.WFSTool=fr,o.WGS84_to_Cartesian3=function(e){return Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)},o.WallGeoFeatureLayer=bt,o.WaterGeoJsonFeatureLayer=Uu,o.WfsLayer=ur,o.WorkerPool=ko,o.billboardGeoJsonFeatureLayer=Re,o.clone=function e(t,i){if(null===t||"object"!=typeof t)return t;i=P(i,!1);var o,r,n=new t.constructor;for(o in t)t.hasOwnProperty(o)&&(r=t[o],i&&(r=e(r,i)),n[o]=r);return n},o.configData=D,o.createGroup=Ie,o.createTerrainProfile=B,o.curtaincontrast=xt,o.defaultValue=P,o.deleteItem=mc,o.demolition=Mi,o.depthTestAgainstTerrain=ui,o.dynamicObject=Ui,o.execute=so,o.expandGroup=Ec,o.export=bc,o.findItem=dc,o.flyTo=Ue,o.flyToObj=ac,o.getExitsObjectType=vc,o.getItemName=pc,o.getNextItem=yc,o.getObject=Cc,o.getPosition=Ee,o.getVisibility=gc,o.indoormode=At,o.isGroup=wc,o.jumpTo=sc,o.lineOfSight=Te,o.lodash=Ce,o.main=Ku,o.measureTerrainArea=b,o.measureTerrainHeight=y,o.measureTerrainPerimeter=m,o.measureTerrainkPerimeter=T,o.northfinger=lc,o.pako_inflate=ou,o.pbf_dev=Je,o.position=Rn,o.renameGroup=fc,o.setPosition=uc,o.setVisibility=_c,o.tdtwmtsimageprovider=To,o.terrainExaggeration=Et,o.treeSource=we,o.vectortile=yt,o.wall=Hn,o.weather=Wt,o.zoomIn=rc,o.zoomOut=nc,Object.defineProperty(o,"__esModule",{value:!0})});