Skip to content

Pan and zoom the flat map; open with every layer off - #6

Merged
veillette merged 1 commit into
mainfrom
claude/flat-map-navigation-zoom-1lmcnf
Aug 5, 2026
Merged

Pan and zoom the flat map; open with every layer off#6
veillette merged 1 commit into
mainfrom
claude/flat-map-navigation-zoom-1lmcnf

Conversation

@veillette

Copy link
Copy Markdown
Contributor

The flat map now has a camera of the same shape as the globe's — the longitude
and latitude at the centre of the viewport, plus a zoom level the map is drawn
at 2^level, capped at 8x. Drag moves the map under the pointer, the arrow keys
move the viewpoint, and a zoom button group sits in the corner of the viewport.
Reset All returns both cameras.

Left/right always does something and up/down does nothing until the user zooms
in, but no interaction code says so: the camera latitude is clamped to
90 - 90/scale, which is zero while the whole world is on screen. That is the
projection being periodic in longitude and bounded in latitude.

Three things follow from ±180° no longer being the edge of the viewport:

  • A feature is unwrapped against the camera at its first vertex, and repeated a
    world-width either side when that copy of the world would show it. The turns
    the walk accumulates are counted separately, so a plate far from the camera
    is not mistaken for one that goes round a pole.
  • project reports false outside the viewport, which keeps plate labels off the
    legend and stops the canvas plotting epicentres that are nowhere near the
    screen. The flat overlay is clipped to the viewport as well.
  • The seams the datasets were cut along are skipped when stroking, by the rule
    the globe has always used — it moves to EarthCanvasNode now that both views
    need it. Without it the Pacific gets a bright line up the middle of it.

Every layer checkbox now starts off, so the sim opens on a bare
ocean-and-coastline map and building it up is the student's to do.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01VzJsEZ3iUbwW7cAn7xWUXY

The flat map now has a camera of the same shape as the globe's — the longitude
and latitude at the centre of the viewport, plus a zoom level the map is drawn
at 2^level, capped at 8x. Drag moves the map under the pointer, the arrow keys
move the viewpoint, and a zoom button group sits in the corner of the viewport.
Reset All returns both cameras.

Left/right always does something and up/down does nothing until the user zooms
in, but no interaction code says so: the camera latitude is clamped to
90 - 90/scale, which is zero while the whole world is on screen. That is the
projection being periodic in longitude and bounded in latitude.

Three things follow from ±180° no longer being the edge of the viewport:

- A feature is unwrapped against the camera at its first vertex, and repeated a
  world-width either side when that copy of the world would show it. The turns
  the walk accumulates are counted separately, so a plate far from the camera
  is not mistaken for one that goes round a pole.
- `project` reports false outside the viewport, which keeps plate labels off the
  legend and stops the canvas plotting epicentres that are nowhere near the
  screen. The flat overlay is clipped to the viewport as well.
- The seams the datasets were cut along are skipped when stroking, by the rule
  the globe has always used — it moves to EarthCanvasNode now that both views
  need it. Without it the Pacific gets a bright line up the middle of it.

Every layer checkbox now starts off, so the sim opens on a bare
ocean-and-coastline map and building it up is the student's to do.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VzJsEZ3iUbwW7cAn7xWUXY
@cursor

cursor Bot commented Aug 5, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@veillette
veillette merged commit 8655a82 into main Aug 5, 2026
6 of 7 checks passed
@veillette
veillette deleted the claude/flat-map-navigation-zoom-1lmcnf branch August 6, 2026 20:26
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.

2 participants