Skip to content

Fit the samples to a phone screen - #66

Merged
wf9a5m75 merged 1 commit into
developfrom
feat/mobile-examples
Nov 13, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
feat/mobile-examples

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

Summary

On a phone (Pixel 5a), the samples showed the map in a short stage under the page title and two paragraphs. An open control panel covered most of the map, and there was no way to see the map alone. These changes are shared, so they apply to every sample page.

Layout under 760 px

  • One line of title.
    • The description stays in the page, for search engines, but takes no room.
  • The map stage now ends at the bottom of the screen. The map, the folded panel and the map's own controls are all in view without scrolling.

ControlPanel

  • The title is a button that folds the panel.
  • Until it is pressed, the screen width decides, in CSS: open on a desktop, folded to its title on a phone. Because CSS decides, the server-rendered page and the first paint match.
  • Opened on a phone, the panel takes at most 55% of the stage, scrolls, and sits above the attribution line.
  • Folding only hides the body, so the controls keep their state.
  • All 34 pages with a panel use ControlPanel, so nothing changes per page.

Full screen button (SamplePageLayout)

  • The button is at the top right of the stage. That corner is free on every provider; ArcGIS, Leaflet and OpenLayers put their zoom buttons top left.
  • It uses the Fullscreen API. Where there is none (iPhone Safari has none for a div), the stage is fixed over the page instead.
  • Escape and the system back gesture leave full screen.
  • It sends a resize event, for maps that only resize on that.
  • Camera Sync keeps its own full screen button for both of its maps, so the new one is not shown there.

Camera Sync on a phone

Each of its two maps now carries only the provider selector and a compact line of numbers, so most of each map is visible.

Checks

  • All 40 sample pages, MapLibre, Pixel 5 viewport (Playwright). Checked folded and opened. Every panel fits, folded at the bottom left or opened in the lower half.
  • Full screen. The stage and the MapLibre canvas grow to 393×727; leaving restores 377×622.
  • Desktop at 1400×900. Unchanged, apart from the fold chevron on the panel title and the full screen button.
  • Pixel 5a (Brave), on a production build. Antenna Horizons, Style Adjustments, Tilt and Boston Buildings, folded and opened, plus full screen.
  • Type check. tsc --noEmit -p examples/basic reports the same 11 existing errors as develop (in ThreeMapObject, vite.config.ts and js-sdk-core), and no new ones.

On a phone the map stage sat under the page title and two paragraphs, and an open control panel covered most of it; there was no way to see the map alone.

- Under 760 px: one line of title (the description stays in the page but takes no room), and a stage that ends at the bottom of the screen.
- ControlPanel's title folds the panel. Until it is pressed the width decides in CSS: open on a desktop, folded to its title on a phone; opened there it takes at most 55% of the stage and scrolls. Folding only hides the body, so the controls keep their state.
- A full screen button on the stage: the Fullscreen API, or the stage fixed over the page where there is none (iPhone Safari). Escape leaves. Camera Sync keeps its own.
- Camera Sync keeps only the selector and the numbers over each of its two maps on a phone.
@wf9a5m75
wf9a5m75 merged commit b70b9cf into develop Nov 13, 2026
3 checks passed
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.

1 participant