@kq_npm/client3d_webgl_vue 4.5.56 → 4.5.57

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 (73) hide show
  1. package/adddata/index.js +189 -21
  2. package/airspacegridoccupancyquery/index.js +108 -7
  3. package/airspaceprofileanalysis/index.js +99 -7
  4. package/aspectanalysis/index.js +25 -7
  5. package/baseterraingallery/index.js +16 -4
  6. package/boxclip/index.js +58 -16
  7. package/buildpointmodel/index.js +3441 -544
  8. package/buildpointmodel/style/buildpointmodel.css +1 -1
  9. package/buildpolygonmodel/index.js +205 -81
  10. package/buildpolylinemodel/index.js +346 -70
  11. package/clientPrint/index.js +10524 -3041
  12. package/comparemap/index.js +132 -60
  13. package/compass/index.js +16 -6
  14. package/excavatefillanalysis/index.js +51 -7
  15. package/fixedzoomin/index.js +24 -7
  16. package/fixedzoomout/index.js +25 -7
  17. package/flight/index.js +113 -26
  18. package/floodanalysis/index.js +79 -14
  19. package/geologicalbodyanalysis/index.js +41 -5
  20. package/gpuspatialquery/index.js +59 -11
  21. package/gridoccupancyquery/index.js +78 -12
  22. package/hawkeye/index.js +20 -2
  23. package/headertemp/index.js +7 -2
  24. package/heatmap3d/index.js +282 -158
  25. package/index.js +10524 -3041
  26. package/isolineanalysis/index.js +113 -38
  27. package/light/index.js +80 -22
  28. package/limitheightanalysis/index.js +30 -10
  29. package/lowaltitudefeature/index.js +292 -119
  30. package/measure/index.js +60 -19
  31. package/modelFlat/index.js +48 -8
  32. package/modeledit/index.js +38 -4
  33. package/modelexcavate/index.js +48 -7
  34. package/modelfilter/index.js +51 -8
  35. package/modelmaterialedit/index.js +127 -25
  36. package/modelprofileanalysis/index.js +50 -14
  37. package/modelselect/index.js +33 -3
  38. package/modelstyleedit/index.js +39 -3
  39. package/modeltransform/index.js +79 -14
  40. package/package.json +1 -1
  41. package/particleeffect/index.js +83 -17
  42. package/planeclip/index.js +66 -17
  43. package/pointcloudrender/index.js +134 -15
  44. package/radarscananalysis/index.js +35 -3
  45. package/resetview/index.js +14 -6
  46. package/roller/index.js +55 -18
  47. package/scaneffect/index.js +98 -29
  48. package/sceneadvancedtoimage/index.js +32 -6
  49. package/sceneapp/index.js +10524 -3041
  50. package/sceneset/index.js +141 -71
  51. package/scenetohdimage/index.js +23 -3
  52. package/sceneview/index.js +10524 -3041
  53. package/screenshot/index.js +44 -11
  54. package/shadowanalysis/index.js +79 -19
  55. package/sightlineanalysis/index.js +66 -15
  56. package/skylineanalysis/index.js +20 -4
  57. package/slopeanalysis/index.js +75 -16
  58. package/slopeaspectanalysis/index.js +128 -26
  59. package/statusbar/index.js +80 -67
  60. package/style.css +1 -1
  61. package/terrainoperation/index.js +39 -7
  62. package/terrainprofileanalysis/index.js +43 -5
  63. package/toolbarapp/index.js +10524 -3041
  64. package/toolboxapp/index.js +10524 -3041
  65. package/typhoontrac/index.js +134 -16
  66. package/underground/index.js +8 -2
  67. package/videofusion/index.js +86 -30
  68. package/videoproject/index.js +77 -23
  69. package/viewshedanalysis/index.js +58 -13
  70. package/weathereffect/index.js +73 -18
  71. package/webgl.es.js +263 -264
  72. package/windyslicing/index.js +233 -45
  73. package/wireframesketch/index.js +25 -8
@@ -87,19 +87,23 @@ const __default__ = {
87
87
  var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
88
88
  props: {
89
89
  mapTarget: String,
90
+ // 关联的地图目标 id
90
91
  settingParams: {
91
92
  type: Object,
92
93
  default: () => ({})
93
- }
94
+ } // 组件配置参数
94
95
  },
95
96
  setup(__props, {
96
97
  expose: __expose
97
98
  }) {
98
99
  const {
99
100
  locale
100
- } = (0, _useGlobalConfig.useLocale)();
101
+ } = (0, _useGlobalConfig.useLocale)(); // 当前语言包
102
+
101
103
  const props = __props;
102
- let viewModel = null;
104
+ let viewModel = null; // 视图模型实例
105
+
106
+ // 组件挂载时获取场景视图并初始化视图模型
103
107
  (0, _vue.onMounted)(() => {
104
108
  _gisUtils.utils.getWebMap(props.mapTarget, scenceView => {
105
109
  if (scenceView) {
@@ -111,9 +115,13 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
111
115
  }
112
116
  });
113
117
  });
118
+
119
+ // 触发查询,启动绘制
114
120
  function startQuery() {
115
121
  viewModel && viewModel.start();
116
122
  }
123
+
124
+ // 组件卸载前销毁视图模型释放资源
117
125
  (0, _vue.onBeforeUnmount)(() => {
118
126
  viewModel && viewModel.destroy();
119
127
  });
@@ -172,19 +180,34 @@ var _message = _interopRequireDefault(__webpack_require__(71323));
172
180
  var _loading = _interopRequireDefault(__webpack_require__(90724));
173
181
  var _useGlobalConfig = __webpack_require__(22686);
174
182
  class GridOccupancyQueryViewModel {
183
+ // 加载 loading 实例
184
+
185
+ /** @description 构造函数,初始化视图模型
186
+ * @param {Object} scenceView 场景视图对象,包含 viewer、drawManager 等
187
+ * @param {Object} options 配置项,包含 queryUrl、calcLevel、isMulti 等
188
+ */
175
189
  constructor(scenceView, options) {
176
190
  this._viewer = null;
191
+ // Cesium Viewer 实例
177
192
  this._mapTarget = null;
193
+ // 地图容器 DOM id
178
194
  this._options = {};
195
+ // 外部传入的合并后配置项
179
196
  this._defaultOptions = {
180
197
  queryUrl: "",
198
+ // 网格占用查询服务地址
181
199
  calcLevel: 23,
182
- isMulti: false
200
+ // 计算层级
201
+ isMulti: false // 是否支持多次绘制查询
183
202
  };
184
203
  this._drawManager = null;
204
+ // 绘制管理器实例
185
205
  this._language = null;
206
+ // 当前语言包
186
207
  this._htmlTag = null;
208
+ // 拖拽 HTML 标签实例
187
209
  this._clickGirdPrimitive = null;
210
+ // 网格几何图元实例
188
211
  this._loading = null;
189
212
  const {
190
213
  locale
@@ -194,13 +217,16 @@ class GridOccupancyQueryViewModel {
194
217
  this._viewer = scenceView._viewer;
195
218
  this._drawManager = scenceView._drawManager;
196
219
  this._mapTarget = scenceView._viewerId || null;
197
- this._viewer.resolutionScale = 1;
198
- this._viewer.postProcessStages.fxaa.enabled = true;
199
- this._viewer.scene.logarithmicDepthBuffer = true;
220
+ this._viewer.resolutionScale = 1; // 设置渲染分辨率为 1
221
+ this._viewer.postProcessStages.fxaa.enabled = true; // 开启抗锯齿
222
+ this._viewer.scene.logarithmicDepthBuffer = true; // 启用对数深度缓冲,避免 z-fighting
200
223
  }
224
+
225
+ // 启动网格占用查询,进入标绘模式
201
226
  start() {
202
227
  const that = this;
203
228
  const queryUrl = this._options.queryUrl || "";
229
+ // 查询服务地址为空时给出提示并终止
204
230
  if (!queryUrl.trim()) {
205
231
  (0, _message.default)({
206
232
  message: that._language.value.webgl["gridOccupancyQueryUrlEmpty"] || "请配置查询服务地址",
@@ -210,33 +236,43 @@ class GridOccupancyQueryViewModel {
210
236
  }
211
237
  this.removeData();
212
238
  if (!this._drawManager) return;
239
+ // 调用绘制管理器进入标点绘制模式
213
240
  this._drawManager.startDraw("marker", {
214
241
  image: null
215
242
  }, (feature, {
216
243
  shape
217
244
  }) => {
245
+ // 仅处理本组件绘制组的图形
218
246
  if (!shape || !shape.groupName || shape.groupName !== "GridOccupancyQueryDraw") return;
219
247
  that.showGridOccupancyQuery(shape._position);
220
248
  that._drawManager.clearDrawGroup("GridOccupancyQueryDraw");
221
249
  }, "GridOccupancyQueryDraw", that._options.isMulti);
222
250
  }
251
+
252
+ /** @description 根据点击位置发起网格占用查询并渲染结果
253
+ * @param {Cesium.Cartesian3} position 点击位置的笛卡尔坐标
254
+ */
223
255
  showGridOccupancyQuery(position) {
224
256
  this.removeData();
225
257
  const that = this;
226
258
  const queryUrl = this._options.queryUrl || "";
227
259
  const level = this._options.calcLevel || 23;
260
+ // 将笛卡尔坐标转换为经纬度地理坐标
228
261
  const cartographic = Cesium.Cartographic.fromCartesian(position);
229
262
  const lon = Cesium.Math.toDegrees(cartographic.longitude);
230
263
  const lat = Cesium.Math.toDegrees(cartographic.latitude);
231
264
  const height = cartographic.height;
232
265
  const url = `${queryUrl}/airspaceOccupyPosition?lon=${lon}&lat=${lat}&height=${height}&level=${level}`;
233
266
  this._showLoading();
267
+
268
+ // 发起查询请求
234
269
  fetch(url, {
235
270
  method: "POST"
236
271
  }).then(response => {
237
272
  if (!response.ok) throw new Error("Network response was not ok");
238
273
  return response.json();
239
274
  }).then(data => {
275
+ // 请求成功且包含网格编码时渲染结果
240
276
  if (data.code === 200 && data.content && data.content.code) {
241
277
  const instanc = that.getGridInstanc(data.content.code);
242
278
  if (instanc) {
@@ -255,13 +291,21 @@ class GridOccupancyQueryViewModel {
255
291
  });
256
292
  });
257
293
  }
294
+
295
+ /** @description 渲染网格几何图元及信息浮窗
296
+ * @param {Cesium.GeometryInstance} instanc 网格几何实例
297
+ * @param {Object} content 查询返回的内容,包含 code、types 等
298
+ * @param {Cesium.Cartesian3} position 标绘点笛卡尔坐标
299
+ */
258
300
  renderGrid(instanc, content, position) {
259
301
  const that = this;
302
+ // 已存在图元时复用并更新几何实例
260
303
  if (that._clickGirdPrimitive) {
261
304
  that._clickGirdPrimitive.geometryInstances = instanc;
262
305
  that._clickGirdPrimitive._state = Cesium.PrimitiveState.READY;
263
306
  that._clickGirdPrimitive.updateVertex = true;
264
307
  } else {
308
+ // 首次渲染时创建带半透明红色材质的 Primitive
265
309
  that._clickGirdPrimitive = that._viewer.scene.primitives.add(new Cesium.Primitive({
266
310
  geometryInstances: instanc,
267
311
  appearance: new Cesium.MaterialAppearance({
@@ -286,8 +330,10 @@ class GridOccupancyQueryViewModel {
286
330
  }));
287
331
  }
288
332
  const code = content.code || "";
289
- const gridcode = code.substring(0, (code.length + 1) / 2);
290
- const type = (content.types || []).map(item => item.description).join(",");
333
+ const gridcode = code.substring(0, (code.length + 1) / 2); // 截取前半段作为网格编码
334
+ const type = (content.types || []).map(item => item.description).join(","); // 拼接占用类型描述
335
+
336
+ // 创建可拖拽 HTML 信息标签
291
337
  that._htmlTag = new Cesium.Kq3dDragableHtmlTag(that._viewer, {
292
338
  showLine: true,
293
339
  lineStyle: "solid",
@@ -302,6 +348,8 @@ class GridOccupancyQueryViewModel {
302
348
  <div class='attr'>${that._language.value.webgl["occupancyType"]}: ${type}</div>
303
349
  </div>`
304
350
  });
351
+
352
+ // 延迟绑定关闭按钮事件
305
353
  setTimeout(() => {
306
354
  const close = document.querySelector("#grid_info_close");
307
355
  if (close) {
@@ -311,10 +359,17 @@ class GridOccupancyQueryViewModel {
311
359
  }
312
360
  }, 500);
313
361
  }
362
+
363
+ /** @description 根据网格编码构建 Cesium 几何实例
364
+ * @param {String} code 网格编码字符串
365
+ * @returns {Cesium.GeometryInstance|null} 网格几何实例
366
+ */
314
367
  getGridInstanc(code) {
315
368
  const index = (code.length + 1) / 2;
369
+ // 调用 WASM 模块解码网格编码为边界框
316
370
  const grid = Module.decodeGeoSotGBCodeToBox(code.substring(0, index), code.substring(index));
317
371
  if (!grid) return null;
372
+ // 限制经纬度范围在合法区间内
318
373
  grid.minx = Math.max(grid.minx, -180);
319
374
  grid.maxx = Math.min(grid.maxx, 180);
320
375
  grid.miny = Math.max(grid.miny, -90);
@@ -323,6 +378,7 @@ class GridOccupancyQueryViewModel {
323
378
  const minLat = Math.min(grid.miny, grid.maxy);
324
379
  const maxLon = Math.max(grid.minx, grid.maxx);
325
380
  const maxLat = Math.max(grid.miny, grid.maxy);
381
+ // 构建拉伸矩形几何体
326
382
  const rectangle = new Cesium.RectangleGeometry({
327
383
  ellipsoid: Cesium.Ellipsoid.WGS84,
328
384
  rectangle: Cesium.Rectangle.fromDegrees(minLon, minLat, maxLon, maxLat),
@@ -333,6 +389,8 @@ class GridOccupancyQueryViewModel {
333
389
  geometry: rectangle
334
390
  });
335
391
  }
392
+
393
+ // 显示加载中遮罩
336
394
  _showLoading() {
337
395
  this._loading = _loading.default.service({
338
396
  lock: true,
@@ -341,12 +399,16 @@ class GridOccupancyQueryViewModel {
341
399
  target: this._mapTarget ? document.getElementById(this._mapTarget) : null
342
400
  });
343
401
  }
402
+
403
+ // 关闭加载中遮罩
344
404
  _hideLoading() {
345
405
  if (this._loading) {
346
406
  this._loading.close();
347
407
  this._loading = null;
348
408
  }
349
409
  }
410
+
411
+ // 移除已渲染的网格图元与 HTML 标签数据
350
412
  removeData() {
351
413
  if (this._htmlTag) {
352
414
  this._htmlTag.destroy();
@@ -358,12 +420,16 @@ class GridOccupancyQueryViewModel {
358
420
  this._clickGirdPrimitive.updateVertex = true;
359
421
  }
360
422
  }
423
+
424
+ // 清空数据并停止绘制
361
425
  clear() {
362
426
  this.removeData();
363
427
  this._hideLoading();
364
428
  this._drawManager?.stopDraw();
365
429
  this._drawManager?.clearDrawGroup("GridOccupancyQueryDraw");
366
430
  }
431
+
432
+ // 销毁视图模型,释放资源
367
433
  destroy() {
368
434
  this.clear();
369
435
  }
@@ -443,11 +509,11 @@ Object.defineProperty(exports, "__esModule", ({
443
509
  value: true
444
510
  }));
445
511
  exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
446
- let kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
512
+ const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
447
513
  __webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
448
- let kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
514
+ const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
449
515
  __webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
450
- let kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
516
+ const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
451
517
  __webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
452
518
 
453
519
  /***/ })
package/hawkeye/index.js CHANGED
@@ -43,12 +43,20 @@ exports["default"] = void 0;
43
43
  class HawkeyeViewModel {
44
44
  //鹰眼三维对象
45
45
 
46
+ /** @description 构造函数,初始化鹰眼对象
47
+ * @param {Object} scenceView 场景视图对象,包含 viewer 等
48
+ * @param {Object} options 鹰眼配置项,包含 show、width、height、centerColor 等
49
+ */
46
50
  constructor(scenceView, options) {
47
51
  this._overviewMap = null;
48
52
  options.viewer = scenceView._viewer;
49
53
  options.centerRectColor = Cesium.Color.fromCssColorString(options.centerColor || "#0000ff").withAlpha(options.centerColorAlpha || 0.5);
50
54
  this.init(options);
51
55
  }
56
+
57
+ /** @description 初始化鹰眼地图对象
58
+ * @param {Object} options 鹰眼配置项
59
+ */
52
60
  init(options) {
53
61
  // if(!options.layers) {
54
62
  // let layers = [];
@@ -73,7 +81,9 @@ class HawkeyeViewModel {
73
81
  this._overviewMap.show = false;
74
82
  }
75
83
 
76
- // 设置图层
84
+ /** @description 设置图层
85
+ * @param {Array} layers 图层数组
86
+ */
77
87
  setLayers(layers) {
78
88
  if (Array.isArray(layers)) {
79
89
  this._overviewMap._viewer.imageryLayers.removeAll();
@@ -188,7 +198,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
188
198
  setup(__props, {
189
199
  expose: __expose
190
200
  }) {
191
- let viewModel = null;
201
+ let viewModel = null; // 鹰眼视图模型实例
192
202
 
193
203
  // 获取组件传参
194
204
  const props = __props;
@@ -211,12 +221,20 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
211
221
  }
212
222
  });
213
223
  });
224
+
225
+ // 显示鹰眼
214
226
  function show() {
215
227
  viewModel && viewModel.show();
216
228
  }
229
+
230
+ // 隐藏鹰眼
217
231
  function hide() {
218
232
  viewModel && viewModel.hide();
219
233
  }
234
+
235
+ /** @description 设置鹰眼图层
236
+ * @param {Array} layers 图层数组
237
+ */
220
238
  function setLayers(layers) {
221
239
  viewModel && viewModel.setLayers(layers);
222
240
  }
@@ -62,21 +62,25 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
62
62
  setup(__props, {
63
63
  expose: __expose
64
64
  }) {
65
- const proxy = (0, _vue.getCurrentInstance)();
65
+ const proxy = (0, _vue.getCurrentInstance)(); // 当前组件实例代理
66
66
 
67
67
  // 获取组件传参
68
68
  const props = __props;
69
69
 
70
70
  // 图标组件
71
71
  let iconBtn = (0, _vue.ref)(null);
72
- let isCollapse = props.isCollapse;
72
+ let isCollapse = props.isCollapse; // 当前折叠状态
73
+
74
+ // 挂载时初始化图标及父节点样式
73
75
  (0, _vue.onMounted)(() => {
74
76
  iconBtn.value = props.headerTempIcon;
75
77
  let dom = proxy.parent.vnode.el;
78
+ // 非右侧布局时添加左侧展示样式
76
79
  if (!props.isRight) {
77
80
  (0, _util.addClass)(dom, ["kq-is-show", "kq-is-left"]);
78
81
  }
79
82
  if (isCollapse) {
83
+ // 折叠状态样式
80
84
  if (props.showShadow) {
81
85
  (0, _util.addClass)(dom, ["kq-is-hide", "kq-light-shadow"]);
82
86
  (0, _util.removeClass)(dom, ["kq-is-show", "kq-box-shadow"]);
@@ -85,6 +89,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
85
89
  (0, _util.removeClass)(dom, "kq-is-show");
86
90
  }
87
91
  } else {
92
+ // 展开状态样式
88
93
  if (props.showShadow) {
89
94
  (0, _util.removeClass)(dom, ["kq-is-hide", "kq-light-shadow"]);
90
95
  (0, _util.addClass)(dom, ["kq-is-show", "kq-box-shadow"]);