|
@@ -99,7 +99,6 @@ import ModelUnpack from "@/components/modelUnpack.vue";
|
|
|
import menuCom from "./menuCom.vue";
|
|
|
import { getTempData, getBaiduTempData, getWWTempData } from "@/api/index.js";
|
|
|
|
|
|
-
|
|
|
export default {
|
|
|
name: "CesiumMap",
|
|
|
|
|
@@ -162,7 +161,7 @@ export default {
|
|
|
showtempImg: false,
|
|
|
handlerAction: null,
|
|
|
sidebarRightData: null,
|
|
|
- imageryProviderV: null
|
|
|
+ imageryProviderV: null,
|
|
|
};
|
|
|
},
|
|
|
|
|
@@ -232,47 +231,47 @@ export default {
|
|
|
// 39.23
|
|
|
// );
|
|
|
|
|
|
- // const cesiumOptions = {
|
|
|
- // geocoder: false, // 地址搜索控件
|
|
|
- // homeButton: false, // 返回地图初始位置控件
|
|
|
- // infoBox: false, // 地图默认的信息控件
|
|
|
- // sceneModePicker: false, // 场景模式切换控件
|
|
|
- // baseLayerPicker: false, // 底图切换控件
|
|
|
- // navigationHelpButton: false, // 帮助控件
|
|
|
- // animation: false, // 动画控制控件
|
|
|
- // timeline: false, // 时间线控件
|
|
|
- // fullscreenButton: false, // 全屏按钮控件
|
|
|
- // // imageryProvider: false, // 是否显示 Cesium 默认地图的底图
|
|
|
- // vrButton: false,
|
|
|
- // selectionIndicator: false,
|
|
|
- // shouldAnimate: true,
|
|
|
- // // terrain: Cesium.Terrain.fromWorldTerrain(),
|
|
|
- // // terrainProvider: new Cesium.CesiumTerrainProvider({
|
|
|
- // // url: "/static/layer.json", // 对应 public/terrain-data 目录
|
|
|
- // // requestVertexNormals: true, // 保留法线数据(光照效果)
|
|
|
- // // requestWaterMask: false, // 本地地形通常无水面效果(需自定义)
|
|
|
- // // }),
|
|
|
- // };
|
|
|
-
|
|
|
- // const viewer = new Cesium.Viewer("cesiumContainer", cesiumOptions);
|
|
|
-
|
|
|
- const viewer = new Cesium.Viewer("cesiumContainer", {
|
|
|
+ // const cesiumOptions = {
|
|
|
+ // geocoder: false, // 地址搜索控件
|
|
|
+ // homeButton: false, // 返回地图初始位置控件
|
|
|
+ // infoBox: false, // 地图默认的信息控件
|
|
|
+ // sceneModePicker: false, // 场景模式切换控件
|
|
|
+ // baseLayerPicker: false, // 底图切换控件
|
|
|
+ // navigationHelpButton: false, // 帮助控件
|
|
|
+ // animation: false, // 动画控制控件
|
|
|
+ // timeline: false, // 时间线控件
|
|
|
+ // fullscreenButton: false, // 全屏按钮控件
|
|
|
+ // // imageryProvider: false, // 是否显示 Cesium 默认地图的底图
|
|
|
+ // vrButton: false,
|
|
|
+ // selectionIndicator: false,
|
|
|
+ // shouldAnimate: true,
|
|
|
+ // // terrain: Cesium.Terrain.fromWorldTerrain(),
|
|
|
+ // // terrainProvider: new Cesium.CesiumTerrainProvider({
|
|
|
+ // // url: "/static/layer.json", // 对应 public/terrain-data 目录
|
|
|
+ // // requestVertexNormals: true, // 保留法线数据(光照效果)
|
|
|
+ // // requestWaterMask: false, // 本地地形通常无水面效果(需自定义)
|
|
|
+ // // }),
|
|
|
+ // };
|
|
|
+
|
|
|
+ // const viewer = new Cesium.Viewer("cesiumContainer", cesiumOptions);
|
|
|
+
|
|
|
+ const viewer = new Cesium.Viewer("cesiumContainer", {
|
|
|
// terrainProvider: Cesium.createWorldTerrain(),
|
|
|
baseLayerPicker: false, //是否显示底图切换按钮
|
|
|
- animation: false,//是否显示动画控制按钮
|
|
|
+ animation: false, //是否显示动画控制按钮
|
|
|
vrButton: false,
|
|
|
- geocoder: false,//是否显示地理编码按钮
|
|
|
- homeButton: false,//是否显示地图导航按钮
|
|
|
+ geocoder: false, //是否显示地理编码按钮
|
|
|
+ homeButton: false, //是否显示地图导航按钮
|
|
|
infoBox: false,
|
|
|
- sceneModePicker: false,//是否显示场景模式切换按钮
|
|
|
+ sceneModePicker: false, //是否显示场景模式切换按钮
|
|
|
selectionIndicator: false,
|
|
|
- timeline: false,//是否显示时间轴
|
|
|
- fullscreenButton: false,//是否显示全屏按钮
|
|
|
+ timeline: false, //是否显示时间轴
|
|
|
+ fullscreenButton: false, //是否显示全屏按钮
|
|
|
navigationHelpButton: false,
|
|
|
shouldAnimate: true,
|
|
|
- imageryProvider: false //控制默认底图的显示
|
|
|
+ imageryProvider: false, //控制默认底图的显示
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
const imageryProvider = new Cesium.UrlTemplateImageryProvider({
|
|
|
// url: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
|
|
|
url: "http://192.168.2.180:3007/tiles/map/{z}/{x}/{y}",
|
|
@@ -284,7 +283,6 @@ export default {
|
|
|
|
|
|
viewer.imageryLayers.addImageryProvider(imageryProvider);
|
|
|
|
|
|
-
|
|
|
// 隐藏 Cesium Logo
|
|
|
viewer.cesiumWidget.creditContainer.style.display = "none";
|
|
|
|
|
@@ -797,7 +795,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
initresetViewport() {
|
|
|
- this.resetViewport1()
|
|
|
+ this.resetViewport1();
|
|
|
},
|
|
|
// 城市视角重置视角
|
|
|
resetViewport(height = 0) {
|
|
@@ -805,34 +803,34 @@ export default {
|
|
|
const that = this;
|
|
|
this.viewer.camera.flyTo({
|
|
|
destination: Cesium.Cartesian3.fromDegrees(
|
|
|
- //宁夏银川
|
|
|
- // 106.169866,
|
|
|
- // 38.46637,
|
|
|
- // height || 10000
|
|
|
-
|
|
|
- //北京
|
|
|
- 116.391586,
|
|
|
- 39.898832,
|
|
|
- 500
|
|
|
- // 106.2,
|
|
|
- // 38.467,
|
|
|
- // 15000.0
|
|
|
-
|
|
|
- // 113.3191,
|
|
|
- // 23.109,
|
|
|
- // 1000
|
|
|
-
|
|
|
- //上海
|
|
|
- // 121.47,
|
|
|
- // 31.23,
|
|
|
- // 1000
|
|
|
+ //宁夏银川
|
|
|
+ // 106.169866,
|
|
|
+ // 38.46637,
|
|
|
+ // height || 10000
|
|
|
+
|
|
|
+ //北京
|
|
|
+ 116.391586,
|
|
|
+ 39.898832,
|
|
|
+ height || 500
|
|
|
+ // 106.2,
|
|
|
+ // 38.467,
|
|
|
+ // 15000.0
|
|
|
+
|
|
|
+ // 113.3191,
|
|
|
+ // 23.109,
|
|
|
+ // 1000
|
|
|
+
|
|
|
+ //上海
|
|
|
+ // 121.47,
|
|
|
+ // 31.23,
|
|
|
+ // 1000
|
|
|
),
|
|
|
-
|
|
|
- orientation: {
|
|
|
- heading: 0, //北京天安门角度 0 上海角度 1
|
|
|
- pitch: -0.2,
|
|
|
- roll: 0,
|
|
|
- },
|
|
|
+
|
|
|
+ // orientation: {
|
|
|
+ // heading: 0, //北京天安门角度 0 上海角度 1
|
|
|
+ // pitch: -0.2,
|
|
|
+ // roll: 0,
|
|
|
+ // },
|
|
|
duration: 3,
|
|
|
// orientation: {
|
|
|
// heading: Cesium.Math.toRadians(0),
|
|
@@ -854,8 +852,8 @@ export default {
|
|
|
const that = this;
|
|
|
this.viewer.camera.flyTo({
|
|
|
destination: Cesium.Cartesian3.fromDegrees(
|
|
|
- 106.169866,
|
|
|
- 38.46637,
|
|
|
+ 106.169866,
|
|
|
+ 38.46637,
|
|
|
10000000
|
|
|
),
|
|
|
// orientation: {
|
|
@@ -940,7 +938,7 @@ export default {
|
|
|
|
|
|
this.viewer.imageryLayers.addImageryProvider(imageryProvider);
|
|
|
|
|
|
- this.imageryProviderV = imageryProvider
|
|
|
+ this.imageryProviderV = imageryProvider;
|
|
|
|
|
|
//调用云层底图
|
|
|
const cloudLayer = this.viewer.imageryLayers.addImageryProvider(
|
|
@@ -974,7 +972,7 @@ export default {
|
|
|
imageryProvider.contrast = 0.1; // 对比度
|
|
|
|
|
|
this.viewer.imageryLayers.addImageryProvider(imageryProvider);
|
|
|
- this.imageryProviderV = imageryProvider
|
|
|
+ this.imageryProviderV = imageryProvider;
|
|
|
|
|
|
// 调用降雨底图
|
|
|
const rainLayer = new Cesium.UrlTemplateImageryProvider({
|
|
@@ -999,7 +997,7 @@ export default {
|
|
|
imageryProvider.contrast = 0.1; // 对比度
|
|
|
|
|
|
this.viewer.imageryLayers.addImageryProvider(imageryProvider);
|
|
|
- this.imageryProviderV = imageryProvider
|
|
|
+ this.imageryProviderV = imageryProvider;
|
|
|
|
|
|
// 调用温度底图
|
|
|
const temperatureLayer = new Cesium.UrlTemplateImageryProvider({
|