Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/google/ground-android int…
Browse files Browse the repository at this point in the history
…o gino-m/2139/2
  • Loading branch information
gino-m committed Jan 11, 2024
2 parents 570db67 + 38e560a commit 75e1d3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ constructor(
Timber.d("Camera moved : ${newCameraPosition.target}")
lastCameraPosition = currentCameraPosition.value
currentCameraPosition.value = newCameraPosition
mapStateRepository.setCameraPosition(newCameraPosition)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@ import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.mapNotNull
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.launch
import timber.log.Timber

@OptIn(ExperimentalCoroutinesApi::class)
@SharedViewModel
class HomeScreenMapContainerViewModel
@Inject
internal constructor(
private val loiRepository: LocationOfInterestRepository,
private val mapStateRepository: MapStateRepository,
mapStateRepository: MapStateRepository,
private val submissionRepository: SubmissionRepository,
locationManager: LocationManager,
settingsManager: SettingsManager,
Expand Down Expand Up @@ -158,9 +157,7 @@ internal constructor(

override fun onMapCameraMoved(newCameraPosition: CameraPosition) {
super.onMapCameraMoved(newCameraPosition)
Timber.d("Setting position to $newCameraPosition")
onZoomChange(lastCameraPosition?.zoomLevel, newCameraPosition.zoomLevel)
mapStateRepository.setCameraPosition(newCameraPosition)
}

private fun onZoomChange(oldZoomLevel: Float?, newZoomLevel: Float?) {
Expand Down

0 comments on commit 75e1d3a

Please sign in to comment.