reverseGeoCoding method
Reverse geocoding of the address with coordinate
.
Implementation
Future<Geocoding> reverseGeoCoding(Coordinate coordinate) async {
Geocoding? result = _storage.getCachedCoordinateData(coordinate);
if (result != null) {
return result;
} else {
if (_storage.isLastSentSafe()) {
result = await _service.reverseCoding(coordinate);
_storage.updateLastSent();
_storage.updateCacheData(result);
return result;
}
throw Exception('can not sent more than 1 request per second');
}
}