Repository navigation
CarPlay compass view - #2077
CarPlay compass view#2077
Conversation
This is a reasonable workaround for mapbox/mapbox-gl-native#6872. The style is correct, but the granularity is too high. |
1ec5
left a comment
There was a problem hiding this comment.
Thanks for cranking out this feature!
| import Mapbox | ||
|
|
||
| @objc(MBCarPlayCompassView) | ||
| open class CarPlayCompassView: FloatingButton { |
There was a problem hiding this comment.
A circular button on the map may look too much like a tappable button. I suppose that’s why other navigation applications give the compass a rounded rectangle shape, similar to the panels that are overlaid atop the map.
There was a problem hiding this comment.
Absolutely agree. This should probably be a StylableView or a plain UIView.
39b3244 to
478f754
Compare
1ec5
left a comment
There was a problem hiding this comment.
Looks good other than two minor issues.
There was a problem hiding this comment.
This class and its open members need documentation.
There was a problem hiding this comment.
Is this wide enough to accommodate a four-character-long string?
https://github.com/mapbox/mapbox-gl-native/blob/5b28c1eb9c1bf58bb2ab050d0e52aa7f96e8eef8/platform/darwin/resources/uk.lproj/Foundation.strings#L128
https://github.com/mapbox/mapbox-gl-native/blob/5b28c1eb9c1bf58bb2ab050d0e52aa7f96e8eef8/platform/darwin/resources/he.lproj/Foundation.strings#L128
Maybe the label’s font size needs to shrink if it doesn’t fit.
There was a problem hiding this comment.
It was a bit out of bounds and it did truncate without font scaling, but it's fixed now.
This PR adds a
CarPlayCompassViewthat indicates the direction the vehicle is traveling towards.It snaps the course to eighth cardinal directions in steps of 45° (["N", "NE", "E", "SE", "S", "SW", "W", "NW"])
The CarPlayCompassView is only meant for CarPlay, and it is hidden by default.
cc @mapbox/navigation-ios