Skip to content

Commit

Permalink
Add tests for layout functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren Budorick committed Jan 29, 2015
1 parent 3b6135f commit 07d6424
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions tests/text-letter-spacing/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,17 @@
"center": [52.499167, 13.418056],
"height": 256,
"classes": ["constant"]
},
"function-close": {
"zoom": 14,
"center": [52.499167, 13.418056],
"height": 256,
"classes": ["function-close"]
},
"function-far": {
"zoom": 15,
"center": [52.499167, 13.418056],
"height": 256,
"classes": ["function-far"]
}
}
25 changes: 25 additions & 0 deletions tests/text-letter-spacing/style.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,30 @@
"paint.constant": {
"text-opacity": 1
}
}, {
"id": "functions",
"type": "symbol",
"source": "mapbox",
"source-layer": "poi_label",
"filter": ["==", "maki", "restaurant"],
"layout": {
"symbol-placement": "point",
"text-allow-overlap": true,
"text-ignore-placement": true,
"text-field": "Test",
"text-font": "Open Sans Semibold, Arial Unicode MS Bold",
"text-letter-spacing": {
"stops": [[14, -4], [15, 4]]
}
},
"paint": {
"text-opacity": 0
},
"paint.function-close": {
"text-opacity": 1
},
"paint.function-far": {
"text-opacity": 1
}
}]
}
Binary file added tests/text-rotate/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.
6 changes: 6 additions & 0 deletions tests/text-rotate/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,11 @@
"center": [52.499167, 13.418056],
"height": 256,
"classes": ["anchor-bottom"]
},
"function": {
"zoom": 14,
"center": [52.499167, 13.418056],
"height": 256,
"classes": ["function"]
}
}
22 changes: 22 additions & 0 deletions tests/text-rotate/style.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,27 @@
"icon-opacity": 1,
"text-opacity": 1
}
}, {
"id": "function",
"type": "symbol",
"source": "mapbox",
"source-layer": "poi_label",
"filter": ["==", "maki", "restaurant"],
"layout": {
"symbol-placement": "point",
"text-field": "Test",
"text-font": "Open Sans Semibold, Arial Unicode MS Bold",
"text-rotate": {
"stops": [[10, 0], [16, 270]]
}
},
"paint": {
"icon-opacity": 0,
"text-opacity": 0
},
"paint.function": {
"icon-opacity": 1,
"text-opacity": 1
}
}]
}

0 comments on commit 07d6424

Please sign in to comment.