diff --git a/src/data/bucket/line_bucket.js b/src/data/bucket/line_bucket.js index d15b18a4c8d..bb63e4d3a4e 100644 --- a/src/data/bucket/line_bucket.js +++ b/src/data/bucket/line_bucket.js @@ -274,8 +274,8 @@ class LineBucket implements Bucket { for (let i = first; i < len; i++) { - nextVertex = isPolygon && i === len - 1 ? - vertices[first + 1] : // if the line is closed, we treat the last vertex like the first + nextVertex = i === len - 1 ? + (isPolygon ? vertices[first + 1] : (undefined: any)) : // if it's a polygon, treat the last vertex like the first vertices[i + 1]; // just the next vertex // if two consecutive vertices exist, skip the current one diff --git a/src/style-spec/types.js b/src/style-spec/types.js index bd74a4f62ba..ecfab1078b5 100644 --- a/src/style-spec/types.js +++ b/src/style-spec/types.js @@ -88,7 +88,8 @@ export type VectorSourceSpecification = { "scheme"?: "xyz" | "tms", "minzoom"?: number, "maxzoom"?: number, - "attribution"?: string + "attribution"?: string, + "promoteId"?: PromoteIdSpecification } export type RasterSourceSpecification = { @@ -112,8 +113,7 @@ export type RasterDEMSourceSpecification = { "maxzoom"?: number, "tileSize"?: number, "attribution"?: string, - "encoding"?: "terrarium" | "mapbox", - "promoteId"?: PromoteIdSpecification + "encoding"?: "terrarium" | "mapbox" } export type GeoJSONSourceSpecification = {| diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#5171/expected.png b/test/integration/render-tests/regressions/mapbox-gl-js#5171/expected.png new file mode 100644 index 00000000000..8784429cebc Binary files /dev/null and b/test/integration/render-tests/regressions/mapbox-gl-js#5171/expected.png differ diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#5171/style.json b/test/integration/render-tests/regressions/mapbox-gl-js#5171/style.json new file mode 100644 index 00000000000..bbcbe066ed0 --- /dev/null +++ b/test/integration/render-tests/regressions/mapbox-gl-js#5171/style.json @@ -0,0 +1,35 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 32 + } + }, + "center": [-0.63938, 44.77458], + "zoom": 18, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "LineString", + "coordinates": [ + [-0.639208, 44.774651], + [-0.639605, 44.774487], + [-0.639605, 44.774487] + ] + } + } + }, + "layers": [ + { + "id": "line", + "type": "line", + "source": "geojson", + "paint": { + "line-color": "#f44336", + "line-width": 10 + } + } + ] +}