Map fly-to overshoots "Hawaii", sends you into the Pacific Ocean
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**mapbox-gl-js version**: noticed on my site, which uses 2.3.1, geocoder 4.7.2 (but also happening on [your geocoder example site](https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-geocoder-accept-coordinates/))
**browser**: chrome, firefox
### Steps to Trigger Behavior
1. On a map with a geocoder, enter "Hawaii" and select the state (not a specific landmark or feature; the top-level state)
2. The fly-to action happens and instead of being centered on the screen, the camera overshoots and Hawaii (and the pin) end up at the bottom right of the frame.
3. As a comparison, try a continental US state like "New York" -- the camera will be correctly centered on the pin and thus the state.
Screenshots:
Searching for Hawaii:

Clicking on the first result results in:

Compare w/the previous screenshot, which was the result of searching for "new york" -- the camera is correctly centered on the pin. For hawaii, it's barely in the frame, and at higher zoom levels, you can't see it at all.
### Link to Demonstration
https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-geocoder-accept-coordinates/
### Expected Behavior
A search for "Hawaii" brings you to the center of the pin (which is correctly placed).
### Actual Behavior
The camera overshoots and Hawaii (and the pin) end up at the bottom right of the frame, and at higher zoom levels, you can't see it at all.
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 with the linked geocoder example and reproduce the camera behavior by searching for "Hawaii", then compare it with "New York". Trace the geocoder selection into the map fly-to behavior; done means Hawaii and its pin are centered at normal and higher zoom levels without overshooting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100