Updating the geometry of a polyline post-render

Hi there,

I’ve been attempting to update the geometry of a polyline and have been trying to follow the documentation examples regarding the use of getGeometryInstanceAttributes(). Please see the example below, which returns the following error for line 24:

Uncaught TypeError: undefined is not a function

It doesn’t like me using “primitives.getGeometryInstanceAttributes(‘track’);”

  1. var viewer = new Cesium.Viewer(‘cesiumContainer’);

  2. var scene = viewer.scene;

  3. var primitives = scene.primitives;

  4. var trackerinstance = new Cesium.GeometryInstance({

  5. geometry : new Cesium.PolylineGeometry({

  6. positions : Cesium.Cartesian3.fromDegreesArray([-100.0, 40.0,-90.0, 40.0]),width : 10.0,vertexFormat :Cesium.PolylineMaterialAppearance.VERTEX_FORMAT

  7. }),

  8. id: ‘track’

  9. });

  10. var tracker = new Cesium.Primitive({

  11. geometryInstances : trackerinstance,

  12. appearance : new Cesium.PolylineMaterialAppearance

  13. ({

  14. material : Cesium.Material.fromType(Cesium.Material.PolylineGlowType)

  15. })

  16. });

  17. primitives.add(tracker);

  18. setTimeout(function(){

  19. var attributes = primitives.getGeometryInstanceAttributes(‘track’);

  20. /*trackerinstance.geometry = Cesium.PolylineGeometry({

  21.     positions : Cesium.Cartesian3.fromDegreesArray([
    
  22.         -100.0, 40.0,
    
  23.         -90.0, 40.0,
    
  24.         -91.0, 30.0
    
  25.     ]),
    
  26.     width : 10.0,
    
  27.     vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT
    
  28. });*/

  29. }, 6000);

Can anyone see a reason why that error is occurring?

Perhaps

var attributes = tracker.getGeometryInstanceAttributes(‘track’);

Patrick