mapbox / mapbox-gl-style-spec

76 stars 38 forks source link

"line-cap": "round" + "line-dasharray": [1, 1] should produce circles #546

Closed jfirebaugh closed 7 years ago

jfirebaugh commented 7 years ago

The combination of "line-cap": "round" and "line-dasharray": [1, 1] should produce a line consisting of circles with diameter equal to the line width, spaced one line width from each other.

Instead, it produces this:

image

jingsam commented 7 years ago

I think this is intended feature, the spec says:

round A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.

So when "line-dasharray": [1, 1], it renders like this: image

Want to get a a line consisting of circles, try to set "line-dasharray": [0, 1]

image

jfirebaugh commented 7 years ago

Yes, I'm suggesting we should change the definition. The existing definition isn't what people expect.

jingsam commented 7 years ago

I think we should keep this behaviour consistent with the definition of stroke-linecap in SVG or linecap in Canvas. That is what a web developer would expect.

jfirebaugh commented 7 years ago

Good point. I just confirmed that the current definition is consistent with SVG.