Zoom is NaN when using rectangular bounds
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 197
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
When calling `geoViewport.viewport([33.841629, -118.91905, 34.27888, -117.954399], [384, 318]);`, I get the following results:
```
center: (2) [34.0602545, -118.4367245]
zoom: NaN
```
It seems to work fine when using a fixed value (`[34.16811, -118.231895, 34.16811, -118.231895]`), so I'm guessing I must be doing something wrong with the data I'm passing in.
Any ideas?
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 call to geoViewport.viewport with the rectangular bounds and [384, 318] size, then inspect the viewport calculation that produces the zoom value. Compare it with the fixed-value example and verify that the rectangular case returns a finite zoom rather than NaN; add or update a regression test if the repository provides one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100