-
Notifications
You must be signed in to change notification settings - Fork 240
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
No onRegionIsChanging callback when flinging position #2141
Comments
This is why is stumbled across this, I am implementing this: Obviously, when one flings the position, the pointer pin should update too. |
Can I help here? Is this fixable on the Java-side? I'd love to be able to release the feature I mentioned but with no callback on flinging it's not good. |
Thanks for the offer to help ❤️ but unfortunately I don't think that this can be fixed on just the Java side. Movement after a fling gesture is handled in the C++ core and it currently doesn't invoke callbacks the way that it does for scripted camera animations. I do at least have an idea for how to fix this now: the movement of the camera after a fling can be calculated as a closed-form function, which means it could be implemented as a camera animation and treated mostly the same as 'updateCamera' and 'flyTo' animations. There are some subtleties to the exact series of events that should be emitted: for example if a fling is considered a camera animation should we call I hope to get some time for this later in the week, or this upcoming weekend. |
Ok it took me a while to re-acquaint myself with this code, thanks for your patience. The events sent to the listener are a little different from what you expected but should still enable you to implement your feature. When a user moves the map with a gesture that ends with a fling, the callbacks look like:
So the fling animation is treated a little separately from the gesture itself, but you still receive events for it. When you get a This is a little different from the way callbacks work in the Google Maps API. It basically mimics the behavior of the equivalent callbacks in MapKit (https://developer.apple.com/documentation/mapkit/mkmapviewdelegate#topics). It was easier for us at the time to pick one callback pattern to implement, but it may be nicer for Android developers to stick closer to the "native" API patterns. |
Ah I understand, yes that'd work. Thank you for the documentation update! |
If one flings the map via the default fling gesture, no
onRegionIsChanging
is called on theMapChangeListener
while the view is being animated to the new position.Seen in tangram 0.12.
Related to #2129
The text was updated successfully, but these errors were encountered: