public T ReverseGeocoding(GeoCoordinates location)
 {
     return(_client.GetRequest <T>(new Dictionary <string, string>()
     {
         { "latlng", location.ToString() }
     }));
 }
Example #2
0
        private bool IsFoundAddress(GeoCoordinates location)
        {
            GeocodingResponse response = FindAddress(location);
            bool is_found = IsStatusOk(response.Status);

            if (!is_found)
            {
                Console.WriteLine($"Address of location: {location.ToString()} is not found: {response.Status}");
            }

            return(is_found);
        }
Example #3
0
        private static async Task <string> GetAddress(GeoCoordinates coordinates)
        {
            var results = await _googleService.ReverseGeocoding(coordinates.ToString(), _googleApiKey);

            return(results.results.FirstOrDefault()?.formatted_address);
        }