U E D R , A S I H C RSS

html5/geolocation


1. Geolocation API?

  • ํ”„กœทธžจ„ ‹คํ–‰ํ•˜Š” ””ฐ”ดŠค˜ œ„˜  •ณด –ปธฐ œ„ํ•œ API
  • ชจฐ” • ํ”Œฆฌ€ด…˜ —ฐ™ํ•˜—ฌ ‚ฌšฉ
  • ณ ธ‰  ˆฒจ˜ API - GPS ดšฉํ•˜Š”€ „คํŠธ›Œํฌ  •ณด ดšฉํ•˜Š”€Š” •Œˆ˜ —†œ‚˜
    ””ฐ”ดŠค‚˜ „คํŠธ›Œํฌ˜ ข…ฅ˜— €„—†ด ™ž‘!

2. ‚ฌšฉ ฐฉฒ•

  • Geolocation API € จ ฉ”„œ“œŠ” ชจ‘ window.navigator ฐฒด—  •˜

2.1. getCurrentPosition()

  • ํ˜„žฌ œ„˜ ํ•œฒˆงŒ ฐ›Š” ฉ”„œ“œ

   namigator.geolocation.getCurrentPosition(function(position){
     alert("œ„„:" + position.coords.latitude +
        "ฒฝ„ :" + position.coords.longitude);
   });
  • œ„˜  •ณด ฐฒด˜ †„
coords †„„ช…
latitudeœ„„
longitudeฒฝ„
altitudeํ‘œณ 
accuracyœ„„™€ ฒฝ„˜ ˜คฐจ
altitudeAccuracyํ‘œณ ˜ ˜คฐจ
heading„ํ–‰ฐฉํ–ฅ
speed„ํ–‰ †„

2.2. watchPosition()

  • ํ˜„žฌ œ„˜ „† ถ” 
  • clearWatch()€ ํ˜ธถœ˜ฉด ข…ฃŒ

3. ถ”€ ธฐŠฅ

†„„ช…
enableHighAccuracy •ํ™•„€ †’€ œ„˜  •ณด š”ฒญ
timeoutœ„˜  •ณด ํ™•ธ— ‹œ„ œํ•œ „ •
maximumAgeœ ํšจ ธฐ„ „ •

4. ˜ˆ œ

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:31:40
Processing time 0.0305 sec