Skip to content

Commit b4efe26

Browse files
committed
chore(map): factor out remaining hardcoded float values
1 parent 69957da commit b4efe26

File tree

1 file changed

+4
-2
lines changed
  • app/src/main/java/com/android/unio/ui/map

1 file changed

+4
-2
lines changed

app/src/main/java/com/android/unio/ui/map/Map.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import java.util.concurrent.TimeUnit
5959
val EPFL_COORDINATES = LatLng(46.518831258, 6.559331096)
6060
const val APPROXIMATE_CIRCLE_RADIUS = 30.0
6161
const val APPROXIMATE_CIRCLE_OUTLINE_WIDTH = 2f
62+
const val INITIAL_ZOOM_LEVEL = 15f
6263

6364
@OptIn(ExperimentalMaterial3Api::class)
6465
@Composable
@@ -121,13 +122,14 @@ fun MapScreen(
121122
}
122123
}
123124
cameraPositionState.position =
124-
CameraPosition.fromLatLngZoom(userLocation ?: EPFL_COORDINATES, 10f)
125+
CameraPosition.fromLatLngZoom(userLocation ?: EPFL_COORDINATES, INITIAL_ZOOM_LEVEL)
125126
}
126127

127128
// Center map on the user's location initially if available
128129
LaunchedEffect(userLocation) {
129130
if (userLocation != null && !initialCentered) {
130-
cameraPositionState.position = CameraPosition.fromLatLngZoom(userLocation!!, 15f)
131+
cameraPositionState.position =
132+
CameraPosition.fromLatLngZoom(userLocation!!, INITIAL_ZOOM_LEVEL)
131133
initialCentered = true
132134
}
133135
}

0 commit comments

Comments
 (0)