-
Notifications
You must be signed in to change notification settings - Fork 1.3k
User location puck for course tracking mode #2233
Conversation
e6e8ed6
to
2205b2d
Compare
} | ||
} | ||
|
||
CGFloat MGLRadiansFromDegrees(CLLocationDegrees degrees) |
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.
These methods are also defined in MGLMapView.mm. Can you factor these implementations out into MGLGeometry.h?
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.
Yup, I'll do that.
baf647b
to
2eba2ce
Compare
I added pitch to the user dot.Why?
The pitched accuracy ring still has sizing issues: vertical screen movement isn't accounted for and all elements of the annotation (and puck) keep a constant scale, even though they shouldn't. |
I agree with tilting the accuracy ring, but tilting the dot itself looks odd unless we give it some thickness or elevation. |
As of 17003db: The user dot is now drawn twice: each instance of the dot is masked to show a semicircle, and only the lower semicircle is tilted, giving the illusion of a hemispherical bubble. Back to @friedbunny for review. |
My current thinking is that:
|
Previously in #2265 we would ask for location permission at app startup if `!settings->showsUserLocation`. #2193 0a172a2 changed the way we used `NSUserDefaults` and mostly removed the `settings` object, which broke #2265. Rather than fix our pestering location permissions ask at startup, this commit now only asks for location permissions when the user hits the locate-me button. Once a user grants permission, the user dot appears because a `userTrackingMode` is set, `showsUserLocation` is permanently set to `YES` in `NSUserDefaults` and is restored at launch.
I'm not much of a hockey fan, but those playoff beards are pretty swell.
This exposes the naïveté of the current pitch transform: accuracy ring sizing stays constant, despite vertical screen movement. Still, it looks better pitched than not.
f244254
to
db4a836
Compare
Still fighting flickering during the tilt gesture, tracked it down to the animations. Now animations are paused and unpaused when the gesture starts/finishes. Sadly, I'm considering ditching the 3D flying-saucer look and seeing if not pitching the dot (only the accuracy ring) is a viable option. |
The masking appears to be an issue here, too. If we were to only transform the inner dot (and not split it in two, then mask one side) that might improve the flickering. |
Instead of masking, maybe we could draw both halves of the dot as actual semicircles. |
532bbd5
to
8f37502
Compare
I couldn't get the dome to perform well and not flicker, so pour one out for the cool flying saucer that could have been.
I think we're ready to go here. Next step is to rebase, squash, and get some eyes on this. Ended up removing the dome and going with another faux 3D-ism by setting the |
If we ever allow pitching beyond 60°, we’ll have to revisit this approach and probably figure out how to make the dome work, but this looks great as-is. |
Adds a "puck" that replaces the user location dot when
MGLUserLocationTrackingModeCourse
is active.-drawDot
-drawPuck
_puckModeActivated
boolean-puckArrow
There are still a variety of things to do:
CATransform3D
MGLUserLocationTrackingModeCourse
?MGLMapView
where necessaryFixes #2188.
/cc @incanus @1ec5 @mapbox/mobile