[gnome-maps/wip/mlundblad/transit-routing: 2/24] routeQuery: WIP: add support for setting time and arrival/departure
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/transit-routing: 2/24] routeQuery: WIP: add support for setting time and arrival/departure
- Date: Sat, 27 Aug 2016 11:37:13 +0000 (UTC)
commit 1ee70d917bcc14f0893bb975c20a078ceb919b2f
Author: Marcus Lundblad <ml update uu se>
Date: Mon Mar 14 23:34:26 2016 +0100
routeQuery: WIP: 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.
src/routeQuery.js | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/src/routeQuery.js b/src/routeQuery.js
index 43e38f6..59edb3a 100644
--- a/src/routeQuery.js
+++ b/src/routeQuery.js
@@ -112,9 +112,43 @@ const RouteQuery = new Lang.Class({
return this._latest;
},
+ get time() {
+ return this._time;
+ },
+
+ set time(time) {
+ this._time = time;
+ this.notify('points');
+ },
+
+ get date() {
+ return this._date;
+ },
+
+ 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;
+ },
+
+ 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();
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]