last_x_pos = null;
last_y_pos = null;
first_x_pos = null;
first_y_pos = null;
tracker_canvas_context.beginPath();
for (footprint_point = 0; footprint_point < 360; footprint_point++){
footprint_x_pos = Math.round((retroTrack.footprint[footprint_point].lon + 180)/360*tracker_canvas_width);
footprint_y_pos = Math.round((180-(retroTrack.footprint[footprint_point].lat+90))/180*tracker_canvas_height);
// Check if we looped to the other side of the map and need to box in the shadow
if (footprint_x_pos<last_x_pos){
// Box in the region below the line
tracker_canvas_context.lineTo(tracker_canvas_width, last_y_pos);
tracker_canvas_context.moveTo(tracker_canvas_width, last_y_pos);
tracker_canvas_context.lineTo(tracker_canvas_width, tracker_canvas_height);
tracker_canvas_context.moveTo(tracker_canvas_width, tracker_canvas_height);
tracker_canvas_context.lineTo(0, tracker_canvas_height);
tracker_canvas_context.moveTo(0, tracker_canvas_height);
tracker_canvas_context.lineTo(0, footprint_y_pos);
tracker_canvas_context.moveTo(0, footprint_y_pos);
tracker_canvas_context.lineTo(footprint_x_pos, footprint_y_pos);
}
if (footprint_point==0){
tracker_canvas_context.moveTo(footprint_x_pos, footprint_y_pos);
first_x_pos = footprint_x_pos;
first_y_pos = footprint_y_pos;
} else {
tracker_canvas_context.lineTo(footprint_x_pos, footprint_y_pos);
tracker_canvas_context.moveTo(footprint_x_pos, footprint_y_pos);
}
last_x_pos = footprint_x_pos;
last_y_pos = footprint_y_pos;
}
tracker_canvas_context.closePath();
tracker_canvas_context.lineWidth = 1;
tracker_canvas_context.strokeStyle = "#"+configuration['sun_color']['value'];
tracker_canvas_context.fillStyle = "#000000";
tracker_canvas_context.stroke();
tracker_canvas_context.fill();