我怎样才能得到GPS位置在网站中使用? [英] How can I get the GPS location for use in a website?

查看:130
本文介绍了我怎样才能得到GPS位置在网站中使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要了解用户位置的网站。所有的用户将是公司的雇员;没有跟踪客户或类似的东西。用户将成为现场员工。他们可能在Android手机,iPhone,平板电脑或笔记本电脑上。我找到了几种获取位置的方法,但无法找到将位置返回到我们网站的具体方法。理想情况下,我们希望将用户的位置报告给数据库,并且网站在登录时会获取该位置。下面是我已经研究过的一些方法来实现这一点。


  1. 个人GPS追踪器(像这样: http://www.ezoomgps.com/home.aspx )。这些设备似乎让雇主通过地图跟踪员工并具有其他功能,但我们需要知道的是位置(经度和纬度)。任何人都知道如何让这样的设备报告这些坐标以便在网站中使用?

  2. 移动应用程序。有很多应用程序用于在地图上显示位置,但没有任何内容只是将位置报告给数据库/网站。任何人都知道只报告设备位置的应用程序?

  3. IP跟踪。发现了一些IP追踪服务(如 http://www.ip2location.com/ ),但不知道如何他们在手机上工作。尝试了一些与我的手机,它让我的城市名称正确,但无法确定我的位置。任何人都知道从IP地址获取物理位置的准确方法?
  4. 听起来像HTML5中的作业 navigator.geolocation.getCurrentPosition 。这将是相当跨平台的,您可以将其构建到网页中,然后向您的数据库报告。



    请参阅:


    I am developing a website that needs to know the user's location. All of the users will be employees of the company; there's no tracking of customers or anything like that. The users will be employees out in the field. They could be on Android phones, iPhones, tablets, or laptops. I've found several ways to get their location, but can't find specific ways to get that location back to our website. Ideally, we'd like the user's location to be reported to database and the website would get that location when they login. Below are some ways I've researched to accomplish this. How do I get any of this information into my website?

    1. Personal GPS tracker (like this: http://www.ezoomgps.com/home.aspx). These devices seem to let employers track employees via a map and have other features, but all we need to know is the location (latitude and longitude). Anyone know how to get a device like this to report those coordinates for use in a website?
    2. Mobile app. Lots of apps out there for showing locations on a map, but nothing that just takes the location and reports it to a database/website. Anyone know of an app that just reports the devices location?
    3. IP tracing. Found some IP tracing services (like http://www.ip2location.com/), but not sure how well they work on mobile. Tried some with my phone and it got my city name right, but couldn't pinpoint my location. Anyone know an accurate way to get a physical location from an IP address?

    解决方案

    Sounds like a job for navigator.geolocation.getCurrentPosition in HTML5. That would be reasonably cross-platform and you could build it into web pages that report back to your database.

    See:

    这篇关于我怎样才能得到GPS位置在网站中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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