1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0" />
- <meta name="author" content="火星科技 http://mars3d.cn " />
- <meta name="apple-touch-fullscreen" content="yes" />
- <meta name="apple-mobile-web-app-capable" content="yes" />
- <meta name="apple-mobile-web-app-status-bar-style" content="black" />
- <meta name="format-detection" content="telephone=no" />
- <meta name="x5-fullscreen" content="true" />
- <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
- <!-- 标题及搜索关键字 -->
- <meta name="keywords" content="火星科技,cesium,3D,GIS,marsgis,三维,地球,地图,开发,框架,系统,示例,资料,模型,离线,外包,合肥,安徽,中国" />
- <meta
- name="description"
- content="火星科技 合肥火星 合肥火星科技 合肥火星科技有限公司 leaflet leaflet框架 leaflet开发 cesium cesium开发 cesium框架 三维 地球 模型 gis marsgis 地图离线 地图开发 地图框架 地图外包 框架 开发 外包 地图离线 二维地图 三维地图 全景漫游 地理信息系统 云GIS 三维GIS GIS平台 WebGIS"
- />
- <link rel="shortcut icon" type="image/x-icon" href="" />
- <title>control 控件 </title>
- <!--第三方lib-->
- <script
- type="text/javascript"
- src="../lib/include-lib.js"
- libpath="../lib/"
- include="jquery,font-awesome,bootstrap,layer,haoutil,turf,mars3d"
- ></script>
- <link href="css/style.css" rel="stylesheet" />
- </head>
- <body class="dark">
- <div id="mars3dContainer" class="mars3d-container"></div>
- <script type="text/javascript">
- "use script"; //开发环境建议开启严格模式
- $(document).ready(function () {
- if (!mars3d.Util.webglreport()) {
- mars3d.Util.webglerror();
- return;
- }
- initMap();
- });
- function initMap() {
- //添加控件有2种方式:
- //方式1:在创建地球前的传参中配置control参数
- var map = new mars3d.Map("mars3dContainer", {
- scene: {
- center: { lat: 33.938752, lng: 103.753712, alt: 18401000, heading: 0, pitch: -90 },
- },
- control: {
- //以下是Cesium.Viewer所支持的控件相关的options
- baseLayerPicker: true, //basemaps底图切换按钮
- homeButton: true, //视角复位按钮
- sceneModePicker: true, //二三维切换按钮
- navigationHelpButton: true, //帮助按钮
- infoBox: true, //信息框
- selectionIndicator: true, //选择框
- vrButton: true, //vr模式按钮
- fullscreenButton: true, //全屏按钮
- animation: true, //动画部件按钮
- timeline: true, //时间线
- geocoder: true, //POI查询按钮
- geocoderConfig: { key: ["ae29a37307840c7ae4a785ac905927e0"] }, //POI查询按钮参数配置
- //以下是mars3d.control定义的控件
- defaultContextMenu: true, //右键菜单
- mouseDownView: true,
- compass: { top: "10px", right: "5px" },
- distanceLegend: { left: "100px", bottom: "2px" },
- },
- basemaps: [
- {
- name: "单张图片",
- icon: "img/basemaps/offline.png",
- type: "image",
- url: "//data.mars3d.cn/file/img/world/world.jpg",
- show: true,
- },
- ],
- });
- //方式2:在创建地球后按需调用addControl添加(直接new对应type类型的控件)
- var locationBar = new mars3d.control.LocationBar({
- fps: true,
- template:
- "<div>经度:{lng}</div> <div>纬度:{lat}</div> <div>海拔:{alt}米</div> <div>层级:{level}</div><div>方向:{heading}度</div> <div>俯仰角:{pitch}度</div><div>视高:{cameraHeight}米</div>",
- });
- map.addControl(locationBar);
- }
- </script>
- </body>
- </html>
|