I recently upgraded from a pre-1.0 release to Cesium 1.4 and was
greatly surprised to see that sensors (cones, pyramids) and vectors
had been removed from core Cesium. IMHO these features are essential
for any visualization tool designed for satellites and aircraft.
The cesium-sensors plugin seems to fill the gap, but it's not
working with v1.4. I receive the following error when trying to load
the example simple.czml file.
An error occurred while rendering. Rendering has
stopped.
undefined
TypeError: undefined is not a function
TypeError: undefined is not a function
at CustomSensorVolume.update
()
at RectangularPyramidSensorVolume.update
()
at PrimitiveCollection.update
()
at updatePrimitives
()
at render
()
at Scene.render
()
at CesiumWidget.render
()
at render
()Cesium.js:134122
CesiumWidget.showErrorPanel
The code I use to load cesium and the senors is:
I had similar trouble getting the sensors working in build 1.1. I’m not sure if the help I got will be completely relevant to your situation, but I did manage to get them working in the end with help from this thread: https://groups.google.com/forum/#!topic/cesium-dev/QDQg2gqBnlY
I saw that thread and the gist seems to be calling
CesiumSensors.initialize(). I’ve tried doing that before and after
creating the cesium viewer, but always with the same result.
The immediate issue seems to be that the senor code is expecting a
function called Cesium.createShaderSource(), which is undefined in
Cesium v1.4.
Maybe downgrading to 1.1 is the solution.
Thanks,
Evan
I had trouble getting the cesiumSensorsInitialize(); function to actually do anything as well. The place it ended up working was being the very first function called in the CesiumViewer.js file. I put it right after the “use strict”; and it seems to work there.
Also from your original post it looks like you are loading in the scripts from the index.html page? I ended up putting the call to the sensors in the Startup.js file and loading it with require.js instead because I couldn’t get a script in the index to load the sensors.
Just tried that as well, slightly different error, but still because
the function createShaderSource() is undefined.
After some more digging it looks like Scott Hunter removed the
required function in commit 3d19ddbe1df80f3cd1ad79fbce7833fed8e3839e
which first appeared in the 1.3 release. This leads me to conclude
that sensors are not compatible with any Cesium version after 1.2.
This led me to downgrade to Cesium 1.2, where the sensors package
does work.
IMHO this is a loss for the Cesium community on two fronts. First
the loss of functionality. Any 3D visualization tool can show dots
moving around the Earth, but the first class support for sensors in
Cesium is one of the features that made it unique.
The second, and bigger loss, is the loss of trust in a stable API.
Code that worked in version 1.2 is now broken in 1.4. Introducing
breaking changes in minor releases is a quick way to lose users.