Skip to content

Commit

Permalink
Update tests for visibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren Budorick committed Jan 23, 2015
1 parent dba0f2b commit 467b996
Show file tree
Hide file tree
Showing 28 changed files with 472 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/background-visibility/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"visible": {
"center": [0, 0],
"zoom": 0,
"width": 64,
"height": 64,
"classes": ["visible"]
},
"none": {
"center": [0, 0],
"zoom": 0,
"width": 64,
"height": 64,
"classes": ["none"]
}
}
Binary file added tests/background-visibility/none/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions tests/background-visibility/style.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"version": 6,
"sources": {
"mapbox": {
"type": "vector",
"maxzoom": 14,
"tiles": ["local://tiles/{z}-{x}-{y}.vector.pbf"]
}
},
"layers": [
{
"id": "background-visible",
"type": "background",
"layout": {
"visibility": "visible"
},
"paint": {
"background-color": "red",
"background-opacity": 0
},
"paint.visible": {
"background-opacity": 1
}
},
{
"id": "background-none",
"type": "background",
"layout": {
"visibility": "none"
},
"paint": {
"background-color": "red",
"background-opacity": 0
},
"paint.none": {
"background-opacity": 1
}
}
]
}
Binary file added tests/background-visibility/visible/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions tests/fill-visibility/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"visible": {
"center": [0, 0],
"zoom": 0,
"width": 64,
"height": 64,
"classes": ["visible"]
},
"none": {
"center": [0, 0],
"zoom": 0,
"width": 64,
"height": 64,
"classes": ["none"]
}
}
Binary file added tests/fill-visibility/none/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions tests/fill-visibility/style.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"version": 6,
"sources": {
"mapbox": {
"type": "vector",
"maxzoom": 14,
"tiles": ["local://tiles/{z}-{x}-{y}.vector.pbf"]
}
},
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "white"
}
},
{
"id": "fill-visible",
"type": "fill",
"source": "mapbox",
"source-layer": "water",
"layout": {
"visibility": "visible"
},
"paint": {
"fill-color": "#000",
"fill-opacity": 0
},
"paint.visible": {
"fill-opacity": 1
}
},
{
"id": "fill-none",
"type": "fill",
"source": "mapbox",
"source-layer": "water",
"layout": {
"visibility": "none"
},
"paint": {
"fill-color": "#000",
"fill-opacity": 0
},
"paint.none": {
"fill-opacity": 1
}
}
]
}
Binary file added tests/fill-visibility/visible/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions tests/icon-visibility/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"visible": {
"zoom": 16,
"center": [52.499167, 13.418056],
"height": 256,
"classes": ["visible"]
},
"none": {
"zoom": 16,
"center": [52.499167, 13.418056],
"height": 256,
"classes": ["none"]
}
}
Binary file added tests/icon-visibility/none/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 tests/icon-visibility/style.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"version": 6,
"sources": {
"mapbox": {
"type": "vector",
"maxzoom": 14,
"tiles": ["local://tiles/{z}-{x}-{y}.vector.pbf"]
}
},
"sprite": "local://sprites/sprite",
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "white"
}
},
{
"id": "icon-visible",
"type": "symbol",
"source": "mapbox",
"source-layer": "poi_label",
"filter": ["==", "maki", "restaurant"],
"layout": {
"symbol-placement": "point",
"icon-allow-overlap": true,
"icon-ignore-placement": true,
"icon-image": "{maki}-12",
"icon-rotation-alignment": "viewport",
"visibility": "visible"
},
"paint": {
"icon-opacity": 0
},
"paint.visible": {
"icon-opacity": 1
}
},
{
"id": "icon-none",
"type": "symbol",
"source": "mapbox",
"source-layer": "poi_label",
"filter": ["==", "maki", "restaurant"],
"layout": {
"symbol-placement": "point",
"icon-allow-overlap": true,
"icon-ignore-placement": true,
"icon-image": "{maki}-12",
"icon-rotation-alignment": "viewport",
"visibility": "none"
},
"paint": {
"icon-opacity": 0
},
"paint.none": {
"icon-opacity": 1
}
}
]
}
Binary file added tests/icon-visibility/visible/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions tests/line-visibility/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"visible": {
"zoom": 16,
"center": [52.499167, 13.418056],
"height": 256,
"bearing": 90,
"classes": ["visible"]
},
"none": {
"zoom": 16,
"center": [52.499167, 13.418056],
"height": 256,
"bearing": 90,
"classes": ["none"]
}
}
Binary file added tests/line-visibility/none/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions tests/line-visibility/style.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"version": 6,
"sources": {
"mapbox": {
"type": "vector",
"maxzoom": 14,
"tiles": ["local://tiles/{z}-{x}-{y}.vector.pbf"]
}
},
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "white"
}
},
{
"id": "line-visible",
"type": "line",
"source": "mapbox",
"source-layer": "road",
"layout": {
"visibility": "visible"
},
"paint": {
"line-opacity": 0
},
"paint.visible": {
"line-opacity": 1
}
},
{
"id": "line-none",
"type": "line",
"source": "mapbox",
"source-layer": "road",
"layout": {
"visibility": "none"
},
"paint": {
"line-opacity": 0
},
"paint.none": {
"line-opacity": 1
}
}
]
}
Binary file added tests/line-visibility/visible/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions tests/raster-visibility/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"visible": {
"zoom": 16,
"center": [52.499167, 13.418056],
"height": 256,
"classes": ["visible"]
},
"none": {
"zoom": 16,
"center": [52.499167, 13.418056],
"height": 256,
"classes": ["none"]
}
}
Binary file added tests/raster-visibility/none/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions tests/raster-visibility/style.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"version": 6,
"sources": {
"satellite": {
"type": "raster",
"tiles": ["local://tiles/{z}-{x}-{y}.satellite.png"],
"maxzoom": 17,
"tileSize": 256
}
},
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "white"
}
},
{
"id": "raster-visible",
"type": "raster",
"source": "satellite",
"layout": {
"visibility": "visible"
},
"paint": {
"raster-opacity": 0,
"raster-fade-duration": 0
},
"paint.visible": {
"raster-opacity": 1
}
},
{
"id": "raster-none",
"type": "raster",
"source": "satellite",
"layout": {
"visibility": "none"
},
"paint": {
"raster-opacity": 0,
"raster-fade-duration": 0
},
"paint.none": {
"raster-opacity": 1
}
}
]
}
Binary file added tests/raster-visibility/visible/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions tests/symbol-visibility/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"visible": {
"zoom": 16,
"center": [52.499167, 13.418056],
"height": 256,
"classes": ["visible"]
},
"none": {
"zoom": 16,
"center": [52.499167, 13.418056],
"height": 256,
"classes": ["none"]
}
}
Binary file added tests/symbol-visibility/none/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 467b996

Please sign in to comment.