summaryrefslogtreecommitdiff
path: root/android-app
diff options
context:
space:
mode:
Diffstat (limited to 'android-app')
-rw-r--r--android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt14
-rwxr-xr-xandroid-app/local.properties12
2 files changed, 15 insertions, 11 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) {
diff --git a/android-app/local.properties b/android-app/local.properties
index 7c003fd..daae45e 100755
--- a/android-app/local.properties
+++ b/android-app/local.properties
@@ -1,11 +1 @@
-# This file must *NOT* be checked into Version Control Systems,
-# as it contains information specific to your local installation.
-#
-# Location of the Android SDK. This is only used by Gradle.
-# ANDROID_HOME environment variable must be set to your Android SDK path.
-# Example:
-# sdk.dir=/home/user/Android/Sdk
-# sdk.dir=/Users/user/Library/Android/sdk (macOS)
-# sdk.dir=C\:\\Users\\user\\AppData\\Local\\Android\\Sdk (Windows)
-#
-# sdk.dir=
+sdk.dir=/opt/android-sdk