// Draws trail
noStroke();
for (int i = trackPointIndex; i > trackPointIndex - trailNumber; i--) {
if (i > 0) {
GPXUtils.TrackPoint tp = trackPoints.get(i);
ScreenPosition pos = map.getScreenPosition(tp.location);
float alpha = Math.round(PApplet.map(i, trackPointIndex, trackPointIndex - trailNumber, 255, 0));
fill(255, 0, 255, alpha);
ellipse(pos.x, pos.y, 12, 12);
}
}
// Draws current position
ScreenPosition currentPos = map.getScreenPosition(currentTrackPoint.location);
stroke(255, 120);
strokeWeight(2);
fill(255, 0, 255, 200);
ellipse(currentPos.x, currentPos.y, 16, 16);