-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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-to-zoom broken when first touch is on a marker on touch devices #9675
Comments
Thanks for the details @levelsio , I looked at your map at nomadlist.com/map, and this would definitely be more of a problem there considering the marker density. I tested the behavior on iOS and confirm this is a regression from our custom-marker-icons page. @ansis would there any event canceling the gestures when we touch a marker? |
Previously we were using e.targetTouches as the list of touches relevant to the map. It contains only the touches that first touched the same target. Touches that hit a marker have a different target. This fixes uses e.touches and filters out touches who's target is not a child of the map. fix #9675
@levelsio we have a fix for this issue that will be available as part of v1.10.1, thanks for the report! |
* fix multi-finger gestures touching markers Previously we were using e.targetTouches as the list of touches relevant to the map. It contains only the touches that first touched the same target. Touches that hit a marker have a different target. This fixes uses e.touches and filters out touches who's target is not a child of the map. fix #9675 * update tests and add regression test
* fix multi-finger gestures touching markers Previously we were using e.targetTouches as the list of touches relevant to the map. It contains only the touches that first touched the same target. Touches that hit a marker have a different target. This fixes uses e.touches and filters out touches who's target is not a child of the map. fix #9675 * update tests and add regression test
* fix multi-finger gestures touching markers Previously we were using e.targetTouches as the list of touches relevant to the map. It contains only the touches that first touched the same target. Touches that hit a marker have a different target. This fixes uses e.touches and filters out touches who's target is not a child of the map. fix #9675 * update tests and add regression test
Since upgrading to v1.10.0, when a user uses a touch device (iPhone) and pinches to zoom on a map but there is a marker on their first touch (e.g. a marker is in the way), zoom will not happen at all. Only if user pinches to zoom outside the marker, the map will zoom.
This is new behavior and not expected I believe. Especially on a map with lots of markers (like my site: nomadlist.com/map), pinch zooming becomes very difficult as the user has to position both fingers outside any marker. It's also not how any other map API or app does it (e.g. Gmaps).
Example from Mapbox itself, open on a touch device like iPhone, zoom out, and try pinch zooming while first touch is on a marker:
https://docs.mapbox.com/mapbox-gl-js/example/custom-marker-icons/
The text was updated successfully, but these errors were encountered: