-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Refactored MGLUserLocationAnnotationView (redux) #5882
Refactored MGLUserLocationAnnotationView (redux) #5882
Conversation
|
||
CGPoint tapPointForUserLocation = self.userLocationAnnotationView.hitTestLayer.superlayer ? [singleTap locationInView:self.userLocationAnnotationView] : tapPoint; | ||
|
||
CALayer *hitLayer = self.userLocationVisible ? [self.userLocationAnnotationView.hitTestLayer hitTest:tapPointForUserLocation] : nil; |
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 doesn’t need to check again for self.userLocationVisible
— will remove.
Saw some weird behavior just now that I don’t have time to investigate, but the user dot wasn’t being updated/deselected when another annotation became selected. E.g., tapping another annotation while in course tracking mode would leave the puck on screen until the tracking mode was manually changed again. Will investigate next week. |
cd60f2a
to
9ba5c91
Compare
9ba5c91
to
71d9687
Compare
380d54a9d5106fb957455c4376e086634ff05f39 fixes the issue where the annotation was not updating immediately. The A separate method that’s called when the user’s location changes shouldn’t be necessary, as the existing The user location annotation needs updates more frequently than once per location event — it needs to respond to user interaction, viewport changes, and user tracking mode changes. Very open to naming suggestions for |
user interaction, a change in the user’s location, when the user tracking mode | ||
changes, or when the viewport changes. | ||
|
||
@warning During user interaction with the map, this method may be called many |
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.
No keyword is needed here, although @note
is fine if you think it’s sufficiently important. @warning
should be reserved for pitfalls that may lead to data loss or similarly catastrophic outcomes.
Can you say more about this @friedbunny? |
1806121
to
824c09f
Compare
@frederoni added I renamed I then re-added the call to
|
Aha! Thank you.
|
This is ready for review 👓 again — thanks y’all. I should note: this is a fairly pure refactor. The main part that has changed versus v3.3.x is that |
And implement this property in MGLFaux3DUserLocationAnnotationView. Generic reimplementation of #5816.
The user location annotation needs to change in response to many factors, not just user location updates. When the user tracking mode changes and when the viewport changes, the dot should respond immediately.
Also remove unnecessary header import.
Because, really, what choice do you have? <3 Xcode.
824c09f
to
634f680
Compare
Rebased again — I’m going to aim for merging this afternoon. |
This is a replacement PR for #5573 that targets
master
.Additionally, I’ve rewritten #5816 so that the hit testing layer can be set by any subclass of
MGLUserLocationAnnotationView
./cc @frederoni @1ec5 @incanus @boundsj