The line-gap property for MBStyle produces unexpected results.
MBStyle:
"type": "line",
"paint": {
"line-color": "#FFCC00",
"line-width": 4,
"line-cap": "round"
}
Generated SLD:
<sld:LineSymbolizer uom="http://www.opengeospatial.org/se/units/pixel">
<sld:Stroke>
<sld:CssParameter name="stroke-linejoin">mitre</sld:CssParameter>
<sld:CssParameter name="stroke-width">
<ogc:Add>
<ogc:Literal>8</ogc:Literal>
<ogc:Literal>4</ogc:Literal>
</ogc:Add>
</sld:CssParameter>
</sld:Stroke>
<sld:PerpendicularOffset>0</sld:PerpendicularOffset>
</sld:LineSymbolizer>
<sld:LineSymbolizer uom="http://www.opengeospatial.org/se/units/pixel">
<sld:Stroke>
<sld:CssParameter name="stroke">#FFFFFF</sld:CssParameter>
<sld:CssParameter name="stroke-linejoin">mitre</sld:CssParameter>
<sld:CssParameter name="stroke-width">
<ogc:Sub>
<ogc:Add>
<ogc:Literal>8</ogc:Literal>
<ogc:Literal>4</ogc:Literal>
</ogc:Add>
<ogc:Literal>1</ogc:Literal>
</ogc:Sub>
</sld:CssParameter>
</sld:Stroke>
<sld:PerpendicularOffset>0</sld:PerpendicularOffset>
</sld:LineSymbolizer>
<sld:LineSymbolizer uom="http://www.opengeospatial.org/se/units/pixel">
<sld:Stroke>
<sld:CssParameter name="stroke-linejoin">mitre</sld:CssParameter>
<sld:CssParameter name="stroke-width">8</sld:CssParameter>
</sld:Stroke>
<sld:PerpendicularOffset>0</sld:PerpendicularOffset>
</sld:LineSymbolizer>
This produces: A black stroke of width 12, a white stroke of width 11, and a black stroke of width 8.
What I would expect - Either:
- Two black strokes (width 8), one with a perpendicularOffset of -6, the other with a perpendicularOffset of 6 (6 = 1/2 (width + gap) = 8+4 / 2).
- One black stroke of width 20, one white stroke of width 4 (only as a workaround if the former doesn’t work)
Resulting visuals attached (There is some other styling on that screenshot, only the big black line is the issue here)
|