Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Polygon stroke width #324

Closed
ekelleyv opened this issue Jun 16, 2014 · 6 comments
Closed

Polygon stroke width #324

ekelleyv opened this issue Jun 16, 2014 · 6 comments
Labels

Comments

@ekelleyv
Copy link

From what I see there is no way to have a polygon (fill) stroke larger than the 1px border (because it uses the 1px strip from antialiasing I assume?). Am I missing a straightforward way to do this? It would be a very nice feature to have.

@ekelleyv
Copy link
Author

My first thought would be to draw the polygon both as a fill and then as a line, but cannot seem to get that to work.

@incanus
Copy link
Contributor

incanus commented Jun 16, 2014

Correct, this is static right now.

lineWidth(2.0f); // This is always fixed and does not depend on the pixelRatio!

Flagging this as a feature request.

@edenh
Copy link
Contributor

edenh commented Jun 16, 2014

My first thought would be to draw the polygon both as a fill and then as a line, but cannot seem to get that to work.

@ekelleyv that is correct. To draw the polygon as a line:

  • Add a separate bucket with "type": "line" and "feature_type": "fill"
  • Make sure "line-width" and "line-color" are defined in the style

@ekelleyv
Copy link
Author

@edenh Fantastic! That worked. Although I believe you meant just "width" and "color" in the style.

On an only slightly related note, how do I avoid the line drawing at the edge of the vector tile? I am creating custom vector tiles using node-mapnik. My guess is that the polygons are being clipped along the tile boundary, causing the render to draw lines there. Is this something y'all have encountered?

Great work on mapbox-gl, btw.

@kkaefer
Copy link
Member

kkaefer commented Jun 17, 2014

@ekelleyv To prevent border lines, we're using a buffered clipping, so that the vector tile actually contains a bit more data around the vector tile's clipping rect.

@ekelleyv ekelleyv reopened this Jun 17, 2014
@jfirebaugh
Copy link
Contributor

Tracking this in mapbox/mapbox-gl-style-spec#223.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants