mapbox / mapbox/mapbox-gl-js

Refactor Tile into separate classes

Open
#5,444 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

refactoring :building_construction:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

We currently stick a lot of state in Tile objects, the particular properties used depending on the source type.

We should probably move to a small hierarchy similar to to gl-native, with, e.g. RasterTile being distinct from VectorTile. The latter would still require quite a bit of state, which it might be good to organize a bit, e.g. by grouping symbol placement & collision data into its own structure.

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 with src/source/tile.js lines 47-84 to inventory the state currently shared by Tile and identify which properties depend on source type. Compare the proposed hierarchy with the gl-native approach, then determine how RasterTile, VectorTile, and the symbol placement and collision data should be organized; done means the design is agreed and the affected tile behavior remains covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.