CZML Not Loading

1. A concise explanation of the problem you're experiencing.

After some debugging in the console and various attempts, I have gotten to the point were the console does not present any current issues and the CZML file is nothing large or complex (Just the simple.czml file from sandcastle).

I've pasted the current code below to see if someone can assist with what I have done wrong.

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Use correct character set. -->
    <meta charset="utf-8">
    <!-- Tell IE to use the latest, best version. -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>Cesium Viewer</title>
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="CesiumViewer.css" media="screen">
    <script data-main="CesiumViewerStartup" src="../../ThirdParty/requirejs-2.1.20/require.js"></script>
</head>
<body style="background: #000;">
    <div id="cesiumContainer" class="fullWindow"></div>
    <div id="loadingIndicator" class="loadingIndicator"></div>
    <script> id="cesium_sat_script">
            function startup(Cesium) {
            'use strict';
            var viewer = new Cesium.Viewer('cesiumContainer');
            var dataSrc = Cesium.CzmlDataSource.load("simple.czml");
            viewer.dataSources.add(dataSrc);
            }
    </script>
</body>
</html>

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

In the end, I am looking to create a CZML that contains multiple LEO sats but first need the ability to load a CZML first.

4. The Cesium version you're using, your operating system and browser.

Latest Chrome and Cesium 1.56.1

It doesn’t appear that your “startup” function is ever called by any code. Also you have an error in your html:

id="cesium_sat_script"> I would suggest starting with the HelloWorld.html file, which is the most basic way to build a web application, and making changes to that until you are more familiar with developing apps.

Dear Scott,

Many thanks for your response.

I've tried a though things in HelloWorld but no success with loading a CZML file. Would you mind suggesting what could be fixed or an example code for loading a CZML file?

Thanks,

Jacques

First, make sure you can get the “getting started” guide working:

https://cesium.com/docs/tutorials/getting-started/

The simplest example of loading Cesium in an HTML page and loading a CZML file would be:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <script src="https://cesiumjs.org/releases/1.56.1/Build/Cesium/Cesium.js"></script>
  <link href="https://cesiumjs.org/releases/1.56.1/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
</head>
<body>
  <div id="cesiumContainer" style="width: 700px; height:400px"></div>
  <script>
    var viewer = new Cesium.Viewer('cesiumContainer', {
    shouldAnimate : true
});  
var dataSrc = Cesium.CzmlDataSource.load('PATH_TO_YOUR_CZML/simple.czml');
viewer.dataSources.add(dataSrc);
  </script>
</body>
</html>

``

You should be able to run this locally if you have a local web server set up and serving this file, and as long as you have the correct path to your CZML.

Dear Omar,

Many thanks for your reply and for giving me a starting point for loading a CZML file. After reviewing what I have done to what you have provided. I realise where I went wrong and after reviewing the CZML help text it actually makes some sense now seeing it.

Thanks again,

Jacques