Results 1 to 2 of 2

Thread: Geolocation detection

  1. #1
    Join Date
    Dec 2009
    Posts
    12

    Geolocation detection

    can anyone help me with technique to detect location (in India) of the user so that relevant data can be shown to the user. I tried to search on google and found that html5 can help to do this but it asks user's permission to access the location details. Is there any other way to detect it without permission

  2. #2
    Join Date
    Jan 2006
    Posts
    605

    Re: Geolocation detection

    You will need an ip address for searching the location of any user, anyhow, check out an alternative structure for the functions that uses IP geolocation of google for fallback:

    Code:
    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(updatePosition, ipPosition, { options... });
    } else {
      ipPosition();
    }
    
    function ipPosition() {
      updatePosition(google.loader.ClientLocation);
    }
    
    function updatePosition(position) {
      if (position == null) {
        return updatePosition(defaultPlace());
      }
    
      // Firefox 3.6 passes in a non-standard position object with lat/lng at the top level instead of in .coords
      var coords = (position.hasOwnProperty("coords")) ? position.coords : position;
      if (coords == null) {
        return updatePosition(defaultPlace());
      }
    
      [...]
    }

Similar Threads

  1. GeoLocation is not working with Safari 5 and HTML 5
    By Super-Man in forum Technology & Internet
    Replies: 3
    Last Post: 15-01-2012, 08:01 PM
  2. GeoLocation is not working properly ASUS Eee PC T101MT
    By Anantram in forum Portable Devices
    Replies: 4
    Last Post: 08-07-2011, 08:02 AM
  3. Firefox 3.5 include Geolocation
    By Johnny in forum Technology & Internet
    Replies: 2
    Last Post: 10-06-2009, 11:13 PM

Posting Permissions

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