Fix gpx layer

This commit is contained in:
Victor Shcherb 2014-06-20 10:04:29 +02:00
parent 6fb5d0299a
commit 06986b8fc2

View file

@ -111,10 +111,7 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
// request to load
final QuadRect latLonBounds = tileBox.getLatLonBounds();
for (SelectedGpxFile g : selectedGPXFiles) {
List<WptPt> pts = g.getGpxFile().points;
if(pts.isEmpty() & !g.getGpxFile().routes.isEmpty()) {
pts = g.getGpxFile().routes.get(0).points;
}
List<WptPt> pts = getListStarPoints(g);
int fcolor = g.getColor() == 0 ? defPointColor : g.getColor();
for (WptPt o : pts) {
@ -142,6 +139,14 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
}
}
private List<WptPt> getListStarPoints(SelectedGpxFile g) {
List<WptPt> pts = g.getGpxFile().points;
if(pts.isEmpty() & !g.getGpxFile().routes.isEmpty()) {
pts = g.getGpxFile().routes.get(0).points;
}
return pts;
}
private void drawSegments(Canvas canvas, RotatedTileBox tileBox, List<List<WptPt>> points) {
final QuadRect latLonBounds = tileBox.getLatLonBounds();
for (List<WptPt> l : points) {
@ -197,7 +202,7 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
int ex = (int) point.x;
int ey = (int) point.y;
for (SelectedGpxFile g : selectedGpxHelper.getSelectedGPXFiles()) {
List<WptPt> pts = g.getGpxFile().points;
List<WptPt> pts = getListStarPoints(g);
// int fcolor = g.getColor() == 0 ? clr : g.getColor();
for (WptPt n : pts) {
int x = (int) tb.getPixXFromLatLon(n.lat, n.lon);