https://developer.mozilla.org/ko/docs/Web/API/Geolocation_API/Using_the_Geolocation_API
https://developer.mozilla.org/ko/docs/Web/API/Geolocation/getCurrentPosition
์ฅ์น์ ํ์ฌ ์์น๋ฅผ ๊ฐ์ ธ์จ๋ค.
navigator.geolocation.getCurrentPosition(success, error, [options])
var options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 0
};
function success(pos) {
var crd = pos.coords;
console.log('Your current position is:');
console.log(`Latitude : ${crd.latitude}`);
console.log(`Longitude: ${crd.longitude}`);
console.log(`More or less ${crd.accuracy} meters.`);
}
function error(err) {
console.warn(`ERROR(${err.code}): ${err.message}`);
}
navigator.geolocation.getCurrentPosition(success, error, options);
coords
= ์ขํ
latitude
= ์๋
longitude
= ๊ฒฝ๋