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

Center scroll wheel zoom on mouse pointer #1191

Merged
merged 6 commits into from
Mar 20, 2022

Conversation

pmjobin
Copy link
Contributor

@pmjobin pmjobin commented Mar 18, 2022

This modifies the behaviour of scroll wheel zooming so that it mimics other map packages (such as Google Maps) by pinning the center of scaling under the mouse pointer. This works regardless of the rotation of the map.

@JaffaKetchup
Copy link
Member

@pmjobin Will try to test soon. Thanks for your contribution!

Copy link
Member

@JaffaKetchup JaffaKetchup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be able to merge this, the checks need to be satisfied. To do this, please run dart format . --fix in your console.

@JaffaKetchup
Copy link
Member

@pmjobin @a14n How will #1191 and #1182 work together? Will they interfere?

@JaffaKetchup JaffaKetchup self-requested a review March 20, 2022 14:05
Copy link
Member

@JaffaKetchup JaffaKetchup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to keep annoying you! This also needs to be fixed to appease the checks:

lib/src/gestures/gestures.dart:3:[8] - unused-import - Unused import: 'dart:math'. Try removing the import directive. 

@JaffaKetchup JaffaKetchup self-requested a review March 20, 2022 14:08
Copy link
Member

@JaffaKetchup JaffaKetchup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will test changes soon, now auto-checks are all good :)

@pmjobin
Copy link
Contributor Author

pmjobin commented Mar 20, 2022

Thanks for your help!

Copy link
Contributor

@ibrierley ibrierley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work and thanks! Tests good for me with and without rotation in chrome and android.

@JaffaKetchup
Copy link
Member

Testing now...
Will have to resolve those conflicts before merge.

@a14n
Copy link
Contributor

a14n commented Mar 20, 2022

To resolve the conflict you have to replace MapEventSource.custom with MapEventSource.scrollWheel

@JaffaKetchup JaffaKetchup self-requested a review March 20, 2022 17:32
Copy link
Member

@JaffaKetchup JaffaKetchup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants