Polylines in 2D

After upgrading from B15 to B16, an exception is thrown in my app when moving to 2D if there are polylines in the scene. Here is the stack trace:

Uncaught DeveloperError: sphere is required
Error
    at new DeveloperError (http://localhost/MyApp/Cesium/Core/DeveloperError.js:44:22)
    at Function.BoundingSphere.clone (http://localhost/MyApp/Cesium/Core/BoundingSphere.js:538:19)
    at PolylineCollection.update (http://localhost/MyApp/Cesium/Scene/PolylineCollection.js:456:45)
    at CompositePrimitive.update (http://localhost/MyApp/Cesium/Scene/CompositePrimitive.js:404:23)
    at Scene.render (http://localhost/Proton/Cesium/Scene/Scene.js:497:26)
    at declare.render (http://localhost/MyApp/Cesium/Widgets/Dojo/CesiumViewerWidget.js:1042:24)
    at declare.updateAndRender (http://localhost/MyApp/Cesium/Widgets/Dojo/CesiumViewerWidget.js:1067:18)
    at updateAndRender (http://localhost/MyApp/Cesium/Widgets/Dojo/CesiumViewerWidget.js:1091:24) BoundingSphere.js:538
BoundingSphere.clone BoundingSphere.js:538
PolylineCollection.update PolylineCollection.js:456
CompositePrimitive.update CompositePrimitive.js:404
Scene.render Scene.js:497
declare.render CesiumViewerWidget.js:1042
declare.updateAndRender CesiumViewerWidget.js:1067
updateAndRender CesiumViewerWidget.js:1091

It appears that a similar issue is present on the Apps deployed on this site, except that no exception is thrown, the polylines just disappear in 2D. For example, switch to 2D here:
http://cesium.agi.com/Cesium/Build/Apps/CesiumViewer/?source=Gallery/simple.czml

I noticed there was some discussion a few days ago about 2D polylines when displaying a GEO orbit track, but I looked at the commits associated with that and I think they are already in B16, and may be associated with the problem.

Thanks,
Jon

Hi Jon, I’m sorry to hear you’re having problems. The Polylines went through a significant rewrite but I was hoping we found any outstanding issues. None of the machines I have access to can reproduce the problem. Can you let us know what OS/Browser/Video card you are using? Also, have you tried updating to the latest drivers available for your card? It doesn’t seem a like a graphics related problem (maybe a race condition of some kind). Does it happen every time without fail?

Thanks,

Matt

Matt,

Don’t ask me why, but all the sudden I am able to see the polylines in the Cesium hosted app. It could be that previously chrome was using my integrated Intel graphics card, and now it’s using my NVIDIA card since chrome was still open from when my laptop was unplugged but now it’s docked.

However, I was still getting the stack trace in my app until I tracked down the issue. The line that causes the exception is:

boundingVolume = BoundingSphere.clone(this._boundingVolume2D, scracthBoundingSphere)

in PolylineCollection.js. this._boundingVolume2D is undefined.

I have some polylines that are added to the scene (with show=false) with no positions set yet. Removing those polylines or setting their positions before adding them to the scene solves the issue. Is that the desired behavior for polylines with no positions?

Thanks!

Jon

You can reproduce the stack trace in the CesiumViewer app by dragging czml with polylines onto an empty instance in 2D mode.

Jon

Yep, starting out in 2D mode I was easily able to reproduce this now. I’ll look into a fix.

I opened this pull request to fix the issue (and another unrelated issue) https://github.com/AnalyticalGraphicsInc/cesium/pull/734

That fixed it, thank you!