f35_diffuseWall.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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="apple-touch-fullscreen" content="yes" />
  7. <meta name="apple-mobile-web-app-capable" content="yes" />
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  9. <meta name="format-detection" content="telephone=no" />
  10. <meta name="x5-fullscreen" content="true" />
  11. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
  12. <!-- 标题及搜索关键字 -->
  13. <meta name="keywords" content="火星科技,cesium,3D,GIS,marsgis,三维,地球,地图,开发,框架,系统,示例,资料,模型,离线,外包,合肥,安徽,中国" />
  14. <meta
  15. name="description"
  16. content="火星科技 合肥火星 合肥火星科技 合肥火星科技有限公司 leaflet leaflet框架 leaflet开发 cesium cesium开发 cesium框架 三维 地球 模型 gis marsgis 地图离线 地图开发 地图框架 地图外包 框架 开发 外包 地图离线 二维地图 三维地图 全景漫游 地理信息系统 云GIS 三维GIS GIS平台 WebGIS"
  17. />
  18. <link rel="shortcut icon" type="image/x-icon" href="" />
  19. <title>扩散围墙 </title>
  20. <script
  21. type="text/javascript"
  22. src="../lib/include-lib.js"
  23. libpath="../lib/"
  24. include="jquery,font-awesome,bootstrap,bootstrap-checkbox,layer,haoutil,turf,mars3d"
  25. ></script>
  26. <link href="css/style.css" rel="stylesheet" />
  27. </head>
  28. <body class="dark">
  29. <!--加载前进行操作提示,优化用户体验-->
  30. <div id="mask" class="signmask" onclick="removeMask()"></div>
  31. <div id="mars3dContainer" class="mars3d-container"></div>
  32. <div class="infoview">
  33. <div>
  34. 图层状态:
  35. <div class="checkbox checkbox-primary checkbox-inline">
  36. <input id="chkPopup" class="styled" type="checkbox" checked />
  37. <label for="chkPopup"> Popup绑定 </label>
  38. </div>
  39. <div class="checkbox checkbox-primary checkbox-inline">
  40. <input id="chkTooltip" class="styled" type="checkbox" />
  41. <label for="chkTooltip"> Tooltip绑定 </label>
  42. </div>
  43. <div class="checkbox checkbox-primary checkbox-inline">
  44. <input id="chkContextMenu" class="styled" type="checkbox" checked />
  45. <label for="chkContextMenu"> 右键菜单绑定 </label>
  46. </div>
  47. </div>
  48. </div>
  49. <!-- 图层管理相关处理js -->
  50. <script type="text/javascript" src="./js/graphicManager.js"></script>
  51. <script src="./js/common.js"></script>
  52. <script type="text/javascript">
  53. "use script"; //开发环境建议开启严格模式
  54. var map;
  55. function initMap(options) {
  56. //合并属性参数,可覆盖config.json中的对应配置
  57. var mapOptions = mars3d.Util.merge(options, {
  58. scene: {
  59. center: { lat: 31.188596, lng: 121.474422, alt: 4541, heading: 15, pitch: -40 },
  60. },
  61. });
  62. //创建三维地球场景
  63. map = new mars3d.Map("mars3dContainer", mapOptions);
  64. map.basemap = 2017; //蓝色底图
  65. var tiles3dLayer = new mars3d.layer.TilesetLayer({
  66. name: "上海市建筑物",
  67. url: "//data.mars3d.cn/3dtiles/jzw-shanghai/tileset.json",
  68. maximumScreenSpaceError: 8,
  69. maximumMemoryUsage: 1024,
  70. marsJzwStyle: true,
  71. style: {
  72. color: {
  73. conditions: [["true", "rgb(3, 104, 255)"]],
  74. },
  75. },
  76. popup: "all",
  77. });
  78. map.addLayer(tiles3dLayer);
  79. //创建Graphic图层
  80. var graphicLayer = new mars3d.layer.GraphicLayer();
  81. map.addLayer(graphicLayer);
  82. //图层管理的相关处理,代码在\js\graphicManager.js
  83. initLayerManager(graphicLayer);
  84. //加一些演示数据
  85. //立体围墙扩散效果,面状
  86. var diffuseWallGlow = new mars3d.graphic.DiffuseWall({
  87. positions: [
  88. [121.475616, 31.255374, 5.87],
  89. [121.482578, 31.248681, 10.85],
  90. [121.479447, 31.240235, 14.25],
  91. [121.470002, 31.240496, 12.92],
  92. [121.46538, 31.249206, 9.53],
  93. [121.475616, 31.255374, 5.87],
  94. ],
  95. style: {
  96. color: "#ffff00",
  97. diffHeight: 2000, //高度
  98. speed: 10, //速度
  99. //高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用
  100. highlight: {
  101. color: "#ff0000",
  102. },
  103. },
  104. });
  105. graphicLayer.addGraphic(diffuseWallGlow);
  106. //立体围墙扩散效果,圆状
  107. var circleDiffuseWallGlow = new mars3d.graphic.DiffuseWall({
  108. position: Cesium.Cartesian3.fromDegrees(121.504242, 31.23805, 27.88), //圆中心点
  109. style: {
  110. diffHeight: 2000, //高度
  111. radius: 600, //半径
  112. color: "#ff0000",
  113. speed: 10, //速度
  114. },
  115. });
  116. graphicLayer.addGraphic(circleDiffuseWallGlow);
  117. }
  118. </script>
  119. </body>
  120. </html>