Refactor Map, introducing Style and Camera as public APIs
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
In the current Mapbox GL JS API, almost the entirety of the API surface area lives on Map, making it a God object.
In particular, it isn't possible to manipulate a style via the runtime styling API, or a camera via the camera API, without either being associated with a live-rendering map. Separating Style and Camera classes from Map would improve Mapbox GL JS's internal architecture and make the external API more flexible. For example, a map-independent Camera would be a natural way to implement Map-independent projection/unprojection. In addition, it would bring GL JS closer to Native, which has public Style and Layer classes (though not Camera, yet).
This is a continuation/reframing of #2741.
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 reviewing the existing Map API and the runtime styling and camera APIs described in the issue. Define the boundaries of public Style and Camera classes and how they operate independently of a live-rendering map. Done means the API surface is separated as proposed and remains consistent with the stated Mapbox Native alignment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, frontend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100