优化日本绘图

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

@@ -1190,8 +1190,8 @@
'new york corp': [-74.0060, 40.7128],
'san francisco': [-122.4194, 37.7749],
'los angeles': [-118.2437, 34.0522],
'japan': [138.2529, 36.2048],
'jp': [138.2529, 36.2048],
'japan': [139.6917, 35.6895],
'jp': [139.6917, 35.6895],
'tokyo': [139.6917, 35.6895],
'singapore': [103.8198, 1.3521],
'sg': [103.8198, 1.3521],

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;
}