[Tutor] JS for location detection
gvkalra at gmail.com
Sun Jun 6 20:29:32 CEST 2010
I was trying to get the user location based on 4 levels.
1. Try for Navigator telling the location (W3C recommendations followed)
2. In case the location is not available, fallback on Google Gears
3. Again if not available, fall back on Google Ajax API's (only for US)
4. Again if not available, use IP to location using Max-Mind Database
The code that I have written is here:
The problem I am facing:
If the navigator supports location sharing, it will ask the user whether it
wants to approve or not (that's okay!). If the user says NO, it is giving me
the right result by falling back on 3/4 step. But, in case the user
approves, the results are not being populated.
Please check the code for more details (commented inline). Any suggestions ?
gvkalra at googlemail.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor