Newer
Older
XinYang_SanWei+RongYun / src / views / HelloWorld.vue
@张强云笔记本 张强云笔记本 on 21 Dec 2021 1 KB 测试提交
<!-- 热力图渲染 -->
<template>
  <div id="CesiumContainer"></div>
</template>

<script>
import qs from "qs";

export default {
  data() {
    return {
      earth: "",
    };
  },
  components: {},
  computed: {},
  mounted() {
    this.init();
  },
  methods: {
    init() {
      // Cesium.Ion.defaultAccessToken =
      //   "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2YjcwZmQzNS1hODBiLTQzNjAtYjI0NC1kY2JkNzFhMGQwZmEiLCJpZCI6MzY5NDksImlhdCI6MTYwNDM3MjQwNn0.Ckrquc_lnL8T4CGKuxmUieS9k2VxdGX9ADL1_I0J4uQ";

      // // 默认定位到中国上空
      // Cesium.Camera.DEFAULT_VIEW_RECTANGLE = new Cesium.Rectangle.fromDegrees(
      //   90,
      //   -20,
      //   110,
      //   90
      // );

      // gis地图服务,第一种添加地图图层的方式
      // let gisMap = new Cesium.ArcGisMapServerImageryProvider({
      //   url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
      // });

      let viewer = new Cesium.Viewer("CesiumContainer", {
        // imageryProvider: gisMap,
        navigation: false,
        animation: false, // 隐藏动画控件
        baseLayerPicker: false, // 隐藏图层选择控件
        fullscreenButton: false, // 隐藏全屏按钮
        vrButton: false, // 隐藏VR按钮,默认false
        geocoder: false, // 隐藏地名查找控件
        homeButton: false, // 隐藏Home按钮
        navigationHelpButton: false, // 隐藏帮助按钮
        infoBox: false, //是否显示信息框
        fullscreenButton: false, //是否显示全屏按钮
        animation: false, //是否创建动画小器件,左下角仪表
        timeline: false, //是否显示时间轴
        selectionIndicator: false, //关闭点击绿色框
        scene3DOnly: true, // 每个几何实例将只在3D中呈现,以节省GPU内存
      });

      this.earth = viewer;
      // this.renderHeatmap()
    },
  },
};
</script>

<style scoped>
#CesiumContainer {
  width: 100%;
  height: 100%;
}
</style>