How to Start Cesium Tracking an Object

All,

I am trying to figure out how to startup cesiumJS with it tracking an object. For example, if I had cesiumJS running locally with the default Node.js server, I would like to be able to go to localhost:8080/?scn=12345, and then it would open the cesium page tracking a satellite with control number 12345. I realize that the cesium viewer has a trackEntity property. However, I am not sure how I would access that from the server.js file. I’m not even sure if that’s the right way to do it. Any thoughts are greatly appreciated. Thank you!

Okay,

So I’ve figured out how to get the query parameters, etc. Now the problem is I can’t figure out how to set the viewer.selectedObject

Hi,

Not sure if mine is the best way:

e = viewer.entities.getById(“12345”); // Get the entity with id “12345”. Or you can user other ways to get it.

viewer.trackedEntity = e // track it. or use “viewer.trackedEntity = undefined” to un-track it.

Check out The CesiumViewer app that ships with Cesium. It supports loading a KML/CZML/GeoJSON file and zooming to a particular entity via query parameters. Here’s a link to the code in master, just search for “lookAt”: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Apps/CesiumViewer/CesiumViewer.js