· 5 years ago · Nov 01, 2020, 02:32 AM
1var mylat = position.coords.latitude;
2 var mylon = position.coords.longitude;
3
4 this.setState({coords:newCoords});
5 console.log({mylat}, {mylon})
6
7 // CAll the API key
8
9
10
11 // let urlkey = 'http://api.openweathermap.org/data/2.5/weather?lat={mylat}&lon={mylon}&appid=7e8f249b6b0a8c12bf5aa8d0f114e7a5'
12
13 Axios.get('http://api.openweathermap.org/data/2.5/weather?lat={mylat}&lon={mylon}&appid=7e8f249b6b0a8c12bf5aa8d0f114e7a5').
14 then(res => {
15 console.log(res)
16 })
17