Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Geolocation detection

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 22-07-2012
Member
 
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

Reply With Quote
  #2  
Old 23-07-2012
Member
 
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());
  }

  [...]
}
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Geolocation detection"
Thread Thread Starter Forum Replies Last Post
GeoLocation is not working with Safari 5 and HTML 5 Super-Man Technology & Internet 3 15-01-2012 08:01 PM
GeoLocation is not working properly ASUS Eee PC T101MT Anantram Portable Devices 4 08-07-2011 08:02 AM
Firefox 3.5 include Geolocation Johnny Technology & Internet 2 10-06-2009 11:13 PM


All times are GMT +5.5. The time now is 01:34 PM.