-
Notifications
You must be signed in to change notification settings - Fork 165
fix: updating DisappearingScaleBar #762
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73f1434 to
d87c1f3
Compare
Code Coverage
|
…tion
This commit enhances the `ScaleBar` composable with performance optimizations,
more robust tests, and comprehensive documentation.
- **Performance**: The `ScaleBar` now uses `remember` with the zoom level as a key,
and `derivedStateOf` to ensure the scale is only recalculated when the map's
zoom level changes, not on every pan. This significantly improves efficiency.
- **Tests**: The `ScaleBarTests` are now more reliable. They use a null-safe
`let` block to prevent potential crashes and calculate the expected scale
text based on the map's projection for more accurate verification.
- **Documentation**:
- Added additional KDocs and inline comments to `ScaleBar` and
`DisappearingScaleBar`, explaining complex calculations and advanced
Compose concepts.
dkhawk
approved these changes
Sep 16, 2025
googlemaps-bot
pushed a commit
that referenced
this pull request
Sep 17, 2025
# [6.11.0](v6.10.0...v6.11.0) (2025-09-17) ### Bug Fixes * tileOverlay in tileOverlayState on TileOverlayNode update ([#755](#755)) ([573e0e2](573e0e2)) * updating DisappearingScaleBar ([#762](#762)) ([ca8cf2d](ca8cf2d)) ### Features * exposing contentDescription on MarkerInfoWindow ([#764](#764)) ([7b55a93](7b55a93))
|
🎉 This PR is included in version 6.11.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 6.11.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
1 similar comment
|
🎉 This PR is included in version 6.11.0 🎉 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This Pull Request modifies the
ScaleBarcomposable to be self-contained and automatically update its text and drawing based on the map's zoom level. It achieves this by introducing a state variable for the horizontal line width and using aLaunchedEffectto listen for camera position changes and update that state.This change fixes the issue where the
DisappearingScaleBartext didn't update dynamically as the user zoomed in or out.FILE.2025-09-16.11.55.38.mp4
Fixes #759