Conversation
|
This change is part of the following stack: Change managed by git-spice. |
There was a problem hiding this comment.
Pull request overview
Adds first-class “visible map bounds” support to the shared CameraPosition model and wires bounds capture/application across Android, iOS (Google Maps + MapKit), and the JVM/web Google Maps wrapper.
Changes:
- Introduces
MapBoundsand adds optionalboundstoCameraPosition(serializable for the web bridge). - Updates Android/iOS camera conversion paths to include visible bounds in
onCameraMoveand to apply bounds when setting the camera. - Extends the web (JVM) JS bridge payload to report bounds, and updates sample defaults to include bounds.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
kmp-maps/core/src/commonMain/kotlin/com/swmansion/kmpmaps/core/MapTypes.kt |
Adds MapBounds + CameraPosition.bounds. |
kmp-maps/core/src/androidMain/kotlin/com/swmansion/kmpmaps/core/Map.kt |
Computes viewport size and uses bounds-aware camera updates + includes bounds in onCameraMove. |
kmp-maps/core/src/androidMain/kotlin/com/swmansion/kmpmaps/core/Extensions.kt |
Adds bounds ↔ native conversions and bounds-aware camera updates. |
kmp-maps/core/src/androidMain/kotlin/com/swmansion/kmpmaps/core/Utils.kt |
Adds Mercator-based zoom calculation helper. |
kmp-maps/core/src/iosMain/kotlin/com/swmansion/kmpmaps/core/Extensions.kt |
MapKit region conversions now consider bounds and emit bounds. |
kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/Extensions.kt |
Applies bounds via fitBounds and adds visible-bounds extraction helper. |
kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/MapDelegate.kt |
Includes visible bounds in emitted camera updates. |
kmp-maps/core/src/jvmMain/resources/web/google_map.js |
Emits bounds in the JS → Kotlin camera payload. |
kmp-maps/core/src/jvmMain/kotlin/com/swmansion/kmpmaps/core/MapContentLoader.kt |
Centers initial web camera from bounds midpoint. |
sample/src/commonMain/kotlin/com/swmansion/kmpmaps/sample/MapWrapper.kt |
Updates sample default camera to include bounds. |
.gitignore |
Ignores .claude. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kmp-maps/core/src/androidMain/kotlin/com/swmansion/kmpmaps/core/Map.kt
Outdated
Show resolved
Hide resolved
kmp-maps/core/src/androidMain/kotlin/com/swmansion/kmpmaps/core/Utils.kt
Outdated
Show resolved
Hide resolved
kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/Extensions.kt
Outdated
Show resolved
Hide resolved
kmp-maps/core/src/jvmMain/kotlin/com/swmansion/kmpmaps/core/MapContentLoader.kt
Outdated
Show resolved
Hide resolved
sample/src/commonMain/kotlin/com/swmansion/kmpmaps/sample/MapWrapper.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kmp-maps/core/src/androidMain/kotlin/com/swmansion/kmpmaps/core/Utils.kt
Show resolved
Hide resolved
kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/Extensions.kt
Outdated
Show resolved
Hide resolved
kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/Extensions.kt
Show resolved
Hide resolved
kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/Extensions.kt
Outdated
Show resolved
Hide resolved
kmp-maps/core/src/androidMain/kotlin/com/swmansion/kmpmaps/core/Extensions.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kmp-maps/core/src/iosMain/kotlin/com/swmansion/kmpmaps/core/Extensions.kt
Show resolved
Hide resolved
kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/Extensions.kt
Outdated
Show resolved
Hide resolved
kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/Extensions.kt
Outdated
Show resolved
Hide resolved
kmp-maps/core/src/iosMain/kotlin/com/swmansion/kmpmaps/core/Extensions.kt
Outdated
Show resolved
Hide resolved
| bearing = (position.iosCameraPosition?.gmsBearing ?: 0f).toDouble(), | ||
| viewingAngle = (position.iosCameraPosition?.gmsViewingAngle ?: 0f).toDouble(), |
There was a problem hiding this comment.
| bearing = (position.iosCameraPosition?.gmsBearing ?: 0f).toDouble(), | |
| viewingAngle = (position.iosCameraPosition?.gmsViewingAngle ?: 0f).toDouble(), | |
| bearing = position.iosCameraPosition?.gmsBearing?.toDouble() ?: 0.0, | |
| viewingAngle = position.iosCameraPosition?.gmsViewingAngle?.toDouble() ?: 0.0, |
| const cameraState = { | ||
| coordinates: { | ||
| latitude: center.lat(), | ||
| longitude: center.lng(), | ||
| }, | ||
| zoom | ||
| }; |
Add basic version of bounds
Add bounds support to all platforms