根据 https://www.mapbox.com/mapbox-gl-js/style-spec/ type='fill' 的图层绘制“带有 可选描边边框 的填充多边形”。
type: 'fill',
paint: {
'fill-color': 'orange',
'fill-opacity': 0.5,
'fill-outline-color': 'red'
}
多边形周围的笔画被绘制,但非常细,因此几乎不引人注意。
问题:有没有办法在多边形周围绘制更强、更粗的笔划线(笔划)?
我还找到了 https://github.com/mapbox/mapbox-gl-js/issues/4087它认为,这些设置像现在一样令人困惑。我同意这一点。
最佳答案
根据此评论,笔划目前仅限于 1px 宽度(您无法更改宽度):
https://github.com/mapbox/mapbox-gl-js/issues/4088#issuecomment-285801635
您可以使用额外的 line
多边形顶部的图层(使用相同的源)fill
层。
通过这种方式,您可以使用 line-width 在多边形周围绘制更粗的笔划。 (对于 line
层)。
关于mapbox-gl-js - 在类型为 'fill' : Can we control the stroke thickness? 的 mapbox gl js 层中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50351902/