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

Explore: Add an ornament with convenience methods to launch privacy settings. #384

Open
2 tasks
fabian-guerra opened this issue Aug 20, 2020 · 2 comments
Open
2 tasks
Assignees
Labels

Comments

@fabian-guerra
Copy link
Contributor

Apple Maps integrates into their Navigation Bar an action controller with multiple options to change privacy settings. This is an exploratory ticket to understand how the Maps SDK can implement such functionality.

Apple Maps Nav Bar
IMG_90B09C6B8ABD-1

  • Explore how this can be implemented as an ornament.
  • Define the UI.
@fabian-guerra
Copy link
Contributor Author

This is an exploratory screenshot:

Ornament on top

newornament

Ornament at the bottom

bottom

Adding another ornament starts to overload the screen. It may be possible that we add an icon instead but we will have to educate users about any new visual representation. The difference with the Apple Maps app's screenshot on top is that they utilize the navigation bar to display this control without overloading the screen. As Mapbox supports multiple use cases this is something we may not want to enforce.

However developers can implement [MGLMapViewDelegate mapView:didChangeLocationManagerAuthorization:] delegate with a trivial controller to either direct users to the App's settings or keep precision off.

UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Mapbox GL works best with your precise location."
                                   message:@"You'll get turn-by-turn directions."
                                   preferredStyle:UIAlertControllerStyleAlert];
    
    UIAlertAction *settingsAction = [UIAlertAction actionWithTitle:@"Turn On in Settings" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
    }];

    UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"Keep Precise Location Off" style:UIAlertActionStyleDefault
       handler:nil];
    [alert addAction:settingsAction];
    [alert addAction:defaultAction];
    [self presentViewController:alert animated:YES completion:nil];

@fabian-guerra fabian-guerra self-assigned this Sep 4, 2020
mappy-mobile pushed a commit to Mappy/mapbox-gl-native-ios that referenced this issue Sep 17, 2020
Migrate remaining targets to Swift 5
@julianrex julianrex modified the milestones: v6.2.1, release-a Sep 22, 2020
@knov knov assigned lloydsheng and unassigned fabian-guerra Oct 15, 2020
@lloydsheng
Copy link
Contributor

@knov What does the precise location ornament looks like? Is there a design?
Because of the scalebar may occupy half of the screen width. There may be no enough space to put down a precise location when scalebar and Mapbox logo are placed at the same horizontal position.
image

I suggest putting the button on top of other ornaments at the bottom of the map, or something more appropriate.

image

@knov knov removed this from the release-apfelsaft milestone Nov 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants