Skip to content

Commit ea85603

Browse files
authored
fix: setFollowingPerspective functionality for iOS (#222)
1 parent 7229a65 commit ea85603

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

ios/react-native-navigation-sdk/NavModule.m

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,7 @@ - (BOOL)checkNavigatorWithError:(RCTPromiseRejectBlock)reject navigator:(GMSNavi
7979
}
8080

8181
- (void)initializeSession {
82-
// TODO(jokerttu): init mapviews on navigation initialization
83-
// [_mapView.settings setCompassButton:YES];
84-
// [self setMyLocationEnabled:YES];
85-
// [_mapView.settings setMyLocationButton:YES];
86-
87-
// [_mapView.navigationUIDelegate self];
88-
// _mapView.navigationEnabled = YES;
89-
9082
// Try to create a navigation session.
91-
9283
if (self->_session == nil && self->_session.navigator == nil) {
9384
GMSNavigationSession *session =
9485
[GMSNavigationServices createNavigationSession];
@@ -120,10 +111,6 @@ - (void)initializeSession {
120111
NavViewModule *navViewModule = [NavViewModule sharedInstance];
121112
[navViewModule attachViewsToNavigationSession:_session];
122113

123-
// TODO(jokerttu): init mapviews on navigation initialization
124-
//_mapView.cameraMode = GMSNavigationCameraModeFollowing;
125-
//[_mapView setFollowingPerspective:GMSNavigationCameraPerspectiveTilted];
126-
127114
[self onNavigationReady];
128115
}
129116

ios/react-native-navigation-sdk/NavViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ - (void)setFollowingPerspective:(NSNumber *)index {
282282
} else {
283283
[_mapView setFollowingPerspective:GMSNavigationCameraPerspectiveTilted];
284284
}
285+
_mapView.cameraMode = GMSNavigationCameraModeFollowing;
285286
}
286287

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

306307
- (BOOL)attachToNavigationSession:(GMSNavigationSession *)session {
307-
BOOL navigationWasEnabled = _mapView.isNavigationEnabled;
308308
BOOL result = [_mapView enableNavigationWithSession:session];
309309
_mapView.navigationUIDelegate = self;
310310
return result;

0 commit comments

Comments
 (0)