Skip to content

CarPlay compass view - #2077

Merged
frederoni merged 7 commits into
masterfrom
fred/cp-compass
May 4, 2019
Merged

frederoni merged 7 commits into
masterfrom
fred/cp-compass

Conversation

@frederoni

@frederoni frederoni commented Apr 4, 2019 •

Copy link
Copy Markdown
Contributor

This PR adds a CarPlayCompassView that 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

@frederoni frederoni added topic: design UI Work related to visual components, Android Auto, Camera, 3D, voice, etc. CarPlay Bugs, improvements and feature requests on Apple CarPlay labels Apr 4, 2019
@1ec5

1ec5 commented Apr 4, 2019

Copy link
Copy Markdown
Contributor

We could also snap the course so that only eight different directions would be present.

This is a reasonable workaround for mapbox/mapbox-gl-native#6872. The style is correct, but the granularity is too high.

@1ec5 1ec5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cranking out this feature!

import Mapbox

@objc(MBCarPlayCompassView)
open class CarPlayCompassView: FloatingButton {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely agree. This should probably be a StylableView or a plain UIView.

@frederoni
frederoni force-pushed the fred/cp-compass branch 2 times, most recently from 39b3244 to 478f754 Compare April 23, 2019 16:46
@frederoni
frederoni marked this pull request as ready for review April 24, 2019 12:06

@1ec5 1ec5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good other than two minor issues.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class and its open members need documentation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a bit out of bounds and it did truncate without font scaling, but it's fixed now.

@frederoni
frederoni merged commit d4fe79d into master May 4, 2019
@frederoni
frederoni deleted the fred/cp-compass branch May 4, 2019 00:11
@1ec5 1ec5 added this to the v0.33.0 milestone May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CarPlay Bugs, improvements and feature requests on Apple CarPlay topic: design UI Work related to visual components, Android Auto, Camera, 3D, voice, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants