setPaintProperty will request tiles again
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
### mapbox-gl-js version
v3.8.0
### Browser and version
141.0.7390.65
### Expected behavior
Tiles are not requested again when running `setPaintProperty`
### Actual behavior
Tiles are requested again when running `setPaintProperty`
### Link to the demonstration
_No response_
### Steps to trigger the unexpected behavior
When i run `setPaintProperty` on our vector tiles (running on our own tileservice, created with tippicanou) than it request some tiles again.
its happen for example when i switch between this two styles.
```
map.setPaintProperty("cableLayer", "line-color", "red")
```
```
map.setPaintProperty("cableLayer", "line-color", [
"case",
[
"==",
[
"get",
"type"
]
,
"5"
],
"#686868",
"#686768"
]
)
```
but not when i run the same style again or this, without `get`
```
map.setPaintProperty("cableLayer", "line-color", [
"case",
[
"==",
[
"string", //<==========
"type"
]
,
"5"
],
"#686868",
"#686768"
]
)
```
so i beleave its happend because of the `get` expression.
i tested it also on the default mapbox style but woudnt get this behaviour.
this is the source config
```
{
"type": "vector",
"promoteId": {
"cable": "id"
},
"tiles": [
"https://xxxxx.com/{z}/{x}/{y}?regionId=yyyyy&scenarioId=defaultScenario&year=2025"
],
"bounds": [
6.005877,
51.617003,
6.229508,
51.791297
],
"minzoom": 10,
"maxzoom": 18
}
```
### Relevant log output
```shell
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the map.setPaintProperty entry point and reproduce the supplied vector-source case with the two line-color expressions, comparing tile requests for get versus string. Confirm the behavior with a minimal example and identify whether the extra requests are expected; done means the cause and a reliable regression test or reproduction are established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100