map.fitBounds with padding affects the map.getBounds
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
map.fitBounds(bounds, { padding: 150 }) in v3.10 somehow sets the global bounds.
If you call map.getBounds(), it returns the bounds including the 150 px padding, which is incorrect.
In v2, map.getBounds() returns the correct bounds covering 100% of the height and width without any padding.
```
map.fitBounds(bounds, { padding: 150 });
const s = map.getBounds();
console.log('s', s);
```
v2 Results: [7.1204, 52.6618, 13.8875, 59.2029]
v3 Results: [8.4594, 53.4663, 12.5486, 58.5104]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the map.fitBounds(bounds, { padding: 150 }) and map.getBounds() sequence from the issue, then compare the v2 and v3 results shown. Trace the fitBounds and getBounds behavior to determine whether padding is being included in the reported geographic bounds. Done means getBounds() reports the fitted bounds without the pixel padding while fitBounds still honors that padding.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100