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

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

问题描述

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

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天全站免登陆