Merge pull request #11057 from osmandapp/master

update test branch
This commit is contained in:
Hardy 2021-03-02 20:01:58 +01:00 committed by GitHub
commit 96221ec5ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View file

@ -46,11 +46,15 @@ public class GpxEngine extends OnlineRoutingEngine {
@Override @Override
protected void makeFullUrl(@NonNull StringBuilder sb, protected void makeFullUrl(@NonNull StringBuilder sb,
@NonNull List<LatLon> path) { @NonNull List<LatLon> path) {
sb.append("?");
for (int i = 0; i < path.size(); i++) { for (int i = 0; i < path.size(); i++) {
LatLon point = path.get(i); LatLon point = path.get(i);
sb.append(point.getLongitude()).append(',').append(point.getLatitude()); sb.append("point=")
.append(point.getLatitude())
.append(',')
.append(point.getLongitude());
if (i < path.size() - 1) { if (i < path.size() - 1) {
sb.append(';'); sb.append('&');
} }
} }
} }

View file

@ -87,16 +87,19 @@ public class GraphhopperEngine extends JsonOnlineRoutingEngine {
protected void makeFullUrl(@NonNull StringBuilder sb, protected void makeFullUrl(@NonNull StringBuilder sb,
@NonNull List<LatLon> path) { @NonNull List<LatLon> path) {
sb.append("?"); sb.append("?");
for (LatLon point : path) { for (int i = 0; i < path.size(); i++) {
LatLon point = path.get(i);
sb.append("point=") sb.append("point=")
.append(point.getLatitude()) .append(point.getLatitude())
.append(',') .append(',')
.append(point.getLongitude()) .append(point.getLongitude());
.append('&'); if (i < path.size() - 1) {
sb.append('&');
}
} }
String vehicle = get(EngineParameter.VEHICLE_KEY); String vehicle = get(EngineParameter.VEHICLE_KEY);
if (!isEmpty(vehicle)) { if (!isEmpty(vehicle)) {
sb.append("vehicle=").append(vehicle); sb.append('&').append("vehicle=").append(vehicle);
} }
String apiKey = get(EngineParameter.API_KEY); String apiKey = get(EngineParameter.API_KEY);
if (!isEmpty(apiKey)) { if (!isEmpty(apiKey)) {