Steve, Thanks for the reply.
I am using the geolocation sample on the gears website. When pointing at http://code.google.com/apis/gears/samples/hello_world_geolocation.html I get a result that is about half a mile from my actual location. The location is using the cell towers. I am sure of this because although the cell phone is connected via WiFi, a desktop on the same WiFi network gives a different location which presumably uses IP. I duplicated the geolocation example on my website. I get the same results as expected. In order to force the cell phone to use its internal GPS, I changed the example by adding gearsLocationProviderUrls: null The full code is below. The cell phone now returns nothing in the status tag when pointed at the url. At the same location, if I use Google maps and choose the use GPS option, the application reports that it is initializing the GPS and then uses the GPS signal. The position is now accurate to about 30 feet. So my thoughts are that either the GPS is not being initialized by gears or I need to use the watchposition method. Do you know if the API does initialize the GPS? Do you have an example that uses the watchposition metheod? Thanks Jack <!-- End HTML code. Begin JavaScript code. --> <script type="text/javascript" src="gears_init.js"></script> <script type="text/javascript" src="sample.js"></script> <script> init(); function init() { if (!window.google || !google.gears) { addStatus('Gears is not installed', 'error'); return; } addStatus('Getting location...'); function successCallback(p) { var address = p.gearsAddress.city + ', ' + p.gearsAddress.region + ', ' + p.gearsAddress.country + ' (' + p.latitude + ', ' + p.longitude + ')'; clearStatus(); addStatus('You are now at: ' + address); } function errorCallback(err) { var msg = 'Error retrieving your location: ' + err.message; setError(msg); } try { var geolocation = google.gears.factory.create('beta.geolocation'); geolocation.getCurrentPosition(successCallback, errorCallback, { enableHighAccuracy: true, gearsRequestAddress: true,gearRequestUrl:null gearsLocationProviderUrls: null }); } catch (e) { setError('Error using Geolocation API: ' + e.message); return; } } </script> </body> </html> On Mon, Feb 9, 2009 at 8:19 AM, Steve Block <[email protected]> wrote: > > Hi Jack, thanks for the report. > > > Any idea how I can get gears to use the internal GPS? > I'm afraid I don't know why it's not working. I'll try to look into > this. > > > I then browsed to my page and now I > > just get a getting location message with no error and no location. > What do you mean by a 'location message'. When you call > getCurrentPosition(), Gears should always call back - either with a > position fix or an error. Note that if Gears fails to connect to the > GPS, it may take several minutes for the process to time out and for > Gears to report an error. > > Steve
