update lib part one
This commit is contained in:
parent
eba0b18689
commit
54a7ad6b9d
6 changed files with 41 additions and 4 deletions
|
|
@ -20,6 +20,9 @@ interface IBRouterService {
|
|||
// "remoteProfile"--> (String), net-content of a profile. If remoteProfile != null, v+fast are ignored
|
||||
//
|
||||
// "lonlats" = lon,lat|... (unlimited list of lon,lat waypoints separated by |)
|
||||
// variantes: lon,lat,d|... (from this point to the next do a direct line)
|
||||
// lon,lat,name|... (route point has a name and should not be ignored)
|
||||
// "straight" = idx1,idx2,.. (optional, minimum one value, index of a direct routing point in the waypoint list)
|
||||
// "nogos" = lon,lat,radius|... (optional, radius in meters)
|
||||
// "polylines" = lon,lat,lon,lat,...,weight|... (unlimited list of lon,lat and weight (optional), lists separated by |)
|
||||
// "polygons" = lon,lat,lon,lat,...,weight|... (unlimited list of lon,lat and weight (optional), lists separated by |)
|
||||
|
|
@ -28,9 +31,9 @@ interface IBRouterService {
|
|||
// "exportWaypoints" = 1 to export them (optional, default is no export)
|
||||
// "pois" = lon,lat,name|... (optional)
|
||||
// "extraParams" = Bundle key=value list for a profile setup (like "profile:")
|
||||
// "timode" = turnInstructionMode [0=none, 1=auto-choose, 2=locus-style, 3=osmand-style, 4=comment-style, 5=gpsies-style, 6=orux-style] default 0
|
||||
// "timode" = turnInstructionMode [0=none, 1=auto-choose, 2=locus-style, 3=osmand-style, 4=comment-style, 5=gpsies-style, 6=orux-style, 7=locus-new-style, 8=cruiser-stylem, 9=brouter-intern] default 0
|
||||
// "heading" = angle (optional to give a route a start direction)
|
||||
// "direction" = (deprecated) angle
|
||||
// "direction" = angle (optional, used on recalculation, only used by Locus)
|
||||
|
||||
// return null if all ok and no path given, the track if ok and path given, an error message if it was wrong
|
||||
// the resultas string when 'pathToFileResult' is null, this should be default when Android Q or later
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class BRouterWorker {
|
|||
if ("osmand".equalsIgnoreCase(tiFormat)) {
|
||||
rc.turnInstructionMode = 3;
|
||||
} else if ("locus".equalsIgnoreCase(tiFormat)) {
|
||||
rc.turnInstructionMode = 2;
|
||||
rc.turnInstructionMode = 7;
|
||||
}
|
||||
}
|
||||
if (params.containsKey("timode")) {
|
||||
|
|
@ -112,7 +112,19 @@ public class BRouterWorker {
|
|||
String key = tk2.nextToken();
|
||||
if (tk2.hasMoreTokens()) {
|
||||
String value = tk2.nextToken();
|
||||
rc.keyValues.put(key, value);
|
||||
if (key.equals("straight")) {
|
||||
try {
|
||||
String[] sa = value.split(",");
|
||||
for ( int i = 0; i<sa.length;i++) {
|
||||
int v = Integer.valueOf(sa[i]);
|
||||
if (waypoints.size() > v) waypoints.get(v).direct = true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.err.println("error " + e.getStackTrace()[0].getLineNumber() + " " + e.getStackTrace()[0] + "\n" +e);
|
||||
}
|
||||
} else {
|
||||
rc.keyValues.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -226,6 +238,13 @@ public class BRouterWorker {
|
|||
if (lonLat.length < 2)
|
||||
throw new IllegalArgumentException("we need two lat/lon points at least!");
|
||||
wplist.add(readPosition(lonLat[0], lonLat[1], "via" + i));
|
||||
if (lonLat.length > 2) {
|
||||
if (lonLat[2].equals("d")) {
|
||||
wplist.get(wplist.size()-1).direct = true;
|
||||
} else {
|
||||
wplist.get(wplist.size()-1).name = lonLat[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wplist.get(0).name = "from";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue