Anyone know a clean way to retrieve the gps location from a gps equipped mobile browser using javascript?
6 replies to this topic
#1
Posted 11 February 2012 - 04:37 AM
|
|
|
#2
Posted 11 February 2012 - 07:39 AM
If the browser is designed properly, it will be impossible. If it's possible, the first thing I'll want to do is get a better browser.
With that said, the IP address will generally tell you at least the county, which should be enough for most purposes.
The real question is: why the heck would you want to do this? What's the real goal?
With that said, the IP address will generally tell you at least the county, which should be enough for most purposes.
The real question is: why the heck would you want to do this? What's the real goal?
#3
Posted 11 February 2012 - 07:52 AM
I am writing chat software for a fishing tournament.
We live in the Florida Keys. During a fishing tournament, the competitors work together and need to know where the nearest bait boats and the catch boats are.
Now they use the radio, but want to just look at phones, chat online and incorporate some other fishing specific info.
I am not sure why you gravitated toward something nefarious so quickly. No one wants to get the infor without permission.
I understand this works on iPhone, but I have not tried it. Anyone know a more general way for other browsers?
We live in the Florida Keys. During a fishing tournament, the competitors work together and need to know where the nearest bait boats and the catch boats are.
Now they use the radio, but want to just look at phones, chat online and incorporate some other fishing specific info.
I am not sure why you gravitated toward something nefarious so quickly. No one wants to get the infor without permission.
I understand this works on iPhone, but I have not tried it. Anyone know a more general way for other browsers?
navigator.geolocation.getCurrentPosition( function(loc){
var lat = loc.coords.latitude;
var lon = loc.coords.longitude;
doSomethingWith( lat, lon ); // your function
});
#4
Posted 11 February 2012 - 02:57 PM
I would create an app for the smart phones, rather than a website. Apps can access the GPS information with no problem.
I drifted to nefarious because paranoia keeps viruses and malware off my computer :)
I drifted to nefarious because paranoia keeps viruses and malware off my computer :)
#5
Posted 11 February 2012 - 04:04 PM
Yeah i know. An app would make it much eeasier, but i don't think even two of the participants have the same phone and installation becomes a hassle without going through the app submission process.
I don't want to write two,three or four apps when most of it is just bouncing text messages and other info back and forth through a server. The gps locations just one thing but it is the most important.
So does anyone know a way?
I don't want to write two,three or four apps when most of it is just bouncing text messages and other info back and forth through a server. The gps locations just one thing but it is the most important.
So does anyone know a way?
#6
Posted 11 February 2012 - 04:35 PM
Disturbingly, it appears to be possible on Android. javascript android gps at DuckDuckGo
In general, you're going to have to research this for EACH operating system you want to support.
In general, you're going to have to research this for EACH operating system you want to support.
#7
Posted 14 February 2012 - 09:03 AM
Got it.
Works great thanks to google and Stan Wiechers MIT licensed gps library
Thank you
Jerry
Works great thanks to google and Stan Wiechers MIT licensed gps library
Thank you
Jerry
<script src="http://code.google.com/apis/gears/gears_init.js" type="text/javascript"></script> <script src="http://www.merkwelt.com/people/stan/geo_js/js/geo.js?id=1" type="text/javascript"></script> <script> geo_position_js.getCurrentPosition(success_callback, error_callback); </script>
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

This topic is locked
Back to top









