Add `map.setSprite(spriteUrl)`method
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
The style diff utility defines an [operation to change the sprite sheet](https://github.com/mapbox/mapbox-gl-style-spec/blob/ef23dd1e8141a60bac2a0ed0fe3ec2ec9e792d82/lib/diff.js#L77-L80) for a style. Mapbox GL JS does not support this method currently causing a fall back to the more invasive setStyle when this operation is encountered.
When this method is invoked, the current sprite sheet should be removed and recreated.
Minimally `setSprite(spriteUrl)` should be added to the style batch, it would also be helpful to expose this method on the map instance.
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 by reading the style diff operation in lib/diff.js at the linked lines, then trace the style batch and map instance entry points in Mapbox GL JS. Done means setSprite(spriteUrl) is supported, the current sprite sheet is removed and recreated, and the fallback to setStyle is avoided when this operation is encountered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100