Skip to content

Refactor/home page - #524

Merged
whes1015 merged 6 commits into
mainfrom
refactor/home-page
Aug 12, 2026
Merged

Refactor/home page#524
whes1015 merged 6 commits into
mainfrom
refactor/home-page

Conversation

@whes1015

Copy link
Copy Markdown
Member

No description provided.

Show the nearest-station name and observation time (Taipei wall clock) as
small print under the home header name, and open the map on the temperature
layer at that same station from a link shown when the sheet is expanded.
Realtime readings are gated to the selected township so a stale previous-area
observation never masquerades as the new one while its fetch runs; the debug
GPS read rides alongside the data fetches so a fix inside its 10s timeout
window can no longer hold up the sheet.
The realtime endpoint trims the trailing 0 from a station code (C0X16, not
C0X160), so opening that station's map sheet failed — the directory and the
trend endpoint both key by the 6-char form. Normalise the id on decode so
every consumer addresses the same key space.
Basemap vector tiles now come from static.lb.exptech.dev (still served through
the same three-tier tile cache), and the terrain tiles join the base map as a
raster-dem source with a translucent hillshade layer between the land fills
and the borders.

The terrain PNGs are Mapbox.com terrain-RGB (height = num/10 - 10000), an
encoding MapLibre Native can't read — both its terrarium and mapbox decoders
would turn Taiwan into a -32 km pit. A small codec rewrites each tile to
terrarium before MapLibre ever sees it: the Dio interceptor and MapTileCache
convert on write, and MapTileCache fetches cache-missing terrain itself (a
native download would keep the unconverted bytes).

Also pins image (pure Dart PNG codec) as a direct dependency.
The terrain tiles are Mapbox.com terrain-RGB — height = (R·65536 + G·256 +
B)/10 − 10000 — which is exactly what MapLibre's `encoding: 'mapbox'` decodes,
so the whole app-side rewrite to terrarium was wrong (see satellite-tiles-go/web).

The raster-dem source now declares encoding mapbox, tileSize 512, zoom 0–12, and
bounds [110, 10, 132, 35] — deliberately overshooting the DEM bbox so the
hillshade edge never meets the plain background on screen. Hillshade follows the
reference tuning (illumination 335°, exaggeration 0.3).

Deleted terrain_tile_codec.dart and the conversion paths in EtagInterceptor and
MapTileCache; MapTileCache no longer needs a fetcher. image is back to
transitive.
Adds a shared MapTerrainRow (relief checkbox) that slots into every overlay
menu alongside the township-label row. MapTownLabelsMenu becomes MapBasemapMenu
holding both toggles, and the chip turns active when either is on.

MapScaffold owns the ValueNotifier and calls setLayerVisibility on the stable
terrain-hillshade id — re-applied after style reloads so the preference
survives them. MapLayer.buildTopTrailingChrome threads the toggle through each
layer so the state lives in exactly one place.
@whes1015
whes1015 merged commit b874670 into main Aug 12, 2026
5 of 6 checks passed
@whes1015
whes1015 deleted the refactor/home-page branch August 12, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant