Hello all,
I have been working with cesium for close to 2 months now and the majority of my work has been done with the Primitive class. The reason for this is because I have a very large amount of data that needs to be visualized so I really needed to optimize performance over just visualization.
My question pertains directly to the PolylineGeometry class and how exactly would I go about using it currently I've tried a few approaches all of which are very similar to this one, note: the beginning code is taken from the cesium documentation
var polyline = new Cesium.PolylineGeometry({
positions: Cesium.Cartesian3.fromDegreesArray([
0.0, 0.0,
5.0, 0.0,
0.0, 5.0
]),
width: 5.0
});
var geometry = Cesium.PolylineGeometry.createGeometry(polyline);
I then created an instance
var newInstance = new Cesium.GeometryInstance({
id: "1",
geometry,
attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED)
}
});
I then add it to a primitive and try to add it to the scene
var targetPrimitive = new Cesium.Primitive({
geometryInstances: newInstance
});
var scene = viewer.scene;
scene.primitives.add(targetPrimitive);
With this method I keep getting an error that says "DeveloperError: _workerName must be defined for asynchronous geometry"
My question really lies in if I'm using PolylineGeometry is this not the proper way to put it into the scene?