diff --git a/components/observatory/observatory-map.tsx b/components/observatory/observatory-map.tsx index 19ef4339..d822fffc 100644 --- a/components/observatory/observatory-map.tsx +++ b/components/observatory/observatory-map.tsx @@ -47,7 +47,7 @@ export function ObservatoryMap({ ctx.clearRect(0, 0, canvas.width, canvas.height); // Draw world map background (simplified) - ctx.fillStyle = '#f5f5f5'; + ctx.fillStyle = '#f9f9f9'; ctx.fillRect(0, 0, canvas.width, canvas.height); // Draw grid lines for better visualization @@ -55,7 +55,7 @@ export function ObservatoryMap({ ctx.lineWidth = 1; // Horizontal grid lines - for (let y = 0; y < canvas.height; y += 40) { + for (let y = 0; y < canvas.height; y += 50) { ctx.beginPath(); ctx.moveTo(0, y); ctx.lineTo(canvas.width, y); @@ -63,40 +63,82 @@ export function ObservatoryMap({ } // Vertical grid lines - for (let x = 0; x < canvas.width; x += 40) { + for (let x = 0; x < canvas.width; x += 50) { ctx.beginPath(); ctx.moveTo(x, 0); ctx.lineTo(x, canvas.height); ctx.stroke(); } - // Draw country markers (in random positions) - countries.forEach((country, index) => { - // Generate random positions (in a real app, we would use actual coordinates) - const x = (index * 60 + 100) % (canvas.width - 80); - const y = 60 + Math.floor(index / 4) * 70; + // Draw country markers at more fixed positions + countries.forEach((country) => { + // Position based on country name (simplified) + let x, y; + + // Very simple positioning logic + switch(country.name) { + case 'Sudan': + x = canvas.width * 0.55; + y = canvas.height * 0.45; + break; + case 'Ukraine': + x = canvas.width * 0.65; + y = canvas.height * 0.25; + break; + case 'USA': + case 'New York': + x = canvas.width * 0.25; + y = canvas.height * 0.35; + break; + case 'UK': + x = canvas.width * 0.45; + y = canvas.height * 0.25; + break; + case 'France': + x = canvas.width * 0.48; + y = canvas.height * 0.30; + break; + case 'China': + x = canvas.width * 0.75; + y = canvas.height * 0.35; + break; + case 'Russia': + x = canvas.width * 0.70; + y = canvas.height * 0.20; + break; + case 'India': + x = canvas.width * 0.70; + y = canvas.height * 0.40; + break; + case 'Brazil': + x = canvas.width * 0.35; + y = canvas.height * 0.60; + break; + case 'Australia': + x = canvas.width * 0.80; + y = canvas.height * 0.65; + break; + default: + // Random position for other countries + x = 100 + Math.random() * (canvas.width - 200); + y = 100 + Math.random() * (canvas.height - 200); + } // Draw marker ctx.beginPath(); - ctx.arc(x, y, country.count > 5 ? 8 : (country.count > 2 ? 6 : 4), 0, Math.PI * 2); + ctx.arc(x, y, 6, 0, Math.PI * 2); - // Highlight selected country - if (selectedCountry === country.name) { - ctx.fillStyle = '#3b82f6'; - ctx.strokeStyle = '#2563eb'; - } else { - ctx.fillStyle = '#f87171'; - ctx.strokeStyle = '#ef4444'; - } + // Simple color + ctx.fillStyle = country.name === 'Sudan' ? '#f87171' : '#cbd5e1'; ctx.fill(); - ctx.lineWidth = 1; - ctx.stroke(); - // Draw country name - ctx.fillStyle = '#374151'; - ctx.font = '12px Inter, system-ui, sans-serif'; - ctx.fillText(country.name, x + 14, y + 4); + // Draw country name if it's Sudan or selected + if (country.name === 'Sudan' || country.name === selectedCountry) { + ctx.fillStyle = '#374151'; + ctx.font = '12px system-ui, sans-serif'; + ctx.fillText(country.name, x + 10, y + 4); + } // Store coordinates for click detection country.x = x; @@ -116,7 +158,7 @@ export function ObservatoryMap({ Math.pow(x - country.x, 2) + Math.pow(y - country.y, 2) ); - if (distance <= 10) { + if (distance <= 8) { onCountrySelect(country.name); break; } @@ -134,7 +176,7 @@ export function ObservatoryMap({ }, [countries, selectedCountry, onCountrySelect]); return ( -