• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    해결됨

섹션2-8 openWeatherMap API

23.09.27 06:08 작성 조회수 180

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로 변경해도 계속 오류가 떠요 ㅠ

어떻게 해야하나요?

답변 1

답변을 작성해보세요.

0

안녕하세요! 소진님!

동일한 질문에 대한 답변이 기존에 존재하여, 링크를 보내드립니다!
아래 링크를 확인해 주세요!

https://www.inflearn.com/questions/886308