涓€銆佷綅缃俊鎭?/p>
1銆佹暟鎹?/p>
浣嶇疆淇℃伅鐢辩粡搴︺€佺含搴﹀潗鏍囧拰涓€浜涘叾浠栧厓鏁版嵁缁勬垚銆?/p>
绾害锛氳窛绂昏丹閬撲互鍖楁垨浠ュ崡鐨勬暟鍊笺€傛瘮濡傦細39.17222
缁忓害锛氳窛绂昏嫳鍥芥牸鏋楀▉娌讳互涓滄垨浠ヨタ鐨勬暟鍊笺€傛瘮濡傦細-120.13778
缁忕含搴﹀彲浠ヤ互鍗佽繘鍒惰〃绀猴紝涔熷彲浠ヤ互DMS锛堣搴︼級鏍煎紡琛ㄧず銆?/p>
HTML5 Geolocation API鐨勫潗鏍囨牸寮忔槸鍗佽繘鍒舵牸寮忋€?/p>
闄ょ粡绾害澶栵紝HTML5 Geolocation杩樻彁渚涘潗鏍囩殑鍑嗙‘搴︺€備緷鎹祻瑙堝櫒鎵€鍦ㄧ殑纭欢璁惧锛岃繕鍙兘鎻愪緵涓€浜涘厓鏁版嵁锛屽寘鎷捣鎷斻€佹捣鎷斿噯纭害銆佽椹舵柟鍚戝拰閫熷害绛夈€傚鏋滆繖浜涘厓鏁版嵁涓嶅瓨鍦ㄥ垯杩斿洖null銆?/p>
聽
2銆佷綅缃俊鎭粠浣曡€屾潵
API骞朵笉鑳戒繚璇佽澶囪繑鍥炵殑鏄儬鍙婁綅缃槸绮剧‘鐨勩€?/p>
璁惧鍙互浣跨敤涓嬪垪鏁版嵁婧?/p>
- IP鍦板潃
- 涓夌淮鍧愭爣
- GPS(Global Positioning System锛屽叏鐞冨畾浣嶇郴缁?锛?/li>
- 浠嶳FID銆乄i-Fi鍜岃摑鐗欏埌Wi-Fi鐨凪AC鍦板潃锛?/li>
- GSM鎴朇DMA鎵嬫満鐨処D
- 鐢ㄦ埛鑷畾涔夋暟鎹?/li>
IP鍦板潃瀹氫綅鏁版嵁鐨勪紭缂虹偣
浼樼偣 | 缂虹偣 |
浠讳綍鍦版柟閮藉彲鐢?/td> | 涓嶇簿纭?缁忓父鍑洪敊锛屼竴鑸簿纭埌鍩庡競绾? |
鍦ㄦ湇鍔″櫒绔鐞?/td> | 杩愮畻浠d环澶?/td> |
聽
GPS瀹氫綅鏁版嵁鐨勪紭缂虹偣
浼樼偣 | 缂虹偣 |
寰堢簿纭?/td> | 瀹氫綅鏃堕棿闀匡紝鐢ㄦ埛鑰楃數閲忓ぇ |
聽 | 瀹ゅ唴鏁堟灉涓嶅ソ |
聽 | 闇€瑕侀澶栫‖浠惰澶?/td> |
聽
Wi-Fi瀹氫綅鏁版嵁浼樼己鐐?/p>
浼樼偣 | 缂虹偣 |
绮剧‘ | 鍦ㄤ埂鏉戣繖浜涙棤绾挎帴鍏ョ偣杈冨皯鐨勫湴鍖烘晥鏋滀笉濂?/td> |
鍙湪瀹ゅ唴浣跨敤 | 聽 |
鍙互绠€鍗曘€佸揩鎹峰畾浣?/td> | 聽 |
聽
鎵嬫満鍦扮悊鏁版嵁浼樼己鐐?/p>
浼樼偣 | 缂虹偣 |
鐩稿綋鍑嗙‘ | 闇€瑕佽兘澶熻闂墜鏈烘垨鍏秏oden鐨勮澶?/td> |
鍙湪瀹ゅ唴浣跨敤 | 鍦ㄥ熀绔欒緝灏戠殑鐗囨簮鍦板尯鏁堟灉涓嶅ソ |
鍙互绠€鍗曘€佸揩鎹峰畾浣?/td> | 聽 |
聽
鐢ㄦ埛鑷畾涔夌殑鍦扮悊瀹氫綅鏁版嵁聽
浼樼偣 | 缂虹偣 |
鐢ㄦ埛鍙互鑾峰緱姣旂▼搴忓畾浣嶆湇鍔℃洿鍑嗙‘鐨勪綅缃暟鎹?/td> | 鍙兘寰堜笉鍑嗙‘锛岀壒鍒槸褰撶敤鎴蜂綅缃彉鏇村悗 |
鍏佽鍦扮悊瀹氫綅鏈嶅姟鐨勭粨鏋滀綔涓哄鐢ㄤ綅缃俊鎭?/td> | 聽 |
鐢ㄦ埛鑷杈撳叆鍙兘姣旇嚜鍔ㄦ娴嬫洿蹇?/td> | 聽 |
聽
鐢ㄦ埛鎵€鍦ㄤ綅缃睘浜庢晱鎰熶俊鎭紝HTML5 Geolocation瑙勮寖鎻愪緵浜嗕竴濂椾繚鎶ょ敤鎴烽殣绉佺殑鏈哄埗銆傞櫎闈炲緱鍒?鐢ㄦ埛鏄庣‘璁稿彲锛屽惁鍒欎笉鍙幏鍙栦綅缃俊鎭€?/p>
聽
浜屻€佷娇鐢℅eolocation API
1銆佹祻瑙堝櫒鏀寔妫€鏌?/p>
鐩墠涓绘祦娴忚鍣ㄩ兘鏀寔Geolocation API銆傝鏌ョ湅鏌愪釜鐗堟湰鏄惁鏀寔鍙弬鑰僪ttp://caniuse.com
鐢ㄨ剼鏈鏌ユ敮鎸佹€э細
function loadDemo() { if (navigator.geolocation) { document.getElementById("support").innerHTML = "Geolocation supported."; } else { docment.getElementById("support").innerHTML = "Geolocation is not supported in your browser."; } }
聽2銆佷綅缃姹?/p>
鏈変袱绉嶇被鍨嬬殑浣嶇疆瑕佹眰
- 鍗曟瀹氭湡璇惰姹?/li>
- 閲嶅鎬х殑浣嶇疆鏇存柊璇锋眰
void getCurrentPosition(in PositionCallback successCallback, in optional PositionErrorCallback errorCallback, in optional PositionOptions options);聽鍒嗘瀽涓€涓嬭繖涓牳蹇冨嚱鏁般€?/div>
- 蹇呴€夊弬鏁皊uccessCallback涓烘祻瑙堝櫒鎸囨槑浣嶇疆鏁版嵁鍙敤鏃跺簲璋冪敤鐨勫嚱鏁般€傚洜涓烘煡浣嶇疆鍙兘闇€瑕佸緢闀挎椂闂达紝鎵€浠ラ噰鐢ㄥ洖璋冨嚱鏁扮殑鏂瑰紡銆傝鍑芥暟鍙湁涓€涓弬鏁帮細浣嶇疆瀵硅薄(鍋囪鍛藉悕涓簆osition)銆傚璞″寘鍚潗鏍囦俊鎭?coords)鍜屼竴涓幏鍙栨暟鎹椂鐨勬椂闂存埑(timestamp)銆?/li>