a10_createMap_viewer.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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>原生Cesium来创建地球 </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. <div id="mars3dContainer" class="mars3d-container"></div>
  32. <script type="text/javascript">
  33. "use script"; //开发环境建议开启严格模式
  34. $(document).ready(function () {
  35. if (!mars3d.Util.webglreport()) {
  36. mars3d.Util.webglerror();
  37. return;
  38. }
  39. initMap();
  40. });
  41. function initMap() {
  42. //与超图结合示例: https://github.com/marsgis/mars3d-link-supermap
  43. //与earthsdk结合示例: https://github.com/marsgis/mars3d-link-earthsdk
  44. //构造地球(可以使用原生Cesium或第3方SDK方式去构造Viewer)
  45. var viewer = new Cesium.Viewer("mars3dContainer", {
  46. animation: false,
  47. timeline: false,
  48. infoBox:false,
  49. baseLayerPicker: false, //是否显示图层选择控件
  50. imageryProvider: new Cesium.TileMapServiceImageryProvider({
  51. url: Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"),
  52. }),
  53. });
  54. //mars3d.Map也可以直接传入外部已经构造好的viewer, 支持config.json所有参数
  55. var map = new mars3d.Map(viewer, {
  56. scene: {
  57. center: { lat: 30.054604, lng: 108.885436, alt: 17036414, heading: 0, pitch: -90 },
  58. fxaa: true,
  59. },
  60. control: {
  61. defaultContextMenu: true, //右键菜单
  62. },
  63. });
  64. //cesium对应的原始地球对象
  65. // var viewer = map.viewer
  66. }
  67. </script>
  68. </body>
  69. </html>