Don't throw and crash renderer if `pitch` or `distance-from-center` is used on non-symbol types
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
A layer like this will cause the renderer to fail
```js
{
id: 'foo',
type: 'circle',
source: 'composite',
'source-layer': 'poi_label',
filter: [
'all',
['==', ['geometry-type'], 'Symbol'],
['>', ['pitch'], 30] // The culprit
]
}
```
It's technically incorrect ([they are only valid for symbol layers](https://github.com/mapbox/mapbox-gl-js/blob/f6eb04c5019c305548546314809acfb93f7f9ad2/src/style-spec/reference/v8.json#L3237-L3254)) but the result is pretty grim and results in a blank map.

Could this instead `console.warn` that these expression properties are only supported for symbols and not prevent the map rendering?
---
- **Demo**: https://jsfiddle.net/tristen/p2arnvfh/
- **Version**: `v2.6.1`
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 with the linked JSFiddle demo and inspect the expression-property validity described in src/style-spec/reference/v8.json, focusing on the renderer path that handles pitch or distance-from-center for non-symbol layers. Done means the invalid expression produces a console warning rather than crashing, and the map continues rendering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100