fix(location): instant viewport centering except on real location button click

This commit is contained in:
LZX committed 2026-10-20 20:51:19 +08:00
1 parent 6ffa7d8108
commit 32fa4a611a
1 file changed
+4 -4
@@ -381,7 +381,7 @@ fun LocationScreen(
String.format(Locale.getDefault(), "%.5f, %.5f", AppPreferences.mockLatitude, AppPreferences.mockLongitude) String.format(Locale.getDefault(), "%.5f, %.5f", AppPreferences.mockLatitude, AppPreferences.mockLongitude)
} }
currentMarker?.title = locationName currentMarker?.title = locationName
mapViewRef?.controller?.animateTo(p) mapViewRef?.controller?.setCenter(p)
mapViewRef?.invalidate() mapViewRef?.invalidate()
} }
} else if (isVisible) { } else if (isVisible) {
@@ -393,7 +393,7 @@ fun LocationScreen(
val p = GeoPoint(gcj[0], gcj[1]) val p = GeoPoint(gcj[0], gcj[1])
currentGeoPoint = p currentGeoPoint = p
currentMarker?.position = p currentMarker?.position = p
mapViewRef?.controller?.animateTo(p) mapViewRef?.controller?.setCenter(p)
mapViewRef?.invalidate() mapViewRef?.invalidate()
coroutineScope.launch { coroutineScope.launch {
val resolved = LocationResolver.resolveLocationName(context, realWgsLat, realWgsLng) val resolved = LocationResolver.resolveLocationName(context, realWgsLat, realWgsLng)
@@ -502,7 +502,7 @@ fun LocationScreen(
currentGeoPoint = mapPoint currentGeoPoint = mapPoint
currentMarker?.position = mapPoint currentMarker?.position = mapPoint
mapViewRef?.controller?.animateTo(mapPoint) mapViewRef?.controller?.setCenter(mapPoint)
mapViewRef?.invalidate() mapViewRef?.invalidate()
locationName = result.name locationName = result.name
@@ -1304,7 +1304,7 @@ fun LocationScreen(
pointOnMap = targetPoint, pointOnMap = targetPoint,
isUserManual = true, isUserManual = true,
centerMap = true, centerMap = true,
animate = true animate = false
) )
locationName = favorite.name locationName = favorite.name
showFavoritesScreen = false showFavoritesScreen = false