Posts

Showing posts from October, 2023

getCurrentPosition() 적용해봄 -> 실패 (https가 아니라서)

아래와 같이 html문서에 넣어봤으나, https가 아니라서 실패.  var centPos =[ 37.566513 , 126.9783039 ]; if ( navigator . geolocation ){ navigator . geolocation . getCurrentPosition (( curPos ) => { centPos = [ curPos . coords . latitude , curPos . coords . longitude ]; }); } else { console . log ( "geolocation is not supported" ); }