h20_rotatePoint.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0" />
  6. <meta name="author" content="火星科技 http://mars3d.cn " />
  7. <meta name="apple-touch-fullscreen" content="yes" />
  8. <meta name="apple-mobile-web-app-capable" content="yes" />
  9. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  10. <meta name="format-detection" content="telephone=no" />
  11. <meta name="x5-fullscreen" content="true" />
  12. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
  13. <!-- 标题及搜索关键字 -->
  14. <meta name="keywords" content="火星科技,cesium,3D,GIS,marsgis,三维,地球,地图,开发,框架,系统,示例,资料,模型,离线,外包,合肥,安徽,中国" />
  15. <meta
  16. name="description"
  17. content="火星科技 合肥火星 合肥火星科技 合肥火星科技有限公司 leaflet leaflet框架 leaflet开发 cesium cesium开发 cesium框架 三维 地球 模型 gis marsgis 地图离线 地图开发 地图框架 地图外包 框架 开发 外包 地图离线 二维地图 三维地图 全景漫游 地理信息系统 云GIS 三维GIS GIS平台 WebGIS"
  18. />
  19. <link rel="shortcut icon" type="image/x-icon" href="" />
  20. <title>绕点环绕飞行 </title>
  21. <!--第三方lib-->
  22. <script
  23. type="text/javascript"
  24. src="../lib/include-lib.js"
  25. libpath="../lib/"
  26. include="jquery,font-awesome,bootstrap,layer,haoutil,turf,mars3d"
  27. ></script>
  28. <link href="css/style.css" rel="stylesheet" />
  29. </head>
  30. <body class="dark">
  31. <!--加载前进行操作提示,优化用户体验-->
  32. <div id="mask" class="signmask" onclick="removeMask()"></div>
  33. <div id="mars3dContainer" class="mars3d-container"></div>
  34. <!-- 面板 -->
  35. <div class="infoview">
  36. <input id="btnStart" type="button" class="btn btn-primary" value="开始" />
  37. <input id="btnStop" type="button" class="btn btn-primary" value="停止" />
  38. </div>
  39. <script src="./js/common.js"></script>
  40. <script type="text/javascript">
  41. "use script"; //开发环境建议开启严格模式
  42. var map;
  43. var rotatePoint;
  44. function initMap(options) {
  45. //合并属性参数,可覆盖config.json中的对应配置
  46. var mapOptions = mars3d.Util.merge(options, {
  47. scene: {
  48. center: { lat: 30.851782, lng: 116.350493, alt: 7944, heading: 348, pitch: -31 },
  49. },
  50. });
  51. //创建三维地球场景
  52. map = new mars3d.Map("mars3dContainer", mapOptions);
  53. rotatePoint = new mars3d.thing.RotatePoint({
  54. direction: false, //方向 true逆时针,false顺时针
  55. time: 50, //给定飞行一周所需时间(单位 秒),控制速度
  56. // autoStopAngle: 360, //到达指定角度后自动停止
  57. });
  58. map.addThing(rotatePoint);
  59. //开启旋转
  60. rotatePoint.start();
  61. $("#btnStart").click(function () {
  62. // 获取当前视角
  63. var point = map.getCenter();
  64. rotatePoint.start(point); //可以传指定的中心点坐标
  65. });
  66. $("#btnStop").click(function () {
  67. rotatePoint.stop();
  68. });
  69. }
  70. </script>
  71. </body>
  72. </html>