-
카테고리
-
세부 분야
백엔드
-
해결 여부
해결됨
섹션2-8 openWeatherMap API
23.09.27 06:08 작성 조회수 79
1
const weatherSearch = function (position) { const openWeatherRes = fetch( `https://api.openweathermap.org/data/2.5/onecall?lat=${position.latitude}&lon=${position.longitude}&appid=4bdfd4f45f4d597908e29058919e8707` ); console.log(openWeatherRes); }; const accessToGeo = function (position) { const positionObj = { latitude: position.coords.latitude, longitude: position.coords.longitude, }; weatherSearch(positionObj); }; const askForLocation = function () { navigator.geolocation.getCurrentPosition(accessToGeo, (err) => { console.log(err); }); }; askForLocation();
fetch 안에 2.5로 변경해도 계속 오류가 떠요 ㅠ
어떻게 해야하나요?
답변을 작성해보세요.
0
답변 1