@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,116 +1,101 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<mapgis-ui-form-model-item label="日期">
|
|
16
|
-
<mapgis-ui-date-picker
|
|
17
|
-
:default-value="startDate"
|
|
18
|
-
size="small"
|
|
19
|
-
@change="changeDate"
|
|
20
|
-
/>
|
|
21
|
-
</mapgis-ui-form-model-item>
|
|
22
|
-
<div>
|
|
23
|
-
<mapgis-ui-form-model-item label="开始时间">
|
|
24
|
-
<mapgis-ui-time-picker
|
|
25
|
-
:default-value="startTime"
|
|
26
|
-
size="small"
|
|
27
|
-
@change="
|
|
28
|
-
val => {
|
|
29
|
-
changeTime(val, 'startTime')
|
|
30
|
-
}
|
|
31
|
-
"
|
|
32
|
-
/>
|
|
33
|
-
</mapgis-ui-form-model-item>
|
|
34
|
-
<mapgis-ui-form-model-item label="结束时间">
|
|
35
|
-
<mapgis-ui-time-picker
|
|
36
|
-
:default-value="endTime"
|
|
37
|
-
size="small"
|
|
38
|
-
@change="
|
|
39
|
-
val => {
|
|
40
|
-
changeTime(val, 'endTime')
|
|
41
|
-
}
|
|
42
|
-
"
|
|
43
|
-
/>
|
|
44
|
-
</mapgis-ui-form-model-item>
|
|
45
|
-
</div>
|
|
46
|
-
<mapgis-ui-form-model-item label="底部高程">
|
|
47
|
-
<Mapgis-ui-input
|
|
48
|
-
v-model.number="formData.min"
|
|
49
|
-
addon-after="(米)"
|
|
50
|
-
size="small"
|
|
51
|
-
type="number"
|
|
52
|
-
/>
|
|
53
|
-
</mapgis-ui-form-model-item>
|
|
54
|
-
<mapgis-ui-form-model-item label="拉伸高度">
|
|
55
|
-
<Mapgis-ui-input
|
|
56
|
-
v-model.number="formData.max"
|
|
57
|
-
addon-after="(米)"
|
|
58
|
-
min="0"
|
|
2
|
+
<div class="mp-widget-shadow-analysis">
|
|
3
|
+
<mapgis-ui-setting-form :model="formData">
|
|
4
|
+
<mapgis-ui-form-model-item label="日期">
|
|
5
|
+
<mapgis-ui-date-picker
|
|
6
|
+
:default-value="startDate"
|
|
7
|
+
size="small"
|
|
8
|
+
@change="changeDate"
|
|
9
|
+
/>
|
|
10
|
+
</mapgis-ui-form-model-item>
|
|
11
|
+
<div>
|
|
12
|
+
<mapgis-ui-form-model-item label="开始时间">
|
|
13
|
+
<mapgis-ui-time-picker
|
|
14
|
+
:default-value="startTime"
|
|
59
15
|
size="small"
|
|
60
|
-
|
|
61
|
-
/>
|
|
62
|
-
</mapgis-ui-form-model-item>
|
|
63
|
-
<mapgis-ui-form-model-item label="阴影颜色">
|
|
64
|
-
<colorPicker
|
|
65
|
-
class="color-picker"
|
|
66
|
-
v-model="formData.shadowColor"
|
|
67
|
-
@change="changeShadowColor"
|
|
68
|
-
/>
|
|
69
|
-
</mapgis-ui-form-model-item>
|
|
70
|
-
<mapgis-ui-form-model-item label="非阴影颜色">
|
|
71
|
-
<colorPicker
|
|
72
|
-
class="color-picker"
|
|
73
|
-
v-model="formData.sunColor"
|
|
74
|
-
@change="changeSunColor"
|
|
16
|
+
@change="changeTime(val, 'startTime')"
|
|
75
17
|
/>
|
|
76
18
|
</mapgis-ui-form-model-item>
|
|
77
|
-
<mapgis-ui-form-model-item
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
disabled
|
|
19
|
+
<mapgis-ui-form-model-item label="结束时间">
|
|
20
|
+
<mapgis-ui-time-picker
|
|
21
|
+
:default-value="endTime"
|
|
81
22
|
size="small"
|
|
82
|
-
|
|
23
|
+
@change="changeTime(val, 'endTime')"
|
|
83
24
|
/>
|
|
84
25
|
</mapgis-ui-form-model-item>
|
|
85
|
-
</
|
|
86
|
-
<
|
|
87
|
-
<mapgis-ui-
|
|
88
|
-
|
|
26
|
+
</div>
|
|
27
|
+
<mapgis-ui-form-model-item label="底部高程">
|
|
28
|
+
<mapgis-ui-input
|
|
29
|
+
v-model.number="formData.minHeight"
|
|
30
|
+
addon-after="(米)"
|
|
89
31
|
size="small"
|
|
90
|
-
type="
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
>
|
|
99
|
-
<mapgis-ui-button
|
|
100
|
-
class="control-button"
|
|
32
|
+
type="number"
|
|
33
|
+
/>
|
|
34
|
+
</mapgis-ui-form-model-item>
|
|
35
|
+
<mapgis-ui-form-model-item label="拉伸高度">
|
|
36
|
+
<mapgis-ui-input
|
|
37
|
+
v-model.number="formData.stretchHeight"
|
|
38
|
+
addon-after="(米)"
|
|
39
|
+
min="0"
|
|
101
40
|
size="small"
|
|
102
|
-
type="
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
41
|
+
type="number"
|
|
42
|
+
/>
|
|
43
|
+
</mapgis-ui-form-model-item>
|
|
44
|
+
<mapgis-ui-form-model-item label="阴影颜色">
|
|
45
|
+
<mapgis-ui-sketch-color-picker
|
|
46
|
+
:color.sync="formData.shadowColor"
|
|
47
|
+
:disableAlpha="true"
|
|
48
|
+
@input="
|
|
49
|
+
val =>
|
|
50
|
+
(formData.shadowColor = `rgba(${val.rgba.r}, ${val.rgba.g}, ${val.rgba.b}, ${val.rgba.a})`)
|
|
51
|
+
"
|
|
52
|
+
/>
|
|
53
|
+
</mapgis-ui-form-model-item>
|
|
54
|
+
<mapgis-ui-form-model-item label="非阴影颜色">
|
|
55
|
+
<mapgis-ui-sketch-color-picker
|
|
56
|
+
:color.sync="formData.sunColor"
|
|
57
|
+
:disableAlpha="true"
|
|
58
|
+
@input="
|
|
59
|
+
val =>
|
|
60
|
+
(formData.sunColor = `rgba(${val.rgba.r}, ${val.rgba.g}, ${val.rgba.b}, ${val.rgba.a})`)
|
|
61
|
+
"
|
|
62
|
+
/>
|
|
63
|
+
</mapgis-ui-form-model-item>
|
|
64
|
+
</mapgis-ui-setting-form>
|
|
65
|
+
<mapgis-ui-setting-footer>
|
|
66
|
+
<mapgis-ui-button
|
|
67
|
+
:disabled="maskShow"
|
|
68
|
+
type="primary"
|
|
69
|
+
@click="shadow"
|
|
70
|
+
>阴影分析
|
|
71
|
+
</mapgis-ui-button
|
|
72
|
+
>
|
|
73
|
+
<mapgis-ui-button type="primary" @click="sun" :disabled="maskShow"
|
|
74
|
+
>日照效果
|
|
75
|
+
</mapgis-ui-button
|
|
76
|
+
>
|
|
77
|
+
<mapgis-ui-button
|
|
78
|
+
type="primary"
|
|
79
|
+
@click="removeAll"
|
|
80
|
+
> 清除
|
|
81
|
+
</mapgis-ui-button
|
|
82
|
+
>
|
|
83
|
+
</mapgis-ui-setting-footer>
|
|
84
|
+
<mapgis-ui-mask
|
|
85
|
+
:parentDivClass="'cesium-map-wrapper'"
|
|
86
|
+
:loading="maskShow"
|
|
87
|
+
:text="maskText"
|
|
88
|
+
:percent="percent"
|
|
89
|
+
></mapgis-ui-mask>
|
|
109
90
|
</div>
|
|
110
91
|
</template>
|
|
111
92
|
|
|
112
93
|
<script>
|
|
113
94
|
import BaseMixin from "./BaseLayer";
|
|
95
|
+
import {hexToRgba} from '../Utils/common/color-util';
|
|
96
|
+
/* import { Util } from "@mapgis/webclient-vue-ui";
|
|
97
|
+
const { ColorUtil } = Util; */
|
|
98
|
+
import VueOptions from "../Base/Vue/VueOptions";
|
|
114
99
|
|
|
115
100
|
const shadowMoment = require('moment');
|
|
116
101
|
const manager = "shadowAnalysisManager";
|
|
@@ -119,20 +104,43 @@ export default {
|
|
|
119
104
|
mixins: [BaseMixin],
|
|
120
105
|
inject: ["Cesium", "CesiumZondy", "webGlobe"],
|
|
121
106
|
props: {
|
|
122
|
-
|
|
107
|
+
...VueOptions,
|
|
108
|
+
/**
|
|
109
|
+
* @type String
|
|
110
|
+
* @default 'rgba(0,255,0,255)'
|
|
111
|
+
* @description 阴影部分颜色
|
|
112
|
+
*/
|
|
113
|
+
shadowColor: {
|
|
123
114
|
type: String,
|
|
124
|
-
default:
|
|
115
|
+
default: 'rgba(0,255,0,255)'
|
|
125
116
|
},
|
|
126
|
-
|
|
117
|
+
/**
|
|
118
|
+
* @type String
|
|
119
|
+
* @default 'rgba(255,0,0,255)'
|
|
120
|
+
* @description 非阴影部分颜色
|
|
121
|
+
*/
|
|
122
|
+
sunColor: {
|
|
127
123
|
type: String,
|
|
128
|
-
default:
|
|
124
|
+
default: 'rgba(255,0,0,255)'
|
|
129
125
|
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
126
|
+
/**
|
|
127
|
+
* @type Number
|
|
128
|
+
* @default 0
|
|
129
|
+
* @description 底部高程(米)
|
|
130
|
+
*/
|
|
131
|
+
minHeight:{
|
|
132
|
+
type:Number,
|
|
133
|
+
default:0
|
|
135
134
|
},
|
|
135
|
+
/**
|
|
136
|
+
* @type Number
|
|
137
|
+
* @default 20
|
|
138
|
+
* @description 拉伸高度(米)
|
|
139
|
+
*/
|
|
140
|
+
stretchHeight:{
|
|
141
|
+
type:Number,
|
|
142
|
+
default:20
|
|
143
|
+
}
|
|
136
144
|
},
|
|
137
145
|
data() {
|
|
138
146
|
return {
|
|
@@ -141,13 +149,10 @@ export default {
|
|
|
141
149
|
startTime: '10:00:00', // 开始时间
|
|
142
150
|
endTime: '14:00:00', // 结束时间
|
|
143
151
|
dateTimeVal: '10:00:00',
|
|
144
|
-
|
|
145
|
-
|
|
152
|
+
minHeight: 0, // 最低高程(米)
|
|
153
|
+
stretchHeight: 20, // 拉伸高度(米)
|
|
146
154
|
shadowColor: 'rgba(0,255,0,255)', // 阴影颜色
|
|
147
155
|
sunColor: 'rgba(255,0,0,255)', // 非阴影颜色
|
|
148
|
-
ratio: 0, // 阴影率(时间点范围阴影分析输出结果)
|
|
149
|
-
// timeType: 'timeRange', // 分析类型(time:时间点;timeRange:时间段)
|
|
150
|
-
// time: '10:00:00' // 时间点
|
|
151
156
|
},
|
|
152
157
|
startDate: "",
|
|
153
158
|
formDataTime: "",
|
|
@@ -156,9 +161,11 @@ export default {
|
|
|
156
161
|
waitManagerName: "M3DIgsManager",
|
|
157
162
|
percent: 0,
|
|
158
163
|
layout: {
|
|
159
|
-
labelCol: {span:
|
|
160
|
-
wrapperCol: {span:
|
|
164
|
+
labelCol: {span: 5},
|
|
165
|
+
wrapperCol: {span: 16},
|
|
161
166
|
},
|
|
167
|
+
maskShow: false,
|
|
168
|
+
maskText: '正在分析中, 请稍等...0%'
|
|
162
169
|
}
|
|
163
170
|
},
|
|
164
171
|
created() {
|
|
@@ -168,16 +175,64 @@ export default {
|
|
|
168
175
|
this.endTime = shadowMoment(this.formData.endTime, 'HH:mm:ss');
|
|
169
176
|
},
|
|
170
177
|
mounted() {
|
|
178
|
+
this.mount();
|
|
179
|
+
},
|
|
180
|
+
destroyed() {
|
|
181
|
+
this.removeAll();
|
|
171
182
|
},
|
|
172
183
|
watch: {
|
|
173
|
-
|
|
174
|
-
handler: function (
|
|
175
|
-
|
|
184
|
+
shadowColor: {
|
|
185
|
+
handler: function (newVal, oldVal) {
|
|
186
|
+
if (newVal.indexOf("#") > -1) {
|
|
187
|
+
this.shadowColor = hexToRgba(newVal, 1);
|
|
188
|
+
}
|
|
189
|
+
this.formData.shadowColor = this.shadowColor;
|
|
190
|
+
},
|
|
191
|
+
immediate: true
|
|
192
|
+
},
|
|
193
|
+
sunColor: {
|
|
194
|
+
handler: function (newVal, oldVal) {
|
|
195
|
+
if (newVal.indexOf("#") > -1) {
|
|
196
|
+
this.sunColor = hexToRgba(newVal, 1);
|
|
197
|
+
}
|
|
198
|
+
this.formData.sunColor = this.sunColor;
|
|
199
|
+
},
|
|
200
|
+
immediate: true
|
|
201
|
+
},
|
|
202
|
+
minHeight:{
|
|
203
|
+
handler:function () {
|
|
204
|
+
this.formData.minHeight = this.minHeight;
|
|
176
205
|
},
|
|
177
|
-
|
|
206
|
+
immediate:true
|
|
207
|
+
},
|
|
208
|
+
stretchHeight:{
|
|
209
|
+
handler:function () {
|
|
210
|
+
this.formData.stretchHeight = this.stretchHeight;
|
|
211
|
+
},
|
|
212
|
+
immediate:true
|
|
178
213
|
}
|
|
179
214
|
},
|
|
180
215
|
methods: {
|
|
216
|
+
async createCesiumObject() {
|
|
217
|
+
return new Promise(
|
|
218
|
+
resolve => {
|
|
219
|
+
resolve();
|
|
220
|
+
},
|
|
221
|
+
reject => {}
|
|
222
|
+
);
|
|
223
|
+
},
|
|
224
|
+
mount() {
|
|
225
|
+
const { webGlobe} = this;
|
|
226
|
+
const { viewer } = webGlobe;
|
|
227
|
+
const vm = this;
|
|
228
|
+
let promise = this.createCesiumObject();
|
|
229
|
+
promise.then(function(dataSource) {
|
|
230
|
+
vm.$emit("load", vm);
|
|
231
|
+
});
|
|
232
|
+
if (viewer.scene.globe.depthTestAgainstTerrain) {
|
|
233
|
+
this.depthTestAgainstTerrain = true;
|
|
234
|
+
}
|
|
235
|
+
},
|
|
181
236
|
/**
|
|
182
237
|
* 日期组件值变化
|
|
183
238
|
*/
|
|
@@ -194,23 +249,6 @@ export default {
|
|
|
194
249
|
this.$set(this.formData, tag, time)
|
|
195
250
|
},
|
|
196
251
|
|
|
197
|
-
// 微件关闭时
|
|
198
|
-
onClose() {
|
|
199
|
-
this.remove()
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
// 微件失活时
|
|
203
|
-
onDeActive() {
|
|
204
|
-
this.remove()
|
|
205
|
-
},
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* rgb转cesium的颜色
|
|
209
|
-
*/
|
|
210
|
-
getCesiumColor(colorStr) {
|
|
211
|
-
return this.colorToCesiumColor(colorStr);
|
|
212
|
-
},
|
|
213
|
-
|
|
214
252
|
/**
|
|
215
253
|
* 时间字符串转JulianDate时间
|
|
216
254
|
*/
|
|
@@ -218,72 +256,20 @@ export default {
|
|
|
218
256
|
const utc = this.Cesium.JulianDate.fromDate(new Date(timeStr)) // UTC
|
|
219
257
|
return this.Cesium.JulianDate.addHours(utc, 0, new this.Cesium.JulianDate()) // 北京时间
|
|
220
258
|
},
|
|
221
|
-
/**
|
|
222
|
-
* RGB/RGBA转Cesium内部颜色值
|
|
223
|
-
* @param {string} color rgb/rgba颜色值
|
|
224
|
-
*/
|
|
225
|
-
colorToCesiumColor(color) {
|
|
226
|
-
let cesiumColor
|
|
227
|
-
if (color.includes('rgb')) {
|
|
228
|
-
// 如果是rgb或者rgba
|
|
229
|
-
const a = color.split('(')[1].split(')')[0]
|
|
230
|
-
const arr = a.split(',')
|
|
231
|
-
const cesiumRed = Number((Number(arr[0]) / 255).toFixed(2))
|
|
232
|
-
const cesiumGreen = Number((Number(arr[1]) / 255).toFixed(2))
|
|
233
|
-
const cesiumBlue = Number((Number(arr[2]) / 255).toFixed(2))
|
|
234
|
-
const cesiumAlpha = Number(arr[3] ? arr[3] : 1)
|
|
235
|
-
cesiumColor = this.webGlobe.getColor(
|
|
236
|
-
cesiumRed,
|
|
237
|
-
cesiumGreen,
|
|
238
|
-
cesiumBlue,
|
|
239
|
-
cesiumAlpha
|
|
240
|
-
)
|
|
241
|
-
} else if (color.indexOf('#') >= 0) {
|
|
242
|
-
cesiumColor = Cesium.Color.fromCssColorString(color);
|
|
243
|
-
}
|
|
244
|
-
return cesiumColor
|
|
245
|
-
},
|
|
246
259
|
|
|
247
260
|
/**
|
|
248
|
-
*
|
|
249
|
-
* @param {string} color 十六进制颜色值
|
|
250
|
-
*/
|
|
251
|
-
colorToRgba(val) {
|
|
252
|
-
//16进制的正则
|
|
253
|
-
let reg = new RegExp("^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$");
|
|
254
|
-
let color = val.toLowerCase();
|
|
255
|
-
if (val.includes('rgba')) {
|
|
256
|
-
return val;
|
|
257
|
-
}
|
|
258
|
-
let result = '';
|
|
259
|
-
if (reg.test(color)) {
|
|
260
|
-
let colorChange = [];
|
|
261
|
-
for (let i = 1; i < 7; i += 2) {
|
|
262
|
-
colorChange.push(parseInt("0x" + color.slice(i, i + 2)));
|
|
263
|
-
result = "rgba(" + colorChange.join(",")
|
|
264
|
-
}
|
|
265
|
-
result = result + ",255)";
|
|
266
|
-
}
|
|
267
|
-
return result;
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* 范围时间点阴影分析/范围时间段阴影分析
|
|
261
|
+
* 范围时间段阴影分析
|
|
272
262
|
*/
|
|
273
263
|
shadow() {
|
|
274
264
|
this.remove();
|
|
275
265
|
const {viewer} = this.webGlobe;
|
|
276
266
|
// 初始化交互式绘制控件
|
|
277
267
|
let drawElement = new this.Cesium.DrawElement(viewer);
|
|
278
|
-
let {date,
|
|
279
|
-
shadowColor = this.colorToRgba(shadowColor);
|
|
280
|
-
sunColor = this.colorToRgba(sunColor);
|
|
268
|
+
let {date, minHeight, stretchHeight, shadowColor, sunColor} = this.formData;
|
|
281
269
|
const time = new Date(`${date} ${this.formData.time}`);
|
|
282
270
|
const startTime = new Date(`${date} ${this.formData.startTime}`);
|
|
283
271
|
const endTime = new Date(`${date} ${this.formData.endTime}`);
|
|
284
272
|
|
|
285
|
-
viewer.scene.globe.depthTestAgainstTerrain = false; // 关闭深度检测
|
|
286
|
-
|
|
287
273
|
const self = this;
|
|
288
274
|
let shadowAnalysis;
|
|
289
275
|
// 1.绘制分析区域(矩形)
|
|
@@ -291,7 +277,8 @@ export default {
|
|
|
291
277
|
drawElement.startDrawingPolygon({
|
|
292
278
|
// 绘制完成回调函数
|
|
293
279
|
callback: positions => {
|
|
294
|
-
self.remove()
|
|
280
|
+
// self.remove();
|
|
281
|
+
self.toggleMask(true);
|
|
295
282
|
this.$emit("analysisBegin");
|
|
296
283
|
let xmin
|
|
297
284
|
let ymin
|
|
@@ -326,7 +313,7 @@ export default {
|
|
|
326
313
|
)
|
|
327
314
|
const xPaneNum = Math.ceil(recXLength / 4) // X轴方向插值点个数
|
|
328
315
|
const yPaneNum = Math.ceil(recYLength / 4) // Y轴方向插值点个数
|
|
329
|
-
const zPaneNum = Math.ceil((
|
|
316
|
+
const zPaneNum = Math.ceil((stretchHeight - minHeight) / 4) // Z轴方向插值点个数
|
|
330
317
|
|
|
331
318
|
shadowAnalysis = new Cesium.ShadowAnalysis(viewer, {
|
|
332
319
|
xPaneNum,
|
|
@@ -334,13 +321,13 @@ export default {
|
|
|
334
321
|
zPaneNum,
|
|
335
322
|
shadowColor: shadowColor,
|
|
336
323
|
sunColor: sunColor,
|
|
337
|
-
percentCallback: this.setPercent
|
|
324
|
+
percentCallback: this.setPercent
|
|
338
325
|
})
|
|
339
326
|
// 时间段范围阴影分析
|
|
340
327
|
const result = shadowAnalysis.calcPointsArrayInShadowTime(
|
|
341
328
|
positions,
|
|
342
|
-
|
|
343
|
-
|
|
329
|
+
minHeight,
|
|
330
|
+
stretchHeight,
|
|
344
331
|
startTime,
|
|
345
332
|
endTime
|
|
346
333
|
)
|
|
@@ -363,7 +350,8 @@ export default {
|
|
|
363
350
|
* 原生日照分析
|
|
364
351
|
*/
|
|
365
352
|
sun() {
|
|
366
|
-
this.
|
|
353
|
+
this.removeSun();
|
|
354
|
+
// this.remove();
|
|
367
355
|
const {viewer} = this.webGlobe;
|
|
368
356
|
viewer.scene.globe.enableLighting = true; // 开启日照
|
|
369
357
|
viewer.shadows = true; // 开启阴影
|
|
@@ -383,72 +371,20 @@ export default {
|
|
|
383
371
|
viewer.clock.clockRange = this.Cesium.ClockRange.LOOP_STOP // 循环动画
|
|
384
372
|
},
|
|
385
373
|
|
|
386
|
-
/**
|
|
387
|
-
* 参数更新后重新加载分析结果
|
|
388
|
-
*/
|
|
389
|
-
reloadAnalysis() {
|
|
390
|
-
let vm = this;
|
|
391
|
-
const {viewer} = this.webGlobe;
|
|
392
|
-
let findSource = vm.$_getManager(manager);
|
|
393
|
-
let xPaneNum;
|
|
394
|
-
let yPaneNum;
|
|
395
|
-
let zPaneNum;
|
|
396
|
-
let positions = [];
|
|
397
|
-
const startTime = new Date(`${this.formData.date} ${this.formData.startTime}`);
|
|
398
|
-
const endTime = new Date(`${this.formData.date} ${this.formData.endTime}`);
|
|
399
|
-
const shadowColor = this.colorToRgba(this.formData.shadowColor);
|
|
400
|
-
const sunColor = this.colorToRgba(this.formData.sunColor);
|
|
401
|
-
if (findSource && findSource.source && findSource.options) {
|
|
402
|
-
let originAnaysis = findSource.source.shadowAnalysis;
|
|
403
|
-
let drawElement = findSource.source.drawElement;
|
|
404
|
-
xPaneNum = originAnaysis.xPaneNum;
|
|
405
|
-
yPaneNum = originAnaysis.yPaneNum;
|
|
406
|
-
zPaneNum = originAnaysis.zPaneNum;
|
|
407
|
-
positions = findSource.options.positionCopy;
|
|
408
|
-
this.remove();
|
|
409
|
-
this.$emit("analysisBegin");
|
|
410
|
-
let shadowAnalysis = new Cesium.ShadowAnalysis(viewer, {
|
|
411
|
-
xPaneNum,
|
|
412
|
-
yPaneNum,
|
|
413
|
-
zPaneNum,
|
|
414
|
-
shadowColor: shadowColor,
|
|
415
|
-
sunColor: sunColor,
|
|
416
|
-
percentCallback: this.setPercent(this.percent)
|
|
417
|
-
})
|
|
418
|
-
// 时间段范围阴影分析
|
|
419
|
-
const result = shadowAnalysis.calcPointsArrayInShadowTime(
|
|
420
|
-
positions,
|
|
421
|
-
this.formData.min,
|
|
422
|
-
this.formData.max,
|
|
423
|
-
startTime,
|
|
424
|
-
endTime
|
|
425
|
-
)
|
|
426
|
-
let positionCopy = [];
|
|
427
|
-
positionCopy = this.copy(positions);
|
|
428
|
-
//存放到管理器中
|
|
429
|
-
CesiumZondy.shadowAnalysisManager.addSource(
|
|
430
|
-
this.vueKey,
|
|
431
|
-
this.vueIndex,
|
|
432
|
-
{shadowAnalysis, drawElement},
|
|
433
|
-
{positionCopy: positionCopy}
|
|
434
|
-
);
|
|
435
|
-
}
|
|
436
|
-
},
|
|
437
|
-
|
|
438
374
|
/**
|
|
439
375
|
* 时间段阴影分析回调函数,获取分析进度值
|
|
440
376
|
*/
|
|
441
|
-
setPercent(result){
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
377
|
+
setPercent(result) {
|
|
378
|
+
this.percent = result;
|
|
379
|
+
this.maskText = `正在分析中, 请稍等...${Number((result * 100).toFixed(2))}%`;
|
|
380
|
+
const timer = setInterval(() => {
|
|
381
|
+
if (this.percent === result) {
|
|
382
|
+
this.toggleMask(false);
|
|
383
|
+
this.$emit("success");
|
|
384
|
+
}
|
|
385
|
+
clearInterval(timer);
|
|
386
|
+
}, 200)
|
|
450
387
|
},
|
|
451
|
-
|
|
452
388
|
//数组对象深拷贝
|
|
453
389
|
copy(obj) {
|
|
454
390
|
var newobj = obj.constructor === Array ? [] : {};
|
|
@@ -464,9 +400,9 @@ export default {
|
|
|
464
400
|
* 移除绘制插件和阴影分析结果
|
|
465
401
|
*/
|
|
466
402
|
remove() {
|
|
467
|
-
let vm = this;
|
|
468
403
|
let {vueKey, vueIndex} = this;
|
|
469
|
-
let findSource = vm.$_getManager(manager);
|
|
404
|
+
// let findSource = vm.$_getManager(manager);
|
|
405
|
+
let findSource = CesiumZondy[manager].findSource(vueKey, vueIndex);
|
|
470
406
|
// 判断是否已有阴影分析结果
|
|
471
407
|
if (findSource && findSource.source) {
|
|
472
408
|
// 移除阴影分析显示结果
|
|
@@ -480,15 +416,29 @@ export default {
|
|
|
480
416
|
}
|
|
481
417
|
// 这段代码可以认为是对应的vue的获取destroyed生命周期
|
|
482
418
|
CesiumZondy[manager].deleteSource(vueKey, vueIndex);
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
419
|
+
},
|
|
420
|
+
/**
|
|
421
|
+
* 移除日照分析结果
|
|
422
|
+
*/
|
|
423
|
+
removeSun() {
|
|
486
424
|
const {viewer} = this.webGlobe
|
|
487
425
|
viewer.scene.globe.enableLighting = false
|
|
488
426
|
viewer.shadows = false
|
|
489
427
|
viewer.clock.multiplier = 1
|
|
490
428
|
viewer.clock.shouldAnimate = false // 关闭计时
|
|
491
429
|
},
|
|
430
|
+
removeAll() {
|
|
431
|
+
this.remove();
|
|
432
|
+
this.removeSun();
|
|
433
|
+
this.$emit("unload", this);
|
|
434
|
+
},
|
|
435
|
+
/**
|
|
436
|
+
* 阴影分析遮罩层
|
|
437
|
+
*/
|
|
438
|
+
toggleMask(status) {
|
|
439
|
+
this.maskShow = status;
|
|
440
|
+
},
|
|
441
|
+
|
|
492
442
|
changeShadowColor(color) {
|
|
493
443
|
this.formData.shadowColor = color;
|
|
494
444
|
},
|
|
@@ -500,40 +450,16 @@ export default {
|
|
|
500
450
|
</script>
|
|
501
451
|
|
|
502
452
|
<style scoped>
|
|
503
|
-
.mp-widget-shadow-analysis {
|
|
504
|
-
/*display: flex;*/
|
|
505
|
-
/*flex-direction: column;*/
|
|
506
|
-
max-height: calc(80vh);
|
|
507
|
-
min-width: calc(20vw);
|
|
508
|
-
background-color: rgba(0, 0, 0, 0.3);
|
|
509
|
-
padding-bottom: 15px;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
.shadow.right {
|
|
513
|
-
position: absolute;
|
|
514
|
-
top: 20px;
|
|
515
|
-
right: 20px;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
::v-deep .fixed-table {
|
|
519
|
-
width: 250px;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
453
|
::v-deep .mapgis-ui-form-item {
|
|
523
|
-
/*align-items: center;*/
|
|
524
454
|
margin-bottom: 0;
|
|
525
455
|
}
|
|
526
456
|
|
|
527
|
-
::v-deep .mapgis-ui-form
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
::v-deep .mapgis-ui-form-item-label > label {
|
|
532
|
-
color: rgba(255, 255, 255, 1);
|
|
457
|
+
::v-deep .mapgis-ui-form label {
|
|
458
|
+
font-size: 12px;
|
|
533
459
|
}
|
|
534
460
|
|
|
535
|
-
::v-deep .mapgis-ui-form-item-label
|
|
536
|
-
|
|
461
|
+
::v-deep .mapgis-ui-form-item-label {
|
|
462
|
+
line-height: 40px;
|
|
537
463
|
}
|
|
538
464
|
|
|
539
465
|
::v-deep .mapgis-ui-input {
|
|
@@ -541,25 +467,10 @@ export default {
|
|
|
541
467
|
}
|
|
542
468
|
|
|
543
469
|
::v-deep .mapgis-ui-time-picker {
|
|
544
|
-
width:
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
.color-picker {
|
|
470
|
+
width: 179px;
|
|
548
471
|
}
|
|
549
472
|
|
|
550
|
-
|
|
551
|
-
width:
|
|
473
|
+
::v-deep .mapgis-ui-col-5 {
|
|
474
|
+
width: 23.833333%;
|
|
552
475
|
}
|
|
553
|
-
|
|
554
|
-
.control-button-container {
|
|
555
|
-
display: inline-flex;
|
|
556
|
-
justify-content: space-between;
|
|
557
|
-
margin: 5px 0;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
.control-button {
|
|
561
|
-
margin: 0 6px;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
|
|
565
476
|
</style>
|