Browse Source

remplace le pointeur bleu central par une ligne bleue

Baptiste Pichot 8 years ago
parent
commit
a79656491d
1 changed files with 9 additions and 7 deletions
  1. 9 7
      panorama/static/panorama/js/pano.js

+ 9 - 7
panorama/static/panorama/js/pano.js

@@ -156,7 +156,7 @@ function draw_tile(idx, ox, oy) {
     cntext.drawImage(img, ox, oy);
 }
 
-/** Draws the colored circles
+/** Draws the colored circles and the central line
  */
 function drawDecorations(ox, oy, tx, ty, twidth, theight) {
     if (twidth) {
@@ -168,11 +168,15 @@ function drawDecorations(ox, oy, tx, ty, twidth, theight) {
     var wgrd = zm.im.width/360;
     var od = ((ox+canvas.width/2)/wgrd)%360;
     var el = (zm.im.height/2 - (oy+canvas.height/2))/wgrd;
-    cntext.fillStyle = "rgba(0,128,128,0.9)";
+
+    // draw a vertical blue line with the central dot
+    // the dot is centered on (ox, oy) = (canvas.width/2, canvas.width/2)
+    var line_width = 6;
+    cntext.fillStyle = "rgba(0,0,255,0.5)";
     cntext.strokeStyle = "rgb(255,255,255)";
     cntext.lineWidth = 1;
-    cntext.fillRect(canvas.width/2-5, canvas.height/2-5, 10, 10);
-    cntext.strokeRect(canvas.width/2-5, canvas.height/2-5, 10, 10);
+    cntext.fillRect(canvas.width/2-line_width/2, 0, line_width, canvas.height);
+    cntext.strokeRect(canvas.width/2-line_width/2, canvas.height/2-line_width, line_width, line_width);
     for(var i = 0; i < zm.pt_list.length; i++) {
       if (zm.pt_list[i]['type'] != 'unlocated') {
 	    cntext.fillStyle = 'rgba('+point_colors[zm.pt_list[i]['type']]+',0.5)';
@@ -181,13 +185,11 @@ function drawDecorations(ox, oy, tx, ty, twidth, theight) {
 	    cntext.beginPath();
 	    cntext.arc(cx, cy, 20, 0, 2*Math.PI, true);
 	    cntext.fill();
-	}
+        }
     }
-
     if (twidth) {
 	cntext.restore();
     }
-
 }
 
 function insert_drawn_point(lat, lon, alt) {