Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4a72257 authored by Fynn Godau's avatar Fynn Godau
Browse files

Fix draggable markers

parent 4bdbc20f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -684,7 +684,12 @@ class GoogleMapImpl(private val context: Context, var options: GoogleMapOptions)

                    override fun onAnnotationDrag(annotation: Symbol?) {
                        try {
                            markers[annotation?.id]?.let { markerDragListener?.onMarkerDrag(it) }
                            annotation?.let { symbol ->
                                markers[symbol.id]?.let { marker ->
                                    marker.setPositionWhileDragging(symbol.latLng.toGms())
                                    markerDragListener?.onMarkerDrag(marker)
                                }
                            }
                        } catch (e: Exception) {
                            Log.w(TAG, e)
                        }
+8 −0
Original line number Diff line number Diff line
@@ -87,6 +87,14 @@ class MarkerImpl(private val map: GoogleMapImpl, private val id: String, options
        map.symbolManager?.let { update(it) }
    }

    /**
     * New position is already reflected on map while if drag is in progress. Calling
     * `symbolManager.update` would interrupt the drag.
     */
    internal fun setPositionWhileDragging(position: LatLng) {
        this.position = position
    }

    override fun getPosition(): LatLng = position

    override fun setTitle(title: String?) {