[gnome-maps] Revert "WIP: graphHopper: Fold subsequent instructions with same name"



commit f8dc7819d38d169b513d15b5703e44d6d32de177
Author: Marcus Lundblad <ml update uu se>
Date:   Tue Apr 9 22:39:17 2019 +0200

    Revert "WIP: graphHopper: Fold subsequent instructions with same name"
    
    This reverts commit 7f8a925eaedce40bf9f1cdfcccd11b0bba87349a.

 src/graphHopper.js | 25 ++-----------------------
 1 file changed, 2 insertions(+), 23 deletions(-)
---
diff --git a/src/graphHopper.js b/src/graphHopper.js
index d0192ba..0953b01 100644
--- a/src/graphHopper.js
+++ b/src/graphHopper.js
@@ -85,7 +85,7 @@ var GraphHopper = class GraphHopper {
         this._queryGraphHopper(points, transportationType,
                                (result, exception) => {
             if (exception) {
-                Utils.debug(exception);
+                Utils.debug(e);
                 if (this._query.latest)
                     this._query.latest.place = null;
                 else
@@ -189,7 +189,7 @@ var GraphHopper = class GraphHopper {
             time:        0,
             turnAngle:   0
         });
-        let rest = this._foldInstructions(instructions).map((instr) => {
+        let rest = instructions.map((instr) => {
             let type = this._createTurnPointType(instr.sign);
             let text = instr.text;
             if (type === Route.TurnPointType.VIA) {
@@ -209,27 +209,6 @@ var GraphHopper = class GraphHopper {
         return [startPoint].concat(rest);
     }
 
-    _foldInstructions(instructions) {
-        let currInstruction = instructions[0];
-        let res = [];
-
-        for (let i = 1; i < instructions.length; i++) {
-            let newInstruction = instructions[i];
-            let newSign = newInstruction.sign;
-            let newStreetname = newInstruction.street_name;
-
-            if ((newSign === 0 || newSign === -7 || newSign === 7) &&
-                newStreetname === currInstruction.street_name) {
-                currInstruction.distance += newInstruction.distance;
-            } else {
-                res.push(currInstruction);
-                currInstruction = instructions[i];
-            }
-        }
-
-        return res;
-    }
-
     _createTurnPointType(sign) {
         let type = sign + 3;
         let min  = Route.TurnPointType.SHARP_LEFT;


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