<template>
<div>
<div id="cesiumContainer" />
</div>
</template>
<script>
import { Viewer, Cartesian3, Color } from 'cesium/Cesium'
import 'cesium/Widgets/widgets.css'
export default {
name: 'CesiumViewer',
mounted () {
this.init()
},
methods: {
init () {
window.viewer = new Viewer('cesiumContainer', {
infoBox: false,
selectionIndicator: false,
shadows: true,
shouldAnimate: true
})
window.viewer.entities.add({
position: Cartesian3.fromDegrees(120.02444386482239, 30.244674682617188),
ellipse: {
semiMinorAxis: 25.0,
semiMajorAxis: 40.0,
height: 200.0,
fill: true,
material: '../../assets/flightcontrol/ball.png',
outline: true, // 必须设置height,否则ouline无法显示
outlineColor: Color.BLUE.withAlpha(0.5),
outlineWidth: 10.0// windows系统下不能设置固定为1