Pan and zoom the flat map; open with every layer off - #6
Merged
Conversation
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
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.
projectreports false outside the viewport, which keeps plate labels off thelegend and stops the canvas plotting epicentres that are nowhere near the
screen. The flat overlay is clipped to the viewport as well.
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