react-geocode icon indicating copy to clipboard operation
react-geocode copied to clipboard

City translation not working, only country works?

Open udrea93 opened this issue 4 years ago • 0 comments

Hello, im using the following code ` Geocode.setLanguage("en"); Geocode.setRegion("en"); Geocode.setLocationType = 'ROOFTOP';

  Geocode.fromLatLng("48.13512530", "11.58198050").then(
    response => {
      if (response.results[0].formatted_address) {
        console.log(response.results[0].formatted_address);

        const formattedAddressArray =
          response.results[0].formatted_address.split(' ');

        const getCity =
          formattedAddressArray[formattedAddressArray.length - 2];
        const getCountry =
          formattedAddressArray[formattedAddressArray.length - 1];
        console.log(getCity + " " + getCountry)
      }
    error => {
      setLocation(eventData.location);
      console.error(error);
    }
  );
}`

I get München, Germany I should get Munich, Germany The country seems to be translated but what about the city? Thanks!

udrea93 avatar Jul 14 '21 13:07 udrea93