从手机浏览器获取位置数据 [英] Get position data from mobile browser

查看:131
本文介绍了从手机浏览器获取位置数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个网络应用程序,它将经常被移动浏览器打击。我想知道是否有办法从浏览器请求中获取足够的信息来查找位置数据(三角测量或GPS)当然,不是直接从请求中获取。一位同事建议,有些运营商提供了独特的请求标头中的标识符可以发送到由所述提供者公开的Web服务,如果客户已经启用该标识符将返回位置数据。任何人都可以指出我对这个或任何其他方法拾取位置数据的正确方向,即使非常接近。显然这是app糖果,例如如果数据不可用,那么应用程序并不真正在意......

I am developing a web app that will be hit frequently by mobile browsers. I am wondering if there is a way to get enough information from the browser request to lookup position data (triangulation or GPS) Not from the request directly, of course. A colleague suggested there some carriers supply a unique identifier in the request header that can be sent to a web service exposed by said provider that will return position data if the customer has enabled that. Can anyone point me in the right direction for this or any other method for gleaning position data, even very approximate. Obviously this is app candy, e.g. if the data is not available the app doesn't really care...

或者,运营商提供的网络服务可以通过IP提供三角测量数据?

Or perhaps a web service by carrier that will provide triangulated data by IP?

推荐答案

Google有 ClientLocation 作为其AJAX API的一部分。您需要加载Google的AJAX API(需要API密钥),然后它会尝试为您解析用户的位置数据。

Google has ClientLocation as part of their AJAX APIs. You'll need to load Google's AJAX API (requires an API key) and it'll try to resolve the user's location data for you.

这篇关于从手机浏览器获取位置数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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