marchdev-tk / flutter_google_maps

A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web.
BSD 3-Clause "New" or "Revised" License
87 stars 57 forks source link

I need to separate gestures for dragging the map and marker's onTap(mobile) #54

Closed kleyos closed 4 years ago

kleyos commented 4 years ago

Use case

hey everybody. my problem is calling callback only when a user drags the map in some direction and not when he taps on the marker. I was trying to add the solution described here.

gestureRecognizers: Set()
            ..add(Factory<DragGestureRecognizer>(() => Test(() {
                myCallBack();
            })),

but in this case, there is not any chance to separate gestures. My next effort was adding certain GestureRecognazers and assign myCallBack on onStart, onDown etc.

 GoogleMap(
      gestureRecognizers: Set()
        ..add(Factory<PanGestureRecognizer>(() => PanGestureRecognizer()..onUpadate = () {myCallback()}))
        ..add(Factory<ScaleGestureRecognizer>(() => ScaleGestureRecognizer()..onStart = () {myCallback()}))
       ..add(Factory<VerticalDragGestureRecognizer>(
            () => VerticalDragGestureRecognizer()..onDown = () {myCallback()})),

but only function that called was onDown. and again it worked for absolutely all gestures including onTap. But I figured that the onUpdate should worked at least. but it didn't

Proposal

if there is the chance to solve my issue, please let me know)). If it's impossible, I can assure you, it would be so helpful if you added such callbacks

kleyos commented 4 years ago

I am closing the issue because it related to another plugin. not yours. but it might be a suggestion for your plugin