@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,126 +1,316 @@
1
1
  <template>
2
- <div :class="['skyl',{ right: position === 'right', left: position === 'left' }]">
3
- <div
4
- class="card-title"
5
- :style="{
6
- background: 'rgb(38, 151, 204)',
7
- padding: '5px',
8
- color: 'white',
9
- }"
10
- >
11
- 天际线分析
12
- </div>
13
- <mapgis-ui-card>
14
- <mapgis-ui-button class="content" type="primary" @click="startSkyLine"
15
- >开始绘制</mapgis-ui-button
16
- >
17
- <mapgis-ui-button
18
- class="content-clear"
19
- type="primary"
20
- @click="clearSkyLine"
21
- >清除</mapgis-ui-button>
22
- </mapgis-ui-card>
2
+ <div>
3
+ <slot>
4
+ <div>
5
+ <mapgis-ui-setting-form :wrapper-width="200">
6
+ <mapgis-ui-mix-row
7
+ title="观察者信息:"
8
+ type="MapgisUiInput"
9
+ :value="centerPosition"
10
+ :props="observerProps"
11
+ />
12
+ <mapgis-ui-mix-row
13
+ title="线宽度:"
14
+ type="MapgisUiInputNumber"
15
+ v-model="formData.skylineWidth"
16
+ :props="lineWidthProps"
17
+ />
18
+ <mapgis-ui-mix-row
19
+ title="线颜色:"
20
+ type="MapgisUiColorPicker"
21
+ v-model="formData.skylineColor"
22
+ />
23
+ </mapgis-ui-setting-form>
24
+ <mapgis-ui-setting-footer>
25
+ <mapgis-ui-button type="primary" @click="add"
26
+ >天际线</mapgis-ui-button
27
+ >
28
+ <mapgis-ui-button @click="showAnalysis2d"
29
+ >二维天际线</mapgis-ui-button
30
+ >
31
+ <mapgis-ui-button @click="remove">清除</mapgis-ui-button>
32
+ </mapgis-ui-setting-footer>
33
+ <mapgis-ui-mask
34
+ :parentDivClass="'cesium-map-wrapper'"
35
+ :loading="maskShow"
36
+ :text="maskText"
37
+ ></mapgis-ui-mask>
38
+ </div>
39
+ </slot>
23
40
  </div>
24
41
  </template>
25
-
26
42
  <script>
43
+ import VueOptions from "../Base/Vue/VueOptions";
44
+ import * as echarts from "echarts";
45
+ import _cloneDeep from "lodash/cloneDeep";
46
+ import chartOptions from "./skyline2dChartOptions";
47
+ import {
48
+ colorToCesiumColor,
49
+ getCenterPosition,
50
+ isLogarithmicDepthBufferEnable,
51
+ setLogarithmicDepthBufferEnable
52
+ } from "../WebGlobe/util";
53
+
27
54
  export default {
28
55
  name: "mapgis-3d-skyline",
29
- props:{
30
- index: {
56
+ props: {
57
+ /**
58
+ * @type Number
59
+ * @default 2
60
+ * @description 天际线宽度
61
+ */
62
+ skylineWidth: {
31
63
  type: Number,
32
- default: 0,
64
+ default: 2
33
65
  },
34
- position: {
66
+ /**
67
+ * @type String
68
+ * @default 'rgb(255,0,0)'
69
+ * @description 天际线颜色
70
+ */
71
+ skylineColor: {
35
72
  type: String,
36
- default: "right",
73
+ default: "rgb(255,0,0)"
37
74
  },
75
+ ...VueOptions
38
76
  },
39
77
  inject: ["Cesium", "CesiumZondy", "webGlobe"],
40
- data(){
41
- return{
42
- //定义天地线分析
43
- skyLineAn:false
78
+ data() {
79
+ return {
80
+ formData: {
81
+ skylineWidth: 2,
82
+ skylineColor: "rgb(255,0,0)"
83
+ },
84
+ loading: null,
85
+ centerPosition: "",
86
+ positions2D: [],
87
+ skyline2dChart: null,
88
+ observerProps: {
89
+ disabled: true,
90
+ placeholder: "经度,纬度,高程"
91
+ },
92
+ lineWidthProps: {
93
+ min: 0
94
+ },
95
+ maskShow: false,
96
+ maskText: "正在分析中, 请稍等...",
97
+ //是否开启缓存区
98
+ isLogarithmicDepthBufferEnable: false
99
+ };
100
+ },
101
+ watch: {
102
+ skylineWidth: {
103
+ handler: function(newVal, oldVal) {
104
+ this.formData.skylineWidth = newVal;
105
+ },
106
+ immediate: true
107
+ },
108
+ skylineColor: {
109
+ handler: function(newVal, oldVal) {
110
+ this.formData.skylineColor = newVal;
111
+ },
112
+ immediate: true
44
113
  }
45
114
  },
46
115
  mounted() {
47
- window.skyline = window.skyline || [[], []];
116
+ this.skyline2dChart = echarts.init(
117
+ document.getElementById("skyline-2d-chart")
118
+ );
119
+ this.mount();
48
120
  },
49
121
  destroyed() {
50
- const { webGlobe } = this;
51
- let find = this.findSource();
52
- webGlobe.viewer.scene.VisualAnalysisManager.remove(
53
- window.skyline[this.index][find.index]
54
- );
55
- delete window.skyline;
56
- window.skyline = [[], []];
122
+ this.unmount();
57
123
  },
58
- methods:{
59
- findSource(){
124
+ methods: {
125
+ async createCesiumObject() {
126
+ const { baseUrl, options } = this;
127
+ // return new Cesium.GeoJsonDataSource.load(baseUrl, options);
128
+ return new Promise(
129
+ resolve => {
130
+ resolve();
131
+ },
132
+ reject => {}
133
+ );
134
+ },
135
+ mount() {
136
+ const { webGlobe, CesiumZondy, vueKey, vueIndex } = this;
137
+ const { viewer } = webGlobe;
60
138
  const vm = this;
61
- let index = -1;
62
- let find = window.skyline[this.index].find((s, i) => {
63
- let result = false;
64
- let { layer } = vm;
65
- if (s instanceof Cesium.SkyLineAnalysis) {
66
- index = i;
67
- result = true;
68
- }
69
- return result;
139
+ let promise = this.createCesiumObject();
140
+ promise.then(function(dataSource) {
141
+ vm.$emit("load", vm);
142
+ CesiumZondy.SkyLineAnalysisManager.addSource(
143
+ vueKey,
144
+ vueIndex,
145
+ dataSource,
146
+ {
147
+ skyLineAnalysis: null
148
+ }
149
+ );
70
150
  });
71
- return { index: index, value: find };
151
+ //缓存区设置
152
+ this.isLogarithmicDepthBufferEnable = isLogarithmicDepthBufferEnable(
153
+ this.webGlobe
154
+ );
155
+ if (
156
+ navigator.userAgent.indexOf("Linux") > 0 &&
157
+ navigator.userAgent.indexOf("Firefox") > 0
158
+ ) {
159
+ setLogarithmicDepthBufferEnable(false, this.webGlobe);
160
+ } else {
161
+ // 其他浏览器还是设置为true,不然会导致分析结果不正确,cesium1.8版本已不需要再额外设置
162
+ setLogarithmicDepthBufferEnable(true, this.webGlobe);
163
+ }
72
164
  },
73
- startSkyLine(){
74
- let that = this;
75
- let viewer = that.webGlobe.viewer;
76
- viewer.scene.globe.depthTestAgainstTerrain = true;
165
+ unmount() {
166
+ let { CesiumZondy, vueKey, vueIndex } = this;
167
+ let find = CesiumZondy.SkyLineAnalysisManager.findSource(
168
+ vueKey,
169
+ vueIndex
170
+ );
171
+ if (find) {
172
+ this.remove();
173
+ }
174
+ CesiumZondy.SkyLineAnalysisManager.deleteSource(vueKey, vueIndex);
77
175
 
78
- viewer.scene.globe.enableTransparent = false;
79
- if (that.skyLineAn === false){
80
- that.skyLineAn = true;
81
- window.skyline[that.index].push(
82
- new Cesium.SkyLineAnalysis(viewer.scene)
176
+ //缓存区设置
177
+ if (
178
+ this.isLogarithmicDepthBufferEnable !==
179
+ isLogarithmicDepthBufferEnable(this.webGlobe)
180
+ ) {
181
+ setLogarithmicDepthBufferEnable(
182
+ this.isLogarithmicDepthBufferEnable,
183
+ this.webGlobe
83
184
  );
84
185
  }
85
- if (that.skyLineAn){
86
- let find = that.findSource();
87
- let skyline3d = window.skyline[that.index][find.index];
88
- //添加天际线分析结果显示
89
- viewer.scene.VisualAnalysisManager.add(skyline3d);
186
+ this.$emit("unload", this);
187
+ },
188
+ remove() {
189
+ let { CesiumZondy, vueKey, vueIndex } = this;
190
+ let find = CesiumZondy.SkyLineAnalysisManager.findSource(
191
+ vueKey,
192
+ vueIndex
193
+ );
194
+ if (find && find.options) {
195
+ let { options } = find;
196
+ let { skyLineAnalysis } = options;
197
+
198
+ // 判断是否已有天际线分析结果
199
+ if (skyLineAnalysis) {
200
+ // 移除天际线分析显示结果
201
+ skyLineAnalysis.destroy();
202
+ skyLineAnalysis = null;
203
+ this.centerPosition = "";
204
+ this.positions2D = [];
205
+ }
90
206
  }
207
+ this.$emit("remove");
91
208
  },
92
- clearSkyLine(){
93
- let that = this;
94
- let viewer = that.webGlobe.viewer;
95
- let find = that.findSource();
96
- viewer.scene.globe.depthTestAgainstTerrain = true;
97
- if (that.skyLineAn === true){
98
- //删除分析结果
99
- viewer.scene.VisualAnalysisManager.remove(
100
- window.skyline[this.index][find.index]
101
- );
102
- delete window.skyline[this.index][find.index];
103
- that.skyLineAn = false;
209
+ /**
210
+ * 获取二维天际线图表的xy轴信息
211
+ */
212
+ getChartOptions() {
213
+ const { canvas } = this.webGlobe.viewer;
214
+ const w = canvas.clientWidth;
215
+ const h = canvas.clientHeight;
216
+ return this.positions2D.reduce(
217
+ ({ x, y }, v) => {
218
+ x.push((1 - v.x / w).toFixed(8));
219
+ y.push((1 - v.y / h).toFixed(8));
220
+ return {
221
+ x,
222
+ y
223
+ };
224
+ },
225
+ {
226
+ x: [],
227
+ y: []
228
+ }
229
+ );
230
+ },
231
+ /**
232
+ * 展示二维天际线
233
+ * todo 绘制完成回调添加二维坐标点 #143
234
+ */
235
+ showAnalysis2d() {
236
+ if (!this.positions2D.length) {
237
+ this.$message.warning("请先进行天际线分析");
238
+ } else {
239
+ this.skyline2dChart.clear();
240
+ this.skyline2dChart.showLoading();
241
+ this.skyline2dChart.setOption(chartOptions(this.getChartOptions()));
242
+ this.skyline2dChart.resize();
243
+ this.skyline2dChart.hideLoading();
244
+ this.$emit("showAnalysis2d", this.skyline2dChart);
104
245
  }
105
- }
246
+ },
247
+ /**
248
+ * 分析结束
249
+ * @param positions2D 二维坐标点
250
+ * @param positions3D 三维坐标点
251
+ */
252
+ analysisEndCallBack({ positions2D = [], positions3D }) {
253
+ this.positions2D = positions2D.length ? _cloneDeep(positions2D) : [];
254
+ this.maskShow = false;
255
+ },
256
+ add() {
257
+ this.remove();
258
+ this.maskShow = true;
259
+ let { CesiumZondy, vueKey, vueIndex } = this;
260
+ const { viewer } = this.webGlobe;
261
+ let find = CesiumZondy.SkyLineAnalysisManager.findSource(
262
+ vueKey,
263
+ vueIndex
264
+ );
265
+ let { options } = find;
266
+
267
+ // 初始化高级分析功能管理类
268
+ const advancedAnalysisManager = new this.CesiumZondy.Manager.AdvancedAnalysisManager(
269
+ {
270
+ viewer: this.webGlobe.viewer
271
+ }
272
+ );
273
+ // 创建天际线实例
274
+ let skylineAnalysisVal = options.skylineAnalysis;
275
+
276
+ skylineAnalysisVal =
277
+ skylineAnalysisVal || advancedAnalysisManager.createSkyLine();
278
+ skylineAnalysisVal._analysisEndCallBack = this.analysisEndCallBack;
279
+ skylineAnalysisVal.color = this.edgeColor();
280
+ skylineAnalysisVal.lineWidth = this.formData.skylineWidth;
106
281
 
282
+ this.$emit("success");
283
+ CesiumZondy.SkyLineAnalysisManager.changeOptions(
284
+ vueKey,
285
+ vueIndex,
286
+ "skyLineAnalysis",
287
+ skylineAnalysisVal
288
+ );
289
+ this.setCenterPosition();
290
+ },
291
+ edgeColor() {
292
+ return colorToCesiumColor(this.formData.skylineColor, this.webGlobe);
293
+ },
294
+ /**
295
+ * 设置观察者位置
296
+ */
297
+ setCenterPosition() {
298
+ const position = getCenterPosition(this.webGlobe);
299
+ if (position) {
300
+ const { lng, lat, height } = position;
301
+ const lngStr = `${lng.toFixed(4)}°`;
302
+ const latStr = `${lat.toFixed(4)}°`;
303
+ const heightStr = `${height.toFixed(2)}m`;
304
+ this.centerPosition = `${lngStr},${latStr},${heightStr}`;
305
+ }
306
+ }
107
307
  }
108
- }
308
+ };
109
309
  </script>
110
310
 
111
311
  <style scoped>
112
- ::v-deep .ant-card-body {
113
- max-height: 300px;
114
- overflow: auto;
312
+ #skyline-2d-chart {
313
+ width: 300px;
314
+ height: 230px;
115
315
  }
116
- .skyl.right{
117
- position: absolute;
118
- top: 20px;
119
- right: 20px;
120
- }
121
- .skyl.left{
122
- position: absolute;
123
- top: 20px;
124
- left: 20px;
125
- }
126
- </style>
316
+ </style>