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,326 +1 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
7
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
10
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
13
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
- import * as Cesium from 'deeptwins-cesium';
15
- import { merge } from 'lodash';
16
- import { DEFAULT_LINE_OF_SIGHT_ANALYSIS_OPTIONS } from "../constant";
17
- import * as utils from "../tool/utils";
18
- // 通视分析。
19
- var LineOfSightAnalysis = /*#__PURE__*/function () {
20
- function LineOfSightAnalysis(map) {
21
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22
- _classCallCheck(this, LineOfSightAnalysis);
23
- _defineProperty(this, "_mapContext", void 0);
24
- _defineProperty(this, "options", void 0);
25
- _defineProperty(this, "isDestroyed", false);
26
- _defineProperty(this, "_lineLayer", null);
27
- _defineProperty(this, "_pointLayer", null);
28
- _defineProperty(this, "_result", null);
29
- this._mapContext = map._mapContext;
30
- this.options = merge(DEFAULT_LINE_OF_SIGHT_ANALYSIS_OPTIONS(), options);
31
- this._replaceArrayOptions(options);
32
- if (this.options.position && this.options.positionEnd) {
33
- this.create();
34
- }
35
- }
36
-
37
- // 是否能进行操作
38
- _createClass(LineOfSightAnalysis, [{
39
- key: "_canOperate",
40
- value: function _canOperate() {
41
- if (this.isDestroyed) {
42
- utils.error('LineOfSightAnalysis实例已销毁');
43
- return false;
44
- }
45
- return true;
46
- }
47
- }, {
48
- key: "_replaceArrayOptions",
49
- value: function _replaceArrayOptions() {
50
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
51
- if (Object.prototype.hasOwnProperty.call(options, 'position')) {
52
- this.options.position = options.position;
53
- }
54
- if (Object.prototype.hasOwnProperty.call(options, 'positionEnd')) {
55
- this.options.positionEnd = options.positionEnd;
56
- }
57
- if (Object.prototype.hasOwnProperty.call(options, 'objectsToExclude')) {
58
- this.options.objectsToExclude = options.objectsToExclude;
59
- }
60
- }
61
- }, {
62
- key: "_normalizePosition",
63
- value: function _normalizePosition(position) {
64
- if (!Array.isArray(position) || position.length < 2) {
65
- return null;
66
- }
67
- var _position = _slicedToArray(position, 3),
68
- lng = _position[0],
69
- lat = _position[1],
70
- _position$ = _position[2],
71
- alt = _position$ === void 0 ? 0 : _position$;
72
- if (!Number.isFinite(lng) || !Number.isFinite(lat) || !Number.isFinite(alt)) {
73
- return null;
74
- }
75
- return [lng, lat, alt];
76
- }
77
- }, {
78
- key: "_toCartesian",
79
- value: function _toCartesian(position) {
80
- var _position2 = _slicedToArray(position, 3),
81
- lng = _position2[0],
82
- lat = _position2[1],
83
- alt = _position2[2];
84
- return utils.lngLatAltToCartesian3(lng, lat, alt);
85
- }
86
- }, {
87
- key: "_getPositionPair",
88
- value: function _getPositionPair() {
89
- var position = this._normalizePosition(this.options.position);
90
- var positionEnd = this._normalizePosition(this.options.positionEnd);
91
- if (!position || !positionEnd) {
92
- return null;
93
- }
94
- return {
95
- position: position,
96
- positionEnd: positionEnd
97
- };
98
- }
99
- }, {
100
- key: "getMap",
101
- value: function getMap() {
102
- return this._mapContext && this._mapContext.getMap();
103
- }
104
- }, {
105
- key: "create",
106
- value: function create() {
107
- if (!this._canOperate()) return null;
108
- this._clearLayers();
109
- var result = this._analyze();
110
- this._result = result;
111
- if (result) {
112
- this._draw(result);
113
- this.options.onComplete && this.options.onComplete(result);
114
- }
115
- return result;
116
- }
117
- }, {
118
- key: "update",
119
- value: function update() {
120
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
121
- if (!this._canOperate()) return null;
122
- this.options = merge({}, this.options, options);
123
- this._replaceArrayOptions(options);
124
- return this.create();
125
- }
126
- }, {
127
- key: "setPositions",
128
- value: function setPositions(position, positionEnd) {
129
- if (!this._canOperate()) return null;
130
- this.options.position = position;
131
- this.options.positionEnd = positionEnd;
132
- return this.create();
133
- }
134
- }, {
135
- key: "getResult",
136
- value: function getResult() {
137
- return this._result;
138
- }
139
- }, {
140
- key: "_analyze",
141
- value: function _analyze() {
142
- var _this$getMap;
143
- var positionPair = this._getPositionPair();
144
- if (!positionPair) {
145
- return null;
146
- }
147
- var position = positionPair.position,
148
- positionEnd = positionPair.positionEnd;
149
- var start = this._toCartesian(position);
150
- var end = this._toCartesian(positionEnd);
151
- var direction = Cesium.Cartesian3.subtract(end, start, new Cesium.Cartesian3());
152
- var distance = Cesium.Cartesian3.magnitude(direction);
153
- if (distance <= 0) {
154
- return {
155
- visible: true,
156
- distance: 0,
157
- position: position,
158
- positionEnd: positionEnd
159
- };
160
- }
161
- Cesium.Cartesian3.normalize(direction, direction);
162
- var scene = (_this$getMap = this.getMap()) === null || _this$getMap === void 0 ? void 0 : _this$getMap.scene;
163
- if (!scene || typeof scene.pickFromRay !== 'function') {
164
- utils.error('当前场景不支持pickFromRay,无法进行通视分析');
165
- return null;
166
- }
167
- var ray = new Cesium.Ray(start, direction);
168
- var pickResult = scene.pickFromRay(ray, this.options.objectsToExclude, this.options.pickWidth);
169
- var obstructionCartesian = pickResult === null || pickResult === void 0 ? void 0 : pickResult.position;
170
- if (!obstructionCartesian) {
171
- return {
172
- visible: true,
173
- distance: distance,
174
- position: position,
175
- positionEnd: positionEnd
176
- };
177
- }
178
- var obstructionDistance = Cesium.Cartesian3.distance(start, obstructionCartesian);
179
- var tolerance = Math.max(Number(this.options.tolerance) || 0, 0);
180
- var visible = obstructionDistance >= distance - tolerance;
181
- var obstructionPosition = utils.cartesian3ToLngLatAlt(obstructionCartesian);
182
- return {
183
- visible: visible,
184
- distance: distance,
185
- position: position,
186
- positionEnd: positionEnd,
187
- obstructionDistance: obstructionDistance,
188
- obstructionPosition: obstructionPosition,
189
- pickedObject: pickResult.object
190
- };
191
- }
192
- }, {
193
- key: "_buildLineGeoJson",
194
- value: function _buildLineGeoJson(result) {
195
- var features = [];
196
- var position = result.position,
197
- positionEnd = result.positionEnd,
198
- obstructionPosition = result.obstructionPosition;
199
- var obstruction = obstructionPosition ? [obstructionPosition.lng, obstructionPosition.lat, obstructionPosition.alt] : null;
200
- if (result.visible || !obstruction) {
201
- features.push(this._lineFeature(position, positionEnd, true));
202
- } else {
203
- features.push(this._lineFeature(position, obstruction, true));
204
- features.push(this._lineFeature(obstruction, positionEnd, false));
205
- }
206
- return {
207
- type: 'FeatureCollection',
208
- features: features
209
- };
210
- }
211
- }, {
212
- key: "_buildPointGeoJson",
213
- value: function _buildPointGeoJson(result) {
214
- var features = [this._pointFeature(result.position, 'start'), this._pointFeature(result.positionEnd, 'end')];
215
- if (this.options.showObstructionPoint && !result.visible && result.obstructionPosition) {
216
- features.push(this._pointFeature([result.obstructionPosition.lng, result.obstructionPosition.lat, result.obstructionPosition.alt], 'obstruction'));
217
- }
218
- return {
219
- type: 'FeatureCollection',
220
- features: features
221
- };
222
- }
223
- }, {
224
- key: "_lineFeature",
225
- value: function _lineFeature(start, end, visible) {
226
- return {
227
- type: 'Feature',
228
- properties: {
229
- visible: visible
230
- },
231
- geometry: {
232
- type: 'LineString',
233
- coordinates: [start, end]
234
- }
235
- };
236
- }
237
- }, {
238
- key: "_pointFeature",
239
- value: function _pointFeature(position, type) {
240
- return {
241
- type: 'Feature',
242
- properties: {
243
- type: type
244
- },
245
- geometry: {
246
- type: 'Point',
247
- coordinates: position
248
- }
249
- };
250
- }
251
- }, {
252
- key: "_draw",
253
- value: function _draw(result) {
254
- var _this = this;
255
- if (this.options.showLine) {
256
- this._lineLayer = this.getMap().addGraphicLayer(this._buildLineGeoJson(result), {
257
- type: 'polyline',
258
- style: {
259
- width: this.options.lineWidth,
260
- material: function material(properties) {
261
- return properties.visible ? _this.options.visibleColor : _this.options.invisibleColor;
262
- },
263
- depthFailMaterial: function depthFailMaterial(properties) {
264
- return properties.visible ? _this.options.visibleColor : _this.options.invisibleColor;
265
- },
266
- clampToGround: false
267
- }
268
- });
269
- }
270
- if (this.options.showPoint) {
271
- this._pointLayer = this.getMap().addGraphicLayer(this._buildPointGeoJson(result), {
272
- type: 'point',
273
- style: {
274
- pixelSize: this.options.pointPixelSize,
275
- color: function color(properties) {
276
- return properties.type === 'obstruction' ? _this.options.obstructionPointColor : _this.options.pointColor;
277
- },
278
- outlineColor: '#ffffff',
279
- outlineWidth: 2
280
- }
281
- });
282
- }
283
- }
284
- }, {
285
- key: "_clearLayers",
286
- value: function _clearLayers() {
287
- if (this._lineLayer) {
288
- this._lineLayer.remove();
289
- this._lineLayer = null;
290
- }
291
- if (this._pointLayer) {
292
- this._pointLayer.remove();
293
- this._pointLayer = null;
294
- }
295
- }
296
- }, {
297
- key: "flyTo",
298
- value: function flyTo() {
299
- if (!this._canOperate()) return;
300
- if (this._lineLayer) {
301
- this._lineLayer.flyTo();
302
- return;
303
- }
304
- if (this._pointLayer) {
305
- this._pointLayer.flyTo();
306
- }
307
- }
308
- }, {
309
- key: "clear",
310
- value: function clear() {
311
- if (!this._canOperate()) return;
312
- this._clearLayers();
313
- this._result = null;
314
- }
315
- }, {
316
- key: "destroy",
317
- value: function destroy() {
318
- if (!this._canOperate()) return;
319
- this._clearLayers();
320
- this._result = null;
321
- this.isDestroyed = true;
322
- }
323
- }]);
324
- return LineOfSightAnalysis;
325
- }();
326
- export default LineOfSightAnalysis;
1
+ (function(_0x13617b,_0x1eb39e){var _0x4f54a0=_0x5da1,_0xed086d=_0x13617b();while(!![]){try{var _0x159812=-parseInt(_0x4f54a0(0x182))/0x1+-parseInt(_0x4f54a0(0x16d))/0x2*(parseInt(_0x4f54a0(0x172))/0x3)+parseInt(_0x4f54a0(0x18e))/0x4+-parseInt(_0x4f54a0(0x15a))/0x5*(-parseInt(_0x4f54a0(0x176))/0x6)+parseInt(_0x4f54a0(0x1a2))/0x7+-parseInt(_0x4f54a0(0x184))/0x8+parseInt(_0x4f54a0(0x195))/0x9*(parseInt(_0x4f54a0(0x1a0))/0xa);if(_0x159812===_0x1eb39e)break;else _0xed086d['push'](_0xed086d['shift']());}catch(_0x2d8457){_0xed086d['push'](_0xed086d['shift']());}}}(_0x2dbd,0x54f31));function _typeof(_0x2265bd){'@babel/helpers - typeof';var _0x338594=_0x5da1;return _typeof='function'==typeof Symbol&&_0x338594(0x187)==typeof Symbol[_0x338594(0x18d)]?function(_0x28feab){return typeof _0x28feab;}:function(_0x5499c2){var _0x10942f=_0x338594;return _0x5499c2&&'function'==typeof Symbol&&_0x5499c2[_0x10942f(0x199)]===Symbol&&_0x5499c2!==Symbol[_0x10942f(0x160)]?'symbol':typeof _0x5499c2;},_typeof(_0x2265bd);}function _slicedToArray(_0x251e67,_0x3416b8){return _arrayWithHoles(_0x251e67)||_iterableToArrayLimit(_0x251e67,_0x3416b8)||_unsupportedIterableToArray(_0x251e67,_0x3416b8)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError('Invalid\x20attempt\x20to\x20destructure\x20non-iterable\x20instance.\x0aIn\x20order\x20to\x20be\x20iterable,\x20non-array\x20objects\x20must\x20have\x20a\x20[Symbol.iterator]()\x20method.');}function _unsupportedIterableToArray(_0x16ab97,_0x5cfad7){var _0x22fe4c=_0x5da1;if(!_0x16ab97)return;if(typeof _0x16ab97==='string')return _arrayLikeToArray(_0x16ab97,_0x5cfad7);var _0x45c100=Object['prototype'][_0x22fe4c(0x180)][_0x22fe4c(0x163)](_0x16ab97)['slice'](0x8,-0x1);if(_0x45c100==='Object'&&_0x16ab97['constructor'])_0x45c100=_0x16ab97[_0x22fe4c(0x199)]['name'];if(_0x45c100===_0x22fe4c(0x1a4)||_0x45c100==='Set')return Array[_0x22fe4c(0x185)](_0x16ab97);if(_0x45c100==='Arguments'||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/['test'](_0x45c100))return _arrayLikeToArray(_0x16ab97,_0x5cfad7);}function _arrayLikeToArray(_0x2b58fc,_0x31a2e2){if(_0x31a2e2==null||_0x31a2e2>_0x2b58fc['length'])_0x31a2e2=_0x2b58fc['length'];for(var _0x5ee44d=0x0,_0x8f95=new Array(_0x31a2e2);_0x5ee44d<_0x31a2e2;_0x5ee44d++)_0x8f95[_0x5ee44d]=_0x2b58fc[_0x5ee44d];return _0x8f95;}function _iterableToArrayLimit(_0x5ec6db,_0x1ae0b8){var _0x9f7867=_0x5da1,_0x5e9af1=null==_0x5ec6db?null:_0x9f7867(0x17a)!=typeof Symbol&&_0x5ec6db[Symbol[_0x9f7867(0x18d)]]||_0x5ec6db[_0x9f7867(0x157)];if(null!=_0x5e9af1){var _0x483880,_0x5e3599,_0x295f49,_0x3f3dc1,_0x49abc5=[],_0x46cf8d=!0x0,_0x41a48d=!0x1;try{if(_0x295f49=(_0x5e9af1=_0x5e9af1[_0x9f7867(0x163)](_0x5ec6db))['next'],0x0===_0x1ae0b8){if(Object(_0x5e9af1)!==_0x5e9af1)return;_0x46cf8d=!0x1;}else{for(;!(_0x46cf8d=(_0x483880=_0x295f49['call'](_0x5e9af1))['done'])&&(_0x49abc5['push'](_0x483880['value']),_0x49abc5[_0x9f7867(0x169)]!==_0x1ae0b8);_0x46cf8d=!0x0);}}catch(_0xcbaa18){_0x41a48d=!0x0,_0x5e3599=_0xcbaa18;}finally{try{if(!_0x46cf8d&&null!=_0x5e9af1['return']&&(_0x3f3dc1=_0x5e9af1['return'](),Object(_0x3f3dc1)!==_0x3f3dc1))return;}finally{if(_0x41a48d)throw _0x5e3599;}}return _0x49abc5;}}function _arrayWithHoles(_0x3cfbad){if(Array['isArray'](_0x3cfbad))return _0x3cfbad;}function _0x5da1(_0x31dd6b,_0x59e46d){_0x31dd6b=_0x31dd6b-0x154;var _0x2dbdf9=_0x2dbd();var _0x5da1eb=_0x2dbdf9[_0x31dd6b];if(_0x5da1['NhyITP']===undefined){var _0x133457=function(_0x7916df){var _0x2eb35e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x39c703='',_0x169fb3='';for(var _0x2265bd=0x0,_0x28feab,_0x5499c2,_0x251e67=0x0;_0x5499c2=_0x7916df['charAt'](_0x251e67++);~_0x5499c2&&(_0x28feab=_0x2265bd%0x4?_0x28feab*0x40+_0x5499c2:_0x5499c2,_0x2265bd++%0x4)?_0x39c703+=String['fromCharCode'](0xff&_0x28feab>>(-0x2*_0x2265bd&0x6)):0x0){_0x5499c2=_0x2eb35e['indexOf'](_0x5499c2);}for(var _0x3416b8=0x0,_0x16ab97=_0x39c703['length'];_0x3416b8<_0x16ab97;_0x3416b8++){_0x169fb3+='%'+('00'+_0x39c703['charCodeAt'](_0x3416b8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x169fb3);};_0x5da1['xTGQLr']=_0x133457,_0x5da1['rqeLoi']={},_0x5da1['NhyITP']=!![];}var _0x20cc07=_0x2dbdf9[0x0],_0x2a2b76=_0x31dd6b+_0x20cc07,_0xc8ee09=_0x5da1['rqeLoi'][_0x2a2b76];return!_0xc8ee09?(_0x5da1eb=_0x5da1['xTGQLr'](_0x5da1eb),_0x5da1['rqeLoi'][_0x2a2b76]=_0x5da1eb):_0x5da1eb=_0xc8ee09,_0x5da1eb;}function _classCallCheck(_0x259615,_0x269070){if(!(_0x259615 instanceof _0x269070))throw new TypeError('Cannot\x20call\x20a\x20class\x20as\x20a\x20function');}function _defineProperties(_0x29a962,_0x4c20ad){var _0x648e78=_0x5da1;for(var _0x2e9409=0x0;_0x2e9409<_0x4c20ad[_0x648e78(0x169)];_0x2e9409++){var _0x29b0f8=_0x4c20ad[_0x2e9409];_0x29b0f8['enumerable']=_0x29b0f8[_0x648e78(0x1a1)]||![],_0x29b0f8['configurable']=!![];if(_0x648e78(0x16e)in _0x29b0f8)_0x29b0f8[_0x648e78(0x17b)]=!![];Object[_0x648e78(0x190)](_0x29a962,_toPropertyKey(_0x29b0f8['key']),_0x29b0f8);}}function _createClass(_0x18e01c,_0x2d9439,_0x2b9729){var _0x390122=_0x5da1;if(_0x2d9439)_defineProperties(_0x18e01c['prototype'],_0x2d9439);if(_0x2b9729)_defineProperties(_0x18e01c,_0x2b9729);return Object[_0x390122(0x190)](_0x18e01c,_0x390122(0x160),{'writable':![]}),_0x18e01c;}function _defineProperty(_0x4add2f,_0x3c2c06,_0x5dad5e){var _0x1a58a1=_0x5da1;return _0x3c2c06=_toPropertyKey(_0x3c2c06),_0x3c2c06 in _0x4add2f?Object[_0x1a58a1(0x190)](_0x4add2f,_0x3c2c06,{'value':_0x5dad5e,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x4add2f[_0x3c2c06]=_0x5dad5e,_0x4add2f;}function _toPropertyKey(_0x1c9f4c){var _0x42f8c2=_toPrimitive(_0x1c9f4c,'string');return'symbol'==_typeof(_0x42f8c2)?_0x42f8c2:String(_0x42f8c2);}function _toPrimitive(_0x146af0,_0x4247ef){var _0xcfbec1=_0x5da1;if('object'!=_typeof(_0x146af0)||!_0x146af0)return _0x146af0;var _0x33f80d=_0x146af0[Symbol[_0xcfbec1(0x162)]];if(void 0x0!==_0x33f80d){var _0x27a95e=_0x33f80d['call'](_0x146af0,_0x4247ef||'default');if(_0xcfbec1(0x166)!=_typeof(_0x27a95e))return _0x27a95e;throw new TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0xcfbec1(0x170)===_0x4247ef?String:Number)(_0x146af0);}import*as _0x39c703 from'deeptwins-cesium';import{merge}from'lodash';import{DEFAULT_LINE_OF_SIGHT_ANALYSIS_OPTIONS}from'../constant';function _0x2dbd(){var _0x6367b1=['Bwf4','C3LTyM9S','y3jLyxrL','AxngAw5PDgu','CMvTB3zL','C2HVD09IC3rYDwn0Aw9Uug9PBNq','AxnbCNjHEq','AxrLCMf0B3i','otqZntG4sgHLChLu','y2fYDgvZAwfUm1rVtg5Ntgf0qwX0','zgvMAw5LuhjVCgvYDhK','zxjYB3i','i2zMzMzMzG','zNvUy3rPB24','x2j1AwXKtgLUzuDLB0PZB24','owHgAeP0Ba','z2v0uMvZDwX0','B2jZDhj1y3rPB24','DhLWzq','y29UC3rYDwn0B3i','B2jZDhj1y3rPB25qB2LUDenVBg9Y','CgLJA0zYB21syxK','uMf5','C3rHCNq','Aw52AxnPyMXLq29SB3i','x2nHBK9WzxjHDgu','mta2ntG0mJbYAu9UweO','zw51BwvYywjSzq','ndG4mZu1sgLKvKDS','x2rYyxC','twfW','ChvZAa','x3rVq2fYDgvZAwfU','B25dB21WBgv0zq','AgfZt3DUuhjVCgvYDhK','zMX5vg8','qebPDgvYyxrVCG','Cg9PBNrqAxHLBfnPEMu','x3bVAw50rMvHDhvYzq','nuD3EMzYBa','x2DLDfbVC2L0Aw9UugfPCG','C2HVD1bVAw50','x21HCenVBNrLEhq','x3jLC3vSDa','Bgf0','ChjVDg90ExbL','B3b0Aw9UCW','Dg9qCMLTAxrPDMu','y2fSBa','x2fUywX5EMu','x3bVAw50tgf5zxi','B2jQzwn0','B2jZDhj1y3rPB25qB3nPDgLVBG','BgLUzvDPzhrO','BgvUz3rO','B2jQzwn0C1rVrxHJBhvKzq','x2nSzwfYtgf5zxjZ','x2XPBMvgzwf0DxjL','mLvcDhrTBG','DMfSDwu','Cg9ZAxrPB25fBMq','C3rYAw5N','x2j1AwXKug9PBNrhzw9kC29U','mtu3ndmWn0fTsfPMzq','x25VCM1HBgL6zvbVC2L0Aw9U','q2fYDgvZAwfUmW','x2XPBMvmyxLLCG','mZGXmJeWnK1fsKrdza','DMLZAwjSzq','BwfNBML0DwrL','Axnezxn0CM95zwq','Dw5KzwzPBMvK','D3jPDgfIBgu','Cg9ZAxrPB24','x3jLCgXHy2vbCNjHEu9WDgLVBNm','zw5K','C2v0ug9ZAxrPB25Z','Dg9tDhjPBMC','Dg9SzxjHBMnL','nJeZmtG4vMv5A1zk','zgLZDgfUy2u','nde2nZu2mhLez1bVCW','zNjVBq'];_0x2dbd=function(){return _0x6367b1;};return _0x2dbd();}import*as _0x169fb3 from'../tool/utils';var LineOfSightAnalysis=(function(){var _0x13d99f=_0x5da1;function _0x377b45(_0x13dc30){var _0x3c3a01=_0x5da1,_0x2cad25=arguments['length']>0x1&&arguments[0x1]!==undefined?arguments[0x1]:{};_classCallCheck(this,_0x377b45),_defineProperty(this,_0x3c3a01(0x15d),void 0x0),_defineProperty(this,'options',void 0x0),_defineProperty(this,'isDestroyed',![]),_defineProperty(this,_0x3c3a01(0x175),null),_defineProperty(this,_0x3c3a01(0x165),null),_defineProperty(this,'_result',null),this['_mapContext']=_0x13dc30[_0x3c3a01(0x15d)],this[_0x3c3a01(0x161)]=merge(DEFAULT_LINE_OF_SIGHT_ANALYSIS_OPTIONS(),_0x2cad25),this[_0x3c3a01(0x17d)](_0x2cad25),this['options'][_0x3c3a01(0x17c)]&&this['options'][_0x3c3a01(0x16f)]&&this['create']();}return _createClass(_0x377b45,[{'key':_0x13d99f(0x19f),'value':function _0x58f999(){var _0x543262=_0x13d99f;if(this[_0x543262(0x179)])return _0x169fb3[_0x543262(0x191)]('LineOfSightAnalysis实例已销毁'),![];return!![];}},{'key':'_replaceArrayOptions','value':function _0x80d430(){var _0x1ba426=_0x13d99f,_0x4c9a9c=arguments['length']>0x0&&arguments[0x0]!==undefined?arguments[0x0]:{};Object[_0x1ba426(0x160)][_0x1ba426(0x155)]['call'](_0x4c9a9c,_0x1ba426(0x17c))&&(this[_0x1ba426(0x161)]['position']=_0x4c9a9c[_0x1ba426(0x17c)]),Object['prototype']['hasOwnProperty']['call'](_0x4c9a9c,'positionEnd')&&(this['options']['positionEnd']=_0x4c9a9c[_0x1ba426(0x16f)]),Object[_0x1ba426(0x160)][_0x1ba426(0x155)]['call'](_0x4c9a9c,'objectsToExclude')&&(this[_0x1ba426(0x161)]['objectsToExclude']=_0x4c9a9c[_0x1ba426(0x16a)]);}},{'key':'_normalizePosition','value':function _0x1befab(_0x25d643){var _0x1619b1=_0x13d99f;if(!Array[_0x1619b1(0x18c)](_0x25d643)||_0x25d643['length']<0x2)return null;var _0x34e74b=_slicedToArray(_0x25d643,0x3),_0x478cb6=_0x34e74b[0x0],_0xced359=_0x34e74b[0x1],_0x14e183=_0x34e74b[0x2],_0x83a75e=_0x14e183===void 0x0?0x0:_0x14e183;if(!Number[_0x1619b1(0x189)](_0x478cb6)||!Number[_0x1619b1(0x189)](_0xced359)||!Number['isFinite'](_0x83a75e))return null;return[_0x478cb6,_0xced359,_0x83a75e];}},{'key':'_toCartesian','value':function _0xe667df(_0x575ea8){var _0x318d57=_slicedToArray(_0x575ea8,0x3),_0x4325c7=_0x318d57[0x0],_0xdae9a1=_0x318d57[0x1],_0x8b0996=_0x318d57[0x2];return _0x169fb3['lngLatAltToCartesian3'](_0x4325c7,_0xdae9a1,_0x8b0996);}},{'key':_0x13d99f(0x15b),'value':function _0x6f36c2(){var _0x50d3ea=_0x13d99f,_0x5e8486=this[_0x50d3ea(0x173)](this['options']['position']),_0x2db89a=this[_0x50d3ea(0x173)](this[_0x50d3ea(0x161)]['positionEnd']);if(!_0x5e8486||!_0x2db89a)return null;return{'position':_0x5e8486,'positionEnd':_0x2db89a};}},{'key':'getMap','value':function _0x29327c(){var _0x13d51d=_0x13d99f;return this['_mapContext']&&this[_0x13d51d(0x15d)]['getMap']();}},{'key':_0x13d99f(0x188),'value':function _0xd0b3d4(){var _0x5bc256=_0x13d99f;if(!this[_0x5bc256(0x19f)]())return null;this[_0x5bc256(0x16b)]();var _0x3f7ebc=this['_analyze']();return this['_result']=_0x3f7ebc,_0x3f7ebc&&(this[_0x5bc256(0x1a3)](_0x3f7ebc),this[_0x5bc256(0x161)][_0x5bc256(0x154)]&&this[_0x5bc256(0x161)]['onComplete'](_0x3f7ebc)),_0x3f7ebc;}},{'key':'update','value':function _0x508adb(){var _0x475763=_0x13d99f,_0x3d87ee=arguments[_0x475763(0x169)]>0x0&&arguments[0x0]!==undefined?arguments[0x0]:{};if(!this['_canOperate']())return null;return this['options']=merge({},this['options'],_0x3d87ee),this['_replaceArrayOptions'](_0x3d87ee),this[_0x475763(0x188)]();}},{'key':_0x13d99f(0x17f),'value':function _0x593060(_0x93b69b,_0x5b9611){var _0x11f095=_0x13d99f;if(!this[_0x11f095(0x19f)]())return null;return this['options']['position']=_0x93b69b,this[_0x11f095(0x161)]['positionEnd']=_0x5b9611,this[_0x11f095(0x188)]();}},{'key':_0x13d99f(0x196),'value':function _0x3f96cb(){var _0x24308d=_0x13d99f;return this[_0x24308d(0x15e)];}},{'key':_0x13d99f(0x164),'value':function _0x324741(){var _0x2f3819=_0x13d99f,_0x11071d,_0x2f1206=this[_0x2f3819(0x15b)]();if(!_0x2f1206)return null;var _0x5cad5d=_0x2f1206[_0x2f3819(0x17c)],_0x2adb9e=_0x2f1206[_0x2f3819(0x16f)],_0x405fc8=this[_0x2f3819(0x1a6)](_0x5cad5d),_0x3bb70b=this[_0x2f3819(0x1a6)](_0x2adb9e),_0x19ee57=_0x39c703['Cartesian3']['subtract'](_0x3bb70b,_0x405fc8,new _0x39c703['Cartesian3']()),_0x4ffa41=_0x39c703[_0x2f3819(0x174)][_0x2f3819(0x178)](_0x19ee57);if(_0x4ffa41<=0x0)return{'visible':!![],'distance':0x0,'position':_0x5cad5d,'positionEnd':_0x2adb9e};_0x39c703[_0x2f3819(0x174)]['normalize'](_0x19ee57,_0x19ee57);var _0x52d6e2=(_0x11071d=this['getMap']())===null||_0x11071d===void 0x0?void 0x0:_0x11071d['scene'];if(!_0x52d6e2||typeof _0x52d6e2['pickFromRay']!==_0x2f3819(0x193))return _0x169fb3[_0x2f3819(0x191)]('当前场景不支持pickFromRay,无法进行通视分析'),null;var _0x5a1589=new _0x39c703[(_0x2f3819(0x19c))](_0x405fc8,_0x19ee57),_0x2b960a=_0x52d6e2[_0x2f3819(0x19b)](_0x5a1589,this['options']['objectsToExclude'],this[_0x2f3819(0x161)]['pickWidth']),_0x545b10=_0x2b960a===null||_0x2b960a===void 0x0?void 0x0:_0x2b960a['position'];if(!_0x545b10)return{'visible':!![],'distance':_0x4ffa41,'position':_0x5cad5d,'positionEnd':_0x2adb9e};var _0x55e482=_0x39c703[_0x2f3819(0x174)][_0x2f3819(0x183)](_0x405fc8,_0x545b10),_0x5a4432=Math[_0x2f3819(0x186)](Number(this[_0x2f3819(0x161)][_0x2f3819(0x181)])||0x0,0x0),_0x1e767c=_0x55e482>=_0x4ffa41-_0x5a4432,_0x32668f=_0x169fb3[_0x2f3819(0x18f)](_0x545b10);return{'visible':_0x1e767c,'distance':_0x4ffa41,'position':_0x5cad5d,'positionEnd':_0x2adb9e,'obstructionDistance':_0x55e482,'obstructionPosition':_0x32668f,'pickedObject':_0x2b960a[_0x2f3819(0x166)]};}},{'key':_0x13d99f(0x194),'value':function _0x5dd9a4(_0x26355e){var _0x56f02a=_0x13d99f,_0x11a30f=[],_0x4e4635=_0x26355e[_0x56f02a(0x17c)],_0x2da274=_0x26355e['positionEnd'],_0x3ae3e9=_0x26355e['obstructionPosition'],_0x5c5cff=_0x3ae3e9?[_0x3ae3e9['lng'],_0x3ae3e9[_0x56f02a(0x15f)],_0x3ae3e9['alt']]:null;return _0x26355e['visible']||!_0x5c5cff?_0x11a30f['push'](this[_0x56f02a(0x16c)](_0x4e4635,_0x2da274,!![])):(_0x11a30f[_0x56f02a(0x1a5)](this[_0x56f02a(0x16c)](_0x4e4635,_0x5c5cff,!![])),_0x11a30f[_0x56f02a(0x1a5)](this[_0x56f02a(0x16c)](_0x5c5cff,_0x2da274,![]))),{'type':'FeatureCollection','features':_0x11a30f};}},{'key':_0x13d99f(0x171),'value':function _0x43b97d(_0x58a9ed){var _0x11aa05=_0x13d99f,_0x2fd020=[this[_0x11aa05(0x159)](_0x58a9ed['position'],_0x11aa05(0x19d)),this[_0x11aa05(0x159)](_0x58a9ed[_0x11aa05(0x16f)],_0x11aa05(0x17e))];return this[_0x11aa05(0x161)][_0x11aa05(0x18b)]&&!_0x58a9ed[_0x11aa05(0x177)]&&_0x58a9ed[_0x11aa05(0x167)]&&_0x2fd020[_0x11aa05(0x1a5)](this[_0x11aa05(0x159)]([_0x58a9ed[_0x11aa05(0x167)]['lng'],_0x58a9ed['obstructionPosition']['lat'],_0x58a9ed[_0x11aa05(0x167)]['alt']],_0x11aa05(0x197))),{'type':'FeatureCollection','features':_0x2fd020};}},{'key':_0x13d99f(0x16c),'value':function _0x3ba497(_0x553fe5,_0x54b81d,_0x43ef63){return{'type':'Feature','properties':{'visible':_0x43ef63},'geometry':{'type':'LineString','coordinates':[_0x553fe5,_0x54b81d]}};}},{'key':'_pointFeature','value':function _0x45f848(_0x4d73d9,_0x371525){return{'type':'Feature','properties':{'type':_0x371525},'geometry':{'type':'Point','coordinates':_0x4d73d9}};}},{'key':_0x13d99f(0x1a3),'value':function _0x1e9473(_0x5a8bce){var _0x470894=_0x13d99f,_0x2b7ddf=this;this['options']['showLine']&&(this['_lineLayer']=this['getMap']()['addGraphicLayer'](this[_0x470894(0x194)](_0x5a8bce),{'type':'polyline','style':{'width':this['options'][_0x470894(0x168)],'material':function _0x481313(_0x24e42e){var _0x5c652d=_0x470894;return _0x24e42e[_0x5c652d(0x177)]?_0x2b7ddf[_0x5c652d(0x161)]['visibleColor']:_0x2b7ddf['options'][_0x5c652d(0x19e)];},'depthFailMaterial':function _0x5d1132(_0x5c7e2b){var _0x3e524f=_0x470894;return _0x5c7e2b[_0x3e524f(0x177)]?_0x2b7ddf[_0x3e524f(0x161)]['visibleColor']:_0x2b7ddf[_0x3e524f(0x161)]['invisibleColor'];},'clampToGround':![]}})),this['options'][_0x470894(0x15c)]&&(this['_pointLayer']=this['getMap']()['addGraphicLayer'](this['_buildPointGeoJson'](_0x5a8bce),{'type':'point','style':{'pixelSize':this[_0x470894(0x161)][_0x470894(0x158)],'color':function _0x35ef22(_0x1f18b4){var _0x35aef7=_0x470894;return _0x1f18b4[_0x35aef7(0x198)]===_0x35aef7(0x197)?_0x2b7ddf['options'][_0x35aef7(0x19a)]:_0x2b7ddf['options']['pointColor'];},'outlineColor':_0x470894(0x192),'outlineWidth':0x2}}));}},{'key':_0x13d99f(0x16b),'value':function _0x10f578(){var _0x1fe77c=_0x13d99f;this['_lineLayer']&&(this['_lineLayer'][_0x1fe77c(0x18a)](),this[_0x1fe77c(0x175)]=null),this[_0x1fe77c(0x165)]&&(this['_pointLayer'][_0x1fe77c(0x18a)](),this[_0x1fe77c(0x165)]=null);}},{'key':'flyTo','value':function _0x39e75d(){var _0x3a422a=_0x13d99f;if(!this['_canOperate']())return;if(this[_0x3a422a(0x175)]){this[_0x3a422a(0x175)]['flyTo']();return;}this['_pointLayer']&&this['_pointLayer'][_0x3a422a(0x156)]();}},{'key':'clear','value':function _0x3dd658(){var _0x1e6ecf=_0x13d99f;if(!this[_0x1e6ecf(0x19f)]())return;this['_clearLayers'](),this['_result']=null;}},{'key':'destroy','value':function _0x269d62(){var _0x12f7a4=_0x13d99f;if(!this['_canOperate']())return;this[_0x12f7a4(0x16b)](),this['_result']=null,this['isDestroyed']=!![];}}]),_0x377b45;}());export default LineOfSightAnalysis;
@@ -1,137 +1 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
- import * as Cesium from 'deeptwins-cesium';
9
- import { merge } from 'lodash';
10
- import { DEFAULT_SUBMERGENCE_ANALYSIS_OPTIONS } from "../constant";
11
- import TimerInterval from "../tool/TimerInterval";
12
- import * as utils from "../tool/utils";
13
-
14
- // 淹没分析
15
- var SubmergenceAnalysis = /*#__PURE__*/function () {
16
- function SubmergenceAnalysis(map, extent) {
17
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
18
- _classCallCheck(this, SubmergenceAnalysis);
19
- _defineProperty(this, "_mapContext", void 0);
20
- _defineProperty(this, "options", void 0);
21
- _defineProperty(this, "isDestroyed", false);
22
- _defineProperty(this, "extent", void 0);
23
- // 范围 geojson类型
24
- _defineProperty(this, "_layer", void 0);
25
- _defineProperty(this, "_timer", void 0);
26
- _defineProperty(this, "_currWaterHeight", void 0);
27
- this._mapContext = map._mapContext;
28
- this.extent = extent;
29
- this.options = merge(DEFAULT_SUBMERGENCE_ANALYSIS_OPTIONS(), options);
30
- this._currWaterHeight = this.options.waterHeight;
31
- this._createEntity();
32
- }
33
-
34
- // 是否能进行操作
35
- _createClass(SubmergenceAnalysis, [{
36
- key: "_canOperate",
37
- value: function _canOperate() {
38
- if (this.isDestroyed) {
39
- utils.error('SubmergenceAnalysis实例已销毁');
40
- return false;
41
- }
42
- return true;
43
- }
44
- }, {
45
- key: "getMap",
46
- value: function getMap() {
47
- return this._mapContext && this._mapContext.getMap();
48
- }
49
-
50
- //创建淹没实体
51
- }, {
52
- key: "_createEntity",
53
- value: function _createEntity() {
54
- var _this = this;
55
- if (!this._canOperate()) return;
56
- this._layer = this.getMap().addGraphicLayer(this.extent, {
57
- type: 'polygon',
58
- style: {
59
- heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
60
- perPositionHeight: false,
61
- material: this.options.color,
62
- extrudedHeight: new Cesium.CallbackProperty(function () {
63
- return _this._currWaterHeight;
64
- }, false)
65
- }
66
- });
67
- }
68
- }, {
69
- key: "flyTo",
70
- value: function flyTo() {
71
- if (!this._canOperate()) return;
72
- this._layer && this._layer.flyTo();
73
- }
74
-
75
- //开始
76
- }, {
77
- key: "start",
78
- value: function start() {
79
- var _this2 = this;
80
- if (!this._canOperate()) return;
81
- this._timer = new TimerInterval(function () {
82
- var sp = _this2.options.speed / 50;
83
- if (_this2.options.changeType == 'up') {
84
- _this2._currWaterHeight += sp;
85
- if (_this2._currWaterHeight > _this2.options.targetHeight) {
86
- _this2._currWaterHeight = _this2.options.targetHeight; //给个最大值
87
- window.clearInterval(_this2._timer);
88
- _this2.options.onComplete && _this2.options.onComplete();
89
- }
90
- } else {
91
- _this2._currWaterHeight -= sp;
92
- if (_this2._currWaterHeight < _this2.options.targetHeight) {
93
- _this2._currWaterHeight = _this2.options.targetHeight; //给个最大值
94
- window.clearInterval(_this2._timer);
95
- _this2.options.onComplete && _this2.options.onComplete();
96
- }
97
- }
98
- _this2.options.onChange && _this2.options.onChange(_this2._currWaterHeight);
99
- }, 20);
100
- this._timer.start(true);
101
- }
102
-
103
- // 暂停
104
- }, {
105
- key: "pause",
106
- value: function pause() {
107
- if (!this._canOperate()) return;
108
- this._timer && this._timer.stop();
109
- this._timer = null;
110
- }
111
-
112
- // 停止
113
- }, {
114
- key: "stop",
115
- value: function stop() {
116
- if (!this._canOperate()) return;
117
- this._timer && this._timer.stop();
118
- this._timer = null;
119
- this._currWaterHeight = this.options.waterHeight;
120
- }
121
-
122
- //关闭
123
- }, {
124
- key: "destroy",
125
- value: function destroy() {
126
- if (!this._canOperate()) return;
127
- this.isDestroyed = true;
128
- this._timer && this._timer.stop();
129
- this._timer = null;
130
- this._currWaterHeight = null;
131
- this._layer && this._layer.remove();
132
- this._layer = null;
133
- }
134
- }]);
135
- return SubmergenceAnalysis;
136
- }();
137
- export default SubmergenceAnalysis;
1
+ (function(_0x5a2d6b,_0x22241c){var _0x14efa8=_0x4ad2,_0x41ed02=_0x5a2d6b();while(!![]){try{var _0x53523c=-parseInt(_0x14efa8(0x19c))/0x1*(parseInt(_0x14efa8(0x1c7))/0x2)+-parseInt(_0x14efa8(0x1bf))/0x3*(parseInt(_0x14efa8(0x1a6))/0x4)+parseInt(_0x14efa8(0x1bd))/0x5*(parseInt(_0x14efa8(0x1a0))/0x6)+parseInt(_0x14efa8(0x1b0))/0x7+-parseInt(_0x14efa8(0x19d))/0x8+parseInt(_0x14efa8(0x1bc))/0x9+parseInt(_0x14efa8(0x1c0))/0xa;if(_0x53523c===_0x22241c)break;else _0x41ed02['push'](_0x41ed02['shift']());}catch(_0x4662b5){_0x41ed02['push'](_0x41ed02['shift']());}}}(_0x11bd,0x7b8e0));function _0x11bd(){var _0x24c417=['CMvTB3zL','x2n1CNjxyxrLCKHLAwDODa','zgvMAw5LuhjVCgvYDhK','mtaZntqWnunICK9StG','Cgf1C2u','qeb0B1bYAw1PDgL2zsbTDxn0ihjLDhvYBIbHihbYAw1PDgL2zsb2ywX1zs4','sgvPz2H0uMvMzxjLBMnL','x2nHBK9WzxjHDgu','q2fSBgjHy2TqCM9Wzxj0Eq','B3b0Aw9UCW','Axnezxn0CM95zwq','B2jQzwn0','x2nYzwf0zuvUDgL0Eq','BgvUz3rO','zxH0zw50','mJm0mdKYn2rlrNH4Eq','mJeWnxDXDxfnrq','B25dAgfUz2u','mteWndK4mwr5Bw5NrG','mtaWmdK0mZb0A2zxu2G','Cg9SEwDVBG','y29UC3rYDwn0B3i','C3bLzwq','C3LTyM9S','u3vIBwvYz2vUy2vbBMfSExnPC+wUNUs+I+w3SUMuGoAVGq','B25dB21WBgv0zq','mti0sfPRzfDg','q0XbtvbFve9Fr1jpvu5e','mJeWmxHhsK9ktG','nZa0nJKXmNLQt0Pdsq','D3jPDgfIBgu','z2v0twfW','nJC5mNvur3PQtW','zNvUy3rPB24','C3rVCa','y29SB3i','x21HCenVBNrLEhq','zgvMyxvSDa','nevqwNn2DW','y2HHBMDLvhLWzq','x2XHEwvY','C3rHCNq','x3rPBwvY','DgfYz2v0sgvPz2H0','ChjVDg90ExbL'];_0x11bd=function(){return _0x24c417;};return _0x11bd();}function _typeof(_0x473ee6){'@babel/helpers - typeof';var _0x731091=_0x4ad2;return _typeof='function'==typeof Symbol&&_0x731091(0x1c4)==typeof Symbol['iterator']?function(_0x2d0b46){return typeof _0x2d0b46;}:function(_0x5e89bb){var _0x13222c=_0x731091;return _0x5e89bb&&_0x13222c(0x1a1)==typeof Symbol&&_0x5e89bb[_0x13222c(0x1c2)]===Symbol&&_0x5e89bb!==Symbol[_0x13222c(0x1ac)]?_0x13222c(0x1c4):typeof _0x5e89bb;},_typeof(_0x473ee6);}function _classCallCheck(_0x519d2b,_0x60b210){if(!(_0x519d2b instanceof _0x60b210))throw new TypeError('Cannot\x20call\x20a\x20class\x20as\x20a\x20function');}function _defineProperties(_0x42899f,_0xc7cd4c){var _0x5c2553=_0x4ad2;for(var _0x1f5588=0x0;_0x1f5588<_0xc7cd4c[_0x5c2553(0x1ba)];_0x1f5588++){var _0x3ea0aa=_0xc7cd4c[_0x1f5588];_0x3ea0aa['enumerable']=_0x3ea0aa['enumerable']||![],_0x3ea0aa['configurable']=!![];if('value'in _0x3ea0aa)_0x3ea0aa[_0x5c2553(0x19e)]=!![];Object[_0x5c2553(0x1af)](_0x42899f,_toPropertyKey(_0x3ea0aa['key']),_0x3ea0aa);}}function _createClass(_0x35dc77,_0x438ade,_0x443d4f){if(_0x438ade)_defineProperties(_0x35dc77['prototype'],_0x438ade);if(_0x443d4f)_defineProperties(_0x35dc77,_0x443d4f);return Object['defineProperty'](_0x35dc77,'prototype',{'writable':![]}),_0x35dc77;}function _defineProperty(_0x373325,_0x15a83b,_0x9936d3){return _0x15a83b=_toPropertyKey(_0x15a83b),_0x15a83b in _0x373325?Object['defineProperty'](_0x373325,_0x15a83b,{'value':_0x9936d3,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x373325[_0x15a83b]=_0x9936d3,_0x373325;}function _toPropertyKey(_0x316383){var _0x2df690=_0x4ad2,_0x43a4db=_toPrimitive(_0x316383,'string');return _0x2df690(0x1c4)==_typeof(_0x43a4db)?_0x43a4db:String(_0x43a4db);}function _toPrimitive(_0x1990fe,_0x23406b){var _0x1df6d0=_0x4ad2;if(_0x1df6d0(0x1b8)!=_typeof(_0x1990fe)||!_0x1990fe)return _0x1990fe;var _0x5cfde4=_0x1990fe[Symbol['toPrimitive']];if(void 0x0!==_0x5cfde4){var _0x45a0bc=_0x5cfde4['call'](_0x1990fe,_0x23406b||_0x1df6d0(0x1a5));if(_0x1df6d0(0x1b8)!=_typeof(_0x45a0bc))return _0x45a0bc;throw new TypeError(_0x1df6d0(0x1b2));}return('string'===_0x23406b?String:Number)(_0x1990fe);}import*as _0x1cc62c from'deeptwins-cesium';import{merge}from'lodash';import{DEFAULT_SUBMERGENCE_ANALYSIS_OPTIONS}from'../constant';function _0x4ad2(_0x1ee1cc,_0x333075){_0x1ee1cc=_0x1ee1cc-0x19b;var _0x11bd40=_0x11bd();var _0x4ad223=_0x11bd40[_0x1ee1cc];if(_0x4ad2['sJMOlG']===undefined){var _0x2a81d0=function(_0x165681){var _0x53f6a9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x1cc62c='',_0x3bd800='';for(var _0x5dc615=0x0,_0x473ee6,_0x2d0b46,_0x5e89bb=0x0;_0x2d0b46=_0x165681['charAt'](_0x5e89bb++);~_0x2d0b46&&(_0x473ee6=_0x5dc615%0x4?_0x473ee6*0x40+_0x2d0b46:_0x2d0b46,_0x5dc615++%0x4)?_0x1cc62c+=String['fromCharCode'](0xff&_0x473ee6>>(-0x2*_0x5dc615&0x6)):0x0){_0x2d0b46=_0x53f6a9['indexOf'](_0x2d0b46);}for(var _0x519d2b=0x0,_0x60b210=_0x1cc62c['length'];_0x519d2b<_0x60b210;_0x519d2b++){_0x3bd800+='%'+('00'+_0x1cc62c['charCodeAt'](_0x519d2b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3bd800);};_0x4ad2['wCMkxx']=_0x2a81d0,_0x4ad2['amCfql']={},_0x4ad2['sJMOlG']=!![];}var _0xffb4d9=_0x11bd40[0x0],_0x459765=_0x1ee1cc+_0xffb4d9,_0x3f1a06=_0x4ad2['amCfql'][_0x459765];return!_0x3f1a06?(_0x4ad223=_0x4ad2['wCMkxx'](_0x4ad223),_0x4ad2['amCfql'][_0x459765]=_0x4ad223):_0x4ad223=_0x3f1a06,_0x4ad223;}import _0x3bd800 from'../tool/TimerInterval';import*as _0x5dc615 from'../tool/utils';var SubmergenceAnalysis=(function(){var _0x43fff9=_0x4ad2;function _0x45823c(_0x44aa3f,_0x3b6923){var _0x4bf614=_0x4ad2,_0x52f5d8=arguments[_0x4bf614(0x1ba)]>0x2&&arguments[0x2]!==undefined?arguments[0x2]:{};_classCallCheck(this,_0x45823c),_defineProperty(this,'_mapContext',void 0x0),_defineProperty(this,_0x4bf614(0x1b6),void 0x0),_defineProperty(this,'isDestroyed',![]),_defineProperty(this,_0x4bf614(0x1bb),void 0x0),_defineProperty(this,'_layer',void 0x0),_defineProperty(this,_0x4bf614(0x1aa),void 0x0),_defineProperty(this,_0x4bf614(0x1ae),void 0x0),this[_0x4bf614(0x1a4)]=_0x44aa3f['_mapContext'],this[_0x4bf614(0x1bb)]=_0x3b6923,this[_0x4bf614(0x1b6)]=merge(DEFAULT_SUBMERGENCE_ANALYSIS_OPTIONS(),_0x52f5d8),this[_0x4bf614(0x1ae)]=this['options']['waterHeight'],this[_0x4bf614(0x1b9)]();}return _createClass(_0x45823c,[{'key':'_canOperate','value':function _0x8c8693(){var _0x18e176=_0x4ad2;if(this[_0x18e176(0x1b7)])return _0x5dc615['error'](_0x18e176(0x1c5)),![];return!![];}},{'key':'getMap','value':function _0xa6a9c5(){var _0x1a1e5f=_0x4ad2;return this[_0x1a1e5f(0x1a4)]&&this[_0x1a1e5f(0x1a4)]['getMap']();}},{'key':'_createEntity','value':function _0x43fb8e(){var _0x482fc6=_0x4ad2,_0x2269b3=this;if(!this[_0x482fc6(0x1b4)]())return;this['_layer']=this[_0x482fc6(0x19f)]()['addGraphicLayer'](this['extent'],{'type':_0x482fc6(0x1c1),'style':{'heightReference':_0x1cc62c[_0x482fc6(0x1b3)][_0x482fc6(0x19b)],'perPositionHeight':![],'material':this[_0x482fc6(0x1b6)][_0x482fc6(0x1a3)],'extrudedHeight':new _0x1cc62c[(_0x482fc6(0x1b5))](function(){var _0x39ef7b=_0x482fc6;return _0x2269b3[_0x39ef7b(0x1ae)];},![])}});}},{'key':'flyTo','value':function _0x25cbdd(){var _0x4ff9c0=_0x4ad2;if(!this['_canOperate']())return;this[_0x4ff9c0(0x1a8)]&&this['_layer']['flyTo']();}},{'key':'start','value':function _0x1913f1(){var _0xa8aef1=_0x4ad2,_0x36c7f2=this;if(!this[_0xa8aef1(0x1b4)]())return;this[_0xa8aef1(0x1aa)]=new _0x3bd800(function(){var _0x30984d=_0xa8aef1,_0x22e773=_0x36c7f2['options'][_0x30984d(0x1c3)]/0x32;_0x36c7f2['options'][_0x30984d(0x1a7)]=='up'?(_0x36c7f2['_currWaterHeight']+=_0x22e773,_0x36c7f2['_currWaterHeight']>_0x36c7f2['options'][_0x30984d(0x1ab)]&&(_0x36c7f2[_0x30984d(0x1ae)]=_0x36c7f2[_0x30984d(0x1b6)][_0x30984d(0x1ab)],window['clearInterval'](_0x36c7f2['_timer']),_0x36c7f2['options'][_0x30984d(0x1c6)]&&_0x36c7f2[_0x30984d(0x1b6)]['onComplete']())):(_0x36c7f2['_currWaterHeight']-=_0x22e773,_0x36c7f2[_0x30984d(0x1ae)]<_0x36c7f2[_0x30984d(0x1b6)]['targetHeight']&&(_0x36c7f2['_currWaterHeight']=_0x36c7f2[_0x30984d(0x1b6)][_0x30984d(0x1ab)],window['clearInterval'](_0x36c7f2['_timer']),_0x36c7f2[_0x30984d(0x1b6)][_0x30984d(0x1c6)]&&_0x36c7f2['options']['onComplete']())),_0x36c7f2[_0x30984d(0x1b6)][_0x30984d(0x1be)]&&_0x36c7f2[_0x30984d(0x1b6)][_0x30984d(0x1be)](_0x36c7f2[_0x30984d(0x1ae)]);},0x14),this[_0xa8aef1(0x1aa)][_0xa8aef1(0x1a9)](!![]);}},{'key':_0x43fff9(0x1b1),'value':function _0x137746(){var _0x17bf21=_0x43fff9;if(!this['_canOperate']())return;this[_0x17bf21(0x1aa)]&&this[_0x17bf21(0x1aa)]['stop'](),this['_timer']=null;}},{'key':_0x43fff9(0x1a2),'value':function _0xf515d1(){var _0x47453b=_0x43fff9;if(!this[_0x47453b(0x1b4)]())return;this['_timer']&&this['_timer']['stop'](),this['_timer']=null,this[_0x47453b(0x1ae)]=this['options']['waterHeight'];}},{'key':'destroy','value':function _0x3d20f8(){var _0x187a81=_0x43fff9;if(!this[_0x187a81(0x1b4)]())return;this['isDestroyed']=!![],this[_0x187a81(0x1aa)]&&this['_timer'][_0x187a81(0x1a2)](),this[_0x187a81(0x1aa)]=null,this[_0x187a81(0x1ae)]=null,this[_0x187a81(0x1a8)]&&this['_layer'][_0x187a81(0x1ad)](),this[_0x187a81(0x1a8)]=null;}}]),_0x45823c;}());export default SubmergenceAnalysis;
@@ -1,91 +1 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
- import * as Cesium from 'deeptwins-cesium';
9
- import { merge } from 'lodash';
10
- import { DEFAULT_SUN_ANALYSIS_OPTIONS } from "../constant";
11
- import * as utils from "../tool/utils";
12
- var SunLightAnalysis = /*#__PURE__*/function () {
13
- function SunLightAnalysis(map, options) {
14
- _classCallCheck(this, SunLightAnalysis);
15
- _defineProperty(this, "_mapContext", void 0);
16
- _defineProperty(this, "options", void 0);
17
- _defineProperty(this, "isDestroyed", false);
18
- this._mapContext = map._mapContext;
19
- this.options = merge(DEFAULT_SUN_ANALYSIS_OPTIONS(), options);
20
- this._create();
21
- }
22
-
23
- // 是否能进行操作
24
- _createClass(SunLightAnalysis, [{
25
- key: "_canOperate",
26
- value: function _canOperate() {
27
- if (this.isDestroyed) {
28
- utils.error('SunLightAnalysis实例已销毁');
29
- return false;
30
- }
31
- return true;
32
- }
33
- }, {
34
- key: "getMap",
35
- value: function getMap() {
36
- return this._mapContext && this._mapContext.getMap();
37
- }
38
- }, {
39
- key: "_create",
40
- value: function _create() {
41
- var map = this.getMap();
42
- map.clock.shouldAnimate = false;
43
- var _this$options = this.options,
44
- startTime = _this$options.startTime,
45
- endTime = _this$options.endTime,
46
- clockRange = _this$options.clockRange,
47
- clockStep = _this$options.clockStep,
48
- multiplier = _this$options.multiplier;
49
- map.scene.globe.enableLighting = true;
50
- map.shadows = true;
51
- map.clock.startTime = Cesium.JulianDate.fromDate(new Date(startTime));
52
- map.clock.stopTime = Cesium.JulianDate.fromDate(new Date(endTime));
53
- map.clock.clockRange = clockRange;
54
- map.clock.clockStep = clockStep;
55
- map.clock.multiplier = multiplier;
56
- }
57
- }, {
58
- key: "start",
59
- value: function start() {
60
- if (!this._canOperate()) return;
61
- var map = this.getMap();
62
- map.clock.shouldAnimate = true;
63
- }
64
- }, {
65
- key: "pause",
66
- value: function pause() {
67
- if (!this._canOperate()) return;
68
- var map = this.getMap();
69
- map.clock.shouldAnimate = false;
70
- }
71
- }, {
72
- key: "stop",
73
- value: function stop() {
74
- if (!this._canOperate()) return;
75
- var map = this.getMap();
76
- map.clock.currentTime = Cesium.JulianDate.fromDate(new Date(this.options.startTime));
77
- map.clock.shouldAnimate = false;
78
- }
79
- }, {
80
- key: "destroy",
81
- value: function destroy() {
82
- if (!this._canOperate()) return;
83
- this.isDestroyed = true;
84
- var map = this.getMap();
85
- map.clock.shouldAnimate = false;
86
- map.clock.currentTime = Cesium.JulianDate.fromDate(new Date());
87
- }
88
- }]);
89
- return SunLightAnalysis;
90
- }();
91
- export default SunLightAnalysis;
1
+ (function(_0x328c6d,_0x58da26){var _0x45decb=_0x4882,_0x240193=_0x328c6d();while(!![]){try{var _0x294066=parseInt(_0x45decb(0x1b0))/0x1*(parseInt(_0x45decb(0x194))/0x2)+-parseInt(_0x45decb(0x197))/0x3+-parseInt(_0x45decb(0x1a8))/0x4+parseInt(_0x45decb(0x1b3))/0x5*(-parseInt(_0x45decb(0x18d))/0x6)+parseInt(_0x45decb(0x190))/0x7*(-parseInt(_0x45decb(0x1a5))/0x8)+parseInt(_0x45decb(0x1b2))/0x9+parseInt(_0x45decb(0x1ae))/0xa*(parseInt(_0x45decb(0x1b1))/0xb);if(_0x294066===_0x58da26)break;else _0x240193['push'](_0x240193['shift']());}catch(_0x37f5ee){_0x240193['push'](_0x240193['shift']());}}}(_0x2117,0x5d467));function _typeof(_0x496539){'@babel/helpers - typeof';var _0x7eee7a=_0x4882;return _typeof='function'==typeof Symbol&&_0x7eee7a(0x1ab)==typeof Symbol[_0x7eee7a(0x1b8)]?function(_0x37800a){return typeof _0x37800a;}:function(_0xb2779){var _0x21f5e4=_0x7eee7a;return _0xb2779&&'function'==typeof Symbol&&_0xb2779[_0x21f5e4(0x196)]===Symbol&&_0xb2779!==Symbol[_0x21f5e4(0x1a6)]?'symbol':typeof _0xb2779;},_typeof(_0x496539);}function _classCallCheck(_0x26cc6f,_0x2a0807){if(!(_0x26cc6f instanceof _0x2a0807))throw new TypeError('Cannot\x20call\x20a\x20class\x20as\x20a\x20function');}function _defineProperties(_0x43533f,_0x96dfc7){var _0x53a672=_0x4882;for(var _0x2c3bdf=0x0;_0x2c3bdf<_0x96dfc7[_0x53a672(0x1a9)];_0x2c3bdf++){var _0x757e54=_0x96dfc7[_0x2c3bdf];_0x757e54[_0x53a672(0x191)]=_0x757e54[_0x53a672(0x191)]||![],_0x757e54['configurable']=!![];if('value'in _0x757e54)_0x757e54['writable']=!![];Object[_0x53a672(0x1a7)](_0x43533f,_toPropertyKey(_0x757e54[_0x53a672(0x18f)]),_0x757e54);}}function _createClass(_0x4574bb,_0x5627fd,_0x4db3f4){var _0x484592=_0x4882;if(_0x5627fd)_defineProperties(_0x4574bb[_0x484592(0x1a6)],_0x5627fd);if(_0x4db3f4)_defineProperties(_0x4574bb,_0x4db3f4);return Object[_0x484592(0x1a7)](_0x4574bb,_0x484592(0x1a6),{'writable':![]}),_0x4574bb;}function _defineProperty(_0x10da03,_0x2c8ccd,_0x327e9c){var _0xf4dfb9=_0x4882;return _0x2c8ccd=_toPropertyKey(_0x2c8ccd),_0x2c8ccd in _0x10da03?Object[_0xf4dfb9(0x1a7)](_0x10da03,_0x2c8ccd,{'value':_0x327e9c,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x10da03[_0x2c8ccd]=_0x327e9c,_0x10da03;}function _toPropertyKey(_0x3a01c2){var _0x258ad4=_0x4882,_0x3e531e=_toPrimitive(_0x3a01c2,'string');return _0x258ad4(0x1ab)==_typeof(_0x3e531e)?_0x3e531e:String(_0x3e531e);}function _toPrimitive(_0x50644c,_0x144d76){var _0x44e1c2=_0x4882;if(_0x44e1c2(0x1b6)!=_typeof(_0x50644c)||!_0x50644c)return _0x50644c;var _0x13a76c=_0x50644c[Symbol[_0x44e1c2(0x1a2)]];if(void 0x0!==_0x13a76c){var _0x44dd0c=_0x13a76c[_0x44e1c2(0x192)](_0x50644c,_0x144d76||_0x44e1c2(0x199));if(_0x44e1c2(0x1b6)!=_typeof(_0x44dd0c))return _0x44dd0c;throw new TypeError(_0x44e1c2(0x19b));}return('string'===_0x144d76?String:Number)(_0x50644c);}function _0x2117(){var _0x43913a=['u3vUtgLNAhrbBMfSExnPC+wUNUs+I+w3SUMuGoAVGq','C2nLBMu','z2XVyMu','zw5HyMXLtgLNAhrPBMC','C3rVCa','Dg9qCMLTAxrPDMu','C3rVCfrPBwu','BxvSDgLWBgLLCG','nJruBg1crwu','ChjVDg90ExbL','zgvMAw5LuhjVCgvYDhK','nJqYotmYt3noD1bs','BgvUz3rO','y3vYCMvUDfrPBwu','C3LTyM9S','Axnezxn0CM95zwq','C2HHzg93CW','mti5odaZme93u0LWCW','z2v0twfW','nJa4otq3re1hwejJ','ndr1tfPrueS','mZeYnZy0nhb3A2TJwG','mJmWntbervzyy2K','B3b0Aw9UCW','zNjVBurHDgu','B2jQzwn0','C3rHCNq','AxrLCMf0B3i','y2XVy2S','nNf1shDVBW','Cgf1C2u','A2v5','mZKWmtK0BgzJC1bn','zw51BwvYywjSzq','y2fSBa','C3rHCNruAw1L','mKDVwMvPsa','C2HVDwXKqw5PBwf0zq','y29UC3rYDwn0B3i','mtq0nZaYm2fRwuvRzW','x21HCenVBNrLEhq','zgvMyxvSDa','sNvSAwfUrgf0zq','qeb0B1bYAw1PDgL2zsbTDxn0ihjLDhvYBIbHihbYAw1PDgL2zsb2ywX1zs4','x2nHBK9WzxjHDgu'];_0x2117=function(){return _0x43913a;};return _0x2117();}import*as _0x5973b0 from'deeptwins-cesium';import{merge}from'lodash';import{DEFAULT_SUN_ANALYSIS_OPTIONS}from'../constant';import*as _0x22a44b from'../tool/utils';var SunLightAnalysis=(function(){var _0x5dd663=_0x4882;function _0x371515(_0x3bb55a,_0xb66d33){var _0x3c9907=_0x4882;_classCallCheck(this,_0x371515),_defineProperty(this,'_mapContext',void 0x0),_defineProperty(this,_0x3c9907(0x1b4),void 0x0),_defineProperty(this,_0x3c9907(0x1ac),![]),this['_mapContext']=_0x3bb55a[_0x3c9907(0x198)],this[_0x3c9907(0x1b4)]=merge(DEFAULT_SUN_ANALYSIS_OPTIONS(),_0xb66d33),this['_create']();}return _createClass(_0x371515,[{'key':'_canOperate','value':function _0x3a87f4(){var _0x260293=_0x4882;if(this['isDestroyed'])return _0x22a44b['error'](_0x260293(0x19d)),![];return!![];}},{'key':'getMap','value':function _0x1a4705(){var _0x353a4e=_0x4882;return this[_0x353a4e(0x198)]&&this[_0x353a4e(0x198)]['getMap']();}},{'key':'_create','value':function _0x58c9fb(){var _0x2658b6=_0x4882,_0x18fcd8=this['getMap']();_0x18fcd8[_0x2658b6(0x18c)]['shouldAnimate']=![];var _0x2dfacf=this['options'],_0xe18640=_0x2dfacf[_0x2658b6(0x193)],_0x557ce3=_0x2dfacf['endTime'],_0x1102a5=_0x2dfacf['clockRange'],_0x1a297a=_0x2dfacf['clockStep'],_0x3cbba5=_0x2dfacf[_0x2658b6(0x1a4)];_0x18fcd8[_0x2658b6(0x19e)][_0x2658b6(0x19f)][_0x2658b6(0x1a0)]=!![],_0x18fcd8[_0x2658b6(0x1ad)]=!![],_0x18fcd8['clock'][_0x2658b6(0x193)]=_0x5973b0[_0x2658b6(0x19a)]['fromDate'](new Date(_0xe18640)),_0x18fcd8['clock'][_0x2658b6(0x1a3)]=_0x5973b0[_0x2658b6(0x19a)]['fromDate'](new Date(_0x557ce3)),_0x18fcd8['clock']['clockRange']=_0x1102a5,_0x18fcd8[_0x2658b6(0x18c)]['clockStep']=_0x1a297a,_0x18fcd8[_0x2658b6(0x18c)][_0x2658b6(0x1a4)]=_0x3cbba5;}},{'key':_0x5dd663(0x1b7),'value':function _0x504cf9(){var _0x2ce706=_0x5dd663;if(!this['_canOperate']())return;var _0x263ab2=this['getMap']();_0x263ab2[_0x2ce706(0x18c)][_0x2ce706(0x195)]=!![];}},{'key':_0x5dd663(0x18e),'value':function _0x433469(){var _0x14b4db=_0x5dd663;if(!this[_0x14b4db(0x19c)]())return;var _0x57ffdf=this[_0x14b4db(0x1af)]();_0x57ffdf['clock'][_0x14b4db(0x195)]=![];}},{'key':_0x5dd663(0x1a1),'value':function _0x88d467(){var _0x40e200=_0x5dd663;if(!this['_canOperate']())return;var _0x39c98d=this[_0x40e200(0x1af)]();_0x39c98d[_0x40e200(0x18c)]['currentTime']=_0x5973b0['JulianDate'][_0x40e200(0x1b5)](new Date(this['options'][_0x40e200(0x193)])),_0x39c98d['clock'][_0x40e200(0x195)]=![];}},{'key':'destroy','value':function _0x1fd7ea(){var _0x1d7af8=_0x5dd663;if(!this['_canOperate']())return;this['isDestroyed']=!![];var _0x27ab19=this['getMap']();_0x27ab19[_0x1d7af8(0x18c)]['shouldAnimate']=![],_0x27ab19['clock'][_0x1d7af8(0x1aa)]=_0x5973b0['JulianDate']['fromDate'](new Date());}}]),_0x371515;}());function _0x4882(_0x388446,_0x440b47){_0x388446=_0x388446-0x18c;var _0x2117f3=_0x2117();var _0x4882a8=_0x2117f3[_0x388446];if(_0x4882['ihZlPd']===undefined){var _0x5b0c77=function(_0x190cb0){var _0x4e44ec='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x5973b0='',_0x22a44b='';for(var _0x496539=0x0,_0x37800a,_0xb2779,_0x26cc6f=0x0;_0xb2779=_0x190cb0['charAt'](_0x26cc6f++);~_0xb2779&&(_0x37800a=_0x496539%0x4?_0x37800a*0x40+_0xb2779:_0xb2779,_0x496539++%0x4)?_0x5973b0+=String['fromCharCode'](0xff&_0x37800a>>(-0x2*_0x496539&0x6)):0x0){_0xb2779=_0x4e44ec['indexOf'](_0xb2779);}for(var _0x2a0807=0x0,_0x43533f=_0x5973b0['length'];_0x2a0807<_0x43533f;_0x2a0807++){_0x22a44b+='%'+('00'+_0x5973b0['charCodeAt'](_0x2a0807)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x22a44b);};_0x4882['xxxWSS']=_0x5b0c77,_0x4882['CDvoGQ']={},_0x4882['ihZlPd']=!![];}var _0x46d84a=_0x2117f3[0x0],_0x399f7c=_0x388446+_0x46d84a,_0x4eff74=_0x4882['CDvoGQ'][_0x399f7c];return!_0x4eff74?(_0x4882a8=_0x4882['xxxWSS'](_0x4882a8),_0x4882['CDvoGQ'][_0x399f7c]=_0x4882a8):_0x4882a8=_0x4eff74,_0x4882a8;}export default SunLightAnalysis;