精细用户手机的位置,我的位置的谷歌地图功能 [英] Fine user mobile location with My Location feature of google maps

查看:242
本文介绍了精细用户手机的位置,我的位置的谷歌地图功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的位置的谷歌地图功能有任何API?
我需要本地化的iphone /安卓/黑莓手机浏览器的用户,试图获得GPS位置开始,然后CELL ID,等...究竟我的位置做了什么!但1小时后在网上搜索,我发现什么!
谢谢

Does My Location feature of google maps has any API ? I need to localize users in the iphone/android/blackberry phones browsers, starting by trying to get the GPS location, then Cell ID, etc ... exactly what My Location does! But after 1 hour searching the web, i found nothing! Thank you

推荐答案

我presume这是一个HTML?如果是这样,使用 HTML5地理定位API 。它适用于Android / iPhone以及最近的BlackBerry设备。使用示例:

I presume this is a HTML? If so, use HTML5 Geo Location API. It works on Android/iPhone and the more recent BlackBerry devices. Example of use:

更新设置的 enableHighAccuracy 的为true,因此该设备将尝试获得高精度定位

Updated to set enableHighAccuracy to true so the device will attempt to get high accuracy location

navigator.geolocation.getCurrentPosition(locationHandler, locationErrorHandler, 
                                         {enableHighAccuracy:true});

function locationHandler(position)
{
   var lat = position.coords.latitude;
   var lng = position.coords.longitude;
}

这篇关于精细用户手机的位置,我的位置的谷歌地图功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆