mapbox / mapbox/mapbox-search-ios

PlaceAutocomplete only returns a max of 4 suggestions

Open
#447 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
28
Forks
28
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
I'm attempting to get a list of addresses at a given coordinate and using the `PlaceAutoComplete` method to do this.

Code looks like this:
```
let placeAutocomplete = PlaceAutocomplete(accessToken: mapboxAccessToken)

@State private var searchResults: [PlaceAutocomplete.Suggestion] = []
@State private var selectedLocationIndex: Int = 0

func prepareSearchCoordinates(coords: CLLocationCoordinate2D) {
placeAutocomplete.suggestions(for: coords) { result in
switch result {
case .success(let suggestions):
self.searchResults = suggestions
print("DEBUG: Received \(suggestions.count) suggestions")

case .failure(let error):
debugPrint(error)
}
}
}
```

I'd expect to get a lot of locations returned, however it's only returning a maximum of 4 results no matter what cooridnates are being passed in.

```
DEBUG: Received 4 suggestions
```

**Expected behavior**
A list of all potential addresses at that given co-ordinate

**Screenshots**

Image

**Smartphone (please complete the following information):**
- Device: iphone17 pro (simulator) / iphone 16 pro (real)
- OS: iOS 26
- Search SDK Version: 2.17.0
- SearchUI SDK Version: N/A
- SearchEngine initialization parameters: N/A

**Additional context**
Add any other context about the problem here.

I was expecting to get a list of every potential address so I can have it as a picker for a given cooridnate point but being limited to 4 results doesn't work for this.

I've checked some of the other APIs and methods available but can't seem to see one that is fit for this purpose of give coords and get back a list of addresses at that coordinate.

I might just be being stupid and missing something obvious, This is a first time using the mapbox-ios-sdk. Any guidance or pointing in the correct direction is appreciated

Contributor guide

Open the contributing guide

Research direction

Start by reading the PlaceAutocomplete.suggestions(for:) API and its documentation for Search SDK 2.17.0, then inspect the available coordinate-based search or reverse-geocoding entry points. Done means establishing whether four suggestions is an intended limit and identifying the supported API or documentation change needed for the requested address list.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
api, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.