From 86eeb4c3a05988e983b2d216b1e081f97f49bd5b Mon Sep 17 00:00:00 2001 From: Ian Wagner Date: Tue, 26 Nov 2024 13:20:02 +0900 Subject: [PATCH] Copy logic to the non-dynamic views --- .../ferrostar/maplibreui/views/LandscapeNavigationView.kt | 3 +++ .../ferrostar/maplibreui/views/PortraitNavigationView.kt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/android/maplibreui/src/main/java/com/stadiamaps/ferrostar/maplibreui/views/LandscapeNavigationView.kt b/android/maplibreui/src/main/java/com/stadiamaps/ferrostar/maplibreui/views/LandscapeNavigationView.kt index 9f0c18b3..0cbbce6c 100644 --- a/android/maplibreui/src/main/java/com/stadiamaps/ferrostar/maplibreui/views/LandscapeNavigationView.kt +++ b/android/maplibreui/src/main/java/com/stadiamaps/ferrostar/maplibreui/views/LandscapeNavigationView.kt @@ -17,6 +17,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.maplibre.compose.camera.MapViewCamera +import com.maplibre.compose.camera.extensions.incrementZoom import com.maplibre.compose.ramani.LocationRequestProperties import com.maplibre.compose.ramani.MapLibreComposable import com.maplibre.compose.rememberSaveableMapViewCamera @@ -108,6 +109,8 @@ fun LandscapeNavigationView( ), theme = theme, config = config, + onClickZoomIn = { camera.value = camera.value.incrementZoom(1.0) }, + onClickZoomOut = { camera.value = camera.value.incrementZoom(-1.0) }, views = views, mapViewInsets = mapViewInsets, onTapExit = onTapExit) diff --git a/android/maplibreui/src/main/java/com/stadiamaps/ferrostar/maplibreui/views/PortraitNavigationView.kt b/android/maplibreui/src/main/java/com/stadiamaps/ferrostar/maplibreui/views/PortraitNavigationView.kt index 39dbac4e..034fffdc 100644 --- a/android/maplibreui/src/main/java/com/stadiamaps/ferrostar/maplibreui/views/PortraitNavigationView.kt +++ b/android/maplibreui/src/main/java/com/stadiamaps/ferrostar/maplibreui/views/PortraitNavigationView.kt @@ -20,6 +20,7 @@ import androidx.compose.ui.tooling.preview.Devices import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.maplibre.compose.camera.MapViewCamera +import com.maplibre.compose.camera.extensions.incrementZoom import com.maplibre.compose.ramani.LocationRequestProperties import com.maplibre.compose.ramani.MapLibreComposable import com.maplibre.compose.rememberSaveableMapViewCamera @@ -119,6 +120,8 @@ fun PortraitNavigationView( ), theme = theme, config = config, + onClickZoomIn = { camera.value = camera.value.incrementZoom(1.0) }, + onClickZoomOut = { camera.value = camera.value.incrementZoom(-1.0) }, views = views, mapViewInsets = mapViewInsets, onTapExit = onTapExit)