diff --git a/layouts/shortcodes/world-map.html b/layouts/shortcodes/world-map.html index 27b327d..d796e2a 100644 --- a/layouts/shortcodes/world-map.html +++ b/layouts/shortcodes/world-map.html @@ -110,11 +110,27 @@ if (!geoData) return; - // Draw country fills (no separate land fill — gaps show ocean, not white) + // Pass 1: draw ALL countries as white in a single path (eliminates inter-polygon seams) + ctx.fillStyle = '#ffffff'; + ctx.beginPath(); + geoData.features.forEach(function(f) { + var geom = f.geometry; + if (geom.type === 'Polygon') { + geom.coordinates.forEach(function(ring) { traceRing(ctx, ring, sx, sy); }); + } else if (geom.type === 'MultiPolygon') { + geom.coordinates.forEach(function(poly) { + poly.forEach(function(ring) { traceRing(ctx, ring, sx, sy); }); + }); + } + }); + ctx.fill('evenodd'); + + // Pass 2: overdraw colored countries only geoData.features.forEach(function(f) { var id = String(f.id).padStart(3, '0'); var c = byIsoNum[id]; - ctx.fillStyle = c ? STATUS_COLORS[c.status] : '#ffffff'; + if (!c) return; // skip no-data (already white) + ctx.fillStyle = STATUS_COLORS[c.status]; drawGeometry(ctx, f.geometry, sx, sy, true); });