Refactor/home page - #524
Merged
Merged
Conversation
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.
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.
No description provided.