mapbox / mapbox/sphericalmercator

bbox does not respect tile size

Open
#39 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
288
Forks
51
PR merge metrics
No merged PRs in 30d

Description

Despite initialising SphericalMercator with a different tile size, `.bbox` returns identical latitude and longitude coordinates for the same inputs, which suggests that tile size is not being taken into account.

Example:
```javascript
const SM = require("@mapbox/sphericalmercator")
const sm1 = new SM({ size: 256 });
sm1.bbox(8298, 5450, 14);
// [ 2.3291015625, 51.467696956223364, 2.35107421875, 51.481382896100975 ]
const sm2 = new SM({ size: 512 });
sm2.bbox(8298, 5450, 14);
// [ 2.3291015625, 51.467696956223364, 2.35107421875, 51.481382896100975 ]
```

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 bbox entry point in the SphericalMercator implementation and compare the provided size 256 and 512 reproductions. Confirm the intended tile-size behavior and add a regression test showing the result for both configurations; done means bbox no longer returns identical coordinates when tile sizes differ.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
web-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.