# Can't change SimplePolylineGeometry to PolylineGeometry

**URL:** <https://community.cesium.com/t/cant-change-simplepolylinegeometry-to-polylinegeometry/18785>\
**Category:** CesiumJS\
**Created:** [May 26, 2022, 1:46pm UTC](https://community.cesium.com/t/cant-change-simplepolylinegeometry-to-polylinegeometry/18785 "2022-05-26T13:46:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DataVerse](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/dataverse/32/3476_2.png) [@DataVerse](https://community.cesium.com/u/DataVerse)\
**Post date:** [May 26, 2022, 1:46pm UTC](https://community.cesium.com/t/cant-change-simplepolylinegeometry-to-polylinegeometry/18785/1 "2022-05-26T13:46:18Z")

</div>

This bit of code works:

```auto
      const rLine = new Cesium.GeometryInstance({
      geometry: new Cesium.SimplePolylineGeometry({
        positions: Cesium.Cartesian3.fromDegreesArrayHeights(posns),
        colors: colorVals,
        colorsPerVertex: true, }),
      });

      viewer.scene.primitives.add(new Cesium.Primitive({
        geometryInstances: rLine,
        appearance: new Cesium.PerInstanceColorAppearance({
          flat: true, }), 
     }));

```

But I need to make it a PolylineGeometry because SimplePolylineGeometry doesn’t support setting the width. If I make one change to  
` geometry: new Cesium.PolylineGeometry({`  
then my line won’t appear, no console errors.

How can I make this work so I can set a line width? I take it setting width for SimplePolylineGeometry is impossible?

Also tried this which gives me just a white line at the correct width:

```auto
 var polylines = viewer.scene.primitives.add(new Cesium.PolylineCollection());
    var polyline = polylines.add({
      positions : Cesium.Cartesian3.fromDegreesArrayHeights(posns),
      colors: colorVals,
      colorsPerVertex: true,
      width: 5
    });

```

I see now this is because Polyline has no mutli colour functionality but PolylineGeometry does! Not sure I Understand why there are two such similar sounding classes.
