SearchBoxAPI class

Search for places by name, point, bbox, proximity, and more.

https://docs.mapbox.com/api/search/search-box/

The Search Box API includes two different endpoints: /suggest and /retrieve. As the user types, text is sent to the /suggest endpoint to get suggested results. When the user selects a suggestion, its mapbox_id is sent to /retrieve to get the full data.

Constructors

SearchBoxAPI({String? apiKey, String? country, int? limit, String? language, List<PlaceType> types = const [], BBox? bbox})
If apiKey is not provided here then it must be provided MapBoxSearch() constructor

Properties

bbox BBox?
Limit results to only those contained within the supplied bounding box.
final
country String?
Limit results to one or more countries. Permitted values are ISO 3166 alpha 2 country codes separated by commas.
final
hashCode int
The hash code for this object.
no setterinherited
language String?
Specify the user’s language. This parameter controls the language of the text supplied in responses.
final
limit int?
Specify the maximum number of results to return. The default is 5 and the maximum supported is 10.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
types List<PlaceType>
Filter results to include only a subset (one or more) of the available feature types. Options are country, region, postcode, district, place, locality, neighborhood, address, and poi. Multiple options can be comma-separated.
final

Methods

getPlace(String mapboxId) Future<ApiResponse<RetrieveResonse>>
Retrive a place by its mapbox_id.
getSuggestions(String queryText, {Proximity proximity = const NoProximity(), List<POICategory> poi = const []}) Future<ApiResponse<SuggestionResponse>>
Get a list of places that match the query.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited