getByGeoPointByQueryLatQueryLonQueryRadiusQueryCategoriesQueryIncludeC method
Gets the places that lie within a geographic region. The geographic region of interest can either be specified by using a lat/lon geo-point and a radius in metres to return places within the locus defined by the lat/lon of its centre or alternatively, by the use of a bounding box defined by the lat/lon of its north-west and south-east corners. Optionally filters on type and can strip properties for a smaller payload.
Implementation
Future<PlacesResponse>
getByGeoPointByQueryLatQueryLonQueryRadiusQueryCategoriesQueryIncludeC(
double lat,
double lon, [
double? radius,
List<String>? categories,
bool? includeChildren,
List<String>? type,
bool? activeOnly,
int? numberOfPlacesToReturn,
]) async {
final response = await _context.client.get(
Uri.https(
authority,
'/place',
{
'lat': lat.toString(),
'lon': lon.toString(),
if (radius != null) 'radius': radius.toString(),
if (categories != null) 'categories': categories.join(','),
if (includeChildren != null)
'includeChildren': includeChildren.toString(),
if (type != null) 'type': type.join(','),
if (activeOnly != null) 'activeOnly': activeOnly.toString(),
if (numberOfPlacesToReturn != null)
'numberOfPlacesToReturn': numberOfPlacesToReturn.toString(),
},
),
);
ClientException.checkIsSuccessStatusCode(response);
return PlacesResponse.fromJson(json.decode(response.body));
}