Advertisement
Guest User

Untitled

a guest
May 24th, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. this.mapPageDrawOverlay = function(context)
  2. {
  3. console.log("Record Route - mapPageDrawOverlay");
  4.  
  5. var point = newRoutePageController.canvasPointFromLocation(coordinates.coord_x,coordinates.coord_y);
  6.  
  7. context.fillStyle = "rgb(0, 0, 204)";
  8. context.lineWidth = 2.0;
  9. context.strokeStyle = "rgb(0, 0, 204)";
  10.  
  11. context.beginPath();
  12. context.arc(point.x, point.y, 5, 0, 2*Math.PI);
  13. context.fill();
  14. context.stroke();
  15.  
  16. //This circle represent the accuracy of the location recorded
  17. context.fillStyle = "rgba(0, 255, 255, 0.2)";
  18. context.lineWidth = 0.4;
  19. context.strokeStyle = "rgb(0, 255, 255)";
  20.  
  21. context.beginPath();
  22. context.arc(point.x, point.y, coordinates.currentAccuracy, 0, 40*Math.PI);
  23. context.fill();
  24. context.stroke();
  25.  
  26. for (var i = 0; i < Path.x.length; i++)
  27. {
  28. var start = newRoutePageController.canvasPointFromLocation(Path.x[i],Path.y[i]);
  29. var end = newRoutePageController.canvasPointFromLocation(Path.x[i-1],Path.y[i-1]);
  30.  
  31. context.fillStyle = "rgb(255, 0, 255)";
  32. context.lineWidth = 1.0;
  33. context.strokeStyle = "rgb(255, 0, 255)";
  34.  
  35. context.beginPath();
  36. context.arc(start.x, start.y, 3, 0, 2*Math.PI);
  37. context.fill();
  38. context.stroke();
  39.  
  40. context.strokeStyle = "rgba(255, 0, 255,0.25)";
  41. context.lineWidth = 5;
  42. context.beginPath();
  43. context.moveTo(end.x, end.y);
  44. context.lineTo(start.x, start.y);
  45. context.stroke();
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement