skip to Main Content

I am a beginner trying to learn to Cesium JS for Web GIS projects.I downloaded and installed the Cesium 1.119 library in my laptop. Now I am not able to see the basic globe part on the screen. I have attached the code and an image of the current result here. Can someone please help me out?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <script src="http://localhost:8085/3d/libs/Cesium-1.119/Build/Cesium/Cesium.js"></script>
    <script src="http://localhost:8085/3d/libs/Cesium-1.119/Apps/Sandcastle/Sandcastle-header.js"></script>

</head>

<style>
    @import url(http://localhost:8085/3d/libs/Cesium-1.119/Apps/Sandcastle/CesiumSandcastle.css);

    @import url(http://localhost:8085/3d/libs/Cesium-1.119/Apps/Sandcastle/templates/bucket.css);
</style>

<body>
    <div id="cesiumContainer" class="fullSize"></div>
    <div id="loadingOverlay">
        <h1>Loading...</h1>
    </div>
    <div id="toolbar"></div>
    <script type="text/javascript">
        var viewer = new Cesium.Viewer("cesiumContainer",{
                  Geocoder: false,
                  Animation: true,
                  CreditsDisplay: false,
                  Timeline: false,
                  FullscreenButton: false
                });
    </script>
    
</body>
</html>

2

Answers


  1. Chosen as BEST ANSWER

    I found a way to open the correct way to access the complete Cesium library through the same server for both Geoserver and Webserver.


  2. I am not sure why you are facing this issue, you can take the official docs example and implement them in your code and it should work.

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Document</title>
    
    
      <script src="https://cesium.com/downloads/cesiumjs/releases/1.119/Build/Cesium/Cesium.js"></script>
      <link href="https://cesium.com/downloads/cesiumjs/releases/1.119/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
    
    
    </head>
    
    <style>
    
    </style>
    
    <body>
      <div id="cesiumContainer" class="fullSize"></div>
      <div id="loadingOverlay">
        <h1>Loading...</h1>
      </div>
      <div id="toolbar"></div>
    
    </body>
    
    </html>
    

    JS Fiddle Demo

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search