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’);”
-
var viewer = new Cesium.Viewer(‘cesiumContainer’);
-
var scene = viewer.scene;
-
var primitives = scene.primitives;
-
var trackerinstance = new Cesium.GeometryInstance({
-
geometry : new Cesium.PolylineGeometry({
-
positions : Cesium.Cartesian3.fromDegreesArray([-100.0, 40.0,-90.0, 40.0]),width : 10.0,vertexFormat :Cesium.PolylineMaterialAppearance.VERTEX_FORMAT
-
}),
-
id: ‘track’
-
});
-
var tracker = new Cesium.Primitive({
-
geometryInstances : trackerinstance,
-
appearance : new Cesium.PolylineMaterialAppearance
-
({
-
material : Cesium.Material.fromType(Cesium.Material.PolylineGlowType)
-
})
-
});
-
primitives.add(tracker);
-
setTimeout(function(){
-
var attributes = primitives.getGeometryInstanceAttributes(‘track’);
-
/*trackerinstance.geometry = Cesium.PolylineGeometry({
-
positions : Cesium.Cartesian3.fromDegreesArray([
-
-100.0, 40.0,
-
-90.0, 40.0,
-
-91.0, 30.0
-
]),
-
width : 10.0,
-
vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT
-
});*/
-
}, 6000);
Can anyone see a reason why that error is occurring?