watchPosition() takes the same parameters as getCurrentPostion().  They are
very simliar, except that watchPosition() will be called more than once if
and when your physical location is changed. This is an example of how to use
watchPosition() -

  var geo = google.gears.factory.create('beta.geolocation');

  function callback(position) {
    alert('Current lat/lon is: ' + position.latitude + ',' +
position.longitude);
  }

  function handleError(positionError) {
    alert('Attempt to get location failed: ' + positionError.message);
  }

  // the callback() will be called every time your device detects a location
change
  geo.watchPosition(callback, handleError);

And lastPostion is an attribute of Geolocation class and it provides a quick
access of last known position.   Code sample -

  // geo is the same geo object created from the factory
  alert('Your last position was: ' + geo.lastPosition.latitude + ',' +
geolastPosition.longitude);


All these information can be found on this page -
http://code.google.com/apis/gears/api_geolocation.html

Hope that helps,
Austin

On Thu, Dec 4, 2008 at 8:37 PM, thiru a <[EMAIL PROTECTED]> wrote:

> To be honest,your reply is frustrating me.
> I said I already referred ur sample ,then again you are referring the same
> Url.
> In ur sample u informed abt how to use 
> getCurrentPosition<http://code.google.com/apis/gears/api_geolocation.html#getCurrent>
> method,for example if want to use 
> watchPosition<http://code.google.com/apis/gears/api_geolocation.html#watchPosition>or
> lastPosition<http://code.google.com/apis/gears/api_geolocation.html#lastPosition>
>  method
> how to do that.
> Expecting some positive reply this time,Pls.
>
> thanks,
> thiru
>
>
> On Wed, Dec 3, 2008 at 5:24 AM, Andrei Popescu <
> [EMAIL PROTECTED]> wrote:
>
>>
>>
>>
>> On Dec 3, 12:34 pm, Prakash <[EMAIL PROTECTED]> wrote:
>> > I dont hav any clue how to proceed.
>>
>> Please see
>>
>> http://code.google.com/apis/gears/samples/hello_world_geolocation.html
>>
>> for an example.
>>
>> Thanks,
>> Andrei
>
>
>

Reply via email to