Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
158
rated 0 times [  165] [ 7]  / answers: 1 / hits: 45724  / 14 Years ago, tue, august 10, 2010, 12:00:00

I would like to get the latitude and longitude of current location from gps enabled mobile device right from the web browser. May I know is this possible? how to do it? does it require geolocation api? Some coding example would be helpful. Thanks.


More From » api

 Answers
26

Use the HTML5 Geolocation API, here's the official spec and examples.



EDIT



I've updated my answer to include current browser support.



W3C Geolocation API support



Firefox 3.5+
Safari 5.0+
Chrome 5.0+
Opera
iPhone 3.0+
Android 2.0+


· ·

Other phones not listed above use Gears or their own, platform-specific APIs.





Ahh, will we ever have just one single API? :)



Many thanks to Mark Pilgrim for his awesome post.


[#95970] Saturday, August 7, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ronniem

Total Points: 584
Total Questions: 111
Total Answers: 111

Location: Finland
Member since Sat, Nov 6, 2021
3 Years ago
;