iPhone Mobile Safariã§GPSãã©ããã³ã°ããã話
ãã¼ã¿ãã¼ã¹ã«è¨é²ããã緯度çµåº¦ããããã³ã°ããå³ã
iPhoneã§GPS座æ¨å¤ãè¨é²ããããã«ã¯ã©ãããã°ããã®ããã¨ãã話ã
æè¿ãèªè»¢è»ãè²·ã£ãã®ã§éã¶ããã«èª¿æ»ãã¾ããã
以ä¸ãiPhone4S, iOS6ç°å¢ã§ã®è©±ã§ãã
1. Geolocation API
ãã¤ãã£ãã®éçºç°å¢ãæã£ã¦ããªãã®ã§ãã©ã¦ã¶ã§ãªãã¨ãã§ããªãããªã¼ã¨èª¿ã¹ã¦ã¿ãã¨ãã
ãªãã¨ãHTML5ã«ã¯GPS座æ¨ãåå¾ããAPIããããMobile Safariã¯ãã®ä»æ§ãå®è£
ãã¦ãããã¨ããããã¾ããã
ãã®APIã§ã
- 緯度ã»çµåº¦
- 緯度ã»çµåº¦ã®èª¤å·®
- é«åº¦
- é«åº¦ã®èª¤å·®
- é度
- 端æ«ã®åãã¦ããæ¹å
ãåå¾ã§ãã¾ãããã©ã¦ã¶ããã»ã³ãµã®å¤ãåããã£ã¦ãããã§ããã
ãããªã緯度ã»çµåº¦ã»é«åº¦ãè¨é²ãã¦ããããäºãã§ãããã§ããï¼iPhoneã®éçºç°å¢ãããã°ãã¤ãã£ãã§ãããã©éããªãã®ã§ã»ã»ã»ï¼ã
ãã¤ãã£ãã¢ããªã§ããã§ããªãã£ã¦äºãããã°ãã®æã«èããæãã§ã
2. APIãããã
ã³ã¼ãã¨ãã¦ã¯ãAPIã«åº§æ¨ãå¼æ°ã«ã¨ãã³ã¼ã«ããã¯é¢æ°ã渡ãã¦ãã®ä¸ã§è²ã
ããæãã«ãªãã¾ãã
APIã¯2ã¤ã®ã¿ã¤ããæä¾ããã¦ãã¾ãã
- 座æ¨å¤ãä¸ååå¾ãã¦çµããã®ã¿ã¤ã
- 座æ¨å¤ãç¶ç¶ç£è¦ãã¦åå¾ãç¶ããã¿ã¤ã
æ¹æ³1. GetCurrentPositionã使ã
ï¼åã¨ã£ã¦çµããã®ã¿ã¤ãã§ãã
ç¶ç¶çã«åå¾ããã«ã¯setTimeoutã¨ãsetIntervalã§ä¸å®æéãã¨ã«åå¾ããå¿
è¦ãããã¾ã
ä¾ï¼ http://jsdo.it/brainfs/jWzX
æ¹æ³2. WatchPositionã使ã
座æ¨å¤ãç¶ç¶çã«ç£è¦ãã¦åå¾ãç¶ããã¿ã¤ãã§ãããã¡ãã®ã»ãã精度ãé«ãã§ãããªããã
座æ¨å¤ãæç³»åã§è£æ£ãã¦ããã§ãããããä»åã¯ãã¡ãã使ãã¾ããã
ä¾ï¼ http://jsdo.it/brainfs/fESL
3. ãã©ããã³ã°ã«ããã£ã¦æ³¨æ
iOSã以ä¸ã®ç¶æ ã ã¨Mobile Safariã¯GPSããå¤ãåå¾ãã¾ããã
- ããã¯ãããç¶æ
- Mobile Safariãããã¯ã°ã©ã¦ã³ãå®è¡ä¸
- Mobile Safariã§ä½ç½®æ å ±ãµã¼ãã¹ãç¦æ¢ããç¶æ
ãªã®ã§GPSãã©ããã³ã°ä¸ã¯
- èªåããã¯ãOFF ([è¨å®]â[ä¸è¬]â[èªåããã¯]ã®ç»é¢ã§"ããªã"ãé¸æ)
- Mobile Safariããã©ã¢ã°ã©ã¦ã³ãå®è¡ãã¦å½è©²ãã¼ã¸ãéããç¶æ
- Mobile Safariã§ä½ç½®æ å ±ãµã¼ãã¹ããªã³([è¨å®]â[ãã©ã¤ãã·ã¼]â[ä½ç½®æ å ±ãµã¼ãã¹] ã§Safariããªã³)
ã«ããå¿ è¦ãããã¾ããããããªã¼é£ãããããã®ç¶æ ã§ã©ããããä¿ã¤ãã®ãã»ã»ã»
ãã¤ãã£ãã¢ããªã ã¨ããã¯ä¸ã§ãGPS座æ¨ãåããããããã§ããããã
4. èµ°ã£ã¦ãã
ç»é¢ããããªç¶æ
ã«ãã¦èµ°ã£ã¦ãã¾ããã
åé ã®ç»åã¯ãä¸å®æéæ¯ã«éä¿¡ããGPS座æ¨å¤ãGoogle Mapsã§ãããããããã®ã
å
å éãããããä¸çªç²¾åº¦ãè¯ãã£ããéããå ´æã ããããªã
5. ããããªã¼ã®æã¡
ãã«å
é»ããiPhoneã
ã»è¼åº¦æä½
ã»èªåããã¯OFF
ã»Safari以å¤ã®ã¢ããªãçµäº
ããç¶æ
ã§GPS座æ¨ãåå¾ãç¶ããã¨ãããã ããã2æéã§ããããªã¼ãåãã¾ããã
ã¢ãã¤ã«ãã¼ã¹ã¿ã¼1å°ã§2åãã«å é»ã§ããã¨ãã¦ãåããã¦6æéãä¸æ¥ä¸å¤åºããã¨ãã¦8ã10æéæãããã«ã¯2å°å¿ è¦ããã§ãã
- åºç社/ã¡ã¼ã«ã¼: ä¸æ´é»æ©
- çºå£²æ¥: 2010/10/21
- ã¡ãã£ã¢: ã¨ã¬ã¯ãããã¯ã¹
- è³¼å ¥: 67人 ã¯ãªãã¯: 692å
- ãã®ååãå«ãããã° (103件) ãè¦ã
è¼åº¦ãä¸ãããtwitterã¯ã©ã¤ã¢ã³ããªã©ãç«ã¡ä¸ããã°ãã£ã¨æ©ãæ¶è²»ããã3å°å¿ è¦ããªãã
7. ãã£ã¨æ£ç¢ºãªé度ã¨ç§»åè·é¢ãåããããï¼
iOS6ããã¯ãMobile Safariã§å é度ã»å¾ããåããããã«ãªã£ããããã§ããå é度ãåãããªããç©åã§é度ãè·é¢ãåºããã¨ãããã¨ã«ãã¨ãªãã¨ãé度ã®æç³»åã®å¤åãªã©ã¯ã緯度çµåº¦ããè¨ç®ããããå é度ããè¨ç®ããæ¹ãããæ£ç¢ºã«å¤ãåºãããã§ãããã£ã¨é«åº¦ã«ãGPSã¨å é度è¨ã§éã£ã¦ããçµè·¯ãè£æ£ã¨ããã§ããããã¦ãç¥ãããã©ãèªè»¢è»ã®é度è¨ã¨ãã¦ä½¿ããªãæç¶ãã¡ãã®æ¹ãæ£ç¢ºã§ããããããä»åº¦ã¯ããã辺ã«åãçµãã®ã楽ããããªæãã§ãã