mapbox / mapbox/spritezero

Don't use Mapnik in generateLayout?

Open
#51 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

icebox jira-sync-complete p3
Dominant language
JavaScript
Stars
186
Forks
70
PR merge metrics
No merged PRs in 30d

Description

Currently, spritezero uses [Mapnik in the generateLayout step](https://github.com/mapbox/spritezero/blob/master/index.js#L118-L129). While this is helpful when the layout is passed to `generateImage`, it is a lot of unneeded work when the layout json is all an application needs.

Can we move this logic to the generateImage step? It would mean needing to calculate an icons width with something other than Mapnik Image.

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 in index.js at the generateLayout logic linked in the issue, then trace how its layout is passed to generateImage. Determine which Mapnik work is only needed for image generation and how icon widths can be calculated without Mapnik Image. Done means layout-only callers avoid that work while generateImage still produces correct sprites.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.