1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
| <template>
| <div id="mapdiv"></div>
| </template>
|
| <script>
| export default {
| name: '',
| data() {
| return {};
| },
| mounted() {
| this.init3DMap();
| },
| methods: {
| init3DMap() {
| window.sgworld = new SmartEarth.SGWorld('mapdiv', {
| url: '/SmartEarthSDK/Workers/image/earth.jpg',
| licenseServer: 'http://192.168.20.39/LFServer',
| });
| window.Viewer = sgworld._Viewer;
| sgworld.Navigate.Stop(); //取消飞行状态
| sgworld.Navigate.jumpTo({
| //跳转视角
| destination: new Cesium.Cartesian3.fromDegrees(110, 32, 8000000),
| });
| //显示fps
| sgworld._Viewer.scene.debugShowFramesPerSecond = false;
| //mpt添加
| var option = {
| url: 'http://183.162.245.49:82/SG/Elevation',
| layerName: 'zhufeng.397336.mpt',
| requestVertexNormals: true,
| };
| sgworld.Creator.sfsterrainprovider('', option, '', true, '');
| //导航控件
| document.getElementById('distanceLegendDiv').style.display = 'none';
| //比例尺
| sgworld.navControl('enableCompass', false);
| //sgworld.navControl("enableDistanceLegend", false);
| setTimeout(() => {}, 10000);
| },
| },
| };
| </script>
|
| <style scoped>
| #mapdiv {
| width: 100%;
| height: 100%;
| overflow: hidden;
| margin: 0;
| padding: 0;
| position: relative;
| }
| </style>
|
|