@mapgis/webclient-vue-cesium 10.5.5-1 → 10.5.5-6

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.
Files changed (124) hide show
  1. package/README.md +46 -49
  2. package/dist-libs/webclient-vue-cesium.common.js +191087 -0
  3. package/dist-libs/webclient-vue-cesium.css +1 -1
  4. package/dist-libs/webclient-vue-cesium.umd.js +191097 -0
  5. package/dist-libs/webclient-vue-cesium.umd.min.js +204 -194
  6. package/docs/.vuepress/config.js +47 -46
  7. package/docs/README.md +5 -4
  8. package/docs/api/analysis/Aspect.md +236 -0
  9. package/docs/api/analysis/Contour.md +240 -0
  10. package/docs/api/analysis/CutFill.md +306 -0
  11. package/docs/api/analysis/DynamicSection.md +336 -0
  12. package/docs/api/analysis/Excavate.md +3 -11
  13. package/docs/api/analysis/Flood.md +177 -200
  14. package/docs/api/analysis/HeightLimited.md +7 -4
  15. package/docs/api/analysis/ParticleEffects.md +549 -0
  16. package/docs/api/analysis/Profile.md +464 -0
  17. package/docs/api/analysis/Shadow.md +76 -13
  18. package/docs/api/analysis/Sightline.md +66 -13
  19. package/docs/api/analysis/Skyline.md +144 -29
  20. package/docs/api/analysis/Slope.md +236 -0
  21. package/docs/api/analysis/Viewshed.md +100 -21
  22. package/docs/api/layer/IGServer/IgsDocLayer.md +10 -0
  23. package/docs/api/layer/IGServer/IgsFeatureLayer.md +253 -0
  24. package/docs/api/layer/IGServer/IgsTileLayer.md +11 -0
  25. package/docs/api/layer/OGC/CesiumOgcWmsLayer.md +20 -19
  26. package/docs/api/layer/OGC/Wms.png +0 -0
  27. package/docs/api/layer/marker/DynamicMarker.md +81 -0
  28. package/docs/api/layer/marker/dynamicmarker.png +0 -0
  29. package/docs/api/layer/marker/selects.png +0 -0
  30. package/docs/api/layer/vectortile/vectortile.md +10 -0
  31. package/docs/api/m3d/image/layer_control_1.png +0 -0
  32. package/docs/api/m3d/image/layer_control_2.png +0 -0
  33. package/docs/api/m3d/image/layer_control_3.png +0 -0
  34. package/docs/api/m3d/m3d.md +13 -2
  35. package/docs/api/service/comprehensiveQuery/comprehensiveQuery.md +946 -0
  36. package/docs/api/ui/draw.md +68 -40
  37. package/docs/api/ui/link.md +8 -1
  38. package/docs/api/ui/marker.md +19 -1
  39. package/docs/api/ui/measure.md +82 -10
  40. package/docs/api/ui/table.md +6 -6
  41. package/docs/guide/README.md +26 -23
  42. package/docs/guide/basemap.md +35 -33
  43. package/docs/guide/markers&popups.md +46 -53
  44. package/docs/plugin_components/create_storybook.md +241 -0
  45. package/docs/plugin_components/img.png +0 -0
  46. package/docs/plugin_components/img_1.png +0 -0
  47. package/docs/plugin_components/img_10.png +0 -0
  48. package/docs/plugin_components/img_2.png +0 -0
  49. package/docs/plugin_components/img_3.png +0 -0
  50. package/docs/plugin_components/img_4.png +0 -0
  51. package/docs/plugin_components/img_5.png +0 -0
  52. package/docs/plugin_components/img_6.png +0 -0
  53. package/docs/plugin_components/img_7.png +0 -0
  54. package/docs/plugin_components/img_8.png +0 -0
  55. package/docs/version/diff.md +4 -4
  56. package/docs/version/version.md +81 -0
  57. package/package.json +5 -5
  58. package/src/cdn/cdn_component.js +62 -0
  59. package/src/component.js +20 -2
  60. package/src/components/Analysis/Aspect.vue +318 -0
  61. package/src/components/Analysis/Contour.vue +257 -0
  62. package/src/components/Analysis/CutFill.vue +581 -0
  63. package/src/components/Analysis/DynamicCutting.vue +98 -59
  64. package/src/components/Analysis/DynamicSection.vue +494 -0
  65. package/src/components/Analysis/Excavate.vue +133 -87
  66. package/src/components/Analysis/Flood.vue +395 -487
  67. package/src/components/Analysis/Flood.vue-- +630 -0
  68. package/src/components/Analysis/HeightLimited.vue +66 -47
  69. package/src/components/Analysis/ModelFlatten.vue +2 -2
  70. package/src/components/Analysis/Profile.vue +503 -0
  71. package/src/components/Analysis/Shadow.vue +220 -309
  72. package/src/components/Analysis/Sightline.vue +393 -375
  73. package/src/components/Analysis/SkyLine.vue +283 -93
  74. package/src/components/Analysis/Slope.vue +317 -0
  75. package/src/components/Analysis/Viewshed.vue +806 -373
  76. package/src/components/Analysis/skyline2dChartOptions.js +66 -0
  77. package/src/components/DataSource/Geojson/GeoJsonDataSource.vue +201 -3
  78. package/src/components/Layer/GeoJSON/GeoJsonLayer.vue +345 -0
  79. package/src/components/Layer/IGServer/IgsFeatureLayer.vue +227 -0
  80. package/src/components/Layer/Marker/DynamicMarkerLayer.vue +487 -0
  81. package/src/components/Layer/Marker/Marker3dPro.vue +196 -0
  82. package/src/components/Layer/Marker/Marker3dSetPro.vue +67 -0
  83. package/src/components/Layer/VectorTile/VectorTileLayer.vue +117 -33
  84. package/src/components/Layer/VectorTile/VectorTileOptions.js +1 -1
  85. package/src/components/M3D/3DTilesetOptions.js +23 -1
  86. package/src/components/M3D/G3D.vue +150 -0
  87. package/src/components/M3D/M3d.vue +142 -32
  88. package/src/components/M3D/M3dSet.vue +118 -0
  89. package/src/components/M3D/M3dType.js +24 -0
  90. package/src/components/Overlay/Mapv3dLayer.vue +2 -0
  91. package/src/components/Overlay/ParticleEffects.vue +545 -0
  92. package/src/components/Overlay/mapv/MapvBaseLayer.js +351 -172
  93. package/src/components/Overlay/mapv/MapvLayer.js +372 -324
  94. package/src/components/Overlay/mapv/SuperCluster.js +611 -0
  95. package/src/components/Overlay/themeLayer/heater/CesiumHeater.vue +152 -0
  96. package/src/components/Overlay/themeLayer/heater/MapvHeater.vue +161 -0
  97. package/src/components/UI/Controls/Draw/Draw.vue +320 -92
  98. package/src/components/UI/Controls/Legend/Legend.vue +55 -51
  99. package/src/components/UI/Controls/Link/Link.vue +59 -37
  100. package/src/components/UI/Controls/Measure/Measure.vue +75 -33
  101. package/src/components/UI/Controls/Measure/components/MeasureResult.vue +71 -0
  102. package/src/components/UI/Controls/Measure/components/MeasureSetting.vue +63 -0
  103. package/src/components/UI/Controls/Measure/components/MeasureTool.vue +155 -0
  104. package/src/components/UI/Geojson/Popup.vue +101 -0
  105. package/src/components/UI/Marker/Marker.vue +185 -48
  106. package/src/components/UI/Popup/Popup.vue +21 -64
  107. package/src/components/Utils/common/color-util.js +159 -0
  108. package/src/components/Utils/util.js +311 -231
  109. package/src/components/WebGlobe/manager.js +81 -3
  110. package/src/components/WebGlobe/mixins/withPrivateMethods.js +4 -2
  111. package/src/components/WebGlobe/util.js +173 -0
  112. package/src/components/service/comprehensive-query/ComprehensiveQuery.vue +156 -0
  113. package/src/components/service/comprehensive-query/PlaceNameCesium.vue +102 -0
  114. package/src/components/service/comprehensive-query/util/catalog/document.js +626 -0
  115. package/src/components/service/comprehensive-query/util/feature/arcgis-feature-query.js +448 -0
  116. package/src/components/service/comprehensive-query/util/feature/feature-convert.js +408 -0
  117. package/src/components/service/comprehensive-query/util/feature/feature-edit.js +50 -0
  118. package/src/components/service/comprehensive-query/util/feature/feature-geojson.js +100 -0
  119. package/src/components/service/comprehensive-query/util/feature/feature-query.js +723 -0
  120. package/src/components/service/comprehensive-query/util/feature/feature.js +1 -0
  121. package/src/components/service/comprehensive-query/util/feature/index.js +9 -0
  122. package/src/components/service/comprehensive-query/util/objects/geometry.js +58 -0
  123. package/src/components/Overlay/Mapv.vue +0 -142
  124. package/src/components/Overlay/MapvHeater.vue +0 -98
@@ -1,38 +1,51 @@
1
1
  <script>
2
2
  import Tileset3dOptions from "./3DTilesetOptions";
3
+ import { M3dType, M3dType_0_0 } from "./M3dType";
3
4
 
4
5
  export default {
5
6
  name: "mapgis-3d-igs-m3d",
6
7
  inject: ["Cesium", "CesiumZondy", "webGlobe"],
7
8
  props: {
8
- ...Tileset3dOptions
9
+ ...Tileset3dOptions,
10
+ },
11
+ data() {
12
+ return {
13
+ layerList: undefined,
14
+ };
9
15
  },
10
16
  created() {},
11
17
  mounted() {
18
+ this.layerList = this.parseLayers(this.layers);
12
19
  this.mount();
13
20
  this.watchProp();
14
21
  },
15
22
  destroyed() {
16
23
  this.unmount();
17
24
  },
25
+ watch: {
26
+ layers(next) {
27
+ this.layerList = this.parseLayers(next);
28
+ this.changeLayerVisible(this.layerList);
29
+ },
30
+ },
18
31
  methods: {
19
32
  createCesiumObject() {
20
33
  const { CesiumZondy, webGlobe } = this;
21
34
  let m3dLayer = new CesiumZondy.Layer.M3DLayer({
22
- viewer: webGlobe.viewer
35
+ viewer: webGlobe.viewer,
23
36
  });
24
37
  return m3dLayer;
25
38
  },
26
39
  watchProp() {
27
40
  let { show, opacity } = this;
28
41
  if (show) {
29
- this.$watch("show", function(next) {
42
+ this.$watch("show", function (next) {
30
43
  if (this.initial) return;
31
44
  this.changeShow(next);
32
45
  });
33
46
  }
34
47
  if (opacity >= 0 && opacity <= 1) {
35
- this.$watch("opacity", function(next) {
48
+ this.$watch("opacity", function (next) {
36
49
  if (this.initial) return;
37
50
  this.changeOpacity(next);
38
51
  });
@@ -41,15 +54,8 @@ export default {
41
54
  onM3dLoaded(e) {},
42
55
  mount() {
43
56
  const vm = this;
44
- const {
45
- webGlobe,
46
- vueIndex,
47
- vueKey,
48
- $props,
49
- offset,
50
- scale,
51
- opacity
52
- } = this;
57
+ const { webGlobe, vueIndex, vueKey, $props, offset, scale, opacity } =
58
+ this;
53
59
  const viewer = webGlobe.viewer;
54
60
 
55
61
  if (viewer.isDestroyed()) return;
@@ -58,10 +64,15 @@ export default {
58
64
  let m3dLayer = this.createCesiumObject();
59
65
  let m3ds = m3dLayer.append(`${this.url}`, {
60
66
  ...$props,
61
- loaded: tileset => {
67
+ loaded: (tileset) => {
62
68
  if (vueKey && vueIndex) {
63
69
  CesiumZondy.M3DIgsManager.addSource(vueKey, vueIndex, m3ds);
64
- !vm.show && m3ds && m3ds.forEach(m3d => (m3d.show = vm.show));
70
+
71
+ if (!vm.show && m3ds) {
72
+ m3ds.forEach((m3d) => {
73
+ m3d.show = vm.show;
74
+ });
75
+ }
65
76
  }
66
77
  if (offset) {
67
78
  let boundingSphere = tileset.boundingSphere;
@@ -90,16 +101,44 @@ export default {
90
101
  if (scale) {
91
102
  tileset.setScale(new Cesium.Cartesian3(scale.x, scale.y, scale.z));
92
103
  }
104
+
93
105
  if (opacity >= 0) {
94
- m3ds.forEach(
95
- m3d =>
96
- (m3d.style = new Cesium.Cesium3DTileStyle({
97
- color: `color('#FFFFFF', ${opacity})`
98
- }))
99
- );
106
+ let dataCallback = () => {
107
+ if (loop) {
108
+ window.clearInterval(loop);
109
+ loop = undefined;
110
+ m3ds.forEach((m3d) => {
111
+ let type = vm.checkType(m3d);
112
+ m3d.type = type;
113
+ switch (type) {
114
+ case M3dType.Model:
115
+ case M3dType.Instance:
116
+ m3d.style = new Cesium.Cesium3DTileStyle({
117
+ color: `color('#FFFFFF', ${opacity})`,
118
+ });
119
+ break;
120
+ case M3dType.CloudPoint:
121
+ // 0.0 1.0版本无法激活Cesium自带得下列样式代码,只能在2.0以后的版本实现透明度的改变
122
+ /* m3d.style = new Cesium.Cesium3DTileStyle({
123
+ color: {
124
+ conditions: [["true", "color('#FFFF00', 0.25)"]]
125
+ }
126
+ }); */
127
+ break;
128
+ case M3dType.UnKnow:
129
+ break;
130
+ }
131
+ });
132
+ }
133
+ };
134
+ let loop = window.setInterval(() => {
135
+ m3ds.forEach((m3d) => {
136
+ vm.checkType(m3d, dataCallback);
137
+ });
138
+ }, 100);
100
139
  }
101
140
  vm.$emit("loaded", { tileset: tileset, m3ds: m3ds });
102
- }
141
+ },
103
142
  });
104
143
  },
105
144
  unmount() {
@@ -110,7 +149,7 @@ export default {
110
149
  let m3ds = find.source;
111
150
  !viewer.isDestroyed() &&
112
151
  m3ds &&
113
- m3ds.forEach(l => {
152
+ m3ds.forEach((l) => {
114
153
  l.destroy();
115
154
  });
116
155
  }
@@ -122,29 +161,100 @@ export default {
122
161
  let find = CesiumZondy.M3DIgsManager.findSource(vueKey, vueIndex);
123
162
  if (find) {
124
163
  let m3ds = find.source;
125
- m3ds && m3ds.forEach(m3d => (m3d.show = show));
164
+ m3ds && m3ds.forEach((m3d) => (m3d.show = show));
126
165
  }
166
+ this.layerList = this.parseLayers();
167
+ this.changeLayerVisible(this.layerList);
127
168
  },
128
169
  changeOpacity(opacity) {
129
170
  const { vueKey, vueIndex } = this;
130
171
  let find = CesiumZondy.M3DIgsManager.findSource(vueKey, vueIndex);
131
- console.log('find', find.source);
132
172
  if (find) {
133
173
  let m3ds = find.source;
134
- m3ds &&
135
- m3ds.forEach(m3d => {
174
+ if (!m3ds) return;
175
+ m3ds.forEach((m3d) => {
176
+ if (m3d.type == M3dType.Model || m3d.type == M3dType.Instance) {
136
177
  m3d.style = new Cesium.Cesium3DTileStyle({
137
- color: `color('#FFFFFF', ${opacity})`
178
+ color: `color('#FFFFFF', ${opacity})`,
138
179
  });
139
- });
180
+ }
181
+ });
140
182
  }
141
- }
183
+ },
184
+ checkType(tileset, callback) {
185
+ let m3dType = M3dType.UnKnow;
186
+ const { root } = tileset;
187
+ if (!root) return m3dType;
188
+
189
+ const version = root.tileset._version;
190
+
191
+ if (version == 0.0 || version == 1.0) {
192
+ // m3d 0.x 1.x版本逻辑判断 type =0是模型 =1是示例化数据 =2是点云
193
+ let { children } = root;
194
+ if (!children || children.length <= 0) return m3dType;
195
+ let child = children[0];
196
+ if (child.content) {
197
+ let type = child.content._dataType;
198
+ if (callback) {
199
+ callback();
200
+ }
201
+ switch (type) {
202
+ case M3dType_0_0.Model:
203
+ m3dType = M3dType.Model;
204
+ break;
205
+ case M3dType_0_0.Instance:
206
+ m3dType = M3dType.Instance;
207
+ break;
208
+ case M3dType_0_0.CloudPoint:
209
+ m3dType = M3dType.CloudPoint;
210
+ break;
211
+ }
212
+ }
213
+ } else if (version == 2.0) {
214
+ }
215
+
216
+ return m3dType;
217
+ },
218
+ parseLayers(layerString) {
219
+ layerString = layerString || this.layers;
220
+ if (!layerString) return undefined;
221
+ let pattern = new RegExp(/layers=show:/i);
222
+ if (!pattern.test(layerString)) {
223
+ console.warn("layers格式错误,格式为layers=show:0,1,2");
224
+ }
225
+ let layerStr = layerString.replace(/layers=show:/i, "");
226
+ let layerStrs = layerStr.split(",");
227
+ let layers = layerStrs.map((l) => parseInt(l));
228
+ return layers;
229
+ },
230
+ changeLayerVisible(layers) {
231
+ layers = layers || this.layerList;
232
+ const { vueKey, vueIndex, show } = this;
233
+ let find = CesiumZondy.M3DIgsManager.findSource(vueKey, vueIndex);
234
+ if (find) {
235
+ let m3ds = find.source;
236
+ if (!m3ds) return;
237
+ m3ds.forEach((m3d) => {
238
+ if (layers) {
239
+ m3d.show = true;
240
+ if (layers.indexOf(m3d.layerIndex) >= 0) {
241
+ } else {
242
+ m3d.show = false;
243
+ }
244
+ } else if (!show) {
245
+ m3d.show = false;
246
+ } else {
247
+ m3d.show = true;
248
+ }
249
+ });
250
+ }
251
+ },
142
252
  },
143
253
  render(h) {
144
254
  return h("span", {
145
255
  class: "mapgis-3d-igs-m3d",
146
- ref: "m3d"
256
+ ref: "m3d",
147
257
  });
148
- }
258
+ },
149
259
  };
150
260
  </script>
@@ -0,0 +1,118 @@
1
+ <script>
2
+ import Tileset3dOptions from "./3DTilesetOptions";
3
+
4
+ export default {
5
+ name: "mapgis-3d-m3dset",
6
+ inject: ["Cesium", "CesiumZondy", "webGlobe"],
7
+ props: {
8
+ ...Tileset3dOptions
9
+ },
10
+ created() {},
11
+ mounted() {
12
+ this.mount();
13
+ this.watchProp();
14
+ },
15
+ destroyed() {
16
+ this.unmount();
17
+ },
18
+ methods: {
19
+ createCesiumObject() {
20
+ const { CesiumZondy, webGlobe } = this;
21
+ let m3dLayer = new CesiumZondy.Layer.M3DLayer({
22
+ viewer: webGlobe.viewer
23
+ });
24
+ return m3dLayer;
25
+ },
26
+ watchProp() {
27
+ let { show } = this;
28
+ if (show) {
29
+ this.$watch("show", function(next) {
30
+ if (this.initial) return;
31
+ this.changeShow(next);
32
+ });
33
+ }
34
+ },
35
+ onM3dLoaded(e) {},
36
+ mount() {
37
+ const vm = this;
38
+ const { webGlobe, vueIndex, vueKey, $props, offset, scale } = this;
39
+ const viewer = webGlobe.viewer;
40
+
41
+ if (viewer.isDestroyed()) return;
42
+ // this.$emit("load", { component: this });
43
+
44
+ let m3dLayer = this.createCesiumObject();
45
+ let m3ds = m3dLayer.append(`${this.url}`, {
46
+ ...$props,
47
+ loaded: tileset => {
48
+ if (vueKey && vueIndex) {
49
+ CesiumZondy.M3DIgsManager.addSource(vueKey, vueIndex, m3ds);
50
+ !vm.show && m3ds && m3ds.forEach(m3d => (m3d.show = vm.show));
51
+ }
52
+ if (offset) {
53
+ let boundingSphere = tileset.boundingSphere;
54
+ let cartographic = Cesium.Cartographic.fromCartesian(
55
+ boundingSphere.center
56
+ );
57
+ let surface = Cesium.Cartesian3.fromRadians(
58
+ cartographic.longitude,
59
+ cartographic.latitude,
60
+ 0.0
61
+ );
62
+ let { longitude = 0, latitude = 0, height = 0 } = offset;
63
+ let offsetParam = Cesium.Cartesian3.fromRadians(
64
+ cartographic.longitude + longitude,
65
+ cartographic.latitude + latitude,
66
+ height
67
+ );
68
+
69
+ let translation = Cesium.Cartesian3.subtract(
70
+ offsetParam,
71
+ surface,
72
+ new Cesium.Cartesian3()
73
+ );
74
+ tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
75
+ }
76
+ if (scale) {
77
+ tileset.setScale(new Cesium.Cartesian3(scale.x, scale.y, scale.z));
78
+ }
79
+ vm.$emit("loaded", { tileset: tileset, m3ds: m3ds });
80
+ }
81
+ });
82
+ },
83
+ unmount() {
84
+ const { webGlobe, CesiumZondy, vueKey, vueIndex } = this;
85
+ const viewer = webGlobe.viewer;
86
+ let find = CesiumZondy.M3DIgsManager.findSource(vueKey, vueIndex);
87
+ if (find) {
88
+ let m3ds = find.source;
89
+ !viewer.isDestroyed() &&
90
+ m3ds &&
91
+ m3ds.forEach(l => {
92
+ l.destroy();
93
+ });
94
+ }
95
+ this.$emit("unload", { component: this });
96
+ CesiumZondy.M3DIgsManager.deleteSource(vueKey, vueIndex);
97
+ },
98
+ changeShow(show) {
99
+ const {vueKey, vueIndex} = this;
100
+ let find = CesiumZondy.M3DIgsManager.findSource(vueKey, vueIndex);
101
+ if (find) {
102
+ let m3ds = find.source;
103
+ m3ds &&
104
+ m3ds.forEach(m3d => {
105
+ m3d.show = show;
106
+ console.log(m3d.show);
107
+ });
108
+ }
109
+ }
110
+ },
111
+ render(h) {
112
+ return h("span", {
113
+ class: "mapgis-3d-igs-m3d",
114
+ ref: "m3d"
115
+ });
116
+ }
117
+ };
118
+ </script>
@@ -0,0 +1,24 @@
1
+ export const M3dType = {
2
+ UnKnow: "UnKnow",
3
+ Model: "Model",
4
+ Instance: "Instance",
5
+ CloudPoint: "CloudPoint"
6
+ };
7
+
8
+ export const M3dType_0_0 = {
9
+ Model: 0,
10
+ Instance: 1,
11
+ CloudPoint: 2
12
+ };
13
+
14
+ export const M3dType_1_0 = {
15
+ Model: 0,
16
+ Instance: 1,
17
+ CloudPoint: 2
18
+ };
19
+
20
+ export const M3dType_2_0 = {
21
+ Model: 0,
22
+ Instance: 1,
23
+ CloudPoint: 2
24
+ };
@@ -33,6 +33,7 @@ export default {
33
33
  geojson: {
34
34
  deep: true,
35
35
  handler() {
36
+ const vm = this;
36
37
  this.dataSet = this.initData(this.geojson);
37
38
  if (!this.dataSet && this.mapvLayer) {
38
39
  this.mapvLayer.destroy();
@@ -42,6 +43,7 @@ export default {
42
43
  this.mount();
43
44
  } else {
44
45
  this.mapvLayer.updateData(this.dataSet, this.options);
46
+ // return new MapvLayer(this.webGlobe.viewer, this.dataset, this.options);
45
47
  }
46
48
  }
47
49
  },