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");
}

Comments

Popular posts from this blog

[VS2010][VS2015] "stdafx.h 을 포함 소스를 찾을 수 없습니다" 에러 해결법

WD mycloud Gen2 hard drive replacement and initialization