You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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>dc-example</title>
  7. <script src="/libs/dc-sdk/dc.min.js"></script>
  8. <script src="../dat.gui.min.js"></script>
  9. <link href="/libs/dc-sdk/dc.min.css" type="text/css" rel="stylesheet" />
  10. <link href="../index.css" type="text/css" rel="stylesheet" />
  11. </head>
  12. <body>
  13. <div id="viewer-container" class="viewer-container"></div>
  14. <script>
  15. DC.config.baseUrl = '../libs/dc-sdk/resources/'
  16. let viewer = new DC.Viewer('viewer-container')
  17. let controls = {
  18. show: true,
  19. showGroundAtmosphere: true,
  20. enableLighting: false,
  21. depthTestAgainstTerrain: false,
  22. tileCacheSize: 100,
  23. preloadSiblings: false,
  24. showSkirts: true,
  25. baseColor: '#00c',
  26. }
  27. let gui = new dat.GUI()
  28. gui.add(controls, 'show').onChange((value) => {
  29. viewer.setOptions({
  30. globe: {
  31. show: value,
  32. },
  33. })
  34. })
  35. gui.add(controls, 'showGroundAtmosphere').onChange((value) => {
  36. viewer.setOptions({
  37. globe: {
  38. showGroundAtmosphere: value,
  39. },
  40. })
  41. })
  42. gui.add(controls, 'enableLighting').onChange((value) => {
  43. viewer.setOptions({
  44. globe: {
  45. enableLighting: value,
  46. },
  47. })
  48. })
  49. gui.add(controls, 'depthTestAgainstTerrain').onChange((value) => {
  50. viewer.setOptions({
  51. globe: {
  52. depthTestAgainstTerrain: value,
  53. },
  54. })
  55. })
  56. gui.add(controls, 'tileCacheSize', 100).onChange((value) => {
  57. viewer.setOptions({
  58. globe: {
  59. tileCacheSize: value,
  60. },
  61. })
  62. })
  63. gui.add(controls, 'preloadSiblings').onChange((value) => {
  64. viewer.setOptions({
  65. globe: {
  66. preloadSiblings: value,
  67. },
  68. })
  69. })
  70. gui.add(controls, 'showSkirts').onChange((value) => {
  71. viewer.setOptions({
  72. globe: {
  73. showSkirts: value,
  74. },
  75. })
  76. })
  77. gui.addColor(controls, 'baseColor').onChange((value) => {
  78. viewer.setOptions({
  79. globe: {
  80. baseColor: DC.Color.fromCssColorString(value),
  81. },
  82. })
  83. })
  84. </script>
  85. </body>
  86. </html>