mapbox / mapbox/mapbox-gl-geocoder

reverseMode option type is unclear

Open
#499 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm creating a Svelte component for a geocoder (student project). I've exported all of the geocoder default options, and all works fine, except for the reverseMode option. I don't think I understand the type of value it accepts.

According to the documentation:
```
options.reverseMode (distance | score) Set the factors that are used to sort nearby results. (optional, default distance)
```

I assumed these were strings, but when I set the default as 'distance,' while trying to perform a search, I get a console error stating that the key is invalid.
I tried using numbers, but that did not work, either.
For now, my component works fine if I just default it to undefined or leave it out altogether.

Apologies if I'm just confused here, but I got pretty stuck on this for awhile, so I thought I'd raise the issue. Clearer documentation on reverseMode would be helpful.

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

Review the documentation entry for options.reverseMode and the option-handling path that produces the invalid-key error described in the issue. Clarify the accepted value format and verify the documented example by performing a geocoder search with reverseMode configured.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.