Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getAddressGeo(e){
- e.preventDefault();
- const apiUrl = this.state.api + this.state.address;
- request.post(apiUrl).then((res) => {
- const direccionCompleta = res.body.results[0].formatted_address;
- const Latitud = res.body.results[0].geometry.location.lat;
- const Longitud = res.body.results[0].geometry.location.lng;
- this.setState({direccion: direccionCompleta,
- latitud: Latitud,
- longitud: Longitud
- })
- })
- .catch((err) => {
- console.log(err.message);
- });
- }
Add Comment
Please, Sign In to add comment