mapbox / mapbox/mapbox-gl-geocoder

Geocoder flies to wrong location when using the `naturalEarth` projection

Open
#489 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug
Dominant language
JavaScript
Stars
388
Forks
181
PR merge metrics
No merged PRs in 30d

Description

When selecting a location with the `naturalEarth` projection, places selected from the geocoder will fly to the wrong location (but the pin is placed in the correct location).

This does not happen for `poi` types from the dropdown so I think it has something to do with the `bbox` property of the geocoder API response not being projected since POIs that worked don't have a `bbox` property in the response.

Here's a fiddle I was able to reproduce it on.

https://jsfiddle.net/qL7064jz/

And a video demonstrating the bug

https://user-images.githubusercontent.com/12189611/222004827-fd7d5e34-4ad5-43c9-b745-98eeb002afde.mov

If you need any more details let me know.

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 with the reproduction fiddle at https://jsfiddle.net/qL7064jz/ and compare geocoder results with `naturalEarth` against `poi` results, focusing on the response `bbox`. Done means selecting a place flies to the correct location while keeping the pin correctly placed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.