deeptwins-engine-3d 0.1.42 → 0.1.43

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 (30) hide show
  1. package/dist/esm/analyze/ViewshedAnalysis.d.ts +8 -8
  2. package/dist/esm/analyze/ViewshedAnalysis.js +76 -90
  3. package/dist/esm/constant.d.ts +44 -6
  4. package/dist/esm/constant.js +86 -7
  5. package/dist/esm/deepTwins/index.js +2 -1
  6. package/dist/esm/drawer/index.d.ts +1 -1
  7. package/dist/esm/graphicLayer/BaseSource.d.ts +1 -1
  8. package/dist/esm/index.d.ts +4 -1
  9. package/dist/esm/index.js +11 -5
  10. package/dist/esm/lowAltitude/BarrierLayer.d.ts +29 -0
  11. package/dist/esm/{tileLayer → lowAltitude}/BarrierLayer.js +39 -165
  12. package/dist/esm/lowAltitude/BaseGridMvtLayer.d.ts +34 -0
  13. package/dist/esm/lowAltitude/BaseGridMvtLayer.js +122 -0
  14. package/dist/esm/lowAltitude/FlightPlanning.d.ts +27 -0
  15. package/dist/esm/lowAltitude/FlightPlanning.js +426 -0
  16. package/dist/esm/{visualization/Airspace.d.ts → lowAltitude/GridDraw.d.ts} +2 -1
  17. package/dist/esm/{visualization/Airspace.js → lowAltitude/GridDraw.js} +9 -9
  18. package/dist/esm/lowAltitude/PoiLayer.d.ts +13 -0
  19. package/dist/esm/lowAltitude/PoiLayer.js +74 -0
  20. package/dist/esm/lowAltitude/RiskEvaluation.d.ts +0 -0
  21. package/dist/esm/lowAltitude/RiskEvaluation.js +0 -0
  22. package/dist/esm/lowAltitude/VisitLayer.d.ts +26 -0
  23. package/dist/esm/lowAltitude/VisitLayer.js +180 -0
  24. package/dist/esm/map/Map.js +3 -3
  25. package/dist/esm/tool/common.d.ts +1 -1
  26. package/dist/esm/tool/common.js +1 -1
  27. package/dist/esm/visualization/FrustumWithCamera.js +10 -8
  28. package/dist/umd/deeptwins-engine-3d.min.js +1 -1
  29. package/package.json +2 -2
  30. package/dist/esm/tileLayer/BarrierLayer.d.ts +0 -76
@@ -10,18 +10,18 @@ declare class ViewshedAnalysis {
10
10
  private lightCamera;
11
11
  private shadowMap;
12
12
  private postStage;
13
- private frustumOutline;
14
- private sketch;
13
+ private frustumCamera;
14
+ private sketchLayer;
15
15
  constructor(map: any, options: any);
16
16
  private _canOperate;
17
17
  getMap(): any;
18
- add(): void;
18
+ create(): void;
19
19
  update(): void;
20
- createLightCamera(): void;
21
- createShadowMap(): void;
22
- createPostStage(): void;
23
- drawFrustumOutline(): void;
24
- drawSketch(): void;
20
+ private _createLightCamera;
21
+ private _createShadowMap;
22
+ private _createPostStage;
23
+ private _drawFrustumOutline;
24
+ private _drawSketch;
25
25
  clear(): void;
26
26
  destroy(): void;
27
27
  }
@@ -15,6 +15,7 @@ import * as Cesium from 'deeptwins-cesium';
15
15
  import { merge } from 'lodash';
16
16
  import { DEFAULT_VIEWSHED_ANALYSIS_OPTIONS } from "../constant";
17
17
  import * as utils from "../tool/utils";
18
+ import FrustumWithCamera from "../visualization/FrustumWithCamera";
18
19
 
19
20
  // 可视域分析。
20
21
  var ViewshedAnalysis = /*#__PURE__*/function () {
@@ -31,30 +32,30 @@ var ViewshedAnalysis = /*#__PURE__*/function () {
31
32
  _defineProperty(this, "lightCamera", void 0);
32
33
  _defineProperty(this, "shadowMap", void 0);
33
34
  _defineProperty(this, "postStage", void 0);
34
- _defineProperty(this, "frustumOutline", void 0);
35
- _defineProperty(this, "sketch", void 0);
35
+ _defineProperty(this, "frustumCamera", void 0);
36
+ _defineProperty(this, "sketchLayer", void 0);
36
37
  this._mapContext = map._mapContext;
37
38
  this.options = merge(DEFAULT_VIEWSHED_ANALYSIS_OPTIONS(), options);
38
- if (!this.options.viewPosition) return;
39
- var _this$options$viewPos = _slicedToArray(this.options.viewPosition, 3),
40
- lng = _this$options$viewPos[0],
41
- lat = _this$options$viewPos[1],
42
- alt = _this$options$viewPos[2];
39
+ if (!this.options.position) return;
40
+ var _this$options$positio = _slicedToArray(this.options.position, 3),
41
+ lng = _this$options$positio[0],
42
+ lat = _this$options$positio[1],
43
+ alt = _this$options$positio[2];
43
44
  this._viewPositionC3 = utils.lngLatAltToCartesian3(lng, lat, alt || 0);
44
- this._viewDistance = this.options.viewDistance;
45
- this._viewHeading = this.options.viewHeading;
46
- this._viewPitch = this.options.viewPitch;
47
- if (this.options.viewPositionEnd) {
48
- var _this$options$viewPos2 = _slicedToArray(this.options.viewPositionEnd, 3),
49
- _lng = _this$options$viewPos2[0],
50
- _lat = _this$options$viewPos2[1],
51
- _alt = _this$options$viewPos2[2];
45
+ this._viewDistance = this.options.distance;
46
+ this._viewHeading = this.options.heading;
47
+ this._viewPitch = this.options.pitch;
48
+ if (this.options.positionEnd) {
49
+ var _this$options$positio2 = _slicedToArray(this.options.positionEnd, 3),
50
+ _lng = _this$options$positio2[0],
51
+ _lat = _this$options$positio2[1],
52
+ _alt = _this$options$positio2[2];
52
53
  this._viewPositionEndC3 = utils.lngLatAltToCartesian3(_lng, _lat, _alt || 0);
53
54
  this._viewDistance = Cesium.Cartesian3.distance(this._viewPositionC3, this._viewPositionEndC3);
54
55
  this._viewHeading = getHeading(this._viewPositionC3, this._viewPositionEndC3);
55
56
  this._viewPitch = getPitch(this._viewPositionC3, this._viewPositionEndC3);
56
57
  }
57
- this.add();
58
+ this.create();
58
59
  }
59
60
 
60
61
  // 是否能进行操作
@@ -73,39 +74,44 @@ var ViewshedAnalysis = /*#__PURE__*/function () {
73
74
  return this._mapContext && this._mapContext.getMap();
74
75
  }
75
76
  }, {
76
- key: "add",
77
- value: function add() {
78
- this.createLightCamera();
79
- this.createShadowMap();
80
- this.createPostStage();
81
- this.drawFrustumOutline();
82
- this.drawSketch();
77
+ key: "create",
78
+ value: function create() {
79
+ this._createLightCamera();
80
+ this._createShadowMap();
81
+ this._createPostStage();
82
+ this._drawFrustumOutline();
83
+ this._drawSketch();
83
84
  }
84
85
  }, {
85
86
  key: "update",
86
87
  value: function update() {
87
88
  if (!this._canOperate) return;
88
89
  this.clear();
89
- this.add();
90
+ this.create();
90
91
  }
91
92
 
92
93
  //创建相机
93
94
  }, {
94
- key: "createLightCamera",
95
- value: function createLightCamera() {
95
+ key: "_createLightCamera",
96
+ value: function _createLightCamera() {
96
97
  if (!this._canOperate) return;
97
98
  this.lightCamera = new Cesium.Camera(this.getMap().scene);
98
99
  this.lightCamera.position = this._viewPositionC3;
99
- // if (this.viewPositionEnd) {
100
- // let direction = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.viewPositionEnd, this.viewPosition, new Cesium.Cartesian3()), new Cesium.Cartesian3());
101
- // this.lightCamera.direction = direction; // direction是相机面向的方向
100
+ // if (this._viewPositionEndC3) {
101
+ // this.lightCamera.direction = Cesium.Cartesian3.normalize(
102
+ // Cesium.Cartesian3.subtract(
103
+ // this._viewPositionEndC3,
104
+ // this._viewPositionC3,
105
+ // new Cesium.Cartesian3(),
106
+ // ),
107
+ // new Cesium.Cartesian3(),
108
+ // ); // direction是相机面向的方向
102
109
  // }
103
110
  this.lightCamera.frustum.near = this._viewDistance * 0.001;
104
111
  this.lightCamera.frustum.far = this._viewDistance;
105
112
  var hr = Cesium.Math.toRadians(this.options.horizontalViewAngle);
106
113
  var vr = Cesium.Math.toRadians(this.options.verticalViewAngle);
107
- var aspectRatio = this._viewDistance * Math.tan(hr / 2) * 2 / (this._viewDistance * Math.tan(vr / 2) * 2);
108
- this.lightCamera.frustum.aspectRatio = aspectRatio;
114
+ this.lightCamera.frustum.aspectRatio = this._viewDistance * Math.tan(hr / 2) * 2 / (this._viewDistance * Math.tan(vr / 2) * 2);
109
115
  if (hr > vr) {
110
116
  this.lightCamera.frustum.fov = hr;
111
117
  } else {
@@ -123,8 +129,8 @@ var ViewshedAnalysis = /*#__PURE__*/function () {
123
129
 
124
130
  //创建阴影贴图
125
131
  }, {
126
- key: "createShadowMap",
127
- value: function createShadowMap() {
132
+ key: "_createShadowMap",
133
+ value: function _createShadowMap() {
128
134
  if (!this._canOperate) return;
129
135
  // 启用地形阴影
130
136
  this.getMap().scene.globe.shadows = Cesium.ShadowMode.ENABLED;
@@ -137,16 +143,18 @@ var ViewshedAnalysis = /*#__PURE__*/function () {
137
143
  cascadesEnabled: false,
138
144
  size: this.options.size,
139
145
  softShadows: this.options.softShadows,
140
- normalOffset: false
146
+ normalOffset: false,
147
+ // @ts-ignore
148
+ fromLightSource: false,
149
+ fadingEnabled: false
141
150
  });
142
151
  this.getMap().scene.shadowMap = this.shadowMap;
143
152
  }
144
153
 
145
154
  //创建PostStage
146
- // --- Replace existing createPostStage() body with this ---
147
155
  }, {
148
- key: "createPostStage",
149
- value: function createPostStage() {
156
+ key: "_createPostStage",
157
+ value: function _createPostStage() {
150
158
  var _this = this;
151
159
  if (!this._canOperate()) return;
152
160
  var fs = "\n #ifdef GL_ES\n precision highp float;\n #endif\n\n #define USE_CUBE_MAP_SHADOW true\n\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n\n uniform mat4 camera_projection_matrix;\n uniform mat4 camera_view_matrix;\n uniform samplerCube shadowMap_textureCube;\n uniform mat4 shadowMap_matrix;\n uniform vec4 shadowMap_lightPositionEC;\n uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;\n uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;\n uniform float helsing_viewDistance;\n uniform vec4 helsing_visibleAreaColor;\n uniform vec4 helsing_invisibleAreaColor;\n\n out vec4 fragColor;\n\n struct zx_shadowParameters {\n vec3 texCoords;\n float depthBias;\n float depth;\n float nDotL;\n vec2 texelStepSize;\n float normalShadingSmooth;\n float darkness;\n };\n\n float czm_shadowVisibility(samplerCube shadowMap, zx_shadowParameters shadowParameters) {\n float depthBias = shadowParameters.depthBias;\n float depth = shadowParameters.depth;\n float nDotL = shadowParameters.nDotL;\n float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n float darkness = shadowParameters.darkness;\n vec3 uvw = shadowParameters.texCoords;\n depth -= depthBias;\n float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\n return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n }\n\n vec4 getPositionEC(){\n return czm_windowToEyeCoordinates(gl_FragCoord);\n }\n\n vec3 getNormalEC(){\n return vec3(1.0);\n }\n\n vec4 toEye( vec2 uv, float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0), (uv.y * 2.0 - 1.0));\n vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera = posInCamera / posInCamera.w;\n return posInCamera;\n }\n\n vec3 pointProjectOnPlane( vec3 planeNormal, vec3 planeOrigin, vec3 point ){\n vec3 v01 = point - planeOrigin;\n float d = dot(planeNormal, v01);\n return (point - planeNormal * d);\n }\n\n float getDepth( vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n\n float shadow( vec4 positionEC ){\n vec3 normalEC = getNormalEC();\n zx_shadowParameters shadowParameters;\n shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;\n shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;\n shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;\n shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;\n vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz;\n float distance = length(directionEC);\n directionEC = normalize(directionEC);\n float radius = shadowMap_lightPositionEC.w;\n if (distance > radius) {\n return 2.0;\n }\n vec3 directionWC = czm_inverseViewRotation * directionEC;\n shadowParameters.depth = distance / radius - 0.0003;\n shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);\n shadowParameters.texCoords = directionWC;\n float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters);\n return visibility;\n }\n\n bool visible( vec4 result ) {\n vec4 r = result / result.w;\n return r.x >= -1.0 && r.x <= 1.0 &&\n r.y >= -1.0 && r.y <= 1.0 &&\n r.z >= -1.0 && r.z <= 1.0;\n }\n\n void main() {\n // base color from the color texture\n vec4 baseColor = texture(colorTexture, v_textureCoordinates);\n\n // fetch depth and convert\n float depth = getDepth(texture(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec4 worldPos = czm_inverseView * viewPos;\n vec4 vcPos = camera_view_matrix * worldPos;\n\n float near = 0.001 * helsing_viewDistance;\n float dis = length(vcPos.xyz);\n\n fragColor = baseColor;\n\n if (dis > near && dis < helsing_viewDistance) {\n vec4 posInEye = camera_projection_matrix * vcPos;\n if (visible(posInEye)) {\n float vis = shadow(viewPos);\n if (vis > 0.3) {\n fragColor = mix(fragColor, helsing_visibleAreaColor, 0.5);\n } else {\n fragColor = mix(fragColor, helsing_invisibleAreaColor, 0.5);\n }\n }\n }\n }\n ";
@@ -193,83 +201,61 @@ var ViewshedAnalysis = /*#__PURE__*/function () {
193
201
 
194
202
  //创建视锥线
195
203
  }, {
196
- key: "drawFrustumOutline",
197
- value: function drawFrustumOutline() {
204
+ key: "_drawFrustumOutline",
205
+ value: function _drawFrustumOutline() {
198
206
  if (!this._canOperate) return;
199
- var scratchRight = new Cesium.Cartesian3();
200
- var scratchRotation = new Cesium.Matrix3();
201
- var scratchOrientation = new Cesium.Quaternion();
202
- // const position = this.lightCamera.positionWC;
203
- var direction = this.lightCamera.directionWC;
204
- var up = this.lightCamera.upWC;
205
- var right = this.lightCamera.rightWC;
206
- right = Cesium.Cartesian3.negate(right, scratchRight);
207
- var rotation = scratchRotation;
208
- Cesium.Matrix3.setColumn(rotation, 0, right, rotation);
209
- Cesium.Matrix3.setColumn(rotation, 1, up, rotation);
210
- Cesium.Matrix3.setColumn(rotation, 2, direction, rotation);
211
- var orientation = Cesium.Quaternion.fromRotationMatrix(rotation, scratchOrientation);
212
- var instance = new Cesium.GeometryInstance({
213
- geometry: new Cesium.FrustumOutlineGeometry({
214
- frustum: this.lightCamera.frustum,
215
- origin: this._viewPositionC3,
216
- orientation: orientation
217
- }),
218
- attributes: {
219
- color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOWGREEN //new Cesium.Color(0.0, 1.0, 0.0, 1.0)
220
- ),
221
- show: new Cesium.ShowGeometryInstanceAttribute(true)
222
- }
207
+ this.frustumCamera = new FrustumWithCamera(this.getMap(), {
208
+ position: this.options.position,
209
+ fill: false,
210
+ outlineColor: this.options.outlineColor,
211
+ camera: this.lightCamera
223
212
  });
224
- this.frustumOutline = this.getMap().scene.primitives.add(new Cesium.Primitive({
225
- geometryInstances: [instance],
226
- appearance: new Cesium.PerInstanceColorAppearance({
227
- flat: true,
228
- translucent: false
229
- })
230
- }));
231
213
  }
232
214
 
233
215
  //创建视网
234
216
  }, {
235
- key: "drawSketch",
236
- value: function drawSketch() {
217
+ key: "_drawSketch",
218
+ value: function _drawSketch() {
237
219
  if (!this._canOperate) return;
238
- this.sketch = this.getMap().entities.add({
239
- name: 'sketch',
240
- position: this._viewPositionC3,
241
- orientation: Cesium.Transforms.headingPitchRollQuaternion(this._viewPositionC3, Cesium.HeadingPitchRoll.fromDegrees(this._viewHeading - this.options.horizontalViewAngle, this._viewPitch, 0.0)),
242
- ellipsoid: {
243
- radii: new Cesium.Cartesian3(this._viewDistance, this._viewDistance, this._viewDistance),
244
- // innerRadii: new Cesium.Cartesian3(2.0, 2.0, 2.0),
245
- minimumClock: Cesium.Math.toRadians(-this.options.horizontalViewAngle / 2),
246
- maximumClock: Cesium.Math.toRadians(this.options.horizontalViewAngle / 2),
247
- minimumCone: Cesium.Math.toRadians(this.options.verticalViewAngle + 7.75),
248
- maximumCone: Cesium.Math.toRadians(180 - this.options.verticalViewAngle - 7.75),
220
+ this.sketchLayer = this.getMap().addGraphicLayer({
221
+ type: 'Feature',
222
+ geometry: {
223
+ type: 'Point',
224
+ coordinates: this.options.position
225
+ }
226
+ }, {
227
+ type: 'ellipsoid',
228
+ style: {
229
+ radii: [this._viewDistance, this._viewDistance, this._viewDistance],
230
+ minimumClock: -this.options.horizontalViewAngle / 2,
231
+ maximumClock: this.options.horizontalViewAngle / 2,
232
+ minimumCone: this.options.verticalViewAngle + 7.75,
233
+ maximumCone: 180 - this.options.verticalViewAngle - 7.75,
249
234
  fill: false,
250
235
  outline: true,
251
236
  subdivisions: 256,
252
237
  stackPartitions: 64,
253
238
  slicePartitions: 64,
254
- outlineColor: Cesium.Color.YELLOWGREEN
239
+ outlineColor: this.options.outlineColor
255
240
  }
256
241
  });
242
+ this.sketchLayer.layers[0].entity.orientation = Cesium.Transforms.headingPitchRollQuaternion(this._viewPositionC3, Cesium.HeadingPitchRoll.fromDegrees(this._viewHeading - this.options.horizontalViewAngle, this._viewPitch, 0.0));
257
243
  }
258
244
  }, {
259
245
  key: "clear",
260
246
  value: function clear() {
261
247
  if (!this._canOperate) return;
262
- if (this.frustumOutline) {
263
- this.frustumOutline.destroy();
264
- this.frustumOutline = null;
248
+ if (this.frustumCamera) {
249
+ this.frustumCamera.destroy();
250
+ this.frustumCamera = null;
265
251
  }
266
252
  if (this.postStage) {
267
253
  this.getMap().scene.postProcessStages.remove(this.postStage);
268
254
  this.postStage = null;
269
255
  }
270
- if (this.sketch) {
271
- this.getMap().entities.remove(this.sketch);
272
- this.sketch = null;
256
+ if (this.sketchLayer) {
257
+ this.sketchLayer.remove();
258
+ this.sketchLayer = null;
273
259
  }
274
260
  }
275
261
  }, {
@@ -110,7 +110,7 @@ export declare const DEFAULT_POINT_CLUSTER_STYLE: () => {
110
110
  enabled: boolean;
111
111
  colorArr: never[];
112
112
  };
113
- export declare const DEFAULT_AIRSPACE_STYLE: () => {
113
+ export declare const DEFAULT_GRID_STYLE: () => {
114
114
  show: boolean;
115
115
  chunkSize: number;
116
116
  dimensions: number[];
@@ -131,6 +131,43 @@ export declare const DEFAULT_VIDEO_TEXTURE_HLS: () => {
131
131
  width: number;
132
132
  height: number;
133
133
  };
134
+ export declare const DEFAULT_GRID_VT_OPTIONS: () => {
135
+ cacheSize: number;
136
+ dataZooms: number[];
137
+ zooms: number[];
138
+ minHeight: number;
139
+ maxHeight: number;
140
+ heightColors: string[];
141
+ };
142
+ export declare const DEFAULT_FLIGHT_PLANNING_OPTIONS: () => {
143
+ isDraw: boolean;
144
+ GRID_HEIGHT_PER_LAYER: number;
145
+ DEFAULT_LATITUDE: number;
146
+ DEFAULT_GRID_LEVEL: number;
147
+ COLOR_GROUP_SIZE: number;
148
+ GRID_ALPHA: number;
149
+ GRID_SIZES: number[][];
150
+ HEIGHT_COLORS: string[];
151
+ DEFAULT_GRID_COLOR: string;
152
+ TYPE_COLOR_MAP: {
153
+ START: string;
154
+ END: string;
155
+ WAYPOINT: string;
156
+ HOLD: string;
157
+ NORMAL: string;
158
+ TASKSTART: string;
159
+ TASKEND: string;
160
+ };
161
+ TYPE_LABEL_MAP: {
162
+ START: string;
163
+ END: string;
164
+ WAYPOINT: string;
165
+ NORMAL: string;
166
+ HOLD: string;
167
+ TASKSTART: string;
168
+ TASKEND: string;
169
+ };
170
+ };
134
171
  export declare const DEFAULT_SUBMERGENCE_ANALYSIS_OPTIONS: () => {
135
172
  startHeight: number;
136
173
  targetHeight: number;
@@ -147,15 +184,16 @@ export declare const DEFAULT_SUN_ANALYSIS_OPTIONS: () => {
147
184
  clockStep: Cesium.ClockStep;
148
185
  };
149
186
  export declare const DEFAULT_VIEWSHED_ANALYSIS_OPTIONS: () => {
150
- viewPosition: null;
151
- viewPositionEnd: null;
152
- viewDistance: number;
153
- viewHeading: number;
154
- viewPitch: number;
187
+ position: null;
188
+ positionEnd: null;
189
+ distance: number;
190
+ heading: number;
191
+ pitch: number;
155
192
  horizontalViewAngle: number;
156
193
  verticalViewAngle: number;
157
194
  visibleAreaColor: Cesium.Color;
158
195
  invisibleAreaColor: Cesium.Color;
196
+ outlineColor: Cesium.Color;
159
197
  enabled: boolean;
160
198
  softShadows: boolean;
161
199
  size: number;
@@ -172,8 +172,8 @@ export var DEFAULT_POINT_CLUSTER_STYLE = function DEFAULT_POINT_CLUSTER_STYLE()
172
172
  };
173
173
  };
174
174
 
175
- // 默认的空域样式
176
- export var DEFAULT_AIRSPACE_STYLE = function DEFAULT_AIRSPACE_STYLE() {
175
+ // 默认的网格样式
176
+ export var DEFAULT_GRID_STYLE = function DEFAULT_GRID_STYLE() {
177
177
  return {
178
178
  show: true,
179
179
  chunkSize: 10000,
@@ -205,6 +205,82 @@ export var DEFAULT_VIDEO_TEXTURE_HLS = function DEFAULT_VIDEO_TEXTURE_HLS() {
205
205
  };
206
206
  };
207
207
 
208
+ // 默认GridVT属性
209
+ export var DEFAULT_GRID_VT_OPTIONS = function DEFAULT_GRID_VT_OPTIONS() {
210
+ return {
211
+ cacheSize: 20,
212
+ dataZooms: [16, 16],
213
+ zooms: [10, 22],
214
+ minHeight: 0,
215
+ maxHeight: Infinity,
216
+ heightColors: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'].reverse()
217
+ };
218
+ };
219
+
220
+ // 默认航线规划配置选项
221
+ export var DEFAULT_FLIGHT_PLANNING_OPTIONS = function DEFAULT_FLIGHT_PLANNING_OPTIONS() {
222
+ return {
223
+ isDraw: true,
224
+ // 是否绘制
225
+ GRID_HEIGHT_PER_LAYER: 7.66,
226
+ // 每层高度(米)
227
+ DEFAULT_LATITUDE: 22.7,
228
+ // 默认纬度
229
+ DEFAULT_GRID_LEVEL: 11,
230
+ // 默认网格级别
231
+ COLOR_GROUP_SIZE: 3,
232
+ // 每几层使用一种颜色
233
+ GRID_ALPHA: 0.6,
234
+ // 网格透明度
235
+ GRID_SIZES: [[0, 0], [21600, 14400], [10800, 7200], [1800, 1800], [900, 600], [300, 300], [60, 60], [12, 12], [4, 4], [2, 2], [1, 1], [0.5, 0.5], [0.25, 0.25], [0.125, 0.125], [0.0625, 0.0625], [0.03125, 0.03125], [0.015625, 0.015625]],
236
+ // 不同级别的网格的地理尺寸,单位:秒,数组的一级索引对应网格级别
237
+ HEIGHT_COLORS: ['#9e0142',
238
+ // 深红色
239
+ '#d53e4f',
240
+ // 红色
241
+ '#f46d43',
242
+ // 橙红色
243
+ '#fdae61',
244
+ // 橙色
245
+ '#fee08b',
246
+ // 黄色
247
+ '#ffffbf',
248
+ // 浅黄色
249
+ '#e6f598',
250
+ // 浅绿色
251
+ '#abdda4',
252
+ // 绿色
253
+ '#66c2a5',
254
+ // 青绿色
255
+ '#3288bd',
256
+ // 蓝色
257
+ '#5e4fa2' // 紫色(最高层)
258
+ ],
259
+ // 网格颜色
260
+ DEFAULT_GRID_COLOR: '#d8daeb',
261
+ // 默认网格颜色
262
+ TYPE_COLOR_MAP: {
263
+ START: '#00ff00',
264
+ END: '#ff0000',
265
+ WAYPOINT: '#ffa500',
266
+ HOLD: '#ffff00',
267
+ NORMAL: '#ffffff',
268
+ TASKSTART: '#87ceeb',
269
+ TASKEND: '#ff00ff'
270
+ },
271
+ // 点位颜色
272
+ TYPE_LABEL_MAP: {
273
+ START: '起点',
274
+ END: '终点',
275
+ WAYPOINT: '途经点',
276
+ NORMAL: '航迹点',
277
+ HOLD: '悬停点',
278
+ TASKSTART: '任务起点',
279
+ TASKEND: '任务终点'
280
+ } // 点位名称
281
+ };
282
+ };
283
+
208
284
  // 默认淹没分析配置选项 SubmergenceAnalysis
209
285
  export var DEFAULT_SUBMERGENCE_ANALYSIS_OPTIONS = function DEFAULT_SUBMERGENCE_ANALYSIS_OPTIONS() {
210
286
  return {
@@ -236,15 +312,15 @@ export var DEFAULT_SUN_ANALYSIS_OPTIONS = function DEFAULT_SUN_ANALYSIS_OPTIONS(
236
312
  // 默认可视域分析
237
313
  export var DEFAULT_VIEWSHED_ANALYSIS_OPTIONS = function DEFAULT_VIEWSHED_ANALYSIS_OPTIONS() {
238
314
  return {
239
- viewPosition: null,
315
+ position: null,
240
316
  // 观测点位置
241
- viewPositionEnd: null,
317
+ positionEnd: null,
242
318
  // 最远观测点位置 (如果设置了观测距离,这个属性可以不设置
243
- viewDistance: 100,
319
+ distance: 100,
244
320
  // 观测距离
245
- viewHeading: 0.0,
321
+ heading: 0.0,
246
322
  // 航向角
247
- viewPitch: 0.0,
323
+ pitch: 0.0,
248
324
  // 俯仰角
249
325
  horizontalViewAngle: 90.0,
250
326
  // 可视域水平夹角
@@ -254,6 +330,7 @@ export var DEFAULT_VIEWSHED_ANALYSIS_OPTIONS = function DEFAULT_VIEWSHED_ANALYSI
254
330
  // 可视区域颜色(默认值`绿色`)。
255
331
  invisibleAreaColor: Cesium.Color.RED,
256
332
  // 不可视区域颜色(默认值`红色`)。
333
+ outlineColor: Cesium.Color.YELLOWGREEN,
257
334
  enabled: true,
258
335
  // 阴影贴图是否可用
259
336
  softShadows: true,
@@ -469,6 +546,7 @@ export var DEFAULT_DYNAMIC_WALL_MATERIAL_STYLE = function DEFAULT_DYNAMIC_WALL_M
469
546
  image: utils.getDeepTwinsFile('Image/wall.png')
470
547
  };
471
548
  };
549
+
472
550
  // 水波纹材质默认的配置
473
551
  export var DEFAULT_CIRCLE_WAVE_MATERIAL_STYLE = function DEFAULT_CIRCLE_WAVE_MATERIAL_STYLE() {
474
552
  return {
@@ -478,6 +556,7 @@ export var DEFAULT_CIRCLE_WAVE_MATERIAL_STYLE = function DEFAULT_CIRCLE_WAVE_MAT
478
556
  gradient: 0.1
479
557
  };
480
558
  };
559
+
481
560
  // 发光材质默认的配置
482
561
  export var DEFAULT_GLOW_MATERIAL_STYLE = function DEFAULT_GLOW_MATERIAL_STYLE() {
483
562
  return {
@@ -57,7 +57,8 @@ var DeepTwins = /*#__PURE__*/function () {
57
57
  moduleLayer: this._getModuleLayer.bind(this),
58
58
  trafficHistoryLayer: this._YunJing.TrafficHistoryLayer,
59
59
  trafficLayer: this._YunJing.TrafficLayer,
60
- gridVTLayer: (_this$_YunjingCesiumP = this._YunjingCesiumPlugins) === null || _this$_YunjingCesiumP === void 0 ? void 0 : _this$_YunjingCesiumP.GridVTLayer
60
+ gridVTLayer: (_this$_YunjingCesiumP = this._YunjingCesiumPlugins) === null || _this$_YunjingCesiumP === void 0 ? void 0 : _this$_YunjingCesiumP.GridVTLayer,
61
+ poiLayer: this._YunJing.PoiLayer
61
62
  });
62
63
  }
63
64
  case 15:
@@ -18,7 +18,7 @@ export declare const MULTI_POINT_SHAPE_TYPES: {
18
18
  readonly POLYLINE: "polyline";
19
19
  readonly POLYGON: "polygon";
20
20
  };
21
- export declare const MULTI_POINT_SHAPES: ("polyline" | "polygon")[];
21
+ export declare const MULTI_POINT_SHAPES: ("polygon" | "polyline")[];
22
22
  declare class Drawer implements DrawContext {
23
23
  private readonly _mapContext;
24
24
  private readonly _drawContext;
@@ -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): "wkt" | "sourceId" | "sourceInstance" | "geoJson" | "other";
18
+ static analysisSourceType(data: any): "other" | "wkt" | "sourceId" | "sourceInstance" | "geoJson";
19
19
  static wktToGeoJon(wkt: string): any;
20
20
  static geoJsonToGeoCartesian3Array(geoJson: any): any[];
21
21
  static handleFeaturePoint(feature: any): any;
@@ -32,7 +32,7 @@ export declare class DeepTwinsEngine3D {
32
32
  static PositionProperty: any;
33
33
  static Frustum: any;
34
34
  static FrustumWithCamera: any;
35
- static Airspace: any;
35
+ static GridDraw: any;
36
36
  static VideoTexture: any;
37
37
  static VideoProject: any;
38
38
  static MapEvent: any;
@@ -66,5 +66,8 @@ export declare class DeepTwinsEngine3D {
66
66
  static KmlDataSource: any;
67
67
  static Compass: any;
68
68
  static ViewshedAnalysis: any;
69
+ static VisitLayer: any;
70
+ static PoiLayer: any;
71
+ static FlightPlanning: any;
69
72
  }
70
73
  export default DeepTwinsEngine3D;
package/dist/esm/index.js CHANGED
@@ -19,6 +19,11 @@ import { CAMERA_EVENT_TYPE, DEFAULT_BASE_LAYER_TYPE, LAYER_EVENT_TYPE, SCENE_EVE
19
19
  import DeepTwins from "./deepTwins";
20
20
  import Drawer from "./drawer/index";
21
21
  import "./global.css";
22
+ import BarrierLayer from "./lowAltitude/BarrierLayer";
23
+ import FlightPlanning from "./lowAltitude/FlightPlanning";
24
+ import GridDraw from "./lowAltitude/GridDraw";
25
+ import PoiLayer from "./lowAltitude/PoiLayer";
26
+ import VisitLayer from "./lowAltitude/VisitLayer";
22
27
  import GroundSkyBox from "./map/GroundSkyBox";
23
28
  import Map from "./map/Map";
24
29
  import VolumeCloud from "./material/VolumeCloud";
@@ -32,7 +37,6 @@ import ImageGlowingMaterialAppearance from "./material/primitive/ImageGlowingMat
32
37
  import Measure from "./measure";
33
38
  import PositionProperty from "./property/PositionProperty";
34
39
  import ArcGisLayer from "./tileLayer/ArcGisLayer";
35
- import BarrierLayer from "./tileLayer/BarrierLayer";
36
40
  import RasterLayer from "./tileLayer/RasterLayer";
37
41
  import WmsLayer from "./tileLayer/WmsLayer";
38
42
  import WmtsLayer from "./tileLayer/WmtsLayer";
@@ -42,7 +46,6 @@ import { ClampToGround, ShapeSection } from "./tool/common";
42
46
  import { loadCss } from "./tool/utils";
43
47
  import VideoProject from "./videoFusion/VideoProject";
44
48
  import VideoTexture from "./videoFusion/VideoTexture";
45
- import Airspace from "./visualization/Airspace";
46
49
  import Frustum from "./visualization/Frustum";
47
50
  import FrustumWithCamera from "./visualization/FrustumWithCamera";
48
51
  import Heatmap2d from "./visualization/Heatmap2d";
@@ -54,11 +57,11 @@ DEEP_TWINS_BASE_URL && (window.CESIUM_BASE_URL = DEEP_TWINS_BASE_URL);
54
57
  // 全局加载css
55
58
  loadCss(Cesium.buildModuleUrl('Widgets/widgets.css'));
56
59
  // 打印版本信息
57
- console.log('DeepTwinsEngine3D Version:', "0.1.42");
60
+ console.log('DeepTwinsEngine3D Version:', "0.1.43");
58
61
  export var DeepTwinsEngine3D = /*#__PURE__*/_createClass(function DeepTwinsEngine3D() {
59
62
  _classCallCheck(this, DeepTwinsEngine3D);
60
63
  });
61
- _defineProperty(DeepTwinsEngine3D, "Version", "0.1.42");
64
+ _defineProperty(DeepTwinsEngine3D, "Version", "0.1.43");
62
65
  _defineProperty(DeepTwinsEngine3D, "Map", Map);
63
66
  _defineProperty(DeepTwinsEngine3D, "GroundSkyBox", GroundSkyBox);
64
67
  _defineProperty(DeepTwinsEngine3D, "RasterLayer", RasterLayer);
@@ -90,7 +93,7 @@ _defineProperty(DeepTwinsEngine3D, "PointCluster", PointCluster);
90
93
  _defineProperty(DeepTwinsEngine3D, "PositionProperty", PositionProperty);
91
94
  _defineProperty(DeepTwinsEngine3D, "Frustum", Frustum);
92
95
  _defineProperty(DeepTwinsEngine3D, "FrustumWithCamera", FrustumWithCamera);
93
- _defineProperty(DeepTwinsEngine3D, "Airspace", Airspace);
96
+ _defineProperty(DeepTwinsEngine3D, "GridDraw", GridDraw);
94
97
  _defineProperty(DeepTwinsEngine3D, "VideoTexture", VideoTexture);
95
98
  _defineProperty(DeepTwinsEngine3D, "VideoProject", VideoProject);
96
99
  _defineProperty(DeepTwinsEngine3D, "MapEvent", Cesium.ScreenSpaceEventType);
@@ -124,4 +127,7 @@ _defineProperty(DeepTwinsEngine3D, "SunLightAnalysis", SunLightAnalysis);
124
127
  _defineProperty(DeepTwinsEngine3D, "KmlDataSource", Cesium.KmlDataSource);
125
128
  _defineProperty(DeepTwinsEngine3D, "Compass", Compass);
126
129
  _defineProperty(DeepTwinsEngine3D, "ViewshedAnalysis", ViewshedAnalysis);
130
+ _defineProperty(DeepTwinsEngine3D, "VisitLayer", VisitLayer);
131
+ _defineProperty(DeepTwinsEngine3D, "PoiLayer", PoiLayer);
132
+ _defineProperty(DeepTwinsEngine3D, "FlightPlanning", FlightPlanning);
127
133
  export default DeepTwinsEngine3D;
@@ -0,0 +1,29 @@
1
+ import BaseGridMvtLayer from './BaseGridMvtLayer';
2
+ /**
3
+ * 障碍物图层 - 基于MVT数据渲染障碍物网格
4
+ */
5
+ declare class BarrierLayer extends BaseGridMvtLayer {
6
+ constructor(map: any, options?: any);
7
+ /**
8
+ * 创建primitives
9
+ * 按照示例代码的逻辑实现,每个feature创建一个障碍物实例
10
+ */
11
+ private _createPrimitives;
12
+ /**
13
+ * 销毁primitives
14
+ */
15
+ private _destroyPrimitives;
16
+ /**
17
+ * 显示primitives
18
+ */
19
+ private _showPrimitives;
20
+ /**
21
+ * 隐藏primitives
22
+ */
23
+ private _hidePrimitives;
24
+ /**
25
+ * 更新primitives
26
+ */
27
+ private _updatePrimitives;
28
+ }
29
+ export default BarrierLayer;