Guest User

Untitled

a guest
Mar 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. getAddressGeo(e){
  2.  
  3. e.preventDefault();
  4.  
  5. const apiUrl = this.state.api + this.state.address;
  6.  
  7. request.post(apiUrl).then((res) => {
  8.  
  9. const direccionCompleta = res.body.results[0].formatted_address;
  10. const Latitud = res.body.results[0].geometry.location.lat;
  11. const Longitud = res.body.results[0].geometry.location.lng;
  12.  
  13. this.setState({direccion: direccionCompleta,
  14. latitud: Latitud,
  15. longitud: Longitud
  16. })
  17.  
  18. })
  19. .catch((err) => {
  20. console.log(err.message);
  21. });
  22. }
Add Comment
Please, Sign In to add comment