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:
+12
-11
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user