@kq_npm/client3d_webgl_vue 3.3.4-beta → 3.3.6-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/index.js +88 -50
- package/modelselect/index.js +50 -43
- package/package.json +1 -1
- package/scenceview/index.js +88 -50
- package/sightlineanalysis/index.js +10 -4
package/index.js
CHANGED
|
@@ -754,7 +754,7 @@ class DrawManager {
|
|
|
754
754
|
} //开始绘制
|
|
755
755
|
|
|
756
756
|
|
|
757
|
-
startDraw(type, options, callback) {
|
|
757
|
+
startDraw(type, options, callback, groupName) {
|
|
758
758
|
this._viewer.scene.globe.depthTestAgainstTerrain = true;
|
|
759
759
|
|
|
760
760
|
if (type === "point") {
|
|
@@ -782,6 +782,7 @@ class DrawManager {
|
|
|
782
782
|
if (callback) {
|
|
783
783
|
var that = this;
|
|
784
784
|
var removeEventListener = this.drawFinishedEvent.addEventListener(shape => {
|
|
785
|
+
if (groupName) shape.groupName = groupName;
|
|
785
786
|
that._viewer.scene.globe.depthTestAgainstTerrain = false;
|
|
786
787
|
var feature = that.shapeToGeoFeature(shape);
|
|
787
788
|
callback(feature.geometry);
|
|
@@ -808,6 +809,19 @@ class DrawManager {
|
|
|
808
809
|
} else {
|
|
809
810
|
this._drawHandler.editHandler.deactivate();
|
|
810
811
|
}
|
|
812
|
+
} //清除绘图分组
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
clearDrawGroup(groupName) {
|
|
816
|
+
let primitives = this._drawLayer._primitives;
|
|
817
|
+
|
|
818
|
+
if (primitives && primitives.length > 0) {
|
|
819
|
+
for (let i = primitives.length - 1; i >= 0; i--) {
|
|
820
|
+
if (primitives[i].groupName === groupName) {
|
|
821
|
+
this._drawLayer.removeById(primitives[i].guid);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
811
825
|
} //清除全部手动绘图
|
|
812
826
|
|
|
813
827
|
|
|
@@ -1000,6 +1014,16 @@ class DrawManager {
|
|
|
1000
1014
|
if (index > -1) {
|
|
1001
1015
|
this._layerGroup.splice(index, 1);
|
|
1002
1016
|
}
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
getGeometry(idCustom) {
|
|
1020
|
+
let dsList = this._viewer.dataSources.getByName(idCustom);
|
|
1021
|
+
|
|
1022
|
+
if (dsList.length <= 0) {
|
|
1023
|
+
return "";
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
return dsList;
|
|
1003
1027
|
} //删除所有geojson绘图
|
|
1004
1028
|
|
|
1005
1029
|
|
|
@@ -1639,13 +1663,14 @@ class LayerManager {
|
|
|
1639
1663
|
|
|
1640
1664
|
case "geojson":
|
|
1641
1665
|
var ds = new Cesium.Kq3dGeoJsonDataSource(name);
|
|
1642
|
-
|
|
1666
|
+
var geojsonStyle = layerData.geojsonStyle || this._geojsonStyle;
|
|
1667
|
+
promise = ds.load(url, geojsonStyle).then(ds => {
|
|
1643
1668
|
ds.entities.values.forEach(entity => {
|
|
1644
1669
|
if (entity.polygon) {
|
|
1645
1670
|
entity.polyline = {
|
|
1646
1671
|
positions: entity.polygon.hierarchy._value.positions,
|
|
1647
|
-
width:
|
|
1648
|
-
material:
|
|
1672
|
+
width: geojsonStyle.polygon.outlineWidth,
|
|
1673
|
+
material: geojsonStyle.polygon.outlineColor
|
|
1649
1674
|
};
|
|
1650
1675
|
}
|
|
1651
1676
|
}, this);
|
|
@@ -9035,6 +9060,8 @@ class ModelSelectViewModel {
|
|
|
9035
9060
|
//拾取状态
|
|
9036
9061
|
//高亮三维对象
|
|
9037
9062
|
//高亮颜色
|
|
9063
|
+
// 模型属性唯一值字段集合
|
|
9064
|
+
// 模型属性匹配字段
|
|
9038
9065
|
constructor(scenceView, pickCallFunc) {
|
|
9039
9066
|
_defineProperty(this, "_viewer", null);
|
|
9040
9067
|
|
|
@@ -9046,6 +9073,10 @@ class ModelSelectViewModel {
|
|
|
9046
9073
|
|
|
9047
9074
|
_defineProperty(this, "_highlightColor", "#FF0000");
|
|
9048
9075
|
|
|
9076
|
+
_defineProperty(this, "_modeFiledArray", null);
|
|
9077
|
+
|
|
9078
|
+
_defineProperty(this, "_modeFiled", "id");
|
|
9079
|
+
|
|
9049
9080
|
this._viewer = scenceView._viewer;
|
|
9050
9081
|
this._drawManager = scenceView._drawManager;
|
|
9051
9082
|
this._handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
|
|
@@ -9053,42 +9084,44 @@ class ModelSelectViewModel {
|
|
|
9053
9084
|
|
|
9054
9085
|
this._handler.setInputAction(function (movement) {
|
|
9055
9086
|
if (that._isPick) {
|
|
9056
|
-
that.
|
|
9057
|
-
|
|
9058
|
-
let pickedObject = that._viewer.scene.pick(movement.position); // console.log(pickedObject);
|
|
9087
|
+
let pickedObject = that._viewer.scene.pick(movement.position);
|
|
9059
9088
|
|
|
9089
|
+
console.log(pickedObject);
|
|
9060
9090
|
|
|
9061
9091
|
if (pickedObject) {
|
|
9062
9092
|
if (pickedObject instanceof Cesium.Cesium3DTileFeature) {
|
|
9063
|
-
let properties = pickedObject.getPropertyNames() || [];
|
|
9093
|
+
let properties = pickedObject.getPropertyNames() || [];
|
|
9094
|
+
console.log(properties);
|
|
9095
|
+
|
|
9096
|
+
if (that._modeFiledArray && that._modeFiledArray.length && that._modeFiledArray.length > 0) {
|
|
9097
|
+
for (let val in that._modeFiledArray) {
|
|
9098
|
+
if (properties.indexOf(val) > -1) {
|
|
9099
|
+
that._modeFiled = val;
|
|
9100
|
+
break;
|
|
9101
|
+
}
|
|
9102
|
+
}
|
|
9103
|
+
}
|
|
9064
9104
|
|
|
9065
|
-
that.
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
// properties.forEach(prop => {
|
|
9086
|
-
// attrs[prop] = pickedObject.getProperty(prop);
|
|
9087
|
-
// });
|
|
9088
|
-
// pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
|
|
9089
|
-
// } else {
|
|
9090
|
-
// console.log("Feature has no id attribute!");
|
|
9091
|
-
// }
|
|
9105
|
+
if (properties.indexOf(that._modeFiled) > -1) {
|
|
9106
|
+
let id = pickedObject.getProperty(that._modeFiled); // that.clear();
|
|
9107
|
+
|
|
9108
|
+
that._highlight = new Cesium.Kq3dHighlight({
|
|
9109
|
+
viewer: that._viewer,
|
|
9110
|
+
tileset: pickedObject.tileset,
|
|
9111
|
+
attrName: that._modeFiled,
|
|
9112
|
+
attrValue: [id],
|
|
9113
|
+
color: [Cesium.Color.fromCssColorString(that._highlightColor)]
|
|
9114
|
+
});
|
|
9115
|
+
let attrs = {};
|
|
9116
|
+
properties.forEach(prop => {
|
|
9117
|
+
attrs[prop] = pickedObject.getProperty(prop);
|
|
9118
|
+
});
|
|
9119
|
+
pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
|
|
9120
|
+
} else {
|
|
9121
|
+
console.log("Feature has no id attribute!");
|
|
9122
|
+
}
|
|
9123
|
+
} else {
|
|
9124
|
+
console.log("no Cesium3DTileFeature!");
|
|
9092
9125
|
}
|
|
9093
9126
|
}
|
|
9094
9127
|
}
|
|
@@ -9120,21 +9153,12 @@ class ModelSelectViewModel {
|
|
|
9120
9153
|
type: "warning"
|
|
9121
9154
|
});
|
|
9122
9155
|
}
|
|
9123
|
-
}
|
|
9124
|
-
|
|
9125
|
-
clearHighlight() {
|
|
9126
|
-
if (this._highlight) {
|
|
9127
|
-
this._highlight.object.color = this._highlight.color;
|
|
9128
|
-
}
|
|
9129
|
-
|
|
9130
|
-
this._highlight = null;
|
|
9131
9156
|
} //清除
|
|
9132
9157
|
|
|
9133
9158
|
|
|
9134
9159
|
clear() {
|
|
9135
|
-
this.
|
|
9136
|
-
|
|
9137
|
-
|
|
9160
|
+
this._highlight && this._highlight.remove();
|
|
9161
|
+
this._highlight = null;
|
|
9138
9162
|
this.setCursor("default");
|
|
9139
9163
|
this._isPick = false;
|
|
9140
9164
|
} //销毁
|
|
@@ -9181,6 +9205,13 @@ const ModelSelectvue_type_script_setup_true_lang_js_default_ = {
|
|
|
9181
9205
|
type: String,
|
|
9182
9206
|
default: "#FF0000"
|
|
9183
9207
|
},
|
|
9208
|
+
// 模型属性唯一值字段集合
|
|
9209
|
+
modeFiledArray: {
|
|
9210
|
+
type: Array,
|
|
9211
|
+
default: () => {
|
|
9212
|
+
return null;
|
|
9213
|
+
}
|
|
9214
|
+
},
|
|
9184
9215
|
// 是否显示阴影效果
|
|
9185
9216
|
showShadow: {
|
|
9186
9217
|
type: Boolean,
|
|
@@ -9258,6 +9289,7 @@ const ModelSelectvue_type_script_setup_true_lang_js_default_ = {
|
|
|
9258
9289
|
language.value = scenceView._language;
|
|
9259
9290
|
viewModel = new ModelSelectViewModel(scenceView, pickCallFunc);
|
|
9260
9291
|
viewModel._highlightColor = props.highlightColor;
|
|
9292
|
+
viewModel._modeFiledArray = props.modeFiledArray;
|
|
9261
9293
|
}
|
|
9262
9294
|
});
|
|
9263
9295
|
});
|
|
@@ -9561,12 +9593,14 @@ class SightlineAnalysisViewModel {
|
|
|
9561
9593
|
|
|
9562
9594
|
|
|
9563
9595
|
createBillboard(pos) {
|
|
9596
|
+
if (this._addType == 1) this.clearBillboards("marker" + this._addType);
|
|
9597
|
+
|
|
9564
9598
|
this._billboards.push(this._viewer.entities.add({
|
|
9565
9599
|
position: pos,
|
|
9600
|
+
name: "marker" + this._addType,
|
|
9566
9601
|
billboard: {
|
|
9567
9602
|
image: this._addType === 1 ? const_image_namespaceObject.OBSERVATION_POINT : const_image_namespaceObject.TARGET_POINT,
|
|
9568
9603
|
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
9569
|
-
scale: 0.15,
|
|
9570
9604
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
9571
9605
|
}
|
|
9572
9606
|
}));
|
|
@@ -9691,12 +9725,16 @@ class SightlineAnalysisViewModel {
|
|
|
9691
9725
|
} // 清楚billboards
|
|
9692
9726
|
|
|
9693
9727
|
|
|
9694
|
-
clearBillboards() {
|
|
9728
|
+
clearBillboards(val) {
|
|
9695
9729
|
for (var i = 0; i < this._billboards.length; i++) {
|
|
9696
|
-
|
|
9730
|
+
if (val) {
|
|
9731
|
+
if (this._billboards[i].name == val) this._viewer.entities.remove(this._billboards[i]);
|
|
9732
|
+
} else {
|
|
9733
|
+
this._viewer.entities.remove(this._billboards[i]);
|
|
9734
|
+
}
|
|
9697
9735
|
}
|
|
9698
9736
|
|
|
9699
|
-
this._billboards = [];
|
|
9737
|
+
if (!val) this._billboards = [];
|
|
9700
9738
|
} //清除全部
|
|
9701
9739
|
|
|
9702
9740
|
|
package/modelselect/index.js
CHANGED
|
@@ -185,6 +185,8 @@ class ModelSelectViewModel {
|
|
|
185
185
|
//拾取状态
|
|
186
186
|
//高亮三维对象
|
|
187
187
|
//高亮颜色
|
|
188
|
+
// 模型属性唯一值字段集合
|
|
189
|
+
// 模型属性匹配字段
|
|
188
190
|
constructor(scenceView, pickCallFunc) {
|
|
189
191
|
(0,defineProperty/* default */.Z)(this, "_viewer", null);
|
|
190
192
|
|
|
@@ -196,6 +198,10 @@ class ModelSelectViewModel {
|
|
|
196
198
|
|
|
197
199
|
(0,defineProperty/* default */.Z)(this, "_highlightColor", "#FF0000");
|
|
198
200
|
|
|
201
|
+
(0,defineProperty/* default */.Z)(this, "_modeFiledArray", null);
|
|
202
|
+
|
|
203
|
+
(0,defineProperty/* default */.Z)(this, "_modeFiled", "id");
|
|
204
|
+
|
|
199
205
|
this._viewer = scenceView._viewer;
|
|
200
206
|
this._drawManager = scenceView._drawManager;
|
|
201
207
|
this._handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
|
|
@@ -203,42 +209,44 @@ class ModelSelectViewModel {
|
|
|
203
209
|
|
|
204
210
|
this._handler.setInputAction(function (movement) {
|
|
205
211
|
if (that._isPick) {
|
|
206
|
-
that.
|
|
207
|
-
|
|
208
|
-
let pickedObject = that._viewer.scene.pick(movement.position); // console.log(pickedObject);
|
|
212
|
+
let pickedObject = that._viewer.scene.pick(movement.position);
|
|
209
213
|
|
|
214
|
+
console.log(pickedObject);
|
|
210
215
|
|
|
211
216
|
if (pickedObject) {
|
|
212
217
|
if (pickedObject instanceof Cesium.Cesium3DTileFeature) {
|
|
213
|
-
let properties = pickedObject.getPropertyNames() || [];
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
218
|
+
let properties = pickedObject.getPropertyNames() || [];
|
|
219
|
+
console.log(properties);
|
|
220
|
+
|
|
221
|
+
if (that._modeFiledArray && that._modeFiledArray.length && that._modeFiledArray.length > 0) {
|
|
222
|
+
for (let val in that._modeFiledArray) {
|
|
223
|
+
if (properties.indexOf(val) > -1) {
|
|
224
|
+
that._modeFiled = val;
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (properties.indexOf(that._modeFiled) > -1) {
|
|
231
|
+
let id = pickedObject.getProperty(that._modeFiled); // that.clear();
|
|
232
|
+
|
|
233
|
+
that._highlight = new Cesium.Kq3dHighlight({
|
|
234
|
+
viewer: that._viewer,
|
|
235
|
+
tileset: pickedObject.tileset,
|
|
236
|
+
attrName: that._modeFiled,
|
|
237
|
+
attrValue: [id],
|
|
238
|
+
color: [Cesium.Color.fromCssColorString(that._highlightColor)]
|
|
239
|
+
});
|
|
240
|
+
let attrs = {};
|
|
241
|
+
properties.forEach(prop => {
|
|
242
|
+
attrs[prop] = pickedObject.getProperty(prop);
|
|
243
|
+
});
|
|
244
|
+
pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
|
|
245
|
+
} else {
|
|
246
|
+
console.log("Feature has no id attribute!");
|
|
247
|
+
}
|
|
248
|
+
} else {
|
|
249
|
+
console.log("no Cesium3DTileFeature!");
|
|
242
250
|
}
|
|
243
251
|
}
|
|
244
252
|
}
|
|
@@ -270,21 +278,12 @@ class ModelSelectViewModel {
|
|
|
270
278
|
type: "warning"
|
|
271
279
|
});
|
|
272
280
|
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
clearHighlight() {
|
|
276
|
-
if (this._highlight) {
|
|
277
|
-
this._highlight.object.color = this._highlight.color;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
this._highlight = null;
|
|
281
281
|
} //清除
|
|
282
282
|
|
|
283
283
|
|
|
284
284
|
clear() {
|
|
285
|
-
this.
|
|
286
|
-
|
|
287
|
-
|
|
285
|
+
this._highlight && this._highlight.remove();
|
|
286
|
+
this._highlight = null;
|
|
288
287
|
this.setCursor("default");
|
|
289
288
|
this._isPick = false;
|
|
290
289
|
} //销毁
|
|
@@ -335,6 +334,13 @@ const __default__ = {
|
|
|
335
334
|
type: String,
|
|
336
335
|
default: "#FF0000"
|
|
337
336
|
},
|
|
337
|
+
// 模型属性唯一值字段集合
|
|
338
|
+
modeFiledArray: {
|
|
339
|
+
type: Array,
|
|
340
|
+
default: () => {
|
|
341
|
+
return null;
|
|
342
|
+
}
|
|
343
|
+
},
|
|
338
344
|
// 是否显示阴影效果
|
|
339
345
|
showShadow: {
|
|
340
346
|
type: Boolean,
|
|
@@ -412,6 +418,7 @@ const __default__ = {
|
|
|
412
418
|
language.value = scenceView._language;
|
|
413
419
|
viewModel = new ModelSelectViewModel(scenceView, pickCallFunc);
|
|
414
420
|
viewModel._highlightColor = props.highlightColor;
|
|
421
|
+
viewModel._modeFiledArray = props.modeFiledArray;
|
|
415
422
|
}
|
|
416
423
|
});
|
|
417
424
|
});
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"3.3.
|
|
1
|
+
{"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"3.3.6-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
|
@@ -14375,6 +14375,8 @@ class ModelSelectViewModel {
|
|
|
14375
14375
|
//拾取状态
|
|
14376
14376
|
//高亮三维对象
|
|
14377
14377
|
//高亮颜色
|
|
14378
|
+
// 模型属性唯一值字段集合
|
|
14379
|
+
// 模型属性匹配字段
|
|
14378
14380
|
constructor(scenceView, pickCallFunc) {
|
|
14379
14381
|
(0,defineProperty/* default */.Z)(this, "_viewer", null);
|
|
14380
14382
|
|
|
@@ -14386,6 +14388,10 @@ class ModelSelectViewModel {
|
|
|
14386
14388
|
|
|
14387
14389
|
(0,defineProperty/* default */.Z)(this, "_highlightColor", "#FF0000");
|
|
14388
14390
|
|
|
14391
|
+
(0,defineProperty/* default */.Z)(this, "_modeFiledArray", null);
|
|
14392
|
+
|
|
14393
|
+
(0,defineProperty/* default */.Z)(this, "_modeFiled", "id");
|
|
14394
|
+
|
|
14389
14395
|
this._viewer = scenceView._viewer;
|
|
14390
14396
|
this._drawManager = scenceView._drawManager;
|
|
14391
14397
|
this._handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
|
|
@@ -14393,42 +14399,44 @@ class ModelSelectViewModel {
|
|
|
14393
14399
|
|
|
14394
14400
|
this._handler.setInputAction(function (movement) {
|
|
14395
14401
|
if (that._isPick) {
|
|
14396
|
-
that.
|
|
14397
|
-
|
|
14398
|
-
let pickedObject = that._viewer.scene.pick(movement.position); // console.log(pickedObject);
|
|
14402
|
+
let pickedObject = that._viewer.scene.pick(movement.position);
|
|
14399
14403
|
|
|
14404
|
+
console.log(pickedObject);
|
|
14400
14405
|
|
|
14401
14406
|
if (pickedObject) {
|
|
14402
14407
|
if (pickedObject instanceof Cesium.Cesium3DTileFeature) {
|
|
14403
|
-
let properties = pickedObject.getPropertyNames() || [];
|
|
14408
|
+
let properties = pickedObject.getPropertyNames() || [];
|
|
14409
|
+
console.log(properties);
|
|
14410
|
+
|
|
14411
|
+
if (that._modeFiledArray && that._modeFiledArray.length && that._modeFiledArray.length > 0) {
|
|
14412
|
+
for (let val in that._modeFiledArray) {
|
|
14413
|
+
if (properties.indexOf(val) > -1) {
|
|
14414
|
+
that._modeFiled = val;
|
|
14415
|
+
break;
|
|
14416
|
+
}
|
|
14417
|
+
}
|
|
14418
|
+
}
|
|
14404
14419
|
|
|
14405
|
-
that.
|
|
14406
|
-
|
|
14407
|
-
|
|
14408
|
-
|
|
14409
|
-
|
|
14410
|
-
|
|
14411
|
-
|
|
14412
|
-
|
|
14413
|
-
|
|
14414
|
-
|
|
14415
|
-
|
|
14416
|
-
|
|
14417
|
-
|
|
14418
|
-
|
|
14419
|
-
|
|
14420
|
-
|
|
14421
|
-
|
|
14422
|
-
|
|
14423
|
-
|
|
14424
|
-
|
|
14425
|
-
// properties.forEach(prop => {
|
|
14426
|
-
// attrs[prop] = pickedObject.getProperty(prop);
|
|
14427
|
-
// });
|
|
14428
|
-
// pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
|
|
14429
|
-
// } else {
|
|
14430
|
-
// console.log("Feature has no id attribute!");
|
|
14431
|
-
// }
|
|
14420
|
+
if (properties.indexOf(that._modeFiled) > -1) {
|
|
14421
|
+
let id = pickedObject.getProperty(that._modeFiled); // that.clear();
|
|
14422
|
+
|
|
14423
|
+
that._highlight = new Cesium.Kq3dHighlight({
|
|
14424
|
+
viewer: that._viewer,
|
|
14425
|
+
tileset: pickedObject.tileset,
|
|
14426
|
+
attrName: that._modeFiled,
|
|
14427
|
+
attrValue: [id],
|
|
14428
|
+
color: [Cesium.Color.fromCssColorString(that._highlightColor)]
|
|
14429
|
+
});
|
|
14430
|
+
let attrs = {};
|
|
14431
|
+
properties.forEach(prop => {
|
|
14432
|
+
attrs[prop] = pickedObject.getProperty(prop);
|
|
14433
|
+
});
|
|
14434
|
+
pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
|
|
14435
|
+
} else {
|
|
14436
|
+
console.log("Feature has no id attribute!");
|
|
14437
|
+
}
|
|
14438
|
+
} else {
|
|
14439
|
+
console.log("no Cesium3DTileFeature!");
|
|
14432
14440
|
}
|
|
14433
14441
|
}
|
|
14434
14442
|
}
|
|
@@ -14460,21 +14468,12 @@ class ModelSelectViewModel {
|
|
|
14460
14468
|
type: "warning"
|
|
14461
14469
|
});
|
|
14462
14470
|
}
|
|
14463
|
-
}
|
|
14464
|
-
|
|
14465
|
-
clearHighlight() {
|
|
14466
|
-
if (this._highlight) {
|
|
14467
|
-
this._highlight.object.color = this._highlight.color;
|
|
14468
|
-
}
|
|
14469
|
-
|
|
14470
|
-
this._highlight = null;
|
|
14471
14471
|
} //清除
|
|
14472
14472
|
|
|
14473
14473
|
|
|
14474
14474
|
clear() {
|
|
14475
|
-
this.
|
|
14476
|
-
|
|
14477
|
-
|
|
14475
|
+
this._highlight && this._highlight.remove();
|
|
14476
|
+
this._highlight = null;
|
|
14478
14477
|
this.setCursor("default");
|
|
14479
14478
|
this._isPick = false;
|
|
14480
14479
|
} //销毁
|
|
@@ -14525,6 +14524,13 @@ const __default__ = {
|
|
|
14525
14524
|
type: String,
|
|
14526
14525
|
default: "#FF0000"
|
|
14527
14526
|
},
|
|
14527
|
+
// 模型属性唯一值字段集合
|
|
14528
|
+
modeFiledArray: {
|
|
14529
|
+
type: Array,
|
|
14530
|
+
default: () => {
|
|
14531
|
+
return null;
|
|
14532
|
+
}
|
|
14533
|
+
},
|
|
14528
14534
|
// 是否显示阴影效果
|
|
14529
14535
|
showShadow: {
|
|
14530
14536
|
type: Boolean,
|
|
@@ -14602,6 +14608,7 @@ const __default__ = {
|
|
|
14602
14608
|
language.value = scenceView._language;
|
|
14603
14609
|
viewModel = new ModelSelectViewModel(scenceView, pickCallFunc);
|
|
14604
14610
|
viewModel._highlightColor = props.highlightColor;
|
|
14611
|
+
viewModel._modeFiledArray = props.modeFiledArray;
|
|
14605
14612
|
}
|
|
14606
14613
|
});
|
|
14607
14614
|
});
|
|
@@ -20162,12 +20169,14 @@ class SightlineAnalysisViewModel {
|
|
|
20162
20169
|
|
|
20163
20170
|
|
|
20164
20171
|
createBillboard(pos) {
|
|
20172
|
+
if (this._addType == 1) this.clearBillboards("marker" + this._addType);
|
|
20173
|
+
|
|
20165
20174
|
this._billboards.push(this._viewer.entities.add({
|
|
20166
20175
|
position: pos,
|
|
20176
|
+
name: "marker" + this._addType,
|
|
20167
20177
|
billboard: {
|
|
20168
20178
|
image: this._addType === 1 ? const_image_.OBSERVATION_POINT : const_image_.TARGET_POINT,
|
|
20169
20179
|
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
20170
|
-
scale: 0.15,
|
|
20171
20180
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
20172
20181
|
}
|
|
20173
20182
|
}));
|
|
@@ -20292,12 +20301,16 @@ class SightlineAnalysisViewModel {
|
|
|
20292
20301
|
} // 清楚billboards
|
|
20293
20302
|
|
|
20294
20303
|
|
|
20295
|
-
clearBillboards() {
|
|
20304
|
+
clearBillboards(val) {
|
|
20296
20305
|
for (var i = 0; i < this._billboards.length; i++) {
|
|
20297
|
-
|
|
20306
|
+
if (val) {
|
|
20307
|
+
if (this._billboards[i].name == val) this._viewer.entities.remove(this._billboards[i]);
|
|
20308
|
+
} else {
|
|
20309
|
+
this._viewer.entities.remove(this._billboards[i]);
|
|
20310
|
+
}
|
|
20298
20311
|
}
|
|
20299
20312
|
|
|
20300
|
-
this._billboards = [];
|
|
20313
|
+
if (!val) this._billboards = [];
|
|
20301
20314
|
} //清除全部
|
|
20302
20315
|
|
|
20303
20316
|
|
|
@@ -26058,7 +26071,7 @@ class DrawManager {
|
|
|
26058
26071
|
} //开始绘制
|
|
26059
26072
|
|
|
26060
26073
|
|
|
26061
|
-
startDraw(type, options, callback) {
|
|
26074
|
+
startDraw(type, options, callback, groupName) {
|
|
26062
26075
|
this._viewer.scene.globe.depthTestAgainstTerrain = true;
|
|
26063
26076
|
|
|
26064
26077
|
if (type === "point") {
|
|
@@ -26086,6 +26099,7 @@ class DrawManager {
|
|
|
26086
26099
|
if (callback) {
|
|
26087
26100
|
var that = this;
|
|
26088
26101
|
var removeEventListener = this.drawFinishedEvent.addEventListener(shape => {
|
|
26102
|
+
if (groupName) shape.groupName = groupName;
|
|
26089
26103
|
that._viewer.scene.globe.depthTestAgainstTerrain = false;
|
|
26090
26104
|
var feature = that.shapeToGeoFeature(shape);
|
|
26091
26105
|
callback(feature.geometry);
|
|
@@ -26112,6 +26126,19 @@ class DrawManager {
|
|
|
26112
26126
|
} else {
|
|
26113
26127
|
this._drawHandler.editHandler.deactivate();
|
|
26114
26128
|
}
|
|
26129
|
+
} //清除绘图分组
|
|
26130
|
+
|
|
26131
|
+
|
|
26132
|
+
clearDrawGroup(groupName) {
|
|
26133
|
+
let primitives = this._drawLayer._primitives;
|
|
26134
|
+
|
|
26135
|
+
if (primitives && primitives.length > 0) {
|
|
26136
|
+
for (let i = primitives.length - 1; i >= 0; i--) {
|
|
26137
|
+
if (primitives[i].groupName === groupName) {
|
|
26138
|
+
this._drawLayer.removeById(primitives[i].guid);
|
|
26139
|
+
}
|
|
26140
|
+
}
|
|
26141
|
+
}
|
|
26115
26142
|
} //清除全部手动绘图
|
|
26116
26143
|
|
|
26117
26144
|
|
|
@@ -26304,6 +26331,16 @@ class DrawManager {
|
|
|
26304
26331
|
if (index > -1) {
|
|
26305
26332
|
this._layerGroup.splice(index, 1);
|
|
26306
26333
|
}
|
|
26334
|
+
}
|
|
26335
|
+
|
|
26336
|
+
getGeometry(idCustom) {
|
|
26337
|
+
let dsList = this._viewer.dataSources.getByName(idCustom);
|
|
26338
|
+
|
|
26339
|
+
if (dsList.length <= 0) {
|
|
26340
|
+
return "";
|
|
26341
|
+
}
|
|
26342
|
+
|
|
26343
|
+
return dsList;
|
|
26307
26344
|
} //删除所有geojson绘图
|
|
26308
26345
|
|
|
26309
26346
|
|
|
@@ -26930,13 +26967,14 @@ class LayerManager {
|
|
|
26930
26967
|
|
|
26931
26968
|
case "geojson":
|
|
26932
26969
|
var ds = new Cesium.Kq3dGeoJsonDataSource(name);
|
|
26933
|
-
|
|
26970
|
+
var geojsonStyle = layerData.geojsonStyle || this._geojsonStyle;
|
|
26971
|
+
promise = ds.load(url, geojsonStyle).then(ds => {
|
|
26934
26972
|
ds.entities.values.forEach(entity => {
|
|
26935
26973
|
if (entity.polygon) {
|
|
26936
26974
|
entity.polyline = {
|
|
26937
26975
|
positions: entity.polygon.hierarchy._value.positions,
|
|
26938
|
-
width:
|
|
26939
|
-
material:
|
|
26976
|
+
width: geojsonStyle.polygon.outlineWidth,
|
|
26977
|
+
material: geojsonStyle.polygon.outlineColor
|
|
26940
26978
|
};
|
|
26941
26979
|
}
|
|
26942
26980
|
}, this);
|
|
@@ -642,12 +642,14 @@ class SightlineAnalysisViewModel {
|
|
|
642
642
|
|
|
643
643
|
|
|
644
644
|
createBillboard(pos) {
|
|
645
|
+
if (this._addType == 1) this.clearBillboards("marker" + this._addType);
|
|
646
|
+
|
|
645
647
|
this._billboards.push(this._viewer.entities.add({
|
|
646
648
|
position: pos,
|
|
649
|
+
name: "marker" + this._addType,
|
|
647
650
|
billboard: {
|
|
648
651
|
image: this._addType === 1 ? const_image_.OBSERVATION_POINT : const_image_.TARGET_POINT,
|
|
649
652
|
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
650
|
-
scale: 0.15,
|
|
651
653
|
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
652
654
|
}
|
|
653
655
|
}));
|
|
@@ -772,12 +774,16 @@ class SightlineAnalysisViewModel {
|
|
|
772
774
|
} // 清楚billboards
|
|
773
775
|
|
|
774
776
|
|
|
775
|
-
clearBillboards() {
|
|
777
|
+
clearBillboards(val) {
|
|
776
778
|
for (var i = 0; i < this._billboards.length; i++) {
|
|
777
|
-
|
|
779
|
+
if (val) {
|
|
780
|
+
if (this._billboards[i].name == val) this._viewer.entities.remove(this._billboards[i]);
|
|
781
|
+
} else {
|
|
782
|
+
this._viewer.entities.remove(this._billboards[i]);
|
|
783
|
+
}
|
|
778
784
|
}
|
|
779
785
|
|
|
780
|
-
this._billboards = [];
|
|
786
|
+
if (!val) this._billboards = [];
|
|
781
787
|
} //清除全部
|
|
782
788
|
|
|
783
789
|
|