What is the expected behaviour of isTileClipped
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
It's not clear to me how exactly isTileClipped is supposed to work, the only documentation I found was:
The drawing of the tiles to the stencil buffer is only performed when isTileClipped:
However, it seems like the most common drawing code (fill/line/symbol) expects there to have been the tile stencil written, and there is no error checking:
This means if you are naïve like me and set isTileClipped to false to allow your tiles to overdraw, then you will get really erratic behaviour from undefined being returned from the _tileClippingMaskIDs lookup in enableTileClippingMask (or whatever else might have happened depending on other sources in the drawing). Would be nice to perhaps make this an error (check that _tileClippingMaskIDs exists and that the entry on _tileClippingMaskIDs also exists), but it seems like perhaps the behaviour could also be to only enable the clipping masks when isTileClipped is true, which I think then should give the behaviour to allow lines / etc to draw outside of their tile...
I'd be happy to write a patch for it.
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 sections in src/source/source.js, src/render/painter.js, and src/render/draw_line.js, then trace enableTileClippingMask and the _tileClippingMaskIDs lookup. Determine the intended behavior when isTileClipped is false, including whether clipping should be skipped or treated as an error. Done means the behavior is defined and the resulting tile drawing is no longer erratic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- computer-graphics, frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100