Skip to content

Commit

Permalink
fix: DisappearingScaleBar do not disappear after specified visibility…
Browse files Browse the repository at this point in the history
…DurationMillis (#168)
  • Loading branch information
Priyankkjain committed Jul 11, 2022
1 parent 5dac3d9 commit 8d0b855
Showing 1 changed file with 5 additions and 8 deletions.
Expand Up @@ -213,14 +213,11 @@ public fun DisappearingScaleBar(
}

LaunchedEffect(key1 = cameraPositionState.position.zoom) {
if (visible.isIdle && !visible.currentState) {
// Show ScaleBar
visible.targetState = true
} else if (visible.isIdle && visible.currentState) {
// Hide ScaleBar after timeout period
delay(visibilityDurationMillis.toLong())
visible.targetState = false
}
// Show ScaleBar
visible.targetState = true
delay(visibilityDurationMillis.toLong())
// Hide ScaleBar after timeout period
visible.targetState = false
}

AnimatedVisibility(
Expand Down

0 comments on commit 8d0b855

Please sign in to comment.