<template>
<div id="vue-cesium"></div>
</template>
<script>
export default {
data() {
return {
tk: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjOTAwOGZhNy04MzE4LTQ4MjgtODQ4Ni0wNjBkNWUyNmE4NWQiLCJpZCI6MTU2NzgxLCJpYXQiOjE2OTA0NDQzNDR9.IzChoJZqHdsGiLeUhE_U0HAy3vbWWD1w2B-YoJwJ2ZU',
viewer: null
}
},
mounted() {
Cesium.Ion.defaultAccessToken = this.tk;
this.viewer = new Cesium.Viewer('vue-cesium', {
animation: false,
baseLayerPicker: true,
geocoder: true,
timeline: false,
sceneModePicker: true,
navigationHelpButton: false,
infoBox: true,
});
}
}
</script>
<style scoped>
#vue-cesium {
width: 1920px;
height: 1080px;
position: relative;
}
</style>
参考
https://www.jianshu.com/p/5c36d9d1b69c