-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable property functions for text-field, text-transform (#4074)
* Enable property functions for text-field, text-transform * Do not perform text-field token replacement on property functions * Add test for text-field token replacement * Skip text-{field,transform} property function tests on native * Update resolve_text test * Simplify render tests
- Loading branch information
1 parent
3e4cab4
commit 66eea65
Showing
12 changed files
with
255 additions
and
24 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions
44
test/integration/render-tests/text-field/literal/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,44 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"height": 64, | ||
"width": 64 | ||
} | ||
}, | ||
"center": [ 0, 0 ], | ||
"zoom": 0, | ||
"sources": { | ||
"point": { | ||
"type": "geojson", | ||
"data": { | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ 0, 0 ] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf", | ||
"layers": [ | ||
{ | ||
"id": "text", | ||
"type": "symbol", | ||
"source": "point", | ||
"layout": { | ||
"text-field": "Test", | ||
"text-font": [ | ||
"Open Sans Semibold", | ||
"Arial Unicode MS Bold" | ||
] | ||
} | ||
} | ||
] | ||
} |
Binary file added
BIN
+1.1 KB
test/integration/render-tests/text-field/property-function/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/text-field/property-function/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": { | ||
"height": 64, | ||
"width": 64, | ||
"skipped": { | ||
"native": "https://github.com/mapbox/mapbox-gl-native/issues/4860" | ||
} | ||
} | ||
}, | ||
"center": [ 0, 0 ], | ||
"zoom": 0, | ||
"sources": { | ||
"point": { | ||
"type": "geojson", | ||
"data": { | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { "x": 1 }, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ 0, -10 ] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { "x": 0 }, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ 0, 10 ] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf", | ||
"layers": [ | ||
{ | ||
"id": "text", | ||
"type": "symbol", | ||
"source": "point", | ||
"layout": { | ||
"text-field": { | ||
"type": "categorical", | ||
"property": "x", | ||
"stops": [ | ||
[0, "Zero"], | ||
[1, "One"] | ||
] | ||
}, | ||
"text-font": [ | ||
"Open Sans Semibold", | ||
"Arial Unicode MS Bold" | ||
] | ||
} | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"height": 64, | ||
"width": 64 | ||
} | ||
}, | ||
"center": [ 0, 0 ], | ||
"zoom": 0, | ||
"sources": { | ||
"point": { | ||
"type": "geojson", | ||
"data": { | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { "x": 1 }, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ 0, -10 ] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { "x": 0 }, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ 0, 10 ] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf", | ||
"layers": [ | ||
{ | ||
"id": "text", | ||
"type": "symbol", | ||
"source": "point", | ||
"layout": { | ||
"text-field": "Test {x}", | ||
"text-font": [ | ||
"Open Sans Semibold", | ||
"Arial Unicode MS Bold" | ||
] | ||
} | ||
} | ||
] | ||
} |
Binary file added
BIN
+1.12 KB
test/integration/render-tests/text-transform/property-function/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions
63
test/integration/render-tests/text-transform/property-function/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,63 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"height": 64, | ||
"width": 64, | ||
"skipped": { | ||
"native": "https://github.com/mapbox/mapbox-gl-native/issues/4860" | ||
} | ||
} | ||
}, | ||
"center": [ 0, 0 ], | ||
"zoom": 0, | ||
"sources": { | ||
"point": { | ||
"type": "geojson", | ||
"data": { | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { "x": 0 }, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ 0, -10 ] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { "x": 1 }, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ 0, 10 ] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf", | ||
"layers": [ | ||
{ | ||
"id": "text", | ||
"type": "symbol", | ||
"source": "point", | ||
"layout": { | ||
"text-field": "hello", | ||
"text-transform": { | ||
"type": "categorical", | ||
"property": "x", | ||
"stops": [ | ||
[0, "uppercase"], | ||
[1, "lowercase"] | ||
] | ||
}, | ||
"text-font": [ | ||
"Open Sans Semibold", | ||
"Arial Unicode MS Bold" | ||
] | ||
} | ||
} | ||
] | ||
} |
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