Allow colours for GPX routes (not just tracks) to be specified in files
GPX distinguishes between routes (where you should go) and tracks (where you've been). OsmAnd can already use a colour specified in <color> in <extensions> for tracks, but not routes. With this change, OsmAnd uses colour specified in GPX files for routes. This is very useful when viewing multiple routes or to emphasise a particular route.
This commit is contained in:
parent
38affee113
commit
42786fc69c
1 changed files with 3 additions and 1 deletions
|
@ -725,10 +725,12 @@ public class GPXUtilities {
|
|||
List<TrkSegment> tpoints = new ArrayList<TrkSegment>();
|
||||
if (routes.size() > 0) {
|
||||
for (Route r : routes) {
|
||||
int routeColor = r.getColor(getColor(0));
|
||||
if (r.points.size() > 0) {
|
||||
TrkSegment sgmt = new TrkSegment();
|
||||
tpoints.add(sgmt);
|
||||
sgmt.points.addAll(r.points);
|
||||
sgmt.setColor(routeColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1226,4 +1228,4 @@ public class GPXUtilities {
|
|||
to.warning = from.warning;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue