deeptwins-engine-3d 0.1.76 → 0.2.0

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 (238) 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.d.ts +1 -1
  86. package/dist/esm/drawer/index.js +1 -688
  87. package/dist/esm/drawer/plotUtil.js +1 -266
  88. package/dist/esm/drawer/shape/Assemble.js +1 -415
  89. package/dist/esm/drawer/shape/AttackArrow.js +1 -442
  90. package/dist/esm/drawer/shape/BaseShape.js +1 -383
  91. package/dist/esm/drawer/shape/Bow.js +1 -375
  92. package/dist/esm/drawer/shape/Circle.js +1 -461
  93. package/dist/esm/drawer/shape/Curve.js +1 -386
  94. package/dist/esm/drawer/shape/DragPoint.js +1 -211
  95. package/dist/esm/drawer/shape/Elliptic.js +1 -491
  96. package/dist/esm/drawer/shape/Formation.js +1 -395
  97. package/dist/esm/drawer/shape/PincerArrow.js +1 -445
  98. package/dist/esm/drawer/shape/Point.js +1 -131
  99. package/dist/esm/drawer/shape/Polygon.js +1 -368
  100. package/dist/esm/drawer/shape/Polyline.js +1 -325
  101. package/dist/esm/drawer/shape/RegularPolygon.js +1 -468
  102. package/dist/esm/drawer/shape/RightAngleArrow.js +1 -423
  103. package/dist/esm/drawer/shape/Sector.js +1 -568
  104. package/dist/esm/drawer/shape/StraightArrow.js +1 -422
  105. package/dist/esm/drawer/shape/SwallowtailArrow.js +1 -438
  106. package/dist/esm/drawer/types.js +1 -11
  107. package/dist/esm/drawer/utils.js +1 -381
  108. package/dist/esm/global.css +22 -1
  109. package/dist/esm/graphicLayer/BaseEntity.js +1 -51
  110. package/dist/esm/graphicLayer/BaseLayer.js +1 -730
  111. package/dist/esm/graphicLayer/BasePointPrimitive.js +1 -45
  112. package/dist/esm/graphicLayer/BasePrimitive.js +1 -36
  113. package/dist/esm/graphicLayer/BasePrimitiveInstance.js +1 -37
  114. package/dist/esm/graphicLayer/BaseSource.d.ts +1 -1
  115. package/dist/esm/graphicLayer/BaseSource.js +1 -630
  116. package/dist/esm/graphicLayer/BillboardEntity.js +1 -106
  117. package/dist/esm/graphicLayer/BillboardPrimitive.js +1 -119
  118. package/dist/esm/graphicLayer/BoxEntity.js +1 -99
  119. package/dist/esm/graphicLayer/BoxPrimitive.js +1 -48
  120. package/dist/esm/graphicLayer/BoxPrimitiveInstance.js +1 -91
  121. package/dist/esm/graphicLayer/EllipseEntity.js +1 -110
  122. package/dist/esm/graphicLayer/EllipsePrimitive.js +1 -47
  123. package/dist/esm/graphicLayer/EllipsePrimitiveInstance.js +1 -98
  124. package/dist/esm/graphicLayer/EllipsoidEntity.js +1 -118
  125. package/dist/esm/graphicLayer/EllipsoidPrimitive.js +1 -48
  126. package/dist/esm/graphicLayer/EllipsoidPrimitiveInstance.js +1 -113
  127. package/dist/esm/graphicLayer/GraphicLayerCollection.js +1 -491
  128. package/dist/esm/graphicLayer/HtmlEntity.d.ts +4 -0
  129. package/dist/esm/graphicLayer/HtmlEntity.js +1 -189
  130. package/dist/esm/graphicLayer/LabelEntity.js +1 -110
  131. package/dist/esm/graphicLayer/LabelPrimitive.js +1 -127
  132. package/dist/esm/graphicLayer/ModelEntity.js +1 -122
  133. package/dist/esm/graphicLayer/ModelPrimitive.js +1 -59
  134. package/dist/esm/graphicLayer/ModelPrimitiveInstance.js +1 -86
  135. package/dist/esm/graphicLayer/PointEntity.js +1 -94
  136. package/dist/esm/graphicLayer/PointPrimitive.js +1 -107
  137. package/dist/esm/graphicLayer/PolygonEntity.js +1 -103
  138. package/dist/esm/graphicLayer/PolygonGroundPrimitive.js +1 -49
  139. package/dist/esm/graphicLayer/PolygonGroundPrimitiveImageMaterialInstance.js +1 -87
  140. package/dist/esm/graphicLayer/PolygonPrimitive.js +1 -60
  141. package/dist/esm/graphicLayer/PolygonPrimitiveImageMaterialInstance.js +1 -84
  142. package/dist/esm/graphicLayer/PolygonPrimitiveInstance.js +1 -101
  143. package/dist/esm/graphicLayer/PolylineEntity.js +1 -96
  144. package/dist/esm/graphicLayer/PolylineGroundPrimitive.js +1 -55
  145. package/dist/esm/graphicLayer/PolylineGroundPrimitiveInstance.js +1 -85
  146. package/dist/esm/graphicLayer/PolylinePrimitive.js +1 -53
  147. package/dist/esm/graphicLayer/PolylinePrimitiveInstance.js +1 -85
  148. package/dist/esm/graphicLayer/PolylineVolumeEntity.js +1 -105
  149. package/dist/esm/graphicLayer/PolylineVolumePrimitive.js +1 -47
  150. package/dist/esm/graphicLayer/PolylineVolumePrimitiveInstance.js +1 -94
  151. package/dist/esm/graphicLayer/WallEntity.js +1 -96
  152. package/dist/esm/graphicLayer/WallPrimitive.js +1 -47
  153. package/dist/esm/graphicLayer/WallPrimitiveInstance.js +1 -88
  154. package/dist/esm/index.d.ts +4 -0
  155. package/dist/esm/index.js +1 -175
  156. package/dist/esm/lowAltitude/BarrierLayer.js +1 -172
  157. package/dist/esm/lowAltitude/BaseGridMvtLayer.js +1 -122
  158. package/dist/esm/lowAltitude/FactorLayer.js +1 -199
  159. package/dist/esm/lowAltitude/FlightPlanning.js +1 -411
  160. package/dist/esm/lowAltitude/FlightRiskEvaluation.js +1 -543
  161. package/dist/esm/lowAltitude/GridDraw.js +1 -137
  162. package/dist/esm/lowAltitude/PoiLayer.js +1 -74
  163. package/dist/esm/lowAltitude/RoutePlanning.js +1 -318
  164. package/dist/esm/lowAltitude/VisitLayer.js +1 -180
  165. package/dist/esm/map/Event.js +1 -377
  166. package/dist/esm/map/GroundSkyBox.js +1 -166
  167. package/dist/esm/map/Map.js +1 -881
  168. package/dist/esm/map/Property.js +1 -35
  169. package/dist/esm/material/AtmosphericDispersion.js +1 -569
  170. package/dist/esm/material/GlobalVolumetricCloud.js +1 -377
  171. package/dist/esm/material/VolumeCloud.js +1 -115
  172. package/dist/esm/material/WeatherEffects.js +1 -351
  173. package/dist/esm/material/entity/BaseMaterialProperty.js +1 -51
  174. package/dist/esm/material/entity/CircleWaveMaterialProperty.js +1 -101
  175. package/dist/esm/material/entity/DynamicWallMaterialProperty.js +1 -101
  176. package/dist/esm/material/entity/ImageGlowingMaterialProperty.js +1 -89
  177. package/dist/esm/material/entity/ImageMaterialProperty.js +1 -34
  178. package/dist/esm/material/entity/PolylineTrailLinkMaterialProperty.js +1 -132
  179. package/dist/esm/material/primitive/BaseMaterialAppearance.js +1 -28
  180. package/dist/esm/material/primitive/ImageGlowingMaterialAppearance.js +1 -77
  181. package/dist/esm/material/primitive/ImageMaterialAppearance.js +1 -77
  182. package/dist/esm/measure/Area.js +1 -220
  183. package/dist/esm/measure/BaseDraw.js +1 -105
  184. package/dist/esm/measure/Distance.js +1 -223
  185. package/dist/esm/measure/index.js +1 -266
  186. package/dist/esm/measure/types.js +1 -17
  187. package/dist/esm/measure/utils.js +1 -319
  188. package/dist/esm/particle/BaseParticle.js +1 -196
  189. package/dist/esm/particle/FireParticle.js +1 -65
  190. package/dist/esm/particle/FountainParticle.js +1 -80
  191. package/dist/esm/particle/SmokeParticle.js +1 -65
  192. package/dist/esm/particle/common.js +1 -23
  193. package/dist/esm/particle/index.js +1 -5
  194. package/dist/esm/property/PositionProperty.js +1 -56
  195. package/dist/esm/tileLayer/ArcGisLayer.js +1 -41
  196. package/dist/esm/tileLayer/CustomRasterClipWorkerClient.js +1 -147
  197. package/dist/esm/tileLayer/CustomRasterLayer.js +1 -1136
  198. package/dist/esm/tileLayer/ImageryLayer.js +1 -44
  199. package/dist/esm/tileLayer/MvtVectorLoad.js +1 -1549
  200. package/dist/esm/tileLayer/MvtVectorWorkerClient.js +1 -126
  201. package/dist/esm/tileLayer/RasterLayer.js +1 -23
  202. package/dist/esm/tileLayer/WmsLayer.js +1 -26
  203. package/dist/esm/tileLayer/WmtsLayer.js +1 -23
  204. package/dist/esm/tool/BuildClampedPolygonGrid.js +1 -278
  205. package/dist/esm/tool/Compass.js +1 -282
  206. package/dist/esm/tool/PrimitiveCluster.js +1 -706
  207. package/dist/esm/tool/TimerInterval.js +1 -58
  208. package/dist/esm/tool/common.js +1 -405
  209. package/dist/esm/tool/fetch.js +1 -222
  210. package/dist/esm/tool/heatmap.js +1 -631
  211. package/dist/esm/tool/utils.d.ts +1 -0
  212. package/dist/esm/tool/utils.js +1 -501
  213. package/dist/esm/toolTip/index.js +1 -79
  214. package/dist/esm/videoFusion/BaseVideo.d.ts +7 -0
  215. package/dist/esm/videoFusion/BaseVideo.js +1 -330
  216. package/dist/esm/videoFusion/VideoProject.js +1 -230
  217. package/dist/esm/videoFusion/VideoTexture.js +1 -163
  218. package/dist/esm/visualization/BaseHeatmap.js +1 -271
  219. package/dist/esm/visualization/BoundaryHighlight.d.ts +136 -0
  220. package/dist/esm/visualization/BoundaryHighlight.js +1 -0
  221. package/dist/esm/visualization/DynamicWater.js +1 -289
  222. package/dist/esm/visualization/Frustum.js +1 -248
  223. package/dist/esm/visualization/Heatmap2d.js +1 -97
  224. package/dist/esm/visualization/Heatmap3d.js +1 -281
  225. package/dist/esm/visualization/MigrationEffect.js +1 -397
  226. package/dist/esm/visualization/PointCluster.js +1 -220
  227. package/dist/esm/visualization/RadarScan.js +1 -333
  228. package/dist/esm/visualization/SampledTerrainRiver.d.ts +180 -0
  229. package/dist/esm/visualization/SampledTerrainRiver.js +1 -0
  230. package/dist/esm/visualization/SampledTerrainWater.d.ts +170 -0
  231. package/dist/esm/visualization/SampledTerrainWater.js +1 -0
  232. package/dist/esm/visualization/WindField.d.ts +72 -0
  233. package/dist/esm/visualization/WindField.js +1 -0
  234. package/dist/esm/visualization/windCore.d.ts +161 -0
  235. package/dist/esm/visualization/windCore.js +8 -0
  236. package/dist/umd/deeptwins-engine-3d.min.css +1 -1
  237. package/dist/umd/deeptwins-engine-3d.min.js +1 -1
  238. 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 _0xd8f0a7=_0x1d4d;(function(_0x5ae4b2,_0x178171){var _0x114ba2=_0x1d4d,_0x3bd9b2=_0x5ae4b2();while(!![]){try{var _0x1fdec5=-parseInt(_0x114ba2(0x185))/0x1*(-parseInt(_0x114ba2(0x1db))/0x2)+parseInt(_0x114ba2(0x1d9))/0x3+parseInt(_0x114ba2(0x195))/0x4*(-parseInt(_0x114ba2(0x19e))/0x5)+-parseInt(_0x114ba2(0x1bb))/0x6*(parseInt(_0x114ba2(0x1c9))/0x7)+-parseInt(_0x114ba2(0x1d6))/0x8+parseInt(_0x114ba2(0x1ca))/0x9+-parseInt(_0x114ba2(0x1d4))/0xa*(-parseInt(_0x114ba2(0x1cb))/0xb);if(_0x1fdec5===_0x178171)break;else _0x3bd9b2['push'](_0x3bd9b2['shift']());}catch(_0x2fea0c){_0x3bd9b2['push'](_0x3bd9b2['shift']());}}}(_0x4deb,0xa882b));import*as _0x154f10 from'deeptwins-cesium';import{Billboard,BillboardCollection,BoundingRectangle,Cartesian2,Cartesian3,defined,Event,Label,LabelCollection,Matrix4,PointPrimitive,PointPrimitiveCollection,SceneMode}from'deeptwins-cesium';function _0x4deb(){var _0x4b25c6=['BgvUz3rO','u0nftKuZra','mJGWrvjqC2v3','x2nSDxn0zxjcAwXSyM9HCMrdB2XSzwn0Aw9U','zw5HyMXLza','x2jPBgXIB2fYzenVBgXLy3rPB24','ChjVDg90ExbL','x2LUAxrPywXPEMu','x2nSDxn0zxjqB2LUDhm','Bwf4','x3bPEgvSuMfUz2u','nti4nxP0tfv0Dq','x2XHyMvS','x2nSDxn0zxjeAxj0Eq','zgvZDhjVEq','x3vUDxnLzejPBgXIB2fYzeLUzgLJzxm','x2nSDxn0zxjqB2LUDenVBgXLy3rPB24','y2X1C3rLCMvK','x3bVAw50q29SBgvJDgLVBG','y29TBwfUzeXPC3q','surftLrjvfK','y2fTzxjH','ChvZAa','Cg9ZAxrPB25dyxj0B2DYyxbOAwm','CMvTB3zLtgfIzwW','yMLSBgjVyxjKsw5KzxG','x3jLBw92zuv2zw50tgLZDgvUzxi','CMvTB3zLqMLSBgjVyxjK','x2nSDxn0zxjmywjLBenVBgXLy3rPB24','C2HVDW','z2v0u2nYzwvUu3bHy2vcB3vUzgLUz0jVEa','Cg9PBNq','y2HHBMDLza','y29TChv0zvnJCMvLBLnWywnLug9ZAxrPB24','z2v0qMLSBgjVyxjK','Dg9mB2nHBgvtDhjPBMC','x3bVAw50uhjPBwL0AxzLq29SBgvJDgLVBG','x2vUywjSzwq','y29VCMq','CgL4zwXsyw5Nzq','mZiYmKLWELjIrW','x3vUDxnLzeXHyMvSsw5KAwnLCW','x2nSDxn0zxjcAwXSyM9HCMrZ','CMvTB3zLqwXS','Dw5PB24','x21PBMLTDw1dBhvZDgvYu2L6zurPCNr5','C2HPzNq','x21PBMLTDw1dBhvZDgvYu2L6zq','AxnqB2LUDfzPC2LIBgu','BgfIzwXjBMrLEa','D2LKDgG','y2X1C3rLCLnOB3C','Aw1Hz2u','ywrKrxzLBNrmAxn0zw5LCG','mtq2ndrHu1DervO','mtaYnda4odrKzfnbu1e','nJq5AwfeBgnb','CMfPC2vfDMvUDa','ywrK','x2XHyMvSq29SBgvJDgLVBG','x3vUDxnLzfbVAw50sw5KAwnLCW','y2XVBMu','CMfUz2u','yMLSBgjVyxjK','zMLUAxnO','nJuYntbOt2ryB2S','x2nVBgXLy3rPB25jBMrPy2vZqNLfBNrPDhK','otCXoduZnKvkyMXMEG','x2nSDxn0zxjmywjLBhm','Cg9PBNrjBMrLEa','mtG5odu0mxn4swDWuG','x3nJzw5L','otK2ntzQB0vAvKO','Cg9ZAxrPB24','DxbKyxrL','mtLZugfMwMi','CMvTB3zLug9PBNq','BwLUAw11BuHLAwDODa','x2nSDxn0zxjfDMvUDa','x2nSDxn0zxi','y29SBgvJDgLVBG','z2v0tgfIzwW','Aw5KzxG','Dgv4Da','x2nVBxb1Dgvty3jLzw5tCgfJzvbVC2L0Aw9U','x3bYzxzPB3vZq2X1C3rLCNm','z2v0','AgvPz2H0','x2vUywjSzwreAxj0Eq'];_0x4deb=function(){return _0x4b25c6;};return _0x4deb();}import _0x111e55 from'kdbush';function PrimitiveCluster(_0x129832){var _0xd8ff1f=_0x1d4d,_0x7891d4,_0x21a767,_0x17c455,_0x2cb8ad,_0x178eb7,_0x5f0626,_0x334a3b,_0x4f08b2;_0x129832=(_0x7891d4=_0x129832)!==null&&_0x7891d4!==void 0x0?_0x7891d4:{},this[_0xd8ff1f(0x1b8)]=(_0x21a767=_0x129832['enabled'])!==null&&_0x21a767!==void 0x0?_0x21a767:![],this[_0xd8ff1f(0x19d)]=(_0x17c455=_0x129832[_0xd8ff1f(0x1ba)])!==null&&_0x17c455!==void 0x0?_0x17c455:0x50,this['_minimumClusterSize']=(_0x2cb8ad=_0x129832['minimumClusterSize'])!==null&&_0x2cb8ad!==void 0x0?_0x2cb8ad:0x2,this['_clusterBillboards']=(_0x178eb7=_0x129832['clusterBillboards'])!==null&&_0x178eb7!==void 0x0?_0x178eb7:!![],this[_0xd8ff1f(0x1d7)]=(_0x5f0626=_0x129832['clusterLabels'])!==null&&_0x5f0626!==void 0x0?_0x5f0626:!![],this['_clusterPoints']=(_0x334a3b=_0x129832['clusterPoints'])!==null&&_0x334a3b!==void 0x0?_0x334a3b:!![],this[_0xd8ff1f(0x1ce)]=undefined,this['_billboardCollection']=undefined,this[_0xd8ff1f(0x1a5)]=undefined,this[_0xd8ff1f(0x196)]=undefined,this[_0xd8ff1f(0x1af)]=undefined,this['_clusterPointCollection']=undefined,this['_collectionIndicesByEntity']={},this[_0xd8ff1f(0x1bc)]=[],this['_unusedBillboardIndices']=[],this[_0xd8ff1f(0x1cf)]=[],this[_0xd8ff1f(0x18f)]=[],this['_previousHeight']=undefined,this['_enabledDirty']=![],this[_0xd8ff1f(0x1a0)]=![],this[_0xd8ff1f(0x189)]=undefined,this['_removeEventListener']=undefined,this[_0xd8ff1f(0x188)]=new Event(),this[_0xd8ff1f(0x1b0)]=(_0x4f08b2=_0x129832[_0xd8ff1f(0x1b0)])!==null&&_0x4f08b2!==void 0x0?_0x4f08b2:!![];}function expandBoundingBox(_0x8cf496,_0x5501b5){_0x8cf496['x']-=_0x5501b5,_0x8cf496['y']-=_0x5501b5,_0x8cf496['width']+=_0x5501b5*0x2,_0x8cf496['height']+=_0x5501b5*0x2;}var labelBoundingBoxScratch=new BoundingRectangle();function getBoundingBox(_0x11764e,_0x5e14e4,_0x1a1ab6,_0x2dfe6c,_0x58f7e6){var _0x300f7c=_0x1d4d;if(defined(_0x11764e[_0x300f7c(0x1ce)])&&_0x2dfe6c[_0x300f7c(0x1d7)])_0x58f7e6=Label[_0x300f7c(0x1b1)](_0x11764e,_0x5e14e4,_0x58f7e6);else{if(defined(_0x11764e['_billboardCollection'])&&_0x2dfe6c[_0x300f7c(0x1bd)])_0x58f7e6=Billboard['getScreenSpaceBoundingBox'](_0x11764e,_0x5e14e4,_0x58f7e6);else defined(_0x11764e[_0x300f7c(0x1b7)])&&_0x2dfe6c['_clusterPoints']&&(_0x58f7e6=PointPrimitive['getScreenSpaceBoundingBox'](_0x11764e,_0x5e14e4,_0x58f7e6));}expandBoundingBox(_0x58f7e6,_0x1a1ab6);if(_0x2dfe6c['_clusterLabels']&&!defined(_0x11764e[_0x300f7c(0x1ce)])&&defined(_0x11764e['id'])&&hasLabelIndex(_0x2dfe6c,_0x11764e['id']['id'])&&defined(_0x11764e['id']['_label'])){var _0x449f83=_0x2dfe6c[_0x300f7c(0x1d5)][_0x11764e['id']['id']][_0x300f7c(0x1c4)],_0xc73208=_0x2dfe6c['_labelCollection']['get'](_0x449f83),_0x48b62d=Label['getScreenSpaceBoundingBox'](_0xc73208,_0x5e14e4,labelBoundingBoxScratch);expandBoundingBox(_0x48b62d,_0x1a1ab6),_0x58f7e6=BoundingRectangle['union'](_0x58f7e6,_0x48b62d,_0x58f7e6);}return _0x58f7e6;}function addNonClusteredItem(_0x15ec91,_0x21d155){var _0x370b1a=_0x1d4d;_0x15ec91['clusterShow']=!![];if(!defined(_0x15ec91['_labelCollection'])&&defined(_0x15ec91['id'])&&hasLabelIndex(_0x21d155,_0x15ec91['id']['id'])&&defined(_0x15ec91['id'][_0x370b1a(0x19f)])){var _0x46ebb9=_0x21d155[_0x370b1a(0x1d5)][_0x15ec91['id']['id']][_0x370b1a(0x1c4)],_0x511a9a=_0x21d155['_labelCollection'][_0x370b1a(0x190)](_0x46ebb9);_0x511a9a[_0x370b1a(0x1c6)]=!![];}}function addCluster(_0x3622a5,_0x4fd636,_0x18ccbb,_0x50b488){var _0x34f4d0=_0x1d4d,_0x4ecdbc={'billboard':_0x50b488['_clusterBillboardCollection'][_0x34f4d0(0x1cd)](),'label':_0x50b488['_clusterLabelCollection']['add'](),'point':_0x50b488[_0x34f4d0(0x1a3)][_0x34f4d0(0x1cd)]()};_0x4ecdbc[_0x34f4d0(0x1d2)]['show']=![],_0x4ecdbc[_0x34f4d0(0x1b2)]['show']=![],_0x4ecdbc['label'][_0x34f4d0(0x1b0)]=!![],_0x4ecdbc['label'][_0x34f4d0(0x18d)]=_0x4fd636[_0x34f4d0(0x1b6)](),_0x4ecdbc['label']['id']=_0x18ccbb,_0x4ecdbc['billboard']['position']=_0x4ecdbc['label'][_0x34f4d0(0x183)]=_0x4ecdbc['point'][_0x34f4d0(0x183)]=_0x3622a5,_0x50b488[_0x34f4d0(0x188)][_0x34f4d0(0x1cc)](_0x18ccbb,_0x4ecdbc);}function hasLabelIndex(_0x54feee,_0x437845){var _0x45c4aa=_0x1d4d;return defined(_0x54feee)&&defined(_0x54feee['_collectionIndicesByEntity'][_0x437845])&&defined(_0x54feee[_0x45c4aa(0x1d5)][_0x437845][_0x45c4aa(0x1c4)]);}function getScreenSpacePositions(_0x483b86,_0x2e4841,_0x300527,_0x40a9c6,_0x2b5fe7){var _0x11b6f7=_0x1d4d;if(!defined(_0x483b86))return;var _0x188a73=_0x483b86['length'];for(var _0x492a9c=0x0;_0x492a9c<_0x188a73;++_0x492a9c){var _0x2b04c1=_0x483b86[_0x11b6f7(0x190)](_0x492a9c);_0x2b04c1[_0x11b6f7(0x1c6)]=![];if(!_0x2b04c1['show']||_0x2b5fe7['_scene']['mode']===SceneMode[_0x11b6f7(0x194)]&&!_0x40a9c6[_0x11b6f7(0x1c3)](_0x2b04c1[_0x11b6f7(0x183)]))continue;var _0x410794=_0x2b04c1[_0x11b6f7(0x1b4)](_0x300527);if(!defined(_0x410794))continue;_0x2e4841['push']({'index':_0x492a9c,'collection':_0x483b86,'clustered':![],'coord':_0x410794});}}function _0x1d4d(_0x30e81c,_0xbe5085){_0x30e81c=_0x30e81c-0x183;var _0x4deb54=_0x4deb();var _0x1d4d54=_0x4deb54[_0x30e81c];if(_0x1d4d['VjohvI']===undefined){var _0x1b3064=function(_0x4a9139){var _0x1b0c27='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x154f10='',_0x111e55='';for(var _0x129832=0x0,_0x7891d4,_0x21a767,_0x17c455=0x0;_0x21a767=_0x4a9139['charAt'](_0x17c455++);~_0x21a767&&(_0x7891d4=_0x129832%0x4?_0x7891d4*0x40+_0x21a767:_0x21a767,_0x129832++%0x4)?_0x154f10+=String['fromCharCode'](0xff&_0x7891d4>>(-0x2*_0x129832&0x6)):0x0){_0x21a767=_0x1b0c27['indexOf'](_0x21a767);}for(var _0x2cb8ad=0x0,_0x178eb7=_0x154f10['length'];_0x2cb8ad<_0x178eb7;_0x2cb8ad++){_0x111e55+='%'+('00'+_0x154f10['charCodeAt'](_0x2cb8ad)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x111e55);};_0x1d4d['GybjfC']=_0x1b3064,_0x1d4d['ymjrfU']={},_0x1d4d['VjohvI']=!![];}var _0x572c27=_0x4deb54[0x0],_0x2cf357=_0x30e81c+_0x572c27,_0x2fe9da=_0x1d4d['ymjrfU'][_0x2cf357];return!_0x2fe9da?(_0x1d4d54=_0x1d4d['GybjfC'](_0x1d4d54),_0x1d4d['ymjrfU'][_0x2cf357]=_0x1d4d54):_0x1d4d54=_0x2fe9da,_0x1d4d54;}var pointBoundinRectangleScratch=new BoundingRectangle(),totalBoundingRectangleScratch=new BoundingRectangle(),neighborBoundingRectangleScratch=new BoundingRectangle();function createDeclutterCallback(_0x399ab1){return function(_0x2f3943){var _0x281159=_0x1d4d;if(defined(_0x2f3943)&&_0x2f3943<0.05||!_0x399ab1[_0x281159(0x197)])return;var _0x4df20e=_0x399ab1['_scene'],_0x472c14=_0x399ab1[_0x281159(0x1ce)],_0x46ef19=_0x399ab1['_billboardCollection'],_0x5ae545=_0x399ab1['_pointCollection'];if(!defined(_0x472c14)&&!defined(_0x46ef19)&&!defined(_0x5ae545)||!_0x399ab1[_0x281159(0x1bd)]&&!_0x399ab1['_clusterLabels']&&!_0x399ab1[_0x281159(0x19b)])return;var _0x3b3e8d=_0x399ab1['_clusterLabelCollection'],_0xdcf732=_0x399ab1['_clusterBillboardCollection'],_0x4648f6=_0x399ab1['_clusterPointCollection'];defined(_0x3b3e8d)?_0x3b3e8d[_0x281159(0x1be)]():_0x3b3e8d=_0x399ab1[_0x281159(0x1af)]=new LabelCollection({'scene':_0x4df20e});defined(_0xdcf732)?_0xdcf732['removeAll']():_0xdcf732=_0x399ab1[_0x281159(0x196)]=new BillboardCollection({'scene':_0x4df20e});defined(_0x4648f6)?_0x4648f6['removeAll']():_0x4648f6=_0x399ab1[_0x281159(0x1a3)]=new PointPrimitiveCollection();var _0x9e6cdc=_0x399ab1[_0x281159(0x19d)],_0x4aa053=_0x399ab1['_minimumClusterSize'],_0x153832=_0x399ab1[_0x281159(0x18f)],_0x4e0136=[],_0x44d7aa=_0x399ab1['_previousHeight'],_0x426834=_0x4df20e['camera'][_0x281159(0x1aa)]['height'],_0xa44993=_0x4df20e['ellipsoid'],_0x5037c9=_0x4df20e['camera']['positionWC'],_0x3c0d5e=new _0x154f10['EllipsoidalOccluder'](_0xa44993,_0x5037c9),_0x36f8da=[];_0x399ab1['_clusterLabels']&&getScreenSpacePositions(_0x472c14,_0x36f8da,_0x4df20e,_0x3c0d5e,_0x399ab1);_0x399ab1[_0x281159(0x1bd)]&&getScreenSpacePositions(_0x46ef19,_0x36f8da,_0x4df20e,_0x3c0d5e,_0x399ab1);_0x399ab1['_clusterPoints']&&getScreenSpacePositions(_0x5ae545,_0x36f8da,_0x4df20e,_0x3c0d5e,_0x399ab1);var _0x29765e,_0x341fe4,_0xedc073,_0x941e95,_0x462a88,_0x115165,_0x58b309,_0x45e385,_0x496666,_0xbef181,_0x30b4fa,_0x2ed6e3;if(_0x36f8da[_0x281159(0x193)]>0x0){var _0x19956f=new _0x111e55(_0x36f8da[_0x281159(0x193)],0x40,Uint32Array);for(var _0x4f67c3=0x0;_0x4f67c3<_0x36f8da['length'];++_0x4f67c3){_0x19956f['add'](_0x36f8da[_0x4f67c3][_0x281159(0x1b9)]['x'],_0x36f8da[_0x4f67c3][_0x281159(0x1b9)]['y']);}_0x19956f[_0x281159(0x1d3)]();if(_0x426834<_0x44d7aa){_0xedc073=_0x153832['length'];for(_0x29765e=0x0;_0x29765e<_0xedc073;++_0x29765e){var _0x406197=_0x153832[_0x29765e];if(!_0x3c0d5e[_0x281159(0x1c3)](_0x406197[_0x281159(0x183)]))continue;var _0x17301d=Billboard[_0x281159(0x18e)](Matrix4[_0x281159(0x1a7)],_0x406197['position'],Cartesian3['ZERO'],Cartesian2['ZERO'],_0x4df20e);if(!defined(_0x17301d))continue;var _0x4615ec=0x1-_0x426834/_0x44d7aa,_0x4b7a86=_0x406197[_0x281159(0x1c5)]=_0x406197['width']*_0x4615ec,_0x2229bf=_0x406197['height']=_0x406197['height']*_0x4615ec;_0x4b7a86=Math[_0x281159(0x19c)](_0x4b7a86,_0x406197['minimumWidth']),_0x2229bf=Math['max'](_0x2229bf,_0x406197[_0x281159(0x187)]);var _0x2ce245=_0x17301d['x']-_0x4b7a86*0.5,_0x6730a1=_0x17301d['y']-_0x2229bf*0.5,_0x4e10dc=_0x17301d['x']+_0x4b7a86,_0x4a981f=_0x17301d['y']+_0x2229bf;_0x462a88=_0x19956f['range'](_0x2ce245,_0x6730a1,_0x4e10dc,_0x4a981f),_0x115165=_0x462a88['length'],_0xbef181=0x0,_0x496666=[];for(_0x341fe4=0x0;_0x341fe4<_0x115165;++_0x341fe4){_0x58b309=_0x462a88[_0x341fe4],_0x45e385=_0x36f8da[_0x58b309],!_0x45e385['clustered']&&(++_0xbef181,_0x30b4fa=_0x45e385[_0x281159(0x18a)],_0x2ed6e3=_0x45e385['index'],_0x496666[_0x281159(0x1a9)](_0x30b4fa['get'](_0x2ed6e3)['id']));}if(_0xbef181>=_0x4aa053){addCluster(_0x406197['position'],_0xbef181,_0x496666,_0x399ab1),_0x4e0136['push'](_0x406197);for(_0x341fe4=0x0;_0x341fe4<_0x115165;++_0x341fe4){_0x36f8da[_0x462a88[_0x341fe4]][_0x281159(0x1a4)]=!![];}}}}_0xedc073=_0x36f8da['length'];for(_0x29765e=0x0;_0x29765e<_0xedc073;++_0x29765e){var _0x5d9363=_0x36f8da[_0x29765e];if(_0x5d9363['clustered'])continue;_0x5d9363[_0x281159(0x1a4)]=!![],_0x30b4fa=_0x5d9363[_0x281159(0x18a)],_0x2ed6e3=_0x5d9363['index'];var _0x185e28=_0x30b4fa[_0x281159(0x190)](_0x2ed6e3);_0x941e95=getBoundingBox(_0x185e28,_0x5d9363[_0x281159(0x1b9)],_0x9e6cdc,_0x399ab1,pointBoundinRectangleScratch);var _0x2dec16=BoundingRectangle[_0x281159(0x1d0)](_0x941e95,totalBoundingRectangleScratch);_0x462a88=_0x19956f[_0x281159(0x1d1)](_0x941e95['x'],_0x941e95['y'],_0x941e95['x']+_0x941e95[_0x281159(0x1c5)],_0x941e95['y']+_0x941e95[_0x281159(0x191)]),_0x115165=_0x462a88[_0x281159(0x193)];var _0x5a2896=Cartesian3[_0x281159(0x1d0)](_0x185e28['position']);_0xbef181=0x1,_0x496666=[_0x185e28['id']];for(_0x341fe4=0x0;_0x341fe4<_0x115165;++_0x341fe4){_0x58b309=_0x462a88[_0x341fe4],_0x45e385=_0x36f8da[_0x58b309];if(!_0x45e385['clustered']){var _0x30a4e6=_0x45e385[_0x281159(0x18a)]['get'](_0x45e385[_0x281159(0x18c)]),_0x2049b2=getBoundingBox(_0x30a4e6,_0x45e385[_0x281159(0x1b9)],_0x9e6cdc,_0x399ab1,neighborBoundingRectangleScratch);Cartesian3[_0x281159(0x1cd)](_0x30a4e6['position'],_0x5a2896,_0x5a2896),BoundingRectangle[_0x281159(0x1bf)](_0x2dec16,_0x2049b2,_0x2dec16),++_0xbef181,_0x496666['push'](_0x30a4e6['id']);}}if(_0xbef181>=_0x4aa053){var _0x288f48=Cartesian3['multiplyByScalar'](_0x5a2896,0x1/_0xbef181,_0x5a2896);addCluster(_0x288f48,_0xbef181,_0x496666,_0x399ab1),_0x4e0136[_0x281159(0x1a9)]({'position':_0x288f48,'width':_0x2dec16['width'],'height':_0x2dec16[_0x281159(0x191)],'minimumWidth':_0x941e95[_0x281159(0x1c5)],'minimumHeight':_0x941e95['height']});for(_0x341fe4=0x0;_0x341fe4<_0x115165;++_0x341fe4){_0x36f8da[_0x462a88[_0x341fe4]]['clustered']=!![];}}else addNonClusteredItem(_0x185e28,_0x399ab1);}}_0x3b3e8d['length']===0x0&&(_0x3b3e8d['destroy'](),_0x399ab1[_0x281159(0x1af)]=undefined),_0xdcf732[_0x281159(0x193)]===0x0&&(_0xdcf732[_0x281159(0x1a1)](),_0x399ab1['_clusterBillboardCollection']=undefined),_0x4648f6['length']===0x0&&(_0x4648f6[_0x281159(0x1a1)](),_0x399ab1[_0x281159(0x1a3)]=undefined),_0x399ab1[_0x281159(0x18f)]=_0x4e0136,_0x399ab1['_previousHeight']=_0x426834;};}PrimitiveCluster[_0xd8f0a7(0x199)][_0xd8f0a7(0x19a)]=function(_0x5a7cfa){var _0x22e901=_0xd8f0a7;this[_0x22e901(0x1da)]=_0x5a7cfa;var _0x34df80=createDeclutterCallback(this);this[_0x22e901(0x189)]=_0x34df80,this[_0x22e901(0x1ad)]=_0x5a7cfa[_0x22e901(0x1a8)][_0x22e901(0x1b3)][_0x22e901(0x1c8)](_0x34df80);},Object['defineProperties'](PrimitiveCluster[_0xd8f0a7(0x199)],{'enabled':{'get':function get(){var _0xdefc53=_0xd8f0a7;return this[_0xdefc53(0x1b8)];},'set':function set(_0x261f10){var _0x6d1b57=_0xd8f0a7;this['_enabledDirty']=_0x261f10!==this[_0x6d1b57(0x1b8)],this[_0x6d1b57(0x1b8)]=_0x261f10;}},'pixelRange':{'get':function get(){var _0x3fa645=_0xd8f0a7;return this[_0x3fa645(0x19d)];},'set':function set(_0xe5cf9a){var _0x30d793=_0xd8f0a7;this[_0x30d793(0x1a0)]=this['_clusterDirty']||_0xe5cf9a!==this['_pixelRange'],this['_pixelRange']=_0xe5cf9a;}},'minimumClusterSize':{'get':function get(){var _0x1f56fd=_0xd8f0a7;return this[_0x1f56fd(0x1c2)];},'set':function set(_0x56e274){this['_clusterDirty']=this['_clusterDirty']||_0x56e274!==this['_minimumClusterSize'],this['_minimumClusterSize']=_0x56e274;}},'clusterEvent':{'get':function get(){return this['_clusterEvent'];}},'clusterBillboards':{'get':function get(){return this['_clusterBillboards'];},'set':function set(_0x45fda9){var _0x4ccd14=_0xd8f0a7;this['_clusterDirty']=this[_0x4ccd14(0x1a0)]||_0x45fda9!==this[_0x4ccd14(0x1bd)],this[_0x4ccd14(0x1bd)]=_0x45fda9;}},'clusterLabels':{'get':function get(){var _0x4b3eff=_0xd8f0a7;return this[_0x4b3eff(0x1d7)];},'set':function set(_0x19cb67){this['_clusterDirty']=this['_clusterDirty']||_0x19cb67!==this['_clusterLabels'],this['_clusterLabels']=_0x19cb67;}},'clusterPoints':{'get':function get(){return this['_clusterPoints'];},'set':function set(_0x3b78c1){var _0x4a3b06=_0xd8f0a7;this[_0x4a3b06(0x1a0)]=this['_clusterDirty']||_0x3b78c1!==this[_0x4a3b06(0x19b)],this[_0x4a3b06(0x19b)]=_0x3b78c1;}}});function createGetEntity(_0xc9e6f7,_0x448d5c,_0x281f60,_0x4f64e9){return function(_0x3319f4){var _0x32fb4c=_0x1d4d,_0x5895bb=this[_0xc9e6f7];!defined(this[_0x32fb4c(0x1d5)])&&(this['_collectionIndicesByEntity']={});var _0xe019d8=this['_collectionIndicesByEntity'][_0x3319f4['id']];!defined(_0xe019d8)&&(_0xe019d8=this[_0x32fb4c(0x1d5)][_0x3319f4['id']]={'billboardIndex':undefined,'labelIndex':undefined,'pointIndex':undefined});if(defined(_0x5895bb)&&defined(_0xe019d8[_0x4f64e9]))return _0x5895bb[_0x32fb4c(0x190)](_0xe019d8[_0x4f64e9]);!defined(_0x5895bb)&&(_0x5895bb=this[_0xc9e6f7]=new _0x448d5c({'scene':this['_scene']}));var _0x36f05c,_0x5ef7b8,_0x357ede=this[_0x281f60];_0x357ede[_0x32fb4c(0x193)]>0x0?(_0x36f05c=_0x357ede[_0x32fb4c(0x1c1)](),_0x5ef7b8=_0x5895bb['get'](_0x36f05c)):(_0x5ef7b8=_0x5895bb[_0x32fb4c(0x1cd)](),_0x36f05c=_0x5895bb[_0x32fb4c(0x193)]-0x1);_0xe019d8[_0x4f64e9]=_0x36f05c;var _0x2daed8=this;return Promise['resolve']()['then'](function(){_0x2daed8['_clusterDirty']=!![];}),_0x5ef7b8;};}function removeEntityIndicesIfUnused(_0x5ab085,_0x5a25ae){var _0x313e22=_0xd8f0a7,_0x32eb9c=_0x5ab085[_0x313e22(0x1d5)][_0x5a25ae];!defined(_0x32eb9c['billboardIndex'])&&!defined(_0x32eb9c[_0x313e22(0x1c4)])&&!defined(_0x32eb9c[_0x313e22(0x1d8)])&&delete _0x5ab085[_0x313e22(0x1d5)][_0x5a25ae];}PrimitiveCluster[_0xd8f0a7(0x199)][_0xd8f0a7(0x18b)]=createGetEntity('_labelCollection',LabelCollection,_0xd8f0a7(0x1bc),'labelIndex'),PrimitiveCluster['prototype'][_0xd8f0a7(0x1ab)]=function(_0x5dfa9f){var _0x335e60=_0xd8f0a7,_0x1c2977=this[_0x335e60(0x1d5)]&&this[_0x335e60(0x1d5)][_0x5dfa9f['id']];if(!defined(this[_0x335e60(0x1ce)])||!defined(_0x1c2977)||!defined(_0x1c2977['labelIndex']))return;var _0x2d992d=_0x1c2977['labelIndex'];_0x1c2977['labelIndex']=undefined,removeEntityIndicesIfUnused(this,_0x5dfa9f['id']);var _0x5a5009=this[_0x335e60(0x1ce)][_0x335e60(0x190)](_0x2d992d);_0x5a5009['show']=![],_0x5a5009['text']='',_0x5a5009['id']=undefined,this['_unusedLabelIndices']['push'](_0x2d992d),this['_clusterDirty']=!![];},PrimitiveCluster['prototype'][_0xd8f0a7(0x1b5)]=createGetEntity('_billboardCollection',BillboardCollection,'_unusedBillboardIndices',_0xd8f0a7(0x1ac)),PrimitiveCluster['prototype'][_0xd8f0a7(0x1ae)]=function(_0x5e5ada){var _0x4eb40a=_0xd8f0a7,_0x4aad22=this[_0x4eb40a(0x1d5)]&&this['_collectionIndicesByEntity'][_0x5e5ada['id']];if(!defined(this['_billboardCollection'])||!defined(_0x4aad22)||!defined(_0x4aad22[_0x4eb40a(0x1ac)]))return;var _0x34f809=_0x4aad22['billboardIndex'];_0x4aad22[_0x4eb40a(0x1ac)]=undefined,removeEntityIndicesIfUnused(this,_0x5e5ada['id']);var _0x4c2e01=this[_0x4eb40a(0x198)]['get'](_0x34f809);_0x4c2e01['id']=undefined,_0x4c2e01['show']=![],_0x4c2e01[_0x4eb40a(0x1c7)]=undefined,this[_0x4eb40a(0x1a2)][_0x4eb40a(0x1a9)](_0x34f809),this['_clusterDirty']=!![];},PrimitiveCluster['prototype']['getPoint']=createGetEntity(_0xd8f0a7(0x1a5),PointPrimitiveCollection,_0xd8f0a7(0x1cf),_0xd8f0a7(0x1d8)),PrimitiveCluster['prototype'][_0xd8f0a7(0x186)]=function(_0x57c561){var _0x5be085=_0xd8f0a7,_0x17d9cb=this['_collectionIndicesByEntity']&&this[_0x5be085(0x1d5)][_0x57c561['id']];if(!defined(this['_pointCollection'])||!defined(_0x17d9cb)||!defined(_0x17d9cb[_0x5be085(0x1d8)]))return;var _0x49bee9=_0x17d9cb[_0x5be085(0x1d8)];_0x17d9cb[_0x5be085(0x1d8)]=undefined,removeEntityIndicesIfUnused(this,_0x57c561['id']);var _0x371671=this[_0x5be085(0x1a5)][_0x5be085(0x190)](_0x49bee9);_0x371671[_0x5be085(0x1b0)]=![],_0x371671['id']=undefined,this[_0x5be085(0x1cf)]['push'](_0x49bee9),this['_clusterDirty']=!![];};function disableCollectionClustering(_0x1ade89){var _0x1c8a78=_0xd8f0a7;if(!defined(_0x1ade89))return;var _0x1ff6cb=_0x1ade89[_0x1c8a78(0x193)];for(var _0x14072b=0x0;_0x14072b<_0x1ff6cb;++_0x14072b){_0x1ade89['get'](_0x14072b)['clusterShow']=!![];}}function updateEnable(_0x3cc2d5){var _0xc7809d=_0xd8f0a7;if(_0x3cc2d5['enabled'])return;defined(_0x3cc2d5[_0xc7809d(0x1af)])&&_0x3cc2d5['_clusterLabelCollection'][_0xc7809d(0x1a1)](),defined(_0x3cc2d5['_clusterBillboardCollection'])&&_0x3cc2d5['_clusterBillboardCollection'][_0xc7809d(0x1a1)](),defined(_0x3cc2d5[_0xc7809d(0x1a3)])&&_0x3cc2d5[_0xc7809d(0x1a3)]['destroy'](),_0x3cc2d5['_clusterLabelCollection']=undefined,_0x3cc2d5['_clusterBillboardCollection']=undefined,_0x3cc2d5[_0xc7809d(0x1a3)]=undefined,disableCollectionClustering(_0x3cc2d5[_0xc7809d(0x1ce)]),disableCollectionClustering(_0x3cc2d5[_0xc7809d(0x198)]),disableCollectionClustering(_0x3cc2d5[_0xc7809d(0x1a5)]);}PrimitiveCluster[_0xd8f0a7(0x199)][_0xd8f0a7(0x184)]=function(_0x5d77e1){var _0x119002=_0xd8f0a7;if(!this[_0x119002(0x1b0)])return;var _0x714265;defined(this['_labelCollection'])&&this['_labelCollection']['length']>0x0&&this[_0x119002(0x1ce)][_0x119002(0x190)](0x0)['_glyphs']['length']===0x0&&(_0x714265=_0x5d77e1['commandList'],_0x5d77e1['commandList']=[],this[_0x119002(0x1ce)]['update'](_0x5d77e1),_0x5d77e1[_0x119002(0x1a6)]=_0x714265),defined(this['_billboardCollection'])&&this['_billboardCollection']['length']>0x0&&!defined(this[_0x119002(0x198)][_0x119002(0x190)](0x0)[_0x119002(0x1c5)])&&(_0x714265=_0x5d77e1[_0x119002(0x1a6)],_0x5d77e1[_0x119002(0x1a6)]=[],this['_billboardCollection']['update'](_0x5d77e1),_0x5d77e1[_0x119002(0x1a6)]=_0x714265),this[_0x119002(0x192)]&&(this[_0x119002(0x192)]=![],updateEnable(this),this[_0x119002(0x1a0)]=!![]),this[_0x119002(0x1a0)]&&(this['_clusterDirty']=![],this[_0x119002(0x189)]()),defined(this['_clusterLabelCollection'])&&this['_clusterLabelCollection']['update'](_0x5d77e1),defined(this['_clusterBillboardCollection'])&&this[_0x119002(0x196)]['update'](_0x5d77e1),defined(this[_0x119002(0x1a3)])&&this[_0x119002(0x1a3)][_0x119002(0x184)](_0x5d77e1),defined(this[_0x119002(0x1ce)])&&this['_labelCollection']['update'](_0x5d77e1),defined(this[_0x119002(0x198)])&&this['_billboardCollection'][_0x119002(0x184)](_0x5d77e1),defined(this['_pointCollection'])&&this[_0x119002(0x1a5)]['update'](_0x5d77e1);},PrimitiveCluster['prototype'][_0xd8f0a7(0x1a1)]=function(){var _0x4035eb=_0xd8f0a7;return this['_labelCollection']=this['_labelCollection']&&this[_0x4035eb(0x1ce)]['destroy'](),this[_0x4035eb(0x198)]=this['_billboardCollection']&&this['_billboardCollection'][_0x4035eb(0x1a1)](),this[_0x4035eb(0x1a5)]=this['_pointCollection']&&this[_0x4035eb(0x1a5)][_0x4035eb(0x1a1)](),this['_clusterLabelCollection']=this[_0x4035eb(0x1af)]&&this['_clusterLabelCollection']['destroy'](),this['_clusterBillboardCollection']=this['_clusterBillboardCollection']&&this['_clusterBillboardCollection'][_0x4035eb(0x1a1)](),this[_0x4035eb(0x1a3)]=this[_0x4035eb(0x1a3)]&&this['_clusterPointCollection']['destroy'](),defined(this[_0x4035eb(0x1ad)])&&(this['_removeEventListener'](),this[_0x4035eb(0x1ad)]=undefined),this[_0x4035eb(0x1ce)]=undefined,this['_billboardCollection']=undefined,this[_0x4035eb(0x1a5)]=undefined,this['_clusterBillboardCollection']=undefined,this[_0x4035eb(0x1af)]=undefined,this[_0x4035eb(0x1a3)]=undefined,this['_collectionIndicesByEntity']=undefined,this[_0x4035eb(0x1bc)]=[],this['_unusedBillboardIndices']=[],this['_unusedPointIndices']=[],this[_0x4035eb(0x18f)]=[],this['_previousHeight']=undefined,this[_0x4035eb(0x192)]=![],this['_pixelRangeDirty']=![],this[_0x4035eb(0x1c0)]=![],undefined;};export default PrimitiveCluster;