Repository navigation
Phone app: Google map tiles when a key is available - #13
Merged
Merged
Conversation
The phone map now draws Google's tiles (Map Tiles API) when the APK is built with NEXT_PUBLIC_GOOGLE_MAPS_API_KEY in .env.local, the desktop app's browser key. Without it, or when Google can't be reached, it falls back to OpenFreeMap, and offline to the plain background with pins and routes. The Map Tiles session is reused for its lifetime, dark mode gets a dark Google look, and the map shows Google's logo with the copyright for the area in view. Only that one variable is exposed to the build; the source never contains a key. README and .env.example say the key ends up inside such an APK, so it should not be shared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Torgh
added a commit
that referenced
this pull request
Oct 18, 2026
* Show the day's map and route in the phone app A map band sits above the day's plan and stays put while the list scrolls, so dragging the map never fights the page. It can be hidden (remembered) or opened full screen; Android back closes full screen first. Tapping a pin scrolls to its card; tapping a card brings its pin into view. In full screen a tapped pin shows what it is (a tour stop names itself and its tour) with a way back to the plan. Pins, route lines and tour stops come from lib/mapLayers.ts, now shared with the desktop map, so both draw the same thing. Route shapes are read from the trip file; without network the map falls back to a plain background, keeping pins and routes readable offline. MapLibre loads only once a trip is opened. The morning's hotel pin is left out when a card sits at the same spot (a tour picking you up at the hotel), where it hid that card's numbered pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Use Google's map tiles in the phone app when a key is available (#13) The phone map now draws Google's tiles (Map Tiles API) when the APK is built with NEXT_PUBLIC_GOOGLE_MAPS_API_KEY in .env.local, the desktop app's browser key. Without it, or when Google can't be reached, it falls back to OpenFreeMap, and offline to the plain background with pins and routes. The Map Tiles session is reused for its lifetime, dark mode gets a dark Google look, and the map shows Google's logo with the copyright for the area in view. Only that one variable is exposed to the build; the source never contains a key. README and .env.example say the key ends up inside such an APK, so it should not be shared. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Builds on #12 (the phone app's day map); merge that first. This PR only changes the map underneath the pins.
NEXT_PUBLIC_GOOGLE_MAPS_API_KEYin.env.local(the desktop app's browser key, with the Map Tiles API enabled), the phone map draws Google's tiles through the official Map Tiles API. MapLibre stays, so pins, routes, tour stops, full screen and the pin ↔ card link are unchanged.Keeping the key out of the repo
mobile/vite.config.mtsexposes only that one variable from.env.local(gitignored) to the build..env.examplewarn that the key ends up inside such an APK, so it shouldn't be shared or published.Note for offline maps (next step)
Google's terms don't allow storing tiles for later, so downloading maps for offline use will keep using OpenFreeMap.
Test plan
bun run typecheck,eslint,bun run test:coverage(194 tests),bun run build:mobile🤖 Generated with Claude Code