Skip to content

UI: extra zoom-out, right-click context menu, Minecraft colour codes in markers - #614

Open
dpembo wants to merge 7 commits into
jpenilla:masterfrom
dpembo:master
Open

dpembo wants to merge 7 commits into
jpenilla:masterfrom
dpembo:master

Conversation

@dpembo

@dpembo dpembo commented Oct 14, 2026

Copy link
Copy Markdown

Summary

Three small, independent frontend/config improvements that are useful on large survival maps and with Towny-style markers, added to the very latest version of squaremaps

1. Extra zoom-out (map.zoom.extra-out)

Native zoom 0 is often not far enough out for a whole world. This adds an optional number of extra zoom-out levels (default 0 = no change).

Config (per world):

map:
  zoom:
    maximum: 3
    default: 3
    extra: 2
    extra-out: 2   # optional; 0 keeps current behaviour

2. Right-click context menu

  • Zoom in / out at the cursor
  • Copy X Z or X 150 Z to the clipboard (spaces, paste-friendly for /tp)

3. Minecraft colour codes in marker popups/tooltips

Parses & colour/format codes in popup and tooltip HTML (common for Towny town/nation names). White is forced to black for contrast on the default popup background.

Notes

  • No API or marker JSON schema changes.
  • Context menu uses the Clipboard API (HTTPS or localhost).
  • Frontend build still uses Bun as documented.

Test plan

  • Fresh config: map behaves as today with extra-out unset / 0
  • Set extra-out: 2, confirm zoom out past native 0 and tiles still load
  • Right-click: zoom in/out around cursor; copy coords and paste into chat/command
  • Marker with &cRed &fWhite in tooltip/popup shows styled text; white readable on popup

pembo and others added 7 commits October 14, 2026 08:42
This allows earth servers in particular to view the whole map on a webpage.
Without this large maps cannot be seen in their entirety

Changes:
Allow the map to zoom out past native zoom 0 so large worlds fit on
screen. Default remains 0 (current behaviour).

- WorldConfig: map.zoom.extra-out (int, default 0)
- Publish zoom.extra_out in world settings JSON
- Frontend: setMinZoom / tile layer minZoom from extra_out

2) Add right-click context menu (zoom and copy coordinates)

Right-click on the map opens a small menu:

- Zoom in / zoom out around the cursor
- Copy coordinates as "X Z" (clipboard)
- Copy coordinates as "X 150 Z" for easy /tp paste

Coordinates use spaces (no commas) so they paste cleanly into
Minecraft commands. Menu closes on pan, zoom, click, Escape, or
outside click. Many players use the map to get TP Coords

3) Render Minecraft & colour/format codes in marker popups and tooltips
Towny and similar plugins often put &-codes in town/nation names.
Convert those codes to inline-styled HTML when building marker
popup/tooltip content.

White (&f) is rendered as black so text stays readable on the light
popup background. Codes absent from a string are a no-op.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant