feat: show country flag next to city names in top villes

Determine country from geoPoint coordinates using bounding boxes
for the main Ğ1 community countries (FR, BE, CH, ES, DE, IT, ...).
Display the emoji flag before each city name in the top villes panel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
syoul
2026-03-22 18:52:00 +01:00
parent a8792641ab
commit 8d9a9a3c07
4 changed files with 70 additions and 26 deletions
+12 -11
View File
@@ -56,11 +56,11 @@ async function fetchLiveTransactions(periodDays: number): Promise<{
)];
// Résolution géo par clé Duniter (_id Cesium+)
let geoMap = new Map<string, { lat: number; lng: number; city: string }>();
let geoMap = new Map<string, { lat: number; lng: number; city: string; countryCode: string }>();
try {
const profiles = await resolveGeoByKeys(duniterKeys);
for (const [key, p] of profiles) {
geoMap.set(key, { lat: p.lat, lng: p.lng, city: p.city });
geoMap.set(key, { lat: p.lat, lng: p.lng, city: p.city, countryCode: p.countryCode });
}
} catch (err) {
console.warn('Cesium+ indisponible :', err);
@@ -75,14 +75,15 @@ async function fetchLiveTransactions(periodDays: number): Promise<{
if (!geo) continue;
geolocated.push({
id: t.id,
timestamp: t.timestamp,
lat: geo.lat,
lng: geo.lng,
amount: t.amount,
city: geo.city,
fromKey: t.fromId,
toKey: t.toId,
id: t.id,
timestamp: t.timestamp,
lat: geo.lat,
lng: geo.lng,
amount: t.amount,
city: geo.city,
countryCode: geo.countryCode,
fromKey: t.fromId,
toKey: t.toId,
});
}
@@ -96,7 +97,7 @@ export interface PeriodStats {
totalVolume: number;
transactionCount: number; // total blockchain (y compris non-géolocalisés)
geoCount: number; // transactions visibles sur la carte
topCities: { name: string; volume: number; count: number }[];
topCities: { name: string; volume: number; count: number; countryCode: string }[];
}
export interface DataResult {