[gnome-maps/wip/mlundblad/transit-service-discovery: 8/11] openTripPlanner: Don't take GraphHopper instance as a parameter



commit fad2b19aca8d5352be385b5e6bfd8b5fc9380f03
Author: Marcus Lundblad <ml update uu se>
Date:   Sun Aug 18 11:32:23 2019 +0200

    openTripPlanner: Don't take GraphHopper instance as a parameter
    
    Instead access it through the Application global instance.
    This way, the coming transit pluging handler will not have
    to handle passing the GraphHopper instance directly to plugins
    needing it.

 src/transitplugins/openTripPlanner.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/transitplugins/openTripPlanner.js b/src/transitplugins/openTripPlanner.js
index b909df7..7303eb3 100644
--- a/src/transitplugins/openTripPlanner.js
+++ b/src/transitplugins/openTripPlanner.js
@@ -23,6 +23,7 @@ const Champlain = imports.gi.Champlain;
 const GLib = imports.gi.GLib;
 const Soup = imports.gi.Soup;
 
+const Application = imports.application;
 const EPAF = imports.epaf;
 const HTTP = imports.http;
 const Location = imports.location;
@@ -128,7 +129,6 @@ var OpenTripPlanner = class OpenTripPlanner {
          */
         this._routersUpdatedTimestamp = 0;
         this._query = params.query;
-        this._graphHopper = params.graphHopper;
         this._plan = new TransitPlan.Plan();
         this._baseUrl = this._getBaseUrl();
         this._walkingRoutes = [];
@@ -797,7 +797,7 @@ var OpenTripPlanner = class OpenTripPlanner {
         let route = this._walkingRoutes[index];
 
         if (!route) {
-            this._graphHopper.fetchRouteAsync(points,
+            Application.routingDelegator.graphHopper.fetchRouteAsync(points,
                                               RouteQuery.Transportation.PEDESTRIAN,
                                               (newRoute) => {
                 this._walkingRoutes[index] = newRoute;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]