-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add geographical and screen coordinates to map interaction callbacks #473
Conversation
5978d96
to
536b1ce
Compare
static MapContentGestureContext decode(Object result) { | ||
result as List<Object?>; | ||
return MapContentGestureContext( | ||
touchPosition: ScreenCoordinate.decode(result[0]! as List<Object?>), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way we can avoid the forced !
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is Pigeon-generated, it seems that the assumptions here, since the decoding and encoding is both done by Pigeon, they deem to be acceptable to force unwrap it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fair 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really nice 😎
Co-authored-by: Patrick Leonard <pjleonard37@users.noreply.github.com>
What does this pull request do?
Introduces
MapContentGestureContext
carrying touch point and projected map coordinate under the touch point of a gesture.Changes tap, long tap and move gesture callbacks to use
MapContentGestureContext
instead ofScreenCoordinate
.What is the motivation and context behind this change?
ScreenCoordinate
is not a correct type to represent geographical position. This is also a matter of ergonomics of providing both touch and geographical positions of a gesture.Addresses: https://mapbox.atlassian.net/browse/MAPSFLT-111, #81 and #190.
Pull request checklist: