If you where to build an app native or with HTML5 would the use of Geolocation get its information from different places? Would the accuracy be different?
| SitePoint Sponsor |
If you where to build an app native or with HTML5 would the use of Geolocation get its information from different places? Would the accuracy be different?

Geolocation based on IP addresses isn't very accurate. It typically gets the Country and State/Provence correct about 90% of the time. Cities are hit or miss, and tend to return the ISP's address, rather than the user's.
Geolocation based on GPS coordinates is very accurate, but not all devices support this.
Visit The Blog | Follow On Twitter
301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
Can be hosted on and utilize your own domain
thanks for the quick response. Is it possible to detect via javascript whether a device has GPS?

Sort of. In javascript, you basically just check to see if the geolocation engine can run. If so, you have access to whichever geolocation resources the device has permission to provide.
As for GeoIP, that uses a completely different solution, and isn't really a part of the build-in geolocation engine build into HTML5.
You can also do error detection do see *why* geolocation isn't available even when it is supported on the device:Code:if (navigator.geolocation) { //do geolocation stuff }else{ //geolocation not supported. Do something else. }
http://merged.ca/iphone/html5-geolocation
Visit The Blog | Follow On Twitter
301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
Can be hosted on and utilize your own domain
maybe slightly off track, you can also eventually incorporate google maps api with the sensor argument as 'true'
for example
http://maps.googleapis.com/maps/api/directions/xml?origin=ORIGIN&destination=DESTINATION&sensor=true
Last edited by Mittineague; Jan 7, 2013 at 22:56.
Bookmarks