Mapbox-gl-native: Polygon stroke width

Created on 16 Jun 2014  路  6Comments  路  Source: mapbox/mapbox-gl-native

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.

feature

Most helpful comment

All 6 comments

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.

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

@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.

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jmkiley picture jmkiley  路  3Comments

rshev picture rshev  路  4Comments

lamhuynh96 picture lamhuynh96  路  3Comments

cmxyzx picture cmxyzx  路  3Comments

melihcolpan picture melihcolpan  路  3Comments