googlemaps / android-maps-utils

Maps SDK for Android Utility Library
https://developers.google.com/maps/documentation/android-sdk/utility
Apache License 2.0
3.54k stars 1.53k forks source link

setOnMarkerDragListener does not report marker drag event #1329

Open gpopac opened 4 months ago

gpopac commented 4 months ago

I have trouble implementing marker dragging with android-maps-utils, despite following the guideline. The marker is draggable, but dragging it on the map does not trigger onMarkerDrag, onMarkerDragEnd or onMarkerDragStart.

I am using KmlLayer and GeoJsonLayer to add custom overlay on the map and simple marker only (not clusters). For more details the code of the Activity is available here: https://github.com/Biologer/Biologer-Android/blob/master/app/src/main/java/org/biologer/biologer/gui/MapActivity.java

In summary I used:

Marker marker;
MarkerManager markerManager = new MarkerManager(googleMap);
MarkerManager.Collection markerCollection = markerManager.newCollection();
MarkerOptions markerOptions = new MarkerOptions().position(latLong).draggable(true);
marker = markerCollection.addMarker(markerOptions);
markerCollection.setOnMarkerDragListener(new GoogleMap.OnMarkerDragListener( ... ...
wangela commented 4 months ago

If you would like to upvote the priority of this issue, please comment below or react on the original post above with :+1: so we can see what is popular when we triage.

@gpopac Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

gpopac commented 4 months ago

Update. It looks like the dragging stops working as soon as I add KmlLayer or GeoJsonLayer.