- html5
- html5/VA
- html5/canvas
- html5/drag-and-drop
- html5/form
- html5/geolocation
- html5/offline-web-application
- html5/others-api
- html5/outline
- html5/overview
- html5/richtext-edit
- html5/video&audio
- html5/web-storage
- html5/web-workers
- html5/webSqlDatabase
- html5/websocket
- html5/๋ฌธ์ ์
- html5practice/roundRect
- html5practice/์ฆ๊ฒจ์ฐพ๊ธฐ๋ชฉ๋ก๋ง๋ค๊ธฐ
1. Geolocation API? ¶
- ํ๋ก๊ทธ๋จ์ ์คํํ๋ ๋๋ฐ์ด์ค์ ์์น ์ ๋ณด๋ฅผ ์ป๊ธฐ ์ํ API
- ๋ชจ๋ฐ์ผ ์ ํ๋ฆฌ์ผ์ด์
๊ณผ ์ฐ๋ํ์ฌ ์ฌ์ฉ
- ๊ณ ๊ธ ๋ ๋ฒจ์ API - GPS๋ฅผ ์ด์ฉํ๋์ง ๋คํธ์ํฌ ์ ๋ณด๋ฅผ ์ด์ฉํ๋์ง๋ ์์ ์์ผ๋
๋๋ฐ์ด์ค๋ ๋คํธ์ํฌ์ ์ข ๋ฅ์ ๊ด๊ณ์์ด ๋์!
2.1. getCurrentPosition() ¶
- ํ์ฌ ์์น๋ฅผ ํ๋ฒ๋ง ๋ฐ๋ ๋ฉ์๋
namigator.geolocation.getCurrentPosition(function(position){ alert("์๋:" + position.coords.latitude + "๊ฒฝ๋ :" + position.coords.longitude); });
- ์์น ์ ๋ณด ๊ฐ์ฒด์ ์์ฑ
coords ์์ฑ | ์ค๋ช |
latitude | ์๋ |
longitude | ๊ฒฝ๋ |
altitude | ํ๊ณ |
accuracy | ์๋์ ๊ฒฝ๋์ ์ค์ฐจ |
altitudeAccuracy | ํ๊ณ ์ ์ค์ฐจ |
heading | ์งํ๋ฐฉํฅ |
speed | ์งํ ์๋ |
3. ์ถ๊ฐ ๊ธฐ๋ฅ ¶
์์ฑ | ์ค๋ช |
enableHighAccuracy | ์ ํ๋๊ฐ ๋์ ์์น ์ ๋ณด ์์ฒญ |
timeout | ์์น ์ ๋ณด ํ์ธ์ ์๊ฐ์ ํ ์ค์ |
maximumAge | ์ ํจ ๊ธฐ๊ฐ ์ค์ |