SlopAnalysis.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>坡度坡向分析</title>
  7. <link rel="stylesheet" href="../../dist/index.css" />
  8. <link href="../../cesium/Source/Widgets/widgets.css" rel="stylesheet">
  9. <script src="../../cesium/Build/Cesium/Cesium.js"></script>
  10. <script src="../../dist/index.js"></script>
  11. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  12. <style>
  13. * {
  14. padding: 0;
  15. margin: 0;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <div id="map" style="height: 90vh; width: 100vw;"></div>
  21. <div style="height: 10vh; width: 100vw;">
  22. <p>最小坡度</p><input type="number" name="SlopeMin" min="0" max="90" step="0.1" value="0"
  23. onchange="SlopAnalysis.updateSlopeMin(this.value)" />
  24. <p>最大坡度</p><input type="number" name="SlopeMax" min="0" max="90" step="0.1" value="90"
  25. onchange="SlopAnalysis.updateSlopeMax(this.value)" />
  26. <p>透明度</p><input type="number" name="Opacity" min="0" max="1" step="0.1" value="0.4"
  27. onchange="SlopAnalysis.updateOpacity(this.value)" />
  28. 显示坡度和坡向 <input type="radio" name="SlopeMode" checked="true" value="graphicandarrow"
  29. onchange="SlopAnalysis.updateSlopeMode(this.value)">
  30. 显示坡度 <input type="radio" name="SlopeMode" value="graphic" onchange="SlopAnalysis.updateSlopeMode(this.value)">
  31. 显示坡向 <input type="radio" name="SlopeMode" value="arrow" onchange="SlopAnalysis.updateSlopeMode(this.value)">
  32. 不显示 <input type="radio" name="SlopeMode" value="none" onchange="SlopAnalysis.updateSlopeMode(this.value)">
  33. <button type="button" onclick="SlopAnalysis.updateSlope()">更新坡度</button>
  34. </div>
  35. </body>
  36. <script>
  37. window.CESIUM_BASE_URL = '../../cesium/Build/CesiumUnminified';
  38. Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2MjIyODA4ZS0zNmRmLTQwNGMtYjZkNC0wOGY2NDdmODgyZTUiLCJpZCI6ODMyOCwiaWF0IjoxNjA2MjkyNDE1fQ.ZhhxNIJ-TzstpcavQBNL7xRwytBat3G2__3jr7lJ8yg'
  39. var viewer = CTMapOl.thrdime.viewercontrol.globalviewer('map', CTMapOl.thrdime.viewercontrol.globalvieweroptions())
  40. viewer._cesiumWidget._creditContainer.style.display = 'none'
  41. CTMapOl.thrdime.imagerylayercontrol.removeAll(viewer, true)
  42. CTMapOl.thrdime.imagerylayercontrol.addImageryProvider(viewer, CTMapOl.thrdime.imagerylayercontrol.gettdtImagery('img', "img_w"))
  43. CTMapOl.thrdime.imagerylayercontrol.addImageryProvider(viewer, CTMapOl.thrdime.imagerylayercontrol.gettdtImagery('cia', "cia_w"))
  44. CTMapOl.thrdime.cameracontrol.setDEFAULT_VIEW_RECTANGLE(116.38, 39.90, 116.40, 39.92)
  45. CTMapOl.thrdime.cameracontrol.setcamera(viewer, CTMapOl.thrdime.cameracontrol.getcameraoptionswithdetile(116.39, 39.91, 5000, 0, -90, 0))
  46. CTMapOl.thrdime.viewercontrol.addterrain(viewer)
  47. let SlopAnalysis = new CTMapOl.cesiumComponent.SlopAnalysis(viewer, 0, 60, 0.4, 'graphicandarrow',()=>{
  48. console.log('分析结束')
  49. })
  50. SlopAnalysis.active()
  51. </script>
  52. </html>