You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed in google and apple maps that when location tracking is functioning, they change how their pinch gestures function. Normally, pinch gestures focus the centers of the zoom wherever the user placed their fingers. However, when location tracking is enabled, the center is changed to always be on top of the location gem marker.
After some discussion with @karimnaaji it seems we'd need to alter Tangram's interface a bit to handle this. I believe the easiest way to do this is to allow implementing developers to mutate the CGPoint location we're passing to them in shouldRecognizePinchGesture: from the TGRecognizerDelegate callbacks. The difficulty here is expressing the mutability of the parameters due to the nature of the protocol being defined in objective-c but imported into swift.
There are a few alternative options, the easiest of which seems like a public obj-c function that wraps Tangram's self.map->handlePinchGesture() function, and some minor refactoring of the obj-c SDK code to use the new wrapper function. That way the implementor could override the handlePinchGesture function, change the location as necessary, and then call the superclass implementation.
The text was updated successfully, but these errors were encountered:
Did a little more reading over lunch. We may be able to switch the CGPoint definition to use pass by reference on the objective-c side, so CGPoint **location and then swift should import that as an UnsafeMutablePointer and allow the mutation to happen.
I noticed in google and apple maps that when location tracking is functioning, they change how their pinch gestures function. Normally, pinch gestures focus the centers of the zoom wherever the user placed their fingers. However, when location tracking is enabled, the center is changed to always be on top of the location gem marker.
After some discussion with @karimnaaji it seems we'd need to alter Tangram's interface a bit to handle this. I believe the easiest way to do this is to allow implementing developers to mutate the
CGPoint location
we're passing to them inshouldRecognizePinchGesture:
from the TGRecognizerDelegate callbacks. The difficulty here is expressing the mutability of the parameters due to the nature of the protocol being defined in objective-c but imported into swift.There are a few alternative options, the easiest of which seems like a public obj-c function that wraps Tangram's
self.map->handlePinchGesture()
function, and some minor refactoring of the obj-c SDK code to use the new wrapper function. That way the implementor could override thehandlePinchGesture
function, change the location as necessary, and then call the superclass implementation.The text was updated successfully, but these errors were encountered: