-
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.
Fix promoteId for line layers (#9210)
* fix promoteId for line layers * fix promoteId spec definitions (#9212) * Add render tests for feature state feature-state/promote-id-line will fail until #9210 is merged Co-authored-by: Karim Naaji <karim.naaji@gmail.com>
- Loading branch information
Showing
12 changed files
with
496 additions
and
2 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
Binary file added
BIN
+350 Bytes
test/integration/render-tests/feature-state/promote-id-circle/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Binary file added
BIN
+2.14 KB
test/integration/render-tests/feature-state/promote-id-fill-extrusion/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
161 changes: 161 additions & 0 deletions
161
test/integration/render-tests/feature-state/promote-id-fill-extrusion/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,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" | ||
] | ||
} | ||
} | ||
] | ||
} |
Binary file added
BIN
+126 Bytes
test/integration/render-tests/feature-state/promote-id-fill/expected.png
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
114
test/integration/render-tests/feature-state/promote-id-fill/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,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" | ||
] | ||
} | ||
} | ||
] | ||
} |
Binary file added
BIN
+166 Bytes
test/integration/render-tests/feature-state/promote-id-line/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.