Skip to content

Commit

Permalink
Add render tests for feature state
Browse files Browse the repository at this point in the history
feature-state/promote-id-line will fail until #9210 is merged
  • Loading branch information
Karim Naaji committed Jan 22, 2020
1 parent 87f3393 commit 40c83f3
Show file tree
Hide file tree
Showing 18 changed files with 494 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.
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"version": 8,
"metadata": {
"test": {
"height": 128,
"width": 512,
"operations": [
[
"setFeatureState",
{
"source": "geojson",
"id": "9007199254740992"
},
{
"color": "red"
}
],
[
"setFeatureState",
{
"source": "geojson",
"id": "1.2"
},
{
"color": "blue"
}
],
[
"wait"
]
]
}
},
"sources": {
"geojson": {
"type": "geojson",
"promoteId": "foo",
"data": {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-0.0005,
-0.0001
],
[
-0.0005,
0.0001
],
[
-0.0003,
0.0001
],
[
-0.0003,
-0.0001
],
[
-0.0005,
-0.0001
]
]
]
},
"properties": {
"foo": "9007199254740992"
}
}, {
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-0.0001,
-0.0001
],
[
-0.0001,
0.0001
],
[
0.0001,
0.0001
],
[
0.0001,
-0.0001
],
[
-0.0001,
-0.0001
]
]
]
},
"properties": {
"foo": "9007199254740993"
}
}, {
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
0.0003,
-0.0001
],
[
0.0003,
0.0001
],
[
0.0005,
0.0001
],
[
0.0005,
-0.0001
],
[
0.0003,
-0.0001
]
]
]
},
"properties": {
"foo": "1.2"
}
}]
}
}
},
"pitch": 60,
"zoom": 18,
"layers": [
{
"id": "fill-extrusion",
"type": "fill-extrusion",
"source": "geojson",
"paint": {
"fill-extrusion-height": 10,
"fill-extrusion-base": 0,
"fill-extrusion-color": [
"coalesce",
[
"feature-state",
"color"
],
"black"
]
}
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 114 additions & 0 deletions test/integration/render-tests/feature-state/promote-id-fill/style.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"version": 8,
"metadata": {
"test": {
"width": 64,
"height": 32,
"operations": [
[
"setFeatureState",
{
"source": "geojson",
"id": "9007199254740992"
},
{
"color": "red"
}
],
[
"setFeatureState",
{
"source": "geojson",
"id": "1.2"
},
{
"color": "blue"
}
],
[
"wait"
]
]
}
},
"zoom": 2,
"sources": {
"geojson": {
"type": "geojson",
"promoteId": "foo",
"data": {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[ -5, -1 ],
[ -5, 1 ],
[ -3, 1 ],
[ -3, -1 ],
[ -5, -1 ]
]
]
},
"properties": {
"foo": "9007199254740992"
}
}, {
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[ -1, -1 ],
[ -1, 1 ],
[ 1, 1 ],
[ 1, -1 ],
[ -0.5, -1 ]
]
]
},
"properties": {
"foo": "9007199254740993"
}
}, {
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[ 3, -1 ],
[ 3, 1 ],
[ 5, 1 ],
[ 5, -1 ],
[ 3, -1 ]
]
]
},
"properties": {
"foo": "1.2"
}
}]
}
}
},
"layers": [
{
"id": "fill",
"type": "fill",
"source": "geojson",
"paint": {
"fill-antialias": false,
"fill-color": [
"coalesce",
[
"feature-state",
"color"
],
"black"
]
}
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
116 changes: 116 additions & 0 deletions test/integration/render-tests/feature-state/promote-id-line/style.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"version": 8,
"metadata": {
"test": {
"width": 64,
"height": 32,
"operations": [
[
"setFeatureState",
{
"source": "geojson",
"id": "9007199254740992"
},
{
"color": "red"
}
],
[
"setFeatureState",
{
"source": "geojson",
"id": "1.2"
},
{
"color": "blue"
}
],
[
"wait"
]
]
}
},
"sources": {
"geojson": {
"type": "geojson",
"promoteId": "foo",
"data": {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[
-10,
-10
],
[
-10,
10
]
]
},
"properties": {
"foo": "9007199254740992"
}
}, {
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[
0,
-10
],
[
0,
10
]
]
},
"properties": {
"foo": "9007199254740993"
}
}, {
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[
10,
-10
],
[
10,
10
]
]
},
"properties": {
"foo": "1.2"
}
}]
}
}
},
"layers": [
{
"id": "line",
"type": "line",
"source": "geojson",
"paint": {
"line-width": 5,
"line-color": [
"coalesce",
[
"feature-state",
"color"
],
"black"
]
}
}
]
}
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 40c83f3

Please sign in to comment.