diff --git a/src/components/DeckGLMap.ts b/src/components/DeckGLMap.ts index dfa6582c8..346483d39 100644 --- a/src/components/DeckGLMap.ts +++ b/src/components/DeckGLMap.ts @@ -48,7 +48,7 @@ import { HeatmapLayer } from '@deck.gl/aggregation-layers'; import type { WeatherAlert } from '@/services/weather'; import { escapeHtml } from '@/utils/sanitize'; import { tokenizeForMatch, matchKeyword, matchesAnyKeyword, findMatchingKeywords } from '@/utils/keyword-match'; -import { t, getCurrentLanguage } from '@/services/i18n'; +import { t } from '@/services/i18n'; import { debounce, rafSchedule, getCurrentTheme } from '@/utils/index'; import { INTEL_HOTSPOTS, @@ -424,7 +424,6 @@ export class DeckGLMap { this.rebuildTechHQSupercluster(); this.rebuildDatacenterSupercluster(); this.initDeck(); - this.applyBasemapLocalization(); this.loadCountryBoundaries(); this.fetchServerBases(); this.render(); @@ -4718,7 +4717,6 @@ export class DeckGLMap { // setStyle() replaces all sources/layers — reset guard so country layers are re-added this.countryGeoJsonLoaded = false; this.maplibreMap.once('style.load', () => { - this.applyBasemapLocalization(); this.loadCountryBoundaries(); this.updateCountryLayerPaint(theme); // Re-render deck.gl overlay after style swap — interleaved layers need @@ -4727,36 +4725,6 @@ export class DeckGLMap { }); } - private applyBasemapLocalization(): void { - if (!this.maplibreMap) return; - const style = this.maplibreMap.getStyle(); - const layers = style?.layers ?? []; - const lang = getCurrentLanguage(); - const localizedNameField = lang === 'en' ? 'name_en' : `name_${lang}`; - - for (const layer of layers) { - const layerType = (layer as { type?: string }).type; - if (layerType !== 'symbol') continue; - - const sourceLayer = (layer as { 'source-layer'?: string })['source-layer']; - if (sourceLayer !== 'place') continue; - - const layout = (layer as { layout?: Record }).layout; - if (!layout || layout['text-field'] == null) continue; - - try { - this.maplibreMap.setLayoutProperty(layer.id, 'text-field', [ - 'coalesce', - ['get', localizedNameField], - ['get', 'name'], - ['get', 'name_en'], - ]); - } catch { - // Some style layers may reject runtime text-field updates; skip those safely. - } - } - } - private updateCountryLayerPaint(theme: 'dark' | 'light'): void { if (!this.maplibreMap || !this.countryGeoJsonLoaded) return; const hoverOpacity = theme === 'light' ? 0.10 : 0.06;