Our users love the compass and want to have it visible all the time. I have added an parameter, compassAlwaysVisible to MGLMapView in our branch that fixes this.
mapView.compassAlwaysVisible = YES;
Would it make sense to have this as an standard option i Mapbox GL Native? Do you want this minor thing as a pull-request?
Hi @halset. Thank you for asking. Even if this is a small change most of our users don't expect the compass to be displayed unless required. If we make this change it will require them to adjust their code.
I have compassAlwaysVisible set to NO by default, so users would not need to change anything.
MapKit is adding this feature in iOS 11 via a separate MKCompassButton, which includes a compassVisibility enum with adaptive, hidden, and visible options. That鈥檚 a nice approach.
In terms of our existing compass setup, I think it鈥檇 be better to add a visibility property on -[MGLMapView.compassView] with similar options.
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
@friedbunny
MGLCompassView class instead of the existing UIImageView for MGLMapView.compassView? Or should we just add a MGLMapView.compassVisibilityadaptive-variant. Translating MKFeatureVisibility to MGLFeatureVisibility is probably not the best as feature is something else? Perhaps MGLVisibility or would that be mixed up with VisibilityType?@chloekraw I changed the title again, as my current intention is to implement adaptive, hidden, and visible options, which is more flexible than a single option to show-the-compass-even-when-it鈥檚-facing-north.
Oh, @friedbunny, I think I had the tab open and changed the title without refreshing the page, so I didn't know that you had already changed it. I meant to override the original title, not yours!
Most helpful comment
MapKit is adding this feature in iOS 11 via a separate
MKCompassButton, which includes acompassVisibilityenum with adaptive, hidden, and visible options. That鈥檚 a nice approach.In terms of our existing compass setup, I think it鈥檇 be better to add a
visibilityproperty on-[MGLMapView.compassView]with similar options.