Open mic12130 opened 2 years ago
I am experiencing the same issue. Did you find any workaround @mic12130 ?
Ahh it has been 2 years. I gave up fixing this as the outcome wasn't worth the works for me. Besides updating codes of the framework, an idea once in my mind was implementing a custom pinch gesture recognizer to particularly handle the trackpad case. (as the built-in recognizer just skips anything happened on trackpads) Then with the combination of the finger locations and the map's camera setter, everything should work.
Hi! @mapbox-ci I have run into this issue as well, pinch gestures do not work on trackpad
Environment
Observed behavior and steps to reproduce
When performing a pinch gesture on a connected trackpad, there is no change on the map view, instead of the expected behavior of zooming in/out (this is what MapKit looks like).
This may affect many scenarios including iPad + Magic Trackpad, iPad + Universal Control, iPad app running on Apple Silicon Mac etc.
Expected behavior
A pinch gesture on the trackpad should be recognized and reacted as same as the one on the touch screen.
Notes / preliminary analysis
I tried to dive down a little bit into this issue and I found that it's supposed to be caused by the
numberOfTouches
validation in PinchGestureHandler.swift - the validation discards any input whosenumberOfTouches
is other than 2, while the property will always return 0 when the input is from a trackpad.Note: I haven't found any information about
numberOfTouches
returning 0 in Apple's documents, but it is observed every time in my testing.Additional links and references