W3C home > Mailing lists > Public > public-geolocation@w3.org > November 2008

Re: Drop lastPosition from Geolocation?

From: Andrei Popescu <andreip@google.com>
Date: Wed, 19 Nov 2008 18:03:18 +0000
Message-ID: <708552fb0811191003o5c85e8cbnf06c3a1a4feef418@mail.gmail.com>
To: Doug Turner <doug.turner@gmail.com>
Cc: Greg Bolsinga <bolsinga@apple.com>, Aaron Boodman <aa@google.com>, public-geolocation <public-geolocation@w3.org>, Richard Barnes <rbarnes@bbn.com>, Martin Thomson <Martin.Thomson@andrew.com>

On Wed, Nov 19, 2008 at 5:52 PM, Doug Turner <doug.turner@gmail.com> wrote:
> On Nov 19, 2008, at 9:43 AM, Andrei Popescu wrote:
>> Hi Doug,
>> I like the modifiedSince option, but I do have a question. Right now,
>> lastPosition allows you to quickly fallback to some default action if
>> lastPositon is null or too old.
>> In the async solution, the only way to achieve the same thing is by
>> both specifying modifiedSince and setting timeout to 0, right? This
>> would force the UA to immediately invoke the errorCallback (with error
>> TIMEOUT or POSITION_UNAVAILABLE?) in case it does not have a fresh
>> enough cached position. What happens if the page does not have
>> permission? I think the errorCallback should be immediately invoked
>> with error PERMISSION_ERR, right?
> Right, if the document isn't given permission to use navigator.geolocation,
> then the errorCallback, if set, will be called with the PERMISSION_DENIED
> error code.

Ok, so for the following call

geolocation.getCurrentPermission(successCallback, errorCallback,
{modifiedSince:600, timeout:0});

the new behavior is the following:

- if the page has no permission, errorCallback is invoked with
- else
  * if it doesn't have any cached position, errorCallback is invoked
  * else
     ** if the cached position is older than 10 mins, errorCallback is
     ** else successCallback is immediately invoked with the cached position

Received on Wednesday, 19 November 2008 18:03:58 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:33:50 UTC