OwnWeb / flutter_map_tappable_polyline

A tappable Polyline plugin for flutter_map
https://pub.dev/packages/flutter_map_tappable_polyline
MIT License
54 stars 44 forks source link

Multiple onTap called when polylines are close to each other #14

Closed Mkohm closed 3 years ago

Mkohm commented 3 years ago

If there are many polylines multiple onTap can be called. A solution where only the closest one will be triggered should be implemented. Will see what i can do about it later.

tuarrep commented 3 years ago

https://github.com/OwnWeb/flutter_map_tappable_polyline/blob/master/lib/flutter_map_tappable_polyline.dart#L185 Should prevent this

Mkohm commented 3 years ago

Unfortunately not - according to this: https://stackoverflow.com/questions/50336082/how-to-return-from-a-foreach-loop-in-dart and my observations, it will not return :) I am working on a fix as i am working with polylines that is close to each other.

tuarrep commented 3 years ago

Just replace foreach by a traditional for then.