-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios] Add MGLMapView.showsScale to control scale bar visibility #11335
Conversation
- Fixes scale bar not being visible until a camera change event. - Adds IBInspectable for scale bar visibility.
4efa282
to
a554425
Compare
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.
Thank you for fixing this. It may be necessary that you retarget to release-agua
for it being included in the next path release.
This is what I reviewed.
- Class/methods documentation according to
MGLMapView.showsScale
changes. - Code readability.
- Code doesn't have side effects.
Thanks for the review, @fabian-guerra. These changes would be easy to retarget at I’m not obstinately in that camp, though, so if folks feel like we should put this in the next v3.7.x patch release I can go ahead and retarget this PR. |
Per #11302 (comment), I’m wondering if we aren’t papering over a subtle bug with this change. |
@1ec5 There may be an issue there, but I believe it’s incidental to the problems solved here:
|
068325c
to
b28dbf8
Compare
Added tests to verify that the scale bar is appearing when it should. |
b28dbf8
to
cbb7871
Compare
MGLMapView.showsScale
as the recommended way to show the scale bar.IBInspectable
for scale bar visibility.scaleBar.hidden
below.This isn’t technically breaking — setting
MGLMapView.scaleBar.hidden = NO
will still work, but is no longer the recommended approach.Setting the scale bar view’s
hidden
property at initialization will now properly show that view when the map loads (because of the newupdateScaleBar
call incameraDidChangeAnimated:
), but setting this property later will still cause it not to be visible until a camera event occurs. The newshowsScale
property avoids this issue by callingupdateScaleBar
itself./cc @frederoni @1ec5 @fabian-guerra