I've asked this question at SO, but there are no replies there, so I decided to give it a try here.
Basically, I want to be able to capture the coordinates of a long press on the Map
component (not the geo-coordinates - that's a separate task - just local to the app coordinates).
The problem is that the .onLongPressGesture
doesn't provide the coordinates of where the long press happened. .onTapGesture
does - but I don't want to register taps, I want to register long presses.
One of the work-arounds suggested at SO was to leverage the DragGesture
, and it kinda works for other views, but when applied to a Map
, it breaks the default dragging functionality of the Map
component (so that it becomes impossible to scroll the map region). Also this work-around provides the coordinates only when the finger is released (at the end of the .onLongPressGesture
), but I want to capture the long-press location before the finger was released (but after some time of holding, for example 1 second).