优化日本绘图

This commit is contained in:
CN-JS-HuiBai
2026-04-13 15:43:47 +08:00
parent 28667bcbee
commit 77743ce097
2 changed files with 14 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ const enableExternalGeoLookup = process.env.ENABLE_EXTERNAL_GEO_LOOKUP === 'true
function normalizeGeo(geo) {
if (!geo) return geo;
// Custom normalization for TW to "Taipei, China" with Taipei coordinates
// Custom normalization for TW to "Taipei, China" and JP to "Tokyo"
const country = (geo.country || geo.country_code || '').toUpperCase();
if (country === 'TW') {
return {
@@ -31,6 +31,17 @@ function normalizeGeo(geo) {
latitude: 25.0330,
longitude: 121.5654
};
} else if (country === 'JP') {
return {
...geo,
city: 'Tokyo',
country: 'JP',
country_name: 'Japan',
// Force Tokyo coordinates for consistent 2D plotting
loc: '35.6895,139.6917',
latitude: 35.6895,
longitude: 139.6917
};
}
return geo;
}