Exemplo n.º 1
0
 public T ReverseGeocoding(GeoCoordinates location)
 {
     return(_client.GetRequest <T>(new Dictionary <string, string>()
     {
         { "latlng", location.ToString() }
     }));
 }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        private static async Task <string> GetAddress(GeoCoordinates coordinates)
        {
            var results = await _googleService.ReverseGeocoding(coordinates.ToString(), _googleApiKey);

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