Modern Apps git

← Modern-Apps.git

maps: hide vehicle sprites until dedicated atlas art lands

Commit
cabdc462af220674a266d2ed70d37f7430915753
Author
vayun-mathur <[email protected]>
When
2026-09-14 05:28 UTC (2 months ago)
Parents
31743f3

Diff

maps/src/main/java/com/vayunmathur/maps/ui/LayersSheet.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/LayersSheet.kt b/maps/src/main/java/com/vayunmathur/maps/ui/LayersSheet.ktindex f926b8e670..4cf024d9a2 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/LayersSheet.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/LayersSheet.kt@@ -71,9 +71,11 @@ fun LayersSheet(                 )             } -            // Transit — offline rail lines + moving vehicles from the on-device-            // pack, and a departure board for the stop nearest a tap. Stop pins-            // themselves are a tracked renderer gap ([TransitStopsLayer]).+            // Transit — offline rail lines from the on-device pack, and a+            // departure board for the stop nearest a tap. Stop pins+            // themselves are a tracked renderer gap ([TransitStopsLayer]);+            // vehicle sprites stay off until the atlas carries dedicated+            // vehicle art (VEHICLE_SPRITES_ENABLED).             SettingsSwitchRow(                 title = stringResource(R.string.layer_transit),                 supportingText = stringResource(R.string.layer_transit_desc),
maps/src/main/java/com/vayunmathur/maps/ui/map/TransitVehicles.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/map/TransitVehicles.kt b/maps/src/main/java/com/vayunmathur/maps/ui/map/TransitVehicles.ktindex c106219435..0933c34a3a 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/map/TransitVehicles.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/map/TransitVehicles.kt@@ -39,6 +39,19 @@ private const val VEHICLE_TICK_MS = 1_000L  */ private const val VEHICLE_MIN_ZOOM = 11.0 +/**+ * Whether the simulated vehicle sprites draw at all. Currently false: the+ * sprite atlas has no dedicated vehicle pictograms, so the vehicle ids borrow+ * the ambient POI icons (`VEHICLE_BUS` draws the bus-stop pin,+ * `VEHICLE_TRAM/TRAIN` the train-station pin) at 28 Dp against 19 Dp POIs+ * with no labels. Vehicles dwell exactly on stops, so several trips at one+ * station read as duplicated, misaligned, textless station POIs - which is+ * what the transit toggle showed. Rail lines, departure boards and routing+ * are unaffected (separate paths); flip this back on when dedicated vehicle+ * sprites land in the atlas (see `marker::icon_sprite_name`).+ */+private const val VEHICLE_SPRITES_ENABLED = false+ /**  * How far the bbox centre may drift (degrees) before a recompute is forced.  * A degree of latitude is ~111 km, so this is ~50 m: a static camera reuses@@ -93,7 +106,9 @@ fun rememberTransitVehicles(     }      LaunchedEffect(transitEnabled, started) {-        if (!transitEnabled || !started) {+        // See VEHICLE_SPRITES_ENABLED: the overlay draws no vehicle sprites+        // until the atlas carries dedicated vehicle art. Clears any shown.+        if (!transitEnabled || !started || !VEHICLE_SPRITES_ENABLED) {             vehicles = emptyList()             return@LaunchedEffect         }
maps/src/main/res/values/strings.xml
diff --git a/maps/src/main/res/values/strings.xml b/maps/src/main/res/values/strings.xmlindex 75c60fde2e..b347eb83aa 100644--- a/maps/src/main/res/values/strings.xml+++ b/maps/src/main/res/values/strings.xml@@ -327,8 +327,8 @@     <string name="layer_safety_unavailable">Coming soon</string>     <!-- LayersSheet: public-transit layer toggle. Noun. -->     <string name="layer_transit">Transit</string>-    <!-- LayersSheet: transit layer description. Rail lines the basemap renderer draws plus the simulated vehicle sprites and the departure board for the stop nearest a tap; stop pins are a tracked renderer gap (TransitStopsLayer is a no-op). -->-    <string name="layer_transit_desc">Show rail lines, live vehicles and departures</string>+    <!-- LayersSheet: transit layer description. Rail lines the basemap renderer draws plus the departure board for the stop nearest a tap; stop pins are a tracked renderer gap (TransitStopsLayer is a no-op) and vehicle sprites are off until the atlas carries dedicated vehicle art. -->+    <string name="layer_transit_desc">Show rail lines and departures</string>      <!-- Departure board: section subtitle under the stop name. Noun. -->     <string name="transit_departures_title">Departures</string>