@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.
- package/adddata/index.js +189 -21
- package/airspacegridoccupancyquery/index.js +108 -7
- package/airspaceprofileanalysis/index.js +99 -7
- package/aspectanalysis/index.js +25 -7
- package/baseterraingallery/index.js +16 -4
- package/boxclip/index.js +58 -16
- package/buildpointmodel/index.js +3441 -544
- package/buildpointmodel/style/buildpointmodel.css +1 -1
- package/buildpolygonmodel/index.js +205 -81
- package/buildpolylinemodel/index.js +346 -70
- package/clientPrint/index.js +10524 -3041
- package/comparemap/index.js +132 -60
- package/compass/index.js +16 -6
- package/excavatefillanalysis/index.js +51 -7
- package/fixedzoomin/index.js +24 -7
- package/fixedzoomout/index.js +25 -7
- package/flight/index.js +113 -26
- package/floodanalysis/index.js +79 -14
- package/geologicalbodyanalysis/index.js +41 -5
- package/gpuspatialquery/index.js +59 -11
- package/gridoccupancyquery/index.js +78 -12
- package/hawkeye/index.js +20 -2
- package/headertemp/index.js +7 -2
- package/heatmap3d/index.js +282 -158
- package/index.js +10524 -3041
- package/isolineanalysis/index.js +113 -38
- package/light/index.js +80 -22
- package/limitheightanalysis/index.js +30 -10
- package/lowaltitudefeature/index.js +292 -119
- package/measure/index.js +60 -19
- package/modelFlat/index.js +48 -8
- package/modeledit/index.js +38 -4
- package/modelexcavate/index.js +48 -7
- package/modelfilter/index.js +51 -8
- package/modelmaterialedit/index.js +127 -25
- package/modelprofileanalysis/index.js +50 -14
- package/modelselect/index.js +33 -3
- package/modelstyleedit/index.js +39 -3
- package/modeltransform/index.js +79 -14
- package/package.json +1 -1
- package/particleeffect/index.js +83 -17
- package/planeclip/index.js +66 -17
- package/pointcloudrender/index.js +134 -15
- package/radarscananalysis/index.js +35 -3
- package/resetview/index.js +14 -6
- package/roller/index.js +55 -18
- package/scaneffect/index.js +98 -29
- package/sceneadvancedtoimage/index.js +32 -6
- package/sceneapp/index.js +10524 -3041
- package/sceneset/index.js +141 -71
- package/scenetohdimage/index.js +23 -3
- package/sceneview/index.js +10524 -3041
- package/screenshot/index.js +44 -11
- package/shadowanalysis/index.js +79 -19
- package/sightlineanalysis/index.js +66 -15
- package/skylineanalysis/index.js +20 -4
- package/slopeanalysis/index.js +75 -16
- package/slopeaspectanalysis/index.js +128 -26
- package/statusbar/index.js +80 -67
- package/style.css +1 -1
- package/terrainoperation/index.js +39 -7
- package/terrainprofileanalysis/index.js +43 -5
- package/toolbarapp/index.js +10524 -3041
- package/toolboxapp/index.js +10524 -3041
- package/typhoontrac/index.js +134 -16
- package/underground/index.js +8 -2
- package/videofusion/index.js +86 -30
- package/videoproject/index.js +77 -23
- package/viewshedanalysis/index.js +58 -13
- package/weathereffect/index.js +73 -18
- package/webgl.es.js +263 -264
- package/windyslicing/index.js +233 -45
- package/wireframesketch/index.js +25 -8
package/windyslicing/index.js
CHANGED
|
@@ -187,26 +187,52 @@ const Utils = {
|
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
class WindySlicingViewModel {
|
|
190
|
+
// 当前绘制分组标识
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* @description 构造函数,初始化剖切管理对象及事件处理器
|
|
194
|
+
* @param {Object} scenceView 场景视图对象,包含 _viewer、_layerManager、_drawManager 属性
|
|
195
|
+
* @param {Object} options 剖切配置参数
|
|
196
|
+
* @param {Function} callbackParams 回调函数,用于通知外部状态变化
|
|
197
|
+
*/
|
|
190
198
|
constructor(scenceView, options, callbackParams) {
|
|
191
199
|
// 类属性初始化(更清晰的声明)
|
|
192
200
|
this._viewer = null;
|
|
201
|
+
// 三维viewer对象
|
|
193
202
|
this._layerManager = null;
|
|
203
|
+
// 图层管理器对象
|
|
194
204
|
this._options = null;
|
|
205
|
+
// 剖切配置参数对象
|
|
195
206
|
this._windySlicingDrawManager = null;
|
|
207
|
+
// 绘制管理器对象
|
|
196
208
|
this._windySlicingLayerconfig = null;
|
|
209
|
+
// 气象剖切图层配置
|
|
197
210
|
this._windySlicingPolylineHandler = null;
|
|
211
|
+
// 线绘制屏幕事件处理器
|
|
198
212
|
this._isDrawPolyline = false;
|
|
213
|
+
// 是否正在绘制线
|
|
199
214
|
this._pointSlicingHtmlTag = null;
|
|
215
|
+
// 点剖切HTML标注对象
|
|
200
216
|
this._volumePrimitives = [];
|
|
217
|
+
// 体剖切Primitive集合
|
|
201
218
|
this._volumePrimitive = null;
|
|
219
|
+
// 当前体剖切Primitive
|
|
202
220
|
this._volumePrimitiveVoxels = null;
|
|
221
|
+
// 体素剖切Primitive
|
|
203
222
|
this._currentVolumeOption = null;
|
|
223
|
+
// 当前体剖切配置参数
|
|
204
224
|
this._currentVolumePosition = null;
|
|
225
|
+
// 当前体剖切位置范围
|
|
205
226
|
this._Kq3dWavePrimitive = null;
|
|
227
|
+
// 三维粒子(风场波浪)对象
|
|
206
228
|
this.callbackParams = null;
|
|
229
|
+
// 回调参数函数
|
|
207
230
|
this.volumelines = null;
|
|
231
|
+
// 剖面线数据
|
|
208
232
|
this._language = null;
|
|
233
|
+
// 当前语言对象
|
|
209
234
|
this._groupName = CONSTS.GROUP_NAME;
|
|
235
|
+
// 绘制分组名称
|
|
210
236
|
this._currentGroupName = null;
|
|
211
237
|
const {
|
|
212
238
|
locale
|
|
@@ -232,6 +258,7 @@ class WindySlicingViewModel {
|
|
|
232
258
|
|
|
233
259
|
// 切换剖切模式(逻辑保持,简化条件判断)
|
|
234
260
|
changeSlicingMode() {
|
|
261
|
+
// 根据样式类型映射对应的剖切处理函数
|
|
235
262
|
const modeMap = {
|
|
236
263
|
'1': () => this._currentVolumePosition && this.windySlicingRectangleSlicing(this._currentVolumePosition),
|
|
237
264
|
'2': () => this._currentVolumePosition && this.windySlicingSurfaceSection(this._currentVolumePosition, this._windySlicingLayerconfig),
|
|
@@ -243,7 +270,11 @@ class WindySlicingViewModel {
|
|
|
243
270
|
handler && handler();
|
|
244
271
|
}
|
|
245
272
|
|
|
246
|
-
|
|
273
|
+
/**
|
|
274
|
+
* @description 参数切换(拆分大函数,按功能模块化)
|
|
275
|
+
* @param {String} key 改变的参数类型标识
|
|
276
|
+
* @param {*} val 改变的参数值
|
|
277
|
+
*/
|
|
247
278
|
paramsChanged(key, val) {
|
|
248
279
|
if (!this._windySlicingLayerconfig && this._options.mode !== "clear") {
|
|
249
280
|
this._showWarningTip();
|
|
@@ -276,7 +307,10 @@ class WindySlicingViewModel {
|
|
|
276
307
|
const handler = handlerMap[key];
|
|
277
308
|
handler ? handler() : null;
|
|
278
309
|
}
|
|
279
|
-
|
|
310
|
+
/**
|
|
311
|
+
* @description 处理三维粒子参数
|
|
312
|
+
* @param {String} key 粒子参数类型标识
|
|
313
|
+
*/
|
|
280
314
|
_changParticleParams(key) {
|
|
281
315
|
const that = this;
|
|
282
316
|
// 实例不存在直接退出
|
|
@@ -398,7 +432,12 @@ class WindySlicingViewModel {
|
|
|
398
432
|
});
|
|
399
433
|
}
|
|
400
434
|
|
|
401
|
-
|
|
435
|
+
/**
|
|
436
|
+
* @description 获取接口数据
|
|
437
|
+
* @param {String} var1 风场U方向变量名
|
|
438
|
+
* @param {String} var2 风场V方向变量名
|
|
439
|
+
* @returns {Promise<Array>} 风场数据数组
|
|
440
|
+
*/
|
|
402
441
|
async getKq3dWaveData(var1, var2) {
|
|
403
442
|
if (!this._windySlicingLayerconfig) return [];
|
|
404
443
|
const rect = JSON.stringify(this._currentVolumePosition);
|
|
@@ -463,6 +502,11 @@ class WindySlicingViewModel {
|
|
|
463
502
|
}
|
|
464
503
|
};
|
|
465
504
|
}
|
|
505
|
+
/**
|
|
506
|
+
* @description 将角度矩形转换为弧度矩形
|
|
507
|
+
* @param {Object} degreeRectangle 角度矩形对象,包含 west/south/east/north
|
|
508
|
+
* @returns {Object} 弧度矩形对象
|
|
509
|
+
*/
|
|
466
510
|
degreesToRadiansRectangle(degreeRectangle) {
|
|
467
511
|
return {
|
|
468
512
|
west: Cesium.Math.toRadians(degreeRectangle.west),
|
|
@@ -471,7 +515,12 @@ class WindySlicingViewModel {
|
|
|
471
515
|
north: Cesium.Math.toRadians(degreeRectangle.north)
|
|
472
516
|
};
|
|
473
517
|
}
|
|
474
|
-
|
|
518
|
+
/**
|
|
519
|
+
* @description 发送请求
|
|
520
|
+
* @param {String} url 请求地址
|
|
521
|
+
* @param {Object} data 请求数据
|
|
522
|
+
* @returns {Promise} 请求结果的Promise
|
|
523
|
+
*/
|
|
475
524
|
_getRequest(url, data) {
|
|
476
525
|
return new Promise(resolve => {
|
|
477
526
|
const xhr = new XMLHttpRequest();
|
|
@@ -503,7 +552,10 @@ class WindySlicingViewModel {
|
|
|
503
552
|
this.changeSlicingMode();
|
|
504
553
|
}
|
|
505
554
|
|
|
506
|
-
|
|
555
|
+
/**
|
|
556
|
+
* @description 处理高度控制切换
|
|
557
|
+
* @param {Array} val 高度值数组
|
|
558
|
+
*/
|
|
507
559
|
_handleAltitudeControlChange(val) {
|
|
508
560
|
this.removeVolumePrimitive();
|
|
509
561
|
if (this._currentVolumePosition) {
|
|
@@ -519,7 +571,10 @@ class WindySlicingViewModel {
|
|
|
519
571
|
}
|
|
520
572
|
}
|
|
521
573
|
|
|
522
|
-
|
|
574
|
+
/**
|
|
575
|
+
* @description 处理经/纬度剖面切换
|
|
576
|
+
* @param {String} type 剖面类型:long-经度剖面,lat-纬度剖面
|
|
577
|
+
*/
|
|
523
578
|
_handleSectionChange(type) {
|
|
524
579
|
const primitiveKey = type === 'long' ? '_volumePrimitive1' : '_volumePrimitive2';
|
|
525
580
|
const valueKey = type === 'long' ? 'longSectionValue' : 'latSectionValue';
|
|
@@ -537,7 +592,10 @@ class WindySlicingViewModel {
|
|
|
537
592
|
}
|
|
538
593
|
}
|
|
539
594
|
|
|
540
|
-
|
|
595
|
+
/**
|
|
596
|
+
* @description 处理轴剖切
|
|
597
|
+
* @param {String} axis 剖切轴:x/y/z
|
|
598
|
+
*/
|
|
541
599
|
_handleAxisClipping(axis) {
|
|
542
600
|
if (!this._volumePrimitiveVoxels) return;
|
|
543
601
|
const clipConfig = {
|
|
@@ -697,7 +755,13 @@ class WindySlicingViewModel {
|
|
|
697
755
|
}
|
|
698
756
|
}
|
|
699
757
|
|
|
700
|
-
|
|
758
|
+
/**
|
|
759
|
+
* @description 生成Z轴显隐数组(复用逻辑)
|
|
760
|
+
* @param {Array} zList Z轴值数组
|
|
761
|
+
* @param {Boolean} isEnable 是否启用
|
|
762
|
+
* @param {Number} targetIndex 目标索引
|
|
763
|
+
* @returns {Array} Z轴显隐数组
|
|
764
|
+
*/
|
|
701
765
|
_generateZVisibles(zList, isEnable, targetIndex) {
|
|
702
766
|
if (!zList || zList.length === 0) return [];
|
|
703
767
|
return zList.map((_, index) => {
|
|
@@ -784,7 +848,10 @@ class WindySlicingViewModel {
|
|
|
784
848
|
}
|
|
785
849
|
}
|
|
786
850
|
|
|
787
|
-
|
|
851
|
+
/**
|
|
852
|
+
* @description 两点绘制线结果
|
|
853
|
+
* @param {Function} callback 绘制完成回调函数
|
|
854
|
+
*/
|
|
788
855
|
drawPolylineHandler(callback) {
|
|
789
856
|
let activeShapePoints = [];
|
|
790
857
|
this._windySlicingPolylineHandler.setInputAction(event => {
|
|
@@ -829,7 +896,13 @@ class WindySlicingViewModel {
|
|
|
829
896
|
this._sendPointRequest(requestData, unit, cartographic);
|
|
830
897
|
}
|
|
831
898
|
|
|
832
|
-
|
|
899
|
+
/**
|
|
900
|
+
* @description 构建点剖切请求数据
|
|
901
|
+
* @param {Number} X 经度
|
|
902
|
+
* @param {Number} Y 纬度
|
|
903
|
+
* @param {Object} layer 图层对象
|
|
904
|
+
* @returns {Object} 请求参数对象
|
|
905
|
+
*/
|
|
833
906
|
_buildPointRequestData(X, Y, layer) {
|
|
834
907
|
const baseData = {
|
|
835
908
|
collectionName: this._windySlicingLayerconfig?.params?.layer,
|
|
@@ -859,7 +932,12 @@ class WindySlicingViewModel {
|
|
|
859
932
|
return baseData;
|
|
860
933
|
}
|
|
861
934
|
|
|
862
|
-
|
|
935
|
+
/**
|
|
936
|
+
* @description 发送点剖切请求
|
|
937
|
+
* @param {Object} data 请求数据
|
|
938
|
+
* @param {String} unit 单位
|
|
939
|
+
* @param {Object} cartographic 拾取点坐标
|
|
940
|
+
*/
|
|
863
941
|
_sendPointRequest(data, unit, cartographic) {
|
|
864
942
|
const url = this._windySlicingLayerconfig?.url.replaceAll("/wmts", "").replace("/image", "/image/identify");
|
|
865
943
|
const xhr = new XMLHttpRequest();
|
|
@@ -870,7 +948,12 @@ class WindySlicingViewModel {
|
|
|
870
948
|
xhr.send(JSON.stringify(data));
|
|
871
949
|
}
|
|
872
950
|
|
|
873
|
-
|
|
951
|
+
/**
|
|
952
|
+
* @description 处理点剖切响应
|
|
953
|
+
* @param {XMLHttpRequest} xhr 请求对象
|
|
954
|
+
* @param {String} unit 单位
|
|
955
|
+
* @param {Object} cartographic 拾取点坐标
|
|
956
|
+
*/
|
|
874
957
|
_handlePointResponse(xhr, unit, cartographic) {
|
|
875
958
|
if (xhr.status < 200 || xhr.status >= 300) {
|
|
876
959
|
console.error('Request error:', xhr.statusText);
|
|
@@ -884,7 +967,12 @@ class WindySlicingViewModel {
|
|
|
884
967
|
this.setWindySlicingPointData(`${val} ${unit}`, cartographic);
|
|
885
968
|
}
|
|
886
969
|
|
|
887
|
-
|
|
970
|
+
/**
|
|
971
|
+
* @description 格式化点剖切数值(拆分复杂逻辑)
|
|
972
|
+
* @param {String} layerName 图层名称
|
|
973
|
+
* @param {Array} getAllVal 获取到的所有值数组
|
|
974
|
+
* @returns {*} 格式化后的数值或文本
|
|
975
|
+
*/
|
|
888
976
|
_formatPointValue(layerName, getAllVal) {
|
|
889
977
|
// 风场处理
|
|
890
978
|
if (CONSTS.WIND_LAYERS.includes(layerName)) {
|
|
@@ -912,7 +1000,13 @@ class WindySlicingViewModel {
|
|
|
912
1000
|
return Number(getAllVal[0].value);
|
|
913
1001
|
}
|
|
914
1002
|
|
|
915
|
-
|
|
1003
|
+
/**
|
|
1004
|
+
* @description 计算风向
|
|
1005
|
+
* @param {Number} u U方向分量
|
|
1006
|
+
* @param {Number} v V方向分量
|
|
1007
|
+
* @param {Number} dir 方向角度(当u、v为空时使用)
|
|
1008
|
+
* @returns {Object} 包含风向文本和风速的对象
|
|
1009
|
+
*/
|
|
916
1010
|
direction(u, v, dir) {
|
|
917
1011
|
let angles, speed;
|
|
918
1012
|
if (u && v) {
|
|
@@ -928,7 +1022,11 @@ class WindySlicingViewModel {
|
|
|
928
1022
|
};
|
|
929
1023
|
}
|
|
930
1024
|
|
|
931
|
-
|
|
1025
|
+
/**
|
|
1026
|
+
* @description 获取风向文本(简化条件判断)
|
|
1027
|
+
* @param {Number} angle 角度值
|
|
1028
|
+
* @returns {String} 风向文本
|
|
1029
|
+
*/
|
|
932
1030
|
_getDirectionText(angle) {
|
|
933
1031
|
const directionRanges = [{
|
|
934
1032
|
min: 15,
|
|
@@ -979,7 +1077,11 @@ class WindySlicingViewModel {
|
|
|
979
1077
|
});
|
|
980
1078
|
}
|
|
981
1079
|
|
|
982
|
-
|
|
1080
|
+
/**
|
|
1081
|
+
* @description 构建点标注HTML(抽离静态内容)
|
|
1082
|
+
* @param {String} val 显示的数值文本
|
|
1083
|
+
* @returns {String} HTML字符串
|
|
1084
|
+
*/
|
|
983
1085
|
_buildPointHtml(val) {
|
|
984
1086
|
return `<div class="pickClass">
|
|
985
1087
|
<div style="display: block;position: absolute;left: 0px;right: 0;width: 2px;height: 140px;background: rgba(68,65,65,.84)">
|
|
@@ -988,7 +1090,11 @@ class WindySlicingViewModel {
|
|
|
988
1090
|
</div>`;
|
|
989
1091
|
}
|
|
990
1092
|
|
|
991
|
-
|
|
1093
|
+
/**
|
|
1094
|
+
* @description 重构剖切参数
|
|
1095
|
+
* @param {Object} [params] 自定义参数
|
|
1096
|
+
* @returns {Object} 体剖切Provider对象
|
|
1097
|
+
*/
|
|
992
1098
|
getSlicingParams(params = {}) {
|
|
993
1099
|
if (!this._windySlicingLayerconfig) return;
|
|
994
1100
|
const colors = this._windySlicingLayerconfig?.colors ?? [];
|
|
@@ -1007,7 +1113,12 @@ class WindySlicingViewModel {
|
|
|
1007
1113
|
return new Cesium.Kq3dGridVolumeProvider(this._currentVolumeOption);
|
|
1008
1114
|
}
|
|
1009
1115
|
|
|
1010
|
-
|
|
1116
|
+
/**
|
|
1117
|
+
* @description 构建基础Volume配置
|
|
1118
|
+
* @param {String} img 颜色表生成的图片
|
|
1119
|
+
* @param {Array} ranges 属性范围数组
|
|
1120
|
+
* @returns {Object} 基础配置对象
|
|
1121
|
+
*/
|
|
1011
1122
|
_buildVolumeOption(img, ranges) {
|
|
1012
1123
|
return {
|
|
1013
1124
|
viewer: this._viewer,
|
|
@@ -1097,7 +1208,11 @@ class WindySlicingViewModel {
|
|
|
1097
1208
|
this.setViewEntity(rect);
|
|
1098
1209
|
}
|
|
1099
1210
|
|
|
1100
|
-
|
|
1211
|
+
/**
|
|
1212
|
+
* @description 获取面剖切Z轴值
|
|
1213
|
+
* @param {Object} data 图层配置
|
|
1214
|
+
* @returns {Array} 排序后的Z轴值数组
|
|
1215
|
+
*/
|
|
1101
1216
|
_getSurfaceSectionZValues(data) {
|
|
1102
1217
|
let zValues = JSON.parse(JSON.stringify(data.zValues));
|
|
1103
1218
|
if (!zValues || zValues.length === 0) {
|
|
@@ -1106,12 +1221,20 @@ class WindySlicingViewModel {
|
|
|
1106
1221
|
return data.unit !== CONSTS.REVERSE_UNIT ? zValues.sort((a, b) => a - b) : zValues.sort((a, b) => b - a);
|
|
1107
1222
|
}
|
|
1108
1223
|
|
|
1109
|
-
|
|
1224
|
+
/**
|
|
1225
|
+
* @description 获取面剖切索引
|
|
1226
|
+
* @param {Object} data 图层配置
|
|
1227
|
+
* @param {Array} zValues Z轴值数组
|
|
1228
|
+
* @returns {Number} 面剖切索引
|
|
1229
|
+
*/
|
|
1110
1230
|
_getSurfaceSectionIndex(data, zValues) {
|
|
1111
1231
|
return data.unit !== CONSTS.REVERSE_UNIT ? 0 : zValues.length - 1;
|
|
1112
1232
|
}
|
|
1113
1233
|
|
|
1114
|
-
|
|
1234
|
+
/**
|
|
1235
|
+
* @description 创建面剖切辅助线
|
|
1236
|
+
* @param {Array} zValues Z轴值数组
|
|
1237
|
+
*/
|
|
1115
1238
|
_createSurfaceSectionLines(zValues) {
|
|
1116
1239
|
this.volumelines = this.createXYVolume(this.getRectangle(this._currentVolumePosition));
|
|
1117
1240
|
const options1 = {
|
|
@@ -1136,13 +1259,21 @@ class WindySlicingViewModel {
|
|
|
1136
1259
|
}
|
|
1137
1260
|
}
|
|
1138
1261
|
|
|
1139
|
-
|
|
1262
|
+
/**
|
|
1263
|
+
* @description 转换为Cesium Rectangle
|
|
1264
|
+
* @param {Object|String} rect 矩形四至对象或JSON字符串
|
|
1265
|
+
* @returns {Object} Cesium Rectangle对象
|
|
1266
|
+
*/
|
|
1140
1267
|
getRectangle(rect) {
|
|
1141
1268
|
const rectObj = typeof rect === 'string' ? JSON.parse(rect) : rect;
|
|
1142
1269
|
return new Cesium.Rectangle(Cesium.Math.toRadians(rectObj.minX), Cesium.Math.toRadians(rectObj.minY), Cesium.Math.toRadians(rectObj.maxX), Cesium.Math.toRadians(rectObj.maxY));
|
|
1143
1270
|
}
|
|
1144
1271
|
|
|
1145
|
-
|
|
1272
|
+
/**
|
|
1273
|
+
* @description 创建XY轴剖面线
|
|
1274
|
+
* @param {Object} rectangle Cesium Rectangle对象
|
|
1275
|
+
* @returns {Object} 包含边界线和剖面线的对象
|
|
1276
|
+
*/
|
|
1146
1277
|
createXYVolume(rectangle) {
|
|
1147
1278
|
// 获取矩形四个角点
|
|
1148
1279
|
const southwest = Cesium.Rectangle.southwest(rectangle);
|
|
@@ -1196,7 +1327,13 @@ class WindySlicingViewModel {
|
|
|
1196
1327
|
});
|
|
1197
1328
|
}
|
|
1198
1329
|
|
|
1199
|
-
|
|
1330
|
+
/**
|
|
1331
|
+
* @description 生成值颜色数组
|
|
1332
|
+
* @param {Number} start 起始值
|
|
1333
|
+
* @param {Number} end 结束值
|
|
1334
|
+
* @param {String} color CSS颜色字符串
|
|
1335
|
+
* @returns {Array} 值颜色数组
|
|
1336
|
+
*/
|
|
1200
1337
|
getValueColor(start, end, color) {
|
|
1201
1338
|
const arr = [];
|
|
1202
1339
|
let num = start;
|
|
@@ -1288,7 +1425,10 @@ class WindySlicingViewModel {
|
|
|
1288
1425
|
this.callbackParams && this.callbackParams("bodyDissectionZClipping", this._options.enableLayerings);
|
|
1289
1426
|
}
|
|
1290
1427
|
|
|
1291
|
-
|
|
1428
|
+
/**
|
|
1429
|
+
* @description 设置entity视角缩放
|
|
1430
|
+
* @param {Object} rect 矩形四至对象
|
|
1431
|
+
*/
|
|
1292
1432
|
setViewEntity(rect) {
|
|
1293
1433
|
// 原逻辑注释保留,如需启用可取消注释
|
|
1294
1434
|
// const rectangle = new Cesium.Rectangle(
|
|
@@ -1317,7 +1457,11 @@ class WindySlicingViewModel {
|
|
|
1317
1457
|
// }, CONSTS.FLY_TO_DURATION);
|
|
1318
1458
|
}
|
|
1319
1459
|
|
|
1320
|
-
|
|
1460
|
+
/**
|
|
1461
|
+
* @description 根据颜色表生成图片
|
|
1462
|
+
* @param {Array} colors 颜色数组
|
|
1463
|
+
* @returns {String} 图片的dataURL
|
|
1464
|
+
*/
|
|
1321
1465
|
generateImage(colors) {
|
|
1322
1466
|
const canvas = document.createElement('canvas');
|
|
1323
1467
|
canvas.width = CONSTS.CANVAS_SIZE.width;
|
|
@@ -1352,6 +1496,7 @@ class WindySlicingViewModel {
|
|
|
1352
1496
|
this._windySlicingDrawManager.clearDrawGroup(this._groupName);
|
|
1353
1497
|
}
|
|
1354
1498
|
}
|
|
1499
|
+
// 销毁三维粒子实例
|
|
1355
1500
|
destroyedKq3dWave() {
|
|
1356
1501
|
if (this._Kq3dWavePrimitive) {
|
|
1357
1502
|
if (this._Kq3dWavePrimitive.particleSystem) {
|
|
@@ -1536,14 +1681,14 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
1536
1681
|
locale
|
|
1537
1682
|
} = (0, _useGlobalConfig.useLocale)();
|
|
1538
1683
|
const props = __props;
|
|
1539
|
-
let enableLayerings = (0, _vue.ref)([]);
|
|
1540
|
-
let unit = (0, _vue.ref)("m");
|
|
1541
|
-
let unitValue = (0, _vue.ref)("");
|
|
1542
|
-
let showSlicingSetting = (0, _vue.ref)(false);
|
|
1543
|
-
let showWindySlicing = (0, _vue.ref)(props.show);
|
|
1544
|
-
const scrollcar_ref = (0, _vue.ref)();
|
|
1545
|
-
const renderbox_ref = (0, _vue.ref)();
|
|
1546
|
-
const isShowParticle3D = (0, _vue.ref)(true);
|
|
1684
|
+
let enableLayerings = (0, _vue.ref)([]); // 分层数据数组
|
|
1685
|
+
let unit = (0, _vue.ref)("m"); // 单位
|
|
1686
|
+
let unitValue = (0, _vue.ref)(""); // 单位值
|
|
1687
|
+
let showSlicingSetting = (0, _vue.ref)(false); // 是否显示剖切设置
|
|
1688
|
+
let showWindySlicing = (0, _vue.ref)(props.show); // 是否显示气象剖切组件
|
|
1689
|
+
const scrollcar_ref = (0, _vue.ref)(); // 滚动容器Ref
|
|
1690
|
+
const renderbox_ref = (0, _vue.ref)(); // 渲染容器Ref
|
|
1691
|
+
const isShowParticle3D = (0, _vue.ref)(true); // 是否显示三维粒子选项
|
|
1547
1692
|
let formItem = (0, _vue.reactive)({
|
|
1548
1693
|
collapseValue: props.settingParams?.collapseValue ?? "setting",
|
|
1549
1694
|
mode: props.settingParams?.mode ?? "",
|
|
@@ -1627,13 +1772,14 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
1627
1772
|
// 创建深度复制
|
|
1628
1773
|
let formItemDef = JSON.parse(JSON.stringify(formItem));
|
|
1629
1774
|
delete formItemDef.collapseValue;
|
|
1630
|
-
const layeredDisplayMax = (0, _vue.ref)(0);
|
|
1631
|
-
|
|
1775
|
+
const layeredDisplayMax = (0, _vue.ref)(0); // 分层显示最大索引
|
|
1776
|
+
|
|
1777
|
+
let viewModel = null; // 气象剖切视图模型对象
|
|
1632
1778
|
// 组件容器Ref
|
|
1633
1779
|
let boxRef = (0, _vue.ref)(null);
|
|
1634
1780
|
// 生成组件默认header
|
|
1635
|
-
let headerTemp = (0, _vue.ref)();
|
|
1636
|
-
let headerTempRef = (0, _vue.ref)();
|
|
1781
|
+
let headerTemp = (0, _vue.ref)(); // 动态生成的Header组件
|
|
1782
|
+
let headerTempRef = (0, _vue.ref)(); // Header组件Ref
|
|
1637
1783
|
(0, _vue.onMounted)(() => {
|
|
1638
1784
|
(0, _util.updatePosition)(boxRef.value, props);
|
|
1639
1785
|
(0, _vue.watch)(() => props.position, (newVal, oldVal) => {
|
|
@@ -1677,11 +1823,20 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
1677
1823
|
showWindySlicing.value = true;
|
|
1678
1824
|
viewModel && viewModel.getWindySlicingLayer(data?.guid ?? "");
|
|
1679
1825
|
};
|
|
1826
|
+
/**
|
|
1827
|
+
* @description 切换气象图层
|
|
1828
|
+
* @param {Object} data 图层配置对象
|
|
1829
|
+
*/
|
|
1680
1830
|
const changeWindyLayer = data => {
|
|
1681
1831
|
clear();
|
|
1682
1832
|
Object.assign(formItem, formItemDef);
|
|
1683
1833
|
viewModel && viewModel.getWindySlicingLayer(null, data);
|
|
1684
1834
|
};
|
|
1835
|
+
/**
|
|
1836
|
+
* @description 回调参数处理,根据key更新组件状态
|
|
1837
|
+
* @param {String} key 回调类型标识
|
|
1838
|
+
* @param {*} val 回调值
|
|
1839
|
+
*/
|
|
1685
1840
|
function callbackParams(key, val) {
|
|
1686
1841
|
switch (key) {
|
|
1687
1842
|
case "showSlicingSetting":
|
|
@@ -1734,24 +1889,35 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
1734
1889
|
break;
|
|
1735
1890
|
}
|
|
1736
1891
|
}
|
|
1737
|
-
|
|
1892
|
+
/**
|
|
1893
|
+
* @description 切换绘制类型
|
|
1894
|
+
* @param {String} mode 绘制模式:point/line/polygon/delete
|
|
1895
|
+
*/
|
|
1738
1896
|
function changeMode(mode) {
|
|
1739
1897
|
if (!viewModel) return;
|
|
1740
1898
|
showSlicingSetting.value = false;
|
|
1741
1899
|
formItem.mode = mode;
|
|
1742
1900
|
viewModel._options.mode = formItem.mode;
|
|
1743
1901
|
viewModel && viewModel.paramsChanged("mode");
|
|
1902
|
+
// 删除模式时重置参数
|
|
1744
1903
|
if (mode == "delete") {
|
|
1745
1904
|
Object.assign(formItem, formItemDef);
|
|
1746
1905
|
}
|
|
1747
1906
|
}
|
|
1907
|
+
// 应用剖切样式
|
|
1748
1908
|
function applicationClick() {
|
|
1749
1909
|
paramsChanged("styleType");
|
|
1750
1910
|
}
|
|
1911
|
+
|
|
1912
|
+
// 应用分层显示配置
|
|
1751
1913
|
function applicationLayeredDisplayClick() {
|
|
1752
1914
|
paramsChanged("changParticleParams", "layeredDisplay");
|
|
1753
1915
|
}
|
|
1754
|
-
|
|
1916
|
+
/**
|
|
1917
|
+
* @description 参数切换事件
|
|
1918
|
+
* @param {String} key 改变的参数类型标识
|
|
1919
|
+
* @param {*} val 改变的参数值
|
|
1920
|
+
*/
|
|
1755
1921
|
function paramsChanged(key, val) {
|
|
1756
1922
|
if (!viewModel) return;
|
|
1757
1923
|
viewModel._options[key] = formItem[key];
|
|
@@ -1809,20 +1975,28 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
1809
1975
|
formItem.bodyDissectionZClippingMax = 10;
|
|
1810
1976
|
Object.assign(viewModel._options, formItem);
|
|
1811
1977
|
}
|
|
1978
|
+
/**
|
|
1979
|
+
* @description 根据Z轴值更新剖面参数范围
|
|
1980
|
+
* @param {Array} gdzValues Z轴值数组
|
|
1981
|
+
*/
|
|
1812
1982
|
function changeParams(gdzValues) {
|
|
1813
1983
|
formItem.heightSectionValueMax = gdzValues.length;
|
|
1984
|
+
// 根据单位判断高度剖面值
|
|
1814
1985
|
if (unit.value != "hpa") {
|
|
1815
1986
|
formItem.heightSectionValue = 1;
|
|
1816
1987
|
} else {
|
|
1817
1988
|
formItem.heightSectionValue = gdzValues.length;
|
|
1818
1989
|
}
|
|
1819
1990
|
if (!viewModel?.volumelines) return;
|
|
1991
|
+
// 计算经度剖面滑动条范围
|
|
1820
1992
|
let jdValue = Math.abs(viewModel?.volumelines.line1[0].longitude - viewModel?.volumelines.line1[1].longitude);
|
|
1821
1993
|
jdValue = jdValue.toFixed(3);
|
|
1822
1994
|
formItem.longSectionValueStep = jdValue / 100;
|
|
1823
1995
|
formItem.longSectionValueMin = -(jdValue / 2);
|
|
1824
1996
|
formItem.longSectionValueMax = jdValue / 2;
|
|
1825
1997
|
formItem.longSectionValue = 0;
|
|
1998
|
+
|
|
1999
|
+
// 计算纬度剖面滑动条范围
|
|
1826
2000
|
let wdValue = Math.abs(viewModel?.volumelines.line4[0].latitude - viewModel?.volumelines.line4[1].latitude);
|
|
1827
2001
|
wdValue = wdValue.toFixed(3);
|
|
1828
2002
|
formItem.latSectionValueStep = wdValue / 100;
|
|
@@ -1831,15 +2005,24 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
1831
2005
|
formItem.latSectionValue = 0;
|
|
1832
2006
|
Object.assign(viewModel._options, formItem);
|
|
1833
2007
|
}
|
|
2008
|
+
// 清除剖切结果
|
|
1834
2009
|
function clear() {
|
|
1835
2010
|
showSlicingSetting.value = false;
|
|
1836
2011
|
viewModel && viewModel.clear();
|
|
1837
2012
|
}
|
|
1838
|
-
|
|
2013
|
+
/**
|
|
2014
|
+
* @description 显示提示信息
|
|
2015
|
+
* @param {Number} val 滑动条值
|
|
2016
|
+
* @returns {String} 提示文本
|
|
2017
|
+
*/
|
|
1839
2018
|
function formatTooltip(val) {
|
|
1840
2019
|
return enableLayerings.value[val - 1] + " " + unit.value;
|
|
1841
2020
|
}
|
|
1842
|
-
|
|
2021
|
+
/**
|
|
2022
|
+
* @description 显示提示信息
|
|
2023
|
+
* @param {Number} val 滑动条值
|
|
2024
|
+
* @returns {String} 提示文本
|
|
2025
|
+
*/
|
|
1843
2026
|
function formatTooltips(val) {
|
|
1844
2027
|
return val + " " + unitValue.value;
|
|
1845
2028
|
}
|
|
@@ -1853,12 +2036,17 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
1853
2036
|
color: "#fdfd28"
|
|
1854
2037
|
});
|
|
1855
2038
|
};
|
|
2039
|
+
// 添加分层显示项
|
|
1856
2040
|
const addLayeredDisplay = () => {
|
|
1857
2041
|
formItem.layeredDisplay.push({
|
|
1858
2042
|
value: 0,
|
|
1859
2043
|
color: "#fdfd28"
|
|
1860
2044
|
});
|
|
1861
2045
|
};
|
|
2046
|
+
/**
|
|
2047
|
+
* @description 删除分层显示项
|
|
2048
|
+
* @param {Number} index 删除项的索引
|
|
2049
|
+
*/
|
|
1862
2050
|
const handleDeleteLayeredDisplay = index => {
|
|
1863
2051
|
formItem.layeredDisplay.splice(index, 1);
|
|
1864
2052
|
};
|
|
@@ -3036,11 +3224,11 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
3036
3224
|
value: true
|
|
3037
3225
|
}));
|
|
3038
3226
|
exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
|
|
3039
|
-
|
|
3227
|
+
const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
|
|
3040
3228
|
__webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
|
|
3041
|
-
|
|
3229
|
+
const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
|
|
3042
3230
|
__webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
|
|
3043
|
-
|
|
3231
|
+
const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
|
|
3044
3232
|
__webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
|
|
3045
3233
|
|
|
3046
3234
|
/***/ })
|
package/wireframesketch/index.js
CHANGED
|
@@ -66,6 +66,10 @@ var _message = _interopRequireDefault(__webpack_require__(71323));
|
|
|
66
66
|
|
|
67
67
|
class WireframeSketchViewModel {
|
|
68
68
|
// 草图模式显示
|
|
69
|
+
/**
|
|
70
|
+
* @description 构造函数,初始化线框模式管理对象
|
|
71
|
+
* @param {Object} scenceView 场景视图对象,包含 _viewer 属性
|
|
72
|
+
*/
|
|
69
73
|
constructor(scenceView) {
|
|
70
74
|
this._viewer = null;
|
|
71
75
|
// 三维viewer对象
|
|
@@ -77,9 +81,15 @@ class WireframeSketchViewModel {
|
|
|
77
81
|
viewer: this._viewer
|
|
78
82
|
}); //声明线框模式类
|
|
79
83
|
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @description 根据渲染模式切换线框/草图/纹理显示
|
|
87
|
+
* @param {String} key 渲染模式标识:1-线框渲染,2-草图渲染,3-纹理渲染
|
|
88
|
+
*/
|
|
80
89
|
changeFrameRender(key) {
|
|
81
90
|
switch (key) {
|
|
82
91
|
case "1":
|
|
92
|
+
// 线框渲染模式:设置线框类型并移除已有的草图效果
|
|
83
93
|
this._wireFrame.type = 1;
|
|
84
94
|
if (this._sketch) {
|
|
85
95
|
this._viewer.effects.remove(this._sketch);
|
|
@@ -87,6 +97,7 @@ class WireframeSketchViewModel {
|
|
|
87
97
|
}
|
|
88
98
|
break;
|
|
89
99
|
case "2":
|
|
100
|
+
// 草图渲染模式:关闭线框并创建草图效果
|
|
90
101
|
this._wireFrame.type = 0;
|
|
91
102
|
if (!this._sketch) {
|
|
92
103
|
this._sketch = new window.Cesium.Kq3dSketch({
|
|
@@ -96,6 +107,7 @@ class WireframeSketchViewModel {
|
|
|
96
107
|
}
|
|
97
108
|
break;
|
|
98
109
|
case "3":
|
|
110
|
+
// 纹理渲染模式:关闭线框并移除已有的草图效果
|
|
99
111
|
this._wireFrame.type = 0;
|
|
100
112
|
if (this._sketch) {
|
|
101
113
|
this._viewer.effects.remove(this._sketch); // 移除草图模式
|
|
@@ -243,9 +255,9 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
243
255
|
lang,
|
|
244
256
|
locale
|
|
245
257
|
} = (0, _useGlobalConfig.useLocale)();
|
|
246
|
-
let viewModel = null;
|
|
247
|
-
let ref_box = (0, _vue.ref)();
|
|
248
|
-
let checkbox_data = (0, _vue.ref)(["2"]);
|
|
258
|
+
let viewModel = null; // 视图模型对象
|
|
259
|
+
let ref_box = (0, _vue.ref)(); // 内容容器Ref
|
|
260
|
+
let checkbox_data = (0, _vue.ref)(["2"]); // 当前选中的渲染模式复选框值
|
|
249
261
|
|
|
250
262
|
// 获取组件传参
|
|
251
263
|
const props = __props;
|
|
@@ -253,8 +265,9 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
253
265
|
let boxRef = (0, _vue.ref)(null);
|
|
254
266
|
|
|
255
267
|
// 生成组件默认header
|
|
256
|
-
let headerTemp = (0, _vue.ref)();
|
|
257
|
-
let headerTempRef = (0, _vue.ref)();
|
|
268
|
+
let headerTemp = (0, _vue.ref)(); // 动态生成的Header组件
|
|
269
|
+
let headerTempRef = (0, _vue.ref)(); // Header组件Ref
|
|
270
|
+
|
|
258
271
|
(0, _vue.onMounted)(() => {
|
|
259
272
|
(0, _util.updatePosition)(boxRef.value, props);
|
|
260
273
|
(0, _vue.watch)(() => props.position, (newVal, oldVal) => {
|
|
@@ -284,6 +297,10 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
284
297
|
headerTemp.value = (0, _util.createHeaderTemp)(boxRef.value, (0, _vue.toRefs)(props), headerTempRef, 'webgl.wireFrameSketch');
|
|
285
298
|
}
|
|
286
299
|
};
|
|
300
|
+
/**
|
|
301
|
+
* @description 切换渲染模式
|
|
302
|
+
* @param {String} val 渲染模式标识:1-线框渲染,2-草图渲染,3-纹理渲染
|
|
303
|
+
*/
|
|
287
304
|
function onChangeFrameRender(val) {
|
|
288
305
|
checkbox_data.value = [];
|
|
289
306
|
checkbox_data.value.push(val);
|
|
@@ -410,11 +427,11 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
410
427
|
value: true
|
|
411
428
|
}));
|
|
412
429
|
exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
|
|
413
|
-
|
|
430
|
+
const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
|
|
414
431
|
__webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
|
|
415
|
-
|
|
432
|
+
const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
|
|
416
433
|
__webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
|
|
417
|
-
|
|
434
|
+
const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
|
|
418
435
|
__webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
|
|
419
436
|
|
|
420
437
|
/***/ })
|