移动GPS网络应用程序 [英] Mobile GPS web application
问题描述
我需要开发一个网络应用程序。 (PHP)的手机100%,需要从手机GPS获取信息,以获得用户的当前位置。我的问题是,我应该怎么做?
我知道PHP,但我对GPS部分完全无能为力(之前从未与他们合作过)。我正在寻找的是抬头看看我是否可以处理这项工作,或只是拒绝它。
我听说W3地理定位API做得非常好,但在测试之后,我并不确信精确度和浏览器支持。我不想使用谷歌的齿轮,因为它必须先下载。
我确实认为< W3C地理定位API 是一个很好的开始:它越来越被接受手机,是一个开放的标准,并将所有特定于设备的API抽象出来。
的确,准确性可能不够完美,但这是因为手机本身可能不是总是知道它在哪里。该API为您提供了一些解决此问题的方法:如果您需要高精确度,则可以通过 enableHighAccuracy $,以牺牲功耗/时间的方式向设备提示您需要准确的结果c $ c>标志并设置一个很长的
超时
参数,以允许设备使用GPS查找位置。此外,所有位置均以95%的置信度返回精度值 - 如果错误过高(通常电话会在第一次请求时返回高错误),您可以再次请求位置,指定您不想要一个缓存的位置。
I need to develop a web app. (PHP) 100% for mobile phones and need to get the information from the mobile phone GPS, in order to get the user's current position. My question is, what should I do?
I know PHP but I'm completely clueless about the GPS part (never worked with them before). All i'm looking is for headsup to see if I can handle the job or just reject it.
I've heard that the W3 geolocation API does a very good job but after testing it i'm not convinced about the accuracy and browser support. I don't want to use Google's gears due to the fact that it must be downloaded first.
I do think the W3C Geolocation API is a good place to start: it has growing acceptance on mobile phones, is an open standard and abstracts away all the device-specific APIs.
It's true that the accuracy may not be perfect, but that's because the phone itself may not always know perfectly where it is. The API gives you a couple ways to work around this: if you need high accuracy, you can hint to the device that you want an accurate result even at the cost of power/time with the enableHighAccuracy
flag and set a long timeout
parameter to allow the device to use GPS to find a location. Also, all positions are returned with an accuracy value for 95% confidence -- if the error is too high (often phones will return a high error on the first request), you can request the location again, specifying that you don't want a cached location.
这篇关于移动GPS网络应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!