Skip to content

refactor: nearest-first earthquake list, drop the map and its libraries - #3

Open
renatgalimov wants to merge 5 commits into
masterfrom
initial-simple-simple
Open

refactor: nearest-first earthquake list, drop the map and its libraries#3
renatgalimov wants to merge 5 commits into
masterfrom
initial-simple-simple

Conversation

@renatgalimov

Copy link
Copy Markdown
Contributor

No description provided.

Same app, less of it. Own code goes from ~990 lines to ~450.

- merge maths.js and render.js into app.js; both files are gone
- the map label is now a Leaflet tooltip, so Leaflet places it. Drops the
  screen projection, the label-area measuring, the card position clamping
  and the leader-line geometry (~200 lines)
- only quakes currently on screen can be labelled, which is one call to
  map.getBounds().contains instead of the old on-screen test
- drop the Pacific-centred world view. It needed every longitude wrapped
  and the whole map drawn twice to fill past the date line. Map is now
  centred on 0, so wrapLongitude, shiftGeoJsonEast and drawWorldCopies go
- magnitude colours move from CSS variables into app.js, so pickMagnitudeColor
  no longer reads them back out of the stylesheet
- the screen scale factor is worked out once at startup instead of being
  re-read inside six draw functions
- add magnitudeOf/locationOf/timeOf so nothing else has to know that
  coordinates[1] means latitude
- the map now stops where the rail starts, so nothing drawn can hide under it

Kept as they were: config and readSetting, pickMagnitudeColor, the plate
boundaries, Leaflet and the offline world data.

No change to the settings, the feed, or what the player sees apart from the
world view no longer being Pacific-centred.
@renatgalimov
renatgalimov requested a review from a team as a code owner August 13, 2026 08:53
@Sir-Monke
Sir-Monke force-pushed the initial-simple-simple branch from db8de8b to 82c0bd2 Compare August 13, 2026 09:13
@renatgalimov
renatgalimov changed the base branch from initial-simple to master August 13, 2026 09:14
@Sir-Monke
Sir-Monke force-pushed the initial-simple-simple branch from 82c0bd2 to 3fc574c Compare August 13, 2026 09:35
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