<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>

//LBS : 基于地图信息的应用

window.onload = function(){
var oInput = document.getElementById('input1');
var oT = document.getElementById('t1');

var timer = null;

oInput.onclick = function(){

timer = navigator.geolocation.watchPosition(function(position){

oT.value += '经度:' + position.coords.longitude+'\n';
oT.value += '纬度 :' + position.coords.latitude+'\n';
oT.value += '准确度 :' + position.coords.accuracy+'\n';
oT.value += '海拔 :' + position.coords.altitude+'\n';
oT.value += '海拔准确度 :' + position.coords.altitudeAcuracy+'\n';
oT.value += '行进方向 :' + position.coords.heading+'\n';
oT.value += '地面速度 :' + position.coords.speed+'\n';
oT.value += '时间戳:' + new Date(position.timestamp)+'\n';

},function(err){

//err.code // 失败所对应的编号

alert( err.code );

navigator.geolocation.clearWatch(timer);

},{
enableHighAcuracy : true,
timeout : 5000,
maximumAge : 5000,
frequency : 1000
});

};

};

</script>
</head>

<body>
<input type="button" value="请求" id="input1" /><br />
<textarea id="t1" style="width:400px; height:400px; border:1px #000 solid;">
</textarea>
</body>
</html>

最新文章

  1. 剑指offer七:两个链表的第一个公共结点
  2. Yii2所提倡的配置管理方案
  3. Spring JDBCTemplate使用JNDI数据源
  4. Day_6作业_模拟人生
  5. 2015年11月30日 spring初级知识讲解(一)装配Bean
  6. CocoaPods安装第三方出错:XCode7.3
  7. UESTC 919 SOUND OF DESTINY --二分图最大匹配+匈牙利算法
  8. sqlite报错OutOfMemory
  9. 【BZOJ】【1052】【HAOI2007】覆盖问题
  10. Spring Batch的事务-Part 1:基础
  11. iCloud之旅
  12. IIS支持net.tcp
  13. 翻译Android USB HOST API
  14. 如何在windows的DOS窗口中正常显示中文(UTF-8字符)
  15. 第1章2节《MonkeyRunner源码剖析》概述:边界(原创)
  16. MooseFS代码分析(一)
  17. linux之常见错误
  18. Ecplise 快捷键笔记
  19. 唐平中讲座笔记 Reinforcement mechanism design 20171107
  20. Python调试打印错误信息

热门文章

  1. &quot;Accepted today?&quot;[HDU1177]
  2. [转]基于gulp和webpack的前端工程化
  3. OpenResty+lua+GraphicsMagick生成缩略图
  4. 洛谷 P1012 拼数 Label:续命模拟QAQ
  5. 这次,雅虎真的撤销QA团队了
  6. 转载:冷门js技巧
  7. 【HDU】1850 Being a Good Boy in Spring Festival
  8. JS:操作样式表2 :用JS实现添加和删除一个类名的功能(addClass()和removeClass())
  9. URAL 1031. Railway Tickets(spfa)
  10. 【BZOJ2038】【2009国家集训队】小Z的袜子(hose) 分块+莫队