Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Double tap zoom gesture moves to quickly #7514

Closed
cammace opened this issue Dec 21, 2016 · 2 comments
Closed

Double tap zoom gesture moves to quickly #7514

cammace opened this issue Dec 21, 2016 · 2 comments
Labels
Android Mapbox Maps SDK for Android bug

Comments

@cammace
Copy link
Contributor

cammace commented Dec 21, 2016

We offer the double tap to zoom in/out on the map but currently the zooming will happen too quickly when barely dragging your finger up or down.

ezgif com-video-to-gif

cc: @mapbox/android

@cammace cammace added Android Mapbox Maps SDK for Android bug labels Dec 21, 2016
@tobrun tobrun added this to the android-v4.2.1 milestone Dec 21, 2016
@tobrun tobrun modified the milestones: android-v5.0.0, android-v4.2.1 Jan 3, 2017
@tobrun
Copy link
Member

tobrun commented Jan 3, 2017

My initial idea was that this is related to screen density since the devices having this issue were mostly newer devices with a large pixel ratio. Now looking into the code I'm seeing that this is not related to the x,y value of pixels but that issue is coming from detector.getScaleFactor() that is used as part of zoomBy in the gesture shown in the OP.

My hunch is that scale factor is too large due to screen density (this value is coming from an external dependency and we would have to work around this in our code) or that the values we are feeding core are not correct (eg. negative values or spike values, in normal situations I'm seeing logs with values around 1 but when a major shift happens I'm seeing a sole value that is negative (eg -0.56) or a value that is way larger as the rest (eg. 14).

@tobrun
Copy link
Member

tobrun commented Jan 3, 2017

Here are some sequences of scale factors provided to the SDK from our gesture detector library:

V/MapGestureDetector$ScaleGestureListener: Scale 1.0046271
V/MapGestureDetector$ScaleGestureListener: Scale 1.0089378
V/MapGestureDetector$ScaleGestureListener: Scale 1.0184126
V/MapGestureDetector$ScaleGestureListener: Scale 1.0239114
V/MapGestureDetector$ScaleGestureListener: Scale 1.046406
V/MapGestureDetector$ScaleGestureListener: Scale 1.0642886
V/MapGestureDetector$ScaleGestureListener: Scale 1.080839
V/MapGestureDetector$ScaleGestureListener: Scale 1.119591
V/MapGestureDetector$ScaleGestureListener: Scale 1.1630605
V/MapGestureDetector$ScaleGestureListener: Scale 1.250629
V/MapGestureDetector$ScaleGestureListener: Scale 0.53555655
V/MapGestureDetector$ScaleGestureListener: Scale 8.800293
V/MapGestureDetector$ScaleGestureListener: Scale 1.4822774
V/MapGestureDetector$ScaleGestureListener: Scale 1.2489731
V/MapGestureDetector$ScaleGestureListener: Scale 1.1681666
V/MapGestureDetector$ScaleGestureListener: Scale 1.1117692
V/MapGestureDetector$ScaleGestureListener: Scale 1.0839446
V/MapGestureDetector$ScaleGestureListener: Scale 1.0684125
V/MapGestureDetector$ScaleGestureListener: Scale 1.0564218
V/MapGestureDetector$ScaleGestureListener: Scale 1.0442512
V/MapGestureDetector$ScaleGestureListener: Scale 1.0412383
V/MapGestureDetector$ScaleGestureListener: Scale 1.0306668
V/MapGestureDetector$ScaleGestureListener: Scale 1.0241464
V/MapGestureDetector$ScaleGestureListener: Scale 1.0180855

or

V/MapGestureDetector$ScaleGestureListener: Scale 0.946373
V/MapGestureDetector$ScaleGestureListener: Scale 0.9367054
V/MapGestureDetector$ScaleGestureListener: Scale 0.91751075
V/MapGestureDetector$ScaleGestureListener: Scale 0.89154875
V/MapGestureDetector$ScaleGestureListener: Scale 0.8659967
V/MapGestureDetector$ScaleGestureListener: Scale 0.8338932
V/MapGestureDetector$ScaleGestureListener: Scale 0.76041627
V/MapGestureDetector$ScaleGestureListener: Scale 0.5274352
V/MapGestureDetector$ScaleGestureListener: Scale -7.3576527
V/MapGestureDetector$ScaleGestureListener: Scale 0.4487716
V/MapGestureDetector$ScaleGestureListener: Scale 0.74890393
V/MapGestureDetector$ScaleGestureListener: Scale 0.8576364
V/MapGestureDetector$ScaleGestureListener: Scale 0.90766495
V/MapGestureDetector$ScaleGestureListener: Scale 0.94259167
V/MapGestureDetector$ScaleGestureListener: Scale 0.95532775
V/MapGestureDetector$ScaleGestureListener: Scale 0.976783
V/MapGestureDetector$ScaleGestureListener: Scale 0.98298824
V/MapGestureDetector$ScaleGestureListener: Scale 0.9842705
V/MapGestureDetector$ScaleGestureListener: Scale 0.9980335
V/MapGestureDetector$ScaleGestureListener: Scale 1.0029142

I'm currently trying out the latter approach in #7514 (comment) and allowing values >0.8 and <1.2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android bug
Projects
None yet
Development

No branches or pull requests

2 participants