[help] Added entities do not render until after time animation stops

Ok, there are two problems.

Problem 1

One of them is that a polyline worker is created only when lines are added, and immediately disposed when no lines remain, based on the following threads plus the behavior that I observe:

The following code is needed once, initially, in order to ensure that a line worker exists all of the time, by making an invisible dummy line, in order to ensure that things stay on screen when removing then adding new lines:

			dataSource.entities.add(
				new Cesium.Entity({
					name: 'dummy line to keep polyline web worker alive',
					polyline: {
						positions: [new Cesium.Cartesian3(0, 0, 0), new Cesium.Cartesian3(1, 1, 1)],
						arcType: Cesium.ArcType.NONE, // required, or runtime error
						material: new Cesium.PolylineDashMaterialProperty({color: Cesium.Color.CYAN}), // required, or else no worker!
					},
				}),
			)

You can’t see the line, but it causes the worker to be around all the time because the line is around all the time, added only once during initialization.

Before adding this dummy line to keep a worker alive, here’s what it looks like each time that time is animated:

After adding the dummy line and keeping a worker alive, lines no longer disappear while animating time:

Problem 2

Although the dummy line trick keeps lines visible in the rendering during time animation, only the last lines visible before time animation started are visible, and any new lines added during time animation are not rendered until time animation stops.

Note, as I described above, I am adding new lines whenever time changes (during time animation), however they don’t show until time stops. Old lines (the ones still visible during time animation) should no longer be visible, however they remain erroneously visible.


TLDR, two problems: without workers, no lines show at all during time animation. With workers, only the last lines before time animation started are visible during time animation but some other problem prevents the rendering to be fully updated.

Overall, this API is very confusing for end users; I’ve no idea how to change this undesirable behavior.