fork download
  1. last_x_pos = null;
  2. last_y_pos = null;
  3. first_x_pos = null;
  4. first_y_pos = null;
  5. tracker_canvas_context.beginPath();
  6. for (footprint_point = 0; footprint_point < 360; footprint_point++){
  7. footprint_x_pos = Math.round((retroTrack.footprint[footprint_point].lon + 180)/360*tracker_canvas_width);
  8. footprint_y_pos = Math.round((180-(retroTrack.footprint[footprint_point].lat+90))/180*tracker_canvas_height);
  9.  
  10. // Check if we looped to the other side of the map and need to box in the shadow
  11. if (footprint_x_pos<last_x_pos){
  12. // Box in the region below the line
  13. tracker_canvas_context.lineTo(tracker_canvas_width, last_y_pos);
  14. tracker_canvas_context.moveTo(tracker_canvas_width, last_y_pos);
  15. tracker_canvas_context.lineTo(tracker_canvas_width, tracker_canvas_height);
  16. tracker_canvas_context.moveTo(tracker_canvas_width, tracker_canvas_height);
  17. tracker_canvas_context.lineTo(0, tracker_canvas_height);
  18. tracker_canvas_context.moveTo(0, tracker_canvas_height);
  19. tracker_canvas_context.lineTo(0, footprint_y_pos);
  20. tracker_canvas_context.moveTo(0, footprint_y_pos);
  21. tracker_canvas_context.lineTo(footprint_x_pos, footprint_y_pos);
  22. }
  23.  
  24. if (footprint_point==0){
  25. tracker_canvas_context.moveTo(footprint_x_pos, footprint_y_pos);
  26. first_x_pos = footprint_x_pos;
  27. first_y_pos = footprint_y_pos;
  28. } else {
  29. tracker_canvas_context.lineTo(footprint_x_pos, footprint_y_pos);
  30. tracker_canvas_context.moveTo(footprint_x_pos, footprint_y_pos);
  31. }
  32.  
  33. last_x_pos = footprint_x_pos;
  34. last_y_pos = footprint_y_pos;
  35. }
  36. tracker_canvas_context.closePath();
  37.  
  38. tracker_canvas_context.lineWidth = 1;
  39. tracker_canvas_context.strokeStyle = "#"+configuration['sun_color']['value'];
  40. tracker_canvas_context.fillStyle = "#000000";
  41. tracker_canvas_context.stroke();
  42. tracker_canvas_context.fill();
Runtime error #stdin #stdout 0.01s 4980KB
stdin
Standard input is empty
stdout
Standard output is empty