platform_maps_flutter icon indicating copy to clipboard operation
platform_maps_flutter copied to clipboard

Enhancement for Polyline::onTap

Open kuzmycz opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. I use polylines to circumscribe a region (defined by markers) and when a user click on a Polyline I want to add a marker where they tap and insert the marker into my marker list. Currently, when a user taps on the Polyline, I have no way of telling where they selected. This requires me to calculate the midpoint and drop the marker there. The user then has to drag the marker to the final destination which is annoying for the user.

Describe the solution you'd like I would like the Polyline onTap method to pass the the Polyline selected and the position on the map they tapped

eg. line.onTap = process(Polyline polyline, LatLng position) => do stuff

Providing the Polyline (that was tapped) allows generic functions to be used (not required, but nice to have) Providing the position allows an application to reason about where on the line the tap occurs. In may case, the position to drop the marker

Describe alternatives you've considered Currently calculate the midpoint of the Polyline. This is annoying for the user as they have to reposition the marker

kuzmycz avatar Mar 27 '22 21:03 kuzmycz