diff --git a/test/integration/render-tests/debug/collision-lines-non-center-alignment/expected.png b/test/integration/render-tests/debug/collision-lines-non-center-alignment/expected.png new file mode 100644 index 00000000000..990142b59bf Binary files /dev/null and b/test/integration/render-tests/debug/collision-lines-non-center-alignment/expected.png differ diff --git a/test/integration/render-tests/debug/collision-lines-non-center-alignment/style.json b/test/integration/render-tests/debug/collision-lines-non-center-alignment/style.json new file mode 100644 index 00000000000..0f842866be0 --- /dev/null +++ b/test/integration/render-tests/debug/collision-lines-non-center-alignment/style.json @@ -0,0 +1,78 @@ +{ + "version": 8, + "metadata": { + "test": { + "collisionDebug": true, + "width": 512, + "height": 512 + } + }, + "center": [ + 0, + 0 + ], + "zoom": 4, + "pitch": 0, + "bearing": 0, + "sources": { + "geojson": { + "type": "geojson", + "maxzoom": 1, + "data": { + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "properties": { + "name": "abcdefg" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -5, 4 ], [ 5, 4 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abcdefg" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 5, -4 ], [ -5, -4 ] + ] + } + + }] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "{name}", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "symbol-placement": "line", + "symbol-spacing": 100, + "text-pitch-alignment": "map", + "text-anchor": "right" + } + } + ] +} diff --git a/test/integration/render-tests/debug/collision-lines-pitched-2/expected.png b/test/integration/render-tests/debug/collision-lines-pitched-2/expected.png new file mode 100644 index 00000000000..9f0856e2c71 Binary files /dev/null and b/test/integration/render-tests/debug/collision-lines-pitched-2/expected.png differ diff --git a/test/integration/render-tests/debug/collision-lines-pitched-2/style.json b/test/integration/render-tests/debug/collision-lines-pitched-2/style.json new file mode 100644 index 00000000000..bc99bfa3536 --- /dev/null +++ b/test/integration/render-tests/debug/collision-lines-pitched-2/style.json @@ -0,0 +1,76 @@ +{ + "version": 8, + "metadata": { + "test": { + "collisionDebug": true, + "width": 512, + "height": 512 + } + }, + "center": [ + 0, + 0 + ], + "zoom": 4, + "pitch": 60, + "bearing": 90, + "sources": { + "geojson": { + "type": "geojson", + "maxzoom": 1, + "data": { + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "properties": { + "name": "Some sentence that is quite long" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -20, 4 ], [ 20, 4 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "Another sentence that is even longer than the previous one" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0, 0 ], [ 50, 0 ] + ] + } + + }] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "{name}", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "symbol-placement": "line", + "text-pitch-alignment": "map" + } + } + ] +} diff --git a/test/integration/render-tests/debug/collision-lines-simple-words-pitched/expected.png b/test/integration/render-tests/debug/collision-lines-simple-words-pitched/expected.png new file mode 100644 index 00000000000..b0d13f8237f Binary files /dev/null and b/test/integration/render-tests/debug/collision-lines-simple-words-pitched/expected.png differ diff --git a/test/integration/render-tests/debug/collision-lines-simple-words-pitched/style.json b/test/integration/render-tests/debug/collision-lines-simple-words-pitched/style.json new file mode 100644 index 00000000000..8fd8b7a4f3f --- /dev/null +++ b/test/integration/render-tests/debug/collision-lines-simple-words-pitched/style.json @@ -0,0 +1,128 @@ +{ + "version": 8, + "metadata": { + "test": { + "collisionDebug": true, + "width": 512, + "height": 512 + } + }, + "center": [ + 0, + 0 + ], + "zoom": 4, + "pitch": 60, + "sources": { + "geojson": { + "type": "geojson", + "maxzoom": 1, + "data": { + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "properties": { + "name": "a" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -5, 4 ], [ -1, 4 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "ab" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -5, 0 ], [ -1, 0 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abc" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -5, -4 ], [ -1, -4 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abcd" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 1, 4 ], [ 5, 4 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abcde" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 1, 0 ], [ 5, 0 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abcdef" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 1, -4 ], [ 5, -4 ] + ] + } + + }] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "{name}", + "symbol-spacing": 30, + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "symbol-placement": "line", + "text-pitch-alignment": "viewport" + } + } + ] +} diff --git a/test/integration/render-tests/debug/collision-lines-simple-words/expected.png b/test/integration/render-tests/debug/collision-lines-simple-words/expected.png new file mode 100644 index 00000000000..590ebd449cf Binary files /dev/null and b/test/integration/render-tests/debug/collision-lines-simple-words/expected.png differ diff --git a/test/integration/render-tests/debug/collision-lines-simple-words/style.json b/test/integration/render-tests/debug/collision-lines-simple-words/style.json new file mode 100644 index 00000000000..e2e84a8ac01 --- /dev/null +++ b/test/integration/render-tests/debug/collision-lines-simple-words/style.json @@ -0,0 +1,126 @@ +{ + "version": 8, + "metadata": { + "test": { + "collisionDebug": true, + "width": 512, + "height": 128 + } + }, + "center": [ + 0, + 0 + ], + "zoom": 4, + "sources": { + "geojson": { + "type": "geojson", + "maxzoom": 1, + "data": { + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "properties": { + "name": "a" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -5, 2 ], [ -1, 2 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "ab" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -5, 0 ], [ -1, 0 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abc" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -5, -2 ], [ -1, -2 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abcd" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 1, 2 ], [ 5, 2 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abcde" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 1, 0 ], [ 5, 0 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abcdef" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 1, -2 ], [ 5, -2 ] + ] + } + + }] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "{name}", + "symbol-spacing": 30, + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "symbol-placement": "line" + } + } + ] +}