是否可以从 HTTP 请求中获取(粗略的)手机位置 [英] Is It Possible to get a (rough) Mobile Phone Location from a HTTP Request

查看:26
本文介绍了是否可以从 HTTP 请求中获取(粗略的)手机位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我没记错的话,谷歌会为地图网站执行此操作.我知道谷歌的移动地图应用程序可以确定粗略的位置(我假设使用某种手机信号塔查找),但我似乎记得在移动浏览器上查看时该网站有点接近当前位置.

If memory serves me correctly, google does this for the maps site. I know google's mobile maps app can determine the rough location (I assume using some kind of cell tower lookup), yet I seem to remember the site getting somewhat close to the current location when viewing on a mobile browser.

有人知道如何/如果可能吗?IP 地址是否会根据塔或区域而变化(似乎他们会使用运营商常用的某种网关)?

Anyone know how/if that's possible? Does the IP address change based on the tower or area (seems like they'd be using some kind of gateway common to the carrier)?

推荐答案

使用常规 HTTP 请求,您唯一的选择是 GeoIP,但这只会给您国家和地区.运营商再好不过了.

With a regular HTTP request the only option you have is GeoIP but this will only give you the country & operator no better.

取决于应用程序和您使用的设备有多种地理定位选项,例如 iPhone 和Android 浏览器支持 HTML5 地理 JavaScript 功能,因此您可以在页面中放置一些代码来向您发送位置.但是这些都涉及到一些客户端代码.

Depending on the application & device you are using there are various option for geolocation, for example iPhone & Android browsers suport the HTML5 geo javascript functions so you could put some code in the page to send you the location. However these all involve some client side code.

另一个选项涉及与网络进行交易,他们可以在请求中将电话号码作为附加标头提供给您,然后您可以通过运营商的 API 查询此号码,以从网络.然而,他们为此功能收取了相当多的费用,而且精度可能从城市环境中的 100m 到农村地区的 35Km 不等.

The other option involves doing a deal with the networks, they can supply you the phone number as an additional header in the request and you can then query this number via an API from the operator to get the location of the phone from the network. However they charge a pretty penny for this function and the accuracy can vary from about 100m in an urban environment to 35Km in very rural areas.

这篇关于是否可以从 HTTP 请求中获取(粗略的)手机位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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