Error when give polyline material

TypeError: Cannot read property ‘length’ of undefined

Got this error when give polyline the new Cesium.PolylineArrowMaterialProperty(Cesium.Color.RED).

No matter give it to the object for PolylineCollection#add or give it to the Polyline returned from the collection#add function.

Is it a bug?

Hello,

Can you please provide a full code sample that runs in Sandcastle? http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html

That will make it easier for use to reproduce the problem.

Thanks,

Hannah

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

var collection = new Cesium.PolylineCollection();

var testLine = {

positions : Cesium.Cartesian3.fromDegreesArrayHeights([-75, 43, 500000,

-125, 43, 500000]),

width : 10

};

viewer.scene.primitives.add(collection);

var line = collection.add(testLine);

line.material = new Cesium.PolylineArrowMaterialProperty(Cesium.Color.PURPLE);

``

Started from the highlighted place.

在 2016年8月16日星期二 UTC+8下午9:22:47,Hannah Pinkos写道:

You’re seeing the error because you’re creating a polyline using the Primitive API but trying to set the material with a property from the Entity API.
We recommend that you use the entity API for creating polylines. Here is an example: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Polyline.html&label=Geometries

Best,

Hannah