@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,630 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<slot>
|
|
4
|
+
<div class="flood-analyse-box" v-show="showOptionsPannel">
|
|
5
|
+
<mapgis-ui-row>
|
|
6
|
+
<mapgis-ui-col :span="8">
|
|
7
|
+
<p class="flood-title">最大淹没高度(米):</p>
|
|
8
|
+
</mapgis-ui-col>
|
|
9
|
+
<mapgis-ui-col :span="16">
|
|
10
|
+
<mapgis-ui-input v-model="maxHeightCopy" />
|
|
11
|
+
</mapgis-ui-col>
|
|
12
|
+
</mapgis-ui-row>
|
|
13
|
+
<mapgis-ui-row>
|
|
14
|
+
<mapgis-ui-col :span="8">
|
|
15
|
+
<p class="flood-title">最小淹没高度(米):</p>
|
|
16
|
+
</mapgis-ui-col>
|
|
17
|
+
<mapgis-ui-col :span="16">
|
|
18
|
+
<mapgis-ui-input v-model="startHeightCopy" />
|
|
19
|
+
</mapgis-ui-col>
|
|
20
|
+
</mapgis-ui-row>
|
|
21
|
+
<mapgis-ui-row>
|
|
22
|
+
<mapgis-ui-col :span="8">
|
|
23
|
+
<p class="flood-title">颜色:</p>
|
|
24
|
+
</mapgis-ui-col>
|
|
25
|
+
<mapgis-ui-col :span="12">
|
|
26
|
+
<mapgis-ui-input class="flood-input" v-model="floodColorCopy" />
|
|
27
|
+
</mapgis-ui-col>
|
|
28
|
+
<div v-if="showPicker" class="flood-color-picker">
|
|
29
|
+
<colorPicker
|
|
30
|
+
v-model="floodColorCopy"
|
|
31
|
+
v-on:change="headleChangeColor"
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
</mapgis-ui-row>
|
|
35
|
+
<mapgis-ui-row>
|
|
36
|
+
<mapgis-ui-col :span="8">
|
|
37
|
+
<p class="flood-title">洪水淹没速度:</p>
|
|
38
|
+
</mapgis-ui-col>
|
|
39
|
+
<mapgis-ui-col :span="12">
|
|
40
|
+
<mapgis-ui-input class="flood-input" v-model="floodSpeedCopy" />
|
|
41
|
+
</mapgis-ui-col>
|
|
42
|
+
</mapgis-ui-row>
|
|
43
|
+
<mapgis-ui-row>
|
|
44
|
+
<mapgis-ui-col :span="8">
|
|
45
|
+
<p class="flood-title">反射光强度:</p>
|
|
46
|
+
</mapgis-ui-col>
|
|
47
|
+
<mapgis-ui-col :span="12">
|
|
48
|
+
<mapgis-ui-input
|
|
49
|
+
class="flood-input"
|
|
50
|
+
v-model="specularIntensityCopy"
|
|
51
|
+
/>
|
|
52
|
+
</mapgis-ui-col>
|
|
53
|
+
</mapgis-ui-row>
|
|
54
|
+
<mapgis-ui-row>
|
|
55
|
+
<mapgis-ui-col :span="8">
|
|
56
|
+
<p class="flood-title">水波高度:</p>
|
|
57
|
+
</mapgis-ui-col>
|
|
58
|
+
<mapgis-ui-col :span="12">
|
|
59
|
+
<mapgis-ui-input class="flood-input" v-model="amplitudeCopy" />
|
|
60
|
+
</mapgis-ui-col>
|
|
61
|
+
</mapgis-ui-row>
|
|
62
|
+
<mapgis-ui-row>
|
|
63
|
+
<mapgis-ui-col :span="8">
|
|
64
|
+
<p class="flood-title">水纹速度:</p>
|
|
65
|
+
</mapgis-ui-col>
|
|
66
|
+
<mapgis-ui-col :span="12">
|
|
67
|
+
<mapgis-ui-input class="flood-input" v-model="animationSpeedCopy" />
|
|
68
|
+
</mapgis-ui-col>
|
|
69
|
+
</mapgis-ui-row>
|
|
70
|
+
<mapgis-ui-row>
|
|
71
|
+
<mapgis-ui-col :span="8">
|
|
72
|
+
<p class="flood-title">水纹频率:</p>
|
|
73
|
+
</mapgis-ui-col>
|
|
74
|
+
<mapgis-ui-col :span="12">
|
|
75
|
+
<mapgis-ui-input class="flood-input" v-model="frequencyCopy" />
|
|
76
|
+
</mapgis-ui-col>
|
|
77
|
+
</mapgis-ui-row>
|
|
78
|
+
<!-- <mapgis-ui-row>-->
|
|
79
|
+
<!-- <mapgis-ui-col :span="8">-->
|
|
80
|
+
<!-- <p class="flood-title">绘制工具:</p>-->
|
|
81
|
+
<!-- </mapgis-ui-col>-->
|
|
82
|
+
<!-- <mapgis-ui-col :span="8">-->
|
|
83
|
+
<!-- <mapgis-ui-select-->
|
|
84
|
+
<!-- class="flood-select"-->
|
|
85
|
+
<!-- :default-value="selectDefault"-->
|
|
86
|
+
<!-- @change="$_selectChange"-->
|
|
87
|
+
<!-- >-->
|
|
88
|
+
<!-- <mapgis-ui-select-option v-for="(tool,index) in tools" :key="tool.name">{{ tool.value }}</mapgis-ui-select-option>-->
|
|
89
|
+
<!-- </mapgis-ui-select>-->
|
|
90
|
+
<!-- </mapgis-ui-col>-->
|
|
91
|
+
<!-- </mapgis-ui-row>-->
|
|
92
|
+
<mapgis-ui-row>
|
|
93
|
+
<mapgis-ui-button
|
|
94
|
+
class="flood-button start"
|
|
95
|
+
type="primary"
|
|
96
|
+
@click="$_startAnalyse"
|
|
97
|
+
:disabled="!disabled"
|
|
98
|
+
>开始分析
|
|
99
|
+
</mapgis-ui-button>
|
|
100
|
+
</mapgis-ui-row>
|
|
101
|
+
</div>
|
|
102
|
+
<div
|
|
103
|
+
class="flood-analyse-box"
|
|
104
|
+
style="height: 127px;"
|
|
105
|
+
v-show="showResultPannel"
|
|
106
|
+
>
|
|
107
|
+
<mapgis-ui-row>
|
|
108
|
+
<mapgis-ui-col :span="8">
|
|
109
|
+
<p class="flood-title">最大淹没高度(米):</p>
|
|
110
|
+
</mapgis-ui-col>
|
|
111
|
+
<mapgis-ui-col :span="16">
|
|
112
|
+
<mapgis-ui-input v-model="maxHeightCopy" />
|
|
113
|
+
</mapgis-ui-col>
|
|
114
|
+
</mapgis-ui-row>
|
|
115
|
+
<mapgis-ui-row>
|
|
116
|
+
<mapgis-ui-col :span="8">
|
|
117
|
+
<p class="flood-title">高度选择(米):</p>
|
|
118
|
+
</mapgis-ui-col>
|
|
119
|
+
<mapgis-ui-col :span="16">
|
|
120
|
+
<mapgis-ui-slider
|
|
121
|
+
v-model="currentHeightCopy"
|
|
122
|
+
:min="Number(startHeightCopyTwo)"
|
|
123
|
+
:max="Number(maxHeightCopy)"
|
|
124
|
+
:disabled="disabled"
|
|
125
|
+
/>
|
|
126
|
+
</mapgis-ui-col>
|
|
127
|
+
</mapgis-ui-row>
|
|
128
|
+
<mapgis-ui-row>
|
|
129
|
+
<mapgis-ui-button
|
|
130
|
+
class="flood-button back"
|
|
131
|
+
style="right: 168px;"
|
|
132
|
+
type="primary"
|
|
133
|
+
@click="$_up"
|
|
134
|
+
:disabled="upDisabled"
|
|
135
|
+
>{{ upTitle }}</mapgis-ui-button
|
|
136
|
+
>
|
|
137
|
+
<mapgis-ui-button
|
|
138
|
+
class="flood-button back"
|
|
139
|
+
style="right: 95px;"
|
|
140
|
+
type="primary"
|
|
141
|
+
@click="$_down"
|
|
142
|
+
:disabled="downDisabled"
|
|
143
|
+
>{{ downTitle }}</mapgis-ui-button
|
|
144
|
+
>
|
|
145
|
+
<mapgis-ui-button
|
|
146
|
+
class="flood-button back"
|
|
147
|
+
@click="$_stopAnalyseToStart"
|
|
148
|
+
>停止分析</mapgis-ui-button
|
|
149
|
+
>
|
|
150
|
+
</mapgis-ui-row>
|
|
151
|
+
</div>
|
|
152
|
+
</slot>
|
|
153
|
+
</div>
|
|
154
|
+
</template>
|
|
155
|
+
|
|
156
|
+
<script>
|
|
157
|
+
import ServiceLayer from "./BaseLayer";
|
|
158
|
+
|
|
159
|
+
export default {
|
|
160
|
+
name: "mapgis-3d-analysis-flood",
|
|
161
|
+
mixins: [ServiceLayer],
|
|
162
|
+
props: {
|
|
163
|
+
startHeight: {
|
|
164
|
+
type: Number,
|
|
165
|
+
default: 0
|
|
166
|
+
},
|
|
167
|
+
minHeight: {
|
|
168
|
+
type: Number,
|
|
169
|
+
default: 0
|
|
170
|
+
},
|
|
171
|
+
currentHeight: {
|
|
172
|
+
type: Number,
|
|
173
|
+
default: 0
|
|
174
|
+
},
|
|
175
|
+
maxHeight: {
|
|
176
|
+
type: Number,
|
|
177
|
+
default: 200
|
|
178
|
+
},
|
|
179
|
+
floodColor: {
|
|
180
|
+
type: String,
|
|
181
|
+
default: "#4e81bb"
|
|
182
|
+
},
|
|
183
|
+
floodSpeed: {
|
|
184
|
+
type: Number,
|
|
185
|
+
default: 30
|
|
186
|
+
},
|
|
187
|
+
specularIntensity: {
|
|
188
|
+
type: Number,
|
|
189
|
+
default: 1
|
|
190
|
+
},
|
|
191
|
+
amplitude: {
|
|
192
|
+
type: Number,
|
|
193
|
+
default: 10
|
|
194
|
+
},
|
|
195
|
+
animationSpeed: {
|
|
196
|
+
type: Number,
|
|
197
|
+
default: 0.01
|
|
198
|
+
},
|
|
199
|
+
frequency: {
|
|
200
|
+
type: Number,
|
|
201
|
+
default: 1000
|
|
202
|
+
},
|
|
203
|
+
showPicker: {
|
|
204
|
+
type: Boolean,
|
|
205
|
+
default: true
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
watch: {
|
|
209
|
+
currentHeightCopy: {
|
|
210
|
+
handler: function() {
|
|
211
|
+
//开始分析后的下一帧,开启高度监听
|
|
212
|
+
if (this.isFlood) {
|
|
213
|
+
const { vueKey, vueIndex } = this;
|
|
214
|
+
let webGlobe = window.CesiumZondy.getWebGlobe(vueKey);
|
|
215
|
+
let floodAnalyse = window.floodAnalyse;
|
|
216
|
+
if (floodAnalyse) {
|
|
217
|
+
floodAnalyse.maxHeight = Number(this.currentHeightCopy);
|
|
218
|
+
floodAnalyse.floodSpeed = Number(this.floodSpeedCopy);
|
|
219
|
+
floodAnalyse.frequency = Number(this.frequencyCopy);
|
|
220
|
+
floodAnalyse.animationSpeed = Number(this.animationSpeedCopy);
|
|
221
|
+
floodAnalyse.amplitude = Number(this.amplitudeCopy);
|
|
222
|
+
floodAnalyse.specularIntensity = Number(this.specularIntensityCopy);
|
|
223
|
+
floodAnalyse.isDownFlood =
|
|
224
|
+
Number(this.floodHeightCopyTwo) > Number(this.currentHeightCopy);
|
|
225
|
+
//存储高度,方便下一次比较
|
|
226
|
+
this.floodHeightCopyTwo = Number(this.currentHeightCopy);
|
|
227
|
+
}
|
|
228
|
+
if (this.currentHeightCopy === this.maxHeightCopy) {
|
|
229
|
+
this.upTitle = "上升";
|
|
230
|
+
this.upDisabled = true;
|
|
231
|
+
this.downDisabled = false;
|
|
232
|
+
} else if (
|
|
233
|
+
this.currentHeightCopy === parseInt(this.startHeightCopyTwo)
|
|
234
|
+
) {
|
|
235
|
+
this.downTitle = "下降";
|
|
236
|
+
this.upDisabled = false;
|
|
237
|
+
this.downDisabled = true;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
startHeight: {
|
|
243
|
+
handler: function() {
|
|
244
|
+
this.startHeightCopy = this.startHeight;
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
minHeight: {
|
|
248
|
+
handler: function() {
|
|
249
|
+
this.minHeightCopy = this.minHeight;
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
floodColor: {
|
|
253
|
+
handler: function() {
|
|
254
|
+
this.floodColorCopy = this.floodColor;
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
maxHeight: {
|
|
258
|
+
handler: function() {
|
|
259
|
+
this.maxHeightCopy = this.maxHeight;
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
floodSpeed: {
|
|
263
|
+
handler: function() {
|
|
264
|
+
this.floodSpeedCopy = this.floodSpeed;
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
specularIntensity: {
|
|
268
|
+
handler: function() {
|
|
269
|
+
this.specularIntensityCopy = this.specularIntensity;
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
amplitude: {
|
|
273
|
+
handler: function() {
|
|
274
|
+
this.amplitudeCopy = this.amplitude;
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
animationSpeed: {
|
|
278
|
+
handler: function() {
|
|
279
|
+
this.animationSpeedCopy = this.animationSpeed;
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
frequency: {
|
|
283
|
+
handler: function() {
|
|
284
|
+
this.frequencyCopy = this.frequency;
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
currentHeight: {
|
|
288
|
+
handler: function() {
|
|
289
|
+
this.currentHeightCopy = parseInt(Number(this.currentHeight));
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
maxHeightCopy: {
|
|
293
|
+
handler: function() {
|
|
294
|
+
if (Number(this.maxHeightCopy) <= Number(this.currentHeightCopy)) {
|
|
295
|
+
this.maxHeightCopy = Number(this.currentHeightCopy);
|
|
296
|
+
this.upDisabled = true;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
data() {
|
|
302
|
+
return {
|
|
303
|
+
selectDefault: "startDrawingPolygon",
|
|
304
|
+
drawToolName: "startDrawingPolygon",
|
|
305
|
+
// tools: [{
|
|
306
|
+
// name: "startDrawingPolygon",
|
|
307
|
+
// value: "多边形工具"
|
|
308
|
+
// }, {
|
|
309
|
+
// name: "startDrawingExtent",
|
|
310
|
+
// value: "矩形工具"
|
|
311
|
+
// }],
|
|
312
|
+
showOptionsPannel: false,
|
|
313
|
+
showResultPannel: false,
|
|
314
|
+
startHeightCopy: 0,
|
|
315
|
+
minHeightCopy: 0,
|
|
316
|
+
startHeightCopyTwo: 0,
|
|
317
|
+
currentHeightCopy: 0,
|
|
318
|
+
currentHeightCopyTwo: 0,
|
|
319
|
+
maxHeightCopy: 0,
|
|
320
|
+
floodColorCopy: "#4e81bb",
|
|
321
|
+
floodSpeedCopy: 0,
|
|
322
|
+
specularIntensityCopy: 0,
|
|
323
|
+
amplitudeCopy: 0,
|
|
324
|
+
animationSpeedCopy: 0,
|
|
325
|
+
frequencyCopy: 0,
|
|
326
|
+
disabled: true,
|
|
327
|
+
isFlood: false,
|
|
328
|
+
isPlayer: false,
|
|
329
|
+
upTitle: "上升",
|
|
330
|
+
downTitle: "下降",
|
|
331
|
+
upDisabled: false,
|
|
332
|
+
downDisabled: false
|
|
333
|
+
};
|
|
334
|
+
},
|
|
335
|
+
mounted() {
|
|
336
|
+
let vm = this;
|
|
337
|
+
window.CesiumZondy.getWebGlobeByInterval(function(webGlobe) {
|
|
338
|
+
vm.$_init();
|
|
339
|
+
vm.showOptionsPannel = true;
|
|
340
|
+
vm.$emit("load", vm, webGlobe);
|
|
341
|
+
}, this.vueKey);
|
|
342
|
+
},
|
|
343
|
+
methods: {
|
|
344
|
+
//对外的开始分析方法
|
|
345
|
+
startAnalyse() {
|
|
346
|
+
this.$_startAnalyse();
|
|
347
|
+
},
|
|
348
|
+
//对外的停止分析方法
|
|
349
|
+
stopAnalyse() {
|
|
350
|
+
this.$_stopAnalyse();
|
|
351
|
+
},
|
|
352
|
+
//颜色拾取事件
|
|
353
|
+
headleChangeColor(color) {
|
|
354
|
+
this.floodColorCopy = color;
|
|
355
|
+
},
|
|
356
|
+
//由于无法改变props,因此复制这些值
|
|
357
|
+
$_init() {
|
|
358
|
+
let vm = this;
|
|
359
|
+
Object.keys(this.$props).forEach(function(key) {
|
|
360
|
+
vm[key + "Copy"] = vm.$props[key];
|
|
361
|
+
});
|
|
362
|
+
},
|
|
363
|
+
// $_selectChange(value) {
|
|
364
|
+
// this.drawToolName = value;
|
|
365
|
+
// },
|
|
366
|
+
//开始洪水淹没分析
|
|
367
|
+
$_floodAnalyse(webGlobe, positions) {
|
|
368
|
+
//确保开始洪水分析后,不会触发currentHeightCopy的更新操作,不然会出现分析失灵的情况
|
|
369
|
+
this.isFlood = false;
|
|
370
|
+
//如果没有注入Cesium,则取得window上面的
|
|
371
|
+
let { Cesium, vueKey, vueIndex } = this;
|
|
372
|
+
let vm = this;
|
|
373
|
+
if (!Cesium) {
|
|
374
|
+
Cesium = window.Cesium;
|
|
375
|
+
}
|
|
376
|
+
//开始分析前,删除上一次分析
|
|
377
|
+
if (webGlobe.scene.VisualAnalysisManager._visualAnalysisList.length > 0) {
|
|
378
|
+
webGlobe.scene.VisualAnalysisManager.removeAll();
|
|
379
|
+
window.CesiumZondy.FloodAnalyseManager.deleteSource(vueKey, vueIndex);
|
|
380
|
+
}
|
|
381
|
+
//将笛卡尔坐标转为经纬度坐标
|
|
382
|
+
let cartographics = [],
|
|
383
|
+
height = 0;
|
|
384
|
+
for (let i = 0; i < positions.length; i++) {
|
|
385
|
+
cartographics.push(Cesium.Cartographic.fromCartesian(positions[i]));
|
|
386
|
+
let cat = Cesium.Cartographic.fromCartesian(positions[i]);
|
|
387
|
+
height += cat.height;
|
|
388
|
+
if (Number(this.startHeightCopy) === 0) {
|
|
389
|
+
if (i === 0) {
|
|
390
|
+
this.startHeightCopyTwo = cat.height;
|
|
391
|
+
} else {
|
|
392
|
+
if (cat.height < this.startHeightCopyTwo) {
|
|
393
|
+
this.startHeightCopyTwo = cat.height;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
} else {
|
|
397
|
+
this.startHeightCopyTwo = this.startHeightCopy;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
//极端洪水淹没平均高度
|
|
401
|
+
this.currentHeightCopy = parseInt(height / cartographics.length);
|
|
402
|
+
this.currentHeightCopyTwo = this.currentHeightCopy;
|
|
403
|
+
//初始化新的洪水淹没分析
|
|
404
|
+
let floodAnalyse = new Cesium.FloodAnalysis(webGlobe.viewer, positions, {
|
|
405
|
+
//设置洪水淹没水体起始高度
|
|
406
|
+
startHeight: Number(this.startHeightCopyTwo),
|
|
407
|
+
//设置洪水淹没区域动画最低高度
|
|
408
|
+
minHeight: Number(this.minHeightCopy),
|
|
409
|
+
//设置洪水淹没区域最高高度
|
|
410
|
+
maxHeight: Number(this.currentHeightCopy),
|
|
411
|
+
//设置洪水上涨速度
|
|
412
|
+
floodSpeed: Number(this.floodSpeedCopy),
|
|
413
|
+
floodColor: Cesium.Color.fromCssColorString(this.floodColorCopy),
|
|
414
|
+
//水纹频率 指波浪的个数
|
|
415
|
+
frequency: Number(this.frequencyCopy),
|
|
416
|
+
//水纹速度
|
|
417
|
+
animationSpeed: Number(this.animationSpeedCopy),
|
|
418
|
+
//水波的高度
|
|
419
|
+
amplitude: Number(this.amplitudeCopy),
|
|
420
|
+
// 指定光线强度
|
|
421
|
+
specularIntensity: Number(this.specularIntensityCopy)
|
|
422
|
+
});
|
|
423
|
+
window.floodAnalyse = floodAnalyse;
|
|
424
|
+
//设置深度检测
|
|
425
|
+
webGlobe.viewer.scene.globe.depthTestAgainstTerrain = true;
|
|
426
|
+
//添加洪水淹没结果显示
|
|
427
|
+
webGlobe.scene.VisualAnalysisManager.add(floodAnalyse);
|
|
428
|
+
//一定是在下一帧,开启对currentHeightCopy的监听操作
|
|
429
|
+
this.$nextTick(function() {
|
|
430
|
+
this.showResultPannel = true;
|
|
431
|
+
this.showOptionsPannel = false;
|
|
432
|
+
//停止绘制
|
|
433
|
+
window.drawElement.stopDrawing();
|
|
434
|
+
this.isFlood = true;
|
|
435
|
+
});
|
|
436
|
+
},
|
|
437
|
+
//开始洪水淹没分析
|
|
438
|
+
$_startAnalyse() {
|
|
439
|
+
//开始分析前先禁用进度条以及停止分析按钮
|
|
440
|
+
this.disabled = false;
|
|
441
|
+
this.$_initAnalysis(this.drawToolName, "$_floodAnalyse");
|
|
442
|
+
},
|
|
443
|
+
$_stopAnalyseToStart() {
|
|
444
|
+
this.$_stopAnalyse();
|
|
445
|
+
this.showResultPannel = false;
|
|
446
|
+
this.showOptionsPannel = true;
|
|
447
|
+
this.startHeightCopyTwo = 0;
|
|
448
|
+
this.isPlayer = true;
|
|
449
|
+
this.$nextTick(function() {
|
|
450
|
+
this.downDisabled = false;
|
|
451
|
+
});
|
|
452
|
+
},
|
|
453
|
+
$_up() {
|
|
454
|
+
switch (this.upTitle) {
|
|
455
|
+
case "上升":
|
|
456
|
+
this.$_playAnalyse(this.currentHeightCopy, this.maxHeightCopy, 1);
|
|
457
|
+
this.downDisabled = true;
|
|
458
|
+
this.upTitle = "暂停";
|
|
459
|
+
break;
|
|
460
|
+
case "暂停":
|
|
461
|
+
this.$_pause();
|
|
462
|
+
this.downDisabled = false;
|
|
463
|
+
this.upTitle = "上升";
|
|
464
|
+
break;
|
|
465
|
+
default:
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
$_down() {
|
|
470
|
+
switch (this.downTitle) {
|
|
471
|
+
case "下降":
|
|
472
|
+
this.$_playAnalyse(
|
|
473
|
+
this.startHeightCopyTwo,
|
|
474
|
+
this.currentHeightCopy,
|
|
475
|
+
-1
|
|
476
|
+
);
|
|
477
|
+
this.upDisabled = true;
|
|
478
|
+
this.downTitle = "暂停";
|
|
479
|
+
break;
|
|
480
|
+
case "暂停":
|
|
481
|
+
this.$_pause();
|
|
482
|
+
this.upDisabled = false;
|
|
483
|
+
this.downTitle = "下降";
|
|
484
|
+
break;
|
|
485
|
+
default:
|
|
486
|
+
break;
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
$_pause() {
|
|
490
|
+
this.isPlayer = false;
|
|
491
|
+
},
|
|
492
|
+
//对外的playAnalyse
|
|
493
|
+
playAnalyse(start, end, forward, rate, timeDiff) {
|
|
494
|
+
this.$_playAnalyse(start, end, forward, rate, timeDiff);
|
|
495
|
+
},
|
|
496
|
+
//对外的上升方法
|
|
497
|
+
up() {
|
|
498
|
+
this.$_playAnalyse(this.currentHeightCopy, this.maxHeightCopy, 1);
|
|
499
|
+
},
|
|
500
|
+
//对外的下降方法
|
|
501
|
+
down() {
|
|
502
|
+
this.$_playAnalyse(this.startHeightCopyTwo, this.currentHeightCopy, -1);
|
|
503
|
+
},
|
|
504
|
+
//对外暂停听方法
|
|
505
|
+
pause() {
|
|
506
|
+
this.$_pause();
|
|
507
|
+
},
|
|
508
|
+
/**
|
|
509
|
+
* 洪水分析上升或下降方法
|
|
510
|
+
* @param start 起始点
|
|
511
|
+
* @param end 结束点
|
|
512
|
+
* @param start forward 向上为1,向下为-1
|
|
513
|
+
* @param rate 上升或下降频率
|
|
514
|
+
* @param timeDiff Cesium和现实时间的倍率
|
|
515
|
+
* */
|
|
516
|
+
$_playAnalyse(start, end, forward, rate, timeDiff) {
|
|
517
|
+
rate = rate || 20;
|
|
518
|
+
timeDiff = timeDiff || 1.5;
|
|
519
|
+
let i = 0;
|
|
520
|
+
let vm = this;
|
|
521
|
+
let distance = end - start;
|
|
522
|
+
let speed = this.floodSpeedCopy / rate;
|
|
523
|
+
let time = Math.ceil(distance / speed);
|
|
524
|
+
speed = distance / time;
|
|
525
|
+
let timeOut = parseInt(
|
|
526
|
+
parseInt((distance / this.floodSpeedCopy / time) * 1000)
|
|
527
|
+
);
|
|
528
|
+
//因为Cesium的事件计算和现实不一样,这里试出来大概是1.5倍
|
|
529
|
+
timeOut = timeOut * timeDiff;
|
|
530
|
+
this.isPlayer = true;
|
|
531
|
+
let interval = setInterval(function() {
|
|
532
|
+
i++;
|
|
533
|
+
vm.currentHeightCopy = parseInt(
|
|
534
|
+
Number((vm.currentHeightCopy + speed * forward).toFixed(4))
|
|
535
|
+
);
|
|
536
|
+
if (!vm.isPlayer) {
|
|
537
|
+
vm.isPlayer = true;
|
|
538
|
+
clearInterval(interval);
|
|
539
|
+
}
|
|
540
|
+
if (i === time) {
|
|
541
|
+
vm.currentHeightCopy = parseInt(
|
|
542
|
+
forward > 0 ? Number(end) : Number(start)
|
|
543
|
+
);
|
|
544
|
+
clearInterval(interval);
|
|
545
|
+
}
|
|
546
|
+
}, timeOut);
|
|
547
|
+
},
|
|
548
|
+
//停止洪水淹没分析
|
|
549
|
+
$_stopAnalyse() {
|
|
550
|
+
const { vueKey, vyeIndex } = this;
|
|
551
|
+
//删除淹没分析
|
|
552
|
+
webGlobe.scene.VisualAnalysisManager.removeAll();
|
|
553
|
+
//停止绘制
|
|
554
|
+
window.drawElement.stopDrawing();
|
|
555
|
+
//删除管理对象
|
|
556
|
+
window.CesiumZondy.FloodAnalyseManager.deleteSource(vueKey, vyeIndex);
|
|
557
|
+
//启用开始分析按钮
|
|
558
|
+
this.disabled = true;
|
|
559
|
+
//高度置零
|
|
560
|
+
this.currentHeight = 0;
|
|
561
|
+
this.currentHeightCopy = 0;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
</script>
|
|
566
|
+
|
|
567
|
+
<style scoped>
|
|
568
|
+
.flood-analyse-box {
|
|
569
|
+
position: absolute;
|
|
570
|
+
top: 10px;
|
|
571
|
+
left: 10px;
|
|
572
|
+
width: 376px;
|
|
573
|
+
height: 364px;
|
|
574
|
+
background: white;
|
|
575
|
+
border-radius: 5px;
|
|
576
|
+
padding: 10px;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.flood-title {
|
|
580
|
+
text-align: left;
|
|
581
|
+
margin-top: 0.3em;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.flood-input {
|
|
585
|
+
width: 235px;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.flood-color-picker {
|
|
589
|
+
position: absolute;
|
|
590
|
+
right: 10px;
|
|
591
|
+
top: 8px;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.flood-button {
|
|
595
|
+
position: absolute;
|
|
596
|
+
right: -140px;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.flood-button-stop {
|
|
600
|
+
right: -117px;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.flood-select {
|
|
604
|
+
position: absolute;
|
|
605
|
+
left: 0;
|
|
606
|
+
width: 235px;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
.flood-analyse-box .ant-slider {
|
|
610
|
+
margin: 10px 6px 10px;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
.flood-analyse-box .currentHeight {
|
|
614
|
+
padding-top: 0.5em;
|
|
615
|
+
padding-left: 0.5em;
|
|
616
|
+
text-align: left;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.flood-analyse-box .start {
|
|
620
|
+
position: absolute;
|
|
621
|
+
right: 1px;
|
|
622
|
+
bottom: -32px;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.flood-analyse-box .back {
|
|
626
|
+
position: absolute;
|
|
627
|
+
right: -1px;
|
|
628
|
+
bottom: -28px;
|
|
629
|
+
}
|
|
630
|
+
</style>
|