<!--
|
* @Descripttion:
|
* @version: 1.0.0
|
* @Author: glc
|
* @Date: 2023-04-06 15:43:01
|
* @LastEditors: Andy
|
* @LastEditTime: 2023-04-13 14:54:15
|
-->
|
<template>
|
<div class="home">
|
<div id="sdkContainerEx"></div>
|
</div>
|
</template>
|
|
<script>
|
import Vue from "vue";
|
import * as SmartEarth from "../../../public/CimSDK/index.js";
|
export default {
|
name: "mapviewEx",
|
data() {
|
return {
|
tableStatus:false,
|
};
|
},
|
methods: {
|
init3DMap() {
|
window.Cesium = SmartEarth.Cesium;
|
window.SmartEarth = SmartEarth;
|
let imageryProvider = new SmartEarth.Cesium.TileMapServiceImageryProvider(
|
{
|
//url: "http://192.168.31.100:8082/gisserver/tmsserver/earth_tms",
|
url: "http://103.85.165.99:9001/gisserver/tmsserver/earth_tms",
|
}
|
);
|
window.sgworldEx = Vue.prototype.$earthCtrlEx = new SmartEarth.EarthCtrl(
|
"sdkContainerEx",
|
{
|
licenseServer: LICENSE_URL, //服务器地址
|
imageryProvider: imageryProvider,
|
StaticFileBaseUrl: "./CimSDK/",
|
shouldAnimate:true,
|
}
|
);
|
// 使用单张地图图片
|
// window.sgworldEx = Vue.prototype.$earthCtrlEx = new SmartEarth.SGWorld(
|
// "sdkContainerEx",
|
// Cesium,
|
// {
|
// licenseServer: LICENSE_URL,
|
// url: SmartEarthRootUrl + "Workers/image/earth.jpg", //不含单张地图图片url则使用在线地图
|
// }
|
// );
|
window.ViewerEx = sgworldEx._Viewer;
|
// sgworldEx.Navigate.Stop(); //取消飞行状态
|
sgworldEx.Navigate.jumpTo({
|
//跳转视角
|
destination: new Cesium.Cartesian3.fromDegrees(110, 32, 8000000),
|
});
|
$("#distanceLegendDiv").attr("id", "distanceLegendDiv2");
|
},
|
},
|
mounted() {
|
// this.init3DMap();
|
},
|
watch:{
|
"$store.state.tableStatus": function(newValue, oldValue) {
|
console.log("console0",newValue)
|
if(newValue) this.init3DMap()
|
else {window.ViewerEx && window.ViewerEx.destroy();window.ViewerEx = null}
|
}
|
},
|
};
|
</script>
|
|
<style scoped lang="less">
|
.home {
|
height: 100%;
|
width: 100%;
|
margin: 0px;
|
padding: 0px;
|
overflow: hidden;
|
|
#sdkContainerEx {
|
width: 100%;
|
height: 99%;
|
margin: 0;
|
overflow: hidden;
|
}
|
}
|
</style>
|