Skip to content

PlaceAutocomplete only returns a max of 4 suggestions #447

@Dectom

Description

@Dectom

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions