deeptwins-engine-3d 0.1.76 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/dist/assets/Build/DeepTwins/Image/noise.png +0 -0
  2. package/dist/assets/Build/DeepTwins/Workers/CustomRasterClip.worker.js +1 -2
  3. package/dist/assets/Build/DeepTwins/Workers/MvtVector.worker.js +1 -1
  4. package/dist/assets/Build/Map3d/ThirdParty/Workers/zip-web-worker.js +640 -0
  5. package/dist/assets/Build/Map3d/ThirdParty/wasm_splats_bg.wasm +0 -0
  6. package/dist/assets/Build/Map3d/ThirdParty/zip-module.wasm +0 -0
  7. package/dist/assets/Build/Map3d/Workers/chunk-27NG6PQR.js +456 -0
  8. package/dist/assets/Build/Map3d/Workers/chunk-2JVMMMWT.js +353 -0
  9. package/dist/assets/Build/Map3d/Workers/chunk-2Y2XYQCS.js +1481 -0
  10. package/dist/assets/Build/Map3d/Workers/chunk-34RF3V5G.js +220 -0
  11. package/dist/assets/Build/Map3d/Workers/chunk-35H7BYLJ.js +1800 -0
  12. package/dist/assets/Build/Map3d/Workers/chunk-57OGEF5V.js +435 -0
  13. package/dist/assets/Build/Map3d/Workers/chunk-5PX3DYJA.js +196 -0
  14. package/dist/assets/Build/Map3d/Workers/chunk-7B5XGQRN.js +171 -0
  15. package/dist/assets/Build/Map3d/Workers/chunk-ATLWOZFF.js +39 -0
  16. package/dist/assets/Build/Map3d/Workers/chunk-BMSUECTA.js +1055 -0
  17. package/dist/assets/Build/Map3d/Workers/chunk-C6IA4TKW.js +476 -0
  18. package/dist/assets/Build/Map3d/Workers/chunk-CZ44I32U.js +157 -0
  19. package/dist/assets/Build/Map3d/Workers/chunk-DE6UV44R.js +122 -0
  20. package/dist/assets/Build/Map3d/Workers/chunk-DUCCKVOG.js +834 -0
  21. package/dist/assets/Build/Map3d/Workers/chunk-EBJBPIYX.js +239 -0
  22. package/dist/assets/Build/Map3d/Workers/chunk-EYSYQ2R6.js +138 -0
  23. package/dist/assets/Build/Map3d/Workers/chunk-FMCAAUQI.js +368 -0
  24. package/dist/assets/Build/Map3d/Workers/chunk-GMYZNRRQ.js +2717 -0
  25. package/dist/assets/Build/Map3d/Workers/chunk-GWPNZZV4.js +781 -0
  26. package/dist/assets/Build/Map3d/Workers/chunk-HLP2U4KW.js +758 -0
  27. package/dist/assets/Build/Map3d/Workers/chunk-HSJSUPQV.js +500 -0
  28. package/dist/assets/Build/Map3d/Workers/chunk-I73Q3AG7.js +58 -0
  29. package/dist/assets/Build/Map3d/Workers/chunk-IMZ4YIMV.js +511 -0
  30. package/dist/assets/Build/Map3d/Workers/chunk-IZSK4DVF.js +421 -0
  31. package/dist/assets/Build/Map3d/Workers/chunk-JKLMRPKK.js +75 -0
  32. package/dist/assets/Build/Map3d/Workers/chunk-KGM345JM.js +691 -0
  33. package/dist/assets/Build/Map3d/Workers/chunk-L4IR5U4G.js +102 -0
  34. package/dist/assets/Build/Map3d/Workers/chunk-MG4EVQH2.js +44 -0
  35. package/dist/assets/Build/Map3d/Workers/chunk-NXWEFAZJ.js +300 -0
  36. package/dist/assets/Build/Map3d/Workers/chunk-PDFAJISJ.js +59 -0
  37. package/dist/assets/Build/Map3d/Workers/chunk-PHWZFJR5.js +100 -0
  38. package/dist/assets/Build/Map3d/Workers/chunk-PLE7CHBE.js +101 -0
  39. package/dist/assets/Build/Map3d/Workers/chunk-PN3GIZ5Q.js +163 -0
  40. package/dist/assets/Build/Map3d/Workers/chunk-PXL5XLHV.js +1073 -0
  41. package/dist/assets/Build/Map3d/Workers/chunk-QYXOF5JC.js +959 -0
  42. package/dist/assets/Build/Map3d/Workers/chunk-R2LIFXV3.js +115 -0
  43. package/dist/assets/Build/Map3d/Workers/chunk-R4W6IRJZ.js +10357 -0
  44. package/dist/assets/Build/Map3d/Workers/chunk-R5PZXG56.js +1258 -0
  45. package/dist/assets/Build/Map3d/Workers/chunk-RZQLZIUI.js +629 -0
  46. package/dist/assets/Build/Map3d/Workers/chunk-SIBDD6Y4.js +390 -0
  47. package/dist/assets/Build/Map3d/Workers/chunk-U5NN6JTQ.js +398 -0
  48. package/dist/assets/Build/Map3d/Workers/chunk-UA5RPPP3.js +73 -0
  49. package/dist/assets/Build/Map3d/Workers/chunk-UXLKFS3C.js +305 -0
  50. package/dist/assets/Build/Map3d/Workers/chunk-VUX4BQIM.js +37 -0
  51. package/dist/assets/Build/Map3d/Workers/chunk-WJDUUUJS.js +684 -0
  52. package/dist/assets/Build/Map3d/Workers/chunk-XBJOJHWX.js +139 -0
  53. package/dist/assets/Build/Map3d/Workers/chunk-XJDMTNKD.js +634 -0
  54. package/dist/assets/Build/Map3d/Workers/chunk-XUCXZZE5.js +963 -0
  55. package/dist/assets/Build/Map3d/Workers/chunk-YIKGVMJ5.js +287 -0
  56. package/dist/assets/Build/Map3d/Workers/chunk-YTNCIBPQ.js +262 -0
  57. package/dist/assets/Build/Map3d/Workers/chunk-ZMDUYETO.js +55 -0
  58. package/dist/assets/Build/Map3d/Workers/chunk-ZW52HXFN.js +2857 -0
  59. package/dist/esm/analyze/LineOfSightAnalysis.js +1 -326
  60. package/dist/esm/analyze/SubmergenceAnalysis.js +1 -137
  61. package/dist/esm/analyze/SunLightAnalysis.js +1 -91
  62. package/dist/esm/analyze/TerrainExcavationAnalysis.js +1 -612
  63. package/dist/esm/analyze/ViewshedAnalysis.js +1 -292
  64. package/dist/esm/cameraControl/ModelRoamHistory.js +1 -639
  65. package/dist/esm/cameraControl/ModelRoamRealTime.js +1 -874
  66. package/dist/esm/cameraControl/Roam.js +1 -418
  67. package/dist/esm/cameraControl/Rotate.js +1 -134
  68. package/dist/esm/cameraControl/RotateInPlace.js +1 -99
  69. package/dist/esm/constant.d.ts +90 -0
  70. package/dist/esm/constant.js +1 -1287
  71. package/dist/esm/deepTwins/index.js +1 -121
  72. package/dist/esm/drawCommand/index.js +1 -3
  73. package/dist/esm/drawCommand/viewShed/Event.js +1 -142
  74. package/dist/esm/drawCommand/viewShed/RectangularSensorPrimitive.js +1 -1306
  75. package/dist/esm/drawCommand/viewShed/ViewShadowPrimitive.js +1 -66
  76. package/dist/esm/drawCommand/viewShed/ViewShedAnalyserLayer.js +1 -466
  77. package/dist/esm/drawCommand/viewShed/ViewShedMap.js +1 -1238
  78. package/dist/esm/drawCommand/viewShed/config.js +1 -21
  79. package/dist/esm/drawCommand/volumeCloud/GeometryPrimitive.js +1 -89
  80. package/dist/esm/drawCommand/volumeCloud/ImprovedNoise.js +1 -112
  81. package/dist/esm/drawCommand/volumeCloud/VolumeClouds.js +1 -91
  82. package/dist/esm/drawer/algorithm.js +1 -314
  83. package/dist/esm/drawer/common.js +1 -965
  84. package/dist/esm/drawer/coordinate.js +1 -184
  85. package/dist/esm/drawer/index.js +1 -688
  86. package/dist/esm/drawer/plotUtil.js +1 -266
  87. package/dist/esm/drawer/shape/Assemble.js +1 -415
  88. package/dist/esm/drawer/shape/AttackArrow.js +1 -442
  89. package/dist/esm/drawer/shape/BaseShape.js +1 -383
  90. package/dist/esm/drawer/shape/Bow.js +1 -375
  91. package/dist/esm/drawer/shape/Circle.js +1 -461
  92. package/dist/esm/drawer/shape/Curve.js +1 -386
  93. package/dist/esm/drawer/shape/DragPoint.js +1 -211
  94. package/dist/esm/drawer/shape/Elliptic.js +1 -491
  95. package/dist/esm/drawer/shape/Formation.js +1 -395
  96. package/dist/esm/drawer/shape/PincerArrow.js +1 -445
  97. package/dist/esm/drawer/shape/Point.js +1 -131
  98. package/dist/esm/drawer/shape/Polygon.js +1 -368
  99. package/dist/esm/drawer/shape/Polyline.js +1 -325
  100. package/dist/esm/drawer/shape/RegularPolygon.js +1 -468
  101. package/dist/esm/drawer/shape/RightAngleArrow.js +1 -423
  102. package/dist/esm/drawer/shape/Sector.js +1 -568
  103. package/dist/esm/drawer/shape/StraightArrow.js +1 -422
  104. package/dist/esm/drawer/shape/SwallowtailArrow.js +1 -438
  105. package/dist/esm/drawer/types.js +1 -11
  106. package/dist/esm/drawer/utils.js +1 -381
  107. package/dist/esm/global.css +22 -1
  108. package/dist/esm/graphicLayer/BaseEntity.js +1 -51
  109. package/dist/esm/graphicLayer/BaseLayer.js +1 -730
  110. package/dist/esm/graphicLayer/BasePointPrimitive.js +1 -45
  111. package/dist/esm/graphicLayer/BasePrimitive.js +1 -36
  112. package/dist/esm/graphicLayer/BasePrimitiveInstance.js +1 -37
  113. package/dist/esm/graphicLayer/BaseSource.d.ts +1 -1
  114. package/dist/esm/graphicLayer/BaseSource.js +1 -630
  115. package/dist/esm/graphicLayer/BillboardEntity.js +1 -106
  116. package/dist/esm/graphicLayer/BillboardPrimitive.js +1 -119
  117. package/dist/esm/graphicLayer/BoxEntity.js +1 -99
  118. package/dist/esm/graphicLayer/BoxPrimitive.js +1 -48
  119. package/dist/esm/graphicLayer/BoxPrimitiveInstance.js +1 -91
  120. package/dist/esm/graphicLayer/EllipseEntity.js +1 -110
  121. package/dist/esm/graphicLayer/EllipsePrimitive.js +1 -47
  122. package/dist/esm/graphicLayer/EllipsePrimitiveInstance.js +1 -98
  123. package/dist/esm/graphicLayer/EllipsoidEntity.js +1 -118
  124. package/dist/esm/graphicLayer/EllipsoidPrimitive.js +1 -48
  125. package/dist/esm/graphicLayer/EllipsoidPrimitiveInstance.js +1 -113
  126. package/dist/esm/graphicLayer/GraphicLayerCollection.js +1 -491
  127. package/dist/esm/graphicLayer/HtmlEntity.d.ts +4 -0
  128. package/dist/esm/graphicLayer/HtmlEntity.js +1 -189
  129. package/dist/esm/graphicLayer/LabelEntity.js +1 -110
  130. package/dist/esm/graphicLayer/LabelPrimitive.js +1 -127
  131. package/dist/esm/graphicLayer/ModelEntity.js +1 -122
  132. package/dist/esm/graphicLayer/ModelPrimitive.js +1 -59
  133. package/dist/esm/graphicLayer/ModelPrimitiveInstance.js +1 -86
  134. package/dist/esm/graphicLayer/PointEntity.js +1 -94
  135. package/dist/esm/graphicLayer/PointPrimitive.js +1 -107
  136. package/dist/esm/graphicLayer/PolygonEntity.js +1 -103
  137. package/dist/esm/graphicLayer/PolygonGroundPrimitive.js +1 -49
  138. package/dist/esm/graphicLayer/PolygonGroundPrimitiveImageMaterialInstance.js +1 -87
  139. package/dist/esm/graphicLayer/PolygonPrimitive.js +1 -60
  140. package/dist/esm/graphicLayer/PolygonPrimitiveImageMaterialInstance.js +1 -84
  141. package/dist/esm/graphicLayer/PolygonPrimitiveInstance.js +1 -101
  142. package/dist/esm/graphicLayer/PolylineEntity.js +1 -96
  143. package/dist/esm/graphicLayer/PolylineGroundPrimitive.js +1 -55
  144. package/dist/esm/graphicLayer/PolylineGroundPrimitiveInstance.js +1 -85
  145. package/dist/esm/graphicLayer/PolylinePrimitive.js +1 -53
  146. package/dist/esm/graphicLayer/PolylinePrimitiveInstance.js +1 -85
  147. package/dist/esm/graphicLayer/PolylineVolumeEntity.js +1 -105
  148. package/dist/esm/graphicLayer/PolylineVolumePrimitive.js +1 -47
  149. package/dist/esm/graphicLayer/PolylineVolumePrimitiveInstance.js +1 -94
  150. package/dist/esm/graphicLayer/WallEntity.js +1 -96
  151. package/dist/esm/graphicLayer/WallPrimitive.js +1 -47
  152. package/dist/esm/graphicLayer/WallPrimitiveInstance.js +1 -88
  153. package/dist/esm/index.d.ts +4 -0
  154. package/dist/esm/index.js +1 -175
  155. package/dist/esm/lowAltitude/BarrierLayer.js +1 -172
  156. package/dist/esm/lowAltitude/BaseGridMvtLayer.js +1 -122
  157. package/dist/esm/lowAltitude/FactorLayer.js +1 -199
  158. package/dist/esm/lowAltitude/FlightPlanning.js +1 -411
  159. package/dist/esm/lowAltitude/FlightRiskEvaluation.js +1 -543
  160. package/dist/esm/lowAltitude/GridDraw.js +1 -137
  161. package/dist/esm/lowAltitude/PoiLayer.js +1 -74
  162. package/dist/esm/lowAltitude/RoutePlanning.js +1 -318
  163. package/dist/esm/lowAltitude/VisitLayer.js +1 -180
  164. package/dist/esm/map/Event.js +1 -377
  165. package/dist/esm/map/GroundSkyBox.js +1 -166
  166. package/dist/esm/map/Map.js +1 -881
  167. package/dist/esm/map/Property.js +1 -35
  168. package/dist/esm/material/AtmosphericDispersion.js +1 -569
  169. package/dist/esm/material/GlobalVolumetricCloud.js +1 -377
  170. package/dist/esm/material/VolumeCloud.js +1 -115
  171. package/dist/esm/material/WeatherEffects.js +1 -351
  172. package/dist/esm/material/entity/BaseMaterialProperty.js +1 -51
  173. package/dist/esm/material/entity/CircleWaveMaterialProperty.js +1 -101
  174. package/dist/esm/material/entity/DynamicWallMaterialProperty.js +1 -101
  175. package/dist/esm/material/entity/ImageGlowingMaterialProperty.js +1 -89
  176. package/dist/esm/material/entity/ImageMaterialProperty.js +1 -34
  177. package/dist/esm/material/entity/PolylineTrailLinkMaterialProperty.js +1 -132
  178. package/dist/esm/material/primitive/BaseMaterialAppearance.js +1 -28
  179. package/dist/esm/material/primitive/ImageGlowingMaterialAppearance.js +1 -77
  180. package/dist/esm/material/primitive/ImageMaterialAppearance.js +1 -77
  181. package/dist/esm/measure/Area.js +1 -220
  182. package/dist/esm/measure/BaseDraw.js +1 -105
  183. package/dist/esm/measure/Distance.js +1 -223
  184. package/dist/esm/measure/index.js +1 -266
  185. package/dist/esm/measure/types.js +1 -17
  186. package/dist/esm/measure/utils.js +1 -319
  187. package/dist/esm/particle/BaseParticle.js +1 -196
  188. package/dist/esm/particle/FireParticle.js +1 -65
  189. package/dist/esm/particle/FountainParticle.js +1 -80
  190. package/dist/esm/particle/SmokeParticle.js +1 -65
  191. package/dist/esm/particle/common.js +1 -23
  192. package/dist/esm/particle/index.js +1 -5
  193. package/dist/esm/property/PositionProperty.js +1 -56
  194. package/dist/esm/tileLayer/ArcGisLayer.js +1 -41
  195. package/dist/esm/tileLayer/CustomRasterClipWorkerClient.js +1 -147
  196. package/dist/esm/tileLayer/CustomRasterLayer.js +1 -1136
  197. package/dist/esm/tileLayer/ImageryLayer.js +1 -44
  198. package/dist/esm/tileLayer/MvtVectorLoad.js +1 -1549
  199. package/dist/esm/tileLayer/MvtVectorWorkerClient.js +1 -126
  200. package/dist/esm/tileLayer/RasterLayer.js +1 -23
  201. package/dist/esm/tileLayer/WmsLayer.js +1 -26
  202. package/dist/esm/tileLayer/WmtsLayer.js +1 -23
  203. package/dist/esm/tool/BuildClampedPolygonGrid.js +1 -278
  204. package/dist/esm/tool/Compass.js +1 -282
  205. package/dist/esm/tool/PrimitiveCluster.js +1 -706
  206. package/dist/esm/tool/TimerInterval.js +1 -58
  207. package/dist/esm/tool/common.js +1 -405
  208. package/dist/esm/tool/fetch.js +1 -222
  209. package/dist/esm/tool/heatmap.js +1 -631
  210. package/dist/esm/tool/utils.d.ts +1 -0
  211. package/dist/esm/tool/utils.js +1 -501
  212. package/dist/esm/toolTip/index.js +1 -79
  213. package/dist/esm/videoFusion/BaseVideo.d.ts +7 -0
  214. package/dist/esm/videoFusion/BaseVideo.js +1 -330
  215. package/dist/esm/videoFusion/VideoProject.js +1 -230
  216. package/dist/esm/videoFusion/VideoTexture.js +1 -163
  217. package/dist/esm/visualization/BaseHeatmap.js +1 -271
  218. package/dist/esm/visualization/BoundaryHighlight.d.ts +135 -0
  219. package/dist/esm/visualization/BoundaryHighlight.js +1 -0
  220. package/dist/esm/visualization/DynamicWater.js +1 -289
  221. package/dist/esm/visualization/Frustum.js +1 -248
  222. package/dist/esm/visualization/Heatmap2d.js +1 -97
  223. package/dist/esm/visualization/Heatmap3d.js +1 -281
  224. package/dist/esm/visualization/MigrationEffect.js +1 -397
  225. package/dist/esm/visualization/PointCluster.js +1 -220
  226. package/dist/esm/visualization/RadarScan.js +1 -333
  227. package/dist/esm/visualization/SampledTerrainRiver.d.ts +180 -0
  228. package/dist/esm/visualization/SampledTerrainRiver.js +1 -0
  229. package/dist/esm/visualization/SampledTerrainWater.d.ts +170 -0
  230. package/dist/esm/visualization/SampledTerrainWater.js +1 -0
  231. package/dist/esm/visualization/WindField.d.ts +72 -0
  232. package/dist/esm/visualization/WindField.js +1 -0
  233. package/dist/esm/visualization/windCore.d.ts +161 -0
  234. package/dist/esm/visualization/windCore.js +8 -0
  235. package/dist/umd/deeptwins-engine-3d.min.css +1 -1
  236. package/dist/umd/deeptwins-engine-3d.min.js +1 -1
  237. package/package.json +6 -4
@@ -1,706 +1 @@
1
- // @ts-nocheck
2
- import * as Cesium from 'deeptwins-cesium';
3
- import { Billboard, BillboardCollection, BoundingRectangle, Cartesian2, Cartesian3, defined, Event, Label, LabelCollection, Matrix4, PointPrimitive, PointPrimitiveCollection, SceneMode } from 'deeptwins-cesium';
4
- import KDBush from 'kdbush';
5
-
6
- /**
7
- * Defines how screen space objects (billboards, points, labels) are clustered.
8
- *
9
- * @param {object} [options] An object with the following properties:
10
- * @param {boolean} [options.enabled=false] Whether or not to enable clustering.
11
- * @param {number} [options.pixelRange=80] The pixel range to extend the screen space bounding box.
12
- * @param {number} [options.minimumClusterSize=2] The minimum number of screen space objects that can be clustered.
13
- * @param {boolean} [options.clusterBillboards=true] Whether or not to cluster the billboards of an entity.
14
- * @param {boolean} [options.clusterLabels=true] Whether or not to cluster the labels of an entity.
15
- * @param {boolean} [options.clusterPoints=true] Whether or not to cluster the points of an entity.
16
- * @param {boolean} [options.show=true] Determines if the entities in the cluster will be shown.
17
- *
18
- * @alias PrimitiveCluster
19
- * @constructor
20
- *
21
- * @demo {@link https://sandcastle.cesium.com/index.html?src=Clustering.html|Cesium Sandcastle Clustering Demo}
22
- */
23
- function PrimitiveCluster(options) {
24
- var _options, _options$enabled, _options$pixelRange, _options$minimumClust, _options$clusterBillb, _options$clusterLabel, _options$clusterPoint, _options$show;
25
- options = (_options = options) !== null && _options !== void 0 ? _options : {};
26
- this._enabled = (_options$enabled = options.enabled) !== null && _options$enabled !== void 0 ? _options$enabled : false;
27
- this._pixelRange = (_options$pixelRange = options.pixelRange) !== null && _options$pixelRange !== void 0 ? _options$pixelRange : 80;
28
- this._minimumClusterSize = (_options$minimumClust = options.minimumClusterSize) !== null && _options$minimumClust !== void 0 ? _options$minimumClust : 2;
29
- this._clusterBillboards = (_options$clusterBillb = options.clusterBillboards) !== null && _options$clusterBillb !== void 0 ? _options$clusterBillb : true;
30
- this._clusterLabels = (_options$clusterLabel = options.clusterLabels) !== null && _options$clusterLabel !== void 0 ? _options$clusterLabel : true;
31
- this._clusterPoints = (_options$clusterPoint = options.clusterPoints) !== null && _options$clusterPoint !== void 0 ? _options$clusterPoint : true;
32
- this._labelCollection = undefined;
33
- this._billboardCollection = undefined;
34
- this._pointCollection = undefined;
35
- this._clusterBillboardCollection = undefined;
36
- this._clusterLabelCollection = undefined;
37
- this._clusterPointCollection = undefined;
38
- this._collectionIndicesByEntity = {};
39
- this._unusedLabelIndices = [];
40
- this._unusedBillboardIndices = [];
41
- this._unusedPointIndices = [];
42
- this._previousClusters = [];
43
- this._previousHeight = undefined;
44
- this._enabledDirty = false;
45
- this._clusterDirty = false;
46
- this._cluster = undefined;
47
- this._removeEventListener = undefined;
48
- this._clusterEvent = new Event();
49
-
50
- /**
51
- * Determines if entities in this collection will be shown.
52
- *
53
- * @type {boolean}
54
- * @default true
55
- */
56
- this.show = (_options$show = options.show) !== null && _options$show !== void 0 ? _options$show : true;
57
- }
58
- function expandBoundingBox(bbox, pixelRange) {
59
- bbox.x -= pixelRange;
60
- bbox.y -= pixelRange;
61
- bbox.width += pixelRange * 2.0;
62
- bbox.height += pixelRange * 2.0;
63
- }
64
- var labelBoundingBoxScratch = new BoundingRectangle();
65
- function getBoundingBox(item, coord, pixelRange, entityCluster, result) {
66
- if (defined(item._labelCollection) && entityCluster._clusterLabels) {
67
- result = Label.getScreenSpaceBoundingBox(item, coord, result);
68
- } else if (defined(item._billboardCollection) && entityCluster._clusterBillboards) {
69
- result = Billboard.getScreenSpaceBoundingBox(item, coord, result);
70
- } else if (defined(item._pointPrimitiveCollection) && entityCluster._clusterPoints) {
71
- result = PointPrimitive.getScreenSpaceBoundingBox(item, coord, result);
72
- }
73
- expandBoundingBox(result, pixelRange);
74
- if (entityCluster._clusterLabels && !defined(item._labelCollection) && defined(item.id) && hasLabelIndex(entityCluster, item.id.id) && defined(item.id._label)) {
75
- var labelIndex = entityCluster._collectionIndicesByEntity[item.id.id].labelIndex;
76
- var label = entityCluster._labelCollection.get(labelIndex);
77
- var labelBBox = Label.getScreenSpaceBoundingBox(label, coord, labelBoundingBoxScratch);
78
- expandBoundingBox(labelBBox, pixelRange);
79
- result = BoundingRectangle.union(result, labelBBox, result);
80
- }
81
- return result;
82
- }
83
- function addNonClusteredItem(item, entityCluster) {
84
- item.clusterShow = true;
85
- if (!defined(item._labelCollection) && defined(item.id) && hasLabelIndex(entityCluster, item.id.id) && defined(item.id._label)) {
86
- var labelIndex = entityCluster._collectionIndicesByEntity[item.id.id].labelIndex;
87
- var label = entityCluster._labelCollection.get(labelIndex);
88
- label.clusterShow = true;
89
- }
90
- }
91
- function addCluster(position, numPoints, ids, entityCluster) {
92
- var cluster = {
93
- billboard: entityCluster._clusterBillboardCollection.add(),
94
- label: entityCluster._clusterLabelCollection.add(),
95
- point: entityCluster._clusterPointCollection.add()
96
- };
97
- cluster.billboard.show = false;
98
- cluster.point.show = false;
99
- cluster.label.show = true;
100
- cluster.label.text = numPoints.toLocaleString();
101
- cluster.label.id = ids;
102
- cluster.billboard.position = cluster.label.position = cluster.point.position = position;
103
- entityCluster._clusterEvent.raiseEvent(ids, cluster);
104
- }
105
- function hasLabelIndex(entityCluster, entityId) {
106
- return defined(entityCluster) && defined(entityCluster._collectionIndicesByEntity[entityId]) && defined(entityCluster._collectionIndicesByEntity[entityId].labelIndex);
107
- }
108
- function getScreenSpacePositions(collection, points, scene, occluder, entityCluster) {
109
- if (!defined(collection)) {
110
- return;
111
- }
112
- var length = collection.length;
113
- for (var i = 0; i < length; ++i) {
114
- var item = collection.get(i);
115
- item.clusterShow = false;
116
- if (!item.show || entityCluster._scene.mode === SceneMode.SCENE3D && !occluder.isPointVisible(item.position)) {
117
- continue;
118
- }
119
-
120
- // const canClusterLabels =
121
- // entityCluster._clusterLabels && defined(item._labelCollection);
122
- // const canClusterBillboards =
123
- // entityCluster._clusterBillboards && defined(item.id._billboard);
124
- // const canClusterPoints =
125
- // entityCluster._clusterPoints && defined(item.id._point);
126
- // if (canClusterLabels && (canClusterPoints || canClusterBillboards)) {
127
- // continue;
128
- // }
129
-
130
- var coord = item.computeScreenSpacePosition(scene);
131
- if (!defined(coord)) {
132
- continue;
133
- }
134
- points.push({
135
- index: i,
136
- collection: collection,
137
- clustered: false,
138
- coord: coord
139
- });
140
- }
141
- }
142
- var pointBoundinRectangleScratch = new BoundingRectangle();
143
- var totalBoundingRectangleScratch = new BoundingRectangle();
144
- var neighborBoundingRectangleScratch = new BoundingRectangle();
145
- function createDeclutterCallback(entityCluster) {
146
- return function (amount) {
147
- if (defined(amount) && amount < 0.05 || !entityCluster.enabled) {
148
- return;
149
- }
150
- var scene = entityCluster._scene;
151
- var labelCollection = entityCluster._labelCollection;
152
- var billboardCollection = entityCluster._billboardCollection;
153
- var pointCollection = entityCluster._pointCollection;
154
- if (!defined(labelCollection) && !defined(billboardCollection) && !defined(pointCollection) || !entityCluster._clusterBillboards && !entityCluster._clusterLabels && !entityCluster._clusterPoints) {
155
- return;
156
- }
157
- var clusteredLabelCollection = entityCluster._clusterLabelCollection;
158
- var clusteredBillboardCollection = entityCluster._clusterBillboardCollection;
159
- var clusteredPointCollection = entityCluster._clusterPointCollection;
160
- if (defined(clusteredLabelCollection)) {
161
- clusteredLabelCollection.removeAll();
162
- } else {
163
- clusteredLabelCollection = entityCluster._clusterLabelCollection = new LabelCollection({
164
- scene: scene
165
- });
166
- }
167
- if (defined(clusteredBillboardCollection)) {
168
- clusteredBillboardCollection.removeAll();
169
- } else {
170
- clusteredBillboardCollection = entityCluster._clusterBillboardCollection = new BillboardCollection({
171
- scene: scene
172
- });
173
- }
174
- if (defined(clusteredPointCollection)) {
175
- clusteredPointCollection.removeAll();
176
- } else {
177
- clusteredPointCollection = entityCluster._clusterPointCollection = new PointPrimitiveCollection();
178
- }
179
- var pixelRange = entityCluster._pixelRange;
180
- var minimumClusterSize = entityCluster._minimumClusterSize;
181
- var clusters = entityCluster._previousClusters;
182
- var newClusters = [];
183
- var previousHeight = entityCluster._previousHeight;
184
- var currentHeight = scene.camera.positionCartographic.height;
185
- var ellipsoid = scene.ellipsoid;
186
- var cameraPosition = scene.camera.positionWC;
187
- var occluder = new Cesium.EllipsoidalOccluder(ellipsoid, cameraPosition);
188
- var points = [];
189
- if (entityCluster._clusterLabels) {
190
- getScreenSpacePositions(labelCollection, points, scene, occluder, entityCluster);
191
- }
192
- if (entityCluster._clusterBillboards) {
193
- getScreenSpacePositions(billboardCollection, points, scene, occluder, entityCluster);
194
- }
195
- if (entityCluster._clusterPoints) {
196
- getScreenSpacePositions(pointCollection, points, scene, occluder, entityCluster);
197
- }
198
- var i;
199
- var j;
200
- var length;
201
- var bbox;
202
- var neighbors;
203
- var neighborLength;
204
- var neighborIndex;
205
- var neighborPoint;
206
- var ids;
207
- var numPoints;
208
- var collection;
209
- var collectionIndex;
210
- if (points.length > 0) {
211
- var index = new KDBush(points.length, 64, Uint32Array);
212
- for (var p = 0; p < points.length; ++p) {
213
- index.add(points[p].coord.x, points[p].coord.y);
214
- }
215
- index.finish();
216
- if (currentHeight < previousHeight) {
217
- length = clusters.length;
218
- for (i = 0; i < length; ++i) {
219
- var cluster = clusters[i];
220
- if (!occluder.isPointVisible(cluster.position)) {
221
- continue;
222
- }
223
- var coord = Billboard._computeScreenSpacePosition(Matrix4.IDENTITY, cluster.position, Cartesian3.ZERO, Cartesian2.ZERO, scene);
224
- if (!defined(coord)) {
225
- continue;
226
- }
227
- var factor = 1.0 - currentHeight / previousHeight;
228
- var width = cluster.width = cluster.width * factor;
229
- var height = cluster.height = cluster.height * factor;
230
- width = Math.max(width, cluster.minimumWidth);
231
- height = Math.max(height, cluster.minimumHeight);
232
- var minX = coord.x - width * 0.5;
233
- var minY = coord.y - height * 0.5;
234
- var maxX = coord.x + width;
235
- var maxY = coord.y + height;
236
- neighbors = index.range(minX, minY, maxX, maxY);
237
- neighborLength = neighbors.length;
238
- numPoints = 0;
239
- ids = [];
240
- for (j = 0; j < neighborLength; ++j) {
241
- neighborIndex = neighbors[j];
242
- neighborPoint = points[neighborIndex];
243
- if (!neighborPoint.clustered) {
244
- ++numPoints;
245
- collection = neighborPoint.collection;
246
- collectionIndex = neighborPoint.index;
247
- ids.push(collection.get(collectionIndex).id);
248
- }
249
- }
250
- if (numPoints >= minimumClusterSize) {
251
- addCluster(cluster.position, numPoints, ids, entityCluster);
252
- newClusters.push(cluster);
253
- for (j = 0; j < neighborLength; ++j) {
254
- points[neighbors[j]].clustered = true;
255
- }
256
- }
257
- }
258
- }
259
- length = points.length;
260
- for (i = 0; i < length; ++i) {
261
- var point = points[i];
262
- if (point.clustered) {
263
- continue;
264
- }
265
- point.clustered = true;
266
- collection = point.collection;
267
- collectionIndex = point.index;
268
- var item = collection.get(collectionIndex);
269
- bbox = getBoundingBox(item, point.coord, pixelRange, entityCluster, pointBoundinRectangleScratch);
270
- var totalBBox = BoundingRectangle.clone(bbox, totalBoundingRectangleScratch);
271
- neighbors = index.range(bbox.x, bbox.y, bbox.x + bbox.width, bbox.y + bbox.height);
272
- neighborLength = neighbors.length;
273
- var clusterPosition = Cartesian3.clone(item.position);
274
- numPoints = 1;
275
- ids = [item.id];
276
- for (j = 0; j < neighborLength; ++j) {
277
- neighborIndex = neighbors[j];
278
- neighborPoint = points[neighborIndex];
279
- if (!neighborPoint.clustered) {
280
- var neighborItem = neighborPoint.collection.get(neighborPoint.index);
281
- var neighborBBox = getBoundingBox(neighborItem, neighborPoint.coord, pixelRange, entityCluster, neighborBoundingRectangleScratch);
282
- Cartesian3.add(neighborItem.position, clusterPosition, clusterPosition);
283
- BoundingRectangle.union(totalBBox, neighborBBox, totalBBox);
284
- ++numPoints;
285
- ids.push(neighborItem.id);
286
- }
287
- }
288
- if (numPoints >= minimumClusterSize) {
289
- var position = Cartesian3.multiplyByScalar(clusterPosition, 1.0 / numPoints, clusterPosition);
290
- addCluster(position, numPoints, ids, entityCluster);
291
- newClusters.push({
292
- position: position,
293
- width: totalBBox.width,
294
- height: totalBBox.height,
295
- minimumWidth: bbox.width,
296
- minimumHeight: bbox.height
297
- });
298
- for (j = 0; j < neighborLength; ++j) {
299
- points[neighbors[j]].clustered = true;
300
- }
301
- } else {
302
- addNonClusteredItem(item, entityCluster);
303
- }
304
- }
305
- }
306
- if (clusteredLabelCollection.length === 0) {
307
- clusteredLabelCollection.destroy();
308
- entityCluster._clusterLabelCollection = undefined;
309
- }
310
- if (clusteredBillboardCollection.length === 0) {
311
- clusteredBillboardCollection.destroy();
312
- entityCluster._clusterBillboardCollection = undefined;
313
- }
314
- if (clusteredPointCollection.length === 0) {
315
- clusteredPointCollection.destroy();
316
- entityCluster._clusterPointCollection = undefined;
317
- }
318
- entityCluster._previousClusters = newClusters;
319
- entityCluster._previousHeight = currentHeight;
320
- };
321
- }
322
- PrimitiveCluster.prototype._initialize = function (scene) {
323
- this._scene = scene;
324
- var cluster = createDeclutterCallback(this);
325
- this._cluster = cluster;
326
- this._removeEventListener = scene.camera.changed.addEventListener(cluster);
327
- };
328
- Object.defineProperties(PrimitiveCluster.prototype, {
329
- /**
330
- * Gets or sets whether clustering is enabled.
331
- * @memberof PrimitiveCluster.prototype
332
- * @type {boolean}
333
- */
334
- enabled: {
335
- get: function get() {
336
- return this._enabled;
337
- },
338
- set: function set(value) {
339
- this._enabledDirty = value !== this._enabled;
340
- this._enabled = value;
341
- }
342
- },
343
- /**
344
- * Gets or sets the pixel range to extend the screen space bounding box.
345
- * @memberof PrimitiveCluster.prototype
346
- * @type {number}
347
- */
348
- pixelRange: {
349
- get: function get() {
350
- return this._pixelRange;
351
- },
352
- set: function set(value) {
353
- this._clusterDirty = this._clusterDirty || value !== this._pixelRange;
354
- this._pixelRange = value;
355
- }
356
- },
357
- /**
358
- * Gets or sets the minimum number of screen space objects that can be clustered.
359
- * @memberof PrimitiveCluster.prototype
360
- * @type {number}
361
- */
362
- minimumClusterSize: {
363
- get: function get() {
364
- return this._minimumClusterSize;
365
- },
366
- set: function set(value) {
367
- this._clusterDirty = this._clusterDirty || value !== this._minimumClusterSize;
368
- this._minimumClusterSize = value;
369
- }
370
- },
371
- /**
372
- * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link PrimitiveCluster.newClusterCallback}.
373
- * @memberof PrimitiveCluster.prototype
374
- * @type {Event<PrimitiveCluster.newClusterCallback>}
375
- */
376
- clusterEvent: {
377
- get: function get() {
378
- return this._clusterEvent;
379
- }
380
- },
381
- /**
382
- * Gets or sets whether clustering billboard entities is enabled.
383
- * @memberof PrimitiveCluster.prototype
384
- * @type {boolean}
385
- */
386
- clusterBillboards: {
387
- get: function get() {
388
- return this._clusterBillboards;
389
- },
390
- set: function set(value) {
391
- this._clusterDirty = this._clusterDirty || value !== this._clusterBillboards;
392
- this._clusterBillboards = value;
393
- }
394
- },
395
- /**
396
- * Gets or sets whether clustering labels entities is enabled.
397
- * @memberof PrimitiveCluster.prototype
398
- * @type {boolean}
399
- */
400
- clusterLabels: {
401
- get: function get() {
402
- return this._clusterLabels;
403
- },
404
- set: function set(value) {
405
- this._clusterDirty = this._clusterDirty || value !== this._clusterLabels;
406
- this._clusterLabels = value;
407
- }
408
- },
409
- /**
410
- * Gets or sets whether clustering point entities is enabled.
411
- * @memberof PrimitiveCluster.prototype
412
- * @type {boolean}
413
- */
414
- clusterPoints: {
415
- get: function get() {
416
- return this._clusterPoints;
417
- },
418
- set: function set(value) {
419
- this._clusterDirty = this._clusterDirty || value !== this._clusterPoints;
420
- this._clusterPoints = value;
421
- }
422
- }
423
- });
424
- function createGetEntity(collectionProperty, CollectionConstructor, unusedIndicesProperty, entityIndexProperty) {
425
- return function (entity) {
426
- var collection = this[collectionProperty];
427
- if (!defined(this._collectionIndicesByEntity)) {
428
- this._collectionIndicesByEntity = {};
429
- }
430
- var entityIndices = this._collectionIndicesByEntity[entity.id];
431
- if (!defined(entityIndices)) {
432
- entityIndices = this._collectionIndicesByEntity[entity.id] = {
433
- billboardIndex: undefined,
434
- labelIndex: undefined,
435
- pointIndex: undefined
436
- };
437
- }
438
- if (defined(collection) && defined(entityIndices[entityIndexProperty])) {
439
- return collection.get(entityIndices[entityIndexProperty]);
440
- }
441
- if (!defined(collection)) {
442
- collection = this[collectionProperty] = new CollectionConstructor({
443
- scene: this._scene
444
- });
445
- }
446
- var index;
447
- var entityItem;
448
- var unusedIndices = this[unusedIndicesProperty];
449
- if (unusedIndices.length > 0) {
450
- index = unusedIndices.shift();
451
- entityItem = collection.get(index);
452
- } else {
453
- entityItem = collection.add();
454
- index = collection.length - 1;
455
- }
456
- entityIndices[entityIndexProperty] = index;
457
- var that = this;
458
- Promise.resolve().then(function () {
459
- that._clusterDirty = true;
460
- });
461
- return entityItem;
462
- };
463
- }
464
- function removeEntityIndicesIfUnused(entityCluster, entityId) {
465
- var indices = entityCluster._collectionIndicesByEntity[entityId];
466
- if (!defined(indices.billboardIndex) && !defined(indices.labelIndex) && !defined(indices.pointIndex)) {
467
- delete entityCluster._collectionIndicesByEntity[entityId];
468
- }
469
- }
470
-
471
- /**
472
- * Returns a new {@link Label}.
473
- * @param {Entity} entity The entity that will use the returned {@link Label} for visualization.
474
- * @returns {Label} The label that will be used to visualize an entity.
475
- *
476
- * @private
477
- */
478
- PrimitiveCluster.prototype.getLabel = createGetEntity('_labelCollection', LabelCollection, '_unusedLabelIndices', 'labelIndex');
479
-
480
- /**
481
- * Removes the {@link Label} associated with an entity so it can be reused by another entity.
482
- * @param {Entity} entity The entity that will uses the returned {@link Label} for visualization.
483
- *
484
- * @private
485
- */
486
- PrimitiveCluster.prototype.removeLabel = function (entity) {
487
- var entityIndices = this._collectionIndicesByEntity && this._collectionIndicesByEntity[entity.id];
488
- if (!defined(this._labelCollection) || !defined(entityIndices) || !defined(entityIndices.labelIndex)) {
489
- return;
490
- }
491
- var index = entityIndices.labelIndex;
492
- entityIndices.labelIndex = undefined;
493
- removeEntityIndicesIfUnused(this, entity.id);
494
- var label = this._labelCollection.get(index);
495
- label.show = false;
496
- label.text = '';
497
- label.id = undefined;
498
- this._unusedLabelIndices.push(index);
499
- this._clusterDirty = true;
500
- };
501
-
502
- /**
503
- * Returns a new {@link Billboard}.
504
- * @param {Entity} entity The entity that will use the returned {@link Billboard} for visualization.
505
- * @returns {Billboard} The label that will be used to visualize an entity.
506
- *
507
- * @private
508
- */
509
- PrimitiveCluster.prototype.getBillboard = createGetEntity('_billboardCollection', BillboardCollection, '_unusedBillboardIndices', 'billboardIndex');
510
-
511
- /**
512
- * Removes the {@link Billboard} associated with an entity so it can be reused by another entity.
513
- * @param {Entity} entity The entity that will uses the returned {@link Billboard} for visualization.
514
- *
515
- * @private
516
- */
517
- PrimitiveCluster.prototype.removeBillboard = function (entity) {
518
- var entityIndices = this._collectionIndicesByEntity && this._collectionIndicesByEntity[entity.id];
519
- if (!defined(this._billboardCollection) || !defined(entityIndices) || !defined(entityIndices.billboardIndex)) {
520
- return;
521
- }
522
- var index = entityIndices.billboardIndex;
523
- entityIndices.billboardIndex = undefined;
524
- removeEntityIndicesIfUnused(this, entity.id);
525
- var billboard = this._billboardCollection.get(index);
526
- billboard.id = undefined;
527
- billboard.show = false;
528
- billboard.image = undefined;
529
- this._unusedBillboardIndices.push(index);
530
- this._clusterDirty = true;
531
- };
532
-
533
- /**
534
- * Returns a new {@link Point}.
535
- * @param {Entity} entity The entity that will use the returned {@link Point} for visualization.
536
- * @returns {Point} The label that will be used to visualize an entity.
537
- *
538
- * @private
539
- */
540
- PrimitiveCluster.prototype.getPoint = createGetEntity('_pointCollection', PointPrimitiveCollection, '_unusedPointIndices', 'pointIndex');
541
-
542
- /**
543
- * Removes the {@link Point} associated with an entity so it can be reused by another entity.
544
- * @param {Entity} entity The entity that will uses the returned {@link Point} for visualization.
545
- *
546
- * @private
547
- */
548
- PrimitiveCluster.prototype.removePoint = function (entity) {
549
- var entityIndices = this._collectionIndicesByEntity && this._collectionIndicesByEntity[entity.id];
550
- if (!defined(this._pointCollection) || !defined(entityIndices) || !defined(entityIndices.pointIndex)) {
551
- return;
552
- }
553
- var index = entityIndices.pointIndex;
554
- entityIndices.pointIndex = undefined;
555
- removeEntityIndicesIfUnused(this, entity.id);
556
- var point = this._pointCollection.get(index);
557
- point.show = false;
558
- point.id = undefined;
559
- this._unusedPointIndices.push(index);
560
- this._clusterDirty = true;
561
- };
562
- function disableCollectionClustering(collection) {
563
- if (!defined(collection)) {
564
- return;
565
- }
566
- var length = collection.length;
567
- for (var i = 0; i < length; ++i) {
568
- collection.get(i).clusterShow = true;
569
- }
570
- }
571
- function updateEnable(entityCluster) {
572
- if (entityCluster.enabled) {
573
- return;
574
- }
575
- if (defined(entityCluster._clusterLabelCollection)) {
576
- entityCluster._clusterLabelCollection.destroy();
577
- }
578
- if (defined(entityCluster._clusterBillboardCollection)) {
579
- entityCluster._clusterBillboardCollection.destroy();
580
- }
581
- if (defined(entityCluster._clusterPointCollection)) {
582
- entityCluster._clusterPointCollection.destroy();
583
- }
584
- entityCluster._clusterLabelCollection = undefined;
585
- entityCluster._clusterBillboardCollection = undefined;
586
- entityCluster._clusterPointCollection = undefined;
587
- disableCollectionClustering(entityCluster._labelCollection);
588
- disableCollectionClustering(entityCluster._billboardCollection);
589
- disableCollectionClustering(entityCluster._pointCollection);
590
- }
591
-
592
- /**
593
- * Gets the draw commands for the clustered billboards/points/labels if enabled, otherwise,
594
- * queues the draw commands for billboards/points/labels created for entities.
595
- * @private
596
- */
597
- PrimitiveCluster.prototype.update = function (frameState) {
598
- if (!this.show) {
599
- return;
600
- }
601
-
602
- // If clustering is enabled before the label collection is updated,
603
- // the glyphs haven't been created so the screen space bounding boxes
604
- // are incorrect.
605
- var commandList;
606
- if (defined(this._labelCollection) && this._labelCollection.length > 0 && this._labelCollection.get(0)._glyphs.length === 0) {
607
- commandList = frameState.commandList;
608
- frameState.commandList = [];
609
- this._labelCollection.update(frameState);
610
- frameState.commandList = commandList;
611
- }
612
-
613
- // If clustering is enabled before the billboard collection is updated,
614
- // the images haven't been added to the image atlas so the screen space bounding boxes
615
- // are incorrect.
616
- if (defined(this._billboardCollection) && this._billboardCollection.length > 0 && !defined(this._billboardCollection.get(0).width)) {
617
- commandList = frameState.commandList;
618
- frameState.commandList = [];
619
- this._billboardCollection.update(frameState);
620
- frameState.commandList = commandList;
621
- }
622
- if (this._enabledDirty) {
623
- this._enabledDirty = false;
624
- updateEnable(this);
625
- this._clusterDirty = true;
626
- }
627
- if (this._clusterDirty) {
628
- this._clusterDirty = false;
629
- this._cluster();
630
- }
631
- if (defined(this._clusterLabelCollection)) {
632
- this._clusterLabelCollection.update(frameState);
633
- }
634
- if (defined(this._clusterBillboardCollection)) {
635
- this._clusterBillboardCollection.update(frameState);
636
- }
637
- if (defined(this._clusterPointCollection)) {
638
- this._clusterPointCollection.update(frameState);
639
- }
640
- if (defined(this._labelCollection)) {
641
- this._labelCollection.update(frameState);
642
- }
643
- if (defined(this._billboardCollection)) {
644
- this._billboardCollection.update(frameState);
645
- }
646
- if (defined(this._pointCollection)) {
647
- this._pointCollection.update(frameState);
648
- }
649
- };
650
-
651
- /**
652
- * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
653
- * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
654
- * <p>
655
- * Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed
656
- * from a data source collection and added to another.
657
- * </p>
658
- */
659
- PrimitiveCluster.prototype.destroy = function () {
660
- this._labelCollection = this._labelCollection && this._labelCollection.destroy();
661
- this._billboardCollection = this._billboardCollection && this._billboardCollection.destroy();
662
- this._pointCollection = this._pointCollection && this._pointCollection.destroy();
663
- this._clusterLabelCollection = this._clusterLabelCollection && this._clusterLabelCollection.destroy();
664
- this._clusterBillboardCollection = this._clusterBillboardCollection && this._clusterBillboardCollection.destroy();
665
- this._clusterPointCollection = this._clusterPointCollection && this._clusterPointCollection.destroy();
666
- if (defined(this._removeEventListener)) {
667
- this._removeEventListener();
668
- this._removeEventListener = undefined;
669
- }
670
- this._labelCollection = undefined;
671
- this._billboardCollection = undefined;
672
- this._pointCollection = undefined;
673
- this._clusterBillboardCollection = undefined;
674
- this._clusterLabelCollection = undefined;
675
- this._clusterPointCollection = undefined;
676
- this._collectionIndicesByEntity = undefined;
677
- this._unusedLabelIndices = [];
678
- this._unusedBillboardIndices = [];
679
- this._unusedPointIndices = [];
680
- this._previousClusters = [];
681
- this._previousHeight = undefined;
682
- this._enabledDirty = false;
683
- this._pixelRangeDirty = false;
684
- this._minimumClusterSizeDirty = false;
685
- return undefined;
686
- };
687
-
688
- /**
689
- * A event listener function used to style clusters.
690
- * @callback PrimitiveCluster.newClusterCallback
691
- *
692
- * @param {Entity[]} clusteredEntities An array of the entities contained in the cluster.
693
- * @param {object} cluster An object containing the Billboard, Label, and Point
694
- * primitives that represent this cluster of entities.
695
- * @param {Billboard} cluster.billboard
696
- * @param {Label} cluster.label
697
- * @param {PointPrimitive} cluster.point
698
- *
699
- * @example
700
- * // The default cluster values.
701
- * dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {
702
- * cluster.label.show = true;
703
- * cluster.label.text = entities.length.toLocaleString();
704
- * });
705
- */
706
- export default PrimitiveCluster;
1
+ var _0x38f8bf=_0x6cec;(function(_0xfb43ab,_0x25b402){var _0xfaca67=_0x6cec,_0x386cb8=_0xfb43ab();while(!![]){try{var _0x4fe654=-parseInt(_0xfaca67(0xda))/0x1+parseInt(_0xfaca67(0xcc))/0x2*(-parseInt(_0xfaca67(0xd6))/0x3)+parseInt(_0xfaca67(0xe7))/0x4*(-parseInt(_0xfaca67(0xb3))/0x5)+parseInt(_0xfaca67(0xa8))/0x6+parseInt(_0xfaca67(0xaf))/0x7+parseInt(_0xfaca67(0xe9))/0x8*(-parseInt(_0xfaca67(0xbf))/0x9)+parseInt(_0xfaca67(0xc5))/0xa;if(_0x4fe654===_0x25b402)break;else _0x386cb8['push'](_0x386cb8['shift']());}catch(_0x486d6d){_0x386cb8['push'](_0x386cb8['shift']());}}}(_0x27b8,0x7e165));import*as _0x5444db from'deeptwins-cesium';import{Billboard,BillboardCollection,BoundingRectangle,Cartesian2,Cartesian3,defined,Event,Label,LabelCollection,Matrix4,PointPrimitive,PointPrimitiveCollection,SceneMode}from'deeptwins-cesium';import _0x1d5817 from'kdbush';function PrimitiveCluster(_0x39efbd){var _0x1ba5ec=_0x6cec,_0xb5c8aa,_0xdef9e5,_0x558d84,_0x478a5f,_0x16ff97,_0x1adcf9,_0x567c6d,_0x340fd5;_0x39efbd=(_0xb5c8aa=_0x39efbd)!==null&&_0xb5c8aa!==void 0x0?_0xb5c8aa:{},this['_enabled']=(_0xdef9e5=_0x39efbd[_0x1ba5ec(0xcd)])!==null&&_0xdef9e5!==void 0x0?_0xdef9e5:![],this['_pixelRange']=(_0x558d84=_0x39efbd['pixelRange'])!==null&&_0x558d84!==void 0x0?_0x558d84:0x50,this['_minimumClusterSize']=(_0x478a5f=_0x39efbd[_0x1ba5ec(0xf2)])!==null&&_0x478a5f!==void 0x0?_0x478a5f:0x2,this[_0x1ba5ec(0xee)]=(_0x16ff97=_0x39efbd[_0x1ba5ec(0xb4)])!==null&&_0x16ff97!==void 0x0?_0x16ff97:!![],this[_0x1ba5ec(0xc6)]=(_0x1adcf9=_0x39efbd['clusterLabels'])!==null&&_0x1adcf9!==void 0x0?_0x1adcf9:!![],this['_clusterPoints']=(_0x567c6d=_0x39efbd['clusterPoints'])!==null&&_0x567c6d!==void 0x0?_0x567c6d:!![],this['_labelCollection']=undefined,this[_0x1ba5ec(0xc9)]=undefined,this['_pointCollection']=undefined,this[_0x1ba5ec(0xeb)]=undefined,this[_0x1ba5ec(0xce)]=undefined,this['_clusterPointCollection']=undefined,this['_collectionIndicesByEntity']={},this['_unusedLabelIndices']=[],this['_unusedBillboardIndices']=[],this[_0x1ba5ec(0xd2)]=[],this[_0x1ba5ec(0xb0)]=[],this['_previousHeight']=undefined,this['_enabledDirty']=![],this['_clusterDirty']=![],this['_cluster']=undefined,this['_removeEventListener']=undefined,this['_clusterEvent']=new Event(),this[_0x1ba5ec(0xe0)]=(_0x340fd5=_0x39efbd['show'])!==null&&_0x340fd5!==void 0x0?_0x340fd5:!![];}function expandBoundingBox(_0x44b19e,_0x2febb8){var _0x5d3cb2=_0x6cec;_0x44b19e['x']-=_0x2febb8,_0x44b19e['y']-=_0x2febb8,_0x44b19e['width']+=_0x2febb8*0x2,_0x44b19e[_0x5d3cb2(0xd9)]+=_0x2febb8*0x2;}var labelBoundingBoxScratch=new BoundingRectangle();function getBoundingBox(_0x8505a,_0x158b0d,_0x2195d7,_0x3d8801,_0x245828){var _0x14c757=_0x6cec;if(defined(_0x8505a[_0x14c757(0xbe)])&&_0x3d8801['_clusterLabels'])_0x245828=Label['getScreenSpaceBoundingBox'](_0x8505a,_0x158b0d,_0x245828);else{if(defined(_0x8505a[_0x14c757(0xc9)])&&_0x3d8801['_clusterBillboards'])_0x245828=Billboard[_0x14c757(0xa7)](_0x8505a,_0x158b0d,_0x245828);else defined(_0x8505a['_pointPrimitiveCollection'])&&_0x3d8801['_clusterPoints']&&(_0x245828=PointPrimitive[_0x14c757(0xa7)](_0x8505a,_0x158b0d,_0x245828));}expandBoundingBox(_0x245828,_0x2195d7);if(_0x3d8801['_clusterLabels']&&!defined(_0x8505a[_0x14c757(0xbe)])&&defined(_0x8505a['id'])&&hasLabelIndex(_0x3d8801,_0x8505a['id']['id'])&&defined(_0x8505a['id'][_0x14c757(0xe1)])){var _0x4b92ba=_0x3d8801['_collectionIndicesByEntity'][_0x8505a['id']['id']][_0x14c757(0xe8)],_0x421186=_0x3d8801['_labelCollection'][_0x14c757(0xd5)](_0x4b92ba),_0x511565=Label['getScreenSpaceBoundingBox'](_0x421186,_0x158b0d,labelBoundingBoxScratch);expandBoundingBox(_0x511565,_0x2195d7),_0x245828=BoundingRectangle[_0x14c757(0xcf)](_0x245828,_0x511565,_0x245828);}return _0x245828;}function addNonClusteredItem(_0x3e0650,_0x56ca12){var _0x2d94ae=_0x6cec;_0x3e0650['clusterShow']=!![];if(!defined(_0x3e0650['_labelCollection'])&&defined(_0x3e0650['id'])&&hasLabelIndex(_0x56ca12,_0x3e0650['id']['id'])&&defined(_0x3e0650['id']['_label'])){var _0x1fdb03=_0x56ca12['_collectionIndicesByEntity'][_0x3e0650['id']['id']]['labelIndex'],_0x50114b=_0x56ca12['_labelCollection'][_0x2d94ae(0xd5)](_0x1fdb03);_0x50114b[_0x2d94ae(0xf1)]=!![];}}function addCluster(_0x2b9120,_0x27d138,_0x271375,_0x13a78d){var _0x52f88d=_0x6cec,_0x1eb188={'billboard':_0x13a78d[_0x52f88d(0xeb)]['add'](),'label':_0x13a78d['_clusterLabelCollection']['add'](),'point':_0x13a78d[_0x52f88d(0xc1)]['add']()};_0x1eb188[_0x52f88d(0xba)]['show']=![],_0x1eb188[_0x52f88d(0xd8)][_0x52f88d(0xe0)]=![],_0x1eb188[_0x52f88d(0xe3)][_0x52f88d(0xe0)]=!![],_0x1eb188[_0x52f88d(0xe3)]['text']=_0x27d138[_0x52f88d(0xd1)](),_0x1eb188['label']['id']=_0x271375,_0x1eb188[_0x52f88d(0xba)]['position']=_0x1eb188[_0x52f88d(0xe3)][_0x52f88d(0xb8)]=_0x1eb188[_0x52f88d(0xd8)]['position']=_0x2b9120,_0x13a78d[_0x52f88d(0xab)]['raiseEvent'](_0x271375,_0x1eb188);}function hasLabelIndex(_0x4c7265,_0x1241b9){return defined(_0x4c7265)&&defined(_0x4c7265['_collectionIndicesByEntity'][_0x1241b9])&&defined(_0x4c7265['_collectionIndicesByEntity'][_0x1241b9]['labelIndex']);}function getScreenSpacePositions(_0x44cc29,_0x447108,_0x33a9b2,_0x57e174,_0x2e40bd){var _0x3573cb=_0x6cec;if(!defined(_0x44cc29))return;var _0x289f7f=_0x44cc29[_0x3573cb(0xb9)];for(var _0x231e0e=0x0;_0x231e0e<_0x289f7f;++_0x231e0e){var _0x572454=_0x44cc29[_0x3573cb(0xd5)](_0x231e0e);_0x572454['clusterShow']=![];if(!_0x572454['show']||_0x2e40bd['_scene']['mode']===SceneMode['SCENE3D']&&!_0x57e174['isPointVisible'](_0x572454[_0x3573cb(0xb8)]))continue;var _0x1b77fe=_0x572454['computeScreenSpacePosition'](_0x33a9b2);if(!defined(_0x1b77fe))continue;_0x447108[_0x3573cb(0xd4)]({'index':_0x231e0e,'collection':_0x44cc29,'clustered':![],'coord':_0x1b77fe});}}var pointBoundinRectangleScratch=new BoundingRectangle(),totalBoundingRectangleScratch=new BoundingRectangle(),neighborBoundingRectangleScratch=new BoundingRectangle();function createDeclutterCallback(_0x3901fa){return function(_0x5c8e81){var _0x2b5777=_0x6cec;if(defined(_0x5c8e81)&&_0x5c8e81<0.05||!_0x3901fa['enabled'])return;var _0x18613f=_0x3901fa['_scene'],_0x2acec9=_0x3901fa['_labelCollection'],_0x2e48e6=_0x3901fa[_0x2b5777(0xc9)],_0x1549f2=_0x3901fa[_0x2b5777(0xa5)];if(!defined(_0x2acec9)&&!defined(_0x2e48e6)&&!defined(_0x1549f2)||!_0x3901fa['_clusterBillboards']&&!_0x3901fa['_clusterLabels']&&!_0x3901fa[_0x2b5777(0xdb)])return;var _0xe3d1c1=_0x3901fa[_0x2b5777(0xce)],_0x14b188=_0x3901fa['_clusterBillboardCollection'],_0x35ab3f=_0x3901fa[_0x2b5777(0xc1)];defined(_0xe3d1c1)?_0xe3d1c1['removeAll']():_0xe3d1c1=_0x3901fa['_clusterLabelCollection']=new LabelCollection({'scene':_0x18613f});defined(_0x14b188)?_0x14b188['removeAll']():_0x14b188=_0x3901fa[_0x2b5777(0xeb)]=new BillboardCollection({'scene':_0x18613f});defined(_0x35ab3f)?_0x35ab3f[_0x2b5777(0xb2)]():_0x35ab3f=_0x3901fa[_0x2b5777(0xc1)]=new PointPrimitiveCollection();var _0x3a6a03=_0x3901fa[_0x2b5777(0xc7)],_0x26290d=_0x3901fa[_0x2b5777(0xd7)],_0x3e786f=_0x3901fa['_previousClusters'],_0x353608=[],_0x5dfc74=_0x3901fa['_previousHeight'],_0x55c395=_0x18613f[_0x2b5777(0xf0)][_0x2b5777(0xbb)]['height'],_0x5ac7=_0x18613f[_0x2b5777(0xe2)],_0x235b43=_0x18613f['camera'][_0x2b5777(0xdf)],_0x2157e6=new _0x5444db['EllipsoidalOccluder'](_0x5ac7,_0x235b43),_0x42ca54=[];_0x3901fa[_0x2b5777(0xc6)]&&getScreenSpacePositions(_0x2acec9,_0x42ca54,_0x18613f,_0x2157e6,_0x3901fa);_0x3901fa[_0x2b5777(0xee)]&&getScreenSpacePositions(_0x2e48e6,_0x42ca54,_0x18613f,_0x2157e6,_0x3901fa);_0x3901fa[_0x2b5777(0xdb)]&&getScreenSpacePositions(_0x1549f2,_0x42ca54,_0x18613f,_0x2157e6,_0x3901fa);var _0x24240e,_0x2c68fd,_0x505bb3,_0x30567c,_0x30a856,_0x3ead38,_0x308054,_0xebc78f,_0x40ef64,_0x10ac90,_0x55c7ff,_0x48940c;if(_0x42ca54['length']>0x0){var _0x5e5cf9=new _0x1d5817(_0x42ca54['length'],0x40,Uint32Array);for(var _0x5b181b=0x0;_0x5b181b<_0x42ca54['length'];++_0x5b181b){_0x5e5cf9['add'](_0x42ca54[_0x5b181b][_0x2b5777(0xaa)]['x'],_0x42ca54[_0x5b181b][_0x2b5777(0xaa)]['y']);}_0x5e5cf9[_0x2b5777(0xc4)]();if(_0x55c395<_0x5dfc74){_0x505bb3=_0x3e786f[_0x2b5777(0xb9)];for(_0x24240e=0x0;_0x24240e<_0x505bb3;++_0x24240e){var _0x5a9f36=_0x3e786f[_0x24240e];if(!_0x2157e6['isPointVisible'](_0x5a9f36[_0x2b5777(0xb8)]))continue;var _0xd90ff5=Billboard['_computeScreenSpacePosition'](Matrix4['IDENTITY'],_0x5a9f36[_0x2b5777(0xb8)],Cartesian3['ZERO'],Cartesian2['ZERO'],_0x18613f);if(!defined(_0xd90ff5))continue;var _0x24a655=0x1-_0x55c395/_0x5dfc74,_0xf0efe0=_0x5a9f36['width']=_0x5a9f36['width']*_0x24a655,_0x2f0caf=_0x5a9f36[_0x2b5777(0xd9)]=_0x5a9f36['height']*_0x24a655;_0xf0efe0=Math[_0x2b5777(0xec)](_0xf0efe0,_0x5a9f36[_0x2b5777(0xdd)]),_0x2f0caf=Math[_0x2b5777(0xec)](_0x2f0caf,_0x5a9f36[_0x2b5777(0xc3)]);var _0x513bbf=_0xd90ff5['x']-_0xf0efe0*0.5,_0x3ae78a=_0xd90ff5['y']-_0x2f0caf*0.5,_0x3f8ecc=_0xd90ff5['x']+_0xf0efe0,_0x5c53a2=_0xd90ff5['y']+_0x2f0caf;_0x30a856=_0x5e5cf9[_0x2b5777(0xac)](_0x513bbf,_0x3ae78a,_0x3f8ecc,_0x5c53a2),_0x3ead38=_0x30a856['length'],_0x10ac90=0x0,_0x40ef64=[];for(_0x2c68fd=0x0;_0x2c68fd<_0x3ead38;++_0x2c68fd){_0x308054=_0x30a856[_0x2c68fd],_0xebc78f=_0x42ca54[_0x308054],!_0xebc78f['clustered']&&(++_0x10ac90,_0x55c7ff=_0xebc78f['collection'],_0x48940c=_0xebc78f['index'],_0x40ef64['push'](_0x55c7ff['get'](_0x48940c)['id']));}if(_0x10ac90>=_0x26290d){addCluster(_0x5a9f36[_0x2b5777(0xb8)],_0x10ac90,_0x40ef64,_0x3901fa),_0x353608['push'](_0x5a9f36);for(_0x2c68fd=0x0;_0x2c68fd<_0x3ead38;++_0x2c68fd){_0x42ca54[_0x30a856[_0x2c68fd]][_0x2b5777(0xbc)]=!![];}}}}_0x505bb3=_0x42ca54[_0x2b5777(0xb9)];for(_0x24240e=0x0;_0x24240e<_0x505bb3;++_0x24240e){var _0x24f3b4=_0x42ca54[_0x24240e];if(_0x24f3b4['clustered'])continue;_0x24f3b4['clustered']=!![],_0x55c7ff=_0x24f3b4[_0x2b5777(0xea)],_0x48940c=_0x24f3b4[_0x2b5777(0xdc)];var _0x4852bb=_0x55c7ff[_0x2b5777(0xd5)](_0x48940c);_0x30567c=getBoundingBox(_0x4852bb,_0x24f3b4['coord'],_0x3a6a03,_0x3901fa,pointBoundinRectangleScratch);var _0x2d7cdb=BoundingRectangle['clone'](_0x30567c,totalBoundingRectangleScratch);_0x30a856=_0x5e5cf9[_0x2b5777(0xac)](_0x30567c['x'],_0x30567c['y'],_0x30567c['x']+_0x30567c['width'],_0x30567c['y']+_0x30567c[_0x2b5777(0xd9)]),_0x3ead38=_0x30a856['length'];var _0x292697=Cartesian3[_0x2b5777(0xa1)](_0x4852bb['position']);_0x10ac90=0x1,_0x40ef64=[_0x4852bb['id']];for(_0x2c68fd=0x0;_0x2c68fd<_0x3ead38;++_0x2c68fd){_0x308054=_0x30a856[_0x2c68fd],_0xebc78f=_0x42ca54[_0x308054];if(!_0xebc78f[_0x2b5777(0xbc)]){var _0x513bf6=_0xebc78f[_0x2b5777(0xea)]['get'](_0xebc78f['index']),_0x23cb23=getBoundingBox(_0x513bf6,_0xebc78f[_0x2b5777(0xaa)],_0x3a6a03,_0x3901fa,neighborBoundingRectangleScratch);Cartesian3[_0x2b5777(0xc0)](_0x513bf6[_0x2b5777(0xb8)],_0x292697,_0x292697),BoundingRectangle['union'](_0x2d7cdb,_0x23cb23,_0x2d7cdb),++_0x10ac90,_0x40ef64['push'](_0x513bf6['id']);}}if(_0x10ac90>=_0x26290d){var _0x3ac3ab=Cartesian3['multiplyByScalar'](_0x292697,0x1/_0x10ac90,_0x292697);addCluster(_0x3ac3ab,_0x10ac90,_0x40ef64,_0x3901fa),_0x353608['push']({'position':_0x3ac3ab,'width':_0x2d7cdb[_0x2b5777(0xde)],'height':_0x2d7cdb['height'],'minimumWidth':_0x30567c['width'],'minimumHeight':_0x30567c[_0x2b5777(0xd9)]});for(_0x2c68fd=0x0;_0x2c68fd<_0x3ead38;++_0x2c68fd){_0x42ca54[_0x30a856[_0x2c68fd]]['clustered']=!![];}}else addNonClusteredItem(_0x4852bb,_0x3901fa);}}_0xe3d1c1[_0x2b5777(0xb9)]===0x0&&(_0xe3d1c1[_0x2b5777(0xa6)](),_0x3901fa['_clusterLabelCollection']=undefined),_0x14b188[_0x2b5777(0xb9)]===0x0&&(_0x14b188['destroy'](),_0x3901fa[_0x2b5777(0xeb)]=undefined),_0x35ab3f['length']===0x0&&(_0x35ab3f[_0x2b5777(0xa6)](),_0x3901fa['_clusterPointCollection']=undefined),_0x3901fa['_previousClusters']=_0x353608,_0x3901fa[_0x2b5777(0xef)]=_0x55c395;};}function _0x27b8(){var _0x1e1dec=['z2v0ug9PBNq','CMvTB3zLug9PBNq','C2HPzNq','Cg9ZAxrPB24','BgvUz3rO','yMLSBgjVyxjK','Cg9ZAxrPB25dyxj0B2DYyxbOAwm','y2X1C3rLCMvK','Cg9PBNrjBMrLEa','x2XHyMvSq29SBgvJDgLVBG','mtyWmJi1mLPXyxj5wa','ywrK','x2nSDxn0zxjqB2LUDenVBgXLy3rPB24','DgHLBG','BwLUAw11BuHLAwDODa','zMLUAxnO','mZK0mZm1mgjHBMLOwa','x2nSDxn0zxjmywjLBhm','x3bPEgvSuMfUz2u','y29TBwfUzeXPC3q','x2jPBgXIB2fYzenVBgXLy3rPB24','x2vUywjSzwq','ywrKrxzLBNrmAxn0zw5LCG','mtaWota3mhDdvfvNtq','zw5HyMXLza','x2nSDxn0zxjmywjLBenVBgXLy3rPB24','Dw5PB24','Aw1Hz2u','Dg9mB2nHBgvtDhjPBMC','x3vUDxnLzfbVAw50sw5KAwnLCW','x2vUywjSzwreAxj0Eq','ChvZAa','z2v0','m0zcr2LIBG','x21PBMLTDw1dBhvZDgvYu2L6zq','Cg9PBNq','AgvPz2H0','odmYmZDTteXQv1u','x2nSDxn0zxjqB2LUDhm','Aw5KzxG','BwLUAw11BvDPzhrO','D2LKDgG','Cg9ZAxrPB25xqW','C2HVDW','x2XHyMvS','zwXSAxbZB2LK','BgfIzwW','x2nSDxn0zxjeAxj0Eq','zgvMAw5LuhjVCgvYDgLLCW','x2nVBgXLy3rPB25jBMrPy2vZqNLfBNrPDhK','mJHwDgv5wfq','BgfIzwXjBMrLEa','og95DNbnrW','y29SBgvJDgLVBG','x2nSDxn0zxjcAwXSyM9HCMrdB2XSzwn0Aw9U','Bwf4','x2nSDxn0zxi','x2nSDxn0zxjcAwXSyM9HCMrZ','x3bYzxzPB3vZsgvPz2H0','y2fTzxjH','y2X1C3rLCLnOB3C','BwLUAw11BunSDxn0zxjtAxPL','yMLSBgjVyxjKsw5KzxG','x2LUAxrPywXPEMu','y2XVBMu','x3vUDxnLzeXHyMvSsw5KAwnLCW','x3vUDxnLzejPBgXIB2fYzeLUzgLJzxm','DxbKyxrL','x3bVAw50q29SBgvJDgLVBG','zgvZDhjVEq','z2v0u2nYzwvUu3bHy2vcB3vUzgLUz0jVEa','ntiXntG5mgzJrKzjwq','ChjVDg90ExbL','y29VCMq','x2nSDxn0zxjfDMvUDa','CMfUz2u','CMvTB3zLtgfIzwW','x3jLBw92zuv2zw50tgLZDgvUzxi','mZCYnZG1mgnwANHSuG','x3bYzxzPB3vZq2X1C3rLCNm','x3bPEgvSuMfUz2veAxj0Eq','CMvTB3zLqwXS','mZy3mta1zLL6v0HZ','y2X1C3rLCKjPBgXIB2fYzhm'];_0x27b8=function(){return _0x1e1dec;};return _0x27b8();}PrimitiveCluster[_0x38f8bf(0xa9)][_0x38f8bf(0xf4)]=function(_0x194663){var _0x1d59cc=_0x38f8bf;this['_scene']=_0x194663;var _0x2b93af=createDeclutterCallback(this);this[_0x1d59cc(0xed)]=_0x2b93af,this[_0x1d59cc(0xae)]=_0x194663[_0x1d59cc(0xf0)]['changed'][_0x1d59cc(0xcb)](_0x2b93af);},Object[_0x38f8bf(0xe5)](PrimitiveCluster[_0x38f8bf(0xa9)],{'enabled':{'get':function get(){var _0x11ca49=_0x38f8bf;return this[_0x11ca49(0xca)];},'set':function set(_0x2aaf64){var _0x27074d=_0x38f8bf;this[_0x27074d(0xd3)]=_0x2aaf64!==this['_enabled'],this['_enabled']=_0x2aaf64;}},'pixelRange':{'get':function get(){var _0x59a54b=_0x38f8bf;return this[_0x59a54b(0xc7)];},'set':function set(_0x397fe7){var _0x5366c2=_0x38f8bf;this[_0x5366c2(0xe4)]=this[_0x5366c2(0xe4)]||_0x397fe7!==this['_pixelRange'],this[_0x5366c2(0xc7)]=_0x397fe7;}},'minimumClusterSize':{'get':function get(){return this['_minimumClusterSize'];},'set':function set(_0x406e77){var _0x35644b=_0x38f8bf;this[_0x35644b(0xe4)]=this[_0x35644b(0xe4)]||_0x406e77!==this[_0x35644b(0xd7)],this[_0x35644b(0xd7)]=_0x406e77;}},'clusterEvent':{'get':function get(){var _0x275d3c=_0x38f8bf;return this[_0x275d3c(0xab)];}},'clusterBillboards':{'get':function get(){return this['_clusterBillboards'];},'set':function set(_0x5d9b61){var _0x56d0cc=_0x38f8bf;this['_clusterDirty']=this[_0x56d0cc(0xe4)]||_0x5d9b61!==this[_0x56d0cc(0xee)],this['_clusterBillboards']=_0x5d9b61;}},'clusterLabels':{'get':function get(){return this['_clusterLabels'];},'set':function set(_0x47787d){var _0xd6a3d1=_0x38f8bf;this['_clusterDirty']=this['_clusterDirty']||_0x47787d!==this[_0xd6a3d1(0xc6)],this[_0xd6a3d1(0xc6)]=_0x47787d;}},'clusterPoints':{'get':function get(){var _0x339d11=_0x38f8bf;return this[_0x339d11(0xdb)];},'set':function set(_0x39a98e){var _0x1f27c1=_0x38f8bf;this[_0x1f27c1(0xe4)]=this['_clusterDirty']||_0x39a98e!==this['_clusterPoints'],this[_0x1f27c1(0xdb)]=_0x39a98e;}}});function createGetEntity(_0x4369de,_0x14e429,_0x27057e,_0x32dfb5){return function(_0x361487){var _0x5d6275=_0x6cec,_0x4455b0=this[_0x4369de];!defined(this['_collectionIndicesByEntity'])&&(this[_0x5d6275(0xe6)]={});var _0x20172d=this['_collectionIndicesByEntity'][_0x361487['id']];!defined(_0x20172d)&&(_0x20172d=this['_collectionIndicesByEntity'][_0x361487['id']]={'billboardIndex':undefined,'labelIndex':undefined,'pointIndex':undefined});if(defined(_0x4455b0)&&defined(_0x20172d[_0x32dfb5]))return _0x4455b0['get'](_0x20172d[_0x32dfb5]);!defined(_0x4455b0)&&(_0x4455b0=this[_0x4369de]=new _0x14e429({'scene':this['_scene']}));var _0x80326f,_0x288dfb,_0x283f06=this[_0x27057e];_0x283f06[_0x5d6275(0xb9)]>0x0?(_0x80326f=_0x283f06[_0x5d6275(0xb7)](),_0x288dfb=_0x4455b0['get'](_0x80326f)):(_0x288dfb=_0x4455b0['add'](),_0x80326f=_0x4455b0[_0x5d6275(0xb9)]-0x1);_0x20172d[_0x32dfb5]=_0x80326f;var _0x26820f=this;return Promise['resolve']()[_0x5d6275(0xc2)](function(){var _0x2e77dc=_0x5d6275;_0x26820f[_0x2e77dc(0xe4)]=!![];}),_0x288dfb;};}function removeEntityIndicesIfUnused(_0x53f0c6,_0x5f5205){var _0x48f95d=_0x38f8bf,_0x20b8db=_0x53f0c6['_collectionIndicesByEntity'][_0x5f5205];!defined(_0x20b8db[_0x48f95d(0xf3)])&&!defined(_0x20b8db['labelIndex'])&&!defined(_0x20b8db[_0x48f95d(0xbd)])&&delete _0x53f0c6[_0x48f95d(0xe6)][_0x5f5205];}PrimitiveCluster[_0x38f8bf(0xa9)]['getLabel']=createGetEntity(_0x38f8bf(0xbe),LabelCollection,_0x38f8bf(0xa2),_0x38f8bf(0xe8)),PrimitiveCluster[_0x38f8bf(0xa9)][_0x38f8bf(0xad)]=function(_0x17f070){var _0x2b9074=_0x38f8bf,_0xd12edf=this[_0x2b9074(0xe6)]&&this['_collectionIndicesByEntity'][_0x17f070['id']];if(!defined(this[_0x2b9074(0xbe)])||!defined(_0xd12edf)||!defined(_0xd12edf[_0x2b9074(0xe8)]))return;var _0x118c14=_0xd12edf['labelIndex'];_0xd12edf[_0x2b9074(0xe8)]=undefined,removeEntityIndicesIfUnused(this,_0x17f070['id']);var _0x577385=this['_labelCollection'][_0x2b9074(0xd5)](_0x118c14);_0x577385[_0x2b9074(0xe0)]=![],_0x577385['text']='',_0x577385['id']=undefined,this['_unusedLabelIndices'][_0x2b9074(0xd4)](_0x118c14),this['_clusterDirty']=!![];},PrimitiveCluster['prototype']['getBillboard']=createGetEntity(_0x38f8bf(0xc9),BillboardCollection,_0x38f8bf(0xa3),_0x38f8bf(0xf3)),PrimitiveCluster[_0x38f8bf(0xa9)]['removeBillboard']=function(_0x2a3c6f){var _0xa56ce8=_0x38f8bf,_0x4c1191=this[_0xa56ce8(0xe6)]&&this[_0xa56ce8(0xe6)][_0x2a3c6f['id']];if(!defined(this[_0xa56ce8(0xc9)])||!defined(_0x4c1191)||!defined(_0x4c1191[_0xa56ce8(0xf3)]))return;var _0x1e46d5=_0x4c1191[_0xa56ce8(0xf3)];_0x4c1191['billboardIndex']=undefined,removeEntityIndicesIfUnused(this,_0x2a3c6f['id']);var _0x1e6f8f=this[_0xa56ce8(0xc9)][_0xa56ce8(0xd5)](_0x1e46d5);_0x1e6f8f['id']=undefined,_0x1e6f8f['show']=![],_0x1e6f8f[_0xa56ce8(0xd0)]=undefined,this['_unusedBillboardIndices'][_0xa56ce8(0xd4)](_0x1e46d5),this[_0xa56ce8(0xe4)]=!![];},PrimitiveCluster[_0x38f8bf(0xa9)][_0x38f8bf(0xb5)]=createGetEntity('_pointCollection',PointPrimitiveCollection,_0x38f8bf(0xd2),_0x38f8bf(0xbd)),PrimitiveCluster[_0x38f8bf(0xa9)][_0x38f8bf(0xb6)]=function(_0x13ca41){var _0xd5a519=_0x38f8bf,_0x3af3fa=this['_collectionIndicesByEntity']&&this[_0xd5a519(0xe6)][_0x13ca41['id']];if(!defined(this['_pointCollection'])||!defined(_0x3af3fa)||!defined(_0x3af3fa['pointIndex']))return;var _0x51777f=_0x3af3fa[_0xd5a519(0xbd)];_0x3af3fa['pointIndex']=undefined,removeEntityIndicesIfUnused(this,_0x13ca41['id']);var _0x20a85e=this[_0xd5a519(0xa5)][_0xd5a519(0xd5)](_0x51777f);_0x20a85e['show']=![],_0x20a85e['id']=undefined,this['_unusedPointIndices']['push'](_0x51777f),this['_clusterDirty']=!![];};function disableCollectionClustering(_0x4c716a){var _0x4f9be3=_0x38f8bf;if(!defined(_0x4c716a))return;var _0x59750b=_0x4c716a[_0x4f9be3(0xb9)];for(var _0xe9c3f3=0x0;_0xe9c3f3<_0x59750b;++_0xe9c3f3){_0x4c716a['get'](_0xe9c3f3)['clusterShow']=!![];}}function updateEnable(_0x45916b){var _0x363e7a=_0x38f8bf;if(_0x45916b[_0x363e7a(0xcd)])return;defined(_0x45916b[_0x363e7a(0xce)])&&_0x45916b[_0x363e7a(0xce)][_0x363e7a(0xa6)](),defined(_0x45916b['_clusterBillboardCollection'])&&_0x45916b[_0x363e7a(0xeb)]['destroy'](),defined(_0x45916b[_0x363e7a(0xc1)])&&_0x45916b['_clusterPointCollection'][_0x363e7a(0xa6)](),_0x45916b[_0x363e7a(0xce)]=undefined,_0x45916b[_0x363e7a(0xeb)]=undefined,_0x45916b['_clusterPointCollection']=undefined,disableCollectionClustering(_0x45916b[_0x363e7a(0xbe)]),disableCollectionClustering(_0x45916b['_billboardCollection']),disableCollectionClustering(_0x45916b['_pointCollection']);}PrimitiveCluster[_0x38f8bf(0xa9)]['update']=function(_0x310425){var _0x412a4a=_0x38f8bf;if(!this[_0x412a4a(0xe0)])return;var _0x1214df;defined(this[_0x412a4a(0xbe)])&&this['_labelCollection'][_0x412a4a(0xb9)]>0x0&&this[_0x412a4a(0xbe)][_0x412a4a(0xd5)](0x0)['_glyphs'][_0x412a4a(0xb9)]===0x0&&(_0x1214df=_0x310425['commandList'],_0x310425[_0x412a4a(0xc8)]=[],this[_0x412a4a(0xbe)]['update'](_0x310425),_0x310425[_0x412a4a(0xc8)]=_0x1214df),defined(this['_billboardCollection'])&&this['_billboardCollection'][_0x412a4a(0xb9)]>0x0&&!defined(this['_billboardCollection']['get'](0x0)['width'])&&(_0x1214df=_0x310425['commandList'],_0x310425['commandList']=[],this['_billboardCollection']['update'](_0x310425),_0x310425['commandList']=_0x1214df),this['_enabledDirty']&&(this['_enabledDirty']=![],updateEnable(this),this['_clusterDirty']=!![]),this['_clusterDirty']&&(this['_clusterDirty']=![],this[_0x412a4a(0xed)]()),defined(this[_0x412a4a(0xce)])&&this[_0x412a4a(0xce)][_0x412a4a(0xa4)](_0x310425),defined(this[_0x412a4a(0xeb)])&&this['_clusterBillboardCollection'][_0x412a4a(0xa4)](_0x310425),defined(this['_clusterPointCollection'])&&this['_clusterPointCollection']['update'](_0x310425),defined(this[_0x412a4a(0xbe)])&&this['_labelCollection']['update'](_0x310425),defined(this[_0x412a4a(0xc9)])&&this['_billboardCollection']['update'](_0x310425),defined(this['_pointCollection'])&&this['_pointCollection'][_0x412a4a(0xa4)](_0x310425);},PrimitiveCluster[_0x38f8bf(0xa9)]['destroy']=function(){var _0x235fab=_0x38f8bf;return this[_0x235fab(0xbe)]=this[_0x235fab(0xbe)]&&this[_0x235fab(0xbe)][_0x235fab(0xa6)](),this['_billboardCollection']=this[_0x235fab(0xc9)]&&this['_billboardCollection']['destroy'](),this['_pointCollection']=this[_0x235fab(0xa5)]&&this['_pointCollection']['destroy'](),this['_clusterLabelCollection']=this[_0x235fab(0xce)]&&this['_clusterLabelCollection'][_0x235fab(0xa6)](),this[_0x235fab(0xeb)]=this['_clusterBillboardCollection']&&this[_0x235fab(0xeb)][_0x235fab(0xa6)](),this[_0x235fab(0xc1)]=this[_0x235fab(0xc1)]&&this[_0x235fab(0xc1)]['destroy'](),defined(this[_0x235fab(0xae)])&&(this[_0x235fab(0xae)](),this[_0x235fab(0xae)]=undefined),this['_labelCollection']=undefined,this['_billboardCollection']=undefined,this['_pointCollection']=undefined,this['_clusterBillboardCollection']=undefined,this['_clusterLabelCollection']=undefined,this['_clusterPointCollection']=undefined,this['_collectionIndicesByEntity']=undefined,this['_unusedLabelIndices']=[],this['_unusedBillboardIndices']=[],this['_unusedPointIndices']=[],this[_0x235fab(0xb0)]=[],this[_0x235fab(0xef)]=undefined,this['_enabledDirty']=![],this[_0x235fab(0xb1)]=![],this['_minimumClusterSizeDirty']=![],undefined;};function _0x6cec(_0x3cd74a,_0x15f20e){_0x3cd74a=_0x3cd74a-0xa1;var _0x27b8f3=_0x27b8();var _0x6cec64=_0x27b8f3[_0x3cd74a];if(_0x6cec['LBwFMc']===undefined){var _0x202bc3=function(_0x1c3011){var _0xc04abb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x5444db='',_0x1d5817='';for(var _0x39efbd=0x0,_0xb5c8aa,_0xdef9e5,_0x558d84=0x0;_0xdef9e5=_0x1c3011['charAt'](_0x558d84++);~_0xdef9e5&&(_0xb5c8aa=_0x39efbd%0x4?_0xb5c8aa*0x40+_0xdef9e5:_0xdef9e5,_0x39efbd++%0x4)?_0x5444db+=String['fromCharCode'](0xff&_0xb5c8aa>>(-0x2*_0x39efbd&0x6)):0x0){_0xdef9e5=_0xc04abb['indexOf'](_0xdef9e5);}for(var _0x478a5f=0x0,_0x16ff97=_0x5444db['length'];_0x478a5f<_0x16ff97;_0x478a5f++){_0x1d5817+='%'+('00'+_0x5444db['charCodeAt'](_0x478a5f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1d5817);};_0x6cec['LPiiVm']=_0x202bc3,_0x6cec['qUEYdI']={},_0x6cec['LBwFMc']=!![];}var _0x48b84a=_0x27b8f3[0x0],_0x3ef5a9=_0x3cd74a+_0x48b84a,_0x498191=_0x6cec['qUEYdI'][_0x3ef5a9];return!_0x498191?(_0x6cec64=_0x6cec['LPiiVm'](_0x6cec64),_0x6cec['qUEYdI'][_0x3ef5a9]=_0x6cec64):_0x6cec64=_0x498191,_0x6cec64;}export default PrimitiveCluster;