dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Is there a way to detect whether a user has already given permission for geolocation

  1. #1
    Join Date
    Jul 2014
    Posts
    1

    Is there a way to detect whether a user has already given permission for geolocation

    Is there a way to detect whether a user has already given permission to use navigator.geolocation?

    I can use localStorage, but the problem is in case the user clears location setting from browser. In this case user still gets true from local storage even though location settings are cleared.

  2. #2
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,504
    You can only best guess location based on the users IP. This I have to say is not accurate at all and having tried geoip services, my location either shows up as Birmingham or Luton and both those places are a couple of hours drive from me...
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  3. #3
    Join Date
    Nov 2010
    Posts
    1,097
    there is a PERMISSION_DENIED error callback (error code 1) but (last time I looked anyway) firefox had a bug that it was not detecting when the user had denied permission

    a good resource for geolocation stuff: http://diveintohtml5.info/geolocation.html

  4. #4
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,504
    Having tried the demo, nowhere near where I live...

    I live 3 hours drive from that location.

    People need to take on board a simple fact that IP based location detection does not work for all users and when it does, you have provisional requirements like the IP address that the device connects to is in a known predetermined location.

    Only true way to know someones location is via GPS or based on trust, ask the person.
    Attached Images Attached Images
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles