fix: Fix position changing while dragging a marker#135
Merged
arturgesiarz merged 6 commits intomainfrom Feb 9, 2026
Merged
Conversation
Member
Author
|
This change is part of the following stack: Change managed by git-spice. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for handling marker drag events by introducing an onMarkerDragEnd callback parameter throughout the Map API. The implementation fixes an issue where marker positions would change incorrectly during dragging.
Changes:
- Added
onMarkerDragEndcallback parameter to all Map function signatures across platforms - Implemented drag event handling in the Android implementation using
MarkerState.isDragging - Updated coordinate conversion utilities to support bidirectional conversion between
LatLngandCoordinates - Added documentation note about draggability limitations when clustering is enabled
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| sample/src/commonMain/kotlin/com/swmansion/kmpmaps/sample/MapWrapper.kt | Threads the new onMarkerDragEnd callback through the sample Map wrapper |
| kmp-maps/google-maps/src/jvmMain/kotlin/com/swmansion/kmpmaps/googlemaps/Map.kt | Adds onMarkerDragEnd parameter to JVM Google Maps implementation |
| kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/Map.kt | Adds onMarkerDragEnd parameter to iOS Google Maps implementation |
| kmp-maps/google-maps/src/commonMain/kotlin/com/swmansion/kmpmaps/googlemaps/Map.kt | Adds onMarkerDragEnd parameter and documentation to common Google Maps API |
| kmp-maps/google-maps/src/androidMain/kotlin/com/swmansion/kmpmaps/googlemaps/Map.kt | Adds onMarkerDragEnd parameter to Android Google Maps implementation |
| kmp-maps/core/src/jvmMain/kotlin/com/swmansion/kmpmaps/core/Map.kt | Adds onMarkerDragEnd parameter to JVM core implementation |
| kmp-maps/core/src/iosMain/kotlin/com/swmansion/kmpmaps/core/Map.kt | Adds onMarkerDragEnd parameter to iOS core implementation |
| kmp-maps/core/src/commonMain/kotlin/com/swmansion/kmpmaps/core/Map.kt | Adds onMarkerDragEnd parameter and documentation to common API |
| kmp-maps/core/src/commonMain/kotlin/com/swmansion/kmpmaps/core/AndroidMapTypes.kt | Documents draggability limitation when clustering is enabled |
| kmp-maps/core/src/androidMain/kotlin/com/swmansion/kmpmaps/core/Map.kt | Implements drag event handling with LaunchedEffect monitoring isDragging state and updates marker click handlers to use current position |
| kmp-maps/core/src/androidMain/kotlin/com/swmansion/kmpmaps/core/Extensions.kt | Adds toCoordinates() extension and refactors marker state conversion for reusability |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kmp-maps/core/src/jvmMain/kotlin/com/swmansion/kmpmaps/core/Map.kt
Outdated
Show resolved
Hide resolved
kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/Map.kt
Outdated
Show resolved
Hide resolved
kmp-maps/core/src/commonMain/kotlin/com/swmansion/kmpmaps/core/Map.kt
Outdated
Show resolved
Hide resolved
kmp-maps/google-maps/src/commonMain/kotlin/com/swmansion/kmpmaps/googlemaps/Map.kt
Outdated
Show resolved
Hide resolved
kmp-maps/core/src/iosMain/kotlin/com/swmansion/kmpmaps/core/Map.kt
Outdated
Show resolved
Hide resolved
0ad686a to
ab1285e
Compare
patrickmichalik
approved these changes
Feb 5, 2026
kmp-maps/core/src/androidMain/kotlin/com/swmansion/kmpmaps/core/Extensions.kt
Outdated
Show resolved
Hide resolved
ab1285e to
cdcce8f
Compare
cdcce8f to
e785287
Compare
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
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.
No description provided.