Refactor RouteService
This commit is contained in:
parent
1a082c5c98
commit
624b897a6c
1 changed files with 9 additions and 7 deletions
|
@ -79,14 +79,16 @@ public class RouteProvider {
|
||||||
private static final int MIN_DISTANCE_FOR_INSERTING_ROUTE_SEGMENT = 60;
|
private static final int MIN_DISTANCE_FOR_INSERTING_ROUTE_SEGMENT = 60;
|
||||||
|
|
||||||
public enum RouteService {
|
public enum RouteService {
|
||||||
OSMAND("OsmAnd (offline)"), YOURS("YOURS"),
|
OSMAND("OsmAnd (offline)"),
|
||||||
|
YOURS("YOURS"),
|
||||||
//ORS("OpenRouteService"), // disable ors due to no public rest service (testing2015 doesn't seem stable)
|
//ORS("OpenRouteService"), // disable ors due to no public rest service (testing2015 doesn't seem stable)
|
||||||
OSRM("OSRM (only car)"),
|
OSRM("OSRM (only car)"),
|
||||||
BROUTER("BRouter (offline)"), STRAIGHT("Straight line");
|
BROUTER("BRouter (offline)"),
|
||||||
|
STRAIGHT("Straight line");
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
private RouteService(String name) {
|
RouteService(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +108,7 @@ public class RouteProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RouteService[] getAvailableRouters(OsmandApplication ctx) {
|
public static RouteService[] getAvailableRouters(OsmandApplication ctx) {
|
||||||
List<RouteService> list = new ArrayList<RouteProvider.RouteService>();
|
List<RouteService> list = new ArrayList<>();
|
||||||
for (RouteService r : values()) {
|
for (RouteService r : values()) {
|
||||||
if (r.isAvailable(ctx)) {
|
if (r.isAvailable(ctx)) {
|
||||||
list.add(r);
|
list.add(r);
|
||||||
|
|
Loading…
Reference in a new issue