<template>
|
<div id="sdkContainer"></div>
|
</template>
|
|
<script>
|
export default {
|
name: "mapindex",
|
data() {
|
return {
|
earthimg: require("../../../assets/img/Map/earth.jpg")
|
}
|
},
|
methods: {
|
init3DMap() {
|
//初始化3D场景
|
let option = {
|
url: this.earthimg,
|
fullscreenButton: true,
|
infoBox: true,
|
selectionIndicator: true,
|
sceneModePicker: false,
|
minViewHeight: parseFloat(40),
|
contextOptions: {
|
failIfMajorPerformanceCaveat: false,
|
webgl: {
|
alpha: true,
|
preserveDrawingBuffer: true
|
}
|
}
|
};
|
|
//EPSG4326
|
// Cesium.ExpandBySmartEarth.Ellipsoid.z = 6356752.3142451793;
|
|
window.sgworld = new SmartEarth.SGWorld(
|
'sdkContainer',
|
Cesium,
|
option,
|
null,
|
function () {
|
sgworld.Navigate.jumpTo({
|
//跳转视角
|
destination: new Cesium.Cartesian3.fromDegrees(
|
117.321786,
|
38.4955423,
|
76968
|
)
|
});
|
});
|
window.Viewer = sgworld._Viewer;
|
// Viewer.imageryLayers.removeAll()
|
// 地球颜色
|
Viewer.scene.globe.baseColor = Cesium.Color.fromCssColorString('#27304a')
|
}
|
},
|
mounted() {
|
this.init3DMap();
|
// window.sgworld = new SmartEarth.SGWorld("sdkContainer", Cesium, "/SmartEarthSDK/Workers/image/earth.jpg", null, function () {
|
// });
|
// window.Viewer = sgworld._Viewer;
|
// sgworld.Navigate.Stop(); //取消飞行状态
|
// sgworld.Navigate.jumpTo({ //跳转视角
|
// destination: new Cesium.Cartesian3.fromDegrees(120.47058173784418, 31.793114225237154, 7709.279139522159),
|
// orientation: {
|
// heading: 0.6775942765589988,
|
// pitch: -0.6531148539291864
|
// }
|
// });
|
// //显示fps
|
// sgworld._Viewer.scene.debugShowFramesPerSecond = false;
|
//
|
// Viewer.imageryLayers.removeAll()
|
// // 地球颜色
|
// // Viewer.scene.globe.baseColor = Cesium.Color.fromCssColorString('#27304a')
|
// }
|
}
|
}
|
</script>
|
|
<style scoped>
|
#sdkContainer {
|
width: 100%;
|
height: 100%;
|
margin: 0;
|
padding: 0;
|
overflow: hidden;
|
}
|
</style>
|