line-gap-width Paint property. Optional number greater than or equal to 0. Units in pixels. Defaults to 0. Supports combinefeature-state and smooth-rampinterpolateexpressions. opacityTransitionable. Draws a line casing outside of a line's actual path. Value indicates the width of the inner...
paint中可以设置的参数:line-blur,line-cap,line-color,line-dasharray,line-gap-width,line-gradient,line-join,line-miter-limit,line-offset,line-opacity,line-pattern,line-round-limit,line-sort-key,line-translate,line-translate-anchor,line-trim-offset,line-width,visibility。具体请参考下面的api链接。 直...
source: 'customSourceName', //使用刚刚添加的资源 layout: { 'line-cap': 'round', 'line-join': 'round' }, paint: { 'line-color': '#00FFF4', 'line-width': 2.5, 'line-opacity': 1, 'line-gap-width': 0, }, }); // 添加图层,如上使用 名为 customSourceName 的资源 添加了一个...
],"layout": {"line-cap": "round", "line-join": "round"},"paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"],12,0.75,20,2],"line-color": "hsl(185, 2%, 29%)","line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"],12,0.5,14, ["match...
},"line-color": "hsl(0, 0%, 100%)","line-gap-width": {"base": 1.5,"stops": [ [5,0.75], [18,32] ] } },"interactive":true}, 3.公路编号图标,图标是一张图片外加属性数据。对应type=symbol,是符号渲染 {"id": "road-shields-white","type": "symbol","source": "germany","sour...
找到line的顶点着色器:uniformboolu_half_paint;然后在main函数里写上if(u_half_paint){outset=2.0*(gapwidth+(normal.y<?halfwidth:*:)+ANTIALIASING;}就是沿着线的左侧绘制然后打包编译执行,测测试验效果。有问题的话自己研究研究哪里不生效。 今天的讲解加魔改就到这里吧。有个专门的提示,web端调试webgl的话...
"line-gap-width": "@road-minor-width" } }, { "id": "bridge_major_case", "type": "line", "source": "mapbox", "source-layer": "bridge", "filter": ["all", ["in", "class", "motorway", "main"], ["==", "$type", "LineString"]], "paint": { "line-color": "@land...
"line-translate-anchor": "map", // 线的平移锚点,即相对的参考物(可选,可选值为 map、viewport,默认为 map) "line-width": 1, // 线的宽度(可选,值 >= 0,默认值为 1,单位:像素) "line-gap-width": 0, // 线的外部间距宽度(可选,值 >= 0,默认值为 0,单位:像素。用来在线的外部再绘制...
, "line-gap-width" , "line-offset" , "line-blur" , "line-dasharray" , "line-pattern" , "line-gradient" , "paint_circle" , "circle-radius" , "circle-color" , "circle-blur" , "circle-opacity" , "circle-translate" , "circle-translate-anchor" , "circle-pitch-scale" , "circle-...
The idea here is to use line-gap-width and a different color with some opacity to represent the outline/border. // separate layer for drawing the borders (using the same source) { ..., filter: ['boolean', ['feature-state', 'selected'], false] } // => Error: layers[1].filter:...