meen
meen

Reputation: 2339

Can we set outlineWidth property for polygon drawn using CZML in Cesium?

I want to reduce the thickness of outline of polygon drawn using CZML in Cesium. I tried to search if there is any option available in CZML to achieve it.

I found this, but it provides 'outlineWidth' for label and point.

Is there any way to adjust thickness of outline of polygon?

Thanks in advance.

Upvotes: 2

Views: 1000

Answers (1)

emackey
emackey

Reputation: 12418

Unfortunately, this doesn't work as smoothly as one might hope. There is indeed an outlineWidth property that can be applied to the polygon in CZML, but unfortunately this simply maps to WebGL's built-in lineWidth, which is not guaranteed to support any value beyond 1.0. In particular, the ANGLE project, which enables WebGL on many Windows-based browsers, has refused to support line widths greater than 1.0 on grounds that the spec doesn't require it.

Cesium does offer a system for Polylines in CZML, and these Polylines use a Cesium-specific implementation of screen-space thick lines that are known to work across all Cesium-supported systems, regardless of ANGLE or max lineWidth restrictions.

So the workaround here is to trace around the edges of all your polygons with polylines. You should be able to get this done automatically in code, and that would give you the thick lines you need.

Upvotes: 2

Related Questions