Modern Apps git

← Modern-Apps.git

maps: remove SF fallback

Commit
048d96ddabdaba63a077a621d538e8fb7abc2d86
Author
vayun-mathur <[email protected]>
When
2026-10-22 04:13 UTC (1 month ago)
Parents
95cda2f

Diff

maps/src/main/java/com/vayunmathur/maps/data/MapPreferences.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/MapPreferences.kt b/maps/src/main/java/com/vayunmathur/maps/data/MapPreferences.ktindex 127f0a1494..f6ce484c86 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/MapPreferences.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/MapPreferences.kt@@ -24,7 +24,7 @@ object MapPreferences {     /**      * Last known user position (lon/lat doubles). Written on every accepted GPS      * fix and read back to seed the cold-start camera, so the map opens where-     * the user was rather than the SF fallback. Absent = no fix ever recorded.+     * the user was. Absent = no fix ever recorded.      */     const val KEY_LAST_LON = "last_lon"     const val KEY_LAST_LAT = "last_lat"
maps/src/main/java/com/vayunmathur/maps/ui/map/MapInitialCamera.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/map/MapInitialCamera.kt b/maps/src/main/java/com/vayunmathur/maps/ui/map/MapInitialCamera.ktindex 99ba9dfe0d..283b4bf402 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/map/MapInitialCamera.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/map/MapInitialCamera.kt@@ -21,9 +21,6 @@ import com.vayunmathur.library.util.DataStoreUtils import com.vayunmathur.maps.data.MapPreferences import com.vayunmathur.maps.util.SelectedFeatureViewModel -/** Cold-start fallback: San Francisco at z14, where the baked POIs are dense enough to see. */-private val FALLBACK_CAMERA = CameraPosition(target = GeoPoint(-122.4194, 37.7749), zoom = 14.0)- /** Zoom the cold-start camera adopts once the user's position is known. */ private const val FIRST_FIX_ZOOM = 14.0 @@ -31,10 +28,11 @@ private const val FIRST_FIX_ZOOM = 14.0  * Cold-start camera for the map screen.  *  * Seeded from the OS-cached device fix (synchronous `LocationManager`- * `getLastKnownLocation`), falling back to the persisted last fix and then the- * SF fallback. DataStore's snapshot read can be empty on a truly cold- * process (not yet hydrated), so the first live fix still centers below —- * either way the zoom stays at the browse default.+ * `getLastKnownLocation`), falling back to the persisted last fix. With neither,+ * the camera starts on the default world view until the first live fix centers+ * it below — never on an arbitrary city. DataStore's snapshot read can be empty+ * on a truly cold process (not yet hydrated), so the first live fix still+ * centers below — either way the zoom stays at the browse default.  *  * The centering runs once: it is skipped when a deep link or an existing  * selection owns the camera, and latched in that case too, so consuming the@@ -51,7 +49,7 @@ fun rememberInitialCamera(viewModel: SelectedFeatureViewModel): CameraState {             ?: persistedLastFix(dataStore)     }     val camera = rememberCameraState(-        seed?.let { CameraPosition(target = it, zoom = FIRST_FIX_ZOOM) } ?: FALLBACK_CAMERA,+        seed?.let { CameraPosition(target = it, zoom = FIRST_FIX_ZOOM) } ?: CameraPosition(),     )      val userPosition by viewModel.userPosition.collectAsState()
maps/src/main/java/com/vayunmathur/maps/util/FrameworkLocationManager.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/util/FrameworkLocationManager.kt b/maps/src/main/java/com/vayunmathur/maps/util/FrameworkLocationManager.ktindex 5ad137f88f..576475ecce 100644--- a/maps/src/main/java/com/vayunmathur/maps/util/FrameworkLocationManager.kt+++ b/maps/src/main/java/com/vayunmathur/maps/util/FrameworkLocationManager.kt@@ -128,7 +128,7 @@ class FrameworkLocationManager(context: Context) : SensorEventListener {          // Emit the OS last-known fix immediately so the UI opens on the user's         // current (or last known) location instead of waiting for the first-        // live fix. Any last-known beats the SF fallback, so no staleness+        // live fix. Any last-known beats no position at all, so no staleness         // filter here — recency filtering is for the live stream only.         lastKnownLocation()?.let { location ->             lastFix = Fix(