From 5297bfa9432d92ac31b3d6387822a1b981d8dc7f Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Mon, 11 Jan 2021 12:22:23 +0200 Subject: [PATCH] fix Graphhopper name --- OsmAnd/src/net/osmand/plus/onlinerouting/EngineType.java | 2 +- .../plus/onlinerouting/OnlineRoutingEngineFragment.java | 6 +++--- .../net/osmand/plus/onlinerouting/OnlineRoutingHelper.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/onlinerouting/EngineType.java b/OsmAnd/src/net/osmand/plus/onlinerouting/EngineType.java index 3362a4e499..fe5080f14c 100644 --- a/OsmAnd/src/net/osmand/plus/onlinerouting/EngineType.java +++ b/OsmAnd/src/net/osmand/plus/onlinerouting/EngineType.java @@ -2,7 +2,7 @@ package net.osmand.plus.onlinerouting; public enum EngineType { - GRAPHHOPER("Graphhoper", "https://graphhopper.com/api/1/route"), + GRAPHHOPPER("Graphhopper", "https://graphhopper.com/api/1/route"), OSRM("OSRM", "https://router.project-osrm.org/route/v1/"), ORS("Openroute Service", "https://api.openrouteservice.org/v2/directions/"); diff --git a/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingEngineFragment.java b/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingEngineFragment.java index cb70a8ca48..59df4ef698 100644 --- a/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingEngineFragment.java +++ b/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingEngineFragment.java @@ -355,7 +355,7 @@ public class OnlineRoutingEngineFragment extends BaseOsmAndFragment { } else if (typeCard.equals(card)) { typeCard.setHeaderSubtitle(engine.type.getTitle()); typeCard.setEditedText(engine.getBaseUrl()); - if (engine.type == EngineType.GRAPHHOPER || engine.type == EngineType.ORS) { + if (engine.type == EngineType.GRAPHHOPPER || engine.type == EngineType.ORS) { apiKeyCard.show(); } else { apiKeyCard.hide(); @@ -414,7 +414,7 @@ public class OnlineRoutingEngineFragment extends BaseOsmAndFragment { engineToSave.putParameter(EngineParameter.CUSTOM_NAME, engine.customName); engineToSave.putParameter(EngineParameter.CUSTOM_URL, engine.customServerUrl); - if (engine.type == EngineType.GRAPHHOPER || engine.type == EngineType.ORS) { + if (engine.type == EngineType.GRAPHHOPPER || engine.type == EngineType.ORS) { engineToSave.putParameter(EngineParameter.API_KEY, engine.apiKey); } @@ -448,7 +448,7 @@ public class OnlineRoutingEngineFragment extends BaseOsmAndFragment { try { JSONObject obj = new JSONObject(response); - if (type == EngineType.GRAPHHOPER) { + if (type == EngineType.GRAPHHOPPER) { resultOk = obj.has("paths"); } else if (type == EngineType.OSRM) { resultOk = obj.has("routes"); diff --git a/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingHelper.java b/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingHelper.java index 6e61c3d444..b54746ddd6 100644 --- a/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingHelper.java @@ -67,7 +67,7 @@ public class OnlineRoutingHelper { String apiKey = engine.getParameter(EngineParameter.API_KEY); switch (engine.getType()) { - case GRAPHHOPER: + case GRAPHHOPPER: sb.append("?"); for (LatLon point : path) { sb.append("point=") @@ -118,7 +118,7 @@ public class OnlineRoutingHelper { switch (engine.getType()) { - case GRAPHHOPER: + case GRAPHHOPPER: return GeoPolylineParserUtil.parse( obj.getJSONArray("paths").getJSONObject(0).getString("points"), GeoPolylineParserUtil.PRECISION_5);