@kq_npm/client3d_webgl_vue 3.1.1-beta → 3.1.3-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.
@@ -726,7 +726,8 @@ class AddDataViewModel {
726
726
  serverType: "imagerylayer",
727
727
  lsType: "ls",
728
728
  url: url,
729
- addType: type
729
+ addType: type,
730
+ layerName: name
730
731
  };
731
732
 
732
733
  this._layerManager.addTempLayerNode(node);
@@ -787,13 +788,13 @@ class AddDataViewModel {
787
788
  });
788
789
  }
789
790
 
791
+ setChildrenAddType(mapServerInfo.layerTreeData, type);
790
792
  mapServerInfo.layerTreeData.forEach(node => {
791
793
  node.lsType = "ls";
792
- node.serverType = "imagerylayer";
793
- node.addType = type;
794
794
 
795
795
  this._layerManager.addTempLayerNode(node, 1);
796
796
 
797
+ console.log(node);
797
798
  cb && cb(node);
798
799
  }, this);
799
800
  });
@@ -843,7 +844,7 @@ class AddDataViewModel {
843
844
  serverType: "imagerylayer",
844
845
  url: url,
845
846
  addType: type,
846
- id: layers[i].layers
847
+ id: layers[i]._imageryProvider.layers
847
848
  });
848
849
  }
849
850
  }
@@ -878,7 +879,7 @@ class AddDataViewModel {
878
879
  serverType: "imagerylayer",
879
880
  url: url,
880
881
  addType: type,
881
- id: layers[i]._layer
882
+ id: layers[i]._imageryProvider._layer
882
883
  });
883
884
  }
884
885
  }
@@ -1041,6 +1042,18 @@ class AddDataViewModel {
1041
1042
  }
1042
1043
  }
1043
1044
 
1045
+ } // 设置子节点addType属性
1046
+
1047
+ function setChildrenAddType(nodeList, addType) {
1048
+ for (let i = 0; i < nodeList.length; i++) {
1049
+ const node = nodeList[i];
1050
+
1051
+ if (node.children) {
1052
+ setChildrenAddType(node.children, addType);
1053
+ } else {
1054
+ node.addType = addType;
1055
+ }
1056
+ }
1044
1057
  }
1045
1058
  ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/webgl/adddata/AddData.vue?vue&type=script&setup=true&lang=js
1046
1059
 
@@ -7573,13 +7586,15 @@ class GPUSpatialQueryViewModel {
7573
7586
  var that = this;
7574
7587
  that._removeEventListener = that._drawManager.drawFinishedEvent.addEventListener(shape => {
7575
7588
  if (shape) {
7576
- that._drawManager.clear();
7577
-
7589
+ that._drawManager && that._drawManager.clear();
7578
7590
  that._center = shape.position; //that.startQuery();
7579
7591
 
7580
7592
  setTimeout(() => {
7581
7593
  //绘制跟高亮显示有冲突,所以延时执行查询
7582
7594
  that.startQuery();
7595
+ that._drawManager && that._drawManager.startDraw("marker", {
7596
+ image: null
7597
+ });
7583
7598
  }, 10);
7584
7599
  }
7585
7600
  });
@@ -7637,6 +7652,7 @@ class GPUSpatialQueryViewModel {
7637
7652
  }
7638
7653
 
7639
7654
  if (flag) {
7655
+ this.clear();
7640
7656
  this.findLayers();
7641
7657
 
7642
7658
  this._drawManager.startDraw("marker", {
@@ -12132,6 +12148,7 @@ class ModelSelectViewModel {
12132
12148
  //屏幕空间事件处理程序三维对象
12133
12149
  //拾取状态
12134
12150
  //高亮三维对象
12151
+ //高亮颜色
12135
12152
  constructor(scenceView, pickCallFunc) {
12136
12153
  (0,_Users_zpc_Documents_KQGEOSpace_KQGISClientForVue_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(this, "_viewer", null);
12137
12154
 
@@ -12141,7 +12158,7 @@ class ModelSelectViewModel {
12141
12158
 
12142
12159
  (0,_Users_zpc_Documents_KQGEOSpace_KQGISClientForVue_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(this, "_highlight", null);
12143
12160
 
12144
- (0,_Users_zpc_Documents_KQGEOSpace_KQGISClientForVue_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(this, "_modeFiled", 'id');
12161
+ (0,_Users_zpc_Documents_KQGEOSpace_KQGISClientForVue_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(this, "_highlightColor", "#FF0000");
12145
12162
 
12146
12163
  this._viewer = scenceView._viewer;
12147
12164
  this._drawManager = scenceView._drawManager;
@@ -12150,32 +12167,42 @@ class ModelSelectViewModel {
12150
12167
 
12151
12168
  this._handler.setInputAction(function (movement) {
12152
12169
  if (that._isPick) {
12153
- let pickedObject = that._viewer.scene.pick(movement.position); //console.log(pickedObject);
12170
+ that.clearHighlight();
12171
+
12172
+ let pickedObject = that._viewer.scene.pick(movement.position); // console.log(pickedObject);
12154
12173
 
12155
12174
 
12156
12175
  if (pickedObject) {
12157
12176
  if (pickedObject instanceof Cesium.Cesium3DTileFeature) {
12158
- let properties = pickedObject.getPropertyNames() || [];
12159
- console.log(properties);
12160
-
12161
- if (properties.indexOf(that._modeFiled) > -1) {
12162
- let id = pickedObject.getProperty(that._modeFiled); // that.clear();
12163
-
12164
- that._highlight = new Cesium.Kq3dHighlight({
12165
- viewer: that._viewer,
12166
- tileset: pickedObject.tileset,
12167
- attrName: that._modeFiled,
12168
- attrValue: [id],
12169
- color: [Cesium.Color.RED]
12170
- });
12171
- let attrs = {};
12172
- properties.forEach(prop => {
12173
- attrs[prop] = pickedObject.getProperty(prop);
12174
- });
12175
- pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
12176
- } else {
12177
- console.log("Feature has no id attribute!");
12178
- }
12177
+ let properties = pickedObject.getPropertyNames() || []; // console.log(properties);
12178
+
12179
+ that._highlight = {
12180
+ object: pickedObject.pickId.object,
12181
+ color: pickedObject.pickId.object.color
12182
+ };
12183
+ pickedObject.pickId.object.color = Cesium.Color.fromCssColorString(that._highlightColor);
12184
+ let attrs = {};
12185
+ properties.forEach(prop => {
12186
+ attrs[prop] = pickedObject.getProperty(prop);
12187
+ });
12188
+ pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs); // if (properties.indexOf(that._modeFiled) > -1) {
12189
+ // let id = pickedObject.getProperty(that._modeFiled);
12190
+ // // that.clear();
12191
+ // that._highlight = new Cesium.Kq3dHighlight({
12192
+ // viewer: that._viewer,
12193
+ // tileset: pickedObject.tileset,
12194
+ // attrName: that._modeFiled,
12195
+ // attrValue: [id],
12196
+ // color: [Cesium.Color.RED]
12197
+ // });
12198
+ // let attrs = {};
12199
+ // properties.forEach(prop => {
12200
+ // attrs[prop] = pickedObject.getProperty(prop);
12201
+ // });
12202
+ // pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
12203
+ // } else {
12204
+ // console.log("Feature has no id attribute!");
12205
+ // }
12179
12206
  }
12180
12207
  }
12181
12208
  }
@@ -12204,12 +12231,21 @@ class ModelSelectViewModel {
12204
12231
  } else {
12205
12232
  throw "请添加模型后拾取!";
12206
12233
  }
12234
+ }
12235
+
12236
+ clearHighlight() {
12237
+ if (this._highlight) {
12238
+ this._highlight.object.color = this._highlight.color;
12239
+ }
12240
+
12241
+ this._highlight = null;
12207
12242
  } //清除
12208
12243
 
12209
12244
 
12210
12245
  clear() {
12211
- this._highlight && this._highlight.remove();
12212
- this._highlight = null;
12246
+ this.clearHighlight(); // this._highlight && this._highlight.remove();
12247
+ // this._highlight = null;
12248
+
12213
12249
  this.setCursor("default");
12214
12250
  this._isPick = false;
12215
12251
  } //销毁
@@ -12251,16 +12287,21 @@ const _hoisted_1 = {
12251
12287
  class: "kq3d-model-select-box"
12252
12288
  };
12253
12289
  const _hoisted_2 = {
12254
- class: "modelTree"
12290
+ class: "title"
12255
12291
  };
12256
- const _hoisted_3 = {
12292
+
12293
+ const _hoisted_3 = /*#__PURE__*/(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("span", null, "所属图层名称:", -1
12294
+ /* HOISTED */
12295
+ );
12296
+
12297
+ const _hoisted_4 = {
12257
12298
  class: "footer-buttons"
12258
12299
  };
12259
12300
 
12260
12301
 
12261
12302
 
12262
12303
 
12263
- // 树绑定字段
12304
+ // tree数据源
12264
12305
 
12265
12306
  const __default__ = {
12266
12307
  name: "Kq3dModelSelect"
@@ -12269,14 +12310,15 @@ const __default__ = {
12269
12310
  props: {
12270
12311
  //指定组件绑定的viewer对象的div的id
12271
12312
  mapTarget: String,
12272
- modeFiled: {
12273
- default: "id",
12274
- type: String
12275
- },
12276
12313
  // 外部字段别名映射
12277
12314
  aliasNameReflection: {
12278
12315
  type: Function
12279
12316
  },
12317
+ // 高亮颜色
12318
+ highlightColor: {
12319
+ type: String,
12320
+ default: "#FF0000"
12321
+ },
12280
12322
  // 是否显示阴影效果
12281
12323
  showShadow: {
12282
12324
  type: Boolean,
@@ -12317,12 +12359,7 @@ const __default__ = {
12317
12359
  expose
12318
12360
  }) {
12319
12361
  const props = __props;
12320
- const defaultProps = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.reactive)({
12321
- children: "children",
12322
- label: "label"
12323
- }); // tree数据源
12324
-
12325
- let treeData = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)([]); // 属性值
12362
+ let layerNameTitle = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(""); // 属性值
12326
12363
 
12327
12364
  let tableData = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)([]); //语言
12328
12365
 
@@ -12357,6 +12394,7 @@ const __default__ = {
12357
12394
  if (scenceView) {
12358
12395
  language.value = scenceView._language;
12359
12396
  viewModel = new ModelSelectViewModel/* default */.Z(scenceView, pickCallFunc);
12397
+ viewModel._highlightColor = props.highlightColor;
12360
12398
  }
12361
12399
  });
12362
12400
  });
@@ -12371,36 +12409,45 @@ const __default__ = {
12371
12409
  }
12372
12410
  };
12373
12411
 
12374
- function setModeFiled(val) {
12375
- viewModel._modeFiled = val;
12376
- }
12377
-
12378
12412
  function pick() {
12379
12413
  viewModel && viewModel.pick();
12380
12414
  }
12381
12415
 
12382
12416
  function pickCallFunc(layerName, properties) {
12383
- let newTreeData = [{
12384
- label: layerName,
12385
- children: [{
12386
- label: properties.id || "Model1"
12387
- }]
12388
- }];
12389
- treeData.value = newTreeData;
12417
+ layerNameTitle.value = layerName;
12390
12418
  let propertiesData = [];
12391
12419
 
12392
- for (let key in properties) {
12393
- propertiesData.push({
12394
- field: key,
12395
- value: properties[key]
12420
+ if (props.aliasNameReflection) {
12421
+ let arrKeys = [];
12422
+
12423
+ for (let key in properties) {
12424
+ arrKeys.push(key);
12425
+ }
12426
+
12427
+ props.aliasNameReflection(arrKeys, item => {
12428
+ console.log(item);
12429
+
12430
+ for (let key in properties) {
12431
+ propertiesData.push({
12432
+ field: item[key] ? item[key] : key,
12433
+ value: properties[key]
12434
+ });
12435
+ }
12396
12436
  });
12437
+ } else {
12438
+ for (let key in properties) {
12439
+ propertiesData.push({
12440
+ field: key,
12441
+ value: properties[key]
12442
+ });
12443
+ }
12397
12444
  }
12398
12445
 
12399
12446
  tableData.value = propertiesData;
12400
12447
  }
12401
12448
 
12402
12449
  function clear() {
12403
- treeData.value = [];
12450
+ layerNameTitle.value = "";
12404
12451
  tableData.value = [];
12405
12452
  viewModel && viewModel.clear();
12406
12453
  } // 销毁
@@ -12412,22 +12459,15 @@ const __default__ = {
12412
12459
  expose({
12413
12460
  pick,
12414
12461
  clear,
12415
- pickCallFunc,
12416
- setModeFiled
12462
+ pickCallFunc
12417
12463
  });
12418
12464
  return (_ctx, _cache) => {
12419
- const _component_KqTree = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("KqTree");
12420
-
12421
- const _component_kq_scrollbar = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-scrollbar");
12422
-
12423
- const _component_kq_col = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-col");
12465
+ const _component_kq_row = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-row");
12424
12466
 
12425
12467
  const _component_kq_table_column = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-table-column");
12426
12468
 
12427
12469
  const _component_kq_table = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-table");
12428
12470
 
12429
- const _component_kq_row = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-row");
12430
-
12431
12471
  const _component_kq_button = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-button");
12432
12472
 
12433
12473
  return (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementBlock)("section", {
@@ -12443,72 +12483,51 @@ const __default__ = {
12443
12483
  }, null, 512
12444
12484
  /* NEED_PATCH */
12445
12485
  )) : (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createCommentVNode)("v-if", true), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_1, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_row, null, {
12446
- default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_col, {
12447
- span: 8
12448
- }, {
12449
- default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_2, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_scrollbar, {
12450
- class: "scrollbarClass"
12451
- }, {
12452
- default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_KqTree, {
12453
- data: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(treeData),
12454
- props: defaultProps,
12455
- "expand-on-click-node": false,
12456
- "default-expand-all": "",
12457
- "highlight-current": "",
12458
- "node-key": "id"
12459
- }, null, 8
12460
- /* PROPS */
12461
- , ["data", "props"])]),
12462
- _: 1
12463
- /* STABLE */
12464
-
12465
- })])]),
12466
- _: 1
12467
- /* STABLE */
12486
+ default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_2, [_hoisted_3, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("span", null, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(layerNameTitle)), 1
12487
+ /* TEXT */
12488
+ )])]),
12489
+ _: 1
12490
+ /* STABLE */
12468
12491
 
12469
- }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_col, {
12470
- span: 16
12492
+ }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_row, {
12493
+ class: "modelTable"
12494
+ }, {
12495
+ default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_table, {
12496
+ border: "",
12497
+ stripe: "",
12498
+ data: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(tableData),
12499
+ style: {
12500
+ "width": "100%",
12501
+ "height": "100%"
12502
+ },
12503
+ "cell-style": {
12504
+ padding: '8px 0'
12505
+ },
12506
+ "header-cell-style": (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(headClass)
12471
12507
  }, {
12472
- default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_table, {
12473
- border: "",
12474
- stripe: "",
12475
- data: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(tableData),
12476
- style: {
12477
- "width": "100%",
12478
- "height": "100%"
12479
- },
12480
- "cell-style": {
12481
- padding: '8px 0'
12482
- },
12483
- "header-cell-style": (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(headClass)
12484
- }, {
12485
- default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_table_column, {
12486
- label: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).fieldName,
12487
- prop: "field",
12488
- align: "center"
12489
- }, null, 8
12490
- /* PROPS */
12491
- , ["label"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_table_column, {
12492
- label: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).fieldValue,
12493
- prop: "value",
12494
- align: "center"
12495
- }, null, 8
12496
- /* PROPS */
12497
- , ["label"])]),
12498
- _: 1
12499
- /* STABLE */
12500
-
12501
- }, 8
12508
+ default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_table_column, {
12509
+ label: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).fieldName,
12510
+ prop: "field",
12511
+ align: "center"
12512
+ }, null, 8
12502
12513
  /* PROPS */
12503
- , ["data", "header-cell-style"])]),
12514
+ , ["label"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_table_column, {
12515
+ label: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).fieldValue,
12516
+ prop: "value",
12517
+ align: "center"
12518
+ }, null, 8
12519
+ /* PROPS */
12520
+ , ["label"])]),
12504
12521
  _: 1
12505
12522
  /* STABLE */
12506
12523
 
12507
- })]),
12524
+ }, 8
12525
+ /* PROPS */
12526
+ , ["data", "header-cell-style"])]),
12508
12527
  _: 1
12509
12528
  /* STABLE */
12510
12529
 
12511
- }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_3, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_button, {
12530
+ }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_4, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_button, {
12512
12531
  onClick: _cache[0] || (_cache[0] = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withModifiers)($event => pick(), ["stop"])),
12513
12532
  title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).pick,
12514
12533
  type: "primary"