correct time tag handling
This commit is contained in:
parent
fb183a6480
commit
15d9ea2e75
1 changed files with 31 additions and 25 deletions
|
@ -1080,35 +1080,41 @@ public class RouteProvider {
|
||||||
}
|
}
|
||||||
Route route = new Route();
|
Route route = new Route();
|
||||||
gpx.routes.add(route);
|
gpx.routes.add(route);
|
||||||
|
int collectTime = 0;
|
||||||
for (int i = cDirInfo; i < directionInfo.size(); i++) {
|
for (int i = cDirInfo; i < directionInfo.size(); i++) {
|
||||||
RouteDirectionInfo dirInfo = directionInfo.get(i);
|
RouteDirectionInfo dirInfo = directionInfo.get(i);
|
||||||
if (dirInfo.routePointOffset >= cRoute && dirInfo.getTurnType() != null && !dirInfo.getTurnType().isSkipToSpeak()) {
|
if (dirInfo.routePointOffset >= cRoute) {
|
||||||
Location loc = routeNodes.get(dirInfo.routePointOffset);
|
if (dirInfo.getTurnType() != null && !dirInfo.getTurnType().isSkipToSpeak()) {
|
||||||
WptPt pt = new WptPt();
|
Location loc = routeNodes.get(dirInfo.routePointOffset);
|
||||||
pt.lat = loc.getLatitude();
|
WptPt pt = new WptPt();
|
||||||
pt.lon = loc.getLongitude();
|
pt.lat = loc.getLatitude();
|
||||||
pt.desc = dirInfo.getDescriptionRoute(ctx);
|
pt.lon = loc.getLongitude();
|
||||||
Map<String, String> extensions = pt.getExtensionsToWrite();
|
pt.desc = dirInfo.getDescriptionRoute(ctx);
|
||||||
extensions.put("time", dirInfo.getExpectedTime() + "");
|
Map<String, String> extensions = pt.getExtensionsToWrite();
|
||||||
int turnType = dirInfo.getTurnType().getValue();
|
extensions.put("time", (collectTime + dirInfo.getExpectedTime()) + "");
|
||||||
if (TurnType.C != turnType) {
|
collectTime = 0;
|
||||||
extensions.put("turn", dirInfo.getTurnType().toXmlString());
|
int turnType = dirInfo.getTurnType().getValue();
|
||||||
extensions.put("turn-angle", dirInfo.getTurnType().getTurnAngle() + "");
|
if (TurnType.C != turnType) {
|
||||||
}
|
extensions.put("turn", dirInfo.getTurnType().toXmlString());
|
||||||
extensions.put("offset", (dirInfo.routePointOffset - cRoute) + "");
|
extensions.put("turn-angle", dirInfo.getTurnType().getTurnAngle() + "");
|
||||||
|
}
|
||||||
|
extensions.put("offset", (dirInfo.routePointOffset - cRoute) + "");
|
||||||
|
|
||||||
// Issue #2894
|
// Issue #2894
|
||||||
if (dirInfo.getRef() != null && !"null".equals(dirInfo.getRef())) {
|
if (dirInfo.getRef() != null && !"null".equals(dirInfo.getRef())) {
|
||||||
extensions.put("ref", dirInfo.getRef() + "");
|
extensions.put("ref", dirInfo.getRef() + "");
|
||||||
}
|
}
|
||||||
if (dirInfo.getStreetName() != null && !"null".equals(dirInfo.getStreetName())) {
|
if (dirInfo.getStreetName() != null && !"null".equals(dirInfo.getStreetName())) {
|
||||||
extensions.put("street-name", dirInfo.getStreetName() + "");
|
extensions.put("street-name", dirInfo.getStreetName() + "");
|
||||||
}
|
}
|
||||||
if (dirInfo.getDestinationName() != null && !"null".equals(dirInfo.getDestinationName())) {
|
if (dirInfo.getDestinationName() != null && !"null".equals(dirInfo.getDestinationName())) {
|
||||||
extensions.put("dest", dirInfo.getDestinationName() + "");
|
extensions.put("dest", dirInfo.getDestinationName() + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
route.points.add(pt);
|
route.points.add(pt);
|
||||||
|
} else {
|
||||||
|
collectTime += dirInfo.getExpectedTime();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<TargetPoint> ps = helper.getIntermediatePointsWithTarget();
|
List<TargetPoint> ps = helper.getIntermediatePointsWithTarget();
|
||||||
|
|
Loading…
Reference in a new issue