mapbox / mapbox/geo-viewport

Output floats for zoom levels in viewport function

Open
#10 3 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
197
Forks
39
PR merge metrics
No merged PRs in 30d

Description

Similar to #5 but to add support for floats for the viewport() function instead of the bounds()function.

Given the new Static Map API supports zoom levels up to two decimal places, it would be great to have an option to yield such value by removing the Math.floor() in the return.

Unlike the bounds() function, this would not require upstream changes in SphericalMercator.

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 at the viewport() function and locate the return expression that applies Math.floor(). Confirm how zoom is currently produced and check the existing tests or usage around viewport(); done means the function can return zoom values with up to two decimal places without requiring SphericalMercator changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.