Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Convert Latitude and longtude to address

$
0
0

I need to convert my latlong to address to extract some data , but reservation failed with error

error

{The operation couldn’t be completed. (com.google.HTTPStatus error 400.)}

my code

void ConvertLatLong(double latitude, double longitude)
        {
            try
            {
                Geocoder geocoder;
                CLLocationCoordinate2D location = new CLLocationCoordinate2D(latitude, longitude);

                geocoder = new Geocoder();

                geocoder.ReverseGeocodeCord(location ,(response, error) => {

                    if (error != null) return;

                    var addresses = response.Results;
                    if (addresses != null && addresses.Length > 1)
                    {
                      Address selectedAddress = addresses[1];
                      if (selectedAddress.AdministrativeArea != null)
                      {
                            var citySelected = citiesLookupResult.Find(c => (selectedAddress.AdministrativeArea.Contains(c.NameEn)));
                            chooseCity.Text = citySelected.NameEn;
                      }
                    }

                });


            }
            catch (Exception e)
            {

            }
        }

my tries to fix the issue go to google console to check if I set app name and E-mail or not

every thing is set correctly

any hint to fix this issue


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>