@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
|
@@ -1,395 +1,828 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
2
|
+
<div class="mapgis-widget-visual-analysis">
|
|
3
|
+
<mapgis-ui-setting-form v-model="formData" :wrapper-width="280">
|
|
4
|
+
<mapgis-ui-form-item label="水平视角">
|
|
5
|
+
<mapgis-ui-input
|
|
6
|
+
v-model.number="formData.horizontAngle"
|
|
7
|
+
:min="1"
|
|
8
|
+
type="number"
|
|
9
|
+
/>
|
|
10
|
+
</mapgis-ui-form-item>
|
|
11
|
+
<mapgis-ui-form-item label="垂直视角">
|
|
12
|
+
<mapgis-ui-input
|
|
13
|
+
v-model.number="formData.verticalAngle"
|
|
14
|
+
:min="1"
|
|
15
|
+
type="number"
|
|
16
|
+
/>
|
|
17
|
+
</mapgis-ui-form-item>
|
|
18
|
+
<mapgis-ui-form-item label="附加高度(米)">
|
|
19
|
+
<mapgis-ui-input
|
|
20
|
+
v-model.number="formData.exHeight"
|
|
21
|
+
type="number"
|
|
22
|
+
:min="0"
|
|
23
|
+
:step="0.1"
|
|
24
|
+
/>
|
|
25
|
+
</mapgis-ui-form-item>
|
|
26
|
+
<mapgis-ui-form-item label="方向角">
|
|
27
|
+
<mapgis-ui-input
|
|
28
|
+
v-model.number="angleSet.heading"
|
|
29
|
+
:min="0"
|
|
30
|
+
:max="360"
|
|
31
|
+
type="number"
|
|
32
|
+
/>
|
|
33
|
+
</mapgis-ui-form-item>
|
|
34
|
+
<mapgis-ui-form-item label="俯仰角">
|
|
35
|
+
<mapgis-ui-input
|
|
36
|
+
v-model.number="angleSet.pitch"
|
|
37
|
+
:min="-90"
|
|
38
|
+
:max="90"
|
|
39
|
+
type="number"
|
|
40
|
+
/>
|
|
41
|
+
</mapgis-ui-form-item>
|
|
42
|
+
<mapgis-ui-form-item label="可视距离(米)">
|
|
43
|
+
<mapgis-ui-input
|
|
44
|
+
v-model.number="angleSet.viewRadius"
|
|
45
|
+
:min="0"
|
|
46
|
+
type="number"
|
|
47
|
+
/>
|
|
48
|
+
</mapgis-ui-form-item>
|
|
49
|
+
<mapgis-ui-form-item label="观察点坐标">
|
|
50
|
+
<mapgis-ui-row>
|
|
51
|
+
<mapgis-ui-col :span="8">
|
|
52
|
+
<mapgis-ui-input
|
|
53
|
+
v-model.number="posData.viewPositionX"
|
|
54
|
+
:step="0.0001"
|
|
55
|
+
type="number"
|
|
56
|
+
placeholder="经度"
|
|
57
|
+
/>
|
|
58
|
+
</mapgis-ui-col>
|
|
59
|
+
<mapgis-ui-col :span="8">
|
|
60
|
+
<mapgis-ui-input
|
|
61
|
+
v-model.number="posData.viewPositionY"
|
|
62
|
+
:step="0.0001"
|
|
63
|
+
type="number"
|
|
64
|
+
placeholder="纬度"
|
|
65
|
+
/>
|
|
66
|
+
</mapgis-ui-col>
|
|
67
|
+
<mapgis-ui-col :span="8">
|
|
68
|
+
<mapgis-ui-input
|
|
69
|
+
v-model.number="posData.viewPositionZ"
|
|
70
|
+
type="number"
|
|
71
|
+
placeholder="高度"
|
|
72
|
+
/>
|
|
73
|
+
</mapgis-ui-col>
|
|
74
|
+
</mapgis-ui-row>
|
|
75
|
+
</mapgis-ui-form-item>
|
|
76
|
+
<mapgis-ui-form-item label="目标点坐标">
|
|
77
|
+
<mapgis-ui-row>
|
|
78
|
+
<mapgis-ui-col :span="8">
|
|
79
|
+
<mapgis-ui-input
|
|
80
|
+
v-model.number="posData.targetPositionX"
|
|
81
|
+
:step="0.0001"
|
|
82
|
+
type="number"
|
|
83
|
+
placeholder="经度"
|
|
84
|
+
/>
|
|
85
|
+
</mapgis-ui-col>
|
|
86
|
+
<mapgis-ui-col :span="8">
|
|
87
|
+
<mapgis-ui-input
|
|
88
|
+
v-model.number="posData.targetPositionY"
|
|
89
|
+
:step="0.0001"
|
|
90
|
+
type="number"
|
|
91
|
+
placeholder="纬度"
|
|
92
|
+
/>
|
|
93
|
+
</mapgis-ui-col>
|
|
94
|
+
<mapgis-ui-col :span="8">
|
|
95
|
+
<mapgis-ui-input
|
|
96
|
+
v-model.number="posData.targetPositionZ"
|
|
97
|
+
type="number"
|
|
98
|
+
placeholder="高度"
|
|
99
|
+
/>
|
|
100
|
+
</mapgis-ui-col>
|
|
101
|
+
</mapgis-ui-row>
|
|
102
|
+
</mapgis-ui-form-item>
|
|
103
|
+
<mapgis-ui-form-item label="不可视区域颜色">
|
|
104
|
+
<mapgis-ui-sketch-color-picker
|
|
105
|
+
:disableAlpha="false"
|
|
106
|
+
:color="formData.unVisibleColor"
|
|
107
|
+
@input="
|
|
108
|
+
val =>
|
|
109
|
+
(formData.unVisibleColor = `rgba(${val.rgba.r}, ${val.rgba.g}, ${val.rgba.b}, ${val.rgba.a})`)
|
|
110
|
+
"
|
|
111
|
+
></mapgis-ui-sketch-color-picker>
|
|
112
|
+
</mapgis-ui-form-item>
|
|
113
|
+
<mapgis-ui-form-item label="可视区域颜色">
|
|
114
|
+
<mapgis-ui-sketch-color-picker
|
|
115
|
+
:disableAlpha="false"
|
|
116
|
+
:color="formData.visibleColor"
|
|
117
|
+
@input="
|
|
118
|
+
val =>
|
|
119
|
+
(formData.visibleColor = `rgba(${val.rgba.r}, ${val.rgba.g}, ${val.rgba.b}, ${val.rgba.a})`)
|
|
120
|
+
"
|
|
121
|
+
></mapgis-ui-sketch-color-picker>
|
|
122
|
+
</mapgis-ui-form-item>
|
|
123
|
+
<mapgis-ui-form-item label="可视遮罩颜色">
|
|
124
|
+
<mapgis-ui-sketch-color-picker
|
|
125
|
+
:disableAlpha="false"
|
|
126
|
+
:color="formData.maskColor"
|
|
127
|
+
@input="
|
|
128
|
+
val =>
|
|
129
|
+
(formData.maskColor = `rgba(${val.rgba.r}, ${val.rgba.g}, ${val.rgba.b}, ${val.rgba.a})`)
|
|
130
|
+
"
|
|
131
|
+
></mapgis-ui-sketch-color-picker>
|
|
132
|
+
</mapgis-ui-form-item>
|
|
133
|
+
</mapgis-ui-setting-form>
|
|
134
|
+
<!-- </div>-->
|
|
135
|
+
<mapgis-ui-setting-footer>
|
|
136
|
+
<mapgis-ui-button type="primary" @click="onClickStart"
|
|
137
|
+
>分析</mapgis-ui-button
|
|
138
|
+
>
|
|
139
|
+
<mapgis-ui-button @click="onClickStop">清除</mapgis-ui-button>
|
|
140
|
+
</mapgis-ui-setting-footer>
|
|
141
|
+
</div>
|
|
120
142
|
</template>
|
|
121
143
|
|
|
122
144
|
<script>
|
|
145
|
+
import VueOptions from "../Base/Vue/VueOptions";
|
|
146
|
+
import {
|
|
147
|
+
isDepthTestAgainstTerrainEnable,
|
|
148
|
+
setDepthTestAgainstTerrainEnable
|
|
149
|
+
} from "../WebGlobe/util";
|
|
150
|
+
|
|
123
151
|
export default {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
152
|
+
name: "mapgis-3d-viewshed",
|
|
153
|
+
props: {
|
|
154
|
+
...VueOptions,
|
|
155
|
+
/**
|
|
156
|
+
* @type Number
|
|
157
|
+
* @default 60
|
|
158
|
+
* @description 观察点的水平视角
|
|
159
|
+
*/
|
|
160
|
+
horizontAngle: {
|
|
161
|
+
type: Number,
|
|
162
|
+
default: 60
|
|
134
163
|
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
startLonMin: 0,
|
|
144
|
-
startLatMin: 0,
|
|
145
|
-
startAltMin: 0,
|
|
146
|
-
endLonMin: 0,
|
|
147
|
-
endLatMin: 0,
|
|
148
|
-
endAltMin: 0,
|
|
149
|
-
startLonMax: 0,
|
|
150
|
-
startLatMax: 0,
|
|
151
|
-
startAltMax: 0,
|
|
152
|
-
endLonMax: 0,
|
|
153
|
-
endLatMax: 0,
|
|
154
|
-
endAltMax: 0,
|
|
155
|
-
form: {
|
|
156
|
-
startLon: 0,
|
|
157
|
-
startLat: 0,
|
|
158
|
-
startAlt: 0,
|
|
159
|
-
endLon: 0,
|
|
160
|
-
endLat: 0,
|
|
161
|
-
endAlt: 0,
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
+
/**
|
|
165
|
+
* @type Number
|
|
166
|
+
* @default 60
|
|
167
|
+
* @description 观察点的垂直视角
|
|
168
|
+
*/
|
|
169
|
+
verticalAngle: {
|
|
170
|
+
type: Number,
|
|
171
|
+
default: 60
|
|
164
172
|
},
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
vshed3d.viewPosition = Cesium.Cartesian3.fromDegrees(
|
|
174
|
-
val.startLon,
|
|
175
|
-
val.startLat,
|
|
176
|
-
val.startAlt
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
if (val.endLon && val.endLat && val.endAlt) {
|
|
180
|
-
vshed3d.targetPosition = Cesium.Cartesian3.fromDegrees(
|
|
181
|
-
val.endLon,
|
|
182
|
-
val.endLat,
|
|
183
|
-
val.endAlt
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
},
|
|
173
|
+
/**
|
|
174
|
+
* @type String
|
|
175
|
+
* @default '#ff0000'
|
|
176
|
+
* @description 不可视区域颜色
|
|
177
|
+
*/
|
|
178
|
+
unVisibleColor: {
|
|
179
|
+
type: String,
|
|
180
|
+
default: "#ff0000"
|
|
189
181
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
182
|
+
/**
|
|
183
|
+
* @type String
|
|
184
|
+
* @default '#00ff00'
|
|
185
|
+
* @description 可视区域颜色
|
|
186
|
+
*/
|
|
187
|
+
visibleColor: {
|
|
188
|
+
type: String,
|
|
189
|
+
default: "#00ff00"
|
|
190
|
+
},
|
|
191
|
+
/**
|
|
192
|
+
* @type String
|
|
193
|
+
* @default 'rgba(37, 218, 169, 0.2)'
|
|
194
|
+
* @description 可视遮罩颜色
|
|
195
|
+
*/
|
|
196
|
+
maskColor: {
|
|
197
|
+
type: String,
|
|
198
|
+
default: "rgba(37, 218, 169, 0.2)"
|
|
199
|
+
},
|
|
200
|
+
/**
|
|
201
|
+
* @type Number
|
|
202
|
+
* @default 1.85
|
|
203
|
+
* @description 观察点的附加高度/米
|
|
204
|
+
*/
|
|
205
|
+
exHeight: {
|
|
206
|
+
type: Number,
|
|
207
|
+
default: 1.85
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
inject: ["Cesium", "CesiumZondy", "webGlobe"],
|
|
211
|
+
data() {
|
|
212
|
+
return {
|
|
213
|
+
formData: {
|
|
214
|
+
horizontAngle: 60,
|
|
215
|
+
verticalAngle: 60,
|
|
216
|
+
unVisibleColor: "#ff0000",
|
|
217
|
+
visibleColor: "#00ff00",
|
|
218
|
+
maskColor: "rgba(37, 218, 169, 0.2)",
|
|
219
|
+
exHeight: 1.85
|
|
220
|
+
},
|
|
221
|
+
angleSet: {
|
|
222
|
+
//方向角
|
|
223
|
+
heading: 0,
|
|
224
|
+
// 俯仰角
|
|
225
|
+
pitch: 0,
|
|
226
|
+
// 可视距离
|
|
227
|
+
viewRadius: 0
|
|
228
|
+
},
|
|
229
|
+
// 坐标数据
|
|
230
|
+
posData: {
|
|
231
|
+
viewPositionX: "",
|
|
232
|
+
viewPositionY: "",
|
|
233
|
+
viewPositionZ: "",
|
|
234
|
+
targetPositionX: "",
|
|
235
|
+
targetPositionY: "",
|
|
236
|
+
targetPositionZ: ""
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
// 是否为鼠标注册了监听事件
|
|
240
|
+
isAddEventListener: false,
|
|
241
|
+
|
|
242
|
+
// 是否已选择观察点位置
|
|
243
|
+
hasViewPosition: false,
|
|
244
|
+
|
|
245
|
+
// 是否可以进行可视域分析
|
|
246
|
+
isAnalyze: false,
|
|
247
|
+
|
|
248
|
+
// 是否具有初始目标点
|
|
249
|
+
isHasTargetPos: false,
|
|
250
|
+
|
|
251
|
+
// 观察点
|
|
252
|
+
viewPoint: undefined,
|
|
253
|
+
|
|
254
|
+
isDepthTestAgainstTerrainEnable: undefined // 深度检测是否已开启,默认为undefined,当这个值为undefined的时候,说明没有赋值,不做任何处理
|
|
255
|
+
};
|
|
256
|
+
},
|
|
257
|
+
watch: {
|
|
258
|
+
horizontAngle: {
|
|
259
|
+
handler: function(newVal, oldVal) {
|
|
260
|
+
this.formData.horizontAngle = newVal;
|
|
261
|
+
},
|
|
262
|
+
immediate: true
|
|
263
|
+
},
|
|
264
|
+
verticalAngle: {
|
|
265
|
+
handler: function(newVal, oldVal) {
|
|
266
|
+
this.formData.verticalAngle = newVal;
|
|
267
|
+
},
|
|
268
|
+
immediate: true
|
|
269
|
+
},
|
|
270
|
+
unVisibleColor: {
|
|
271
|
+
handler: function(newVal, oldVal) {
|
|
272
|
+
this.formData.unVisibleColor = newVal;
|
|
273
|
+
},
|
|
274
|
+
immediate: true
|
|
275
|
+
},
|
|
276
|
+
visibleColor: {
|
|
277
|
+
handler: function(newVal, oldVal) {
|
|
278
|
+
this.formData.visibleColor = newVal;
|
|
279
|
+
},
|
|
280
|
+
immediate: true
|
|
281
|
+
},
|
|
282
|
+
maskColor: {
|
|
283
|
+
handler: function(newVal, oldVal) {
|
|
284
|
+
this.formData.maskColor = newVal;
|
|
285
|
+
},
|
|
286
|
+
immediate: true
|
|
287
|
+
},
|
|
288
|
+
exHeight: {
|
|
289
|
+
handler: function(newVal, oldVal) {
|
|
290
|
+
this.formData.exHeight = newVal;
|
|
291
|
+
},
|
|
292
|
+
immediate: true
|
|
293
|
+
},
|
|
294
|
+
formData: {
|
|
295
|
+
deep: true,
|
|
296
|
+
handler: function(newVal, oldVal) {
|
|
297
|
+
let { Cesium } = this;
|
|
298
|
+
let find = this.findSource();
|
|
299
|
+
const unVisibleColor = new Cesium.Color.fromCssColorString(
|
|
300
|
+
newVal.unVisibleColor
|
|
301
|
+
);
|
|
302
|
+
const visibleColor = new Cesium.Color.fromCssColorString(
|
|
303
|
+
newVal.visibleColor
|
|
304
|
+
);
|
|
305
|
+
const maskColor = new Cesium.Color.fromCssColorString(newVal.maskColor);
|
|
306
|
+
|
|
307
|
+
if (find.options.visualAnalysis) {
|
|
308
|
+
let visualAnalysis = find.options.visualAnalysis;
|
|
309
|
+
visualAnalysis.unVisibleColor = unVisibleColor;
|
|
310
|
+
visualAnalysis.visibleColor = visibleColor;
|
|
311
|
+
visualAnalysis._fanColor = maskColor;
|
|
312
|
+
visualAnalysis.horizontAngle = newVal.horizontAngle;
|
|
313
|
+
visualAnalysis.verticalAngle = newVal.verticalAngle;
|
|
314
|
+
|
|
315
|
+
if (newVal.exHeight !== oldVal.exHeight) {
|
|
316
|
+
let cartesian = visualAnalysis.viewPosition;
|
|
317
|
+
// 获取当前坐标系标准
|
|
318
|
+
const ellipsoid = this.webGlobe.viewer.scene.globe.ellipsoid;
|
|
319
|
+
// 根据坐标系标准,将笛卡尔坐标转换为地理坐标
|
|
320
|
+
const cartographic = ellipsoid.cartesianToCartographic(cartesian);
|
|
321
|
+
cartographic.height += newVal.exHeight - oldVal.exHeight;
|
|
322
|
+
|
|
323
|
+
cartesian = Cesium.Cartographic.toCartesian(cartographic);
|
|
324
|
+
visualAnalysis.viewPosition = cartesian;
|
|
325
|
+
//赋值给manager
|
|
326
|
+
CesiumZondy.ViewshedAnalysisManager.changeOptions(
|
|
327
|
+
vueKey,
|
|
328
|
+
vueIndex,
|
|
329
|
+
"visualAnalysis",
|
|
330
|
+
visualAnalysis
|
|
331
|
+
);
|
|
332
|
+
// 改变观察点坐标
|
|
333
|
+
this.viewPoint.position._value = cartesian;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
angleSet: {
|
|
339
|
+
deep: true,
|
|
340
|
+
handler: function(newVal) {
|
|
341
|
+
let { vueKey, vueIndex } = this;
|
|
342
|
+
let find = this.findSource();
|
|
343
|
+
if (find && find.options.visualAnalysis) {
|
|
344
|
+
let visualAnalysis = find.options.visualAnalysis;
|
|
345
|
+
visualAnalysis.heading = newVal.heading;
|
|
346
|
+
visualAnalysis.pitch = newVal.pitch;
|
|
347
|
+
visualAnalysis.viewRadius = newVal.viewRadius;
|
|
348
|
+
CesiumZondy.ViewshedAnalysisManager.changeOptions(
|
|
349
|
+
vueKey,
|
|
350
|
+
vueIndex,
|
|
351
|
+
"visualAnalysis",
|
|
352
|
+
visualAnalysis
|
|
353
|
+
);
|
|
354
|
+
this.updateTargetPosition(find.options.visualAnalysis.targetPosition);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
mounted() {
|
|
360
|
+
this.mount();
|
|
361
|
+
},
|
|
362
|
+
destroyed() {
|
|
363
|
+
this.unmount();
|
|
364
|
+
},
|
|
365
|
+
methods: {
|
|
366
|
+
async createCesiumObject() {
|
|
367
|
+
const { baseUrl, options } = this;
|
|
368
|
+
// return new Cesium.GeoJsonDataSource.load(baseUrl, options);
|
|
369
|
+
return new Promise(
|
|
370
|
+
resolve => {
|
|
371
|
+
resolve();
|
|
359
372
|
},
|
|
373
|
+
reject => {}
|
|
374
|
+
);
|
|
375
|
+
},
|
|
376
|
+
mount() {
|
|
377
|
+
const { webGlobe, CesiumZondy, vueKey, vueIndex } = this;
|
|
378
|
+
const { viewer } = webGlobe;
|
|
379
|
+
const vm = this;
|
|
380
|
+
let promise = this.createCesiumObject();
|
|
381
|
+
promise.then(function(dataSource) {
|
|
382
|
+
vm.$emit("load", vm);
|
|
383
|
+
CesiumZondy.ViewshedAnalysisManager.addSource(
|
|
384
|
+
vueKey,
|
|
385
|
+
vueIndex,
|
|
386
|
+
dataSource,
|
|
387
|
+
{
|
|
388
|
+
visualAnalysis: null
|
|
389
|
+
}
|
|
390
|
+
);
|
|
391
|
+
});
|
|
392
|
+
},
|
|
393
|
+
unmount() {
|
|
394
|
+
let { vueKey, vueIndex } = this;
|
|
395
|
+
this.onClickStop();
|
|
396
|
+
CesiumZondy.ViewshedAnalysisManager.deleteSource(vueKey, vueIndex);
|
|
397
|
+
},
|
|
398
|
+
formDataClone() {
|
|
399
|
+
let vm = this;
|
|
400
|
+
vm.formDataCloneVal = JSON.parse(JSON.stringify(this.formData));
|
|
401
|
+
return vm.formDataCloneVal;
|
|
402
|
+
},
|
|
403
|
+
|
|
404
|
+
// 若分析完成后,当方向角、俯仰角、可视距离变化时,更新目标点坐标
|
|
405
|
+
updateTargetPosition(cartesian) {
|
|
406
|
+
this.convertPosition(cartesian, "target");
|
|
360
407
|
},
|
|
361
|
-
|
|
362
|
-
|
|
408
|
+
|
|
409
|
+
// 将三维笛卡尔坐标转换为经纬度坐标
|
|
410
|
+
convertPosition(position, type) {
|
|
411
|
+
// 获取当前坐标系标准
|
|
412
|
+
const ellipsoid = this.webGlobe.viewer.scene.globe.ellipsoid;
|
|
413
|
+
// 根据坐标系标准,将笛卡尔坐标转换为地理坐标
|
|
414
|
+
const cartographic = ellipsoid.cartesianToCartographic(position);
|
|
415
|
+
// 获取高度
|
|
416
|
+
const height = cartographic.height.toFixed(8);
|
|
417
|
+
|
|
418
|
+
// 获取该位置的经纬度坐标
|
|
419
|
+
const centerLon = parseFloat(
|
|
420
|
+
this.Cesium.Math.toDegrees(cartographic.longitude).toFixed(8)
|
|
421
|
+
);
|
|
422
|
+
const centerLat = parseFloat(
|
|
423
|
+
this.Cesium.Math.toDegrees(cartographic.latitude).toFixed(8)
|
|
424
|
+
);
|
|
425
|
+
|
|
426
|
+
if (type === "view") {
|
|
427
|
+
this.posData.viewPositionX = centerLon;
|
|
428
|
+
this.posData.viewPositionY = centerLat;
|
|
429
|
+
this.posData.viewPositionZ = height;
|
|
430
|
+
} else {
|
|
431
|
+
this.posData.targetPositionX = centerLon;
|
|
432
|
+
this.posData.targetPositionY = centerLat;
|
|
433
|
+
this.posData.targetPositionZ = height;
|
|
434
|
+
}
|
|
363
435
|
},
|
|
364
|
-
|
|
365
|
-
|
|
436
|
+
|
|
437
|
+
// 点击开始分析按钮回调
|
|
438
|
+
onClickStart() {
|
|
439
|
+
this.startVisualAnalysis();
|
|
440
|
+
|
|
441
|
+
if (
|
|
442
|
+
this.posData.viewPositionX !== "" &&
|
|
443
|
+
this.posData.viewPositionY !== "" &&
|
|
444
|
+
this.posData.viewPositionZ !== "" &&
|
|
445
|
+
this.posData.targetPositionX !== "" &&
|
|
446
|
+
this.posData.targetPositionY !== "" &&
|
|
447
|
+
this.posData.targetPositionZ !== ""
|
|
448
|
+
) {
|
|
449
|
+
this.isHasTargetPos = false;
|
|
450
|
+
// 注销鼠标的各项监听事件
|
|
451
|
+
this.webGlobe.unRegisterMouseEvent("MOUSE_MOVE");
|
|
452
|
+
this.webGlobe.unRegisterMouseEvent("LEFT_CLICK");
|
|
453
|
+
this.webGlobe.unRegisterMouseEvent("RIGHT_CLICK");
|
|
454
|
+
this.isAddEventListener = false;
|
|
455
|
+
|
|
456
|
+
this.onInputStart();
|
|
457
|
+
} else if (
|
|
458
|
+
this.posData.viewPositionX === "" &&
|
|
459
|
+
this.posData.viewPositionY === "" &&
|
|
460
|
+
this.posData.viewPositionZ === "" &&
|
|
461
|
+
this.posData.targetPositionX === "" &&
|
|
462
|
+
this.posData.targetPositionY === "" &&
|
|
463
|
+
this.posData.targetPositionZ === ""
|
|
464
|
+
) {
|
|
465
|
+
this.isHasTargetPos = false;
|
|
466
|
+
this.addEventListener();
|
|
467
|
+
} else if (
|
|
468
|
+
this.posData.viewPositionX !== "" &&
|
|
469
|
+
this.posData.viewPositionY !== "" &&
|
|
470
|
+
this.posData.viewPositionZ !== "" &&
|
|
471
|
+
this.posData.targetPositionX === "" &&
|
|
472
|
+
this.posData.targetPositionY === "" &&
|
|
473
|
+
this.posData.targetPositionZ === ""
|
|
474
|
+
) {
|
|
475
|
+
this.isHasTargetPos = false;
|
|
476
|
+
let viewCartesian = this.Cesium.Cartesian3.fromDegrees(
|
|
477
|
+
this.posData.viewPositionX,
|
|
478
|
+
this.posData.viewPositionY,
|
|
479
|
+
this.posData.viewPositionZ
|
|
480
|
+
);
|
|
481
|
+
|
|
482
|
+
const cartographic = this.updateExheight(viewCartesian);
|
|
483
|
+
viewCartesian = this.Cesium.Cartographic.toCartesian(cartographic);
|
|
484
|
+
|
|
485
|
+
// window.VisualAnalysisManage.visualAnalysis.viewPosition = viewCartesian;
|
|
366
486
|
let find = this.findSource();
|
|
367
|
-
|
|
368
|
-
|
|
487
|
+
find.options.visualAnalysis.viewPosition = viewCartesian;
|
|
488
|
+
|
|
489
|
+
this.convertPosition(viewCartesian, "view");
|
|
490
|
+
// 添加观察点到地图
|
|
491
|
+
this.addViewPoint(viewCartesian);
|
|
492
|
+
this.hasViewPosition = true;
|
|
493
|
+
this.addEventListener();
|
|
494
|
+
} else if (
|
|
495
|
+
this.posData.viewPositionX === "" &&
|
|
496
|
+
this.posData.viewPositionY === "" &&
|
|
497
|
+
this.posData.viewPositionZ === "" &&
|
|
498
|
+
this.posData.targetPositionX !== "" &&
|
|
499
|
+
this.posData.targetPositionY !== "" &&
|
|
500
|
+
this.posData.targetPositionZ !== ""
|
|
501
|
+
) {
|
|
502
|
+
this.isHasTargetPos = true;
|
|
503
|
+
this.addEventListener();
|
|
504
|
+
} else {
|
|
505
|
+
this.isHasTargetPos = false;
|
|
506
|
+
this.addEventListener();
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
|
|
510
|
+
// 开启可视域分析工具
|
|
511
|
+
startVisualAnalysis() {
|
|
512
|
+
let { webGlobe, Cesium, vueKey, vueIndex } = this;
|
|
513
|
+
const viewer = webGlobe;
|
|
514
|
+
this.isAnalyze = true;
|
|
515
|
+
this.tilesetArray = this.webGlobe._m3dServerLayer;
|
|
516
|
+
//深度检测开启
|
|
517
|
+
this.isDepthTestAgainstTerrainEnable = isDepthTestAgainstTerrainEnable(
|
|
518
|
+
this.webGlobe
|
|
519
|
+
);
|
|
520
|
+
if (!this.isDepthTestAgainstTerrainEnable) {
|
|
521
|
+
// 如果深度检测没有开启,则开启
|
|
522
|
+
setDepthTestAgainstTerrainEnable(true, this.webGlobe);
|
|
523
|
+
}
|
|
524
|
+
// 初始化分析工具
|
|
525
|
+
let find = this.findSource();
|
|
526
|
+
let { options } = find;
|
|
527
|
+
let visualAnalysis = options.visualAnalysis;
|
|
528
|
+
visualAnalysis = new Cesium.ViewshedAnalysis(viewer.scene);
|
|
529
|
+
|
|
530
|
+
// 锁定图层帧数,只显示一个可视域结果
|
|
531
|
+
for (let i = 0; i < this.tilesetArray.length; i++) {
|
|
532
|
+
this.tilesetArray[i][0].debugFreezeFrame = true;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// 移除可视域分析结果
|
|
536
|
+
this.webGlobe.viewer.scene.VisualAnalysisManager._visualAnalysisList = [];
|
|
537
|
+
|
|
538
|
+
// 移除所有观察点
|
|
539
|
+
this.webGlobe.viewer.entities.removeAll();
|
|
540
|
+
|
|
541
|
+
// 设置可视域分析工具的配置
|
|
542
|
+
const unVisibleColor = new this.Cesium.Color.fromCssColorString(
|
|
543
|
+
this.formData.unVisibleColor
|
|
544
|
+
);
|
|
545
|
+
const visibleColor = new this.Cesium.Color.fromCssColorString(
|
|
546
|
+
this.formData.visibleColor
|
|
547
|
+
);
|
|
548
|
+
const maskColor = new this.Cesium.Color.fromCssColorString(
|
|
549
|
+
this.formData.maskColor
|
|
550
|
+
);
|
|
551
|
+
|
|
552
|
+
visualAnalysis.horizontAngle = this.formData.horizontAngle;
|
|
553
|
+
visualAnalysis.verticalAngle = this.formData.verticalAngle;
|
|
554
|
+
visualAnalysis._unVisibleColor = unVisibleColor;
|
|
555
|
+
visualAnalysis._visibleColor = visibleColor;
|
|
556
|
+
visualAnalysis._fanColor = maskColor;
|
|
557
|
+
|
|
558
|
+
// 添加可视域分析结果显示
|
|
559
|
+
this.webGlobe.viewer.scene.VisualAnalysisManager.add(visualAnalysis);
|
|
560
|
+
//更新manager
|
|
561
|
+
CesiumZondy.ViewshedAnalysisManager.changeOptions(
|
|
562
|
+
vueKey,
|
|
563
|
+
vueIndex,
|
|
564
|
+
"visualAnalysis",
|
|
565
|
+
visualAnalysis
|
|
566
|
+
);
|
|
567
|
+
},
|
|
568
|
+
// 通过输入坐标开始分析按钮
|
|
569
|
+
onInputStart() {
|
|
570
|
+
let viewCartesian = this.Cesium.Cartesian3.fromDegrees(
|
|
571
|
+
this.posData.viewPositionX,
|
|
572
|
+
this.posData.viewPositionY,
|
|
573
|
+
this.posData.viewPositionZ
|
|
574
|
+
);
|
|
575
|
+
|
|
576
|
+
const cartographic = this.updateExheight(viewCartesian);
|
|
577
|
+
viewCartesian = this.Cesium.Cartographic.toCartesian(cartographic);
|
|
578
|
+
|
|
579
|
+
const targetCartesian = this.Cesium.Cartesian3.fromDegrees(
|
|
580
|
+
this.posData.targetPositionX,
|
|
581
|
+
this.posData.targetPositionY,
|
|
582
|
+
this.posData.targetPositionZ
|
|
583
|
+
);
|
|
584
|
+
|
|
585
|
+
let find = this.findSource();
|
|
586
|
+
find.options.visualAnalysis.viewPosition = viewCartesian;
|
|
587
|
+
find.options.visualAnalysis.targetPosition = targetCartesian;
|
|
588
|
+
|
|
589
|
+
this.setVisualAttrs();
|
|
590
|
+
|
|
591
|
+
// 添加观察点到地图
|
|
592
|
+
this.addViewPoint(viewCartesian);
|
|
593
|
+
},
|
|
594
|
+
|
|
595
|
+
// 获取更新附加高度后的地理坐标
|
|
596
|
+
updateExheight(cartesian) {
|
|
597
|
+
// 获取当前坐标系标准
|
|
598
|
+
const ellipsoid = this.webGlobe.viewer.scene.globe.ellipsoid;
|
|
599
|
+
// 根据坐标系标准,将笛卡尔坐标转换为地理坐标
|
|
600
|
+
const cartographic = ellipsoid.cartesianToCartographic(cartesian);
|
|
601
|
+
// 抬高观察点
|
|
602
|
+
cartographic.height += this.formData.exHeight;
|
|
603
|
+
|
|
604
|
+
return cartographic;
|
|
605
|
+
},
|
|
606
|
+
|
|
607
|
+
// 分析完成时显示方向角、俯仰角、可视距离三种属性
|
|
608
|
+
setVisualAttrs() {
|
|
609
|
+
let find = this.findSource();
|
|
610
|
+
const { heading, pitch, viewRadius } = find.options.visualAnalysis;
|
|
611
|
+
|
|
612
|
+
this.angleSet.heading = heading.toFixed(2);
|
|
613
|
+
this.angleSet.pitch = pitch.toFixed(2);
|
|
614
|
+
this.angleSet.viewRadius = parseInt(viewRadius);
|
|
615
|
+
},
|
|
616
|
+
|
|
617
|
+
// 添加观察点到地图上
|
|
618
|
+
addViewPoint(cartesian) {
|
|
619
|
+
if (this.viewPoint) this.webGlobe.viewer.entities.remove(this.viewPoint);
|
|
620
|
+
|
|
621
|
+
this.viewPoint = this.webGlobe.viewer.entities.add({
|
|
622
|
+
position: cartesian,
|
|
623
|
+
point: {
|
|
624
|
+
color: this.Cesium.Color.BLUE,
|
|
625
|
+
pixelSize: 10
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
},
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* @description 恢复深度检测设置
|
|
632
|
+
*/
|
|
633
|
+
_restoreDepthTestAgainstTerrain() {
|
|
634
|
+
if (
|
|
635
|
+
this.isDepthTestAgainstTerrainEnable !== undefined &&
|
|
636
|
+
this.isDepthTestAgainstTerrainEnable !==
|
|
637
|
+
isDepthTestAgainstTerrainEnable(this.webGlobe)
|
|
638
|
+
) {
|
|
639
|
+
setDepthTestAgainstTerrainEnable(
|
|
640
|
+
this.isDepthTestAgainstTerrainEnable,
|
|
641
|
+
this.webGlobe
|
|
642
|
+
);
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
|
|
646
|
+
// 点击结束分析按钮回调
|
|
647
|
+
onClickStop() {
|
|
648
|
+
let { vueKey, vueIndex } = this;
|
|
649
|
+
// 注销鼠标的各项监听事件
|
|
650
|
+
this.webGlobe.unRegisterMouseEvent("MOUSE_MOVE");
|
|
651
|
+
this.webGlobe.unRegisterMouseEvent("LEFT_CLICK");
|
|
652
|
+
this.webGlobe.unRegisterMouseEvent("RIGHT_CLICK");
|
|
653
|
+
|
|
654
|
+
// 清空观察点与目标点坐标
|
|
655
|
+
this.posData.viewPositionX = "";
|
|
656
|
+
this.posData.viewPositionY = "";
|
|
657
|
+
this.posData.viewPositionZ = "";
|
|
658
|
+
this.posData.targetPositionX = "";
|
|
659
|
+
this.posData.targetPositionY = "";
|
|
660
|
+
this.posData.targetPositionZ = "";
|
|
661
|
+
|
|
662
|
+
// 清空方向角、俯仰角、可视距离
|
|
663
|
+
this.angleSet.heading = 0;
|
|
664
|
+
this.angleSet.pitch = 0;
|
|
665
|
+
this.angleSet.viewRadius = 0;
|
|
666
|
+
|
|
667
|
+
// 移除所有观察点
|
|
668
|
+
this.webGlobe.viewer.entities.removeAll();
|
|
669
|
+
|
|
670
|
+
for (let i = 0; i < (this.tilesetArray || []).length; i++) {
|
|
671
|
+
this.tilesetArray[i][0].debugFreezeFrame = false;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
// 移除可视域分析工具
|
|
675
|
+
let find = this.findSource();
|
|
676
|
+
if (find && find.options) {
|
|
677
|
+
find.options.visualAnalysis = null;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
// 移除可视域分析结果
|
|
681
|
+
this.webGlobe.viewer.scene.VisualAnalysisManager._visualAnalysisList = [];
|
|
682
|
+
|
|
683
|
+
this.isAddEventListener = false;
|
|
684
|
+
|
|
685
|
+
//恢复深度检测的原始设置
|
|
686
|
+
this._restoreDepthTestAgainstTerrain();
|
|
687
|
+
this.hasViewPosition = false;
|
|
688
|
+
this.isAnalyze = false;
|
|
689
|
+
},
|
|
690
|
+
|
|
691
|
+
// 为鼠标的各种行为注册监听事件
|
|
692
|
+
addEventListener() {
|
|
693
|
+
if (!this.isAddEventListener) {
|
|
694
|
+
this.webGlobe.registerMouseEvent("MOUSE_MOVE", event => {
|
|
695
|
+
this.registerMouseMoveEvent(event);
|
|
696
|
+
});
|
|
697
|
+
this.webGlobe.registerMouseEvent("LEFT_CLICK", event => {
|
|
698
|
+
this.registerMouseLClickEvent(event);
|
|
699
|
+
});
|
|
700
|
+
this.webGlobe.registerMouseEvent("RIGHT_CLICK", event => {
|
|
701
|
+
this.registerMouseRClickEvent(event);
|
|
702
|
+
});
|
|
703
|
+
this.isAddEventListener = true;
|
|
704
|
+
}
|
|
705
|
+
},
|
|
706
|
+
// 注册可视域分析鼠标移动事件
|
|
707
|
+
registerMouseMoveEvent(event) {
|
|
708
|
+
if (this.hasViewPosition) {
|
|
709
|
+
const cartesian = this.webGlobe.viewer.getCartesian3Position(
|
|
710
|
+
event.endPosition
|
|
369
711
|
);
|
|
370
|
-
|
|
371
|
-
|
|
712
|
+
if (cartesian) {
|
|
713
|
+
// 设置可视域结束点坐标
|
|
714
|
+
let find = this.findSource();
|
|
715
|
+
find.options.visualAnalysis.targetPosition = cartesian;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
},
|
|
719
|
+
|
|
720
|
+
// 注册可视域分析鼠标左键点击事件
|
|
721
|
+
registerMouseLClickEvent(event) {
|
|
722
|
+
let cartesian = this.webGlobe.viewer.getCartesian3Position(
|
|
723
|
+
event.position
|
|
724
|
+
);
|
|
725
|
+
let find = this.findSource();
|
|
726
|
+
|
|
727
|
+
if (this.isAnalyze) {
|
|
728
|
+
if (!this.hasViewPosition && cartesian !== undefined) {
|
|
729
|
+
// 若还未选择观察点
|
|
730
|
+
const cartographic = this.updateExheight(cartesian);
|
|
731
|
+
cartesian = this.Cesium.Cartographic.toCartesian(cartographic);
|
|
732
|
+
|
|
733
|
+
// 设置可视域观察点坐标
|
|
734
|
+
find.options.visualAnalysis.viewPosition = cartesian;
|
|
735
|
+
this.convertPosition(cartesian, "view");
|
|
736
|
+
|
|
737
|
+
// 添加观察点到地图
|
|
738
|
+
this.addViewPoint(cartesian);
|
|
739
|
+
this.hasViewPosition = true;
|
|
740
|
+
|
|
741
|
+
// 如果拥有初始目标点,则相当于在选择观察点后,又自动点击了鼠标左键一次来选择目标点
|
|
742
|
+
if (this.isHasTargetPos) {
|
|
743
|
+
const targetCartesian = this.Cesium.Cartesian3.fromDegrees(
|
|
744
|
+
this.posData.targetPositionX,
|
|
745
|
+
this.posData.targetPositionY,
|
|
746
|
+
this.posData.targetPositionZ
|
|
747
|
+
);
|
|
748
|
+
find.options.visualAnalysis.targetPosition = targetCartesian;
|
|
749
|
+
|
|
750
|
+
this.setVisualAttrs();
|
|
751
|
+
this.convertPosition(targetCartesian, "target");
|
|
752
|
+
|
|
753
|
+
this.hasViewPosition = false;
|
|
754
|
+
this.isAnalyze = false;
|
|
755
|
+
}
|
|
756
|
+
} else {
|
|
757
|
+
// 已经选择了观察点,则这次是选择结束点
|
|
758
|
+
|
|
759
|
+
// 设置可视域结束点坐标
|
|
760
|
+
find.options.visualAnalysis.targetPosition = cartesian;
|
|
761
|
+
|
|
762
|
+
this.setVisualAttrs();
|
|
763
|
+
this.convertPosition(cartesian, "target");
|
|
764
|
+
|
|
765
|
+
this.hasViewPosition = false;
|
|
766
|
+
this.isAnalyze = false;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
372
769
|
},
|
|
770
|
+
|
|
771
|
+
// 注册可视域分析鼠标右键点击事件
|
|
772
|
+
registerMouseRClickEvent(event) {
|
|
773
|
+
const cartesian = this.webGlobe.viewer.getCartesian3Position(
|
|
774
|
+
event.position
|
|
775
|
+
);
|
|
776
|
+
let find = this.findSource();
|
|
777
|
+
|
|
778
|
+
if (this.hasViewPosition) {
|
|
779
|
+
// 设置可视域结束点坐标
|
|
780
|
+
find.options.visualAnalysis.targetPosition = cartesian;
|
|
781
|
+
|
|
782
|
+
this.setVisualAttrs();
|
|
783
|
+
this.convertPosition(cartesian, "target");
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
this.hasViewPosition = false;
|
|
787
|
+
this.isAnalyze = false;
|
|
788
|
+
},
|
|
789
|
+
findSource() {
|
|
790
|
+
let { CesiumZondy, vueKey, vueIndex } = this;
|
|
791
|
+
let find = CesiumZondy.ViewshedAnalysisManager.findSource(
|
|
792
|
+
vueKey,
|
|
793
|
+
vueIndex
|
|
794
|
+
);
|
|
795
|
+
return find;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
373
798
|
};
|
|
374
799
|
</script>
|
|
375
800
|
|
|
376
|
-
|
|
377
801
|
<style scoped>
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
802
|
+
.mapgis-widget-visual-analysis {
|
|
803
|
+
/*max-width: calc(42vw);*/
|
|
804
|
+
max-height: calc(60vh);
|
|
805
|
+
overflow-y: auto;
|
|
381
806
|
}
|
|
382
|
-
|
|
383
|
-
|
|
807
|
+
|
|
808
|
+
::v-deep .mapgis-ui-form-item {
|
|
809
|
+
margin-bottom: 0;
|
|
384
810
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
811
|
+
|
|
812
|
+
::v-deep .mapgis-ui-form label {
|
|
813
|
+
font-size: 12px;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
::v-deep .mapgis-ui-form-item-label {
|
|
817
|
+
line-height: 40px;
|
|
389
818
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
819
|
+
|
|
820
|
+
::v-deep .mapgis-ui-input {
|
|
821
|
+
padding: 4px 11px;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
::v-deep .mapgis-ui-card.mapgis-ui-card-bordered {
|
|
825
|
+
max-height: 100%;
|
|
826
|
+
overflow-y: auto;
|
|
394
827
|
}
|
|
395
|
-
</style>
|
|
828
|
+
</style>
|