SHARE
TWEET

Untitled

a guest Nov 15th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2.     <html lang="en">
  3.     <head>
  4.       <!-- Use correct character set. -->
  5.       <meta charset="utf-8">
  6.       <!-- Tell IE to use the latest, best version. -->
  7.       <meta http-equiv="X-UA-Compatible" content="IE=edge">
  8.       <!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
  9.       <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
  10.       <title>Hello World!</title>
  11.       <script src="../Build/Cesium/Cesium.js"></script>
  12.       <style>
  13.           @import url(../Build/Cesium/Widgets/widgets.css);
  14.           html, body, #cesiumContainer {
  15.               width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden;
  16.           }
  17.       </style>
  18.     </head>
  19.     <body>
  20.       <div id="cesiumContainer"></div>
  21.       <script type="text/javascript">
  22.             var viewer = new Cesium.Viewer('cesiumContainer');
  23.     var scene = viewer.scene;
  24.     scene.mode= Cesium.SceneMode.SCENE3D;
  25.     var scenename = "3D";
  26.     console.log("Scene Mode 3D");
  27.  
  28.      //updateFromServer();
  29.     var intervalID = window.setInterval(updateFromServer, 6000);
  30.  
  31.     function updateFromServer() {
  32.         if (scenename === "3D")
  33.         {
  34.             scene.mode= Cesium.SceneMode.SCENE2D;
  35.             scenename = "2D";
  36.             console.log("Scene Mode 2D");
  37.         }
  38.         else
  39.         {
  40.             scene.mode= Cesium.SceneMode.SCENE3D;
  41.             scenename = "3D";
  42.             console.log("Scene Mode 3D");
  43.         }
  44.     }
  45.  
  46.       </script>
  47.     </body>
  48.     </html>
RAW Paste Data
Top