fromLatLng method
Implementation
Future<GeocodeResponse> fromLatLng(
double latitude,
double longitude, {
String? apiKey,
String? language,
String? region,
String? locationType,
}) async {
final fRegion = region ?? _region;
final fLocationType = locationType ?? _locationType;
final qp = <String, dynamic>{
'latlng': '$latitude,$longitude',
if (language != null) 'language': language,
if (fRegion != null) 'region': fRegion,
if (fLocationType != null) 'location_type': fLocationType,
};
try {
final data = await doGet(
path: '/maps/api/geocode/json',
params: qp,
);
return GeocodeResponse.fromMap(data);
} catch (error) {
final gr = GeocodeResponse.fromError(error.toString());
return gr;
}
}