mapbox / mapbox/mapbox-gl-js

Refactor Map, introducing Style and Camera as public APIs

Open
#7,070 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api :memo: breaking change :warning: GL native → GL JS
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.