Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Show scale control #7432

Closed
wants to merge 2 commits into from
Closed

Conversation

frederoni
Copy link
Contributor

@frederoni frederoni commented Dec 14, 2016

WIP #1278

  • Expose a showsScale property on MGLMapView
  • Show scale while zooming by default
  • Switch units based on regional settings

screenshot 2016-12-14 16 13 12

@frederoni frederoni added the iOS Mapbox Maps SDK for iOS label Dec 14, 2016
@frederoni frederoni self-assigned this Dec 14, 2016
@mention-bot
Copy link

@frederoni, thanks for your PR! By analyzing this pull request, we identified @incanus, @1ec5 and @boundsj to be potential reviewers.

@frederoni frederoni mentioned this pull request Dec 14, 2016
if (!_debugLabel) {
_debugLabel = [[UILabel alloc] init];
_debugLabel.font = [UIFont systemFontOfSize:8];
[self addSubview:_debugLabel];
Copy link
Contributor

Choose a reason for hiding this comment

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

A label means you'd have to manage constraints internal to this view. That may be a good idea, but consider whether it might be easier to override -drawInRect: and use Core Graphics and attributed string drawing methods to accomplish the same effect, since you don't need to worry about line wrapping.

Copy link
Contributor Author

@frederoni frederoni Dec 15, 2016

Choose a reason for hiding this comment

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

I prefer to use -drawInRect: when I want instant rendering instead of default animation between layouts otherwise I prefer -layoutSubviews. Working directly with the views also improves readability but I haven't really decided yet. The logic should be the same so we can switch to Core Graphics if we don't get the expected behavior without much fuss.


- (instancetype)init {
if (self == [super init]) {
_formatter = [[NSLengthFormatter alloc] init];
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use MGLDistanceFormatter once #3331 is implemented. NSLengthFormatter is suboptimal because, when the system is set to U.S. units, it tends to use yards instead of feet or fractional miles, whereas Americans find yards difficult to relate to (except in football).

@frederoni
Copy link
Contributor Author

Closing in favor of #7631

@frederoni frederoni closed this Jan 8, 2017
@friedbunny friedbunny deleted the fred-scale-control-1278 branch February 9, 2017 22:42
@1ec5 1ec5 added GL JS parity For feature parity with Mapbox GL JS MapKit parity For feature parity with MapKit on iOS or macOS labels Feb 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature GL JS parity For feature parity with Mapbox GL JS iOS Mapbox Maps SDK for iOS MapKit parity For feature parity with MapKit on iOS or macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants