react-geocode
react-geocode copied to clipboard
City translation not working, only country works?
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!