@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.
- package/README.md +46 -49
- package/dist-libs/webclient-vue-cesium.common.js +191087 -0
- package/dist-libs/webclient-vue-cesium.css +1 -1
- package/dist-libs/webclient-vue-cesium.umd.js +191097 -0
- package/dist-libs/webclient-vue-cesium.umd.min.js +204 -194
- package/docs/.vuepress/config.js +47 -46
- package/docs/README.md +5 -4
- package/docs/api/analysis/Aspect.md +236 -0
- package/docs/api/analysis/Contour.md +240 -0
- package/docs/api/analysis/CutFill.md +306 -0
- package/docs/api/analysis/DynamicSection.md +336 -0
- package/docs/api/analysis/Excavate.md +3 -11
- package/docs/api/analysis/Flood.md +177 -200
- package/docs/api/analysis/HeightLimited.md +7 -4
- package/docs/api/analysis/ParticleEffects.md +549 -0
- package/docs/api/analysis/Profile.md +464 -0
- package/docs/api/analysis/Shadow.md +76 -13
- package/docs/api/analysis/Sightline.md +66 -13
- package/docs/api/analysis/Skyline.md +144 -29
- package/docs/api/analysis/Slope.md +236 -0
- package/docs/api/analysis/Viewshed.md +100 -21
- package/docs/api/layer/IGServer/IgsDocLayer.md +10 -0
- package/docs/api/layer/IGServer/IgsFeatureLayer.md +253 -0
- package/docs/api/layer/IGServer/IgsTileLayer.md +11 -0
- package/docs/api/layer/OGC/CesiumOgcWmsLayer.md +20 -19
- package/docs/api/layer/OGC/Wms.png +0 -0
- package/docs/api/layer/marker/DynamicMarker.md +81 -0
- package/docs/api/layer/marker/dynamicmarker.png +0 -0
- package/docs/api/layer/marker/selects.png +0 -0
- package/docs/api/layer/vectortile/vectortile.md +10 -0
- package/docs/api/m3d/image/layer_control_1.png +0 -0
- package/docs/api/m3d/image/layer_control_2.png +0 -0
- package/docs/api/m3d/image/layer_control_3.png +0 -0
- package/docs/api/m3d/m3d.md +13 -2
- package/docs/api/service/comprehensiveQuery/comprehensiveQuery.md +946 -0
- package/docs/api/ui/draw.md +68 -40
- package/docs/api/ui/link.md +8 -1
- package/docs/api/ui/marker.md +19 -1
- package/docs/api/ui/measure.md +82 -10
- package/docs/api/ui/table.md +6 -6
- package/docs/guide/README.md +26 -23
- package/docs/guide/basemap.md +35 -33
- package/docs/guide/markers&popups.md +46 -53
- package/docs/plugin_components/create_storybook.md +241 -0
- package/docs/plugin_components/img.png +0 -0
- package/docs/plugin_components/img_1.png +0 -0
- package/docs/plugin_components/img_10.png +0 -0
- package/docs/plugin_components/img_2.png +0 -0
- package/docs/plugin_components/img_3.png +0 -0
- package/docs/plugin_components/img_4.png +0 -0
- package/docs/plugin_components/img_5.png +0 -0
- package/docs/plugin_components/img_6.png +0 -0
- package/docs/plugin_components/img_7.png +0 -0
- package/docs/plugin_components/img_8.png +0 -0
- package/docs/version/diff.md +4 -4
- package/docs/version/version.md +81 -0
- package/package.json +5 -5
- package/src/cdn/cdn_component.js +62 -0
- package/src/component.js +20 -2
- package/src/components/Analysis/Aspect.vue +318 -0
- package/src/components/Analysis/Contour.vue +257 -0
- package/src/components/Analysis/CutFill.vue +581 -0
- package/src/components/Analysis/DynamicCutting.vue +98 -59
- package/src/components/Analysis/DynamicSection.vue +494 -0
- package/src/components/Analysis/Excavate.vue +133 -87
- package/src/components/Analysis/Flood.vue +395 -487
- package/src/components/Analysis/Flood.vue-- +630 -0
- package/src/components/Analysis/HeightLimited.vue +66 -47
- package/src/components/Analysis/ModelFlatten.vue +2 -2
- package/src/components/Analysis/Profile.vue +503 -0
- package/src/components/Analysis/Shadow.vue +220 -309
- package/src/components/Analysis/Sightline.vue +393 -375
- package/src/components/Analysis/SkyLine.vue +283 -93
- package/src/components/Analysis/Slope.vue +317 -0
- package/src/components/Analysis/Viewshed.vue +806 -373
- package/src/components/Analysis/skyline2dChartOptions.js +66 -0
- package/src/components/DataSource/Geojson/GeoJsonDataSource.vue +201 -3
- package/src/components/Layer/GeoJSON/GeoJsonLayer.vue +345 -0
- package/src/components/Layer/IGServer/IgsFeatureLayer.vue +227 -0
- package/src/components/Layer/Marker/DynamicMarkerLayer.vue +487 -0
- package/src/components/Layer/Marker/Marker3dPro.vue +196 -0
- package/src/components/Layer/Marker/Marker3dSetPro.vue +67 -0
- package/src/components/Layer/VectorTile/VectorTileLayer.vue +117 -33
- package/src/components/Layer/VectorTile/VectorTileOptions.js +1 -1
- package/src/components/M3D/3DTilesetOptions.js +23 -1
- package/src/components/M3D/G3D.vue +150 -0
- package/src/components/M3D/M3d.vue +142 -32
- package/src/components/M3D/M3dSet.vue +118 -0
- package/src/components/M3D/M3dType.js +24 -0
- package/src/components/Overlay/Mapv3dLayer.vue +2 -0
- package/src/components/Overlay/ParticleEffects.vue +545 -0
- package/src/components/Overlay/mapv/MapvBaseLayer.js +351 -172
- package/src/components/Overlay/mapv/MapvLayer.js +372 -324
- package/src/components/Overlay/mapv/SuperCluster.js +611 -0
- package/src/components/Overlay/themeLayer/heater/CesiumHeater.vue +152 -0
- package/src/components/Overlay/themeLayer/heater/MapvHeater.vue +161 -0
- package/src/components/UI/Controls/Draw/Draw.vue +320 -92
- package/src/components/UI/Controls/Legend/Legend.vue +55 -51
- package/src/components/UI/Controls/Link/Link.vue +59 -37
- package/src/components/UI/Controls/Measure/Measure.vue +75 -33
- package/src/components/UI/Controls/Measure/components/MeasureResult.vue +71 -0
- package/src/components/UI/Controls/Measure/components/MeasureSetting.vue +63 -0
- package/src/components/UI/Controls/Measure/components/MeasureTool.vue +155 -0
- package/src/components/UI/Geojson/Popup.vue +101 -0
- package/src/components/UI/Marker/Marker.vue +185 -48
- package/src/components/UI/Popup/Popup.vue +21 -64
- package/src/components/Utils/common/color-util.js +159 -0
- package/src/components/Utils/util.js +311 -231
- package/src/components/WebGlobe/manager.js +81 -3
- package/src/components/WebGlobe/mixins/withPrivateMethods.js +4 -2
- package/src/components/WebGlobe/util.js +173 -0
- package/src/components/service/comprehensive-query/ComprehensiveQuery.vue +156 -0
- package/src/components/service/comprehensive-query/PlaceNameCesium.vue +102 -0
- package/src/components/service/comprehensive-query/util/catalog/document.js +626 -0
- package/src/components/service/comprehensive-query/util/feature/arcgis-feature-query.js +448 -0
- package/src/components/service/comprehensive-query/util/feature/feature-convert.js +408 -0
- package/src/components/service/comprehensive-query/util/feature/feature-edit.js +50 -0
- package/src/components/service/comprehensive-query/util/feature/feature-geojson.js +100 -0
- package/src/components/service/comprehensive-query/util/feature/feature-query.js +723 -0
- package/src/components/service/comprehensive-query/util/feature/feature.js +1 -0
- package/src/components/service/comprehensive-query/util/feature/index.js +9 -0
- package/src/components/service/comprehensive-query/util/objects/geometry.js +58 -0
- package/src/components/Overlay/Mapv.vue +0 -142
- package/src/components/Overlay/MapvHeater.vue +0 -98
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<slot>
|
|
4
|
+
<div class="mapgis-widget-cut-fill-analysis">
|
|
5
|
+
<mapgis-ui-group-tab title="参数设置">
|
|
6
|
+
<mapgis-ui-toolbar slot="handle" :bordered="false">
|
|
7
|
+
<mapgis-ui-toolbar-command
|
|
8
|
+
icon="mapgis-redo"
|
|
9
|
+
title="重新计算"
|
|
10
|
+
@click="refresh"
|
|
11
|
+
:disabled="!recalculate"
|
|
12
|
+
></mapgis-ui-toolbar-command>
|
|
13
|
+
</mapgis-ui-toolbar>
|
|
14
|
+
</mapgis-ui-group-tab>
|
|
15
|
+
<mapgis-ui-setting-form>
|
|
16
|
+
<mapgis-ui-form-item label="x方向采样点数">
|
|
17
|
+
<mapgis-ui-input
|
|
18
|
+
v-model.number="xPaneNumCopy"
|
|
19
|
+
type="number"
|
|
20
|
+
min="0"
|
|
21
|
+
/>
|
|
22
|
+
</mapgis-ui-form-item>
|
|
23
|
+
<mapgis-ui-form-item label="y方向采样点数">
|
|
24
|
+
<mapgis-ui-input
|
|
25
|
+
v-model.number="yPaneNumCopy"
|
|
26
|
+
type="number"
|
|
27
|
+
min="0"
|
|
28
|
+
/>
|
|
29
|
+
</mapgis-ui-form-item>
|
|
30
|
+
<mapgis-ui-form-item label="填挖规整高度">
|
|
31
|
+
<mapgis-ui-input
|
|
32
|
+
v-model.number="heightCopy"
|
|
33
|
+
type="number"
|
|
34
|
+
min="0"
|
|
35
|
+
addon-after="(米)"
|
|
36
|
+
/>
|
|
37
|
+
</mapgis-ui-form-item>
|
|
38
|
+
</mapgis-ui-setting-form>
|
|
39
|
+
<mapgis-ui-group-tab title="样式设置"></mapgis-ui-group-tab>
|
|
40
|
+
<mapgis-ui-setting-form>
|
|
41
|
+
<mapgis-ui-form-item label="边线">
|
|
42
|
+
<mapgis-ui-sketch-color-picker
|
|
43
|
+
:color.sync="lineColorCopy"
|
|
44
|
+
:disableAlpha="false"
|
|
45
|
+
></mapgis-ui-sketch-color-picker>
|
|
46
|
+
</mapgis-ui-form-item>
|
|
47
|
+
<mapgis-ui-form-item label="填充">
|
|
48
|
+
<mapgis-ui-sketch-color-picker
|
|
49
|
+
:color.sync="fillColorCopy"
|
|
50
|
+
:disableAlpha="false"
|
|
51
|
+
></mapgis-ui-sketch-color-picker>
|
|
52
|
+
</mapgis-ui-form-item>
|
|
53
|
+
</mapgis-ui-setting-form>
|
|
54
|
+
<mapgis-ui-group-tab title="填挖结果"></mapgis-ui-group-tab>
|
|
55
|
+
<mapgis-ui-setting-form>
|
|
56
|
+
<mapgis-ui-form-item label="高程范围">
|
|
57
|
+
<mapgis-ui-input
|
|
58
|
+
v-model.number="result.height"
|
|
59
|
+
disabled
|
|
60
|
+
addon-after="(米)"
|
|
61
|
+
/>
|
|
62
|
+
</mapgis-ui-form-item>
|
|
63
|
+
<mapgis-ui-form-item label="表面积">
|
|
64
|
+
<mapgis-ui-input
|
|
65
|
+
v-model.number="result.surfaceArea"
|
|
66
|
+
disabled
|
|
67
|
+
addon-after="(平方米)"
|
|
68
|
+
/>
|
|
69
|
+
</mapgis-ui-form-item>
|
|
70
|
+
<mapgis-ui-form-item label="挖体积">
|
|
71
|
+
<mapgis-ui-input
|
|
72
|
+
v-model.number="result.cutVolume"
|
|
73
|
+
disabled
|
|
74
|
+
addon-after="(立方米)"
|
|
75
|
+
/>
|
|
76
|
+
</mapgis-ui-form-item>
|
|
77
|
+
<mapgis-ui-form-item label="填体积">
|
|
78
|
+
<mapgis-ui-input
|
|
79
|
+
v-model.number="result.fillVolume"
|
|
80
|
+
disabled
|
|
81
|
+
addon-after="(立方米)"
|
|
82
|
+
/>
|
|
83
|
+
</mapgis-ui-form-item>
|
|
84
|
+
</mapgis-ui-setting-form>
|
|
85
|
+
<mapgis-ui-setting-footer>
|
|
86
|
+
<mapgis-ui-button type="primary" @click="analysis"
|
|
87
|
+
>分析</mapgis-ui-button
|
|
88
|
+
>
|
|
89
|
+
<mapgis-ui-button @click="remove">清除</mapgis-ui-button>
|
|
90
|
+
</mapgis-ui-setting-footer>
|
|
91
|
+
</div>
|
|
92
|
+
</slot>
|
|
93
|
+
<mapgis-ui-mask
|
|
94
|
+
v-if="useMask"
|
|
95
|
+
:parentDivClass="'cesium-map-wrapper'"
|
|
96
|
+
:loading="maskShow"
|
|
97
|
+
:text="maskText"
|
|
98
|
+
></mapgis-ui-mask>
|
|
99
|
+
</div>
|
|
100
|
+
</template>
|
|
101
|
+
|
|
102
|
+
<script>
|
|
103
|
+
import VueOptions from "../Base/Vue/VueOptions";
|
|
104
|
+
import {
|
|
105
|
+
colorToCesiumColor,
|
|
106
|
+
isDepthTestAgainstTerrainEnable,
|
|
107
|
+
setDepthTestAgainstTerrainEnable
|
|
108
|
+
} from "../WebGlobe/util";
|
|
109
|
+
|
|
110
|
+
export default {
|
|
111
|
+
name: "mapgis-3d-analysis-cut-fill",
|
|
112
|
+
inject: ["Cesium", "CesiumZondy", "webGlobe"],
|
|
113
|
+
props: {
|
|
114
|
+
...VueOptions,
|
|
115
|
+
/**
|
|
116
|
+
* @type Number
|
|
117
|
+
* @default 16
|
|
118
|
+
* @description X坐标方向采样点的个数
|
|
119
|
+
*/
|
|
120
|
+
xPaneNum: {
|
|
121
|
+
type: Number,
|
|
122
|
+
default: 16
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* @type Number
|
|
126
|
+
* @default 16
|
|
127
|
+
* @description Y坐标方向采样点的个数
|
|
128
|
+
*/
|
|
129
|
+
yPaneNum: {
|
|
130
|
+
type: Number,
|
|
131
|
+
default: 16
|
|
132
|
+
},
|
|
133
|
+
/**
|
|
134
|
+
* @type Number
|
|
135
|
+
* @default 2000
|
|
136
|
+
* @description 平整高程
|
|
137
|
+
*/
|
|
138
|
+
height: {
|
|
139
|
+
type: Number,
|
|
140
|
+
default: 2000
|
|
141
|
+
},
|
|
142
|
+
/**
|
|
143
|
+
* @type String
|
|
144
|
+
* @default "rgba(0,255,0,1)"
|
|
145
|
+
* @description 分析区域边界颜色
|
|
146
|
+
*/
|
|
147
|
+
lineColor: {
|
|
148
|
+
type: String,
|
|
149
|
+
default: "rgba(0,255,0,1)"
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
* @type String
|
|
153
|
+
* @default "rgba(0,0,255,0.3)"
|
|
154
|
+
* @description 分析区域面颜色
|
|
155
|
+
*/
|
|
156
|
+
fillColor: {
|
|
157
|
+
type: String,
|
|
158
|
+
default: "rgba(0,0,255,0.3)"
|
|
159
|
+
},
|
|
160
|
+
/**
|
|
161
|
+
* @type Number
|
|
162
|
+
* @default 2.0
|
|
163
|
+
* @description 数据类型,0.0:地形,1.0:模型,2.0:通用
|
|
164
|
+
*/
|
|
165
|
+
dataType: {
|
|
166
|
+
type: Number,
|
|
167
|
+
default: 2.0
|
|
168
|
+
},
|
|
169
|
+
/**
|
|
170
|
+
* @type Boolean
|
|
171
|
+
* @default true
|
|
172
|
+
* @description 是否使用内置的遮罩层
|
|
173
|
+
*/
|
|
174
|
+
useMask: {
|
|
175
|
+
type: Boolean,
|
|
176
|
+
default: true
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
data() {
|
|
180
|
+
return {
|
|
181
|
+
xPaneNumCopy: 16,
|
|
182
|
+
yPaneNumCopy: 16,
|
|
183
|
+
heightCopy: 2000,
|
|
184
|
+
lineColorCopy: "rgba(0,255,0,1)",
|
|
185
|
+
fillColorCopy: "rgba(0,0,255,0.3)",
|
|
186
|
+
result: {
|
|
187
|
+
height: "",
|
|
188
|
+
surfaceArea: "",
|
|
189
|
+
cutVolume: "",
|
|
190
|
+
fillVolume: ""
|
|
191
|
+
},
|
|
192
|
+
positions: null,
|
|
193
|
+
recalculate: false,
|
|
194
|
+
entityController: null,
|
|
195
|
+
terrainLine: null,
|
|
196
|
+
terrainPolygon: null,
|
|
197
|
+
isDepthTestAgainstTerrainEnable: undefined, // 深度检测是否已开启,默认为undefined,当这个值为undefined的时候,说明没有赋值,不做任何处理
|
|
198
|
+
maskShow: false,
|
|
199
|
+
maskText: "正在分析中, 请稍等..."
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
computed: {
|
|
203
|
+
params() {
|
|
204
|
+
const { xPaneNumCopy, yPaneNumCopy, heightCopy } = this;
|
|
205
|
+
return { xPaneNumCopy, yPaneNumCopy, heightCopy };
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
created() {},
|
|
209
|
+
mounted() {
|
|
210
|
+
this.mount();
|
|
211
|
+
},
|
|
212
|
+
destroyed() {
|
|
213
|
+
this.unmount();
|
|
214
|
+
},
|
|
215
|
+
watch: {
|
|
216
|
+
params: {
|
|
217
|
+
handler: function(e) {
|
|
218
|
+
if (this.positions) {
|
|
219
|
+
this.recalculate = true;
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
deep: true,
|
|
223
|
+
immediate: true
|
|
224
|
+
},
|
|
225
|
+
xPaneNum: {
|
|
226
|
+
handler() {
|
|
227
|
+
this.xPaneNumCopy = this.xPaneNum;
|
|
228
|
+
},
|
|
229
|
+
immediate: true
|
|
230
|
+
},
|
|
231
|
+
yPaneNum: {
|
|
232
|
+
handler() {
|
|
233
|
+
this.yPaneNumCopy = this.yPaneNum;
|
|
234
|
+
},
|
|
235
|
+
immediate: true
|
|
236
|
+
},
|
|
237
|
+
height: {
|
|
238
|
+
handler() {
|
|
239
|
+
this.heightCopy = this.height;
|
|
240
|
+
},
|
|
241
|
+
immediate: true
|
|
242
|
+
},
|
|
243
|
+
lineColor: {
|
|
244
|
+
handler() {
|
|
245
|
+
this.lineColorCopy = this.lineColor;
|
|
246
|
+
},
|
|
247
|
+
immediate: true
|
|
248
|
+
},
|
|
249
|
+
fillColor: {
|
|
250
|
+
handler() {
|
|
251
|
+
this.fillColorCopy = this.fillColor;
|
|
252
|
+
},
|
|
253
|
+
immediate: true
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
methods: {
|
|
257
|
+
async createCesiumObject() {
|
|
258
|
+
return new Promise(
|
|
259
|
+
resolve => {
|
|
260
|
+
resolve();
|
|
261
|
+
},
|
|
262
|
+
reject => {}
|
|
263
|
+
);
|
|
264
|
+
},
|
|
265
|
+
mount() {
|
|
266
|
+
const { webGlobe, CesiumZondy, vueKey, vueIndex } = this;
|
|
267
|
+
const { viewer } = webGlobe;
|
|
268
|
+
const vm = this;
|
|
269
|
+
let promise = this.createCesiumObject();
|
|
270
|
+
promise.then(function(dataSource) {
|
|
271
|
+
vm.$emit("load", vm);
|
|
272
|
+
CesiumZondy.CutFillAnalysisManager.addSource(
|
|
273
|
+
vueKey,
|
|
274
|
+
vueIndex,
|
|
275
|
+
dataSource,
|
|
276
|
+
{
|
|
277
|
+
drawElement: null,
|
|
278
|
+
cutFillAnalysis: null
|
|
279
|
+
}
|
|
280
|
+
);
|
|
281
|
+
});
|
|
282
|
+
},
|
|
283
|
+
unmount() {
|
|
284
|
+
let { CesiumZondy, vueKey, vueIndex } = this;
|
|
285
|
+
let find = CesiumZondy.CutFillAnalysisManager.findSource(
|
|
286
|
+
vueKey,
|
|
287
|
+
vueIndex
|
|
288
|
+
);
|
|
289
|
+
if (find) {
|
|
290
|
+
this.remove();
|
|
291
|
+
}
|
|
292
|
+
CesiumZondy.CutFillAnalysisManager.deleteSource(vueKey, vueIndex);
|
|
293
|
+
this.$emit("unload", this);
|
|
294
|
+
},
|
|
295
|
+
/**
|
|
296
|
+
* @description rgba值转cesium内部color对象
|
|
297
|
+
* @param rgba - {String} rgba值
|
|
298
|
+
* @return {Object} cesium内部color对象
|
|
299
|
+
*/
|
|
300
|
+
_getColor(rgba) {
|
|
301
|
+
return colorToCesiumColor(rgba, this.webGlobe);
|
|
302
|
+
},
|
|
303
|
+
/**
|
|
304
|
+
* @description 获取SourceOptions,以方便获取填挖方分析对象和绘制对象
|
|
305
|
+
* @return SourceOptions对象
|
|
306
|
+
*/
|
|
307
|
+
_getSourceOptions() {
|
|
308
|
+
const { CesiumZondy, vueKey, vueIndex } = this;
|
|
309
|
+
const find = CesiumZondy.CutFillAnalysisManager.findSource(
|
|
310
|
+
vueKey,
|
|
311
|
+
vueIndex
|
|
312
|
+
);
|
|
313
|
+
const { options } = find;
|
|
314
|
+
return options;
|
|
315
|
+
},
|
|
316
|
+
/**
|
|
317
|
+
* @description 开始绘制并分析
|
|
318
|
+
*/
|
|
319
|
+
analysis() {
|
|
320
|
+
let { CesiumZondy, vueKey, vueIndex, Cesium } = this;
|
|
321
|
+
const options = this._getSourceOptions();
|
|
322
|
+
let { cutFillAnalysis, drawElement } = options;
|
|
323
|
+
const { viewer } = this.webGlobe;
|
|
324
|
+
// 初始化交互式绘制控件
|
|
325
|
+
drawElement = drawElement || new Cesium.DrawElement(viewer);
|
|
326
|
+
CesiumZondy.CutFillAnalysisManager.changeOptions(
|
|
327
|
+
vueKey,
|
|
328
|
+
vueIndex,
|
|
329
|
+
"drawElement",
|
|
330
|
+
drawElement
|
|
331
|
+
);
|
|
332
|
+
const lineColor = this._getColor(this.lineColorCopy);
|
|
333
|
+
const fillColor = this._getColor(this.fillColorCopy);
|
|
334
|
+
|
|
335
|
+
// 激活交互式绘制工具
|
|
336
|
+
drawElement.startDrawingPolygon({
|
|
337
|
+
// 绘制完成回调函数
|
|
338
|
+
callback: positions => {
|
|
339
|
+
this.$emit("start");
|
|
340
|
+
this.remove();
|
|
341
|
+
this.positions = positions;
|
|
342
|
+
this.maskShow = true;
|
|
343
|
+
|
|
344
|
+
const linePointArr = [];
|
|
345
|
+
const polygonPointArr = [];
|
|
346
|
+
positions.forEach(element => {
|
|
347
|
+
const { lon, lat, height } = this._cartesianToDegrees(element);
|
|
348
|
+
linePointArr.push(lon);
|
|
349
|
+
linePointArr.push(lat);
|
|
350
|
+
polygonPointArr.push(lon);
|
|
351
|
+
polygonPointArr.push(lat);
|
|
352
|
+
polygonPointArr.push(height);
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
// 构造几何绘制控制对象
|
|
356
|
+
this.entityController = new CesiumZondy.Manager.EntityController({
|
|
357
|
+
viewer
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
// 绘制贴地形线
|
|
361
|
+
this.terrainLine = this.entityController.appendLine(
|
|
362
|
+
// 名称
|
|
363
|
+
"贴地形线",
|
|
364
|
+
// 点数组
|
|
365
|
+
linePointArr,
|
|
366
|
+
// 线宽
|
|
367
|
+
3,
|
|
368
|
+
// 线颜色
|
|
369
|
+
lineColor,
|
|
370
|
+
// 是否识别带高度的坐标
|
|
371
|
+
false,
|
|
372
|
+
// 是否贴地形
|
|
373
|
+
true,
|
|
374
|
+
// 附加属性
|
|
375
|
+
{}
|
|
376
|
+
);
|
|
377
|
+
|
|
378
|
+
// 构造区对象
|
|
379
|
+
const polygon = {
|
|
380
|
+
// 区
|
|
381
|
+
polygon: {
|
|
382
|
+
// 坐标
|
|
383
|
+
hierarchy: this.Cesium.Cartesian3.fromDegreesArrayHeights(
|
|
384
|
+
polygonPointArr
|
|
385
|
+
),
|
|
386
|
+
// 颜色
|
|
387
|
+
material: fillColor,
|
|
388
|
+
// 分类类型:地形类型
|
|
389
|
+
classificationType: this.Cesium.ClassificationType.TERRAIN
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
// 绘制图形通用方法:对接Cesium原生特性
|
|
393
|
+
this.terrainPolygon = this.entityController.appendGraphics(polygon);
|
|
394
|
+
|
|
395
|
+
this._doAnalysis();
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
},
|
|
399
|
+
/**
|
|
400
|
+
* @description 世界坐标转经纬度坐标
|
|
401
|
+
* @param cartesian - {Object} 世界坐标
|
|
402
|
+
* @return {Object} 经纬度坐标
|
|
403
|
+
*/
|
|
404
|
+
_cartesianToDegrees(cartesian) {
|
|
405
|
+
const { ellipsoid } = this.webGlobe.scene.globe;
|
|
406
|
+
// 将笛卡尔坐标转换为地理坐标
|
|
407
|
+
const cartographic = ellipsoid.cartesianToCartographic(cartesian);
|
|
408
|
+
// 将弧度转为度的十进制度表示
|
|
409
|
+
const longitude = this.Cesium.Math.toDegrees(cartographic.longitude); // 转换后的经度
|
|
410
|
+
const latitude = this.Cesium.Math.toDegrees(cartographic.latitude); // 转换后的纬度
|
|
411
|
+
const coor = {
|
|
412
|
+
lon: longitude,
|
|
413
|
+
lat: latitude,
|
|
414
|
+
height: cartographic.height
|
|
415
|
+
};
|
|
416
|
+
return coor;
|
|
417
|
+
},
|
|
418
|
+
/**
|
|
419
|
+
* @description 进行填挖方分析
|
|
420
|
+
*/
|
|
421
|
+
_doAnalysis() {
|
|
422
|
+
const { positions } = this;
|
|
423
|
+
if (!positions) {
|
|
424
|
+
this.$message.warning("请绘制分析区域");
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
this._reset();
|
|
428
|
+
const { viewer } = this.webGlobe;
|
|
429
|
+
const { xPaneNumCopy, yPaneNumCopy, heightCopy } = this;
|
|
430
|
+
|
|
431
|
+
this.isDepthTestAgainstTerrainEnable = isDepthTestAgainstTerrainEnable(
|
|
432
|
+
this.webGlobe
|
|
433
|
+
);
|
|
434
|
+
if (!this.isDepthTestAgainstTerrainEnable) {
|
|
435
|
+
// 如果深度检测没有开启,则开启
|
|
436
|
+
setDepthTestAgainstTerrainEnable(true, this.webGlobe);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// 初始化高级分析功能管理类
|
|
440
|
+
const cutFillAnalysis = new this.CesiumZondy.Manager.AdvancedAnalysisManager(
|
|
441
|
+
{
|
|
442
|
+
viewer
|
|
443
|
+
}
|
|
444
|
+
);
|
|
445
|
+
// 创建填挖方实例
|
|
446
|
+
const cutFill = cutFillAnalysis.createCutFill(this.dataType, {
|
|
447
|
+
// 设置x方向采样点个数
|
|
448
|
+
xPaneNum: xPaneNumCopy,
|
|
449
|
+
// 设置y方向采样点个数参数
|
|
450
|
+
yPaneNum: yPaneNumCopy,
|
|
451
|
+
// 设置填挖规整高度
|
|
452
|
+
height: heightCopy,
|
|
453
|
+
// 返回结果的回调函数
|
|
454
|
+
callback: this._analysisSuccess
|
|
455
|
+
});
|
|
456
|
+
// 开始执行填挖方分析
|
|
457
|
+
cutFillAnalysis.startCutFill(cutFill, positions);
|
|
458
|
+
|
|
459
|
+
let { CesiumZondy, vueKey, vueIndex } = this;
|
|
460
|
+
|
|
461
|
+
CesiumZondy.CutFillAnalysisManager.changeOptions(
|
|
462
|
+
vueKey,
|
|
463
|
+
vueIndex,
|
|
464
|
+
"cutFillAnalysis",
|
|
465
|
+
cutFillAnalysis
|
|
466
|
+
);
|
|
467
|
+
},
|
|
468
|
+
/**
|
|
469
|
+
* @description 分析成功回调
|
|
470
|
+
*/
|
|
471
|
+
_analysisSuccess(result) {
|
|
472
|
+
this.result = {
|
|
473
|
+
height: `${result.minHeight.toFixed(2)}~${result.maxHeight.toFixed(2)}`,
|
|
474
|
+
surfaceArea: result.surfaceArea,
|
|
475
|
+
cutVolume: result.cutVolume,
|
|
476
|
+
fillVolume: result.fillVolume
|
|
477
|
+
};
|
|
478
|
+
this.maskShow = false;
|
|
479
|
+
this.$emit("success", result);
|
|
480
|
+
},
|
|
481
|
+
/**
|
|
482
|
+
* @description 重新计算
|
|
483
|
+
*/
|
|
484
|
+
refresh() {
|
|
485
|
+
this._doAnalysis();
|
|
486
|
+
},
|
|
487
|
+
/**
|
|
488
|
+
* @description 重置结果显示
|
|
489
|
+
*/
|
|
490
|
+
_reset() {
|
|
491
|
+
this.result = {
|
|
492
|
+
height: "",
|
|
493
|
+
surfaceArea: "",
|
|
494
|
+
cutVolume: "",
|
|
495
|
+
fillVolume: ""
|
|
496
|
+
};
|
|
497
|
+
},
|
|
498
|
+
/**
|
|
499
|
+
* @description 恢复深度检测设置
|
|
500
|
+
*/
|
|
501
|
+
_restoreDepthTestAgainstTerrain() {
|
|
502
|
+
if (
|
|
503
|
+
this.isDepthTestAgainstTerrainEnable !== undefined &&
|
|
504
|
+
this.isDepthTestAgainstTerrainEnable !==
|
|
505
|
+
isDepthTestAgainstTerrainEnable(this.webGlobe)
|
|
506
|
+
) {
|
|
507
|
+
setDepthTestAgainstTerrainEnable(
|
|
508
|
+
this.isDepthTestAgainstTerrainEnable,
|
|
509
|
+
this.webGlobe
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
/**
|
|
514
|
+
* @description 移除填挖方分析结果,取消交互式绘制事件激活状态,恢复深度检测设置,重置结果显示
|
|
515
|
+
*/
|
|
516
|
+
remove() {
|
|
517
|
+
let { CesiumZondy, vueKey, vueIndex } = this;
|
|
518
|
+
let options = this._getSourceOptions();
|
|
519
|
+
let { cutFillAnalysis, drawElement } = options;
|
|
520
|
+
|
|
521
|
+
// 判断是否已有等值线分析结果
|
|
522
|
+
if (cutFillAnalysis) {
|
|
523
|
+
CesiumZondy.CutFillAnalysisManager.changeOptions(
|
|
524
|
+
vueKey,
|
|
525
|
+
vueIndex,
|
|
526
|
+
"cutFillAnalysis",
|
|
527
|
+
null
|
|
528
|
+
);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
if (drawElement) {
|
|
532
|
+
// 取消交互式绘制矩形事件激活状态
|
|
533
|
+
drawElement.stopDrawing();
|
|
534
|
+
CesiumZondy.CutFillAnalysisManager.changeOptions(
|
|
535
|
+
vueKey,
|
|
536
|
+
vueIndex,
|
|
537
|
+
"drawElement",
|
|
538
|
+
null
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
this.positions = null;
|
|
543
|
+
this.recalculate = false;
|
|
544
|
+
this.maskShow = false;
|
|
545
|
+
this._reset();
|
|
546
|
+
|
|
547
|
+
this._restoreDepthTestAgainstTerrain();
|
|
548
|
+
if (this.terrainLine) {
|
|
549
|
+
this.entityController.removeEntity(this.terrainLine);
|
|
550
|
+
this.entityController.removeEntity(this.terrainPolygon);
|
|
551
|
+
this.terrainLine = null;
|
|
552
|
+
this.terrainPolygon = null;
|
|
553
|
+
this.entityController = null;
|
|
554
|
+
}
|
|
555
|
+
this.$emit("remove");
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
</script>
|
|
560
|
+
<style scoped>
|
|
561
|
+
.mapgis-widget-cut-fill-analysis {
|
|
562
|
+
max-height: calc(50vh);
|
|
563
|
+
overflow-y: auto;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
::v-deep .mapgis-ui-form-item {
|
|
567
|
+
margin-bottom: 0;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
::v-deep .mapgis-ui-form label {
|
|
571
|
+
font-size: 12px;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
::v-deep .mapgis-ui-form-item-label {
|
|
575
|
+
line-height: 40px;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
::v-deep .mapgis-ui-input {
|
|
579
|
+
padding: 4px 11px;
|
|
580
|
+
}
|
|
581
|
+
</style>
|