diff options
author | Marcus Lundblad <ml@update.uu.se> | 2016-03-14 23:34:26 +0100 |
---|---|---|
committer | Marcus Lundblad <ml@update.uu.se> | 2017-02-15 20:49:50 +0100 |
commit | dae22926210493e377a7d906e6a415e2b08e02e7 (patch) | |
tree | 67eb4e12e8a023dff47a33d3403b7fd4b86e4b4d /src/routeQuery.js | |
parent | 86d9d8ce3e31f3c937037691c96c6e98f79b93a2 (diff) | |
download | gnome-maps-dae22926210493e377a7d906e6a415e2b08e02e7.tar.gz |
routeQuery: Add support for setting time and arrival/departure
Adds a trip time and arrival/departure parameter, indicating if the
time means "arrive no later than the time specified" or "depart not
before the time specified".
This would be used for transit routing.
https://bugzilla.gnome.org/show_bug.cgi?id=755808
Diffstat (limited to 'src/routeQuery.js')
-rw-r--r-- | src/routeQuery.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/routeQuery.js b/src/routeQuery.js index 43e38f64..99ecfaa5 100644 --- a/src/routeQuery.js +++ b/src/routeQuery.js @@ -112,9 +112,47 @@ const RouteQuery = new Lang.Class({ return this._latest; }, + get time() { + return this._time; + }, + + /* time to leave or arrive, null implies "Leave now" */ + set time(time) { + this._time = time; + this.notify('points'); + }, + + get date() { + return this._date; + }, + + /* date to leave or arrive */ + set date(date) { + this._date = date; + /* only notify change when an actual date was set, when resetting time + * time and date (to use "Leave Now" routing) time would be set to null + * triggering an update */ + if (date) + this.notify('points'); + }, + + get arriveBy() { + return this._arriveBy; + }, + + /* when set to true, the set time and date means arrive by the specified + * time */ + set arriveBy(arriveBy) { + this._arriveBy = arriveBy; + if (this._time) + this.notify('points'); + }, + _init: function(args) { this.parent(args); this._points = []; + this._time = null; + this._date = null; this.reset(); }, |