How to search for latitude and longitude by city using react-native-geocoding

0

Hello, I'm trying to return the information of the city, but when I tell you the name of cities, it does not return anything to me ... it only rotunds me when I put names of places like Colosseum ...

 onPressBuscaLongetudeLatidePorNome = async () => {
    try {
      Geocoder.setApiKey(googleMapsApi);

      Geocoder.from(this.state.destino).then(
        json => {
          let location = json.results[0].geometry.location;
          alert(location.lat + ", " + location.lng);
        }, 
        error => {
          console.log("error", e)
        }
      ); 
    } catch (e) {
      console.log("error", e)
    }
  }
    
asked by anonymous 27.08.2018 / 04:13

0 answers