-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue #6919: bring gl-js collision handling closer to gl-native
- Don't place features that _have_ text but don't have collision boxes - Create a single collision box even when the length of a label is less than half the box size Test updates: - Add debug collision circles to line-center to verify collision behavior - Add regression test that exercises case where a line label is almost exactly the same length as its line
- Loading branch information
Showing
8 changed files
with
72 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+8.03 KB
test/integration/render-tests/regressions/mapbox-gl-js#6919/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions
62
test/integration/render-tests/regressions/mapbox-gl-js#6919/style.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"debug": true, | ||
"collisionDebug": true, | ||
"description": "'Carribean Sea' crosses a tile boundary, but we don't draw the tile boundary in the test because JS and Native render tile boundaries differently.", | ||
"height": 256, | ||
"width": 1024 | ||
} | ||
}, | ||
"center": [ | ||
-73, | ||
15 | ||
], | ||
"zoom": 4.5, | ||
"sources": { | ||
"mapbox": { | ||
"type": "vector", | ||
"maxzoom": 14, | ||
"tiles": [ | ||
"local://tiles/mapbox.mapbox-streets-v7/{z}-{x}-{y}.mvt" | ||
] | ||
} | ||
}, | ||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf", | ||
"layers": [ | ||
{ | ||
"id": "background", | ||
"type": "background", | ||
"paint": { | ||
"background-color": "white" | ||
} | ||
}, | ||
{ | ||
"id": "line-center", | ||
"type": "symbol", | ||
"source": "mapbox", | ||
"source-layer": "marine_label", | ||
"layout": { | ||
"text-field": "{name_en}", | ||
"symbol-placement": "line-center", | ||
"text-allow-overlap": true, | ||
"text-size": 50, | ||
"text-letter-spacing": 0.5, | ||
"text-font": [ | ||
"Open Sans Semibold", | ||
"Arial Unicode MS Bold" | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "line", | ||
"type": "line", | ||
"source": "mapbox", | ||
"source-layer": "marine_label", | ||
"paint": { | ||
"line-width": 1 | ||
} | ||
} | ||
] | ||
} |
Binary file modified
BIN
-3.43 KB
(84%)
test/integration/render-tests/symbol-placement/line-center-buffer/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+22.4 KB
(140%)
test/integration/render-tests/symbol-placement/line-center/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"collisionDebug": true, | ||
"height": 512 | ||
} | ||
}, | ||
|