From 28667bcbee67808bdb48f7fdc17a1425fcd067fc Mon Sep 17 00:00:00 2001 From: CN-JS-HuiBai Date: Mon, 13 Apr 2026 15:42:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=AD=E5=9B=BD=E5=8F=B0?= =?UTF-8?q?=E6=B9=BE=E7=BB=98=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/app.js | 4 ++-- server/geo-service.js | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) 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;