@kq_npm/client3d_webgl_vue 3.6.2-beta → 3.6.4-beta
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/floodanalysis/index.js +28 -14
- package/index.js +180 -20
- package/package.json +1 -1
- package/scenceview/index.js +180 -20
package/floodanalysis/index.js
CHANGED
|
@@ -196,6 +196,8 @@ class FloodAnalysisViewModel {
|
|
|
196
196
|
//测量结果
|
|
197
197
|
//淹没模式
|
|
198
198
|
constructor(scenceView, options) {
|
|
199
|
+
(0,defineProperty/* default */.Z)(this, "_options", {});
|
|
200
|
+
|
|
199
201
|
(0,defineProperty/* default */.Z)(this, "_floodTerrainAnalysis", null);
|
|
200
202
|
|
|
201
203
|
(0,defineProperty/* default */.Z)(this, "_floodModelAnalysis", null);
|
|
@@ -218,10 +220,11 @@ class FloodAnalysisViewModel {
|
|
|
218
220
|
src: const_image_.GREEN_TO_BLUE_URL
|
|
219
221
|
}]);
|
|
220
222
|
|
|
223
|
+
this._mode = options.mode;
|
|
221
224
|
options.viewer = scenceView._viewer;
|
|
222
225
|
options.viewer.scene.globe.depthTestAgainstTerrain = true;
|
|
223
|
-
|
|
224
|
-
|
|
226
|
+
options.colorImage = this.getImagePath(options.colorImage);
|
|
227
|
+
this._options = options; //this._floodModelAnalysis = new Cesium.Kq3dFloodModelAnalysis(options);
|
|
225
228
|
|
|
226
229
|
this._floodModelAnalysis = scenceView._floodModelAnalysis;
|
|
227
230
|
this._floodModelAnalysis.moveMode = options.moveMode;
|
|
@@ -244,10 +247,10 @@ class FloodAnalysisViewModel {
|
|
|
244
247
|
if (ret == false) {
|
|
245
248
|
if (that._measureResult) {
|
|
246
249
|
if (that._mode === 0) {
|
|
247
|
-
|
|
250
|
+
that._options.positions = that._measureResult.positions;
|
|
248
251
|
|
|
249
252
|
if (!that._floodTerrainAnalysis) {
|
|
250
|
-
that._floodTerrainAnalysis = new Cesium.Kq3dFloodTerrainAnalysis(
|
|
253
|
+
that._floodTerrainAnalysis = new Cesium.Kq3dFloodTerrainAnalysis(that._options);
|
|
251
254
|
} else {
|
|
252
255
|
that._floodTerrainAnalysis.positions = that._measureResult.positions;
|
|
253
256
|
}
|
|
@@ -374,36 +377,47 @@ class FloodAnalysisViewModel {
|
|
|
374
377
|
|
|
375
378
|
|
|
376
379
|
setMoveDirection(direction) {
|
|
377
|
-
|
|
378
|
-
|
|
380
|
+
direction = Number(direction);
|
|
381
|
+
this._options.moveMode = direction;
|
|
382
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.moveMode = direction;
|
|
383
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.moveMode = direction;
|
|
379
384
|
} //设置淹没速度
|
|
380
385
|
|
|
381
386
|
|
|
382
387
|
setMoveSpeed(speed) {
|
|
383
|
-
|
|
384
|
-
|
|
388
|
+
speed = Number(speed);
|
|
389
|
+
this._options.speed = speed;
|
|
390
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.speed = speed;
|
|
391
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.speed = speed;
|
|
385
392
|
} //设置淹没纹理透明度
|
|
386
393
|
|
|
387
394
|
|
|
388
395
|
setMoveAlpha(alpha) {
|
|
389
|
-
|
|
390
|
-
|
|
396
|
+
alpha = Number(alpha);
|
|
397
|
+
this._options.alpha = alpha;
|
|
398
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.alpha = alpha;
|
|
399
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.alpha = alpha;
|
|
391
400
|
} //设置最小淹没高度
|
|
392
401
|
|
|
393
402
|
|
|
394
403
|
setMoveMinHeight(minHeight) {
|
|
395
|
-
|
|
396
|
-
|
|
404
|
+
minHeight = Number(minHeight);
|
|
405
|
+
this._options.minHeight = minHeight;
|
|
406
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.minHeight = minHeight;
|
|
407
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.minHeight = minHeight;
|
|
397
408
|
} //设置最大淹没高度
|
|
398
409
|
|
|
399
410
|
|
|
400
411
|
setMoveMaxHeight(maxHeight) {
|
|
401
|
-
|
|
402
|
-
|
|
412
|
+
maxHeight = Number(maxHeight);
|
|
413
|
+
this._options.maxHeight = maxHeight;
|
|
414
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.maxHeight = maxHeight;
|
|
415
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.maxHeight = maxHeight;
|
|
403
416
|
} //设置淹没填充纹理
|
|
404
417
|
|
|
405
418
|
|
|
406
419
|
setMoveImage(image) {
|
|
420
|
+
this._options.colorImage = image;
|
|
407
421
|
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.colorImage = image;
|
|
408
422
|
if (this._floodModelAnalysis) this._floodModelAnalysis.colorImage = image;
|
|
409
423
|
}
|
package/index.js
CHANGED
|
@@ -564,7 +564,9 @@ var const_image_namespaceObject = require("@kq_npm/client_common_vue/_utils/cons
|
|
|
564
564
|
//绘制操作类
|
|
565
565
|
|
|
566
566
|
class DrawManager {
|
|
567
|
-
|
|
567
|
+
// 图层分组
|
|
568
|
+
// 地理编码绘制点图标点击事件
|
|
569
|
+
// 地理编码绘制点图层分组
|
|
568
570
|
// 默认绘制样式提供给绘图组件绑定
|
|
569
571
|
// 默认绘制样式
|
|
570
572
|
constructor(viewer) {
|
|
@@ -576,6 +578,10 @@ class DrawManager {
|
|
|
576
578
|
|
|
577
579
|
_defineProperty(this, "_layerGroup", []);
|
|
578
580
|
|
|
581
|
+
_defineProperty(this, "_handler", null);
|
|
582
|
+
|
|
583
|
+
_defineProperty(this, "_pointGroup", []);
|
|
584
|
+
|
|
579
585
|
_defineProperty(this, "_defaultStyle", {
|
|
580
586
|
color: "#ff0000",
|
|
581
587
|
fillColor: "#1E90FF",
|
|
@@ -619,7 +625,7 @@ class DrawManager {
|
|
|
619
625
|
//线宽
|
|
620
626
|
color: "#ff0000",
|
|
621
627
|
//线颜色
|
|
622
|
-
opacity:
|
|
628
|
+
opacity: 1,
|
|
623
629
|
//线颜色透明度
|
|
624
630
|
arcType: 1,
|
|
625
631
|
clampToGround: true //是否贴地
|
|
@@ -637,7 +643,7 @@ class DrawManager {
|
|
|
637
643
|
//边框宽度
|
|
638
644
|
color: "#ff0000",
|
|
639
645
|
//边框颜色
|
|
640
|
-
opacity:
|
|
646
|
+
opacity: 1,
|
|
641
647
|
//边框颜色透明度
|
|
642
648
|
clampToGround: true //是否贴地
|
|
643
649
|
|
|
@@ -712,7 +718,8 @@ class DrawManager {
|
|
|
712
718
|
this._drawStyle.freehandpolygon = this._drawStyle.polygon; //手绘面
|
|
713
719
|
|
|
714
720
|
this._drawStyle.rectangle = this._drawStyle.polygon; //矩形
|
|
715
|
-
}
|
|
721
|
+
} // 获取三维填充样式
|
|
722
|
+
|
|
716
723
|
|
|
717
724
|
getFillStyle(fillStyle) {
|
|
718
725
|
let lineColor = fillStyle.lineColor || "rgba(0, 0, 255, 1)";
|
|
@@ -785,7 +792,9 @@ class DrawManager {
|
|
|
785
792
|
if (groupName) shape.groupName = groupName;
|
|
786
793
|
that._viewer.scene.globe.depthTestAgainstTerrain = false;
|
|
787
794
|
var feature = that.shapeToGeoFeature(shape);
|
|
788
|
-
callback(feature.geometry
|
|
795
|
+
callback(feature.geometry, {
|
|
796
|
+
layer: shape.guid
|
|
797
|
+
});
|
|
789
798
|
removeEventListener();
|
|
790
799
|
});
|
|
791
800
|
}
|
|
@@ -1104,7 +1113,7 @@ class DrawManager {
|
|
|
1104
1113
|
}
|
|
1105
1114
|
|
|
1106
1115
|
return geoFeature;
|
|
1107
|
-
} //
|
|
1116
|
+
} // 获取所有绘制图层, geojson数据格式 (普通点线面绘制接口使用)
|
|
1108
1117
|
|
|
1109
1118
|
|
|
1110
1119
|
getAllGeometry() {
|
|
@@ -1124,7 +1133,144 @@ class DrawManager {
|
|
|
1124
1133
|
features: features
|
|
1125
1134
|
};
|
|
1126
1135
|
return geojson;
|
|
1136
|
+
} // 设置交互绘制样式, 只设置最后一个图形样式, 绘图组件使用
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
setDrawStyleById(id, style) {
|
|
1140
|
+
let primitive = this._drawLayer.getById(id);
|
|
1141
|
+
|
|
1142
|
+
if (!primitive) return;
|
|
1143
|
+
let type = primitive.geoType;
|
|
1144
|
+
|
|
1145
|
+
if (type === 'point') {// 绘制点暂时不需要修改样式
|
|
1146
|
+
} else if (type === 'polyline' || type === 'polygon') {
|
|
1147
|
+
if (style.weight) primitive.width = style.weight;
|
|
1148
|
+
if (style.color) primitive.color = Cesium.Color.fromCssColorString(style.color);
|
|
1149
|
+
if (style.dashArray) primitive.dashArray = style.dashArray;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
if (type === 'polygon') {
|
|
1153
|
+
primitive.fill = style.fill;
|
|
1154
|
+
|
|
1155
|
+
if (style.fill) {
|
|
1156
|
+
let opacity = style.fillOpacity || this._drawStyle.polygon.fillOpacity;
|
|
1157
|
+
if (style.fillColor) primitive.fillColor = Cesium.Color.fromCssColorString(style.fillColor).withAlpha(opacity);
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
/********** 地理编码通用组件使用 start ************/
|
|
1162
|
+
// 绘制点图标自带点击弹出气泡, 地理编码通用组件使用
|
|
1163
|
+
|
|
1164
|
+
|
|
1165
|
+
drawPointWithPoup(data, idCustom = "geocode") {
|
|
1166
|
+
if (!this._handler) {
|
|
1167
|
+
// 注册点击事件
|
|
1168
|
+
let scene = this._viewer.scene;
|
|
1169
|
+
this._handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
|
|
1170
|
+
let that = this;
|
|
1171
|
+
|
|
1172
|
+
this._handler.setInputAction(function (movement) {
|
|
1173
|
+
var pickedObject = scene.pick(movement.position);
|
|
1174
|
+
|
|
1175
|
+
if (pickedObject && pickedObject.id && pickedObject.id instanceof Cesium.Entity) {
|
|
1176
|
+
let entity = pickedObject.id;
|
|
1177
|
+
that.createPointPoup(entity);
|
|
1178
|
+
}
|
|
1179
|
+
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
1180
|
+
|
|
1181
|
+
this._handler.setInputAction(function (movement) {
|
|
1182
|
+
// that.closePointPoup();
|
|
1183
|
+
that.openPointPoup('1002', 'AAA'); // that.removePointAll();
|
|
1184
|
+
//that.clearPointByIdCustom();
|
|
1185
|
+
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
let pointDs = this._viewer.dataSources.getByName(idCustom);
|
|
1189
|
+
|
|
1190
|
+
if (pointDs.length === 0) {
|
|
1191
|
+
pointDs = new Cesium.CustomDataSource(idCustom);
|
|
1192
|
+
|
|
1193
|
+
this._viewer.dataSources.add(pointDs);
|
|
1194
|
+
|
|
1195
|
+
this._pointGroup.push(idCustom);
|
|
1196
|
+
} else {
|
|
1197
|
+
pointDs = pointDs[0];
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
let position = Cesium.Cartesian3.fromDegrees(data.lat, data.lon);
|
|
1201
|
+
pointDs.entities.add({
|
|
1202
|
+
position: position,
|
|
1203
|
+
billboard: {
|
|
1204
|
+
image: data.image,
|
|
1205
|
+
width: data.width,
|
|
1206
|
+
height: data.height,
|
|
1207
|
+
verticalOrigin: Cesium.VerticalOrigin.BOTTOM
|
|
1208
|
+
} // properties: data
|
|
1209
|
+
|
|
1210
|
+
});
|
|
1211
|
+
} // 通过entity创建关联气泡
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
createPointPoup(entity) {
|
|
1215
|
+
if (this._htmlTag) this._htmlTag.destroy();
|
|
1216
|
+
this._htmlTag = new Cesium.Kq3dHtmlTag(this._viewer, {
|
|
1217
|
+
html: '<div>' + entity.properties.id._value + '</div>',
|
|
1218
|
+
position: entity.position,
|
|
1219
|
+
anchor: [0, -entity.properties.height._value],
|
|
1220
|
+
alignmentMode: 7
|
|
1221
|
+
});
|
|
1222
|
+
} // 通过id打开地理编码图标气泡
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
openPointPoup(id, idCustom = "geocode") {
|
|
1226
|
+
if (id) {
|
|
1227
|
+
let pointDs = this._viewer.dataSources.getByName(idCustom);
|
|
1228
|
+
|
|
1229
|
+
if (pointDs.length > 0) {
|
|
1230
|
+
let entities = pointDs[0].entities.values;
|
|
1231
|
+
|
|
1232
|
+
for (let i = 0; i < entities.length; i++) {
|
|
1233
|
+
if (entities[i].properties.id && entities[i].properties.id._value === id) {
|
|
1234
|
+
this.createPointPoup(entities[i]);
|
|
1235
|
+
break;
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
} // 关闭地理编码图标点击气泡
|
|
1241
|
+
|
|
1242
|
+
|
|
1243
|
+
closePointPoup() {
|
|
1244
|
+
if (this._htmlTag) this._htmlTag.destroy();
|
|
1245
|
+
} // 清除地理编码指定分组的所有图标
|
|
1246
|
+
|
|
1247
|
+
|
|
1248
|
+
clearPointByIdCustom(idCustom = "geocode") {
|
|
1249
|
+
let pointDs = this._viewer.dataSources.getByName(idCustom);
|
|
1250
|
+
|
|
1251
|
+
if (pointDs.length > 0) {
|
|
1252
|
+
for (let i = 0; i < pointDs.length; i++) {
|
|
1253
|
+
pointDs[i].entities.removeAll();
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
} // 删除所有地理编码图标, 包含分组图层
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
removePointAll() {
|
|
1260
|
+
let that = this;
|
|
1261
|
+
|
|
1262
|
+
this._pointGroup.forEach(group => {
|
|
1263
|
+
let dsList = that._viewer.dataSources.getByName(group);
|
|
1264
|
+
|
|
1265
|
+
for (let i = 0; i < dsList.length; i++) {
|
|
1266
|
+
that._viewer.dataSources.remove(dsList[i], true);
|
|
1267
|
+
}
|
|
1268
|
+
});
|
|
1269
|
+
|
|
1270
|
+
this._pointGroup = [];
|
|
1127
1271
|
}
|
|
1272
|
+
/********** 地理编码通用组件使用 end ************/
|
|
1273
|
+
|
|
1128
1274
|
|
|
1129
1275
|
}
|
|
1130
1276
|
;// CONCATENATED MODULE: external "element-plus/es"
|
|
@@ -14818,6 +14964,8 @@ class FloodAnalysisViewModel {
|
|
|
14818
14964
|
//测量结果
|
|
14819
14965
|
//淹没模式
|
|
14820
14966
|
constructor(scenceView, options) {
|
|
14967
|
+
_defineProperty(this, "_options", {});
|
|
14968
|
+
|
|
14821
14969
|
_defineProperty(this, "_floodTerrainAnalysis", null);
|
|
14822
14970
|
|
|
14823
14971
|
_defineProperty(this, "_floodModelAnalysis", null);
|
|
@@ -14840,10 +14988,11 @@ class FloodAnalysisViewModel {
|
|
|
14840
14988
|
src: const_image_namespaceObject.GREEN_TO_BLUE_URL
|
|
14841
14989
|
}]);
|
|
14842
14990
|
|
|
14991
|
+
this._mode = options.mode;
|
|
14843
14992
|
options.viewer = scenceView._viewer;
|
|
14844
14993
|
options.viewer.scene.globe.depthTestAgainstTerrain = true;
|
|
14845
|
-
|
|
14846
|
-
|
|
14994
|
+
options.colorImage = this.getImagePath(options.colorImage);
|
|
14995
|
+
this._options = options; //this._floodModelAnalysis = new Cesium.Kq3dFloodModelAnalysis(options);
|
|
14847
14996
|
|
|
14848
14997
|
this._floodModelAnalysis = scenceView._floodModelAnalysis;
|
|
14849
14998
|
this._floodModelAnalysis.moveMode = options.moveMode;
|
|
@@ -14866,10 +15015,10 @@ class FloodAnalysisViewModel {
|
|
|
14866
15015
|
if (ret == false) {
|
|
14867
15016
|
if (that._measureResult) {
|
|
14868
15017
|
if (that._mode === 0) {
|
|
14869
|
-
|
|
15018
|
+
that._options.positions = that._measureResult.positions;
|
|
14870
15019
|
|
|
14871
15020
|
if (!that._floodTerrainAnalysis) {
|
|
14872
|
-
that._floodTerrainAnalysis = new Cesium.Kq3dFloodTerrainAnalysis(
|
|
15021
|
+
that._floodTerrainAnalysis = new Cesium.Kq3dFloodTerrainAnalysis(that._options);
|
|
14873
15022
|
} else {
|
|
14874
15023
|
that._floodTerrainAnalysis.positions = that._measureResult.positions;
|
|
14875
15024
|
}
|
|
@@ -14996,36 +15145,47 @@ class FloodAnalysisViewModel {
|
|
|
14996
15145
|
|
|
14997
15146
|
|
|
14998
15147
|
setMoveDirection(direction) {
|
|
14999
|
-
|
|
15000
|
-
|
|
15148
|
+
direction = Number(direction);
|
|
15149
|
+
this._options.moveMode = direction;
|
|
15150
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.moveMode = direction;
|
|
15151
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.moveMode = direction;
|
|
15001
15152
|
} //设置淹没速度
|
|
15002
15153
|
|
|
15003
15154
|
|
|
15004
15155
|
setMoveSpeed(speed) {
|
|
15005
|
-
|
|
15006
|
-
|
|
15156
|
+
speed = Number(speed);
|
|
15157
|
+
this._options.speed = speed;
|
|
15158
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.speed = speed;
|
|
15159
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.speed = speed;
|
|
15007
15160
|
} //设置淹没纹理透明度
|
|
15008
15161
|
|
|
15009
15162
|
|
|
15010
15163
|
setMoveAlpha(alpha) {
|
|
15011
|
-
|
|
15012
|
-
|
|
15164
|
+
alpha = Number(alpha);
|
|
15165
|
+
this._options.alpha = alpha;
|
|
15166
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.alpha = alpha;
|
|
15167
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.alpha = alpha;
|
|
15013
15168
|
} //设置最小淹没高度
|
|
15014
15169
|
|
|
15015
15170
|
|
|
15016
15171
|
setMoveMinHeight(minHeight) {
|
|
15017
|
-
|
|
15018
|
-
|
|
15172
|
+
minHeight = Number(minHeight);
|
|
15173
|
+
this._options.minHeight = minHeight;
|
|
15174
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.minHeight = minHeight;
|
|
15175
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.minHeight = minHeight;
|
|
15019
15176
|
} //设置最大淹没高度
|
|
15020
15177
|
|
|
15021
15178
|
|
|
15022
15179
|
setMoveMaxHeight(maxHeight) {
|
|
15023
|
-
|
|
15024
|
-
|
|
15180
|
+
maxHeight = Number(maxHeight);
|
|
15181
|
+
this._options.maxHeight = maxHeight;
|
|
15182
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.maxHeight = maxHeight;
|
|
15183
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.maxHeight = maxHeight;
|
|
15025
15184
|
} //设置淹没填充纹理
|
|
15026
15185
|
|
|
15027
15186
|
|
|
15028
15187
|
setMoveImage(image) {
|
|
15188
|
+
this._options.colorImage = image;
|
|
15029
15189
|
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.colorImage = image;
|
|
15030
15190
|
if (this._floodModelAnalysis) this._floodModelAnalysis.colorImage = image;
|
|
15031
15191
|
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"3.6.
|
|
1
|
+
{"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"3.6.4-beta","homepage":"","keywords":["KQGIS","webGL","Vue"],"browserslist":["> 1%","last 2 versions","not dead","not ie 11"],"author":"KQWEB GROUP","license":"Apache-2.0","dependencies":{"colorcolor":"^1.1.1","echarts":"^5.3.3","js-cookie":"^3.0.1","omit.js":"^2.0.2","save":"^2.5.0","tinycolor2":"^1.4.2","vue-i18n":"9.2.0-beta.36","xlsx":"^0.18.5","css-vars-ponyfill":"^2.4.8","html2canvas":"^1.4.1","xe-utils":"^3.5.4"}}
|
package/scenceview/index.js
CHANGED
|
@@ -8769,6 +8769,8 @@ class FloodAnalysisViewModel {
|
|
|
8769
8769
|
//测量结果
|
|
8770
8770
|
//淹没模式
|
|
8771
8771
|
constructor(scenceView, options) {
|
|
8772
|
+
(0,defineProperty/* default */.Z)(this, "_options", {});
|
|
8773
|
+
|
|
8772
8774
|
(0,defineProperty/* default */.Z)(this, "_floodTerrainAnalysis", null);
|
|
8773
8775
|
|
|
8774
8776
|
(0,defineProperty/* default */.Z)(this, "_floodModelAnalysis", null);
|
|
@@ -8791,10 +8793,11 @@ class FloodAnalysisViewModel {
|
|
|
8791
8793
|
src: const_image_.GREEN_TO_BLUE_URL
|
|
8792
8794
|
}]);
|
|
8793
8795
|
|
|
8796
|
+
this._mode = options.mode;
|
|
8794
8797
|
options.viewer = scenceView._viewer;
|
|
8795
8798
|
options.viewer.scene.globe.depthTestAgainstTerrain = true;
|
|
8796
|
-
|
|
8797
|
-
|
|
8799
|
+
options.colorImage = this.getImagePath(options.colorImage);
|
|
8800
|
+
this._options = options; //this._floodModelAnalysis = new Cesium.Kq3dFloodModelAnalysis(options);
|
|
8798
8801
|
|
|
8799
8802
|
this._floodModelAnalysis = scenceView._floodModelAnalysis;
|
|
8800
8803
|
this._floodModelAnalysis.moveMode = options.moveMode;
|
|
@@ -8817,10 +8820,10 @@ class FloodAnalysisViewModel {
|
|
|
8817
8820
|
if (ret == false) {
|
|
8818
8821
|
if (that._measureResult) {
|
|
8819
8822
|
if (that._mode === 0) {
|
|
8820
|
-
|
|
8823
|
+
that._options.positions = that._measureResult.positions;
|
|
8821
8824
|
|
|
8822
8825
|
if (!that._floodTerrainAnalysis) {
|
|
8823
|
-
that._floodTerrainAnalysis = new Cesium.Kq3dFloodTerrainAnalysis(
|
|
8826
|
+
that._floodTerrainAnalysis = new Cesium.Kq3dFloodTerrainAnalysis(that._options);
|
|
8824
8827
|
} else {
|
|
8825
8828
|
that._floodTerrainAnalysis.positions = that._measureResult.positions;
|
|
8826
8829
|
}
|
|
@@ -8947,36 +8950,47 @@ class FloodAnalysisViewModel {
|
|
|
8947
8950
|
|
|
8948
8951
|
|
|
8949
8952
|
setMoveDirection(direction) {
|
|
8950
|
-
|
|
8951
|
-
|
|
8953
|
+
direction = Number(direction);
|
|
8954
|
+
this._options.moveMode = direction;
|
|
8955
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.moveMode = direction;
|
|
8956
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.moveMode = direction;
|
|
8952
8957
|
} //设置淹没速度
|
|
8953
8958
|
|
|
8954
8959
|
|
|
8955
8960
|
setMoveSpeed(speed) {
|
|
8956
|
-
|
|
8957
|
-
|
|
8961
|
+
speed = Number(speed);
|
|
8962
|
+
this._options.speed = speed;
|
|
8963
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.speed = speed;
|
|
8964
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.speed = speed;
|
|
8958
8965
|
} //设置淹没纹理透明度
|
|
8959
8966
|
|
|
8960
8967
|
|
|
8961
8968
|
setMoveAlpha(alpha) {
|
|
8962
|
-
|
|
8963
|
-
|
|
8969
|
+
alpha = Number(alpha);
|
|
8970
|
+
this._options.alpha = alpha;
|
|
8971
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.alpha = alpha;
|
|
8972
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.alpha = alpha;
|
|
8964
8973
|
} //设置最小淹没高度
|
|
8965
8974
|
|
|
8966
8975
|
|
|
8967
8976
|
setMoveMinHeight(minHeight) {
|
|
8968
|
-
|
|
8969
|
-
|
|
8977
|
+
minHeight = Number(minHeight);
|
|
8978
|
+
this._options.minHeight = minHeight;
|
|
8979
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.minHeight = minHeight;
|
|
8980
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.minHeight = minHeight;
|
|
8970
8981
|
} //设置最大淹没高度
|
|
8971
8982
|
|
|
8972
8983
|
|
|
8973
8984
|
setMoveMaxHeight(maxHeight) {
|
|
8974
|
-
|
|
8975
|
-
|
|
8985
|
+
maxHeight = Number(maxHeight);
|
|
8986
|
+
this._options.maxHeight = maxHeight;
|
|
8987
|
+
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.maxHeight = maxHeight;
|
|
8988
|
+
if (this._floodModelAnalysis) this._floodModelAnalysis.maxHeight = maxHeight;
|
|
8976
8989
|
} //设置淹没填充纹理
|
|
8977
8990
|
|
|
8978
8991
|
|
|
8979
8992
|
setMoveImage(image) {
|
|
8993
|
+
this._options.colorImage = image;
|
|
8980
8994
|
if (this._floodTerrainAnalysis) this._floodTerrainAnalysis.colorImage = image;
|
|
8981
8995
|
if (this._floodModelAnalysis) this._floodModelAnalysis.colorImage = image;
|
|
8982
8996
|
}
|
|
@@ -25880,7 +25894,9 @@ var const_image_ = __webpack_require__(9702);
|
|
|
25880
25894
|
//绘制操作类
|
|
25881
25895
|
|
|
25882
25896
|
class DrawManager {
|
|
25883
|
-
|
|
25897
|
+
// 图层分组
|
|
25898
|
+
// 地理编码绘制点图标点击事件
|
|
25899
|
+
// 地理编码绘制点图层分组
|
|
25884
25900
|
// 默认绘制样式提供给绘图组件绑定
|
|
25885
25901
|
// 默认绘制样式
|
|
25886
25902
|
constructor(viewer) {
|
|
@@ -25892,6 +25908,10 @@ class DrawManager {
|
|
|
25892
25908
|
|
|
25893
25909
|
(0,defineProperty/* default */.Z)(this, "_layerGroup", []);
|
|
25894
25910
|
|
|
25911
|
+
(0,defineProperty/* default */.Z)(this, "_handler", null);
|
|
25912
|
+
|
|
25913
|
+
(0,defineProperty/* default */.Z)(this, "_pointGroup", []);
|
|
25914
|
+
|
|
25895
25915
|
(0,defineProperty/* default */.Z)(this, "_defaultStyle", {
|
|
25896
25916
|
color: "#ff0000",
|
|
25897
25917
|
fillColor: "#1E90FF",
|
|
@@ -25935,7 +25955,7 @@ class DrawManager {
|
|
|
25935
25955
|
//线宽
|
|
25936
25956
|
color: "#ff0000",
|
|
25937
25957
|
//线颜色
|
|
25938
|
-
opacity:
|
|
25958
|
+
opacity: 1,
|
|
25939
25959
|
//线颜色透明度
|
|
25940
25960
|
arcType: 1,
|
|
25941
25961
|
clampToGround: true //是否贴地
|
|
@@ -25953,7 +25973,7 @@ class DrawManager {
|
|
|
25953
25973
|
//边框宽度
|
|
25954
25974
|
color: "#ff0000",
|
|
25955
25975
|
//边框颜色
|
|
25956
|
-
opacity:
|
|
25976
|
+
opacity: 1,
|
|
25957
25977
|
//边框颜色透明度
|
|
25958
25978
|
clampToGround: true //是否贴地
|
|
25959
25979
|
|
|
@@ -26028,7 +26048,8 @@ class DrawManager {
|
|
|
26028
26048
|
this._drawStyle.freehandpolygon = this._drawStyle.polygon; //手绘面
|
|
26029
26049
|
|
|
26030
26050
|
this._drawStyle.rectangle = this._drawStyle.polygon; //矩形
|
|
26031
|
-
}
|
|
26051
|
+
} // 获取三维填充样式
|
|
26052
|
+
|
|
26032
26053
|
|
|
26033
26054
|
getFillStyle(fillStyle) {
|
|
26034
26055
|
let lineColor = fillStyle.lineColor || "rgba(0, 0, 255, 1)";
|
|
@@ -26101,7 +26122,9 @@ class DrawManager {
|
|
|
26101
26122
|
if (groupName) shape.groupName = groupName;
|
|
26102
26123
|
that._viewer.scene.globe.depthTestAgainstTerrain = false;
|
|
26103
26124
|
var feature = that.shapeToGeoFeature(shape);
|
|
26104
|
-
callback(feature.geometry
|
|
26125
|
+
callback(feature.geometry, {
|
|
26126
|
+
layer: shape.guid
|
|
26127
|
+
});
|
|
26105
26128
|
removeEventListener();
|
|
26106
26129
|
});
|
|
26107
26130
|
}
|
|
@@ -26420,7 +26443,7 @@ class DrawManager {
|
|
|
26420
26443
|
}
|
|
26421
26444
|
|
|
26422
26445
|
return geoFeature;
|
|
26423
|
-
} //
|
|
26446
|
+
} // 获取所有绘制图层, geojson数据格式 (普通点线面绘制接口使用)
|
|
26424
26447
|
|
|
26425
26448
|
|
|
26426
26449
|
getAllGeometry() {
|
|
@@ -26440,7 +26463,144 @@ class DrawManager {
|
|
|
26440
26463
|
features: features
|
|
26441
26464
|
};
|
|
26442
26465
|
return geojson;
|
|
26466
|
+
} // 设置交互绘制样式, 只设置最后一个图形样式, 绘图组件使用
|
|
26467
|
+
|
|
26468
|
+
|
|
26469
|
+
setDrawStyleById(id, style) {
|
|
26470
|
+
let primitive = this._drawLayer.getById(id);
|
|
26471
|
+
|
|
26472
|
+
if (!primitive) return;
|
|
26473
|
+
let type = primitive.geoType;
|
|
26474
|
+
|
|
26475
|
+
if (type === 'point') {// 绘制点暂时不需要修改样式
|
|
26476
|
+
} else if (type === 'polyline' || type === 'polygon') {
|
|
26477
|
+
if (style.weight) primitive.width = style.weight;
|
|
26478
|
+
if (style.color) primitive.color = Cesium.Color.fromCssColorString(style.color);
|
|
26479
|
+
if (style.dashArray) primitive.dashArray = style.dashArray;
|
|
26480
|
+
}
|
|
26481
|
+
|
|
26482
|
+
if (type === 'polygon') {
|
|
26483
|
+
primitive.fill = style.fill;
|
|
26484
|
+
|
|
26485
|
+
if (style.fill) {
|
|
26486
|
+
let opacity = style.fillOpacity || this._drawStyle.polygon.fillOpacity;
|
|
26487
|
+
if (style.fillColor) primitive.fillColor = Cesium.Color.fromCssColorString(style.fillColor).withAlpha(opacity);
|
|
26488
|
+
}
|
|
26489
|
+
}
|
|
26490
|
+
}
|
|
26491
|
+
/********** 地理编码通用组件使用 start ************/
|
|
26492
|
+
// 绘制点图标自带点击弹出气泡, 地理编码通用组件使用
|
|
26493
|
+
|
|
26494
|
+
|
|
26495
|
+
drawPointWithPoup(data, idCustom = "geocode") {
|
|
26496
|
+
if (!this._handler) {
|
|
26497
|
+
// 注册点击事件
|
|
26498
|
+
let scene = this._viewer.scene;
|
|
26499
|
+
this._handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
|
|
26500
|
+
let that = this;
|
|
26501
|
+
|
|
26502
|
+
this._handler.setInputAction(function (movement) {
|
|
26503
|
+
var pickedObject = scene.pick(movement.position);
|
|
26504
|
+
|
|
26505
|
+
if (pickedObject && pickedObject.id && pickedObject.id instanceof Cesium.Entity) {
|
|
26506
|
+
let entity = pickedObject.id;
|
|
26507
|
+
that.createPointPoup(entity);
|
|
26508
|
+
}
|
|
26509
|
+
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
26510
|
+
|
|
26511
|
+
this._handler.setInputAction(function (movement) {
|
|
26512
|
+
// that.closePointPoup();
|
|
26513
|
+
that.openPointPoup('1002', 'AAA'); // that.removePointAll();
|
|
26514
|
+
//that.clearPointByIdCustom();
|
|
26515
|
+
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
|
|
26516
|
+
}
|
|
26517
|
+
|
|
26518
|
+
let pointDs = this._viewer.dataSources.getByName(idCustom);
|
|
26519
|
+
|
|
26520
|
+
if (pointDs.length === 0) {
|
|
26521
|
+
pointDs = new Cesium.CustomDataSource(idCustom);
|
|
26522
|
+
|
|
26523
|
+
this._viewer.dataSources.add(pointDs);
|
|
26524
|
+
|
|
26525
|
+
this._pointGroup.push(idCustom);
|
|
26526
|
+
} else {
|
|
26527
|
+
pointDs = pointDs[0];
|
|
26528
|
+
}
|
|
26529
|
+
|
|
26530
|
+
let position = Cesium.Cartesian3.fromDegrees(data.lat, data.lon);
|
|
26531
|
+
pointDs.entities.add({
|
|
26532
|
+
position: position,
|
|
26533
|
+
billboard: {
|
|
26534
|
+
image: data.image,
|
|
26535
|
+
width: data.width,
|
|
26536
|
+
height: data.height,
|
|
26537
|
+
verticalOrigin: Cesium.VerticalOrigin.BOTTOM
|
|
26538
|
+
} // properties: data
|
|
26539
|
+
|
|
26540
|
+
});
|
|
26541
|
+
} // 通过entity创建关联气泡
|
|
26542
|
+
|
|
26543
|
+
|
|
26544
|
+
createPointPoup(entity) {
|
|
26545
|
+
if (this._htmlTag) this._htmlTag.destroy();
|
|
26546
|
+
this._htmlTag = new Cesium.Kq3dHtmlTag(this._viewer, {
|
|
26547
|
+
html: '<div>' + entity.properties.id._value + '</div>',
|
|
26548
|
+
position: entity.position,
|
|
26549
|
+
anchor: [0, -entity.properties.height._value],
|
|
26550
|
+
alignmentMode: 7
|
|
26551
|
+
});
|
|
26552
|
+
} // 通过id打开地理编码图标气泡
|
|
26553
|
+
|
|
26554
|
+
|
|
26555
|
+
openPointPoup(id, idCustom = "geocode") {
|
|
26556
|
+
if (id) {
|
|
26557
|
+
let pointDs = this._viewer.dataSources.getByName(idCustom);
|
|
26558
|
+
|
|
26559
|
+
if (pointDs.length > 0) {
|
|
26560
|
+
let entities = pointDs[0].entities.values;
|
|
26561
|
+
|
|
26562
|
+
for (let i = 0; i < entities.length; i++) {
|
|
26563
|
+
if (entities[i].properties.id && entities[i].properties.id._value === id) {
|
|
26564
|
+
this.createPointPoup(entities[i]);
|
|
26565
|
+
break;
|
|
26566
|
+
}
|
|
26567
|
+
}
|
|
26568
|
+
}
|
|
26569
|
+
}
|
|
26570
|
+
} // 关闭地理编码图标点击气泡
|
|
26571
|
+
|
|
26572
|
+
|
|
26573
|
+
closePointPoup() {
|
|
26574
|
+
if (this._htmlTag) this._htmlTag.destroy();
|
|
26575
|
+
} // 清除地理编码指定分组的所有图标
|
|
26576
|
+
|
|
26577
|
+
|
|
26578
|
+
clearPointByIdCustom(idCustom = "geocode") {
|
|
26579
|
+
let pointDs = this._viewer.dataSources.getByName(idCustom);
|
|
26580
|
+
|
|
26581
|
+
if (pointDs.length > 0) {
|
|
26582
|
+
for (let i = 0; i < pointDs.length; i++) {
|
|
26583
|
+
pointDs[i].entities.removeAll();
|
|
26584
|
+
}
|
|
26585
|
+
}
|
|
26586
|
+
} // 删除所有地理编码图标, 包含分组图层
|
|
26587
|
+
|
|
26588
|
+
|
|
26589
|
+
removePointAll() {
|
|
26590
|
+
let that = this;
|
|
26591
|
+
|
|
26592
|
+
this._pointGroup.forEach(group => {
|
|
26593
|
+
let dsList = that._viewer.dataSources.getByName(group);
|
|
26594
|
+
|
|
26595
|
+
for (let i = 0; i < dsList.length; i++) {
|
|
26596
|
+
that._viewer.dataSources.remove(dsList[i], true);
|
|
26597
|
+
}
|
|
26598
|
+
});
|
|
26599
|
+
|
|
26600
|
+
this._pointGroup = [];
|
|
26443
26601
|
}
|
|
26602
|
+
/********** 地理编码通用组件使用 end ************/
|
|
26603
|
+
|
|
26444
26604
|
|
|
26445
26605
|
}
|
|
26446
26606
|
// EXTERNAL MODULE: ./src/common/_ui/message/index.js + 1 modules
|