| 32 | }, [origin, destination, GOOGLE_MAP_APIKEY]) |
| 33 | |
| 34 | const getTravelTime = async () => { |
| 35 | const URL = `https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=${origin.description}&destinations=${destination.description}&key=${GOOGLE_MAP_APIKEY}` |
| 36 | const data = await fetch(URL).then(response => response.json()) |
| 37 | if(data.status !== 'OK') return alert(data.error_message) |
| 38 | dispatch(setTravelTimeInformation(data.rows[0].elements[0])) |
| 39 | } |
| 40 | |
| 41 | return ( |
| 42 | <View style={tailwind`flex-1 relative`}> |