简体   繁体   English

我们可以在 Cesium 中为使用 CZML 绘制的多边形设置 outlineWidth 属性吗?

[英]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.我想减少在铯中使用 CZML 绘制的多边形轮廓的厚度。 I tried to search if there is any option available in CZML to achieve it.我试图搜索 CZML 中是否有任何可用的选项来实现它。

I found this , but it provides 'outlineWidth' for label and point.我找到了这个,但它为标签和点提供了“outlineWidth”。

Is there any way to adjust thickness of outline of polygon?有没有办法调整多边形轮廓的粗细?

Thanks in advance.提前致谢。

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.outlineWidth中确实有一个可以应用于多边形的 outlineWidth 属性,但不幸的是,这只是映射到 WebGL 的内置lineWidth ,不能保证支持任何超过 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.特别是,在许多基于 Windows 的浏览器上启用 WebGL 的 ANGLE 项目 拒绝支持大于 1.0 的线宽,理由是规范不需要它。

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. Cesium确实为CZML 中的 Polylines提供了一个系统,这些 Polylines 使用Cesium特定的屏幕空间粗线实现,这些粗线已知可以在所有 Cesium 支持的系统上工作,而不管 ANGLE 或最大lineWidth限制。

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.您应该能够在代码中自动完成此操作,这将为您提供所需的粗线。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM