cesium 右键菜单

获取 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 秘钥
        Cesium.Ion.defaultAccessToken = '你的秘钥';
        var viewer = new Cesium.Viewer('cesiumContainer',{
   
   
            geocoder: false,                //是否显示地名查找控件
            sceneModePicker: false,         //是否显示投影方式控件
            navigationHelpButton: false,    //是否显示帮助信息控件
            baseLayerPicker: false,         //是否显示图层选择控件
            homeButton: false,              //是否显示Home按钮
            fullscreenButton: false,        //是否显示全屏按钮    
            timeline:false,                 //时间轴控件 
            animation:false,                //动画控件 
        });

        //去cesium logo水印 或 css
        viewer.cesiumWidget.creditContainer.style.display = "none";//去cesium logo水印

        var cesiumContainer = document.querySelector(
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值