- 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 | μ ν¨ κΈ°κ° μ€μ |