RTFDB-4842: Improve user input handling in "mapbox-gl-geocoder" - #559
Open
pahuta wants to merge 2 commits into
Open
RTFDB-4842: Improve user input handling in "mapbox-gl-geocoder"#559pahuta wants to merge 2 commits into
pahuta wants to merge 2 commits into
Conversation
- Add optional `parseExtendedSpatialFormats` option with four independently toggled formats, all disabled by default: `commaSeparatedLngLatZoom` (`lng,lat,zoom`), `slashSeparatedZoomLatLng` (`zoom/lat/lng`), `tile` (`z/x/y`) and `quadkey` - Add `lib/spatial-formats.js`, which turns a matching search input into a synthetic GeoJSON feature and prepends it to the suggestion list on both the successful and the failed request path - Add `isValidTile`, `isValidQuadkey`, `tileToLngLat` and `quadkeyToTile` helpers to `lib/utils.js` - Use the parsed zoom when flying to a selected feature that has no `bbox` - Fix `getSelectedIndex` in `lib/events.js` reporting index 0 for every result feature without an `id` https://mapbox.atlassian.net/browse/RTFDB-4842
stepankuzmin
reviewed
Aug 5, 2026
stepankuzmin
reviewed
Aug 5, 2026
- remove a `parseExtendedSpatialFormats` contractor parameter in favor of using a `localGeocoder` https://mapbox.atlassian.net/browse/RTFDB-4842
| this._hideAttribution(); | ||
|
|
||
| // in the event of an error in the Mapbox Geocoding API still display results from the localGeocoder | ||
| if ((localGeocoderRes.length && this.options.localGeocoder) || (externalGeocoderRes.length && this.options.externalGeocoder) ) { |
Contributor
There was a problem hiding this comment.
Doesn't that break the externalGeocoder?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
localGeocoderfunctionisValidTile,isValidQuadkey,tileToLngLatandquadkeyToTilehelpers tolib/utils.jsbboxhttps://mapbox.atlassian.net/browse/RTFDB-4842
npm run docsand commit changes to API.mdmainheading before mergingParsing extended spatial formats when enabled:
parseExtendedSpatialFormats.mp4
Previous vs current behavior when user cut or undo search input value
cut_undo.mp4