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:
njohnston 2016-06-28 20:01:31 +00:00
parent 38affee113
commit 42786fc69c

View file

@ -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;
}
}
}
}