Difficulty Getting Started

Hello everybody,

I apologize in advance for the rudimentary level of my questions - I am very new to JavaScript and Cesium, and I would very much appreciate any suggestions you may have.

I have read through the Quick Start and most of the other pages on the Cesium Wiki, and I have downloaded and successfully run the zip of master from the Quick Start page. My first, and likely very dumb, question is: how do I create my own project (or, for that matter, access the example projects)? I can browse to http://localhost:8080 as directed and from there select from a number of links. I have also looked at the Sandcastle code on the Cesium website. However, I am unfortunately quite lost as to how all of these pieces fit together.

If it helps, my ultimate goal in using Cesium is to create a 2D map where I can display points for which I have latitude/longitude coordinates, and I would like to be able to zoom to different levels as well. Relative to the full capabilities of Cesium I am sure this is quite simple, but alas I've been rather unsuccessful in getting started.

Thank you very much for any help you can provide!

-Rob

Hi Rob,

No need to apologize. Currently, there is a bit of a gap between how to get Cesium running and building your first app. We are working to make this easier and better documented.

If your app just needs to display points for latitude/longitude positions, consider creating a CZML file, which is a JSON file describing your data that you can just drag and drop onto Cesium Viewer or pass to the viewer as part of the URL, e.g.,

http://cesium.agi.com/Cesium/Build/Apps/CesiumViewer/index.html?source=Gallery/LotsOfSensors.czml

You can write CZML directly or use our czml-writer (C# and Java).

For building your own Cesium app beyond just generating CZML, Ed provided some advice recently.

Regards,

Patrick

Thank you, I will try out the czml-writer as you suggested. You mentioned that I can pass the CZML file to the viewer as part of the URL. I've looked at the index.html file in the CesiumViewer App directory (as well as the boot.js and CesiumViewer.js files) and I cannot find the place in the file that specifies which .czml file is being used. I've tried running the index.html file that I have saved locally on my machine and I get a blank black screen - when I try appending "?source=Gallery/LotsOfSensors.czml" to the url it doesn't seem like anything happens.

Thanks,

-Rob

Hi Rob,

When you drag and drop the file, bring up the console window in the browser’s debugger (Ctrl-Shitf-i in Chrome) and see if there are any errors or warnings. Is this a CZML file you authored yourself? It is possible that it is not valid CZML or JSON. We have a CZML validator in the czml-writer project; see Validator.html in the Schema directory.

Also, are you running Cesium viewer off of http://cesium.agi.com/? Or do you have a local copy? If you’re using a local copy, are you running it through a web server?

Regards,

Patrick

I have used the czml-writer to convert my data into .czml format, and have successfully plotted my data on the Cesium viewer at both http://cesium.agi.com/ and on my local copy by dragging and dropping the .czml file onto the viewer window (previously I had forgotten to build and run the web server as described in the Quick Start). Thank you for pointing out my mistake!

Ultimately I will be working with a large number of latitude/longitude points (likely in the tens of thousands, but possibly more), and for performance reasons I anticipate it will be necessary to cluster nearby points together, and to re-draw the points upon a change in the level of zoom, etc. I plan to manage the clustering and determination of which points to plot outside of Cesium. However, I was wondering if there is a way I could ask for the boundary coordinates for the current view and then pass a new .czml file of points to re-draw based on those coordinates, upon the occurrence of a zoom or lateral view shift. If so, could you point me in the direction of the classes I would want to use for that task?

Thank you very much for your help,

-Rob

Hi Rob,

We do something very similar with terrain and imagery. Given the view frustum, we determine what tiles we’d like to render, then we render the best set that we have in memory and request the rest. For computing the view frustum, checkout scene.getCamera().frustum.computeCullingVolume. It’s used in Scene.js and, perhaps more interesting to you, CentralBodySurface.js.

Regards,

Patrick

I too was encountering the blank black screen. After following Patrick's suggestion below about checking the development console for errors, I found the following error: "Uncaught Error: SecurityError: DOM Exception 18". A quick search turned up this StackOverflow page: http://stackoverflow.com/questions/2704929/uncaught-error-security-err-dom-exception-18-when-i-try-to-set-a-cookie. This page clued me in that opening index.html from Windows Explorer, as I was doing, results in the use of the file:// URI scheme, which is apparently problematic from a security standpoint. So, I was able to setup a local web server, and accessing index.html via the http:// URI scheme through localhost worked great.