Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(results => {
console.log(results)
getLatLng(results[0])
})
.then(latLng => console.log('Success', latLng))
.then(results => {
//console.log(results);
addr = results[0].formatted_address;
this.setState({ address: addr });
return getLatLng(results[0]);
})
.then(results => {
const handleSelect = (address) => {
props.setGoogleAddress(address)
geocodeByAddress(address)
.then(results => {
console.log(results)
getLatLng(results[0])
})
.then(latLng => console.log('Success', latLng))
.catch(error => console.error('Error', error))
}
const handleSelect = address => {
console.log(props, address)
geocodeByAddress(address)
.then(results => getLatLng(results[0]))
.then(latLng => {
console.log('Success', latLng)
setLatlng(latLng)
})
.then(() => props.change('location', address))
.catch(error => console.error('Error', error));
};
const renderInput = ({ input, meta, width, label, ...custom }) => (
handleSelect = (address) => {
geocodeByAddress(address)
.then(results => this.props.updateSearchResultViewport(results[0].geometry.viewport))
.catch(error => console.error('Error', error));
}
handleSelect = (address) => {
const { onSelect } = this.props
if (!onSelect) {
return
}
geocodeByAddress(address)
.then(results => getLatLng(results[0]))
.then(latLng => onSelect({ ...latLng, name: address }))
.catch(error => console.error('Error', error))
}
}
const latLngevt = address => (
geocodeByAddress(address)
.then(results => getLatLng(results[0]))
.catch(err => console.log(err))
);
handleLocationChange = async (address, id) => {
const place = await geocodeByPlaceId(id);
this.setState(
{
city: place[0].formatted_address,
location: await getLatLng(place[0]),
},
this.search,
);
};