Update index.html
Browse files- index.html +64 -77
index.html
CHANGED
|
@@ -486,6 +486,21 @@
|
|
| 486 |
};
|
| 487 |
}
|
| 488 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 489 |
// -------------------------------------------------------------
|
| 490 |
// A. DRAW F1 CIRCUIT TRACK
|
| 491 |
// -------------------------------------------------------------
|
|
@@ -521,107 +536,79 @@
|
|
| 521 |
|
| 522 |
// -------------------------------------------------------------
|
| 523 |
// B. DEFINE MAP NODES (Grandstands, Food, Hubs, Gates)
|
| 524 |
-
//
|
| 525 |
// -------------------------------------------------------------
|
| 526 |
const nodes = {
|
| 527 |
// Grandstands
|
| 528 |
-
"Hamilton GS": { pos: toCanvas(-2.2, -
|
| 529 |
-
"Becketts GS": { pos: toCanvas(1,
|
| 530 |
-
"Stowe GS": { pos: toCanvas(
|
| 531 |
-
"Village GS": { pos: toCanvas(-
|
| 532 |
-
"Club GS": { pos: toCanvas(
|
| 533 |
|
| 534 |
// Food Stalls & Arenas
|
| 535 |
-
"Main Fan Zone": { pos: toCanvas(-
|
| 536 |
-
"Becketts Food": { pos: toCanvas(
|
| 537 |
-
"Village Plaza": { pos: toCanvas(-
|
| 538 |
-
"Club Eats": { pos: toCanvas(0.
|
| 539 |
|
| 540 |
// Intermediate Junction Hubs
|
| 541 |
-
"Arena Crossroad": { pos: toCanvas(-
|
| 542 |
-
"Becketts Interchange": { pos: toCanvas(
|
| 543 |
-
"South Bypass": { pos: toCanvas(-
|
| 544 |
|
| 545 |
// Gates
|
| 546 |
-
"Main Gate 1": { pos: toCanvas(-
|
| 547 |
-
"South Gate 2": { pos: toCanvas(1, -4.
|
| 548 |
-
"East Gate 3": { pos: toCanvas(
|
| 549 |
-
"West Gate 4": { pos: toCanvas(-4.
|
| 550 |
};
|
| 551 |
|
| 552 |
// -------------------------------------------------------------
|
| 553 |
// C. INTERCONNECTED STANDARD PEDESTRIAN PATHS (GREEN / RED)
|
|
|
|
| 554 |
// -------------------------------------------------------------
|
| 555 |
-
const
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
{ start: "Club GS", end: "Club Eats", color: "#00cc66" },
|
| 575 |
-
{ start: "Club Eats", end: "South Gate 2", color: "#00cc66" }
|
| 576 |
-
];
|
| 577 |
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
ctx.lineWidth = 4;
|
| 584 |
-
ctx.stroke();
|
| 585 |
-
});
|
| 586 |
|
| 587 |
// -------------------------------------------------------------
|
| 588 |
// D. EXPANDED GOOGLE MAPS MULTI-NODE DETOURS (PURPLE)
|
|
|
|
| 589 |
// -------------------------------------------------------------
|
| 590 |
if (isGate1Bottleneck) {
|
| 591 |
-
//
|
| 592 |
-
|
| 593 |
-
ctx.setLineDash([8, 6]);
|
| 594 |
-
ctx.moveTo(nodes["Main Fan Zone"].pos.x, nodes["Main Fan Zone"].pos.y);
|
| 595 |
-
ctx.lineTo(nodes["South Bypass"].pos.x, nodes["South Bypass"].pos.y);
|
| 596 |
-
ctx.lineTo(nodes["Club Eats"].pos.x, nodes["Club Eats"].pos.y);
|
| 597 |
-
ctx.lineTo(nodes["South Gate 2"].pos.x, nodes["South Gate 2"].pos.y);
|
| 598 |
-
ctx.strokeStyle = "#a020f0";
|
| 599 |
-
ctx.lineWidth = 5;
|
| 600 |
-
ctx.stroke();
|
| 601 |
|
| 602 |
-
//
|
| 603 |
-
|
| 604 |
-
ctx.moveTo(nodes["Arena Crossroad"].pos.x, nodes["Arena Crossroad"].pos.y);
|
| 605 |
-
ctx.lineTo(nodes["Village Plaza"].pos.x, nodes["Village Plaza"].pos.y);
|
| 606 |
-
ctx.lineTo(nodes["West Gate 4"].pos.x, nodes["West Gate 4"].pos.y);
|
| 607 |
-
ctx.strokeStyle = "#a020f0";
|
| 608 |
-
ctx.lineWidth = 5;
|
| 609 |
-
ctx.stroke();
|
| 610 |
-
ctx.setLineDash([]);
|
| 611 |
}
|
| 612 |
|
| 613 |
if (isGate3Bottleneck) {
|
| 614 |
-
//
|
| 615 |
-
|
| 616 |
-
ctx.setLineDash([8, 6]);
|
| 617 |
-
ctx.moveTo(nodes["Becketts Interchange"].pos.x, nodes["Becketts Interchange"].pos.y);
|
| 618 |
-
ctx.lineTo(nodes["Arena Crossroad"].pos.x, nodes["Arena Crossroad"].pos.y);
|
| 619 |
-
ctx.lineTo(nodes["South Bypass"].pos.x, nodes["South Bypass"].pos.y);
|
| 620 |
-
ctx.lineTo(nodes["South Gate 2"].pos.x, nodes["South Gate 2"].pos.y);
|
| 621 |
-
ctx.strokeStyle = "#a020f0";
|
| 622 |
-
ctx.lineWidth = 5;
|
| 623 |
-
ctx.stroke();
|
| 624 |
-
ctx.setLineDash([]);
|
| 625 |
}
|
| 626 |
|
| 627 |
// -------------------------------------------------------------
|
|
|
|
| 486 |
};
|
| 487 |
}
|
| 488 |
|
| 489 |
+
// Helper function to draw multi-point paths
|
| 490 |
+
function drawPath(points, color, isDashed = false) {
|
| 491 |
+
ctx.beginPath();
|
| 492 |
+
if (isDashed) ctx.setLineDash([8, 6]);
|
| 493 |
+
points.forEach((ptKey, idx) => {
|
| 494 |
+
const pos = typeof ptKey === 'string' ? nodes[ptKey].pos : toCanvas(ptKey.x, ptKey.y);
|
| 495 |
+
if (idx === 0) ctx.moveTo(pos.x, pos.y);
|
| 496 |
+
else ctx.lineTo(pos.x, pos.y);
|
| 497 |
+
});
|
| 498 |
+
ctx.strokeStyle = color;
|
| 499 |
+
ctx.lineWidth = isDashed ? 5 : 4;
|
| 500 |
+
ctx.stroke();
|
| 501 |
+
if (isDashed) ctx.setLineDash([]);
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
// -------------------------------------------------------------
|
| 505 |
// A. DRAW F1 CIRCUIT TRACK
|
| 506 |
// -------------------------------------------------------------
|
|
|
|
| 536 |
|
| 537 |
// -------------------------------------------------------------
|
| 538 |
// B. DEFINE MAP NODES (Grandstands, Food, Hubs, Gates)
|
| 539 |
+
// Shifted safely outside the track boundary
|
| 540 |
// -------------------------------------------------------------
|
| 541 |
const nodes = {
|
| 542 |
// Grandstands
|
| 543 |
+
"Hamilton GS": { pos: toCanvas(-2.2, -2.5), type: "gs", label: `Hamilton (${hamilton})` },
|
| 544 |
+
"Becketts GS": { pos: toCanvas(1, 4.8), type: "gs", label: `Becketts (${becketts})` },
|
| 545 |
+
"Stowe GS": { pos: toCanvas(4.8, 1.5), type: "gs", label: `Stowe (${stowe})` },
|
| 546 |
+
"Village GS": { pos: toCanvas(-4.2, 1.2), type: "gs", label: `Village (${village})` },
|
| 547 |
+
"Club GS": { pos: toCanvas(2.8, -4.5), type: "gs", label: `Club (${club})` },
|
| 548 |
|
| 549 |
// Food Stalls & Arenas
|
| 550 |
+
"Main Fan Zone": { pos: toCanvas(-4.2, -1.0), type: "food", label: "π Main Fan Zone" },
|
| 551 |
+
"Becketts Food": { pos: toCanvas(2.8, 4.2), type: "food", label: "π Becketts Food" },
|
| 552 |
+
"Village Plaza": { pos: toCanvas(-3.2, 3.2), type: "food", label: "π Village Plaza" },
|
| 553 |
+
"Club Eats": { pos: toCanvas(-0.5, -4.5), type: "food", label: "π¦ Club Eats" },
|
| 554 |
|
| 555 |
// Intermediate Junction Hubs
|
| 556 |
+
"Arena Crossroad": { pos: toCanvas(-3.5, -2.2), type: "hub", label: "π Arena Hub" },
|
| 557 |
+
"Becketts Interchange": { pos: toCanvas(-1.0, 4.2), type: "hub", label: "π Becketts Hub" },
|
| 558 |
+
"South Bypass": { pos: toCanvas(-2.2, -3.8), type: "hub", label: "π South Hub" },
|
| 559 |
|
| 560 |
// Gates
|
| 561 |
+
"Main Gate 1": { pos: toCanvas(-4.8, -2.2), type: "gate", label: "πͺ Main Gate 1" },
|
| 562 |
+
"South Gate 2": { pos: toCanvas(1.5, -4.8), type: "gate", label: "πͺ South Gate 2" },
|
| 563 |
+
"East Gate 3": { pos: toCanvas(5.2, -1.5), type: "gate", label: "πͺ East Gate 3" },
|
| 564 |
+
"West Gate 4": { pos: toCanvas(-4.8, 3.2), type: "gate", label: "πͺ West Gate 4" }
|
| 565 |
};
|
| 566 |
|
| 567 |
// -------------------------------------------------------------
|
| 568 |
// C. INTERCONNECTED STANDARD PEDESTRIAN PATHS (GREEN / RED)
|
| 569 |
+
// Explicit waypoint routing around track perimeter
|
| 570 |
// -------------------------------------------------------------
|
| 571 |
+
const pathColorG1 = isGate1Bottleneck ? "#ff4444" : "#00cc66";
|
| 572 |
+
const pathColorG3 = isGate3Bottleneck ? "#ff4444" : "#00cc66";
|
| 573 |
+
|
| 574 |
+
// Gate 1 Network
|
| 575 |
+
drawPath(["Hamilton GS", "Arena Crossroad"], pathColorG1);
|
| 576 |
+
drawPath(["Arena Crossroad", "Main Fan Zone"], pathColorG1);
|
| 577 |
+
drawPath(["Main Fan Zone", "Main Gate 1"], pathColorG1);
|
| 578 |
+
drawPath(["Village GS", "Main Fan Zone"], pathColorG1);
|
| 579 |
+
|
| 580 |
+
// Gate 3 & Becketts Network
|
| 581 |
+
drawPath(["Becketts GS", "Becketts Interchange"], pathColorG3);
|
| 582 |
+
drawPath(["Becketts GS", "Becketts Food"], pathColorG3);
|
| 583 |
+
drawPath(["Becketts Food", "Stowe GS"], pathColorG3);
|
| 584 |
+
drawPath(["Stowe GS", "East Gate 3"], pathColorG3);
|
| 585 |
+
|
| 586 |
+
// Outer Northern Connection (Becketts Hub <-> Village Plaza <-> Fan Zone around top/left)
|
| 587 |
+
drawPath(["Becketts Interchange", "Village Plaza"], pathColorG1);
|
| 588 |
+
drawPath(["Village Plaza", "Village GS"], "#00cc66");
|
| 589 |
+
drawPath(["Village Plaza", "West Gate 4"], "#00cc66");
|
|
|
|
|
|
|
|
|
|
| 590 |
|
| 591 |
+
// Outer Southern Connection (Hamilton <-> South Bypass <-> Club Eats <-> South Gate 2 around bottom)
|
| 592 |
+
drawPath(["Hamilton GS", "South Bypass"], "#00cc66");
|
| 593 |
+
drawPath(["South Bypass", "Club Eats"], "#00cc66");
|
| 594 |
+
drawPath(["Club GS", "Club Eats"], "#00cc66");
|
| 595 |
+
drawPath(["Club Eats", "South Gate 2"], "#00cc66");
|
|
|
|
|
|
|
|
|
|
| 596 |
|
| 597 |
// -------------------------------------------------------------
|
| 598 |
// D. EXPANDED GOOGLE MAPS MULTI-NODE DETOURS (PURPLE)
|
| 599 |
+
// Detours routed cleanly along the outer perimeter
|
| 600 |
// -------------------------------------------------------------
|
| 601 |
if (isGate1Bottleneck) {
|
| 602 |
+
// Fan Zone -> South Hub -> Club Eats -> South Gate 2
|
| 603 |
+
drawPath(["Main Fan Zone", "Arena Crossroad", "South Bypass", "Club Eats", "South Gate 2"], "#a020f0", true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 604 |
|
| 605 |
+
// Arena Hub -> West Gate 4
|
| 606 |
+
drawPath(["Arena Crossroad", "Village GS", "West Gate 4"], "#a020f0", true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 607 |
}
|
| 608 |
|
| 609 |
if (isGate3Bottleneck) {
|
| 610 |
+
// Becketts Hub -> Village Plaza -> Main Fan Zone -> South Hub -> South Gate 2
|
| 611 |
+
drawPath(["Becketts Interchange", "Village Plaza", "Main Fan Zone", "South Bypass", "South Gate 2"], "#a020f0", true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 612 |
}
|
| 613 |
|
| 614 |
// -------------------------------------------------------------
|