@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
@@ -0,0 +1,317 @@
1
+ <template>
2
+ <div>
3
+ <slot>
4
+ <div class="mapgis-widget-slope-analysis">
5
+ <mapgis-ui-group-tab title="坡度图例设置">
6
+ <mapgis-ui-tooltip slot="handle" placement="bottomRight">
7
+ <template slot="title">
8
+ <span>{{ info }}</span>
9
+ </template>
10
+ <mapgis-ui-iconfont type="mapgis-info"></mapgis-ui-iconfont>
11
+ </mapgis-ui-tooltip>
12
+ </mapgis-ui-group-tab>
13
+ <mapgis-ui-colors-setting
14
+ v-model="rampColorsCopy"
15
+ :rangeField="'坡度范围'"
16
+ ></mapgis-ui-colors-setting>
17
+ <mapgis-ui-setting-footer>
18
+ <mapgis-ui-button type="primary" @click="analysis"
19
+ >分析</mapgis-ui-button
20
+ >
21
+ <mapgis-ui-button @click="remove">清除</mapgis-ui-button>
22
+ </mapgis-ui-setting-footer>
23
+ </div>
24
+ </slot>
25
+ </div>
26
+ </template>
27
+
28
+ <script>
29
+ import {rgbaToHex} from '../Utils/common/color-util';
30
+ /* import { Util } from "@mapgis/webclient-vue-ui";
31
+ const { ColorUtil } = Util; */
32
+ import VueOptions from "../Base/Vue/VueOptions";
33
+ import {
34
+ isEnableLighting,
35
+ setEnableLighting,
36
+ getBrightness,
37
+ getBrightnessStatusAndUniformsBrightness,
38
+ setBrightnessStatusAndUniformsBrightness
39
+ } from "../WebGlobe/util";
40
+
41
+ export default {
42
+ name: "mapgis-3d-analysis-slope",
43
+ inject: ["Cesium", "CesiumZondy", "webGlobe"],
44
+ props: {
45
+ ...VueOptions,
46
+ /**
47
+ * @type Object
48
+ * @description 坡度分析角度颜色数组
49
+ */
50
+ rampColors: {
51
+ type: Array,
52
+ default: () => {
53
+ return [
54
+ { min: 0, max: 15, color: "rgba(244, 67, 54, 0.5)" },
55
+ { min: 15, max: 30, color: "rgba(233, 30, 99, 0.5)" },
56
+ { min: 30, max: 45, color: "rgba(156, 39, 176, 0.5)" },
57
+ { min: 45, max: 60, color: "rgba(255, 235, 59, 0.5)" },
58
+ { min: 60, max: 75, color: "rgba(96, 125, 139, 0.5)" },
59
+ { min: 75, max: 90, color: "rgba(76, 175, 80, 0.5)" }
60
+ ];
61
+ }
62
+ }
63
+ },
64
+ watch: {
65
+ rampColors: {
66
+ handler() {
67
+ this.rampColorsCopy = this.rampColors;
68
+ },
69
+ deep: true,
70
+ immediate: true
71
+ }
72
+ },
73
+ data() {
74
+ return {
75
+ rampColorsCopy: [
76
+ { min: 0, max: 15, color: "rgba(244, 67, 54, 0.5)" },
77
+ { min: 15, max: 30, color: "rgba(233, 30, 99, 0.5)" },
78
+ { min: 30, max: 45, color: "rgba(156, 39, 176, 0.5)" },
79
+ { min: 45, max: 60, color: "rgba(255, 235, 59, 0.5)" },
80
+ { min: 60, max: 75, color: "rgba(96, 125, 139, 0.5)" },
81
+ { min: 75, max: 90, color: "rgba(76, 175, 80, 0.5)" }
82
+ ],
83
+
84
+ isEnableLighting: undefined, // 光照是否已开启
85
+
86
+ noBrightness: undefined, // 是否有brightness对象
87
+
88
+ brightnessStatusAndUniformsBrightness: undefined, // 光照参数
89
+
90
+ info: "坡度分析需要带法线地形。"
91
+ };
92
+ },
93
+
94
+ created() {},
95
+ mounted() {
96
+ this.mount();
97
+ },
98
+ destroyed() {
99
+ this.unmount();
100
+ },
101
+ methods: {
102
+ async createCesiumObject() {
103
+ const { baseUrl, options } = this;
104
+ return new Promise(
105
+ resolve => {
106
+ resolve();
107
+ },
108
+ reject => {}
109
+ );
110
+ },
111
+ mount() {
112
+ const { webGlobe, CesiumZondy, vueKey, vueIndex } = this;
113
+ const { viewer } = webGlobe;
114
+ const vm = this;
115
+ let promise = this.createCesiumObject();
116
+ promise.then(function(dataSource) {
117
+ vm.$emit("load", vm);
118
+ CesiumZondy.SlopeAnalysisManager.addSource(
119
+ vueKey,
120
+ vueIndex,
121
+ dataSource,
122
+ {
123
+ drawElement: null,
124
+ slopeAnalysis: null
125
+ }
126
+ );
127
+ });
128
+ },
129
+ unmount() {
130
+ let { CesiumZondy, vueKey, vueIndex } = this;
131
+ let find = CesiumZondy.SlopeAnalysisManager.findSource(vueKey, vueIndex);
132
+ if (find) {
133
+ this.remove();
134
+ }
135
+ CesiumZondy.SlopeAnalysisManager.deleteSource(vueKey, vueIndex);
136
+ this.$emit("unload", this);
137
+ },
138
+ /**
139
+ * @description 开启光照
140
+ */
141
+ _enableBrightness() {
142
+ // 开启光照,不然放大地图,分析结果显示异常
143
+
144
+ this.isEnableLighting = isEnableLighting(this.webGlobe);
145
+ if (!this.isEnableLighting) {
146
+ // 未开启光照,开启
147
+ setEnableLighting(true, this.webGlobe);
148
+ }
149
+ // 调高亮度
150
+ const { viewer } = this.webGlobe;
151
+ const stages = viewer.scene.postProcessStages;
152
+ const brightness = getBrightness(this.webGlobe);
153
+ if (!brightness) {
154
+ // 初始没有brightness对象
155
+ this.noBrightness = true;
156
+ viewer.scene.brightness = stages.add(
157
+ this.Cesium.PostProcessStageLibrary.createBrightnessStage()
158
+ );
159
+ }
160
+ // 设置前记录原有光照参数
161
+ this.brightnessStatusAndUniformsBrightness = getBrightnessStatusAndUniformsBrightness(
162
+ this.webGlobe
163
+ );
164
+ const statusAndUniformsBrightness = {
165
+ enabled: true,
166
+ brightness: 1.2
167
+ };
168
+ setBrightnessStatusAndUniformsBrightness(
169
+ statusAndUniformsBrightness,
170
+ this.webGlobe
171
+ );
172
+ },
173
+ /**
174
+ * @description 开始绘制并分析
175
+ */
176
+ analysis() {
177
+ let { CesiumZondy, vueKey, vueIndex } = this;
178
+ let find = CesiumZondy.SlopeAnalysisManager.findSource(vueKey, vueIndex);
179
+ let { options } = find;
180
+ let { slopeAnalysis, drawElement } = options;
181
+ const { viewer } = this.webGlobe;
182
+ // 初始化交互式绘制控件
183
+ drawElement = drawElement || new this.Cesium.DrawElement(viewer);
184
+ CesiumZondy.SlopeAnalysisManager.changeOptions(
185
+ vueKey,
186
+ vueIndex,
187
+ "drawElement",
188
+ drawElement
189
+ );
190
+
191
+ const { rampColorsCopy } = this;
192
+
193
+ const colors = [];
194
+ const ramp = [];
195
+ rampColorsCopy.forEach(({ max, color }) => {
196
+ ramp.push((max / 360).toFixed(2));
197
+ colors.push(color);
198
+ });
199
+ const rampColor = this._transformColor(colors);
200
+
201
+ // 激活交互式绘制工具
202
+ drawElement.startDrawingPolygon({
203
+ // 绘制完成回调函数
204
+ callback: positions => {
205
+ this.remove();
206
+ this._enableBrightness(); // 开启光照
207
+ slopeAnalysis =
208
+ slopeAnalysis ||
209
+ new this.Cesium.TerrainAnalyse(viewer, {
210
+ slopeRampColor: rampColor,
211
+ slopeRamp: ramp
212
+ });
213
+ slopeAnalysis.enableContour(false);
214
+ slopeAnalysis.updateMaterial("slope");
215
+ slopeAnalysis.changeAnalyseArea(positions);
216
+ CesiumZondy.SlopeAnalysisManager.changeOptions(
217
+ vueKey,
218
+ vueIndex,
219
+ "slopeAnalysis",
220
+ slopeAnalysis
221
+ );
222
+ }
223
+ });
224
+ },
225
+ /**
226
+ * @description rgba数组转hex数组
227
+ * @param arrayColor - {Array} rgba数组
228
+ * @return hex数组
229
+ */
230
+ _transformColor(arrayColor) {
231
+ let isNull = false;
232
+ const arr = arrayColor.map(color => {
233
+ if (color) {
234
+ return rgbaToHex(color);
235
+ }
236
+ isNull = true;
237
+ return null;
238
+ });
239
+ if (isNull) {
240
+ return [];
241
+ }
242
+ return arr;
243
+ },
244
+ /**
245
+ * @description 移除坡度分析结果,取消交互式绘制事件激活状态
246
+ */
247
+ remove() {
248
+ let { CesiumZondy, vueKey, vueIndex } = this;
249
+ let find = CesiumZondy.SlopeAnalysisManager.findSource(vueKey, vueIndex);
250
+ let { options } = find;
251
+ let { slopeAnalysis, drawElement } = options;
252
+
253
+ // 判断是否已有坡度分析结果
254
+ if (slopeAnalysis) {
255
+ // 移除坡度分析显示结果
256
+ slopeAnalysis.updateMaterial("none");
257
+ CesiumZondy.SlopeAnalysisManager.changeOptions(
258
+ vueKey,
259
+ vueIndex,
260
+ "slopeAnalysis",
261
+ null
262
+ );
263
+ }
264
+
265
+ if (drawElement) {
266
+ // 取消交互式绘制矩形事件激活状态
267
+ drawElement.stopDrawing();
268
+ CesiumZondy.SlopeAnalysisManager.changeOptions(
269
+ vueKey,
270
+ vueIndex,
271
+ "drawElement",
272
+ null
273
+ );
274
+ }
275
+
276
+ // 恢复光照设置
277
+ this._restoreEnableLighting();
278
+ },
279
+ /***
280
+ * 恢复光照设置
281
+ */
282
+ _restoreEnableLighting() {
283
+ // 恢复光照开启状态设置
284
+ if (
285
+ this.isEnableLighting !== undefined &&
286
+ this.isEnableLighting !== isEnableLighting(this.webGlobe)
287
+ ) {
288
+ setEnableLighting(this.isEnableLighting, this.webGlobe);
289
+ }
290
+ const stages = this.webGlobe.viewer.scene.postProcessStages;
291
+ if (this.noBrightness) {
292
+ // 如果开始没有brightness对象,恢复
293
+ stages.remove(this.webGlobe.viewer.scene.brightness);
294
+ this.webGlobe.viewer.scene.brightness = undefined;
295
+ } else {
296
+ // 恢复brightness参数设置
297
+ if (this.brightnessStatusAndUniformsBrightness !== undefined) {
298
+ const brightnessStatusAndUniformsBrightness = getBrightnessStatusAndUniformsBrightness(
299
+ this.webGlobe
300
+ );
301
+ if (
302
+ this.brightnessStatusAndUniformsBrightness.enabled !==
303
+ brightnessStatusAndUniformsBrightness.enabled ||
304
+ this.brightnessStatusAndUniformsBrightness.brightness !==
305
+ brightnessStatusAndUniformsBrightness.brightness
306
+ ) {
307
+ setBrightnessStatusAndUniformsBrightness(
308
+ this.brightnessStatusAndUniformsBrightness,
309
+ this.webGlobe
310
+ );
311
+ }
312
+ }
313
+ }
314
+ }
315
+ }
316
+ };
317
+ </script>