summaryrefslogtreecommitdiff
path: root/android-app/app/src/main
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-22 23:48:32 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-22 23:48:32 +0000
commitf024a6a1cbcb68395fe1a15d4ac852c2be2416e6 (patch)
tree149db55dbc69b04a5aa02edf88dbe8a5d83f1841 /android-app/app/src/main
parent455206121f2061d5bc81b629da7978e1975845d9 (diff)
chore: unify and centralize agent configuration in .agent/
Diffstat (limited to 'android-app/app/src/main')
-rw-r--r--android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt14
1 files changed, 14 insertions, 0 deletions
diff --git a/android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt b/android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt
index 2e67975..91569cf 100644
--- a/android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt
+++ b/android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt
@@ -1,6 +1,9 @@
package org.terst.nav.ui
import android.graphics.Bitmap
+import org.maplibre.android.camera.CameraPosition
+import org.maplibre.android.camera.CameraUpdateFactory
+import org.maplibre.android.geometry.LatLng
import org.maplibre.android.maps.MapLibreMap
import org.maplibre.android.maps.Style
import org.maplibre.android.style.layers.CircleLayer
@@ -82,6 +85,17 @@ class MapHandler(private val maplibreMap: MapLibreMap) {
}
/**
+ * Centers the map on the specified location.
+ */
+ fun centerOnLocation(lat: Double, lon: Double, zoom: Double = 14.0) {
+ val position = CameraPosition.Builder()
+ .target(LatLng(lat, lon))
+ .zoom(zoom)
+ .build()
+ maplibreMap.animateCamera(CameraUpdateFactory.newCameraPosition(position), 1000)
+ }
+
+ /**
* Updates the anchor watch visualization on the map.
*/
fun updateAnchorWatch(state: AnchorWatchState) {