W3C home > Mailing lists > Public > public-geolocation@w3.org > May 2009

aborting getCurrentPosition()?

From: Max Froumentin <maxfro@opera.com>
Date: Wed, 06 May 2009 09:48:47 +0200
To: public-geolocation@w3.org
Message-ID: <m2bpq6y8m8.fsf@pc214.sm.oslo.opera.com>
Hi,

Was the possibility of aborting an asynchronous operation ever considered?
Either through abort(), a la XMLHttpRequest:

var asyncOperation =  navigator.geolocation.getCurrentPosition(successCallback,  errorCallback, {maximumAge:600000});
// Waiting for success or callback, GPS Fix is taking time, user gets bored

button.onevent=function() {
  alert("fix cancelled");
  asyncOperation.abort();
}

or through a new error type:

navigator.geolocation.getCurrentPosition(successCallback,  errorCallback, {maximumAge:600000});
function errorCallback(error) {
  if (error.code == ABORT) {
    alert("fix cancelled");
 }
}

Max.
Received on Wednesday, 6 May 2009 07:49:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 August 2009 20:54:10 GMT