Skip to content

refactor: Replace line page's map implementation with MaplibreX - #3627

Merged
joshlarson merged 27 commits into
mainfrom
jdl/refactor/use-maplibrex
Nov 13, 2026
Merged

joshlarson merged 27 commits into
mainfrom
jdl/refactor/use-maplibrex

Conversation

@joshlarson

@joshlarson joshlarson commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Scope

Asana Ticket: 💈🗺️🛠️ Investigate replacing custom map component implementation with MapLibreX

Implementation

Note

🤖 I used Copilot to generate almost all of this PR, with a decent amount of back and forth. I have looked over and vetted all of the code.

You may find it easier to review this PR commit-by-commit, since each commit accomplishes an isolated bit of functionality and/or fixes a bug. Almost but not quite all of the commits were AI-generated - the first two were just me fiddling with dependencies - the ones with robot in the prefix were Copilot.

I reviewed each diff before committing it.

Screenshots

Things look pretty much the same. Here's a screenshot demonstrating that fact.
Screenshot 2026-11-02 at 11 20 47 AM

How to test

Visit a new line diagram page (1, 39, 66, Red Line) and observe the following subtle changes:

  • When you click to open a vehicle popup, it stays open, even when vehicles move
  • The line shape and stop and vehicle markers no longer flicker.

Everything else should be the same!

Note

One feature that is intentionally preserved is that the map zoom/center resets when you change the variant. That's an intentional design decision, since the route shape can vary pretty dramatically between variants, and we don't want the shape to just disappear if you change the variant (if the newly-selected one is off-screen).

joshlarson and others added 22 commits October 19, 2026 14:03
Map the maplibrex import to a minimal local declaration so tsc doesn't compile the dependency's TypeScript sources.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve imports from maplibrex's sources against assets/node_modules, add the deck.gl type packages it needs, and drop the hand-written maplibrex shim.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@joshlarson
joshlarson marked this pull request as ready for review November 4, 2026 19:30
@joshlarson
joshlarson requested a review from a team as a code owner November 4, 2026 19:30
@joshlarson
joshlarson requested a review from lvachon1 November 4, 2026 19:30
Comment thread assets/package.json Resolved
@joshlarson joshlarson added the dev-green Deploy to dev-green label Nov 9, 2026
joshlarson and others added 2 commits November 9, 2026 15:03
Replace the mutating updatePopup method with a syncPopup helper that returns a new entry, so the no-param-reassign disable is no longer needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
joshlarson and others added 2 commits November 12, 2026 16:15
MaplibreX compares the map style by reference, so a style object made every patch call map.setStyle and wipe the route shape layers. Wrap the map hook to skip setStyle when the style is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@lvachon1 lvachon1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@lvachon1 lvachon1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@joshlarson joshlarson removed the dev-green Deploy to dev-green label Nov 13, 2026
@joshlarson
joshlarson enabled auto-merge (squash) November 13, 2026 21:04
@joshlarson
joshlarson merged commit 51212d7 into main Nov 13, 2026
31 checks passed
@joshlarson
joshlarson deleted the jdl/refactor/use-maplibrex branch November 13, 2026 21:05

This branch was previously deployed

1 inactive deployment
dev-green — ed000b42 Deployed Nov 12, 2026 by joshlarson via pr / Deploy to dev-green #6356
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