优化日本绘图
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user