@@ -15,7 +15,6 @@ import androidx.activity.compose.setContent
1515import androidx.compose.foundation.layout.Box
1616import androidx.compose.foundation.layout.fillMaxSize
1717import androidx.compose.foundation.layout.padding
18- import androidx.compose.material3.FloatingActionButton
1918import androidx.compose.material3.MaterialTheme
2019import androidx.compose.material3.Surface
2120import androidx.compose.material3.Text
@@ -67,6 +66,9 @@ fun MapViewScreen() {
6766 setZoom(14.0 )
6867 mapView = this
6968
69+ // Enable built-in zoom controls
70+ getUiSettings().isZoomControlsEnabled = true
71+
7072 // Set attribution click listener to open OSM copyright page
7173 setOnAttributionClickListener {
7274 val intent = Intent (Intent .ACTION_VIEW , Uri .parse(" https://www.openstreetmap.org/copyright" ))
@@ -91,37 +93,5 @@ fun MapViewScreen() {
9193 style = MaterialTheme .typography.titleMedium,
9294 )
9395 }
94-
95- // Zoom in button
96- FloatingActionButton (
97- onClick = {
98- mapView?.let {
99- val newZoom = (it.getZoom() + 1.0 ).coerceAtMost(19.0 )
100- it.setZoom(newZoom)
101- zoomLevel = newZoom
102- }
103- },
104- modifier = Modifier
105- .align(Alignment .BottomEnd )
106- .padding(end = 16 .dp, bottom = 88 .dp),
107- ) {
108- Text (" +" , style = MaterialTheme .typography.headlineMedium)
109- }
110-
111- // Zoom out button
112- FloatingActionButton (
113- onClick = {
114- mapView?.let {
115- val newZoom = (it.getZoom() - 1.0 ).coerceAtLeast(2.0 )
116- it.setZoom(newZoom)
117- zoomLevel = newZoom
118- }
119- },
120- modifier = Modifier
121- .align(Alignment .BottomEnd )
122- .padding(end = 16 .dp, bottom = 16 .dp),
123- ) {
124- Text (" -" , style = MaterialTheme .typography.headlineMedium)
125- }
12696 }
12797}
0 commit comments