HTML5 Geolocation示例
来源:互联网 发布:color finale mac 编辑:程序博客网 时间:2024/06/08 14:36
if(navigator.geolocation){ navigator.geolocation.getCurrentPosition(success_handler, errors_handler); function success_handler(position){ console.log('Latitude: ' + position.coords.latitude + '\n Longitude: ' + position.coords.longitude); } function error_handler(err) { switch(err.code){ case err.PERMISSION_DENIED: console.log('User refused to share geolocation data'); break; case err.POSITION_UNAVAILABLE: console.log('Current position is unavailabel'); break; case err.TIMEOUT: console.log('Timed out'); break; default: console.log('Unknown error'); break; } } }}
getCurrentPosition: position.coords.latitude, position.coords.longitude, position.coords.altitude, position.coords.accuracy;
watchCurrentPosition: position.coords.heading, position.coords.speed;
0 0
- HTML5 Geolocation示例
- html5 geolocation
- HTML5 Geolocation
- HTML5 Geolocation
- HTML5 Geolocation
- HTML5全球定位系统Geolocation初探
- HTML5的Geolocation API
- HTML5全球定位系统Geolocation初探
- HTML5之Geolocation API
- HTML5全球定位系统Geolocation初探
- HTML5 Geolocation 地理位置 - 6
- HTML5 Geolocation获取地理位置
- HTML5 Geolocation API
- HTML5地理定位(Geolocation)
- HTML5地理定位Geolocation
- HTML5 Geolocation地理定位
- Html5 Geolocation获取地理位置信息
- Html5 系列之:地理位置Geolocation
- 随机生成3个数,创建3个指针指向这3个数,不改变这3个数,从大到小显示。
- 漫步IOS--OC编程初始
- Matlab图像处理学习笔记(三):基于匹配的目标识别
- 在一个字符串中找到第一个只出现一次的字符
- Servlet 生命周期、工作原理
- HTML5 Geolocation示例
- 第二次迭代个人总结
- 输入一颗二元树,从上向下按层打印树的每个节点,同一层中,按照从左到右的顺序打印。
- 输入一个单向链表,输出该链表中倒数第K个结点
- Tomcat性能调优
- linux内核由struct file获取filename
- 查找最小的K个元素,使用最大堆。
- CSS SASS基础知识
- [Linux]RHEL使用DSN和DHCP