Skip to content

Refactor Map Compose components for performance and stability#144

Merged
phpduy merged 1 commit intostagingfrom
refactor/compose-map-optimizations
Mar 2, 2026
Merged

Refactor Map Compose components for performance and stability#144
phpduy merged 1 commit intostagingfrom
refactor/compose-map-optimizations

Conversation

@phpduy
Copy link
Contributor

@phpduy phpduy commented Mar 2, 2026

  • Optimize content lambda recomposition using movableContentOf in both W3WGoogleMap and W3WMapBox.
  • Reorder W3WGoogleMap parameters to support trailing lambda for content and provide a default Modifier.
  • Remove unnecessary coroutine context switching in updateCameraBound to simplify bounds calculation.
  • Safely handle IllegalStateException in updateCameraBound when accessing latLngBounds before the map layout is fully ready.

- Optimize `content` lambda recomposition using `movableContentOf` in both `W3WGoogleMap` and `W3WMapBox`.
- Reorder `W3WGoogleMap` parameters to support trailing lambda for `content` and provide a default `Modifier`.
- Remove unnecessary coroutine context switching in `updateCameraBound` to simplify bounds calculation.
- Safely handle `IllegalStateException` in `updateCameraBound` when accessing `latLngBounds` before the map layout is fully ready.
Copy link

@nghianguyen-w3w nghianguyen-w3w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

@phpduy phpduy merged commit 4290c51 into staging Mar 2, 2026
@phpduy phpduy deleted the refactor/compose-map-optimizations branch March 2, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants