获取 AccessToken
代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>cesium 右键菜单</title>
<script src="https://cesiumjs.org/releases/1.51/Build/Cesium/Cesium.js"></script>
<link href="https://cesiumjs.org/releases/1.51/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
<style>
html,body,#cesiumContainer{
padding: 0;
margin: 0;
width:100%;height:100%
}
ul,li{
padding: 0;
margin: 0;
}
.contextmenu-ul{
background: rgba(43,44,47,.6);
border: 1px solid #2b2c2f;
min-width: 110px;
list-style: none;
font-size: 14px;
}
.contextmenu-ul a{
border-bottom: 1px solid rgba(128, 128, 128, 0.5);
padding: 6px 10px;
transition: background-color .25s;
display: block;
clear: both;
font-weight: 400;
line-height: 1.6;
white-space: nowrap;
color: #edffff;
text-decoration: none;
}
.contextmenu-ul li:last-child a{
border-bottom:none;
}
.contextmenu-ul a:hover{
background-color: #444d59;
color: #fff;
text-decoration: none;
}
</style>
</head>
<body>
<div id="cesiumContainer"></div>
<script>
Cesium.Ion.defaultAccessToken = '你的秘钥';
var viewer = new Cesium.Viewer('cesiumContainer',{
geocoder: false,
sceneModePicker: false,
navigationHelpButton: false,
baseLayerPicker: false,
homeButton: false,
fullscreenButton: false,
timeline:false,
animation:false,
});
viewer.cesiumWidget.creditContainer.style.display = "none";
var cesiumContainer = document.querySelector(