fix(core): repaint feature-state-driven symbol paint properties (#4445)

This commit is contained in:
Brandon Roeder
2026-08-04 11:17:53 -05:00
committed by GitHub
parent 5e6fd6bb78
commit a34723ff4a
6 changed files with 122 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

View File

@@ -0,0 +1,106 @@
{
"version": 8,
"metadata": {
"test": {
"width": 64,
"height": 64,
"operations": [
[
"wait"
],
[
"setFeatureState",
{
"source": "geojson",
"id": "red"
},
{
"color": "red"
}
],
[
"wait"
]
]
}
},
"zoom": 2,
"sprite": "local://sprites/sprite",
"glyphs": "local://glyphs/{fontstack}/{range}.pbf",
"sources": {
"geojson": {
"type": "geojson",
"data": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "red",
"geometry": {
"type": "Point",
"coordinates": [
0,
0
]
},
"properties": {
"label": "R"
}
}
]
}
}
},
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "white"
}
},
{
"id": "symbol",
"type": "symbol",
"source": "geojson",
"layout": {
"icon-image": "dot.sdf",
"icon-allow-overlap": true,
"icon-ignore-placement": true,
"text-field": [
"get",
"label"
],
"text-font": [
"Open Sans Semibold",
"Arial Unicode MS Bold"
],
"text-size": 14,
"text-offset": [
0,
1.5
],
"text-allow-overlap": true,
"text-ignore-placement": true
},
"paint": {
"icon-color": [
"coalesce",
[
"feature-state",
"color"
],
"black"
],
"text-color": [
"coalesce",
[
"feature-state",
"color"
],
"black"
]
}
}
]
}