首页 新闻 会员 周边

SuperMap Vue2的开发案例

0
悬赏园豆:10 [已解决问题] 解决于 2022-07-06 13:09

Supermap 的Vue版本这些组件怎么导入?

<template>
<sm-viewer>
  </sm-viewer>
</template>

<script>

export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App'
    }
  },
  mounted () {
//这个viewer 、Cesium 怎么导入?官方example都跑不起来
    viewer.scene.camera.setView({
      destination: new Cesium.Cartesian3(-1206939.1925299785, 5337998.241228442, 3286279.2424502545),
      orientation: {
        heading: 1.4059101895600987,
        pitch: -0.20917672793046682,
        roll: 2.708944180085382e-13
      }
    })
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>

echo_lovely的主页 echo_lovely | 小虾三级 | 园豆:1433
提问于:2022-07-06 09:05
< >
分享
最佳答案
0
<template>
  <div class="hello">
    <div id="cesiumContainer"></div>
  </div>
</template>

<script>
console.log(window)
let Cesium = window.Cesium

export default {
  name: 'HelloWorld',
  mounted () {
    window.viewer = new Cesium.Viewer('cesiumContainer')
    let scene = window.viewer.scene

    scene.camera.setView({
      // 将经度、纬度、高度的坐标转换为笛卡尔坐标
      destination: new Cesium.Cartesian3(-2653915.6463913363, 3571045.726807149, 4570293.566342328),
      orientation: {
        heading: 2.1953426301495345,
        pitch: -0.33632707158103625,
        roll: 6.283185307179586
      }
    })
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
#cesiumContainer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  margin: 0;
  overflow: hidden;
  padding: 0;
  font-family: sans-serif;
}
</style>

echo_lovely | 小虾三级 |园豆:1433 | 2022-07-06 13:08

这个可以有小地球

echo_lovely | 园豆:1433 (小虾三级) | 2022-07-06 13:09
其他回答(1)
0
收获园豆:10
顾星河 | 园豆:7173 (大侠五级) | 2022-07-06 11:51

不中

支持(0) 反对(0) echo_lovely | 园豆:1433 (小虾三级) | 2022-07-06 13:07

我就对着这个整的

支持(0) 反对(0) echo_lovely | 园豆:1433 (小虾三级) | 2022-07-06 13:07
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册