-
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.
do not hide icons if text is an empty string (#6164)
Empty text strings do not have any collision boxes so the collision index check was never done and the text was not counted as "placed". This fixes that by making "placed" the default when the feature has text. fix #6160
- Loading branch information
Showing
4 changed files
with
87 additions
and
14 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
+1.66 KB
test/integration/render-tests/regressions/mapbox-gl-js#6160/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions
73
test/integration/render-tests/regressions/mapbox-gl-js#6160/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,73 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"width": 64, | ||
"height": 64, | ||
"description": "Checks that icons are not hidden when the text is an empty string" | ||
} | ||
}, | ||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf", | ||
"sources": { | ||
"geojson": { | ||
"type": "geojson", | ||
"data": { | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
0, | ||
0 | ||
] | ||
}, | ||
"properties": { | ||
"text": "OK" | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
20, | ||
0 | ||
] | ||
}, | ||
"properties": { | ||
"text": "" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"sprite": "local://sprites/sprite", | ||
"layers": [ | ||
{ | ||
"id": "symbol", | ||
"type": "symbol", | ||
"source": "geojson", | ||
"layout": { | ||
"symbol-placement": "point", | ||
"text-allow-overlap": true, | ||
"icon-allow-overlap": true, | ||
"icon-image": "triangle-12", | ||
"text-field": "{text}", | ||
"text-font": [ | ||
"Open Sans Semibold", | ||
"Arial Unicode MS Bold" | ||
] | ||
}, | ||
"paint": { | ||
"icon-opacity": 0.5, | ||
"text-translate": [ | ||
-10, | ||
0 | ||
] | ||
} | ||
} | ||
] | ||
} |