GeoCoding class

The MapBox Geocoding API lets you convert location text into geographic coordinates (1600 Pennsylvania Ave NW → -77.0366,38.8971) and vice versa (reverse geocoding).

https://docs.mapbox.com/api/search/geocoding/

Constructors

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

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

copyWith({String? apiKey, String? language, String? country, int? limit, BBox? bbox, List<PlaceType>? types}) GeoCoding
getAddress(Location location) Future<ApiResponse<List<MapBoxPlace>?>>
Get the address of the given location coordinates
getPlaces(String queryText, {Location? location, Proximity proximity = const NoProximity()}) Future<ApiResponse<List<MapBoxPlace>>>
Get the places for the given query text
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