Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] hasGesture is false after double tap zoom in onPositionChanged callback #1465

Closed
5 tasks done
David-Prelinger opened this issue Mar 14, 2023 · 7 comments · Fixed by #1630
Closed
5 tasks done
Labels
bug This issue reports broken functionality or another error P: 3 (low) (Default priority for feature requests)

Comments

@David-Prelinger
Copy link

David-Prelinger commented Mar 14, 2023

What is the bug?

The onPositionChanged callback delivers false for hasGesture when zooming, especially double tapping to zoom. Normally, when the user zooms with two fingers, he also moves the map slightly, so hasGesture will eventually be true. But if you zoom with mouse and keyboard or zoom via double tap, hasGesture is just false.

This makes it hard to disguish between zooms made by code and zooms made by human.

What is the expected behaviour?

hasGesture == true, when onPositionChanged callback is called from a zoom.

How can we reproduce this issue?

FlutterMap(
 mapController: _mapController,
 options: MapOptions(
 onPositionChanged: (
    MapPosition posChange,
    bool hasGesture,
 ) {
   print(hasGesture);
}

Do you have a potential solution?

No response

Can you provide any other information?

I was just able to test it on Android, but I expect it to happen on all platforms.

Platforms Affected

Android

Severity

Minimum: Allows normal functioning

Frequency

Consistently: Always occurs at the same time and location

Requirements

  • I agree to follow this project's Code of Conduct
  • My Flutter/Dart installation is unaltered, and flutter doctor finds no relevant issues
  • I have checked the FAQs section on the documentation website
  • I am using the latest stable version of this package
  • I have checked for similar issues which may be duplicates
@David-Prelinger David-Prelinger added bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing labels Mar 14, 2023
@ibrierley
Copy link
Collaborator

Might be that line 71 of geatures/gestures.dart needs to include "hasGesture: true," if you wanted to test that.

@David-Prelinger
Copy link
Author

I looked into the code and your suggestion seems reasonable.I tried to edit it in my .pub-cache folder to quickly try it out, though changes there didn't have an effect in my project. I am not familiar with flutter package development, so I would be happy if someone who knows about flutter package development and open source contribution could try it out.

@JaffaKetchup
Copy link
Member

Hi @David-Prelinger,
You'll need to make a fork of this repository, then edit it via GitHub (or clone and work on it as normal), then depend on it direct from GitHub: https://docs.fleaflet.dev/getting-started/installation#from-github.com. After this, changes from GitHub should appear locally, after running flutter pub upgrade.
If the issue appears to be fixed, please do open a PR! There'll be buttons available at the top of your fork page once you make changes, or you can visit https://github.com/fleaflet/flutter_map/compare and use 'Compare across forks'.

@David-Prelinger
Copy link
Author

Thanks I'll try it out!

@JaffaKetchup
Copy link
Member

Hi @David-Prelinger, just checking up to see if you ever got around to this? No problem if not!

@JaffaKetchup JaffaKetchup added non-fatal and removed needs triage This new bug report needs reproducing and prioritizing labels Jun 4, 2023
@David-Prelinger
Copy link
Author

Hi @JaffaKetchup sorry for not coming back to this sooner. This issue was work related and we decided not to follow through with fixing it since it was only a minor inconvenience to us.

@JaffaKetchup
Copy link
Member

No problem!

@JaffaKetchup JaffaKetchup linked a pull request Jun 19, 2023 that will close this issue
@JaffaKetchup JaffaKetchup changed the title [BUG] hasGesture is false after double tap zoom in onPositionChanged callback. [BUG] hasGesture is false after double tap zoom in onPositionChanged callback Jun 19, 2023
@JaffaKetchup JaffaKetchup added the P: 3 (low) (Default priority for feature requests) label Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports broken functionality or another error P: 3 (low) (Default priority for feature requests)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants