Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisappearingScaleBar do not disappear after specified visibilityDurationMillis #166

Closed
Priyankkjain opened this issue Jul 1, 2022 · 2 comments · Fixed by #168
Closed
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. released type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@Priyankkjain
Copy link
Contributor

The new DisappearingScaleBar does not disappear after the specified visibilityDurationMillis. Unless I have interpreted it wrong, I think what DisappearingScaleBar does is that it automatically disappears after specified visibilityDurationMillis on every zoom click.

But currently, after the initial disappearance that is not happening.

Steps to reproduce

  1. Add DisappearingScaleBar to map
  2. Wait for it to disappear for the first time
  3. Just press zoom in one time
  4. After the zoom in the scalebar does not automatically disappear.

I have also attached a video for the issue. It only contains the DisappearingScaleBar on top of the map.

DisappearingScaleBar.issue.mp4

.

Code example

GoogleMap(
  modifier = Modifier.matchParentSize(),
  cameraPositionState = cameraPositionState,
  onMapLoaded = {
    isMapLoaded = true
  }
)
DisappearingScaleBar(
  modifier = Modifier
  .padding(top = 5.dp, end = 15.dp)
  .align(Alignment.TopStart),
  cameraPositionState = cameraPositionState,
  visibilityDurationMillis = 5_000
)

I think the issue lies in the LaunchedEffect of DisappearingScaleBar. Because of the condition, it is not able to hide the scale bar after the time-out period.

@Priyankkjain Priyankkjain added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jul 1, 2022
@barbeau
Copy link
Contributor

barbeau commented Jul 1, 2022

@Priyankkjain Thanks for the repro steps with the zoom button! That's very useful. And thanks for the PR #168 as well. Using pinch-to-zoom it's much harder to repro but it does seem to occasionally happen. I'll look at this further and see if your PR seems a reasonable way to fix this.

@barbeau barbeau added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed triage me I really want to be triaged. labels Jul 1, 2022
@googlemaps-bot
Copy link
Contributor

🎉 This issue has been resolved in version 2.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. released type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
3 participants