deeptwins-engine-3d 0.1.43 → 0.1.45

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.
@@ -15,7 +15,7 @@ export default class BaseSource {
15
15
  remove(): void;
16
16
  setData(data: any): this | undefined;
17
17
  _toDestroy(): void;
18
- static analysisSourceType(data: any): "other" | "wkt" | "sourceId" | "sourceInstance" | "geoJson";
18
+ static analysisSourceType(data: any): "wkt" | "sourceId" | "sourceInstance" | "geoJson" | "other";
19
19
  static wktToGeoJon(wkt: string): any;
20
20
  static geoJsonToGeoCartesian3Array(geoJson: any): any[];
21
21
  static handleFeaturePoint(feature: any): any;
@@ -69,5 +69,6 @@ export declare class DeepTwinsEngine3D {
69
69
  static VisitLayer: any;
70
70
  static PoiLayer: any;
71
71
  static FlightPlanning: any;
72
+ static FlightRiskEvaluation: any;
72
73
  }
73
74
  export default DeepTwinsEngine3D;
package/dist/esm/index.js CHANGED
@@ -21,6 +21,7 @@ import Drawer from "./drawer/index";
21
21
  import "./global.css";
22
22
  import BarrierLayer from "./lowAltitude/BarrierLayer";
23
23
  import FlightPlanning from "./lowAltitude/FlightPlanning";
24
+ import FlightRiskEvaluation from "./lowAltitude/FlightRiskEvaluation";
24
25
  import GridDraw from "./lowAltitude/GridDraw";
25
26
  import PoiLayer from "./lowAltitude/PoiLayer";
26
27
  import VisitLayer from "./lowAltitude/VisitLayer";
@@ -57,11 +58,11 @@ DEEP_TWINS_BASE_URL && (window.CESIUM_BASE_URL = DEEP_TWINS_BASE_URL);
57
58
  // 全局加载css
58
59
  loadCss(Cesium.buildModuleUrl('Widgets/widgets.css'));
59
60
  // 打印版本信息
60
- console.log('DeepTwinsEngine3D Version:', "0.1.43");
61
+ console.log('DeepTwinsEngine3D Version:', "0.1.45");
61
62
  export var DeepTwinsEngine3D = /*#__PURE__*/_createClass(function DeepTwinsEngine3D() {
62
63
  _classCallCheck(this, DeepTwinsEngine3D);
63
64
  });
64
- _defineProperty(DeepTwinsEngine3D, "Version", "0.1.43");
65
+ _defineProperty(DeepTwinsEngine3D, "Version", "0.1.45");
65
66
  _defineProperty(DeepTwinsEngine3D, "Map", Map);
66
67
  _defineProperty(DeepTwinsEngine3D, "GroundSkyBox", GroundSkyBox);
67
68
  _defineProperty(DeepTwinsEngine3D, "RasterLayer", RasterLayer);
@@ -130,4 +131,5 @@ _defineProperty(DeepTwinsEngine3D, "ViewshedAnalysis", ViewshedAnalysis);
130
131
  _defineProperty(DeepTwinsEngine3D, "VisitLayer", VisitLayer);
131
132
  _defineProperty(DeepTwinsEngine3D, "PoiLayer", PoiLayer);
132
133
  _defineProperty(DeepTwinsEngine3D, "FlightPlanning", FlightPlanning);
134
+ _defineProperty(DeepTwinsEngine3D, "FlightRiskEvaluation", FlightRiskEvaluation);
133
135
  export default DeepTwinsEngine3D;
@@ -15,6 +15,7 @@ import * as Cesium from 'deeptwins-cesium';
15
15
  import { merge } from 'lodash';
16
16
  import { DEFAULT_FLIGHT_PLANNING_OPTIONS } from "../constant";
17
17
  import { ShapeSection } from "../tool/common";
18
+ import fetch from "../tool/fetch";
18
19
  import * as utils from "../tool/utils";
19
20
  import GridDraw from "./GridDraw";
20
21
  var FlightPlanning = /*#__PURE__*/function () {
@@ -57,46 +58,30 @@ var FlightPlanning = /*#__PURE__*/function () {
57
58
  key: "createPlan",
58
59
  value: function () {
59
60
  var _createPlan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
60
- var payload, response, result, normalized, hasPoints;
61
+ var payload, _yield$fetch$post, result, normalized, hasPoints;
61
62
  return _regeneratorRuntime().wrap(function _callee$(_context) {
62
63
  while (1) switch (_context.prev = _context.next) {
63
64
  case 0:
64
65
  payload = this._buildPayload(value);
65
66
  _context.next = 3;
66
- return fetch(this.options.API_URL, {
67
- method: 'POST',
68
- headers: {
69
- 'Content-Type': 'application/json'
70
- },
71
- body: JSON.stringify(payload)
72
- });
67
+ return fetch.post(this.options.API_URL, payload);
73
68
  case 3:
74
- response = _context.sent;
75
- if (response.ok) {
76
- _context.next = 7;
77
- break;
78
- }
79
- utils.error("\u63A5\u53E3\u8BF7\u6C42\u5931\u8D25\uFF0CHTTP ".concat(response.status));
80
- return _context.abrupt("return");
81
- case 7:
82
- _context.next = 9;
83
- return response.json();
84
- case 9:
85
- result = _context.sent;
69
+ _yield$fetch$post = _context.sent;
70
+ result = _yield$fetch$post.data;
86
71
  if (!(result.code !== 0)) {
87
- _context.next = 13;
72
+ _context.next = 8;
88
73
  break;
89
74
  }
90
75
  utils.error(result.message || '规划接口返回失败');
91
76
  return _context.abrupt("return");
92
- case 13:
77
+ case 8:
93
78
  if (result.data) {
94
- _context.next = 16;
79
+ _context.next = 11;
95
80
  break;
96
81
  }
97
82
  utils.error('规划结果为空');
98
83
  return _context.abrupt("return");
99
- case 16:
84
+ case 11:
100
85
  normalized = this._normalizeRouteData(result.data);
101
86
  if (this.options.isDraw) {
102
87
  hasPoints = normalized && Array.isArray(normalized.points) && normalized.points.length > 0;
@@ -111,7 +96,7 @@ var FlightPlanning = /*#__PURE__*/function () {
111
96
  }
112
97
  }
113
98
  return _context.abrupt("return", normalized);
114
- case 19:
99
+ case 14:
115
100
  case "end":
116
101
  return _context.stop();
117
102
  }
@@ -0,0 +1,26 @@
1
+ declare class FlightRiskEvaluation {
2
+ private readonly _mapContext;
3
+ isDestroyed: boolean;
4
+ options: any;
5
+ routeSource: any;
6
+ routeResultSource: any;
7
+ routePointsLayer: any;
8
+ routePointsLabelLayer: any;
9
+ routePipelineLayer: any;
10
+ riskPointsLayer: any;
11
+ riskPointsLabelLayer: any;
12
+ gridsLayer: any;
13
+ constructor(map: any, options?: any);
14
+ private _canOperate;
15
+ getMap(): any;
16
+ start(geoJson?: any): Promise<void>;
17
+ private _createRoute;
18
+ private _clearRoute;
19
+ private _getSegmentColorFromEvaluation;
20
+ private _clusterRiskPoints;
21
+ private _createRiskPoints;
22
+ private _clearRiskPoints;
23
+ private _createGrids;
24
+ destroy(): void;
25
+ }
26
+ export default FlightRiskEvaluation;