problem with cesium entity outlineWidth

Hi,

I have a cesium application and I am creating Cesium entities of various types:

Billboards, polylines, polygons and ellipse.

Here is how I am creating them:

var ellipse= Cesium.entities.add({

id: ‘myEllipse’,

position: new Cesium.Cartesian3.fromDegrees(parseFloat(center.x), parseFloat(center.y), parseFloat(center.z)),

ellipse: {

semiMinorAxis: 600,

semiMajorAxis: 600,

material: Cesium.Color.RED.withAlpha(0.1),

outline: true,

outlineColor: Cesium.Color.RED,

outlineWidth: 3.5,

show: true,

fill: false

}

});

var myEntity = Cesium.entities.add({

position: new Cesium.Cartesian3.fromDegrees(parseFloat(position.x), parseFloat(position.y), parseFloat(position.z)),

id: name,

billboard: {

name: name,

scale: 0.9,

image: icon,

rotation: Cesium.Math.toRadians(parseFloat(angle))

},

polyline: {

positions: [new Cesium.Cartesian3.fromDegrees(parseFloat(position.x), parseFloat(position.y), parseFloat(position.z)),

new Cesium.Cartesian3.fromDegrees(parseFloat(center.x), parseFloat(center.y), parseFloat(center.z))],

width: 3.5,

material: Cesium.Color.RED

}

});

var polygon = Cesium.entities.add({

id: name,

polygon: {

hierarchy: new Cesium.Cartesian3.fromDegreesArray(groundProjectionArray),

extrudedHeight: 0,

perPositionHeight: false,

material: Cesium.Color.RED.withAlpha(0.1),

outline: true,

outlineWidth: 3.5,

outlineColor: Cesium.Color.RED,

show: true,

fill: true

}

});

The issue is that I need thicker outlineWidth but it is working only on the polyline and not on the ellipse and polygon.

How do I set it correctly?

Thanks.

Hi there,

Try adding height : 0 to your polygon and ellipse objects. When height is undefined, Cesium by default will clamp your geometry to the ground, and outlines are not supported when shapes are ground clamped.

Hope that helps,

  • Rachel

Hi Rachel,

Now I understand why the out lines width are not working, but the height: 0 did not solve it.

Any idea why?

Hi there,

I don’t see anything else wrong with your code right now – try double checking against similar sandcastle examples: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Polygon.html&label=Showcases

Hope that helps,

  • Rachel