diff --git a/public/js/app.js b/public/js/app.js index 04741af..35ca0fc 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1176,8 +1176,8 @@ 'shanghai': [121.4737, 31.2304], 'hong kong': [114.1694, 22.3193], 'hk': [114.1694, 22.3193], - 'taiwan': [120.9605, 23.6978], - 'tw': [120.9605, 23.6978], + 'taiwan': [121.5654, 25.0330], + 'tw': [121.5654, 25.0330], 'united states': [-95.7129, 37.0902], 'us': [-95.7129, 37.0902], 'us seattle': [-122.3321, 47.6062], diff --git a/server/geo-service.js b/server/geo-service.js index 4af35cc..59b7bc3 100644 --- a/server/geo-service.js +++ b/server/geo-service.js @@ -18,13 +18,18 @@ const enableExternalGeoLookup = process.env.ENABLE_EXTERNAL_GEO_LOOKUP === 'true function normalizeGeo(geo) { if (!geo) return geo; - // Custom normalization for TW, HK, MO to "China, {CODE}" - const specialRegions = ['TW']; - if (specialRegions.includes(geo.country?.toUpperCase())) { + // Custom normalization for TW to "Taipei, China" with Taipei coordinates + const country = (geo.country || geo.country_code || '').toUpperCase(); + if (country === 'TW') { return { ...geo, - city: `China, ${geo.country.toUpperCase()}`, - country_name: 'China' + city: 'Taipei', + country: 'TW', + country_name: 'China', + // Force Taipei coordinates for consistent 2D plotting + loc: '25.0330,121.5654', + latitude: 25.0330, + longitude: 121.5654 }; } return geo;