Skip to content

fix: disable map repetition & use English-only labels#92

Merged
koala73 merged 3 commits intomainfrom
fix/map-no-repeat-no-labels
Feb 17, 2026
Merged

fix: disable map repetition & use English-only labels#92
koala73 merged 3 commits intomainfrom
fix/map-no-repeat-no-labels

Conversation

@SebastienMelki
Copy link
Collaborator

@SebastienMelki SebastienMelki commented Feb 17, 2026

Summary

  • Switched from CARTO dark_all raster tiles to CARTO Dark Matter vector style — labels now render in English instead of local scripts (亚洲, AFRIKA, أفريقيا, AMÉRICA DO SUL)
  • Set renderWorldCopies: false to prevent the map from repeating horizontally
  • Changed deck.gl overlay to interleaved: true so basemap labels render above data layers

Closes #81

Test plan

  • Verify map no longer repeats when panning left/right
  • Verify continent, country, and city labels display in English
  • Verify data layers (hotspots, markers, clusters) still render correctly on top of the basemap
  • Verify tooltips and click interactions still work

🤖 Generated with Claude Code

@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldmonitor Ready Ready Preview, Comment Feb 17, 2026 2:45pm
worldmonitor-finance Ready Ready Preview, Comment Feb 17, 2026 2:45pm
worldmonitor-startup Ready Ready Preview, Comment Feb 17, 2026 2:45pm

Request Review

Switch from CARTO dark_all raster tiles (which showed continent names
in local languages like 亚洲, AFRIKA, أفريقيا) to CARTO Dark Matter
vector style with English labels. Set renderWorldCopies: false to
prevent horizontal map duplication. Use interleaved deck.gl overlay
so basemap labels render above data layers.

Closes #81

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@koala73
Copy link
Owner

koala73 commented Feb 17, 2026

@SebastienMelki

Theme switch breaks country hover/highlight overlays
File: DeckGLMap.ts (line 3790)
switchBasemap() now calls map.setStyle(...), which replaces map style layers/sources.
Country layers are only loaded once on initial map load (DeckGLMap.ts (line 346)) and then blocked by countryGeoJsonLoaded (DeckGLMap.ts (line 3681), DeckGLMap.ts (line 3682)).
After a theme toggle, country-interactive / country-hover-fill / highlight layers are gone and not re-added, so country hover/click/highlight behavior regresses.

Suggested fix

  • Rehydrate country source/layers after style reload (style.load/styledata), and reset or remove the one-time guard so loadCountryBoundaries() can run again after setStyle.
  • Apply updateCountryLayerPaint() only after those layers exist.

@koala73
Copy link
Owner

koala73 commented Feb 17, 2026 via email

setStyle() replaces all map sources/layers. Country boundaries were
only loaded once (guarded by countryGeoJsonLoaded) so they vanished
after theme toggle with no way to re-add them.

- Reset countryGeoJsonLoaded in switchBasemap so loadCountryBoundaries
  can re-run after the new style loads
- Listen for style.load before re-adding country source/layers
- Guard setupCountryHover with countryHoverSetup flag to prevent
  duplicate mousemove/mouseout listeners on re-load
- Apply theme-correct paint values after layer creation
Store the active highlighted ISO code so it can be re-applied after
setStyle() rebuilds map layers with empty default filters.
@koala73 koala73 merged commit 84d33bf into main Feb 17, 2026
4 checks passed
@SebastienMelki SebastienMelki added the claude Generated with Claude Code label Feb 19, 2026
@koala73 koala73 deleted the fix/map-no-repeat-no-labels branch February 19, 2026 20:57
facusturla pushed a commit to facusturla/worldmonitor that referenced this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: map Map, globe, DeckGL visualization claude Generated with Claude Code enhancement New feature or request UX/UI User interface and experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce the size of the chart to just one set of world map

2 participants