@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,155 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="prefixCls">
|
|
3
|
+
<!-- 测量控制按钮 -->
|
|
4
|
+
<mapgis-ui-toolbar :class="`${prefixCls}-toolbar`">
|
|
5
|
+
<!-- 面积或长度设置按钮 -->
|
|
6
|
+
<mapgis-ui-toolbar-command-group>
|
|
7
|
+
<mapgis-ui-toolbar-command
|
|
8
|
+
v-for="{ title, mode, icon } in modes"
|
|
9
|
+
:key="title"
|
|
10
|
+
:title="title"
|
|
11
|
+
:icon="icon"
|
|
12
|
+
:active="activeMode === mode"
|
|
13
|
+
@click="startMeasure(mode)"
|
|
14
|
+
/>
|
|
15
|
+
</mapgis-ui-toolbar-command-group>
|
|
16
|
+
<mapgis-ui-toolbar-space />
|
|
17
|
+
<!-- 清除或设置 -->
|
|
18
|
+
<mapgis-ui-toolbar-command-group>
|
|
19
|
+
<mapgis-ui-toolbar-command
|
|
20
|
+
title="清除"
|
|
21
|
+
icon="mapgis-shanchu_dianji"
|
|
22
|
+
@click="clearMeasure"
|
|
23
|
+
/>
|
|
24
|
+
<mapgis-ui-toolbar-command
|
|
25
|
+
@click="showSettingPanel = !showSettingPanel"
|
|
26
|
+
:active="showSettingPanel"
|
|
27
|
+
title="设置"
|
|
28
|
+
icon="mapgis-setting"
|
|
29
|
+
/>
|
|
30
|
+
</mapgis-ui-toolbar-command-group>
|
|
31
|
+
</mapgis-ui-toolbar>
|
|
32
|
+
<!-- 测量结果 -->
|
|
33
|
+
<measure-3d-result :mode="activeMode" :result="measureResult" />
|
|
34
|
+
<!-- 测量样式设置 -->
|
|
35
|
+
<measure-3d-setting
|
|
36
|
+
v-if="showSettingPanel"
|
|
37
|
+
@measure-style-change="measureStyleChange"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
<script>
|
|
42
|
+
import { last } from "../../../../Utils/util";
|
|
43
|
+
import Measure3dResult, { measureModeMap } from "./MeasureResult.vue";
|
|
44
|
+
import Measure3dSetting from "./MeasureSetting.vue";
|
|
45
|
+
|
|
46
|
+
// todo 暂不支持样式的实时更改
|
|
47
|
+
export default {
|
|
48
|
+
name: "measure-3d-tool",
|
|
49
|
+
inject: ["webGlobe"],
|
|
50
|
+
components: {
|
|
51
|
+
"measure-3d-result": Measure3dResult,
|
|
52
|
+
"measure-3d-setting": Measure3dSetting
|
|
53
|
+
},
|
|
54
|
+
props: {
|
|
55
|
+
result: {
|
|
56
|
+
type: Object
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
data: vm => ({
|
|
60
|
+
prefixCls: "measure-3d-tool",
|
|
61
|
+
showSettingPanel: false,
|
|
62
|
+
measureResult: null,
|
|
63
|
+
activeMode: "",
|
|
64
|
+
// todo 替换ICON
|
|
65
|
+
modes: [
|
|
66
|
+
{
|
|
67
|
+
mode: measureModeMap.MeasureLengthTool,
|
|
68
|
+
title: "长度",
|
|
69
|
+
icon: "mapgis-huizhixian1"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
mode: measureModeMap.MeasureAreaTool,
|
|
73
|
+
title: "面积",
|
|
74
|
+
icon: "mapgis-area"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
mode: measureModeMap.TriangulationTool,
|
|
78
|
+
title: "三角",
|
|
79
|
+
icon: "mapgis-sanjiaoceliang"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}),
|
|
83
|
+
methods: {
|
|
84
|
+
/**
|
|
85
|
+
* 保留2位小数
|
|
86
|
+
*/
|
|
87
|
+
precision(n, p = 2) {
|
|
88
|
+
return n.toFixed(p);
|
|
89
|
+
},
|
|
90
|
+
/**
|
|
91
|
+
* 设置测量结果
|
|
92
|
+
* @param {*} result
|
|
93
|
+
*/
|
|
94
|
+
setMeasureResult(result) {
|
|
95
|
+
let _measureResult;
|
|
96
|
+
switch (this.activeMode) {
|
|
97
|
+
case measureModeMap.MeasureLengthTool:
|
|
98
|
+
_measureResult = {
|
|
99
|
+
cesiumLength: this.precision(last(result) / 1000)
|
|
100
|
+
};
|
|
101
|
+
break;
|
|
102
|
+
case measureModeMap.MeasureAreaTool:
|
|
103
|
+
_measureResult = {
|
|
104
|
+
cesiumArea: this.precision(result / Math.pow(1000, 2))
|
|
105
|
+
};
|
|
106
|
+
break;
|
|
107
|
+
case measureModeMap.TriangulationTool:
|
|
108
|
+
_measureResult = {
|
|
109
|
+
horizontalDiatance: this.precision(result.horizontalDiatance),
|
|
110
|
+
verticalDiatance: this.precision(result.verticalDiatance)
|
|
111
|
+
};
|
|
112
|
+
break;
|
|
113
|
+
default:
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
this.measureResult = _measureResult;
|
|
117
|
+
},
|
|
118
|
+
/**
|
|
119
|
+
* 开始测量
|
|
120
|
+
*/
|
|
121
|
+
startMeasure(mode) {
|
|
122
|
+
this.activeMode = mode;
|
|
123
|
+
this.clearMeasure();
|
|
124
|
+
this.enableMeasure(mode);
|
|
125
|
+
},
|
|
126
|
+
/**
|
|
127
|
+
* 关闭测量工具
|
|
128
|
+
*/
|
|
129
|
+
clearMeasure() {
|
|
130
|
+
this.activeMode = "";
|
|
131
|
+
this.measureResult = null;
|
|
132
|
+
this.$parent.remove();
|
|
133
|
+
},
|
|
134
|
+
/**
|
|
135
|
+
* 开始测量
|
|
136
|
+
*/
|
|
137
|
+
enableMeasure(mode) {
|
|
138
|
+
this.$parent.$_enableMeasure(mode, this.setMeasureResult);
|
|
139
|
+
},
|
|
140
|
+
/**
|
|
141
|
+
* 测量样式变化
|
|
142
|
+
*/
|
|
143
|
+
measureStyleChange(style) {
|
|
144
|
+
this.$parent.initStyles(style);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
</script>
|
|
149
|
+
<style lang="scss" scoped>
|
|
150
|
+
.measure-3d-tool {
|
|
151
|
+
&-toolbar {
|
|
152
|
+
justify-content: space-between;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
</style>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="mapgis-featuretool-content" ref="geojsontool">
|
|
3
|
+
<div class="mapgis-inspect-prop-tabs">
|
|
4
|
+
<mapgis-ui-tabs
|
|
5
|
+
v-if="mode === 'click'"
|
|
6
|
+
v-model="activeKey"
|
|
7
|
+
:style="{ height: '240px' }"
|
|
8
|
+
size="small"
|
|
9
|
+
:tab-position="tabPosition"
|
|
10
|
+
>
|
|
11
|
+
<mapgis-ui-tab-pane
|
|
12
|
+
class="mapgis-inspect-prop-content"
|
|
13
|
+
v-for="(f, i) in currentLayerInfo"
|
|
14
|
+
:key="i"
|
|
15
|
+
>
|
|
16
|
+
<div slot="tab" class="mapgis-inspect-layer-name">
|
|
17
|
+
<mapgis-ui-tooltip :title="f.layer.id">
|
|
18
|
+
<span>
|
|
19
|
+
{{ f.layer.id.substr(0, 12) }}
|
|
20
|
+
</span>
|
|
21
|
+
</mapgis-ui-tooltip>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="mapgis-popup-content-title">
|
|
24
|
+
{{ f.title }}
|
|
25
|
+
</div>
|
|
26
|
+
<div
|
|
27
|
+
v-for="(value, key) in f.properties"
|
|
28
|
+
class="mapgis-inspect-prop-style"
|
|
29
|
+
:key="key"
|
|
30
|
+
>
|
|
31
|
+
<div class="mapgis-inspect-prop-key">
|
|
32
|
+
<span style="padding-right: 5px">{{ key }}</span>
|
|
33
|
+
</div>
|
|
34
|
+
<div>{{ value }} ({{ typeof value }})</div>
|
|
35
|
+
</div>
|
|
36
|
+
<br />
|
|
37
|
+
</mapgis-ui-tab-pane>
|
|
38
|
+
</mapgis-ui-tabs>
|
|
39
|
+
<div v-else>
|
|
40
|
+
<div v-if="currentLayerInfo && currentLayerInfo.length > 0">
|
|
41
|
+
<div>
|
|
42
|
+
{{ currentLayerInfo[0].title }}
|
|
43
|
+
</div>
|
|
44
|
+
<div
|
|
45
|
+
v-for="(value, key) in currentLayerInfo[0].properties"
|
|
46
|
+
class="mapgis-inspect-prop-style"
|
|
47
|
+
:key="key"
|
|
48
|
+
>
|
|
49
|
+
<div class="mapgis-inspect-prop-key">
|
|
50
|
+
<span style="padding-right: 5px">{{ key }}</span>
|
|
51
|
+
</div>
|
|
52
|
+
<div>{{ value }}</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
<script>
|
|
60
|
+
export default {
|
|
61
|
+
name: "mapgis-3d-geojson-popup",
|
|
62
|
+
inject: ["Cesium", "CesiumZondy"],
|
|
63
|
+
props: {
|
|
64
|
+
outStyle: {
|
|
65
|
+
type: Object,
|
|
66
|
+
default: () => {
|
|
67
|
+
return { height: "120px", width: "240px" };
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
mode: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: "click"
|
|
73
|
+
},
|
|
74
|
+
currentLayerInfo: {
|
|
75
|
+
type: Array,
|
|
76
|
+
default: () => []
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
watch: {
|
|
80
|
+
activeKey(next) {
|
|
81
|
+
this.$emit("select-layer", next);
|
|
82
|
+
},
|
|
83
|
+
currentLayerInfo() {
|
|
84
|
+
this.activeKey = 0;
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
data() {
|
|
88
|
+
return {
|
|
89
|
+
tabPosition: "top",
|
|
90
|
+
activeKey: 0
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
mounted() {
|
|
94
|
+
this.$nextTick(() => {
|
|
95
|
+
if (this.activeKey) {
|
|
96
|
+
this.$emit("select-layer", this.activeKey);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
</script>
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
<div style="display: none">
|
|
3
|
+
<!-- slot for custom marker -->
|
|
4
|
+
<slot name="marker" />
|
|
5
|
+
<!-- slot for popup -->
|
|
6
|
+
<slot v-if="marker" />
|
|
7
|
+
</div>
|
|
3
8
|
</template>
|
|
4
9
|
|
|
5
10
|
<script>
|
|
6
|
-
|
|
7
11
|
export default {
|
|
8
|
-
name: "mapgis-3d-
|
|
12
|
+
name: "mapgis-3d-marker",
|
|
9
13
|
inject: ["Cesium", "CesiumZondy", "webGlobe"],
|
|
10
14
|
props: {
|
|
15
|
+
fid: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
11
19
|
text: {
|
|
12
20
|
type: String,
|
|
13
21
|
default: ""
|
|
@@ -42,11 +50,11 @@ export default {
|
|
|
42
50
|
},
|
|
43
51
|
iconHeight: {
|
|
44
52
|
type: Number,
|
|
45
|
-
default:
|
|
53
|
+
default: 32
|
|
46
54
|
},
|
|
47
55
|
iconWidth: {
|
|
48
56
|
type: Number,
|
|
49
|
-
default:
|
|
57
|
+
default: 32
|
|
50
58
|
},
|
|
51
59
|
farDist: {
|
|
52
60
|
type: Number,
|
|
@@ -73,13 +81,33 @@ export default {
|
|
|
73
81
|
default() {
|
|
74
82
|
return Number((Math.random() * 100000000).toFixed(0));
|
|
75
83
|
}
|
|
84
|
+
},
|
|
85
|
+
changeEvent: {
|
|
86
|
+
type: Function
|
|
76
87
|
}
|
|
77
88
|
},
|
|
89
|
+
data() {
|
|
90
|
+
return {
|
|
91
|
+
marker: undefined,
|
|
92
|
+
isMoveIn: false,
|
|
93
|
+
isMoveOut: true
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
provide() {
|
|
97
|
+
const self = this;
|
|
98
|
+
return {
|
|
99
|
+
get marker() {
|
|
100
|
+
// 提供marker给子组件popup或者插槽槽
|
|
101
|
+
return self.marker;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
},
|
|
78
105
|
mounted() {
|
|
79
106
|
let vm = this;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
107
|
+
const defaults = ["vueKey", "vueIndex"];
|
|
108
|
+
Object.keys(this.$props).forEach(function(key) {
|
|
109
|
+
if (defaults.indexOf(key) < 0) {
|
|
110
|
+
vm.$watch(key, function() {
|
|
83
111
|
vm.$_unmount();
|
|
84
112
|
vm.$_mount();
|
|
85
113
|
});
|
|
@@ -91,24 +119,29 @@ export default {
|
|
|
91
119
|
this.$_unmount();
|
|
92
120
|
},
|
|
93
121
|
methods: {
|
|
94
|
-
$_mount(){
|
|
122
|
+
$_mount() {
|
|
95
123
|
let vm = this;
|
|
96
|
-
window.CesiumZondy.getWebGlobeByInterval(function
|
|
124
|
+
window.CesiumZondy.getWebGlobeByInterval(function(webGlobe) {
|
|
97
125
|
vm.$_init(webGlobe);
|
|
98
|
-
},this.vueKey)
|
|
126
|
+
}, this.vueKey);
|
|
99
127
|
},
|
|
100
|
-
$_unmount(){
|
|
101
|
-
const {vueKey, vueIndex } = this;
|
|
128
|
+
$_unmount() {
|
|
129
|
+
const { vueKey, vueIndex } = this;
|
|
102
130
|
const vm = this;
|
|
103
131
|
let CesiumZondy = this.CesiumZondy || window.CesiumZondy;
|
|
104
|
-
window.CesiumZondy.getWebGlobeByInterval(function
|
|
105
|
-
let MarkerManager = CesiumZondy.MarkerManager.findSource(
|
|
132
|
+
window.CesiumZondy.getWebGlobeByInterval(function(webGlobe) {
|
|
133
|
+
let MarkerManager = CesiumZondy.MarkerManager.findSource(
|
|
134
|
+
vueKey,
|
|
135
|
+
vueIndex
|
|
136
|
+
);
|
|
106
137
|
let webGlobeMarker = vm.webGlobe || webGlobe;
|
|
107
138
|
webGlobeMarker.viewer.entities.remove(MarkerManager.source);
|
|
108
139
|
CesiumZondy.MarkerManager.deleteSource(vueKey, vueIndex);
|
|
109
|
-
},vueKey);
|
|
140
|
+
}, vueKey);
|
|
110
141
|
},
|
|
111
142
|
$_init(webGlobe) {
|
|
143
|
+
const { CesiumZondy } = this;
|
|
144
|
+
let vm = this;
|
|
112
145
|
let Cesium = this.Cesium || window.Cesium;
|
|
113
146
|
let webGlobeMarker = this.webGlobe || webGlobe;
|
|
114
147
|
let labelLayer = new CesiumZondy.Manager.LabelLayer({
|
|
@@ -116,54 +149,158 @@ export default {
|
|
|
116
149
|
});
|
|
117
150
|
let heightReference = Cesium.HeightReference.CLAMP_TO_GROUND;
|
|
118
151
|
switch (this.heightReference) {
|
|
119
|
-
case "clamped"
|
|
152
|
+
case "clamped":
|
|
120
153
|
heightReference = Cesium.HeightReference.CLAMP_TO_GROUND;
|
|
121
154
|
break;
|
|
122
|
-
case "absolute"
|
|
155
|
+
case "absolute":
|
|
123
156
|
heightReference = Cesium.HeightReference.NONE;
|
|
124
157
|
break;
|
|
125
|
-
case "above"
|
|
158
|
+
case "above":
|
|
126
159
|
heightReference = Cesium.HeightReference.RELATIVE_TO_GROUND;
|
|
127
160
|
break;
|
|
128
161
|
}
|
|
129
|
-
if(this.height > 0){
|
|
162
|
+
if (this.height > 0) {
|
|
130
163
|
heightReference = Cesium.HeightReference.NONE;
|
|
131
164
|
}
|
|
132
|
-
|
|
165
|
+
let label = {
|
|
166
|
+
//文本内容
|
|
167
|
+
text: this.text,
|
|
168
|
+
//经度、纬度、高度
|
|
169
|
+
longitude: this.longitude,
|
|
170
|
+
latitude: this.latitude,
|
|
171
|
+
height: this.height,
|
|
172
|
+
//文字大小、字体
|
|
173
|
+
font: this.fontSize + " " + this.fontFamily,
|
|
174
|
+
//文字颜色
|
|
175
|
+
fontColor: Cesium.Color.fromCssColorString(this.color),
|
|
176
|
+
// "data/picture/icon.png",
|
|
177
|
+
iconUrl: this.iconUrl,
|
|
178
|
+
iconWidth: this.iconWidth,
|
|
179
|
+
iconHeight: this.iconHeight,
|
|
180
|
+
//最远显示距离:相机到注记的距离大于该值 注记不显示
|
|
181
|
+
farDist: this.farDist,
|
|
182
|
+
//最近显示距离:相机到注记的距离小于该值 注记不显示
|
|
183
|
+
nearDist: this.nearDist,
|
|
184
|
+
//图片位置:'center','top','bottom'
|
|
185
|
+
iconPos: this.iconPos,
|
|
186
|
+
//相对位置
|
|
187
|
+
heightReference: heightReference
|
|
188
|
+
};
|
|
189
|
+
this.$_append(labelLayer, heightReference, label);
|
|
190
|
+
this.marker = this;
|
|
191
|
+
|
|
192
|
+
if (!window.DynamicMarkerHandler) {
|
|
193
|
+
window.DynamicMarkerHandler = new Cesium.ScreenSpaceEventHandler(
|
|
194
|
+
webGlobeMarker.viewer.scene.canvas
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
window.DynamicMarkerHandler.removeInputAction(
|
|
198
|
+
vm.$_markerMouseAction,
|
|
199
|
+
Cesium.ScreenSpaceEventType.MOUSE_MOVE
|
|
200
|
+
);
|
|
201
|
+
window.DynamicMarkerHandler.setInputAction(
|
|
202
|
+
vm.$_markerMouseAction,
|
|
203
|
+
Cesium.ScreenSpaceEventType.MOUSE_MOVE
|
|
204
|
+
);
|
|
205
|
+
},
|
|
206
|
+
$_hasId(id) {
|
|
207
|
+
let marker = {};
|
|
208
|
+
marker.flag = false;
|
|
209
|
+
let markerManagers = CesiumZondy.MarkerManager[this.vueKey];
|
|
210
|
+
for (let i = 0; i < markerManagers.length; i++) {
|
|
211
|
+
if (markerManagers[i].source._id === id) {
|
|
212
|
+
marker.flag = true;
|
|
213
|
+
marker.label = markerManagers[i].source.markLabel;
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return marker;
|
|
133
218
|
},
|
|
134
|
-
$
|
|
219
|
+
$_markerMouseAction(movement) {
|
|
220
|
+
const { Cesium, CesiumZondy } = this;
|
|
221
|
+
const vm = this;
|
|
222
|
+
let webGlobeMarker = this.webGlobe;
|
|
223
|
+
let scene = webGlobeMarker.viewer.scene;
|
|
224
|
+
window.DynamicMarkerLastActiceId = window.DynamicMarkerLastActiceId || undefined;
|
|
225
|
+
if (scene.mode !== Cesium.SceneMode.MORPHING) {
|
|
226
|
+
let pickedObject = scene.pick(movement.endPosition);
|
|
227
|
+
if (
|
|
228
|
+
Cesium.defined(pickedObject) &&
|
|
229
|
+
pickedObject.hasOwnProperty("id") &&
|
|
230
|
+
pickedObject.id.label &&
|
|
231
|
+
vm.$_hasId(pickedObject.id.id).flag
|
|
232
|
+
) {
|
|
233
|
+
if (!vm.isMoveIn) {
|
|
234
|
+
vm.isMoveIn = true;
|
|
235
|
+
vm.isMoveOut = false;
|
|
236
|
+
let label = vm.$_hasId(pickedObject.id.id).label
|
|
237
|
+
if (window.DynamicMarkerLastActiceId && window.DynamicMarkerLastActiceId != label) {
|
|
238
|
+
vm.$emit("mouseLeave", window.DynamicMarkerLastActiceId);
|
|
239
|
+
}
|
|
240
|
+
vm.$emit("mouseEnter", label);
|
|
241
|
+
window.DynamicMarkerLastActiceId = label;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (!Cesium.defined(pickedObject)) {
|
|
245
|
+
if (!vm.isMoveOut) {
|
|
246
|
+
vm.isMoveIn = false;
|
|
247
|
+
vm.isMoveOut = true;
|
|
248
|
+
vm.$emit("mouseLeave", window.DynamicMarkerLastActiceId);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
$_append(labelLayer, heightReference, label) {
|
|
135
254
|
let icon = labelLayer.appendLabelIcon(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
255
|
+
//文本内容
|
|
256
|
+
this.text,
|
|
257
|
+
//经度、纬度、高度
|
|
258
|
+
this.longitude,
|
|
259
|
+
this.latitude,
|
|
260
|
+
this.height,
|
|
261
|
+
//文字大小、字体
|
|
262
|
+
this.fontSize + " " + this.fontFamily,
|
|
263
|
+
//文字颜色
|
|
264
|
+
Cesium.Color.fromCssColorString(this.color),
|
|
265
|
+
// "data/picture/icon.png",
|
|
266
|
+
this.iconUrl,
|
|
267
|
+
this.iconWidth,
|
|
268
|
+
this.iconHeight,
|
|
269
|
+
//最远显示距离:相机到注记的距离大于该值 注记不显示
|
|
270
|
+
this.farDist,
|
|
271
|
+
//最近显示距离:相机到注记的距离小于该值 注记不显示
|
|
272
|
+
this.nearDist,
|
|
273
|
+
//图片位置:'center','top','bottom'
|
|
274
|
+
this.iconPos,
|
|
275
|
+
"",
|
|
276
|
+
//相对位置
|
|
277
|
+
heightReference
|
|
156
278
|
);
|
|
279
|
+
label.fid = this.fid;
|
|
280
|
+
label.changeEvent = this.changeEvent;
|
|
281
|
+
icon.markLabel = label;
|
|
157
282
|
this.$_addIcon(icon);
|
|
158
283
|
},
|
|
159
284
|
$_addIcon(icon) {
|
|
160
|
-
const {vueKey, vueIndex} = this;
|
|
285
|
+
const { vueKey, vueIndex } = this;
|
|
161
286
|
let CesiumZondy = this.CesiumZondy || window.CesiumZondy;
|
|
162
|
-
CesiumZondy.MarkerManager.addSource(vueKey,vueIndex,icon);
|
|
287
|
+
CesiumZondy.MarkerManager.addSource(vueKey, vueIndex, icon);
|
|
288
|
+
},
|
|
289
|
+
togglePopup() {
|
|
290
|
+
const { longitude, latitude, height } = this;
|
|
291
|
+
let children = this.$children;
|
|
292
|
+
if (!children || children.length <= 0) return;
|
|
293
|
+
let popup = children[0];
|
|
294
|
+
let vnode = popup.$vnode;
|
|
295
|
+
if (!vnode) return;
|
|
296
|
+
let { tag } = vnode;
|
|
297
|
+
if (!tag || tag.indexOf("mapgis-3d-popup") < 0) return;
|
|
298
|
+
if (!popup.$props.position) {
|
|
299
|
+
popup.$props.position = { longitude, latitude, height };
|
|
300
|
+
popup.togglePopup();
|
|
301
|
+
}
|
|
302
|
+
popup.togglePopup();
|
|
163
303
|
}
|
|
164
304
|
}
|
|
165
|
-
}
|
|
305
|
+
};
|
|
166
306
|
</script>
|
|
167
|
-
|
|
168
|
-
<style scoped>
|
|
169
|
-
</style>
|
|
@@ -15,6 +15,14 @@ export default {
|
|
|
15
15
|
prop: "visible",
|
|
16
16
|
event: "change"
|
|
17
17
|
},
|
|
18
|
+
data() {
|
|
19
|
+
return {
|
|
20
|
+
longitude: 0, // 仅用于父级marker动态改变popup的data使用
|
|
21
|
+
latitude: 0, // 仅用于父级marker动态改变popup的data使用
|
|
22
|
+
height: 0, // 仅用于父级marker动态改变popup的data使用,
|
|
23
|
+
show: true
|
|
24
|
+
};
|
|
25
|
+
},
|
|
18
26
|
inject: ["Cesium", "CesiumZondy", "webGlobe"],
|
|
19
27
|
watch: {
|
|
20
28
|
position: {
|
|
@@ -28,6 +36,12 @@ export default {
|
|
|
28
36
|
handler() {
|
|
29
37
|
this.update();
|
|
30
38
|
}
|
|
39
|
+
},
|
|
40
|
+
show: {
|
|
41
|
+
deep: true,
|
|
42
|
+
handler() {
|
|
43
|
+
this.update();
|
|
44
|
+
}
|
|
31
45
|
}
|
|
32
46
|
},
|
|
33
47
|
updated() {
|
|
@@ -42,6 +56,10 @@ export default {
|
|
|
42
56
|
this.unmount();
|
|
43
57
|
},
|
|
44
58
|
methods: {
|
|
59
|
+
togglePopup() {
|
|
60
|
+
let value = !this.show;
|
|
61
|
+
this.show = value;
|
|
62
|
+
},
|
|
45
63
|
getWebGlobe() {
|
|
46
64
|
let { webGlobe, vueKey, CesiumZondy } = this;
|
|
47
65
|
CesiumZondy = CesiumZondy || window.CesiumZondy;
|
|
@@ -59,7 +77,8 @@ export default {
|
|
|
59
77
|
|
|
60
78
|
if (this.$slots.default) {
|
|
61
79
|
if (this.$slots.default[0].elm) {
|
|
62
|
-
container =
|
|
80
|
+
container =
|
|
81
|
+
this.$slots.default[0].elm || this.$slots.default[0].elm.innerHTML;
|
|
63
82
|
} else if (this.$slots.default[0].context.$children[0].$el) {
|
|
64
83
|
container = this.$slots.default[0].context.$children[0].$el.innerHTML;
|
|
65
84
|
}
|
|
@@ -136,7 +155,7 @@ export default {
|
|
|
136
155
|
CesiumZondy.PopupManager.deleteSource(vueKey, vueIndex);
|
|
137
156
|
}
|
|
138
157
|
|
|
139
|
-
if (this.visible) {
|
|
158
|
+
if (this.visible && this.show) {
|
|
140
159
|
popup = this.createCesiumObject();
|
|
141
160
|
this.$emit("load", { popup: popup });
|
|
142
161
|
if (vueKey && (vueIndex || vueIndex === 0)) {
|
|
@@ -155,65 +174,3 @@ export default {
|
|
|
155
174
|
}
|
|
156
175
|
};
|
|
157
176
|
</script>
|
|
158
|
-
<style>
|
|
159
|
-
.cesium-popup {
|
|
160
|
-
position: absolute;
|
|
161
|
-
text-align: center;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.cesium-popup-close-button {
|
|
165
|
-
position: absolute;
|
|
166
|
-
top: 0;
|
|
167
|
-
right: 0;
|
|
168
|
-
padding: 4px 4px 0 0;
|
|
169
|
-
text-align: center;
|
|
170
|
-
width: 18px;
|
|
171
|
-
height: 14px;
|
|
172
|
-
font: 16px/14px Tahoma, Verdana, sans-serif;
|
|
173
|
-
color: #ffffff;
|
|
174
|
-
text-decoration: none;
|
|
175
|
-
font-weight: bold;
|
|
176
|
-
background: transparent;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.cesium-popup-content-wrapper {
|
|
180
|
-
text-align: left;
|
|
181
|
-
padding: 10px;
|
|
182
|
-
overflow-y: auto;
|
|
183
|
-
font-size: 1.2em;
|
|
184
|
-
z-index: 9999;
|
|
185
|
-
border: 2px solid #46bcf1;
|
|
186
|
-
box-shadow: 0px 0px 20px #46bcf1;
|
|
187
|
-
-moz-box-shadow: 0px 0px 20px #46bcf1;
|
|
188
|
-
-webkit-box-shadow: 0px 0px 20px #46bcf1;
|
|
189
|
-
border-radius: 3px 3px 3px 3px;
|
|
190
|
-
background: #46bcf188;
|
|
191
|
-
background-size: 50% 50%;
|
|
192
|
-
background-repeat: no-repeat;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.cesium-popup-content {
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.cesium-popup-tip-container {
|
|
199
|
-
margin: 0 auto;
|
|
200
|
-
width: 40px;
|
|
201
|
-
height: 20px;
|
|
202
|
-
position: relative;
|
|
203
|
-
overflow: hidden;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.cesium-popup-tip {
|
|
207
|
-
background: #46bcf1;
|
|
208
|
-
box-shadow: 0 3px 14px #46bcf1;
|
|
209
|
-
width: 17px;
|
|
210
|
-
height: 17px;
|
|
211
|
-
padding: 1px;
|
|
212
|
-
margin: -10px auto 0;
|
|
213
|
-
-webkit-transform: rotate(45deg);
|
|
214
|
-
-moz-transform: rotate(45deg);
|
|
215
|
-
-ms-transform: rotate(45deg);
|
|
216
|
-
-o-transform: rotate(45deg);
|
|
217
|
-
transform: rotate(45deg);
|
|
218
|
-
}
|
|
219
|
-
</style>
|