@kq_npm/client3d_webgl_vue 3.9.3-beta → 3.9.9-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/adddata/index.js CHANGED
@@ -269,6 +269,7 @@ class AddDataViewModel {
269
269
  this._language = scenceView._language;
270
270
  this._geometryServerUrl = options.geometryServerUrl;
271
271
  this._geometryServerToken = options.geometryServerToken;
272
+ if (options.geojsonStyle) this._geojsonStyle = Object.assign({}, this._geojsonStyle, options.geojsonStyle);
272
273
  } //解析文件
273
274
 
274
275
 
@@ -299,9 +300,8 @@ class AddDataViewModel {
299
300
  }
300
301
  });
301
302
 
302
- that._viewer.dataSources.add(ds);
303
+ that._viewer.dataSources.add(ds); // ds.autoAvoid(that._viewer);
303
304
 
304
- ds.autoAvoid(that._viewer);
305
305
 
306
306
  that._viewer.flyTo(ds);
307
307
 
@@ -342,9 +342,8 @@ class AddDataViewModel {
342
342
  }
343
343
  });
344
344
 
345
- that._viewer.dataSources.add(ds);
345
+ that._viewer.dataSources.add(ds); // ds.autoAvoid(that._viewer);
346
346
 
347
- ds.autoAvoid(that._viewer);
348
347
 
349
348
  that._viewer.flyTo(ds);
350
349
 
@@ -394,21 +393,30 @@ class AddDataViewModel {
394
393
  }
395
394
  } catch (e) {}
396
395
 
396
+ var style = { ...that._geojsonStyle
397
+ };
397
398
  var ds = new Cesium.Kq3dGeoJsonDataSource(name);
398
- ds.load(ret, that._geojsonStyle).then(ds => {
399
+ var addType = "geojson"; // 判断是否是arcgis格式的json数据
400
+
401
+ if (ret.geometryType) {
402
+ ds = new Cesium.Kq3dEsriGeoJsonDataSource(name);
403
+ style.label.express = "NAME";
404
+ addType = "arcjson";
405
+ }
406
+
407
+ ds.load(ret, style).then(ds => {
399
408
  ds.entities.values.forEach(entity => {
400
409
  if (entity.polygon) {
401
410
  entity.polyline = {
402
411
  positions: entity.polygon.hierarchy._value.positions,
403
- width: that._geojsonStyle.polygon.outlineWidth,
404
- material: that._geojsonStyle.polygon.outlineColor
412
+ width: style.polygon.outlineWidth,
413
+ material: style.polygon.outlineColor
405
414
  };
406
415
  }
407
416
  });
408
417
 
409
- that._viewer.dataSources.add(ds);
418
+ that._viewer.dataSources.add(ds); // ds.autoAvoid(that._viewer);
410
419
 
411
- ds.autoAvoid(that._viewer);
412
420
 
413
421
  that._viewer.flyTo(ds);
414
422
 
@@ -420,7 +428,7 @@ class AddDataViewModel {
420
428
  serverType: "datasource",
421
429
  lsType: "ls",
422
430
  url: ret,
423
- addType: "geojson",
431
+ addType: addType,
424
432
  shapeType: that._layerManager.getShapeType(ds)
425
433
  };
426
434
 
@@ -871,9 +879,15 @@ class AddDataViewModel {
871
879
  }, this);
872
880
 
873
881
  if (mapInfo.rect84) {
874
- this._viewer.camera.flyTo({
875
- destination: Cesium.Rectangle.fromDegrees(mapInfo.rect84.minx, mapInfo.rect84.miny, mapInfo.rect84.maxx, mapInfo.rect84.maxy)
876
- });
882
+ if (mapInfo.rect84 instanceof Array) {
883
+ this._viewer.camera.flyTo({
884
+ destination: Cesium.Rectangle.fromDegrees(mapInfo.rect84[0], mapInfo.rect84[1], mapInfo.rect84[2], mapInfo.rect84[3])
885
+ });
886
+ } else {
887
+ this._viewer.camera.flyTo({
888
+ destination: Cesium.Rectangle.fromDegrees(mapInfo.rect84.minx, mapInfo.rect84.miny, mapInfo.rect84.maxx, mapInfo.rect84.maxy)
889
+ });
890
+ }
877
891
  }
878
892
 
879
893
  setChildrenAddType(mapServerInfo.layerTreeData, type);
@@ -1000,9 +1014,11 @@ class AddDataViewModel {
1000
1014
 
1001
1015
  case "wmts":
1002
1016
  case "kqgistileserver":
1017
+ case "kqgisaggregationserver":
1003
1018
  this._viewer.addWMTSLayerGroup(url).then(group => {
1004
1019
  var defaultName = 'wmts';
1005
1020
  if (type === "kqgistileserver") defaultName = 'tile';
1021
+ if (type === "kqgisaggregationserver") defaultName = 'aggregation';
1006
1022
  node = {
1007
1023
  guid: group.guid,
1008
1024
  name: name || defaultName,
@@ -1051,9 +1067,8 @@ class AddDataViewModel {
1051
1067
  wfsProvider.load().then(function (data) {
1052
1068
  var ds = new Cesium.Kq3dGeoJsonDataSource(name);
1053
1069
  ds.load(data, that._geojsonStyle).then(ds => {
1054
- that._viewer.dataSources.add(ds);
1070
+ that._viewer.dataSources.add(ds); // ds.autoAvoid(that._viewer);
1055
1071
 
1056
- ds.autoAvoid(that._viewer);
1057
1072
 
1058
1073
  that._viewer.flyTo(ds);
1059
1074
 
@@ -1087,9 +1102,45 @@ class AddDataViewModel {
1087
1102
  }
1088
1103
  }, this);
1089
1104
 
1090
- this._viewer.dataSources.add(ds);
1105
+ this._viewer.dataSources.add(ds); // ds.autoAvoid(this._viewer);
1106
+
1107
+
1108
+ this._viewer.flyTo(ds);
1109
+
1110
+ node = {
1111
+ guid: ds.guid,
1112
+ name: name,
1113
+ visible: true,
1114
+ serverType: "datasource",
1115
+ lsType: "ls",
1116
+ url: url,
1117
+ addType: type,
1118
+ shapeType: this._layerManager.getShapeType(ds)
1119
+ };
1120
+
1121
+ this._layerManager.addTempLayerNode(node);
1122
+
1123
+ cb && cb(node);
1124
+ });
1125
+ break;
1126
+
1127
+ case "arcjson":
1128
+ var ds = new Cesium.Kq3dEsriGeoJsonDataSource(name);
1129
+ var geojsonStyle = { ...this._geojsonStyle
1130
+ };
1131
+ geojsonStyle.label.express = 'NAME';
1132
+ ds.load(url, geojsonStyle).then(ds => {
1133
+ ds.entities.values.forEach(entity => {
1134
+ if (entity.polygon) {
1135
+ entity.polyline = {
1136
+ positions: entity.polygon.hierarchy._value.positions,
1137
+ width: geojsonStyle.polygon.outlineWidth,
1138
+ material: geojsonStyle.polygon.outlineColor
1139
+ };
1140
+ }
1141
+ }, this);
1091
1142
 
1092
- ds.autoAvoid(this._viewer);
1143
+ this._viewer.dataSources.add(ds);
1093
1144
 
1094
1145
  this._viewer.flyTo(ds);
1095
1146
 
@@ -1160,6 +1211,30 @@ class AddDataViewModel {
1160
1211
  });
1161
1212
  break;
1162
1213
 
1214
+ case "s3m":
1215
+ layer = this._viewer.scene.primitives.add(new Cesium.Kq3dS3MTilesLayer({
1216
+ context: this._viewer.scene._context,
1217
+ url: url,
1218
+ maxVisibleDistance: 1000000,
1219
+ minVisibleDistance: 0
1220
+ }));
1221
+ this.flyToLayer(layer);
1222
+ if (!layer.guid) layer.guid = Cesium.createGuid();
1223
+ node = {
1224
+ guid: layer.guid,
1225
+ name: name,
1226
+ visible: true,
1227
+ serverType: "3dtiles",
1228
+ lsType: "ls",
1229
+ url: url,
1230
+ addType: type
1231
+ };
1232
+
1233
+ this._layerManager.addTempLayerNode(node);
1234
+
1235
+ cb && cb(node);
1236
+ break;
1237
+
1163
1238
  default:
1164
1239
  break;
1165
1240
  }
@@ -1176,6 +1251,12 @@ class AddDataViewModel {
1176
1251
  });
1177
1252
  } else if (layer instanceof Cesium.Cesium3DTileset) {
1178
1253
  viewer.zoomTo(layer);
1254
+ } else if (layer instanceof Cesium.Kq3dS3MTilesLayer) {
1255
+ layer.readyPromise.then(function (tileset) {
1256
+ viewer.camera.flyTo({
1257
+ destination: tileset.rectangle
1258
+ });
1259
+ });
1179
1260
  } else if (layer instanceof Cesium.GeoJsonDataSource || layer instanceof Cesium.Kq3dGeoJsonDataSource || layer instanceof Cesium.KmlDataSource || layer instanceof Cesium.CzmlDataSource) {
1180
1261
  viewer.flyTo(layer);
1181
1262
  } else if (layer instanceof Cesium.Kq3dKQGISServerTerrainProvider || layer instanceof Cesium.Kq3dFileTerrainProvider || layer instanceof Cesium.CesiumTerrainProvider) {
@@ -1311,6 +1392,10 @@ const __default__ = {
1311
1392
  isRight: {
1312
1393
  type: Boolean,
1313
1394
  default: true
1395
+ },
1396
+ // geojson数据加载样式
1397
+ geojsonStyle: {
1398
+ type: Object
1314
1399
  }
1315
1400
  },
1316
1401
 
@@ -1416,6 +1501,18 @@ const __default__ = {
1416
1501
  namePlaceholder: language.value.unnamedLayer,
1417
1502
  urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/tile/wmts",
1418
1503
  description: language.value.imagertyTileServerdescription
1504
+ }, {
1505
+ type: "kqgisaggregationserver",
1506
+ name: language.value.KQGISAggregationServer,
1507
+ namePlaceholder: language.value.unnamedLayer,
1508
+ urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/map/wmts",
1509
+ description: language.value.imagertyAggregationServerdescription
1510
+ }, {
1511
+ type: "s3m",
1512
+ name: language.value.S3M,
1513
+ namePlaceholder: language.value.unnamedLayer,
1514
+ urlPlaceholder: language.value.format + ":http://<host>:<port>/xxx/realspace/datas/xxx/config",
1515
+ description: language.value.imagertyS3Mdescription
1419
1516
  }, {
1420
1517
  type: "arcgismapserver",
1421
1518
  name: language.value.ArcGISMapServer,
@@ -1452,6 +1549,12 @@ const __default__ = {
1452
1549
  namePlaceholder: language.value.unnamedLayer,
1453
1550
  urlPlaceholder: language.value.format + ":http://<host>:<port>/xxx.geojson",
1454
1551
  description: language.value.imagertyGeoJsondescription
1552
+ }, {
1553
+ type: "arcjson",
1554
+ name: language.value.ArcJson,
1555
+ namePlaceholder: language.value.unnamedLayer,
1556
+ urlPlaceholder: language.value.format + ":http://<host>:<port>/xxx.json",
1557
+ description: language.value.imagertyArcJsondescription
1455
1558
  }, {
1456
1559
  type: "mvt",
1457
1560
  name: language.value.MVT,
@@ -1494,7 +1597,8 @@ const __default__ = {
1494
1597
  if (scenceView) {
1495
1598
  let options = {
1496
1599
  geometryServerUrl: props.geometryServerUrl,
1497
- geometryServerToken: props.geometryServerToken
1600
+ geometryServerToken: props.geometryServerToken,
1601
+ geojsonStyle: props.geojsonStyle
1498
1602
  };
1499
1603
  viewModel = new AddDataViewModel(scenceView, options);
1500
1604
  }
package/index.js CHANGED
@@ -2171,9 +2171,36 @@ class LayerManager {
2171
2171
  }
2172
2172
  }, this);
2173
2173
 
2174
+ this._viewer.dataSources.add(ds); // ds.autoAvoid(this._viewer);
2175
+
2176
+
2177
+ ds._guid = layerData.guid;
2178
+ layerData.shapeType = this.getShapeType(ds);
2179
+ });
2180
+ }
2181
+
2182
+ break;
2183
+
2184
+ case "arcjson":
2185
+ layerData.visible = isAdd;
2186
+ layerData.serverType = "datasource";
2187
+
2188
+ if (isAdd) {
2189
+ var ds = new Cesium.Kq3dEsriGeoJsonDataSource(name);
2190
+ var geojsonStyle = layerData.geojsonStyle || this._geojsonStyle;
2191
+ promise = ds.load(url, geojsonStyle).then(ds => {
2192
+ ds.entities.values.forEach(entity => {
2193
+ if (entity.polygon) {
2194
+ entity.polyline = {
2195
+ positions: entity.polygon.hierarchy._value.positions,
2196
+ width: geojsonStyle.polygon.outlineWidth,
2197
+ material: geojsonStyle.polygon.outlineColor
2198
+ };
2199
+ }
2200
+ }, this);
2201
+
2174
2202
  this._viewer.dataSources.add(ds);
2175
2203
 
2176
- ds.autoAvoid(this._viewer);
2177
2204
  ds._guid = layerData.guid;
2178
2205
  layerData.shapeType = this.getShapeType(ds);
2179
2206
  });
@@ -2381,9 +2408,15 @@ class LayerManager {
2381
2408
  });
2382
2409
 
2383
2410
  if (rect) {
2384
- that._viewer.camera.flyTo({
2385
- destination: Cesium.Rectangle.fromDegrees(rect.minx, rect.miny, rect.maxx, rect.maxy)
2386
- });
2411
+ if (rect instanceof Array) {
2412
+ that._viewer.camera.flyTo({
2413
+ destination: Cesium.Rectangle.fromDegrees(rect[0], rect[1], rect[2], rect[3])
2414
+ });
2415
+ } else {
2416
+ that._viewer.camera.flyTo({
2417
+ destination: Cesium.Rectangle.fromDegrees(rect.minx, rect.miny, rect.maxx, rect.maxy)
2418
+ });
2419
+ }
2387
2420
  }
2388
2421
 
2389
2422
  that._scenceView.fire("resetLayerDatas");
@@ -2581,7 +2614,7 @@ class LayerManager {
2581
2614
  } else if (type === "3dtiles") {
2582
2615
  let primitives = this._viewer.scene.primitives._primitives;
2583
2616
  let layer = primitives.find(item => {
2584
- return item.guid === guid && item instanceof Cesium.Cesium3DTileset;
2617
+ return item.guid === guid;
2585
2618
  });
2586
2619
  return layer;
2587
2620
  } else if (type === "datasource") {
@@ -3303,7 +3336,10 @@ class ScenceViewViewModel extends (mitt_default()) {
3303
3336
 
3304
3337
  case "tianditu":
3305
3338
  layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dTiandituImageryProvider({
3306
- mapStyle: layerConfig.layerType + "_c"
3339
+ mapStyle: layerConfig.layerType + "_c",
3340
+ maximumLevel: layerConfig.maximumLevel || null,
3341
+ useCache: layerConfig.useCache || false,
3342
+ key: layerConfig.key || Cesium.Kq3dTiandituImageryProvider.DEFAULT_KEY
3307
3343
  }), index);
3308
3344
  break;
3309
3345
 
@@ -22674,6 +22710,7 @@ class AddDataViewModel {
22674
22710
  this._language = scenceView._language;
22675
22711
  this._geometryServerUrl = options.geometryServerUrl;
22676
22712
  this._geometryServerToken = options.geometryServerToken;
22713
+ if (options.geojsonStyle) this._geojsonStyle = Object.assign({}, this._geojsonStyle, options.geojsonStyle);
22677
22714
  } //解析文件
22678
22715
 
22679
22716
 
@@ -22704,9 +22741,8 @@ class AddDataViewModel {
22704
22741
  }
22705
22742
  });
22706
22743
 
22707
- that._viewer.dataSources.add(ds);
22744
+ that._viewer.dataSources.add(ds); // ds.autoAvoid(that._viewer);
22708
22745
 
22709
- ds.autoAvoid(that._viewer);
22710
22746
 
22711
22747
  that._viewer.flyTo(ds);
22712
22748
 
@@ -22747,9 +22783,8 @@ class AddDataViewModel {
22747
22783
  }
22748
22784
  });
22749
22785
 
22750
- that._viewer.dataSources.add(ds);
22786
+ that._viewer.dataSources.add(ds); // ds.autoAvoid(that._viewer);
22751
22787
 
22752
- ds.autoAvoid(that._viewer);
22753
22788
 
22754
22789
  that._viewer.flyTo(ds);
22755
22790
 
@@ -22799,21 +22834,30 @@ class AddDataViewModel {
22799
22834
  }
22800
22835
  } catch (e) {}
22801
22836
 
22837
+ var style = { ...that._geojsonStyle
22838
+ };
22802
22839
  var ds = new Cesium.Kq3dGeoJsonDataSource(name);
22803
- ds.load(ret, that._geojsonStyle).then(ds => {
22840
+ var addType = "geojson"; // 判断是否是arcgis格式的json数据
22841
+
22842
+ if (ret.geometryType) {
22843
+ ds = new Cesium.Kq3dEsriGeoJsonDataSource(name);
22844
+ style.label.express = "NAME";
22845
+ addType = "arcjson";
22846
+ }
22847
+
22848
+ ds.load(ret, style).then(ds => {
22804
22849
  ds.entities.values.forEach(entity => {
22805
22850
  if (entity.polygon) {
22806
22851
  entity.polyline = {
22807
22852
  positions: entity.polygon.hierarchy._value.positions,
22808
- width: that._geojsonStyle.polygon.outlineWidth,
22809
- material: that._geojsonStyle.polygon.outlineColor
22853
+ width: style.polygon.outlineWidth,
22854
+ material: style.polygon.outlineColor
22810
22855
  };
22811
22856
  }
22812
22857
  });
22813
22858
 
22814
- that._viewer.dataSources.add(ds);
22859
+ that._viewer.dataSources.add(ds); // ds.autoAvoid(that._viewer);
22815
22860
 
22816
- ds.autoAvoid(that._viewer);
22817
22861
 
22818
22862
  that._viewer.flyTo(ds);
22819
22863
 
@@ -22825,7 +22869,7 @@ class AddDataViewModel {
22825
22869
  serverType: "datasource",
22826
22870
  lsType: "ls",
22827
22871
  url: ret,
22828
- addType: "geojson",
22872
+ addType: addType,
22829
22873
  shapeType: that._layerManager.getShapeType(ds)
22830
22874
  };
22831
22875
 
@@ -23276,9 +23320,15 @@ class AddDataViewModel {
23276
23320
  }, this);
23277
23321
 
23278
23322
  if (mapInfo.rect84) {
23279
- this._viewer.camera.flyTo({
23280
- destination: Cesium.Rectangle.fromDegrees(mapInfo.rect84.minx, mapInfo.rect84.miny, mapInfo.rect84.maxx, mapInfo.rect84.maxy)
23281
- });
23323
+ if (mapInfo.rect84 instanceof Array) {
23324
+ this._viewer.camera.flyTo({
23325
+ destination: Cesium.Rectangle.fromDegrees(mapInfo.rect84[0], mapInfo.rect84[1], mapInfo.rect84[2], mapInfo.rect84[3])
23326
+ });
23327
+ } else {
23328
+ this._viewer.camera.flyTo({
23329
+ destination: Cesium.Rectangle.fromDegrees(mapInfo.rect84.minx, mapInfo.rect84.miny, mapInfo.rect84.maxx, mapInfo.rect84.maxy)
23330
+ });
23331
+ }
23282
23332
  }
23283
23333
 
23284
23334
  setChildrenAddType(mapServerInfo.layerTreeData, type);
@@ -23405,9 +23455,11 @@ class AddDataViewModel {
23405
23455
 
23406
23456
  case "wmts":
23407
23457
  case "kqgistileserver":
23458
+ case "kqgisaggregationserver":
23408
23459
  this._viewer.addWMTSLayerGroup(url).then(group => {
23409
23460
  var defaultName = 'wmts';
23410
23461
  if (type === "kqgistileserver") defaultName = 'tile';
23462
+ if (type === "kqgisaggregationserver") defaultName = 'aggregation';
23411
23463
  node = {
23412
23464
  guid: group.guid,
23413
23465
  name: name || defaultName,
@@ -23456,9 +23508,8 @@ class AddDataViewModel {
23456
23508
  wfsProvider.load().then(function (data) {
23457
23509
  var ds = new Cesium.Kq3dGeoJsonDataSource(name);
23458
23510
  ds.load(data, that._geojsonStyle).then(ds => {
23459
- that._viewer.dataSources.add(ds);
23511
+ that._viewer.dataSources.add(ds); // ds.autoAvoid(that._viewer);
23460
23512
 
23461
- ds.autoAvoid(that._viewer);
23462
23513
 
23463
23514
  that._viewer.flyTo(ds);
23464
23515
 
@@ -23492,9 +23543,45 @@ class AddDataViewModel {
23492
23543
  }
23493
23544
  }, this);
23494
23545
 
23495
- this._viewer.dataSources.add(ds);
23546
+ this._viewer.dataSources.add(ds); // ds.autoAvoid(this._viewer);
23547
+
23548
+
23549
+ this._viewer.flyTo(ds);
23550
+
23551
+ node = {
23552
+ guid: ds.guid,
23553
+ name: name,
23554
+ visible: true,
23555
+ serverType: "datasource",
23556
+ lsType: "ls",
23557
+ url: url,
23558
+ addType: type,
23559
+ shapeType: this._layerManager.getShapeType(ds)
23560
+ };
23561
+
23562
+ this._layerManager.addTempLayerNode(node);
23563
+
23564
+ cb && cb(node);
23565
+ });
23566
+ break;
23567
+
23568
+ case "arcjson":
23569
+ var ds = new Cesium.Kq3dEsriGeoJsonDataSource(name);
23570
+ var geojsonStyle = { ...this._geojsonStyle
23571
+ };
23572
+ geojsonStyle.label.express = 'NAME';
23573
+ ds.load(url, geojsonStyle).then(ds => {
23574
+ ds.entities.values.forEach(entity => {
23575
+ if (entity.polygon) {
23576
+ entity.polyline = {
23577
+ positions: entity.polygon.hierarchy._value.positions,
23578
+ width: geojsonStyle.polygon.outlineWidth,
23579
+ material: geojsonStyle.polygon.outlineColor
23580
+ };
23581
+ }
23582
+ }, this);
23496
23583
 
23497
- ds.autoAvoid(this._viewer);
23584
+ this._viewer.dataSources.add(ds);
23498
23585
 
23499
23586
  this._viewer.flyTo(ds);
23500
23587
 
@@ -23565,6 +23652,30 @@ class AddDataViewModel {
23565
23652
  });
23566
23653
  break;
23567
23654
 
23655
+ case "s3m":
23656
+ layer = this._viewer.scene.primitives.add(new Cesium.Kq3dS3MTilesLayer({
23657
+ context: this._viewer.scene._context,
23658
+ url: url,
23659
+ maxVisibleDistance: 1000000,
23660
+ minVisibleDistance: 0
23661
+ }));
23662
+ this.flyToLayer(layer);
23663
+ if (!layer.guid) layer.guid = Cesium.createGuid();
23664
+ node = {
23665
+ guid: layer.guid,
23666
+ name: name,
23667
+ visible: true,
23668
+ serverType: "3dtiles",
23669
+ lsType: "ls",
23670
+ url: url,
23671
+ addType: type
23672
+ };
23673
+
23674
+ this._layerManager.addTempLayerNode(node);
23675
+
23676
+ cb && cb(node);
23677
+ break;
23678
+
23568
23679
  default:
23569
23680
  break;
23570
23681
  }
@@ -23581,6 +23692,12 @@ class AddDataViewModel {
23581
23692
  });
23582
23693
  } else if (layer instanceof Cesium.Cesium3DTileset) {
23583
23694
  viewer.zoomTo(layer);
23695
+ } else if (layer instanceof Cesium.Kq3dS3MTilesLayer) {
23696
+ layer.readyPromise.then(function (tileset) {
23697
+ viewer.camera.flyTo({
23698
+ destination: tileset.rectangle
23699
+ });
23700
+ });
23584
23701
  } else if (layer instanceof Cesium.GeoJsonDataSource || layer instanceof Cesium.Kq3dGeoJsonDataSource || layer instanceof Cesium.KmlDataSource || layer instanceof Cesium.CzmlDataSource) {
23585
23702
  viewer.flyTo(layer);
23586
23703
  } else if (layer instanceof Cesium.Kq3dKQGISServerTerrainProvider || layer instanceof Cesium.Kq3dFileTerrainProvider || layer instanceof Cesium.CesiumTerrainProvider) {
@@ -23714,6 +23831,10 @@ const AddDatavue_type_script_setup_true_lang_js_default_ = {
23714
23831
  isRight: {
23715
23832
  type: Boolean,
23716
23833
  default: true
23834
+ },
23835
+ // geojson数据加载样式
23836
+ geojsonStyle: {
23837
+ type: Object
23717
23838
  }
23718
23839
  },
23719
23840
 
@@ -23819,6 +23940,18 @@ const AddDatavue_type_script_setup_true_lang_js_default_ = {
23819
23940
  namePlaceholder: language.value.unnamedLayer,
23820
23941
  urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/tile/wmts",
23821
23942
  description: language.value.imagertyTileServerdescription
23943
+ }, {
23944
+ type: "kqgisaggregationserver",
23945
+ name: language.value.KQGISAggregationServer,
23946
+ namePlaceholder: language.value.unnamedLayer,
23947
+ urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/map/wmts",
23948
+ description: language.value.imagertyAggregationServerdescription
23949
+ }, {
23950
+ type: "s3m",
23951
+ name: language.value.S3M,
23952
+ namePlaceholder: language.value.unnamedLayer,
23953
+ urlPlaceholder: language.value.format + ":http://<host>:<port>/xxx/realspace/datas/xxx/config",
23954
+ description: language.value.imagertyS3Mdescription
23822
23955
  }, {
23823
23956
  type: "arcgismapserver",
23824
23957
  name: language.value.ArcGISMapServer,
@@ -23855,6 +23988,12 @@ const AddDatavue_type_script_setup_true_lang_js_default_ = {
23855
23988
  namePlaceholder: language.value.unnamedLayer,
23856
23989
  urlPlaceholder: language.value.format + ":http://<host>:<port>/xxx.geojson",
23857
23990
  description: language.value.imagertyGeoJsondescription
23991
+ }, {
23992
+ type: "arcjson",
23993
+ name: language.value.ArcJson,
23994
+ namePlaceholder: language.value.unnamedLayer,
23995
+ urlPlaceholder: language.value.format + ":http://<host>:<port>/xxx.json",
23996
+ description: language.value.imagertyArcJsondescription
23858
23997
  }, {
23859
23998
  type: "mvt",
23860
23999
  name: language.value.MVT,
@@ -23897,7 +24036,8 @@ const AddDatavue_type_script_setup_true_lang_js_default_ = {
23897
24036
  if (scenceView) {
23898
24037
  let options = {
23899
24038
  geometryServerUrl: props.geometryServerUrl,
23900
- geometryServerToken: props.geometryServerToken
24039
+ geometryServerToken: props.geometryServerToken,
24040
+ geojsonStyle: props.geojsonStyle
23901
24041
  };
23902
24042
  viewModel = new AddDataViewModel(scenceView, options);
23903
24043
  }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"3.9.3-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"}}
1
+ {"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"3.9.9-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"}}
@@ -186,6 +186,7 @@ class AddDataViewModel {
186
186
  this._language = scenceView._language;
187
187
  this._geometryServerUrl = options.geometryServerUrl;
188
188
  this._geometryServerToken = options.geometryServerToken;
189
+ if (options.geojsonStyle) this._geojsonStyle = Object.assign({}, this._geojsonStyle, options.geojsonStyle);
189
190
  } //解析文件
190
191
 
191
192
 
@@ -216,9 +217,8 @@ class AddDataViewModel {
216
217
  }
217
218
  });
218
219
 
219
- that._viewer.dataSources.add(ds);
220
+ that._viewer.dataSources.add(ds); // ds.autoAvoid(that._viewer);
220
221
 
221
- ds.autoAvoid(that._viewer);
222
222
 
223
223
  that._viewer.flyTo(ds);
224
224
 
@@ -259,9 +259,8 @@ class AddDataViewModel {
259
259
  }
260
260
  });
261
261
 
262
- that._viewer.dataSources.add(ds);
262
+ that._viewer.dataSources.add(ds); // ds.autoAvoid(that._viewer);
263
263
 
264
- ds.autoAvoid(that._viewer);
265
264
 
266
265
  that._viewer.flyTo(ds);
267
266
 
@@ -311,21 +310,30 @@ class AddDataViewModel {
311
310
  }
312
311
  } catch (e) {}
313
312
 
313
+ var style = { ...that._geojsonStyle
314
+ };
314
315
  var ds = new Cesium.Kq3dGeoJsonDataSource(name);
315
- ds.load(ret, that._geojsonStyle).then(ds => {
316
+ var addType = "geojson"; // 判断是否是arcgis格式的json数据
317
+
318
+ if (ret.geometryType) {
319
+ ds = new Cesium.Kq3dEsriGeoJsonDataSource(name);
320
+ style.label.express = "NAME";
321
+ addType = "arcjson";
322
+ }
323
+
324
+ ds.load(ret, style).then(ds => {
316
325
  ds.entities.values.forEach(entity => {
317
326
  if (entity.polygon) {
318
327
  entity.polyline = {
319
328
  positions: entity.polygon.hierarchy._value.positions,
320
- width: that._geojsonStyle.polygon.outlineWidth,
321
- material: that._geojsonStyle.polygon.outlineColor
329
+ width: style.polygon.outlineWidth,
330
+ material: style.polygon.outlineColor
322
331
  };
323
332
  }
324
333
  });
325
334
 
326
- that._viewer.dataSources.add(ds);
335
+ that._viewer.dataSources.add(ds); // ds.autoAvoid(that._viewer);
327
336
 
328
- ds.autoAvoid(that._viewer);
329
337
 
330
338
  that._viewer.flyTo(ds);
331
339
 
@@ -337,7 +345,7 @@ class AddDataViewModel {
337
345
  serverType: "datasource",
338
346
  lsType: "ls",
339
347
  url: ret,
340
- addType: "geojson",
348
+ addType: addType,
341
349
  shapeType: that._layerManager.getShapeType(ds)
342
350
  };
343
351
 
@@ -788,9 +796,15 @@ class AddDataViewModel {
788
796
  }, this);
789
797
 
790
798
  if (mapInfo.rect84) {
791
- this._viewer.camera.flyTo({
792
- destination: Cesium.Rectangle.fromDegrees(mapInfo.rect84.minx, mapInfo.rect84.miny, mapInfo.rect84.maxx, mapInfo.rect84.maxy)
793
- });
799
+ if (mapInfo.rect84 instanceof Array) {
800
+ this._viewer.camera.flyTo({
801
+ destination: Cesium.Rectangle.fromDegrees(mapInfo.rect84[0], mapInfo.rect84[1], mapInfo.rect84[2], mapInfo.rect84[3])
802
+ });
803
+ } else {
804
+ this._viewer.camera.flyTo({
805
+ destination: Cesium.Rectangle.fromDegrees(mapInfo.rect84.minx, mapInfo.rect84.miny, mapInfo.rect84.maxx, mapInfo.rect84.maxy)
806
+ });
807
+ }
794
808
  }
795
809
 
796
810
  setChildrenAddType(mapServerInfo.layerTreeData, type);
@@ -917,9 +931,11 @@ class AddDataViewModel {
917
931
 
918
932
  case "wmts":
919
933
  case "kqgistileserver":
934
+ case "kqgisaggregationserver":
920
935
  this._viewer.addWMTSLayerGroup(url).then(group => {
921
936
  var defaultName = 'wmts';
922
937
  if (type === "kqgistileserver") defaultName = 'tile';
938
+ if (type === "kqgisaggregationserver") defaultName = 'aggregation';
923
939
  node = {
924
940
  guid: group.guid,
925
941
  name: name || defaultName,
@@ -968,9 +984,8 @@ class AddDataViewModel {
968
984
  wfsProvider.load().then(function (data) {
969
985
  var ds = new Cesium.Kq3dGeoJsonDataSource(name);
970
986
  ds.load(data, that._geojsonStyle).then(ds => {
971
- that._viewer.dataSources.add(ds);
987
+ that._viewer.dataSources.add(ds); // ds.autoAvoid(that._viewer);
972
988
 
973
- ds.autoAvoid(that._viewer);
974
989
 
975
990
  that._viewer.flyTo(ds);
976
991
 
@@ -1004,9 +1019,45 @@ class AddDataViewModel {
1004
1019
  }
1005
1020
  }, this);
1006
1021
 
1007
- this._viewer.dataSources.add(ds);
1022
+ this._viewer.dataSources.add(ds); // ds.autoAvoid(this._viewer);
1023
+
1024
+
1025
+ this._viewer.flyTo(ds);
1026
+
1027
+ node = {
1028
+ guid: ds.guid,
1029
+ name: name,
1030
+ visible: true,
1031
+ serverType: "datasource",
1032
+ lsType: "ls",
1033
+ url: url,
1034
+ addType: type,
1035
+ shapeType: this._layerManager.getShapeType(ds)
1036
+ };
1037
+
1038
+ this._layerManager.addTempLayerNode(node);
1039
+
1040
+ cb && cb(node);
1041
+ });
1042
+ break;
1043
+
1044
+ case "arcjson":
1045
+ var ds = new Cesium.Kq3dEsriGeoJsonDataSource(name);
1046
+ var geojsonStyle = { ...this._geojsonStyle
1047
+ };
1048
+ geojsonStyle.label.express = 'NAME';
1049
+ ds.load(url, geojsonStyle).then(ds => {
1050
+ ds.entities.values.forEach(entity => {
1051
+ if (entity.polygon) {
1052
+ entity.polyline = {
1053
+ positions: entity.polygon.hierarchy._value.positions,
1054
+ width: geojsonStyle.polygon.outlineWidth,
1055
+ material: geojsonStyle.polygon.outlineColor
1056
+ };
1057
+ }
1058
+ }, this);
1008
1059
 
1009
- ds.autoAvoid(this._viewer);
1060
+ this._viewer.dataSources.add(ds);
1010
1061
 
1011
1062
  this._viewer.flyTo(ds);
1012
1063
 
@@ -1077,6 +1128,30 @@ class AddDataViewModel {
1077
1128
  });
1078
1129
  break;
1079
1130
 
1131
+ case "s3m":
1132
+ layer = this._viewer.scene.primitives.add(new Cesium.Kq3dS3MTilesLayer({
1133
+ context: this._viewer.scene._context,
1134
+ url: url,
1135
+ maxVisibleDistance: 1000000,
1136
+ minVisibleDistance: 0
1137
+ }));
1138
+ this.flyToLayer(layer);
1139
+ if (!layer.guid) layer.guid = Cesium.createGuid();
1140
+ node = {
1141
+ guid: layer.guid,
1142
+ name: name,
1143
+ visible: true,
1144
+ serverType: "3dtiles",
1145
+ lsType: "ls",
1146
+ url: url,
1147
+ addType: type
1148
+ };
1149
+
1150
+ this._layerManager.addTempLayerNode(node);
1151
+
1152
+ cb && cb(node);
1153
+ break;
1154
+
1080
1155
  default:
1081
1156
  break;
1082
1157
  }
@@ -1093,6 +1168,12 @@ class AddDataViewModel {
1093
1168
  });
1094
1169
  } else if (layer instanceof Cesium.Cesium3DTileset) {
1095
1170
  viewer.zoomTo(layer);
1171
+ } else if (layer instanceof Cesium.Kq3dS3MTilesLayer) {
1172
+ layer.readyPromise.then(function (tileset) {
1173
+ viewer.camera.flyTo({
1174
+ destination: tileset.rectangle
1175
+ });
1176
+ });
1096
1177
  } else if (layer instanceof Cesium.GeoJsonDataSource || layer instanceof Cesium.Kq3dGeoJsonDataSource || layer instanceof Cesium.KmlDataSource || layer instanceof Cesium.CzmlDataSource) {
1097
1178
  viewer.flyTo(layer);
1098
1179
  } else if (layer instanceof Cesium.Kq3dKQGISServerTerrainProvider || layer instanceof Cesium.Kq3dFileTerrainProvider || layer instanceof Cesium.CesiumTerrainProvider) {
@@ -1228,6 +1309,10 @@ const __default__ = {
1228
1309
  isRight: {
1229
1310
  type: Boolean,
1230
1311
  default: true
1312
+ },
1313
+ // geojson数据加载样式
1314
+ geojsonStyle: {
1315
+ type: Object
1231
1316
  }
1232
1317
  },
1233
1318
 
@@ -1333,6 +1418,18 @@ const __default__ = {
1333
1418
  namePlaceholder: language.value.unnamedLayer,
1334
1419
  urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/tile/wmts",
1335
1420
  description: language.value.imagertyTileServerdescription
1421
+ }, {
1422
+ type: "kqgisaggregationserver",
1423
+ name: language.value.KQGISAggregationServer,
1424
+ namePlaceholder: language.value.unnamedLayer,
1425
+ urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/map/wmts",
1426
+ description: language.value.imagertyAggregationServerdescription
1427
+ }, {
1428
+ type: "s3m",
1429
+ name: language.value.S3M,
1430
+ namePlaceholder: language.value.unnamedLayer,
1431
+ urlPlaceholder: language.value.format + ":http://<host>:<port>/xxx/realspace/datas/xxx/config",
1432
+ description: language.value.imagertyS3Mdescription
1336
1433
  }, {
1337
1434
  type: "arcgismapserver",
1338
1435
  name: language.value.ArcGISMapServer,
@@ -1369,6 +1466,12 @@ const __default__ = {
1369
1466
  namePlaceholder: language.value.unnamedLayer,
1370
1467
  urlPlaceholder: language.value.format + ":http://<host>:<port>/xxx.geojson",
1371
1468
  description: language.value.imagertyGeoJsondescription
1469
+ }, {
1470
+ type: "arcjson",
1471
+ name: language.value.ArcJson,
1472
+ namePlaceholder: language.value.unnamedLayer,
1473
+ urlPlaceholder: language.value.format + ":http://<host>:<port>/xxx.json",
1474
+ description: language.value.imagertyArcJsondescription
1372
1475
  }, {
1373
1476
  type: "mvt",
1374
1477
  name: language.value.MVT,
@@ -1411,7 +1514,8 @@ const __default__ = {
1411
1514
  if (scenceView) {
1412
1515
  let options = {
1413
1516
  geometryServerUrl: props.geometryServerUrl,
1414
- geometryServerToken: props.geometryServerToken
1517
+ geometryServerToken: props.geometryServerToken,
1518
+ geojsonStyle: props.geojsonStyle
1415
1519
  };
1416
1520
  viewModel = new AddDataViewModel(scenceView, options);
1417
1521
  }
@@ -28054,9 +28158,36 @@ class LayerManager {
28054
28158
  }
28055
28159
  }, this);
28056
28160
 
28161
+ this._viewer.dataSources.add(ds); // ds.autoAvoid(this._viewer);
28162
+
28163
+
28164
+ ds._guid = layerData.guid;
28165
+ layerData.shapeType = this.getShapeType(ds);
28166
+ });
28167
+ }
28168
+
28169
+ break;
28170
+
28171
+ case "arcjson":
28172
+ layerData.visible = isAdd;
28173
+ layerData.serverType = "datasource";
28174
+
28175
+ if (isAdd) {
28176
+ var ds = new Cesium.Kq3dEsriGeoJsonDataSource(name);
28177
+ var geojsonStyle = layerData.geojsonStyle || this._geojsonStyle;
28178
+ promise = ds.load(url, geojsonStyle).then(ds => {
28179
+ ds.entities.values.forEach(entity => {
28180
+ if (entity.polygon) {
28181
+ entity.polyline = {
28182
+ positions: entity.polygon.hierarchy._value.positions,
28183
+ width: geojsonStyle.polygon.outlineWidth,
28184
+ material: geojsonStyle.polygon.outlineColor
28185
+ };
28186
+ }
28187
+ }, this);
28188
+
28057
28189
  this._viewer.dataSources.add(ds);
28058
28190
 
28059
- ds.autoAvoid(this._viewer);
28060
28191
  ds._guid = layerData.guid;
28061
28192
  layerData.shapeType = this.getShapeType(ds);
28062
28193
  });
@@ -28264,9 +28395,15 @@ class LayerManager {
28264
28395
  });
28265
28396
 
28266
28397
  if (rect) {
28267
- that._viewer.camera.flyTo({
28268
- destination: Cesium.Rectangle.fromDegrees(rect.minx, rect.miny, rect.maxx, rect.maxy)
28269
- });
28398
+ if (rect instanceof Array) {
28399
+ that._viewer.camera.flyTo({
28400
+ destination: Cesium.Rectangle.fromDegrees(rect[0], rect[1], rect[2], rect[3])
28401
+ });
28402
+ } else {
28403
+ that._viewer.camera.flyTo({
28404
+ destination: Cesium.Rectangle.fromDegrees(rect.minx, rect.miny, rect.maxx, rect.maxy)
28405
+ });
28406
+ }
28270
28407
  }
28271
28408
 
28272
28409
  that._scenceView.fire("resetLayerDatas");
@@ -28464,7 +28601,7 @@ class LayerManager {
28464
28601
  } else if (type === "3dtiles") {
28465
28602
  let primitives = this._viewer.scene.primitives._primitives;
28466
28603
  let layer = primitives.find(item => {
28467
- return item.guid === guid && item instanceof Cesium.Cesium3DTileset;
28604
+ return item.guid === guid;
28468
28605
  });
28469
28606
  return layer;
28470
28607
  } else if (type === "datasource") {
@@ -29186,7 +29323,10 @@ class ScenceViewViewModel extends (mitt_default()) {
29186
29323
 
29187
29324
  case "tianditu":
29188
29325
  layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dTiandituImageryProvider({
29189
- mapStyle: layerConfig.layerType + "_c"
29326
+ mapStyle: layerConfig.layerType + "_c",
29327
+ maximumLevel: layerConfig.maximumLevel || null,
29328
+ useCache: layerConfig.useCache || false,
29329
+ key: layerConfig.key || Cesium.Kq3dTiandituImageryProvider.DEFAULT_KEY
29190
29330
  }), index);
29191
29331
  break;
29192
29332