Merge pull request #10556 from osmandapp/OnlineRoutingBackend

fix Graphhopper name
This commit is contained in:
Vitaliy 2021-01-11 12:24:53 +02:00 committed by GitHub
commit 4eb868ef9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -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/");

View file

@ -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");

View file

@ -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);