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

Unable to set heading or pitch of map view on load #13210

Closed
1ec5 opened this issue Oct 26, 2018 · 1 comment · Fixed by #13212
Closed

Unable to set heading or pitch of map view on load #13210

1ec5 opened this issue Oct 26, 2018 · 1 comment · Fixed by #13212
Assignees
Labels
bug iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS release blocker Blocks the next final release

Comments

@1ec5
Copy link
Contributor

1ec5 commented Oct 26, 2018

When setting the camera within -[MGLMapViewDelegate mapView:didFinishLoadingStyle:] or -[MGLMapViewDelegate mapViewDidFinishLoadingMap:], MGLMapView no longer respects the camera’s heading or pitch. The following code results in a map centered at the correct coordinate and at the correct zoom level, but at a pitch of 0° and a heading just off of 0°:

- (void)mapViewDidFinishLoadingMap:(MGLMapView *)mapView {
    MGLMapCamera *camera = [MGLMapCamera cameraLookingAtCenterCoordinate:CLLocationCoordinate2DMake(39.10279795, -84.5064623336961) acrossDistance:50 pitch:60 heading:45];
    mapView.camera = camera;
}

This issue reproduces in iOS map SDK v4.6.0-alpha.2 and also da2685d on both iOS and macOS, whether or not there’s animation when setting the camera, in both iosapp and the iOS examples project. It does not reproduce in iOS map SDK v4.5.0.

This issue removes the principal workaround for #3859, which is that you can’t set the camera earlier in -[UIViewController viewDidLoad].

/cc @mapbox/maps-ios

@1ec5 1ec5 added bug iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS labels Oct 26, 2018
@1ec5
Copy link
Contributor Author

1ec5 commented Oct 26, 2018

I’m guessing this is fallout from #13123.

@fabian-guerra fabian-guerra added the release blocker Blocks the next final release label Oct 26, 2018
@fabian-guerra fabian-guerra added this to the ios-v4.6.0-h-release milestone Oct 26, 2018
@1ec5 1ec5 self-assigned this Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS release blocker Blocks the next final release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants