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

Pinch & Zoom is off center on touch devices (v0.45.0) #6722

Closed
dave11mj opened this issue May 23, 2018 · 15 comments
Closed

Pinch & Zoom is off center on touch devices (v0.45.0) #6722

dave11mj opened this issue May 23, 2018 · 15 comments
Labels

Comments

@dave11mj
Copy link

dave11mj commented May 23, 2018

mapbox-gl-js version: v0.45.0

browser:

  • Chrome (Windows 10) with a touch monitor (Dell S2240T)
  • Safari (iPhone 7)
  • Safari (iPad)
  • Any other touch enabled device (specially large screen displays)

Steps to Trigger Behavior

  1. Place your fingers around the intended target to initiate zoom
  2. Expand your fingers in a pinch & zooming gesture
  3. Observe target moves away from the center of your fingers

Link to Demonstration

v0-45-0-demo

Demo Github Page Using v0.45.0
Demo Source

Note that in the demo above when you try to pinch and zoom on the "Capitol Hill Fountain"
it goes off center instead of remaining between the fingers.

v0-44-2-demo

Demo Github Page Using v0.42.2
Demo Source

Note that in the demo above when you try to pinch and zoom on the "Capitol Hill Fountain"
it stays between fingers. However, you are unable to pan with more than one finger.

Expected Behavior

Target should remain centered between the user's fingers without removing the ability to pan using more than one finger.

Actual Behavior

Target moves off center as the user zooms into it.

@andest01
Copy link

I am able to reproduce this error on my setup as well.

  • Chrome Version 66.0.3359.181 (Official Build) (64-bit)
  • (Windows 10)
  • Dell P2418HT touch device

@averas
Copy link
Contributor

averas commented Jun 19, 2018

This bug, along with #6668, feels like major blockers for any production upgrades from 0.44.2 and below.

@jliebrand
Copy link

This makes using pinch zoom pretty crappy on mobile. Any update on a potential fix here?

@jliebrand
Copy link

Friendly ping. Any plans for a fix?

@pakastin
Copy link
Contributor

pakastin commented Aug 24, 2018

I have a simple solution waiting for a pull request which fixes this nicely 😎

@pakastin
Copy link
Contributor

@jliebrand
Copy link

Awesome!

ryanhamley pushed a commit that referenced this issue Aug 24, 2018
…#7191)

* Keep multitouch center at starting center location during pinch gestures
@ryanhamley
Copy link
Contributor

closed by #7191

pirxpilot added a commit to pirxpilot/mapbox-gl-js that referenced this issue Aug 26, 2018
@jliebrand
Copy link

This is now much improved! Thanks! There's still a little glitch at the start of the pinch gesture... it seems to first move the map for a certain threshold of pixels, and then it computes the correct centre, jumps a little, and from there on in the pinch works fine.

Any thoughts on that initially little "jump"

@pakastin
Copy link
Contributor

Yeah, it's basically because of this: #7196

If you move the map with one finger and then add a second finger, multitouch event overlaps with the single touch event and creates the glitch..

@msbarry
Copy link
Contributor

msbarry commented Sep 17, 2018

Also might be related to a fix I made for #1832 - try setting setting clickTolerance option when you create the map to 0.

@Mindcraft1
Copy link

Hello
I'm encountering exactly this issue when using mapbox-gl as node_module import.

npm i mapbox-gl
import mapboxgl from 'mapbox-gl'

Updated package today for double check.

Does this require a new issue to be opened?

@pakastin
Copy link
Contributor

pakastin commented Oct 7, 2018

You mean the original issue? How to reproduce?

@ryanhamley
Copy link
Contributor

Hi @Mindcraft1 this was fixed as of v0.49.0 so if you have that installed, it should work as expected. You haven't really given enough information for us to help you out here. If you can confirm that you have the correct version installed and are still seeing a bug, you can open a new ticket with all the information in the template filled out and a minimal reproduction of the bug (in JSBin for example) so that we can diagnose what is going on.

@Mindcraft1
Copy link

Hi I opened #7397

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

No branches or pull requests

9 participants