Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Posts
    455
    Thanks
    7
    Thanked 3 Times in 3 Posts

    How to get GPS not geolocation

    I am wanting to have the visitor's GPS location to be sent with their requests on a form. All I am able to find so far is Geo Location which is not the visitors location but instead the location of the ISP office that deals with IP address they are currently using.

    Does anyone know how I can do this?

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    geolocation provides the most accurate location available.

    If they are browsing on a GPS enabled device and grant their browser access to that information then that's what geolocation will use.

    If they don't grant access then you get nothing regardless of how accurately their device knows its location.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    Regular Coder
    Join Date
    Oct 2009
    Posts
    455
    Thanks
    7
    Thanked 3 Times in 3 Posts
    ok I tried to use this site... HTML5 Demo: geolocation
    on my own mobile and it showed a better location but still its like half a mile away from where I am.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,509
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    No way to do it accurately unless they actually mark their location on a Google Map (as a mash-up application on your site). I would think most people would not wish to do that unless it's an absolute requirement for something.

    Knowing their address (number, street, city, state, zipcode) would get you the closest without a person actually pin-pointing it on a map.

    It is a privacy issue as well.

  • #5
    Regular Coder
    Join Date
    Oct 2009
    Posts
    455
    Thanks
    7
    Thanked 3 Times in 3 Posts
    of course they would have to confirm the privacy box that pops up, like I had when I tested the page above.

    I am not after an exact location to the pin-point, but half a mile is a fair distance way then that when I used my mobiles road map feature. The Road map was showing me as being about 4 houses away from where I am.

  • #6
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    So the browser you tested with only reports your position with the level of accuracy you saw. The limitation is whatever is built into the device and is beyond what can be controlled with your code.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #7
    Regular Coder
    Join Date
    Oct 2009
    Posts
    455
    Thanks
    7
    Thanked 3 Times in 3 Posts
    I viewed the page HTML5 Demo: geolocation on my windows mobile phone and I was shown on the map to be half a mile away from my real position.

    When I view the MAPS app on my phone it shows my position to be within 4 houses away from my real position.

    Surely the website and the maps app would be using the same geo position ?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •