views:

488

answers:

2

Hi, I am new to this forum, however I have found help here many times before, so I am hoping the same happens this time :)

What I would like to do is run a Google Map application on a mobile phone, run the "My Location" feature and get the GPS Co-Ordinates. I would like to do this programmatically.

I could use the built in GPS device, however, in most cases it's about inaccurate by about 20m, which is a bit too much for me. On the other hand, the My Location feature is usually off by a couple of meters (usually less than 5m) which in my case will be enough.

The problem is that I have been looking on the web to see if this can be done. So far, the only way, it seems, that I managed to find to get GPS coordinates from Google Maps is to use some sort of JSP snippet manually.

So basically my question is: Can this be done, and if yes how?

Thanks in advance :)

+1  A: 

The Google Maps API doesn't provide access to your current location (or an estimate of that location). The My Location functionality at maps.google.com uses the Google Gears GeoLocation API to determine the users location. According to the Gears API reference:

The Geolocation API provides the best estimate of the user's position using a number of sources (called location providers). These providers may be onboard (GPS for example) or server-based (a network location provider).

I am not sure if Gears works in the browser for your mobile platform. I am assuming it does if the My Location functionality on maps.google.com works.

Cannonade
I don't want to use the application in a browser. I just want to use it as a simple java application that runs on a mobile platform.I will give a look at the Google Gears API, thanks loads :)
npinti
The answer to your question is "no, you can't get GPS coordinates from Google Maps". You can do what they do (talk to Gears), but only if you are in a browser (it's a browser plugin). Which platform are you on?
Cannonade
I think I might have found some sort of work around, I haven't really tried. I don't want to make a browser application, how ever, it seems that Google gears is supported on my platform. How ever, I would like to make a platform independent (As much as possible at least) application, so Google Gears isn't exactly on top of my list either.
npinti
A: 

You should try this tool : http://gps.studio9.be

arn00s