Skip to content

Commit

Permalink
fix: setFollowingPerspective functionality for iOS (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
jokerttu authored Aug 6, 2024
1 parent 7229a65 commit ea85603
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 0 additions & 13 deletions ios/react-native-navigation-sdk/NavModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,7 @@ - (BOOL)checkNavigatorWithError:(RCTPromiseRejectBlock)reject navigator:(GMSNavi
}

- (void)initializeSession {
// TODO(jokerttu): init mapviews on navigation initialization
// [_mapView.settings setCompassButton:YES];
// [self setMyLocationEnabled:YES];
// [_mapView.settings setMyLocationButton:YES];

// [_mapView.navigationUIDelegate self];
// _mapView.navigationEnabled = YES;

// Try to create a navigation session.

if (self->_session == nil && self->_session.navigator == nil) {
GMSNavigationSession *session =
[GMSNavigationServices createNavigationSession];
Expand Down Expand Up @@ -120,10 +111,6 @@ - (void)initializeSession {
NavViewModule *navViewModule = [NavViewModule sharedInstance];
[navViewModule attachViewsToNavigationSession:_session];

// TODO(jokerttu): init mapviews on navigation initialization
//_mapView.cameraMode = GMSNavigationCameraModeFollowing;
//[_mapView setFollowingPerspective:GMSNavigationCameraPerspectiveTilted];

[self onNavigationReady];
}

Expand Down
2 changes: 1 addition & 1 deletion ios/react-native-navigation-sdk/NavViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ - (void)setFollowingPerspective:(NSNumber *)index {
} else {
[_mapView setFollowingPerspective:GMSNavigationCameraPerspectiveTilted];
}
_mapView.cameraMode = GMSNavigationCameraModeFollowing;
}

- (void)setSpeedometerEnabled:(BOOL)isEnabled {
Expand All @@ -304,7 +305,6 @@ - (instancetype)initWithSize:(double)height width:(double)width {
}

- (BOOL)attachToNavigationSession:(GMSNavigationSession *)session {
BOOL navigationWasEnabled = _mapView.isNavigationEnabled;
BOOL result = [_mapView enableNavigationWithSession:session];
_mapView.navigationUIDelegate = self;
return result;
Expand Down

0 comments on commit ea85603

Please sign in to comment.