@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
|
@@ -26,8 +26,8 @@ export function initManager() {
|
|
|
26
26
|
window.CesiumZondy.MarkerManager || new MarkerManager();
|
|
27
27
|
window.CesiumZondy.OGCWMTSManager =
|
|
28
28
|
window.CesiumZondy.OGCWMTSManager || new OGCWMTSManager();
|
|
29
|
-
window.CesiumZondy.
|
|
30
|
-
window.CesiumZondy.
|
|
29
|
+
window.CesiumZondy.FloodAnalysisManager =
|
|
30
|
+
window.CesiumZondy.FloodAnalysisManager || new FloodAnalysisManager();
|
|
31
31
|
window.CesiumZondy.OGCWMSManager =
|
|
32
32
|
window.CesiumZondy.OGCWMSManager || new OGCWMSManager();
|
|
33
33
|
window.CesiumZondy.DragEditManager =
|
|
@@ -70,6 +70,29 @@ export function initManager() {
|
|
|
70
70
|
new HeightLimitedAnalysisManager();
|
|
71
71
|
window.CesiumZondy.shadowAnalysisManager =
|
|
72
72
|
window.CesiumZondy.shadowAnalysisManager || new shadowAnalysisManager();
|
|
73
|
+
window.CesiumZondy.IgsFeatureManager =
|
|
74
|
+
window.CesiumZondy.IgsFeatureManager || new IgsFeatureManager();
|
|
75
|
+
window.CesiumZondy.AspectAnalysisManager =
|
|
76
|
+
window.CesiumZondy.AspectAnalysisManager || new AspectAnalysisManager();
|
|
77
|
+
DynamicSectionAnalysisManager;
|
|
78
|
+
window.CesiumZondy.DynamicSectionAnalysisManager =
|
|
79
|
+
window.CesiumZondy.DynamicSectionAnalysisManager ||
|
|
80
|
+
new DynamicSectionAnalysisManager();
|
|
81
|
+
window.CesiumZondy.SlopeAnalysisManager =
|
|
82
|
+
window.CesiumZondy.SlopeAnalysisManager || new SlopeAnalysisManager();
|
|
83
|
+
window.CesiumZondy.SkyLineAnalysisManager =
|
|
84
|
+
window.CesiumZondy.SkyLineAnalysisManager || new SkyLineAnalysisManager();
|
|
85
|
+
window.CesiumZondy.ContourAnalysisManager =
|
|
86
|
+
window.CesiumZondy.ContourAnalysisManager || new ContourAnalysisManager();
|
|
87
|
+
window.CesiumZondy.ViewshedAnalysisManager =
|
|
88
|
+
window.CesiumZondy.ViewshedAnalysisManager || new ViewshedAnalysisManager();
|
|
89
|
+
window.CesiumZondy.VisiblityAnalysisManager =
|
|
90
|
+
window.CesiumZondy.VisiblityAnalysisManager ||
|
|
91
|
+
new VisiblityAnalysisManager();
|
|
92
|
+
window.CesiumZondy.CutFillAnalysisManager =
|
|
93
|
+
window.CesiumZondy.CutFillAnalysisManager || new CutFillAnalysisManager();
|
|
94
|
+
window.CesiumZondy.ProfileAnalysisManager =
|
|
95
|
+
window.CesiumZondy.ProfileAnalysisManager || new ProfileAnalysisManager();
|
|
73
96
|
|
|
74
97
|
//在window.CesiumZondy下添加取得WebGlobe对象的方法
|
|
75
98
|
window.CesiumZondy.getWebGlobe = function(vueKey) {
|
|
@@ -145,6 +168,51 @@ export class BaseManager {
|
|
|
145
168
|
}
|
|
146
169
|
}
|
|
147
170
|
|
|
171
|
+
changeSource(vueKey, vueIndex, source) {
|
|
172
|
+
vueKey = vueKey ? vueKey : this.vueKey;
|
|
173
|
+
vueIndex = vueIndex ? vueIndex : this.vueIndex;
|
|
174
|
+
vueIndex = `${vueIndex}`;
|
|
175
|
+
let index = -1;
|
|
176
|
+
let findSource = undefined;
|
|
177
|
+
if (!this[vueKey]) return findSource;
|
|
178
|
+
|
|
179
|
+
let find = this[vueKey].find((s, i) => {
|
|
180
|
+
let result = false;
|
|
181
|
+
if (s && s.key === vueIndex) {
|
|
182
|
+
index = i;
|
|
183
|
+
result = true;
|
|
184
|
+
}
|
|
185
|
+
return result;
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
if (!source) {
|
|
189
|
+
find.source = source;
|
|
190
|
+
}
|
|
191
|
+
return find;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
changeOptions(vueKey, vueIndex, key, value) {
|
|
195
|
+
vueKey = vueKey ? vueKey : this.vueKey;
|
|
196
|
+
vueIndex = vueIndex ? vueIndex : this.vueIndex;
|
|
197
|
+
vueIndex = `${vueIndex}`;
|
|
198
|
+
let index = -1;
|
|
199
|
+
let findSource = undefined;
|
|
200
|
+
if (!this[vueKey]) return findSource;
|
|
201
|
+
|
|
202
|
+
let find = this[vueKey].find((s, i) => {
|
|
203
|
+
let result = false;
|
|
204
|
+
if (s && s.key === vueIndex) {
|
|
205
|
+
index = i;
|
|
206
|
+
result = true;
|
|
207
|
+
}
|
|
208
|
+
return result;
|
|
209
|
+
});
|
|
210
|
+
find.options = find.options || {};
|
|
211
|
+
find.options[key] = value;
|
|
212
|
+
|
|
213
|
+
return find;
|
|
214
|
+
}
|
|
215
|
+
|
|
148
216
|
findSource(vueKey, vueIndex) {
|
|
149
217
|
vueKey = vueKey ? vueKey : this.vueKey;
|
|
150
218
|
vueIndex = vueIndex ? vueIndex : this.vueIndex;
|
|
@@ -205,10 +273,20 @@ export class IgsDocLayerManager extends BaseManager {}
|
|
|
205
273
|
export class IgsTilecLayerManager extends BaseManager {}
|
|
206
274
|
export class IgsserverManager extends BaseManager {}
|
|
207
275
|
export class ExcavateAnalysisManager extends BaseManager {}
|
|
208
|
-
export class
|
|
276
|
+
export class FloodAnalysisManager extends BaseManager {}
|
|
209
277
|
export class MarkerManager extends BaseManager {}
|
|
210
278
|
export class AnalysisModelFlattenManager extends BaseManager {}
|
|
211
279
|
export class DynamicCuttingManager extends BaseManager {}
|
|
212
280
|
export class AnalysisManager extends BaseManager {}
|
|
213
281
|
export class HeightLimitedAnalysisManager extends BaseManager {}
|
|
214
282
|
export class shadowAnalysisManager extends BaseManager {}
|
|
283
|
+
export class IgsFeatureManager extends BaseManager {}
|
|
284
|
+
export class AspectAnalysisManager extends BaseManager {}
|
|
285
|
+
export class DynamicSectionAnalysisManager extends BaseManager {}
|
|
286
|
+
export class SlopeAnalysisManager extends BaseManager {}
|
|
287
|
+
export class SkyLineAnalysisManager extends BaseManager {}
|
|
288
|
+
export class ContourAnalysisManager extends BaseManager {}
|
|
289
|
+
export class ViewshedAnalysisManager extends BaseManager {}
|
|
290
|
+
export class VisiblityAnalysisManager extends BaseManager {}
|
|
291
|
+
export class CutFillAnalysisManager extends BaseManager {}
|
|
292
|
+
export class ProfileAnalysisManager extends BaseManager {}
|
|
@@ -67,14 +67,16 @@ export default {
|
|
|
67
67
|
|
|
68
68
|
$scriptMain.src =
|
|
69
69
|
this.libPath ||
|
|
70
|
-
|
|
70
|
+
window.VueCesiumLibPath ||
|
|
71
|
+
"http://develop.smaryun.com/static/libs/cdn/cesium/Cesium.js";
|
|
71
72
|
|
|
72
73
|
return new Promise(resolve => {
|
|
73
74
|
$scriptMain.onload = () => {
|
|
74
75
|
if (global.Cesium) {
|
|
75
76
|
$scriptPlugin.src =
|
|
76
77
|
self.pluginPath ||
|
|
77
|
-
|
|
78
|
+
window.VueCesiumPluginPath ||
|
|
79
|
+
"http://develop.smaryun.com/static/libs/cdn/zondyclient/webclient-cesium-plugin.min.js";
|
|
78
80
|
$scriptPlugin.onload = () => {
|
|
79
81
|
if (global.Cesium) {
|
|
80
82
|
self.globalLoad = true;
|
|
@@ -49,3 +49,176 @@ export function dirname(path) {
|
|
|
49
49
|
}
|
|
50
50
|
return path.slice(0, end);
|
|
51
51
|
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* RGB/RGBA转Cesium内部颜色值
|
|
55
|
+
* @param color rgb/rgba字符串
|
|
56
|
+
* @returns {*}
|
|
57
|
+
*/
|
|
58
|
+
export function colorToCesiumColor(color, webGlobe) {
|
|
59
|
+
let cesiumColor;
|
|
60
|
+
if (color.includes("rgb")) {
|
|
61
|
+
// 如果是rgb或者rgba
|
|
62
|
+
const a = color.split("(")[1].split(")")[0];
|
|
63
|
+
const arr = a.split(",");
|
|
64
|
+
const cesiumRed = Number((Number(arr[0]) / 255).toFixed(2));
|
|
65
|
+
const cesiumGreen = Number((Number(arr[1]) / 255).toFixed(2));
|
|
66
|
+
const cesiumBlue = Number((Number(arr[2]) / 255).toFixed(2));
|
|
67
|
+
const cesiumAlpha = Number(arr[3] ? arr[3] : 1);
|
|
68
|
+
cesiumColor = webGlobe.getColor(
|
|
69
|
+
cesiumRed,
|
|
70
|
+
cesiumGreen,
|
|
71
|
+
cesiumBlue,
|
|
72
|
+
cesiumAlpha
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
return cesiumColor;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* 获取当前摄像机的位置
|
|
80
|
+
* @returns {null|{lng: number, lat: number, height: *}}
|
|
81
|
+
*/
|
|
82
|
+
export function getCenterPosition(webGlobe) {
|
|
83
|
+
const lnglat = getCartographic(webGlobe);
|
|
84
|
+
if (lnglat) {
|
|
85
|
+
const { longitude, latitude } = lnglat;
|
|
86
|
+
const pi = Math.PI;
|
|
87
|
+
const lng = (longitude * 180) / pi;
|
|
88
|
+
const lat = (latitude * 180) / pi;
|
|
89
|
+
const height = getCameraHeight(webGlobe);
|
|
90
|
+
return {
|
|
91
|
+
lng,
|
|
92
|
+
lat,
|
|
93
|
+
height
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* 获取地理坐标
|
|
101
|
+
* @returns 地理坐标
|
|
102
|
+
*/
|
|
103
|
+
export function getCartographic(webGlobe) {
|
|
104
|
+
console.log("Cesium", Cesium);
|
|
105
|
+
const pickEllipsoid = getPickEllipsoid(webGlobe);
|
|
106
|
+
return pickEllipsoid
|
|
107
|
+
? Cesium.Ellipsoid.WGS84.cartesianToCartographic(pickEllipsoid)
|
|
108
|
+
: null;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 获取椭球坐标
|
|
113
|
+
* @returns height
|
|
114
|
+
*/
|
|
115
|
+
export function getPickEllipsoid(webGlobe) {
|
|
116
|
+
const { w, h } = getWebGlobeCanvasSize(webGlobe);
|
|
117
|
+
return webGlobe.viewer.camera.pickEllipsoid(
|
|
118
|
+
new Cesium.Cartesian2(w / 2, h / 2)
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* 获取三维场景画布高宽
|
|
124
|
+
* @returns {w:number; h: number}
|
|
125
|
+
*/
|
|
126
|
+
export function getWebGlobeCanvasSize(webGlobe) {
|
|
127
|
+
const { canvas } = webGlobe.viewer;
|
|
128
|
+
return {
|
|
129
|
+
w: canvas.clientWidth,
|
|
130
|
+
h: canvas.clientHeight
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* 获取camera高度
|
|
136
|
+
* @returns height
|
|
137
|
+
*/
|
|
138
|
+
export function getCameraHeight(webGlobe) {
|
|
139
|
+
const { viewer } = webGlobe;
|
|
140
|
+
return viewer
|
|
141
|
+
? viewer.scene.globe.ellipsoid.cartesianToCartographic(
|
|
142
|
+
viewer.camera.position
|
|
143
|
+
).height
|
|
144
|
+
: 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* 判断当前是否开启了对数深度缓存区
|
|
149
|
+
* @returns true:开启,false:关闭
|
|
150
|
+
*/
|
|
151
|
+
export function isLogarithmicDepthBufferEnable(webGlobe) {
|
|
152
|
+
return webGlobe.viewer.scene.logarithmicDepthBuffer;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* 设置是否开启对数深度缓存区
|
|
157
|
+
* @param {*} isEnable true:开启,false:关闭
|
|
158
|
+
*/
|
|
159
|
+
export function setLogarithmicDepthBufferEnable(isEnable, webGlobe) {
|
|
160
|
+
webGlobe.viewer.scene.logarithmicDepthBuffer = isEnable;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* 判断当前是否开启了深度检测
|
|
165
|
+
* @returns true:开启,false:关闭
|
|
166
|
+
*/
|
|
167
|
+
export function isDepthTestAgainstTerrainEnable(webGlobe) {
|
|
168
|
+
return webGlobe.viewer.scene.globe.depthTestAgainstTerrain;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* 设置是否开启深度检测
|
|
173
|
+
* @param {*} isEnable true:开启,false:关闭
|
|
174
|
+
*/
|
|
175
|
+
export function setDepthTestAgainstTerrainEnable(isEnable, webGlobe) {
|
|
176
|
+
webGlobe.viewer.scene.globe.depthTestAgainstTerrain = isEnable;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* 判断当前是否开启了光照
|
|
181
|
+
* @returns true:开启,false:关闭
|
|
182
|
+
*/
|
|
183
|
+
export function isEnableLighting(webGlobe) {
|
|
184
|
+
return webGlobe.viewer.scene.globe.enableLighting;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* 设置光照
|
|
189
|
+
* @param {*} isEnable true:开启,false:关闭
|
|
190
|
+
*/
|
|
191
|
+
export function setEnableLighting(isEnable, webGlobe) {
|
|
192
|
+
webGlobe.viewer.scene.globe.enableLighting = isEnable;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* 获取光照对象
|
|
197
|
+
* @returns brightness对象
|
|
198
|
+
*/
|
|
199
|
+
export function getBrightness(webGlobe) {
|
|
200
|
+
return webGlobe.viewer.scene.brightness;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* 获取光照对象的开启状态和Uniforms的brightness参数
|
|
205
|
+
* @returns this.webGlobe.viewer.scene.brightness的enabled和uniforms.brightness值
|
|
206
|
+
*/
|
|
207
|
+
export function getBrightnessStatusAndUniformsBrightness(webGlobe) {
|
|
208
|
+
const { enabled, uniforms } = webGlobe.viewer.scene.brightness;
|
|
209
|
+
const { brightness } = uniforms;
|
|
210
|
+
return { enabled, brightness };
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* 设置光照对象的开启状态和Uniforms的brightness参数
|
|
215
|
+
* @param {*} { enabled, brightness } this.webGlobe.viewer.scene.brightness的enabled和uniforms.brightness值组成的数组
|
|
216
|
+
*/
|
|
217
|
+
export function setBrightnessStatusAndUniformsBrightness(
|
|
218
|
+
{ enabled, brightness },
|
|
219
|
+
webGlobe
|
|
220
|
+
) {
|
|
221
|
+
const sceneBrightness = webGlobe.viewer.scene.brightness;
|
|
222
|
+
sceneBrightness.enabled = enabled;
|
|
223
|
+
sceneBrightness.uniforms.brightness = brightness;
|
|
224
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<mapgis-ui-comprehensive-query
|
|
4
|
+
:geoJSONExtent="geoJSONExtent"
|
|
5
|
+
:logo="logo"
|
|
6
|
+
:districtName="districtName"
|
|
7
|
+
:widgetInfo="widgetInfo"
|
|
8
|
+
:defaultMarkerIcon="defaultMarkerIcon"
|
|
9
|
+
:selectedMarkerIcon="selectedMarkerIcon"
|
|
10
|
+
@onClose="onClose"
|
|
11
|
+
@onSearch="onSearch"
|
|
12
|
+
@current-result="currentResult"
|
|
13
|
+
@select-markers="selectMarkers"
|
|
14
|
+
@click-item="clickItem"
|
|
15
|
+
@change-cluster="changeCluster"
|
|
16
|
+
@open-attribute-table="openAttributeTable"
|
|
17
|
+
@remove-attribute-table="removeAttributeTable"
|
|
18
|
+
@color-cluster="setColorCluster"
|
|
19
|
+
>
|
|
20
|
+
</mapgis-ui-comprehensive-query>
|
|
21
|
+
<place-name-cesium
|
|
22
|
+
:defaultMarkerIcon="defaultMarkerIcon"
|
|
23
|
+
:selectedMarkerIcon="selectedMarkerIcon"
|
|
24
|
+
:hoverMarker="hoverMarker"
|
|
25
|
+
:cluster="cluster"
|
|
26
|
+
:geojson="current"
|
|
27
|
+
:colorCluster="colorCluster"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import * as Feature from "./util/feature";
|
|
34
|
+
import PlaceNameCesium from "./PlaceNameCesium";
|
|
35
|
+
|
|
36
|
+
export default {
|
|
37
|
+
name: "mapgis-3d-comprehensive-query",
|
|
38
|
+
components: { PlaceNameCesium },
|
|
39
|
+
inject: ["Cesium", "CesiumZondy", "webGlobe"],
|
|
40
|
+
props: {
|
|
41
|
+
logo: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: ""
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* 默认图标
|
|
47
|
+
*/
|
|
48
|
+
defaultMarkerIcon: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: ""
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* 选中图标
|
|
54
|
+
*/
|
|
55
|
+
selectedMarkerIcon: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: ""
|
|
58
|
+
},
|
|
59
|
+
districtName: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ""
|
|
62
|
+
},
|
|
63
|
+
geoJSONExtent: {
|
|
64
|
+
type: Object,
|
|
65
|
+
default: () => ({})
|
|
66
|
+
},
|
|
67
|
+
widgetInfo: {
|
|
68
|
+
type: Object,
|
|
69
|
+
default: () => ({})
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
data() {
|
|
73
|
+
return {
|
|
74
|
+
/**
|
|
75
|
+
* 是否开启聚合标注
|
|
76
|
+
*/
|
|
77
|
+
cluster: false,
|
|
78
|
+
colorCluster: "",
|
|
79
|
+
/**
|
|
80
|
+
* 查询的结果
|
|
81
|
+
*/
|
|
82
|
+
current: { type: "FeatureCollection", features: [] },
|
|
83
|
+
/**
|
|
84
|
+
* 鼠标移入的marker
|
|
85
|
+
*/
|
|
86
|
+
hoverMarker: [],
|
|
87
|
+
/**
|
|
88
|
+
* 行政区范围
|
|
89
|
+
*/
|
|
90
|
+
district: null
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
methods: {
|
|
94
|
+
/**
|
|
95
|
+
* 点击关闭的回调函数
|
|
96
|
+
*/
|
|
97
|
+
onClose() {
|
|
98
|
+
this.$emit("onClose");
|
|
99
|
+
},
|
|
100
|
+
/**
|
|
101
|
+
* 查询时的回调函数(在没有查询范围时,采用当前屏幕的范围)
|
|
102
|
+
*/
|
|
103
|
+
onSearch() {
|
|
104
|
+
this.$emit("onSearch");
|
|
105
|
+
},
|
|
106
|
+
/**
|
|
107
|
+
* 设置聚合图标的颜色
|
|
108
|
+
*/
|
|
109
|
+
setColorCluster(color) {
|
|
110
|
+
this.colorCluster = color;
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* 当前展示的结果回调函数(将查询结果展示至地图上)
|
|
114
|
+
*/
|
|
115
|
+
currentResult(geojson) {
|
|
116
|
+
this.current = geojson;
|
|
117
|
+
},
|
|
118
|
+
/**
|
|
119
|
+
* 当前点击的条目的回调函数(实现点击后跳转中心点)
|
|
120
|
+
*/
|
|
121
|
+
clickItem(feature) {
|
|
122
|
+
const center = Feature.getGeoJSONFeatureCenter(feature);
|
|
123
|
+
this.webGlobe.flyTo(center[0], center[1]);
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* 当前选中的坐标
|
|
128
|
+
*/
|
|
129
|
+
selectMarkers(selectMarkers) {
|
|
130
|
+
this.hoverMarker = selectMarkers;
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* 聚合按钮改变时的回调
|
|
135
|
+
*/
|
|
136
|
+
changeCluster(val) {
|
|
137
|
+
this.current = { type: "FeatureCollection", features: [] };
|
|
138
|
+
this.cluster = val;
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* 打开属性表回调函数
|
|
143
|
+
*/
|
|
144
|
+
openAttributeTable(exhibition) {
|
|
145
|
+
this.$emit("open-attribute-table", exhibition);
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* 关闭属性表回调函数
|
|
150
|
+
*/
|
|
151
|
+
removeAttributeTable(exhibitionId) {
|
|
152
|
+
this.$emit("remove-attribute-table", exhibitionId);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
</script>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<mapgis-3d-dynamic-marker-layer
|
|
4
|
+
v-if="!cluster"
|
|
5
|
+
:data="geojson"
|
|
6
|
+
:selects="hoverMarker"
|
|
7
|
+
:highlight="false"
|
|
8
|
+
:layerStyle="layerStyle"
|
|
9
|
+
:highlightStyle="highlightStyle"
|
|
10
|
+
idField="markerId"
|
|
11
|
+
/>
|
|
12
|
+
<!-- 聚合标注专题图 -->
|
|
13
|
+
<mapgis-3d-mapv-layer
|
|
14
|
+
v-else-if="
|
|
15
|
+
geojson &&
|
|
16
|
+
geojson.features &&
|
|
17
|
+
geojson.features.length > 0 &&
|
|
18
|
+
colorCluster
|
|
19
|
+
"
|
|
20
|
+
:geojson="geojson"
|
|
21
|
+
:options="options"
|
|
22
|
+
count-field="count"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
import { Style } from "@mapgis/webclient-es6-service";
|
|
29
|
+
const { MarkerStyle, LineStyle, PointStyle, FillStyle } = Style;
|
|
30
|
+
export default {
|
|
31
|
+
name: "place-name-cesium",
|
|
32
|
+
inject: ["Cesium", "CesiumZondy", "webGlobe"],
|
|
33
|
+
props: {
|
|
34
|
+
selectedMarkerIcon: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ""
|
|
37
|
+
},
|
|
38
|
+
defaultMarkerIcon: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: ""
|
|
41
|
+
},
|
|
42
|
+
cluster: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
colorCluster: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: ""
|
|
49
|
+
},
|
|
50
|
+
geojson: {
|
|
51
|
+
type: Object,
|
|
52
|
+
default: () => ({})
|
|
53
|
+
},
|
|
54
|
+
hoverMarker: {
|
|
55
|
+
type: Array,
|
|
56
|
+
default: () => []
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
computed: {
|
|
60
|
+
layerStyle() {
|
|
61
|
+
return new MarkerStyle({
|
|
62
|
+
symbol: this.defaultMarkerIcon
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
highlightStyle() {
|
|
66
|
+
return {
|
|
67
|
+
enableHoverMarker: false,
|
|
68
|
+
enableHoverFeature: false,
|
|
69
|
+
marker: new MarkerStyle({
|
|
70
|
+
symbol: this.selectedMarkerIcon
|
|
71
|
+
}),
|
|
72
|
+
point: new PointStyle(),
|
|
73
|
+
line: new LineStyle(),
|
|
74
|
+
polygon: new FillStyle()
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
options() {
|
|
78
|
+
return {
|
|
79
|
+
fillStyle: this.colorCluster,
|
|
80
|
+
size: 50 / 3 / 2, // 非聚合点的半径
|
|
81
|
+
minSize: 8, // 聚合点最小半径
|
|
82
|
+
maxSize: 31, // 聚合点最大半径
|
|
83
|
+
globalAlpha: 0.8, // 透明度
|
|
84
|
+
clusterRadius: 150, // 聚合像素半径
|
|
85
|
+
maxClusterZoom: 18, // 最大聚合的级别
|
|
86
|
+
maxZoom: 19, // 最大显示级别
|
|
87
|
+
minPoints: 5, // 最少聚合点数,点数多于此值才会被聚合
|
|
88
|
+
extent: 400, // 聚合的细腻程度,越高聚合后点越密集
|
|
89
|
+
label: {
|
|
90
|
+
// 聚合文本样式
|
|
91
|
+
show: true, // 是否显示
|
|
92
|
+
fillStyle: "white"
|
|
93
|
+
},
|
|
94
|
+
gradient: { 0: "blue", 0.5: "yellow", 1.0: "rgb(255,0,0)" }, // 聚合图标渐变色
|
|
95
|
+
cesium: { postRender: true, postRenderFrame: 0 },
|
|
96
|
+
draw: "cluster",
|
|
97
|
+
context: "2d"
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
</script>
|